X runs without -dumbSched; the ISO ships r8169 and the licences
Tried in QEMU on a built ISO: startx brings up Window Maker, xclock and xeyes connect and disconnect, an xterm runs and exits, Xorg stays up -- the pthread_join crash is gone with threads. -dumbSched is removed from .xserverrc. make iso now stages Linux's r8169 set first when this machine has the modules (ldls-r8169-if-present), and sysroot-install puts LICENSE, LICENSE.MIT and NOTICE in /usr/share/licenses/schos. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EVRhxi9zpdW2uDUN4FVcao
This commit is contained in:
parent
1334f446cc
commit
6e78bb0d5e
3 changed files with 28 additions and 13 deletions
16
Makefile
16
Makefile
|
|
@ -804,6 +804,7 @@ projects:
|
||||||
# CFLAGS and make cannot see that.
|
# CFLAGS and make cannot see that.
|
||||||
# -----------------------------------------------------------------------
|
# -----------------------------------------------------------------------
|
||||||
iso:
|
iso:
|
||||||
|
@$(MAKE) --no-print-directory ldls-r8169-if-present
|
||||||
$(MAKE) RAMROOT=1 schos.iso
|
$(MAKE) RAMROOT=1 schos.iso
|
||||||
|
|
||||||
# One El Torito entry, pointing at a FAT image holding the loader and kernel.
|
# One El Torito entry, pointing at a FAT image holding the loader and kernel.
|
||||||
|
|
@ -1427,6 +1428,15 @@ ldls-r8169:
|
||||||
*) cp $$f $(SYSROOT)/lib/firmware/rtl_nic/;; esac; done
|
*) cp $$f $(SYSROOT)/lib/firmware/rtl_nic/;; esac; done
|
||||||
@echo "staged Linux r8169 ($(shell uname -r)) into $(SYSROOT)"
|
@echo "staged Linux r8169 ($(shell uname -r)) into $(SYSROOT)"
|
||||||
|
|
||||||
|
# `make iso` runs this first: the ISO ships Linux's r8169 set (NOTICE), so stage it whenever
|
||||||
|
# this machine has the modules and the BTF to stage it from, and say so when it does not.
|
||||||
|
ldls-r8169-if-present:
|
||||||
|
@if ls $(LDLS_KDIR)/drivers/net/ethernet/realtek/r8169.ko* >/dev/null 2>&1 && [ -r /sys/kernel/btf/vmlinux ]; then \
|
||||||
|
$(MAKE) --no-print-directory ldls-r8169; \
|
||||||
|
else \
|
||||||
|
echo "iso: no Linux r8169 modules or BTF on this machine ($(LDLS_KDIR)) -- this ISO will not carry them"; \
|
||||||
|
fi
|
||||||
|
|
||||||
ldls-unstage:
|
ldls-unstage:
|
||||||
rm -rf $(SYSROOT)/lib/modules
|
rm -rf $(SYSROOT)/lib/modules
|
||||||
@echo "removed"
|
@echo "removed"
|
||||||
|
|
@ -1497,6 +1507,10 @@ etc-install: $(SCHINIT_JOBS) $(ETC_PLAIN) $(ETC_ZSH) $(LOGO_ASCII) $(SRV_FILES)
|
||||||
@mkdir -p $(SYSROOT)/usr/share/hwdata
|
@mkdir -p $(SYSROOT)/usr/share/hwdata
|
||||||
@rm -f $(SYSROOT)/usr/share/usb.ids
|
@rm -f $(SYSROOT)/usr/share/usb.ids
|
||||||
@for f in usb.ids pci.ids; do [ -f dist/$$f ] && cp -p dist/$$f $(SYSROOT)/usr/share/hwdata/; done; true
|
@for f in usb.ids pci.ids; do [ -f dist/$$f ] && cp -p dist/$$f $(SYSROOT)/usr/share/hwdata/; done; true
|
||||||
|
@# The licences travel with the image: SchOS's, xv6's, and NOTICE, which carries the
|
||||||
|
@# third-party ones -- including Linux's r8169 modules, whose source offer it records.
|
||||||
|
@mkdir -p $(SYSROOT)/usr/share/licenses/schos
|
||||||
|
@cp -p LICENSE LICENSE.MIT NOTICE $(SYSROOT)/usr/share/licenses/schos/
|
||||||
@echo "installed $(words $(ETC_PLAIN)) /etc file(s), $(words $(ETC_ZSH)) zsh file(s) and $(words $(SCHINIT_JOBS)) schinit manifest(s)"
|
@echo "installed $(words $(ETC_PLAIN)) /etc file(s), $(words $(ETC_ZSH)) zsh file(s) and $(words $(SCHINIT_JOBS)) schinit manifest(s)"
|
||||||
|
|
||||||
# The mount points. Created here rather than by init, because a mkdir on a
|
# The mount points. Created here rather than by init, because a mkdir on a
|
||||||
|
|
@ -1844,4 +1858,4 @@ distclean: clean
|
||||||
-include $(shell find $(BUILD) \( -path $(BUILD)/aroot -o -path $(BUILD)/iso -o -path $(BUILD)/ports \) -prune -o -type f -name '*.d' -print 2>/dev/null)
|
-include $(shell find $(BUILD) \( -path $(BUILD)/aroot -o -path $(BUILD)/iso -o -path $(BUILD)/ports \) -prune -o -type f -name '*.d' -print 2>/dev/null)
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
.PHONY: FORCE
|
.PHONY: FORCE ldls-r8169-if-present
|
||||||
|
|
|
||||||
|
|
@ -40,11 +40,12 @@ the real program is for.
|
||||||
## The four files
|
## The four files
|
||||||
|
|
||||||
- **`/root/.xserverrc`** starts `X` on the VT `startx` was started from (startx works that
|
- **`/root/.xserverrc`** starts `X` on the VT `startx` was started from (startx works that
|
||||||
out only when `uname -s` says Linux, and SchOS's says SchIFT) with **`-dumbSched`**. Xorg
|
out only when `uname -s` says Linux, and SchOS's says SchIFT). It used to add **`-dumbSched`**,
|
||||||
normally reads input on a thread of its own; when SchOS had no threads the server crashed
|
Xorg's switch for reading input on the main loop, because Xorg normally reads input on a
|
||||||
the first time a client disconnected, in `pthread_join` on a thread that was never made, and
|
thread of its own and, when SchOS had no threads, the server crashed the first time a client
|
||||||
`-dumbSched` is Xorg's own switch for input on the main loop. Threads exist now; the switch
|
disconnected, in `pthread_join` on a thread that was never made. Threads exist now and the switch
|
||||||
is still on, and nobody has run the server without it since.
|
is gone: under QEMU, X starts with Window Maker, `xclock` and `xeyes` connect and disconnect, an
|
||||||
|
`xterm` runs and exits, and the server stays up.
|
||||||
- **`/root/.xinitrc`** is `exec wmaker`. Without it xinit falls back to twm and an xterm, which
|
- **`/root/.xinitrc`** is `exec wmaker`. Without it xinit falls back to twm and an xterm, which
|
||||||
are not in the image.
|
are not in the image.
|
||||||
- **`/etc/X11/xorg.conf.d/10-schos.conf`** names the input devices. Alpine's Xorg asks udev for
|
- **`/etc/X11/xorg.conf.d/10-schos.conf`** names the input devices. Alpine's Xorg asks udev for
|
||||||
|
|
|
||||||
|
|
@ -97,12 +97,12 @@ mkdir -p "$P/etc/profile.d"
|
||||||
grep -v '^export \(PATH\|HOME\|TERM\)=' "$P/etc/profile" > "$P/etc/profile.d/schos.sh"
|
grep -v '^export \(PATH\|HOME\|TERM\)=' "$P/etc/profile" > "$P/etc/profile.d/schos.sh"
|
||||||
rm -f "$P/etc/profile"
|
rm -f "$P/etc/profile"
|
||||||
|
|
||||||
# How startx starts the X server for root: Alpine's xserverrc, plus
|
# How startx starts the X server for root: Alpine's xserverrc. (It used to add
|
||||||
# -dumbSched. Xorg reads input on a thread of its own; when SchOS had no threads
|
# -dumbSched, Xorg's switch for reading input on the main loop, because when SchOS
|
||||||
# the server crashed on its way out the first time a client disconnected, in
|
# had no threads the server crashed on its way out the first time a client
|
||||||
# pthread_join on a thread that was never made. -dumbSched is Xorg's own switch
|
# disconnected, in pthread_join on a thread that was never made. SchOS has threads
|
||||||
# for input on the main loop. SchOS has threads now (clone, futex), so this may
|
# now; X was run without the switch under QEMU -- clients connecting and
|
||||||
# no longer be needed -- it has simply not been tried without it. The file is
|
# disconnecting, an xterm starting and exiting -- and it stays up.) The file is
|
||||||
# root's own rather than /etc/X11/xinit/xserverrc, which belongs to the xinit
|
# root's own rather than /etc/X11/xinit/xserverrc, which belongs to the xinit
|
||||||
# package.
|
# package.
|
||||||
mkdir -p "$P/root"
|
mkdir -p "$P/root"
|
||||||
|
|
@ -111,7 +111,7 @@ cat > "$P/root/.xserverrc" <<'XEOF'
|
||||||
# The VT X runs on is the one startx was started from. startx works that out
|
# The VT X runs on is the one startx was started from. startx works that out
|
||||||
# only when `uname -s` says Linux, and SchOS's says SchIFT.
|
# only when `uname -s` says Linux, and SchOS's says SchIFT.
|
||||||
vt=$(tty | sed -n 's|^/dev/tty\([0-9][0-9]*\)$|vt\1|p')
|
vt=$(tty | sed -n 's|^/dev/tty\([0-9][0-9]*\)$|vt\1|p')
|
||||||
exec /usr/bin/X -nolisten tcp -dumbSched $vt "$@"
|
exec /usr/bin/X -nolisten tcp $vt "$@"
|
||||||
XEOF
|
XEOF
|
||||||
|
|
||||||
# What startx runs inside it: Window Maker, which world installs. Without this
|
# What startx runs inside it: Window Maker, which world installs. Without this
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue