Linux kernel development under emulator

278 views
Skip to first unread message

Chris Furlough

unread,
Feb 10, 2015, 10:27:25 PM2/10/15
to android...@googlegroups.com
Hey Guys.

I'm trying to do some custom kernel development under the goldfish emulator.  I've compiled my own kernel (using the goldfish config), and gdb.  I'm having some problems that I hope you guys can help with.  (I've exhausted my google searches and online tutorials).

I'm using Android Studio to launch the emulator with the following command line:
/home/android/Android/Sdk/tools/emulator -avd Nexus_10_API_19 -netspeed full -netdelay none -show-kernel -qemu -s -S -kernel /home/android/goldfish/arch/arm/boot/zImage

This loads, and stops as you'd expect.  I launch gdb in a different window:
~/WholeTree/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin$ ./arm-eabi-gdb ~/goldfish/vmlinux

I then do this:
(gdb) target remote :1234
Remote debugging using :1234
0x00000000 in ?? ()

Obviously that 0x00000000 is a problem.  The kernel versions match.  Why is this?

I'm working with the early boot stuff inside the Linux kernel.  

When I launch the kernel, via:

(gdb) cont
Continuing.

I get this:

serial0 console
Uncompressing Linux... done, booting the kernel.


And then it hangs.  

When I ctrl-c it, I get:

^C
Program received signal SIGINT, Interrupt.
0x0044f82c in ?? ()


I'm not asking for help with my CODE, only my debugging.  Any ideas what my GDB problem is here?

Emeric VIGIER

unread,
Mar 24, 2015, 9:16:44 PM3/24/15
to android...@googlegroups.com

Try enabling EARLY_PRINTK for your platform. This may or not may not be supported. If it is, add the proper command line argument to enable this, visit those:

http://smackerelofopinion.blogspot.ca/2009/11/kernel-early-printk-messages.html?m=1

http://elinux.org/Debugging_by_printing#Debugging_early_boot_problems

What version of Linux did you compile? What toolchain did you use?

Emeric

--
--
unsubscribe: android-kerne...@googlegroups.com
website: http://groups.google.com/group/android-kernel
---
You received this message because you are subscribed to the Google Groups "Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-kerne...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

karthik poduval

unread,
Apr 27, 2015, 4:35:56 PM4/27/15
to android...@googlegroups.com
I have done this earlier directly with qemu-kvm. 

I used to launch the QEMU with the  commandline:-
qemu-kvm -hda MyImage.raw -m 128 -redir tcp:12345::22 -nographic -s -S

and then gdb using
$ gdb <path-to-vmlinux>
target remote:1234

Not sure if this is useful to you, but the above combination worked for me.
Is the same gcc cross compiler (arm-eabi-gdb) being used to build the kernel ?

--
Regards,
Karthik Poduval

--
Regards,
Karthik Poduval

Ye Roger

unread,
Aug 26, 2015, 1:25:05 PM8/26/15
to Android Linux Kernel Development
There are a lot of articles about this. You can do a google search of "Embedded Android".
Reply all
Reply to author
Forward
0 new messages