summaryrefslogtreecommitdiff
path: root/Kernel/i386.h
AgeCommit message (Collapse)Author
2018-12-03More coding style changes.Andreas Kling
2018-11-17Make bash-2.05b build with minimal changes.Andreas Kling
This is really neat. :^)
2018-11-13Reduce kmalloc() traffic in directory iteration.Andreas Kling
Pass the file name in a stack-allocated buffer instead of using an AK::String when iterating directories. This dramatically reduces the amount of cycles spent traversing the filesystem.
2018-11-12Make loading /bin/bash ~250x faster.Andreas Kling
The ELF loader was doing huge amounts of unnecessary work. Got rid of the "export symbols" and relocation passes since we don't need them. They were useful things when bringing up the ELF loading code. Also added a simple TSC-based Stopwatch RAII thingy to help debug performance issues.
2018-11-08Make Process::for_each...() functions inline and allocation-free.Andreas Kling
AK::Function is very handy, but costs us an 8-byte allocation. Let's not have kmalloc() calls in the scheduler hot path.
2018-11-08Refactor the virtual memory object model a bit:Andreas Kling
Process now has a number of Regions. Each Region is backed by a VMObject. A VMObject can be file-backed or anonymous. These can be shared.
2018-11-08Support basic mmap'ing of a file!Andreas Kling
All right, we can now mmap() a file and it gets magically paged in from fs in response to an NP page fault. This is really cool :^) I need to refactor this to support sharing of read-only file-backed pages, but it's cool to just have something working.
2018-11-07Some refactor and style tweaks.Andreas Kling
2018-11-05Implement COW pages! :^)Andreas Kling
sys$fork() now clones all writable regions with per-page COW bits. The pages are then mapped read-only and we handle a PF by COWing the pages. This is quite delightful. Obviously there's lots of work to do still, and it needs better data structures, but the general concept works.
2018-11-05Tidy up the page fault code a bit in preparation.Andreas Kling
2018-11-02Add a simple /proc/cpuinfo that includes some info from CPUID.Andreas Kling
2018-11-01Use a freelist for GDT entries.Andreas Kling
Tweak the kmalloc space layout a bit. Get the spawn stress test up and running again.
2018-10-24Add an InterruptDisabler helper class and use that for kmalloc.Andreas Kling
The naive spinlock was not nearly enough to protect kmalloc from reentrancy problems. I don't want to deal with coming up with a fancy lock for kmalloc right now, so I made an InterruptDisabler thingy instead. It does CLI and then STI iff interrupts were previously enabled.
2018-10-23Lots of hacking:Andreas Kling
- Turn Keyboard into a CharacterDevice (85,1) at /dev/keyboard. - Implement MM::unmapRegionsForTask() and MM::unmapRegion() - Save SS correctly on interrupt. - Add a simple Spawn syscall for launching another process. - Move a bunch of IO syscall debug output behind DEBUG_IO. - Have ASSERT do a "cli" immediately when failing. This makes the output look proper every time. - Implement a bunch of syscalls in LibC. - Add a simple shell ("sh"). All it can do now is read a line of text from /dev/keyboard and then try launching the specified executable by calling spawn(). There are definitely bugs in here, but we're moving on forward.
2018-10-22Add IRQHandler class that can be subclasses to handle an IRQ.Andreas Kling
Also move Keyboard to a class implementation using this pattern.
2018-10-19Turn the syscall interrupt into a trap (by switching the gate type.)Andreas Kling
This leaves interrupts enabled while we're in the kernel, which is precisely what we want. This uncovered a horrendous problem with kernel tasks silently overflowing their stacks. For now I've simply increased the stack size but I need a more MMU-y solution for this eventually.
2018-10-18Add Regions concept to Task.Andreas Kling
2018-10-18More paging stuff.Andreas Kling
The test userspace process now runs at linear address 0x300000 which is mapped to a dynamically allocated page from the MemoryManager. Cool!
2018-10-17A userspace process can now GPF and the OS goes on!Andreas Kling
This is really rickety, but it kinda sorta works for my test GPF!
2018-10-16Import the "gerbert" kernel I worked on earlier this year.Andreas Kling
It's a lot crappier than I remembered it. It's gonna need a lot of work.