Skip to content
Kevin Boos edited this page Oct 17, 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
  • 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

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
    • Already in progress, Nathan Royer is actively working on this (Oct 2023)

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
    • Nearly complete as of October 2023 -- in progress by Noah Mogenson (see PR #1016)
    • 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
  • 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
    • The Rhai scripting language works on Theseus, but isn't yet fully integrated.
      • See PR #907 for a small start on it.
    • Avoids having to create & build another very basic application
    • e.g., one could type call page_allocator::dump_state()

Legacy compatibility

Other projects / meta-level projects

  • Use rustfmt with a TOML configuration
    • Also add a CI pass that checks or imposes said formatting constraints

Completed

  • Disable preemption only instead of all interrupts
    • More efficient when accessing sensitive task-related states
  • Add support for UEFI bootloaders
    • Partial support was added, but for ARM aarch64, not x86_64
  • Implement true CPU-local storage
  • Add github actions CI tool that runs build tests on each PR
  • 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
  • Bring intralinguality and safety to keyboard/mouse (PS2) devices
    • Completed thanks to @hecatia-elegua
  • Integrate async/await into Theseus
    • Initial async executor is now complete, called dreadnought. Still needs improvement.