4

The 80286 processor added these instructions: ARPL, VERR, VERW, LAR, LSL, SMSW, SGDT, SIDT, SLDT, STR, LMSW, LGDT, LIDT, LLDT, LTR, CLTS.

To help understand how this was implemented I am looking for an outline of how protected mode works, which includes the points where some of the above instructions are used, like mentioning that the LGDT, and LLDT and load the global and local descriptor tables, which are used for OS and DLLs (global), and user processes (local).

6
  • The LIDT instruction is not about the LDT (local descriptor table), but about the IDT (interrupt descriptor table). The LDT is affected by LLDT. The operating system will not use LLDT when switching tasks, though, as long as the system uses hardware-assisted task switching. The LDT selector is loaded from the task state segment when a hardware-assisted task switch is performed. The operating system can use LLDT when first setting up a task, though. Sep 6 '20 at 14:37
  • Thanks. Have edited LIDT to LLDT. So is the LLDT instruction just used once initially on OS startup? Sep 6 '20 at 14:48
  • 1
    This is bordering on being too broad of a question to answer within the character limits for an answer. You should also cite the source for text you quoted.
    – user722
    Sep 6 '20 at 15:01
  • Not once in OS startup, but once per task on task startup. It is not used for switching between tasks that are already running. This is true if you are doing multitasking/task switching as the 286 designers intended it. Sep 6 '20 at 16:03
  • @RossRidge edited this to just the broad parts of how it works. Sep 6 '20 at 16:06
7

Have you referred to the Intel 286 manuals yet?

The 286 Programmer's Reference Manual (PDF copy on Bitsavers linked here) covers the instructions in general from a programming perspective, including a brief overview of the protected mode instructions.

The Operating System Writer's Guide (Bitsavers again) deals specifically in depth with the 286's protected mode features, as relevant to someone implementing systems software.

1
  • No. Probably those original manuals are the best resource for this. I understand partially some of the instructions LGDT, LIDT and LLDT and their store equivalents but not how it all fits together. Sep 6 '20 at 14:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.