summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/AMD64/HalKernelMain.cc
AgeCommit message (Collapse)Author
2025-05-27feat: generic_kits: Add X64Chrono inside BenchKit.Amlal El Mahrouss
refactor: libSystem: Refactored as a whole. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-27feat: Assign ThreadID to APIC's ProcessID when initialzing APs.Amlal El Mahrouss
refactor: Cleanup copyright headers and source code. feat: Add PrinterNetworkDevice, and DBGNetworkDevice. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-27fix: DBG_TRAP being called before IDT is setup.Amlal El Mahrouss
refactor: rename HalSyscallEntry to HAL_DISPATCH_ENTRY. also: - Better hashing function in ArchKit: Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-25kernel!: lots of changes, see commit details.Amlal El Mahrouss
refactor(hal): unify file naming and drop redundant architecture suffixes feat(build): rename kernel and bootloader to 'ne_kernel' and 'ne_bootz' refactor(memory): replace mm_get_phys_address with mm_get_page_addr feat(bitmap): track bitmap allocator usage and add out-of-memory error fix(heap): correct heap magic naming and alignment logic chore(fs): downgrade HeFS disk size check to warning chore(tools): clean up formatting in 'ping' and 'manual' docs(design): update OS_DESIGN.drawio to reflect Hypr86 and new layout Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-24feat(nekit)!: Change dbg_break_point to DBG_TRAP.Amlal El Mahrouss
BREAKING CHANGE: renamed symbol to match the codebase's macro style. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-23feat!(Kernel): Improvements on the BitMapMgr, HTS, and UPS.Amlal El Mahrouss
other: - Add ZXD header file. - Reworking AMD64 interrupts. - Improved HTS's design implementation. - Improved UPS's balancing implementation. breaking changes: - Rename MemoryMgr to HeapMgr. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-21feat(kernel): Architectural changes, and introducing a kKernelVM.Amlal El Mahrouss
see code for more details. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-19feat(kernel, sched): Architectural improvements, and cleaned upAmlal El Mahrouss
the codebase from previous implementations that didn't work/scale well. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-18feat(sched_desgin): better architecture for the HTS.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-18dev(sched): Improvements and work in progress fixes.Amlal El Mahrouss
what? - The main algorithm got improved for real time tasks, and SMP usage. - The SMP usage was present before, I just reintroduced it after realizing that it won't scale well from what I have right now. - Also removed weird implementations quirks from previous sketch. - Such as the core 0 being reserved for the boot core. - Also moved FS init code after IDT initalization. - To avoid weird FS format behavior. - Wrap HPET signature in a macro. next? - Work on the HAL's userspace transition mechanism. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-18feat(kernel{sched/hal}): int 3 if something is wrong in `sched_jump_to_task`Amlal El Mahrouss
why: - After the image's entry is done, and no exit is called. also: - Added sched_idle_task to CPS's API. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-16feat(kernel): Better UPS and interrupt system too.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-16feat(kernel/ap): Improved and fixed the AP boot flow, also made sure that ↵Amlal El Mahrouss
the segment loading for the long mode stub works. TODO: - Stack pointer shall be set when jumping to AP routine. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-15feat(kernel/sched): fixes and improvements on the scheduler'sAmlal El Mahrouss
implementation. why? - The previous one wasn't entierly correct on some parts. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-15feat(kernel): improved scheduler and kernel main code.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-15feat(kernel): pushing the fixes regarding the scheduler, and working onAmlal El Mahrouss
making the LAPIC work correctly. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-15feat(kernel): Finalizing the first version of the user scheduler.Amlal El Mahrouss
other: - Removed DmaPool into its own Kit. - ApplicationProcessor unit has been cleaned up. - Rename functions of MemoryMgr. - Use KIB instead of MIBs of stack. - Cleanup parts of the scheduler, and hw scheduler. - Use UD handler for INT 6. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-14feat(kernel): Filesystem fixes, and others.Amlal El Mahrouss
what? - Add simple generic RTL8139 NIC driver, to be used within a NK device. - Update IVT accordingly. - Comment ARM's AP GIC init function, to tell what it's actually doing. - Cleanup Kernel Main, removed the useless pre_init_scheduler function. - Prepare new FileMgr with HeFileSystemMgr. - Fallback to NeFS when trying to format a fileysstem. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-13feat(kernel): see below for the commit's details.Amlal El Mahrouss
what? - UserProcessScheduler and CoreProcessScheduler have been extended for FILE_TREE and also HEAP_TREE structures. - DDK device's API will use dk_ calls instead of sk_ calls. - SIGTRAP and Interrupt handlers have been fixed to handle when no process is being run, and the kernel is instead raising the interrupt. - Add file for HeFS formating in DiskImage.fwrk - Replace generic handler with breakpoint handler in int 3. why? - These changes are bug fixes and improvements. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-11feat(kernel/hefs): Fixed the shortcomings and issues of HeFS.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-05-02kernel, FS: Mostly patches regarding NeFS's formating and disk write ↵Amlal
implementation. Signed-off-by: Amlal <amlal@nekernel.org>
2025-05-01kernel: scheduler and pef code mgr improvements.Amlal
Signed-off-by: Amlal <amlal@nekernel.org>
2025-04-30kernel: keep track of cr3 in AMD HAL/HEL.Amlal
why? To keep track of it, avoid security issues in the future. Signed-off-by: Amlal <amlal@nekernel.org>
2025-04-28dev, kernel(hal/amd64): Init filesystem according to FSKit configuration.Amlal
Signed-off-by: Amlal <amlal@nekernel.org>
2025-04-28dev, kernel: HeFS, Tooling: reworked the mkfs.hefs tool for the new filesystem.Amlal
other/related: - Add new KPC codes. - Final refactors for HeFS's Format method. - Dma pool improvements. - Better standard disk I/O names. - Add mm_memory_fence function inside HalPagingMgrAMD64.cc Signed-off-by: Amlal <amlal@nekernel.org>
2025-04-27dev, kernel: HeFS had to be redesigned to be less problematic with hard-drives.Amlal
why? the struct were way too big to fit wihin a sector. Signed-off-by: Amlal <amlal@nekernel.org>
2025-04-27dev, kernel: AHCI, HeFS filesystem, SysChk, and BootSATA improvements.Amlal
what? - AHCI now writes to disk, forgot to do it. - Codebase's architecutre has been used to reuse the Generic+AHCI driver in SysChk for AHCI. (tradeoff is 256K in size instead of 36K) - DriveMgr now detects EPM. - And HeFS is still being worked on. Signed-off-by: Amlal <amlal@nekernel.org>
2025-04-25dev, kernel: improve nefs format method, hefs format method.Amlal
Signed-off-by: Amlal <amlal@nekernel.org>
2025-04-25dev: better .clang-format, ran format command.Amlal
Signed-off-by: Amlal <amlal@nekernel.org>
2025-04-24dev, kernel: scheduler, timer: hw timer and scheduler improvements.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-24dev, kernel, boot: HeFS, Scheduler, BootZ: see below.Amlal El Mahrouss
Refactored HeFS node handling and API for extensibility, added directory metadata, improved wildcard querying, and updated documentation accordingly. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-23dev, kernel: necessary refactors regarding future changes.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-23dev, kernel/hal: amd64: made the loop at the end clearer on why itAmlal El Mahrouss
exists and what's the context. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-23dev, kernel/hal: cleanup amd64 kernel main.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-23dev, kernel: scheduler and disk swap refactors.Amlal El Mahrouss
Details: - Reworked SCSI groundwork to prepare for a Generic SCSI driver. - Refatored scheduler's code with the new coding style for structs. - Add Leak and LeakBlob inside PROCESS_IMAGE struct. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-22dev, kernel: WiP changes done to kernel and SysChk module.Amlal El Mahrouss
- Getting SysChk to work again. - Refactor scheduler. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-22dev, boot: fix bootloader link error caused by `kTeams`Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-22dev, kernel: Milestone towards 0.0.2, see details.Amlal El Mahrouss
Details: - Added support for 512 process teams (kTeams array). - New SwitchTeam() API in UserProcessScheduler. - Kernel main loop rotates active team every 200ms. - Renamed syscall tables for clarity (kSyscalls → kSysCalls, etc.). - Replaced kKernelMaxSystemCalls with kMaxDispatchCallCount. - Updated call sites to match new naming. - Bumped format version to 0x0101. - Added reserved fields to HEFS_BOOT_NODE for future use. - Changed inode indexing logic to operate on (start, size) pairs. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-19dev, kernel: Working on a 0.0.1e (for Errata)Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-18dev, fb: did some cleanup on the graphics stack.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-18kernel, boot: improvements and tweaks on the kernel's filesystems.Amlal El Mahrouss
- HeFS requires a 4gb disk at minimum now. - make_app fully supports STEPS. - Errata of NeFS.tex, add HeFS.tex. - Better boot flow. - New filesystems for FileMgr. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-18dev, kernel: important patches.Amlal El Mahrouss
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-16dev, kernel, boot: fix dumb early-init which caused the kernel to jumpAmlal El Mahrouss
at IVT. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-15fix, kernel, boot, mod: Fixing issues regarding the boot flow and theAmlal El Mahrouss
kernel. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-14bootloader, netboot: integrate EFI_SIMPLE_NETWORK_PROTOCOL for HTTP-based ↵Amlal El Mahrouss
kernel fetching - Added BootNet module to support network boot using EFI_SIMPLE_NETWORK_PROTOCOL - Replaced ModuleMain with BootloaderMain as unified entry point - Implemented EFI protocol discovery, startup, and logging for netboot - Updated linker scripts, GDB configs, and build targets accordingly - Laid groundwork for full HTTP/TCP/IP bootloader logic - Improved kernel handoff logic and memory allocation fallback handling Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-13dev, scheduler, ahci, dev: Refactor scheduler, and fix minor mistakes.Amlal El Mahrouss
Add kDeviceTypeATA in DeviceMgr.h, making NeKernel aware that ATA devices can exist too. The scheduler now won't have to reimplement new classes, I refactor the names to signal that, and they're already generic enough to signal that. The AHCI-Generic driver got cleaned up of any irrelevant code, such as aligning the newly allocated pointer. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
2025-04-11tweak kernel, boot: use -Wall, -Werror, -Wpedantic now.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-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>