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