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