Rev 129 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 129 | Rev 384 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; KERNEL32.INC ;; |
3 | ;; KERNEL32.INC ;; |
4 | ;; ;; |
4 | ;; ;; |
5 | ;; Included 32 bit kernel files for MenuetOS ;; |
5 | ;; Included 32 bit kernel files for MenuetOS ;; |
6 | ;; ;; |
6 | ;; ;; |
7 | ;; This file is kept separate as it will be easier to ;; |
7 | ;; This file is kept separate as it will be easier to ;; |
8 | ;; maintain and compile with an automated SETUP program ;; |
8 | ;; maintain and compile with an automated SETUP program ;; |
9 | ;; in the future. ;; |
9 | ;; in the future. ;; |
10 | ;; ;; |
10 | ;; ;; |
11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | 12 | ||
13 | ; structure definition helper |
13 | ; structure definition helper |
14 | macro struct name, [arg] |
14 | macro struct name, [arg] |
15 | { |
15 | { |
16 | common |
16 | common |
17 | name@struct equ name |
17 | name@struct equ name |
18 | struc name arg { |
18 | struc name arg { |
19 | } |
19 | } |
20 | 20 | ||
21 | macro struct_helper name |
21 | macro struct_helper name |
22 | { |
22 | { |
23 | match xname,name |
23 | match xname,name |
24 | \{ |
24 | \{ |
25 | virtual at 0 |
25 | virtual at 0 |
26 | xname xname |
26 | xname xname |
27 | sizeof.#xname = $ - xname |
27 | sizeof.#xname = $ - xname |
28 | name equ sizeof.#xname |
28 | name equ sizeof.#xname |
29 | end virtual |
29 | end virtual |
30 | \} |
30 | \} |
31 | } |
31 | } |
32 | 32 | ||
33 | ends fix } struct_helper name@struct |
33 | ends fix } struct_helper name@struct |
34 | 34 | ||
35 | ;// mike.dld, 2006-29-01 [ |
35 | ;// mike.dld, 2006-29-01 [ |
36 | 36 | ||
37 | ; macros definition |
37 | ; macros definition |
38 | macro diff16 title,l1,l2 |
38 | macro diff16 title,l1,l2 |
39 | { |
39 | { |
40 | local s,d |
40 | local s,d |
41 | s = l2-l1 |
41 | s = l2-l1 |
42 | display title,': 0x' |
42 | display title,': 0x' |
43 | repeat 8 |
43 | repeat 8 |
44 | d = 48 + s shr ((8-%) shl 2) and $0F |
44 | d = 48 + s shr ((8-%) shl 2) and $0F |
45 | if d > 57 |
45 | if d > 57 |
46 | d = d + 65-57-1 |
46 | d = d + 65-57-1 |
47 | end if |
47 | end if |
48 | display d |
48 | display d |
49 | end repeat |
49 | end repeat |
50 | display 13,10 |
50 | display 13,10 |
51 | } |
51 | } |
- | 52 | ||
- | 53 | ; \begin{diamond}[29.09.2006] |
|
- | 54 | ; may be useful for kernel debugging |
|
- | 55 | ; example 1: |
|
- | 56 | ; dbgstr 'Hello, World!' |
|
- | 57 | ; example 2: |
|
- | 58 | ; dbgstr 'Hello, World!', save_flags |
|
- | 59 | macro dbgstr string*, f |
|
- | 60 | { |
|
- | 61 | local a |
|
- | 62 | iglobal_nested |
|
- | 63 | a db 'K : ',string,13,10,0 |
|
- | 64 | endg_nested |
|
- | 65 | if ~ f eq |
|
- | 66 | pushfd |
|
- | 67 | end if |
|
- | 68 | push esi |
|
- | 69 | mov esi, a |
|
- | 70 | call sys_msg_board_str |
|
- | 71 | pop esi |
|
- | 72 | if ~ f eq |
|
- | 73 | popfd |
|
- | 74 | end if |
|
- | 75 | } |
|
- | 76 | ; \end{diamond}[29.09.2006] |
|
52 | 77 | ||
53 | ;struc db [a] { common . db a |
78 | ;struc db [a] { common . db a |
54 | ; if ~used . |
79 | ; if ~used . |
55 | ; display 'not used db: ',`.,13,10 |
80 | ; display 'not used db: ',`.,13,10 |
56 | ; end if } |
81 | ; end if } |
57 | ;struc dw [a] { common . dw a |
82 | ;struc dw [a] { common . dw a |
58 | ; if ~used . |
83 | ; if ~used . |
59 | ; display 'not used dw: ',`.,13,10 |
84 | ; display 'not used dw: ',`.,13,10 |
60 | ; end if } |
85 | ; end if } |
61 | ;struc dd [a] { common . dd a |
86 | ;struc dd [a] { common . dd a |
62 | ; if ~used . |
87 | ; if ~used . |
63 | ; display 'not used dd: ',`.,13,10 |
88 | ; display 'not used dd: ',`.,13,10 |
64 | ; end if } |
89 | ; end if } |
65 | ;struc dp [a] { common . dp a |
90 | ;struc dp [a] { common . dp a |
66 | ; if ~used . |
91 | ; if ~used . |
67 | ; display 'not used dp: ',`.,13,10 |
92 | ; display 'not used dp: ',`.,13,10 |
68 | ; end if } |
93 | ; end if } |
69 | ;struc dq [a] { common . dq a |
94 | ;struc dq [a] { common . dq a |
70 | ; if ~used . |
95 | ; if ~used . |
71 | ; display 'not used dq: ',`.,13,10 |
96 | ; display 'not used dq: ',`.,13,10 |
72 | ; end if } |
97 | ; end if } |
73 | ;struc dt [a] { common . dt a |
98 | ;struc dt [a] { common . dt a |
74 | ; if ~used . |
99 | ; if ~used . |
75 | ; display 'not used dt: ',`.,13,10 |
100 | ; display 'not used dt: ',`.,13,10 |
76 | ; end if } |
101 | ; end if } |
77 | 102 | ||
78 | struc RECT { |
103 | struc RECT { |
79 | .left dd ? |
104 | .left dd ? |
80 | .top dd ? |
105 | .top dd ? |
81 | .right dd ? |
106 | .right dd ? |
82 | .bottom dd ? |
107 | .bottom dd ? |
83 | } |
108 | } |
84 | virtual at 0 |
109 | virtual at 0 |
85 | RECT RECT |
110 | RECT RECT |
86 | end virtual |
111 | end virtual |
87 | 112 | ||
88 | struc BOX { |
113 | struc BOX { |
89 | .left dd ? |
114 | .left dd ? |
90 | .top dd ? |
115 | .top dd ? |
91 | .width dd ? |
116 | .width dd ? |
92 | .height dd ? |
117 | .height dd ? |
93 | } |
118 | } |
94 | virtual at 0 |
119 | virtual at 0 |
95 | BOX BOX |
120 | BOX BOX |
96 | end virtual |
121 | end virtual |
97 | 122 | ||
98 | ; constants definition |
123 | ; constants definition |
99 | WSTATE_NORMAL = 00000000b |
124 | WSTATE_NORMAL = 00000000b |
100 | WSTATE_MAXIMIZED = 00000001b |
125 | WSTATE_MAXIMIZED = 00000001b |
101 | WSTATE_MINIMIZED = 00000010b |
126 | WSTATE_MINIMIZED = 00000010b |
102 | WSTATE_ROLLEDUP = 00000100b |
127 | WSTATE_ROLLEDUP = 00000100b |
103 | 128 | ||
104 | WSTATE_REDRAW = 00000001b |
129 | WSTATE_REDRAW = 00000001b |
105 | WSTATE_WNDDRAWN = 00000010b |
130 | WSTATE_WNDDRAWN = 00000010b |
106 | 131 | ||
107 | WSTYLE_HASCAPTION = 00010000b |
132 | WSTYLE_HASCAPTION = 00010000b |
108 | WSTYLE_CLIENTRELATIVE = 00100000b |
133 | WSTYLE_CLIENTRELATIVE = 00100000b |
109 | 134 | ||
110 | struc TASKDATA |
135 | struc TASKDATA |
111 | { |
136 | { |
112 | .event_mask dd ? |
137 | .event_mask dd ? |
113 | .pid dd ? |
138 | .pid dd ? |
114 | dw ? |
139 | dw ? |
115 | .state db ? |
140 | .state db ? |
116 | db ? |
141 | db ? |
117 | dw ? |
142 | dw ? |
118 | .wnd_number db ? |
143 | .wnd_number db ? |
119 | db ? |
144 | db ? |
120 | .mem_start dd ? |
145 | .mem_start dd ? |
121 | .counter_sum dd ? |
146 | .counter_sum dd ? |
122 | .counter_add dd ? |
147 | .counter_add dd ? |
123 | .cpu_usage dd ? |
148 | .cpu_usage dd ? |
124 | } |
149 | } |
125 | virtual at 0 |
150 | virtual at 0 |
126 | TASKDATA TASKDATA |
151 | TASKDATA TASKDATA |
127 | end virtual |
152 | end virtual |
128 | 153 | ||
129 | ; structures definition |
154 | ; structures definition |
130 | struc WDATA { |
155 | struc WDATA { |
131 | .box BOX |
156 | .box BOX |
132 | .cl_workarea dd ? |
157 | .cl_workarea dd ? |
133 | .cl_titlebar dd ? |
158 | .cl_titlebar dd ? |
134 | .cl_frames dd ? |
159 | .cl_frames dd ? |
135 | .reserved db ? |
160 | .reserved db ? |
136 | .fl_wstate db ? |
161 | .fl_wstate db ? |
137 | .fl_wdrawn db ? |
162 | .fl_wdrawn db ? |
138 | .fl_redraw db ? |
163 | .fl_redraw db ? |
139 | } |
164 | } |
140 | virtual at 0 |
165 | virtual at 0 |
141 | WDATA WDATA |
166 | WDATA WDATA |
142 | end virtual |
167 | end virtual |
143 | label WDATA.fl_wstyle byte at 0x13 |
168 | label WDATA.fl_wstyle byte at 0x13 |
144 | 169 | ||
145 | struc APPDATA |
170 | struc APPDATA |
146 | { |
171 | { |
147 | .app_name db 11 dup(?) |
172 | .app_name db 11 dup(?) |
148 | db 5 dup(?) |
173 | db 5 dup(?) |
- | 174 | ||
149 | .fpu_save_area: db 108 dup(?) |
175 | .fpu_state dd ? ;+16 |
150 | db 3 dup(?) |
176 | .ev_count dd ? ;+20 |
151 | .is_fpu_saved db ? |
177 | .fpu_handler dd ? ;+24 |
- | 178 | .sse_handler dd ? ;+28 |
|
- | 179 | .pl0_stack dd ? ;unused ;+32 |
|
- | 180 | .heap_base dd ? ;+36 |
|
- | 181 | .heap_top dd ? ;+40 |
|
- | 182 | .cursor dd ? ;+44 |
|
- | 183 | .fd_ev dd ? ;+48 |
|
- | 184 | .bk_ev dd ? ;+52 |
|
- | 185 | .fd_obj dd ? ;+56 |
|
- | 186 | .bk_obj dd ? ;+60 |
|
- | 187 | ||
- | 188 | db 64 dup(?) ;+64 |
|
- | 189 | ||
152 | .wnd_shape dd ? |
190 | .wnd_shape dd ? ;+128 |
153 | .wnd_shape_scale dd ? |
191 | .wnd_shape_scale dd ? ;+132 |
154 | dd ? |
192 | dd ? ;+136 |
155 | .mem_size dd ? |
193 | .mem_size dd ? ;+140 |
156 | .saved_box BOX |
194 | .saved_box BOX |
157 | .ipc_start dd ? |
195 | .ipc_start dd ? |
158 | .ipc_size dd ? |
196 | .ipc_size dd ? |
159 | .event_mask dd ? |
197 | .event_mask dd ? |
160 | .debugger_slot dd ? |
198 | .debugger_slot dd ? |
161 | dd ? |
199 | dd ? |
162 | .keyboard_mode db ? |
200 | .keyboard_mode db ? |
163 | db 3 dup(?) |
201 | db 3 dup(?) |
164 | .dir_table dd ? |
202 | .dir_table dd ? |
165 | .dbg_event_mem dd ? |
203 | .dbg_event_mem dd ? |
166 | .dbg_regs: |
204 | .dbg_regs: |
167 | .dbg_regs.dr0 dd ? |
205 | .dbg_regs.dr0 dd ? |
168 | .dbg_regs.dr1 dd ? |
206 | .dbg_regs.dr1 dd ? |
169 | .dbg_regs.dr2 dd ? |
207 | .dbg_regs.dr2 dd ? |
170 | .dbg_regs.dr3 dd ? |
208 | .dbg_regs.dr3 dd ? |
171 | .dbg_regs.dr7 dd ? |
209 | .dbg_regs.dr7 dd ? |
172 | .wnd_caption dd ? |
210 | .wnd_caption dd ? |
173 | .wnd_clientbox BOX |
211 | .wnd_clientbox BOX |
174 | } |
212 | } |
175 | virtual at 0 |
213 | virtual at 0 |
176 | APPDATA APPDATA |
214 | APPDATA APPDATA |
177 | end virtual |
215 | end virtual |
178 | 216 | ||
179 | ;// mike.dld, 2006-29-01 ] |
217 | ;// mike.dld, 2006-29-01 ] |
180 | 218 | ||
181 | 219 | ||
182 | ; Core functions |
220 | ; Core functions |
183 | include "core/sync.inc" ; macros for synhronization objects |
221 | include "core/sync.inc" ; macros for synhronization objects |
184 | include "core/sys32.inc" ; process management |
222 | include "core/sys32.inc" ; process management |
185 | include "core/sched.inc" ; process scheduling |
223 | include "core/sched.inc" ; process scheduling |
186 | include "core/syscall.inc" ; system call |
224 | include "core/syscall.inc" ; system call |
187 | include "core/mem.inc" ; high-level memory management |
225 | include "core/fpu.inc" ; all fpu/sse support |
- | 226 | include "core/memory.inc" |
|
188 | include "core/newproce.inc" ;new process management |
227 | include "core/heap.inc" ; kernel and app heap |
189 | include "core/physmem.inc" ; access to physical memory for applications |
228 | include "core/malloc.inc" ; small kernel heap |
- | 229 | include "core/taskman.inc" |
|
- | 230 | include "core/dll.inc" |
|
- | 231 | include "core/exports.inc" |
|
190 | 232 | ||
191 | ; GUI stuff |
233 | ; GUI stuff |
192 | include "gui/window.inc" |
234 | include "gui/window.inc" |
193 | include "gui/event.inc" |
235 | include "gui/event.inc" |
194 | include "gui/font.inc" |
236 | include "gui/font.inc" |
195 | include "gui/button.inc" |
237 | include "gui/button.inc" |
196 | 238 | ||
197 | ; shutdown |
239 | ; shutdown |
198 | 240 | ||
199 | include "boot/shutdown.inc" ; shutdown or restart |
241 | include "boot/shutdown.inc" ; shutdown or restart |
200 | 242 | ||
201 | ; file system |
243 | ; file system |
202 | 244 | ||
203 | include "fs/fs.inc" ; syscall |
245 | include "fs/fs.inc" ; syscall |
204 | include "fs/fat32.inc" ; read / write for fat32 filesystem |
246 | include "fs/fat32.inc" ; read / write for fat32 filesystem |
- | 247 | include "fs/ntfs.inc" ; read / write for ntfs filesystem |
|
205 | include "fs/fat12.inc" ; read / write for fat12 filesystem |
248 | include "fs/fat12.inc" ; read / write for fat12 filesystem |
206 | include "blkdev/rd.inc" ; ramdisk read /write |
249 | include "blkdev/rd.inc" ; ramdisk read /write |
207 | include "fs/fs_lfn.inc" ; syscall, version 2 |
250 | include "fs/fs_lfn.inc" ; syscall, version 2 |
208 | include "fs/iso9660.inc" ; read for iso9660 filesystem CD |
251 | include "fs/iso9660.inc" ; read for iso9660 filesystem CD |
209 | 252 | ||
210 | ; sound |
253 | ; sound |
211 | 254 | ||
212 | include "sound/sb16.inc" ; playback for Sound Blaster 16 |
255 | include "sound/sb16.inc" ; playback for Sound Blaster 16 |
213 | include "sound/playnote.inc" ; player Note for Speaker PC |
256 | include "sound/playnote.inc" ; player Note for Speaker PC |
214 | 257 | ||
215 | ; display |
258 | ; display |
216 | 259 | ||
217 | include "video/vesa12.inc" ; Vesa 1.2 functions |
260 | include "video/vesa12.inc" ; Vesa 1.2 functions |
218 | include "video/vesa20.inc" ; Vesa 2.0 functions |
261 | include "video/vesa20.inc" ; Vesa 2.0 functions |
219 | include "video/vga.inc" ; VGA 16 color functions |
262 | include "video/vga.inc" ; VGA 16 color functions |
- | 263 | include "video/cursors.inc" ; cursors functions |
|
220 | 264 | ||
221 | ; Network Interface & TCPIP Stack |
265 | ; Network Interface & TCPIP Stack |
222 | 266 | ||
223 | include "network/stack.inc" |
267 | include "network/stack.inc" |
224 | 268 | ||
225 | ; Mouse pointer |
269 | ; Mouse pointer |
226 | 270 | ||
227 | include "gui/mouse.inc" |
271 | include "gui/mouse.inc" |
228 | 272 | ||
229 | ; Window skinning |
273 | ; Window skinning |
230 | 274 | ||
231 | include "gui/skincode.inc" |
275 | include "gui/skincode.inc" |
232 | 276 | ||
233 | ; Pci functions |
277 | ; Pci functions |
234 | 278 | ||
235 | include "bus/pci/pci32.inc" |
279 | include "bus/pci/pci32.inc" |
236 | 280 | ||
237 | ; Floppy drive controller |
281 | ; Floppy drive controller |
238 | 282 | ||
239 | include "blkdev/fdc.inc" |
283 | include "blkdev/fdc.inc" |
240 | include "blkdev/flp_drv.inc" |
284 | include "blkdev/flp_drv.inc" |
- | 285 | ||
- | 286 | ; HD drive controller |
|
- | 287 | include "blkdev/hd_drv.inc" |
|
241 | 288 | ||
242 | ; CD drive controller |
289 | ; CD drive controller |
243 | 290 | ||
244 | include "blkdev/cdrom.inc" |
291 | include "blkdev/cdrom.inc" |
245 | include "blkdev/cd_drv.inc" |
292 | include "blkdev/cd_drv.inc" |
246 | 293 | ||
247 | ; Character devices |
294 | ; Character devices |
248 | 295 | ||
249 | include "hid/keyboard.inc" |
296 | include "hid/keyboard.inc" |
250 | include "hid/mousedrv.inc" |
297 | include "hid/mousedrv.inc" |
251 | 298 | ||
252 | ; setting date,time,clock and alarm-clock |
299 | ; setting date,time,clock and alarm-clock |
253 | 300 | ||
254 | include "hid/set_dtc.inc" |
301 | include "hid/set_dtc.inc" |
255 | 302 | ||
256 | ;% -include |
303 | ;% -include |