Skip to content
Kevin Boos edited this page Mar 3, 2023 · 12 revisions

Welcome to the Theseus wiki!

Note: we have a new project tracker -- check it out here!

Currently this is used as an informal space to dump project ideas.

Ongoing Projects and Project Ideas

The projects below are loosely sorted into categories, but often touch more than one area.

General OS

  • Dynamically-loaded device drivers
    • Currently, driver crates are always loaded, but are only initialized if the device is present. This is wasteful and unnecessary.
    • Should use Theseusโ€™s crate loading functionality to load driver crates only if/when the actual device is connected.
    • Requires creating a simple mapping from device ID to driver
    • Example test cases: ATA driver, e1000, etc
      • Start with devices that are easy to add/remove via QEMU
  • Use blocking locks, events, channels, etc. instead of spin locks that waste CPU
  • Disable preemption only instead of all interrupts
    • More efficient when accessing sensitive task-related states
  • Redesign wait events and/or condition variables
    • Use proper guard types with Drop handlers
  • Push stack traces after panics/exceptions to VGA terminal instead of just to the serial log
    • Important for execution on real hardware
  • Create better abstraction for logging
    • Save logs to memory (ringbuffer?) or file
    • Either in addition to or instead of serial port
    • Generic high-level writer backends are supported in 358238c and d6b86b6
  • Add support for UEFI bootloaders
    • Partial support was added, but for ARM aarch64, not x86_64

Device Support

  • Add support to access VBE info from Rust to change VESA resolution dynamically
  • Dynamic device detection (e.g., plug-n-play support)
    • Currently, devices are just detected once at boot time
    • Should be a way to be notified of device connection
      • Worst case, we can just manually re-scan PCI bus
  • Proper shutdown using ACPI
    • Initial version doesnโ€™t require full ACPICA support
    • Can be expanded into fuller power management by parsing ACPICA
  • Add DMA support to ATA disk driver
  • Add support for Intel integrated graphics card
  • Add USB support
    • See the old PR #92 for a partial implementation / starting point

Memory

  • Re-add MappedPagesMut/MappedPagesExec dedicated types that perform compile-time checking for proper EntryFlags-related access.
    • Kevin has 2 old branches for this, both work but need updating.
  • Support huge pages
    • Already partially started by Namitha & Bowen for CPSC626
    • Modify MappedPages, Page, PageRange, and PageAllocator to support large/huge pages beyond 4KiB.
    • Use Rust generics to make the various Page/Frame-related types generic to page size, but make 4KiB the default.
    • Use of experimental const generics is preferred
  • Add support for demand paging
  • Support memory mapping of files within the MappedPages type
  • Disable MMU and virtual addressing (on x86)
    • Collapse virtual addresses and physical addresses into the same thing
    • Idea: start by creating dummy versions of page allocator & mapper (MappedPages) that do nothing but return success.

Rust-oriented

  • Create a generic abstraction that combines the core logic of the page and frame allocator, using Rust traits.
    • Most of the logic is the same for every allocator, they just need to allocate and track metadata for different types of objects.
    • This generic abstraction would be agnostic to what is being allocated
  • Remove unsafely from task spawning (again...) and test on real hardware
  • Bring intralinguality and safety to keyboard/mouse (PS2) devices
  • Integrate async/await into Theseus
    • Already partially started, based on Caihua / Ketaki's CPSC 626 project
  • Use const generics and/or min specialization in various places where beneficial
    • e.g., interrupt handlers, primitive arrays
  • PeekFS-style idea - expose kernel states via filesystem
    • Use debug information to do so programmatically
  • Create "interpreter" that can invoke arbitrary OS functions dynamically
    • Avoids having to create & build another very basic application
    • e.g., one could type call page_allocator::dump_state()

Legacy compatibility

  • Port Rustโ€™s std lib to Theseus
  • Implement libc for Theseus
    • Currently in progress
  • Support basic libc functions & data types
    • Prioritize those used in Rust std lib

Other projects / meta-level projects

  • Add github actions CI tool that runs build tests on each PR
    • Possible extensions: basic run test (make run gets to blank shell),
      code formatting, etc

Completed

  • Write a better page allocator or frame allocator
    • Track allocations with a safe, dynamic data structure, but avoid cyclical allocation
    • Transparently support early pre-heap allocations
  • Properly deallocate frames when dropping & unmapping a MappedPages object.
    • Can likely avoid having to store an arbitrary number of "Allocated Frames" objects in the parent Mapped Pages object, because we can obtain the exact frames that each page was mapped to while we are walking the page tables to unmap them (clear those PTEs)
  • Add โ€œembeddedโ€ MappedPages feature to encode a MappedPages object at the end of its own memory
    • struct EmbeddedMappedPages<T> {
          inner: T,
          // fields of MappedPages are at the end
          embedded: (p4_frame, AllocatedPages, EntryFlags),
      } 
    • Before creating it, require that the size of T is smaller than the size of the underlying memory region minus the size of the inner Mapped pages fields
    • The drop handler for EmbeddedMappedPages must extract and re-create the original MappedPages so that it can be properly dropped.
    • Note: this is available in the embedded_mapped_pages branch in the upstream, but it hasn't been merged because it still needs documentation and introduces some additional unsafe code. Plus, I haven't seen a true need for it yet, so I'm saving it for later. upstream.
  • Offer basic C toolchain
    • Merged into the main branch.
  • Support GitHub pages that auto-build the Theseus documentation, both the source-level and book docs.
    • Merged into the main branch, thanks to @apogeeoak.
  • Real FS support
  • Create a generic abstraction that merges the implementation of VirtualAddress and PhysicalAddress together. This is Issue #350.
  • Move MappedPages::as_func() into the crate manager code
    • Enables properly checking for function code size
    • Realized in fbe80b0
    • Optional improvement: use debug info to check that type signatures match
  • Clippy support
    • Follow and apply its suggestions for code improvements/fixes
Clone this wiki locally