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.
Oh my fucking god this was by far the most awful
and boring and tedious day in my entire life.
Also, dear FreeBSD people: please don't sue me.
I tried really hard to comply with all the
copyright stuff, but it is absolutely possible i
made a mistake. Just DM me and i'll do everything
in my power to fix it, even if that means
releasing entire portions of GayBSD under the BSD
license. I don't care, i just want stuff to work.
(i'm including this message to use it as possible
evidence in case i get sued to show my good will)
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).
I have no idea if i've made things better or worse
with these changes, but tbh i don't really care.
It didn't compile (with the upcoming changes to
kprintf(), that is) before, it does compile now.
End of story.
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.
All i really wanted to do is prevent accidentally
using floats, but the -mgeneral-regs-only option
seemed a little overkill and clang ignored it
anyway, so there is little use for it other than
emitting noisy compile warnings.
Turns out you can't pass a va_list to subroutines
as per the C standard, even though it worked
perfectly fine on ARM. Well then, the entire
kprintf thing needs to be refactored anyway at
some point in the future, so that more formatting
options are supported.