This is hopefully the last time in a while that
something in the mm subsystem needs a refactor
this large. There are two main changes:
- The page frame allocator returns a vm_page_t
rather than a virtual address.
- Data for the slab allocator is now stored in
struct vm_page, which means there is no overhead
in the slab itself so the space is used in a
more efficient manner.
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.
Another one of those larger endeavours that take
multiple commits. This first one introduces the
basic vm_page data structure, as well as the x86
bootstrap code for initializing it.
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 seems like a huge commit but it's really just
renaming a bunch of symbols. The entire mm
subsystem is probably gonna have to go through
some major changes in the near future, so it's
best to start off with something that is not too
chaotic i guess.
Up to now, the page frame allocator's
initialization routine relied on the fact that
map_page() never needs to get new pages on i386 if
the mapped page is a hugepage. This is not at all
true on other architectures, however.
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.
This is part of a series of commits where i
completely rewrite kmalloc() because it needs to
be able to return physically contiguous memory for
DMA operations.
Yes, i know the build isn't working right now.
So this was painful. kprintf() supports most of
the format specifiers from BSD now, except for the
$ sequence. It has gotten a general overhaul and
is significantly more sophisticated, bloated and
slower now. There is also some minor stuff i
forgot about, like the 't' length modifier, but
that isn't so important right now and will be
fixed later(TM).
This commit also fixes the fun little size bug in
segment.S where i subtracted the end from the
start address of the GDT instead of the other way
round which resulted in a gigantic overflow :)
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.