ref: 354b6b991e68fe3ab6bdb0ff42f3261064ba6b21 k/PORTABILITY.md -rw-r--r-- 730 bytes
354b6b99 — Eyal Sawady Initial commit 9 months ago


k aims to be highly portable, with most of the kernel written in arch-independent C. However, there are times when this is impossible.

When possible, there should be an abstraction layer, implemented in assembly, upon which portable C can be written. This abstraction layer should be as thin as possible while still being easy to implement on all hardware.

The exception to this rule is the stage-1 bootloader, which is fully implemented in assembly. The tasks that the stage-1 bootloader performs are entirely architecture-dependent, and it is usually severely limited in size.

All architecture-specific code MUST live in arch/$(uname -m). Porting k to a new architecture should take at most a few weeks.