Releases: DonaldKellett/marvelos
Spectacular Scheduler
Finally, we have some semblance of a userspace: a system call that does nothing other than print Test syscall
, a template init_process
for userspace processes hardcoded within the kernel that just invokes our test syscall in an infinite loop, and a round robin scheduler that just juggles around three copies of init_process
forever.
Of course, no operating system should ever hardcode user processes in the kernel; instead, it should be able to read user programs from disk and launch them as processes. So that's what we're going to do next!
Invincible Interruptor
There's still no userspace yet, but hey, we can now handle all sorts of traps and interrupts:
- Load page faults
- Store/AMO page faults
- Timer interrupts
- External interrupts (UART)
In particular, with external interrupts enabled, we can finally listen to our UART and respond to keyboard input. At the moment, it doesn't do much beyond echoing the input back to the user and powering down the board when it receives a Ctrl-C, but it's a good start nonetheless. Hopefully, with process management next on the list, we can start to see some semblance of a userspace.
Super Sv39
Still a looooong way to go before I get to anything resembling a remotely usable operating system from an end user's perspective, but anyway, I'd like to take the time to celebrate the fact that I finally turned the MMU on and got it working!
The project codebase has also seen some notable improvements which should aid with maintenance and development going forward:
- Implemented page-grained allocator
- Implemented Sv39 routines
- Implemented byte-grained allocator (
kmalloc
,kcalloc
,kfree
) - Turned on Sv39 paging in S-mode and confirmed that dynamic memory allocation works for basic use cases
- Rewrote linker script from scratch to something I actually fully understand and have full control over
- Extended the C runtime
crt0.s
to support switching from M-mode to S-mode - Added
format
target formake
in order to enforce consistent formatting across the codebase
Meaty Skeleton
A meaty skeleton for fellow OSDev'ers to base their RISC-V operating system upon:
- Hierarchial project structure with
make
build system for sustainable mid- to long-term development - Includes
debug
target for debugging with GDB (requires cross-debugger targetingriscv64-elf
) - Basic console output through NS16550A UART
- Convenience wrappers for powering off and rebooting the device
- Working
kprintf
supporting base format specifiers (no floating point support; no sub-specifiers; non
specifier) to facilitateprintf
debugging panic
function for kernel panics