SCFF, the SchOS Compressed File Format (include/fs/scff.h), is a block image cut into 128 KB chunks, each its own zstd frame, behind an index. tools/mkscff writes it from fs-ram.img on every core (-19, 11 s) and checks each chunk decompresses to itself. The kernel carries the .scff as its ramdisk and unpacks a chunk the first time a block in it is read; zero blocks share one page. The kernel and the ISO are the compressed size, and the root costs memory only for what is touched. See docs/architecture/scff.md. zstd 1.5.7 comes from ports/zstd like uACPI: the decoder is compiled into the kernel at -O2, with a static context and a 64 KB stack of its own, and mkscff builds the whole library from the same release. world now has xorg-server, the fbdev and evdev drivers, xinit, Window Maker, xterm and DejaVu, and /root/.xinitrc runs wmaker. That root is 358 MB, 102 MB as SCFF. The ISO no longer carries the root a third time as an ISO 9660 tree, which nothing read. schos.iso: 1389 MB -> 318 MB. El Torito keeps its own copy of the EFI image, the layout real machines have booted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S1giNvrHTrPMPw7V6x1kQ4
43 lines
1.4 KiB
Makefile
43 lines
1.4 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# zstd -- the decompressor behind SCFF, the compressed live root. Dual
|
|
# BSD-3-Clause / GPL-2.0; see LICENSE and COPYING in the tarball and
|
|
# docs/licensing.md.
|
|
#
|
|
# Kernel code, like uACPI: nothing is installed into the sysroot. This
|
|
# directory fetches and unpacks a pinned release, and the top-level Makefile
|
|
# compiles the decoder half of lib/ straight into the kernel against
|
|
# kernel/scff/compat, which stands in for the libc headers it includes. The
|
|
# host side, tools/mkscff, links the system's libzstd.
|
|
#
|
|
# Chosen for what SCFF asks of a codec: compress as hard as the build likes,
|
|
# once, and decompress at memory speed on every first read of a block.
|
|
|
|
include ../mk/port.mk
|
|
|
|
ZSTD_VERSION := 1.5.7
|
|
ZSTD_URL := https://github.com/facebook/zstd/releases/download/v$(ZSTD_VERSION)/zstd-$(ZSTD_VERSION).tar.gz
|
|
ZSTD_SHA256 := eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3
|
|
|
|
TARBALL := $(DISTDIR)/zstd-$(ZSTD_VERSION).tar.gz
|
|
|
|
$(TARBALL): | $(DISTDIR)
|
|
curl -fsSL -o $@ $(ZSTD_URL)
|
|
sh $(SHA256CHECK) "$(ZSTD_SHA256)" "$@"
|
|
|
|
download: $(TARBALL)
|
|
|
|
$(SRCDIR): $(TARBALL)
|
|
mkdir -p $(PORTDIR)
|
|
cd $(PORTDIR) && tar xzf $(abspath $<)
|
|
mv $(PORTDIR)/zstd-$(ZSTD_VERSION) $@
|
|
|
|
# The kernel build depends on this directory existing, nothing more.
|
|
all: | $(SRCDIR)
|
|
|
|
install:
|
|
|
|
clean:
|
|
rm -rf $(PORTDIR)
|
|
|
|
distclean: clean
|
|
rm -f $(TARBALL)
|