littlekernel / lk

LK embedded kernel
MIT License
3.14k stars 615 forks source link

test run for "make lm3s6965evb-test" #198

Closed wenhuizhang closed 7 years ago

wenhuizhang commented 7 years ago

Hi, I was trying to give it a test run for cortex-m3, however got error trace as following, any idea of why this happens please?

vagrant@vagrant-ubuntu-trusty-32:~/lk/build-lm3s6965evb-test$ qemu-system-arm -machine versatileab -cpu cortex-m3 ./lk.elf
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
alsa: Could not initialize DAC
alsa: Failed to open `default':
alsa: Reason: No such file or directory
audio: Failed to create voice `lm4549.out'
Could not initialize SDL(No available video device) - exiting
wenhuizhang commented 7 years ago

I have updated qemu-system-arm with 2.9 version. And using qemu-system-arm -machine versatileab -cpu cortex-m4 ./lk.bin I got:

vagrant@vagrant-ubuntu-trusty-32:~/lk/build-lm3s6965evb-test$ qemu-system-arm -machine versatileab -cpu cortex-m4 ./lk.elf
WARNING: Image format was not specified for './lk.elf' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
audio: Could not init `oss' audio driver
gtk initialization failed

Any suggestions for debugging traces please?

nvll commented 7 years ago

These are issues with your Linux system unrelated to LK. Qemu is trying to use 'oss' as the audio background and is unable to. You'll need to specify the correct one to use, or figure out why 'oss' isn't working.

On Tue, Aug 8, 2017 at 6:02 PM, Wenhui Zhang notifications@github.com wrote:

I have updated qemu-system-arm with 2.9 version. And using qemu-system-arm -machine versatileab -cpu cortex-m4 ./lk.bin I got:

vagrant@vagrant-ubuntu-trusty-32:~/lk/build-lm3s6965evb-test$ qemu-system-arm -machine versatileab -cpu cortex-m4 ./lk.elf WARNING: Image format was not specified for './lk.elf' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. audio: Could not init `oss' audio driver gtk initialization failed

Any suggestions for debugging traces please?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/littlekernel/lk/issues/198#issuecomment-321122887, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD0hUYEe8jDrTIpWkfjhQ28OPWEqZE4ks5sWQUQgaJpZM4OxDt- .

wenhuizhang commented 7 years ago

Is it possible to eliminate audio and graphics interfaces modules on little kernel while compiling please? I think I only need file system and network interfaces/the tcp/ip stack. I tried to pass -nographics flag, and got trace as following:

vagrant@vagrant-ubuntu-trusty-32:~/lk$ qemu-system-arm -machine versatileab -cpu cortex-m4 -m 64  -smp 1 -kernel ./build-qemu-m4-test/lk.elf -nographic
audio: Could not init `oss' audio driver
qemu-system-arm: Trying to execute code outside RAM or ROM at 0x08000e54
This usually means one of the following happened:

(1) You told QEMU to execute a kernel for the wrong machine type, and it crashed on startup (eg trying to run a raspberry pi kernel on a versatilepb QEMU machine)
(2) You didn't give QEMU a kernel or BIOS filename at all, and QEMU executed a ROM full of no-op instructions until it fell off the end
(3) Your guest kernel has a bug and crashed by jumping off into nowhere

This is almost always one of the first two, so check your command line and that you are using the right type of kernel for this machine.
If you think option (3) is likely then you can try debugging your guest with the -d debug options; in particular -d guest_errors will cause the log to include a dump of the guest register state at this point.

Execution cannot continue; stopping here.
wenhuizhang commented 7 years ago

Hi, I think it is just a mapping issue, managed to match the board name and cpu name. Working fine now, however did not find tcp/ip stack .... I think probably I have to write myself, thanks :)