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.
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.