SchOS/docs/Website/app.js
Nexoniarz d3c37f82b6 docs: the tree moved and the documentation did not
The site and several documents still described the system as it was before
virtual terminals, the new schinit, the hybrid work and descriptor passing.

docs/architecture/init.md described the wrong program. It documented a single
schinit that parses manifests and supervises jobs, which has not been true since
PID 1 was split: PID 1 forks a supervisor, spawns jobs on its behalf and reaps;
the job table lives in /proc/schinit; a heartbeat runs both ways; and
proc_reincarnate() re-execs PID 1 in place rather than panicking. Rewritten
around what exists, keeping the reasoning that is still load-bearing -- the five
failures of the sibling-init scheme, the escalation ladder, and the three bugs in
the reincarnation path that each had to happen before they were obvious.

docs/plan/init.md is deleted, which is the tree's own rule for finished work and
had not been applied. Fourteen source comments referenced it by part number, so
they are repointed at the architecture doc by section name rather than left
dangling -- a deleted document nobody notices is worse than a stale one.

docs/architecture/devices.md gained the section it has been missing since
/dev/pci existed: what a driver needs from a kernel, why mmap is checked against
the caller's claims, why DMA is a call and not a mapping, and why the write back
after an interrupt is not optional. Also that a released device does not come
back by itself, which is true and was nowhere.

docs/architecture/networking.md gained a descriptor-passing section, and
docs/architecture/README.md's stack diagram gained the two layers and the third
seam it was missing. "Two seams hold the whole thing together" has not been true
since /dev/pci.

docs/plan/README.md said the hybrid work was deliberately last, on the argument
that an interface with no consumer is wrong in ways nobody can see. The argument
was right; the conclusion was not, and the document now says why it changed --
the alternative to a driver compatibility layer is writing a driver for every
device that exists, and the original objection is answered rather than ignored
because SchOS's own drivers are the consumers.

The site: a Hybrid section with the eviction transcript, cards for virtual
terminals, schinit and drivers outside the kernel, and the numbers remeasured
rather than estimated -- 46,961 lines, 207 syscalls. The boot log in app.js is
from a boot taken today, and the lines are trimmed to what the console can show
without clipping, each still a verbatim prefix of real output.

Two small rendering fixes found by looking at the pages rather than assuming:
.console pre's min-height is now scoped to the hero, so a static transcript sizes
to its content instead of reserving eight lines it does not have; and the docs
reader's contents panel strips inline marks from headings, so a heading written
`proc_reincarnate()` no longer carries its backticks into the sidebar.

Every intra-doc link checked; none broken.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
2026-09-13 20:05:06 +02:00

93 lines
3.2 KiB
JavaScript

/* SPDX-License-Identifier: Apache-2.0
*
* Two behaviours, no framework:
* 1. the hero console types a real boot log
* 2. sections fade in once, as they arrive
*
* Both are decoration. If this file fails to load the page is still complete
* and still readable, which is the test any script on a documentation site
* should have to pass.
*/
(function () {
"use strict";
var reduced = window.matchMedia &&
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
/* ---- 1. the boot log ------------------------------------------------
* These are real lines from a real boot, not invented ones. The timer
* calibration line in particular is there because of what it cost: the
* clock ran seven times slow until a graphics driver was made to
* acknowledge its own interrupt. See docs/history/kernel.md.
*/
var LINES = [
{ t: "[ 0.000]", k: "SchIFT", s: " 64-bit, 2 cpus" },
{ t: "[ 0.004]", k: "cpu0", s: ": lapic timer 999941980 Hz, tsc 3792 MHz" },
{ t: "[ 0.049]", k: "virtio-gpu", s: ": 1280x800, 4000 KB framebuffer" },
{ t: "[ 0.088]", k: "e1000", s: ": 52:54:00:12:34:56, link up, irq 11" },
{ t: "[ 0.143]", k: "schfs", s: ": mounted 'schos', generation 2" },
{ t: "[ 0.169]", k: "net", s: ": eth0 10.0.2.15/255.255.255.0" },
{ t: "[ 0.204]", k: "schinit", s: ": ready (pid 1)" },
{ t: "[ 0.212]", k: "schinitd", s: ": 2 job(s) loaded, generation 1", g: true },
{ t: "", k: "", s: "# " }
];
var out = document.getElementById("bootlog");
function span(cls, text) {
var e = document.createElement("span");
if (cls) e.className = cls;
e.textContent = text;
return e;
}
function emit(line) {
if (line.t) {
out.appendChild(span("t", line.t + " "));
out.appendChild(span("k", line.k));
}
out.appendChild(span(line.g ? "g" : "", line.s));
out.appendChild(document.createTextNode("\n"));
}
function cursor() {
var c = document.createElement("i");
c.className = "cursor";
out.appendChild(c);
}
if (!out) {
/* nothing to do */
} else if (reduced) {
LINES.forEach(emit); // the whole log at once, no animation
cursor();
} else {
var i = 0;
(function step() {
if (i >= LINES.length) { cursor(); return; }
emit(LINES[i++]);
/* Uneven on purpose: a boot that ticks out at a metronome's pace reads
as a progress bar rather than as a machine doing different work. */
setTimeout(step, 180 + Math.random() * 220);
})();
}
/* ---- 2. reveal on scroll ------------------------------------------ */
var targets = document.querySelectorAll(".reveal");
if (reduced || !("IntersectionObserver" in window)) {
Array.prototype.forEach.call(targets, function (el) { el.classList.add("in"); });
return;
}
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
entry.target.classList.add("in");
io.unobserve(entry.target); // once, not on every scroll past
});
}, { rootMargin: "0px 0px -12% 0px", threshold: 0.05 });
Array.prototype.forEach.call(targets, function (el) { io.observe(el); });
})();