x86 internals help

C. Scott Ananian (cananian@lcs.mit.edu)
Thu, 12 Feb 1998 18:41:34 -0500 (EST)


OK, I'm trying to debug APM bugs on my laptop. I've got the spec in front
of me. Can an x86 guru help me out with some kernel internals questions?

The APM spec says (regarding calling the 32-bit APM BIOS routines):
- "The code segment descriptors must specify protection level 0, and
the APM BIOS routines must be invoked with CPL=0 so they can execute
privileged instructions such as port inputs and outputs."

OK, this is an easy one: any kernel code will be running at
protection level 0, right?

- "The caller must supply a stack large enough for use by the APM BIOS
and potential interrupt handlers... The APM BIOS 32-bit protected mode
interface must be called with a 32-bit stack."

I'm *assuming* I don't have to worry about this. Is it even possible
to change the kernel stack size? [interrupts are disabled before the
apm routines are called, but I'm not ruling out some silly recursive
routine in the BIOS.]

- "When the APM BIOS routines are called in protected mode, the current
I/O permission bit map must allow access to the I/O ports the BIOS may
need to access in the process of performing the selected function."

This goes with the first question. Is there a special I/O port
permissions map I need to fiddle with, or can I assume that kernel
code will be running with all permissions wide open?

And, finally, a device driver question for the IDE-gurus out there:
the 'suspend to disk' APM function will (presumably) be attempting to
write to disk using BIOS routines. Does the linux IDE driver fiddle with
chip setup information such that these BIOS routines might not work
properly?

Thanks in advance for the help...
--Scott
@ @
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-oOO-(_)-OOo-=-=-=-=-=
C. Scott Ananian: cananian@lcs.mit.edu / Declare the Truth boldly and
Laboratory for Computer Science/Crypto / without hindrance.
Massachusetts Institute of Technology /META-PARRESIAS AKOLUTOS:Acts 28:31
-.-. .-.. .. ..-. ..-. --- .-. -.. ... -.-. --- - - .- -. .- -. .. .- -.
PGP key available via finger and from http://www.pdos.lcs.mit.edu/~cananian

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu