HakuKernel
Newborn Newborn C C
โ†‘ 53 ?
HakuKernel ParsaAzima/HakuKernel

An independent operating system built from scratch, powered by HakuKernel. Independent by Design.

HEALTH ? 89 / Healthy
// solo builder// hidden gem assemblybootloaderckernelkernel-sourcenasmnasm-assemblernasm-assemblynasm-languageopreating-system ?

// readme

Haku v0.2.0 โ€” a tiny x86-64 operating system in C

A NASM bootloader loads a C kernel, switches the CPU to long mode and runs ELF64 programs at ring 3 behind the Linux x86-64 syscall ABI. The same source tree still builds the original 32-bit kernel (python build.py --arch=i386), which is where the static musl/busybox userland, the user C library and the shell live. There is no C runtime inside the kernel and no hosted library under it: MSVC (or clang-cl) and NASM produce freestanding objects that link.exe/lld-link combine into a flat boot image, and QEMU boots it.

The practical target is a small, honest POSIX-inspired subset that a real static Linux binary can use. The strongest evidence for that is the CI job that boots static musl programs, and the python build.py shell target, which brings up a 1 MiB static busybox as PID 1 and lands in ash with job control and pipelines working.

Status

  • Boot โ€” BIOS floppy image, two-stage 16-bit loader (Linux-style A20, GDT, protected mode), E820 map, 448 KiB kernel window.
  • Memory โ€” paging with a supervisor direct map, E820-sized frame allocator and bitmaps, 4 KiB pages, kmalloc/kfree heap,โ€ฆ