For some reason I will debug bios to see how it works.
Get&Build BIOS
git clone https://github.com/coreboot/seabios.gitmake
Debug BIOS
Do not try x/i command in gdb when debugging bios, because gdb does not support 16 bit segmentation memory management You must provide the correct address, do not simply use x/10i, it will not work in real mode because 8086 doesn’t support flat memory model(google it) , you must provide the segment seletor and the offset, such x/10i 0xffffabcd, or 0x000fabcd, see https://stackoverflow.com/questions/62513643/qemu-gdb-does-not-show-instructions-of-firmware.
Way 1
qemu-system-i386 -bios out/bios.bin -S -s
╭─ ~/Learning/System/Linux/Kernel/seabios on master ?2 ········ ✔ ─╮╰─ ls ─╯COPYING docs out rom16offset.o srcCOPYING.LESSER Makefile README scripts vgasrc╭─ ~/Learning/System/Linux/Kernel/seabios on master ?2 ········ ✔ ─╮╰─ gdb ./out/rom.o ─╯
in gdb
target remote :1234
Way 2
See, https://stackoverflow.com/questions/49405417/how-to-launch-openbios-from-qemu.
qemu-system-i386 -L . -vga cirrus -serial stdio -S -s
# In gdbtarget remote :1234
