My Haiku RISC-V port progress

I’d love to have a RISC-V powered HaikuBox.

5 Likes

Some progress report: I made experiments on my mini OS and implemented following:

  1. FDT parsing and using it for getting MMIO registers, IRQ, memory size and Virtio device list.

  2. Now system is operating in supervisor mode instead of machine mode.

  3. Implemented timer interrupt forwarding and control for supervisor mode. In most RISC-V implementations timer is available only for machine mode and machine mode code should be used to deliver interrupts to supervisor mode. For Haiku some small resident machine mode program also should be used to deliver timer interrupts. Timer is used to switch threads and for timeouts (snooze, thread locking etc.). Timer is tested by moving black rectangle on screenshot.

  4. Improved Virtio driver. Now it can handle multiple queues. Virtio console is implemented.

  5. Implemented basic GUI system. It supports view hierarchy, clipping, deferring repainting with dirty rect, message delivery, setting focus for keyboard and pointer messages (keyboard focus is red frame in screenshot).

  6. Implemented keyboard and tablet message generation and passing to GUI. Pointer testing view is presented on screenshot. Also some SDL bug was found when multiple mouse buttons are pressed.

Now it is ready for introducing virtual memory and experimenting with it. In Haiku 2 virtual memory implementations will be needed: in haiku_loader and in kernel.

screenshot40

28 Likes

I managed to get KDL and basic stack trace working:

+vm_allocate_early
PANIC: not implemented: status_t arch_vm_translation_map_early_map(kernel_args*, addr_t, phys_addr_t, uint8, phys_addr_t (*)(kernel_args*))

Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0
arch_debug_stack_trace()
Stack:
FP: 0x80be9a50, PC: 0x8030a4d9
FP: 0x80be9ac0, PC: 0x8030a765
FP: 0x80be9b00, PC: 0x8030aa71
FP: 0x80be9b50, PC: 0x8037ca61
FP: 0x80be9bb0, PC: 0x803666dd
FP: 0x80be9c00, PC: 0x80358ac1
FP: 0x80be9cc0, PC: 0x8035a10b
FP: 0x80be9d70, PC: 0x8035a2ad
FP: 0x80be9da0, PC: 0x80356e0d
FP: 0x80be9e20, PC: 0x8035d2dd
FP: 0x80be9e70, PC: 0x8035c815
FP: 0x80be9f00, PC: 0x80356ed9
FP: 0x80be9fe0, PC: 0x8036985d
FP: 0x80bea000, PC: 0x802d3e23
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261a7
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d

The problem was absolute addresses in vtable that was not included to relocation table for some reason. Kernel is currently loaded at dynamically defined address that don’t math address in linker script (0x80000000 currently used for haiku_loader). Using -fpic and -shared compiler flags fixed issue. Additional relocation types were needed to be implemented (jump slot).

No luck in getting built-in symbol lookup working because it use heap that not yet working. Lets port my mini OS stack tracer…

Also I introduced virtual memory to my mini OS, now it is possible to map virtual memory and catch page fault traps.

11 Likes

Got symbol names in stack trace:

Modules:
module: kernel_riscv64
  text: 0x80255000, 0x156000, 2445312
  data: 0x803ab000, 0x51000, 2445312
module: session
  text: 0x80be2000, 0x3000, 2159943680
  data: 0x80be5000, 0x1000, 2159943680
module: write_overlay
  text: 0x80bd6000, 0x6000, 2159894528
  data: 0x80bdc000, 0x1000, 2159894528
module: udf
  text: 0x80bbf000, 0xb000, 2159800320
  data: 0x80bca000, 0x1000, 2159800320
module: reiserfs
  text: 0x80b91000, 0xf000, 2159611904
  data: 0x80ba0000, 0x1000, 2159611904
module: ntfs
  text: 0x80ad8000, 0x4d000, 2158854144
  data: 0x80b25000, 0x4000, 2158854144
module: log_overlay
  text: 0x80ac9000, 0x7000, 2158792704
  data: 0x80ad0000, 0x1000, 2158792704
module: iso9660
  text: 0x80ac4000, 0x4000, 2158772224
  data: 0x80ac8000, 0x1000, 2158772224
module: fat
  text: 0x80a8b000, 0x1c000, 2158538752
  data: 0x80aa7000, 0x2000, 2158538752
module: ext2
  text: 0x80a2f000, 0x20000, 2158161920
  data: 0x80a4f000, 0x2000, 2158161920
module: exfat
  text: 0x80a22000, 0x6000, 2158108672
  data: 0x80a28000, 0x1000, 2158108672
module: btrfs
  text: 0x809e4000, 0x17000, 2157854720
  data: 0x809fb000, 0x1000, 2157854720
module: bindfs
  text: 0x809df000, 0x4000, 2157834240
  data: 0x809e3000, 0x1000, 2157834240
module: attribute_overlay
  text: 0x809d5000, 0x5000, 2157793280
  data: 0x809da000, 0x1000, 2157793280
module: xhci
  text: 0x809ad000, 0x14000, 2157629440
  data: 0x809c1000, 0x1000, 2157629440
module: virtio_scsi
  text: 0x809a8000, 0x4000, 2157608960
  data: 0x809ac000, 0x1000, 2157608960
module: virtio_pci
  text: 0x80995000, 0x2000, 2157531136
  data: 0x80997000, 0x1000, 2157531136
module: virtio_block
  text: 0x80991000, 0x3000, 2157514752
  data: 0x80994000, 0x1000, 2157514752
module: virtio
  text: 0x80986000, 0x5000, 2157469696
  data: 0x8098b000, 0x1000, 2157469696
module: usb_disk
  text: 0x8095d000, 0x10000, 2157301760
  data: 0x8096d000, 0x5000, 2157301760
module: usb
  text: 0x80942000, 0xd000, 2157191168
  data: 0x8094f000, 0x1000, 2157191168
module: uhci
  text: 0x8090f000, 0x11000, 2156982272
  data: 0x80920000, 0x1000, 2156982272
module: silicon_image_3112
  text: 0x8090b000, 0x3000, 2156965888
  data: 0x8090e000, 0x1000, 2156965888
module: sdhci_pci
  text: 0x80906000, 0x4000, 2156945408
  data: 0x8090a000, 0x1000, 2156945408
module: scsi_periph
  text: 0x80901000, 0x4000, 2156924928
  data: 0x80905000, 0x1000, 2156924928
module: scsi_disk
  text: 0x808fe000, 0x2000, 2156912640
  data: 0x80900000, 0x1000, 2156912640
module: scsi_cd
  text: 0x808fa000, 0x3000, 2156896256
  data: 0x808fd000, 0x1000, 2156896256
module: scsi
  text: 0x808eb000, 0x7000, 2156834816
  data: 0x808f2000, 0x1000, 2156834816
module: pci
  text: 0x808c8000, 0x9000, 2156691456
  data: 0x808d1000, 0x1000, 2156691456
module: packagefs
  text: 0x807c5000, 0x54000, 2155630592
  data: 0x80819000, 0x5000, 2155630592
module: ohci
  text: 0x807a1000, 0x12000, 2155483136
  data: 0x807b3000, 0x1000, 2155483136
module: mmc_disk
  text: 0x8079d000, 0x3000, 2155466752
  data: 0x807a0000, 0x1000, 2155466752
module: mmc
  text: 0x8079a000, 0x2000, 2155454464
  data: 0x8079c000, 0x1000, 2155454464
module: locked_pool
  text: 0x80797000, 0x2000, 2155442176
  data: 0x80799000, 0x1000, 2155442176
module: legacy_sata
  text: 0x80794000, 0x2000, 2155429888
  data: 0x80796000, 0x1000, 2155429888
module: it8211
  text: 0x80792000, 0x1000, 2155421696
  data: 0x80793000, 0x1000, 2155421696
module: intel
  text: 0x8076b000, 0xb000, 2155261952
  data: 0x80776000, 0x2000, 2155261952
module: highpoint_ide_pci
  text: 0x80768000, 0x2000, 2155249664
  data: 0x8076a000, 0x1000, 2155249664
module: generic_ide_pci
  text: 0x80766000, 0x1000, 2155241472
  data: 0x80767000, 0x1000, 2155241472
module: ehci
  text: 0x8073e000, 0x14000, 2155077632
  data: 0x80752000, 0x1000, 2155077632
module: efi_gpt
  text: 0x80717000, 0xb000, 2154917888
  data: 0x80722000, 0x2000, 2154917888
module: dpc
  text: 0x80715000, 0x1000, 2154909696
  data: 0x80716000, 0x1000, 2154909696
module: config_manager
  text: 0x80713000, 0x1000, 2154901504
  data: 0x80714000, 0x1000, 2154901504
module: bfs
  text: 0x8069c000, 0x30000, 2154414080
  data: 0x806cc000, 0x2000, 2154414080
module: ata_adapter
  text: 0x80699000, 0x2000, 2154401792
  data: 0x8069b000, 0x1000, 2154401792
module: ata
  text: 0x80687000, 0x9000, 2154328064
  data: 0x80690000, 0x1000, 2154328064
module: ahci
  text: 0x80671000, 0xa000, 2154237952
  data: 0x8067b000, 0x2000, 2154237952
Stack:
FP: 0x80beaa50, PC: <kernel_riscv64>_ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80beaac0, PC: <kernel_riscv64>_ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80beab00, PC: <kernel_riscv64>panic + 93
FP: 0x80beab50, PC: <kernel_riscv64>arch_vm_translation_map_early_map + 27
FP: 0x80beabb0, PC: <kernel_riscv64>vm_allocate_early + 827
FP: 0x80beac00, PC: <kernel_riscv64>_ZN13MemoryManager13_AllocateAreaEjRPNS_4AreaE.localalias.10 + 73
FP: 0x80beacc0, PC: <kernel_riscv64>_ZN13MemoryManager15_AllocateChunksEmjjRPNS_9MetaChunkERPNS_5ChunkE.localalias.16 + 381
FP: 0x80bead70, PC: <kernel_riscv64>_ZN13MemoryManager11AllocateRawEmjRPv + 297
FP: 0x80beada0, PC: <kernel_riscv64>_Z17block_alloc_earlym + 177
FP: 0x80beae20, PC: <kernel_riscv64>_ZN16SmallObjectCache6CreateEPKcmmmmmjPvPFiS2_S2_EPFvS2_S2_EPFvS2_iE + 185
FP: 0x80beae70, PC: <kernel_riscv64>create_object_cache_etc.localalias.0 + 39
FP: 0x80beaf00, PC: <kernel_riscv64>_Z25block_allocator_init_bootv + 151
FP: 0x80beafe0, PC: <kernel_riscv64>vm_init + 113
FP: 0x80beb000, PC: <kernel_riscv64>_start + 393
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261a7
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
kdebug> 
8 Likes

Fixing kernel linking problems caused more progress. Now it freeze at create_area() in vm_page_init_post_area().

Kernel entry point
arch_debug_init()
Welcome to kernel debugger output!
Haiku revision: , debug level: 2
INIT: init CPU
INIT: init interrupts
INIT: init VM
vm_init: entry
vm_translation_map_init()
physical memory ranges:
  80000000 - 88000000
allocated physical ranges:
  80000000 - 80beb000
allocated virtual ranges:
  80000000 - 80beb000
+RISCV64VMPhysicalPageMapper
arch_vm_init()
(1)
first phys page = 0x80000, end 0x88000
(2)
+vm_allocate_early
-vm_allocate_early
(3)
vm_page_init: entry
+vm_allocate_early
-vm_allocate_early
vm_init: putting free_page_table @ 0x0000000081800000, # ents 32768 (size 0x280000)
initialized table
mark_page_range_in_use: start 0x0, len 0x80000
mark_page_range_in_use(0x0, 0x80000): start page is before free list
mark_page_range_in_use: start 0x80000, len 0x166b
vm_page_init: exit
(4)
(5)
(6)
(7)
arch_vm_translation_map_create_map()
(8)
reserve_boot_loader_ranges()
(10)
arch_vm_translation_map_init_post_area()
(11)
arch_vm_init_post_area()
(12)
(2.1)
6 Likes

amazing work

Interrupt handling implemented. Now it is posssible to see why and where kernel crashes. It seems to mess stack and call some garbage, causing illegal instruction exception. Not suprizing because paging is still not implemented and non-identity page mapping was requested in arch_vm_translation_map_early_map().

Kernel stack at 0x80be7000
kernel entry at 802d3d9a
Kernel entry point
arch_debug_init()
Welcome to kernel debugger output!
Haiku revision: , debug level: 2
INIT: init CPU
INIT: init interrupts
arch_int_init()
MTrap(exception mEcall)
  mstatus: (ie: {s}, pie: {m}, spp: u, mpp: m)
  mepc: <kernel_riscv64> arch_int_init + 56
  mie: {}
  mip: {mTimer, sExtern, mExtern}
  sip: {}
Stack:
FP: 0x80bebed0, PC: <kernel_riscv64> MTrap + 391
FP: 0x80bebfd0, PC: <kernel_riscv64> MVec + 81
FP: 0x80bebfe0, PC: <kernel_riscv64> arch_int_init + 55
FP: 0x80bec000, PC: <kernel_riscv64> _start + 369
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261a7
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
INIT: init VM
vm_init: entry
vm_translation_map_init()
physical memory ranges:
  80000000 - 88000000
allocated physical ranges:
  80000000 - 80bec000
allocated virtual ranges:
  80000000 - 80bec000
+RISCV64VMPhysicalPageMapper
arch_vm_init()
(1)
first phys page = 0x80000, end 0x88000
(2)
+vm_allocate_early
-vm_allocate_early
(3)
vm_page_init: entry
+vm_allocate_early
-vm_allocate_early
vm_init: putting free_page_table @ 0x0000000081800000, # ents 32768 (size 0x280000)
initialized table
mark_page_range_in_use: start 0x0, len 0x80000
mark_page_range_in_use(0x0, 0x80000): start page is before free list
mark_page_range_in_use: start 0x80000, len 0x166c
vm_page_init: exit
(4)
(5)
(6)
(7)
arch_vm_translation_map_create_map()
(8)
reserve_boot_loader_ranges()
(10)
arch_vm_translation_map_init_post_area()
(11)
arch_vm_init_post_area()
(12)
(2.1)
MTrap(exception illegalInst)
  mstatus: (ie: {s}, pie: {m}, spp: u, mpp: m)
  mepc: 0x8004315a
  mie: {}
  mip: {mTimer, sExtern, mExtern}
  sip: {}
Stack:
FP: 0x80bebe70, PC: <kernel_riscv64> MTrap + 391
FP: 0x80bebf70, PC: <kernel_riscv64> MVec + 81
FP: 0x0, PC: 0x80043159
PANIC: unhandled MTrap
Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0
Stack:
FP: 0x80bebd80, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80bebdf0, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80bebe30, PC: <kernel_riscv64> panic + 93
FP: 0x80bebf70, PC: <kernel_riscv64> MVec + 81
FP: 0x0, PC: 0x80043159
kdebug>
9 Likes

Switching to supervisor mode and early paging is implemented. Crash is attempt to write to address 0x7 (probably NULL dereference).

Kernel stack at 0x80c05000
kernel entry at 802d4840
Kernel entry point
arch_debug_init()
Welcome to kernel debugger output!
Haiku revision: , debug level: 2
INIT: init CPU
INIT: init interrupts
arch_int_init()
MTrap(exception mEcall)
  mstatus: (ie: {s}, pie: {m}, spp: u, mpp: m)
  mepc: <kernel_riscv64> msyscall + 0
  mie: {}
  mip: {mTimer, sExtern, mExtern}
  sip: {}
Stack:
FP: 0x80c09ed0, PC: <kernel_riscv64> MTrap + 331
FP: 0x80c09fd0, PC: <kernel_riscv64> MVec + 81
FP: 0x80c09fe0, PC: <kernel_riscv64> 0x8038998f
FP: 0x80c0a000, PC: <kernel_riscv64> _start + 369
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261a7
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
testMmodeSyscall(10, -15, 12345678987654321)
testMmodeSyscall: 456
MTrap(exception mEcall)
  mstatus: (ie: {s}, pie: {m}, spp: u, mpp: m)
  mepc: <kernel_riscv64> msyscall + 0
  mie: {}
  mip: {mTimer, sExtern, mExtern}
  sip: {}
Stack:
FP: 0x80c09ed0, PC: <kernel_riscv64> MTrap + 331
FP: 0x80c09fd0, PC: <kernel_riscv64> MVec + 81
FP: 0x80c09fe0, PC: <kernel_riscv64> 0x8038998f
FP: 0x80c0a000, PC: <kernel_riscv64> _start + 369
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261a7
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
switchToSmodeMmodeSyscall()
  mstatus (2): (ie: {s}, pie: {m}, spp: u, mpp: s)
INIT: init VM
vm_init: entry
vm_translation_map_init()
paging enabled
PhysMem(0): 0x08145117
PhysMem(4): 0x0810113
PhysMem(8): 0x08ef4401
physical memory ranges:
  80000000 - 88000000
allocated physical ranges:
  80000000 - 80c56000
allocated virtual ranges:
  80000000 - 80c0a000
+RISCV64VMPhysicalPageMapper
arch_vm_init()
(1)
first phys page = 0x80000, end 0x88000
(2)
+vm_allocate_early
-vm_allocate_early
(3)
vm_page_init: entry
+vm_allocate_early
-vm_allocate_early
vm_init: putting free_page_table @ 0x0000000081800000, # ents 32768 (size 0x280000)
initialized table
mark_page_range_in_use: start 0x0, len 0x80000
mark_page_range_in_use(0x0, 0x80000): start page is before free list
mark_page_range_in_use: start 0x80000, len 0x16dc
vm_page_init: exit
(4)
(5)
(6)
(7)
arch_vm_translation_map_create_map()
+RISCV64VMTranslationMap
(8)
reserve_boot_loader_ranges()
(10)
arch_vm_translation_map_init_post_area()
(11)
arch_vm_init_post_area()
(12)
(2.1)
MTrap(exception storePageFault)
  mstatus: (ie: {s}, pie: {m}, spp: u, mpp: s)
  mepc: <kernel_riscv64> get_memory_map_etc.localalias.8 + 490
  mie: {}
  mip: {mTimer, sExtern, mExtern}
  sip: {}
  mtval: 0x7
Stack:
FP: 0x80c09de0, PC: <kernel_riscv64> MTrap + 305
FP: 0x80c09ee0, PC: <kernel_riscv64> MVec + 81
FP: 0x80c09f10, PC: <kernel_riscv64> get_memory_map_etc.localalias.8 + 489
FP: 0x80c09fe0, PC: <kernel_riscv64> vm_init + 581
FP: 0x80c0a000, PC: <kernel_riscv64> _start + 393
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261a7
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
PANIC: unhandled MTrap
Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0
Stack:
FP: 0x80c09cf0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80c09d60, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80c09da0, PC: <kernel_riscv64> panic + 93
FP: 0x80c09ee0, PC: <kernel_riscv64> MVec + 81
FP: 0x80c09f10, PC: <kernel_riscv64> get_memory_map_etc.localalias.8 + 489
FP: 0x80c09fe0, PC: <kernel_riscv64> vm_init + 581
FP: 0x80c0a000, PC: <kernel_riscv64> _start + 393
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261a7
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
kdebug> 
5 Likes

Now I get borken symbol versions for vm/vm.cpp. It produce some strange and wrong code instead for creating alias:

Exports 
Id	Type	Bind	Vis	Version	Size	Value	Name
1233	func	glb	def	KERNEL_BASE	144	80120D24	create_area
3770	func	glb	def	KERNEL_BASE	156	801218D8	__create_area_haiku (* why address is different? *)
  create_area			(* What is this and where it come from? *)
80120D24	16B7 8000 	LUI A3, $80001000
80120D28	8693 3016 	LI A3, $80001301
80120D2C	B7BD 	J $80120C9A
80120D2E	06B7 8000 	LUI A3, $80000000
80120D32	0695 	LI A3, $80000005
80120D34	B79D 	J $80120C9A
80120D36	56FD 	LI A3, -1
80120D38	B78D 	J $80120C9A
80120D3A	3703 F604 	LD A4, -160(FP)
80120D3E	76B7 8000 	LUI A3, $80007000
80120D42	8693 0296 	LI A3, $80007029
80120D46	C31C 	SW A5, 0(A4)
80120D48	BF89 	J $80120C9A

80120C9A	60EA 	LD RA, 152(SP)
80120C9C	644A 	LD FP, 144(SP)
80120C9E	64AA 	LD S1, 136(SP)
80120CA0	690A 	LD S2, 128(SP)
80120CA2	79E6 	LD S3, 120(SP)
80120CA4	7A46 	LD S4, 112(SP)
80120CA6	7AA6 	LD S5, 104(SP)
80120CA8	7B06 	LD S6, 96(SP)
80120CAA	6BE6 	LD S7, 88(SP)
80120CAC	6C46 	LD S8, 80(SP)
80120CAE	6CA6 	LD S9, 72(SP)
80120CB0	6D06 	LD S10, 64(SP)
80120CB2	7DE2 	LD S11, 56(SP)
80120CB4	8536 	MV A0, A3
80120CB6	610D 	ADDI SP, SP, 160
80120CB8	8082 	RET

Issue is temponary fixed by creating aliases instead of symbol versions:

extern "C" area_id create_area(const char* name, void** _address, uint32 addressSpec, size_t size, uint32 lock, uint32 protection)
{
	return __create_area_haiku(name, _address, addressSpec, size, lock, protection);
}

Now it progress to unimplemented methods in RISCV64VMTranslationMap:

PANIC: not implemented: virtual bool RISCV64VMTranslationMap::Lock()

Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0
Stack:
FP: 0x80c08c00, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80c08c70, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80c08cb0, PC: <kernel_riscv64> panic + 93
FP: 0x80c08d00, PC: <kernel_riscv64> _ZN23RISCV64VMTranslationMap4LockEv.localalias.3 + 27
FP: 0x80c08e40, PC: <kernel_riscv64> vm_create_anonymous_area.localalias.35 + 1737
FP: 0x80c08ef0, PC: <kernel_riscv64> __create_area_haiku.localalias.2 + 137
FP: 0x80c08f10, PC: <kernel_riscv64> vm_page_init_post_area + 67
FP: 0x80c08fe0, PC: <kernel_riscv64> vm_init + 555
FP: 0x80c09000, PC: <kernel_riscv64> _start + 393
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261cb
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
kdebug> 
5 Likes

OOh KDL is working :slight_smile: Nice progress…

NOTE: This post was recovered after broken network and reboot. It was written some time before.

I have progressed to “init modules” stage. It currently crashes with PANIC: remove page 0x000000008183c0a0 from cache 0x0000000081013ee0: page still has mappings!

Kernel stack: 0x80c04000, 0x80c09000
kernel entry at 802d48b0
Kernel entry point
arch_debug_init()
Welcome to kernel debugger output!
Haiku revision: , debug level: 2
INIT: init CPU
INIT: init interrupts
arch_int_init()
MTrap(exception mEcall)
  mstatus: (ie: {s}, pie: {m}, spp: u, mpp: m)
  mepc: <kernel_riscv64> msyscall + 0
  mie: {}
  mip: {mTimer, sExtern, mExtern}
  sip: {}
Stack:
FP: 0x80c08ed0, PC: <kernel_riscv64> MTrap + 331
FP: 0x80c08fd0, PC: <kernel_riscv64> MVec + 81
FP: 0x80c08fe0, PC: <kernel_riscv64> 0x801346cf
FP: 0x80c09000, PC: <kernel_riscv64> _start + 369
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261cb
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
testMmodeSyscall(10, -15, 12345678987654321)
testMmodeSyscall: 456
MTrap(exception mEcall)
  mstatus: (ie: {s}, pie: {m}, spp: u, mpp: m)
  mepc: <kernel_riscv64> msyscall + 0
  mie: {}
  mip: {mTimer, sExtern, mExtern}
  sip: {}
Stack:
FP: 0x80c08ed0, PC: <kernel_riscv64> MTrap + 331
FP: 0x80c08fd0, PC: <kernel_riscv64> MVec + 81
FP: 0x80c08fe0, PC: <kernel_riscv64> 0x801346cf
FP: 0x80c09000, PC: <kernel_riscv64> _start + 369
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261cb
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
switchToSmodeMmodeSyscall()
  mstatus (2): (ie: {s}, pie: {m}, spp: u, mpp: s)
INIT: init VM
vm_translation_map_init()
paging enabled
PhysMem(0): 0x08145117
PhysMem(4): 0x0810113
PhysMem(8): 0x08ef4401
physical memory ranges:
  80000000 - 88000000
allocated physical ranges:
  80000000 - 80c55000
allocated virtual ranges:
  80000000 - 80c09000
+RISCV64VMPhysicalPageMapper
arch_vm_init()
first phys page = 0x80000, end 0x88000
vm_page_init: entry
vm_init: putting free_page_table @ 0x0000000081800000, # ents 32768 (size 0x280000)
initialized table
mark_page_range_in_use: start 0x0, len 0x80000
mark_page_range_in_use(0x0, 0x80000): start page is before free list
mark_page_range_in_use: start 0x80000, len 0x16db
vm_page_init: exit
arch_vm_translation_map_create_map()
+RISCV64VMTranslationMap(1, 0x80c09000)
_map: 0x000000008100df40
arch_vm_translation_map_init_post_area()
arch_vm_init_post_area()
vm_page_init_post_area()
sPages: 0x0000000081800000
RISCV64VMTranslationMap::Lock()
RISCV64VMTranslationMap::Unlock()
RISCV64VMTranslationMap::Lock()
RISCV64VMTranslationMap::Unlock()
RISCV64VMTranslationMap::Lock()
RISCV64VMTranslationMap::Unmap(0x81000000, 0x81000fff)
RISCV64VMTranslationMap::Unlock()
...
INIT: init modules
user_debug_image_deleted()
RISCV64VMTranslationMap::UnmapPages(0x0x0000000081012000, 0x80c00000, 0x3000, 1)
RISCV64VMTranslationMap::Unmap(0x80c00000, 0x80c03000)
PANIC: remove page 0x000000008183c0a0 from cache 0x0000000081013ee0: page still has mappings!

Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0
Stack:
FP: 0x80c08c10, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80c08c80, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80c08cc0, PC: <kernel_riscv64> panic + 93
FP: 0x80c08d60, PC: <kernel_riscv64> _ZN7VMCache6DeleteEv.localalias.12 + 117
FP: 0x80c08dc0, PC: <kernel_riscv64> _ZL11delete_areaP14VMAddressSpaceP6VMAreab + 409
FP: 0x80c08ee0, PC: <kernel_riscv64> vm_delete_area.localalias.30 + 417
FP: 0x80c08f00, PC: <kernel_riscv64> _ZL16delete_elf_imageP14elf_image_info + 21
FP: 0x80c08f50, PC: <kernel_riscv64> unload_kernel_add_on + 259
FP: 0x80c08fe0, PC: <kernel_riscv64> module_init + 1133
FP: 0x80c09000, PC: <kernel_riscv64> _start + 553
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261cb
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
initial commands: page 0x000000008183c0a0; cache 0x0000000081013ee0
, at position: 0, in command line: page 0x000000008183c0a0; cache 0x0000000081013ee0
kdebug> 
3 Likes

I progressed to INIT: init VM semaphores. Now something is attempting to delete kernel address space.

RISCV64VMPhysicalPageMapper::MemsetPhysical(0x8091c000, 0x0, 0x1000)
RISCV64VMTranslationMap::Lock()
RISCV64VMTranslationMap::Map(0x80be0000, 0x8091c000)
RISCV64VMTranslationMap::Unlock()
RISCV64VMPhysicalPageMapper::MemsetPhysical(0x80922000, 0x0, 0x1000)
RISCV64VMTranslationMap::Lock()
RISCV64VMTranslationMap::Map(0x80be1000, 0x80922000)
RISCV64VMTranslationMap::Unlock()
RISCV64VMPhysicalPageMapper::MemsetPhysical(0x8091e000, 0x0, 0x1000)
RISCV64VMTranslationMap::Lock()
RISCV64VMTranslationMap::Map(0x80be2000, 0x8091e000)
RISCV64VMTranslationMap::Unlock()
RISCV64VMPhysicalPageMapper::MemsetPhysical(0x8091f000, 0x0, 0x1000)
RISCV64VMTranslationMap::Lock()
RISCV64VMTranslationMap::Map(0x80be3000, 0x8091f000)
RISCV64VMTranslationMap::Unlock()
INIT: init system info
INIT: init SMP
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(): 0 virtual ranges to keep:
PANIC: deleting the kernel aspace!

Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0
Stack:
FP: 0x80c07de0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0x80c07e50, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x80c07e90, PC: <kernel_riscv64> panic + 93
FP: 0x80c07ef0, PC: <kernel_riscv64> _ZN20VMKernelAddressSpaceD2Ev.localalias.5 + 37
FP: 0x80c07f10, PC: <kernel_riscv64> _ZN20VMKernelAddressSpaceD0Ev.localalias.6 + 15
FP: 0x80c07f70, PC: <kernel_riscv64> _ZN20VMKernelAddressSpace21UnreserveAddressRangeEmmj.localalias.19 + 189
FP: 0x80c07fb0, PC: <kernel_riscv64> vm_unreserve_address_range.localalias.37 + 67
FP: 0x80c07fe0, PC: <kernel_riscv64> vm_init_post_sem + 223
FP: 0x80c08000, PC: <kernel_riscv64> _start + 781
FP: 0x80144f10, PC: 0x8000019f
FP: 0x80144f70, PC: 0x800261cb
FP: 0x80145000, PC: 0x800002d3
FP: 0x0, PC: 0x8000000d
kdebug>
3 Likes

Framebuffer KDL is still not working yet, only console. Keyboard input is also not working, it need Virtio keyboard or console driver.

1 Like

Threads are partially working, but something is currently messed up:

INIT: init system info
INIT: init SMP
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(): 0 virtual ranges to keep:
arch_vm_translation_map_init_post_sem()
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
arch_thread_init_kthread_stack(0x000000008129f700(undertaker), 0x0000000080ae4000, 0x0000000080ae8fe0, 0x00000000802f24de, 0x0000000080ae8fe0)
INIT: init kernel daemons
arch_thread_init_kthread_stack(0x000000008129f240(kernel daemon), 0x0000000080962000, 0x0000000080966fe0, 0x00000000802f24de, 0x0000000080966fe0)
arch_thread_init_kthread_stack(0x000000008129ed80(resource resizer), 0x000000008090b000, 0x000000008090ffe0, 0x00000000802f24de, 0x000000008090ffe0)
INIT: init I/O interrupts
arch_int_init_io()
INIT: init VM threads
arch_thread_init_kthread_stack(0x000000008129e8c0(page scrubber), 0x00000000808e8000, 0x00000000808ecfe0, 0x00000000802f24de, 0x00000000808ecfe0)
arch_thread_init_kthread_stack(0x000000008129e400(page writer), 0x00000000806a7000, 0x00000000806abfe0, 0x00000000802f24de, 0x00000000806abfe0)
arch_thread_init_kthread_stack(0x000000008129df40(page daemon), 0x0000000080691000, 0x0000000080695fe0, 0x00000000802f24de, 0x0000000080695fe0)
arch_thread_init_kthread_stack(0x000000008129da80(object cache resizer), 0x0000000080ae9000, 0x0000000080aedfe0, 0x00000000802f24de, 0x0000000080aedfe0)
arch_thread_init_kthread_stack(0x000000008129d5c0(low resource manager), 0x0000000080967000, 0x000000008096bfe0, 0x00000000802f24de, 0x000000008096bfe0)
INIT: init DPC
arch_thread_init_kthread_stack(0x000000008129d100(dpc: normal priority), 0x0000000080bb1000, 0x0000000080bb5fe0, 0x00000000802f24de, 0x0000000080bb5fe0)
arch_thread_init_kthread_stack(0x000000008129cc40(dpc: high priority), 0x0000000080bb6000, 0x0000000080bbafe0, 0x00000000802f24de, 0x0000000080bbafe0)
arch_thread_init_kthread_stack(0x000000008129c780(dpc: real-time priority), 0x0000000080aab000, 0x0000000080aaffe0, 0x00000000802f24de, 0x0000000080aaffe0)
INIT: init VFS
arch_thread_init_kthread_stack(0x000000008129c2c0(block notifier/writer), 0x00000000809ff000, 0x0000000080a03fe0, 0x00000000802f24de, 0x0000000080a03fe0)
INIT: init swap support
INIT: init POSIX semaphores
INIT: spawning main2 thread
arch_thread_init_kthread_stack(0x000000008129be00(main2), 0x00000000809c8000, 0x00000000809ccfe0, 0x00000000802f24de, 0x00000000809ccfe0)
INIT: waking up AP cpus
INIT: exiting kernel startup
INIT: starting scheduler on cpu 0 and enabling interrupts
arch_thread_context_switch(0x00000000803e8988(idle thread 1), 0x000000008129da80(object cache resizer))
slab memory manager: created area 0x00000000cd001000 (134)
arch_thread_context_switch(0x000000008129da80(object cache resizer), 0x000000008129c780(dpc: real-time priority))
arch_thread_context_switch(0x000000008129c780(dpc: real-time priority), 0x000000008129cc40(dpc: high priority))
arch_thread_context_switch(0x000000008129cc40(dpc: high priority), 0x000000008129f700(undertaker))
arch_thread_context_switch(0x000000008129f700(undertaker), 0x000000008129e400(page writer))
arch_thread_context_switch(0x000000008129e400(page writer), 0x000000008129df40(page daemon))
arch_thread_context_switch(0x000000008129df40(page daemon), 0x000000008129d100(dpc: normal priority))
arch_thread_context_switch(0x000000008129d100(dpc: normal priority), 0x000000008129be00(main2))
INIT: start of main2: initializing devices
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
INIT: Add preloaded old-style drivers
MTrap(exception execPageFault)
  mstatus: (ie: {s}, pie: {m}, spp: u, mpp: s)
  mepc: 0x59a0
  mie: {}
  mip: {mTimer, sExtern, mExtern}
  sip: {}
  mtval: 0x59a0
Stack:
FP: 0x809ccca0, PC: <kernel_riscv64> MTrap + 305
FP: 0x809ccda0, PC: <kernel_riscv64> MVec + 81
FP: 0x809cce10, PC: 0x599f
FP: 0xcccccccccccccccc, PC: 0xcccccccccccccccb
target_read_slow: invalid physical address 0xccccccccccccccc0, PC: 0000000080388a74
target_read_slow: invalid physical address 0xccccccccccccccc8, PC: 0000000080388a74
target_read_slow: invalid physical address 0xccccccccccccccb8, PC: 0000000080388a74
target_read_slow: invalid physical address 0xccccccccccccccc0, PC: 0000000080388a74
FP: 0x40008004198af6c8, PC: 0x40008004198af6c7
target_read_slow: invalid physical address 0x40008004198af6c0, PC: 0000000080388a74
target_read_slow: invalid physical address 0x40008004198af6b8, PC: 0000000080388a74
FP: 0xa, PC: 0x9
target_read_slow: invalid physical address 0xfffffffffffffff8, PC: 0000000080388a74
FP: 0x0, PC: 0xffffffffffffffff
target_read_slow: invalid physical address 0x00000000ccd0c000, PC: 00000000803107a6
target_write_slow: invalid physical address 0x00000000ccd0c000, PC: 00000000803107a6
target_write_slow: invalid physical address 0x00000000ccd0c004, PC: 00000000803107a6
target_read_slow: invalid physical address 0x00000000ccd0c000, PC: 00000000803107a6
target_write_slow: invalid physical address 0x00000000ccd0c008, PC: 0000000080310866
target_write_slow: invalid physical address 0x00000000ccd0c00c, PC: 0000000080310866
target_read_slow: invalid physical address 0x00000000ccd0c000, PC: 0000000080310866
target_write_slow: invalid physical address 0x00000000ccd0c000, PC: 0000000080310866
PANIC: unhandled MTrap
Welcome to Kernel Debugging Land...
Thread 0 "" running on CPU 0
The thread's CPU pointer is 0x0000000000000000, but should be 0x00000000803d7f00.
target_read_slow: invalid physical address 0x00000000ccd0c000, PC: 0000000080310e8e
target_read_slow: invalid physical address 0x00000000ccd0c00c, PC: 0000000080310ee4
Stack:
FP: 0x809ccbb0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 685
FP: 0x809ccc20, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x809ccc60, PC: <kernel_riscv64> panic + 93
FP: 0x809ccda0, PC: <kernel_riscv64> MVec + 81
FP: 0x809cce10, PC: 0x599f
FP: 0xcccccccccccccccc, PC: 0xcccccccccccccccb
target_read_slow: invalid physical address 0xccccccccccccccc0, PC: 0000000080388a74
target_read_slow: invalid physical address 0xccccccccccccccc8, PC: 0000000080388a74
target_read_slow: invalid physical address 0xccccccccccccccb8, PC: 0000000080388a74
target_read_slow: invalid physical address 0xccccccccccccccc0, PC: 0000000080388a74
FP: 0x4000800400000000, PC: 0x40008003ffffffff
target_read_slow: invalid physical address 0x40008003fffffff8, PC: 0000000080388a74
target_read_slow: invalid physical address 0x40008003fffffff0, PC: 0000000080388a74
FP: 0xa, PC: 0x9
target_read_slow: invalid physical address 0xfffffffffffffff8, PC: 0000000080388a74
FP: 0x0, PC: 0xffffffffffffffff
kdebug> 
15 Likes

Amazing progress and updates. Thank you for the effort!

5 Likes

Kernel framebuffer is working:

screenshot40

19 Likes

I progressed to fourth icon and “PANIC: did not find any boot partitions!” error. Now it is needed to parse FDT and setup Virtio disk driver.

screenshot41

28 Likes

This is simply stellar work.

I implemented publishing FDT nodes in FDT bus manager driver.

Existing VirtIO driver seems to be not useable because it is hardcoded to PCI bus and use different register layout. Also TinyEMU use new VirtIO version 2. But existing VirtIO API and VirtIO block driver may be useable.

PANIC: did not find any boot partitions! 
Welcome to Kernel Debugging Land...
Thread 14 "main2" running on CPU 0
Stack:
FP: 0xcd099a40, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 243
FP: 0xcd099ab0, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0xcd099af0, PC: <kernel_riscv64> panic + 93
FP: 0xcd099f70, PC: <kernel_riscv64> vfs_mount_boot_file_system + 821
FP: 0xcd099fc0, PC: <kernel_riscv64> _ZL5main2Pv + 283
FP: 0xcd099fe0, PC: <kernel_riscv64> _ZL19common_thread_entryPv + 49
FP: 0x0, PC: <kernel_riscv64> arch_thread_entry + 3
initial commands:  dm_tree
(0) @0x00000000813afe60 "system/devices_root/driver_v1" (ref 26, init 23, module 0x00000000803d3700, data 0x0000000000000000)
      "device/pretty name" : string : "Devices Root"
      "device/bus" : string : "root"
      "device/flags" : uint32 : 6 (0x6)
      "device/driver" : string : "system/devices_root/driver_v1"
   (1) @0x00000000813afdc0 "bus_managers/fdt/root/driver_v1" (ref 21, init 19, module 0x000000008078d878, data 0x00000000813afdc0)
         "device/pretty name" : string : "FDT"
         "device/flags" : uint32 : 4 (0x4)
         "device/driver" : string : "bus_managers/fdt/root/driver_v1"
      (2) @0x00000000813afd20 "bus_managers/fdt/driver_v1" (ref 23, init 17, module 0x000000008078d818, data 0x0000000000000000)
            "device/bus" : string : "fdt"
            "fdt/node" : uint32 : 0 (0x0)
            "fdt/name" : string : ""
            "fdt/compatible" : string : "ucbbar,riscvemu-bar_dev"
            "device/driver" : string : "bus_managers/fdt/driver_v1"
         (3) @0x00000000813af320 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
               "device/bus" : string : "fdt"
               "fdt/node" : uint32 : 1664 (0x680)
               "fdt/name" : string : "chosen"
               "device/driver" : string : "bus_managers/fdt/driver_v1"
         (3) @0x00000000813af960 "bus_managers/fdt/driver_v1" (ref 20, init 10, module 0x000000008078d818, data 0x0000000000000000)
               "device/bus" : string : "fdt"
               "fdt/node" : uint32 : 548 (0x224)
               "fdt/name" : string : "soc"
               "fdt/compatible" : string : "ucbbar,riscvemu-bar-soc"
               "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af3c0 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 1496 (0x5d8)
                  "fdt/name" : string : "framebuffer@41000000"
                  "fdt/compatible" : string : "simple-framebuffer"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af460 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 1400 (0x578)
                  "fdt/name" : string : "virtio@40014000"
                  "fdt/compatible" : string : "virtio,mmio"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af500 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 1304 (0x518)
                  "fdt/name" : string : "virtio@40013000"
                  "fdt/compatible" : string : "virtio,mmio"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af5a0 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 1208 (0x4b8)
                  "fdt/name" : string : "virtio@40012000"
                  "fdt/compatible" : string : "virtio,mmio"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af640 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 1112 (0x458)
                  "fdt/name" : string : "virtio@40011000"
                  "fdt/compatible" : string : "virtio,mmio"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af6e0 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 1016 (0x3f8)
                  "fdt/name" : string : "virtio@40010000"
                  "fdt/compatible" : string : "virtio,mmio"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af780 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 920 (0x398)
                  "fdt/name" : string : "serial@10000000"
                  "fdt/compatible" : string : "ns16550a"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af820 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 756 (0x2f4)
                  "fdt/name" : string : "plic@40100000"
                  "fdt/compatible" : string : "riscv,plic0"
                  "fdt/phandle" : uint32 : 2 (0x2)
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813af8c0 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 648 (0x288)
                  "fdt/name" : string : "clint@2000000"
                  "fdt/compatible" : string : "riscv,clint0"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
         (3) @0x00000000813afa00 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
               "device/bus" : string : "fdt"
               "fdt/node" : uint32 : 508 (0x1fc)
               "fdt/name" : string : "htif"
               "fdt/compatible" : string : "ucb,htif0"
               "device/driver" : string : "bus_managers/fdt/driver_v1"
         (3) @0x00000000813afaa0 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
               "device/bus" : string : "fdt"
               "fdt/node" : uint32 : 436 (0x1b4)
               "fdt/name" : string : "memory@80000000"
               "fdt/device_type" : string : "memory"
               "device/driver" : string : "bus_managers/fdt/driver_v1"
         (3) @0x00000000813afc80 "bus_managers/fdt/driver_v1" (ref 5, init 3, module 0x000000008078d818, data 0x0000000000000000)
               "device/bus" : string : "fdt"
               "fdt/node" : uint32 : 112 (0x70)
               "fdt/name" : string : "cpus"
               "device/driver" : string : "bus_managers/fdt/driver_v1"
            (4) @0x00000000813afbe0 "bus_managers/fdt/driver_v1" (ref 4, init 2, module 0x000000008078d818, data 0x0000000000000000)
                  "device/bus" : string : "fdt"
                  "fdt/node" : uint32 : 172 (0xac)
                  "fdt/name" : string : "cpu@0"
                  "fdt/device_type" : string : "cpu"
                  "fdt/compatible" : string : "riscv"
                  "device/driver" : string : "bus_managers/fdt/driver_v1"
               (5) @0x00000000813afb40 "bus_managers/fdt/driver_v1" (ref 2, init 1, module 0x000000008078d818, data 0x0000000000000000)
                     "device/bus" : string : "fdt"
                     "fdt/node" : uint32 : 324 (0x144)
                     "fdt/name" : string : "interrupt-controller"
                     "fdt/compatible" : string : "riscv,cpu-intc"
                     "fdt/phandle" : uint32 : 1 (0x1)
                     "device/driver" : string : "bus_managers/fdt/driver_v1"
   (1) @0x00000000813af280 "system/devices_generic/driver_v1" (ref 3, init 2, module 0x00000000803d36a0, data 0x0000000000000000)
         "device/pretty name" : string : "Generic"
         "device/bus" : string : "generic"
         "device/flags" : uint32 : 7 (0x7)
         "device/driver" : string : "system/devices_generic/driver_v1"
kdebug> 
13 Likes

Every day progress amazing! Do not forget to rest!

3 Likes