Subversion Repositories Kolibri OS

Rev

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

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                              ;;
  3. ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
  4. ;; Distributed under terms of the GNU General Public License    ;;
  5. ;;                                                              ;;
  6. ;; KERNEL32.INC                                                 ;;
  7. ;;                                                              ;;
  8. ;; Included 32 bit kernel files for MenuetOS                    ;;
  9. ;;                                                              ;;
  10. ;; This file is kept separate as it will be easier to           ;;
  11. ;; maintain and compile with an automated SETUP program         ;;
  12. ;; in the future.                                               ;;
  13. ;;                                                              ;;
  14. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  15.  
  16. $Revision: 2143 $
  17.  
  18.  
  19. ;struc db [a] { common . db a
  20. ;  if ~used .
  21. ;    display 'not used db: ',`.,13,10
  22. ;  end if }
  23. ;struc dw [a] { common . dw a
  24. ;  if ~used .
  25. ;    display 'not used dw: ',`.,13,10
  26. ;  end if }
  27. ;struc dd [a] { common . dd a
  28. ;  if ~used .
  29. ;    display 'not used dd: ',`.,13,10
  30. ;  end if }
  31. ;struc dp [a] { common . dp a
  32. ;  if ~used .
  33. ;    display 'not used dp: ',`.,13,10
  34. ;  end if }
  35. ;struc dq [a] { common . dq a
  36. ;  if ~used .
  37. ;    display 'not used dq: ',`.,13,10
  38. ;  end if }
  39. ;struc dt [a] { common . dt a
  40. ;  if ~used .
  41. ;    display 'not used dt: ',`.,13,10
  42. ;  end if }
  43.  
  44. struc POINT {
  45.   .x dd ?
  46.   .y dd ?
  47.   .sizeof:
  48. }
  49. virtual at 0
  50.  POINT POINT
  51. end virtual
  52.  
  53. struc RECT {
  54.   .left   dd ?
  55.   .top    dd ?
  56.   .right  dd ?
  57.   .bottom dd ?
  58.   .sizeof:
  59. }
  60. virtual at 0
  61.  RECT RECT
  62. end virtual
  63.  
  64. struc BOX {
  65.   .left   dd ?
  66.   .top    dd ?
  67.   .width  dd ?
  68.   .height dd ?
  69.   .sizeof:
  70. }
  71. virtual at 0
  72.  BOX BOX
  73. end virtual
  74.  
  75. struc DISPMODE {
  76.   .width   rw 1
  77.   .height  rw 1
  78.   .bpp     rw 1
  79.   .freq    rw 1
  80. }
  81.  
  82. ; constants definition
  83. WSTATE_NORMAL    = 00000000b
  84. WSTATE_MAXIMIZED = 00000001b
  85. WSTATE_MINIMIZED = 00000010b
  86. WSTATE_ROLLEDUP  = 00000100b
  87.  
  88. WSTATE_REDRAW    = 00000001b
  89. WSTATE_WNDDRAWN  = 00000010b
  90.  
  91. WSTYLE_HASCAPTION     = 00010000b
  92. WSTYLE_CLIENTRELATIVE = 00100000b
  93.  
  94. struc TASKDATA
  95. {
  96.   .event_mask  dd ?
  97.   .pid         dd ?
  98.                dw ?
  99.   .state       db ?
  100.                db ?
  101.                dw ?
  102.   .wnd_number  db ?
  103.                db ?
  104.   .mem_start   dd ?
  105.   .counter_sum dd ?
  106.   .counter_add dd ?
  107.   .cpu_usage   dd ?
  108. }
  109. virtual at 0
  110.  TASKDATA TASKDATA
  111. end virtual
  112.  
  113. TSTATE_RUNNING        = 0
  114. TSTATE_RUN_SUSPENDED  = 1
  115. TSTATE_WAIT_SUSPENDED = 2
  116. TSTATE_ZOMBIE         = 3
  117. TSTATE_TERMINATING    = 4
  118. TSTATE_WAITING        = 5
  119. TSTATE_FREE           = 9
  120.  
  121. ; structures definition
  122. struc WDATA {
  123.   .box             BOX
  124.   .cl_workarea     dd ?
  125.   .cl_titlebar     dd ?
  126.   .cl_frames       dd ?
  127.   .reserved        db ?
  128.   .fl_wstate       db ?
  129.   .fl_wdrawn       db ?
  130.   .fl_redraw       db ?
  131.   .sizeof:
  132. }
  133. virtual at 0
  134.  WDATA WDATA
  135. end virtual
  136. label WDATA.fl_wstyle byte at WDATA.cl_workarea + 3
  137.  
  138. struc APPDATA
  139. {
  140.   .app_name        db 11  dup(?)
  141.                    db 5   dup(?)
  142.  
  143.   .fpu_state       dd ?            ;+16
  144.   .ev_count_       dd ? ;unused    ;+20
  145.   .exc_handler     dd ?            ;+24
  146.   .except_mask     dd ?            ;+28
  147.   .pl0_stack       dd ?            ;+32
  148.   .heap_base       dd ?            ;+36
  149.   .heap_top        dd ?            ;+40
  150.   .cursor          dd ?            ;+44
  151.   .fd_ev           dd ?            ;+48
  152.   .bk_ev           dd ?            ;+52
  153.   .fd_obj          dd ?            ;+56
  154.   .bk_obj          dd ?            ;+60
  155.   .saved_esp       dd ?            ;+64
  156.   .io_map          rd 2            ;+68
  157.   .dbg_state       dd ?            ;+76
  158.   .cur_dir         dd ?            ;+80
  159.   .wait_timeout    dd ?            ;+84
  160.   .saved_esp0      dd ?            ;+88
  161.   .wait_begin      dd ?            ;+92   +++
  162.   .wait_test       dd ?            ;+96   +++
  163.   .wait_param      dd ?            ;+100  +++
  164.   .tls_base        dd ?            ;+104
  165.   .dlls_list_ptr   dd ?            ;+108
  166.                    db 16 dup(?)    ;+112
  167.  
  168.   .wnd_shape       dd ?            ;+128
  169.   .wnd_shape_scale dd ?            ;+132
  170.                    dd ?            ;+136
  171.   .mem_size        dd ?            ;+140
  172.   .saved_box       BOX
  173.   .ipc_start       dd ?
  174.   .ipc_size        dd ?
  175.   .event_mask      dd ?
  176.   .debugger_slot   dd ?
  177.                    dd ?
  178.   .keyboard_mode   db ?
  179.                    db 3   dup(?)
  180.   .dir_table       dd ?
  181.   .dbg_event_mem   dd ?
  182.   .dbg_regs:
  183.   .dbg_regs.dr0    dd ?
  184.   .dbg_regs.dr1    dd ?
  185.   .dbg_regs.dr2    dd ?
  186.   .dbg_regs.dr3    dd ?
  187.   .dbg_regs.dr7    dd ?
  188.   .wnd_caption     dd ?
  189.   .wnd_clientbox   BOX
  190. }
  191. virtual at 0
  192.  APPDATA APPDATA
  193. end virtual
  194.  
  195. ;// mike.dld, 2006-29-01 ]
  196.  
  197. struc MUTEX
  198. {
  199.     .wait   LHEAD
  200.     .count  rd 1
  201. }
  202.  
  203. virtual at 0
  204.  MUTEX MUTEX
  205. end virtual
  206.  
  207.  
  208. ; Core functions
  209. include "core/sync.inc"     ; macros for synhronization objects
  210. include "core/sys32.inc"    ; process management
  211. include "core/sched.inc"    ; process scheduling
  212. include "core/syscall.inc"  ; system call
  213. include "core/fpu.inc"      ; all fpu/sse support
  214. include "core/memory.inc"
  215. include "core/heap.inc"     ; kernel and app heap
  216. include "core/malloc.inc"   ; small kernel heap
  217. include "core/taskman.inc"
  218. include "core/dll.inc"
  219. include "core/peload.inc"   ;
  220. include "core/exports.inc"
  221. include "core/string.inc"
  222. include "core/v86.inc"      ; virtual-8086 manager
  223. include "core/apic.inc"     ; Interrupt Controller functions
  224. include "core/irq.inc"      ; irq handling functions
  225. include "core/timers.inc"
  226.  
  227. ; GUI stuff
  228. include "gui/window.inc"
  229. include "gui/event.inc"
  230. include "gui/font.inc"
  231. include "gui/button.inc"
  232.  
  233. ; shutdown
  234.  
  235. ; file system
  236.  
  237. include "blkdev/disk.inc" ; support for plug-n-play disks
  238. include "blkdev/disk_cache.inc" ; caching for plug-n-play disks
  239. include "fs/fs.inc"       ; syscall
  240. include "fs/fat32.inc"    ; read / write for fat32 filesystem
  241. include "fs/ntfs.inc"     ; read / write for ntfs filesystem
  242. include "fs/fat12.inc"    ; read / write for fat12 filesystem
  243. include "blkdev/rd.inc"   ; ramdisk read /write
  244. include "fs/fs_lfn.inc"    ; syscall, version 2
  245. include "fs/iso9660.inc"  ; read for iso9660 filesystem CD
  246. include "fs/ext2.inc"     ; read / write for ext2 filesystem
  247.  
  248. ; sound
  249.  
  250. include "sound/playnote.inc" ; player Note for Speaker PC
  251.  
  252. ; display
  253.  
  254. include "video/vesa12.inc"   ; Vesa 1.2 functions
  255. include "video/vesa20.inc"   ; Vesa 2.0 functions
  256. include "video/blitter.inc"  ;
  257. include "video/vga.inc"      ; VGA 16 color functions
  258. include "video/cursors.inc"  ; cursors functions
  259.  
  260. ; Network Interface & TCPIP Stack
  261.  
  262. include "network/stack.inc"
  263.  
  264. ;include "drivers/uart.inc"
  265.  
  266.  
  267. ; Mouse pointer
  268.  
  269. include "gui/mouse.inc"
  270.  
  271. ; Window skinning
  272.  
  273. include "gui/skincode.inc"
  274.  
  275. ; Pci functions
  276.  
  277. include "bus/pci/pci32.inc"
  278.  
  279. ; Floppy drive controller
  280.  
  281. include "blkdev/fdc.inc"
  282. include "blkdev/flp_drv.inc"
  283.  
  284. ; IDE cache
  285. include "blkdev/ide_cache.inc"
  286.  
  287. ; HD drive controller
  288. include "blkdev/hd_drv.inc"
  289.  
  290. ; CD drive controller
  291.  
  292. include "blkdev/cdrom.inc"
  293. include "blkdev/cd_drv.inc"
  294.  
  295. ; Character devices
  296.  
  297. include "hid/keyboard.inc"
  298. include "hid/mousedrv.inc"
  299.  
  300. ; setting date,time,clock and alarm-clock
  301.  
  302. include "hid/set_dtc.inc"
  303.  
  304. ;% -include
  305.  
  306. ;parser file names
  307. include "fs/parse_fn.inc"
  308.  
  309. ; work with conf lib
  310. include "core/conf_lib.inc"
  311.  
  312. ; load external lib
  313. include "core/ext_lib.inc"
  314.  
  315. ; list of external functions
  316. include "imports.inc"
  317.