How fdos/kernel works
Main Components
• Boot Loader: Represented in the “boot” directory (and supplemented by files in “bin” and “test/bootimg”). This component is responsible for bootstrapping the system. Include elements such as “boot.asm”, “oemboot.asm”, and the makefile in this directory.
• Kernel Core: The “kernel” folder contains most of the core operating system routines. Show subcomponents like:
• Basic initialization (e.g., “entry.asm”, “initdisk.c”, “initclk.c”)
• Memory management (e.g., “memmgr.c”, “memdisk.asm”)
• Process and task management (e.g., “task.c”, “procsupt.asm”)
• DOS services (e.g., “dosfns.c”, “execrh.asm”, “fatfs.c”)
• Device and I/O handling (e.g., “io.asm”, “chario.c”, “serial.asm”)
• Network and other system functions (e.g., “network.c”)
• Drivers: The “drivers” directory includes low-level drivers (like the floppy and clock drivers). This indicates separate modules interacting with the hardware.
• Header Files and Configurations: The “hdr” directory has many header files defining the structures and interfaces (like “file.h”, “device.h”, “version.h”), which are essential for inter-module communications.
• Utility & Build System: Directories like “lib”, “mkfiles”, “utils” and files such as “makefile”, “build.bat”, and “ci_build.sh” are present for building, configuration, and support tasks.
• Documentation & Test Suites: “docs”, “test”, and “tests” directories contain documentation, history, bug notes, and test programs which can show how the components are intended to function together.
Architectural Patterns and Design Principles
• Layered Architecture: Show a layered stack – hardware at the bottom, then drivers, followed by the kernel core, and finally utilities and higher-level DOS functions. This adds clarity to the separation of concerns.
• Build and CI Integration: Given the presence of CI scripts (.sh and bat files) and various makefiles, include a “Build/CI Environment” element that feeds into all components, highlighting automated builds and tests.
Specific Elements
• Each major folder (Boot, Kernel, Drivers, Lib/Utilities, Docs/Tests) represented as a block.
• For each block, add internal submodules (for example, under “Kernel Core”, indicate “Initialization”, “Memory Management”, “Task Management”, “I/O and File Systems”, “Networking”).
• Boot Loader → Kernel Core (handover control)
• Kernel Core ↔ Drivers (interrupts and I/O requests)
• Build/CI Tools → All Components (for automated builds and testing)