Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build

Latest: v2.0.1

The image builder for riscos

All the supported releases are here:

Release armv7 (ARM 32-bit, Cortex-A7)
5.30 ✅ (tar)

Note: RISC OS support is a tech preview. Remote command execution and file sync both work, and the desktop comes up on the VNC console, where a USB keyboard and mouse work (anyvm attaches usb-kbd and usb-mouse) -- see "Keyboard and mouse" below for the QEMU fix that needs.

Nothing from RISC OS Open is redistributed here. The builder downloads the official Raspberry Pi SD card image from riscosopen.org at build time; this repository's release assets carry only its own work (the patched QEMU, the agent, the injector). Note that ROOL deletes superseded media -- the 5.30 zip answers 200 while the identically-shaped 5.28 URL answers 404 -- so a new release replaces this row rather than adding one.

Linux x86_64 hosts only. The patched QEMU below is published for that platform alone, and there is no system fallback -- no released QEMU can boot RISC OS on a raspi machine at all. anyvm.py fails fast with that message on any other host rather than starting an emulator that cannot work. macOS and Windows would need the same patched build produced on those runners; that is not done yet.

No working RISC OS port of QEMU existed, so this builder makes one. files/qemu-riscos-raspi.patch is eight fixes plus a new USB NIC model, built by files/build-qemu-riscos.sh and published as this repo's own release asset. Four of the eight are generic QEMU defects with nothing to do with RISC OS: three in hcd-dwc2.c (the frame counter divided elapsed time by the frame interval in PHY clocks rather than the frame time; GINTSTS_HCHINT was raised but never lowered; the bus was started from dwc2_attach() instead of on the HPRT0 port-enable edge -- and must also be restarted when a port reset completes, see below), and one in bcm2835_dma.c, where xlen -= 4 on a uint32_t byte count wraps for any length that is not a multiple of four -- the loop then spins about 2^30 times, scribbling over guest memory as it goes. The RISC OS specific ones are a BCM2835 mailbox power channel, a VCHIQ mailbox peer, byte access on the interrupt controller and the BSC/I2C FIFO (RISC OS uses LDRB/STRB where the models demanded word access), and hw/usb/dev-smsc95xx.c, a model of the SMSC LAN9512 that is the real Pi 2's NIC -- the guest has a driver for it and for nothing else QEMU offers.

Keyboard and mouse. An earlier version of this note claimed the Pi ROM has no USB keyboard driver. It does: ROOL's USBDriver compiles in boot-protocol keyboard and mouse drivers (build/c/usbkboard, build/c/usbmouse), and No keyboard present - autobooting only means the kernel's 5-second boot-time USB discovery found nothing that early -- the Wimp rescans the bus when it starts. What actually blocked input was this builder's own QEMU patch: SOF framing was restarted on the port-enable edge only, so the second port reset RISC OS issues at Wimp startup left the frame counter frozen and no interrupt transfer was ever issued after it (the keyboard driver attached, opened its interrupt pipe, and waited forever -- riscos-vm#12). With the reset case handled, -device usb-kbd types into the desktop and -device usb-mouse moves the pointer; QEMU's usb-tablet does not, because it rejects SET_PROTOCOL, which RISC OS's mouse driver requires. RISC OS still has no text console -- it consoles on the framebuffer and writes nothing to serial -- so the guest is prepared by patching the disc image offline rather than typing an installer in (files/rofilecore.py parses FileCore's SBPr "BigDir" directories and overwrites one cosmetic boot script in place, at its existing length).

Three things about that image will bite anyone who touches it. The live boot tree does not exist in a freshly downloaded image -- RISC OS copies $.!Boot.RO530Hook.Boot into $.!Boot.Choices.Boot on first boot, so patching the pristine image patches a template that is never run, and patching a booted one lands somewhere else entirely. Every injected command must be prefixed with X (*X <cmd> runs it and discards any error), because one error stops the boot on a dialog waiting for a keypress, and the build attaches no keyboard. And injected scripts must print nothing: any console output from a Tasks hook opens the Wimp's single-tasking output screen, which waits for a keypress at the end -- same brick, different cause.

The agent. RISC OS ships no remote-access server of any kind -- checked in a running guest, where *Modules lists 137 modules whose only networking is the stack (Internet, Resolver, DHCP, EtherUSB) and clients (LanManFS for SMB, ShareFS/Freeway for Acorn Access). No telnetd, no sshd, no ftpd. So, like reactos-builder, this builder supplies the server: files/anyvmd.py, a small Python agent on port 23 (VM_TRANSPORT=telnet).

The telnet is real, not a raw socket wearing the name: IAC is unescaped inbound and doubled outbound, and BINARY (RFC 856) is accepted both ways, which is what keeps the tar stream intact. Verified against the worst case it can meet -- 4096 bytes of 0xFF (the IAC byte itself) followed by all 256 byte values, round-tripped byte-identical. It is not a shell, though: RISC OS has no pipes to a child and no &&, so the agent parses the two tar one-liners itself, services them with Python's tarfile, and prints the completion marker where a shell would have got it from the chained && echo. It also holds a persistent session, several commands down one connection, because that is what telnet_exec does.

It needs nothing installed -- ROOL's image already ships Python 2.7.2 at $.Programming.Python.!Python27 with a complete standard library. It runs inside a TaskWindow so the desktop stays interactive; single-tasking Python would freeze the machine for as long as it served, and *Shutdown would then do nothing at all.

Sync was settled on the running guest rather than assumed. There is no sshd and no ssh client (so no rsync / sshfs / scp) and no 9P client. The SD card's FAT boot partition is reachable from the guest: $.!Boot.Loader is a DOSFS image file onto it, read and write (*Cat $.!Boot.Loader lists RISCOS/IMG, CONFIG/TXT, START/ELF...). It is not a sync channel, though: the host can only get at that partition with the disc closed, so it would be a drop box for before boot and after shutdown, and tar over the agent already covers both directions live. (Fat32fs 1.63 is unrelated; it serves removable FAT media such as a FAT32 USB stick, and Fat32Map is its DOS-extension-to-filetype table.) An earlier version of this note said the boot partition could not be seen at all; that was wrong (riscos-vm#13).

How the images are built:

Each image is built automatically in the anyvm-org/riscos-builder repo's GitHub Actions: it downloads RISC OS Open's official Raspberry Pi distribution, prepares the SD-card image offline (remote access and the anyvm runtime support are injected into the image), verifies it by booting in QEMU, and exports the disk image. No interactive installer is run.

Upstream media: the official RISC OS Open Raspberry Pi downloads from https://www.riscosopen.org/content/downloads/raspberry-pi.

How to build:

  1. Use the manual.yml to build manually.

    Run the workflow manually, you will get a view-only webconsole from the output of the workflow, just open the link in your web browser.

    You will also get an interactive VNC connection port from the output, you can connect to the vm by any vnc client.

  2. Run the builder locally on your Ubuntu machine.

    Just clone the repo. and run:

    python3 build.py conf/riscos-5.30-armv7.conf

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages