Home /Modules/operating-system/SLOSPiece.sleela

SLOSPiece.sleela

lib/operating-system/os-creator/SLOSPiece.sleela · 106 line(s) · sleela

<< lib/operating-system/os-creator/SLOSPiece.sleela
   SLeeLa Standard Library Definition.
   Definition: Defines SLOSPiece — one emitted piece of an OS produced by
     OS Creator(TM). A piece is a named unit of the firmware -> boot -> kernel ->
     userspace -> desktop chain (UEFI, BIOS, Boot Loader, Kernel Loader, Driver
     Loader, OS Loader, Desktop GUI Loader, or the OS itself) together with the
     files that realise it: its C source, its C++ source, its configuration
     file, and a short README. SLOSCreator produces one SLOSPiece per piece and
     hands them to SLOSDevTree to be written under /os-development.
   
   This is a flat value object; the per-piece emitters fill it and SLOSDevTree
   writes it. Each piece knows its own subdirectory and base file name so the
   tree layout is derived, not hard-coded in the writer.
   
   Family: operating-system. Produced by the OS Creator(TM) piece emitters. >>
#sleela 2.5
material;
class SLOSPiece {
  < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
  << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
     or catalog can read and (where appropriate) override this record.
     Values are faithful to the subject's real origin where publicly known. >>
  String metaVersion = "1.0.0";
  int metaId = 10932;
  String metaAuthor = "Kiro Agent";
  String metaDate = "2026-10-16";
  String metaCopyright = "SLeeLa project";
  String metaTrademark = "none";
  String metaCorporation = "none";
  < metaOrigin: National | <nation> | International | Galactic >
  String metaOrigin = "International";
  String metaBirthDate = "2026-10-10";
  < metaScienceRating: maturity/robustness on a 1..10 scale >
  int metaScienceRating = 9;
  < metaNationalSchedule: a real, citable instrument or "none" >
  String metaNationalSchedule = "none";

  String getMetaVersion() { return metaVersion; }
  void setMetaVersion(String v) { metaVersion = v; }
  int getMetaId() { return metaId; }
  void setMetaId(int v) { metaId = v; }
  String getAuthor() { return metaAuthor; }
  void setAuthor(String v) { metaAuthor = v; }
  String getDate() { return metaDate; }
  void setDate(String v) { metaDate = v; }
  String getCopyright() { return metaCopyright; }
  void setCopyright(String v) { metaCopyright = v; }
  String getTrademark() { return metaTrademark; }
  void setTrademark(String v) { metaTrademark = v; }
  String getCorporation() { return metaCorporation; }
  void setCorporation(String v) { metaCorporation = v; }
  String getOrigin() { return metaOrigin; }
  void setOrigin(String v) { metaOrigin = v; }
  String getBirthDate() { return metaBirthDate; }
  void setBirthDate(String v) { metaBirthDate = v; }
  int getScienceRating() { return metaScienceRating; }
  void setScienceRating(int v) { metaScienceRating = v; }
  String getNationalSchedule() { return metaNationalSchedule; }
  void setNationalSchedule(String v) { metaNationalSchedule = v; }
  < human name, e.g. "Boot Loader" >
  String name;
  < tree-relative dir, e.g. "boot/loader" >
  String directory;
  < file stem, e.g. "bootloader" >
  String baseName;
  < the .c surface >
  String cSource;
  < the .cpp surface >
  String cppSource;
  < config file name, e.g. "loader.conf" >
  String configName;
  < config file contents >
  String configText;
  < per-piece README.md contents >
  String readme;
  int configured;

  void configure(String pieceName, String dir, String stem) {
    name = pieceName; directory = dir; baseName = stem;
    cSource = ""; cppSource = ""; configName = ""; configText = ""; readme = "";
    configured = 1;
  }

  void setC(String src)   { cSource = src; }
  void setCpp(String src) { cppSource = src; }
  void setConfig(String fileName, String text) { configName = fileName; configText = text; }
  void setReadme(String text) { readme = text; }

  < ---- Derived file paths (relative to the dev-tree root) ----------------- >
  String cPath()      { return directory + "/" + baseName + ".c"; }
  String cppPath()    { return directory + "/" + baseName + ".cpp"; }
  String configPath() { return directory + "/" + configName; }
  String readmePath() { return directory + "/README.md"; }

  < ---- Accessors ---------------------------------------------------------- >
  String pieceName()  { return name; }
  String dir()        { return directory; }
  String c()          { return cSource; }
  String cpp()        { return cppSource; }
  String config()     { return configText; }
  String configFile() { return configName; }
  String readmeText() { return readme; }
  boolean hasConfig() { return configName != ""; }
  boolean hasReadme() { return readme != ""; }
}