Home /Modules/operating-system/ARCHITECTURE.md

ARCHITECTURE.md

lib/operating-system/os-creator/ARCHITECTURE.md · 135 line(s) · markdown

OS Creator™ — Architecture

OS Creator™ is the SLeeLa provider that turns an object-oriented OS description (SLOSModel) into a complete, on-disk OS development tree at /os-development. It is the capstone of lib/os: where SLOSModel describes an OS and SLOSCompiler/SLISOBuilder/SLInstallerGenerator emit individual artifacts, OS Creator™ lays down every piece of the OS, its source, its configuration, and its build tooling as real files, so that running the compiled OS Creator object produces a buildable OS project top-to-bottom.

Name & mark. This component is OS Creator™. The trademark denotes the provider surface (SLOSCreator) and the /os-development layout contract described here.

1. The provider contract

   SLeeLa source: an SLOSModel (shape = Windows / Linux / macOS, arch, parts)
        |
        v
   SLOSCreator.create(model, "/os-development")      ← the OS Creator™ provider
        |
        +-- osMakeDir(...)   lays out the /os-development directory tree
        +-- piece emitters   emit C + C++ source for every OS piece
        +-- config emitters  emit each piece's configuration file
        +-- toolchain emitter emits Makefile + build.sh/build.ps1
        +-- source dropper    copies the SLeeLa source + the emitted source in
        |
        v
   /os-development            a complete, compilable OS project on disk
        |
        +-- make / build.sh    ← run the emitted toolchain to build the OS -> ISO

Running the compiled OS Creator object (the SLeeLa program that composes an SLOSModel and calls SLOSCreator.create(...)) is what materializes the tree. Every file write crosses the explicit VM/OS bridge via the openFile/write/ close and osMakeDir built-ins — the same honest bridge the rest of lib/os uses. No file is invented in memory only; the result is a real directory.

2. The OS pieces (what gets written)

OS Creator™ writes one subtree per piece of the firmware → boot → kernel → userspace → desktop chain. Each piece ships its C and C++ source in the varieties/scales the model implies, plus a configuration file:

#PieceDirectoryRoleEmitter
1UEFIfirmware/uefi/UEFI firmware entry + ESP handoffSLUEFIEmitter
2BIOSfirmware/bios/legacy BIOS/CSM entry (16-bit stub + C)SLBIOSEmitter
3Boot Loaderboot/loader/GRUB/BOOTMGR/boot.efi-shaped loaderSLBootLoaderEmitter
4Kernel Loaderboot/kernel-loader/loads + relocates the kernel imageSLKernelLoaderEmitter
5Driver Loaderkernel/driver-loader/enumerates + loads built-in/module driversSLDriverLoaderEmitter
6OS Loaderuserspace/os-loader/brings up PID 1 / the service managerSLOSLoaderEmitter
7Desktop GUI Loaderdesktop/gui-loader/starts the display server + session shellSLDesktopLoaderEmitter
8The OSos/the composed OS image + boot-chain assemble()SLCEmitter + SLCppEmitter

Each piece directory contains:

A server edition omits the Desktop GUI Loader (piece 7); a Windows shape labels the BIOS piece a CSM and the OS loader the Service Control Manager, etc. — the piece set is the same contract, the content is shape-specific.

3. The /os-development layout

/os-development/
├── MANIFEST.md                 what was generated, from which model, when
├── Makefile                    top-level build: all pieces -> ISO
├── build.sh                    POSIX build driver (Linux/macOS shapes)
├── build.ps1                   PowerShell build driver (Windows shape)
├── config/
│   └── os.conf                 the model's identity + global config
├── firmware/
│   ├── uefi/     {uefi.c, uefi.cpp, uefi.conf, README.md}
│   └── bios/     {bios.c, bios.cpp, bios.cfg, README.md}
├── boot/
│   ├── loader/        {bootloader.c, bootloader.cpp, loader.conf, README.md}
│   └── kernel-loader/ {kernel_loader.c, kernel_loader.cpp, kernel-loader.conf, README.md}
├── kernel/
│   └── driver-loader/ {driver_loader.c, driver_loader.cpp, drivers.conf, README.md}
├── userspace/
│   └── os-loader/     {os_loader.c, os_loader.cpp, services.conf, README.md}
├── desktop/
│   └── gui-loader/    {gui_loader.c, gui_loader.cpp, session.conf, README.md}
├── os/
│   ├── os_config.h             (from SLCEmitter)
│   ├── os_boot.c               (from SLCEmitter)
│   └── os_image.cpp            (from SLCppEmitter)
├── src/
│   └── sleela/                 the SLeeLa source that produced this tree
└── tools/
    └── gen-iso.sh              the ISO recipe (from SLISOBuilder)

4. Classes

ClassRole
SLOSCreatorThe OS Creator™ provider. create(model, root) lays out /os-development and drives every emitter; plan(model) returns the file plan without writing.
SLOSDevTreeOwns the /os-development directory layout: makes directories and writes files through the OS bridge; records a manifest.
SLOSPieceOne emitted piece (name, directory, C source, C++ source, config, readme).
SLUEFIEmitter, SLBIOSEmitter, SLBootLoaderEmitter, SLKernelLoaderEmitter, SLDriverLoaderEmitter, SLOSLoaderEmitter, SLDesktopLoaderEmitterPer-piece C/C++ + config emitters.
SLToolchainEmitterEmits the Makefile, build.sh, and build.ps1 that compile the written pieces into the OS and ISO.
SLSourceDropperWrites the SLeeLa source (and the emitted C/C++) into /os-development/src.

SLOSCreator reuses the existing SLCEmitter/SLCppEmitter for piece 8 (the OS itself) and SLISOBuilder for tools/gen-iso.sh, so there is one source of truth for the OS image and the ISO recipe.

5. Varieties and scales

"All their varieties and scales" is expressed two ways, both from the single SLOSModel:

6. Integrity

OS Creator™ writes into /os-development (an output tree), never into the repository's gated sources, so it does not perturb security/sha256-manifest.json (the build gate). The OS Creator™ source files themselves are ordinary /lib units recorded in lib/LIBRARY.SYMBOLS.md and SHA256-DIGESTS.md like any other library source. See lib/operating-system/OS.md for how OS Creator™ sits atop the OS model.