SchOS/ports/alpine/world
Nexoniarz c77841ce3d Sound through ALSA, a 2D game, and a stack walk that cannot panic
SDL 3 has no OSS backend and SchOS has no ALSA kernel side, so sound now
goes SDL -> alsa-lib -> alsa-plugins' OSS plugin -> /dev/dsp. That path
found two bugs underneath it:

- ac97: resetting the PCM-out box also clears the descriptor list address,
  and nothing set it again. Every stream after the first stop played a
  "list" at physical address 0 -- silence -- and ALSA resets before each
  stream. If the engine halts at the end of the queue, the run bit is set
  again.
- /dev/dsp: SETFRAGMENT, GETFMTS, GETCAPS, SETTRIGGER, GETOPTR and GETODELAY
  for the plugin's ring-and-pointer model, and poll(), writable once a whole
  fragment fits (ALSA spun at 76% CPU otherwise). speaker-test now plays in
  real time at 0% CPU, verified in a recording of QEMU's AC'97.
- /etc/asound.conf: the default device is a plug to the OSS device at 16-bit
  stereo 48 kHz, what every SchOS audio driver plays.

Also:

- getstackpcs: each frame link must go up the same stack by less than
  KSTACKSIZE. The chain ends at the syscall entry with the user's rbp,
  which lbreakouthd uses as a register (-1024); the walk dereferenced it
  under the syscall tracer and the kernel panicked inside acquire().
- fb: FBIOGET_VSCREENINFO reports nominal timings, as Linux's efifb does,
  instead of zeros, which Xorg's fbdev turned into a 0 Hz RandR mode.
- procdump (Ctrl-P) shows where runnable threads are in user space.
- World: lbreakouthd instead of lbreakout2 (its stk.c passes vsnprintf a
  size of 511 plus the prefix length, and Alpine's fortified headers trap on
  that), plus curl, alsa-lib and alsa-plugins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
2026-10-25 05:39:16 +01:00

58 lines
2 KiB
Text

# Alpine packages built into the apk-managed root, one per line.
#
# Edit this, then run `make alpine-lock` to resolve it, with every dependency,
# into world.lock -- exact versions and checksums. A normal build installs
# exactly what world.lock says from dist/alpine/, downloading only files it
# does not have yet, and never asks Alpine what is newer. That happens only
# when you run `make alpine-lock` again.
#
# Anything else is one `apk add` away on the running system; this list is
# what a fresh image starts with.
# The login shell. Replaces SchOS's own zsh port.
zsh
# Terminal descriptions for zsh, htop, and everything else that draws.
ncurses-terminfo-base
# The PCI and USB ID databases: lspci, fastfetch and Xorg read them.
hwdata-pci
hwdata-usb
# X on the framebuffer, with startx. /root/.xserverrc and .xinitrc (from
# mkaroot.sh) start it with -dumbSched and run Window Maker in it.
xorg-server
xf86-video-fbdev
xf86-input-evdev
xinit
# The desktop: Window Maker, a terminal for it, and a font for both.
windowmaker
xterm
font-dejavu
# Stress: terminal programs that draw, multiplex and poll. htop and btop read
# /proc hard; tmux wants ptys, sockets and signals; mc does everything at once.
htop
btop
tmux
mc
ncdu
fastfetch
# Games. In the terminal: nethack, the BSD set, and two toys. On X:
# lbreakouthd (SDL 2) and the classic X clients. Not lbreakout2: its stk.c
# hands vsnprintf a size of 511 + the prefix length, and Alpine's fortified
# headers trap on that before it loads its first image -- on Alpine too.
nethack
bsd-games
cmatrix
sl
lbreakouthd
xeyes
xclock
xcalc
# A browser: NetSurf, on GTK 3 -- glib's threads, cairo, pango, TLS. The step
# before WebKit (epiphany), which is `apk add` away.
netsurf
# curl's command line; libcurl is already here for NetSurf.
curl
# Sound for everything that speaks ALSA, SDL included: alsa-lib with the OSS
# plugin, pointed at /dev/dsp by schos-base's /etc/asound.conf. SchOS has OSS,
# not ALSA's kernel side, and SDL 3 has no OSS backend of its own.
alsa-lib
alsa-plugins