Pyromaniac

Examples

Example files

During the course of development, I produced a number of examples of the tool in use. Some of these are provided here. They are at varying stages of the development of Pyromaniac, although the version number and release date appear on some which may help to identify when they are from.

2020 examples

Building the RISC OS Kernel on macOS

[Asciinema!]
(Asciinema)
An example of the cross-compiling tools running within my CI environment.
This shows the build running for the RISC OS Kernel, on macOS. The process of building is split up into stages:
  • determine what is being built from CI
  • setup up the environment variables for this build
  • download and extract the tools needed for the build (from Artifactory)
  • run the riscos-amu build
  • archive the results
  • upload the archive to Artifactory (when requested)

Running BASIC on macOS

[Asciinema!]
(Asciinema)
BASIC running a few commands very early on.
This demonstrates that SWI calls work, and that the system knows about a few memory regions.

Running BASIC with modules

[Asciinema!]
(Asciinema)
BASIC a month later, with modules present, system banner, and the beginnings of networking.
We now have some more modules working, as well as the Shared C Library. Network works to the point that we can send packets. Quite a few *-commands work now. Console output is converted from Latin-1 to UTF-8 before output.

ANSIText coloured output

[Asciinema!]
(Asciinema)
ANSIText, converting RISC OS VDU sequences to ANSI terminal sequences.
The RISC OS colour selection operations are translated by the 'ansitext' implementation into terminal control codes.

Freeway works

[Asciinema!]
(Asciinema)
Freeway is now running and is able to communicate with its counterpart on another virtualised system.
Here, the system is running on a machine called 'Laputa'. By the time the *FWShow command is issued, Freeway has broadcast its information to other machines on the network and received responses. The command shows that the system has received the registration from the remote machine 'WinRPCEmu' (a RISC OS system running under RPCEmu on Windows). Although it's not visible here, the RPCEmu system happily sees the registration from 'Laputa' as well.
There's a gap in the recording which wasn't intentional - I didn't really need to pause for the module to work.

Snake in a console window

[Asciinema!]
(Asciinema)
ANSIText works well enough to be able to play Snake from INPUT magazine.
Cursor movement is now translated properly into the terminal control codes by the ANSIText VDU implementation. The program was only slightly modified to run on RISC OS - the original program was designed for a BBC.

OS_GBPB through sed

[Asciinema!]
(Asciinema)
OS_GBPB works, and C programs run.
Being able to run 'sed' means that the multi-byte file operations are working well enough that the C library can read buffered files properly. It's not an amazing demonstration, but it shows that the C library is now working well enough to be useful.

TWIN called from BASIC

[Asciinema!]
(Asciinema)
TWIN runs from within BASIC.
'TWIN' is a BASIC command which invokes the TWIN module to edit the BASIC program. Pyromaniac has its own implementation of TWIN which is incredibly simple - it just invokes a host command on the file, and then waits for it to return.
You'll find the source to the TWIN module in the example code on this page.

CLI aliases

[Asciinema!]
(Asciinema)
Aliases work at the command line.
Aliases are expanded from the system variables, and have to support the same abbreviation rules that the regular commands do. These are shown to work here - and the fact that aliases containing multiple commands are executed, too.

Tracing execution

[Asciinema!]
(Asciinema)
Using the tracing functions to trace the execution of a utility.
This demonstrates that the instruction tracing works - it's also showing how some of the instructions used to appear - LDM instead of LDMIA, LSR instead of MOV ..., LSR. These are Capstone's disassembly features.

Lots of modules

[Asciinema!]
(Asciinema)
One of the early attempts to just throw as many modules as possible at the system.
There are 217 modules present, although the first few are from Pyromaniac itself and many reported errors on initialisation.

Early example of JFPatch

[Asciinema!]
(Asciinema)
An early example of JFPatch running inside a docker container.
With Pyromaniac and JFPatch in a docker container, it's possible to put together a simple command line which is able to run Pyromaniac inside the container, with the current directory mounted, and then invoke JFPatch on the file that was supplied. Effectively allowing JFPatch to be run from macOS command line.

Network connections

[Asciinema!]
(Asciinema)
Network interface enumeration, and network connections using IPv4 and IPv6 work.
Demonstrates the mapping of the host interfaces to those that can be used by RISC OS. The stack provides IPv4 and IPv6 access to the system. The ifconfig tool was modified slightly to add support for reading the information about the IPv6 addresses - and to use SIOCGIFCONF better. The test command has some hard-coded IPv4 and IPv6 addresses in it which it will communicate with - at present there is not Resolver support for IPv6 addresses.

RAMFS and low-vector watches

[Asciinema!]
(Asciinema)
RAMFS initialisation, showing that it worked, but it did access the low vector area, triggering the watchpoints.
This example demonstrates loading FileSwitch, FileCore and RAMFS modules and then resizing the RAM disc to have some memory set aside. In doing so, it triggers a bug in FileSwitch, caused by the register for the special field being dereferenced even though it was invalid. This bug was fixed using the reported information.

Faking Git

[Asciinema!]
(Asciinema)
Experiments with running the host git tool through the Host command can make it look like you're running the command directly.
The command line shows exactly what commands are being used ('*PyromaniacHostCommand ...') but it looks like you're running git on RISC OS. Kinda. The git command is using the terminal control sequences, which the PyromaniacHostCommand implementation turns into the relevant VDU control codes on RISC OS to change colours. The VDU implementation is ANSIText, which then converts those VDU control codes back to the correct terminal control sequences. Thus, the colour that was output by the host git command changes the RISC OS state, and is then output in the right way for the terminal to have colour. The later PyromaniacGit module provides similar operation but is even more integrated to hide the host system.

ErrorCancel module

[Asciinema!]
(Asciinema)
Rick Murray's ErrorCancel module waits for an error box to turn and then clears it by pressing Escape.
It works with the Pyromaniac implementation of the error box. The Pyromaniac error box actually has a few implementations - one that does nothing, one that outputs the message to the screen like you see here, and one that uses the Python EasyGUI package to give you a desktop error box.

CObey crash

[Asciinema!]
(Asciinema)
Julie Stamp's COBey module running under Pyromaniac.
I tested it with Pyromaniac and Fortify and found that it freed the stack underneath it - triggering a Pyromaniac exception report. It's actually not that exciting, but it's useful to see that an exception in real code (not just tests) can be traced through Pyromaniac.

Drawfile rendering

[Image]
(Video)

BootMenu

[Image]
(Video)

Wimp experiment

[Image]
(Full size image)

MacOS application

[Image]
(Video)

Font_Paint, showing UTF-8

[Image]
(Full size image)

Font_Paint, with macOS fonts

[Image]
(Video)

Rendering with the classic Draw module

[Image]
(Full size image)

Running on Windows

[Image]
(Full size image)

Font rendering with Pyromaniac

[Image]
(Full size image)

Font rendering with classic FontManager

[Image]
(Full size image)

JPEG_PlotTransformed

[Image]
(Full size image)

Classic Wimp with Pyromaniac fonts

[Image]
(Full size image)

Classic Hourglass

[Image]
(Video)

BBC Game Explode

[Image]
(Video)

First tune through WaveSynth

[Sound]
(Audio)
The first working tune played through WaveSynth.
The sound system ('SOUND', handled by SoundChannels) usually plays sound through MIDI in Pyromaniac. However, in an experimental branch, the sound system can play sound using the PCM system, by loading the SoundChannels module and whatever voices are required. When this first started working, the example 'Hall Of The Mountain King' program was used to test that it worked as well as the MIDI version.
The sound isn't quite right; there's an annoying clicking in it, which is caused by the sample buffer not having a length which is a multiple of 4. I didn't realise that this was a requirement at the time, but I was very pleased that the first time I tried playing a tune it came out recognisably, and in the right pitch. The repeated note at the end would have been a sustain on the BBC, but doesn't have that effect on RISC OS.
The current version of the experimental branch plays this smoothly without glitches.
This was actually the second time I'd tried to play the tune - the first time was horribly distorted. I'd got the mu-law-to-linear conversion wrong - the values for 16bit sound are -32768 to 32767, but I was mapping to -65536 to 65535, which meant that they clipped and distorted really badly.

Application: On macOS

[Image]
(Full size image)

Application: On Windows (via Wine, on macOS)

[Image]
(Full size image)

Application: On Linux (via VNC to a local docker image, on macOS)

[Image]
(Full size image)

2021 examples

WindowManager runs with Iconbar

[Image]
(Full size image)

Filer window opens, unsorted

[Image]
(Full size image)

Filer window opens, sorted

[Image]
(Full size image)

MessageTrans_MakeMenus works

[Image]
(Full size image)

TaskManager runs and can show custom acknowledgements

[Image]
(Full size image)

Sprites begin working in the desktop

[Image]
(Full size image)

Sprites are now using the correct palette

[Image]
(Full size image)

Sprite masks are working, and alpha sprites

[Image]
(Full size image)

Using the desktop video (January 2021)

[Image]
(Video)

Comparison of Font_Paint with RISC OS Classic

[Image]
(Full size image)

FontManager's correct control code parser

[Image]
(Full size image)

RailPro runs with correct colours

[Image]
(Full size image)

*ScreenSave very nearly works

[Image]
(Full size image)

Floating keyboard LEDs window

[Image]
(Video)

Filling the screen with tiled cogs

[Image]
(Full size image)

Desktop background sprite now tiles

[Image]
(Full size image)

Desktop tiling, but in a 16 million colour mode

[Image]
(Full size image)

Using the desktop video (July 2021)

[Image]
(Video)

Breakdown of the tests (July 2021)

[Image]
(Full size image)

Pyromaniac hourglass with a percentage and bar

[Image]
(Video)

FontManager menus for the standard fonts

[Image]
(Full size image)

FontManager menus for all the host fonts

[Image]
(Full size image)

FontManager menus work in !Draw

[Image]
(Full size image)

Draw rotates text

[Image]
(Full size image)

Plot actions partially work in menus

[Image]
(Full size image)

Edit with fonts in colour

[Image]
(Full size image)

Draw colour selection

[Image]
(Full size image)

Paint loads sprite files

[Image]
(Full size image)

Maestro loads and renders tunes

[Image]
(Full size image)

Maestro plays 'It's a long way to Tipperary'

[Image]
(Video)

Desktop rendered as an SVG

[Image]
(Full size image)

The Great Escape (image)

[Image]
(Full size image)

The Great Escape (video)

[Image]
(Video)

Using the desktop video (October 2021)

[Image]
(Video)

ColourTrans HSV conversion works

[Image]
(Full size image)

Display manager shows the built in graphics modes

[Image]
(Full size image)

Full system demo video (2021)

[Image]
(Video)

Documentation: Comparison of documentation styles

[pdf]
Download

PDF showing the different styles of manuals that Acorn produced over the years, and similar styles generated by the PRM-in-XML transformation process. This gallery is itself created through PRM-in-XML.

[zip]
Download

Zip archive of the source and generated HTML for the comparison gallery.

Documentation: Example PRM-in-XML document

[pdf]
Download

PDF generated from parts of the PRM-in-XML project, for a sample of the parts of the networking system.

Documentation: Example PRM-in-XML document (RISC OS 2 style)

[pdf]
Download

PDF generated from parts of the PRM-in-XML project, for a sample of the parts of the networking system. This time, using the RISC OS 2 style variant.

2022 examples

Jan Vibe's Diamond Tree

[Image]
(Video)
[Image]
(Full size image)

Integration with the macOS Finder

[Image]
(Video)

Unicorn 2 works

[Image]
(Video)

Information about the running system

[Image]
(Full size image)
[Image]
(Full size image)
[Image]
(Full size image)

Interactivity in the UI

[Image]
(Full size image)
[Image]
(Video)
[Image]
(Video)
[Image]
(Video)

Examining the system memory

[Image]
(Full size image)
[Image]
(Video)
[Image]
(Full size image)

Coloured disassembly at the command line

[Image]
(Full size image)

FS explorer in WxWidgets

[Image]
(Video)
[Image]
(Video)
[Image]
(Full size image)

Resizing the UI

[Image]
(Video)
[Image]
(Full size image)
[Image]
(Full size image)
[Image]
(Full size image)

GTK and WxWidgets comparison

[Image]
(Full size image)

Old UtilityModule behaviour

[Image]
(Full size image)

Statistics on interfaces

[Image]
(Full size image)
[Image]
(Full size image)

OvationPro in the desktop

[Image]
(Video)

Desktop rendered as a PDF

[pdf]
Download
Cairo renders to a document just as easily as to a bitmap.

Just as it is possible to render to a SVG using the Cairo system, it is also possible to render to a PDF. Whilst SVG isn't great as a rendering medium for an operating system, a PDF is even more strange.

'Simple' IIC and GPIO devices

[Image]
(Video)
[Image]
(Video)
[Image]
(Video)
[Image]
(Full size image)
[Image]
(Full size image)
[Image]
(Video)

Graphics implementation using an OLED display

[Image]
(Full size image)
[Image]
(Video)
[Image]
(Video)
[Image]
(Video)
[Image]
(Full size image)

Graphics implementation using Turing Screen

[Image]
(Video)

Graphics implementation using a 21x7 LED display

[Image]
(Video)

Graphics implementation using the console

[Image]
(Video)

ADC experiments

[Image]
(Video)
[Image]
(Video)

PWM devices

[Image]
(Video)
[Image]
(Video)