Total Pageviews

Sunday, July 13, 2008

capture the kernel oops

Just stumbled upon some very old stuff that i did when i used to hack kernels
  • How to capture kernel oops message on other computer using a NULL Modem cable.
    When your kernel is panicking and you are already frustrated, then not being able to read the kernel oops message is the worst thing that can happen to anyone. Your serial port can rescue you at this point of time.
    Do the following steps
  1. Compile the kernel which is panicking with serial port support. Its in
    Device Drivers--->Character Devices--->Serial Drivers--->
    then click on "8250/16550 and compatible serial support", a new option of
    "console on 8250/16550 and compatible serial port" will pop up.
  2. Select this option and compile it directy in kernel(NOT AS MODULE).
  3. Edit the file /boot/grub/menu.1st and append "console=ttyS0,9600 console=tty0" to the line "kernel /boot/vmlinuz-2.6.3".
    You can use different baud rates if you dont want to use 9600
    The text which you are appending will make sure that the messages which kernel will throw (using kprintf) will be written to your console(tty0) as well as to serial port (ttyS0)
  4. Shut down you computer.
  5. Connect the serial port(db9 in my case) of this computer to the serial port of other computer on which you want to capture oops using a NULL modem cable.
  6. Start your computer and boot with newly compiled kernel.
  7. Use "minicom" on other computer to capture data written on the serial port. Its really easy to use, you will just need to set it up first. Just go to setup--> serial port setup and change you serial device to /dev/ttyS0 and BPS to 9600 and restart minicom.
    YOU ARE DONE!!!

No comments: