summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel
AgeCommit message (Collapse)Author
2025-04-06fs/NeFS.cc: `buf` must be zeroed out.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-06fs/nefs: Optimize ::Format method for EPM inside NeFileSystemParser.Amlal El Mahrouss
TL;DR: - Avoiding unecessary delays, when copying filesystem name to part block (EPM) Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-06kernel/storage: use correct if branching to avoid future compiler errors.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-06 adding an align function designed for AHCI's needs and drivemgr'sAmlal El Mahrouss
AHCI detection system. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-05AHCI+Generic.cc: a little but important tweak regarding AHCI genericAmlal El Mahrouss
driver. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-05kernel: storage, modules, mbci: implement mbci_read_auth_key, ↵Amlal El Mahrouss
mbci_test_mmio, test DMA on AHCI too. - Alongside fixes for BootNet, SysChk, and refactor for KernelScheduler, and MemoryMgr. - IMPORTANT: Add MBCI specs. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-04kernel, storage: important patches done to AHCI, PIO, PagingMgr, and DMA.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-03fmt/pef.h: correcting minor mistakes.Amlal El Mahrouss
2025-04-03kernel/pci: document Device class.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-02boot/net: rename Boot.S files, clarify EEPROM implication, and prep UDP readAmlal El Mahrouss
- Renamed Boot.S → BootNetStartup.S and SysChk/Boot.S → SysChkStartup.S for clarity - Replaced BOOTNET_INTERNET_HEADER.ImpliesEEPROM with ImpliesProgram to better reflect the generic reprogramming intent - Introduced `bootnet_read_udp_packet()` stub for future UDP packet parsing from bootnet.json - Minor alignment and comment fixes in various headers (CoreBoot, EPM, Json) - Updated HalPagingMgr to use PageStore instead of NE_PAGE_STORE - Boot time now prints cycles since start; triggered fs_init_nefs() earlier during HAL init - Prep for extended MBCI and master structure support in COREBOOT_LINEAR_EXEC - Numerous cleanups across DMA, NewKit, and Json parsing to prep for extended patching and block-level bootstrap This lays groundwork for richer NetBoot infrastructure in NeKernel and aligns naming and structure conventions across subsystems. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-01kernel/wip: SMP tweaks, and code cleanup.Amlal El Mahrouss
2025-04-01ahci, boot: bump, and working on a patch.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-01fix/paging: Fix page manager API probe and tlb invalidator logic.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-01kernel/storage, pio, ahci, dma: a lot of patches and fixes according to ↵Amlal El Mahrouss
StorageKit specs and cleaned up DMA driver for a future more robust implementation. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-01boot, kernel, modules: unify gfx headers, fix AHCI LBA48, standardize ModuleMainAmlal El Mahrouss
- Consolidated CoreGfx headers: * Renamed `FBMgr.h` to `CoreGfx.h` * Renamed `TextMgr.h` → `TextGfx.h`, `MathMgr.h` → `MathGfx.h`, and `AccessibilityMgr.h` → `CoreAccess.h` * Updated all includes across bootloader, HAL, and kernel to use new names - Standardized EFI entrypoint: * Replaced `Main` with `ModuleMain` in EFI boot sources and linker flags * Updated GDB and build scripts accordingly - Improved AHCI identify logic: * Added full 48-bit LBA extraction (words 100–102) * Fallback to 28-bit if LBA48 not supported * Refactored `drv_get_size` and `drv_std_detected` into separate `#ifdef __AHCI__` region - DiskImage framework improvements: * Namespaced API into `DI` namespace * Split implementation: `DiskImage+EPM.cc` and `DiskImage+NeFS.cc` * Updated CLI tool accordingly - KernelTest framework: * Namespaced macros and classes with `KT_` * Changed test result to use `MUST_PASS` and boolean return - Misc: * Corrected minor logic in `NetworkDevice::Name()` * Bumped down KernelKit and NewKit versions to 0.0.1 * Renamed `HalUtils.asm` → `HalUtilsAPI.asm` Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31firmware/netboot: final refactors regarding netboot.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31ahci: fix useless '#include "' which is also breaking nekernel's coding ↵Amlal El Mahrouss
standards.
2025-03-31ahci: a set of important patches of generic ahci driver.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31boot/efi: a set of important patches regarding efi bootz.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31meta: ran format.shAmlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31docs: add mermaid directory, fix bad refactor in HeFS.h, and updatedAmlal El Mahrouss
OS_DESIGN.drawio Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31storage: unify naming for drive protocol interfaceAmlal El Mahrouss
Renamed `fDriveKind` to `fProtocol` across kernel storage subsystems to clarify its purpose as a protocol identifier (e.g., "AHCI", "ATA-") rather than a general "kind" classification. Updated all affected header and source files: - DriveMgr, HeFS, AHCI, ATADeviceInterface, and NeFS now consistently reference `fProtocol()` instead of `fDriveKind()`. - Added streaming operators (`<<`, `>>`) to AHCI and ATA device interfaces for improved mountpoint interaction. - Promoted `GetPortsImplemented()` and `SetPortsImplemented()` to public for AHCI device configuration. - Added null checks and protocol verification logic in stream operators. This refactor improves clarity and consistency when working with storage devices across the kernel. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31dev/user: user.sys shall be the main component which handles syscalls,Amlal El Mahrouss
as a DDK driver. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31boot: fix framebuffer init and restore boot on real hardwareAmlal El Mahrouss
Framebuffer mode selection now defaults gracefully when the expected resolution is unavailable. EFI binaries now boot successfully on physical hardware using a fixed image base and simplified jump logic. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31efi: make it fit the 8.3 limit (FAT)Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-31meta/repository: fix capitalization on my name 'El' instead of 'EL'.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-30kernel/crc32.cc: new crc32 table generated from pycrc (just to be sure).Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-30kernel/crc32.cc: Fix poly div inside ke_calculate_crc32.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-29hal/amd64: unify GDT/IDT setup and rename I/O opsAmlal El Mahrouss
Normalize descriptor loading logic under Register64. Prefix low-level port and MSR functions with hal_ for consistency. Improve APIC init flow to reflect MADT-based IRQ routing. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-29ddk: refactor: reorganize kit into a standard kernel kit.Amlal El Mahrouss
sched: refactor: refactor scheduler file names, for future additions. xcoff: refactor: document and improve XCOFF for NeFS (regarding Ne's FW) codemgr: refactor: make a difference between kernel and user processes. refactor: document project overall. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-28ahci: fix: report success when ahci is detected.Amlal El Mahrouss
mbci: reintroduce NeKernel's MBCI. cfkit: rename: CFKit -> CF libuser: rename ErrKind to ErrRef. coregfx: fix last unconsistent things about the module. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-28kernel: breaking: Change namespace from NeOS to Kernel.Amlal El Mahrouss
sched: Fix redundancy in NeKernel's user scheduler macros, refactored the other files using the redundant macros too. part one of a series of commit for NeKernel. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-28ahci: FIX - remove redundant header in AHCI+Generic.ccAmlal
Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
2025-03-28achi: WIP - fix the misused `NO` flag in read/write call sites, this isAmlal El Mahrouss
needed to treat them as commands. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-28ahci: WIP - refactor AHCI command engine, fix PRDT setup and LBA logicAmlal El Mahrouss
This patch begins a major cleanup and enhancement of AHCI I/O handling: - Refactored AHCI command setup logic to prepare FIS and PRDT entries more correctly. - Fixed miscalculation of 48-bit LBA extraction from IDENTIFY response. - Rewrote PRDT loop to increment physical address per entry instead of recomputing offsets. - Replaced read/write/identify branching with unified ternary logic for clarity. - Ensured proper stopping and reinitialization of command engine before issuing commands. - Explicitly remap and zero command list base, FIS base, and command table areas. - Made command slot lookup more robust. - Added fallback wait after command completion to avoid SRBSY/SRDRQ residue. - Dropped misused `YES` flag in read/write call sites — now passed only when needed. Also includes: - Minor cleanup in `BootKit.h` (whitespace). - NeFS debug message clarified to avoid accidental fork overwrites. This is a **work-in-progress** rework of the AHCI path. Next steps will involve: - More robust error recovery. - Support for non-512 sector drives. - Support for multiple ports and NCQ. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-28bootz: rename NetBoot module to BootNetAmlal El Mahrouss
Rename the NetBoot module to BootNet to avoid confusion with Apple's NetBoot and better reflect the module's role within BootZ. Updates include: - Renamed module directory: NetBoot/ → BootNet/ - Renamed files and headers: NetBoot.cc → BootNet.cc, etc. - Updated build output: netboot.sys → bootnet.sys - Replaced all references in build scripts, source includes, and user-visible strings - Fixed typo in SysChk.cc copyright This unifies naming across modules and reinforces BootZ's modular identity. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-28bootz: consolidate EFI namespace into Boot, finalize NetBoot fallbackAmlal El Mahrouss
Collapse the EFI namespace into Boot to unify BootZ's interface for firmware handling. This simplifies calls to functions like Stop(), ThrowError(), and ExitBootServices(), and improves consistency across boot modules. Also rename SysChk/Module.cc to SysChk/SysChk.cc for naming consistency with other modules. Improve NetBoot fallback path in BootEFI: - Ensure netboot.sys is read before ExitBootServices() to avoid allocation issues after exiting firmware services. - Reuse reader and thread objects if kernel boot fails. - Update both AMD64 and ARM64 paths to follow the same logic. Update all call sites to use Boot:: instead of EFI::. Fixes: broken error handling and memory reads after ExitBootServices() Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-27BootZ: Introduce NetBoot module & consolidate STANDALONE macroAmlal El Mahrouss
- Renamed __BOOTLDR_STANDALONE__ → __BOOTZ_STANDALONE__ across all modules. - Introduced NetBoot module to support fallback booting via packets. - Updated amd64-desktop build to bundle netboot.sys as part of system image. - NetBoot now properly zeroes out its header and performs sanity check on PatchLength. - Boot flow now attempts to fallback to NetBoot if neoskrnl.exe fails to start. - Reorganized disk formatting logic for clarity and better failure recovery. - HeFS & NeFS minimum disk size lowered (64GiB → 256MiB and 4GiB → 8MiB). - Renamed `IndexProperty` to `Index` in FSKit::Indexer. - Moved HintKit → hint/, updated includes and guards. - Removed deprecated LPC.{cc,h}, replaced by ProcessCodes.h. - Modernized SystemCalls.h typedefs: SCIObject → Ref, ThreadObject → ThreadRef, etc. - Updated userland tools `make_app` and `open` with copyright and behavior fixes. This prepares the BootZ infrastructure for headless/network environments. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-27add: new driver device kit API. (DDK)Amlal El Mahrouss
refactor: rename SCIKit -> user (then libuser.dylib) boot/modules/netboot: fixed compilation for amd64. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-26feat(boot): kern_ver nvram variable.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-26feat(kernel): SwapKit+kSwap variant type.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-25cli(diutil): moved CommandLine.cc to src/Amlal El Mahrouss
ahci(generic): set err_global_get() when probing or command fails, use HbaMemRef when refering to HbaMem* Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-25kernel: Refactor AHCI I/O path, enhance memory allocators, and cleanup ↵Amlal El Mahrouss
obsolete script - Removed unused `build_gcc.sh` script. - Namespaced CPU feature flags under `NeOS` and transitioned from enum to unnamed enum for scoping. - Renamed `drv_std_input_output` to `drv_std_input_output_ahci` for clarity. - Improved AHCI driver documentation and added zeroing for read buffers. - Added optional `pad` parameter to memory allocators: `mm_alloc_bitmap`, `mm_new_heap`, `PageMgr::Request`, etc. - Updated bitmap allocator to correctly handle and align with padded sizes. - Added `fPad` field to memory header block. - Fixed `ATA-DMA` mode comment, corrected PRD usage and logic. - Improved code documentation and formatting in `UserProcessScheduler`, `PageMgr`, and related components. - Enhanced safety in process memory cleanup (e.g., `StackReserve` cleanup). Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-25fix(build&ci): build script was refering to the old HalBoot.asm.Amlal El Mahrouss
2025-03-25refactor(kernel): Refactor MemoryMgr code and log freed address location.Amlal El Mahrouss
feat(setup_amd64): Add 'disk' build step. fix(hal/amd64): Fix warning regarding resb being used inside a non-bss area (using no-op instead). feat(kernelkit/lockdelegate): add new entry to lock delegate's enum (ensure validation). feat(meta): ran format.sh to format files according to .clang-format. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-03-24doc(fix): didn't got the email handle correctly.Amlal El Mahrouss
2025-03-24feat(meta): minor tweaks.Amlal El Mahrouss
2025-03-24kernel(feat): Add basic wide system bug check (memory check), otherAmlal El Mahrouss
changes have been made too, see commit details for more information. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
2025-03-23feat(meta): move documentation to either drawio/ or /md/ according toAmlal El Mahrouss
file type. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
2025-03-23feat(SwapDisk.cc): Check for empty fork name in I/O methods.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>