
SYSTEM CONTROL AND INITIALIZATION
After RESET, CS points to the top 64K bytes in the
Sections 10.4.1 and 10.4.2 describe the steps needed to initialize the 80286 in the real address mode and the protected mode, respectively.
10.4.1Real Address Mode
1.Allocate a stack.
2.Load programs and data into memory from secondary storage.
3.Initialize external devices and the Interrupt Vector Table.
4.Set registers and MSW bits to desired values.
5.Set FLAG bits to desired
6.Execute (usually via an
10.4.2Protected Mode
The full 80286 virtual address mode initialization procedure requires additional steps to operate correctly:
1.Load programs and associated descriptor tables.
2.Load valid GDT and IDT descriptor tables, setting the GDTR and IDTR to their correct value.
3.Set the PE bit to enter protected mode.
4.Execute an
5.Load or construct a valid task state segment for the initial task to be executed in protected mode.
6.Load the LDTR selector from the task's GDT or OOOOH (null) if an LDT is not needed.
7.Set the stack pointer (SS, SP) to a valid location in a valid stack segment.
8.Mark all items not in memory as
9.Set FLAGS and MSW bits to correct values for the desired system configuation.
10.Initialize external devices.
11.Ensure that a valid interrupt handler exists for each possible interrupt.
12.Enable interrupts.
13.Execute.
The example in Appendix A shows the steps necessary to load all the required tables and registers that permit execution of the first task of a protected mode system. The program in Appendix A assumes that Intel development tools have been used to construct a prototype GDT, IDT, LDT, TSS, and all the data segments necessary to start up that first task. Typically, these items are stored on EPROM; on most syslems it is necessary to copy them all into RAM to get going. Otherwise, the 80286 will attempt to wrile into the EPROM to set the accessed or busy bits.