* How to debug a triple fault at startup?
@ 2009-06-21 16:02 Michael Crawford
2009-06-21 20:02 ` Michael Crawford
0 siblings, 1 reply; 5+ messages in thread
From: Michael Crawford @ 2009-06-21 16:02 UTC (permalink / raw)
To: kvm
Greetings, I just subscribed.
I get as far as the "Press F12 for a boot menu", and then the guest
reboots. I have gotten as far as figuring out that there is a triple
fault in my guest's code, but I don't know why.
Can anyone give me a clue as to how to debug it?
I am able to attach gdb to the debugger stub, but I don't have any
symbols so I don't know what's going on.
Thanks for any help you can give me.
Mike
--
Michael David Crawford
mdcrawford at gmail dot com
GoingWare's Bag of Programming Tricks
http://www.goingware.com/tips/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to debug a triple fault at startup?
2009-06-21 16:02 How to debug a triple fault at startup? Michael Crawford
@ 2009-06-21 20:02 ` Michael Crawford
2009-06-22 1:58 ` Michael Crawford
0 siblings, 1 reply; 5+ messages in thread
From: Michael Crawford @ 2009-06-21 20:02 UTC (permalink / raw)
To: kvm
On Sun, Jun 21, 2009 at 9:02 AM, Michael Crawford<mdcrawford@gmail.com> wrote:
> I get as far as the "Press F12 for a boot menu", and then the guest
> reboots. I have gotten as far as figuring out that there is a triple
> fault in my guest's code, but I don't know why.
>
> Can anyone give me a clue as to how to debug it?
I haven't actually tried it yet, but here is what I think will work:
I'll look up the exception vector table in the x86 documentation -
there must be hundreds of web pages that discuss it - and then set a
breakpoint at the fault handler.
When my breakpoint is hit, I'll look on the stack for the exception
frame, and find the address that generated it, and the address that
that instruction was trying to access.
I've been pondering my boot code for so long that those alone ought to
enlighten me. No doubt I'm setting something up wrong, but I'll be
damned if I know what.
(One can debug within the guest by giving, say "-gdb tcp::45000" on
the qemu command line, and then "target remote tcp::45000" within
gdb.)
Thine In Utter Torment,
MIke
--
Michael David Crawford
mdcrawford at gmail dot com
GoingWare's Bag of Programming Tricks
http://www.goingware.com/tips/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to debug a triple fault at startup?
2009-06-21 20:02 ` Michael Crawford
@ 2009-06-22 1:58 ` Michael Crawford
2009-06-22 8:05 ` Alexander Graf
2009-06-22 8:35 ` Avi Kivity
0 siblings, 2 replies; 5+ messages in thread
From: Michael Crawford @ 2009-06-22 1:58 UTC (permalink / raw)
To: kvm
I'm not completely certain, but I think I get a GPF whenever trying to
output text to the screen once interrupts have been enabled.
That is, before calling int 0x19, I can use printf from within
rombios.c, and my messages appear. But from anywhere within the int19
code, they don't.
I definitely don't see the "Booting from hard drive message".
Mike
--
Michael David Crawford
mdcrawford at gmail dot com
GoingWare's Bag of Programming Tricks
http://www.goingware.com/tips/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to debug a triple fault at startup?
2009-06-22 1:58 ` Michael Crawford
@ 2009-06-22 8:05 ` Alexander Graf
2009-06-22 8:35 ` Avi Kivity
1 sibling, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2009-06-22 8:05 UTC (permalink / raw)
To: Michael Crawford; +Cc: kvm@vger.kernel.org
On 22.06.2009, at 03:58, Michael Crawford <mdcrawford@gmail.com> wrote:
> I'm not completely certain, but I think I get a GPF whenever trying to
> output text to the screen once interrupts have been enabled.
>
> That is, before calling int 0x19, I can use printf from within
> rombios.c, and my messages appear. But from anywhere within the int19
> code, they don't.
>
> I definitely don't see the "Booting from hard drive message".
Does it break with -no-kvm as well? If so, use it and pass -d
in_asm,cpu,int too. You can then check /tmp/qemu.log to see where
things go wrong.
Alex
>
> Mike
> --
> Michael David Crawford
> mdcrawford at gmail dot com
>
> GoingWare's Bag of Programming Tricks
> http://www.goingware.com/tips/
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to debug a triple fault at startup?
2009-06-22 1:58 ` Michael Crawford
2009-06-22 8:05 ` Alexander Graf
@ 2009-06-22 8:35 ` Avi Kivity
1 sibling, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2009-06-22 8:35 UTC (permalink / raw)
To: Michael Crawford; +Cc: kvm
On 06/22/2009 04:58 AM, Michael Crawford wrote:
> I'm not completely certain, but I think I get a GPF whenever trying to
> output text to the screen once interrupts have been enabled.
>
> That is, before calling int 0x19, I can use printf from within
> rombios.c, and my messages appear. But from anywhere within the int19
> code, they don't.
>
> I definitely don't see the "Booting from hard drive message".
>
Try to hack the reset code to vm_stop(0) instead of resetting. You'll
then be able to examine guest registers with 'info registers' though the
monitor (or debugger), and perhaps see what went wrong.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-06-22 8:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-21 16:02 How to debug a triple fault at startup? Michael Crawford
2009-06-21 20:02 ` Michael Crawford
2009-06-22 1:58 ` Michael Crawford
2009-06-22 8:05 ` Alexander Graf
2009-06-22 8:35 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox