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 has been brewing for quite some time now, and
it still is nowhere near finished, but at least it
compiles now. A lot has changed, and it's still
quite messy (i386 is almost certainly broken now,
i haven't even checked)
This also includes a minor refactor of everything,
as well as some optimizations. The bitmap
operations have been moved into a separate file
because they are probably gonna come in handy in
other parts of the system as well.
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.