SchOS/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz 75ccf9841c errno: -1 is EPERM, and four places were saying it by accident
Ctrl-C killed the shell. consoleread() breaks off the read in progress when
SIGINT arrives and returned -1 to do it -- and -1 is -EPERM by the time it
reaches a program, so every program that handles SIGINT by carrying on saw a
permanent error instead of an interrupted call:

    zsh: error on TTY read: operation not permitted
    schinitd: restarting os.schos.console-shell

and the next Ctrl-C did it to the replacement. EINTR now, which is what a
signal-interrupted read is required to give. Verified: Ctrl-C an interruptible
command, shell survives, zero restarts.

Same mistake, same file family: link, unlink, rename and renameat returned -1
on every error path. Callers branch on errno -- `if (unlink(p) < 0 && errno !=
ENOENT)` is the standard shape, and against EPERM it always complains -- which
is why zsh reported failures for things that had worked. They return ENOENT,
EEXIST, EXDEV, EISDIR, ENOTEMPTY and EFAULT now. About ninety other `return -1`s
remain in sys_fs.c; these four are done because these four were what a program
tripped over. /dev/mem's unknown minors return ENODEV rather than -1 too.

/dev/urandom was a linear congruential generator seeded with a **constant**, so
every boot produced the same bytes in the same order -- not weak, the same. A
key, a nonce, a temporary filename: shared with every SchOS machine that had
ever run. Seeded at boot from RDRAND where the CPU has it, from the cycle
counter and the wall clock where it does not, and re-stirred per byte. Still an
LCG and still not a CSPRNG; what changed is the part that was dangerous rather
than merely poor.

**Not fixed, and recorded as such:** rename() still will not replace an existing
target, so zsh's history save fails on every exit after the first. An attempt to
unlink the target first was reverted -- the directory is an HTree, dirunlink
followed by dirlink of the same name did not behave, and it panicked in
filewrite with the old file already gone. Losing both files is worse than
refusing, so it refuses until the HTree's slot reuse is understood.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
2026-09-14 22:12:28 +02:00
..
asm.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
buf.h Raise the disk ceiling: 64-bit blocks, no FSSIZE panic, LBA48 2026-08-10 18:50:31 +02:00
config_sinit.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
date.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
dbg.h debugger: D5, the network transport -- and the plan closes 2026-09-14 15:33:53 +02:00
defs.h errno: -1 is EPERM, and four places were saying it by accident 2026-09-14 22:12:28 +02:00
device.h docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
display.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
dma.h dma: best fit, and say which number is the problem 2026-09-14 21:28:07 +02:00
elf.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
errno.h schfs: a format version policy, and refusing is not falling back 2026-09-12 17:13:59 +02:00
fb.h Rename Schunix to SchOS; the kernel becomes SchIFT 2026-08-09 14:09:59 +02:00
fcntl.h Rename Schunix to SchOS; the kernel becomes SchIFT 2026-08-09 14:09:59 +02:00
file.h fs: devtmpfs, so /dev is generated rather than written to a disk 2026-09-12 20:18:30 +02:00
font.h Rename Schunix to SchOS; the kernel becomes SchIFT 2026-08-09 14:09:59 +02:00
fs.h init survives stray signals; commands are 4-34x faster 2026-08-09 15:54:05 +02:00
fsstat.h fs: timestamps come from the clock, and /proc/fsstat says how full the tables are 2026-09-12 17:14:14 +02:00
gfx.h init: PID 1 becomes a role -- schinit splits, schinitd supervises 2026-09-13 13:57:27 +02:00
input.h usb-hid: bind an absolute pointer, and plumb EV_ABS through 2026-08-10 18:27:01 +02:00
ioperm.h ldls: a second driver, and everything it found 2026-09-14 15:20:07 +02:00
irq.h hybrid: interrupts to userspace, and a crashed driver that stays crashed 2026-09-13 18:11:00 +02:00
kbd.h tty: AltGr+F1..F6 by default, and AltGr+-/+ to step 2026-09-13 13:22:01 +02:00
klog.h debugger: D5, the network transport -- and the plan closes 2026-09-14 15:33:53 +02:00
logo.h docs: a branding folder, and the three marks are not interchangeable 2026-09-12 18:19:09 +02:00
memlayout.h Free every usable memory region, not one contiguous run 2026-08-09 20:03:51 +02:00
mmu.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
mp.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
netdev.h net: a frame wakes the stack, instead of waiting for the clock 2026-09-12 17:23:46 +02:00
netuser.h ldls: L4 was free after all, and the plan closes 2026-09-14 13:37:04 +02:00
param.h ldls: a network, in a process 2026-09-14 08:31:06 +02:00
pci.h hybrid: the GPU driver now runs in userspace 2026-09-13 18:27:41 +02:00
pciuser.h hybrid: the GPU driver now runs in userspace 2026-09-13 18:27:41 +02:00
posix.h debugger: the kernel can be asked a question 2026-09-14 00:58:45 +02:00
proc.h ldls: a second driver, and everything it found 2026-09-14 15:20:07 +02:00
qr.h docs: four directories, and a rule for when a thing leaves the roadmap 2026-09-12 17:13:35 +02:00
sbuf.h debugger: D5, the network transport -- and the plan closes 2026-09-14 15:33:53 +02:00
schboot.h boot/uefi: the memory map the kernel gets is the one the firmware agreed to 2026-08-11 11:42:22 +02:00
schfs.h schfs: records at arbitrary offsets are packed, and the compiler is told 2026-09-12 17:56:36 +02:00
schinit.h hybrid: the driver is killed, and the driver comes back 2026-09-14 00:05:43 +02:00
sleeplock.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
socket.h debugger: D5, the network transport -- and the plan closes 2026-09-14 15:33:53 +02:00
spinlock.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
stat.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
syscall.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
text.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
theme.h gfx: the console and the crash screen stop drawing on a driver by name 2026-08-15 17:04:10 +02:00
traps.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
ttf.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
types.h Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
uaccess.h Rename Schunix to SchOS; the kernel becomes SchIFT 2026-08-09 14:09:59 +02:00
usb.h usb-hid: bind an absolute pointer, and plumb EV_ABS through 2026-08-10 18:27:01 +02:00
user.h sockets: a descriptor can cross between processes 2026-09-13 19:49:37 +02:00
virtio.h hybrid: a modeset, from a process 2026-09-14 01:36:05 +02:00
vt.h tty: AltGr+F1..F6 by default, and AltGr+-/+ to step 2026-09-13 13:22:01 +02:00
x86.h schfs: the commit barrier, reflink, and attributes with an index over them 2026-08-15 16:02:02 +02:00