My progress on real RISC-V hardware

Currently I hit #15569.

PMA: bad value for allocate (163792 bytes)
usb error xhci 0: failed to allocate TRBs
PANIC: failed to queue data transfer: Out of memory

Welcome to Kernel Debugging Land...
Thread 627 "launch_daemon" running on CPU 0
Stack:
FP: 0xffffffc00246cbf0
FP: 0xffffffc00246cd00, PC: 0xffffffc00215a875 <kernel_riscv64> arch_debug_call_with_fault_handler + 91
FP: 0xffffffc00246cd50, PC: 0xffffffc0020d24eb <kernel_riscv64> debug_call_with_fault_handler.localalias.7 + 129
FP: 0xffffffc00246cde0, PC: 0xffffffc0020d3b15 <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 299
FP: 0xffffffc00246ce50, PC: 0xffffffc0020d3e01 <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 135
FP: 0xffffffc00246ce90, PC: 0xffffffc0020d4149 <kernel_riscv64> panic + 101
FP: 0xffffffc00246cf20, PC: 0xffffffc00243e30b <usb_disk> _Z22usb_disk_transfer_dataP13disk_device_sbPvm.localalias           .12 + 253
FP: 0xffffffc00246cfb0, PC: 0xffffffc00243e7a3 <usb_disk> _Z23usb_disk_operation_bulkP12device_lun_sPhmPvPmbP7err_a           ct.localalias.8 + 505
FP: 0xffffffc00246d010, PC: 0xffffffc00243eb2f <usb_disk> _ZL19usb_disk_block_readP12device_lun_sjtPvPm + 277
FP: 0xffffffc00246d070, PC: 0xffffffc00243ecb5 <usb_disk> _ZL13usb_disk_readPvlS_Pm + 147
FP: 0xffffffc00246d0f0, PC: 0xffffffc0021159eb <kernel_riscv64> _ZL14synchronous_ioP9IORequestR4DoIO + 89
FP: 0xffffffc00246d120, PC: 0xffffffc002124d47 <kernel_riscv64> vfs_synchronous_io + 49
FP: 0xffffffc00246d170, PC: 0xffffffc0020ef979 <kernel_riscv64> _ZL8devfs_ioP9fs_volumeP8fs_vnodePvP9IORequest + 20           5
FP: 0xffffffc00246d1c0, PC: 0xffffffc002124a99 <kernel_riscv64> vfs_vnode_io.localalias.0 + 37
FP: 0xffffffc00246d2c0, PC: 0xffffffc002124bfb <kernel_riscv64> _ZL26do_iterative_fd_io_iteratePvP9IORequestPb + 27           1
FP: 0xffffffc00246d310, PC: 0xffffffc00212503b <kernel_riscv64> do_iterative_fd_io + 193
FP: 0xffffffc00246d360, PC: 0xffffffc002124a99 <kernel_riscv64> vfs_vnode_io.localalias.0 + 37
FP: 0xffffffc00246d3f0, PC: 0xffffffc00208521b <kernel_riscv64> cache_prefetch_vnode.localalias.0 + 483
FP: 0xffffffc00246d5e0, PC: 0xffffffc0021433fd <kernel_riscv64> _ZL12_vm_map_fileiPKcPPvjmjjbilb + 935
FP: 0xffffffc00246d6a0, PC: 0xffffffc0021461fb <kernel_riscv64> _user_map_file + 221
FP: 0xffffffc00246d6e0, PC: 0xffffffc0020a67cd <kernel_riscv64> syscall_dispatcher + 1705
FP: 0xffffffc00246d7d0, PC: 0xffffffc00215bb37 <kernel_riscv64> STrap + 575
FP: 0xffffffc00246d8d0, PC: 0xffffffc002159b0d <kernel_riscv64> SVecU + 109
FP: 0x3df7b039e0, PC: 0x2686252d87 <runtime_loader_seg0ro> 0x15d87
FP: 0x3df7b04ee0, PC: 0x268624a5ef <runtime_loader_seg0ro> 0xd5ef
FP: 0x3df7b04f70, PC: 0x26862484ed <runtime_loader_seg0ro> 0xb4ed
FP: 0x3df7b04fd0, PC: 0x26862488cd <runtime_loader_seg0ro> 0xb8cd
FP: 0x3df7b05000, PC: 0x268624f72d <runtime_loader_seg0ro> 0x1272d
FP: 0xffffffc00246d900, PC: 0xffffffc00215c3a7 <kernel_riscv64> arch_thread_enter_userspace + 145
FP: 0xffffffc00246da30, PC: 0xffffffc0020b01bb <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThread           EntryArguments + 109
FP: 0xffffffc00246da90, PC: 0xffffffc0020b1cfb <kernel_riscv64> thread_enter_userspace_new_team + 57
FP: 0xffffffc00246df80, PC: 0xffffffc0020aa6b5 <kernel_riscv64> _ZL33team_create_thread_start_internalPv + 651
FP: 0xffffffc00246df90, PC: 0xffffffc0020abeff <kernel_riscv64> _ZL24team_create_thread_startPv + 15
FP: 0xffffffc00246dfb0, PC: 0xffffffc0020b4e87 <kernel_riscv64> _ZL19common_thread_entryPv + 57
FP: 0x0, PC: 0xffffffc0021599e5 <kernel_riscv64> arch_thread_entry + 3
kdebug>
6 Likes

After adding some hack to cache prefetch and adding radeon_hd driver to image, it now runs userland and attempts to initialize graphics card, but fails. Something seems wrong with PCI register allocation.

radeon_hd: device_open: open(name = graphics/radeon_hd_050000)
radeon_hd: card(0): radeon_hd_init: called
radeon_hd: radeon_hd_init: card(0): Radeon Cape Verde 1002:683F
radeon_hd: radeon_hd_init: Error: found 0MB video ram, using PCI bar size...
radeon_hd: radeon_hd_init: mapping a frame buffer of 256MB out of 0MB video ram
radeon_hd: card(0): radeon_hd_getbios: called
radeon_hd: radeon_hd_getbios: ACPI ATRM AtomBIOS TODO
radeon_hd: radeon_hd_getbios: AtomBIOS not found using active method 0 at 0x0
radeon_hd: radeon_hd_getbios: No base found at PCI FB BAR
radeon_hd: radeon_hd_getbios: AtomBIOS not found using active method 1 at 0x0
radeon_hd: radeon_hd_getbios: PCI ROM decode enabled
radeon_hd: mapAtomBIOS: seeking AtomBIOS @ 0x70440000 [size: 0x20000]
radeon_hd: mapAtomBIOS: AtomBIOS verified and locked
radeon_hd: radeon_hd_getbios: AtomBIOS found using active method 2 at 0x70440000
radeon_hd: card(0): radeon_hd_init didn't find VESA EDID modes.
radeon_hd: card(0): radeon_hd_init completed successfully!
radeon_hd: card(0): GPU thermal status: 40C
radeon_hd: device_ioctl: accelerant: radeon_hd.accelerant
8 Likes

Subclass 0x80 (for that “mystery” element of the Radeon chipset) is vendor defined. so it is likely to be fine to entirely ignore this mysterious PCI device entry, especially this early in the bring-up.

2 Likes

Video driver progressed a bit. Now it traps because of attempt to write to illegal physical address.

radeon_hd: init_hardware
radeon_hd: init_driver
radeon_hd: init_driver: GPU(0) Radeon HD 7750, revision = 0x87
radeon_hd: publish_devices
radeon_hd: find_device
loaded driver /boot/system/add-ons/kernel/drivers/dev/graphics/radeon_hd
vesa: init_hardware()
radeon_hd: device_open: open(name = graphics/radeon_hd_050000)
radeon_hd: card(0): radeon_hd_init: called
radeon_hd: radeon_hd_init: card(0): Radeon Cape Verde 1002:683F
radeon_hd: radeon_hd_init: Error: found 0MB video ram, using PCI bar size...
radeon_hd: radeon_hd_init: mapping a frame buffer of 256MB out of 0MB video ram
radeon_hd: card(0): radeon_hd_getbios: called
radeon_hd: radeon_hd_getbios: ACPI ATRM AtomBIOS TODO
radeon_hd: radeon_hd_getbios: AtomBIOS not found using active method 0 at 0x0
radeon_hd: radeon_hd_getbios: No base found at PCI FB BAR
radeon_hd: radeon_hd_getbios: AtomBIOS not found using active method 1 at 0x0
radeon_hd: radeon_hd_getbios: PCI ROM decode enabled
radeon_hd: mapAtomBIOS: seeking AtomBIOS @ 0x70440000 [size: 0x20000]
radeon_hd: mapAtomBIOS: AtomBIOS verified and locked
radeon_hd: radeon_hd_getbios: AtomBIOS found using active method 2 at 0x70440000
radeon_hd: card(0): radeon_hd_init didn't find VESA EDID modes.
radeon_hd: card(0): radeon_hd_init completed successfully!
radeon_hd: card(0): GPU thermal status: 41C
radeon_hd: device_ioctl: accelerant: radeon_hd.accelerant
radeon_hd: radeon_init_accelerant enter
radeon_hd: radeon_dump_bios: Dumping AtomBIOS as ATOM_DEBUG is set...
radeon_hd: radeon_dump_bios: AtomBIOS dumped to /boot/system/cache/tmp/radeon_hd_bios_1002_683f_0.bin
radeon_hd: radeon_init_bios: init AtomBIOS for this card as it is not not posted
radeon_hd: atom_op_calltable: table: unknown (80)
Last message repeated 4 times.
radeon_hd: radeon_gpu_probe: table 2.2
radeon_hd: gpio_general_populate: general GPIO @ 0, valid: true, hwPin: 0x1
radeon_hd: gpio_general_populate: general GPIO @ 1, valid: true, hwPin: 0x2
radeon_hd: gpio_general_populate: general GPIO @ 2, valid: true, hwPin: 0x3
radeon_hd: gpio_general_populate: general GPIO @ 3, valid: true, hwPin: 0x4
radeon_hd: gpio_general_populate: general GPIO @ 4, valid: true, hwPin: 0x5
radeon_hd: gpio_general_populate: general GPIO @ 5, valid: true, hwPin: 0x6
radeon_hd: gpio_i2c_populate: i2c GPIO @ 6, valid: true, hwPin: 0x90
radeon_hd: gpio_i2c_populate: i2c GPIO @ 7, valid: true, hwPin: 0x91
radeon_hd: gpio_i2c_populate: i2c GPIO @ 8, valid: true, hwPin: 0x92
radeon_hd: gpio_i2c_populate: i2c GPIO @ 9, valid: true, hwPin: 0x93
radeon_hd: gpio_i2c_populate: i2c GPIO @ 10, valid: true, hwPin: 0x94
radeon_hd: gpio_i2c_populate: i2c GPIO @ 11, valid: true, hwPin: 0x95
radeon_hd: gpio_i2c_populate: i2c GPIO @ 12, valid: true, hwPin: 0x96
radeon_hd: gpio_i2c_populate: i2c GPIO @ 13, valid: true, hwPin: 0x97
radeon_hd: connector_probe: found 3 potential display paths.
radeon_hd: pll_limit_probe: table 2.2
radeon_hd: pll_limit_probe: referenceFreq: 27000; pllOutMin: 600000;  pllOutMax: 1200000; pllInMin: 6750;pllInMax: 27000
radeon_hd: pll_limit_probe: table 2.2
radeon_hd: pll_limit_probe: referenceFreq: 27000; pllOutMin: 600000;  pllOutMax: 1200000; pllInMin: 6750;pllInMax: 27000
radeon_hd: pll_limit_probe: table 2.2
radeon_hd: pll_limit_probe: referenceFreq: 27000; pllOutMin: 600000;  pllOutMax: 1200000; pllInMin: 6750;pllInMax: 27000
radeon_hd: Currently detected connectors=============
radeon_hd: Connector #0)
radeon_hd:  + connector:          HDMI A
radeon_hd:  + i2c gpio table id:  7
radeon_hd:    - gpio hw pin:      0x91
radeon_hd:    - gpio valid:       true
radeon_hd:    - i2c valid:        true
radeon_hd:  + hpd gpio table id:  0
radeon_hd:    - gpio hw pin:      0x1
radeon_hd:    - gpio valid:       true
radeon_hd:  + encoder:            TMDS
radeon_hd:    - id:               30
radeon_hd:    - type:             Internal Kaleidoscope UNIPHY
radeon_hd:    - capabilities:     0x0
radeon_hd:    - enumeration:      1
radeon_hd:    - is bridge:        false
radeon_hd:    + external encoder: none
radeon_hd:  + flags:
radeon_hd:    * device DFP1 support
radeon_hd: Connector #1)
radeon_hd:  + connector:          DVI-D (Digital Only)
radeon_hd:  + i2c gpio table id:  6
radeon_hd:    - gpio hw pin:      0x90
radeon_hd:    - gpio valid:       true
radeon_hd:    - i2c valid:        true
radeon_hd:  + hpd gpio table id:  1
radeon_hd:    - gpio hw pin:      0x2
radeon_hd:    - gpio valid:       true
radeon_hd:  + encoder:            TMDS
radeon_hd:    - id:               30
radeon_hd:    - type:             Internal Kaleidoscope UNIPHY
radeon_hd:    - capabilities:     0x0
radeon_hd:    - enumeration:      2
radeon_hd:    - is bridge:        false
radeon_hd:    + external encoder: none
radeon_hd:  + flags:
radeon_hd:    * device DFP2 support
radeon_hd: Connector #2)
radeon_hd:  + connector:          VGA
radeon_hd:  + i2c gpio table id:  10
radeon_hd:    - gpio hw pin:      0x94
radeon_hd:    - gpio valid:       true
radeon_hd:    - i2c valid:        true
radeon_hd:  + hpd gpio table id:  0
radeon_hd:    - gpio hw pin:      0x1
radeon_hd:    - gpio valid:       true
radeon_hd:  + encoder:            TV DAC
radeon_hd:    - id:               21
radeon_hd:    - type:             Internal Kaleidoscope DAC1
radeon_hd:    - capabilities:     0x0
radeon_hd:    - enumeration:      1
radeon_hd:    - is bridge:        false
radeon_hd:    + external encoder: none
radeon_hd:  + flags:
radeon_hd:    * device CRT1 support
radeon_hd: ==========================================
radeon_hd: encoder_init: called
radeon_hd: transmitter_dig_setup: connector 0, pixelClock: 0
radeon_hd: transmitter_dig_setup: table 1.5
radeon_hd: encoder_pick_dig: connector 0
radeon_hd: transmitter_dig_setup: connector 1, pixelClock: 0
radeon_hd: transmitter_dig_setup: table 1.5
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: pll_set_external: set external pll clock to 600000
radeon_hd: pll_set_external: table 1.6
radeon_hd: dp_setup_connectors
radeon_hd: detect_displays: connector(0): bit-banging ddc for EDID.
DDC: ddc2_read: DDC information read failure
Last message repeated 3 times.
radeon_hd: detect_displays: connector(1): bit-banging ddc for EDID.
radeon_hd: connector_read_edid: found edid monitor on connector #1
radeon_hd: detect_displays: connector(1): found EDID data.
radeon_hd: init_registers, registers for ATI chipset Cape Verde crt #0 loaded
radeon_hd: detect_displays: connector(2): bit-banging ddc for EDID.
DDC: ddc2_read: DDC information read failure
Last message repeated 3 times.
radeon_hd: Currently detected monitors===============
radeon_hd: Display #0 attached = true
radeon_hd:  + connector ID:   1
radeon_hd:  + connector type: DVI-D (Digital Only)
radeon_hd:  + encoder type:   TMDS
radeon_hd:  + limits: Vert Min/Max: 56/75
radeon_hd:  + limits: Horz Min/Max: 30/80
radeon_hd: Display #1 attached = false
radeon_hd: ==========================================
radeon_hd: radeon_gpu_mc_setup: vramStart: 0x0, vramEnd: 0xFFFFFFF
radeon_hd: radeon_gpu_ring_setup called
radeon_hd: RingQueue: Requested 1048576 bytes for GFX RingQueue.
radeon_hd: RingQueue: Allocating 1048576 bytes for GFX RingQueue.
radeon_hd: radeon_gpu_ring_boot called
radeon_hd: radeon_gpu_ring_boot: TODO
radeon_hd: radeon_init_accelerant done
radeon_hd: radeon_get_edid_info
radeon_hd: encoder_output_lock: true
radeon_hd: display_crtc_lock
radeon_hd: encoder_dpms_set: display 0, power: false
radeon_hd: encoder_dpms_set_dig: display 0, power: false
radeon_hd: transmitter_dig_setup: connector 1, pixelClock: 0
radeon_hd: transmitter_dig_setup: table 1.5
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: display_crtc_dpms: crtc 0 dpms powerdown
radeon_hd: display_crtc_blank
radeon_hd: display_crtc_power
radeon_hd: encoder_assign_crtc
radeon_hd: encoder_assign_crtc: table 1.2
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: encoder_crtc_scratch: display 0
radeon_hd: radeon_set_display_mode: pll 0 selected for connector 1
radeon_hd: pll_asic_ss_probe: ss match found
radeon_hd: pll_setup_flags: CRTC: 0, PLL: 0
radeon_hd: pll_adjust: table 1.3
radeon_hd: pll_adjust: was: 64996, now: 64990
radeon_hd: pll_compute_post_divider: vco = 600000
radeon_hd: pll_compute_post_divider: postDiv = 9
radeon_hd: pll_compute: using minimum reference divider
radeon_hd: pll_compute: performing fractional feedback calculations
radeon_hd: pll_compute: Calculated pixel clock of 65000 based on:
radeon_hd: pll_compute:   referenceFrequency: 27000; referenceDivider: 3
radeon_hd: pll_compute:   feedbackDivider: 65; feedbackDividerFrac: 0
radeon_hd: pll_compute:   postDivider: 9
radeon_hd: pll_compute: pixel clock 64990 was changed to 65000
radeon_hd: pll_set: table 1.6
radeon_hd: pll_set: set adjusted pixel clock 65000 (was 64996)
radeon_hd: atom_op_jump: Error: AtomBIOS stuck in loop for more then 5 seconds. (404531 identical jmp op's)
radeon_hd: atom_execute_table_locked: AtomBIOS parser aborted calling operation DELAY_MICROSEC (0x51) @ 0xC2D9
radeon_hd: atom_execute_table: AtomBIOS parser was aborted in table SetPixelClock (0xC)
radeon_hd: display_crtc_ss
radeon_hd: display_crtc_ss: external SS, ignoring SS request
radeon_hd: display_crtc_set_dtd called to do 1024x768
radeon_hd: display_crtc_fb_set: Framebuffer at: 0x0
radeon_hd: display_crtc_fb_set: Set SurfaceAddress High: 0x0
radeon_hd: display_crtc_fb_set: Set SurfaceAddress: 0x0
radeon_hd: display_crtc_fb_set: fb: 1024x768 (32 bpp)
radeon_hd: display_crtc_fb_set: fb pitch: 1024
radeon_hd: display_dce45_crtc_load_lut: crtcID 0
radeon_hd: display_crtc_scale
radeon_hd: encoder_mode_set: display 0
radeon_hd: encoder_dig_setup
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: encoder_dig_setup: table 1.4
radeon_hd: encoder_dig_setup
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: encoder_dig_setup: table 1.4
radeon_hd: encoder_apply_quirks: display 0
radeon_hd: display_crtc_dpms: crtc 0 dpms powerup
radeon_hd: display_crtc_power
radeon_hd: display_crtc_blank
radeon_hd: encoder_dpms_set: display 0, power: true
radeon_hd: encoder_dpms_set_dig: display 0, power: true
radeon_hd: encoder_dig_setup
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: encoder_dig_setup: table 1.4
radeon_hd: encoder_dig_setup
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: encoder_dig_setup: table 1.4
radeon_hd: transmitter_dig_setup: connector 1, pixelClock: 65000
radeon_hd: transmitter_dig_setup: table 1.5
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: display_crtc_lock
radeon_hd: encoder_output_lock: false
radeon_hd: Current DisplayPort Info =================
radeon_hd: Connector #0) DP: false
radeon_hd: Connector #1) DP: false
radeon_hd: Connector #2) DP: false
radeon_hd: ==========================================
radeon_hd: D1CRTC_STATUS        Value: 0x2
radeon_hd: D2CRTC_STATUS        Value: 0x0
radeon_hd: D1CRTC_CONTROL       Value: 0x0
radeon_hd: D2CRTC_CONTROL       Value: 0x0
radeon_hd: D1GRPH_ENABLE        Value: 0x0
radeon_hd: D2GRPH_ENABLE        Value: 0x0
radeon_hd: D1SCL_ENABLE         Value: 0x0
radeon_hd: D2SCL_ENABLE         Value: 0x0
radeon_hd: D1CRTC_BLANK_CONTROL Value: 0x0
radeon_hd: D2CRTC_BLANK_CONTROL Value: 0x0
radeon_hd: radeon_get_frame_buffer_config
radeon_hd: display_crtc_dpms: crtc 0 dpms powerup
radeon_hd: display_crtc_power
radeon_hd: display_crtc_blank
radeon_hd: encoder_dpms_set: display 0, power: true
radeon_hd: encoder_dpms_set_dig: display 0, power: true
radeon_hd: encoder_dig_setup
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: encoder_dig_setup: table 1.4
radeon_hd: encoder_dig_setup
radeon_hd: encoder_pick_dig: connector 1
radeon_hd: encoder_dig_setup: table 1.4
radeon_hd: transmitter_dig_setup: connector 1, pixelClock: 65000
radeon_hd: transmitter_dig_setup: table 1.5
radeon_hd: encoder_pick_dig: connector 1
arch_thread_init_kthread_stack(0xffffffc006aa7e80(create_app_meta_mime (s)))
arch_thread_enter_uspace()
arch_thread_init_kthread_stack(0xffffffc006aa7e80(input_server))
arch_thread_enter_uspace()
STrap(exception storeAccessFault)
  sstatus: (ie: {}, pie: {s}, spp: u, sum: 0)
  sie: {sTimer, sExtern}
  sip: {}
  stval: 0xffffffc12b802000
  tp: 0xffffffc006aa7380(app_server)
PANIC: unhandled STrap
Welcome to Kernel Debugging Land...
Thread 632 "app_server" running on CPU 0
Stack:
FP: 0xffffffc002495400
FP: 0xffffffc002495510, PC: 0xffffffc00215a645 <kernel_riscv64> arch_debug_call_with_fault_handler + 91
FP: 0xffffffc002495560, PC: 0xffffffc0020d22b1 <kernel_riscv64> debug_call_with_fault_handler.localalias.7 + 129
FP: 0xffffffc0024955f0, PC: 0xffffffc0020d38db <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 299
FP: 0xffffffc002495660, PC: 0xffffffc0020d3bc7 <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 135
FP: 0xffffffc0024956a0, PC: 0xffffffc0020d3f0f <kernel_riscv64> panic + 101
FP: 0xffffffc0024957d0, PC: 0xffffffc00215b857 <kernel_riscv64> STrap + 399
FP: 0xffffffc0024958d0, PC: 0xffffffc0021598dd <kernel_riscv64> SVecU + 109
FP: 0x3eb9959830, PC: 0x26f907fc87 <app_server_seg0ro> 0xe7c87
FP: 0x3eb9959880, PC: 0x26f908004f <app_server_seg0ro> 0xe804f
FP: 0x3eb99598e0, PC: 0x26f906796d <app_server_seg0ro> 0xcf96d
FP: 0x3eb9959980, PC: 0x26f908164b <app_server_seg0ro> 0xe964b
FP: 0x3eb99599d0, PC: 0x26f907f6c9 <app_server_seg0ro> 0xe76c9
FP: 0x3eb9959a90, PC: 0x26f9079da9 <app_server_seg0ro> 0xe1da9
FP: 0x3eb9959b00, PC: 0x26f9018351 <app_server_seg0ro> 0x80351
FP: 0x3eb9959bb0, PC: 0x26f901bef7 <app_server_seg0ro> 0x83ef7
FP: 0x3eb9959bf0, PC: 0x26f90109f7 <app_server_seg0ro> 0x789f7
FP: 0x3eb9959ca0, PC: 0x26f9010c0f <app_server_seg0ro> 0x78c0f
FP: 0x3eb9959ef0, PC: 0x22bd968b69 <libbe.so_seg0ro> 0x141b69
FP: 0x3eb9959f50, PC: 0x22bd96f919 <libbe.so_seg0ro> 0x148919
FP: 0x3eb9959f70, PC: 0x22bd9660d9 <libbe.so_seg0ro> 0x13f0d9
FP: 0x3eb9959fa0, PC: 0x26f900fec7 <app_server_seg0ro> 0x77ec7
FP: 0x3eb9959fd0, PC: 0x26f9010239 <app_server_seg0ro> 0x78239
FP: 0x3eb995a000, PC: 0x2dca6fe743 <runtime_loader_seg0ro> 0x12743
FP: 0xffffffc002495900, PC: 0xffffffc00215c177 <kernel_riscv64> arch_thread_enter_userspace + 145
FP: 0xffffffc002495a30, PC: 0xffffffc0020aff81 <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 109
FP: 0xffffffc002495a90, PC: 0xffffffc0020b1ac1 <kernel_riscv64> thread_enter_userspace_new_team + 57
FP: 0xffffffc002495f80, PC: 0xffffffc0020aa47b <kernel_riscv64> _ZL33team_create_thread_start_internalPv + 651
FP: 0xffffffc002495f90, PC: 0xffffffc0020abcc5 <kernel_riscv64> _ZL24team_create_thread_startPv + 15
FP: 0xffffffc002495fb0, PC: 0xffffffc0020b4c4d <kernel_riscv64> _ZL19common_thread_entryPv + 57
FP: 0x0, PC: 0xffffffc0021597b5 <kernel_riscv64> arch_thread_entry + 3
kdebug>

If someone (@kallisti5?) knows how radeon_hd driver works, please tell what is happening.

10 Likes

heh. This is the first time my radeon_hd driver has run on anything except x86 :slight_smile:

Here’s a rundown:

  • AMD cards have something called “atombios”. Essentially there is code that executes from the card itself. atombios has it’s own simple ISA + opcode design.
  • Atombios has a data and function area.
    • data contains important card + state information
    • function is the list of functions (applications?) available to execute on the card and where they live.

The host’s driver executes the atombios functions to do various things on the card in a card-specific way.

I would enable ATOMBIOS tracing. It will give you a LOT of insight into what Atombios is doing down to the opcodes being issued.

https://git.haiku-os.org/haiku/tree/src/add-ons/accelerants/radeon_hd/atombios/atom.cpp#n44

15 Likes

After some obvious fixes such as proper handling of 64 bit PCI BARs and enabling MMIO decoding and also using VGA connector it started to display something. Now it crash in app_server Deskbar thread. “storeAccessFault” is illegal attempt to write to physical memory.

STrap(exception storeAccessFault)
  sstatus: (ie: {}, pie: {s}, spp: u, sum: 0)
  sie: {sTimer, sExtern}
  sip: {}
  stval: 0xffffffc12b802be4
  tp: 0xffffffc001468440(w:699:Deskbar)
PANIC: unhandled STrap
Welcome to Kernel Debugging Land...
Thread 721 "w:699:Deskbar" running on CPU 0
Stack:
FP: 0xffffffc00252a960
FP: 0xffffffc00252aa70, PC: 0xffffffc00215a645 <kernel_riscv64> arch_debug_call_with_fault_handler + 91
FP: 0xffffffc00252aac0, PC: 0xffffffc0020d22b1 <kernel_riscv64> debug_call_with_fault_handler.localalias.7 + 129
FP: 0xffffffc00252ab50, PC: 0xffffffc0020d38db <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 299
FP: 0xffffffc00252abc0, PC: 0xffffffc0020d3bc7 <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 135
FP: 0xffffffc00252ac00, PC: 0xffffffc0020d3f0f <kernel_riscv64> panic + 101
FP: 0xffffffc00252ad30, PC: 0xffffffc00215b857 <kernel_riscv64> STrap + 399
FP: 0xffffffc00252ae30, PC: 0xffffffc0021598dd <kernel_riscv64> SVecU + 109
FP: 0x366d9c4cb0, PC: 0x165e8acc87 <app_server_seg0ro> 0xe7c87
FP: 0x366d9c4d00, PC: 0x165e8ad04f <app_server_seg0ro> 0xe804f
FP: 0x366d9c4d60, PC: 0x165e89496d <app_server_seg0ro> 0xcf96d
FP: 0x366d9c4e00, PC: 0x165e8ae64b <app_server_seg0ro> 0xe964b
FP: 0x366d9c4e50, PC: 0x165e8ac6c9 <app_server_seg0ro> 0xe76c9
FP: 0x366d9c4e80, PC: 0x165e87d049 <app_server_seg0ro> 0xb8049
FP: 0x366d9c4f40, PC: 0x165e874fbf <app_server_seg0ro> 0xaffbf
FP: 0x366d9c4fd0, PC: 0x165e86fd3b <app_server_seg0ro> 0xaad3b
FP: 0x366d9c4fe0, PC: 0x165e852b05 <app_server_seg0ro> 0x8db05
FP: 0x366d9c5000, PC: 0x1416808f85 <libroot.so_seg0ro> 0x3bf85
FP: 0xffffffc00252ae60, PC: 0xffffffc00215c177 <kernel_riscv64> arch_thread_enter_userspace + 145
FP: 0xffffffc00252af90, PC: 0xffffffc0020aff81 <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 109
FP: 0xffffffc00252afb0, PC: 0xffffffc0020b4c71 <kernel_riscv64> _ZL19common_thread_entryPv + 93
FP: 0x0, PC: 0xffffffc0021597b5 <kernel_riscv64> arch_thread_entry + 3
kdebug>

CIMG4712

31 Likes

I finally managed to run desktop. Crashes was caused by unaligned access to framebuffer, access seems to require 16 byte alignment. I made some quick hack to enforce alignment in app_server when copying to front buffer, but it currently introduce artifacts.

I don’t know why 16 byte alignment is required, radeon_hd driver works fine on Acer W500 tablet without alignment tricks.

CIMG4716

59 Likes

Congratulations. What an achievement! :tada:

So looking forward to get a RISC computer dedicated to run Haiku :grinning:

8 Likes

This is simply astonishing! Hats off and kudos to you for your hard work and mad skills!

13 Likes

Wow wtf, unbelievable work…
Congtats and Nastrowie for the dektop to show.
We should consider a prize for your archivement.
Just great very fast straight forward process.
Nice and it makes me confident to hold on Haiku developement efforts.
Like a light in the dark…
Fascinating.

3 Likes

@jt15s Maybe you can promote this achievement by a blog post ?

3 Likes

Maybe fix artifacts first?

11 Likes

Would enabling write-combining, the way VESA & Framebuffer drivers do, potentially fix this problem? It may get the CPU to write a full cache line at a time instead of unaligned bytes.

3 Likes

I fixed problem by using 32 bit copy per step. It seems that 64 bit access should use 64 bit (8 byte) aligned pointers.

CIMG4717

31 Likes

Memory types are not yet implemented for RISC-V.

2 Likes

Another interesting thing is that HDA audio is recognized for video card HDMI port. Maybe audio will work by HDMI.

11 Likes

I’ve shared some info on your awesome progress on Reddit, and someone there is asking if there’s an SD card image that be used to play with.

6 Likes

I boot from USB disk, SD card is left untouched. I may upload test live USB image later. Note that it have known problems and not yet ready for general use.

SD card has 3 problems:

  1. It is not yet supported by Haiku.
  2. It should include 2 additional partitions with low-level firmware code.
  3. It is slow, at least on Linux.
4 Likes

An image which can be dd-d to a drive should be sufficient, and of course the expectations would be set that this is pre-pre alpha.

Also… @X512… I’ve been on the edge of my seat these past few months reading and waiting for your updates. This is awesome work, and I wish I was at your level.

5 Likes

Also people who want to test should aware that video card is mandatory, there are no text mode. Currently only Radeon graphics are included and tested.

3 Likes