]> pd.if.org Git - mmurtl/blob - ossource/tss.inc
autocommit for file dated 2003-12-29 17:36:54
[mmurtl] / ossource / tss.inc
1 ;   MMURTL Operating System Source Code\r
2 ;   Copyright 1991,1992,1993,1994 Richard A. Burgess\r
3 ;   ALL RIGHTS RESERVED   Version 1.0\r
4 ;=============================================================================\r
5 ;\r
6 ;\r
7 ;-------------------------------------------------------\r
8 ; Each Task State Segment (Structure) is 512 bytes long\r
9 ; The Task State Segment is a structure required by the\r
10 ; CPU for harware task switching. It is used to save\r
11 ; the state of the processor for a task that is suspended.\r
12 ; The rest of the TSS is used to save software state information\r
13 ; for the OS.\r
14 ;\r
15 ; Space is also reserved for Math Coprocessor registers\r
16 ; which will be used when we add support for management of tasks\r
17 ; using the coprocessor.  The top potions for registers\r
18 ; are aligned as required for the hardware (processor).\r
19 ; The rest is WORD or DWORD aligned for best efficiency.\r
20 ;\r
21 sTSS            EQU 512\r
22 \r
23 TSS_BackLink    EQU 0   ;DW 0000h,0000h         ; Task Selector of Interrupted TASK\r
24 TSS_ESP0                EQU 4   ;DD 00000000h           ; Top of Stack for Prot Level 0\r
25 TSS_SS0                 EQU 8   ;DW 0000h,0000h         ; Selector for Prot Level 0 Stack\r
26 TSS_ESP1                EQU 12  ;DD 00000000h           ; Top of Stack for Prot Level 1\r
27 TSS_SS1                 EQU 16  ;DW 0000h,0000h         ; Selector for Prot Level 1 Stack\r
28 TSS_ESP2                EQU 20  ;DD 00000000h           ; Top of Stack for Prot Level 2\r
29 TSS_SS2                 EQU 24  ;DW 0000h,0000h         ; Selector for Prot Level 2 Stack\r
30 TSS_CR3                 EQU 28  ;DD 00000000h           ; Physical Address of Page Directory\r
31 TSS_EIP                 EQU 32  ;DD 00000000h           ; Extended Instruction Pointer\r
32 TSS_EFlags              EQU 36  ;DD 00000000h           ; Extended Flags\r
33 TSS_EAX                 EQU 40  ;DD 00000000h           ; General Purpose Registers\r
34 TSS_ECX                 EQU 44  ;DD 00000000h           ;\r
35 TSS_EDX                 EQU 48  ;DD 00000000h           ;\r
36 TSS_EBX                 EQU 52  ;DD 00000000h           ;\r
37 TSS_ESP                 EQU 56  ;DD 00000000h           ; Top of Stack for Current Prot Level\r
38 TSS_EBP                 EQU 60  ;DD 00000000h           ; Base Frame Pointer (64 bytes to here)\r
39 TSS_ESI                 EQU 64  ;DD 00000000h           ; Source Index Register\r
40 TSS_EDI                 EQU 68  ;DD 00000000h           ; Destination Index Register\r
41 TSS_ES                  EQU 72  ;DW 0000h,0000h         ; E Selector (Extra)\r
42 TSS_CS                  EQU 76  ;DW 0000h,0000h         ; C Selector (Code)\r
43 TSS_SS                  EQU 80  ;DW 0000h,0000h         ; S Selector (Stack Curr Prot Level)\r
44 TSS_DS                  EQU 84  ;DW 0000h,0000h         ; D Selector (Data)\r
45 TSS_FS                  EQU 88  ;DW 0000h,0000h         ; F Selector (Extra)\r
46 TSS_GS                  EQU 92  ;DW 0000h,0000h         ; G Selector (Extra)\r
47 TSS_LDT                 EQU 96  ;DW 0000h,0000h         ; LDT Selector ( ALWAYS 0)  (100)\r
48 TSS_TrapBit             EQU 100 ;DW 0000h                       ; 1 = DEBUG; 0 = NODEBUG\r
49 TSS_IOBitBase   EQU 102 ;DW 1111111111111111b   ; NULL I/O Permission Bit Map\r
50 \r
51 ; This begins MMURTL's software state that we save in the TSS\r
52 \r
53 TSS_Exch                EQU 104 ;DD 00000000h           ; Task Exchange used by OS ONLY\r
54 TSS_pJCB                EQU 108 ;DD 00000000h                   ; pointer to Job Control Blk (Owner)\r
55 Tid                             EQU 112 ;DW 0000h                               ; 1 word Task Id (Selector)\r
56 Priority                EQU 114 ;DB 00h                                 ; 1 byte Priority (0..31)\r
57 TSS_Rsvd1               EQU 115 ;DB 00h                                 ; For alignment\r
58 TSS_MSG                 EQU 116 ;DD 00000000h,00000000h ; 8 Byte OS Msg Block\r
59 pLBRet                  EQU 124 ;DD 00000000h                   ; pLB containing MessageRet (128)\r
60 NextTSS                 EQU 128 ;DD 00000000h                   ; Near Pointer to next TSS (132)\r
61 TSSNum                  EQU 132 ;DW 0000h                               ; Sequential Number of this TSS\r
62 \r
63 ;TSS_Rsvd2              EQU 134 ;DB 122 dup (00h)               ; Math Coprocessor Registers (future)\r
64 ;TSS_Rsvd3       ;DD 64 dup (00000000h)   ; Future Expansion\r
65 \r
66 ;================== End of module ===========================\r