Update flowchart

This commit is contained in:
gil 2024-05-20 03:03:25 -05:00
parent 5dfd3f780f
commit 325fa3c147
2 changed files with 4 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View file

@ -9,9 +9,11 @@ A kernel for RISC-V written in Rust. Currently focused on running on QEMU generi
## Progress ## Progress
* **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-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~~
![Flowchart (tentatively) showing the plan for the kernel's initialization process. On the left is hart 0, the main hardware thread, and on the right is hart 1...n, all other hardware threads. All harts will set the global, stack, and thread pointers, disable paging, and set the mstatus and mepc control status registers, before doing their own independent init processes. Hart 0 will disable interrupts and enter the primary initialization function, kinit, before starting the first user process. Other harts will enable interrupts, do their own init, kinit_hart, then wait for a software inter-processor interrupt.](20240519-kernel_init_diagram.png) * **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)
## Research and implement ## Research and implement