Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
164 serge 1
 
2
 
3
cpl0    equ  10011010b      ; code read dpl0
4
cpl3    equ  11111010b      ; code read dpl3
5
6
D32     equ  01000000b      ; 32bit segment
7
 
8
9
10
 
11
 
12
CPU_386        equ 3
13
 
14
CPU_PENTIUM    equ 5
15
CPU_P6         equ 6
16
CPU_PENTIUM4   equ 0x0F
17
18
CAPS_FPU       equ    00 ;on-chip x87 floating point unit
19
 
20
CAPS_DE        equ    02 ;debugging extensions
21
CAPS_PSE       equ    03 ;page-size extensions
22
CAPS_TSC       equ    04 ;time stamp counter
23
CAPS_MSR       equ    05 ;model-specific registers
24
CAPS_PAE       equ    06 ;physical-address extensions
25
CAPS_MCE       equ    07 ;machine check exception
26
CAPS_CX8       equ    08 ;CMPXCHG8B instruction
27
CAPS_APIC      equ    09 ;on-chip advanced programmable
28
                         ; interrupt controller
29
;                     10 ;unused
30
CAPS_SEP       equ    11 ;SYSENTER and SYSEXIT instructions
31
CAPS_MTRR      equ    12 ;memory-type range registers
32
CAPS_PGE       equ    13 ;page global extension
33
CAPS_MCA       equ    14 ;machine check architecture
34
CAPS_CMOV      equ    15 ;conditional move instructions
35
CAPS_PAT       equ    16 ;page attribute table
36
37
CAPS_PSE36     equ    17 ;page-size extensions
38
 
39
CAPS_CLFLUSH   equ    19 ;CLFUSH instruction
40
41
CAPS_DS        equ    21 ;debug store
42
 
43
                         ;controlled clock supported
44
CAPS_MMX       equ    23 ;MMX instructions
45
CAPS_FXSR      equ    24 ;FXSAVE and FXRSTOR instructions
46
CAPS_SSE       equ    25 ;SSE instructions
47
CAPS_SSE2      equ    26 ;SSE2 instructions
48
CAPS_SS        equ    27 ;self-snoop
49
CAPS_HTT       equ    28 ;hyper-threading technology
50
CAPS_TM        equ    29 ;thermal monitor supported
51
CAPS_IA64      equ    30 ;IA64 capabilities
52
CAPS_PBE       equ    31 ;pending break enable
53
54
;ecx
55
 
56
;                     33
57
;                     34
58
CAPS_MONITOR   equ    35 ;MONITOR/MWAIT instructions
59
CAPS_DS_CPL    equ    36 ;
60
CAPS_VMX       equ    37 ;virtual mode extensions
61
;                     38 ;
62
CAPS_EST       equ    39 ;enhansed speed step
63
CAPS_TM2       equ    40 ;thermal monitor2 supported
64
;                     41
65
CAPS_CID       equ    42 ;
66
;                     43
67
;                     44
68
CAPS_CX16      equ    45 ;CMPXCHG16B instruction
69
CAPS_xTPR      equ    46 ;
70
;
71
;reserved
72
;
73
;ext edx /ecx
74
CAPS_SYSCAL    equ    64 ;
75
CAPS_XD        equ    65 ;execution disable
76
CAPS_FFXSR     equ    66 ;
77
CAPS_RDTSCP    equ    67 ;
78
CAPS_X64       equ    68 ;
79
CAPS_3DNOW     equ    69 ;
80
CAPS_3DNOWEXT  equ    70 ;
81
CAPS_LAHF      equ    71 ;
82
CAPS_CMP_LEG   equ    72 ;
83
CAPS_SVM       equ    73 ;secure virual machine
84
CAPS_ALTMOVCR8 equ    74 ;
85
86
87
 
88
 
168 serge 89
CR0_EM         equ    0x00000004   ;fpu emulation
90
CR0_TS         equ    0x00000008   ;task switch
91
CR0_ET         equ    0x00000010   ;extension type hardcoded to 1
92
CR0_NE         equ    0x00000020   ;numeric error
93
CR0_WP         equ    0x00010000   ;write protect
94
CR0_AM         equ    0x00040000   ;alignment check
95
CR0_NW         equ    0x20000000   ;not write-through
96
CR0_CD         equ    0x40000000   ;cache disable
97
CR0_PG         equ    0x80000000   ;paging
98
99
100
 
101
 
164 serge 102
CR4_TSD        equ    0x0004
103
CR4_DE         equ    0x0008
104
CR4_PSE        equ    0x0010
105
CR4_PAE        equ    0x0020
106
CR4_MCE        equ    0x0040
107
CR4_PGE        equ    0x0080
108
CR4_PCE        equ    0x0100
109
CR4_OSFXSR     equ    0x0200
110
CR4_OSXMMEXPT  equ    0x0400
111
112
SSE_IE         equ    0x0001
113
 
168 serge 114
SSE_ZE         equ    0x0004
115
SSE_OE         equ    0x0008
116
SSE_UE         equ    0x0010
117
SSE_PE         equ    0x0020
118
SSE_DAZ        equ    0x0040
119
SSE_IM         equ    0x0080
120
SSE_DM         equ    0x0100
121
SSE_ZM         equ    0x0200
122
SSE_OM         equ    0x0400
123
SSE_UM         equ    0x0800
124
SSE_PM         equ    0x1000
125
SSE_FZ         equ    0x8000
126
127
SSE_INIT equ (SSE_IM+SSE_DM+SSE_ZM+SSE_OM+SSE_UM+SSE_PM)
164 serge 128
 
168 serge 129
OS_BASE             equ 0;  0x80400000
164 serge 130
 
131
window_data         equ OS_BASE+0x0000000
132
 
133
CURRENT_TASK        equ OS_BASE+0x0003000
134
 
135
TASK_BASE           equ OS_BASE+0x0003010
136
TASK_DATA           equ OS_BASE+0x0003020
137
TASK_EVENT          equ OS_BASE+0x0003020
138
139
;mouseunder          equ OS_BASE+0x0006900
140
 
141
ACTIVE_PROC_STACK   equ OS_BASE+0x000A400
142
idts                equ OS_BASE+0x000B100
143
WIN_STACK           equ OS_BASE+0x000C000
144
WIN_POS             equ OS_BASE+0x000C400
145
FDD_DATA            equ OS_BASE+0x000D000
146
147
ENABLE_TASKSWITCH   equ OS_BASE+0x000E000
148
 
149
GETPIXEL            equ OS_BASE+0x000E024
150
BANK_SWITCH         equ OS_BASE+0x000E030
151
152
MOUSE_PICTURE       equ OS_BASE+0x000F200
153
 
154
XY_TEMP             equ OS_BASE+0x000F300
155
KEY_COUNT           equ OS_BASE+0x000F400
156
KEY_BUFF            equ OS_BASE+0x000F401
157
158
BTN_COUNT           equ OS_BASE+0x000F500
159
 
160
161
CPU_FREQ            equ OS_BASE+0x000F600
162
 
188 serge 163
164 serge 164
PS2_CHUNK           equ OS_BASE+0x000FB00
165
 
166
MOUSE_Y             equ OS_BASE+0x000FB0C
167
168
MOUSE_COLOR_MEM     equ OS_BASE+0x000FB10
169
 
170
BTN_DOWN            equ OS_BASE+0x000FB40
171
MOUSE_DOWN          equ OS_BASE+0x000FB44
172
X_UNDER             equ OS_BASE+0x000FB4A
173
Y_UNDER             equ OS_BASE+0x000FB4C
174
ScreenBPP           equ OS_BASE+0x000FBF1
175
MOUSE_BUFF_COUNT    equ OS_BASE+0x000FCFF
221 serge 176
HD_CACHE_ENT        equ OS_BASE+0x000FE10
164 serge 177
LFBAddress          equ OS_BASE+0x000FE80
178
MEM_AMOUNT          equ OS_BASE+0x000FE8C
179
;LFBSize             equ OS_BASE+0x02f9050
180
214 serge 181
SCR_X_SIZE          equ OS_BASE+0x000FE00
164 serge 182
 
183
SCR_BYTES_PER_LINE  equ OS_BASE+0x000FE08
184
SCR_MODE            equ OS_BASE+0x000FE0C
185
186
BTN_ADDR            equ OS_BASE+0x000FE88
187
 
188
TASK_ACTIVATE       equ OS_BASE+0x000FF01
189
190
REDRAW_BACKGROUND   equ OS_BASE+0x000FFF0
191
 
192
MOUSE_BACKGROUND    equ OS_BASE+0x000FFF4
193
DONT_DRAW_MOUSE     equ OS_BASE+0x000FFF5
194
DONT_SWITCH         equ OS_BASE+0x000FFFF
195
196
STACK_TOP           equ OS_BASE+0x003EC00
197
 
198
FONT_II             equ OS_BASE+0x003EC00
199
 
200
DISK_DATA           equ OS_BASE+0x0040000
201
PROC_BASE           equ OS_BASE+0x0080000
202
TMP_BUFF            equ OS_BASE+0x0090000
203
204
VGABasePtr          equ OS_BASE+0x00A0000
205
 
206
RAMDISK             equ OS_BASE+0x0100000
207
 
208
FLOPPY_FAT          equ OS_BASE+0x0282000
209
SB16_Status         equ OS_BASE+0x02B0000
210
BUTTON_INFO         equ OS_BASE+0x02C0000
211
RESERVED_PORTS      equ OS_BASE+0x02D0000
212
IRQ_SAVE            equ OS_BASE+0x02E0000
213
SYS_VAR             equ OS_BASE+0x02f0000
214
IMG_BACKGROUND      equ OS_BASE+0x0300000
215
WinMapAddress       equ OS_BASE+0x0460000
216
display_data        equ OS_BASE+0x0460000
217
HD_CACHE            equ OS_BASE+0x0600000
218
stack_data_start    equ OS_BASE+0x0700000
219
eth_data_start      equ OS_BASE+0x0700000
220
stack_data          equ OS_BASE+0x0704000
221
stack_data_end      equ OS_BASE+0x071ffff
222
VMODE_BASE          equ OS_BASE+0x0760000
223
resendQ             equ OS_BASE+0x0770000
224
225
;skin_data          equ OS_BASE+0x0778000
226
 
188 serge 227
draw_data           equ OS_BASE+0x0800000
164 serge 228
 
229
230
tss_data            equ OS_BASE+0x0920000
231
 
232
pages_tab           equ  0x60000000
233
 
188 serge 234
current_pgdir       equ  0x60180000
235
236
sys_pgdir           equ  OS_BASE+0x00050000
164 serge 237
 
188 serge 238
sys_pgmap           equ  OS_BASE+0x00052000
239
240
;lfb_start          equ  0x00800000
164 serge 241
 
188 serge 242
;new_app_pdir          equ OS_BASE+0x01000000
164 serge 243
 
244
;new_app_ptable        equ OS_BASE+0x01002000
245
246
new_app_base        equ  0x60400000
247
 
188 serge 248
twdw                equ (CURRENT_TASK-window_data)
164 serge 249
 
188 serge 250
std_application_base_address   equ new_app_base
164 serge 251
 
252
PAGES_USED          equ 4
253
 
188 serge 254
PG_UNMAP            equ 0x000
164 serge 255
 
188 serge 256
PG_WRITE            equ 0x002
257
PG_SW               equ 0x003
258
PG_USER             equ 0x005
259
PG_UW               equ 0x007
260
PG_NOCACHE          equ 0x018
261
PG_LARGE            equ 0x080
262
PG_GLOBAL           equ 0x100
263
264
;;;;;;;;;;;boot time variables
164 serge 265
 
266
;BOOT_BPP            equ 0x9000    ;byte   bits per pixel
267
 
268
BOOT_VESA_MODE      equ 0x9008    ;word   vesa video mode
269
;;BOOT_X_RES          equ 0x900A    ;word   X res
270
;;BOOT_Y_RES          equ 0x900C    ;word   Y res
271
;;BOOT_MOUSE_PORT     equ 0x9010    ;byte   mouse port  - not used
272
BOOT_BANK_SW        equ 0x9014    ;dword  Vesa 1.2 pm bank switch
273
BOOT_LFB            equ 0x9018    ;dword  Vesa 2.0 LFB address
274
BOOT_MTRR           equ 0x901C    ;byte   0 or 1 : enable MTRR graphics acceleration
275
BOOT_LOG            equ 0x901D    ;byte   not used anymore (0 or 1 : enable system log display)
276
BOOT_DIRECT_LFB     equ 0x901E    ;byte   0 or 1 : enable direct lfb write, paging disabled
277
BOOT_PCI_DATA       equ 0x9020    ;8bytes pci data
278
BOOT_VRR            equ 0x9030    ;byte   VRR start enabled 1, 2-no
279
BOOT_IDE_BASE_ADDR  equ 0x9031   ;word   IDEContrRegsBaseAddr
280
BOOT_MEM_AMOUNT     equ 0x9034    ;dword  memory amount
281
282
TMP_FILE_NAME       equ     0
283
 
284
TMP_ICON_OFFS       equ  1280
285
286
287
 
288
 
289
EVENT_BUTTON       equ 0x00000004
290
EVENT_BACKGROUND   equ 0x00000010
291
EVENT_MOUSE        equ 0x00000020
292
EVENT_IPC          equ 0x00000040
293
EVENT_NETWORK      equ 0x00000080
294
EVENT_DEBUG        equ 0x00000100
295
EVENT_EXTENDED     equ 0x00000200
296
227 serge 297
EV_INTR            equ 1
164 serge 298
 
299
struc SYS_VARS
300
 
301
  .scanline       dd ?
302
  .vesa_mode      dd ?
303
  .x_res          dd ?
304
  .y_res          dd ?
305
  .cpu_caps       dd ?
306
                  dd ?
307
                  dd ?
308
                  dd ?
309
}
310
311
struc APPOBJ           ;common object header
312
 
281 serge 313
   .magic       dd ?   ;
314
   .destroy     dd ?   ;internal destructor
315
   .fd          dd ?   ;next object in list
316
   .bk          dd ?   ;prev object in list
317
   .pid         dd ?   ;owner id
318
};
319
320
virtual at 0
321
 
322
end virtual
323
324
APP_OBJ_OFFSET  equ 48
325
 
326
struc CURSOR
327
 
221 serge 328
   .magic       dd ?   ;'CURS'
281 serge 329
   .destroy     dd ?   ;internal destructor
330
   .fd          dd ?   ;next object in list
331
   .bk          dd ?   ;prev object in list
332
   .pid         dd ?   ;owner id
333
334
 ;cursor data
335
 
336
   .hot_x       dd ?   ;hotspot coords
337
   .hot_y       dd ?
338
}
221 serge 339
virtual at 0
340
  CURSOR CURSOR
341
end virtual
342
343
CURSOR_SIZE     equ 32
344
 
281 serge 345
struc BOOT_DATA
221 serge 346
 
164 serge 347
  .scanline       dd ?
348
  .vesa_mode      dd ?
349
  .x_res          dd ?
350
  .y_res          dd ?
351
  .mouse_port     dd ?
352
  .bank_switch    dd ?
353
  .lfb            dd ?
354
  .vesa_mem       dd ?
355
  .log            dd ?
356
  .direct_lfb     dd ?
357
  .pci_data       dd ?
358
;                  dd ?
359
  .vrr            dd ?
360
  .ide_base       dd ?
361
  .mem_amount     dd ?
362
  .pages_count    dd ?
363
  .pagemap_size   dd ?
364
  .kernel_max     dd ?
365
  .kernel_pages   dd ?
366
  .kernel_tables  dd ?
367
368
  .cpu_vendor     dd ?
369
 
370
                  dd ?
371
  .cpu_sign       dd ?
372
  .cpu_info       dd ?
373
  .cpu_caps       dd ?
374
                  dd ?
375
                  dd ?
376
}
377
378
virtual at 0
379
 
380
end virtual
381
382
struc MEM_STATE
383
 
276 serge 384
   .smallmap          rd 1
385
   .treemap           rd 1
386
   .topsize           rd 1
387
   .top               rd 1
388
   .smallbins         rd 4*32
389
   .treebins          rd 32
390
}
391
392
struc PG_DATA
393
 
164 serge 394
  .vesa_mem          dd ?
395
  .pages_count       dd ?
396
  .pages_free        dd ?
397
  .pages_faults      dd ?
398
  .pagemap_size      dd ?
399
  .kernel_max        dd ?
400
  .kernel_pages      dd ?
401
  .kernel_tables     dd ?
402
  .sys_page_dir      dd ?
403
  .pg_mutex          dd ?
404
  .tmp_task_mutex    dd ?
405
}
406
407
;struc LIB
408
 
278 serge 409
;  .lib_base          dd ?
410
;  .lib_start         dd ?
411
;  .export            dd ?
412
;  .import            dd ?
413
;}
414
415
struc SRV
164 serge 416
 
417
  .magic             dd ?     ;+0x10 ;'SRV '
278 serge 418
  .size              dd ?     ;+0x14 ;size of structure SRV
419
  .fd                dd ?     ;+0x18 ;next SRV descriptor
420
  .bk                dd ?     ;+0x1C ;prev SRV descriptor
421
  .base              dd ?     ;+0x20 ;service base address
422
  .entry             dd ?     ;+0x24 ;service START function
423
  .srv_proc          dd ?     ;+0x28 ;main service handler
424
}
425
164 serge 426
SRV_FD_OFFSET  equ 0x18
427
 
278 serge 428
429
struc COFF_HEADER
430
 
164 serge 431
   .nSections        dw ?
432
   .DataTime         dd ?
433
   .pSymTable        dd ?
434
   .nSymbols         dd ?
435
   .optHeader        dw ?
436
   .flags            dw ?
437
};
438
439
440
 
441
 
442
   .VirtualSize      dd ?
443
   .VirtualAddress   dd ?
444
   .SizeOfRawData    dd ?
445
   .PtrRawData       dd ?
446
   .PtrReloc         dd ?
447
   .PtrLinenumbers   dd ?
448
   .NumReloc         dw ?
449
   .NumLinenum       dw ?
450
   .Characteristics  dd ?
451
}
452
COFF_SECTION_SIZE equ 40
453
206 serge 454
struc COFF_RELOC
164 serge 455
 
456
   .SymIndex         dd ?
457
   .Type             dw ?
458
}
459
460
struc COFF_SYM
461
 
462
   .Value            dd ?
463
   .SectionNumber    dw ?
464
   .Type             dw ?
465
   .StorageClass     db ?
466
   .NumAuxSymbols    db ?
467
}
468
CSYM_SIZE equ 18
469
188 serge 470
struc IOCTL
164 serge 471
 
472
   .io_code          dd ?
473
   .input            dd ?
474
   .inp_size         dd ?
475
   .output           dd ?
476
   .out_size         dd ?
477
}
478
479
virtual at 0
480
 
481
end virtual
482
483
;virtual at 0
484
 
278 serge 485
;end virtual
486
487
virtual at 0
164 serge 488
 
489
end virtual
490
491
virtual at 0
492
 
493
end virtual
188 serge 494
495
virtual at 0
496
 
497
end virtual
164 serge 498
499
virtual at 0
500
 
501
end virtual
502
503
virtual at 0
504
 
505
end virtual
506