diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-06 14:52:33 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-04-06 14:52:33 +0200 |
| commit | 32f75625830660468287de0f213baee760fc6384 (patch) | |
| tree | aaa8286ee13a4188d826d4efd59482c7b1aa0e73 /Private/NewBoot | |
| parent | 422b8029eba71b6fbb6b3dcb386b8e115bbd08ef (diff) | |
:boom: Breaking changes, disk API improvemenets and bringing support for
more drivers...
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Private/NewBoot')
| -rw-r--r-- | Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx | 17 | ||||
| -rw-r--r-- | Private/NewBoot/Source/HEL/PowerPC/BootEPM.cxx | 7 |
2 files changed, 12 insertions, 12 deletions
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx b/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx index 133429c5..0d678dc1 100644 --- a/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx +++ b/Private/NewBoot/Source/HEL/AMD64/BootEPM.cxx @@ -7,8 +7,9 @@ #include <BootKit/BootKit.hxx> #include <FSKit/NewFS.hxx> +#define kEPMSectorSize kATASectorSize #define kEPMSwapSize MIB(16) -#define kEPMGPTStartLba 30 +#define kEPMGPTStartLba (30) // {310E1FC7-2060-425D-BE7B-75A37CC679BC} STATIC const BlockGUID kEPMGuid = { @@ -28,19 +29,19 @@ EXTERN_C Boolean boot_write_epm_partition(const Char* namePart, SizeT namePartLe if (!bootDev) return No; bootDev->Leak().mBase = kEPMGPTStartLba; - bootDev->Leak().mSize = kATASectorSize; + bootDev->Leak().mSize = kEPMSectorSize; - Char buf[kATASectorSize] = {0}; + Char buf[kEPMSectorSize] = {0}; bootDev->Read(buf, 1); BTextWriter writer; - writer.Write(L"NewOS: Checking for a NewFS partition...\r\n"); + writer.Write(L"NewOS: Checking for a EPM partition...\r\n"); for (SizeT index = 0; index < kEPMMagicLength; ++index) { if (buf[index] != kEPMMagic[index]) { - writer.Write(L"NewOS: Writing a NewFS partition...\r\n"); + writer.Write(L"NewOS: Writing a EPM partition...\r\n"); BootBlockType* bootBlock = (BootBlockType*)buf; @@ -58,7 +59,7 @@ EXTERN_C Boolean boot_write_epm_partition(const Char* namePart, SizeT namePartLe bootBlock->LbaStart = sizeof(BootBlockType) + (sizeof(PartitionBlockType) * kEPMMaxBlks); - bootBlock->SectorSz = kATASectorSize; + bootBlock->SectorSz = kEPMSectorSize; bootBlock->Uuid = kEPMGuid; @@ -80,7 +81,7 @@ EXTERN_C Boolean boot_write_epm_partition(const Char* namePart, SizeT namePartLe partBlock->Name[i] = partNameSystem[i]; } - partBlock->SectorSz = kATASectorSize; + partBlock->SectorSz = kEPMSectorSize; partBlock->LbaStart = kEPMStartPartitionBlk + kEPMSwapSize; partBlock->Version = kNewFSVersionInteger; partBlock->Kind = kNewFSPartitionTypeStandard; @@ -101,7 +102,7 @@ EXTERN_C Boolean boot_write_epm_partition(const Char* namePart, SizeT namePartLe swapBlock->Name[i] = partNameSwap[i]; } - swapBlock->SectorSz = kATASectorSize; + swapBlock->SectorSz = kEPMSectorSize; swapBlock->LbaStart = kEPMStartPartitionBlk; swapBlock->Version = kNewFSVersionInteger; swapBlock->Kind = kNewFSPartitionTypePage; diff --git a/Private/NewBoot/Source/HEL/PowerPC/BootEPM.cxx b/Private/NewBoot/Source/HEL/PowerPC/BootEPM.cxx index 2e35b0dc..f088d73c 100644 --- a/Private/NewBoot/Source/HEL/PowerPC/BootEPM.cxx +++ b/Private/NewBoot/Source/HEL/PowerPC/BootEPM.cxx @@ -7,8 +7,7 @@ #include <BootKit/BootKit.hxx> #include <FSKit/NewFS.hxx> -#define kEPMSectorSize 1024 - +#define kEPMSectorSize (1024U) #define kEPMSwapSize MIB(16) // {310E1FC7-2060-425D-BE7B-75A37CC679BC} @@ -37,11 +36,11 @@ EXTERN_C Boolean boot_write_epm_partition(const Char* namePart, SizeT namePartLe BTextWriter writer; - writer.Write(L"NewOS: Checking for a NewFS partition...\r\n"); + writer.Write(L"NewOS: Checking for a EPM partition...\r\n"); for (SizeT index = 0; index < kEPMMagicLength; ++index) { if (buf[index] != kEPMMagic[index]) { - writer.Write(L"NewOS: Writing a NewFS partition...\r\n"); + writer.Write(L"NewOS: Writing a EPM partition...\r\n"); BootBlockType* bootBlock = (BootBlockType*)buf; |
