Subversion Repositories Kolibri OS

Rev

Rev 5351 | Rev 5360 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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