My progress on real RISC-V hardware

@waddlesplash is still wanting to kill haiku_loader.riscv: https://dev.haiku-os.org/ticket/17188. It is possible to down-vote ticket.

1 Like

Votes on tickets are a system to indicate to developers what users are particularly interested in. On technical matters like this, where the ultimate decision will have basically no impact on users one way or another, they matter much less. “Vote brigading” is also, uh, generally unhelpful.

Anyway, @kallisti5 et al. seemed to vaguely agree with the reasoning in there; which is part of why I made the ticket in the first place.

2 Likes

Still no new RISC-V related Gerrit patches from me in 5 years until that ticket is opened. No discussion accepted. My new code will be uploaded here or on Gists.

6 Likes

Previously you said the condition was my -2 and the code not being merged as a result. Well, we agreed to shelve the discussion and resume it at a later date, and merge the code for now (and indeed it was merged.) So, you are changing your terms, then?

Hinging all of your contributions to Haiku on a single chunk of code being included or not in Haiku is not a great recipe for amenable relations with the rest of the developers, and leaves a rather sour taste in any technical discussions.

General terms are acceptance of haiku_loader.riscv. “-2” was some objective way to reject it. Now rejection is even more clear.

I will be responsible for maintaining haiku_loader.riscv, so don’t worry with that. I plan to support it for whole time, not just as temporary solution. When I become inactive, it can be deleted as I will not care anymore.

— START ADMIN EDIT —
See the split topic below to continue this discussion around patch acceptance
— END ADMIN EDIT —

13 Likes

66 posts were split to a new topic: Regarding patch acceptance policies

After updating the u-boot version on my SiFive Unmatched, I can confirm the latest master Haiku code is getting into the kernel :fireworks:

More work is needed, but we’re creeping towards an upstream working build you can “throw on a USB stick” and boot on the SiFive Unmatched!

24 Likes

Compiling python3 fails because of too old libffi with no RISC-V support introduced yet.

4 Likes

I split this topic off at X512’s request.

He wants to keep this thread about updates to the riscv64 architecture port progress. Anyone wanting to discuss how Haiku accepts patches should see the Regarding patch acceptance policies thread

20 Likes

I pushed X512’s commands to upstream u-boot. This should allow us to follow the model below:

  1. Guide users to make a “firmware SD card”
  2. Boot the generic Haiku RISCV64 image on the SiFive unmatched via a USB stick.

This makes the Unmatched system work a lot like an X86 system… just plug in a USB stick with Haiku and boot. The SD Card bus is on the unmatched is extremely slow, so this model makes a lot more sense than trying to pack the OS onto the SD card.

Honestly, if you want an awesome system to play with Haiku on… get the SiFive Unmatched. It’s expensive, but compared to an x86 system the price isn’t too bad. (Think how much a Motherboard, CPU, and 16GiB of ram cost). Haiku is really close to having mainline support thanks to X512’s work.

28 Likes

I finally managed to compile u-boot (board firmware) on Haiku. Patch: Haiku build patch for u-boot fdc4fda33051bcb9eb782001afe2bdd3c0d09eae · GitHub.

18 Likes

I did some u-boot hacking and managed to run it on TinyEMU. But OpenSBI crashes after some kernel calls.


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:24:25 +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 12 ms (37.2 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: 0x80000000000ac0d0, kernelArgs: 0xae70b110, kernelEntry: 0xffffffc0020938fa, sp: 0xffffffc0025e6000)
Kernel entry point
platform1: sbi
platform2: efi
arch_debug_init_early()
image 0xffffffc002000000
image "kernel_riscv64"
  text: 0xffffffc002010000 - 0xffffffc002191000, -276991770624
  data: 0xffffffc002191000 - 0xffffffc0021ea000, -276991770624
image 0xffffffc0025b82dd
image "session"
  text: 0xffffffc0025cd000 - 0xffffffc0025d0000, -274838269952
  data: 0xffffffc0025d0000 - 0xffffffc0025d1000, -274838269952
image 0xffffffc0025b3e3d
image "write_overlay"
  text: 0xffffffc0025c6000 - 0xffffffc0025cc000, -274838298624
  data: 0xffffffc0025cc000 - 0xffffffc0025cd000, -274838298624
image 0xffffffc0025af1ed
image "udf"
  text: 0xffffffc0025b9000 - 0xffffffc0025c5000, -274838351872
  data: 0xffffffc0025c5000 - 0xffffffc0025c6000, -274838351872
image 0xffffffc002536088
image "reiserfs"
  text: 0xffffffc002598000 - 0xffffffc0025a8000, -274838487040
  data: 0xffffffc0025a8000 - 0xffffffc0025a9000, -274838487040
image 0xffffffc00252a918
image "ntfs"
  text: 0xffffffc002540000 - 0xffffffc002594000, -274838847488
  data: 0xffffffc002594000 - 0xffffffc002598000, -274838847488
image 0xffffffc00252895f
image "log_overlay"
  text: 0xffffffc002537000 - 0xffffffc00253f000, -274838884352
  data: 0xffffffc00253f000 - 0xffffffc002540000, -274838884352
image 0xffffffc0025007fe
image "iso9660"
  text: 0xffffffc002521000 - 0xffffffc002526000, -274838974464
  data: 0xffffffc002526000 - 0xffffffc002527000, -274838974464
image 0xffffffc0024fc49d
image "fat"
  text: 0xffffffc002501000 - 0xffffffc00251f000, -274839105536
  data: 0xffffffc00251f000 - 0xffffffc002521000, -274839105536
image 0xffffffc0024a30f5
image "ext2"
  text: 0xffffffc0024cc000 - 0xffffffc0024ef000, -274839322624
  data: 0xffffffc0024ef000 - 0xffffffc0024f1000, -274839322624
image 0xffffffc0024a022c
image "exfat"
  text: 0xffffffc0024c4000 - 0xffffffc0024cb000, -274839355392
  data: 0xffffffc0024cb000 - 0xffffffc0024cc000, -274839355392
image 0xffffffc00249881e
image "btrfs"
  text: 0xffffffc0024aa000 - 0xffffffc0024c3000, -274839461888
  data: 0xffffffc0024c3000 - 0xffffffc0024c4000, -274839461888
image 0xffffffc00249680c
image "bindfs"
  text: 0xffffffc0024a4000 - 0xffffffc0024a9000, -274839486464
  data: 0xffffffc0024a9000 - 0xffffffc0024aa000, -274839486464
image 0xffffffc0024656a1
image "attribute_overlay"
  text: 0xffffffc00248e000 - 0xffffffc002493000, -274839576576
  data: 0xffffffc002493000 - 0xffffffc002494000, -274839576576
image 0xffffffc00245ea0d
image "xhci"
  text: 0xffffffc002478000 - 0xffffffc00248d000, -274839666688
  data: 0xffffffc00248d000 - 0xffffffc00248e000, -274839666688
image 0xffffffc00245cdbb
image "virtio_scsi"
  text: 0xffffffc002473000 - 0xffffffc002477000, -274839687168
  data: 0xffffffc002477000 - 0xffffffc002478000, -274839687168
image 0xffffffc00245be2d
image "virtio_pci"
  text: 0xffffffc002470000 - 0xffffffc002472000, -274839699456
  data: 0xffffffc002472000 - 0xffffffc002473000, -274839699456
image 0xffffffc00245a6f6
image "virtio_mmio"
  text: 0xffffffc00246c000 - 0xffffffc00246f000, -274839715840
  data: 0xffffffc00246f000 - 0xffffffc002470000, -274839715840
image 0xffffffc00245936a
image "virtio_block"
  text: 0xffffffc002468000 - 0xffffffc00246b000, -274839732224
  data: 0xffffffc00246b000 - 0xffffffc00246c000, -274839732224
image 0xffffffc00242b5bf
image "virtio"
  text: 0xffffffc002452000 - 0xffffffc002457000, -274839822336
  data: 0xffffffc002457000 - 0xffffffc002458000, -274839822336
image 0xffffffc0024295d3
image "usb_disk"
  text: 0xffffffc00243c000 - 0xffffffc00244d000, -274839912448
  data: 0xffffffc00244d000 - 0xffffffc002452000, -274839912448
image 0xffffffc002423e9f
image "usb"
  text: 0xffffffc00242d000 - 0xffffffc00243b000, -274839973888
  data: 0xffffffc00243b000 - 0xffffffc00243c000, -274839973888
image 0xffffffc002353e77
image "uhci"
  text: 0xffffffc002409000 - 0xffffffc00241c000, -274840121344
  data: 0xffffffc00241c000 - 0xffffffc00241d000, -274840121344
image 0xffffffc0023530a0
image "silicon_image_3112"
  text: 0xffffffc002405000 - 0xffffffc002408000, -274840137728
  data: 0xffffffc002408000 - 0xffffffc002409000, -274840137728
image 0xffffffc0023519a8
image "sdhci_pci"
  text: 0xffffffc0023ff000 - 0xffffffc002404000, -274840162304
  data: 0xffffffc002404000 - 0xffffffc002405000, -274840162304
image 0xffffffc00234ffb1
image "scsi_periph"
  text: 0xffffffc0023fa000 - 0xffffffc0023fe000, -274840182784
  data: 0xffffffc0023fe000 - 0xffffffc0023ff000, -274840182784
image 0xffffffc00234ef03
image "scsi_disk"
  text: 0xffffffc0023f7000 - 0xffffffc0023f9000, -274840195072
  data: 0xffffffc0023f9000 - 0xffffffc0023fa000, -274840195072
image 0xffffffc00234da19
image "scsi_cd"
  text: 0xffffffc0023f3000 - 0xffffffc0023f6000, -274840211456
  data: 0xffffffc0023f6000 - 0xffffffc0023f7000, -274840211456
image 0xffffffc00234b3c5
image "scsi"
  text: 0xffffffc0023ea000 - 0xffffffc0023f2000, -274840248320
  data: 0xffffffc0023f2000 - 0xffffffc0023f3000, -274840248320
image 0xffffffc002348096
image "pci"
  text: 0xffffffc0023dc000 - 0xffffffc0023e9000, -274840305664
  data: 0xffffffc0023e9000 - 0xffffffc0023ea000, -274840305664
image 0xffffffc002347f8e
image "packagefs"
  text: 0xffffffc002354000 - 0xffffffc0023ad000, -274840862720
  data: 0xffffffc0023ad000 - 0xffffffc0023b2000, -274840862720
image 0xffffffc00230f743
image "ohci"
  text: 0xffffffc002330000 - 0xffffffc002343000, -274841010176
  data: 0xffffffc002343000 - 0xffffffc002344000, -274841010176
image 0xffffffc00230bed0
image "nvme_disk"
  text: 0xffffffc002323000 - 0xffffffc00232f000, -274841063424
  data: 0xffffffc00232f000 - 0xffffffc002330000, -274841063424
image 0xffffffc00230aa57
image "mmc_disk"
  text: 0xffffffc00231f000 - 0xffffffc002322000, -274841079808
  data: 0xffffffc002322000 - 0xffffffc002323000, -274841079808
image 0xffffffc0023098c0
image "mmc"
  text: 0xffffffc00231b000 - 0xffffffc00231e000, -274841096192
  data: 0xffffffc00231e000 - 0xffffffc00231f000, -274841096192
image 0xffffffc002308c14
image "locked_pool"
  text: 0xffffffc002318000 - 0xffffffc00231a000, -274841108480
  data: 0xffffffc00231a000 - 0xffffffc00231b000, -274841108480
image 0xffffffc002307f9c
image "legacy_sata"
  text: 0xffffffc002315000 - 0xffffffc002317000, -274841120768
  data: 0xffffffc002317000 - 0xffffffc002318000, -274841120768
image 0xffffffc0023074bf
image "it8211"
  text: 0xffffffc002313000 - 0xffffffc002314000, -274841128960
  data: 0xffffffc002314000 - 0xffffffc002315000, -274841128960
image 0xffffffc0022d14c9
image "intel"
  text: 0xffffffc0022f5000 - 0xffffffc002301000, -274841251840
  data: 0xffffffc002301000 - 0xffffffc002303000, -274841251840
image 0xffffffc0022d080a
image "highpoint_ide_pci"
  text: 0xffffffc0022f2000 - 0xffffffc0022f4000, -274841264128
  data: 0xffffffc0022f4000 - 0xffffffc0022f5000, -274841264128
image 0xffffffc0022cfbd0
image "generic_ide_pci"
  text: 0xffffffc0022f0000 - 0xffffffc0022f1000, -274841272320
  data: 0xffffffc0022f1000 - 0xffffffc0022f2000, -274841272320
image 0xffffffc0022cdc93
image "fdt"
  text: 0xffffffc0022e9000 - 0xffffffc0022ef000, -274841300992
  data: 0xffffffc0022ef000 - 0xffffffc0022f0000, -274841300992
image 0xffffffc0022c6b10
image "ehci"
  text: 0xffffffc0022d3000 - 0xffffffc0022e8000, -274841391104
  data: 0xffffffc0022e8000 - 0xffffffc0022e9000, -274841391104
image 0xffffffc00200e9a7
image "efi_gpt"
  text: 0xffffffc0022b6000 - 0xffffffc0022c1000, -274841509888
  data: 0xffffffc0022c1000 - 0xffffffc0022c3000, -274841509888
image 0xffffffc00200df1b
image "dpc"
  text: 0xffffffc0022b4000 - 0xffffffc0022b5000, -274841518080
  data: 0xffffffc0022b5000 - 0xffffffc0022b6000, -274841518080
image 0xffffffc00200d3bd
image "config_manager"
  text: 0xffffffc0022b2000 - 0xffffffc0022b3000, -274841526272
  data: 0xffffffc0022b3000 - 0xffffffc0022b4000, -274841526272
image 0xffffffc0020077cb
image "bfs"
  text: 0xffffffc002273000 - 0xffffffc0022a7000, -274841784320
  data: 0xffffffc0022a7000 - 0xffffffc0022a9000, -274841784320
image 0xffffffc002006570
image "ata_adapter"
  text: 0xffffffc00226f000 - 0xffffffc002272000, -274841800704
  data: 0xffffffc002272000 - 0xffffffc002273000, -274841800704
image 0xffffffc002002e32
image "ata"
  text: 0xffffffc002265000 - 0xffffffc00226e000, -274841841664
  data: 0xffffffc00226e000 - 0xffffffc00226f000, -274841841664
image 0xffffffc00200010d
image "ahci"
  text: 0xffffffc002258000 - 0xffffffc002263000, -274841894912
  data: 0xffffffc002263000 - 0xffffffc002265000, -274841894912
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 - ae714000
  ae71b000 - ae71c000
  ae71d000 - ae71f000
  ae723000 - ae724000
  ae728000 - ae729000
  ae72b000 - ae72d000
  ae72e000 - aff51000
  aff52000 - b0000000
allocated physical ranges:
  abe66000 - ae6bb000
  ae730000 - aff51000
  aff52000 - b0000000
allocated virtual ranges:
  10000000 - 10001000
  ac0d1000 - ae714000
  ae71c000 - ae71d000
  ae720000 - ae723000
  ae724000 - ae728000
  ae730000 - b0000000
  ffffffc002000000 - ffffffc002aab000
  ffffffffd7f04000 - 0
kernel args ranges:
  ffffffc002000000 - ffffffc002010000
  ffffffc0021ea000 - ffffffc002258000
  ffffffc0022a9000 - ffffffc0022b2000
  ffffffc0022c3000 - ffffffc0022d3000
  ffffffc002303000 - ffffffc002313000
  ffffffc002344000 - ffffffc002354000
  ffffffc0023b2000 - ffffffc0023dc000
  ffffffc00241d000 - ffffffc00242d000
  ffffffc002458000 - ffffffc002468000
  ffffffc002494000 - ffffffc0024a4000
  ffffffc0024f1000 - ffffffc002501000
  ffffffc002527000 - ffffffc002537000
  ffffffc0025a9000 - ffffffc0025b9000
  ffffffc0025d1000 - ffffffc0025e1000
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: 0x00000000ac0d1000, 40120320
reserve_boot_loader_ranges(): Skipping range: 0x00000000ae71c000, 4096
reserve_boot_loader_ranges(): Skipping range: 0x00000000ae720000, 12288
reserve_boot_loader_ranges(): Skipping range: 0x00000000ae724000, 16384
reserve_boot_loader_ranges(): Skipping range: 0x00000000ae730000, 26017792
vm_translation_map_init_post_area: entry
SBI spec version: 0x2
SBI implementation ID: 0x1
SBI implementation version: 0x9
sbi_trap_error: hart0: illegal instruction handler failed (error -2)
sbi_trap_error: hart0: mcause=0x0000000000000002 mtval=0x00000000f11027f3
sbi_trap_error: hart0: mepc=0x0000000080004c8c mstatus=0x0000000a00003820
sbi_trap_error: hart0: ra=0x0000000080004b00 sp=0x0000000080017df8
sbi_trap_error: hart0: gp=0x0000000000000000 tp=0xffffffc0021c27e8
sbi_trap_error: hart0: s0=0x0000000080017e18 s1=0x0000000000000010
sbi_trap_error: hart0: a0=0x0000000000000010 a1=0x0000000000000004
sbi_trap_error: hart0: a2=0x0000000080017ee8 a3=0x0000000080017e18
sbi_trap_error: hart0: a4=0x00000000800111fc a5=0x0000000080004c8c
sbi_trap_error: hart0: a6=0x0000000000000004 a7=0x0000000000000010
sbi_trap_error: hart0: s2=0x0000000080017e18 s3=0x0000000000000004
sbi_trap_error: hart0: s4=0x0000000000000009 s5=0x0000000000000000
sbi_trap_error: hart0: s6=0x0000000000000000 s7=0x00000000af72e590
sbi_trap_error: hart0: s8=0x00000000af72e598 s9=0x80000000000ac0d0
sbi_trap_error: hart0: s10=0x00000000ae6ed8a0 s11=0x00000000ae6ed8e8
sbi_trap_error: hart0: t0=0x0000000a00002820 t1=0xffffffc0020767ac
sbi_trap_error: hart0: t2=0xffffffc00218e490 t3=0xffffffc002161b4c
sbi_trap_error: hart0: t4=0x0000000000000020 t5=0x0000000000000001
sbi_trap_error: hart0: t6=0x0000000000000000
5 Likes

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

sorry for my ignorance, is it slow due to a driver or architecture problem? right I inquire if in the future I would like to think about buying one, if prices drop a little, if Haiku grows etc etc …

1 Like

If I understand correctly this is hardware limitation. You can think that SD card is something like BIOS ROM chip. For installing system NVMe or USB 3 can be used.

3 Likes

Yup. Geist mentioned the SD card bus is all bit-banged on the Unmatched and extremely slow. Linux distros are starting to create SiFive unmatched SD cards with u-boot + their distro and noticing this.

My general feeling is if we encourage the usage of the SD card as strictly a “bios” source outside of Haiku, then our whole model gets a lot easier and the ecosystem gets unified under a more standard PC design. (boot USB drive with Haiku, boot EFI haiku from NVMe, etc)

4 Likes

Tell them “please don’t”. This is fundamentally wrong non-portable approach. At least extlinux can be used.

Maybe slow SD card access is actually good thing that will help to notice them and start doing things in a right way.

4 Likes

After libffi update I managed to compile python 3.7.10. Latest haikuporter now can be used.

Also I improved MMU code to better handle SMP. Now per-CPU core address space usage is tracked and TLB is invalidated on other CPU cores. Some issues still exists: userland applications sometimes crashes with random NULL dereferences.

screenshot8

44 Likes

I finally fixed C++ exception handling. Now Terminal can be closed without crashing and many other crashes are resolved. The problem was missing TLS_DTV_OFFSET handling. For RISC-V module TLS entry allows negative TLS offsets in __tls_get_addr() and this is actually used in libstdc++.so. Maximum allowed negative offset is TLS_DTV_OFFSET (0x800). See riscv-elf-psabi-doc/riscv-elf.md at master · riscv/riscv-elf-psabi-doc · GitHub.

Also I managed to recompile libstdc++.so on real hardware, but not GCC package yet (complains something about unsupported platform).

22 Likes

Are you using out current GCC8.3 build for this work?