4.2 KiB
4.2 KiB
[!todo] Testing
- setup custom test frameworks (Use CrystalOS-V2 as a reference)
- write a sub-crate for tests
- implement several unit tests on things that we are likely to break often
- setup Git CI/CD pipeline with testing
- figure out how to run QEMU in the test environment
- write a script to run tests
- a release should only be published if all tests pass
[!todo] HAL (Hardware Abstraction Layer)
- use either traits or cfg attributes to support more than just x86_64
- prefer writing cross platform code (I am aware I made the problem slightly worse by merging libk with the kernel sources)
[!todo] Allocator
- learn about several allocator designs and decide on the optimal one
- implementation
- implement an allocate method
- implement a deallocate method
- set the global allocator
- testing
- write unit tests
- many allocations
- large allocations
- allocating more memory than is available
- pass unit tests
[!todo] Threading
- implement thread switching functionality
- switch stacks
- implement multi-threading
- figure out how to turn on another core
- Scheduler
- which task goes on which thread?
- round robin / time slicing algorithm
- switch tasks on a given core
- push registers
- switch stacks
- ensure the scheduler knows where to find the stack for each thread
- move a given task to a new core
- differentiate between kernel threads and user threads
- create syscall to create a new thread
[!todo] Filesystem
- AHCI Implementation
- figure out what hard drives are attached
- read data
- write data
- FAT32 Implementation
- parse FAT header
- figure out where files are / what files are what
- parse file metadata / figure out type of file
- reading the entirety of a file into memory
- (extension) ext2 Implementation
- Syscall API
- provide a user program with file read / write access given a filename
- translate a filename into a disk location of data & the size of the data
- provide an interface to read from a file or write to a file
[!todo] APIC
- Enable APIC
- Get apic location from MSR
- Enable APIC bit flag
- Disable Legacy PIC
- Map physical APIC address to virtual memory
[!error] Page fault exception occurs when APIC is activated
- Setup Interrupt handlers to handle interrupts generated by the APIC
- Timer Interrupts
- Keyboard Interrupts
[!todo] Userspace (req: Threading, Filesystem)
- Load program into memory from disk
- requires:
- Program Loader
- Parse ELF File
- Load file into memory
- Filesystem
- Scheduler (to start and manage the process)
- Start a user process
- switch stacks
- jump to user code
[!todo] User Interface
- This will be a library so that programs in userspace can provide a user interface rather than relying on text commands from a basic terminal
- features required:
- Rendering frames to a display buffer
- requires: Frame rendering Syscall
- I/O
- syncio
- keystrokes
- asyncio
- keystrokes
- requires: I/O Syscalls
- Window struct
- stores it's size and location
- handles rendering pixels to the screen
- Widgets
- textbox / label
- single line text input
- how do we capture keyboard inputs?
- multiline text input
- how do we capture keyboard inputs?
- button
- dialog
- box widget
- figure out how to nest other widgets inside it
pub struct Window { position; dimensions; } impl Window { fn display(&self, frame: &Frame) -> Result<(), RenderError>; } pub struct Frame<'a> { window: &'a Window, data: <"... a suitable type to store pixels"> } impl<'a> Frame<'a> { pub fn display(&self) -> Result<(), RenderError> { self.window.display(self) } } pub trait Widget { fn render(&self) -> Frame; }