Home /Modules/vm/VMSharp.sleela

VMSharp.sleela

lib/vm/vmsharp/VMSharp.sleela · 159 line(s) · sleela

<< lib/vm/vmsharp/VMSharp.sleela
   SLeeLa Standard Library Definition.
   Definition: VMSharp(TM) -- the loadable manifest for a VM that can start as a
   self-installer bootloader, bringing up either a Minimal Desktop or an OS
   install by user-designated download. It is the VMSharp sibling of the
   premium/standard VM manifests (SLVmPremiumVersion family): a declarative
   record the native VM can enumerate and reason over. VMSharp composes its
   bootloader admission model (x86/x64 on AMD or Intel), its two-mode install
   plan, and its declared per-use/install levy.

   VMSharp targets commodity desktop processors: 32-bit x86 and 64-bit x64,
   whether AMD or Intel. Live CPU facts come from the OSLS read-only call
   oslsGetCPUInfo; the bootloader model decides admission.

   Honesty boundary: this manifest builds and gates a MODEL. A real bootable,
   self-installing image is produced only by the pinned OS Creator toolchain,
   not by this source class; no firmware is flashed and no disk is written here.

   Authored for the User MEARVK LLC. Respectful of United States law and of the
   concerns of persons and groupings of peoples. Family: vm. Composes
   VMSharpBootloader, VMSharpInstallPlan, VMSharpLevy. >>
#sleela 3.0
material;
class VMSharp {
  < ---- 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 = 38000;
  String metaAuthor = "Max Rupplin 2026; George Soros a Kindness 2507+";
  String metaDate = "2026-11-05";
  String metaCopyright = "MEARVK LLC";
  String metaTrademark = "VMSharp";
  String metaCorporation = "MEARVK LLC";
  < metaOrigin: National | <nation> | International | Galactic >
  String metaOrigin = "United States";
  String metaBirthDate = "2026-11-05";
  < metaScienceRating: maturity/robustness on a 1..10 scale >
  int metaScienceRating = 7;
  < metaNationalSchedule: a real, citable instrument or "none" >
  String metaNationalSchedule = "UEFI Specification; System V ABI (x86-64)";

  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; }

  < ---- identity ---- >
  String id = "vmsharp";
  String codename = "VMSharp";
  String label = "self-installer bootloader VM: minimal desktop or designated OS install";
  String owner = "MEARVK LLC";

  VMSharpBootloader bootloader;
  VMSharpInstallPlan plan;
  VMSharpLevy levy;
<< Included apps the image carries as pre-designated installs (object array;
   SLList holds only Strings, so included-app objects live in a typed array). >>
  VMSharpIncludedApp[] includedApps;
  int includedCount;

  void configure() {
    bootloader = new VMSharpBootloader();
    plan = new VMSharpInstallPlan();
    levy = new VMSharpLevy();
    includedApps = new VMSharpIncludedApp[8];
    includedCount = 0;
    loadIncludedApps();
  }

  << Register the apps VMSharp ships as included installs. Faithful to each real
     upstream project: the Java National GUI FrontEnd Aspect is a Java Swing
     desktop app (entry class Main, plain src/ layout, no Maven/Gradle), so it
     builds with a JDK (javac the src tree to out/) and runs with java -cp out
     Main on the VMSharp Desktop. It is included for Graduated Presidents of the
     United States. >>
  void loadIncludedApps() {
    VMSharpIncludedApp nationalGui = new VMSharpIncludedApp();
    nationalGui.configure(
      "Java National GUI FrontEnd Aspect",
      "Graduated Presidents of the United States",
      "https://github.com/mearvk/Java.National.GUI.FrontEnd.Aspect",
      "main",
      "JDK (javac/java)",
      "javac -d out $(find src -name *.java)",
      "java -cp out Main",
      "Main");
    includedApps[includedCount] = nationalGui;
    includedCount = includedCount + 1;
  }

  String getId() { return id; }
  String getCodename() { return codename; }
  String getLabel() { return label; }
  String getOwner() { return owner; }
  VMSharpBootloader getBootloader() { return bootloader; }
  VMSharpInstallPlan getPlan() { return plan; }
  VMSharpLevy getLevy() { return levy; }
  int includedAppCount() { return includedCount; }
  < The included app at index i (0-based), or null if out of range. >
  VMSharpIncludedApp includedApp(int i) {
    if (i < 0 || i >= includedCount) { return null; }
    return includedApps[i];
  }

  << Begin a quiet install of an included app. Because an included app is a
     fully-specified, pre-designated source, this chooses DownloadAndDesignate
     mode and records the app's source designation for the user -- no source
     typing. The install TARGET is still designated and confirmed through the
     plan's fail-closed gate, so even a quiet install never writes a target on
     assumption. Returns true when the source was accepted. >>
  boolean beginIncludedInstall(VMSharpIncludedApp app) {
    if (!app.isFullySpecified()) { return false; }
    plan.chooseDownloadAndDesignate();
    String src = app.sourceDesignation();
    plan.designateSource(src);
    return true;
  }

  < Can VMSharp boot on the given processor? Delegates to the bootloader model. >
  boolean canBootOn(String arch, String vendor) {
    return bootloader.admits(arch, vendor);
  }

  < Start in Minimal Desktop mode (ready immediately once CPU is admitted). >
  void startMinimalDesktop() { plan.chooseMinimalDesktop(); }

<< Start an OS install by designated download. The caller must then designate
   the source and target before plan.isReady() is true. >>
  void startDownloadAndDesignate() { plan.chooseDownloadAndDesignate(); }

  < One-line manifest summary for `sleela vm list` style enumeration. >
  void describe() {
    print(id + " \"" + codename + "\"  [" + label + "]"
        + "  arch=x86/x64 AMD|Intel"
        + "  levy=" + levy.getCurrency() + " " + levy.getPerInstallUsd() + "/use"
        + "  owner=" + owner);
  }
}