Subversion Repositories Kolibri OS

Rev

Rev 908 | Rev 996 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                              ;;
  3. ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
  4. ;; Distributed under terms of the GNU General Public License    ;;
  5. ;;                                                              ;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8. $Revision: 928 $
  9.  
  10.  
  11. dpl0    equ  10010000b      ; data read       dpl0
  12. drw0    equ  10010010b      ; data read/write dpl0
  13. drw1    equ  10110010b      ; data read/write dpl1
  14. drw3    equ  11110010b      ; data read/write dpl3
  15.  
  16. cpl0    equ  10011010b      ; code read dpl0
  17. cpl1    equ  10111010b      ; code read dpl1
  18. cpl3    equ  11111010b      ; code read dpl3
  19.  
  20. D32     equ  01000000b      ; 32bit segment
  21. G32     equ  10000000b      ; page gran
  22.  
  23.  
  24. ;;;;;;;;;;;;cpu_caps flags;;;;;;;;;;;;;;;;
  25.  
  26. CPU_386        equ     3
  27. CPU_486        equ     4
  28. CPU_PENTIUM    equ     5
  29. CPU_P6         equ     6
  30. CPU_PENTIUM4   equ  0x0F
  31.  
  32. CAPS_FPU       equ    00 ;on-chip x87 floating point unit
  33. CAPS_VME       equ    01 ;virtual-mode enhancements
  34. CAPS_DE        equ    02 ;debugging extensions
  35. CAPS_PSE       equ    03 ;page-size extensions
  36. CAPS_TSC       equ    04 ;time stamp counter
  37. CAPS_MSR       equ    05 ;model-specific registers
  38. CAPS_PAE       equ    06 ;physical-address extensions
  39. CAPS_MCE       equ    07 ;machine check exception
  40. CAPS_CX8       equ    08 ;CMPXCHG8B instruction
  41. CAPS_APIC      equ    09 ;on-chip advanced programmable
  42.                          ; interrupt controller
  43. ;                     10 ;unused
  44. CAPS_SEP       equ    11 ;SYSENTER and SYSEXIT instructions
  45. CAPS_MTRR      equ    12 ;memory-type range registers
  46. CAPS_PGE       equ    13 ;page global extension
  47. CAPS_MCA       equ    14 ;machine check architecture
  48. CAPS_CMOV      equ    15 ;conditional move instructions
  49. CAPS_PAT       equ    16 ;page attribute table
  50.  
  51. CAPS_PSE36     equ    17 ;page-size extensions
  52. CAPS_PSN       equ    18 ;processor serial number
  53. CAPS_CLFLUSH   equ    19 ;CLFUSH instruction
  54.  
  55. CAPS_DS        equ    21 ;debug store
  56. CAPS_ACPI      equ    22 ;thermal monitor and software
  57.                          ;controlled clock supported
  58. CAPS_MMX       equ    23 ;MMX instructions
  59. CAPS_FXSR      equ    24 ;FXSAVE and FXRSTOR instructions
  60. CAPS_SSE       equ    25 ;SSE instructions
  61. CAPS_SSE2      equ    26 ;SSE2 instructions
  62. CAPS_SS        equ    27 ;self-snoop
  63. CAPS_HTT       equ    28 ;hyper-threading technology
  64. CAPS_TM        equ    29 ;thermal monitor supported
  65. CAPS_IA64      equ    30 ;IA64 capabilities
  66. CAPS_PBE       equ    31 ;pending break enable
  67.  
  68. ;ecx
  69. CAPS_SSE3      equ    32 ;SSE3 instructions
  70. ;                     33
  71. ;                     34
  72. CAPS_MONITOR   equ    35 ;MONITOR/MWAIT instructions
  73. CAPS_DS_CPL    equ    36 ;
  74. CAPS_VMX       equ    37 ;virtual mode extensions
  75. ;                     38 ;
  76. CAPS_EST       equ    39 ;enhansed speed step
  77. CAPS_TM2       equ    40 ;thermal monitor2 supported
  78. ;                     41
  79. CAPS_CID       equ    42 ;
  80. ;                     43
  81. ;                     44
  82. CAPS_CX16      equ    45 ;CMPXCHG16B instruction
  83. CAPS_xTPR      equ    46 ;
  84. ;
  85. ;reserved
  86. ;
  87. ;ext edx /ecx
  88. CAPS_SYSCAL    equ    64 ;
  89. CAPS_XD        equ    65 ;execution disable
  90. CAPS_FFXSR     equ    66 ;
  91. CAPS_RDTSCP    equ    67 ;
  92. CAPS_X64       equ    68 ;
  93. CAPS_3DNOW     equ    69 ;
  94. CAPS_3DNOWEXT  equ    70 ;
  95. CAPS_LAHF      equ    71 ;
  96. CAPS_CMP_LEG   equ    72 ;
  97. CAPS_SVM       equ    73 ;secure virual machine
  98. CAPS_ALTMOVCR8 equ    74 ;
  99.  
  100. ; CPU MSR names
  101. MSR_SYSENTER_CS         equ     0x174
  102. MSR_SYSENTER_ESP        equ     0x175
  103. MSR_SYSENTER_EIP        equ     0x176
  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.  
  150. struc TSS
  151. {
  152.   ._back       rw 2
  153.   ._esp0       rd 1
  154.   ._ss0        rw 2
  155.   ._esp1       rd 1
  156.   ._ss1        rw 2
  157.   ._esp2       rd 1
  158.   ._ss2        rw 2
  159.   ._cr3        rd 1
  160.   ._eip        rd 1
  161.   ._eflags     rd 1
  162.   ._eax        rd 1
  163.   ._ecx        rd 1
  164.   ._edx        rd 1
  165.   ._ebx        rd 1
  166.   ._esp        rd 1
  167.   ._ebp        rd 1
  168.   ._esi        rd 1
  169.   ._edi        rd 1
  170.   ._es         rw 2
  171.   ._cs         rw 2
  172.   ._ss         rw 2
  173.   ._ds         rw 2
  174.   ._fs         rw 2
  175.   ._gs         rw 2
  176.   ._ldt        rw 2
  177.   ._trap       rw 1
  178.   ._io         rw 1
  179.                rb 24
  180.   ._io_map_0   rb 4096
  181.   ._io_map_1   rb 4096
  182. }
  183.  
  184. virtual at 0
  185.   TSS  TSS
  186. end virtual
  187.  
  188. TSS_SIZE  equ (128+8192)
  189.  
  190. HEAP_BASE           equ 0x80000000
  191.  
  192. HEAP_MIN_SIZE       equ 0x01000000
  193.  
  194. page_tabs           equ 0xDDC00000
  195. app_page_tabs       equ 0xDDC00000
  196.  
  197. heap_tabs           equ (page_tabs+ (HEAP_BASE shr 10))
  198. kernel_tabs         equ (page_tabs+ (OS_BASE shr 10))
  199. master_tab          equ (page_tabs+ (page_tabs shr 10))
  200.  
  201. LFB_BASE            equ 0xDE000000
  202. SHADOWFB            equ 0   ;0xDE800000
  203.  
  204. TEXT_BASE           equ 0xDFC00000
  205.  
  206. _16BIT_BASE         equ 0x00010000
  207. LOAD_BASE           equ 0x00100000
  208. OS_BASE             equ 0xE0000000
  209. IMAGE_BASE          equ (OS_BASE+LOAD_BASE)
  210.  
  211. window_data         equ OS_BASE
  212.  
  213. CURRENT_TASK        equ (OS_BASE+0x0003000)
  214. TASK_COUNT          equ (OS_BASE+0x0003004)
  215. TASK_BASE           equ (OS_BASE+0x0003010)
  216. TASK_DATA           equ (OS_BASE+0x0003020)
  217. TASK_EVENT          equ (OS_BASE+0x0003020)
  218.  
  219. mouseunder          equ (OS_BASE+0x0006900)
  220. CDDataBuf           equ (OS_BASE+0x0007000)
  221. FLOPPY_BUFF         equ (OS_BASE+0x0008000)
  222. ACTIVE_PROC_STACK   equ (OS_BASE+0x000A400) ;unused
  223.  
  224. WIN_STACK           equ (OS_BASE+0x000C000)
  225. WIN_POS             equ (OS_BASE+0x000C400)
  226. FDD_BUFF            equ (OS_BASE+0x000D000)
  227.  
  228. DRIVE_DATA          equ (OS_BASE+0x0070000)
  229.  
  230. SLOT_BASE           equ (OS_BASE+0x0080000)
  231.  
  232. VGABasePtr          equ (OS_BASE+0x00A0000)
  233.  
  234. RAMDISK_FAT         equ (OS_BASE+0x0180000)
  235. FLOPPY_FAT          equ (OS_BASE+0x0182000)
  236.  
  237. IDE_DMA             equ 0x184000
  238.  
  239. BgrAuxTable         equ (OS_BASE+0x0198000)
  240. ; unused?
  241. SB16Buffer          equ (OS_BASE+0x01A0000)
  242. SB16_Status         equ (OS_BASE+0x01B0000)
  243.  
  244. BUTTON_INFO         equ (OS_BASE+0x01C0000)
  245. RESERVED_PORTS      equ (OS_BASE+0x01D0000)
  246. IRQ_SAVE            equ (OS_BASE+0x01E0000)
  247. BOOT_VAR            equ (OS_BASE+0x01f0000)
  248.  
  249. stack_data_start    equ (OS_BASE+0x0200000)
  250. eth_data_start      equ (OS_BASE+0x0200000)
  251. stack_data          equ (OS_BASE+0x0204000)
  252. stack_data_end      equ (OS_BASE+0x021ffff)
  253. resendQ             equ (OS_BASE+0x0220000)
  254. VMODE_BASE          equ (OS_BASE+0x0228000)
  255. skin_data           equ (OS_BASE+0x0230000)
  256. draw_data           equ (OS_BASE+0x0238000);
  257.  
  258. BgrDrawMode         equ (OS_BASE+0x023BFF4)
  259. BgrDataWidth        equ (OS_BASE+0x023BFF8)
  260. BgrDataHeight       equ (OS_BASE+0x023BFFC)
  261.  
  262. virtual at              (OS_BASE+0x023CF80)
  263.   tss  TSS
  264. end virtual
  265.  
  266. LAST_PAGE           equ 0x0240000
  267.  
  268. ;sys_pgmap           equ (OS_BASE+LAST_PAGE)
  269.  
  270. twdw                equ 0x3000   ;(CURRENT_TASK-window_data)
  271.  
  272. std_application_base_address   equ new_app_base
  273. RING0_STACK_SIZE    equ (0x2000 - 512)    ;512 áàéò äëÿ êîíòåêñòà FPU
  274.  
  275. REG_SS              equ (RING0_STACK_SIZE-4)
  276. REG_APP_ESP         equ (RING0_STACK_SIZE-8)
  277. REG_EFLAGS          equ (RING0_STACK_SIZE-12)
  278. REG_CS              equ (RING0_STACK_SIZE-16)
  279. REG_EIP             equ (RING0_STACK_SIZE-20)
  280. REG_EAX             equ (RING0_STACK_SIZE-24)
  281. REG_ECX             equ (RING0_STACK_SIZE-28)
  282. REG_EDX             equ (RING0_STACK_SIZE-32)
  283. REG_EBX             equ (RING0_STACK_SIZE-36)
  284. REG_ESP             equ (RING0_STACK_SIZE-40)  ;RING0_STACK_SIZE-20
  285. REG_EBP             equ (RING0_STACK_SIZE-44)
  286. REG_ESI             equ (RING0_STACK_SIZE-48)
  287. REG_EDI             equ (RING0_STACK_SIZE-52)
  288. REG_RET             equ (RING0_STACK_SIZE-56)  ;irq0.return
  289.  
  290. REG_USTACK          equ (RING0_STACK_SIZE-56)
  291. REG_CSTACK          equ (RING0_STACK_SIZE-60)
  292. REG_RAW             equ (RING0_STACK_SIZE-64)
  293. REG_RESTART         equ (RING0_STACK_SIZE-68)
  294. REG_ENTRY           equ (RING0_STACK_SIZE-72)
  295.  
  296. PG_UNMAP            equ 0x000
  297. PG_MAP              equ 0x001
  298. PG_WRITE            equ 0x002
  299. PG_SW               equ 0x003
  300. PG_USER             equ 0x005
  301. PG_UW               equ 0x007
  302. PG_NOCACHE          equ 0x018
  303. PG_LARGE            equ 0x080
  304. PG_GLOBAL           equ 0x100
  305.  
  306. ;;;;;;;;;;;boot time variables
  307.  
  308. ;BOOT_BPP            equ 0x9000    ;byte   bits per pixel
  309. BOOT_SCANLINE       equ 0x9001    ;word   scanline length
  310. BOOT_VESA_MODE      equ 0x9008    ;word   vesa video mode
  311. ;;BOOT_X_RES          equ 0x900A    ;word   X res
  312. ;;BOOT_Y_RES          equ 0x900C    ;word   Y res
  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
  316. BOOT_LOG            equ 0x901D    ;byte   not used anymore (0 or 1 : enable system log display)
  317. BOOT_DIRECT_LFB     equ 0x901E    ;byte   0 or 1 : enable direct lfb write, paging disabled
  318. BOOT_PCI_DATA       equ 0x9020    ;8bytes pci data
  319. BOOT_VRR            equ 0x9030    ;byte   VRR start enabled 1, 2-no
  320. BOOT_IDE_BASE_ADDR  equ 0x9031   ;word   IDEContrRegsBaseAddr
  321. BOOT_MEM_AMOUNT     equ 0x9034    ;dword  memory amount
  322.  
  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
  336. EVENT_EXTENDED     equ 0x00000200
  337.  
  338. EV_INTR            equ 1
  339.  
  340. struc THR_DATA
  341. {
  342.                   rb (8192-512)
  343.   .pl0_stack:
  344.   .fpu_state      rb 512
  345.   .tls_page       rb 4096
  346.   .pdbr           rb 4096
  347. }
  348.  
  349. THR_DATA_SIZE     equ 4096*4
  350.  
  351. virtual at (OS_BASE-THR_DATA_SIZE)
  352.   thr_data  THR_DATA
  353. end virtual
  354.  
  355. struc SYS_VARS
  356. { .bpp            dd ?
  357.   .scanline       dd ?
  358.   .vesa_mode      dd ?
  359.   .x_res          dd ?
  360.   .y_res          dd ?
  361. }
  362.  
  363. struc APPOBJ           ;common object header
  364. {
  365.    .magic       dd ?   ;
  366.    .destroy     dd ?   ;internal destructor
  367.    .fd          dd ?   ;next object in list
  368.    .bk          dd ?   ;prev object in list
  369.    .pid         dd ?   ;owner id
  370. };
  371.  
  372. virtual at 0
  373.   APPOBJ APPOBJ
  374. end virtual
  375.  
  376. APP_OBJ_OFFSET  equ 48
  377. APP_EV_OFFSET   equ 40
  378.  
  379. struc CURSOR
  380. {;common object header
  381.    .magic       dd ?   ;'CURS'
  382.    .destroy     dd ?   ;internal destructor
  383.    .fd          dd ?   ;next object in list
  384.    .bk          dd ?   ;prev object in list
  385.    .pid         dd ?   ;owner id
  386.  
  387.  ;cursor data
  388.    .base        dd ?   ;allocated memory
  389.    .hot_x       dd ?   ;hotspot coords
  390.    .hot_y       dd ?
  391. }
  392. virtual at 0
  393.   CURSOR CURSOR
  394. end virtual
  395.  
  396. CURSOR_SIZE     equ 32
  397.  
  398. struc EVENT
  399. {
  400.    .magic       dd ?   ;'EVNT'
  401.    .destroy     dd ?   ;internal destructor
  402.    .fd          dd ?   ;next object in list
  403.    .bk          dd ?   ;prev object in list
  404.    .pid         dd ?   ;owner id
  405.  
  406.    .id          dd ?   ;event uid
  407.    .state       dd ?   ;internal flags
  408.    .code        dd ?
  409.                 rd 5
  410. }
  411. EVENT_SIZE  equ 52
  412.  
  413. virtual at 0
  414.   EVENT EVENT
  415. end virtual
  416.  
  417.  
  418. struc HEAP_DATA
  419. {
  420.    .mutex         rd 1
  421.    .refcount      rd 1
  422.    .heap_base     rd 1
  423.    .heap_top      rd 1
  424.    .app_mem       rd 1
  425. }
  426.  
  427. HEAP_DATA_SIZE  equ 20
  428. virtual at 0
  429.   HEAP_DATA HEAP_DATA
  430. end virtual
  431.  
  432. struc BOOT_DATA
  433. { .bpp            dd ?
  434.   .scanline       dd ?
  435.   .vesa_mode      dd ?
  436.   .x_res          dd ?
  437.   .y_res          dd ?
  438.   .mouse_port     dd ?
  439.   .bank_switch    dd ?
  440.   .lfb            dd ?
  441.   .vesa_mem       dd ?
  442.   .log            dd ?
  443.   .direct_lfb     dd ?
  444.   .pci_data       dd ?
  445. ;                  dd ?
  446.   .vrr            dd ?
  447.   .ide_base       dd ?
  448.   .mem_amount     dd ?
  449.   .pages_count    dd ?
  450.   .pagemap_size   dd ?
  451.   .kernel_max     dd ?
  452.   .kernel_pages   dd ?
  453.   .kernel_tables  dd ?
  454.  
  455.   .cpu_vendor     dd ?
  456.                   dd ?
  457.                   dd ?
  458.   .cpu_sign       dd ?
  459.   .cpu_info       dd ?
  460.   .cpu_caps       dd ?
  461.                   dd ?
  462.                   dd ?
  463. }
  464.  
  465. virtual at 0
  466.   BOOT_DATA BOOT_DATA
  467. end virtual
  468.  
  469. struc MEM_STATE
  470. {  .mutex             rd 1
  471.    .smallmap          rd 1
  472.    .treemap           rd 1
  473.    .topsize           rd 1
  474.    .top               rd 1
  475.    .smallbins         rd 4*32
  476.    .treebins          rd 32
  477. }
  478.  
  479. struc PG_DATA
  480. { .mem_amount        dd ?
  481.   .vesa_mem          dd ?
  482.   .pages_faults      dd ?
  483.   .pagemap_size      dd ?
  484.   .kernel_pages      dd ?
  485.   .kernel_tables     dd ?
  486.   .sys_page_dir      dd ?
  487.   .pg_mutex          dd ?
  488. }
  489.  
  490. ;struc LIB
  491. ;{ .lib_name         rb 16
  492. ;  .lib_base         dd ?
  493. ;  .lib_start        dd ?
  494. ;  .export           dd ?
  495. ;  .import           dd ?
  496. ;}
  497.  
  498. struc SRV
  499. { .srv_name          rb 16           ;ASCIIZ string
  500.   .magic             dd ?     ;+0x10 ;'SRV '
  501.   .size              dd ?     ;+0x14 ;size of structure SRV
  502.   .fd                dd ?     ;+0x18 ;next SRV descriptor
  503.   .bk                dd ?     ;+0x1C ;prev SRV descriptor
  504.   .base              dd ?     ;+0x20 ;service base address
  505.   .entry             dd ?     ;+0x24 ;service START function
  506.   .srv_proc          dd ?     ;+0x28 ;main service handler
  507. }
  508.  
  509. SRV_FD_OFFSET  equ 0x18
  510. SRV_SIZE       equ 44
  511.  
  512. DRV_ENTRY    equ  1
  513. DRV_EXIT     equ -1
  514.  
  515. struc COFF_HEADER
  516. {  .machine          dw ?
  517.    .nSections        dw ?
  518.    .DataTime         dd ?
  519.    .pSymTable        dd ?
  520.    .nSymbols         dd ?
  521.    .optHeader        dw ?
  522.    .flags            dw ?
  523. };
  524.  
  525.  
  526. struc COFF_SECTION
  527. {  .Name             rb 8
  528.    .VirtualSize      dd ?
  529.    .VirtualAddress   dd ?
  530.    .SizeOfRawData    dd ?
  531.    .PtrRawData       dd ?
  532.    .PtrReloc         dd ?
  533.    .PtrLinenumbers   dd ?
  534.    .NumReloc         dw ?
  535.    .NumLinenum       dw ?
  536.    .Characteristics  dd ?
  537. }
  538. COFF_SECTION_SIZE equ 40
  539.  
  540. struc COFF_RELOC
  541. {  .VirtualAddress   dd ?
  542.    .SymIndex         dd ?
  543.    .Type             dw ?
  544. }
  545.  
  546. struc COFF_SYM
  547. {  .Name             rb 8
  548.    .Value            dd ?
  549.    .SectionNumber    dw ?
  550.    .Type             dw ?
  551.    .StorageClass     db ?
  552.    .NumAuxSymbols    db ?
  553. }
  554. CSYM_SIZE equ 18
  555.  
  556. struc IOCTL
  557. {  .handle           dd ?
  558.    .io_code          dd ?
  559.    .input            dd ?
  560.    .inp_size         dd ?
  561.    .output           dd ?
  562.    .out_size         dd ?
  563. }
  564.  
  565. virtual at 0
  566.   IOCTL IOCTL
  567. end virtual
  568.  
  569. ;virtual at 0
  570. ;  LIB LIB
  571. ;end virtual
  572.  
  573. virtual at 0
  574.   SRV SRV
  575. end virtual
  576.  
  577. virtual at 0
  578.   CFH COFF_HEADER
  579. end virtual
  580.  
  581. virtual at 0
  582.   CFS COFF_SECTION
  583. end virtual
  584.  
  585. virtual at 0
  586.   CRELOC COFF_RELOC
  587. end virtual
  588.  
  589. virtual at 0
  590.   CSYM COFF_SYM
  591. end virtual
  592.  
  593. struc THR
  594. {
  595.   .edi            rd 1     ;   0x00
  596.   .esi            rd 1     ;   0x04
  597.   .ebp            rd 1     ;   0x08
  598.                   rd 1     ;   0x0C    ;esp
  599.   .ebx            rd 1     ;   0x10
  600.   .edx            rd 1     ;   0x14
  601.   .ecx            rd 1     ;   0x18
  602.   .eax            rd 1     ;   0x1C
  603.   .retaddr        rd 1     ;   0x20    ;èëè êîä îøèáêè
  604.   .eip            rd 1     ;   0x24
  605.   .cs             rd 1     ;   0x28
  606.   .eflags         rd 1     ;   0x2C
  607.   .esp            rd 1     ;   0x30
  608.   .ss             rd 1     ;   0x34
  609.  
  610.   .pl0_stack:
  611.  
  612.   .tid            rd 1     ;       ; number of this process (for fast access)
  613.   .slot           rd 1     ;       ; number of this process (for fast access)
  614.   .pdir           rd 1     ;       ;
  615.   .thr_flags      rd 1     ;       ; process is runnable only if zero
  616.   .ticks_left     rd 1     ;       ; number of scheduling ticks left
  617.   .quantum_size   rd 1     ;       ; quantum size in ticks
  618.   .user_time      rd 1     ;       ; user time in ticks
  619.   .sys_time       rd 1     ;       ; sys time in ticks
  620. }
  621.  
  622. virtual at 0
  623.   THR  THR
  624. end virtual
  625.  
  626.  
  627.