]> pd.if.org Git - mmurtl/blob - ossource/mosgdt.asm
autocommit for file dated 2003-12-29 17:36:54
[mmurtl] / ossource / mosgdt.asm
1 ;   MMURTL Operating System Source Code\r
2 ;   Copyright 1991,1992,1993,1994 Richard A. Burgess\r
3 ;   ALL RIGHTS RESERVED\r
4 ;   Version 1,0\r
5 .DATA\r
6 .INCLUDE MOSEDF.INC\r
7 \r
8 ;=============================================================================\r
9 ;\r
10 ; All the static GDT descriptors below are defined as shown on page\r
11 ; 2-5 of the 80386 System Software Writer's Guide.\r
12 ; Comments next to each of the entries mean:\r
13 ;\r
14 ; Limit - 00:15 DW A WORD (16 bits) with LSW of the Linear Segment Limit\r
15 ; Base  - 00:15 DW A WORD (16 bits) with LSW of the Linear Segment Base\r
16 ; Base  - 16:23 DB A BYTE (8 bits) with MSB of the Linear Segment Base\r
17 ; ProtType      DB P/DPL/1/CRA or EWA/ Protection, Type, etc...\r
18 ; GranSizeLim   DB Granularity/Size for code/\r
19 ; Base  - 24:31 DB A BYTE (8 bits) with MSB of the Linear Segment base\r
20 ;\r
21 ;=============================================================================\r
22 ;Sel 00h\r
23 PUBLIC GDT      DD 2 DUP (0h)           ;The first desc is always null\r
24 \r
25 ;Sel 08\r
26 OSCodeDesc      DW 0FFFFh                       ; Limit 15-0 (4Gb)\r
27                         DW 0000h                        ; Base  15-0\r
28                         DB 00h                          ; Base  23-16   ;10000h\r
29                         DB 10011010b            ; P(1) DPL(00) 1 1 C(0) R(1) A(0)\r
30                         DB 11001111b            ; G(1) D(1) 0 0 Limit[19-16]\r
31                         DB 00h                          ; Base  31-24\r
32 \r
33 ;Sel 10h  - This the OS and User Data descriptor.\r
34 \r
35 DataDesc        DW 0FFFFh                       ;Limit (bits 0:15) at linear 00K\r
36                         DW 0000h                        ;base (bits 15:0)\r
37                         DB 00h                          ;base (bits 23:16)\r
38                         DB 10010010b            ;P(1) DPL(00) 1 0 E(0) W(1) A(0)\r
39                         DB 11001111b            ;G(1), B(1) 0 0 limit[19-16)\r
40                         DB 00h                          ;Base at 0 (bits 31:24)\r
41 \r
42 ;Sel 18h - This is the user's code descriptor.\r
43 \r
44 CodeDesc        DW 0FFFFh                       ; Limit 15-0 (0FFFFh)\r
45                         DW 0000h                        ; Base  15-0\r
46                         DB 00h                          ; Base  23-16\r
47                         DB 10011010b            ; P(1)-DPL(00)-1-1-C(0)-R(1)-A(0)\r
48                         DB 11001111b            ; G(1) D(1) 0 0 Limit[19-16]\r
49                         DB 00h                          ; Base  31-24\r
50 \r
51 ;Save these for the future...\r
52 \r
53 OSXtra0Desc     DD 0, 0         ;Sel 20h\r
54 OSXtra1Desc     DD 0, 0         ;Sel 28h\r
55 OSXtra2Desc     DD 0, 0         ;Sel 30h\r
56 OSXtra3Desc     DD 0, 0         ;Sel 38h\r
57 \r
58 ;WARNING: The rgCall Descriptors must never be moved from this location\r
59 ;         in the GDT. They describe system entry points that will become\r
60 ;         PUBLIC for external programs. The first PUBLIC call gate is\r
61 ;         selector 40h.\r
62 \r
63 ;Sel 40\r
64 \r
65 PUBLIC rgCallDesc       DD (nCallGates*2) DUP (0)       ;Call Gates\r
66 \r
67 PUBLIC rgTSSDesc        DD (nTSS*2) DUP (0)             ;Task descriptors\r
68 \r
69 \r
70 ;--------- END OF MODULE ------------------------------\r