[Gllug] Debugging kernel loading initrd

John Edwards john at cornerstonelinux.co.uk
Sat Apr 26 10:22:59 UTC 2008


On Sat, Apr 26, 2008 at 10:45:13AM +0100, Richard Jones wrote:
> On Sat, Apr 26, 2008 at 09:32:52AM +0100, John Edwards wrote:
>> Is there anyway that I can get a kernel to print debugging messages
>> to the console on what it is doing, especially when loading an
>> initrd/initramfs?
> [...]
>> I have an old Pentium system where the initrd (gzip'ed cpio initramfs)
>> is not being run by the kernel. No error messages are being displayed
>> and the system stops booting but responds to the keyboard
>> Ctrl-Alt-Del. So the kernel has not crashed.
>> 
>> The same kernel and initrd can boot on Pentium II and above CPUs, but
>> fails on four different Pentium I machines. The kernel can boot other
> [..]
> 
> Do you see any kernel messages? 

Yes. It stops after displaying the message about AT keyboard.
On Pentium II and above this is the point where the initrd is
accessed and the init script starts to run.


> Possibly an issue with the kernel or
> some userspace program being compiled with some Pentium-II specific
> instructions, although I'm not quite sure what they would be.

I've been going through the binaries and libraries that are in the
initrd looking for any i686 compliation options, but have not found
any yet.


> Anyhow, unpack the initrd, edit /etc/init file (IIRC), add some echo
> commands to it, repack it against and reboot. You should be able to
> see how far the init script gets, or whether it gets started at all.

I've tried that - echo message and start a busybox shell. But that
also doesn't happen, so looks like the init script does not get run.


Which is why I wondered if there was any way to get the kernel to
debug what it's doing with the initrd/initramfs. The kernel docs
just suggest running a simple "hello world" program to see if it
works in an emulator (eg QEMU or UML). Are there any emulators that
can be a bug-perfect copy of a Pentium I CPU?


If there isn't a standard way of debuging this sort of thing then
there are two options I can think of:

1) Write a bunch of C programs that rely on different sets of
libraries and then see which is them work.

2) Add debugging messages to the kernel code that loads the initrd.

And I'm not a C programmer. Will either of those work?


-- 
#---------------------------------------------------------#
|    John Edwards   Email: john at cornerstonelinux.co.uk    |
#---------------------------------------------------------#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080426/c3375589/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list