How to debug a bootloader (syslinux on x86)

Programming, for all ages and all languages.
Post Reply
anatolik
Posts: 16
Joined: Sun Jul 07, 2013 7:29 pm

How to debug a bootloader (syslinux on x86)

Post by anatolik »

I need to patch/compile syslinux on Linux Arch (BIOS+GPT partition). Unfortunately when I install my version of syslinux it fails to boot. It gives me black screen at very early stages. There is something wrong, but syslinux does not provide any useful information. I would like to debug the problem.

What is the best way to debug bootloaders? My gut feeling that there are 2 way:
- use serial port to connect to running machine and check the debug output
- use qemu/bosch and remote gdb debugger

I was not able to find any useful information about doing either way. Did anyone tried to do these thing? Could you share your experience/steps to reproduce?

Thanks for your reply in advance.
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: How to debug a bootloader (syslinux on x86)

Post by Roman »

anatolik wrote:I need to patch/compile syslinux on Linux Arch (BIOS+GPT partition). Unfortunately when I install my version of syslinux it fails to boot. It gives me black screen at very early stages. There is something wrong, but syslinux does not provide any useful information. I would like to debug the problem.

What is the best way to debug bootloaders? My gut feeling that there are 2 way:
- use serial port to connect to running machine and check the debug output
- use qemu/bosch and remote gdb debugger

I was not able to find any useful information about doing either way. Did anyone tried to do these thing? Could you share your experience/steps to reproduce?

Thanks for your reply in advance.
Hi, you can also create break points with cli and hlt and test in QEMU. About using GDB with QEMU: http://wiki.qemu.org/Documentation/Debugging
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
Post Reply