This is the final part of the major mm subsystem
refactor (for now). The new and improved slab
allocator can do *proper* poisoning, with pretty
accurate out-of-bounds and use-after-free
detection.
vm_page_t has also been restructured; its flags
and order are now combined into one atomic field.
This is part 3 of the mm subsystem overhaul.
The allocator doesn't rely on mutexes anymore and
uses individual per-order spinlocks instead.
Also, it is aware of multiple memory zones (normal
and DMA) as well as emergency reserves.
Page bitmaps take up 50 % less overhead now.
As of now, everything except the code imported
from FreeBSD is proprietary. Of course, it won't
be like this for long, only until we have decided
which license we like to use. The rationale is
that releasing everything under a copyleft license
later is always easier than doing so immediately
and then changing it afterwards.
Naturally, any changes made before this commit are
still subject to the terms of the CNPL.
This is a huge commit, but it mainly just moves
some files around and doesn't change their
contents much.
A lot of stuff works the same on amd64 as it does
on i386, so i'm moving the parts that are specific
to the latter into separate subdirectories while
the rest can be shared with the amd64 codebase.
Now that memory allocation finally kind of works,
we can finally start focusing on the core system
architecture. This commit also fixes some bugs in
get_page() and friends, as well as performance
improvements because the page map is addressed as
unsigned longs rather than individual bytes.
Turns out writing your own bootloader from scratch
is something you probably don't wanna be bothered
with when your main goal is writing an entire
operating system. Blessed be the souls of the
maniacs who gave us GRUB, and punched be their
faces for writing such inconsistent documentation.