Do you have a question? Post it now! No Registration Necessary
- Posted on
September 14, 2004, 6:01 am
rate this thread
- Albert Gonzalez
September 14, 2004, 1:28 pm
Re: How can I read PC(program counter) during Linux kernel booting?
comp.os.linux.embedded, en JoohyeonPark va escriure:
Alternative 1: use a pc emulator such as bochs / embedded machine emulator
from your developement machine.
Alternative 2: exec the kernel from within gdb
Alternative 3: write a wrapper around the boot process, depending on your
For x86 systems, you can install interrupt handler 3, then proceed in single
step each instruction. The ISR (interrupt service routine) can give you the
PC (with any other registrer you want). To get the PC, grab it from the
For other systems, you may need to find a suitable interrupt (check the
processor databook to check if there's a single step interrupt /
instruction ) and do the same.
If there isn't such instruction / operation mode, you can use a NMI/INT,
using the NMI/INT ISR as main control for the debugger, and letting just
the computer to execute one instruction before the next interrupt (usually
by leaving the interrupt pin aserted continually).
Ideally, you should do remote debugging using an unused communications port,
because if you insert printk/printf commands in the ISR you could be
tampering with the machine hardware status that the kernel expects.
Beware of unsuspected side effects, such as timing problems with drivers,
and so on.
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux