Re: Confusion about undefined behaviour
- From: "robertwessel2@xxxxxxxxx" <robertwessel2@xxxxxxxxx>
- Date: Mon, 20 Jul 2009 16:20:26 -0700 (PDT)
On Jul 20, 4:15 pm, Stephen Sprunk <step...@xxxxxxxxxx> wrote:
I'm not familiar enough with the Linux kernel to know offhand why it's
defined... It might be that traps are disabled, or the Interrupt
Descriptor Table* is mapped there, or something else entirely. The
point is that you won't get a segfault like you (and the compiler) would
expect in user code (also defined by the implementation).
(* The IDT must live at physical addresses 0-1023 on x86, which is a
large part of why buggy DOS programs crashed the computer so frequently:
writing through a null pointer would corrupt the IDT, so the next time
that interrupt fired, the CPU would wander off and start executing
something that probably wasn't code, trap to the corrupted IDT again, etc..)
On x86, only in real mode is there an IDT in a fixed location. Which
certainly does not apply to the Linux kernel in the usual
circumstances. In any protected mode, there’s a CPU register which
points to the IDT (with complications – the being x86, of course - and
with a completely different table format than in real mode).
.
- Follow-Ups:
- Re: Confusion about undefined behaviour
- From: Stephen Sprunk
- Re: Confusion about undefined behaviour
- References:
- Confusion about undefined behaviour
- From: Phil Carmody
- Re: Confusion about undefined behaviour
- From: Beej Jorgensen
- Re: Confusion about undefined behaviour
- From: Eric Sosman
- Re: Confusion about undefined behaviour
- From: Kenneth Brody
- Re: Confusion about undefined behaviour
- From: Stephen Sprunk
- Re: Confusion about undefined behaviour
- From: Keith Thompson
- Re: Confusion about undefined behaviour
- From: Stephen Sprunk
- Confusion about undefined behaviour
- Prev by Date: Re: Confusion about undefined behaviour
- Next by Date: Re: Confusion about undefined behaviour
- Previous by thread: Re: Confusion about undefined behaviour
- Next by thread: Re: Confusion about undefined behaviour
- Index(es):
Relevant Pages
|