diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-30 08:10:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-30 08:10:48 +0100 |
| commit | 72b41e2f711198ad9baa846e7ba37f6e070cedb0 (patch) | |
| tree | 412e384fb7ad218098d69c52d5d92a2801ec8a8e /src/boot | |
| parent | 951e967388dbf628e9a4b8b6ce4e8a637de91d75 (diff) | |
chore: ddk: Fix build on nebuild for C++ DDK.
chore: kernel: Tweaks and internal improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/BootKit/BootKit.h | 16 | ||||
| -rw-r--r-- | src/boot/amd64-ci.make | 2 | ||||
| -rw-r--r-- | src/boot/amd64-desktop.make | 2 | ||||
| -rw-r--r-- | src/boot/arm64-desktop.make | 2 | ||||
| -rw-r--r-- | src/boot/modules/BootNet/BootNet.cc | 4 | ||||
| -rw-r--r-- | src/boot/src/HEL/AMD64/BootATA.cc | 13 | ||||
| -rw-r--r-- | src/boot/src/HEL/ARM64/BootPlatform.cc | 3 | ||||
| -rw-r--r-- | src/boot/src/New+Delete.cc | 3 |
8 files changed, 25 insertions, 20 deletions
diff --git a/src/boot/BootKit/BootKit.h b/src/boot/BootKit/BootKit.h index 4296ebcb..fa10e6cf 100644 --- a/src/boot/BootKit/BootKit.h +++ b/src/boot/BootKit/BootKit.h @@ -290,16 +290,16 @@ inline Boolean BDiskFormatFactory<BootDev>::Format(const Char* part_name) { CopyMem(gpt_part->Signature, reinterpret_cast<VoidPtr>(const_cast<Char*>(kMagicGPT)), StrLen(kMagicGPT)); - gpt_part->Revision = 0x00010000; + gpt_part->Revision = 0x00010000; gpt_part->HeaderSize = sizeof(GPT_PARTITION_TABLE); gpt_part->CRC32 = 0x00000000; - gpt_part->Reserved1 = 0x00000000; - gpt_part->LBAHeader = 0x00000000; - gpt_part->LBAAltHeader = 0x00000000; + gpt_part->Reserved1 = 0x00000000; + gpt_part->LBAHeader = 0x00000000; + gpt_part->LBAAltHeader = 0x00000000; gpt_part->FirstGPTEntry = 0x00000000; - gpt_part->LastGPTEntry = 0x00000000; + gpt_part->LastGPTEntry = 0x00000000; gpt_part->Guid.Data1 = 0x00000000; gpt_part->Guid.Data2 = 0x0000; @@ -309,10 +309,10 @@ inline Boolean BDiskFormatFactory<BootDev>::Format(const Char* part_name) { gpt_part->Revision = 0x00010000; - gpt_part->StartingLBA = 0x00000000; + gpt_part->StartingLBA = 0x00000000; gpt_part->NumPartitionEntries = 0x00000000; - gpt_part->SizeOfEntries = 0x00000000; - gpt_part->CRC32PartEntry = 0x00000000; + gpt_part->SizeOfEntries = 0x00000000; + gpt_part->CRC32PartEntry = 0x00000000; SetMem(gpt_part->Reserved2, 0, kSectorAlignGPT_PartTbl); diff --git a/src/boot/amd64-ci.make b/src/boot/amd64-ci.make index ec3d1c6c..a6a1399e 100644 --- a/src/boot/amd64-ci.make +++ b/src/boot/amd64-ci.make @@ -67,7 +67,7 @@ REM_FLAG=-f FLAG_ASM=-f win64 FLAG_GNU=-fshort-wchar -Wall -Wpedantic -Wextra -Werror -D__EFI_x86_64__ -mno-red-zone -D__NEKERNEL__ -D__BOOTZ__ \ -DEFI_FUNCTION_WRAPPER -I./ -I../kernel $(DEBUG_MACRO) $(DISK_DRV) -I../ -c -nostdlib -fno-rtti -fno-exceptions \ - -std=c++20 -DBOOTZ_GPT_SUPPORT -DBOOTZ_EPM_SUPPORT -D__HAVE_NE_APIS__ -DZBA_USE_FB -D__NE_AMD64__ -D__NE__ -DNE_AUTO_FORMAT + -std=c++20 -DBOOTZ_GPT_SUPPORT -DBOOTZ_EPM_SUPPORT -D__HAVE_NE_API__ -DZBA_USE_FB -D__NE_AMD64__ -D__NE__ -DNE_AUTO_FORMAT BOOTLOADER=ne_bootz KERNEL=ne_kernel diff --git a/src/boot/amd64-desktop.make b/src/boot/amd64-desktop.make index d1043d56..0c230f62 100644 --- a/src/boot/amd64-desktop.make +++ b/src/boot/amd64-desktop.make @@ -69,7 +69,7 @@ REM_FLAG=-f FLAG_ASM=-f win64 FLAG_GNU=-fshort-wchar -D__EFI_x86_64__ -D__nekernel_allow_non_nekernel_pe -Wall -Wpedantic -Wextra -mno-red-zone -D__NEKERNEL__ -D__BOOTZ__ -DBOOTZ_VEPM_SUPPORT \ -DEFI_FUNCTION_WRAPPER -I./ -I../kernel $(DISK_DRV) -I../ -c -nostdlib -fno-rtti -fno-exceptions \ - -std=c++20 -DBOOTZ_GPT_SUPPORT -D__HAVE_NE_APIS__ -DZBA_USE_FB -D__NE_AMD64__ -D__NE__ -DNE_AUTO_FORMAT -Wl,--disable-reloc-section + -std=c++20 -DBOOTZ_GPT_SUPPORT -D__HAVE_NE_API__ -DZBA_USE_FB -D__NE_AMD64__ -D__NE__ -DNE_AUTO_FORMAT -Wl,--disable-reloc-section BOOTLOADER=ne_bootz KERNEL=ne_kernel diff --git a/src/boot/arm64-desktop.make b/src/boot/arm64-desktop.make index d908daea..3a418a14 100644 --- a/src/boot/arm64-desktop.make +++ b/src/boot/arm64-desktop.make @@ -45,7 +45,7 @@ REM_FLAG=-f FLAG_ASM=-f win64 FLAG_GNU=-fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ -target aarch64-unknown-windows \ - -std=c++20 -DBOOTZ_EPM_SUPPORT -D__nekernel_allow_non_nekernel_pe -DZBA_USE_FB -D__FSKIT_USE_NEFS__ -D__BOOTZ_STANDALONE__ -D__NEKERNEL__ -D__BOOTZ__ -D__HAVE_NE_APIS__ -D__NE__ -I../ -I../kernel + -std=c++20 -DBOOTZ_EPM_SUPPORT -D__nekernel_allow_non_nekernel_pe -DZBA_USE_FB -D__FSKIT_USE_NEFS__ -D__BOOTZ_STANDALONE__ -D__NEKERNEL__ -D__BOOTZ__ -D__HAVE_NE_API__ -D__NE__ -I../ -I../kernel BOOT_LOADER=ne_bootz KERNEL=ne_kernel diff --git a/src/boot/modules/BootNet/BootNet.cc b/src/boot/modules/BootNet/BootNet.cc index 8b0112c5..4a08cb51 100644 --- a/src/boot/modules/BootNet/BootNet.cc +++ b/src/boot/modules/BootNet/BootNet.cc @@ -7,8 +7,8 @@ #include <FirmwareKit/EFI/API.h> #include <modules/BootNet/BootNet.h> -STATIC EFI_GUID kEfiSimpleProtoGUID = EFI_SIMPLE_NETWORK_PROTOCOL_GUID; -STATIC EFI_SIMPLE_NETWORK_PROTOCOL* kEfiProtocol = nullptr; +STATIC EFI_GUID kEfiSimpleProtoGUID = EFI_SIMPLE_NETWORK_PROTOCOL_GUID; +STATIC EFI_SIMPLE_NETWORK_PROTOCOL* kEfiProtocol = nullptr; STATIC Void bootnet_read_ip_packet(BOOTNET_INTERNET_HEADER inet, BOOTNET_INTERNET_HEADER** inet_out); diff --git a/src/boot/src/HEL/AMD64/BootATA.cc b/src/boot/src/HEL/AMD64/BootATA.cc index 423f4437..3826ea41 100644 --- a/src/boot/src/HEL/AMD64/BootATA.cc +++ b/src/boot/src/HEL/AMD64/BootATA.cc @@ -75,7 +75,8 @@ ATAInit_Retry: /// fetch serial info /// model, speed, number of sectors... - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT indexData = 0ul; indexData < kATADataLen; ++indexData) { kATAData[indexData] = rt_in16(IO + ATA_REG_DATA); @@ -101,14 +102,15 @@ Void boot_ata_read(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeASCII* Buf, rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT IndexOff = 0; IndexOff < Size; IndexOff += 2) { boot_ata_wait_io(IO); @@ -134,14 +136,15 @@ Void boot_ata_write(UInt64 Lba, UInt16 IO, UInt8 Master, CharacterTypeASCII* Buf rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz)) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT IndexOff = 0; IndexOff < Size; IndexOff += 2) { boot_ata_wait_io(IO); diff --git a/src/boot/src/HEL/ARM64/BootPlatform.cc b/src/boot/src/HEL/ARM64/BootPlatform.cc index 8e45fa60..612fe62c 100644 --- a/src/boot/src/HEL/ARM64/BootPlatform.cc +++ b/src/boot/src/HEL/ARM64/BootPlatform.cc @@ -11,7 +11,8 @@ using namespace Boot; EXTERN_C void rt_halt() { - while (Yes); + while (Yes) + ; } EXTERN_C void rt_cli() {} diff --git a/src/boot/src/New+Delete.cc b/src/boot/src/New+Delete.cc index 20965cbe..99a31166 100644 --- a/src/boot/src/New+Delete.cc +++ b/src/boot/src/New+Delete.cc @@ -15,7 +15,8 @@ void* operator new(size_t sz) { void* buf = nullptr; - while (BS->AllocatePool(EfiMemoryType::EfiLoaderData, sz, &buf) != kEfiOk); + while (BS->AllocatePool(EfiMemoryType::EfiLoaderData, sz, &buf) != kEfiOk) + ; return buf; } |
