Rename Schunix to SchOS; the kernel becomes SchIFT

Removes the "-unix" element and with it any trademark exposure to The
Open Group.

The split follows the ecosystem layout: SchOS is the system, and the
kernel has its own name. Kernel-identity strings are the only places
that take SchIFT -- uname(2) sysname, /proc/version, and the two licence
sentences that say "kernel" outright. That is what every Unix does here:
`uname -s` on Linux reports the kernel, not the distribution. Everything
a user reads as the product -- panic screen, boot menu, error prefixes,
docs, LICENSE, NOTICE -- is SchOS.

schunix.img is schos.img, the logo assets and the musl TLS patch are
renamed, and __SCHUNIX__ is __SCHOS__ (the define and the patch that
consumes it moved together).

Two things the rename broke, both found by the bootcheck suite:

  - shmtest wrote "SCHUNIX-MMAP-OK" with a hardcoded length of 15 and
    compared it back by hand-counted offsets (m[3]=='U', m[14]=='K').
    The shorter marker left the write running two bytes past the literal
    and the compare reading past the data, failing a file-backed mmap
    that was working correctly. Now written and compared through one
    constant with sizeof.
  - bootcheck asserted a 31-byte file after appending to
    "hello-from-schunix"; the shorter string makes it 29.

Both are the same mistake: a string literal whose length is written out
somewhere else. Full suite green -- base, Tty, Ps, Sock, Fb, Usb, Evdev.
This commit is contained in:
Nexoniarz 2026-08-09 14:09:59 +02:00
commit e04ca28812
83 changed files with 520 additions and 601 deletions

View file

@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Schunix — minimal init (PID 1)
// SchOS — minimal init (PID 1)
#include "types.h"
#include "user.h"
@ -89,7 +89,7 @@ main(void)
mkdir("/sys");
xputs(1, "\nSchunix\n");
xputs(1, "\nSchOS\n");
xputs(1, "init: ready (pid 1)\n");
for (;;) {
@ -102,7 +102,7 @@ main(void)
if (pid == 0) {
// exec.c auto-enables Linux ABI for musl binaries (entry >= 0x100000).
// Do NOT call enable_linux_abi() here — it corrupts Schunix syscall
// Do NOT call enable_linux_abi() here — it corrupts SchOS syscall
// numbers for the exec/exit calls that follow in this child.
// Standardized naming: the shell is always /bin/sh, regardless of
// which implementation backs it (dash, mksh, etc.) — no ksh/mksh/

View file

@ -77,19 +77,29 @@ main(void)
check(p[100] == 'X', "and so is one further into the segment");
// --- file-backed mmap --------------------------------------------------
// Written and compared through one constant, and never by hand-counted
// offsets. Those offsets used to spell out SCHUNIX-MMAP-OK a character at a
// time -- m[3]=='U' and m[14]=='K' -- with the length 15 written out
// separately. Renaming the marker to SCHOS shortened it to 13 and left both
// behind: the write ran two bytes off the end of the literal and the
// compare read past the data, which failed a file-backed mmap that was
// working correctly.
static const char MARK[] = "SCHOS-MMAP-OK";
const int MARKLEN = (int)(sizeof(MARK) - 1);
int fd = open("/tmp/shmtest.dat", O_CREATE | O_RDWR);
check(fd >= 0, "created a file to map");
if (fd >= 0) {
write(fd, "SCHUNIX-MMAP-OK", 15);
write(fd, MARK, MARKLEN);
close(fd);
}
fd = open("/tmp/shmtest.dat", O_RDONLY);
if (fd >= 0) {
char *m = mmap(0, 4096, PROT_READ, MAP_PRIVATE, fd, 0);
int ok = ((long)m > 0) &&
m[0]=='S' && m[1]=='C' && m[2]=='H' && m[3]=='U' &&
m[8]=='M' && m[13]=='O' && m[14]=='K';
int ok = ((long)m > 0);
for (int i = 0; ok && i < MARKLEN; i++)
ok = (m[i] == MARK[i]);
check(ok, "mmap of a file returns the file, not zeros");
close(fd);
} else {