Files
FoundryOS/docs/Planning & To-Dos.md
T
2025-02-27 02:30:48 +00:00

3.1 KiB

[!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;
}