From fdb8b146b2dd9d21bdc966e180632ba489accd6f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 31 Dec 2025 12:48:54 +0100 Subject: feat: pre-release improvements and harderning. Signed-off-by: Amlal El Mahrouss --- CLAUDE.md | 6 +-- doc/specs/SPECIFICATION_FWRK.md | 8 ++-- scripts/debug_ahci_arm64.sh | 2 +- scripts/debug_ahci_x64.sh | 2 +- scripts/debug_ata_x64.sh | 2 +- scripts/release_ahci_x64.sh | 2 +- scripts/release_ata_x64.sh | 2 +- src/boot/modules/BootNet/amd64.json | 1 + src/boot/modules/SysChk/SysChk.cc | 4 +- src/boot/modules/SysChk/amd64-ahci-epm.json | 1 + src/boot/modules/SysChk/amd64-ahci-gpt.json | 1 + src/boot/modules/SysChk/amd64-pio-epm.json | 1 + src/boot/modules/SysChk/amd64-pio-gpt.json | 1 + src/boot/src/HEL/AMD64/BootEFI.cc | 53 +++++++++++++------------ src/boot/src/HEL/ARM64/BootEFI.cc | 32 +-------------- src/kernel/FirmwareKit/Handover.h | 1 - src/kernel/HALKit/AMD64/HalKernelMain.cc | 4 +- src/kernel/HALKit/AMD64/Processor.h | 2 +- src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc | 2 +- src/kernel/NeKit/ErrorOr.h | 2 +- src/kernel/NeKit/Pmm.h | 2 +- src/kernel/NetworkKit/IPC.h | 10 ++--- src/kernel/amd64-ci.make | 2 +- src/kernel/src/BitMapMgr.cc | 10 ----- src/kernel/src/FS/OpenHeFS+FileMgr.cc | 2 +- src/kernel/src/FS/OpenHeFS+FileSystemParser.cc | 2 +- src/kernel/src/HeapMgr.cc | 4 +- src/kernel/src/Network/IPCMessage.cc | 4 +- tools/kfwrk.py | 2 +- tools/kimg.py | 2 +- tools/kman.py | 2 +- tools/mkapp.py | 2 +- 32 files changed, 68 insertions(+), 105 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 71651fb4..29a5fdcf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -258,9 +258,9 @@ Located in `tools/` and `public/tools/`: - **mkfs.hefs.cc** - Create HeFS filesystems - **chk.hefs.cc** - Check/repair HeFS filesystems -- **mk_img.py** - Create disk images -- **mk_fwrk.py** - Package frameworks (.fwrk) -- **mk_app.py** - Package applications (.app) +- **kimg.py** - Create disk images +- **mkfwrk.py** - Package frameworks (.fwrk) +- **mkapp.py** - Package applications (.app) ## Debugging diff --git a/doc/specs/SPECIFICATION_FWRK.md b/doc/specs/SPECIFICATION_FWRK.md index 8d95abc7..e7366987 100644 --- a/doc/specs/SPECIFICATION_FWRK.md +++ b/doc/specs/SPECIFICATION_FWRK.md @@ -166,7 +166,7 @@ Contains XML-based property list files for framework metadata. Auto-generated directory containing compiled framework binaries. - **Output file**: `lib.fwrk.dylib` -- Created during build process via `mk_fwrk.py` +- Created during build process via `mkfwrk.py` - Not committed to version control ## Built-in Frameworks @@ -193,12 +193,12 @@ The NeKernel project includes the following standard frameworks: ## Framework Creation -### Using mk_fwrk.py +### Using mkfwrk.py -The `mk_fwrk.py` tool automates framework creation: +The `mkfwrk.py` tool automates framework creation: ```bash -python3 tools/mk_fwrk.py +python3 tools/mkfwrk.py ``` This generates: diff --git a/scripts/debug_ahci_arm64.sh b/scripts/debug_ahci_arm64.sh index 37c5e3ba..bdc210ea 100755 --- a/scripts/debug_ahci_arm64.sh +++ b/scripts/debug_ahci_arm64.sh @@ -11,6 +11,6 @@ cd ../boot make -f arm64-desktop.make all make -f arm64-desktop.make disk cd ../../ -./tools/mk_img.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root +./tools/kimg.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root cd src/boot make -f arm64-desktop.make -j 8 run-efi-arm64 diff --git a/scripts/debug_ahci_x64.sh b/scripts/debug_ahci_x64.sh index 6c829d1e..014100be 100755 --- a/scripts/debug_ahci_x64.sh +++ b/scripts/debug_ahci_x64.sh @@ -11,6 +11,6 @@ cd ../boot make -f amd64-desktop.make all make -f amd64-desktop.make disk cd ../../ -./tools/mk_img.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root +./tools/kimg.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root cd src/boot make -f amd64-desktop.make -j 8 run-efi-amd64-ahci \ No newline at end of file diff --git a/scripts/debug_ata_x64.sh b/scripts/debug_ata_x64.sh index 920e96ea..04c1321f 100755 --- a/scripts/debug_ata_x64.sh +++ b/scripts/debug_ata_x64.sh @@ -11,6 +11,6 @@ cd ../boot make -f amd64-desktop.make all make -f amd64-desktop.make disk cd ../../ -./tools/mk_img.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root +./tools/kimg.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root cd src/boot make -f amd64-desktop.make -j 8 run-efi-amd64-ata-pio diff --git a/scripts/release_ahci_x64.sh b/scripts/release_ahci_x64.sh index 7106586c..73815787 100755 --- a/scripts/release_ahci_x64.sh +++ b/scripts/release_ahci_x64.sh @@ -8,6 +8,6 @@ cd ../boot make -f amd64-desktop.make all make -f amd64-desktop.make disk cd ../../ -./tools/mk_img.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root +./tools/kimg.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root cd src/boot make -f amd64-desktop.make -j 8 run-efi-amd64-ahci \ No newline at end of file diff --git a/scripts/release_ata_x64.sh b/scripts/release_ata_x64.sh index d1d84476..6a5fc35d 100755 --- a/scripts/release_ata_x64.sh +++ b/scripts/release_ata_x64.sh @@ -8,6 +8,6 @@ cd ../boot make -f amd64-desktop.make all make -f amd64-desktop.make disk cd ../../ -./tools/mk_img.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root +./tools/kimg.py ./src/boot/src/nekernel-esp.img ./src/boot/src/root cd src/boot make -f amd64-desktop.make -j 8 run-efi-amd64-ata-pio \ No newline at end of file diff --git a/src/boot/modules/BootNet/amd64.json b/src/boot/modules/BootNet/amd64.json index c0037580..5cbefe3d 100644 --- a/src/boot/modules/BootNet/amd64.json +++ b/src/boot/modules/BootNet/amd64.json @@ -27,6 +27,7 @@ "__BOOTZ__", "__BOOTZ_STANDALONE__", "__NE_AMD64__", + "__nekernel_max_cores=8 ", "kBootNetVersionHighest=0x0100", "kBootNetVersionLowest=0x0100", "kBootNetEFIVersion=0x0100" diff --git a/src/boot/modules/SysChk/SysChk.cc b/src/boot/modules/SysChk/SysChk.cc index baedf3e8..ebc2be68 100644 --- a/src/boot/modules/SysChk/SysChk.cc +++ b/src/boot/modules/SysChk/SysChk.cc @@ -25,9 +25,9 @@ EXTERN_C Int32 SysChkModuleMain(Kernel::HEL::BootInfoHeader* handover) { fw_init_efi((EfiSystemTable*) handover->f_FirmwareCustomTables[Kernel::HEL::kHandoverTableST]); #if defined(__ATA_PIO__) - Boot::BDiskFormatFactory partition_factory; + Boot::BDiskFormatFactory partition_factory; #elif defined(__AHCI__) - Boot::BDiskFormatFactory partition_factory; + Boot::BDiskFormatFactory partition_factory; #endif if (partition_factory.IsPartitionValid()) return kEfiOk; diff --git a/src/boot/modules/SysChk/amd64-ahci-epm.json b/src/boot/modules/SysChk/amd64-ahci-epm.json index 8ce9bfd8..48da0f86 100644 --- a/src/boot/modules/SysChk/amd64-ahci-epm.json +++ b/src/boot/modules/SysChk/amd64-ahci-epm.json @@ -33,6 +33,7 @@ "__AHCI__", "__SYSCHK__", "BOOTZ_EPM_SUPPORT", + "__nekernel_max_cores=8 ", "__NE_VEPM__", "__NE_MODULAR_KERNEL_COMPONENTS__", "kChkVersionHighest=0x0100", diff --git a/src/boot/modules/SysChk/amd64-ahci-gpt.json b/src/boot/modules/SysChk/amd64-ahci-gpt.json index 80bb433e..91ab6291 100644 --- a/src/boot/modules/SysChk/amd64-ahci-gpt.json +++ b/src/boot/modules/SysChk/amd64-ahci-gpt.json @@ -30,6 +30,7 @@ "__NEOSKRNL__", "__NE_AMD64__", "__AHCI__", + "__nekernel_max_cores=8 ", "__SYSCHK__", "BOOTZ_GPT_SUPPORT", "__NE_MODULAR_KERNEL_COMPONENTS__", diff --git a/src/boot/modules/SysChk/amd64-pio-epm.json b/src/boot/modules/SysChk/amd64-pio-epm.json index b1b95d8d..c7276d4e 100644 --- a/src/boot/modules/SysChk/amd64-pio-epm.json +++ b/src/boot/modules/SysChk/amd64-pio-epm.json @@ -31,6 +31,7 @@ "__BOOTZ__", "__BOOTZ_STANDALONE__", "__NE_AMD64__", + "__nekernel_max_cores=8 ", "__ATA_PIO__", "BOOTZ_EPM_SUPPORT", "__NE_VEPM__", diff --git a/src/boot/modules/SysChk/amd64-pio-gpt.json b/src/boot/modules/SysChk/amd64-pio-gpt.json index b1a4d38b..88dae9be 100644 --- a/src/boot/modules/SysChk/amd64-pio-gpt.json +++ b/src/boot/modules/SysChk/amd64-pio-gpt.json @@ -33,6 +33,7 @@ "__NE_AMD64__", "__ATA_PIO__", "__NE_VEPM__", + "__nekernel_max_cores=8 ", "BOOTZ_GPT_SUPPORT", "kChkVersionHighest=0x0100", "kChkVersionLowest=0x0100", diff --git a/src/boot/src/HEL/AMD64/BootEFI.cc b/src/boot/src/HEL/AMD64/BootEFI.cc index 59b0d239..d275a13d 100644 --- a/src/boot/src/HEL/AMD64/BootEFI.cc +++ b/src/boot/src/HEL/AMD64/BootEFI.cc @@ -36,7 +36,7 @@ STATIC Bool boot_init_fb() { if (BS->LocateProtocol(&kGopGuid, nullptr, (VoidPtr*) &kGop) != kEfiOk) return No; - // AMLALE: Ok that ain't great, open to fixes. + // TODO: Ok that ain't great, open to fixes. kGopStride = 4; return Yes; @@ -124,38 +124,41 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa // Fill handover header now. - handover_hdr->f_BitMapStart = nullptr; /* Start of bitmap. */ - handover_hdr->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap in bytes. */ + handover_hdr->f_BitMapStart = nullptr; /* Start of bitmap. */ + handover_hdr->f_BitMapSize = 0UL; /* Size of bitmap in bytes. */ - kHandoverHeader->f_BitMapStart = nullptr; /* Start of bitmap. */ - kHandoverHeader->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap in bytes. */ + kHandoverHeader->f_BitMapStart = nullptr; /* Start of bitmap. */ + kHandoverHeader->f_BitMapSize = 0UL; /* Size of bitmap in bytes. */ - // open to patches. - UInt16 trials = 15; - - while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize, - &kHandoverHeader->f_BitMapStart) != kEfiOk) { - --trials; - - if (trials) { - writer.Write("BootZ: Unable to allocate sufficient memory, trying again...\r"); + // Get memory map to determine available memory for bitmap allocation. + BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); - if (kHandoverHeader->f_BitMapSize > 0) - kHandoverHeader->f_BitMapSize = - kHandoverHeader->f_BitMapSize / 2; /* Size of bitmap in bytes. */ + // Allocate space for the memory descriptors. + BS->AllocatePool(EfiLoaderData, size_struct_ptr, (VoidPtr*) &struct_ptr); + BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); - while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize, - &kHandoverHeader->f_BitMapStart) != kEfiOk) { - --trials; + // Calculate initial bitmap size by summing all free memory pages. + UInt64 free_pages = 0; + VoidPtr first_free_page = nullptr; - if (!trials) { - writer.Write("BootZ: Unable to allocate sufficient memory, aborting...\r"); - Boot::Stop(); - } + for (UInt32 i = 0; i < size_struct_ptr / sz_desc; ++i) { + EfiMemoryDescriptor* desc = (EfiMemoryDescriptor*) ((UInt8*) struct_ptr + (i * sz_desc)); + if (desc->Kind == EfiConventionalMemory) { + if (first_free_page == nullptr) { + first_free_page = (VoidPtr) desc->PhysicalStart; } + free_pages += desc->NumberOfPages; } } + // Set bitmap to use the first free page region found. + kHandoverHeader->f_BitMapStart = first_free_page; + handover_hdr->f_BitMapStart = first_free_page; + + // Convert pages to bytes (assuming 4K pages) for bitmap size. + kHandoverHeader->f_BitMapSize = free_pages * 4096; + handover_hdr->f_BitMapSize = free_pages * 4096; + handover_hdr->f_FirmwareCustomTables[Kernel::HEL::kHandoverTableBS] = (VoidPtr) BS; handover_hdr->f_FirmwareCustomTables[Kernel::HEL::kHandoverTableST] = (VoidPtr) ST; @@ -175,8 +178,6 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa syschk_thread->Start(handover_hdr, NO); } - BS->GetMemoryMap(&size_struct_ptr, struct_ptr, &map_key, &sz_desc, &rev_desc); - handover_hdr->f_FirmwareVendorLen = Boot::BStrLen(sys_table->FirmwareVendor); handover_hdr->f_Magic = kHandoverMagic; diff --git a/src/boot/src/HEL/ARM64/BootEFI.cc b/src/boot/src/HEL/ARM64/BootEFI.cc index a393e841..6322d311 100644 --- a/src/boot/src/HEL/ARM64/BootEFI.cc +++ b/src/boot/src/HEL/ARM64/BootEFI.cc @@ -120,39 +120,9 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa } //-------------------------------------------------------------// - // Allocate heap. + // TODO: Allocate heap. //-------------------------------------------------------------// - Boot::BootTextWriter writer; - - kHandoverHeader->f_BitMapStart = nullptr; /* Start of bitmap. */ - kHandoverHeader->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap in bytes. */ - - UInt16 trials = 15; - - while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize, - &kHandoverHeader->f_BitMapStart) != kEfiOk) { - --trials; - - if (trials) { - writer.Write("BootZ: Unable to allocate sufficient memory, trying again...\r"); - - if (kHandoverHeader->f_BitMapSize > 0) - kHandoverHeader->f_BitMapSize = - kHandoverHeader->f_BitMapSize / 2; /* Size of bitmap in bytes. */ - - while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize, - &kHandoverHeader->f_BitMapStart) != kEfiOk) { - --trials; - - if (!trials) { - writer.Write("BootZ: Unable to allocate sufficient memory, aborting...\r"); - Boot::Stop(); - } - } - } - } - // ------------------------------------------ // // null these fields, to avoid being reused later. // ------------------------------------------ // diff --git a/src/kernel/FirmwareKit/Handover.h b/src/kernel/FirmwareKit/Handover.h index 06e99c83..4128db2c 100644 --- a/src/kernel/FirmwareKit/Handover.h +++ b/src/kernel/FirmwareKit/Handover.h @@ -12,7 +12,6 @@ #define kHandoverVersion (0x0117) /* Initial bitmap pointer location and size. */ -#define kHandoverBitMapSz (gib_cast(4)) #define kHandoverStructSz sizeof(HEL::BootInfoHeader) namespace Kernel::HEL { diff --git a/src/kernel/HALKit/AMD64/HalKernelMain.cc b/src/kernel/HALKit/AMD64/HalKernelMain.cc index 4cf7d608..e54c0d84 100644 --- a/src/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/src/kernel/HALKit/AMD64/HalKernelMain.cc @@ -142,10 +142,10 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) { UserProcessScheduler::The().SwitchTeam(kRTUserTeam); - // AMLALE: TODO: Prosan, Process sanitizer. + // TODO: Prosan, Process sanitizer. rtl_create_user_process([]() -> void { while (YES); }, "ProSan"); - // AMLALE: TODO, Vet sanitizer. + //TODO: Vet sanitizer. rtl_create_user_process([]() -> void { while (YES); }, "VetSan"); HAL::mp_init_cores(kHandoverHeader->f_HardwareTables.f_VendorPtr); diff --git a/src/kernel/HALKit/AMD64/Processor.h b/src/kernel/HALKit/AMD64/Processor.h index 7501ec63..8bd7b226 100644 --- a/src/kernel/HALKit/AMD64/Processor.h +++ b/src/kernel/HALKit/AMD64/Processor.h @@ -270,7 +270,7 @@ EXTERN_C ATTRIBUTE(naked) Kernel::Void hal_load_idt(Kernel::HAL::Register64 ptr) EXTERN_C ATTRIBUTE(naked) Kernel::Void hal_load_gdt(Kernel::HAL::Register64 ptr); inline Kernel::VoidPtr kKernelBitMpStart = nullptr; -inline Kernel::UIntPtr kKernelBitMpSize = 0UL; +inline Kernel::SizeT kKernelBitMpSize = 0UL; #endif // __NE_AMD64__ */ diff --git a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 28969475..456b6a2a 100644 --- a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -384,7 +384,7 @@ STATIC Bool drv_init_command_structures_ahci() { /// @param atapi reference value, tells whether we should detect ATAPI instead of SATA. /// @return if the disk was successfully initialized or not. STATIC Bool drv_std_init_ahci(UInt16& pi, BOOL& atapi) { - /// AMLALE: TODO: Iterator is good enough, but we need to expand it. + /// TODO: Iterator is good enough, but we need to expand it. PCI::Iterator iterator(Types::PciDeviceKind::MassStorageController, 0x00); for (SizeT device_index = 0; device_index < NE_BUS_COUNT; ++device_index) { diff --git a/src/kernel/NeKit/ErrorOr.h b/src/kernel/NeKit/ErrorOr.h index b471e33e..87031b75 100644 --- a/src/kernel/NeKit/ErrorOr.h +++ b/src/kernel/NeKit/ErrorOr.h @@ -24,7 +24,7 @@ class ErrorOr final { using TypePtr = T*; explicit ErrorOr(ErrorT err) : mRef((T*) RTL_ALLOCA(sizeof(T))), mId(err) { - // AMLALE: Invalidate the value of mRef to make computational evaluations false. + // TODO: Invalidate the value of mRef to make computational evaluations false. mRef = nullptr; } diff --git a/src/kernel/NeKit/Pmm.h b/src/kernel/NeKit/Pmm.h index 894e28c9..35357e60 100644 --- a/src/kernel/NeKit/Pmm.h +++ b/src/kernel/NeKit/Pmm.h @@ -13,7 +13,7 @@ namespace Kernel { class Pmm; class PTEWrapper; -// AMLALE: A PMM stands for Page Memory Manager. Which guarantees page retrieval and free. +// TODO: A PMM stands for Page Memory Manager. Which guarantees page retrieval and free. class Pmm final { public: explicit Pmm(); diff --git a/src/kernel/NetworkKit/IPC.h b/src/kernel/NetworkKit/IPC.h index 0d42de31..27f39079 100644 --- a/src/kernel/NetworkKit/IPC.h +++ b/src/kernel/NetworkKit/IPC.h @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/nekernel-org/nekernel -#ifndef INC_IPC_H -#define INC_IPC_H +#ifndef NETWORKKIT_IPC_H +#define NETWORKKIT_IPC_H #include #include @@ -47,8 +47,6 @@ enum { kIPCMixedEndian = 2, }; -constexpr inline auto kIPCMsgSize = 6094U; - enum { kIPCLockInvalid = 0, kIPCLockFree = 1, @@ -65,8 +63,8 @@ typedef struct IPC_MSG final { UInt32 IpcCRC32; UInt32 IpcMsg; UInt32 IpcMsgSz; - UInt8 IpcData[kIPCMsgSize]; UInt32 IpcLock; + UInt8* IpcData; /// @brief Passes the message to target, could be anything, HTTP packet, JSON or whatever. static Bool Pass(IPC_MSG* self, IPC_MSG* target); } PACKED ALIGN(8) IPC_MSG; @@ -82,4 +80,4 @@ BOOL ipc_sanitize_packet(_Input IPC_MSG* pckt_in); BOOL ipc_construct_packet(_Output _Input IPC_MSG** pckt_in); } // namespace Kernel -#endif // INC_IPC_H +#endif // NETWORKKIT_IPC_H diff --git a/src/kernel/amd64-ci.make b/src/kernel/amd64-ci.make index 203d0dc9..ad0e96b3 100644 --- a/src/kernel/amd64-ci.make +++ b/src/kernel/amd64-ci.make @@ -5,7 +5,7 @@ CXX = x86_64-w64-mingw32-g++ LD = x86_64-w64-mingw32-ld -CCFLAGS = -fshort-wchar -c -D__NE_AMD64__ -D__NEOSKRNL__ -D__NE_VEPM__ -Werror -Wall -Wpedantic -Wextra -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__NE_SUPPORT_NX__ -O0 -I../vendor -D__FSKIT_INCLUDES_NEFS__ -D__NEKERNEL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../boot +CCFLAGS = -fshort-wchar -D__nekernel_max_cores=8 -c -D__NE_AMD64__ -D__NEOSKRNL__ -D__NE_VEPM__ -Werror -Wall -Wpedantic -Wextra -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__NE_SUPPORT_NX__ -O0 -I../vendor -D__FSKIT_INCLUDES_NEFS__ -D__NEKERNEL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../boot ASM = nasm diff --git a/src/kernel/src/BitMapMgr.cc b/src/kernel/src/BitMapMgr.cc index d6541769..5cae02c1 100644 --- a/src/kernel/src/BitMapMgr.cc +++ b/src/kernel/src/BitMapMgr.cc @@ -78,17 +78,7 @@ namespace HAL { auto FindBitMap(VoidPtr base_ptr, SizeT size, Bool wr, Bool user, SizeT pad) -> VoidPtr { if (!size) return nullptr; - if (kBitMapCursor > kKernelBitMpSize) { - err_global_get() = kErrorOutOfBitMapMemory; - - (Void)(kout << "Bitmap limit reached, can't allocate more bitmaps." << kendl); - return nullptr; - } - VoidPtr base = reinterpret_cast(base_ptr); - MUST_PASS(base); - - if (!base) return nullptr; STATIC SizeT biggest = 0UL; diff --git a/src/kernel/src/FS/OpenHeFS+FileMgr.cc b/src/kernel/src/FS/OpenHeFS+FileMgr.cc index abe8164c..7008c491 100644 --- a/src/kernel/src/FS/OpenHeFS+FileMgr.cc +++ b/src/kernel/src/FS/OpenHeFS+FileMgr.cc @@ -49,7 +49,7 @@ NodePtr HeFileSystemMgr::Create(_Input const Char* path) { return nullptr; } - // AMLALE: TODO, its own helper! + //TODO: its own helper! SizeT len = oe_string_len(path); #if defined(__clang__) diff --git a/src/kernel/src/FS/OpenHeFS+FileSystemParser.cc b/src/kernel/src/FS/OpenHeFS+FileSystemParser.cc index 8db1a01f..93cc5a63 100644 --- a/src/kernel/src/FS/OpenHeFS+FileSystemParser.cc +++ b/src/kernel/src/FS/OpenHeFS+FileSystemParser.cc @@ -876,7 +876,7 @@ _Output Bool HeFileSystemParser::Format(_Input _Output DriveTrait* mnt, _Input c return NO; } - /// AMLALE: Better way to create default directories than before. + /// TODO: Better way to create default directories than before. const Utf8Char* kFileMap[] = {u8"/", u8"/boot", u8"/system", u8"/network", u8"/devices", u8"/media", u8"/dev", (Utf8Char*) nullptr}; diff --git a/src/kernel/src/HeapMgr.cc b/src/kernel/src/HeapMgr.cc index be6c60bf..f549f60c 100644 --- a/src/kernel/src/HeapMgr.cc +++ b/src/kernel/src/HeapMgr.cc @@ -244,9 +244,9 @@ _Output Boolean mm_protect_ptr(VoidPtr heap_ptr) { reinterpret_cast((UIntPtr) heap_ptr - sizeof(Detail::MM_INFORMATION_BLOCK)); - /// AMLALE: if valid, present and is heap header, then compute crc32 + /// TODO: if valid, present and is heap header, then compute crc32 if (heap_info_ptr && heap_info_ptr->fPresent && kHeapMgrMagic == heap_info_ptr->fMagic) { - /// AMLALE: Protect only the header, information in it may change. + /// TODO: Protect only the header, information in it may change. heap_info_ptr->fCRC32 = ke_calculate_crc32((Char*) heap_info_ptr, sizeof(Detail::MM_INFORMATION_BLOCK)); diff --git a/src/kernel/src/Network/IPCMessage.cc b/src/kernel/src/Network/IPCMessage.cc index 6a565604..7db9f022 100644 --- a/src/kernel/src/Network/IPCMessage.cc +++ b/src/kernel/src/Network/IPCMessage.cc @@ -34,7 +34,7 @@ Bool ipc_int_sanitize_packet(IPC_MSG* pckt) { goto ipc_check_failed; } - if (pckt->IpcFrom == pckt->IpcTo || pckt->IpcPacketSize > kIPCMsgSize) { + if (pckt->IpcFrom == pckt->IpcTo || pckt->IpcPacketSize < 1) { goto ipc_check_failed; } @@ -115,7 +115,7 @@ Bool IPC_MSG::Pass(IPC_MSG* src, IPC_MSG* target) { ++target->IpcLock; - rt_copy_memory_safe(src->IpcData, target->IpcData, src->IpcMsgSz, kIPCMsgSize); + rt_copy_memory_safe(src->IpcData, target->IpcData, src->IpcMsgSz, target->IpcMsgSz); --target->IpcLock; diff --git a/tools/kfwrk.py b/tools/kfwrk.py index 3779cd42..585e4c32 100755 --- a/tools/kfwrk.py +++ b/tools/kfwrk.py @@ -81,7 +81,7 @@ def create_directory_structure(base_path_fwrk, project_file_name, project_name): if __name__ == "__main__": if len(sys.argv) != 2: - print("HELP: mk_fwrk.py ") + print("HELP: mkfwrk.py ") sys.exit(os.EX_CONFIG) base_path = os.getcwd() # Use the current working directory as the base path diff --git a/tools/kimg.py b/tools/kimg.py index 23b94eb1..a7f4daca 100755 --- a/tools/kimg.py +++ b/tools/kimg.py @@ -27,7 +27,7 @@ def copy_to_fat(image_path, source_dir): if __name__ == "__main__": if len(sys.argv) != 3: - print("HELP: mk_img.py ") + print("HELP: kimg.py ") sys.exit(1) image_path = sys.argv[1] diff --git a/tools/kman.py b/tools/kman.py index 366cd732..35959d9e 100755 --- a/tools/kman.py +++ b/tools/kman.py @@ -5,7 +5,7 @@ import sys, os if __name__ == "__main__": if len(sys.argv) != 2: - print("INFO: mk_htman.py ") + print("INFO: mkhtman.py ") sys.exit(os.EX_CONFIG) manual_path = sys.argv[1] diff --git a/tools/mkapp.py b/tools/mkapp.py index 793dd4a4..5f65bfb2 100755 --- a/tools/mkapp.py +++ b/tools/mkapp.py @@ -69,7 +69,7 @@ def create_directory_structure(base_path, project_name): if __name__ == "__main__": if len(sys.argv) != 2: - print("HELP: mk_app.py ") + print("HELP: mkapp.py ") sys.exit(os.EX_CONFIG) base_path = os.getcwd() # Use the current working directory as the base path -- cgit v1.2.3