27 Commits (main)

Author SHA1 Message Date
anna 3910c85cac
x86/mm: fix __boot_clear_page 2 years ago
anna b4ed811920
mm: refactor page allocator
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.
2 years ago
anna f8a85a1541
happy new year 2022 uwu
May it be slightly less exhausting than 2021.
2 years ago
anna 79033fbc8b
x86/mm: disable page caching in direct map 2 years ago
anna 385af1b7ef
mm: refactor page frame allocator
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.
3 years ago
anna d19e665d47
mm: generalize boot allocator
The boot page frame allocator is now architecture
independent.
This is part 2 of the mm subsystem refactor.
3 years ago
anna 7285c2e076
mm: refactor entire mm subsystem, part 1
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.
3 years ago
anna 5a5135f416
update license terms
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.
3 years ago
anna 52ac282ac8
x86: move common setup checks to shared file
This should also kind of fix the build.
I don't know whether that's actually the case
because i haven't tried tho lmao.
3 years ago
anna 24ae60225f
amd64: add base 64-bit support files
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)
3 years ago
anna 637ac5ce92
x86/page: add page flagging functions 3 years ago
anna a3941b6dc4
mm: minor page management refactor
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.
3 years ago
anna 6d0950501c
page: ensure early page mapping doesn't fail
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.
3 years ago
anna 2b3eaf4ff7
mm: add basic slab allocator
This still needs some work and integration into
kmalloc() but hey i've tested it and it doesn't
immediately fall apart so why not commit it
3 years ago
anna 96378f019c
kmalloc: add shiny new buddy page frame allocator
This is still kind of a work in progress because
it will be the backend to a slab allocator, which
in turn is managed by kmalloc().
3 years ago
anna 3fee893f21
x86: begin preparations for amd64 support
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.
3 years ago
anna c911ff9009
x86/mm: add huge page support
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.
3 years ago
anna 14e673b8dd
x86: fix page allocator once and for all 3 years ago
anna 65899b35f1
x86: minor page management refactor
Even Uranium-223 ages better than my code
3 years ago
anna 89f3393b8b
x86: move page fault handler to where it belongs 3 years ago
anna d475429639
kprintf: implement "full" format sequence support
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).
3 years ago
anna 613c28a965
x86: add basic interrupt support
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 :)
3 years ago
anna 5c0fa715a4
kmalloc: add actual memory allocator
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.
3 years ago
anna 8129518640
mm: replace GRUB's GDT with our own 3 years ago
anna 3d6258a06e
mm: implement runtime page mapping 3 years ago
anna 17320f2571
boot: enable paging in boot sequence 3 years ago
anna d436d9b203
mm: add page frame allocator 3 years ago