Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] QEMU help, Please
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1224
Location: Richmond Hill, Canada

PostPosted: Tue Jul 23, 2024 7:27 pm    Post subject: [SOLVED] QEMU help, Please Reply with quote

Hi,

I am not able to setup QEMU arm. Nothing was display (i.e no kernel boot message)

This is relate to How to install java on arm musl?

This is my command to start qemu
Code:
qemu-system-arm -M virt -cpu cortex-a15\
                -m 1024M\
                -smp 2\
                -kernel /nbd/r2d2/nbd03/vir-rk3288-w-dtb-zImage\
                -append "console=ttyS0 console=tty1"\
                -nographic\
                -no-reboot


Also tried
Code:
qemu-system-arm -M virt -cpu cortex-a15\
                -m 1024M\
                -smp 2\
                -kernel /nbd/r2d2/nbd03/vir-rk3288-zImage\
                -dtb /nbd/r2d2/nbd03/vir-rk3288-tinker-s.dtb\
                -append "console=ttyS0 console=tty1"\
                -nographic\
                -no-reboot


Please ignore missing root device at this stage. because all I want at this time is to prove the kernel is ready to be used by qemu.

I am guessing I need something in kernel but I don't know what I miss, so can somebody help?

I share two kernel .config file.

The original(a.k.a TkB.config) .config build for the system. https://pastebin.com/xqX8wqpg

The modified "vir" .config with CONFIG_VIRT enabled. https://pastebin.com/rjDNp2uZ


Last edited by pingtoo on Wed Jul 24, 2024 8:43 pm; edited 2 times in total
Back to top
View user's profile Send private message
M95D
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2020
Posts: 94

PostPosted: Wed Jul 24, 2024 7:33 am    Post subject: Reply with quote

If that's my config file, you probably need to relax the cpu type a bit, possibly other hardware restrictions. I didn't configure it to be portable to different cpus.

My best recommendation is to run a "ARCH=arm make menuconfig" and look around in the System Type.
At least, enable CONFIG_ARCH_VIRT.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1224
Location: Richmond Hill, Canada

PostPosted: Wed Jul 24, 2024 10:13 am    Post subject: Reply with quote

M95D wrote:
If that's my config file, you probably need to relax the cpu type a bit, possibly other hardware restrictions. I didn't configure it to be portable to different cpus.

My best recommendation is to run a "ARCH=arm make menuconfig" and look around in the System Type.
At least, enable CONFIG_ARCH_VIRT.


Thank you for the suggestion.

I have two .config, the first one 'TkB' is your original, the second 'vir' is the one with ARCH_VIRT. and I am using the 'vir' in QEMU boot.

Just wonder if I missing something to let kernel start.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1224
Location: Richmond Hill, Canada

PostPosted: Wed Jul 24, 2024 8:43 pm    Post subject: Reply with quote

update, this problem solved.

It turn out for QEMU arm to work, we need to have CONFIG_SERIAL_AMBA_PL011 and CONFIG_SERIAL_AMBA_PL011_CONSOLE.

And the initial .config have CONFIG_DEBUG_LL which need to turn off. or else message go somewhere else.
Back to top
View user's profile Send private message
M95D
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2020
Posts: 94

PostPosted: Wed Jul 24, 2024 9:19 pm    Post subject: Reply with quote

If the virtual address of the UART is wrong in CONFIG_DEBUG_UART_VIRT, the kernel will crash when it tries to map virtual memory. It won't boot at all, not even as headless.

"qemu-system-arm -machine virt" has an emulated PL011 at physical address 0x9000000. You can test that with "earlycon=pl011,0x9000000 earlyprintk" bootargs, without enabling CONFIG_DEBUG_LL.
I couldn't find the virtual address for CONFIG_DEBUG_LL / CONFIG_DEBUG_UART_VIRT. It's not documented anywhere. If anyone knows what it is, or how to find it, please let me/us know. I'm very interested.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum