Rev 1508 | Rev 1641 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1508 | Rev 1551 | ||
---|---|---|---|
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: 1508 $ |
16 | $Revision: 1551 $ |
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 ? ;unused ;+32 |
147 | .pl0_stack dd ? ;unused ;+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 | .count rd 1 |
199 | .count rd 1 |
200 | .next rd 1 |
200 | .next rd 1 |
201 | .prev rd 1 |
201 | .prev rd 1 |
202 | } |
202 | } |
203 | 203 | ||
204 | virtual at 0 |
204 | virtual at 0 |
205 | MUTEX MUTEX |
205 | MUTEX MUTEX |
206 | end virtual |
206 | end virtual |
207 | 207 | ||
208 | 208 | ||
209 | ; Core functions |
209 | ; Core functions |
210 | include "core/sync.inc" ; macros for synhronization objects |
210 | include "core/sync.inc" ; macros for synhronization objects |
211 | include "core/sys32.inc" ; process management |
211 | include "core/sys32.inc" ; process management |
212 | include "core/sched.inc" ; process scheduling |
212 | include "core/sched.inc" ; process scheduling |
213 | include "core/syscall.inc" ; system call |
213 | include "core/syscall.inc" ; system call |
214 | include "core/fpu.inc" ; all fpu/sse support |
214 | include "core/fpu.inc" ; all fpu/sse support |
215 | include "core/memory.inc" |
215 | include "core/memory.inc" |
216 | include "core/heap.inc" ; kernel and app heap |
216 | include "core/heap.inc" ; kernel and app heap |
217 | include "core/malloc.inc" ; small kernel heap |
217 | include "core/malloc.inc" ; small kernel heap |
218 | include "core/taskman.inc" |
218 | include "core/taskman.inc" |
219 | include "core/dll.inc" |
219 | include "core/dll.inc" |
220 | include "core/peload.inc" ; |
220 | include "core/peload.inc" ; |
221 | include "core/exports.inc" |
221 | include "core/exports.inc" |
222 | include "core/string.inc" |
222 | include "core/string.inc" |
223 | include "core/v86.inc" ; virtual-8086 manager |
223 | include "core/v86.inc" ; virtual-8086 manager |
224 | 224 | ||
225 | ; GUI stuff |
225 | ; GUI stuff |
226 | include "gui/window.inc" |
226 | include "gui/window.inc" |
227 | include "gui/event.inc" |
227 | include "gui/event.inc" |
228 | include "gui/font.inc" |
228 | include "gui/font.inc" |
229 | include "gui/button.inc" |
229 | include "gui/button.inc" |
230 | 230 | ||
231 | ; shutdown |
231 | ; shutdown |
232 | 232 | ||
233 | ; file system |
233 | ; file system |
234 | 234 | ||
235 | include "fs/fs.inc" ; syscall |
235 | include "fs/fs.inc" ; syscall |
236 | include "fs/fat32.inc" ; read / write for fat32 filesystem |
236 | include "fs/fat32.inc" ; read / write for fat32 filesystem |
237 | include "fs/ntfs.inc" ; read / write for ntfs filesystem |
237 | include "fs/ntfs.inc" ; read / write for ntfs filesystem |
238 | include "fs/fat12.inc" ; read / write for fat12 filesystem |
238 | include "fs/fat12.inc" ; read / write for fat12 filesystem |
239 | include "blkdev/rd.inc" ; ramdisk read /write |
239 | include "blkdev/rd.inc" ; ramdisk read /write |
240 | include "fs/fs_lfn.inc" ; syscall, version 2 |
240 | include "fs/fs_lfn.inc" ; syscall, version 2 |
241 | include "fs/iso9660.inc" ; read for iso9660 filesystem CD |
241 | include "fs/iso9660.inc" ; read for iso9660 filesystem CD |
242 | include "fs/ext2.inc" ; read / write for ext2 filesystem |
242 | include "fs/ext2.inc" ; read / write for ext2 filesystem |
243 | 243 | ||
244 | ; sound |
244 | ; sound |
245 | 245 | ||
246 | include "sound/playnote.inc" ; player Note for Speaker PC |
246 | include "sound/playnote.inc" ; player Note for Speaker PC |
247 | 247 | ||
248 | ; display |
248 | ; display |
249 | 249 | ||
250 | ;include "video/vesa12.inc" ; Vesa 1.2 functions |
250 | ;include "video/vesa12.inc" ; Vesa 1.2 functions |
251 | include "video/vesa20.inc" ; Vesa 2.0 functions |
251 | include "video/vesa20.inc" ; Vesa 2.0 functions |
252 | include "video/vga.inc" ; VGA 16 color functions |
252 | include "video/vga.inc" ; VGA 16 color functions |
253 | include "video/cursors.inc" ; cursors functions |
253 | include "video/cursors.inc" ; cursors functions |
254 | 254 | ||
255 | ; Network Interface & TCPIP Stack |
255 | ; Network Interface & TCPIP Stack |
256 | 256 | ||
257 | include "network/stack.inc" |
257 | include "network/stack.inc" |
258 | 258 | ||
259 | ;include "drivers/uart.inc" |
259 | ;include "drivers/uart.inc" |
260 | 260 | ||
261 | 261 | ||
262 | ; Mouse pointer |
262 | ; Mouse pointer |
263 | 263 | ||
264 | include "gui/mouse.inc" |
264 | include "gui/mouse.inc" |
265 | 265 | ||
266 | ; Window skinning |
266 | ; Window skinning |
267 | 267 | ||
268 | include "gui/skincode.inc" |
268 | include "gui/skincode.inc" |
269 | 269 | ||
270 | ; Pci functions |
270 | ; Pci functions |
271 | include "bus/pci/pci32.inc" |
271 | include "bus/pci/pci32.inc" |
272 | include "bus/pci/pcie.inc" |
272 | include "bus/pci/pcie.inc" |
- | 273 | include "bus/ht.inc" ; AMD HyperTransport bus control |
|
273 | 274 | ||
274 | ; Floppy drive controller |
275 | ; Floppy drive controller |
275 | 276 | ||
276 | include "blkdev/fdc.inc" |
277 | include "blkdev/fdc.inc" |
277 | include "blkdev/flp_drv.inc" |
278 | include "blkdev/flp_drv.inc" |
278 | 279 | ||
279 | ; IDE cache |
280 | ; IDE cache |
280 | include "blkdev/ide_cache.inc" |
281 | include "blkdev/ide_cache.inc" |
281 | 282 | ||
282 | ; HD drive controller |
283 | ; HD drive controller |
283 | include "blkdev/hd_drv.inc" |
284 | include "blkdev/hd_drv.inc" |
284 | 285 | ||
285 | ; CD drive controller |
286 | ; CD drive controller |
286 | 287 | ||
287 | include "blkdev/cdrom.inc" |
288 | include "blkdev/cdrom.inc" |
288 | include "blkdev/cd_drv.inc" |
289 | include "blkdev/cd_drv.inc" |
289 | 290 | ||
290 | ; Character devices |
291 | ; Character devices |
291 | 292 | ||
292 | include "hid/keyboard.inc" |
293 | include "hid/keyboard.inc" |
293 | include "hid/mousedrv.inc" |
294 | include "hid/mousedrv.inc" |
294 | 295 | ||
295 | ; setting date,time,clock and alarm-clock |
296 | ; setting date,time,clock and alarm-clock |
296 | 297 | ||
297 | include "hid/set_dtc.inc" |
298 | include "hid/set_dtc.inc" |
298 | 299 | ||
299 | ;% -include |
300 | ;% -include |
300 | 301 | ||
301 | ;parser file names |
302 | ;parser file names |
302 | include "fs/parse_fn.inc" |
303 | include "fs/parse_fn.inc" |
303 | 304 | ||
304 | ; work with conf lib |
305 | ; work with conf lib |
305 | include "core/conf_lib.inc" |
306 | include "core/conf_lib.inc" |
306 | 307 | ||
307 | ; load external lib |
308 | ; load external lib |
308 | include "core/ext_lib.inc" |
309 | include "core/ext_lib.inc" |
309 | 310 | ||
310 | ; list of external functions |
311 | ; list of external functions |
311 | include "imports.inc" |
312 | include "imports.inc" |