Subversion Repositories Kolibri OS

Rev

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

Rev 114 Rev 115
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
 
52
 
53
struc db [a] { common . db a
53
struc db [a] { common . db a
54
  if ~used .
54
  if ~used .
55
    display 'not used db: ',`.,13,10
55
    display 'not used db: ',`.,13,10
56
  end if }
56
  end if }
57
struc dw [a] { common . dw a
57
struc dw [a] { common . dw a
58
  if ~used .
58
  if ~used .
59
    display 'not used dw: ',`.,13,10
59
    display 'not used dw: ',`.,13,10
60
  end if }
60
  end if }
61
struc dd [a] { common . dd a
61
struc dd [a] { common . dd a
62
  if ~used .
62
  if ~used .
63
    display 'not used dd: ',`.,13,10
63
    display 'not used dd: ',`.,13,10
64
  end if }
64
  end if }
65
struc dp [a] { common . dp a
65
struc dp [a] { common . dp a
66
  if ~used .
66
  if ~used .
67
    display 'not used dp: ',`.,13,10
67
    display 'not used dp: ',`.,13,10
68
  end if }
68
  end if }
69
struc dq [a] { common . dq a
69
struc dq [a] { common . dq a
70
  if ~used .
70
  if ~used .
71
    display 'not used dq: ',`.,13,10
71
    display 'not used dq: ',`.,13,10
72
  end if }
72
  end if }
73
struc dt [a] { common . dt a
73
struc dt [a] { common . dt a
74
  if ~used .
74
  if ~used .
75
    display 'not used dt: ',`.,13,10
75
    display 'not used dt: ',`.,13,10
76
  end if }
76
  end if }
77
 
77
 
78
struc RECT {
78
struc RECT {
79
  .left   dd ?
79
  .left   dd ?
80
  .top    dd ?
80
  .top    dd ?
81
  .right  dd ?
81
  .right  dd ?
82
  .bottom dd ?
82
  .bottom dd ?
83
}
83
}
84
virtual at 0
84
virtual at 0
85
 RECT RECT
85
 RECT RECT
86
end virtual
86
end virtual
87
 
87
 
88
struc BOX {
88
struc BOX {
89
  .left   dd ?
89
  .left   dd ?
90
  .top    dd ?
90
  .top    dd ?
91
  .width  dd ?
91
  .width  dd ?
92
  .height dd ?
92
  .height dd ?
93
}
93
}
94
virtual at 0
94
virtual at 0
95
 BOX BOX
95
 BOX BOX
96
end virtual
96
end virtual
97
 
97
 
98
; constants definition
98
; constants definition
99
WSTATE_NORMAL	 = 00000000b
99
WSTATE_NORMAL	 = 00000000b
100
WSTATE_MAXIMIZED = 00000001b
100
WSTATE_MAXIMIZED = 00000001b
101
WSTATE_MINIMIZED = 00000010b
101
WSTATE_MINIMIZED = 00000010b
102
WSTATE_ROLLEDUP  = 00000100b
102
WSTATE_ROLLEDUP  = 00000100b
103
 
103
 
104
WSTATE_REDRAW	 = 00000001b
104
WSTATE_REDRAW	 = 00000001b
105
WSTATE_WNDDRAWN  = 00000010b
105
WSTATE_WNDDRAWN  = 00000010b
106
 
106
 
107
WSTYLE_HASCAPTION     = 00010000b
107
WSTYLE_HASCAPTION     = 00010000b
108
WSTYLE_CLIENTRELATIVE = 00100000b
108
WSTYLE_CLIENTRELATIVE = 00100000b
109
 
109
 
110
struc TASKLIST
110
struc TASKDATA
111
{
111
{
112
  .event_mask  dd ?
112
  .event_mask  dd ?
113
  .pid	       dd ?
113
  .pid	       dd ?
114
	       dw ?
114
	       dw ?
115
  .state       dw ?
115
  .state       db ?
-
 
116
               db ?
116
	       dw ?
117
	       dw ?
117
  .wnd_number  db ?
118
  .wnd_number  db ?
118
	       db ?
119
	       db ?
119
  .mem_start   dd ?
120
  .mem_start   dd ?
120
  .counter_sum dd ?
121
  .counter_sum dd ?
121
  .counter_add dd ?
122
  .counter_add dd ?
122
  .cpu_usage   dd ?
123
  .cpu_usage   dd ?
123
}
124
}
124
virtual at 0
125
virtual at 0
125
 TASKLIST TASKLIST
126
 TASKDATA TASKDATA
126
end virtual
127
end virtual
127
 
128
 
128
; structures definition
129
; structures definition
129
struc WDATA {
130
struc WDATA {
130
  .box		   BOX
131
  .box		   BOX
131
  .cl_workarea	   dd ?
132
  .cl_workarea	   dd ?
132
  .cl_titlebar	   dd ?
133
  .cl_titlebar	   dd ?
133
  .cl_frames	   dd ?
134
  .cl_frames	   dd ?
134
  .reserved	   db ?
135
  .reserved	   db ?
135
  .fl_wstate	   db ?
136
  .fl_wstate	   db ?
136
  .fl_wdrawn	   db ?
137
  .fl_wdrawn	   db ?
137
  .fl_redraw	   db ?
138
  .fl_redraw	   db ?
138
}
139
}
139
virtual at 0
140
virtual at 0
140
 WDATA WDATA
141
 WDATA WDATA
141
end virtual
142
end virtual
142
label WDATA.fl_wstyle byte at 0x13
143
label WDATA.fl_wstyle byte at 0x13
143
 
144
 
144
struc APPDATA
145
struc APPDATA
145
{
146
{
146
  .app_name	   db 11  dup(?)
147
  .app_name	   db 11  dup(?)
147
		   db 5   dup(?)
148
		   db 5   dup(?)
148
  .fpu_save_area   db 108 dup(?)
149
  .fpu_save_area:  db 108 dup(?)
149
		   db 3   dup(?)
150
		   db 3   dup(?)
150
  .is_fpu_saved    db ?
151
  .is_fpu_saved    db ?
151
  .wnd_shape	   dd ?
152
  .wnd_shape	   dd ?
152
  .wnd_shape_scale dd ?
153
  .wnd_shape_scale dd ?
153
  .gdt		   dd ?
154
		   dd ?
154
  .mem_size	   dd ?
155
  .mem_size	   dd ?
155
  .saved_box	   BOX
156
  .saved_box	   BOX
156
  .ipc_start	   dd ?
157
  .ipc_start	   dd ?
157
  .ipc_size	   dd ?
158
  .ipc_size	   dd ?
158
  .event_mask	   dd ?
159
  .event_mask	   dd ?
159
  .debugger_slot   dd ?
160
  .debugger_slot   dd ?
160
  .int40_handler   dd ?
161
		   dd ?
161
  .keyboard_mode   db ?
162
  .keyboard_mode   db ?
162
		   db 3   dup(?)
163
		   db 3   dup(?)
163
  .dir_table	   dd ?
164
  .dir_table	   dd ?
164
  .dbg_event_mem   dd ?
165
  .dbg_event_mem   dd ?
165
  .dbg_regs:
166
  .dbg_regs:
166
  .dbg_regs.dr0    dd ?
167
  .dbg_regs.dr0    dd ?
167
  .dbg_regs.dr1    dd ?
168
  .dbg_regs.dr1    dd ?
168
  .dbg_regs.dr2    dd ?
169
  .dbg_regs.dr2    dd ?
169
  .dbg_regs.dr3    dd ?
170
  .dbg_regs.dr3    dd ?
170
  .dbg_regs.dr7    dd ?
171
  .dbg_regs.dr7    dd ?
171
  .wnd_caption	   dd ?
172
  .wnd_caption	   dd ?
172
  .wnd_clientbox   BOX
173
  .wnd_clientbox   BOX
173
}
174
}
174
virtual at 0
175
virtual at 0
175
 APPDATA APPDATA
176
 APPDATA APPDATA
176
end virtual
177
end virtual
177
 
178
 
178
;// mike.dld, 2006-29-01 ]
179
;// mike.dld, 2006-29-01 ]
179
 
180
 
180
 
181
 
181
; Core functions
182
; Core functions
182
include "core/sync.inc"     ; macros for synhronization objects
183
include "core/sync.inc"     ; macros for synhronization objects
183
include "core/sys32.inc"    ; process management
184
include "core/sys32.inc"    ; process management
184
include "core/sched.inc"    ; process scheduling
185
include "core/sched.inc"    ; process scheduling
185
include "core/syscall.inc"  ; system call
186
include "core/syscall.inc"  ; system call
186
include "core/mem.inc"      ; high-level memory management
187
include "core/mem.inc"      ; high-level memory management
187
include "core/newproce.inc" ;new process management
188
include "core/newproce.inc" ;new process management
188
include "core/physmem.inc"  ; access to physical memory for applications
189
include "core/physmem.inc"  ; access to physical memory for applications
189
 
190
 
190
; GUI stuff
191
; GUI stuff
191
include "gui/window.inc"
192
include "gui/window.inc"
192
include "gui/event.inc"
193
include "gui/event.inc"
193
include "gui/font.inc"
194
include "gui/font.inc"
194
include "gui/button.inc"
195
include "gui/button.inc"
195
 
196
 
196
; shutdown
197
; shutdown
197
 
198
 
198
include "boot/shutdown.inc" ; shutdown or restart
199
include "boot/shutdown.inc" ; shutdown or restart
199
 
200
 
200
; file system
201
; file system
201
 
202
 
202
include "fs/fs.inc"       ; syscall
203
include "fs/fs.inc"       ; syscall
203
include "fs/fat32.inc"    ; read / write for fat32 filesystem
204
include "fs/fat32.inc"    ; read / write for fat32 filesystem
204
include "fs/fat12.inc"    ; read / write for fat12 filesystem
205
include "fs/fat12.inc"    ; read / write for fat12 filesystem
205
include "blkdev/rd.inc"   ; ramdisk read /write
206
include "blkdev/rd.inc"   ; ramdisk read /write
206
include "fs/fs_lfn.inc"    ; syscall, version 2
207
include "fs/fs_lfn.inc"    ; syscall, version 2
207
include "fs/iso9660.inc"  ; read for iso9660 filesystem CD
208
include "fs/iso9660.inc"  ; read for iso9660 filesystem CD
208
 
209
 
209
; sound
210
; sound
210
 
211
 
211
include "sound/sb16.inc"     ; playback for Sound Blaster 16
212
include "sound/sb16.inc"     ; playback for Sound Blaster 16
212
include "sound/playnote.inc" ; player Note for Speaker PC
213
include "sound/playnote.inc" ; player Note for Speaker PC
213
 
214
 
214
; display
215
; display
215
 
216
 
216
include "video/vesa12.inc"   ; Vesa 1.2 functions
217
include "video/vesa12.inc"   ; Vesa 1.2 functions
217
include "video/vesa20.inc"   ; Vesa 2.0 functions
218
include "video/vesa20.inc"   ; Vesa 2.0 functions
218
include "video/vga.inc"      ; VGA 16 color functions
219
include "video/vga.inc"      ; VGA 16 color functions
219
 
220
 
220
; Network Interface & TCPIP Stack
221
; Network Interface & TCPIP Stack
221
 
222
 
222
include "network/stack.inc"
223
include "network/stack.inc"
223
 
224
 
224
; Mouse pointer
225
; Mouse pointer
225
 
226
 
226
include "gui/mouse.inc"
227
include "gui/mouse.inc"
227
 
228
 
228
; Window skinning
229
; Window skinning
229
 
230
 
230
include "gui/skincode.inc"
231
include "gui/skincode.inc"
231
 
232
 
232
; Pci functions
233
; Pci functions
233
 
234
 
234
include "bus/pci/pci32.inc"
235
include "bus/pci/pci32.inc"
235
 
236
 
236
; Floppy drive controller
237
; Floppy drive controller
237
 
238
 
238
include "blkdev/fdc.inc"
239
include "blkdev/fdc.inc"
239
include "blkdev/flp_drv.inc"
240
include "blkdev/flp_drv.inc"
240
 
241
 
241
; CD drive controller
242
; CD drive controller
242
 
243
 
243
include "blkdev/cdrom.inc"
244
include "blkdev/cdrom.inc"
244
include "blkdev/cd_drv.inc"
245
include "blkdev/cd_drv.inc"
245
 
246
 
246
; Character devices
247
; Character devices
247
 
248
 
248
include "hid/keyboard.inc"
249
include "hid/keyboard.inc"
249
include "hid/mousedrv.inc"
250
include "hid/mousedrv.inc"
250
 
251
 
251
; setting date,time,clock and alarm-clock
252
; setting date,time,clock and alarm-clock
252
 
253
 
253
include "hid/set_dtc.inc"
254
include "hid/set_dtc.inc"
254
 
255
 
255
;% -include
256
;% -include