My progress on real RISC-V hardware

I managed to run Haiku on TinyEMU with OpenSBI+u-boot+EFI+GOP (Graphics Output Protocol) so boot splash is working.

screenshot102


OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : ucbbar,riscvemu-bare
Platform Features         : timer,mfdeleg
Platform HART Count       : 1
Firmware Base             : 0x80000000
Firmware Size             : 100 KB
Runtime SBI Version       : 0.2

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000080000000-0x000000008001ffff ()
Domain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000080200000
Domain0 Next Arg1         : 0x0000000082200000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcsu
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 0
Boot HART PMP Granularity : 0
Boot HART PMP Address Bits: 0
Boot HART MHPM Count      : 0
Boot HART MHPM Count      : 0
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109


U-Boot 2021.10-rc1-00447-g8d73f2a57d-dirty (Aug 17 2021 - 03:47:06 +0900)

CPU:   rv64acdfimsu
Model: ucbbar,riscvemu-bare
DRAM:  768 MiB
Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
## Unknown flash on Bank 2 - Size = 0x00000000 = 0 MB
0 Bytes
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial
Net:   eth0: virtio-net#1
Hit any key to stop autoboot:  0 
Wrong Image Format for bootm command
ERROR: can't get kernel image!

Device 0: ffff VirtIO Block Device
            Type: Hard Disk
            Capacity: 16.0 MB = 0.0 GB (32768 x 512)
... is now current device
Scanning virtio 0:1...
** Unable to read file / **
Failed to load '/'
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk virtio-blk#2...
Scanning disk virtio-blk#3...
** Unrecognized filesystem type **
Found 3 disks
** Unable to read file ubootefi.var **
Failed to load EFI variables
BootOrder not defined
EFI boot manager: Cannot load any image
Found EFI removable media binary efi/boot/bootriscv64.efi
467463 bytes read in 14 ms (31.8 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Booting /efi\boot\bootriscv64.efi












































Switched to legacy serial output
init_arch_traps()
[PRE] SetSatp()
[POST] SetSatp()
[POST] FlushTlbAll()
arch_enter_kernel(satp: 0x80000000000ac09e, kernelArgs: 0xae707110, kernelEntry: 0xffffffc00209383a, sp: 0xffffffc002613000)
Kernel entry point
platform1: sbi
platform2: efi
arch_debug_init_early()
image 0xffffffc002000000
image "kernel_riscv64"
  text: 0xffffffc002010000 - 0xffffffc002190000, -276991770624
  data: 0xffffffc002190000 - 0xffffffc0021e9000, -276991770624
image 0xffffffc0025e52dd
image "session"
  text: 0xffffffc0025fa000 - 0xffffffc0025fd000, -274838085632
  data: 0xffffffc0025fd000 - 0xffffffc0025fe000, -274838085632
image 0xffffffc0025e0e3d
image "write_overlay"
  text: 0xffffffc0025f3000 - 0xffffffc0025f9000, -274838114304
  data: 0xffffffc0025f9000 - 0xffffffc0025fa000, -274838114304
image 0xffffffc0025dc1ed
image "udf"
  text: 0xffffffc0025e6000 - 0xffffffc0025f2000, -274838167552
  data: 0xffffffc0025f2000 - 0xffffffc0025f3000, -274838167552
image 0xffffffc002563088
image "reiserfs"
  text: 0xffffffc0025c5000 - 0xffffffc0025d5000, -274838302720
  data: 0xffffffc0025d5000 - 0xffffffc0025d6000, -274838302720
image 0xffffffc002557918
image "ntfs"
  text: 0xffffffc00256d000 - 0xffffffc0025c1000, -274838663168
  data: 0xffffffc0025c1000 - 0xffffffc0025c5000, -274838663168
image 0xffffffc00255595f
image "log_overlay"
  text: 0xffffffc002564000 - 0xffffffc00256c000, -274838700032
  data: 0xffffffc00256c000 - 0xffffffc00256d000, -274838700032
image 0xffffffc00252d7fe
image "iso9660"
  text: 0xffffffc00254e000 - 0xffffffc002553000, -274838790144
  data: 0xffffffc002553000 - 0xffffffc002554000, -274838790144
image 0xffffffc00252949d
image "fat"
  text: 0xffffffc00252e000 - 0xffffffc00254c000, -274838921216
  data: 0xffffffc00254c000 - 0xffffffc00254e000, -274838921216
image 0xffffffc0024d00f5
image "ext2"
  text: 0xffffffc0024f9000 - 0xffffffc00251c000, -274839138304
  data: 0xffffffc00251c000 - 0xffffffc00251e000, -274839138304
image 0xffffffc0024cd22c
image "exfat"
  text: 0xffffffc0024f1000 - 0xffffffc0024f8000, -274839171072
  data: 0xffffffc0024f8000 - 0xffffffc0024f9000, -274839171072
image 0xffffffc0024c581e
image "btrfs"
  text: 0xffffffc0024d7000 - 0xffffffc0024f0000, -274839277568
  data: 0xffffffc0024f0000 - 0xffffffc0024f1000, -274839277568
image 0xffffffc0024c380c
image "bindfs"
  text: 0xffffffc0024d1000 - 0xffffffc0024d6000, -274839302144
  data: 0xffffffc0024d6000 - 0xffffffc0024d7000, -274839302144
image 0xffffffc0024926a1
image "attribute_overlay"
  text: 0xffffffc0024bb000 - 0xffffffc0024c0000, -274839392256
  data: 0xffffffc0024c0000 - 0xffffffc0024c1000, -274839392256
image 0xffffffc00248ba0d
image "xhci"
  text: 0xffffffc0024a5000 - 0xffffffc0024ba000, -274839482368
  data: 0xffffffc0024ba000 - 0xffffffc0024bb000, -274839482368
image 0xffffffc002489dbb
image "virtio_scsi"
  text: 0xffffffc0024a0000 - 0xffffffc0024a4000, -274839502848
  data: 0xffffffc0024a4000 - 0xffffffc0024a5000, -274839502848
image 0xffffffc002488e2d
image "virtio_pci"
  text: 0xffffffc00249d000 - 0xffffffc00249f000, -274839515136
  data: 0xffffffc00249f000 - 0xffffffc0024a0000, -274839515136
image 0xffffffc0024876f6
image "virtio_mmio"
  text: 0xffffffc002499000 - 0xffffffc00249c000, -274839531520
  data: 0xffffffc00249c000 - 0xffffffc00249d000, -274839531520
image 0xffffffc00248636a
image "virtio_block"
  text: 0xffffffc002495000 - 0xffffffc002498000, -274839547904
  data: 0xffffffc002498000 - 0xffffffc002499000, -274839547904
image 0xffffffc0024585bf
image "virtio"
  text: 0xffffffc00247f000 - 0xffffffc002484000, -274839638016
  data: 0xffffffc002484000 - 0xffffffc002485000, -274839638016
image 0xffffffc0024565d3
image "usb_disk"
  text: 0xffffffc002469000 - 0xffffffc00247a000, -274839728128
  data: 0xffffffc00247a000 - 0xffffffc00247f000, -274839728128
image 0xffffffc002450e9f
image "usb"
  text: 0xffffffc00245a000 - 0xffffffc002468000, -274839789568
  data: 0xffffffc002468000 - 0xffffffc002469000, -274839789568
image 0xffffffc002380e77
image "uhci"
  text: 0xffffffc002436000 - 0xffffffc002449000, -274839937024
  data: 0xffffffc002449000 - 0xffffffc00244a000, -274839937024
image 0xffffffc0023800a0
image "silicon_image_3112"
  text: 0xffffffc002432000 - 0xffffffc002435000, -274839953408
  data: 0xffffffc002435000 - 0xffffffc002436000, -274839953408
image 0xffffffc00237e9a8
image "sdhci_pci"
  text: 0xffffffc00242c000 - 0xffffffc002431000, -274839977984
  data: 0xffffffc002431000 - 0xffffffc002432000, -274839977984
image 0xffffffc00237cfb1
image "scsi_periph"
  text: 0xffffffc002427000 - 0xffffffc00242b000, -274839998464
  data: 0xffffffc00242b000 - 0xffffffc00242c000, -274839998464
image 0xffffffc00237bf03
image "scsi_disk"
  text: 0xffffffc002424000 - 0xffffffc002426000, -274840010752
  data: 0xffffffc002426000 - 0xffffffc002427000, -274840010752
image 0xffffffc00237aa19
image "scsi_cd"
  text: 0xffffffc002420000 - 0xffffffc002423000, -274840027136
  data: 0xffffffc002423000 - 0xffffffc002424000, -274840027136
image 0xffffffc0023783c5
image "scsi"
  text: 0xffffffc002417000 - 0xffffffc00241f000, -274840064000
  data: 0xffffffc00241f000 - 0xffffffc002420000, -274840064000
image 0xffffffc002375096
image "pci"
  text: 0xffffffc002409000 - 0xffffffc002416000, -274840121344
  data: 0xffffffc002416000 - 0xffffffc002417000, -274840121344
image 0xffffffc002374f8e
image "packagefs"
  text: 0xffffffc002381000 - 0xffffffc0023da000, -274840678400
  data: 0xffffffc0023da000 - 0xffffffc0023df000, -274840678400
image 0xffffffc00233c743
image "ohci"
  text: 0xffffffc00235d000 - 0xffffffc002370000, -274840825856
  data: 0xffffffc002370000 - 0xffffffc002371000, -274840825856
image 0xffffffc002338ed0
image "nvme_disk"
  text: 0xffffffc002350000 - 0xffffffc00235c000, -274840879104
  data: 0xffffffc00235c000 - 0xffffffc00235d000, -274840879104
image 0xffffffc002337a57
image "mmc_disk"
  text: 0xffffffc00234c000 - 0xffffffc00234f000, -274840895488
  data: 0xffffffc00234f000 - 0xffffffc002350000, -274840895488
image 0xffffffc0023368c0
image "mmc"
  text: 0xffffffc002348000 - 0xffffffc00234b000, -274840911872
  data: 0xffffffc00234b000 - 0xffffffc00234c000, -274840911872
image 0xffffffc002335c14
image "locked_pool"
  text: 0xffffffc002345000 - 0xffffffc002347000, -274840924160
  data: 0xffffffc002347000 - 0xffffffc002348000, -274840924160
image 0xffffffc002334f9c
image "legacy_sata"
  text: 0xffffffc002342000 - 0xffffffc002344000, -274840936448
  data: 0xffffffc002344000 - 0xffffffc002345000, -274840936448
image 0xffffffc0023344bf
image "it8211"
  text: 0xffffffc002340000 - 0xffffffc002341000, -274840944640
  data: 0xffffffc002341000 - 0xffffffc002342000, -274840944640
image 0xffffffc0022fe4c9
image "intel"
  text: 0xffffffc002322000 - 0xffffffc00232e000, -274841067520
  data: 0xffffffc00232e000 - 0xffffffc002330000, -274841067520
image 0xffffffc0022fd80a
image "highpoint_ide_pci"
  text: 0xffffffc00231f000 - 0xffffffc002321000, -274841079808
  data: 0xffffffc002321000 - 0xffffffc002322000, -274841079808
image 0xffffffc0022fcbd0
image "generic_ide_pci"
  text: 0xffffffc00231d000 - 0xffffffc00231e000, -274841088000
  data: 0xffffffc00231e000 - 0xffffffc00231f000, -274841088000
image 0xffffffc0022fac93
image "fdt"
  text: 0xffffffc002316000 - 0xffffffc00231c000, -274841116672
  data: 0xffffffc00231c000 - 0xffffffc00231d000, -274841116672
image 0xffffffc0022f3b10
image "ehci"
  text: 0xffffffc002300000 - 0xffffffc002315000, -274841206784
  data: 0xffffffc002315000 - 0xffffffc002316000, -274841206784
image 0xffffffc00200e9a7
image "efi_gpt"
  text: 0xffffffc0022e3000 - 0xffffffc0022ee000, -274841325568
  data: 0xffffffc0022ee000 - 0xffffffc0022f0000, -274841325568
image 0xffffffc00200df1b
image "dpc"
  text: 0xffffffc0022e1000 - 0xffffffc0022e2000, -274841333760
  data: 0xffffffc0022e2000 - 0xffffffc0022e3000, -274841333760
image 0xffffffc00200d3bd
image "config_manager"
  text: 0xffffffc0022df000 - 0xffffffc0022e0000, -274841341952
  data: 0xffffffc0022e0000 - 0xffffffc0022e1000, -274841341952
image 0xffffffc0020077cb
image "bfs"
  text: 0xffffffc0022a0000 - 0xffffffc0022d4000, -274841600000
  data: 0xffffffc0022d4000 - 0xffffffc0022d6000, -274841600000
image 0xffffffc002006570
image "ata_adapter"
  text: 0xffffffc00229c000 - 0xffffffc00229f000, -274841616384
  data: 0xffffffc00229f000 - 0xffffffc0022a0000, -274841616384
image 0xffffffc002002e32
image "ata"
  text: 0xffffffc002292000 - 0xffffffc00229b000, -274841657344
  data: 0xffffffc00229b000 - 0xffffffc00229c000, -274841657344
image 0xffffffc00200010d
image "ahci"
  text: 0xffffffc002285000 - 0xffffffc002290000, -274841710592
  data: 0xffffffc002290000 - 0xffffffc002292000, -274841710592
Welcome to kernel debugger output!
Haiku revision: , debug level: 2
INIT: init CPU
INIT: init interrupts
arch_int_init()
  CPU 0:
    hartId: 0
    plicContext: 0
reserve_io_interrupt_vectors: reserved 128 vectors starting from 0
INIT: init VM
vm_translation_map_init: entry
physical memory ranges:
  87f04000 - ae710000
  ae717000 - ae718000
  ae719000 - ae71b000
  ae71f000 - ae720000
  ae724000 - ae725000
  ae727000 - ae729000
  ae72a000 - aff4d000
  aff4e000 - b0000000
allocated physical ranges:
  abe34000 - ac6b6000
  ac6b7000 - ae6b7000
  ae72c000 - aff4d000
  aff4e000 - b0000000
allocated virtual ranges:
  10000000 - 10001000
  ac09f000 - ac6b6000
  ac6b7000 - ae710000
  ae718000 - ae719000
  ae71c000 - ae71f000
  ae720000 - ae724000
  ae72c000 - b0000000
  ffffffc002000000 - ffffffc002ad8000
  ffffffffd7f04000 - 0
kernel args ranges:
  ffffffc002000000 - ffffffc002010000
  ffffffc0021e9000 - ffffffc002285000
  ffffffc0022d6000 - ffffffc0022df000
  ffffffc0022f0000 - ffffffc002300000
  ffffffc002330000 - ffffffc002340000
  ffffffc002371000 - ffffffc002381000
  ffffffc0023df000 - ffffffc002409000
  ffffffc00244a000 - ffffffc00245a000
  ffffffc002485000 - ffffffc002495000
  ffffffc0024c1000 - ffffffc0024d1000
  ffffffc00251e000 - ffffffc00252e000
  ffffffc002554000 - ffffffc002564000
  ffffffc0025d6000 - ffffffc0025e6000
  ffffffc0025fe000 - ffffffc00260e000
physMapBase: 0xffffffffd7f04000
physMemBase: 0x87f04000
mark_page_range_in_use(0x0, 0x87f04): start page is before free list
reserve_boot_loader_ranges(): Skipping range: 0x0000000010000000, 4096
reserve_boot_loader_ranges(): Skipping range: 0x00000000ac09f000, 6385664
reserve_boot_loader_ranges(): Skipping range: 0x00000000ac6b7000, 33918976
reserve_boot_loader_ranges(): Skipping range: 0x00000000ae718000, 4096
reserve_boot_loader_ranges(): Skipping range: 0x00000000ae71c000, 12288
reserve_boot_loader_ranges(): Skipping range: 0x00000000ae720000, 16384
reserve_boot_loader_ranges(): Skipping range: 0x00000000ae72c000, 26034176
vm_translation_map_init_post_area: entry
INIT: init driver_settings
INIT: init notification services
INIT: init teams
INIT: init ELF loader
INIT: init modules
INIT: init semaphores
INIT: init interrupts post vm
INIT: init system info
INIT: init SMP
arch_smp_init()
CPU topology:
  node(0, levels)
    node(0, package)
      node(0, core)
        node(0, smt)
INIT: init timer
INIT: init real time clock
allocate_commpage_entry(2, 16) -> 0x0000000000000200
INIT: init condition variables
INIT: init VM semaphores
arch_vm_init_end(): 3 virtual ranges to keep:
  start: 0xffffffc002617000, size: 0xc0000
  start: 0xffffffc0026d7000, size: 0x400000
  start: 0xffffffc002ad7000, size: 0x100
INIT: init generic syscall
INIT: init scheduler
scheduler_init: found 1 logical cpu and 0 cache levels
scheduler switches: single core: true, cpu load tracking: false, core load tracking: false
scheduler: switching to low latency mode
INIT: init threads
INIT: init kernel daemons
INIT: init stack protector
INIT: init I/O interrupts
INIT: init VM threads
INIT: init DPC
INIT: init VFS
INIT: init swap support
INIT: init POSIX semaphores
INIT: spawning main2 thread
INIT: waking up AP cpus
INIT: exiting kernel startup
INIT: starting scheduler on cpu 0 and enabling interrupts
slab memory manager: created area 0xffffffc001001000 (143)
INIT: start of main2: initializing devices
allocate_commpage_entry(3, 46) -> 0x0000000000000210
allocate_commpage_entry(4, 10) -> 0x0000000000000240
INIT: init ports
INIT: init user mutex
INIT: init system notifications
INIT: Init modules
INIT: Init Userland debugging
INIT: Init Messaging Service
INIT: Bootstrap file systems
INIT: Init Device Manager
+pci_root
-pci_root
...
32 Likes