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