diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-09 19:55:54 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-09 19:56:35 +0200 |
| commit | 1c217ed09c6c4b13ec09b897270a208439f0db55 (patch) | |
| tree | 43c93aef6ee233fafcd7ca07a5700dd76d5ecdf5 /Boot/BootKit | |
| parent | acd8297fe927e601a7173cec7ca5445fd4a9c74a (diff) | |
[FIX] Fix bootloop on serial write, fixing more bugs now, still have to
fix allocation.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Boot/BootKit')
| -rw-r--r-- | Boot/BootKit/BootKit.hxx | 13 | ||||
| -rw-r--r-- | Boot/BootKit/Rsrc/NewBoot.rsrc | 4 | ||||
| -rw-r--r-- | Boot/BootKit/Rsrc/NewBootFatal.rsrc | 4 |
3 files changed, 7 insertions, 14 deletions
diff --git a/Boot/BootKit/BootKit.hxx b/Boot/BootKit/BootKit.hxx index 680c9863..f716890a 100644 --- a/Boot/BootKit/BootKit.hxx +++ b/Boot/BootKit/BootKit.hxx @@ -243,11 +243,11 @@ public: blockPart->SectorSize != BootDev::kSectorSize || blockPart->Version != kNewFSVersionInteger) { - EFI::ThrowError(L"Invalid-Disk-Geometry", L"Invalid disk."); + return false; } else if (blockPart->PartitionName[0] == 0) { - EFI::ThrowError(L"Invalid-Partition-Name", L"Invalid disk partition."); + return false; } writer.Write(L"newosldr: partition name: ").Write(blockPart->PartitionName).Write(L" is healthy.\r"); @@ -281,19 +281,12 @@ private: catalogKind->Kind = blob->fKind; catalogKind->Flags = kNewFSFlagCreated; - /// before going to forks, we must check for the catalog name first. - if (blob->fKind == kNewFSCatalogKindDir && - blob->fFileName[strlen(blob->fFileName) - 1] != kNewFSSeparator) - { - EFI::ThrowError(L"Developer-Error", L"This is caused by the developer of the bootloader."); - } - --partBlock.FreeCatalog; --partBlock.FreeSectors; writer.Write(L"newosldr: root directory: ").Write(blob->fFileName).Write(L"\r"); - memcpy(catalogKind->Name, blob->fFileName, strlen(blob->fFileName)); + CopyMem(catalogKind->Name, blob->fFileName, StrLen(blob->fFileName)); fDiskDev.Leak().mBase = startLba; fDiskDev.Leak().mSize = sizeof(NFS_CATALOG_STRUCT); diff --git a/Boot/BootKit/Rsrc/NewBoot.rsrc b/Boot/BootKit/Rsrc/NewBoot.rsrc index 15da3029..68b6cba1 100644 --- a/Boot/BootKit/Rsrc/NewBoot.rsrc +++ b/Boot/BootKit/Rsrc/NewBoot.rsrc @@ -1,5 +1,5 @@ -#define NEWBOOT_HEIGHT 239 -#define NEWBOOT_WIDTH 402 +#define NEWOSLDR_HEIGHT 239 +#define NEWOSLDR_WIDTH 402 // array size is 288234 static const unsigned int NewBoot[] = { diff --git a/Boot/BootKit/Rsrc/NewBootFatal.rsrc b/Boot/BootKit/Rsrc/NewBootFatal.rsrc index bad1ccd1..7422c8ec 100644 --- a/Boot/BootKit/Rsrc/NewBootFatal.rsrc +++ b/Boot/BootKit/Rsrc/NewBootFatal.rsrc @@ -1,5 +1,5 @@ -#define NEWBOOTFATAL_HEIGHT 239 -#define NEWBOOTFATAL_WIDTH 402 +#define NEWOSLDRFATAL_HEIGHT 239 +#define NEWOSLDRFATAL_WIDTH 402 // array size is 288234 static const unsigned int NewBootFatal[] = { |
