Rev 5343 | Rev 5356 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5343 | Rev 5351 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2014. 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: 5343 $ |
8 | $Revision: 5351 $ |
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 | ; |
81 | ; |
82 | ;reserved |
82 | ;reserved |
83 | ; |
83 | ; |
84 | ;ext edx /ecx |
84 | ;ext edx /ecx |
85 | CAPS_SYSCAL equ 64 ; |
85 | CAPS_SYSCAL equ 64 ; |
86 | CAPS_XD equ 65 ;execution disable |
86 | CAPS_XD equ 65 ;execution disable |
87 | CAPS_FFXSR equ 66 ; |
87 | CAPS_FFXSR equ 66 ; |
88 | CAPS_RDTSCP equ 67 ; |
88 | CAPS_RDTSCP equ 67 ; |
89 | CAPS_X64 equ 68 ; |
89 | CAPS_X64 equ 68 ; |
90 | CAPS_3DNOW equ 69 ; |
90 | CAPS_3DNOW equ 69 ; |
91 | CAPS_3DNOWEXT equ 70 ; |
91 | CAPS_3DNOWEXT equ 70 ; |
92 | CAPS_LAHF equ 71 ; |
92 | CAPS_LAHF equ 71 ; |
93 | CAPS_CMP_LEG equ 72 ; |
93 | CAPS_CMP_LEG equ 72 ; |
94 | CAPS_SVM equ 73 ;secure virual machine |
94 | CAPS_SVM equ 73 ;secure virual machine |
95 | CAPS_ALTMOVCR8 equ 74 ; |
95 | CAPS_ALTMOVCR8 equ 74 ; |
96 | 96 | ||
97 | ; CPU MSR names |
97 | ; CPU MSR names |
98 | MSR_SYSENTER_CS equ 0x174 |
98 | MSR_SYSENTER_CS equ 0x174 |
99 | MSR_SYSENTER_ESP equ 0x175 |
99 | MSR_SYSENTER_ESP equ 0x175 |
100 | MSR_SYSENTER_EIP equ 0x176 |
100 | MSR_SYSENTER_EIP equ 0x176 |
101 | MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register |
101 | MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register |
102 | MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register |
102 | MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register |
103 | 103 | ||
104 | CR0_PE equ 0x00000001 ;protected mode |
104 | CR0_PE equ 0x00000001 ;protected mode |
105 | CR0_MP equ 0x00000002 ;monitor fpu |
105 | CR0_MP equ 0x00000002 ;monitor fpu |
106 | CR0_EM equ 0x00000004 ;fpu emulation |
106 | CR0_EM equ 0x00000004 ;fpu emulation |
107 | CR0_TS equ 0x00000008 ;task switch |
107 | CR0_TS equ 0x00000008 ;task switch |
108 | CR0_ET equ 0x00000010 ;extension type hardcoded to 1 |
108 | CR0_ET equ 0x00000010 ;extension type hardcoded to 1 |
109 | CR0_NE equ 0x00000020 ;numeric error |
109 | CR0_NE equ 0x00000020 ;numeric error |
110 | CR0_WP equ 0x00010000 ;write protect |
110 | CR0_WP equ 0x00010000 ;write protect |
111 | CR0_AM equ 0x00040000 ;alignment check |
111 | CR0_AM equ 0x00040000 ;alignment check |
112 | CR0_NW equ 0x20000000 ;not write-through |
112 | CR0_NW equ 0x20000000 ;not write-through |
113 | CR0_CD equ 0x40000000 ;cache disable |
113 | CR0_CD equ 0x40000000 ;cache disable |
114 | CR0_PG equ 0x80000000 ;paging |
114 | CR0_PG equ 0x80000000 ;paging |
115 | 115 | ||
116 | 116 | ||
117 | CR4_VME equ 0x0001 |
117 | CR4_VME equ 0x0001 |
118 | CR4_PVI equ 0x0002 |
118 | CR4_PVI equ 0x0002 |
119 | CR4_TSD equ 0x0004 |
119 | CR4_TSD equ 0x0004 |
120 | CR4_DE equ 0x0008 |
120 | CR4_DE equ 0x0008 |
121 | CR4_PSE equ 0x0010 |
121 | CR4_PSE equ 0x0010 |
122 | CR4_PAE equ 0x0020 |
122 | CR4_PAE equ 0x0020 |
123 | CR4_MCE equ 0x0040 |
123 | CR4_MCE equ 0x0040 |
124 | CR4_PGE equ 0x0080 |
124 | CR4_PGE equ 0x0080 |
125 | CR4_PCE equ 0x0100 |
125 | CR4_PCE equ 0x0100 |
126 | CR4_OSFXSR equ 0x0200 |
126 | CR4_OSFXSR equ 0x0200 |
127 | CR4_OSXMMEXPT equ 0x0400 |
127 | CR4_OSXMMEXPT equ 0x0400 |
128 | 128 | ||
129 | SSE_IE equ 0x0001 |
129 | SSE_IE equ 0x0001 |
130 | SSE_DE equ 0x0002 |
130 | SSE_DE equ 0x0002 |
131 | SSE_ZE equ 0x0004 |
131 | SSE_ZE equ 0x0004 |
132 | SSE_OE equ 0x0008 |
132 | SSE_OE equ 0x0008 |
133 | SSE_UE equ 0x0010 |
133 | SSE_UE equ 0x0010 |
134 | SSE_PE equ 0x0020 |
134 | SSE_PE equ 0x0020 |
135 | SSE_DAZ equ 0x0040 |
135 | SSE_DAZ equ 0x0040 |
136 | SSE_IM equ 0x0080 |
136 | SSE_IM equ 0x0080 |
137 | SSE_DM equ 0x0100 |
137 | SSE_DM equ 0x0100 |
138 | SSE_ZM equ 0x0200 |
138 | SSE_ZM equ 0x0200 |
139 | SSE_OM equ 0x0400 |
139 | SSE_OM equ 0x0400 |
140 | SSE_UM equ 0x0800 |
140 | SSE_UM equ 0x0800 |
141 | SSE_PM equ 0x1000 |
141 | SSE_PM equ 0x1000 |
142 | SSE_FZ equ 0x8000 |
142 | SSE_FZ equ 0x8000 |
143 | 143 | ||
144 | SSE_INIT equ (SSE_IM+SSE_DM+SSE_ZM+SSE_OM+SSE_UM+SSE_PM) |
144 | SSE_INIT equ (SSE_IM+SSE_DM+SSE_ZM+SSE_OM+SSE_UM+SSE_PM) |
145 | 145 | ||
146 | IRQ_PIC equ 0 |
146 | IRQ_PIC equ 0 |
147 | IRQ_APIC equ 1 |
147 | IRQ_APIC equ 1 |
148 | 148 | ||
149 | struct TSS |
149 | struct TSS |
150 | _back rw 2 |
150 | _back rw 2 |
151 | _esp0 rd 1 |
151 | _esp0 rd 1 |
152 | _ss0 rw 2 |
152 | _ss0 rw 2 |
153 | _esp1 rd 1 |
153 | _esp1 rd 1 |
154 | _ss1 rw 2 |
154 | _ss1 rw 2 |
155 | _esp2 rd 1 |
155 | _esp2 rd 1 |
156 | _ss2 rw 2 |
156 | _ss2 rw 2 |
157 | _cr3 rd 1 |
157 | _cr3 rd 1 |
158 | _eip rd 1 |
158 | _eip rd 1 |
159 | _eflags rd 1 |
159 | _eflags rd 1 |
160 | _eax rd 1 |
160 | _eax rd 1 |
161 | _ecx rd 1 |
161 | _ecx rd 1 |
162 | _edx rd 1 |
162 | _edx rd 1 |
163 | _ebx rd 1 |
163 | _ebx rd 1 |
164 | _esp rd 1 |
164 | _esp rd 1 |
165 | _ebp rd 1 |
165 | _ebp rd 1 |
166 | _esi rd 1 |
166 | _esi rd 1 |
167 | _edi rd 1 |
167 | _edi rd 1 |
168 | _es rw 2 |
168 | _es rw 2 |
169 | _cs rw 2 |
169 | _cs rw 2 |
170 | _ss rw 2 |
170 | _ss rw 2 |
171 | _ds rw 2 |
171 | _ds rw 2 |
172 | _fs rw 2 |
172 | _fs rw 2 |
173 | _gs rw 2 |
173 | _gs rw 2 |
174 | _ldt rw 2 |
174 | _ldt rw 2 |
175 | _trap rw 1 |
175 | _trap rw 1 |
176 | _io rw 1 |
176 | _io rw 1 |
177 | rb 24 |
177 | rb 24 |
178 | _io_map_0 rb 4096 |
178 | _io_map_0 rb 4096 |
179 | _io_map_1 rb 4096 |
179 | _io_map_1 rb 4096 |
180 | ends |
180 | ends |
181 | 181 | ||
182 | DRIVE_DATA_SIZE equ 16 |
182 | DRIVE_DATA_SIZE equ 16 |
183 | 183 | ||
184 | OS_BASE equ 0x80000000 |
184 | OS_BASE equ 0x80000000 |
185 | 185 | ||
186 | window_data equ (OS_BASE+0x0001000) |
186 | window_data equ (OS_BASE+0x0001000) |
187 | 187 | ||
188 | CURRENT_TASK equ (OS_BASE+0x0003000) |
188 | CURRENT_TASK equ (OS_BASE+0x0003000) |
189 | TASK_COUNT equ (OS_BASE+0x0003004) |
189 | TASK_COUNT equ (OS_BASE+0x0003004) |
190 | TASK_BASE equ (OS_BASE+0x0003010) |
190 | TASK_BASE equ (OS_BASE+0x0003010) |
191 | TASK_DATA equ (OS_BASE+0x0003020) |
191 | TASK_DATA equ (OS_BASE+0x0003020) |
192 | TASK_EVENT equ (OS_BASE+0x0003020) |
192 | TASK_EVENT equ (OS_BASE+0x0003020) |
193 | 193 | ||
194 | CDDataBuf equ (OS_BASE+0x0005000) |
194 | CDDataBuf equ (OS_BASE+0x0005000) |
195 | 195 | ||
196 | ;unused 0x6000 - 0x8fff |
196 | ;unused 0x6000 - 0x8fff |
197 | 197 | ||
198 | BOOT_VARS equ (OS_BASE) ;0x9000 |
198 | BOOT_VARS equ (OS_BASE) ;0x9000 |
199 | 199 | ||
200 | idts equ (OS_BASE+0x000B100) |
200 | idts equ (OS_BASE+0x000B100) |
201 | WIN_STACK equ (OS_BASE+0x000C000) |
201 | WIN_STACK equ (OS_BASE+0x000C000) |
202 | WIN_POS equ (OS_BASE+0x000C400) |
202 | WIN_POS equ (OS_BASE+0x000C400) |
203 | FDD_BUFF equ (OS_BASE+0x000D000) ;512 |
203 | FDD_BUFF equ (OS_BASE+0x000D000) ;512 |
204 | 204 | ||
205 | WIN_TEMP_XY equ (OS_BASE+0x000F300) |
205 | WIN_TEMP_XY equ (OS_BASE+0x000F300) |
206 | KEY_COUNT equ (OS_BASE+0x000F400) |
206 | KEY_COUNT equ (OS_BASE+0x000F400) |
207 | KEY_BUFF equ (OS_BASE+0x000F401) ; 120*2 + 2*2 = 244 bytes, actually 255 bytes |
207 | KEY_BUFF equ (OS_BASE+0x000F401) ; 120*2 + 2*2 = 244 bytes, actually 255 bytes |
208 | 208 | ||
209 | BTN_COUNT equ (OS_BASE+0x000F500) |
209 | BTN_COUNT equ (OS_BASE+0x000F500) |
210 | BTN_BUFF equ (OS_BASE+0x000F501) |
210 | BTN_BUFF equ (OS_BASE+0x000F501) |
211 | 211 | ||
212 | 212 | ||
213 | BTN_ADDR equ (OS_BASE+0x000FE88) |
213 | BTN_ADDR equ (OS_BASE+0x000FE88) |
214 | MEM_AMOUNT equ (OS_BASE+0x000FE8C) |
214 | MEM_AMOUNT equ (OS_BASE+0x000FE8C) |
215 | 215 | ||
216 | SYS_SHUTDOWN equ (OS_BASE+0x000FF00) |
216 | SYS_SHUTDOWN equ (OS_BASE+0x000FF00) |
217 | TASK_ACTIVATE equ (OS_BASE+0x000FF01) |
217 | TASK_ACTIVATE equ (OS_BASE+0x000FF01) |
218 | 218 | ||
219 | 219 | ||
220 | TMP_STACK_TOP equ 0x006CC00 |
220 | TMP_STACK_TOP equ 0x006CC00 |
221 | 221 | ||
222 | sys_proc equ (OS_BASE+0x006F000) |
222 | sys_proc equ (OS_BASE+0x006F000) |
223 | 223 | ||
224 | SLOT_BASE equ (OS_BASE+0x0080000) |
224 | SLOT_BASE equ (OS_BASE+0x0080000) |
225 | 225 | ||
226 | VGABasePtr equ (OS_BASE+0x00A0000) |
226 | VGABasePtr equ (OS_BASE+0x00A0000) |
227 | 227 | ||
228 | CLEAN_ZONE equ (_CLEAN_ZONE-OS_BASE) |
228 | CLEAN_ZONE equ (_CLEAN_ZONE-OS_BASE) |
229 | IDE_DMA equ (_IDE_DMA-OS_BASE) |
229 | IDE_DMA equ (_IDE_DMA-OS_BASE) |
230 | 230 | ||
231 | UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000) |
231 | UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000) |
232 | 232 | ||
233 | virtual at (OS_BASE+0x05FFF80) |
233 | virtual at (OS_BASE+0x05FFF80) |
234 | tss TSS |
234 | tss TSS |
235 | end virtual |
235 | end virtual |
236 | 236 | ||
237 | HEAP_BASE equ (OS_BASE+0x0800000) |
237 | HEAP_BASE equ (OS_BASE+0x0800000) |
238 | HEAP_MIN_SIZE equ 0x01000000 |
238 | HEAP_MIN_SIZE equ 0x01000000 |
239 | 239 | ||
240 | page_tabs equ 0xFDC00000 |
240 | page_tabs equ 0xFDC00000 |
241 | app_page_tabs equ 0xFDC00000 |
241 | app_page_tabs equ 0xFDC00000 |
242 | kernel_tabs equ (page_tabs+ (OS_BASE shr 10)) ;0xFDE00000 |
242 | kernel_tabs equ (page_tabs+ (OS_BASE shr 10)) ;0xFDE00000 |
243 | master_tab equ (page_tabs+ (page_tabs shr 10)) ;0xFDFF70000 |
243 | master_tab equ (page_tabs+ (page_tabs shr 10)) ;0xFDFF70000 |
244 | 244 | ||
245 | LFB_BASE equ 0xFE000000 |
245 | LFB_BASE equ 0xFE000000 |
246 | 246 | ||
247 | 247 | ||
248 | new_app_base equ 0; |
248 | new_app_base equ 0; |
249 | 249 | ||
250 | twdw equ 0x2000 ;(CURRENT_TASK-window_data) |
250 | twdw equ 0x2000 ;(CURRENT_TASK-window_data) |
251 | 251 | ||
252 | std_application_base_address equ new_app_base |
252 | std_application_base_address equ new_app_base |
253 | RING0_STACK_SIZE equ (0x2000 - 512) ;512 байт для контекста FPU |
253 | RING0_STACK_SIZE equ (0x2000 - 512) ;512 байт для контекста FPU |
254 | 254 | ||
255 | REG_SS equ (RING0_STACK_SIZE-4) |
255 | REG_SS equ (RING0_STACK_SIZE-4) |
256 | REG_APP_ESP equ (RING0_STACK_SIZE-8) |
256 | REG_APP_ESP equ (RING0_STACK_SIZE-8) |
257 | REG_EFLAGS equ (RING0_STACK_SIZE-12) |
257 | REG_EFLAGS equ (RING0_STACK_SIZE-12) |
258 | REG_CS equ (RING0_STACK_SIZE-16) |
258 | REG_CS equ (RING0_STACK_SIZE-16) |
259 | REG_EIP equ (RING0_STACK_SIZE-20) |
259 | REG_EIP equ (RING0_STACK_SIZE-20) |
260 | REG_EAX equ (RING0_STACK_SIZE-24) |
260 | REG_EAX equ (RING0_STACK_SIZE-24) |
261 | REG_ECX equ (RING0_STACK_SIZE-28) |
261 | REG_ECX equ (RING0_STACK_SIZE-28) |
262 | REG_EDX equ (RING0_STACK_SIZE-32) |
262 | REG_EDX equ (RING0_STACK_SIZE-32) |
263 | REG_EBX equ (RING0_STACK_SIZE-36) |
263 | REG_EBX equ (RING0_STACK_SIZE-36) |
264 | REG_ESP equ (RING0_STACK_SIZE-40) ;RING0_STACK_SIZE-20 |
264 | REG_ESP equ (RING0_STACK_SIZE-40) ;RING0_STACK_SIZE-20 |
265 | REG_EBP equ (RING0_STACK_SIZE-44) |
265 | REG_EBP equ (RING0_STACK_SIZE-44) |
266 | REG_ESI equ (RING0_STACK_SIZE-48) |
266 | REG_ESI equ (RING0_STACK_SIZE-48) |
267 | REG_EDI equ (RING0_STACK_SIZE-52) |
267 | REG_EDI equ (RING0_STACK_SIZE-52) |
268 | REG_RET equ (RING0_STACK_SIZE-56) ;irq0.return |
268 | REG_RET equ (RING0_STACK_SIZE-56) ;irq0.return |
269 | 269 | ||
270 | 270 | ||
271 | PAGE_SIZE equ 4096 |
271 | PAGE_SIZE equ 4096 |
272 | 272 | ||
273 | PG_UNMAP equ 0x000 |
273 | PG_UNMAP equ 0x000 |
274 | PG_MAP equ 0x001 |
274 | PG_MAP equ 0x001 |
275 | PG_WRITE equ 0x002 |
275 | PG_WRITE equ 0x002 |
276 | PG_SW equ 0x003 |
276 | PG_SW equ 0x003 |
277 | PG_USER equ 0x005 |
277 | PG_USER equ 0x005 |
278 | PG_UW equ 0x007 |
278 | PG_UW equ 0x007 |
279 | PG_NOCACHE equ 0x018 |
279 | PG_NOCACHE equ 0x018 |
280 | PG_LARGE equ 0x080 |
280 | PG_LARGE equ 0x080 |
281 | PG_GLOBAL equ 0x100 |
281 | PG_GLOBAL equ 0x100 |
282 | 282 | ||
283 | PG_SHARED equ 0x200 |
283 | PG_SHARED equ 0x200 |
284 | 284 | ||
285 | ;;;;;;;;;;;boot time variables |
285 | ;;;;;;;;;;;boot time variables |
286 | 286 | ||
287 | BOOT_BPP equ 0x9000 ;byte bits per pixel |
287 | BOOT_BPP equ 0x9000 ;byte bits per pixel |
288 | BOOT_PITCH equ 0x9001 ;word scanline length |
288 | BOOT_PITCH equ 0x9001 ;word scanline length |
289 | BOOT_VESA_MODE equ 0x9008 ;word vesa video mode |
289 | BOOT_VESA_MODE equ 0x9008 ;word vesa video mode |
290 | BOOT_X_RES equ 0x900A ;word X res |
290 | BOOT_X_RES equ 0x900A ;word X res |
291 | BOOT_Y_RES equ 0x900C ;word Y res |
291 | BOOT_Y_RES equ 0x900C ;word Y res |
292 | BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch |
292 | BOOT_BANK_SW equ 0x9014 ;dword Vesa 1.2 pm bank switch |
293 | BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address |
293 | BOOT_LFB equ 0x9018 ;dword Vesa 2.0 LFB address |
294 | BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration |
294 | BOOT_MTRR equ 0x901C ;byte 0 or 1 : enable MTRR graphics acceleration |
295 | ;BOOT_LOG equ 0x901D ;byte not used anymore (0 or 1 : enable system log display) |
295 | ;BOOT_LOG equ 0x901D ;byte not used anymore (0 or 1 : enable system log display) |
296 | BOOT_LAUNCHER_START equ 0x901D ;byte (0 or 1) start the first app (right now it's LAUNCHER) after kernel is loaded? |
296 | BOOT_LAUNCHER_START equ 0x901D ;byte (0 or 1) start the first app (right now it's LAUNCHER) after kernel is loaded? |
297 | ;BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled |
297 | ;BOOT_DIRECT_LFB equ 0x901E ;byte 0 or 1 : enable direct lfb write, paging disabled |
298 | BOOT_DEBUG_PRINT equ 0x901E ;byte If nonzero, duplicates debug output to the screen. |
298 | BOOT_DEBUG_PRINT equ 0x901E ;byte If nonzero, duplicates debug output to the screen. |
299 | BOOT_DMA equ 0x901F ; |
299 | BOOT_DMA equ 0x901F ; |
300 | BOOT_PCI_DATA equ 0x9020 ;8bytes pci data |
300 | BOOT_PCI_DATA equ 0x9020 ;8bytes pci data |
301 | BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no |
301 | BOOT_VRR equ 0x9030 ;byte VRR start enabled 1, 2-no |
302 | ;BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr ; now free and is not used |
302 | ;BOOT_IDE_BASE_ADDR equ 0x9031 ;word IDEContrRegsBaseAddr ; now free and is not used |
303 | BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount |
303 | BOOT_MEM_AMOUNT equ 0x9034 ;dword memory amount |
304 | 304 | ||
305 | BOOT_APM_ENTRY equ 0x9040 |
305 | BOOT_APM_ENTRY equ 0x9040 |
306 | BOOT_APM_VERSION equ 0x9044 |
306 | BOOT_APM_VERSION equ 0x9044 |
307 | BOOT_APM_FLAGS equ 0x9046 ;unused |
307 | BOOT_APM_FLAGS equ 0x9046 ;unused |
308 | BOOT_APM_CODE_32 equ 0x9050 |
308 | BOOT_APM_CODE_32 equ 0x9050 |
309 | BOOT_APM_CODE_16 equ 0x9052 |
309 | BOOT_APM_CODE_16 equ 0x9052 |
310 | BOOT_APM_DATA_16 equ 0x9054 |
310 | BOOT_APM_DATA_16 equ 0x9054 |
311 | ;BOOT_IDE_BAR0_16 equ 0x9056 ; now free and is not used |
311 | ;BOOT_IDE_BAR0_16 equ 0x9056 ; now free and is not used |
312 | ;BOOT_IDE_BAR1_16 equ 0x9058 ; now free and is not used |
312 | ;BOOT_IDE_BAR1_16 equ 0x9058 ; now free and is not used |
313 | ;BOOT_IDE_BAR2_16 equ 0x905A ; now free and is not used |
313 | ;BOOT_IDE_BAR2_16 equ 0x905A ; now free and is not used |
314 | ;BOOT_IDE_BAR3_16 equ 0x905C ; now free and is not used |
314 | ;BOOT_IDE_BAR3_16 equ 0x905C ; now free and is not used |
315 | ;BOOT_IDE_PI_16 equ 0x905E ; now free and is not used |
315 | ;BOOT_IDE_PI_16 equ 0x905E ; now free and is not used |
316 | ;BOOT_IDE_INTERR_16 equ 0x9060 ; now free and is not used |
316 | ;BOOT_IDE_INTERR_16 equ 0x9060 ; now free and is not used |
317 | 317 | ||
318 | TMP_FILE_NAME equ 0 |
318 | TMP_FILE_NAME equ 0 |
319 | TMP_CMD_LINE equ 1024 |
319 | TMP_CMD_LINE equ 1024 |
320 | TMP_ICON_OFFS equ 1280 |
320 | TMP_ICON_OFFS equ 1280 |
321 | 321 | ||
322 | 322 | ||
323 | EVENT_REDRAW equ 0x00000001 |
323 | EVENT_REDRAW equ 0x00000001 |
324 | EVENT_KEY equ 0x00000002 |
324 | EVENT_KEY equ 0x00000002 |
325 | EVENT_BUTTON equ 0x00000004 |
325 | EVENT_BUTTON equ 0x00000004 |
326 | EVENT_BACKGROUND equ 0x00000010 |
326 | EVENT_BACKGROUND equ 0x00000010 |
327 | EVENT_MOUSE equ 0x00000020 |
327 | EVENT_MOUSE equ 0x00000020 |
328 | EVENT_IPC equ 0x00000040 |
328 | EVENT_IPC equ 0x00000040 |
329 | EVENT_NETWORK equ 0x00000080 |
329 | EVENT_NETWORK equ 0x00000080 |
330 | EVENT_DEBUG equ 0x00000100 |
330 | EVENT_DEBUG equ 0x00000100 |
331 | EVENT_NETWORK2 equ 0x00000200 |
331 | EVENT_NETWORK2 equ 0x00000200 |
332 | EVENT_EXTENDED equ 0x00000400 |
332 | EVENT_EXTENDED equ 0x00000400 |
333 | 333 | ||
334 | EV_INTR equ 1 |
334 | EV_INTR equ 1 |
335 | 335 | ||
336 | struct THR_DATA |
336 | struct THR_DATA |
337 | rb (8192-512) |
337 | rb (8192-512) |
338 | ; pl0_stack |
338 | ; pl0_stack |
339 | fpu_state rb 512 |
339 | fpu_state rb 512 |
340 | tls_page rb 4096 |
340 | tls_page rb 4096 |
341 | pdbr rb 4096 |
341 | pdbr rb 4096 |
342 | ends |
342 | ends |
343 | 343 | ||
344 | virtual at (OS_BASE-sizeof.THR_DATA) |
344 | virtual at (OS_BASE-sizeof.THR_DATA) |
345 | thr_data THR_DATA |
345 | thr_data THR_DATA |
346 | end virtual |
346 | end virtual |
347 | 347 | ||
348 | struct SYS_VARS |
348 | struct SYS_VARS |
349 | bpp dd ? |
349 | bpp dd ? |
350 | scanline dd ? |
350 | scanline dd ? |
351 | vesa_mode dd ? |
351 | vesa_mode dd ? |
352 | x_res dd ? |
352 | x_res dd ? |
353 | y_res dd ? |
353 | y_res dd ? |
354 | ends |
354 | ends |
355 | 355 | ||
356 | struct APPOBJ ; common object header |
356 | struct APPOBJ ; common object header |
357 | magic dd ? ; |
357 | magic dd ? ; |
358 | destroy dd ? ; internal destructor |
358 | destroy dd ? ; internal destructor |
359 | fd dd ? ; next object in list |
359 | fd dd ? ; next object in list |
360 | bk dd ? ; prev object in list |
360 | bk dd ? ; prev object in list |
361 | pid dd ? ; owner id |
361 | pid dd ? ; owner id |
362 | ends |
362 | ends |
363 | 363 | ||
364 | APP_OBJ_OFFSET equ 48 |
364 | APP_OBJ_OFFSET equ 48 |
365 | APP_EV_OFFSET equ 40 |
365 | APP_EV_OFFSET equ 40 |
366 | 366 | ||
367 | struct CURSOR APPOBJ |
367 | struct CURSOR APPOBJ |
368 | base dd ? ;allocated memory |
368 | base dd ? ;allocated memory |
369 | hot_x dd ? ;hotspot coords |
369 | hot_x dd ? ;hotspot coords |
370 | hot_y dd ? |
370 | hot_y dd ? |
371 | 371 | ||
372 | list_next dd ? ;next cursor in cursor list |
372 | list_next dd ? ;next cursor in cursor list |
373 | list_prev dd ? ;prev cursor in cursor list |
373 | list_prev dd ? ;prev cursor in cursor list |
374 | dev_obj dd ? ;device depended data |
374 | dev_obj dd ? ;device depended data |
375 | ends |
375 | ends |
376 | 376 | ||
377 | 377 | ||
378 | struct EVENT APPOBJ |
378 | struct EVENT APPOBJ |
379 | id dd ? ;event uid |
379 | id dd ? ;event uid |
380 | state dd ? ;internal flags |
380 | state dd ? ;internal flags |
381 | code dd ? |
381 | code dd ? |
382 | rd 5 |
382 | rd 5 |
383 | ends |
383 | ends |
384 | 384 | ||
385 | 385 | ||
386 | struct SMEM |
386 | struct SMEM |
387 | bk dd ? |
387 | bk dd ? |
388 | fd dd ? ;+4 |
388 | fd dd ? ;+4 |
389 | base dd ? ;+8 |
389 | base dd ? ;+8 |
390 | size dd ? ;+12 |
390 | size dd ? ;+12 |
391 | access dd ? ;+16 |
391 | access dd ? ;+16 |
392 | refcount dd ? ;+20 |
392 | refcount dd ? ;+20 |
393 | name rb 32 ;+24 |
393 | name rb 32 ;+24 |
394 | ends |
394 | ends |
395 | 395 | ||
396 | struct SMAP APPOBJ |
396 | struct SMAP APPOBJ |
397 | base dd ? ;mapped base |
397 | base dd ? ;mapped base |
398 | parent dd ? ;SMEM |
398 | parent dd ? ;SMEM |
399 | ends |
399 | ends |
400 | 400 | ||
401 | struct DLLDESCR |
401 | struct DLLDESCR |
402 | bk dd ? |
402 | bk dd ? |
403 | fd dd ? ;+4 |
403 | fd dd ? ;+4 |
404 | data dd ? ;+8 |
404 | data dd ? ;+8 |
405 | size dd ? ;+12 |
405 | size dd ? ;+12 |
406 | timestamp dq ? |
406 | timestamp dq ? |
407 | refcount dd ? |
407 | refcount dd ? |
408 | defaultbase dd ? |
408 | defaultbase dd ? |
409 | coff_hdr dd ? |
409 | coff_hdr dd ? |
410 | symbols_ptr dd ? |
410 | symbols_ptr dd ? |
411 | symbols_num dd ? |
411 | symbols_num dd ? |
412 | symbols_lim dd ? |
412 | symbols_lim dd ? |
413 | exports dd ? ;export table |
413 | exports dd ? ;export table |
414 | name rb 260 |
414 | name rb 260 |
415 | ends |
415 | ends |
416 | 416 | ||
417 | struct HDLL |
417 | struct HDLL |
418 | fd dd ? ;next object in list |
418 | fd dd ? ;next object in list |
419 | bk dd ? ;prev object in list |
419 | bk dd ? ;prev object in list |
420 | pid dd ? ;owner id |
420 | pid dd ? ;owner id |
421 | 421 | ||
422 | base dd ? ;mapped base |
422 | base dd ? ;mapped base |
423 | size dd ? ;mapped size |
423 | size dd ? ;mapped size |
424 | refcount dd ? ;reference counter for this process and this lib |
424 | refcount dd ? ;reference counter for this process and this lib |
425 | parent dd ? ;DLLDESCR |
425 | parent dd ? ;DLLDESCR |
426 | ends |
426 | ends |
427 | - | ||
428 | struct display_t |
- | |
429 | x dd ? |
- | |
430 | y dd ? |
- | |
431 | width dd ? |
- | |
432 | height dd ? |
- | |
433 | bits_per_pixel dd ? |
- | |
434 | vrefresh dd ? |
- | |
435 | pitch dd ? |
- | |
436 | lfb dd ? |
- | |
437 | - | ||
438 | modes dd ? |
- | |
439 | ddev dd ? |
- | |
440 | connector dd ? |
- | |
441 | crtc dd ? |
- | |
442 | - | ||
443 | cr_list.next dd ? |
- | |
444 | cr_list.prev dd ? |
- | |
445 | - | ||
446 | cursor dd ? |
- | |
447 | - | ||
448 | init_cursor dd ? |
- | |
449 | select_cursor dd ? |
- | |
450 | show_cursor dd ? |
- | |
451 | move_cursor dd ? |
- | |
452 | restore_cursor dd ? |
- | |
453 | disable_mouse dd ? |
- | |
454 | mask_seqno dd ? |
- | |
455 | check_mouse dd ? |
- | |
456 | check_m_pixel dd ? |
- | |
457 | - | ||
458 | bytes_per_pixel dd ? |
- | |
459 | ends |
427 | |
460 | 428 | ||
461 | struct BOOT_DATA |
429 | struct BOOT_DATA |
462 | bpp dd ? |
430 | bpp dd ? |
463 | scanline dd ? |
431 | scanline dd ? |
464 | vesa_mode dd ? |
432 | vesa_mode dd ? |
465 | x_res dd ? |
433 | x_res dd ? |
466 | y_res dd ? |
434 | y_res dd ? |
467 | mouse_port dd ? |
435 | mouse_port dd ? |
468 | bank_switch dd ? |
436 | bank_switch dd ? |
469 | lfb dd ? |
437 | lfb dd ? |
470 | vesa_mem dd ? |
438 | vesa_mem dd ? |
471 | log dd ? |
439 | log dd ? |
472 | direct_lfb dd ? |
440 | direct_lfb dd ? |
473 | pci_data dd ? |
441 | pci_data dd ? |
474 | dd ? |
442 | dd ? |
475 | vrr dd ? |
443 | vrr dd ? |
476 | ide_base dd ? |
444 | ide_base dd ? |
477 | mem_amount dd ? |
445 | mem_amount dd ? |
478 | pages_count dd ? |
446 | pages_count dd ? |
479 | pagemap_size dd ? |
447 | pagemap_size dd ? |
480 | kernel_max dd ? |
448 | kernel_max dd ? |
481 | kernel_pages dd ? |
449 | kernel_pages dd ? |
482 | kernel_tables dd ? |
450 | kernel_tables dd ? |
483 | 451 | ||
484 | cpu_vendor dd ? |
452 | cpu_vendor dd ? |
485 | dd ? |
453 | dd ? |
486 | dd ? |
454 | dd ? |
487 | cpu_sign dd ? |
455 | cpu_sign dd ? |
488 | cpu_info dd ? |
456 | cpu_info dd ? |
489 | cpu_caps dd ? |
457 | cpu_caps dd ? |
490 | dd ? |
458 | dd ? |
491 | dd ? |
459 | dd ? |
492 | ends |
460 | ends |
493 | 461 | ||
494 | struct LHEAD |
462 | struct LHEAD |
495 | next dd ? ;next object in list |
463 | next dd ? ;next object in list |
496 | prev dd ? ;prev object in list |
464 | prev dd ? ;prev object in list |
497 | ends |
465 | ends |
498 | 466 | ||
499 | struct MUTEX |
467 | struct MUTEX |
500 | wait_list LHEAD |
468 | wait_list LHEAD |
501 | count dd ? |
469 | count dd ? |
502 | ends |
470 | ends |
503 | 471 | ||
504 | struct RWSEM |
472 | struct RWSEM |
505 | wait_list LHEAD |
473 | wait_list LHEAD |
506 | count dd ? |
474 | count dd ? |
507 | ends |
475 | ends |
- | 476 | ||
- | 477 | struct display_t |
|
- | 478 | x dd ? |
|
- | 479 | y dd ? |
|
- | 480 | width dd ? |
|
- | 481 | height dd ? |
|
- | 482 | bits_per_pixel dd ? |
|
- | 483 | vrefresh dd ? |
|
- | 484 | lfb dd ? |
|
- | 485 | lfb_pitch dd ? |
|
- | 486 | ||
- | 487 | win_map_lock RWSEM |
|
- | 488 | win_map dd ? |
|
- | 489 | win_map_pitch dd ? |
|
- | 490 | win_map_size dd ? |
|
- | 491 | ||
- | 492 | modes dd ? |
|
- | 493 | ddev dd ? |
|
- | 494 | connector dd ? |
|
- | 495 | crtc dd ? |
|
- | 496 | ||
- | 497 | cr_list.next dd ? |
|
- | 498 | cr_list.prev dd ? |
|
- | 499 | ||
- | 500 | cursor dd ? |
|
- | 501 | ||
- | 502 | init_cursor dd ? |
|
- | 503 | select_cursor dd ? |
|
- | 504 | show_cursor dd ? |
|
- | 505 | move_cursor dd ? |
|
- | 506 | restore_cursor dd ? |
|
- | 507 | disable_mouse dd ? |
|
- | 508 | mask_seqno dd ? |
|
- | 509 | check_mouse dd ? |
|
- | 510 | check_m_pixel dd ? |
|
- | 511 | ||
- | 512 | bytes_per_pixel dd ? |
|
- | 513 | ends |
|
- | 514 | ||
508 | 515 | ||
509 | struct PCIDEV |
516 | struct PCIDEV |
510 | bk dd ? |
517 | bk dd ? |
511 | fd dd ? |
518 | fd dd ? |
512 | vendor_device_id dd ? |
519 | vendor_device_id dd ? |
513 | class dd ? |
520 | class dd ? |
514 | devfn db ? |
521 | devfn db ? |
515 | bus db ? |
522 | bus db ? |
516 | rb 2 |
523 | rb 2 |
517 | owner dd ? ; pointer to SRV or 0 |
524 | owner dd ? ; pointer to SRV or 0 |
518 | ends |
525 | ends |
519 | 526 | ||
520 | ; The following macro assume that we are on uniprocessor machine. |
527 | ; The following macro assume that we are on uniprocessor machine. |
521 | ; Serious work is needed for multiprocessor machines. |
528 | ; Serious work is needed for multiprocessor machines. |
522 | macro spin_lock_irqsave spinlock |
529 | macro spin_lock_irqsave spinlock |
523 | { |
530 | { |
524 | pushf |
531 | pushf |
525 | cli |
532 | cli |
526 | } |
533 | } |
527 | macro spin_unlock_irqrestore spinlock |
534 | macro spin_unlock_irqrestore spinlock |
528 | { |
535 | { |
529 | popf |
536 | popf |
530 | } |
537 | } |
531 | macro spin_lock_irq spinlock |
538 | macro spin_lock_irq spinlock |
532 | { |
539 | { |
533 | cli |
540 | cli |
534 | } |
541 | } |
535 | macro spin_unlock_irq spinlock |
542 | macro spin_unlock_irq spinlock |
536 | { |
543 | { |
537 | sti |
544 | sti |
538 | } |
545 | } |
539 | 546 | ||
540 | struct MEM_STATE |
547 | struct MEM_STATE |
541 | mutex MUTEX |
548 | mutex MUTEX |
542 | smallmap dd ? |
549 | smallmap dd ? |
543 | treemap dd ? |
550 | treemap dd ? |
544 | topsize dd ? |
551 | topsize dd ? |
545 | top dd ? |
552 | top dd ? |
546 | smallbins rd 4*32 |
553 | smallbins rd 4*32 |
547 | treebins rd 32 |
554 | treebins rd 32 |
548 | ends |
555 | ends |
549 | 556 | ||
550 | struct PG_DATA |
557 | struct PG_DATA |
551 | mem_amount dd ? |
558 | mem_amount dd ? |
552 | vesa_mem dd ? |
559 | vesa_mem dd ? |
553 | pages_count dd ? |
560 | pages_count dd ? |
554 | pages_free dd ? |
561 | pages_free dd ? |
555 | pages_faults dd ? |
562 | pages_faults dd ? |
556 | pagemap_size dd ? |
563 | pagemap_size dd ? |
557 | kernel_pages dd ? |
564 | kernel_pages dd ? |
558 | kernel_tables dd ? |
565 | kernel_tables dd ? |
559 | sys_page_dir dd ? |
566 | sys_page_dir dd ? |
560 | mutex MUTEX |
567 | mutex MUTEX |
561 | ends |
568 | ends |
562 | 569 | ||
563 | struct SRV |
570 | struct SRV |
564 | srv_name rb 16 ;ASCIIZ string |
571 | srv_name rb 16 ;ASCIIZ string |
565 | magic dd ? ;+0x10 ;'SRV ' |
572 | magic dd ? ;+0x10 ;'SRV ' |
566 | size dd ? ;+0x14 ;size of structure SRV |
573 | size dd ? ;+0x14 ;size of structure SRV |
567 | fd dd ? ;+0x18 ;next SRV descriptor |
574 | fd dd ? ;+0x18 ;next SRV descriptor |
568 | bk dd ? ;+0x1C ;prev SRV descriptor |
575 | bk dd ? ;+0x1C ;prev SRV descriptor |
569 | base dd ? ;+0x20 ;service base address |
576 | base dd ? ;+0x20 ;service base address |
570 | entry dd ? ;+0x24 ;service START function |
577 | entry dd ? ;+0x24 ;service START function |
571 | srv_proc dd ? ;+0x28 ;user mode service handler |
578 | srv_proc dd ? ;+0x28 ;user mode service handler |
572 | srv_proc_ex dd ? ;+0x2C ;kernel mode service handler |
579 | srv_proc_ex dd ? ;+0x2C ;kernel mode service handler |
573 | ends |
580 | ends |
574 | 581 | ||
575 | struct USBSRV |
582 | struct USBSRV |
576 | srv SRV |
583 | srv SRV |
577 | usb_func dd ? |
584 | usb_func dd ? |
578 | ends |
585 | ends |
579 | 586 | ||
580 | struct USBFUNC |
587 | struct USBFUNC |
581 | strucsize dd ? |
588 | strucsize dd ? |
582 | add_device dd ? |
589 | add_device dd ? |
583 | device_disconnect dd ? |
590 | device_disconnect dd ? |
584 | ends |
591 | ends |
585 | 592 | ||
586 | DRV_ENTRY equ 1 |
593 | DRV_ENTRY equ 1 |
587 | DRV_EXIT equ -1 |
594 | DRV_EXIT equ -1 |
588 | 595 | ||
589 | struct COFF_HEADER |
596 | struct COFF_HEADER |
590 | machine dw ? |
597 | machine dw ? |
591 | nSections dw ? |
598 | nSections dw ? |
592 | DataTime dd ? |
599 | DataTime dd ? |
593 | pSymTable dd ? |
600 | pSymTable dd ? |
594 | nSymbols dd ? |
601 | nSymbols dd ? |
595 | optHeader dw ? |
602 | optHeader dw ? |
596 | flags dw ? |
603 | flags dw ? |
597 | ends |
604 | ends |
598 | 605 | ||
599 | struct COFF_SECTION |
606 | struct COFF_SECTION |
600 | Name rb 8 |
607 | Name rb 8 |
601 | VirtualSize dd ? |
608 | VirtualSize dd ? |
602 | VirtualAddress dd ? |
609 | VirtualAddress dd ? |
603 | SizeOfRawData dd ? |
610 | SizeOfRawData dd ? |
604 | PtrRawData dd ? |
611 | PtrRawData dd ? |
605 | PtrReloc dd ? |
612 | PtrReloc dd ? |
606 | PtrLinenumbers dd ? |
613 | PtrLinenumbers dd ? |
607 | NumReloc dw ? |
614 | NumReloc dw ? |
608 | NumLinenum dw ? |
615 | NumLinenum dw ? |
609 | Characteristics dd ? |
616 | Characteristics dd ? |
610 | ends |
617 | ends |
611 | 618 | ||
612 | struct COFF_RELOC |
619 | struct COFF_RELOC |
613 | VirtualAddress dd ? |
620 | VirtualAddress dd ? |
614 | SymIndex dd ? |
621 | SymIndex dd ? |
615 | Type dw ? |
622 | Type dw ? |
616 | ends |
623 | ends |
617 | 624 | ||
618 | struct COFF_SYM |
625 | struct COFF_SYM |
619 | Name rb 8 |
626 | Name rb 8 |
620 | Value dd ? |
627 | Value dd ? |
621 | SectionNumber dw ? |
628 | SectionNumber dw ? |
622 | Type dw ? |
629 | Type dw ? |
623 | StorageClass db ? |
630 | StorageClass db ? |
624 | NumAuxSymbols db ? |
631 | NumAuxSymbols db ? |
625 | ends |
632 | ends |
626 | 633 | ||
627 | struct STRIPPED_PE_HEADER |
634 | struct STRIPPED_PE_HEADER |
628 | Signature dw ? |
635 | Signature dw ? |
629 | Characteristics dw ? |
636 | Characteristics dw ? |
630 | AddressOfEntryPoint dd ? |
637 | AddressOfEntryPoint dd ? |
631 | ImageBase dd ? |
638 | ImageBase dd ? |
632 | SectionAlignmentLog db ? |
639 | SectionAlignmentLog db ? |
633 | FileAlignmentLog db ? |
640 | FileAlignmentLog db ? |
634 | MajorOSVersion db ? |
641 | MajorOSVersion db ? |
635 | MinorOSVersion db ? |
642 | MinorOSVersion db ? |
636 | SizeOfImage dd ? |
643 | SizeOfImage dd ? |
637 | SizeOfStackReserve dd ? |
644 | SizeOfStackReserve dd ? |
638 | SizeOfHeapReserve dd ? |
645 | SizeOfHeapReserve dd ? |
639 | SizeOfHeaders dd ? |
646 | SizeOfHeaders dd ? |
640 | Subsystem db ? |
647 | Subsystem db ? |
641 | NumberOfRvaAndSizes db ? |
648 | NumberOfRvaAndSizes db ? |
642 | NumberOfSections dw ? |
649 | NumberOfSections dw ? |
643 | ends |
650 | ends |
644 | STRIPPED_PE_SIGNATURE = 0x4503 ; 'PE' xor 'S' |
651 | STRIPPED_PE_SIGNATURE = 0x4503 ; 'PE' xor 'S' |
645 | SPE_DIRECTORY_IMPORT = 0 |
652 | SPE_DIRECTORY_IMPORT = 0 |
646 | SPE_DIRECTORY_EXPORT = 1 |
653 | SPE_DIRECTORY_EXPORT = 1 |
647 | SPE_DIRECTORY_BASERELOC = 2 |
654 | SPE_DIRECTORY_BASERELOC = 2 |
648 | 655 | ||
649 | struct IOCTL |
656 | struct IOCTL |
650 | handle dd ? |
657 | handle dd ? |
651 | io_code dd ? |
658 | io_code dd ? |
652 | input dd ? |
659 | input dd ? |
653 | inp_size dd ? |
660 | inp_size dd ? |
654 | output dd ? |
661 | output dd ? |
655 | out_size dd ? |
662 | out_size dd ? |
656 | ends |
663 | ends |
657 | 664 | ||
658 | struct IRQH |
665 | struct IRQH |
659 | list LHEAD |
666 | list LHEAD |
660 | handler dd ? ;handler roututine |
667 | handler dd ? ;handler roututine |
661 | data dd ? ;user-specific data |
668 | data dd ? ;user-specific data |
662 | num_ints dd ? ;how many times handled |
669 | num_ints dd ? ;how many times handled |
663 | ends |
670 | ends |