Friday, 10 July 2009

Debugging Early Resume Issues

The last couple of days I've been digging a little deeper into a tricky resume issue on a laptop; specifically it hangs the second time one does a resume and it hangs up in or around arch/x86/kernel/acpi/wakeup_32.S

It is rather annoying as the hang occurs early in the resume phase so it is not possible to use printk() to dump any information out to a console; one has to resort to low level debugging hacks.

The difficult part is that I cannot attach a Power On Self Test (POST) debug card in to the laptop and wiggle port $80 to see the POST codes as a method of debugging. To see if the BIOS is actually jumping back to the kernel resume code I added some code that just flashes the keyboard LED as a sanity check, and from there I've been able to work down through the code.

I've got a lot of hacky code like this that helps me debug thorny issues. I've put some of this code up in the debug-code git repository as it could be useful to others. I've provided code snippits in C and assembler to buzz the internal PC speaker, flash the keyboard LED and also to change the VGA palette. This code is hacky I know, but gets the job done!

If you have your own favourite way of debugging code, feel free to share the know-how.

No comments:

Post a comment