This is a rather large commit, so the gist of it is this:
User context switching is now functional, after a change to the TSS, and
a few minor details in the scheduler and loader.
ELF parsing is rather primitive, but basically functional, as long as it
only loads code.
The interrupt 0x80 is for syscalls, and will switch from user mode to
kernel mode. It is currently the only interrupt that can be called from
user mode
This adds the syscall functionality, which currently uses a red-black
tree to store the function pointers, although when the table is more
flushed out, it will probably be replaced with an array
The pager now correctly marks the parent nodes with attributes as it
allocates them. Without doing this, the page table entries will never be
reached in lower privilege modes, causing page faults
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
If the pointer the the beginning of the slab was the beginning of the
aligned region, instead of jumping to the next, as was done previously,
we use the already aligned pointer instead.
This type should never be modified by the user, and only passed into the
functions in slab.c. Using a typedef to notifies the user semantically
of this fact
This also switches the kmalloc allocator over to the new rbtree
structure. As a balanced binary search tree, it is much more efficient
than the previous method
this massively speeds up boot on larger memory systems, as before this
was only tested on a 2GB system. Only identity mapping the first 4GB of
still allows MMIO to work, but without the massive space and time taken
by the previous method
allocating individual pages en-masse for kmap with the buddy allocator
is way too slow, especially with the new method of buddy allocation that
is noticeably slower to start, but scales more efficiently.
the slab allocator is extremely fast and is perfect for this purpose
before this patch, the buddy allocator used a hybrid bitmap-freelist
approach where free would use the bitmap to determine size, but all
other operations we O(n) traversals of the free-list.
now, both alloc and free use the bitmap exclusively for allocation.