up: Chapter 10 -- Initialization
prev: 10.1 Processor State After Reset
next: 10.3 Switching to Protected Mode
10.2 Software Initialization for Real-Address Mode
In real-address mode a few structures must be initialized before a program can take advantage of all the features available in this mode.
10.2.1 Stack
No instructions that use the stack can be used until the stack-segment register (SS) has been loaded. SS must point to an area in RAM.
10.2.2 Interrupt Table
The initial state of the 80386 leaves interrupts disabled; however, the processor will still attempt to access the interrupt table if an exception or nonmaskable interrupt (NMI) occurs. Initialization software should take one of the following actions:
- Change the limit value in the IDTR to zero. This will cause a shutdown if an exception or nonmaskable interrupt occurs. (Refer to the 80386 Hardware Reference Manual to see how shutdown is signalled externally.)
- Put pointers to valid interrupt handlers in all positions of the interrupt table that might be used by exceptions or interrupts.
- Change the IDTR to point to a valid interrupt table.
10.2.3 First Instructions
After RESET, address lines A{31-20} are automatically asserted for instruction fetches. This fact, together with the initial values of CS:IP, causes instruction execution to begin at physical address FFFFFFF0H. Near (intrasegment) forms of control transfer instructions may be used to pass control to other addresses in the upper 64K bytes of the address space. The first far (intersegment) JMP or CALL instruction causes A{31-20} to drop low, and the 80386 continues executing instructions in the lower one megabyte of physical memory. This automatic assertion of address lines A{31-20} allows systems designers to use a ROM at the high end of the address space to initialize the system.
up: Chapter 10 -- Initialization
prev: 10.1 Processor State After Reset
next: 10.3 Switching to Protected Mode