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.