kernel/README.md

39 lines
2.1 KiB
Markdown
Raw Normal View History

2024-05-13 18:31:37 -04:00
---
created: 2024-05-13T14:28:49-05:00
2024-05-19 18:42:50 -04:00
modified: 2024-05-19T17:41:01-05:00
2024-05-13 18:31:37 -04:00
---
2024-05-19 18:48:59 -04:00
# kernel
2024-05-14 12:12:11 -04:00
A kernel for RISC-V written in Rust. Currently focused on running on QEMU generic riscv64, advice and assistance welcome & encouraged.
2024-05-19 18:48:59 -04:00
## Progress
2024-05-13 18:31:37 -04:00
2024-05-20 04:03:25 -04:00
* **2024-05-19:** As of right now, the basic "stuff" for initializing the kernel is there. ~~The diagram below shows what I'm thinking as far as what the init process should be. This is what I'm currently working on implementing, and I will update this chart (and prettify it) more~~
2024-05-13 18:39:00 -04:00
2024-05-20 04:03:25 -04:00
* **2024-05-20:** I added entry.S and entry_alt.S, its planned replacement, and rewrote some of the code. I also switched from using the `spinning_top` crate to `spin`, since `spinning_top` did not have out-of-the-box support for a one-time spinlock. Here is a new flowchart, replacing the previous one, showing what the kernel init process is:
![A flowchart showing the kernel initialization process. On the left column are hart 0-specific steps, on the right are steps for other harts. The first stage happens in the _entry code. 1. Setting global, stack, and thread pointers. 2. Initializing the BSS (main hart only). The second stage shows the start code, where both the main hart and the other harts prepare CSRs for S-mode interrupts. This stage is also where PMP and timers would be set up. The final stage is for the main function, where the main hart (hart 0) initializes the console, paging system, processing system, and interrupts before the first user process. While hart 0 is initializing, the other harts wait for it to finish. Once hart 0 is done, the other harts will enable paging and interrupts, and all harts will enter the scheduler.](20240520-kernel_init_diagram.png)
2024-05-13 22:37:28 -04:00
2024-05-19 18:48:59 -04:00
## Research and implement
2024-05-14 12:12:11 -04:00
- [ ] Basics
- [ ] Processes
2024-05-19 18:42:50 -04:00
- [ ] Virtual address spaces, page tables
2024-05-14 12:12:11 -04:00
- [ ] Files, directories
- [ ] Pipes
- [ ] Multitasking, time-slicing
- [ ] Syscalls
- [ ] CPU cache
- [ ] User authentication, login
- [ ] File protection, permissions
- [ ] Mountable file systems
- [ ] Paging to disk
- [ ] Sockets, network support
- [ ] Interprocess communication
- [ ] Device drivers
- [ ] User applications
2024-05-19 18:42:50 -04:00
2024-05-19 18:48:59 -04:00
## Resources
2024-05-19 18:42:50 -04:00
2024-05-19 18:43:44 -04:00
See [RESOURCES.md](RESOURCES.md)