SchOS/kernel/core
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz eab13241a0 hwreport: describe a machine onto a USB stick, from a Linux-style /sys
hwreport writes one folder to the first read-write FAT mount, or mounts
the first USB stick that takes vfat itself and unmounts it afterwards:
summary.txt (machine, firmware, CPU, memory, every PCI and USB device
with its driver or "-- no driver"), dmesg.txt, lspci.txt in the shape of
lspci -nnk -xxx, lsusb.txt, dmi.txt, memmap.txt, the ACPI tables as raw
.dat files iasl -d reads, and copies of /proc. Serials, the UUID and the
MSDM/SLIC tables (a Windows licence key) are left out.

It reads /sys, which is new: sysfs at Linux's paths and in Linux's
formats -- /sys/bus/pci/devices with uevent, config and resource,
/sys/bus/usb/devices, /sys/firmware/acpi/tables, dmi/tables, memmap
and efi, /sys/class/dmi/id. toybox's lspci and lsusb work unmodified
against it. The USB core now keeps a table of attached devices for it.

The machine's name comes from SMBIOS (kernel/dev/dmi.c). The UEFI loader
hands over the entry point from the configuration table, the kernel
falls back to the 0xF0000 scan, and the log gets Linux's "DMI:" line.

Two bugs found on the way:

- The loader handed over at most 40 memory-map entries, in firmware
  order. A laptop's UEFI map is 60-150 descriptors with RAM above 4 GB
  listed last, so that is what was dropped. The entries now have their
  own area at 0x31000 with room for 256, are sorted before merging, and
  the kernel's 32 usable regions keep the largest when there are more.
- MemTotal and sysinfo's totalram were PHYSTOP, an address, which counts
  the PCI hole: a 6 GB machine reported 8. Now the usable RAM, summed.

usb.ids moves to /usr/share/hwdata, where lsusb looks for it, and
pci.ids joins it (`make pci-ids`, BSD-3-Clause like usb.ids).

Checked under QEMU q35: the report written to a FAT32 stick, fsck.fat
clean, DSDT.dat disassembled by iasl on the host, lspci -k and lsusb
showing names, 6 GB of RAM seen as 6137 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
2026-10-23 12:54:11 +02:00
..
console.c dev: read /dev/zero and /dev/urandom from them, not from the keyboard 2026-10-23 09:33:08 +02:00
dma.c dma: best fit, and say which number is the problem 2026-09-14 21:28:07 +02:00
kalloc.c mm: the loader jumped out from under itself, and 3 GB was never the limit 2026-09-25 15:23:55 +02:00
klog.c licence: SchOS is GPL-2.0-or-later, no longer Apache-2.0 2026-10-22 08:48:45 +02:00
kmem.c kmem: a slab allocator, and what the fixed tables actually cost 2026-09-22 09:32:06 +02:00
ksym.c licence: SchOS is GPL-2.0-or-later, no longer Apache-2.0 2026-10-22 08:48:45 +02:00
main.c hwreport: describe a machine onto a USB stick, from a Linux-style /sys 2026-10-23 12:54:11 +02:00
panic.c psogm: fit the report on an 800x600 screen 2026-10-22 23:47:07 +02:00
qr.c Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
sbuf.c licence: SchOS is GPL-2.0-or-later, no longer Apache-2.0 2026-10-22 08:48:45 +02:00
sleeplock.c kernel: holdingsleep asks who holds the lock, not whether anyone does 2026-09-12 17:13:59 +02:00
spinlock.c Fix two bugs the Fedora move exposed 2026-08-09 19:29:21 +02:00
string.c net: the socket layer stops saying yes to things it did not do, and ping works 2026-09-12 17:14:35 +02:00
time.c boot: one line when it works, all of it when it does not 2026-09-14 21:19:50 +02:00
uaccess.c Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00