Subversion Repositories Kolibri OS

Rev

Rev 7124 | Rev 7129 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7124 Rev 7126
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
7
 
8
$Revision: 7124 $
8
$Revision: 7126 $
9
 
9
 
10
 
10
 
11
dpl0    equ  10010000b      ; data read       dpl0
11
dpl0    equ  10010000b      ; data read       dpl0
12
drw0    equ  10010010b      ; data read/write dpl0
12
drw0    equ  10010010b      ; data read/write dpl0
13
drw3    equ  11110010b      ; data read/write dpl3
13
drw3    equ  11110010b      ; data read/write dpl3
14
cpl0    equ  10011010b      ; code read dpl0
14
cpl0    equ  10011010b      ; code read dpl0
15
cpl3    equ  11111010b      ; code read dpl3
15
cpl3    equ  11111010b      ; code read dpl3
16
 
16
 
17
D32     equ  01000000b      ; 32bit segment
17
D32     equ  01000000b      ; 32bit segment
18
G32     equ  10000000b      ; page gran
18
G32     equ  10000000b      ; page gran
19
 
19
 
20
 
20
 
21
;;;;;;;;;;;;cpu_caps flags;;;;;;;;;;;;;;;;
21
;;;;;;;;;;;;cpu_caps flags;;;;;;;;;;;;;;;;
22
 
22
 
23
CPU_386        equ 3
23
CPU_386        equ 3
24
CPU_486        equ 4
24
CPU_486        equ 4
25
CPU_PENTIUM    equ 5
25
CPU_PENTIUM    equ 5
26
CPU_P6         equ 6
26
CPU_P6         equ 6
27
CPU_PENTIUM4   equ 0x0F
27
CPU_PENTIUM4   equ 0x0F
28
 
28
 
29
CAPS_FPU       equ    00 ;on-chip x87 floating point unit
29
CAPS_FPU       equ    00 ;on-chip x87 floating point unit
30
CAPS_VME       equ    01 ;virtual-mode enhancements
30
CAPS_VME       equ    01 ;virtual-mode enhancements
31
CAPS_DE        equ    02 ;debugging extensions
31
CAPS_DE        equ    02 ;debugging extensions
32
CAPS_PSE       equ    03 ;page-size extensions
32
CAPS_PSE       equ    03 ;page-size extensions
33
CAPS_TSC       equ    04 ;time stamp counter
33
CAPS_TSC       equ    04 ;time stamp counter
34
CAPS_MSR       equ    05 ;model-specific registers
34
CAPS_MSR       equ    05 ;model-specific registers
35
CAPS_PAE       equ    06 ;physical-address extensions
35
CAPS_PAE       equ    06 ;physical-address extensions
36
CAPS_MCE       equ    07 ;machine check exception
36
CAPS_MCE       equ    07 ;machine check exception
37
CAPS_CX8       equ    08 ;CMPXCHG8B instruction
37
CAPS_CX8       equ    08 ;CMPXCHG8B instruction
38
CAPS_APIC      equ    09 ;on-chip advanced programmable
38
CAPS_APIC      equ    09 ;on-chip advanced programmable
39
                         ; interrupt controller
39
                         ; interrupt controller
40
;                     10 ;unused
40
;                     10 ;unused
41
CAPS_SEP       equ    11 ;SYSENTER and SYSEXIT instructions
41
CAPS_SEP       equ    11 ;SYSENTER and SYSEXIT instructions
42
CAPS_MTRR      equ    12 ;memory-type range registers
42
CAPS_MTRR      equ    12 ;memory-type range registers
43
CAPS_PGE       equ    13 ;page global extension
43
CAPS_PGE       equ    13 ;page global extension
44
CAPS_MCA       equ    14 ;machine check architecture
44
CAPS_MCA       equ    14 ;machine check architecture
45
CAPS_CMOV      equ    15 ;conditional move instructions
45
CAPS_CMOV      equ    15 ;conditional move instructions
46
CAPS_PAT       equ    16 ;page attribute table
46
CAPS_PAT       equ    16 ;page attribute table
47
 
47
 
48
CAPS_PSE36     equ    17 ;page-size extensions
48
CAPS_PSE36     equ    17 ;page-size extensions
49
CAPS_PSN       equ    18 ;processor serial number
49
CAPS_PSN       equ    18 ;processor serial number
50
CAPS_CLFLUSH   equ    19 ;CLFUSH instruction
50
CAPS_CLFLUSH   equ    19 ;CLFUSH instruction
51
 
51
 
52
CAPS_DS        equ    21 ;debug store
52
CAPS_DS        equ    21 ;debug store
53
CAPS_ACPI      equ    22 ;thermal monitor and software
53
CAPS_ACPI      equ    22 ;thermal monitor and software
54
                         ;controlled clock supported
54
                         ;controlled clock supported
55
CAPS_MMX       equ    23 ;MMX instructions
55
CAPS_MMX       equ    23 ;MMX instructions
56
CAPS_FXSR      equ    24 ;FXSAVE and FXRSTOR instructions
56
CAPS_FXSR      equ    24 ;FXSAVE and FXRSTOR instructions
57
CAPS_SSE       equ    25 ;SSE instructions
57
CAPS_SSE       equ    25 ;SSE instructions
58
CAPS_SSE2      equ    26 ;SSE2 instructions
58
CAPS_SSE2      equ    26 ;SSE2 instructions
59
CAPS_SS        equ    27 ;self-snoop
59
CAPS_SS        equ    27 ;self-snoop
60
CAPS_HTT       equ    28 ;hyper-threading technology
60
CAPS_HTT       equ    28 ;hyper-threading technology
61
CAPS_TM        equ    29 ;thermal monitor supported
61
CAPS_TM        equ    29 ;thermal monitor supported
62
CAPS_IA64      equ    30 ;IA64 capabilities
62
CAPS_IA64      equ    30 ;IA64 capabilities
63
CAPS_PBE       equ    31 ;pending break enable
63
CAPS_PBE       equ    31 ;pending break enable
64
 
64
 
65
;ecx
65
;ecx
66
CAPS_SSE3      equ    32 ;SSE3 instructions
66
CAPS_SSE3      equ    32 ;SSE3 instructions
67
;                     33
67
;                     33
68
;                     34
68
;                     34
69
CAPS_MONITOR   equ    35 ;MONITOR/MWAIT instructions
69
CAPS_MONITOR   equ    35 ;MONITOR/MWAIT instructions
70
CAPS_DS_CPL    equ    36 ;
70
CAPS_DS_CPL    equ    36 ;
71
CAPS_VMX       equ    37 ;virtual mode extensions
71
CAPS_VMX       equ    37 ;virtual mode extensions
72
;                     38 ;
72
;                     38 ;
73
CAPS_EST       equ    39 ;enhansed speed step
73
CAPS_EST       equ    39 ;enhansed speed step
74
CAPS_TM2       equ    40 ;thermal monitor2 supported
74
CAPS_TM2       equ    40 ;thermal monitor2 supported
75
;                     41
75
;                     41
76
CAPS_CID       equ    42 ;
76
CAPS_CID       equ    42 ;
77
;                     43
77
;                     43
78
;                     44
78
;                     44
79
CAPS_CX16      equ    45 ;CMPXCHG16B instruction
79
CAPS_CX16      equ    45 ;CMPXCHG16B instruction
80
CAPS_xTPR      equ    46 ;
80
CAPS_xTPR      equ    46 ;
81
CAPS_XSAVE     equ    (32 + 26) ; XSAVE and XRSTOR instructions
81
CAPS_XSAVE     equ    (32 + 26) ; XSAVE and XRSTOR instructions
82
CAPS_OSXSAVE   equ    (32 + 27)
82
CAPS_OSXSAVE   equ    (32 + 27)
83
; A value of 1 indicates that the OS has set CR4.OSXSAVE[bit 18] to enable
83
; A value of 1 indicates that the OS has set CR4.OSXSAVE[bit 18] to enable
84
; XSETBV/XGETBV instructions to access XCR0 and to support processor extended
84
; XSETBV/XGETBV instructions to access XCR0 and to support processor extended
85
; state management using XSAVE/XRSTOR.
85
; state management using XSAVE/XRSTOR.
86
CAPS_AVX       equ    (32 + 28) ; not AVX2
86
CAPS_AVX       equ    (32 + 28) ; not AVX2
87
;
87
;
88
;reserved
88
;reserved
89
;
89
;
90
;ext edx /ecx
90
;ext edx /ecx
91
CAPS_SYSCAL    equ    64 ;
91
CAPS_SYSCAL    equ    64 ;
92
CAPS_XD        equ    65 ;execution disable
92
CAPS_XD        equ    65 ;execution disable
93
CAPS_FFXSR     equ    66 ;
93
CAPS_FFXSR     equ    66 ;
94
CAPS_RDTSCP    equ    67 ;
94
CAPS_RDTSCP    equ    67 ;
95
CAPS_X64       equ    68 ;
95
CAPS_X64       equ    68 ;
96
CAPS_3DNOW     equ    69 ;
96
CAPS_3DNOW     equ    69 ;
97
CAPS_3DNOWEXT  equ    70 ;
97
CAPS_3DNOWEXT  equ    70 ;
98
CAPS_LAHF      equ    71 ;
98
CAPS_LAHF      equ    71 ;
99
CAPS_CMP_LEG   equ    72 ;
99
CAPS_CMP_LEG   equ    72 ;
100
CAPS_SVM       equ    73 ;secure virual machine
100
CAPS_SVM       equ    73 ;secure virual machine
101
CAPS_ALTMOVCR8 equ    74 ;
101
CAPS_ALTMOVCR8 equ    74 ;
102
 
102
 
103
; CPU MSR names
103
; CPU MSR names
104
MSR_SYSENTER_CS         equ     0x174
104
MSR_SYSENTER_CS         equ     0x174
105
MSR_SYSENTER_ESP        equ     0x175
105
MSR_SYSENTER_ESP        equ     0x175
106
MSR_SYSENTER_EIP        equ     0x176
106
MSR_SYSENTER_EIP        equ     0x176
107
MSR_CR_PAT              equ     0x277
107
MSR_CR_PAT              equ     0x277
108
MSR_MTRR_DEF_TYPE       equ     0x2FF
108
MSR_MTRR_DEF_TYPE       equ     0x2FF
109
 
109
 
110
MSR_AMD_EFER            equ     0xC0000080      ; Extended Feature Enable Register
110
MSR_AMD_EFER            equ     0xC0000080      ; Extended Feature Enable Register
111
MSR_AMD_STAR            equ     0xC0000081      ; SYSCALL/SYSRET Target Address Register
111
MSR_AMD_STAR            equ     0xC0000081      ; SYSCALL/SYSRET Target Address Register
112
 
112
 
113
CR0_PE         equ    0x00000001   ;protected mode
113
CR0_PE         equ    0x00000001   ;protected mode
114
CR0_MP         equ    0x00000002   ;monitor fpu
114
CR0_MP         equ    0x00000002   ;monitor fpu
115
CR0_EM         equ    0x00000004   ;fpu emulation
115
CR0_EM         equ    0x00000004   ;fpu emulation
116
CR0_TS         equ    0x00000008   ;task switch
116
CR0_TS         equ    0x00000008   ;task switch
117
CR0_ET         equ    0x00000010   ;extension type hardcoded to 1
117
CR0_ET         equ    0x00000010   ;extension type hardcoded to 1
118
CR0_NE         equ    0x00000020   ;numeric error
118
CR0_NE         equ    0x00000020   ;numeric error
119
CR0_WP         equ    0x00010000   ;write protect
119
CR0_WP         equ    0x00010000   ;write protect
120
CR0_AM         equ    0x00040000   ;alignment check
120
CR0_AM         equ    0x00040000   ;alignment check
121
CR0_NW         equ    0x20000000   ;not write-through
121
CR0_NW         equ    0x20000000   ;not write-through
122
CR0_CD         equ    0x40000000   ;cache disable
122
CR0_CD         equ    0x40000000   ;cache disable
123
CR0_PG         equ    0x80000000   ;paging
123
CR0_PG         equ    0x80000000   ;paging
124
 
124
 
125
 
125
 
126
CR4_VME        equ    0x000001
126
CR4_VME        equ    0x000001
127
CR4_PVI        equ    0x000002
127
CR4_PVI        equ    0x000002
128
CR4_TSD        equ    0x000004
128
CR4_TSD        equ    0x000004
129
CR4_DE         equ    0x000008
129
CR4_DE         equ    0x000008
130
CR4_PSE        equ    0x000010
130
CR4_PSE        equ    0x000010
131
CR4_PAE        equ    0x000020
131
CR4_PAE        equ    0x000020
132
CR4_MCE        equ    0x000040
132
CR4_MCE        equ    0x000040
133
CR4_PGE        equ    0x000080
133
CR4_PGE        equ    0x000080
134
CR4_PCE        equ    0x000100
134
CR4_PCE        equ    0x000100
135
CR4_OSFXSR     equ    0x000200
135
CR4_OSFXSR     equ    0x000200
136
CR4_OSXMMEXPT  equ    0x000400
136
CR4_OSXMMEXPT  equ    0x000400
137
CR4_OSXSAVE    equ    0x040000
137
CR4_OSXSAVE    equ    0x040000
138
 
138
 
139
XCR0_FPU_MMX   equ    0x0001
139
XCR0_FPU_MMX   equ    0x0001
140
XCR0_SSE       equ    0x0002
140
XCR0_SSE       equ    0x0002
141
XCR0_AVX       equ    0x0004
141
XCR0_AVX       equ    0x0004
142
XCR0_MPX       equ    0x0018
142
XCR0_MPX       equ    0x0018
143
XCR0_AVX512    equ    0x00e0
143
XCR0_AVX512    equ    0x00e0
144
 
144
 
145
MXCSR_IE       equ    0x0001
145
MXCSR_IE       equ    0x0001
146
MXCSR_DE       equ    0x0002
146
MXCSR_DE       equ    0x0002
147
MXCSR_ZE       equ    0x0004
147
MXCSR_ZE       equ    0x0004
148
MXCSR_OE       equ    0x0008
148
MXCSR_OE       equ    0x0008
149
MXCSR_UE       equ    0x0010
149
MXCSR_UE       equ    0x0010
150
MXCSR_PE       equ    0x0020
150
MXCSR_PE       equ    0x0020
151
MXCSR_DAZ      equ    0x0040
151
MXCSR_DAZ      equ    0x0040
152
MXCSR_IM       equ    0x0080
152
MXCSR_IM       equ    0x0080
153
MXCSR_DM       equ    0x0100
153
MXCSR_DM       equ    0x0100
154
MXCSR_ZM       equ    0x0200
154
MXCSR_ZM       equ    0x0200
155
MXCSR_OM       equ    0x0400
155
MXCSR_OM       equ    0x0400
156
MXCSR_UM       equ    0x0800
156
MXCSR_UM       equ    0x0800
157
MXCSR_PM       equ    0x1000
157
MXCSR_PM       equ    0x1000
158
MXCSR_FZ       equ    0x8000
158
MXCSR_FZ       equ    0x8000
159
 
159
 
160
MXCSR_INIT     equ (MXCSR_IM+MXCSR_DM+MXCSR_ZM+MXCSR_OM+MXCSR_UM+MXCSR_PM)
160
MXCSR_INIT     equ (MXCSR_IM+MXCSR_DM+MXCSR_ZM+MXCSR_OM+MXCSR_UM+MXCSR_PM)
-
 
161
 
-
 
162
EFLAGS_CF      equ    0x000001  ; carry flag
-
 
163
EFLAGS_PF      equ    0x000004  ; parity flag
-
 
164
EFLAGS_AF      equ    0x000010  ; auxiliary flag
-
 
165
EFLAGS_ZF      equ    0x000040  ; zero flag
-
 
166
EFLAGS_SF      equ    0x000080  ; sign flag
-
 
167
EFLAGS_TF      equ    0x000100  ; trap flag
-
 
168
EFLAGS_IF      equ    0x000200  ; interrupt flag
-
 
169
EFLAGS_DF      equ    0x000400  ; direction flag
-
 
170
EFLAGS_OF      equ    0x000800  ; overflow flag
-
 
171
EFLAGS_IOPL    equ    0x003000  ; i/o priviledge level
-
 
172
EFLAGS_NT      equ    0x004000  ; nested task flag
-
 
173
EFLAGS_RF      equ    0x010000  ; resume flag
-
 
174
EFLAGS_VM      equ    0x020000  ; virtual 8086 mode flag
-
 
175
EFLAGS_AC      equ    0x040000  ; alignment check flag
-
 
176
EFLAGS_VIF     equ    0x080000  ; virtual interrupt flag
-
 
177
EFLAGS_VIP     equ    0x100000  ; virtual interrupt pending
-
 
178
EFLAGS_ID      equ    0x200000  ; id flag
161
 
179
 
162
IRQ_PIC        equ    0
180
IRQ_PIC        equ    0
163
IRQ_APIC       equ    1
181
IRQ_APIC       equ    1
164
 
182
 
165
struct  TSS
183
struct  TSS
166
        _back       rw 2
184
        _back       rw 2
167
        _esp0       rd 1
185
        _esp0       rd 1
168
        _ss0        rw 2
186
        _ss0        rw 2
169
        _esp1       rd 1
187
        _esp1       rd 1
170
        _ss1        rw 2
188
        _ss1        rw 2
171
        _esp2       rd 1
189
        _esp2       rd 1
172
        _ss2        rw 2
190
        _ss2        rw 2
173
        _cr3        rd 1
191
        _cr3        rd 1
174
        _eip        rd 1
192
        _eip        rd 1
175
        _eflags     rd 1
193
        _eflags     rd 1
176
        _eax        rd 1
194
        _eax        rd 1
177
        _ecx        rd 1
195
        _ecx        rd 1
178
        _edx        rd 1
196
        _edx        rd 1
179
        _ebx        rd 1
197
        _ebx        rd 1
180
        _esp        rd 1
198
        _esp        rd 1
181
        _ebp        rd 1
199
        _ebp        rd 1
182
        _esi        rd 1
200
        _esi        rd 1
183
        _edi        rd 1
201
        _edi        rd 1
184
        _es         rw 2
202
        _es         rw 2
185
        _cs         rw 2
203
        _cs         rw 2
186
        _ss         rw 2
204
        _ss         rw 2
187
        _ds         rw 2
205
        _ds         rw 2
188
        _fs         rw 2
206
        _fs         rw 2
189
        _gs         rw 2
207
        _gs         rw 2
190
        _ldt        rw 2
208
        _ldt        rw 2
191
        _trap       rw 1
209
        _trap       rw 1
192
        _io         rw 1
210
        _io         rw 1
193
                    rb 24
211
                    rb 24
194
        _io_map_0   rb 4096
212
        _io_map_0   rb 4096
195
        _io_map_1   rb 4096
213
        _io_map_1   rb 4096
196
ends
214
ends
197
 
215
 
198
DRIVE_DATA_SIZE     equ 16
216
DRIVE_DATA_SIZE     equ 16
199
 
217
 
200
OS_BASE             equ 0x80000000
218
OS_BASE             equ 0x80000000
201
 
219
 
202
window_data         equ (OS_BASE+0x0001000)
220
window_data         equ (OS_BASE+0x0001000)
203
 
221
 
204
CURRENT_TASK        equ (OS_BASE+0x0003000)
222
CURRENT_TASK        equ (OS_BASE+0x0003000)
205
TASK_COUNT          equ (OS_BASE+0x0003004)
223
TASK_COUNT          equ (OS_BASE+0x0003004)
206
TASK_BASE           equ (OS_BASE+0x0003010)
224
TASK_BASE           equ (OS_BASE+0x0003010)
207
TASK_DATA           equ (OS_BASE+0x0003020)
225
TASK_DATA           equ (OS_BASE+0x0003020)
208
TASK_EVENT          equ (OS_BASE+0x0003020)
226
TASK_EVENT          equ (OS_BASE+0x0003020)
209
 
227
 
210
CDDataBuf           equ (OS_BASE+0x0005000)
228
CDDataBuf           equ (OS_BASE+0x0005000)
211
 
229
 
212
;unused                 0x6000 - 0x8fff
230
;unused                 0x6000 - 0x8fff
213
 
231
 
214
BOOT_VARS           equ (OS_BASE)               ;0x9000
232
BOOT_VARS           equ (OS_BASE)               ;0x9000
215
 
233
 
216
idts                equ (OS_BASE+0x000B100)
234
idts                equ (OS_BASE+0x000B100)
217
WIN_STACK           equ (OS_BASE+0x000C000)
235
WIN_STACK           equ (OS_BASE+0x000C000)
218
WIN_POS             equ (OS_BASE+0x000C400)
236
WIN_POS             equ (OS_BASE+0x000C400)
219
FDD_BUFF            equ (OS_BASE+0x000D000)     ;512
237
FDD_BUFF            equ (OS_BASE+0x000D000)     ;512
220
 
238
 
221
WIN_TEMP_XY         equ (OS_BASE+0x000F300)
239
WIN_TEMP_XY         equ (OS_BASE+0x000F300)
222
KEY_COUNT           equ (OS_BASE+0x000F400)
240
KEY_COUNT           equ (OS_BASE+0x000F400)
223
KEY_BUFF            equ (OS_BASE+0x000F401) ; 120*2 + 2*2 = 244 bytes, actually 255 bytes
241
KEY_BUFF            equ (OS_BASE+0x000F401) ; 120*2 + 2*2 = 244 bytes, actually 255 bytes
224
 
242
 
225
BTN_COUNT           equ (OS_BASE+0x000F500)
243
BTN_COUNT           equ (OS_BASE+0x000F500)
226
BTN_BUFF            equ (OS_BASE+0x000F501)
244
BTN_BUFF            equ (OS_BASE+0x000F501)
227
 
245
 
228
 
246
 
229
BTN_ADDR            equ (OS_BASE+0x000FE88)
247
BTN_ADDR            equ (OS_BASE+0x000FE88)
230
MEM_AMOUNT          equ (OS_BASE+0x000FE8C)
248
MEM_AMOUNT          equ (OS_BASE+0x000FE8C)
231
 
249
 
232
SYS_SHUTDOWN        equ (OS_BASE+0x000FF00)
250
SYS_SHUTDOWN        equ (OS_BASE+0x000FF00)
233
TASK_ACTIVATE       equ (OS_BASE+0x000FF01)
251
TASK_ACTIVATE       equ (OS_BASE+0x000FF01)
234
 
252
 
235
 
253
 
236
TMP_STACK_TOP       equ 0x006CC00
254
TMP_STACK_TOP       equ 0x006CC00
237
 
255
 
238
sys_proc            equ (OS_BASE+0x006F000)
256
sys_proc            equ (OS_BASE+0x006F000)
239
 
257
 
240
SLOT_BASE           equ (OS_BASE+0x0080000)
258
SLOT_BASE           equ (OS_BASE+0x0080000)
241
 
259
 
242
VGABasePtr          equ (OS_BASE+0x00A0000)
260
VGABasePtr          equ (OS_BASE+0x00A0000)
243
 
261
 
244
CLEAN_ZONE          equ (_CLEAN_ZONE-OS_BASE)
262
CLEAN_ZONE          equ (_CLEAN_ZONE-OS_BASE)
245
 
263
 
246
UPPER_KERNEL_PAGES  equ (OS_BASE+0x0400000)
264
UPPER_KERNEL_PAGES  equ (OS_BASE+0x0400000)
247
 
265
 
248
virtual at              (OS_BASE+0x05FFF80)
266
virtual at              (OS_BASE+0x05FFF80)
249
  tss  TSS
267
  tss  TSS
250
end virtual
268
end virtual
251
 
269
 
252
HEAP_BASE           equ (OS_BASE+0x0800000)
270
HEAP_BASE           equ (OS_BASE+0x0800000)
253
HEAP_MIN_SIZE       equ 0x01000000
271
HEAP_MIN_SIZE       equ 0x01000000
254
 
272
 
255
page_tabs           equ 0xFDC00000
273
page_tabs           equ 0xFDC00000
256
app_page_tabs       equ 0xFDC00000
274
app_page_tabs       equ 0xFDC00000
257
kernel_tabs         equ (page_tabs+ (OS_BASE shr 10))   ;0xFDE00000
275
kernel_tabs         equ (page_tabs+ (OS_BASE shr 10))   ;0xFDE00000
258
master_tab          equ (page_tabs+ (page_tabs shr 10)) ;0xFDFF70000
276
master_tab          equ (page_tabs+ (page_tabs shr 10)) ;0xFDFF70000
259
 
277
 
260
LFB_BASE            equ 0xFE000000
278
LFB_BASE            equ 0xFE000000
261
 
279
 
262
 
280
 
263
new_app_base        equ 0;
281
new_app_base        equ 0;
264
 
282
 
265
twdw                equ 0x2000   ;(CURRENT_TASK-window_data)
283
twdw                equ 0x2000   ;(CURRENT_TASK-window_data)
266
 
284
 
267
std_application_base_address   equ new_app_base
285
std_application_base_address   equ new_app_base
268
RING0_STACK_SIZE    equ 0x2000
286
RING0_STACK_SIZE    equ 0x2000
269
 
287
 
270
REG_SS              equ (RING0_STACK_SIZE-4)
288
REG_SS              equ (RING0_STACK_SIZE-4)
271
REG_APP_ESP         equ (RING0_STACK_SIZE-8)
289
REG_APP_ESP         equ (RING0_STACK_SIZE-8)
272
REG_EFLAGS          equ (RING0_STACK_SIZE-12)
290
REG_EFLAGS          equ (RING0_STACK_SIZE-12)
273
REG_CS              equ (RING0_STACK_SIZE-16)
291
REG_CS              equ (RING0_STACK_SIZE-16)
274
REG_EIP             equ (RING0_STACK_SIZE-20)
292
REG_EIP             equ (RING0_STACK_SIZE-20)
275
REG_EAX             equ (RING0_STACK_SIZE-24)
293
REG_EAX             equ (RING0_STACK_SIZE-24)
276
REG_ECX             equ (RING0_STACK_SIZE-28)
294
REG_ECX             equ (RING0_STACK_SIZE-28)
277
REG_EDX             equ (RING0_STACK_SIZE-32)
295
REG_EDX             equ (RING0_STACK_SIZE-32)
278
REG_EBX             equ (RING0_STACK_SIZE-36)
296
REG_EBX             equ (RING0_STACK_SIZE-36)
279
REG_ESP             equ (RING0_STACK_SIZE-40)  ;RING0_STACK_SIZE-20
297
REG_ESP             equ (RING0_STACK_SIZE-40)  ;RING0_STACK_SIZE-20
280
REG_EBP             equ (RING0_STACK_SIZE-44)
298
REG_EBP             equ (RING0_STACK_SIZE-44)
281
REG_ESI             equ (RING0_STACK_SIZE-48)
299
REG_ESI             equ (RING0_STACK_SIZE-48)
282
REG_EDI             equ (RING0_STACK_SIZE-52)
300
REG_EDI             equ (RING0_STACK_SIZE-52)
283
REG_RET             equ (RING0_STACK_SIZE-56)  ;irq0.return
301
REG_RET             equ (RING0_STACK_SIZE-56)  ;irq0.return
284
 
302
 
285
 
303
 
286
PAGE_SIZE           equ 4096
304
PAGE_SIZE           equ 4096
287
 
305
 
288
PG_UNMAP            equ 0x000
306
PG_UNMAP            equ 0x000
289
PG_READ             equ 0x001
307
PG_READ             equ 0x001
290
PG_WRITE            equ 0x002
308
PG_WRITE            equ 0x002
291
PG_USER             equ 0x004
309
PG_USER             equ 0x004
292
PG_PCD              equ 0x008
310
PG_PCD              equ 0x008
293
PG_PWT              equ 0x010
311
PG_PWT              equ 0x010
294
PG_ACCESSED         equ 0x020
312
PG_ACCESSED         equ 0x020
295
PG_DIRTY            equ 0x040
313
PG_DIRTY            equ 0x040
296
PG_PAT              equ 0x080
314
PG_PAT              equ 0x080
297
PG_GLOBAL           equ 0x100
315
PG_GLOBAL           equ 0x100
298
PG_SHARED           equ 0x200
316
PG_SHARED           equ 0x200
299
 
317
 
300
PG_SWR              equ 0x003 ; (PG_WRITE+PG_READ)
318
PG_SWR              equ 0x003 ; (PG_WRITE+PG_READ)
301
PG_UR               equ 0x005 ; (PG_USER+PG_READ)
319
PG_UR               equ 0x005 ; (PG_USER+PG_READ)
302
PG_UWR              equ 0x007 ; (PG_USER+PG_WRITE+PG_READ)
320
PG_UWR              equ 0x007 ; (PG_USER+PG_WRITE+PG_READ)
303
PG_NOCACHE          equ 0x018 ; (PG_PCD+PG_PWT)
321
PG_NOCACHE          equ 0x018 ; (PG_PCD+PG_PWT)
304
 
322
 
305
PDE_LARGE           equ 0x080
323
PDE_LARGE           equ 0x080
306
 
324
 
307
PAT_WB              equ 0x000
325
PAT_WB              equ 0x000
308
PAT_WC              equ 0x008
326
PAT_WC              equ 0x008
309
PAT_UCM             equ 0x010
327
PAT_UCM             equ 0x010
310
PAT_UC              equ 0x018
328
PAT_UC              equ 0x018
311
 
329
 
312
PAT_TYPE_UC         equ 0
330
PAT_TYPE_UC         equ 0
313
PAT_TYPE_WC         equ 1
331
PAT_TYPE_WC         equ 1
314
PAT_TYPE_WB         equ 6
332
PAT_TYPE_WB         equ 6
315
PAT_TYPE_UCM        equ 7
333
PAT_TYPE_UCM        equ 7
316
 
334
 
317
PAT_VALUE           equ 0x00070106; (UC<<24)|(UCM<<16)|(WC<<8)|WB
335
PAT_VALUE           equ 0x00070106; (UC<<24)|(UCM<<16)|(WC<<8)|WB
318
 
336
 
319
;;;;;;;;;;;boot time variables
337
;;;;;;;;;;;boot time variables
320
 
338
 
321
BOOT_BPP            equ 0x9000    ;byte   bits per pixel
339
BOOT_BPP            equ 0x9000    ;byte   bits per pixel
322
BOOT_PITCH          equ 0x9001    ;word   scanline length
340
BOOT_PITCH          equ 0x9001    ;word   scanline length
323
BOOT_VESA_MODE      equ 0x9008    ;word   vesa video mode
341
BOOT_VESA_MODE      equ 0x9008    ;word   vesa video mode
324
BOOT_X_RES          equ 0x900A    ;word   X res
342
BOOT_X_RES          equ 0x900A    ;word   X res
325
BOOT_Y_RES          equ 0x900C    ;word   Y res
343
BOOT_Y_RES          equ 0x900C    ;word   Y res
326
BOOT_BANK_SW        equ 0x9014    ;dword  Vesa 1.2 pm bank switch
344
BOOT_BANK_SW        equ 0x9014    ;dword  Vesa 1.2 pm bank switch
327
BOOT_LFB            equ 0x9018    ;dword  Vesa 2.0 LFB address
345
BOOT_LFB            equ 0x9018    ;dword  Vesa 2.0 LFB address
328
BOOT_MTRR           equ 0x901C    ;byte   0 or 1 : enable MTRR graphics acceleration
346
BOOT_MTRR           equ 0x901C    ;byte   0 or 1 : enable MTRR graphics acceleration
329
BOOT_LAUNCHER_START equ 0x901D    ;byte   (0 or 1) start the first app (right now it's LAUNCHER) after kernel is loaded?
347
BOOT_LAUNCHER_START equ 0x901D    ;byte   (0 or 1) start the first app (right now it's LAUNCHER) after kernel is loaded?
330
BOOT_DEBUG_PRINT    equ 0x901E    ;byte   If nonzero, duplicates debug output to the screen.
348
BOOT_DEBUG_PRINT    equ 0x901E    ;byte   If nonzero, duplicates debug output to the screen.
331
BOOT_DMA            equ 0x901F    ;byte   DMA write : 1=yes, 2=no
349
BOOT_DMA            equ 0x901F    ;byte   DMA write : 1=yes, 2=no
332
BOOT_PCI_DATA       equ 0x9020    ;8bytes pci data
350
BOOT_PCI_DATA       equ 0x9020    ;8bytes pci data
333
BOOT_SHUTDOWN_TYPE  equ 0x9030    ;byte   shutdown type (see sysfn 18.9)
351
BOOT_SHUTDOWN_TYPE  equ 0x9030    ;byte   shutdown type (see sysfn 18.9)
334
BOOT_MEM_AMOUNT     equ 0x9034    ;dword  memory amount
352
BOOT_MEM_AMOUNT     equ 0x9034    ;dword  memory amount
335
 
353
 
336
BOOT_APM_ENTRY      equ 0x9040
354
BOOT_APM_ENTRY      equ 0x9040
337
BOOT_APM_VERSION    equ 0x9044
355
BOOT_APM_VERSION    equ 0x9044
338
BOOT_APM_FLAGS      equ 0x9046
356
BOOT_APM_FLAGS      equ 0x9046
339
BOOT_APM_CODE_32    equ 0x9050
357
BOOT_APM_CODE_32    equ 0x9050
340
BOOT_APM_CODE_16    equ 0x9052
358
BOOT_APM_CODE_16    equ 0x9052
341
BOOT_APM_DATA_16    equ 0x9054
359
BOOT_APM_DATA_16    equ 0x9054
342
 
360
 
343
BOOT_BIOS_HD_CNT     equ 0x907F   ; byte   number of BIOS hard disks
361
BOOT_BIOS_HD_CNT     equ 0x907F   ; byte   number of BIOS hard disks
344
BOOT_BIOS_HD         equ 0x9080   ; Nbytes BIOS hard disks
362
BOOT_BIOS_HD         equ 0x9080   ; Nbytes BIOS hard disks
345
BOOT_MEMMAP_BLOCK_CNT equ 0x9100  ; word   available physical memory map: number of blocks
363
BOOT_MEMMAP_BLOCK_CNT equ 0x9100  ; word   available physical memory map: number of blocks
346
BOOT_MEMMAP_BLOCKS   equ 0x9104   ; available physical memory map: blocks, i.e. e820entry structs
364
BOOT_MEMMAP_BLOCKS   equ 0x9104   ; available physical memory map: blocks, i.e. e820entry structs
347
MAX_MEMMAP_BLOCKS   equ 32
365
MAX_MEMMAP_BLOCKS   equ 32
348
 
366
 
349
TMP_FILE_NAME       equ     0
367
TMP_FILE_NAME       equ     0
350
TMP_CMD_LINE        equ  1024
368
TMP_CMD_LINE        equ  1024
351
TMP_ICON_OFFS       equ  1280
369
TMP_ICON_OFFS       equ  1280
352
 
370
 
353
 
371
 
354
EVENT_REDRAW       equ 0x00000001
372
EVENT_REDRAW       equ 0x00000001
355
EVENT_KEY          equ 0x00000002
373
EVENT_KEY          equ 0x00000002
356
EVENT_BUTTON       equ 0x00000004
374
EVENT_BUTTON       equ 0x00000004
357
EVENT_BACKGROUND   equ 0x00000010
375
EVENT_BACKGROUND   equ 0x00000010
358
EVENT_MOUSE        equ 0x00000020
376
EVENT_MOUSE        equ 0x00000020
359
EVENT_IPC          equ 0x00000040
377
EVENT_IPC          equ 0x00000040
360
EVENT_NETWORK      equ 0x00000080
378
EVENT_NETWORK      equ 0x00000080
361
EVENT_DEBUG        equ 0x00000100
379
EVENT_DEBUG        equ 0x00000100
362
EVENT_NETWORK2     equ 0x00000200
380
EVENT_NETWORK2     equ 0x00000200
363
EVENT_EXTENDED     equ 0x00000400
381
EVENT_EXTENDED     equ 0x00000400
364
 
382
 
365
EV_INTR            equ 1
383
EV_INTR            equ 1
366
 
384
 
367
STDIN_FILENO       equ 0
385
STDIN_FILENO       equ 0
368
STDOUT_FILENO      equ 1
386
STDOUT_FILENO      equ 1
369
STDERR_FILENO      equ 2
387
STDERR_FILENO      equ 2
370
 
388
 
371
SYSTEM_SHUTDOWN    equ 2
389
SYSTEM_SHUTDOWN    equ 2
372
SYSTEM_REBOOT      equ 3
390
SYSTEM_REBOOT      equ 3
373
SYSTEM_RESTART     equ 4
391
SYSTEM_RESTART     equ 4
374
 
392
 
375
BLIT_CLIENT_RELATIVE equ 0x20000000
393
BLIT_CLIENT_RELATIVE equ 0x20000000
376
 
394
 
377
struct SYSCALL_STACK
395
struct SYSCALL_STACK
378
        _eip            dd ?
396
        _eip            dd ?
379
        _edi            dd ?    ;  +4
397
        _edi            dd ?    ;  +4
380
        _esi            dd ?    ;  +8
398
        _esi            dd ?    ;  +8
381
        _ebp            dd ?    ; +12
399
        _ebp            dd ?    ; +12
382
        _esp            dd ?    ; +16
400
        _esp            dd ?    ; +16
383
        _ebx            dd ?    ; +20
401
        _ebx            dd ?    ; +20
384
        _edx            dd ?    ; +24
402
        _edx            dd ?    ; +24
385
        _ecx            dd ?    ; +28
403
        _ecx            dd ?    ; +28
386
        _eax            dd ?    ; +32
404
        _eax            dd ?    ; +32
387
ends
405
ends
388
 
406
 
389
struct  LHEAD
407
struct  LHEAD
390
        next            dd ?   ;next object in list
408
        next            dd ?   ;next object in list
391
        prev            dd ?   ;prev object in list
409
        prev            dd ?   ;prev object in list
392
ends
410
ends
393
 
411
 
394
struct  MUTEX_WAITER
412
struct  MUTEX_WAITER
395
        list    LHEAD
413
        list    LHEAD
396
        task    dd ?
414
        task    dd ?
397
        type    dd ?
415
        type    dd ?
398
ends
416
ends
399
 
417
 
400
struct  MUTEX
418
struct  MUTEX
401
        wait_list       LHEAD
419
        wait_list       LHEAD
402
        count           dd ?
420
        count           dd ?
403
ends
421
ends
404
 
422
 
405
struct  RWSEM
423
struct  RWSEM
406
        wait_list       LHEAD
424
        wait_list       LHEAD
407
        count           dd ?
425
        count           dd ?
408
ends
426
ends
409
 
427
 
410
struct  FUTEX
428
struct  FUTEX
411
        list            LHEAD
429
        list            LHEAD
412
        magic           dd ?
430
        magic           dd ?
413
        handle          dd ?
431
        handle          dd ?
414
        destroy         dd ?
432
        destroy         dd ?
415
 
433
 
416
        wait_list       LHEAD
434
        wait_list       LHEAD
417
        pointer         dd ?
435
        pointer         dd ?
418
        flags           dd ?
436
        flags           dd ?
419
ends
437
ends
420
 
438
 
421
FUTEX_INIT      equ 0
439
FUTEX_INIT      equ 0
422
FUTEX_DESTROY   equ 1
440
FUTEX_DESTROY   equ 1
423
FUTEX_WAIT      equ 2
441
FUTEX_WAIT      equ 2
424
FUTEX_WAKE      equ 3
442
FUTEX_WAKE      equ 3
425
 
443
 
426
struct  FILED
444
struct  FILED
427
        list            LHEAD
445
        list            LHEAD
428
        magic           rd 1
446
        magic           rd 1
429
        handle          rd 1
447
        handle          rd 1
430
        destroy         rd 1
448
        destroy         rd 1
431
        mode            rd 1
449
        mode            rd 1
432
        file            rd 1
450
        file            rd 1
433
ends
451
ends
434
 
452
 
435
struct  PIPE
453
struct  PIPE
436
        pipe_ops        rd 1
454
        pipe_ops        rd 1
437
        buffer          rd 1
455
        buffer          rd 1
438
        readers         rd 1
456
        readers         rd 1
439
        writers         rd 1
457
        writers         rd 1
440
 
458
 
441
        pipe_lock       MUTEX
459
        pipe_lock       MUTEX
442
        count           rd 1
460
        count           rd 1
443
 
461
 
444
        read_end        rd 1
462
        read_end        rd 1
445
        write_end       rd 1
463
        write_end       rd 1
446
        rlist           LHEAD
464
        rlist           LHEAD
447
        wlist           LHEAD
465
        wlist           LHEAD
448
ends
466
ends
449
 
467
 
450
struct  PROC
468
struct  PROC
451
        list            LHEAD
469
        list            LHEAD
452
        thr_list        LHEAD
470
        thr_list        LHEAD
453
        heap_lock       MUTEX
471
        heap_lock       MUTEX
454
        heap_base       rd 1
472
        heap_base       rd 1
455
        heap_top        rd 1
473
        heap_top        rd 1
456
        mem_used        rd 1
474
        mem_used        rd 1
457
        dlls_list_ptr   rd 1
475
        dlls_list_ptr   rd 1
458
        pdt_0_phys      rd 1
476
        pdt_0_phys      rd 1
459
        pdt_1_phys      rd 1
477
        pdt_1_phys      rd 1
460
        io_map_0        rd 1
478
        io_map_0        rd 1
461
        io_map_1        rd 1
479
        io_map_1        rd 1
462
 
480
 
463
        ht_lock         rd 1
481
        ht_lock         rd 1
464
        ht_free         rd 1                ;htab[0] stdin
482
        ht_free         rd 1                ;htab[0] stdin
465
        ht_next         rd 1                ;htab[1] stdout
483
        ht_next         rd 1                ;htab[1] stdout
466
        htab            rd 1024-PROC.htab/4 ;htab[2] stderr
484
        htab            rd 1024-PROC.htab/4 ;htab[2] stderr
467
        pdt_0           rd 1024
485
        pdt_0           rd 1024
468
ends
486
ends
469
 
487
 
470
struct  DBG_REGS
488
struct  DBG_REGS
471
        dr0             dd ?
489
        dr0             dd ?
472
        dr1             dd ?
490
        dr1             dd ?
473
        dr2             dd ?
491
        dr2             dd ?
474
        dr3             dd ?
492
        dr3             dd ?
475
        dr7             dd ?
493
        dr7             dd ?
476
ends
494
ends
477
 
495
 
478
struct  POINT
496
struct  POINT
479
        x       dd ?
497
        x       dd ?
480
        y       dd ?
498
        y       dd ?
481
ends
499
ends
482
 
500
 
483
struct  RECT
501
struct  RECT
484
        left    dd ?
502
        left    dd ?
485
        top     dd ?
503
        top     dd ?
486
        right   dd ?
504
        right   dd ?
487
        bottom  dd ?
505
        bottom  dd ?
488
ends
506
ends
489
 
507
 
490
struct  BOX
508
struct  BOX
491
        left    dd ?
509
        left    dd ?
492
        top     dd ?
510
        top     dd ?
493
        width   dd ?
511
        width   dd ?
494
        height  dd ?
512
        height  dd ?
495
ends
513
ends
496
 
514
 
497
struct  APPDATA
515
struct  APPDATA
498
        app_name        rb 11
516
        app_name        rb 11
499
                        rb 5
517
                        rb 5
500
 
518
 
501
        list            LHEAD           ;+16
519
        list            LHEAD           ;+16
502
        process         dd ?            ;+24
520
        process         dd ?            ;+24
503
        fpu_state       dd ?            ;+28
521
        fpu_state       dd ?            ;+28
504
        exc_handler     dd ?            ;+32
522
        exc_handler     dd ?            ;+32
505
        except_mask     dd ?            ;+36
523
        except_mask     dd ?            ;+36
506
        pl0_stack       dd ?            ;+40
524
        pl0_stack       dd ?            ;+40
507
        cursor          dd ?            ;+44
525
        cursor          dd ?            ;+44
508
        fd_ev           dd ?            ;+48
526
        fd_ev           dd ?            ;+48
509
        bk_ev           dd ?            ;+52
527
        bk_ev           dd ?            ;+52
510
        fd_obj          dd ?            ;+56
528
        fd_obj          dd ?            ;+56
511
        bk_obj          dd ?            ;+60
529
        bk_obj          dd ?            ;+60
512
        saved_esp       dd ?            ;+64
530
        saved_esp       dd ?            ;+64
513
        io_map          rd 2            ;+68
531
        io_map          rd 2            ;+68
514
        dbg_state       dd ?            ;+76
532
        dbg_state       dd ?            ;+76
515
        cur_dir         dd ?            ;+80
533
        cur_dir         dd ?            ;+80
516
        wait_timeout    dd ?            ;+84
534
        wait_timeout    dd ?            ;+84
517
        saved_esp0      dd ?            ;+88
535
        saved_esp0      dd ?            ;+88
518
        wait_begin      dd ?            ;+92   +++
536
        wait_begin      dd ?            ;+92   +++
519
        wait_test       dd ?            ;+96   +++
537
        wait_test       dd ?            ;+96   +++
520
        wait_param      dd ?            ;+100  +++
538
        wait_param      dd ?            ;+100  +++
521
        tls_base        dd ?            ;+104
539
        tls_base        dd ?            ;+104
522
                        dd ?            ;+108
540
                        dd ?            ;+108
523
        event_filter    dd ?            ;+112
541
        event_filter    dd ?            ;+112
524
        draw_bgr_x      dd ?            ;+116
542
        draw_bgr_x      dd ?            ;+116
525
        draw_bgr_y      dd ?            ;+120
543
        draw_bgr_y      dd ?            ;+120
526
                        dd ?            ;+124
544
                        dd ?            ;+124
527
        wnd_shape       dd ?            ;+128
545
        wnd_shape       dd ?            ;+128
528
        wnd_shape_scale dd ?            ;+132
546
        wnd_shape_scale dd ?            ;+132
529
                        dd ?            ;+136
547
                        dd ?            ;+136
530
                        dd ?            ;+140
548
                        dd ?            ;+140
531
        saved_box       BOX             ;+144
549
        saved_box       BOX             ;+144
532
        ipc_start       dd ?            ;+160
550
        ipc_start       dd ?            ;+160
533
        ipc_size        dd ?            ;+164
551
        ipc_size        dd ?            ;+164
534
        event_mask      dd ?            ;+168
552
        event_mask      dd ?            ;+168
535
        debugger_slot   dd ?            ;+172
553
        debugger_slot   dd ?            ;+172
536
        terminate_protection dd ?       ;+176
554
        terminate_protection dd ?       ;+176
537
        keyboard_mode   db ?            ;+180
555
        keyboard_mode   db ?            ;+180
538
        captionEncoding db ?
556
        captionEncoding db ?
539
                        rb 2
557
                        rb 2
540
        exec_params     dd ?            ;+184
558
        exec_params     dd ?            ;+184
541
        dbg_event_mem   dd ?            ;+188
559
        dbg_event_mem   dd ?            ;+188
542
        dbg_regs        DBG_REGS        ;+192
560
        dbg_regs        DBG_REGS        ;+192
543
        wnd_caption     dd ?            ;+212
561
        wnd_caption     dd ?            ;+212
544
        wnd_clientbox   BOX             ;+216
562
        wnd_clientbox   BOX             ;+216
545
        priority        dd ?            ;+232
563
        priority        dd ?            ;+232
546
        in_schedule     LHEAD           ;+236
564
        in_schedule     LHEAD           ;+236
547
ends
565
ends
548
 
566
 
549
APP_OBJ_OFFSET  equ 48
567
APP_OBJ_OFFSET  equ 48
550
APP_EV_OFFSET   equ 40
568
APP_EV_OFFSET   equ 40
551
 
569
 
552
struct  TASKDATA
570
struct  TASKDATA
553
        event_mask      dd ?
571
        event_mask      dd ?
554
        pid             dd ?
572
        pid             dd ?
555
                        dw ?
573
                        dw ?
556
        state           db ?
574
        state           db ?
557
                        db ?
575
                        db ?
558
                        dw ?
576
                        dw ?
559
        wnd_number      db ?
577
        wnd_number      db ?
560
                        db ?
578
                        db ?
561
        mem_start       dd ?
579
        mem_start       dd ?
562
        counter_sum     dd ?
580
        counter_sum     dd ?
563
        counter_add     dd ?
581
        counter_add     dd ?
564
        cpu_usage       dd ?
582
        cpu_usage       dd ?
565
ends
583
ends
566
 
584
 
567
TSTATE_RUNNING        = 0
585
TSTATE_RUNNING        = 0
568
TSTATE_RUN_SUSPENDED  = 1
586
TSTATE_RUN_SUSPENDED  = 1
569
TSTATE_WAIT_SUSPENDED = 2
587
TSTATE_WAIT_SUSPENDED = 2
570
TSTATE_ZOMBIE         = 3
588
TSTATE_ZOMBIE         = 3
571
TSTATE_TERMINATING    = 4
589
TSTATE_TERMINATING    = 4
572
TSTATE_WAITING        = 5
590
TSTATE_WAITING        = 5
573
TSTATE_FREE           = 9
591
TSTATE_FREE           = 9
574
 
592
 
575
; constants definition
593
; constants definition
576
WSTATE_NORMAL    = 00000000b
594
WSTATE_NORMAL    = 00000000b
577
WSTATE_MAXIMIZED = 00000001b
595
WSTATE_MAXIMIZED = 00000001b
578
WSTATE_MINIMIZED = 00000010b
596
WSTATE_MINIMIZED = 00000010b
579
WSTATE_ROLLEDUP  = 00000100b
597
WSTATE_ROLLEDUP  = 00000100b
580
 
598
 
581
WSTATE_REDRAW    = 00000001b
599
WSTATE_REDRAW    = 00000001b
582
WSTATE_WNDDRAWN  = 00000010b
600
WSTATE_WNDDRAWN  = 00000010b
583
 
601
 
584
WSTYLE_HASCAPTION     = 00010000b
602
WSTYLE_HASCAPTION     = 00010000b
585
WSTYLE_CLIENTRELATIVE = 00100000b
603
WSTYLE_CLIENTRELATIVE = 00100000b
586
 
604
 
587
ZPOS_DESKTOP            = -2
605
ZPOS_DESKTOP            = -2
588
ZPOS_ALWAYS_BACK        = -1
606
ZPOS_ALWAYS_BACK        = -1
589
ZPOS_NORMAL             = 0
607
ZPOS_NORMAL             = 0
590
ZPOS_ALWAYS_TOP         = 1     ;ZPOS_ALWAYS_TOP is always last and has max number!
608
ZPOS_ALWAYS_TOP         = 1     ;ZPOS_ALWAYS_TOP is always last and has max number!
591
; structures definition
609
; structures definition
592
struct  WDATA
610
struct  WDATA
593
        box             BOX
611
        box             BOX
594
        cl_workarea     dd ?
612
        cl_workarea     dd ?
595
        cl_titlebar     dd ?
613
        cl_titlebar     dd ?
596
        cl_frames       dd ?
614
        cl_frames       dd ?
597
        z_modif         db ?
615
        z_modif         db ?
598
        fl_wstate       db ?
616
        fl_wstate       db ?
599
        fl_wdrawn       db ?
617
        fl_wdrawn       db ?
600
        fl_redraw       db ?
618
        fl_redraw       db ?
601
ends
619
ends
602
 
620
 
603
label WDATA.fl_wstyle byte at WDATA.cl_workarea + 3
621
label WDATA.fl_wstyle byte at WDATA.cl_workarea + 3
604
 
622
 
605
 
623
 
606
struct  SYS_VARS
624
struct  SYS_VARS
607
        bpp             dd ?
625
        bpp             dd ?
608
        scanline        dd ?
626
        scanline        dd ?
609
        vesa_mode       dd ?
627
        vesa_mode       dd ?
610
        x_res           dd ?
628
        x_res           dd ?
611
        y_res           dd ?
629
        y_res           dd ?
612
ends
630
ends
613
 
631
 
614
struct  APPOBJ                  ; common object header
632
struct  APPOBJ                  ; common object header
615
        magic           dd ?    ;
633
        magic           dd ?    ;
616
        destroy         dd ?    ; internal destructor
634
        destroy         dd ?    ; internal destructor
617
        fd              dd ?    ; next object in list
635
        fd              dd ?    ; next object in list
618
        bk              dd ?    ; prev object in list
636
        bk              dd ?    ; prev object in list
619
        pid             dd ?    ; owner id
637
        pid             dd ?    ; owner id
620
ends
638
ends
621
 
639
 
622
struct  CURSOR          APPOBJ
640
struct  CURSOR          APPOBJ
623
        base            dd ?   ;allocated memory
641
        base            dd ?   ;allocated memory
624
        hot_x           dd ?   ;hotspot coords
642
        hot_x           dd ?   ;hotspot coords
625
        hot_y           dd ?
643
        hot_y           dd ?
626
 
644
 
627
        list_next       dd ?   ;next cursor in cursor list
645
        list_next       dd ?   ;next cursor in cursor list
628
        list_prev       dd ?   ;prev cursor in cursor list
646
        list_prev       dd ?   ;prev cursor in cursor list
629
        dev_obj         dd ?   ;device depended data
647
        dev_obj         dd ?   ;device depended data
630
ends
648
ends
631
 
649
 
632
 
650
 
633
struct  EVENT           APPOBJ
651
struct  EVENT           APPOBJ
634
        id              dd ?   ;event uid
652
        id              dd ?   ;event uid
635
        state           dd ?   ;internal flags
653
        state           dd ?   ;internal flags
636
        code            dd ?
654
        code            dd ?
637
                        rd 5
655
                        rd 5
638
ends
656
ends
639
 
657
 
640
 
658
 
641
struct  SMEM
659
struct  SMEM
642
        bk              dd ?
660
        bk              dd ?
643
        fd              dd ?    ;+4
661
        fd              dd ?    ;+4
644
        base            dd ?    ;+8
662
        base            dd ?    ;+8
645
        size            dd ?    ;+12
663
        size            dd ?    ;+12
646
        access          dd ?    ;+16
664
        access          dd ?    ;+16
647
        refcount        dd ?    ;+20
665
        refcount        dd ?    ;+20
648
        name            rb 32   ;+24
666
        name            rb 32   ;+24
649
ends
667
ends
650
 
668
 
651
struct  SMAP            APPOBJ
669
struct  SMAP            APPOBJ
652
        base            dd ?   ;mapped base
670
        base            dd ?   ;mapped base
653
        parent          dd ?   ;SMEM
671
        parent          dd ?   ;SMEM
654
ends
672
ends
655
 
673
 
656
struct  DLLDESCR
674
struct  DLLDESCR
657
        bk              dd ?
675
        bk              dd ?
658
        fd              dd ?    ;+4
676
        fd              dd ?    ;+4
659
        data            dd ?    ;+8
677
        data            dd ?    ;+8
660
        size            dd ?    ;+12
678
        size            dd ?    ;+12
661
        timestamp       dq ?
679
        timestamp       dq ?
662
        refcount        dd ?
680
        refcount        dd ?
663
        defaultbase     dd ?
681
        defaultbase     dd ?
664
        coff_hdr        dd ?
682
        coff_hdr        dd ?
665
        symbols_ptr     dd ?
683
        symbols_ptr     dd ?
666
        symbols_num     dd ?
684
        symbols_num     dd ?
667
        symbols_lim     dd ?
685
        symbols_lim     dd ?
668
        exports         dd ?   ;export table
686
        exports         dd ?   ;export table
669
        name            rb 260
687
        name            rb 260
670
ends
688
ends
671
 
689
 
672
struct  HDLL
690
struct  HDLL
673
        fd              dd ?   ;next object in list
691
        fd              dd ?   ;next object in list
674
        bk              dd ?   ;prev object in list
692
        bk              dd ?   ;prev object in list
675
        pid             dd ?   ;owner id
693
        pid             dd ?   ;owner id
676
 
694
 
677
        base            dd ?   ;mapped base
695
        base            dd ?   ;mapped base
678
        size            dd ?   ;mapped size
696
        size            dd ?   ;mapped size
679
        refcount        dd ?   ;reference counter for this process and this lib
697
        refcount        dd ?   ;reference counter for this process and this lib
680
        parent          dd ?   ;DLLDESCR
698
        parent          dd ?   ;DLLDESCR
681
ends
699
ends
682
 
700
 
683
 
701
 
684
struct  BOOT_DATA
702
struct  BOOT_DATA
685
        bpp             dd ?
703
        bpp             dd ?
686
        scanline        dd ?
704
        scanline        dd ?
687
        vesa_mode       dd ?
705
        vesa_mode       dd ?
688
        x_res           dd ?
706
        x_res           dd ?
689
        y_res           dd ?
707
        y_res           dd ?
690
        mouse_port      dd ?
708
        mouse_port      dd ?
691
        bank_switch     dd ?
709
        bank_switch     dd ?
692
        lfb             dd ?
710
        lfb             dd ?
693
        vesa_mem        dd ?
711
        vesa_mem        dd ?
694
        log             dd ?
712
        log             dd ?
695
        direct_lfb      dd ?
713
        direct_lfb      dd ?
696
        pci_data        dd ?
714
        pci_data        dd ?
697
                        dd ?
715
                        dd ?
698
        ide_base        dd ?
716
        ide_base        dd ?
699
        mem_amount      dd ?
717
        mem_amount      dd ?
700
        pages_count     dd ?
718
        pages_count     dd ?
701
        pagemap_size    dd ?
719
        pagemap_size    dd ?
702
        kernel_max      dd ?
720
        kernel_max      dd ?
703
        kernel_pages    dd ?
721
        kernel_pages    dd ?
704
        kernel_tables   dd ?
722
        kernel_tables   dd ?
705
 
723
 
706
        cpu_vendor      dd ?
724
        cpu_vendor      dd ?
707
                        dd ?
725
                        dd ?
708
                        dd ?
726
                        dd ?
709
        cpu_sign        dd ?
727
        cpu_sign        dd ?
710
        cpu_info        dd ?
728
        cpu_info        dd ?
711
        cpu_caps        dd ?
729
        cpu_caps        dd ?
712
                        dd ?
730
                        dd ?
713
                        dd ?
731
                        dd ?
714
ends
732
ends
715
 
733
 
716
struct  display_t
734
struct  display_t
717
        x               dd ?
735
        x               dd ?
718
        y               dd ?
736
        y               dd ?
719
        width           dd ?
737
        width           dd ?
720
        height          dd ?
738
        height          dd ?
721
        bits_per_pixel  dd ?
739
        bits_per_pixel  dd ?
722
        vrefresh        dd ?
740
        vrefresh        dd ?
723
        current_lfb     dd ?
741
        current_lfb     dd ?
724
        lfb_pitch       dd ?
742
        lfb_pitch       dd ?
725
 
743
 
726
        win_map_lock    RWSEM
744
        win_map_lock    RWSEM
727
        win_map         dd ?
745
        win_map         dd ?
728
        win_map_pitch   dd ?
746
        win_map_pitch   dd ?
729
        win_map_size    dd ?
747
        win_map_size    dd ?
730
 
748
 
731
        modes           dd ?
749
        modes           dd ?
732
        ddev            dd ?
750
        ddev            dd ?
733
        connector       dd ?
751
        connector       dd ?
734
        crtc            dd ?
752
        crtc            dd ?
735
 
753
 
736
        cr_list.next    dd ?
754
        cr_list.next    dd ?
737
        cr_list.prev    dd ?
755
        cr_list.prev    dd ?
738
 
756
 
739
        cursor          dd ?
757
        cursor          dd ?
740
 
758
 
741
        init_cursor     dd ?
759
        init_cursor     dd ?
742
        select_cursor   dd ?
760
        select_cursor   dd ?
743
        show_cursor     dd ?
761
        show_cursor     dd ?
744
        move_cursor     dd ?
762
        move_cursor     dd ?
745
        restore_cursor  dd ?
763
        restore_cursor  dd ?
746
        disable_mouse   dd ?
764
        disable_mouse   dd ?
747
        mask_seqno      dd ?
765
        mask_seqno      dd ?
748
        check_mouse     dd ?
766
        check_mouse     dd ?
749
        check_m_pixel   dd ?
767
        check_m_pixel   dd ?
750
 
768
 
751
        bytes_per_pixel dd ?
769
        bytes_per_pixel dd ?
752
ends
770
ends
753
 
771
 
754
struct  DISPMODE
772
struct  DISPMODE
755
        width   dw ?
773
        width   dw ?
756
        height  dw ?
774
        height  dw ?
757
        bpp     dw ?
775
        bpp     dw ?
758
        freq    dw ?
776
        freq    dw ?
759
ends
777
ends
760
 
778
 
761
 
779
 
762
struct  PCIDEV
780
struct  PCIDEV
763
        bk              dd ?
781
        bk              dd ?
764
        fd              dd ?
782
        fd              dd ?
765
        vendor_device_id dd ?
783
        vendor_device_id dd ?
766
        class           dd ?
784
        class           dd ?
767
        devfn           db ?
785
        devfn           db ?
768
        bus             db ?
786
        bus             db ?
769
                        rb 2
787
                        rb 2
770
        owner           dd ? ; pointer to SRV or 0
788
        owner           dd ? ; pointer to SRV or 0
771
ends
789
ends
772
 
790
 
773
struct  IDE_DATA
791
struct  IDE_DATA
774
        ProgrammingInterface dd ?
792
        ProgrammingInterface dd ?
775
        Interrupt            dw ?
793
        Interrupt            dw ?
776
        RegsBaseAddres       dw ?
794
        RegsBaseAddres       dw ?
777
        BAR0_val             dw ?
795
        BAR0_val             dw ?
778
        BAR1_val             dw ?
796
        BAR1_val             dw ?
779
        BAR2_val             dw ?
797
        BAR2_val             dw ?
780
        BAR3_val             dw ?
798
        BAR3_val             dw ?
781
        dma_hdd_channel_1    db ?
799
        dma_hdd_channel_1    db ?
782
        dma_hdd_channel_2    db ?
800
        dma_hdd_channel_2    db ?
783
        pcidev               dd ?       ; pointer to corresponding PCIDEV structure
801
        pcidev               dd ?       ; pointer to corresponding PCIDEV structure
784
ends
802
ends
785
 
803
 
786
struct  IDE_CACHE
804
struct  IDE_CACHE
787
        pointer              dd ?
805
        pointer              dd ?
788
        size                 dd ?   ; not use
806
        size                 dd ?   ; not use
789
        data_pointer         dd ?
807
        data_pointer         dd ?
790
        system_data_size     dd ?   ; not use
808
        system_data_size     dd ?   ; not use
791
        appl_data_size       dd ?   ; not use
809
        appl_data_size       dd ?   ; not use
792
        system_data          dd ?
810
        system_data          dd ?
793
        appl_data            dd ?
811
        appl_data            dd ?
794
        system_sad_size      dd ?
812
        system_sad_size      dd ?
795
        appl_sad_size        dd ?
813
        appl_sad_size        dd ?
796
        search_start         dd ?
814
        search_start         dd ?
797
        appl_search_start    dd ?
815
        appl_search_start    dd ?
798
ends
816
ends
799
 
817
 
800
struct  IDE_DEVICE
818
struct  IDE_DEVICE
801
        UDMA_possible_modes  db ?
819
        UDMA_possible_modes  db ?
802
        UDMA_set_mode        db ?
820
        UDMA_set_mode        db ?
803
ends
821
ends
804
 
822
 
805
; The following macro assume that we are on uniprocessor machine.
823
; The following macro assume that we are on uniprocessor machine.
806
; Serious work is needed for multiprocessor machines.
824
; Serious work is needed for multiprocessor machines.
807
macro spin_lock_irqsave spinlock
825
macro spin_lock_irqsave spinlock
808
{
826
{
809
        pushf
827
        pushf
810
        cli
828
        cli
811
}
829
}
812
macro spin_unlock_irqrestore spinlock
830
macro spin_unlock_irqrestore spinlock
813
{
831
{
814
        popf
832
        popf
815
}
833
}
816
macro spin_lock_irq spinlock
834
macro spin_lock_irq spinlock
817
{
835
{
818
        cli
836
        cli
819
}
837
}
820
macro spin_unlock_irq spinlock
838
macro spin_unlock_irq spinlock
821
{
839
{
822
        sti
840
        sti
823
}
841
}
824
 
842
 
825
struct  MEM_STATE
843
struct  MEM_STATE
826
        mutex           MUTEX
844
        mutex           MUTEX
827
        smallmap        dd ?
845
        smallmap        dd ?
828
        treemap         dd ?
846
        treemap         dd ?
829
        topsize         dd ?
847
        topsize         dd ?
830
        top             dd ?
848
        top             dd ?
831
        smallbins       rd 4*32
849
        smallbins       rd 4*32
832
        treebins        rd 32
850
        treebins        rd 32
833
ends
851
ends
834
 
852
 
835
struct  PG_DATA
853
struct  PG_DATA
836
        mem_amount      dd ?
854
        mem_amount      dd ?
837
        vesa_mem        dd ?
855
        vesa_mem        dd ?
838
        pages_count     dd ?
856
        pages_count     dd ?
839
        pages_free      dd ?
857
        pages_free      dd ?
840
        pages_faults    dd ?
858
        pages_faults    dd ?
841
        pagemap_size    dd ?
859
        pagemap_size    dd ?
842
        kernel_pages    dd ?
860
        kernel_pages    dd ?
843
        kernel_tables   dd ?
861
        kernel_tables   dd ?
844
        sys_page_dir    dd ?
862
        sys_page_dir    dd ?
845
        mutex           MUTEX
863
        mutex           MUTEX
846
ends
864
ends
847
 
865
 
848
struct  SRV
866
struct  SRV
849
        srv_name        rb 16    ;ASCIIZ string
867
        srv_name        rb 16    ;ASCIIZ string
850
        magic           dd ?     ;+0x10 ;'SRV '
868
        magic           dd ?     ;+0x10 ;'SRV '
851
        size            dd ?     ;+0x14 ;size of structure SRV
869
        size            dd ?     ;+0x14 ;size of structure SRV
852
        fd              dd ?     ;+0x18 ;next SRV descriptor
870
        fd              dd ?     ;+0x18 ;next SRV descriptor
853
        bk              dd ?     ;+0x1C ;prev SRV descriptor
871
        bk              dd ?     ;+0x1C ;prev SRV descriptor
854
        base            dd ?     ;+0x20 ;service base address
872
        base            dd ?     ;+0x20 ;service base address
855
        entry           dd ?     ;+0x24 ;service START function
873
        entry           dd ?     ;+0x24 ;service START function
856
        srv_proc        dd ?     ;+0x28 ;user mode service handler
874
        srv_proc        dd ?     ;+0x28 ;user mode service handler
857
        srv_proc_ex     dd ?     ;+0x2C ;kernel mode service handler
875
        srv_proc_ex     dd ?     ;+0x2C ;kernel mode service handler
858
ends
876
ends
859
 
877
 
860
struct USBSRV
878
struct USBSRV
861
        srv             SRV
879
        srv             SRV
862
        usb_func        dd ?
880
        usb_func        dd ?
863
ends
881
ends
864
 
882
 
865
struct USBFUNC
883
struct USBFUNC
866
        strucsize       dd ?
884
        strucsize       dd ?
867
        add_device      dd ?
885
        add_device      dd ?
868
        device_disconnect dd ?
886
        device_disconnect dd ?
869
ends
887
ends
870
 
888
 
871
DRV_ENTRY    equ  1
889
DRV_ENTRY    equ  1
872
DRV_EXIT     equ -1
890
DRV_EXIT     equ -1
873
 
891
 
874
struct  COFF_HEADER
892
struct  COFF_HEADER
875
        machine         dw ?
893
        machine         dw ?
876
        nSections       dw ?
894
        nSections       dw ?
877
        DataTime        dd ?
895
        DataTime        dd ?
878
        pSymTable       dd ?
896
        pSymTable       dd ?
879
        nSymbols        dd ?
897
        nSymbols        dd ?
880
        optHeader       dw ?
898
        optHeader       dw ?
881
        flags           dw ?
899
        flags           dw ?
882
ends
900
ends
883
 
901
 
884
struct  COFF_SECTION
902
struct  COFF_SECTION
885
        Name            rb 8
903
        Name            rb 8
886
        VirtualSize     dd ?
904
        VirtualSize     dd ?
887
        VirtualAddress  dd ?
905
        VirtualAddress  dd ?
888
        SizeOfRawData   dd ?
906
        SizeOfRawData   dd ?
889
        PtrRawData      dd ?
907
        PtrRawData      dd ?
890
        PtrReloc        dd ?
908
        PtrReloc        dd ?
891
        PtrLinenumbers  dd ?
909
        PtrLinenumbers  dd ?
892
        NumReloc        dw ?
910
        NumReloc        dw ?
893
        NumLinenum      dw ?
911
        NumLinenum      dw ?
894
        Characteristics dd ?
912
        Characteristics dd ?
895
ends
913
ends
896
 
914
 
897
struct  COFF_RELOC
915
struct  COFF_RELOC
898
        VirtualAddress  dd ?
916
        VirtualAddress  dd ?
899
        SymIndex        dd ?
917
        SymIndex        dd ?
900
        Type            dw ?
918
        Type            dw ?
901
ends
919
ends
902
 
920
 
903
struct  COFF_SYM
921
struct  COFF_SYM
904
        Name            rb 8
922
        Name            rb 8
905
        Value           dd ?
923
        Value           dd ?
906
        SectionNumber   dw ?
924
        SectionNumber   dw ?
907
        Type            dw ?
925
        Type            dw ?
908
        StorageClass    db ?
926
        StorageClass    db ?
909
        NumAuxSymbols   db ?
927
        NumAuxSymbols   db ?
910
ends
928
ends
911
 
929
 
912
struct  STRIPPED_PE_HEADER
930
struct  STRIPPED_PE_HEADER
913
        Signature           dw ?
931
        Signature           dw ?
914
        Characteristics     dw ?
932
        Characteristics     dw ?
915
        AddressOfEntryPoint dd ?
933
        AddressOfEntryPoint dd ?
916
        ImageBase           dd ?
934
        ImageBase           dd ?
917
        SectionAlignmentLog db ?
935
        SectionAlignmentLog db ?
918
        FileAlignmentLog    db ?
936
        FileAlignmentLog    db ?
919
        MajorOSVersion      db ?
937
        MajorOSVersion      db ?
920
        MinorOSVersion      db ?
938
        MinorOSVersion      db ?
921
        SizeOfImage         dd ?
939
        SizeOfImage         dd ?
922
        SizeOfStackReserve  dd ?
940
        SizeOfStackReserve  dd ?
923
        SizeOfHeapReserve   dd ?
941
        SizeOfHeapReserve   dd ?
924
        SizeOfHeaders       dd ?
942
        SizeOfHeaders       dd ?
925
        Subsystem           db ?
943
        Subsystem           db ?
926
        NumberOfRvaAndSizes db ?
944
        NumberOfRvaAndSizes db ?
927
        NumberOfSections    dw ?
945
        NumberOfSections    dw ?
928
ends
946
ends
929
STRIPPED_PE_SIGNATURE = 0x4503 ; 'PE' xor 'S'
947
STRIPPED_PE_SIGNATURE = 0x4503 ; 'PE' xor 'S'
930
SPE_DIRECTORY_IMPORT    = 0
948
SPE_DIRECTORY_IMPORT    = 0
931
SPE_DIRECTORY_EXPORT    = 1
949
SPE_DIRECTORY_EXPORT    = 1
932
SPE_DIRECTORY_BASERELOC = 2
950
SPE_DIRECTORY_BASERELOC = 2
933
 
951
 
934
struct  IOCTL
952
struct  IOCTL
935
        handle          dd ?
953
        handle          dd ?
936
        io_code         dd ?
954
        io_code         dd ?
937
        input           dd ?
955
        input           dd ?
938
        inp_size        dd ?
956
        inp_size        dd ?
939
        output          dd ?
957
        output          dd ?
940
        out_size        dd ?
958
        out_size        dd ?
941
ends
959
ends
942
 
960
 
943
struct  IRQH
961
struct  IRQH
944
        list            LHEAD
962
        list            LHEAD
945
        handler         dd ?   ;handler roututine
963
        handler         dd ?   ;handler roututine
946
        data            dd ?   ;user-specific data
964
        data            dd ?   ;user-specific data
947
        num_ints        dd ?   ;how many times handled
965
        num_ints        dd ?   ;how many times handled
948
ends
966
ends
949
 
967
 
950
struct DQ
968
struct DQ
951
        lo dd ?
969
        lo dd ?
952
        hi dd ?
970
        hi dd ?
953
ends
971
ends
954
 
972
 
955
struct e820entry
973
struct e820entry
956
        addr DQ ?
974
        addr DQ ?
957
        size DQ ?
975
        size DQ ?
958
        type dd ?
976
        type dd ?
959
ends
977
ends
960
 
978
 
961
;;;;;;;;;;;boot>
979
;;;;;;;;;;;boot>
962
 
980
 
963
;;;;;;;;;;;boot>
981
;;;;;;;;;;;boot>
964
 
982
 
965
;;;;;;;;;;;boot>
983
;;;;;;;;;;;boot>
966
 
984
 
967
;;;;;;;;;;;boot>
985
;;;;;;;;;;;boot>
968
 
986
 
969
;;;;;;;;;;;boot>
987
;;;;;;;;;;;boot>
970
 
988
 
971
;;;;;;;;;;;boot>
989
;;;;;;;;;;;boot>