aboutsummaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst79
1 files changed, 56 insertions, 23 deletions
diff --git a/README.rst b/README.rst
index 344d76a0..c83fd7bd 100644
--- a/README.rst
+++ b/README.rst
@@ -128,14 +128,14 @@ TeachOS separates memory allocation into three specialized systems:
Virtual File System (VFS)
.........................
-A POSIX-like directory and file abstraction layer is located in `kernel/filesystem/ <kernel/kernel/filesystem>`_:
+A POSIX-like directory and file abstraction layer is located in `kernel/vfs/ <kernel/kernel/vfs>`_:
-* **Abstractions**: Managed via `directory entries <kernel/kernel/filesystem/dentry.hpp>`_, `filesystem nodes <kernel/kernel/filesystem/inode.hpp>`_, `mount hierarchies <kernel/kernel/filesystem/mount.hpp>`_, and the `open file table <kernel/kernel/filesystem/open_file_table.hpp>`_.
-* **Concrete Filesystems**:
+* **Abstractions**: Managed via `directory entries <kernel/kernel/vfs/dentry.hpp>`_, `filesystem nodes <kernel/kernel/vfs/inode.hpp>`_, `mount hierarchies <kernel/kernel/vfs/mount.hpp>`_, and the `open file table <kernel/kernel/vfs/open_file_table.hpp>`_.
+* **Concrete Filesystems**: Implemented separately, under `kernel/filesystems/ <kernel/kernel/filesystems>`_:
- - `RootFS <kernel/kernel/filesystem/rootfs>`_: An in-memory filesystem mounted at `/` during early boot.
- - `Device FS <kernel/kernel/filesystem/devfs>`_: Exposes devices as files under `/dev`.
- - `Second Extended Filesystem <kernel/kernel/filesystem/ext2>`_: An Ext2 driver.
+ - `RootFS <kernel/kernel/filesystems/rootfs>`_: An in-memory filesystem mounted at `/` during early boot.
+ - `Device FS <kernel/kernel/filesystems/devfs>`_: Exposes devices as files under `/dev`.
+ - `Second Extended Filesystem <kernel/kernel/filesystems/ext2>`_: An Ext2 driver.
Standalone Support Libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -172,6 +172,29 @@ These projects should be approached sequentially or as a joint effort:
- *Prerequisite*: A basic multitasking or thread control subsystem.
- *Scope*: Implement user-kernel privilege transitions (Ring 3 to Ring 0) utilizing platform-specific instructions. Configure page tables to separate user space virtual memory from the higher-half kernel mapping.
- *Extension*: Establish a system call dispatcher routing file and memory operations from user space to the corresponding `kapi/ <kapi>`_ implementations.
+ - *Extension*: Load and execute an ELF64 binary as the first user-space process. TeachOS already includes an ELF structure parser (`elf <libs/elf>`_), but it only reads headers and sections today — loading segments into a process address space and transferring control to them does not exist yet.
+
+Interrupt Routing, Multi-Core Bring-Up, and ACPI
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TeachOS currently boots and runs on a single core, with interrupts routed through the legacy 8259 PICs.
+Moving beyond that is foundational infrastructure that several other projects on this list — a real
+scheduler, DMA-capable device drivers, and spec-correct ACPI power management — ultimately build on:
+
+3. **Application Processor (AP) Bring-Up and SMP**:
+
+ - *Scope*: Implement the INIT-SIPI-SIPI startup sequence to bring additional CPU cores online: a real-mode trampoline, per-core state, and a documented lock-ordering discipline for structures shared across cores.
+ - *Extension*: Use the newly-online cores as the foundation for a genuine multi-core scheduler (see "Kernel Multitasking" above).
+
+4. **PIC to I/O APIC Transition**:
+
+ - *Scope*: Implement an I/O APIC device/driver pair, parse the ACPI MADT's Interrupt Source Override entries to correctly resolve legacy ISA IRQs to Global System Interrupts, and switch interrupt delivery away from the legacy 8259 PICs (via the IMCR, or the ACPI-blessed ``_PIC`` control method).
+ - *Extension*: Mask the legacy PICs once the I/O APIC path is confirmed working, and make the kernel's interrupt-acknowledgment path mode-aware.
+
+5. **ACPI AML Interpreter**:
+
+ - *Scope*: Implement a bytecode interpreter for ACPI Machine Language (AML): object namespace construction and control-method invocation (e.g. ``_STA``, ``_PS0``/``_PS3``, ``_PIC``, ``_S5``). TeachOS currently only parses static ACPI tables (the MADT and similar); AML execution is a substantial, largely self-contained undertaking on top of that and a good fit for a Bachelor's thesis on its own.
+ - *Extension*: Use the interpreter to perform a spec-correct interrupt-mode switch and ACPI S5 shutdown, replacing fixed-register/IMCR shortcuts.
Platform Ports (64-bit Architectures)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -179,11 +202,11 @@ Platform Ports (64-bit Architectures)
TeachOS currently targets only 64-bit x86 (`x86_64`).
To validate the platform-independence of the `kapi/ <kapi>`_ interface, ports to other 64-bit targets are highly encouraged:
-3. **ARM64 (AArch64) Port**:
+6. **ARM64 (AArch64) Port**:
- *Scope*: Implement the platform-defined KAPI interfaces for a 64-bit ARM target (e.g., QEMU `virt` board or Raspberry Pi 4). This includes writing the boot startup assembly, configuring the translation table (MMU paging), handling the Generic Interrupt Controller (GIC), and implementing timer ticks.
-4. **RISC-V 64-bit (RV64G) Port**:
+7. **RISC-V 64-bit (RV64G) Port**:
- *Scope*: Port TeachOS to the RISC-V 64-bit architecture. This involves implementing boot assembly, configuring page table mappings (Sv39/Sv48), setting up the Core Local Interruptor (CLINT) and Platform-Level Interrupt Controller (PLIC), and managing supervisor/user mode transitions.
@@ -193,15 +216,15 @@ Memory Management Subsystem Extensions
The current memory management uses a basic bitmap page frame allocator and a first-fit heap allocator.
There are significant opportunities to implement standard production-grade memory management schemes:
-5. **Buddy Page Allocator**:
+8. **Buddy Page Allocator**:
- *Scope*: Replace the current `bitmap_frame_allocator <kernel/kernel/memory/bitmap_allocator.hpp>`_ with a Buddy Allocator system. This manages memory allocations in power-of-two page sizes, significantly reducing external fragmentation and improving allocation speed.
-6. **Slab/Slub/Slob Object Allocator**:
+9. **Slab/Slub/Slob Object Allocator**:
- *Scope*: Implement a slab allocator on top of the physical page allocator. This caches kernel objects of identical size (such as inodes, file descriptors, and thread control blocks) to avoid constant heap fragmentation and overhead from the general-purpose `block_list_allocator <kernel/kernel/memory/block_list_allocator.hpp>`_.
-7. **Advanced Virtual Memory (Copy-on-Write, Demand Paging)**:
+10. **Advanced Virtual Memory (Copy-on-Write, Demand Paging)**:
- *Prerequisite*: A basic thread multitasking subsystem.
- *Scope*: Implement a page fault handler that dynamically loads executable segments only when touched (demand paging), or implement copy-on-write page table sharing (crucial for implementing Unix-like `fork` semantics).
@@ -212,19 +235,20 @@ Filesystem Support and VFS Extensions
The Virtual File System (VFS) is designed to host multiple concurrent filesystem types, but support is currently limited.
Project opportunities here include implementing new drivers or core VFS caching features:
-8. **Ext2 Write Support and Dynamic Allocation** (already available in experimental stage):
+11. **Ext2 Write Completion (unlink, rmdir, rename)**:
- - *Scope*: Extend the read-oriented `ext2 <kernel/kernel/filesystem/ext2/filesystem.hpp>`_ driver to support full write operations. This requires managing free inode and block bitmaps, updating directories, allocating data blocks dynamically, and maintaining superblock consistency.
+ - *Scope*: Ext2 write support — inode and block allocation, directory-entry management, and superblock consistency — is already substantially implemented in the `ext2 <kernel/kernel/filesystems/ext2/filesystem.hpp>`_ driver. The concrete remaining gap is ``unlink()``, ``rmdir()``, and ``rename()``, none of which exist yet anywhere in the VFS-facing filesystem interfaces.
+ - *Extension*: ``rename()`` across a mount boundary is a substantially harder problem than the same-filesystem case, and a good extension once the basic operations land.
-9. **New Filesystem Drivers (e.g., FAT32, ISO 9660)**:
+12. **New Filesystem Drivers (e.g., FAT32, ISO 9660)**:
- - *Scope*: Implement new filesystem drivers from scratch (such as FAT32 or ISO 9660 for CD-ROMs), allowing TeachOS to interoperate with standard virtual media and flash drives.
+ - *Scope*: Implement new filesystem drivers from scratch (such as FAT32 or ISO 9660 for CD-ROMs), allowing TeachOS to interoperate with standard virtual media and flash drives.
-10. **Unified Page Cache and Directory Entry Cache**:
+13. **Unified Page Cache and Directory Entry Cache**:
- - *Scope*: Develop a page caching subsystem that intercepts read/write VFS calls, caching recently accessed filesystem blocks in physical memory frames, and optimize pathname lookup times using a dynamic directory entry (dentry) cache.
+ - *Scope*: Develop a page caching subsystem that intercepts read/write VFS calls, caching recently accessed filesystem blocks in physical memory frames, and optimize pathname lookup times using a dynamic directory entry (dentry) cache. TeachOS currently has no page cache at all, which is a correctness concern as much as a performance one: two open file descriptors on the same file can see divergent views of the same underlying data.
-11. **Virtual Filesystems (e.g., procfs, sysfs)**:
+14. **Virtual Filesystems (e.g., procfs, sysfs)**:
- *Scope*: Create virtual filesystems that dynamically generate contents from current kernel data structures, providing userspace with debugging and configuration access interfaces.
@@ -234,15 +258,24 @@ Hardware Buses and Device Drivers
Currently, block storage is simulated via RAM disks loaded as boot modules.
Real hardware interaction requires expanding driver support:
-12. **PCI/PCIe Bus Discovery**:
+15. **PCI/PCIe Bus Discovery**:
- *Scope*: Develop a PCI/PCIe bus driver that scans configuration spaces, detects connected devices, and registers them to the virtual root bus using the `kapi::devices <kapi/kapi/devices.hpp>`_ interface.
-13. **Storage Controller Drivers (AHCI/SATA or NVMe)**:
+16. **PS/2 Keyboard Controller (Intel 8042)**:
+
+ - *Scope*: Implement a driver for the legacy 8042 keyboard controller: enumerate its keyboard (and, where present, mouse) channels as separate devices, and implement a minimal scancode translation layer. Does not require PCI discovery, which makes it a good smaller-scale companion or precursor project to USB below.
+
+17. **Storage Controller Drivers (AHCI/SATA, NVMe, or virtio-blk)**:
- *Prerequisite*: PCI bus discovery.
- - *Scope*: Write a driver for SATA controllers (AHCI) or modern NVMe drives, routing block read/write operations from the VFS to actual physical disks.
+ - *Scope*: Write a driver for SATA controllers (AHCI), modern NVMe drives, or the virtio-blk paravirtualized interface, routing block read/write operations from the VFS to actual (or emulated) physical disks. AHCI is TeachOS's QEMU machine's native, default-attached storage controller and a natural first target; virtio-blk trades realism for a simpler, more forgiving protocol under emulation.
+
+18. **USB Host Controller and Device Support**:
+
+ - *Prerequisite*: PCI bus discovery (for the xHCI host controller).
+ - *Scope*: Implement an xHCI host controller driver and USB device enumeration (descriptor requests, configuration selection), modeling each USB interface as its own device carrying a class-specific facet (e.g. HID, mass storage). A HID keyboard driver is a natural first target to prove the model end-to-end. A substantial, multi-stage project on its own.
+
+19. **Network Stack and Driver Integration**:
-14. **Network Stack and Driver Integration**:
-
- *Scope*: Interface with a network adapter (e.g., Intel e1000 or VirtIO-net), and develop a lightweight network stack (ARP, IPv4, UDP) to allow TeachOS to send and receive raw network frames.