Genode / RISC OS

I would like to tell you a bit of my project and why it is kind of a dead end. I have been interested in multi cpu core systems since it allows you to run completely different code at the same time without virtualisation. My first demo was with NetBSD running at one core and RISC OS on another. RISC OS was the main system, as in what you can see. It displayed NetBSD framebuffer in a window and also made it possible to interact with it. My second demo , which is also open source, was RISC OS running in parallel with Genode. I think it turned out quite well. I worked with it night and day in a few weeks before my crowd funded trip to Bristol. It isn’t just Genode code but also a lot of driver development in RISC OS. It also features the possibility to “download” files to RISC OS from Genode, but no real filesystem. It is strictly only for iMX8 because of my (ab)use of the message unit. The message unit is clearly not indented to work between the big cores, but it can be used for provoke interrupts and when this happen write / read its data registers. The keyboard is interrupt driven and the mouse movement is polled.

The original plan was to have RISC OS and Genode tightly integrated, but the more I think about it , the more I feel that it is impossible. RISC OS and Genode is very different. RISC OS i built for ARM ( and only ARM) and relies on SWI , software interrupts for everything. Other systems uses that for syscalls , but in a different way. RISC OS kernel and other parts is built in assembly. In order to have it integrated with Genode, it kind of need a full rewrite.

Besides the parallel system demo I also made a emulator based on the unicorn cpu emulator. In that I run BBC BASIC as the front end. It simulates a lot of RISC OS SWIs. For example supports loading of RISC OS kernel modules. It cannot do everything from a random module, but many things work. As a proof of concept I include the “Shared C Library” module. That allows to run RISC OS C applications. However, the emulator is CLI only and RISC OS is only “multitasking” in its graphical user interface. RISC OS is basically only one process. There is also no floating point in my emulator. RISC OS have a kernel module that traps illegal instructions, “fpu” instructions from a old controller and translate them to what the current cpu wants. That means that floating point is impossible from C code. In assembler I can use floating point.

So to summarise:
It has been a exciting journey, but I am afraid that this is the end of the road. I have learned a lot of Genode internals and had a lot of fun! Also as a side effect I ported Genode to RockChip SOCs rk3588 and rk3399.

Thanks for reading.

2 Likes

There might be some merit to that. Kind of reminds me of AROS (Amiga Replacement project, a clean-room rewrite I think?), though I haven’t followed the Amiga scene in 20 years so there might be more contenders now. Looks like you had quite an adventure, hope you stick around in the Genode ecosystem!

1 Like

There is a project in which RISC OS is implemented in Python. That is a super effort! Probably the most complex I have come across .

1 Like

Don’t worry … my interest in kernels will make me stay :smiley:

3 Likes

Just by chance .. if someone with a MNT Reform (i.MX8 , not the rockchip) want to try this.

https://micken.se/pix/uImage_genrisc_reform

It will boot up to riscos in a window. But it was a while since I did this and Lukas (MNT) didn’t have any iMX8 Reforms to try it on. So I don’t know if it works at all .. serial output would be interesting.

1 Like

Hi micken,

several things are starting up, but there are also failures that prevent the system from being interactively usable, here is the serial output that you wanted to look at:

kernel initialized
Genode sculpt-24.10.3 <local changes>
919 MiB RAM and 64533 caps assigned to init
[init] Warning: backdrop: invalid priority, upgrading from -1 to 0
[init] Warning: wm_backdrop: invalid priority, upgrading from -1 to 0
[init -> risc_os]   0x1000000 .. 0x10ffffff: linker area
[init -> drivers] parent provides
[init -> drivers]   service "IRQ"
[init -> drivers]   service "IO_MEM"
[init -> drivers]   service "ROM"
[init -> drivers]   service "PD"
[init -> drivers]   service "RM"
[init -> drivers]   service "CPU"
[init -> drivers]   service "LOG"
[init -> drivers]   service "Timer"
[init -> drivers]   service "Capture"
[init -> drivers]   service "Event"
[init -> drivers] child "report_rom"
[init -> drivers]   RAM quota:  776K
[init -> drivers]   cap quota:  26
[init -> drivers]   ELF binary: report_rom
[init -> drivers]   priority:   0
[init -> drivers]   provides service Report
[init -> drivers]   provides service ROM
[init -> drivers] child "platform"
[init -> drivers]   RAM quota:  1800K
[init -> drivers]   cap quota:  116
[init -> drivers]   ELF binary: imx8mq_platform
[init -> drivers]   priority:   0
[init -> drivers]   provides service Platform
[init -> drivers] child "event_filter"
[init -> drivers]   RAM quota:  776K
[init -> drivers]   cap quota:  46
[init -> drivers]   ELF binary: event_filter
[init -> drivers]   priority:   0
[init -> drivers]   provides service Event
[init -> drivers] child "usb"
[init -> drivers]   RAM quota:  12040K
[init -> drivers]   cap quota:  116
[init -> drivers]   ELF binary: imx8m_usb_host
[init -> drivers]   priority:   0
[init -> drivers]   provides service Usb
[init -> drivers] child "usb_hid"
[init -> drivers]   RAM quota:  11016K
[init -> drivers]   cap quota:  106
[init -> drivers]   ELF binary: usb_hid
[init -> drivers]   priority:   0
[init -> drivers]   provides service Input
[init -> drivers] child "fb"
[init -> drivers]   RAM quota:  40712K
[init -> drivers]   cap quota:  216
[init -> drivers]   ELF binary: imx8mq_fb
[init -> drivers]   priority:   0
[init -> backdrop] Error: deadlock ahead, mutex=0xe8168, return ip=0x763d8
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Error: event_filter: environment ROM session denied (label="event_filter", ram_quota=6144, cap_quota=3, diag=0)
[init -> drivers] Warning: fb: configured RAM exceeds available RAM, proceed with 37327284
[init -> unicorn] Error: LD: symbol not found: 'typeinfo for Genode::Console'
[init -> wm -> decorator] Warning: decorator: configured RAM exceeds available RAM, proceed with 19568273
[init -> unicorn] Error: Uncaught exception of type 'Linker::Not_found'
[init -> unicorn] Warning: abort called - thread: ep
[init -> wm] child "wm" requests resources: cap_quota=3
[init -> drivers] child "report_rom" announces service "Report"
[init -> drivers] child "report_rom" announces service "ROM"
[init -> drivers] child "platform" announces service "Platform"
[init -> drivers -> fb] --- i.MX 8MQ framebuffer driver started ---
[init -> drivers] child "usb" announces service "Usb"
[init -> drivers -> fb] SLUB: HWalign=128, Order=0-1, MinObjects=0, CPUs=1, Nodes=1
[init -> drivers -> usb] SLUB: HWalign=128, Order=0-1, MinObjects=0, CPUs=1, Nodes=1
[init -> drivers -> fb] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[init -> drivers -> usb] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[init -> drivers -> usb] clocksource: dde_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[init -> drivers -> usb] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[init -> drivers -> usb] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[init -> drivers -> usb] platform soc@0: Fixed dependency cycle(s) with /soc@0/bus@30000000/efuse@30350000/soc-uid@4
[init -> drivers -> usb] platform 30350000.efuse: Fixed dependency cycle(s) with /soc@0/bus@30000000/clock-controller@30380000
[init -> drivers -> usb] platform 30350000.efuse: Fixed dependency cycle(s) with /soc@0/bus@30000000/clock-controller@30380000
[init -> drivers -> usb] platform 30380000.clock-controller: Fixed dependency cycle(s) with /soc@0/interrupt-controller@38800000
[init -> drivers -> usb] usbcore: registered new interface driver usbfs
[init -> drivers -> usb] usbcore: registered new interface driver hub
[init -> drivers -> usb] usbcore: registered new device driver usb
[init -> drivers -> usb] clocksource: Switched to clocksource dde_counter
[init -> drivers -> usb] usbcore: registered new interface driver genode
[init -> drivers -> usb] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[init -> drivers -> usb] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[init -> drivers -> usb] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220fe6c hci version 0x110 quirks 0x0000008000000010
[init -> drivers -> usb] xhci-hcd xhci-hcd.0.auto: irq 1, io mem 0x38100000
[init -> drivers -> usb] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[init -> drivers -> usb] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[init -> drivers -> usb] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[init -> drivers -> usb] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[init -> drivers -> usb] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[init -> drivers -> usb] usb usb1: Product: xHCI Host Controller
[init -> drivers -> usb] usb usb1: Manufacturer:   xhci-hcd
[init -> drivers -> usb] usb usb1: SerialNumber: xhci-hcd.0.auto
[init -> drivers -> usb] hub 1-0:1.0: USB hub found
[init -> drivers -> usb] hub 1-0:1.0: 1 port detected
[init -> drivers -> usb] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[init -> drivers -> usb] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[init -> drivers -> usb] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[init -> drivers -> usb] usb usb2: Product: xHCI Host Controller
[init -> drivers -> usb] usb usb2: Manufacturer:   xhci-hcd
[init -> drivers -> usb] usb usb2: SerialNumber: xhci-hcd.0.auto
[init -> drivers -> usb] hub 2-0:1.0: USB hub found
[init -> drivers -> usb] hub 2-0:1.0: 1 port detected
[init -> drivers -> usb] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[init -> drivers -> usb] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 3
[init -> drivers -> usb] xhci-hcd xhci-hcd.1.auto: hcc params 0x0220fe6c hci version 0x110 quirks 0x0000008000000010
[init -> drivers -> usb] xhci-hcd xhci-hcd.1.auto: irq 2, io mem 0x38200000
[init -> drivers -> usb] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[init -> drivers -> usb] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 4
[init -> drivers -> usb] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[init -> drivers -> usb] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[init -> drivers -> usb] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[init -> drivers -> usb] usb usb3: Product: xHCI Host Controller
[init -> drivers -> usb] usb usb3: Manufacturer:   xhci-hcd
[init -> drivers -> usb] usb usb3: SerialNumber: xhci-hcd.1.auto
[init -> drivers -> usb] hub 3-0:1.0: USB hub found
[init -> drivers -> usb] hub 3-0:1.0: 1 port detected
[init -> drivers -> usb] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[init -> drivers -> usb] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[init -> drivers -> usb] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[init -> drivers -> usb] usb usb4: Product: xHCI Host Controller
[init -> drivers -> usb] usb usb4: Manufacturer:   xhci-hcd
[init -> drivers -> usb] usb usb4: SerialNumber: xhci-hcd.1.auto
[init -> drivers -> usb] hub 4-0:1.0: USB hub found
[init -> drivers -> usb] hub 4-0:1.0: 1 port detected
[init -> drivers -> fb] clocksource: dde_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[init -> drivers -> fb] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
[init -> drivers -> fb] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[init -> drivers -> fb] platform soc@0: Fixed dependency cycle(s) with /soc@0/bus@30000000/efuse@30350000/soc-uid@4
[init -> drivers -> fb] platform 30350000.efuse: Fixed dependency cycle(s) with /soc@0/bus@30000000/clock-controller@30380000
[init -> drivers -> fb] platform 30350000.efuse: Fixed dependency cycle(s) with /soc@0/bus@30000000/clock-controller@30380000
[init -> drivers -> fb] platform 30380000.clock-controller: Fixed dependency cycle(s) with /soc@0/interrupt-controller@38800000
[init -> drivers -> fb] platform 32c00000.hdmi: Fixed dependency cycle(s) with /soc@0/bus@32c00000/display-controller@32e00000
[init -> drivers -> fb] platform 32c00000.hdmi: Fixed dependency cycle(s) with /soc@0/bus@32c00000/display-controller@32e00000
[init -> drivers -> fb] platform 32e00000.display-controller: Fixed dependency cycle(s) with /soc@0/bus@32c00000/hdmi@32c00000
[init -> drivers -> fb] clocksource: Switched to clocksource dde_counter
[init -> drivers -> usb_hid] SLUB: HWalign=128, Order=0-1, MinObjects=0, CPUs=1, Nodes=1
[init -> drivers -> usb_hid] clocksource: dde_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
[init -> drivers -> usb_hid] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[init -> drivers -> usb_hid] usbcore: registered new interface driver usbfs
[init -> drivers -> usb_hid] usbcore: registered new interface driver hub
[init -> drivers -> usb_hid] usbcore: registered new device driver usb
[init -> drivers -> usb_hid] clocksource: Switched to clocksource dde_counter
[init -> drivers -> usb_hid] usbcore: registered new interface driver usbhid
[init -> drivers -> usb_hid] hid_core: USB HID core driver
[init -> risc_os]   0x40000000 .. 0x4fffffff: stack area
[init -> risc_os]   0x30000 .. 0xf9fff: ld.lib.so
[init -> drivers -> usb] usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
[init -> risc_os]   0x10e86000 .. 0x10ffffff: libc.lib.so
[init -> risc_os]   0x10dfe000 .. 0x10e85fff: vfs.lib.so
[init -> drivers -> usb] usb 2-1: New USB device found, idVendor=0451, idProduct=8140, bcdDevice= 1.00
[init -> drivers -> usb] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[init -> drivers -> usb] hub 2-1:1.0: USB hub found
[init -> drivers -> usb] hub 2-1:1.0: 4 ports detected
[init -> drivers -> usb] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[init -> drivers -> usb] usb 1-1: New USB device found, idVendor=0451, idProduct=8142, bcdDevice= 1.00
[init -> drivers -> usb] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[init -> drivers -> usb] usb 1-1: SerialNumber: D200007134FF
[init -> drivers -> usb] hub 1-1:1.0: USB hub found
[init -> drivers -> usb] hub 1-1:1.0: 4 ports detected
[init -> drivers -> fb] cdns-mhdp-imx 32c00000.hdmi: lane-mapping 0xe4
[init -> drivers -> fb] imx-dcss 32e00000.display-controller: bound 32c00000.hdmi (ops 0x0000000001120810)
[init -> drivers -> fb] [drm] Initialized imx-dcss 1.0.0 20190917 for 32e00000.display-controller on minor 0
[init -> drivers -> fb] imx-dcss 32e00000.display-controller: [drm] Cannot find any crtc or sizes
[init -> drivers -> fb] imx-dcss 32e00000.display-controller: [drm] Cannot find any crtc or sizes
[init -> drivers -> usb] usb 1-1.3: new full-speed USB device number 3 using xhci-hcd
[init -> drivers -> usb] usb 1-1.3: New USB device found, idVendor=03eb, idProduct=2042, bcdDevice= 0.01
[init -> drivers -> usb] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[init -> drivers -> usb] usb 1-1.3: Product: Reform Keyboard
[init -> drivers -> usb] usb 1-1.3: Manufacturer: MNT
[init -> drivers -> usb_hid] input: MNT Reform Keyboard as /devices/usb-1-3/0-0:1.0/0003:03EB:2042.0001/input/input0
[init -> drivers -> usb] usb 1-1.4: new full-speed USB device number 4 using xhci-hcd
[init -> drivers -> usb] usb 1-1.4: device descriptor read/64, error -32
[init -> drivers -> usb] usb 1-1.4: device descriptor read/64, error -32
[init -> drivers -> usb] usb 1-1.4: new full-speed USB device number 5 using xhci-hcd
[init -> drivers -> usb] usb 1-1.4: device descriptor read/64, error -32
[init -> drivers -> usb] usb 1-1.4: New USB device found, idVendor=03eb, idProduct=2041, bcdDevice= 0.01
[init -> drivers -> usb] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[init -> drivers -> usb] usb 1-1.4: Product: Reform Trackball
[init -> drivers -> usb] usb 1-1.4: Manufacturer: MNT

Thank you skalk. Seems like two problems , not counting unicorn. One is event_filter and the other is display driver. I guess nothing shows up on screen? I have put together drivers-interactive for Reform and I suppose I did something wrong.

I am looking for a used Reform with the hope of having a imx8 target which you have.

1 Like

Yes, you’re right, the screen keeps black.