Subversion Repositories Kolibri OS

Rev

Rev 425 | Rev 431 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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