2026-05-10 22:02:36 +02:00
2026-05-10 22:02:36 +02:00
2026-05-10 22:02:36 +02:00
2026-05-10 22:02:36 +02:00

NT-Lite -- an x86-64 kernel

Boots. Runs processes. Mimics Windows to some extent.

what is it?

A 64-bit operating system kernel written from scratch. UEFI bootloader, physical and virtual memory managers, preemptive scheduler, HAL, VFS, PE loader, partial Win32 layer. It boots into a shell. ~20k lines of C and assembly.

features

  • UEFI bootloader
  • physical memory manager
  • virtual memory manager with kernel pool
  • HAL (screen, keyboard, mouse, timer, disk, PCI, APIC)
  • preemptive scheduler with priority levels
  • processes and threads
  • VFS with IRPs
  • drive-letter paths (0:\apps\shell.exe)
  • INI-based boot and driver configuration
  • PE import resolution and dynamic driver loading
  • Win32 personality (partial)
  • POSIX personality (partial)

how 2 build

  • open vs x64 build tools as admin
  • cd into this directory
  • mkimage.bat
  • build.bat
  • run.bat(ide)/rund.bat(ide, debug)/runa.bat(ahci)/runad.bat(ahci, debug)
  • enjoy

how it looks when built

I have some strong opinions on OS design.

efi/boot/
  bootx64.efi
boot.ini
hal.dll
colonel.exe
drivers/
  drivers.ini
  ide.sys
  ahci.sys
  fat32.sys
syscall.dll
win32.dll
posix.dll
shell.exe
video.exe

driver model

drivers are PE32+ .sys files with an entry point preferably named DriverEntry accepting a constant pointer to HAL_API.

drivers to be loaded have their path stored in drivers.ini, split into essential for boot (loaded by bootloader) and not required for boot (loaded by kernel).

a disk driver fills in a DISK_DRIVER vtable and calls IoRegisterDisk(index, &driver). a filesystem driver fills in an IO_FILESYSTEM vtable and calls IoRegisterFilesystem(index, &fs, &vol).

currently shipping: AHCI (interrupts), IDE (PIO/DMA) and FAT32.

how it boots

  1. UEFI loads boot.ini, reads drivers.ini
  2. bootloader maps kernel, HAL, and boot drivers into the upper half
  3. direct physical window at 0xFFFF880000000000
  4. jumps to KernelMain
  5. PMM, VMM, GDT, IDT, HAL, IRQs, scheduler
  6. loads runtime drivers from disk
  7. launches shell.exe

paths (because they're different)

"apps\shell.exe"     -> current working directory
"0:\apps\shell.exe"  -> drive 0
"2:\data\config.ini" -> drive 2

Drives 0-7. A drive only works if a filesystem registered on it.
The Win32 personality translates drive letters to drive numbers, the POSIX personality maps drives onto a tree.

screenshots

video.exe running bink video 2

faq

Q: Why?
A: Why not?

Q: Does it run Doom?
A: Not yet.

Q: Is the Win32 layer real?
A: Real enough to load binaries that expect it. Not real enough to run Notepad.

Q: Is the scheduler preemptive?
A: As much as it will ever be.

Q: Will it corrupt my data?
A: It shouldn't.

Q: Is this finished?
A: Not in the slightest.

Q: Can I use this in production?
A: Don't.

S
Description
No description provided
Readme
37 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 98.9%
Assembly 0.9%
C++ 0.1%