Collapse OS Documentation Browser


asm/ code/ hw/ algo.txt arch.txt avr.txt blk.txt blksrv.txt bootstrap.txt cross.txt design.txt dict.txt dis.txt drivers.txt ed.txt emul.txt faq.txt grid.txt grok.txt impl.txt intro.txt me.txt mspan.txt ps2.txt rxtx.txt sdcard.txt sega.txt selfhost.txt spi.txt usage.txt wordtbl.txt

Architecture management

To facilitate the development of the Collapse OS project, code
related to specific architectures all live in their separate
blk.fs file in /arch. This arch-specific code is organized to
live at B300. This means that, out-of-the-box, Collapse OS can
only be built with one architecture at once.

For example, /cvm/Makefile builds a blkfs with the /cvm/cvm.fs
architecture. /arch/z80/rc2014/Makefile builds a blkfs with a
/arch/z80/blk.fs architecture.

How then can you cross-compile from within Collapse OS? Out of
the box, you can't. You have to craft your own blkfs. The good
news is, it's not complicated.

For example, if you want a z80/8086 blkfs, you can start with
a z80 blkfs and graft /arch/8086/blk.fs on top of it. This could
mean, for example, that 8086 blocks start at B440. If you want
"round" blocks, you can add a "phantom" 199 marker at the end
of /arch/z80/blk.fs which would make your 8086 arch start at

Then, to have a clean system, adjust bock numbers in 8086
"ARCHM" block (B1 of 8086) to have their base offset B440
instead of B300. Finally, adjust your "ARCHM" loader word to
also load B441. You now have a clean z80/8086 Collapse OS!

Collapse OS and its documentation are created by Virgil Dupras and licensed under the GNU GPL v3.

This documentation browser by James Stanley. Please report bugs on github or to

This page generated at 2022-05-19 21:05:03 from documentation in CollapseOS snapshot 20220509.