Subversion Repositories Kolibri OS

Rev

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

Rev 2513 Rev 2515
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2012. 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
7
 
8
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
8
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
9
 
9
 
10
Number of the function is located in the register eax.
10
Number of the function is located in the register eax.
11
The call of the system function is executed by "int 0x40" command.
11
The call of the system function is executed by "int 0x40" command.
12
All registers except explicitly declared in the returned value,
12
All registers except explicitly declared in the returned value,
13
    including eflags, are preserved.
13
    including eflags, are preserved.
14
 
14
 
15
 
15
 
16
======================================================================
16
======================================================================
17
============== Function 0 - define and draw the window. ==============
17
============== Function 0 - define and draw the window. ==============
18
======================================================================
18
======================================================================
19
Defines an application window. Draws a frame of the window, header and
19
Defines an application window. Draws a frame of the window, header and
20
working area. For skinned windows defines standard close and minimize
20
working area. For skinned windows defines standard close and minimize
21
buttons.
21
buttons.
22
Parameters:
22
Parameters:
23
  * eax = 0 - function number
23
  * eax = 0 - function number
24
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
24
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
25
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
25
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
26
  * edx = 0xXYRRGGBB, where:
26
  * edx = 0xXYRRGGBB, where:
27
    * Y = style of the window:
27
    * Y = style of the window:
28
      * Y=0 - type I - fixed-size window
28
      * Y=0 - type I - fixed-size window
29
      * Y=1 - only define window area, draw nothing
29
      * Y=1 - only define window area, draw nothing
30
      * Y=2 - type II - variable-size window
30
      * Y=2 - type II - variable-size window
31
      * Y=3 - skinned window
31
      * Y=3 - skinned window
32
      * Y=4 - skinned fixed-size window
32
      * Y=4 - skinned fixed-size window
33
      * other possible values (from 5 up to 15) are reserved,
33
      * other possible values (from 5 up to 15) are reserved,
34
        function call with such Y is ignored
34
        function call with such Y is ignored
35
    * RR, GG, BB = accordingly red, green, blue components of a color
35
    * RR, GG, BB = accordingly red, green, blue components of a color
36
      of the working area of the window (are ignored for style Y=2)
36
      of the working area of the window (are ignored for style Y=2)
37
    * X = DCBA (bits)
37
    * X = DCBA (bits)
38
      * A = 1 - window has caption; for styles Y=3,4 caption string
38
      * A = 1 - window has caption; for styles Y=3,4 caption string
39
                  must be passed in edi, for other styles use
39
                  must be passed in edi, for other styles use
40
                  subfunction 1 of function 71
40
                  subfunction 1 of function 71
41
      * B = 1 - coordinates of all graphics primitives are relative to
41
      * B = 1 - coordinates of all graphics primitives are relative to
42
                  window client area
42
                  window client area
43
      * C = 1 - don't fill working area on window draw
43
      * C = 1 - don't fill working area on window draw
44
      * D = 0 - normal filling of the working area, 1 - gradient
44
      * D = 0 - normal filling of the working area, 1 - gradient
45
    The following parameters are intended for windows
45
    The following parameters are intended for windows
46
    of a type I and II, and ignored for styles Y=1,3:
46
    of a type I and II, and ignored for styles Y=1,3:
47
  * esi = 0xXYRRGGBB - color of the header
47
  * esi = 0xXYRRGGBB - color of the header
48
    * RR, GG, BB define color
48
    * RR, GG, BB define color
49
    * Y=0 - usual window, Y=1 - unmovable window
49
    * Y=0 - usual window, Y=1 - unmovable window
50
    * X defines a gradient of header: X=0 - no gradient,
50
    * X defines a gradient of header: X=0 - no gradient,
51
      X=8 - usual gradient,
51
      X=8 - usual gradient,
52
      for windows of a type II X=4 - negative gradient
52
      for windows of a type II X=4 - negative gradient
53
    * other values of X and Y are reserved
53
    * other values of X and Y are reserved
54
  * edi = 0x00RRGGBB - color of the frame
54
  * edi = 0x00RRGGBB - color of the frame
55
Returned value:
55
Returned value:
56
  * function does not return value
56
  * function does not return value
57
Remarks:
57
Remarks:
58
  * Position and sizes of the window are installed by the first
58
  * Position and sizes of the window are installed by the first
59
    call of this function and are ignored at subsequent; to change
59
    call of this function and are ignored at subsequent; to change
60
    position and/or sizes of already created window use function 67.
60
    position and/or sizes of already created window use function 67.
61
  * For windows with styles Y=3,4 and caption (A=1) caption string
61
  * For windows with styles Y=3,4 and caption (A=1) caption string
62
    is set by the first call of this function and is ignored
62
    is set by the first call of this function and is ignored
63
    at subsequent (strictly speaking, is ignored after a call to
63
    at subsequent (strictly speaking, is ignored after a call to
64
    subfunction 2 of function 12 - end redraw); to change caption of
64
    subfunction 2 of function 12 - end redraw); to change caption of
65
    already created window use subfunction 1 of function 71.
65
    already created window use subfunction 1 of function 71.
66
  * If the window has appropriate styles, position and/or sizes can be
66
  * If the window has appropriate styles, position and/or sizes can be
67
    changed by user. Current position and sizes can be obtained
67
    changed by user. Current position and sizes can be obtained
68
    by function 9.
68
    by function 9.
69
  * The window must fit on the screen. If the transferred
69
  * The window must fit on the screen. If the transferred
70
    coordinates and sizes do not satisfy to this condition,
70
    coordinates and sizes do not satisfy to this condition,
71
    appropriate coordinate (or, probably, both) is considered as zero,
71
    appropriate coordinate (or, probably, both) is considered as zero,
72
    and if it does not help too, the appropriate size
72
    and if it does not help too, the appropriate size
73
    (or, probably, both) is installed in a size of the screen.
73
    (or, probably, both) is installed in a size of the screen.
74
 
74
 
75
    Further let us designate xpos,ypos,xsize,ysize - values passed
75
    Further let us designate xpos,ypos,xsize,ysize - values passed
76
    in ebx,ecx. The coordinates are resulted concerning
76
    in ebx,ecx. The coordinates are resulted concerning
77
    the left upper corner of the window, which, thus, is set as (0,0),
77
    the left upper corner of the window, which, thus, is set as (0,0),
78
    coordinates of the right lower corner essence (xsize,ysize).
78
    coordinates of the right lower corner essence (xsize,ysize).
79
  * The sizes of the window are understood in sence of coordinates
79
  * The sizes of the window are understood in sence of coordinates
80
    of the right lower corner. This concerns all other functions too.
80
    of the right lower corner. This concerns all other functions too.
81
    It means, that the real sizes are on 1 pixel more.
81
    It means, that the real sizes are on 1 pixel more.
82
  * The window of type I looks as follows:
82
  * The window of type I looks as follows:
83
    * draw external frame of color indicated in edi, 1 pixel in width
83
    * draw external frame of color indicated in edi, 1 pixel in width
84
    * draw header - rectangle with the left upper corner (1,1) and
84
    * draw header - rectangle with the left upper corner (1,1) and
85
      right lower (xsize-1,min(25,ysize)) color indicated in esi
85
      right lower (xsize-1,min(25,ysize)) color indicated in esi
86
      (taking a gradient into account)
86
      (taking a gradient into account)
87
    * if ysize>=26, fill the working area of the window -
87
    * if ysize>=26, fill the working area of the window -
88
      rectangle with the left upper corner (1,21) and right lower
88
      rectangle with the left upper corner (1,21) and right lower
89
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
89
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
90
      indicated in edx (taking a gradient into account)
90
      indicated in edx (taking a gradient into account)
91
    * if A=1 and caption has been already set by subfunction 1
91
    * if A=1 and caption has been already set by subfunction 1
92
      of function 71, it is drawn in the corresponding place of header
92
      of function 71, it is drawn in the corresponding place of header
93
  * The window of style Y=1 looks as follows:
93
  * The window of style Y=1 looks as follows:
94
    * completely defined by the application
94
    * completely defined by the application
95
  * The window of type II looks as follows:
95
  * The window of type II looks as follows:
96
    * draw external frame of width 1 pixel with the "shaded" color
96
    * draw external frame of width 1 pixel with the "shaded" color
97
      edi (all components of the color decrease twice)
97
      edi (all components of the color decrease twice)
98
    * draw intermediate frame of width 3 pixels with color edi
98
    * draw intermediate frame of width 3 pixels with color edi
99
    * draw internal frame of width 1 pixel with the "shaded" color edi
99
    * draw internal frame of width 1 pixel with the "shaded" color edi
100
    * draw header - rectangle with the left upper corner (4,4)
100
    * draw header - rectangle with the left upper corner (4,4)
101
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
101
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
102
      (taking a gradient into account)
102
      (taking a gradient into account)
103
    * if ysize>=26, fill the working area of the window -
103
    * if ysize>=26, fill the working area of the window -
104
      rectangle with the left upper corner (5,20) and right lower
104
      rectangle with the left upper corner (5,20) and right lower
105
      (xsize-5,ysize-5) with color indicated in edx
105
      (xsize-5,ysize-5) with color indicated in edx
106
      (taking a gradient into account)
106
      (taking a gradient into account)
107
    * if A=1 and caption has been already set by subfunction 1
107
    * if A=1 and caption has been already set by subfunction 1
108
      of function 71, it is drawn in the corresponding place of header
108
      of function 71, it is drawn in the corresponding place of header
109
  * The skinned window looks as follows:
109
  * The skinned window looks as follows:
110
    * draw external frame of width 1 pixel
110
    * draw external frame of width 1 pixel
111
      with color 'outer' from the skin
111
      with color 'outer' from the skin
112
    * draw intermediate frame of width 3 pixel
112
    * draw intermediate frame of width 3 pixel
113
      with color 'frame' from the skin
113
      with color 'frame' from the skin
114
    * draw internal frame of width 1 pixel
114
    * draw internal frame of width 1 pixel
115
      with color 'inner' from the skin
115
      with color 'inner' from the skin
116
    * draw header (on bitmaps from the skin) in a rectangle
116
    * draw header (on bitmaps from the skin) in a rectangle
117
      (0,0) - (xsize,_skinh-1)
117
      (0,0) - (xsize,_skinh-1)
118
    * if ysize>=26, fill the working area of the window -
118
    * if ysize>=26, fill the working area of the window -
119
      rectangle with the left upper corner (5,_skinh) and right lower
119
      rectangle with the left upper corner (5,_skinh) and right lower
120
      (xsize-5,ysize-5) with color indicated in edx
120
      (xsize-5,ysize-5) with color indicated in edx
121
      (taking a gradient into account)
121
      (taking a gradient into account)
122
    * define two standard buttons: close and minimize
122
    * define two standard buttons: close and minimize
123
      (see function 8)
123
      (see function 8)
124
    * if A=1 and edi contains (nonzero) pointer to caption string,
124
    * if A=1 and edi contains (nonzero) pointer to caption string,
125
      it is drawn in place in header defined in the skin
125
      it is drawn in place in header defined in the skin
126
    * value _skinh is accessible as the result of call
126
    * value _skinh is accessible as the result of call
127
      subfunction 4 of function 48
127
      subfunction 4 of function 48
128
 
128
 
129
======================================================================
129
======================================================================
130
================ Function 1 - put pixel in the window. ===============
130
================ Function 1 - put pixel in the window. ===============
131
======================================================================
131
======================================================================
132
Parameters:
132
Parameters:
133
  * eax = 1 - function number
133
  * eax = 1 - function number
134
  * ebx = x-coordinate (relative to the window)
134
  * ebx = x-coordinate (relative to the window)
135
  * ecx = y-coordinate (relative to the window)
135
  * ecx = y-coordinate (relative to the window)
136
  * edx = 0x00RRGGBB - color of a pixel
136
  * edx = 0x00RRGGBB - color of a pixel
137
    edx = 0x01xxxxxx - invert color of a pixel
137
    edx = 0x01xxxxxx - invert color of a pixel
138
          (low 24 bits are ignored)
138
          (low 24 bits are ignored)
139
Returned value:
139
Returned value:
140
  * function does not return value
140
  * function does not return value
141
 
141
 
142
======================================================================
142
======================================================================
143
============ Function 2 - get the code of the pressed key. ===========
143
============ Function 2 - get the code of the pressed key. ===========
144
======================================================================
144
======================================================================
145
Takes away the code of the pressed key from the buffer.
145
Takes away the code of the pressed key from the buffer.
146
Parameters:
146
Parameters:
147
  * eax = 2 - function number
147
  * eax = 2 - function number
148
Returned value:
148
Returned value:
149
  * if the buffer is empty, function returns eax=1
149
  * if the buffer is empty, function returns eax=1
150
  * if the buffer is not empty, function returns al=0,
150
  * if the buffer is not empty, function returns al=0,
151
    ah=code of the pressed key, high word of eax is zero
151
    ah=code of the pressed key, high word of eax is zero
152
  * if there is "hotkey", function returns al=2,
152
  * if there is "hotkey", function returns al=2,
153
    ah=scancode of the pressed key (0 for control keys),
153
    ah=scancode of the pressed key (0 for control keys),
154
    high word of eax contains a status of control keys at the moment
154
    high word of eax contains a status of control keys at the moment
155
    of pressing a hotkey
155
    of pressing a hotkey
156
Remarks:
156
Remarks:
157
  * There is a common system buffer of the pressed keys
157
  * There is a common system buffer of the pressed keys
158
    by a size of 120 bytes, organized as queue.
158
    by a size of 120 bytes, organized as queue.
159
  * There is one more common system buffer on 120 "hotkeys".
159
  * There is one more common system buffer on 120 "hotkeys".
160
  * If the application with the inactive window calls this function,
160
  * If the application with the inactive window calls this function,
161
    the buffer of the pressed keys is considered to be empty.
161
    the buffer of the pressed keys is considered to be empty.
162
  * By default this function returns ASCII-codes; to switch
162
  * By default this function returns ASCII-codes; to switch
163
    to the scancodes mode (and back) use function 66.
163
    to the scancodes mode (and back) use function 66.
164
    However, hotkeys are always notificated as scancodes.
164
    However, hotkeys are always notificated as scancodes.
165
  * To find out, what keys correspond to what codes, start
165
  * To find out, what keys correspond to what codes, start
166
    the application keyascii and scancode.
166
    the application keyascii and scancode.
167
  * Scancodes come directly from keyboard and are fixed;
167
  * Scancodes come directly from keyboard and are fixed;
168
    ASCII-codes turn out with usage of the conversion tables,
168
    ASCII-codes turn out with usage of the conversion tables,
169
    which can be set by subfunction 2 of function 21
169
    which can be set by subfunction 2 of function 21
170
    and get by subfunction 2 of function 26.
170
    and get by subfunction 2 of function 26.
171
  * As a consequence, ASCII-codes take into account current
171
  * As a consequence, ASCII-codes take into account current
172
    keyboard layout (rus/en) as opposed to scancodes.
172
    keyboard layout (rus/en) as opposed to scancodes.
173
  * This function notifies only about those hotkeys, which were
173
  * This function notifies only about those hotkeys, which were
174
    defined by this thread by subfunction 4 of function 66.
174
    defined by this thread by subfunction 4 of function 66.
175
 
175
 
176
======================================================================
176
======================================================================
177
==================== Function 3 - get system time. ===================
177
==================== Function 3 - get system time. ===================
178
======================================================================
178
======================================================================
179
Parameters:
179
Parameters:
180
  * eax = 3 - function number
180
  * eax = 3 - function number
181
Returned value:
181
Returned value:
182
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
182
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
183
  * each item is BCD-number, for example,
183
  * each item is BCD-number, for example,
184
    for time 23:59:59 function returns 0x00595923
184
    for time 23:59:59 function returns 0x00595923
185
Remarks:
185
Remarks:
186
  * See also subfunction 9 of function 26 - get time from
186
  * See also subfunction 9 of function 26 - get time from
187
    the moment of start of the system; it is more convenient, because
187
    the moment of start of the system; it is more convenient, because
188
    returns simply DWORD-value of the time counter.
188
    returns simply DWORD-value of the time counter.
189
  * System time can be set by function 22.
189
  * System time can be set by function 22.
190
 
190
 
191
======================================================================
191
======================================================================
192
============ Function 4 - draw text string in the window. ============
192
============ Function 4 - draw text string in the window. ============
193
======================================================================
193
======================================================================
194
Parameters:
194
Parameters:
195
  * eax = 4 - function number
195
  * eax = 4 - function number
196
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
196
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
197
  * ecx = 0xX0RRGGBB, where
197
  * ecx = 0xX0RRGGBB, where
198
    * RR, GG, BB specify text color
198
    * RR, GG, BB specify text color
199
    * X=ABnn (bits):
199
    * X=ABnn (bits):
200
    * nn specifies the used font: 0=system monospaced,
200
    * nn specifies the used font: 0=system monospaced,
201
      1=system font of variable width
201
      1=system font of variable width
202
    * A=0 - output esi characters, A=1 - output ASCIIZ-string
202
    * A=0 - output esi characters, A=1 - output ASCIIZ-string
203
    * B=1 - fill background with the color edi
203
    * B=1 - fill background with the color edi
204
  * edx = pointer to the beginning of the string
204
  * edx = pointer to the beginning of the string
205
  * esi = for A=0 length of the string, must not exceed 255;
205
  * esi = for A=0 length of the string, must not exceed 255;
206
          for A=1 is ignored
206
          for A=1 is ignored
207
Returned value:
207
Returned value:
208
  * function does not return value
208
  * function does not return value
209
Remarks:
209
Remarks:
210
  * First system font is read out at loading from the file char.mt,
210
  * First system font is read out at loading from the file char.mt,
211
    second - from char2.mt.
211
    second - from char2.mt.
212
  * Both fonts have height 9 pixels, width of the monospaced font
212
  * Both fonts have height 9 pixels, width of the monospaced font
213
    is equal to 6 pixels.
213
    is equal to 6 pixels.
214
 
214
 
215
======================================================================
215
======================================================================
216
========================= Function 5 - delay. ========================
216
========================= Function 5 - delay. ========================
217
======================================================================
217
======================================================================
218
Delays execution of the program on the given time.
218
Delays execution of the program on the given time.
219
Parameters:
219
Parameters:
220
  * eax = 5 - function number
220
  * eax = 5 - function number
221
  * ebx = time in the 1/100 of second
221
  * ebx = time in the 1/100 of second
222
Returned value:
222
Returned value:
223
  * function does not return value
223
  * function does not return value
224
Remarks:
224
Remarks:
225
  * Passing ebx=0 does not transfer control to the next process
225
  * Passing ebx=0 does not transfer control to the next process
226
    and does not make any operations at all. If it is really required
226
    and does not make any operations at all. If it is really required
227
    to transfer control to the next process (to complete a current
227
    to transfer control to the next process (to complete a current
228
    time slice), use subfunction 1 of function 68.
228
    time slice), use subfunction 1 of function 68.
229
 
229
 
230
======================================================================
230
======================================================================
231
============== Function 6 - read the file from ramdisk. ==============
231
============== Function 6 - read the file from ramdisk. ==============
232
======================================================================
232
======================================================================
233
Parameters:
233
Parameters:
234
  * eax = 6 - function number
234
  * eax = 6 - function number
235
  * ebx = pointer to the filename
235
  * ebx = pointer to the filename
236
  * ecx = number of start block, beginning from 1;
236
  * ecx = number of start block, beginning from 1;
237
    ecx=0 - read from the beginning of the file (same as ecx=1)
237
    ecx=0 - read from the beginning of the file (same as ecx=1)
238
  * edx = number of blocks to read;
238
  * edx = number of blocks to read;
239
    edx=0 - read one block (same as edx=1)
239
    edx=0 - read one block (same as edx=1)
240
  * esi = pointer to memory area for the data
240
  * esi = pointer to memory area for the data
241
Returned value:
241
Returned value:
242
  * eax = file size in bytes, if the file was successfully read
242
  * eax = file size in bytes, if the file was successfully read
243
  * eax = -1, if the file was not found
243
  * eax = -1, if the file was not found
244
Remarks:
244
Remarks:
245
  * This function is out-of-date; function 70 allows
245
  * This function is out-of-date; function 70 allows
246
    to fulfil the same operations with the extended possibilities.
246
    to fulfil the same operations with the extended possibilities.
247
  * Block = 512 bytes.
247
  * Block = 512 bytes.
248
  * For reading all file you can specify the certainly large value
248
  * For reading all file you can specify the certainly large value
249
    in edx, for example, edx = -1; but in this case be ready that
249
    in edx, for example, edx = -1; but in this case be ready that
250
    the program will "fall", if the file will appear too large and can
250
    the program will "fall", if the file will appear too large and can
251
    not be placed in the program memory.
251
    not be placed in the program memory.
252
  * The filename must be either in the format 8+3 characters
252
  * The filename must be either in the format 8+3 characters
253
    (first 8 characters - name itself, last 3 - extension,
253
    (first 8 characters - name itself, last 3 - extension,
254
    the short names and extensions are supplemented with spaces),
254
    the short names and extensions are supplemented with spaces),
255
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
255
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
256
    (name no more than 8 characters, dot, extension 3 characters
256
    (name no more than 8 characters, dot, extension 3 characters
257
    supplemented if necessary by spaces).
257
    supplemented if necessary by spaces).
258
    The filename must be written with capital letters. The terminating
258
    The filename must be written with capital letters. The terminating
259
    character with code 0 is not necessary (not ASCIIZ-string).
259
    character with code 0 is not necessary (not ASCIIZ-string).
260
  * This function does not support folders on the ramdisk.
260
  * This function does not support folders on the ramdisk.
261
 
261
 
262
======================================================================
262
======================================================================
263
=============== Function 7 - draw image in the window. ===============
263
=============== Function 7 - draw image in the window. ===============
264
======================================================================
264
======================================================================
265
Paramters:
265
Paramters:
266
  * eax = 7 - function number
266
  * eax = 7 - function number
267
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
267
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
268
  * ecx = [size on axis x]*65536 + [size on axis y]
268
  * ecx = [size on axis x]*65536 + [size on axis y]
269
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
269
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
270
Returned value:
270
Returned value:
271
  * function does not return value
271
  * function does not return value
272
Remarks:
272
Remarks:
273
  * Coordinates of the image are coordinates of the upper left corner
273
  * Coordinates of the image are coordinates of the upper left corner
274
    of the image relative to the window.
274
    of the image relative to the window.
275
  * Size of the image in bytes is 3*xsize*ysize.
275
  * Size of the image in bytes is 3*xsize*ysize.
276
 
276
 
277
======================================================================
277
======================================================================
278
=============== Function 8 - define/delete the button. ===============
278
=============== Function 8 - define/delete the button. ===============
279
======================================================================
279
======================================================================
280
Parameters for button definition:
280
Parameters for button definition:
281
  * eax = 8 - function number
281
  * eax = 8 - function number
282
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
282
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
283
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
283
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
284
  * edx = 0xXYnnnnnn, where:
284
  * edx = 0xXYnnnnnn, where:
285
    * nnnnnn = identifier of the button
285
    * nnnnnn = identifier of the button
286
    * high (31st) bit of edx is cleared
286
    * high (31st) bit of edx is cleared
287
    * if 30th bit of edx is set - do not draw the button
287
    * if 30th bit of edx is set - do not draw the button
288
    * if 29th bit of edx is set - do not draw a frame
288
    * if 29th bit of edx is set - do not draw a frame
289
      at pressing the button
289
      at pressing the button
290
  * esi = 0x00RRGGBB - color of the button
290
  * esi = 0x00RRGGBB - color of the button
291
Parameters for button deleting:
291
Parameters for button deleting:
292
  * eax = 8 - function number
292
  * eax = 8 - function number
293
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
293
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
294
Returned value:
294
Returned value:
295
  * function does not return value
295
  * function does not return value
296
Remarks:
296
Remarks:
297
  * Sizes of the button must be more than 0 and less than 0x8000.
297
  * Sizes of the button must be more than 0 and less than 0x8000.
298
  * For skinned windows definition of the window
298
  * For skinned windows definition of the window
299
    (call of 0th function) creates two standard buttons -
299
    (call of 0th function) creates two standard buttons -
300
    for close of the window with identifier 1 and
300
    for close of the window with identifier 1 and
301
    for minimize of the window with identifier 0xffff.
301
    for minimize of the window with identifier 0xffff.
302
  * The creation of two buttons with same identifiers is admitted.
302
  * The creation of two buttons with same identifiers is admitted.
303
  * The button with the identifier 0xffff at pressing is interpreted
303
  * The button with the identifier 0xffff at pressing is interpreted
304
    by the system as the button of minimization, the system handles
304
    by the system as the button of minimization, the system handles
305
    such pressing independently, not accessing to the application.
305
    such pressing independently, not accessing to the application.
306
    In rest it is usual button.
306
    In rest it is usual button.
307
  * Total number of buttons for all applications is limited to 4095.
307
  * Total number of buttons for all applications is limited to 4095.
308
 
308
 
309
======================================================================
309
======================================================================
310
============ Function 9 - information on execution thread. ===========
310
============ Function 9 - information on execution thread. ===========
311
======================================================================
311
======================================================================
312
Parameters:
312
Parameters:
313
  * eax = 9 - function number
313
  * eax = 9 - function number
314
  * ebx = pointer to 1-Kb buffer
314
  * ebx = pointer to 1-Kb buffer
315
  * ecx = number of the slot of the thread
315
  * ecx = number of the slot of the thread
316
    ecx = -1 - get information on the current thread
316
    ecx = -1 - get information on the current thread
317
Returned value:
317
Returned value:
318
  * eax = maximum number of the slot of a thread
318
  * eax = maximum number of the slot of a thread
319
  * buffer pointed to by ebx contains the following information:
319
  * buffer pointed to by ebx contains the following information:
320
    * +0: dword: usage of the processor (how many time units
320
    * +0: dword: usage of the processor (how many time units
321
      per second leaves on execution of this thread)
321
      per second leaves on execution of this thread)
322
    * +4: word: position of the window of thread in the window stack
322
    * +4: word: position of the window of thread in the window stack
323
    * +6: word: (has no relation to the specified thread)
323
    * +6: word: (has no relation to the specified thread)
324
      number of the thread slot, which window has in the window stack
324
      number of the thread slot, which window has in the window stack
325
      position ecx
325
      position ecx
326
    * +8: word: reserved
326
    * +8: word: reserved
327
    * +10 = +0xA: 11 bytes: name of the process
327
    * +10 = +0xA: 11 bytes: name of the process
328
      (name of corresponding executable file in the format 8+3)
328
      (name of corresponding executable file in the format 8+3)
329
    * +21 = +0x15: byte: reserved, this byte is not changed
329
    * +21 = +0x15: byte: reserved, this byte is not changed
330
    * +22 = +0x16: dword: address of the process in memory
330
    * +22 = +0x16: dword: address of the process in memory
331
    * +26 = +0x1A: dword: size of used memory - 1
331
    * +26 = +0x1A: dword: size of used memory - 1
332
    * +30 = +0x1E: dword: identifier (PID/TID)
332
    * +30 = +0x1E: dword: identifier (PID/TID)
333
    * +34 = +0x22: dword: coordinate of the thread window on axis x
333
    * +34 = +0x22: dword: coordinate of the thread window on axis x
334
    * +38 = +0x26: dword: coordinate of the thread window on axis y
334
    * +38 = +0x26: dword: coordinate of the thread window on axis y
335
    * +42 = +0x2A: dword: size of the thread window on axis x
335
    * +42 = +0x2A: dword: size of the thread window on axis x
336
    * +46 = +0x2E: dword: size of the thread window on axis y
336
    * +46 = +0x2E: dword: size of the thread window on axis y
337
    * +50 = +0x32: word: status of the thread slot:
337
    * +50 = +0x32: word: status of the thread slot:
338
      * 0 = thread is running
338
      * 0 = thread is running
339
      * 1 = thread is suspended
339
      * 1 = thread is suspended
340
      * 2 = thread is suspended while waiting for event
340
      * 2 = thread is suspended while waiting for event
341
      * 3 = thread is terminating as a result of call to function -1
341
      * 3 = thread is terminating as a result of call to function -1
342
        or under duress as a result of call to subfunction 2
342
        or under duress as a result of call to subfunction 2
343
        of function 18 or termination of the system
343
        of function 18 or termination of the system
344
      * 4 = thread is terminating as a result of exception
344
      * 4 = thread is terminating as a result of exception
345
      * 5 = thread waits for event
345
      * 5 = thread waits for event
346
      * 9 = requested slot is free, all other information on the slot
346
      * 9 = requested slot is free, all other information on the slot
347
        is not meaningful
347
        is not meaningful
348
    * +52 = +0x34: word: reserved, this word is not changed
348
    * +52 = +0x34: word: reserved, this word is not changed
349
    * +54 = +0x36: dword: coordinate of the client area on axis x
349
    * +54 = +0x36: dword: coordinate of the client area on axis x
350
    * +58 = +0x3A: dword: coordinate of the client area on axis y
350
    * +58 = +0x3A: dword: coordinate of the client area on axis y
351
    * +62 = +0x3E: dword: width of the client area
351
    * +62 = +0x3E: dword: width of the client area
352
    * +66 = +0x42: dword: height of the client area
352
    * +66 = +0x42: dword: height of the client area
353
    * +70 = +0x46: byte: state of the window - bitfield
353
    * +70 = +0x46: byte: state of the window - bitfield
354
      * bit 0 (mask 1): window is maximized
354
      * bit 0 (mask 1): window is maximized
355
      * bit 1 (mask 2): window is minimized to panel
355
      * bit 1 (mask 2): window is minimized to panel
356
      * bit 2 (mask 4): window is rolled up
356
      * bit 2 (mask 4): window is rolled up
357
    * +71 = +0x47: dword: event mask
357
    * +71 = +0x47: dword: event mask
358
Remarks:
358
Remarks:
359
  * Slots are numbered starting from 1.
359
  * Slots are numbered starting from 1.
360
  * Returned value is not a total number of threads, because there
360
  * Returned value is not a total number of threads, because there
361
    can be free slots.
361
    can be free slots.
362
  * When process is starting, system automatically creates
362
  * When process is starting, system automatically creates
363
    execution thread.
363
    execution thread.
364
  * Function gives information on the thread. Each process has
364
  * Function gives information on the thread. Each process has
365
    at least one thread. One process can create many threads,
365
    at least one thread. One process can create many threads,
366
    in this case each thread has its own slot and the fields
366
    in this case each thread has its own slot and the fields
367
    +10, +22, +26 in these slots coincide.
367
    +10, +22, +26 in these slots coincide.
368
    Applications have no common way to define whether two threads
368
    Applications have no common way to define whether two threads
369
    belong to one process.
369
    belong to one process.
370
  * The active window - window on top of the window stack -
370
  * The active window - window on top of the window stack -
371
    receives the messages on a keyboard input. For such window
371
    receives the messages on a keyboard input. For such window
372
    the position in the window stack coincides with returned value.
372
    the position in the window stack coincides with returned value.
373
  * Slot 1 corresponds to special system thread, for which:
373
  * Slot 1 corresponds to special system thread, for which:
374
    * the window is in the bottom of the window stack, the fields
374
    * the window is in the bottom of the window stack, the fields
375
      +4 and +6 contain value 1
375
      +4 and +6 contain value 1
376
    * name of the process - "OS/IDLE" (supplemented by spaces)
376
    * name of the process - "OS/IDLE" (supplemented by spaces)
377
    * address of the process in memory is 0, size of used memory is
377
    * address of the process in memory is 0, size of used memory is
378
      16 Mb (0x1000000)
378
      16 Mb (0x1000000)
379
    * PID=1
379
    * PID=1
380
    * coordinates and sizes of the window and the client area are by
380
    * coordinates and sizes of the window and the client area are by
381
      convention set to 0
381
      convention set to 0
382
    * status of the slot is always 0 (running)
382
    * status of the slot is always 0 (running)
383
    * the execution time adds of time leaving on operations itself
383
    * the execution time adds of time leaving on operations itself
384
      and idle time in waiting for interrupt (which can be got by call
384
      and idle time in waiting for interrupt (which can be got by call
385
      to subfunction 4 of function 18).
385
      to subfunction 4 of function 18).
386
  * Beginning from slot 2, the normal applications are placed.
386
  * Beginning from slot 2, the normal applications are placed.
387
  * The normal applications are placed in memory at the address
387
  * The normal applications are placed in memory at the address
388
    0 (kernel constant 'std_application_base_address').
388
    0 (kernel constant 'std_application_base_address').
389
    There is no intersection, as each process has its own page table.
389
    There is no intersection, as each process has its own page table.
390
  * At creation of the thread it is assigned the slot
390
  * At creation of the thread it is assigned the slot
391
    in the system table and identifier (Process/Thread IDentifier =
391
    in the system table and identifier (Process/Thread IDentifier =
392
    PID/TID), which do not vary with time for given thread.
392
    PID/TID), which do not vary with time for given thread.
393
    After completion of the thread its slot can be anew used
393
    After completion of the thread its slot can be anew used
394
    for another thread. The thread identifier can not be assigned
394
    for another thread. The thread identifier can not be assigned
395
    to other thread even after completion of this thread.
395
    to other thread even after completion of this thread.
396
    Identifiers, assigned to new threads, grow monotonously.
396
    Identifiers, assigned to new threads, grow monotonously.
397
  * If the thread has not yet defined the window by call to
397
  * If the thread has not yet defined the window by call to
398
    function 0, the position and the sizes
398
    function 0, the position and the sizes
399
    of its window are considered to be zero.
399
    of its window are considered to be zero.
400
  * Coordinates of the client area are relative to the window.
400
  * Coordinates of the client area are relative to the window.
401
  * At the moment only the part of the buffer by a size
401
  * At the moment only the part of the buffer by a size
402
    71 = 0x37 bytes is used. Nevertheless it is recommended to use
402
    71 = 0x37 bytes is used. Nevertheless it is recommended to use
403
    1-Kb buffer for the future compatibility, in the future
403
    1-Kb buffer for the future compatibility, in the future
404
    some fields can be added.
404
    some fields can be added.
405
 
405
 
406
======================================================================
406
======================================================================
407
==================== Function 10 - wait for event. ===================
407
==================== Function 10 - wait for event. ===================
408
======================================================================
408
======================================================================
409
If the message queue is empty, waits for appearance of the message
409
If the message queue is empty, waits for appearance of the message
410
in queue. In this state thread does not consume CPU time.
410
in queue. In this state thread does not consume CPU time.
411
Then reads out the message from queue.
411
Then reads out the message from queue.
412
 
412
 
413
Parameters:
413
Parameters:
414
  * eax = 10 - function number
414
  * eax = 10 - function number
415
Returned value:
415
Returned value:
416
  * eax = event (see the list of events)
416
  * eax = event (see the list of events)
417
Remarks:
417
Remarks:
418
  * Those events are taken into account only which enter into
418
  * Those events are taken into account only which enter into
419
    a mask set by function 40. By default it is
419
    a mask set by function 40. By default it is
420
    redraw, key and button events.
420
    redraw, key and button events.
421
  * To check, whether there is a message in queue, use function 11.
421
  * To check, whether there is a message in queue, use function 11.
422
    To wait for no more than given time, use function 23.
422
    To wait for no more than given time, use function 23.
423
 
423
 
424
======================================================================
424
======================================================================
425
=============== Function 11 - check for event, no wait. ==============
425
=============== Function 11 - check for event, no wait. ==============
426
======================================================================
426
======================================================================
427
If the message queue contains event, function reads out
427
If the message queue contains event, function reads out
428
and return it. If the queue is empty, function returns 0.
428
and return it. If the queue is empty, function returns 0.
429
Parameters:
429
Parameters:
430
  * eax = 11 - function number
430
  * eax = 11 - function number
431
Returned value:
431
Returned value:
432
  * eax = 0 - message queue is empty
432
  * eax = 0 - message queue is empty
433
  * else eax = event (see the list of events)
433
  * else eax = event (see the list of events)
434
Remarks:
434
Remarks:
435
  * Those events are taken into account only, which enter into
435
  * Those events are taken into account only, which enter into
436
    a mask set by function 40. By default it is
436
    a mask set by function 40. By default it is
437
    redraw, key and button events.
437
    redraw, key and button events.
438
  * To wait for event, use function 10.
438
  * To wait for event, use function 10.
439
    To wait for no more than given time, use function 23.
439
    To wait for no more than given time, use function 23.
440
 
440
 
441
======================================================================
441
======================================================================
442
=============== Function 12 - begin/end window redraw. ===============
442
=============== Function 12 - begin/end window redraw. ===============
443
======================================================================
443
======================================================================
444
 
444
 
445
---------------- Subfunction 1 - begin window redraw. ----------------
445
---------------- Subfunction 1 - begin window redraw. ----------------
446
Parameters:
446
Parameters:
447
  * eax = 12 - function number
447
  * eax = 12 - function number
448
  * ebx = 1 - subfunction number
448
  * ebx = 1 - subfunction number
449
Returned value:
449
Returned value:
450
  * function does not return value
450
  * function does not return value
451
 
451
 
452
----------------- Subfunction 2 - end window redraw. -----------------
452
----------------- Subfunction 2 - end window redraw. -----------------
453
Parameters:
453
Parameters:
454
  * eax = 12 - function number
454
  * eax = 12 - function number
455
  * ebx = 2 - subfunction number
455
  * ebx = 2 - subfunction number
456
Returned value:
456
Returned value:
457
  * function does not return value
457
  * function does not return value
458
Remarks:
458
Remarks:
459
  * Subfunction 1 deletes all buttons defined with
459
  * Subfunction 1 deletes all buttons defined with
460
    function 8, they must be defined again.
460
    function 8, they must be defined again.
461
 
461
 
462
======================================================================
462
======================================================================
463
============ Function 13 - draw a rectangle in the window. ===========
463
============ Function 13 - draw a rectangle in the window. ===========
464
======================================================================
464
======================================================================
465
Parameters:
465
Parameters:
466
  * eax = 13 - function number
466
  * eax = 13 - function number
467
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
467
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
468
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
468
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
469
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
469
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
470
Returned value:
470
Returned value:
471
  * function does not return value
471
  * function does not return value
472
Remarks:
472
Remarks:
473
  * Coordinates are understood as coordinates of the left upper corner
473
  * Coordinates are understood as coordinates of the left upper corner
474
    of a rectangle relative to the window.
474
    of a rectangle relative to the window.
475
 
475
 
476
======================================================================
476
======================================================================
477
=================== Function 14 - get screen size. ===================
477
=================== Function 14 - get screen size. ===================
478
======================================================================
478
======================================================================
479
Parameters:
479
Parameters:
480
  * eax = 14 - function number
480
  * eax = 14 - function number
481
Returned value:
481
Returned value:
482
  * eax = [xsize]*65536 + [ysize], where
482
  * eax = [xsize]*65536 + [ysize], where
483
  * xsize = x-coordinate of the right lower corner of the screen =
483
  * xsize = x-coordinate of the right lower corner of the screen =
484
            horizontal size - 1
484
            horizontal size - 1
485
  * ysize = y-coordinate of the right lower corner of the screen =
485
  * ysize = y-coordinate of the right lower corner of the screen =
486
            vertical size - 1
486
            vertical size - 1
487
Remarks:
487
Remarks:
488
  * See also subfunction 5 of function 48 - get sizes of
488
  * See also subfunction 5 of function 48 - get sizes of
489
    working area of the screen.
489
    working area of the screen.
490
 
490
 
491
======================================================================
491
======================================================================
492
== Function 15, subfunction 1 - set a size of the background image. ==
492
== Function 15, subfunction 1 - set a size of the background image. ==
493
======================================================================
493
======================================================================
494
Parameters:
494
Parameters:
495
  * eax = 15 - function number
495
  * eax = 15 - function number
496
  * ebx = 1 - subfunction number
496
  * ebx = 1 - subfunction number
497
  * ecx = width of the image
497
  * ecx = width of the image
498
  * edx = height of the image
498
  * edx = height of the image
499
Returned value:
499
Returned value:
500
  * function does not return value
500
  * function does not return value
501
Remarks:
501
Remarks:
502
  * Before calling subfunctions 2 and 5 you should call this function
502
  * Before calling subfunctions 2 and 5 you should call this function
503
    to set image size!
503
    to set image size!
504
  * For update of the screen (after completion of a series of commands
504
  * For update of the screen (after completion of a series of commands
505
    working with a background) call subfunction 3.
505
    working with a background) call subfunction 3.
506
  * There is a pair function for get size of the background image -
506
  * There is a pair function for get size of the background image -
507
    subfunction 1 of function 39.
507
    subfunction 1 of function 39.
508
 
508
 
509
======================================================================
509
======================================================================
510
=== Function 15, subfunction 2 - put pixel on the background image. ==
510
=== Function 15, subfunction 2 - put pixel on the background image. ==
511
======================================================================
511
======================================================================
512
Parameters:
512
Parameters:
513
  * eax = 15 - function number
513
  * eax = 15 - function number
514
  * ebx = 2 - subfunction number
514
  * ebx = 2 - subfunction number
515
  * ecx = offset
515
  * ecx = offset
516
  * edx = color of a pixel 0xRRGGBB
516
  * edx = color of a pixel 0xRRGGBB
517
Returned value:
517
Returned value:
518
  * function does not return value
518
  * function does not return value
519
Remarks:
519
Remarks:
520
  * Offset for a pixel with coordinates (x,y) is calculated as
520
  * Offset for a pixel with coordinates (x,y) is calculated as
521
    (x+y*xsize)*3.
521
    (x+y*xsize)*3.
522
  * If the given offset exceeds size set by subfunction 1,
522
  * If the given offset exceeds size set by subfunction 1,
523
    the call is ignored.
523
    the call is ignored.
524
  * For update of the screen (after completion of a series of commands
524
  * For update of the screen (after completion of a series of commands
525
    working with a background) call subfunction 3.
525
    working with a background) call subfunction 3.
526
  * There is a pair function for get pixel on the background image -
526
  * There is a pair function for get pixel on the background image -
527
    subfunction 2 of function 39.
527
    subfunction 2 of function 39.
528
 
528
 
529
======================================================================
529
======================================================================
530
=========== Function 15, subfunction 3 - redraw background. ==========
530
=========== Function 15, subfunction 3 - redraw background. ==========
531
======================================================================
531
======================================================================
532
Parameters:
532
Parameters:
533
  * eax = 15 - function number
533
  * eax = 15 - function number
534
  * ebx = 3 - subfunction number
534
  * ebx = 3 - subfunction number
535
Returned value:
535
Returned value:
536
  * function does not return value
536
  * function does not return value
537
 
537
 
538
======================================================================
538
======================================================================
539
== Function 15, subfunction 4 - set drawing mode for the background. =
539
== Function 15, subfunction 4 - set drawing mode for the background. =
540
======================================================================
540
======================================================================
541
Parameters:
541
Parameters:
542
  * eax = 15 - function number
542
  * eax = 15 - function number
543
  * ebx = 4 - subfunction number
543
  * ebx = 4 - subfunction number
544
  * ecx = drawing mode:
544
  * ecx = drawing mode:
545
    * 1 = tile
545
    * 1 = tile
546
    * 2 = stretch
546
    * 2 = stretch
547
Returned value:
547
Returned value:
548
  * function does not return value
548
  * function does not return value
549
Remarks:
549
Remarks:
550
  * For update of the screen (after completion of a series of commands
550
  * For update of the screen (after completion of a series of commands
551
    working with a background) call subfunction 3.
551
    working with a background) call subfunction 3.
552
  * There is a pair function for get drawing mode of the background -
552
  * There is a pair function for get drawing mode of the background -
553
    subfunction 4 of function 39.
553
    subfunction 4 of function 39.
554
 
554
 
555
======================================================================
555
======================================================================
556
===================== Function 15, subfunction 5 =====================
556
===================== Function 15, subfunction 5 =====================
557
============ Put block of pixels on the background image. ============
557
============ Put block of pixels on the background image. ============
558
======================================================================
558
======================================================================
559
Parameters:
559
Parameters:
560
  * eax = 15 - function number
560
  * eax = 15 - function number
561
  * ebx = 5 - subfunction number
561
  * ebx = 5 - subfunction number
562
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
562
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
563
  * edx = offset in data of the background image
563
  * edx = offset in data of the background image
564
  * esi = size of data in bytes = 3 * number of pixels
564
  * esi = size of data in bytes = 3 * number of pixels
565
Returned value:
565
Returned value:
566
  * function does not return value
566
  * function does not return value
567
Remarks:
567
Remarks:
568
  * Offset and size are not checked for correctness.
568
  * Offset and size are not checked for correctness.
569
  * Color of each pixel is stored as 3-bytes value BBGGRR.
569
  * Color of each pixel is stored as 3-bytes value BBGGRR.
570
  * Pixels of the background image are written sequentially
570
  * Pixels of the background image are written sequentially
571
    from left to right, from up to down.
571
    from left to right, from up to down.
572
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
572
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
573
  * For update of the screen (after completion of a series of commands
573
  * For update of the screen (after completion of a series of commands
574
    working with a background) call subfunction 3.
574
    working with a background) call subfunction 3.
575
 
575
 
576
======================================================================
576
======================================================================
577
===================== Function 15, subfunction 6 =====================
577
===================== Function 15, subfunction 6 =====================
578
======== Map background data to the address space of process. ========
578
======== Map background data to the address space of process. ========
579
======================================================================
579
======================================================================
580
Parameters:
580
Parameters:
581
  * eax = 15 - function number
581
  * eax = 15 - function number
582
  * ebx = 6 - subfunction number
582
  * ebx = 6 - subfunction number
583
Returned value:
583
Returned value:
584
  * eax = pointer to background data, 0 if error
584
  * eax = pointer to background data, 0 if error
585
Remarks:
585
Remarks:
586
  * Mapped data are available for read and write.
586
  * Mapped data are available for read and write.
587
  * Size of background data is 3*xsize*ysize. The system blocks
587
  * Size of background data is 3*xsize*ysize. The system blocks
588
    changes of background sizes while process works with mapped data.
588
    changes of background sizes while process works with mapped data.
589
  * Color of each pixel is stored as 3-bytes value BBGGRR.
589
  * Color of each pixel is stored as 3-bytes value BBGGRR.
590
  * Pixels of the background image are written sequentially
590
  * Pixels of the background image are written sequentially
591
    from left to right, from up to down.
591
    from left to right, from up to down.
592
 
592
 
593
======================================================================
593
======================================================================
594
===== Function 15, subfunction 7 - close mapped background data. =====
594
===== Function 15, subfunction 7 - close mapped background data. =====
595
======================================================================
595
======================================================================
596
Parameters:
596
Parameters:
597
  * eax = 15 - function number
597
  * eax = 15 - function number
598
  * ebx = 7 - subfunction number
598
  * ebx = 7 - subfunction number
599
  * ecx = pointer to mapped data
599
  * ecx = pointer to mapped data
600
Returned value:
600
Returned value:
601
  * eax = 1 - success, 0 - error
601
  * eax = 1 - success, 0 - error
602
 
602
 
603
======================================================================
603
======================================================================
-
 
604
===================== Function 15, subfunction 8 =====================
-
 
605
============= Get coordinates of last draw the background ============
-
 
606
======================================================================
-
 
607
Parameters:
-
 
608
  * eax = 15 - function number
-
 
609
  * ebx = 8 - subfunction number
-
 
610
Returned value:
-
 
611
  * eax = [left]*65536 + [right]
-
 
612
  * ebx = [top]*65536 + [bottom]
-
 
613
Remarks:
-
 
614
  * (left,top) are coordinates of the left upper corner,
-
 
615
    (right,bottom) are coordinates of the right lower one.
-
 
616
  * For receiving more reliable information, call the function
-
 
617
    immediately after the event:
-
 
618
             5 = kernel finished redrawing of the desktop background
-
 
619
 
-
 
620
======================================================================
604
=============== Function 16 - save ramdisk on a floppy. ==============
621
=============== Function 16 - save ramdisk on a floppy. ==============
605
======================================================================
622
======================================================================
606
Parameters:
623
Parameters:
607
  * eax = 16 - function number
624
  * eax = 16 - function number
608
  * ebx = 1 or ebx = 2 - on which floppy save
625
  * ebx = 1 or ebx = 2 - on which floppy save
609
Returned value:
626
Returned value:
610
  * eax = 0 - success
627
  * eax = 0 - success
611
  * eax = 1 - error
628
  * eax = 1 - error
612
 
629
 
613
======================================================================
630
======================================================================
614
======= Function 17 - get the identifier of the pressed button. ======
631
======= Function 17 - get the identifier of the pressed button. ======
615
======================================================================
632
======================================================================
616
Takes away the code of the pressed button from the buffer.
633
Takes away the code of the pressed button from the buffer.
617
Parameters:
634
Parameters:
618
  * eax = 17 - function number
635
  * eax = 17 - function number
619
Returned value:
636
Returned value:
620
  * if the buffer is empty, function returns eax=1
637
  * if the buffer is empty, function returns eax=1
621
  * if the buffer is not empty:
638
  * if the buffer is not empty:
622
    * high 24 bits of eax contain button identifier (in particular,
639
    * high 24 bits of eax contain button identifier (in particular,
623
      ah contains low byte of the identifier; if all buttons have
640
      ah contains low byte of the identifier; if all buttons have
624
      the identifier less than 256, ah is enough to distinguish)
641
      the identifier less than 256, ah is enough to distinguish)
625
    * al = 0 - the button was pressed with left mouse button
642
    * al = 0 - the button was pressed with left mouse button
626
    * al = bit corresponding to used mouse button otherwise
643
    * al = bit corresponding to used mouse button otherwise
627
Remarks:
644
Remarks:
628
  * "Buffer" keeps only one button, at pressing the new button the
645
  * "Buffer" keeps only one button, at pressing the new button the
629
    information about old is lost.
646
    information about old is lost.
630
  * The call of this function by an application with inactive window
647
  * The call of this function by an application with inactive window
631
    will return answer "buffer is empty".
648
    will return answer "buffer is empty".
632
  * Returned value for al corresponds to the state of mouse buttons
649
  * Returned value for al corresponds to the state of mouse buttons
633
    as in subfunction 2 of function 37 at the beginning
650
    as in subfunction 2 of function 37 at the beginning
634
    of button press, excluding lower bit, which is cleared.
651
    of button press, excluding lower bit, which is cleared.
635
 
652
 
636
======================================================================
653
======================================================================
637
===================== Function 18, subfunction 1 =====================
654
===================== Function 18, subfunction 1 =====================
638
============= Make deactive the window of the given thread. ==========
655
============= Make deactive the window of the given thread. ==========
639
======================================================================
656
======================================================================
640
Parameters:
657
Parameters:
641
  * eax = 18 - function number
658
  * eax = 18 - function number
642
  * ebx = 1 - subfunction number
659
  * ebx = 1 - subfunction number
643
  * ecx = number of the thread slot
660
  * ecx = number of the thread slot
644
Returned value:
661
Returned value:
645
  * function does not return value
662
  * function does not return value
646
 
663
 
647
======================================================================
664
======================================================================
648
= Function 18, subfunction 2 - terminate process/thread by the slot. =
665
= Function 18, subfunction 2 - terminate process/thread by the slot. =
649
======================================================================
666
======================================================================
650
Parameters:
667
Parameters:
651
  * eax = 18 - function number
668
  * eax = 18 - function number
652
  * ebx = 2 - subfunction number
669
  * ebx = 2 - subfunction number
653
  * ecx = number of the slot of process/thread
670
  * ecx = number of the slot of process/thread
654
Returned value:
671
Returned value:
655
  * function does not return value
672
  * function does not return value
656
Remarks:
673
Remarks:
657
  * It is impossible to terminate system thread OS/IDLE (with
674
  * It is impossible to terminate system thread OS/IDLE (with
658
    number of the slot 1),
675
    number of the slot 1),
659
    it is possible to terminate any normal process/thread.
676
    it is possible to terminate any normal process/thread.
660
  * See also subfunction 18 - terminate
677
  * See also subfunction 18 - terminate
661
    process/thread by the identifier.
678
    process/thread by the identifier.
662
 
679
 
663
======================================================================
680
======================================================================
664
===================== Function 18, subfunction 3 =====================
681
===================== Function 18, subfunction 3 =====================
665
============= Make active the window of the given thread. ============
682
============= Make active the window of the given thread. ============
666
======================================================================
683
======================================================================
667
Parameters:
684
Parameters:
668
  * eax = 18 - function number
685
  * eax = 18 - function number
669
  * ebx = 3 - subfunction number
686
  * ebx = 3 - subfunction number
670
  * ecx = number of the thread slot
687
  * ecx = number of the thread slot
671
Returned value:
688
Returned value:
672
  * function does not return value
689
  * function does not return value
673
Remarks:
690
Remarks:
674
  * If correct, but nonexistent slot is given,
691
  * If correct, but nonexistent slot is given,
675
    some window is made active.
692
    some window is made active.
676
  * To find out, which window is active, use subfunction 7.
693
  * To find out, which window is active, use subfunction 7.
677
 
694
 
678
======================================================================
695
======================================================================
679
===================== Function 18, subfunction 4 =====================
696
===================== Function 18, subfunction 4 =====================
680
=========== Get counter of idle time units per one second. ===========
697
=========== Get counter of idle time units per one second. ===========
681
======================================================================
698
======================================================================
682
Idle time units are units, in which the processor stands idle
699
Idle time units are units, in which the processor stands idle
683
in waiting for interrupt (in the command 'hlt').
700
in waiting for interrupt (in the command 'hlt').
684
 
701
 
685
Parameters:
702
Parameters:
686
  * eax = 18 - function number
703
  * eax = 18 - function number
687
  * ebx = 4 - subfunction number
704
  * ebx = 4 - subfunction number
688
Returned value:
705
Returned value:
689
  * eax = value of the counter of idle time units per one second
706
  * eax = value of the counter of idle time units per one second
690
 
707
 
691
======================================================================
708
======================================================================
692
========== Function 18, subfunction 5 - get CPU clock rate. ==========
709
========== Function 18, subfunction 5 - get CPU clock rate. ==========
693
======================================================================
710
======================================================================
694
Parameters:
711
Parameters:
695
  * eax = 18 - function number
712
  * eax = 18 - function number
696
  * ebx = 5 - subfunction number
713
  * ebx = 5 - subfunction number
697
Returned value:
714
Returned value:
698
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
715
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
699
 
716
 
700
======================================================================
717
======================================================================
701
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
718
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
702
======================================================================
719
======================================================================
703
Parameters:
720
Parameters:
704
  * eax = 18 - function number
721
  * eax = 18 - function number
705
  * ebx = 6 - subfunction number
722
  * ebx = 6 - subfunction number
706
  * ecx = pointer to the full path to file
723
  * ecx = pointer to the full path to file
707
    (for example, "/hd0/1/kolibri/kolibri.img")
724
    (for example, "/hd0/1/kolibri/kolibri.img")
708
Returned value:
725
Returned value:
709
  * eax = 0 - success
726
  * eax = 0 - success
710
  * else eax = error code of the file system
727
  * else eax = error code of the file system
711
Remarks:
728
Remarks:
712
  * All folders in the given path must exist, otherwise function
729
  * All folders in the given path must exist, otherwise function
713
    returns value 5, "file not found".
730
    returns value 5, "file not found".
714
 
731
 
715
======================================================================
732
======================================================================
716
=========== Function 18, subfunction 7 - get active window. ==========
733
=========== Function 18, subfunction 7 - get active window. ==========
717
======================================================================
734
======================================================================
718
Parameters:
735
Parameters:
719
  * eax = 18 - function number
736
  * eax = 18 - function number
720
  * ebx = 7 - subfunction number
737
  * ebx = 7 - subfunction number
721
Returned value:
738
Returned value:
722
  * eax = number of the active window
739
  * eax = number of the active window
723
    (number of the slot of the thread with active window)
740
    (number of the slot of the thread with active window)
724
Remarks:
741
Remarks:
725
  * Active window is at the top of the window stack and receives
742
  * Active window is at the top of the window stack and receives
726
    messages on all keyboard input.
743
    messages on all keyboard input.
727
  * To make a window active, use subfunction 3.
744
  * To make a window active, use subfunction 3.
728
 
745
 
729
======================================================================
746
======================================================================
730
== Function 18, subfunction 8 - disable/enable the internal speaker. =
747
== Function 18, subfunction 8 - disable/enable the internal speaker. =
731
======================================================================
748
======================================================================
732
If speaker sound is disabled, all calls to subfunction 55 of
749
If speaker sound is disabled, all calls to subfunction 55 of
733
function 55 are ignored. If speaker sound is enabled,
750
function 55 are ignored. If speaker sound is enabled,
734
they are routed on builtin speaker.
751
they are routed on builtin speaker.
735
 
752
 
736
------------------- Subsubfunction 1 - get status. -------------------
753
------------------- Subsubfunction 1 - get status. -------------------
737
Parameters:
754
Parameters:
738
  * eax = 18 - function number
755
  * eax = 18 - function number
739
  * ebx = 8 - subfunction number
756
  * ebx = 8 - subfunction number
740
  * ecx = 1 - number of the subsubfunction
757
  * ecx = 1 - number of the subsubfunction
741
Returned value:
758
Returned value:
742
  * eax = 0 - speaker sound is enabled; 1 - disabled
759
  * eax = 0 - speaker sound is enabled; 1 - disabled
743
 
760
 
744
----------------- Subsubfunction 2 - toggle status. ------------------
761
----------------- Subsubfunction 2 - toggle status. ------------------
745
Toggles states of disable/enable.
762
Toggles states of disable/enable.
746
Parameters:
763
Parameters:
747
  * eax = 18 - function number
764
  * eax = 18 - function number
748
  * ebx = 8 - subfunction number
765
  * ebx = 8 - subfunction number
749
  * ecx = 2 - number of the subsubfunction
766
  * ecx = 2 - number of the subsubfunction
750
Returned value:
767
Returned value:
751
  * function does not return value
768
  * function does not return value
752
 
769
 
753
======================================================================
770
======================================================================
754
== Function 18, subfunction 9 - system shutdown with the parameter. ==
771
== Function 18, subfunction 9 - system shutdown with the parameter. ==
755
======================================================================
772
======================================================================
756
Parameters:
773
Parameters:
757
  * eax = 18 - function number
774
  * eax = 18 - function number
758
  * ebx = 9 - subfunction number
775
  * ebx = 9 - subfunction number
759
  * ecx = parameter:
776
  * ecx = parameter:
760
    * 2 = turn off computer
777
    * 2 = turn off computer
761
    * 3 = reboot computer
778
    * 3 = reboot computer
762
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
779
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
763
Returned value:
780
Returned value:
764
  * at incorrect ecx the registers do not change (i.e. eax=18)
781
  * at incorrect ecx the registers do not change (i.e. eax=18)
765
  * by correct call function always returns eax=0
782
  * by correct call function always returns eax=0
766
    as the tag of success
783
    as the tag of success
767
Remarks:
784
Remarks:
768
  * Do not rely on returned value by incorrect call, it can be
785
  * Do not rely on returned value by incorrect call, it can be
769
    changed in future versions of the kernel.
786
    changed in future versions of the kernel.
770
 
787
 
771
======================================================================
788
======================================================================
772
===== Function 18, subfunction 10 - minimize application window. =====
789
===== Function 18, subfunction 10 - minimize application window. =====
773
======================================================================
790
======================================================================
774
Minimizes the own window.
791
Minimizes the own window.
775
Parameters:
792
Parameters:
776
  * eax = 18 - function number
793
  * eax = 18 - function number
777
  * ebx = 10 - subfunction number
794
  * ebx = 10 - subfunction number
778
Returned value:
795
Returned value:
779
  * function does not return value
796
  * function does not return value
780
Remarks:
797
Remarks:
781
  * The minimized window from the point of view of function 9
798
  * The minimized window from the point of view of function 9
782
    keeps position and sizes.
799
    keeps position and sizes.
783
  * Restoring of an application window occurs at its activation by
800
  * Restoring of an application window occurs at its activation by
784
    subfunction 3.
801
    subfunction 3.
785
  * Usually there is no necessity to minimize/restire a window
802
  * Usually there is no necessity to minimize/restire a window
786
    obviously: minimization of a window is carried out by the system
803
    obviously: minimization of a window is carried out by the system
787
    at pressing the minimization button (for skinned windows
804
    at pressing the minimization button (for skinned windows
788
    it is defined automatically by function 0,
805
    it is defined automatically by function 0,
789
    for other windows it can be defined manually by function 8),
806
    for other windows it can be defined manually by function 8),
790
    restore of a window is done by the application '@panel'.
807
    restore of a window is done by the application '@panel'.
791
 
808
 
792
======================================================================
809
======================================================================
793
 Function 18, subfunction 11 - get information on the disk subsystem.
810
 Function 18, subfunction 11 - get information on the disk subsystem.
794
======================================================================
811
======================================================================
795
Parameters:
812
Parameters:
796
  * eax = 18 - function number
813
  * eax = 18 - function number
797
  * ebx = 11 - subfunction number
814
  * ebx = 11 - subfunction number
798
  * ecx = type of the table:
815
  * ecx = type of the table:
799
    * 1 = short version, 10 bytes
816
    * 1 = short version, 10 bytes
800
    * 2 = full version, 65536 bytes
817
    * 2 = full version, 65536 bytes
801
  * edx = pointer to the buffer (in the application) for the table
818
  * edx = pointer to the buffer (in the application) for the table
802
Returned value:
819
Returned value:
803
  * function does not return value
820
  * function does not return value
804
Format of the table: short version:
821
Format of the table: short version:
805
  * +0: byte: information about FDD's (drives for floppies),
822
  * +0: byte: information about FDD's (drives for floppies),
806
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
823
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
807
    of the second regarding to the following list:
824
    of the second regarding to the following list:
808
    * 0 = there is no drive
825
    * 0 = there is no drive
809
    * 1 = 360Kb, 5.25''
826
    * 1 = 360Kb, 5.25''
810
    * 2 = 1.2Mb, 5.25''
827
    * 2 = 1.2Mb, 5.25''
811
    * 3 = 720Kb, 3.5''
828
    * 3 = 720Kb, 3.5''
812
    * 4 = 1.44Mb, 3.5''
829
    * 4 = 1.44Mb, 3.5''
813
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
830
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
814
    For example, for the standard configuration from one 1.44-drive
831
    For example, for the standard configuration from one 1.44-drive
815
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
832
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
816
    the value is 24h.
833
    the value is 24h.
817
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
834
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
818
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
835
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
819
    * 0 = device is absent
836
    * 0 = device is absent
820
    * 1 = hard drive
837
    * 1 = hard drive
821
    * 2 = CD-drive
838
    * 2 = CD-drive
822
    For example, in the case HD on IDE0 and CD on IDE2
839
    For example, in the case HD on IDE0 and CD on IDE2
823
    this field contains 48h.
840
    this field contains 48h.
824
  * +2: 4 db: number of the retrieved partitions on hard disks
841
  * +2: 4 db: number of the retrieved partitions on hard disks
825
    at accordingly IDE0,...,IDE3.
842
    at accordingly IDE0,...,IDE3.
826
    If the hard disk on IDEx is absent, appropriate byte is zero,
843
    If the hard disk on IDEx is absent, appropriate byte is zero,
827
    otherwise it shows number of the recognized partitions, which
844
    otherwise it shows number of the recognized partitions, which
828
    can be not presented (if the drive is not formatted or if
845
    can be not presented (if the drive is not formatted or if
829
    the file system is not supported). Current version of the kernel
846
    the file system is not supported). Current version of the kernel
830
    supports only FAT16, FAT32 and NTFS for hard disks.
847
    supports only FAT16, FAT32 and NTFS for hard disks.
831
  * +6: 4 db: reserved
848
  * +6: 4 db: reserved
832
Format of the table: full version:
849
Format of the table: full version:
833
  * +0: 10 db: same as for the short version
850
  * +0: 10 db: same as for the short version
834
  * +10: 100 db: data for the first partition
851
  * +10: 100 db: data for the first partition
835
  * +110: 100 db: data for the second partition
852
  * +110: 100 db: data for the second partition
836
  * ...
853
  * ...
837
  * +10+100*(n-1): 100 db: data for the last partition
854
  * +10+100*(n-1): 100 db: data for the last partition
838
The partitions are located as follows: at first sequentially all
855
The partitions are located as follows: at first sequentially all
839
recoginzed partitions on HD on IDE0 (if present),
856
recoginzed partitions on HD on IDE0 (if present),
840
then on HD on IDE1 (if present) and so on up to IDE3.
857
then on HD on IDE1 (if present) and so on up to IDE3.
841
Format of the information about partition
858
Format of the information about partition
842
(at moment only FAT is supported):
859
(at moment only FAT is supported):
843
  * +0: dword: first physical sector of the partition
860
  * +0: dword: first physical sector of the partition
844
  * +4: dword: last physical sector of the partition
861
  * +4: dword: last physical sector of the partition
845
    (belongs to the partition)
862
    (belongs to the partition)
846
  * +8: byte: file system type:
863
  * +8: byte: file system type:
847
    16=FAT16, 32=FAT32, 1=NTFS
864
    16=FAT16, 32=FAT32, 1=NTFS
848
  * other data are dependent on file system, are modified with
865
  * other data are dependent on file system, are modified with
849
    kernel modifications and therefore are not described
866
    kernel modifications and therefore are not described
850
Remarks:
867
Remarks:
851
  * The short table can be used for obtaining the information about
868
  * The short table can be used for obtaining the information about
852
    available devices.
869
    available devices.
853
 
870
 
854
======================================================================
871
======================================================================
855
========== Function 18, subfunction 13 - get kernel version. =========
872
========== Function 18, subfunction 13 - get kernel version. =========
856
======================================================================
873
======================================================================
857
Parameters:
874
Parameters:
858
  * eax = 18 - function number
875
  * eax = 18 - function number
859
  * ebx = 13 - subfunction number
876
  * ebx = 13 - subfunction number
860
  * ecx = pointer to the buffer (not less than 16 bytes), where
877
  * ecx = pointer to the buffer (not less than 16 bytes), where
861
    the information will be placed
878
    the information will be placed
862
Returned value:
879
Returned value:
863
  * function does not return value
880
  * function does not return value
864
Structure of the buffer:
881
Structure of the buffer:
865
db a,b,c,d for version a.b.c.d
882
db a,b,c,d for version a.b.c.d
866
db 0: reserved
883
db 0: reserved
867
dd REV - kernel SVN revision number
884
dd REV - kernel SVN revision number
868
For Kolibri 0.7.7.0+ kernel:
885
For Kolibri 0.7.7.0+ kernel:
869
db 0,7,7,0
886
db 0,7,7,0
870
db 0
887
db 0
871
dd 1675
888
dd 1675
872
 
889
 
873
======================================================================
890
======================================================================
874
======= Function 18, subfunction 14 - wait for screen retrace. =======
891
======= Function 18, subfunction 14 - wait for screen retrace. =======
875
======================================================================
892
======================================================================
876
Waits for the beginning of retrace of the scanning ray of the screen
893
Waits for the beginning of retrace of the scanning ray of the screen
877
monitor.
894
monitor.
878
Parameters:
895
Parameters:
879
  * eax = 18 - function number
896
  * eax = 18 - function number
880
  * ebx = 14 - subfunction number
897
  * ebx = 14 - subfunction number
881
Returned value:
898
Returned value:
882
  * eax = 0 as the tag of success
899
  * eax = 0 as the tag of success
883
Remarks:
900
Remarks:
884
  * Function is intended only for active high-efficiency graphics
901
  * Function is intended only for active high-efficiency graphics
885
    applications; is used for smooth output of a graphics.
902
    applications; is used for smooth output of a graphics.
886
 
903
 
887
======================================================================
904
======================================================================
888
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
905
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
889
======================================================================
906
======================================================================
890
Parameters:
907
Parameters:
891
  * eax = 18 - function number
908
  * eax = 18 - function number
892
  * ebx = 15 - subfunction number
909
  * ebx = 15 - subfunction number
893
Returned value:
910
Returned value:
894
  * eax = 0 as the tag of success
911
  * eax = 0 as the tag of success
895
 
912
 
896
======================================================================
913
======================================================================
897
========= Function 18, subfunction 16 - get size of free RAM. ========
914
========= Function 18, subfunction 16 - get size of free RAM. ========
898
======================================================================
915
======================================================================
899
Parameters:
916
Parameters:
900
  * eax = 18 - function number
917
  * eax = 18 - function number
901
  * ebx = 16 - subfunction number
918
  * ebx = 16 - subfunction number
902
Returned value:
919
Returned value:
903
  * eax = size of free memory in kilobytes
920
  * eax = size of free memory in kilobytes
904
 
921
 
905
======================================================================
922
======================================================================
906
======== Function 18, subfunction 17 - get full amount of RAM. =======
923
======== Function 18, subfunction 17 - get full amount of RAM. =======
907
======================================================================
924
======================================================================
908
Parameters:
925
Parameters:
909
  * eax = 18 - function number
926
  * eax = 18 - function number
910
  * ebx = 17 - subfunction number
927
  * ebx = 17 - subfunction number
911
Returned value:
928
Returned value:
912
  * eax = total size of existing memory in kilobytes
929
  * eax = total size of existing memory in kilobytes
913
 
930
 
914
======================================================================
931
======================================================================
915
===================== Function 18, subfunction 18 ====================
932
===================== Function 18, subfunction 18 ====================
916
============= Terminate process/thread by the identifier. ============
933
============= Terminate process/thread by the identifier. ============
917
======================================================================
934
======================================================================
918
Parameters:
935
Parameters:
919
  * eax = 18 - function number
936
  * eax = 18 - function number
920
  * ebx = 18 - subfunction number
937
  * ebx = 18 - subfunction number
921
  * ecx = identifer of process/thread (PID/TID)
938
  * ecx = identifer of process/thread (PID/TID)
922
Returned value:
939
Returned value:
923
  * eax = 0 - success
940
  * eax = 0 - success
924
  * eax = -1 - error (process is not found or is system)
941
  * eax = -1 - error (process is not found or is system)
925
Remarks:
942
Remarks:
926
  * It is impossible to terminate system thread OS/IDLE (identifier
943
  * It is impossible to terminate system thread OS/IDLE (identifier
927
    1), it is possible to terminate any normal process/thread.
944
    1), it is possible to terminate any normal process/thread.
928
  * See also subfunction 2 - terminate
945
  * See also subfunction 2 - terminate
929
    process/thread by given slot.
946
    process/thread by given slot.
930
 
947
 
931
======================================================================
948
======================================================================
932
======== Function 18, subfunction 19 - get/set mouse features. =======
949
======== Function 18, subfunction 19 - get/set mouse features. =======
933
======================================================================
950
======================================================================
934
 
951
 
935
---------------- Subsubfunction 0 - get mouse speed. -----------------
952
---------------- Subsubfunction 0 - get mouse speed. -----------------
936
Parameters:
953
Parameters:
937
  * eax = 18 - function number
954
  * eax = 18 - function number
938
  * ebx = 19 - subfunction number
955
  * ebx = 19 - subfunction number
939
  * ecx = 0 - subsubfunction number
956
  * ecx = 0 - subsubfunction number
940
Returned value:
957
Returned value:
941
  * eax = current mouse speed
958
  * eax = current mouse speed
942
 
959
 
943
---------------- Subsubfunction 1 - set mouse speed. -----------------
960
---------------- Subsubfunction 1 - set mouse speed. -----------------
944
Parameters:
961
Parameters:
945
  * eax = 18 - function number
962
  * eax = 18 - function number
946
  * ebx = 19 - subfunction number
963
  * ebx = 19 - subfunction number
947
  * ecx = 1 - subsubfunction number
964
  * ecx = 1 - subsubfunction number
948
  * edx = new value for speed
965
  * edx = new value for speed
949
Returned value:
966
Returned value:
950
  * function does not return value
967
  * function does not return value
951
 
968
 
952
---------------- Subsubfunction 2 - get mouse delay. -----------------
969
---------------- Subsubfunction 2 - get mouse delay. -----------------
953
Parameters:
970
Parameters:
954
  * eax = 18 - function number
971
  * eax = 18 - function number
955
  * ebx = 19 - subfunction number
972
  * ebx = 19 - subfunction number
956
  * ecx = 2 - subsubfunction number
973
  * ecx = 2 - subsubfunction number
957
Returned value:
974
Returned value:
958
  * eax = current mouse delay
975
  * eax = current mouse delay
959
 
976
 
960
---------------- Subsubfunction 3 - set mouse delay. -----------------
977
---------------- Subsubfunction 3 - set mouse delay. -----------------
961
Parameters:
978
Parameters:
962
  * eax = 18 - function number
979
  * eax = 18 - function number
963
  * ebx = 19 - subfunction number
980
  * ebx = 19 - subfunction number
964
  * ecx = 3 - subsubfunction number
981
  * ecx = 3 - subsubfunction number
965
  * edx = new value for mouse delay
982
  * edx = new value for mouse delay
966
Returned value:
983
Returned value:
967
  * function does not return value
984
  * function does not return value
968
 
985
 
969
----------- Subsubfunction 4 - set mouse pointer position. -----------
986
----------- Subsubfunction 4 - set mouse pointer position. -----------
970
Parameters:
987
Parameters:
971
  * eax = 18 - function number
988
  * eax = 18 - function number
972
  * ebx = 19 - subfunction number
989
  * ebx = 19 - subfunction number
973
  * ecx = 4 - subsubfunction number
990
  * ecx = 4 - subsubfunction number
974
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
991
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
975
Returned value:
992
Returned value:
976
  * function does not return value
993
  * function does not return value
977
 
994
 
978
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
995
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
979
Parameters:
996
Parameters:
980
  * eax = 18 - function number
997
  * eax = 18 - function number
981
  * ebx = 19 - subfunction number
998
  * ebx = 19 - subfunction number
982
  * ecx = 5 - subsubfunction number
999
  * ecx = 5 - subsubfunction number
983
  * edx = information about emulated state of mouse buttons:
1000
  * edx = information about emulated state of mouse buttons:
984
    (same as return value in subfunction 2 of function 37)
1001
    (same as return value in subfunction 2 of function 37)
985
    * bit 0 is set = left button is pressed
1002
    * bit 0 is set = left button is pressed
986
    * bit 1 is set = right button is pressed
1003
    * bit 1 is set = right button is pressed
987
    * bit 2 is set = middle button is pressed
1004
    * bit 2 is set = middle button is pressed
988
    * bit 3 is set = 4th button is pressed
1005
    * bit 3 is set = 4th button is pressed
989
    * bit 4 is set = 5th button is pressed
1006
    * bit 4 is set = 5th button is pressed
990
Returned value:
1007
Returned value:
991
  * function does not return value
1008
  * function does not return value
992
Remarks:
1009
Remarks:
993
  * It is recommended to set speed of the mouse (in subsubfunction 1)
1010
  * It is recommended to set speed of the mouse (in subsubfunction 1)
994
    from 1 up to 9. The installed value is not inspected by the kernel
1011
    from 1 up to 9. The installed value is not inspected by the kernel
995
    code, so set it carefully, at incorrect value the cursor
1012
    code, so set it carefully, at incorrect value the cursor
996
    can "freeze". Speed of the mouse can be regulated through the
1013
    can "freeze". Speed of the mouse can be regulated through the
997
    application SETUP.
1014
    application SETUP.
998
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
1015
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
999
    value is not handled by COM mice. At the very large values the
1016
    value is not handled by COM mice. At the very large values the
1000
    movement of the mouse on 1 pixel is impossible and the cursor will
1017
    movement of the mouse on 1 pixel is impossible and the cursor will
1001
    jump on the value of installed speed (subsubfunction 1). The
1018
    jump on the value of installed speed (subsubfunction 1). The
1002
    installed value is not inspected by the kernel code.
1019
    installed value is not inspected by the kernel code.
1003
    Mouse delay can be regulated through the application SETUP.
1020
    Mouse delay can be regulated through the application SETUP.
1004
  * The subsubfunction 4 does not check the passed value. Before
1021
  * The subsubfunction 4 does not check the passed value. Before
1005
    its call find out current screen resolution (with function 14)
1022
    its call find out current screen resolution (with function 14)
1006
    and check that the value of position is inside the limits of the
1023
    and check that the value of position is inside the limits of the
1007
    screen.
1024
    screen.
1008
 
1025
 
1009
======================================================================
1026
======================================================================
1010
======== Function 18, subfunction 20 - get information on RAM. =======
1027
======== Function 18, subfunction 20 - get information on RAM. =======
1011
======================================================================
1028
======================================================================
1012
Parameters:
1029
Parameters:
1013
  * eax = 18 - function number
1030
  * eax = 18 - function number
1014
  * ebx = 20 - subfunction number
1031
  * ebx = 20 - subfunction number
1015
  * ecx = pointer to the buffer for information (36 bytes)
1032
  * ecx = pointer to the buffer for information (36 bytes)
1016
Returned value:
1033
Returned value:
1017
  * eax = total size of existing RAM in pages
1034
  * eax = total size of existing RAM in pages
1018
    or -1 if error has occured
1035
    or -1 if error has occured
1019
  * buffer pointed to by ecx contains the following information:
1036
  * buffer pointed to by ecx contains the following information:
1020
    * +0:  dword: total size of existing RAM in pages
1037
    * +0:  dword: total size of existing RAM in pages
1021
    * +4:  dword: size of free RAM in pages
1038
    * +4:  dword: size of free RAM in pages
1022
    * +8:  dword: number of page faults (exceptions #PF)
1039
    * +8:  dword: number of page faults (exceptions #PF)
1023
                 in applications
1040
                 in applications
1024
    * +12: dword: size of kernel heap in bytes
1041
    * +12: dword: size of kernel heap in bytes
1025
    * +16: dword: free in kernel heap in bytes
1042
    * +16: dword: free in kernel heap in bytes
1026
    * +20: dword: total number of memory blocks in kernel heap
1043
    * +20: dword: total number of memory blocks in kernel heap
1027
    * +24: dword: number of free memory blocks in kernel heap
1044
    * +24: dword: number of free memory blocks in kernel heap
1028
    * +28: dword: size of maximum free block in kernel heap
1045
    * +28: dword: size of maximum free block in kernel heap
1029
                 (reserved)
1046
                 (reserved)
1030
    * +32: dword: size of maximum allocated block in kernel heap
1047
    * +32: dword: size of maximum allocated block in kernel heap
1031
                 (reserved)
1048
                 (reserved)
1032
 
1049
 
1033
======================================================================
1050
======================================================================
1034
===================== Function 18, subfunction 21 ====================
1051
===================== Function 18, subfunction 21 ====================
1035
======== Get slot number of process/thread by the identifier. ========
1052
======== Get slot number of process/thread by the identifier. ========
1036
======================================================================
1053
======================================================================
1037
Parameters:
1054
Parameters:
1038
  * eax = 18 - function number
1055
  * eax = 18 - function number
1039
  * ebx = 21 - subfunction number
1056
  * ebx = 21 - subfunction number
1040
  * ecx = identifer of process/thread (PID/TID)
1057
  * ecx = identifer of process/thread (PID/TID)
1041
Returned value:
1058
Returned value:
1042
  * eax = 0 - error (invalid identifier)
1059
  * eax = 0 - error (invalid identifier)
1043
  * otherwise eax = slot number
1060
  * otherwise eax = slot number
1044
 
1061
 
1045
======================================================================
1062
======================================================================
1046
===================== Function 18, subfunction 22 ====================
1063
===================== Function 18, subfunction 22 ====================
1047
============== Operations with window of another thread. =============
1064
============== Operations with window of another thread. =============
1048
======================================================================
1065
======================================================================
1049
Parameters:
1066
Parameters:
1050
  * eax = 18 - function number
1067
  * eax = 18 - function number
1051
  * ebx = 22 - subfunction number
1068
  * ebx = 22 - subfunction number
1052
  * ecx = operation type:
1069
  * ecx = operation type:
1053
    * 0 = minimize window of the thread with given slot number
1070
    * 0 = minimize window of the thread with given slot number
1054
    * 1 = minimize window of the thread with given identifier
1071
    * 1 = minimize window of the thread with given identifier
1055
    * 2 = restore window of the thread with given slot number
1072
    * 2 = restore window of the thread with given slot number
1056
    * 3 = restore window of the thread with given identifier
1073
    * 3 = restore window of the thread with given identifier
1057
  * edx = parameter (slot number or PID/TID)
1074
  * edx = parameter (slot number or PID/TID)
1058
Returned value:
1075
Returned value:
1059
  * eax = 0 - success
1076
  * eax = 0 - success
1060
  * eax = -1 - error (invalid identifier)
1077
  * eax = -1 - error (invalid identifier)
1061
Remarks:
1078
Remarks:
1062
  * The thread can minimize its window with subfunction 10.
1079
  * The thread can minimize its window with subfunction 10.
1063
  * One can restore and activate window simultaneously with
1080
  * One can restore and activate window simultaneously with
1064
    subfunction 3 (which requires slot number).
1081
    subfunction 3 (which requires slot number).
1065
 
1082
 
1066
======================================================================
1083
======================================================================
1067
==================== Function 20 - MIDI interface. ===================
1084
==================== Function 20 - MIDI interface. ===================
1068
======================================================================
1085
======================================================================
1069
 
1086
 
1070
----------------------- Subfunction 1 - reset ------------------------
1087
----------------------- Subfunction 1 - reset ------------------------
1071
Parameters:
1088
Parameters:
1072
  * eax = 20 - function number
1089
  * eax = 20 - function number
1073
  * ebx = 1 - subfunction number
1090
  * ebx = 1 - subfunction number
1074
 
1091
 
1075
-------------------- Subfunction 2 - output byte ---------------------
1092
-------------------- Subfunction 2 - output byte ---------------------
1076
Parameters:
1093
Parameters:
1077
  * eax = 20 - function number
1094
  * eax = 20 - function number
1078
  * ebx = 2 - subfunction number
1095
  * ebx = 2 - subfunction number
1079
  * cl = byte for output
1096
  * cl = byte for output
1080
Returned value (is the same for both subfunctions):
1097
Returned value (is the same for both subfunctions):
1081
  * eax = 0 - success
1098
  * eax = 0 - success
1082
  * eax = 1 - base port is not defined
1099
  * eax = 1 - base port is not defined
1083
Remarks:
1100
Remarks:
1084
  * Previously the base port must be defined by
1101
  * Previously the base port must be defined by
1085
    subfunction 1 of function 21.
1102
    subfunction 1 of function 21.
1086
 
1103
 
1087
======================================================================
1104
======================================================================
1088
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1105
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1089
======================================================================
1106
======================================================================
1090
Parameters:
1107
Parameters:
1091
  * eax = 21 - function number
1108
  * eax = 21 - function number
1092
  * ebx = 1 - subfunction number
1109
  * ebx = 1 - subfunction number
1093
  * ecx = number of base port
1110
  * ecx = number of base port
1094
Returned value
1111
Returned value
1095
  * eax = 0 - success
1112
  * eax = 0 - success
1096
  * eax = -1 - erratic number of a port
1113
  * eax = -1 - erratic number of a port
1097
Remarks:
1114
Remarks:
1098
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1115
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1099
  * The installation of base is necessary for function 20.
1116
  * The installation of base is necessary for function 20.
1100
  * To get base port use subfunction 1 of function 26.
1117
  * To get base port use subfunction 1 of function 26.
1101
 
1118
 
1102
======================================================================
1119
======================================================================
1103
========== Function 21, subfunction 2 - set keyboard layout. =========
1120
========== Function 21, subfunction 2 - set keyboard layout. =========
1104
======================================================================
1121
======================================================================
1105
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1122
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1106
which will be read by function 2.
1123
which will be read by function 2.
1107
Parameters:
1124
Parameters:
1108
  * eax = 21 - function number
1125
  * eax = 21 - function number
1109
  * ebx = 2 - subfunction number
1126
  * ebx = 2 - subfunction number
1110
  * ecx = which layout to set:
1127
  * ecx = which layout to set:
1111
    * 1 = normal layout
1128
    * 1 = normal layout
1112
    * 2 = layout at pressed Shift
1129
    * 2 = layout at pressed Shift
1113
    * 3 = layout at pressed Alt
1130
    * 3 = layout at pressed Alt
1114
  * edx = pointer to layout - table of length 128 bytes
1131
  * edx = pointer to layout - table of length 128 bytes
1115
Or:
1132
Or:
1116
  * ecx = 9
1133
  * ecx = 9
1117
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1134
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1118
Returned value:
1135
Returned value:
1119
  * eax = 0 - success
1136
  * eax = 0 - success
1120
  * eax = 1 - incorrect parameter
1137
  * eax = 1 - incorrect parameter
1121
Remarks:
1138
Remarks:
1122
  * If Alt is pressed, the layout with Alt is used;
1139
  * If Alt is pressed, the layout with Alt is used;
1123
    if Alt is not pressed, but Shift is pressed,
1140
    if Alt is not pressed, but Shift is pressed,
1124
    the layout with Shift is used;
1141
    the layout with Shift is used;
1125
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1142
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1126
    layout is used and then from the code is subtracted 0x60;
1143
    layout is used and then from the code is subtracted 0x60;
1127
    if no control key is pressed, the normal layout is used.
1144
    if no control key is pressed, the normal layout is used.
1128
  * To get layout and country identifier use
1145
  * To get layout and country identifier use
1129
    subfunction 2 of function 26.
1146
    subfunction 2 of function 26.
1130
  * Country identifier is global system variable, which is not used
1147
  * Country identifier is global system variable, which is not used
1131
    by the kernel itself; however the application '@panel' displays
1148
    by the kernel itself; however the application '@panel' displays
1132
    the corresponding icon.
1149
    the corresponding icon.
1133
  * The application @panel switches layouts on user request.
1150
  * The application @panel switches layouts on user request.
1134
 
1151
 
1135
======================================================================
1152
======================================================================
1136
============== Function 21, subfunction 3 - set CD base. =============
1153
============== Function 21, subfunction 3 - set CD base. =============
1137
======================================================================
1154
======================================================================
1138
Parameters:
1155
Parameters:
1139
  * eax = 21 - function number
1156
  * eax = 21 - function number
1140
  * ebx = 3 - subfunction number
1157
  * ebx = 3 - subfunction number
1141
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1158
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1142
Returned value:
1159
Returned value:
1143
  * eax = 0
1160
  * eax = 0
1144
Remarks:
1161
Remarks:
1145
  * CD base is used by function 24.
1162
  * CD base is used by function 24.
1146
  * To get CD base use subfunction 3 of function 26.
1163
  * To get CD base use subfunction 3 of function 26.
1147
 
1164
 
1148
======================================================================
1165
======================================================================
1149
========== Function 21, subfunction 5 - set system language. =========
1166
========== Function 21, subfunction 5 - set system language. =========
1150
======================================================================
1167
======================================================================
1151
Parameters:
1168
Parameters:
1152
  * eax = 21 - function number
1169
  * eax = 21 - function number
1153
  * ebx = 5 - subfunction number
1170
  * ebx = 5 - subfunction number
1154
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1171
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1155
Returned value:
1172
Returned value:
1156
  * eax = 0
1173
  * eax = 0
1157
Remarks:
1174
Remarks:
1158
  * System language is global system variable and is not used
1175
  * System language is global system variable and is not used
1159
    by the kernel itself, however application @panel draws the
1176
    by the kernel itself, however application @panel draws the
1160
    appropriate icon.
1177
    appropriate icon.
1161
  * Function does not check for correctness, as the kernel does not
1178
  * Function does not check for correctness, as the kernel does not
1162
    use this variable.
1179
    use this variable.
1163
  * To get system language use subfunction 5 of function 26.
1180
  * To get system language use subfunction 5 of function 26.
1164
 
1181
 
1165
======================================================================
1182
======================================================================
1166
============== Function 21, subfunction 7 - set HD base. =============
1183
============== Function 21, subfunction 7 - set HD base. =============
1167
======================================================================
1184
======================================================================
1168
The HD base defines hard disk to write with usage of obsolete
1185
The HD base defines hard disk to write with usage of obsolete
1169
syntax /HD in obsolete function 58; at usage of modern syntax
1186
syntax /HD in obsolete function 58; at usage of modern syntax
1170
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1187
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1171
Parameters:
1188
Parameters:
1172
  * eax = 21 - function number
1189
  * eax = 21 - function number
1173
  * ebx = 7 - subfunction number
1190
  * ebx = 7 - subfunction number
1174
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1191
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1175
Returned value:
1192
Returned value:
1176
  * eax = 0
1193
  * eax = 0
1177
Remarks:
1194
Remarks:
1178
  * Any application at any time can change the base.
1195
  * Any application at any time can change the base.
1179
  * Do not change base, when any application works with hard disk.
1196
  * Do not change base, when any application works with hard disk.
1180
    If you do not want system bugs.
1197
    If you do not want system bugs.
1181
  * To get HD base use subfunction 7 of function 26.
1198
  * To get HD base use subfunction 7 of function 26.
1182
  * It is also necessary to define used partition of hard disk by
1199
  * It is also necessary to define used partition of hard disk by
1183
    subfunction 8.
1200
    subfunction 8.
1184
 
1201
 
1185
======================================================================
1202
======================================================================
1186
========= Function 21, subfunction 8 - set used HD partition. ========
1203
========= Function 21, subfunction 8 - set used HD partition. ========
1187
======================================================================
1204
======================================================================
1188
The HD partition defines partition of the hard disk to write with
1205
The HD partition defines partition of the hard disk to write with
1189
usage of obsolete syntax /HD and obsolete function 58;
1206
usage of obsolete syntax /HD and obsolete function 58;
1190
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1207
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1191
base and partition are set automatically.
1208
base and partition are set automatically.
1192
Parameters:
1209
Parameters:
1193
  * eax = 21 - function number
1210
  * eax = 21 - function number
1194
  * ebx = 8 - subfunction number
1211
  * ebx = 8 - subfunction number
1195
  * ecx = HD partition (beginning from 1)
1212
  * ecx = HD partition (beginning from 1)
1196
Return value:
1213
Return value:
1197
  * eax = 0
1214
  * eax = 0
1198
Remarks:
1215
Remarks:
1199
  * Any application at any time can change partition.
1216
  * Any application at any time can change partition.
1200
  * Do not change partition when any application works with hard disk.
1217
  * Do not change partition when any application works with hard disk.
1201
    If you do not want system bugs.
1218
    If you do not want system bugs.
1202
  * To get used partition use subfunction 8 of function 26.
1219
  * To get used partition use subfunction 8 of function 26.
1203
  * There is no correctness checks.
1220
  * There is no correctness checks.
1204
  * To get the number of partitions of a hard disk use
1221
  * To get the number of partitions of a hard disk use
1205
    subfunction 11 of function 18.
1222
    subfunction 11 of function 18.
1206
  * It is also necessary to define used HD base by subfunction 7.
1223
  * It is also necessary to define used HD base by subfunction 7.
1207
 
1224
 
1208
======================================================================
1225
======================================================================
1209
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1226
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1210
======================================================================
1227
======================================================================
1211
Parameters:
1228
Parameters:
1212
  * eax = 21 - function number
1229
  * eax = 21 - function number
1213
  * ebx = 11 - subfunction number
1230
  * ebx = 11 - subfunction number
1214
  * ecx = 0/1 - disable/enable
1231
  * ecx = 0/1 - disable/enable
1215
Returned value:
1232
Returned value:
1216
  * eax = 0
1233
  * eax = 0
1217
Remarks:
1234
Remarks:
1218
  * Is used in LBA-read (subfunction 8 of function 58).
1235
  * Is used in LBA-read (subfunction 8 of function 58).
1219
  * The current implementation uses only low bit of ecx.
1236
  * The current implementation uses only low bit of ecx.
1220
  * To get current status use subfunction 11 of function 26.
1237
  * To get current status use subfunction 11 of function 26.
1221
 
1238
 
1222
======================================================================
1239
======================================================================
1223
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1240
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1224
======================================================================
1241
======================================================================
1225
Parameters:
1242
Parameters:
1226
  * eax = 21 - function number
1243
  * eax = 21 - function number
1227
  * ebx = 12 - subfunction number
1244
  * ebx = 12 - subfunction number
1228
  * ecx = 0/1 - disable/enable
1245
  * ecx = 0/1 - disable/enable
1229
Returned value:
1246
Returned value:
1230
  * eax = 0
1247
  * eax = 0
1231
Remarks:
1248
Remarks:
1232
  * Is used in operations with PCI bus (function 62).
1249
  * Is used in operations with PCI bus (function 62).
1233
  * The current implementation uses only low bit of ecx.
1250
  * The current implementation uses only low bit of ecx.
1234
  * To get current status use subfunction 12 of function 26.
1251
  * To get current status use subfunction 12 of function 26.
1235
 
1252
 
1236
======================================================================
1253
======================================================================
1237
============ Function 21, subfunction 13, subsubfunction 1 ===========
1254
============ Function 21, subfunction 13, subsubfunction 1 ===========
1238
======== Initialize + get information on the driver vmode.mdr. =======
1255
======== Initialize + get information on the driver vmode.mdr. =======
1239
======================================================================
1256
======================================================================
1240
Parameters:
1257
Parameters:
1241
  * eax = 21 - function number
1258
  * eax = 21 - function number
1242
  * ebx = 13 - subfunction number
1259
  * ebx = 13 - subfunction number
1243
  * ecx = 1 - number of the driver function
1260
  * ecx = 1 - number of the driver function
1244
  * edx = pointer to 512-bytes buffer
1261
  * edx = pointer to 512-bytes buffer
1245
Returned value:
1262
Returned value:
1246
  * if driver is not loaded
1263
  * if driver is not loaded
1247
    (never happens in the current implementation):
1264
    (never happens in the current implementation):
1248
    * eax = -1
1265
    * eax = -1
1249
    * ebx, ecx destroyed
1266
    * ebx, ecx destroyed
1250
  * if driver is loaded:
1267
  * if driver is loaded:
1251
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1268
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1252
      - signature
1269
      - signature
1253
    * ebx = current frequency of the scanning (in Hz)
1270
    * ebx = current frequency of the scanning (in Hz)
1254
    * ecx destroyed
1271
    * ecx destroyed
1255
    * buffer pointed to by edx is filled
1272
    * buffer pointed to by edx is filled
1256
Format of the buffer:
1273
Format of the buffer:
1257
  * +0: 32*byte: driver name, "Trans VideoDriver"
1274
  * +0: 32*byte: driver name, "Trans VideoDriver"
1258
    (without quotes, supplemented by spaces)
1275
    (without quotes, supplemented by spaces)
1259
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1276
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1260
    y*65536+x), for the current implementation is 1 (1.0)
1277
    y*65536+x), for the current implementation is 1 (1.0)
1261
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1278
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1262
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1279
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1263
    is number of a videomode, after list itself there are zeroes)
1280
    is number of a videomode, after list itself there are zeroes)
1264
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1281
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1265
    scannings for videomodes: for each videomode listed in the
1282
    scannings for videomodes: for each videomode listed in the
1266
    previous field up to 5 supported frequences are given
1283
    previous field up to 5 supported frequences are given
1267
    (unused positions contain zeroes)
1284
    (unused positions contain zeroes)
1268
Remarks:
1285
Remarks:
1269
  * Function initializes the driver (if it is not initialized yet)
1286
  * Function initializes the driver (if it is not initialized yet)
1270
    and must be called first, before others (otherwise they will do
1287
    and must be called first, before others (otherwise they will do
1271
    nothing and return -1).
1288
    nothing and return -1).
1272
  * The current implementation supports only one frequency
1289
  * The current implementation supports only one frequency
1273
    of the scanning on videomode.
1290
    of the scanning on videomode.
1274
 
1291
 
1275
======================================================================
1292
======================================================================
1276
============ Function 21, subfunction 13, subsubfunction 2 ===========
1293
============ Function 21, subfunction 13, subsubfunction 2 ===========
1277
================ Get information on current videomode. ===============
1294
================ Get information on current videomode. ===============
1278
======================================================================
1295
======================================================================
1279
Parameters:
1296
Parameters:
1280
  * eax = 21 - function number
1297
  * eax = 21 - function number
1281
  * ebx = 13 - subfunction number
1298
  * ebx = 13 - subfunction number
1282
  * ecx = 2 - number of the driver function
1299
  * ecx = 2 - number of the driver function
1283
Returned value:
1300
Returned value:
1284
  * eax = -1 - driver is not loaded or not initialized;
1301
  * eax = -1 - driver is not loaded or not initialized;
1285
    ebx,ecx are destroyed
1302
    ebx,ecx are destroyed
1286
  * eax = [width]*65536 + [height]
1303
  * eax = [width]*65536 + [height]
1287
  * ebx = frequency of the vertical scanning (in Hz)
1304
  * ebx = frequency of the vertical scanning (in Hz)
1288
  * ecx = number of current videomode
1305
  * ecx = number of current videomode
1289
Remarks:
1306
Remarks:
1290
  * Driver must be initialized by call to
1307
  * Driver must be initialized by call to
1291
    driver function 1.
1308
    driver function 1.
1292
  * If only screen sizes are required, it is more expedient to use
1309
  * If only screen sizes are required, it is more expedient to use
1293
    function 14 taking into account that it
1310
    function 14 taking into account that it
1294
    returns sizes on 1 less.
1311
    returns sizes on 1 less.
1295
 
1312
 
1296
======================================================================
1313
======================================================================
1297
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1314
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1298
======================================================================
1315
======================================================================
1299
Parameters:
1316
Parameters:
1300
  * eax = 21 - function number
1317
  * eax = 21 - function number
1301
  * ebx = 13 - subfunction number
1318
  * ebx = 13 - subfunction number
1302
  * ecx = 3 - number of the driver function
1319
  * ecx = 3 - number of the driver function
1303
  * edx = [scanning frequency]*65536 + [videomode number]
1320
  * edx = [scanning frequency]*65536 + [videomode number]
1304
Returned value:
1321
Returned value:
1305
  * eax = -1 - driver is not loaded, not initialized or
1322
  * eax = -1 - driver is not loaded, not initialized or
1306
    an error has occured
1323
    an error has occured
1307
  * eax = 0 - success
1324
  * eax = 0 - success
1308
  * ebx, ecx destroyed
1325
  * ebx, ecx destroyed
1309
Remarks:
1326
Remarks:
1310
  * Driver must be initialized by driver function 1.
1327
  * Driver must be initialized by driver function 1.
1311
  * The videomode number and frequency must be in the table
1328
  * The videomode number and frequency must be in the table
1312
    returned by driver function 1.
1329
    returned by driver function 1.
1313
 
1330
 
1314
======================================================================
1331
======================================================================
1315
============ Function 21, subfunction 13, subsubfunction 4 ===========
1332
============ Function 21, subfunction 13, subsubfunction 4 ===========
1316
================== Return to the initial videomode. ==================
1333
================== Return to the initial videomode. ==================
1317
======================================================================
1334
======================================================================
1318
Returns the screen to the videomode set at system boot.
1335
Returns the screen to the videomode set at system boot.
1319
Parameters:
1336
Parameters:
1320
  * eax = 21 - function number
1337
  * eax = 21 - function number
1321
  * ebx = 13 - subfunction number
1338
  * ebx = 13 - subfunction number
1322
  * ecx = 4 - number of the driver function
1339
  * ecx = 4 - number of the driver function
1323
Returned value:
1340
Returned value:
1324
  * eax = -1 - driver is not loaded or not initialized
1341
  * eax = -1 - driver is not loaded or not initialized
1325
  * eax = 0 - success
1342
  * eax = 0 - success
1326
  * ebx, ecx destroyed
1343
  * ebx, ecx destroyed
1327
Remarks:
1344
Remarks:
1328
  * Driver must be initialized by call to driver function 1.
1345
  * Driver must be initialized by call to driver function 1.
1329
 
1346
 
1330
======================================================================
1347
======================================================================
1331
============ Function 21, subfunction 13, subsubfunction 5 ===========
1348
============ Function 21, subfunction 13, subsubfunction 5 ===========
1332
===== Increase/decrease the size of the visible area of monitor. =====
1349
===== Increase/decrease the size of the visible area of monitor. =====
1333
======================================================================
1350
======================================================================
1334
Parameters:
1351
Parameters:
1335
  * eax = 21 - function number
1352
  * eax = 21 - function number
1336
  * ebx = 13 - subfunction number
1353
  * ebx = 13 - subfunction number
1337
  * ecx = 5 - number of the driver function
1354
  * ecx = 5 - number of the driver function
1338
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1355
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1339
  * edx = 2/3 - is not supported in the current implementation;
1356
  * edx = 2/3 - is not supported in the current implementation;
1340
    is planned as decrease/increase vertical size on 1 position
1357
    is planned as decrease/increase vertical size on 1 position
1341
Returned value:
1358
Returned value:
1342
  * eax = -1 - driver is not loaded or not initialized
1359
  * eax = -1 - driver is not loaded or not initialized
1343
  * eax = 0 - success
1360
  * eax = 0 - success
1344
  * ebx, ecx destroyed
1361
  * ebx, ecx destroyed
1345
Remarks:
1362
Remarks:
1346
  * Driver must be initialized by call to driver function 1.
1363
  * Driver must be initialized by call to driver function 1.
1347
  * Function influences only the physical size of the screen image;
1364
  * Function influences only the physical size of the screen image;
1348
    the logical size (number of pixels) does not change.
1365
    the logical size (number of pixels) does not change.
1349
 
1366
 
1350
======================================================================
1367
======================================================================
1351
================= Function 22 - set system date/time. ================
1368
================= Function 22 - set system date/time. ================
1352
======================================================================
1369
======================================================================
1353
Parameters:
1370
Parameters:
1354
  * eax = 22 - function number
1371
  * eax = 22 - function number
1355
  * ebx = 0 - set time
1372
  * ebx = 0 - set time
1356
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1373
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1357
    * HH=hour 00..23
1374
    * HH=hour 00..23
1358
    * MM=minute 00..59
1375
    * MM=minute 00..59
1359
    * SS=second 00..59
1376
    * SS=second 00..59
1360
  * ebx = 1 - set date
1377
  * ebx = 1 - set date
1361
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1378
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1362
    * DD=day 01..31
1379
    * DD=day 01..31
1363
    * MM=month 01..12
1380
    * MM=month 01..12
1364
    * YY=year 00..99
1381
    * YY=year 00..99
1365
  * ebx = 2 - set day of week
1382
  * ebx = 2 - set day of week
1366
    * ecx = 1 for Sunday, ..., 7 for Saturday
1383
    * ecx = 1 for Sunday, ..., 7 for Saturday
1367
  * ebx = 3 - set alarm clock
1384
  * ebx = 3 - set alarm clock
1368
    * ecx = 0x00SSMMHH
1385
    * ecx = 0x00SSMMHH
1369
Returned value:
1386
Returned value:
1370
  * eax = 0 - success
1387
  * eax = 0 - success
1371
  * eax = 1 - incorrect parameter
1388
  * eax = 1 - incorrect parameter
1372
  * eax = 2 - CMOS-battery was unloaded
1389
  * eax = 2 - CMOS-battery was unloaded
1373
Remarks:
1390
Remarks:
1374
  * Value of installation of day of week seems to be doubtful,
1391
  * Value of installation of day of week seems to be doubtful,
1375
    as it a little where is used
1392
    as it a little where is used
1376
    (day of week can be calculated by date).
1393
    (day of week can be calculated by date).
1377
  * Alarm clock can be set on operation in the given time every day.
1394
  * Alarm clock can be set on operation in the given time every day.
1378
    But there is no existing system function to disable it.
1395
    But there is no existing system function to disable it.
1379
  * Operation of alarm clock consists in generation IRQ8.
1396
  * Operation of alarm clock consists in generation IRQ8.
1380
  * Generally CMOS supports for alarm clock set of value 0xFF
1397
  * Generally CMOS supports for alarm clock set of value 0xFF
1381
    as one of parameters and it means that the appropriate parameter
1398
    as one of parameters and it means that the appropriate parameter
1382
    is ignored. But current implementation does not allow this
1399
    is ignored. But current implementation does not allow this
1383
    (will return 1).
1400
    (will return 1).
1384
  * Alarm clock is a global system resource; the set of
1401
  * Alarm clock is a global system resource; the set of
1385
    an alarm clock cancels automatically the previous set.
1402
    an alarm clock cancels automatically the previous set.
1386
    However, at moment no program uses it.
1403
    However, at moment no program uses it.
1387
 
1404
 
1388
======================================================================
1405
======================================================================
1389
============= Function 23 - wait for event with timeout. =============
1406
============= Function 23 - wait for event with timeout. =============
1390
======================================================================
1407
======================================================================
1391
If the message queue is empty, waits for new message in the queue,
1408
If the message queue is empty, waits for new message in the queue,
1392
but no more than given time. Then reads out a message from the queue.
1409
but no more than given time. Then reads out a message from the queue.
1393
 
1410
 
1394
Parameters:
1411
Parameters:
1395
  * eax = 23 - function number
1412
  * eax = 23 - function number
1396
  * ebx = timeout (in 1/100 of second)
1413
  * ebx = timeout (in 1/100 of second)
1397
Returned value:
1414
Returned value:
1398
  * eax = 0 - the message queue is empty
1415
  * eax = 0 - the message queue is empty
1399
  * otherwise eax = event (see the list of events)
1416
  * otherwise eax = event (see the list of events)
1400
Remarks:
1417
Remarks:
1401
  * Only those events are taken into account, which enter into
1418
  * Only those events are taken into account, which enter into
1402
    the mask set by function 40. By default it is
1419
    the mask set by function 40. By default it is
1403
    redraw, key and button events.
1420
    redraw, key and button events.
1404
  * To check for presence of a message in the queue use function 11.
1421
  * To check for presence of a message in the queue use function 11.
1405
    To wait without timeout use function 10.
1422
    To wait without timeout use function 10.
1406
  * Transmission ebx=0 results in immediate returning eax=0.
1423
  * Transmission ebx=0 results in immediate returning eax=0.
1407
  * Current implementation returns immediately with eax=0,
1424
  * Current implementation returns immediately with eax=0,
1408
    if the addition of ebx with the current value of time counter
1425
    if the addition of ebx with the current value of time counter
1409
    makes 32-bit overflow.
1426
    makes 32-bit overflow.
1410
 
1427
 
1411
======================================================================
1428
======================================================================
1412
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1429
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1413
======================================================================
1430
======================================================================
1414
Parameters:
1431
Parameters:
1415
  * eax = 24 - function number
1432
  * eax = 24 - function number
1416
  * ebx = 1 - subfunction number
1433
  * ebx = 1 - subfunction number
1417
  * ecx = 0x00FRSSMM, where
1434
  * ecx = 0x00FRSSMM, where
1418
    * MM = starting minute
1435
    * MM = starting minute
1419
    * SS = starting second
1436
    * SS = starting second
1420
    * FR = starting frame
1437
    * FR = starting frame
1421
Returned value:
1438
Returned value:
1422
  * eax = 0 - success
1439
  * eax = 0 - success
1423
  * eax = 1 - CD base is not defined
1440
  * eax = 1 - CD base is not defined
1424
Remarks:
1441
Remarks:
1425
  * Previously CD base must be defined by the call to
1442
  * Previously CD base must be defined by the call to
1426
    subfunction 3 of function 21.
1443
    subfunction 3 of function 21.
1427
  * One second includes 75 frames, one minute includes 60 seconds.
1444
  * One second includes 75 frames, one minute includes 60 seconds.
1428
  * The function is asynchronous (returns control, when play begins).
1445
  * The function is asynchronous (returns control, when play begins).
1429
 
1446
 
1430
======================================================================
1447
======================================================================
1431
======= Function 24, subfunction 2 - get information on tracks. ======
1448
======= Function 24, subfunction 2 - get information on tracks. ======
1432
======================================================================
1449
======================================================================
1433
Parameters:
1450
Parameters:
1434
  * eax = 24 - function number
1451
  * eax = 24 - function number
1435
  * ebx = 2 - subfunction number
1452
  * ebx = 2 - subfunction number
1436
  * ecx = pointer to the buffer for the table
1453
  * ecx = pointer to the buffer for the table
1437
    (maximum 8*64h+4 bytes=100 tracks)
1454
    (maximum 8*64h+4 bytes=100 tracks)
1438
Returned value:
1455
Returned value:
1439
  * eax = 0 - success
1456
  * eax = 0 - success
1440
  * eax = 1 - CD base is not defined
1457
  * eax = 1 - CD base is not defined
1441
Remarks:
1458
Remarks:
1442
  * The format of the table with tracks information is the same as
1459
  * The format of the table with tracks information is the same as
1443
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1460
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1444
    Function returns addresses in MSF.
1461
    Function returns addresses in MSF.
1445
  * Previously CD base port must be set by call to
1462
  * Previously CD base port must be set by call to
1446
    subfunction 3 of function 21.
1463
    subfunction 3 of function 21.
1447
  * Function returns information only about no more than 100
1464
  * Function returns information only about no more than 100
1448
    first tracks. In most cases it is enough.
1465
    first tracks. In most cases it is enough.
1449
 
1466
 
1450
======================================================================
1467
======================================================================
1451
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1468
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1452
======================================================================
1469
======================================================================
1453
Parameters:
1470
Parameters:
1454
  * eax = 24 - function number
1471
  * eax = 24 - function number
1455
  * ebx = 1 - subfunction number
1472
  * ebx = 1 - subfunction number
1456
Returned value:
1473
Returned value:
1457
  * eax = 0 - success
1474
  * eax = 0 - success
1458
  * eax = 1 - CD base is not defined
1475
  * eax = 1 - CD base is not defined
1459
Remarks:
1476
Remarks:
1460
  * Previously CD base port must be defined by call to
1477
  * Previously CD base port must be defined by call to
1461
    subfunction 3 of function 21.
1478
    subfunction 3 of function 21.
1462
 
1479
 
1463
======================================================================
1480
======================================================================
1464
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1481
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1465
======================================================================
1482
======================================================================
1466
Parameters:
1483
Parameters:
1467
  * eax = 24 - function number
1484
  * eax = 24 - function number
1468
  * ebx = 4 - subfunction number
1485
  * ebx = 4 - subfunction number
1469
  * ecx = position of CD/DVD-drive
1486
  * ecx = position of CD/DVD-drive
1470
      (from 0=Primary Master to 3=Secondary Slave)
1487
      (from 0=Primary Master to 3=Secondary Slave)
1471
Returned value:
1488
Returned value:
1472
  * function does not return value
1489
  * function does not return value
1473
Remarks:
1490
Remarks:
1474
  * The function is supported only for ATAPI devices (CD and DVD).
1491
  * The function is supported only for ATAPI devices (CD and DVD).
1475
  * When the tray is being ejected,
1492
  * When the tray is being ejected,
1476
    manual control of tray is unlocked.
1493
    manual control of tray is unlocked.
1477
  * When the tray is being ejected, the code clears the cache for
1494
  * When the tray is being ejected, the code clears the cache for
1478
    corresponding device.
1495
    corresponding device.
1479
  * An example of usage of the function is the application CD_tray.
1496
  * An example of usage of the function is the application CD_tray.
1480
 
1497
 
1481
======================================================================
1498
======================================================================
1482
======== Function 24, subfunction 5 - load tray of disk drive. =======
1499
======== Function 24, subfunction 5 - load tray of disk drive. =======
1483
======================================================================
1500
======================================================================
1484
Parameters:
1501
Parameters:
1485
  * eax = 24 - function number
1502
  * eax = 24 - function number
1486
  * ebx = 5 - subfunction number
1503
  * ebx = 5 - subfunction number
1487
  * ecx = position of CD/DVD-drive
1504
  * ecx = position of CD/DVD-drive
1488
      (from 0=Primary Master to 3=Secondary Slave)
1505
      (from 0=Primary Master to 3=Secondary Slave)
1489
Returned value:
1506
Returned value:
1490
  * function does not return value
1507
  * function does not return value
1491
Remarks:
1508
Remarks:
1492
  * The function is supported only for ATAPI devices (CD and DVD).
1509
  * The function is supported only for ATAPI devices (CD and DVD).
1493
  * An example of usage of the function is the application CD_tray.
1510
  * An example of usage of the function is the application CD_tray.
1494
 
1511
 
1495
======================================================================
1512
======================================================================
1496
======= Function 25 - put image area on the background layer. ========
1513
======= Function 25 - put image area on the background layer. ========
1497
======================================================================
1514
======================================================================
1498
Paramters:
1515
Paramters:
1499
  * eax = 25 - function number
1516
  * eax = 25 - function number
1500
  * ebx = pointer to the previously allocated memory area,
1517
  * ebx = pointer to the previously allocated memory area,
1501
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1518
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1502
  * ecx = [size on axis x]*65536 + [size on axis y]
1519
  * ecx = [size on axis x]*65536 + [size on axis y]
1503
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1520
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1504
Returned value:
1521
Returned value:
1505
  * function does not return value
1522
  * function does not return value
1506
Remarks:
1523
Remarks:
1507
  * Coordinates of the image are coordinates of the upper left corner
1524
  * Coordinates of the image are coordinates of the upper left corner
1508
    of the image relative to the screen.
1525
    of the image relative to the screen.
1509
  * Size of the image in bytes is 4*xsize*ysize
1526
  * Size of the image in bytes is 4*xsize*ysize
1510
  * TT - byte pointer of transparency, at current version:
1527
  * TT - byte pointer of transparency, at current version:
1511
         1 to FF - opaque, 0 - transparent.
1528
         1 to FF - opaque, 0 - transparent.
1512
  * The function places the image directly to LFB. It is not for
1529
  * The function places the image directly to LFB. It is not for
1513
    background image f.15. Options f.15 to f.25 does not make sense.
1530
    background image f.15. Options f.15 to f.25 does not make sense.
1514
 
1531
 
1515
======================================================================
1532
======================================================================
1516
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1533
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1517
======================================================================
1534
======================================================================
1518
Parameters:
1535
Parameters:
1519
  * eax = 26 - function number
1536
  * eax = 26 - function number
1520
  * ebx = 1 - subfunction number
1537
  * ebx = 1 - subfunction number
1521
Returned value:
1538
Returned value:
1522
  * eax = port number
1539
  * eax = port number
1523
Parameters:
1540
Parameters:
1524
  * To set base port use subfunction 1 of function 21.
1541
  * To set base port use subfunction 1 of function 21.
1525
 
1542
 
1526
======================================================================
1543
======================================================================
1527
========== Function 26, subfunction 2 - get keyboard layout. =========
1544
========== Function 26, subfunction 2 - get keyboard layout. =========
1528
======================================================================
1545
======================================================================
1529
The keyboard layout is used to convert keyboard scancodes to
1546
The keyboard layout is used to convert keyboard scancodes to
1530
ASCII-codes for function 2.
1547
ASCII-codes for function 2.
1531
Parameters:
1548
Parameters:
1532
  * eax = 26 - function number
1549
  * eax = 26 - function number
1533
  * ebx = 2 - subfunction number
1550
  * ebx = 2 - subfunction number
1534
  * ecx = what layout to get:
1551
  * ecx = what layout to get:
1535
    * 1 = normal layout
1552
    * 1 = normal layout
1536
    * 2 = layout with pressed Shift
1553
    * 2 = layout with pressed Shift
1537
    * 3 = layout with pressed Alt
1554
    * 3 = layout with pressed Alt
1538
  * edx = pointer to the 128-bytes buffer, where the layout will be
1555
  * edx = pointer to the 128-bytes buffer, where the layout will be
1539
    copied
1556
    copied
1540
Returned value:
1557
Returned value:
1541
  * function does not return value
1558
  * function does not return value
1542
Or:
1559
Or:
1543
  * eax = 26 - function number
1560
  * eax = 26 - function number
1544
  * ebx = 2 - subfunction number
1561
  * ebx = 2 - subfunction number
1545
  * ecx = 9
1562
  * ecx = 9
1546
Returned value:
1563
Returned value:
1547
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1564
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1548
Remarks:
1565
Remarks:
1549
  * If Alt is pressed, the layout with Alt is used;
1566
  * If Alt is pressed, the layout with Alt is used;
1550
    if Alt is not pressed, but Shift is pressed,
1567
    if Alt is not pressed, but Shift is pressed,
1551
    the layout with Shift is used;
1568
    the layout with Shift is used;
1552
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1569
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1553
    layout is used and then from the code is subtracted 0x60;
1570
    layout is used and then from the code is subtracted 0x60;
1554
    if no control key is pressed, the normal layout is used.
1571
    if no control key is pressed, the normal layout is used.
1555
  * To set layout and country identifier use
1572
  * To set layout and country identifier use
1556
    subfunction 2 of function 21.
1573
    subfunction 2 of function 21.
1557
  * Country identifier is global system variable, which is not used
1574
  * Country identifier is global system variable, which is not used
1558
    by the kernel itself; however the application '@panel' displays
1575
    by the kernel itself; however the application '@panel' displays
1559
    the corresponding icon (using this function).
1576
    the corresponding icon (using this function).
1560
  * The application @panel switches layouts on user request.
1577
  * The application @panel switches layouts on user request.
1561
 
1578
 
1562
======================================================================
1579
======================================================================
1563
============== Function 26, subfunction 3 - get CD base. =============
1580
============== Function 26, subfunction 3 - get CD base. =============
1564
======================================================================
1581
======================================================================
1565
Parameters:
1582
Parameters:
1566
  * eax = 26 - function number
1583
  * eax = 26 - function number
1567
  * ebx = 3 - subfunction number
1584
  * ebx = 3 - subfunction number
1568
Returned value:
1585
Returned value:
1569
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1586
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1570
Remarks:
1587
Remarks:
1571
  * CD base is used by function 24.
1588
  * CD base is used by function 24.
1572
  * To set CD base use subfunction 3 of function 21.
1589
  * To set CD base use subfunction 3 of function 21.
1573
 
1590
 
1574
======================================================================
1591
======================================================================
1575
========== Function 26, subfunction 5 - get system language. =========
1592
========== Function 26, subfunction 5 - get system language. =========
1576
======================================================================
1593
======================================================================
1577
Parameters:
1594
Parameters:
1578
  * eax = 26 - function number
1595
  * eax = 26 - function number
1579
  * ebx = 5 - subfunction number
1596
  * ebx = 5 - subfunction number
1580
Returned value:
1597
Returned value:
1581
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1598
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1582
Remarks:
1599
Remarks:
1583
  * System language is global system variable and is not used
1600
  * System language is global system variable and is not used
1584
    by the kernel itself, however application @panel draws the
1601
    by the kernel itself, however application @panel draws the
1585
    appropriate icon (using this function).
1602
    appropriate icon (using this function).
1586
  * To set system language use subfunction 5 of function 21.
1603
  * To set system language use subfunction 5 of function 21.
1587
 
1604
 
1588
======================================================================
1605
======================================================================
1589
============== Function 26, subfunction 7 - get HD base. =============
1606
============== Function 26, subfunction 7 - get HD base. =============
1590
======================================================================
1607
======================================================================
1591
The HD base defines hard disk to write with usage of obsolete
1608
The HD base defines hard disk to write with usage of obsolete
1592
syntax /HD in obsolete function 58; at usage of modern syntax
1609
syntax /HD in obsolete function 58; at usage of modern syntax
1593
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1610
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1594
Parameters:
1611
Parameters:
1595
  * eax = 26 - function number
1612
  * eax = 26 - function number
1596
  * ebx = 7 - subfunction number
1613
  * ebx = 7 - subfunction number
1597
Returned value:
1614
Returned value:
1598
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1615
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1599
Remarks:
1616
Remarks:
1600
  * Any application in any time can change HD base.
1617
  * Any application in any time can change HD base.
1601
  * To set base use subfunction 7 of function 21.
1618
  * To set base use subfunction 7 of function 21.
1602
  * To get used partition of hard disk use subfunction 8.
1619
  * To get used partition of hard disk use subfunction 8.
1603
 
1620
 
1604
======================================================================
1621
======================================================================
1605
========= Function 26, subfunction 8 - get used HD partition. ========
1622
========= Function 26, subfunction 8 - get used HD partition. ========
1606
======================================================================
1623
======================================================================
1607
The HD partition defines partition of the hard disk to write with
1624
The HD partition defines partition of the hard disk to write with
1608
usage of obsolete syntax /HD in obsolete function 58;
1625
usage of obsolete syntax /HD in obsolete function 58;
1609
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1626
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1610
base and partition are set automatically.
1627
base and partition are set automatically.
1611
Parameters:
1628
Parameters:
1612
  * eax = 26 - function number
1629
  * eax = 26 - function number
1613
  * ebx = 8 - subfunction number
1630
  * ebx = 8 - subfunction number
1614
Returned value:
1631
Returned value:
1615
  * eax = HD partition (beginning from 1)
1632
  * eax = HD partition (beginning from 1)
1616
Remarks:
1633
Remarks:
1617
  * Any application in any time can change partition.
1634
  * Any application in any time can change partition.
1618
  * To set partition use subfunction 8 of function 21.
1635
  * To set partition use subfunction 8 of function 21.
1619
  * To get number of partitions on a hard disk use
1636
  * To get number of partitions on a hard disk use
1620
    subfunction 11 of function 18.
1637
    subfunction 11 of function 18.
1621
  * To get base of used hard disk, use subfunction 7.
1638
  * To get base of used hard disk, use subfunction 7.
1622
 
1639
 
1623
======================================================================
1640
======================================================================
1624
=== Function 26, subfunction 9 - get the value of the time counter. ==
1641
=== Function 26, subfunction 9 - get the value of the time counter. ==
1625
======================================================================
1642
======================================================================
1626
Parameters:
1643
Parameters:
1627
  * eax = 26 - function number
1644
  * eax = 26 - function number
1628
  * ebx = 9 - subfunction number
1645
  * ebx = 9 - subfunction number
1629
Returned value:
1646
Returned value:
1630
  * eax = number of 1/100s of second, past from the system boot time
1647
  * eax = number of 1/100s of second, past from the system boot time
1631
Remarks:
1648
Remarks:
1632
  * Counter takes modulo 2^32, that correspond to a little more
1649
  * Counter takes modulo 2^32, that correspond to a little more
1633
    than 497 days.
1650
    than 497 days.
1634
  * To get system time use function 3.
1651
  * To get system time use function 3.
1635
 
1652
 
1636
======================================================================
1653
======================================================================
1637
===================== Function 26, subfunction 11 ====================
1654
===================== Function 26, subfunction 11 ====================
1638
========== Find out whether low-level HD access is enabled. ==========
1655
========== Find out whether low-level HD access is enabled. ==========
1639
======================================================================
1656
======================================================================
1640
Parameters:
1657
Parameters:
1641
  * eax = 26 - function number
1658
  * eax = 26 - function number
1642
  * ebx = 11 - subfunction number
1659
  * ebx = 11 - subfunction number
1643
Returned value:
1660
Returned value:
1644
  * eax = 0/1 - disabled/enabled
1661
  * eax = 0/1 - disabled/enabled
1645
Remarks:
1662
Remarks:
1646
  * Is used in LBA read (subfunction 8 of function 58).
1663
  * Is used in LBA read (subfunction 8 of function 58).
1647
  * To set current state use subfunction 11 of function 21.
1664
  * To set current state use subfunction 11 of function 21.
1648
 
1665
 
1649
======================================================================
1666
======================================================================
1650
===================== Function 26, subfunction 12 ====================
1667
===================== Function 26, subfunction 12 ====================
1651
========== Find out whether low-level PCI access is enabled. =========
1668
========== Find out whether low-level PCI access is enabled. =========
1652
======================================================================
1669
======================================================================
1653
Parameters:
1670
Parameters:
1654
  * eax = 26 - function number
1671
  * eax = 26 - function number
1655
  * ebx = 12 - subfunction number
1672
  * ebx = 12 - subfunction number
1656
Returned value:
1673
Returned value:
1657
  * eax = 0/1 - disabled/enabled
1674
  * eax = 0/1 - disabled/enabled
1658
Remarks:
1675
Remarks:
1659
  * Is used by operations with PCI bus (function 62).
1676
  * Is used by operations with PCI bus (function 62).
1660
  * The current implementation uses only low bit of ecx.
1677
  * The current implementation uses only low bit of ecx.
1661
  * To set the current state use subfunction 12 of function 21.
1678
  * To set the current state use subfunction 12 of function 21.
1662
 
1679
 
1663
======================================================================
1680
======================================================================
1664
=================== Function 29 - get system date. ===================
1681
=================== Function 29 - get system date. ===================
1665
======================================================================
1682
======================================================================
1666
Parameters:
1683
Parameters:
1667
  * eax = 29 - function number
1684
  * eax = 29 - function number
1668
Returned value:
1685
Returned value:
1669
  * eax = 0x00DDMMYY, where
1686
  * eax = 0x00DDMMYY, where
1670
    (binary-decimal coding, BCD, is used)
1687
    (binary-decimal coding, BCD, is used)
1671
  * YY = two low digits of year (00..99)
1688
  * YY = two low digits of year (00..99)
1672
  * MM = month (01..12)
1689
  * MM = month (01..12)
1673
  * DD = day (01..31)
1690
  * DD = day (01..31)
1674
Remarks:
1691
Remarks:
1675
  * To set system date use function 22.
1692
  * To set system date use function 22.
1676
 
1693
 
1677
======================================================================
1694
======================================================================
1678
============= Function 30 - work with the current folder. ============
1695
============= Function 30 - work with the current folder. ============
1679
======================================================================
1696
======================================================================
1680
 
1697
 
1681
--------- Subfunction 1 - set current folder for the thread. ---------
1698
--------- Subfunction 1 - set current folder for the thread. ---------
1682
Parameters:
1699
Parameters:
1683
  * eax = 30 - function number
1700
  * eax = 30 - function number
1684
  * ebx = 1 - subfunction number
1701
  * ebx = 1 - subfunction number
1685
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1702
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1686
Returned value:
1703
Returned value:
1687
  * function does not return value
1704
  * function does not return value
1688
 
1705
 
1689
--------- Subfunction 2 - get current folder for the thread. ---------
1706
--------- Subfunction 2 - get current folder for the thread. ---------
1690
Parameters:
1707
Parameters:
1691
  * eax = 30 - function number
1708
  * eax = 30 - function number
1692
  * ebx = 2 - subfunction number
1709
  * ebx = 2 - subfunction number
1693
  * ecx = pointer to buffer
1710
  * ecx = pointer to buffer
1694
  * edx = size of buffer
1711
  * edx = size of buffer
1695
Returned value:
1712
Returned value:
1696
  * eax = size of the current folder's name (including terminating 0)
1713
  * eax = size of the current folder's name (including terminating 0)
1697
Remarks:
1714
Remarks:
1698
  * If the buffer is too small to hold all data, only first (edx-1)
1715
  * If the buffer is too small to hold all data, only first (edx-1)
1699
    bytes are copied and than terminating 0 is inserted.
1716
    bytes are copied and than terminating 0 is inserted.
1700
  * By default, current folder for the thread is "/rd/1".
1717
  * By default, current folder for the thread is "/rd/1".
1701
  * At process/thread creation the current folder will be inherited
1718
  * At process/thread creation the current folder will be inherited
1702
    from the parent.
1719
    from the parent.
1703
 
1720
 
1704
======================================================================
1721
======================================================================
1705
========= Function 34 - who owner the pixel on the screen. ===========
1722
========= Function 34 - who owner the pixel on the screen. ===========
1706
======================================================================
1723
======================================================================
1707
Parameters:
1724
Parameters:
1708
  * eax = 34 - function number
1725
  * eax = 34 - function number
1709
  * ebx = x-coordinate (relative to the display)
1726
  * ebx = x-coordinate (relative to the display)
1710
  * ecx = y-coordinate (relative to the display)
1727
  * ecx = y-coordinate (relative to the display)
1711
 
1728
 
1712
Returned value:
1729
Returned value:
1713
  * eax = 0x000000XX - owner of pixel the slot window N
1730
  * eax = 0x000000XX - owner of pixel the slot window N
1714
    If incorrect values ebx and ecx then function returns 0
1731
    If incorrect values ebx and ecx then function returns 0
1715
  * The function takes the value from the area [_WinMapAddress]
1732
  * The function takes the value from the area [_WinMapAddress]
1716
  
1733
  
1717
======================================================================
1734
======================================================================
1718
======= Function 35 - read the color of a pixel on the screen. =======
1735
======= Function 35 - read the color of a pixel on the screen. =======
1719
======================================================================
1736
======================================================================
1720
Parameters:
1737
Parameters:
1721
  * eax = 35
1738
  * eax = 35
1722
  * ebx = y*xsize+x, where
1739
  * ebx = y*xsize+x, where
1723
  * (x,y) = coordinates of a pixel (beginning from 0)
1740
  * (x,y) = coordinates of a pixel (beginning from 0)
1724
  * xsize = horizontal screen size
1741
  * xsize = horizontal screen size
1725
Returned value:
1742
Returned value:
1726
  * eax = color 0x00RRGGBB
1743
  * eax = color 0x00RRGGBB
1727
Remarks:
1744
Remarks:
1728
  * To get screen sizes use function 14. Pay attention,
1745
  * To get screen sizes use function 14. Pay attention,
1729
    that it subtracts 1 from both sizes.
1746
    that it subtracts 1 from both sizes.
1730
  * There is also direct access (without any system calls)
1747
  * There is also direct access (without any system calls)
1731
    to videomemory through the selector gs. To get parameters of
1748
    to videomemory through the selector gs. To get parameters of
1732
    the current videomode, use function 61.
1749
    the current videomode, use function 61.
1733
 
1750
 
1734
======================================================================
1751
======================================================================
1735
=================== Function 36 - read screen area. ==================
1752
=================== Function 36 - read screen area. ==================
1736
======================================================================
1753
======================================================================
1737
Paramters:
1754
Paramters:
1738
  * eax = 36 - function number
1755
  * eax = 36 - function number
1739
  * ebx = pointer to the previously allocated memory area,
1756
  * ebx = pointer to the previously allocated memory area,
1740
        where will be placed the image in the format BBGGRRBBGGRR...
1757
        where will be placed the image in the format BBGGRRBBGGRR...
1741
  * ecx = [size on axis x]*65536 + [size on axis y]
1758
  * ecx = [size on axis x]*65536 + [size on axis y]
1742
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1759
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1743
Returned value:
1760
Returned value:
1744
  * function does not return value
1761
  * function does not return value
1745
Remarks:
1762
Remarks:
1746
  * Coordinates of the image are coordinates of the upper left corner
1763
  * Coordinates of the image are coordinates of the upper left corner
1747
    of the image relative to the screen.
1764
    of the image relative to the screen.
1748
  * Size of the image in bytes is 3*xsize*ysize.
1765
  * Size of the image in bytes is 3*xsize*ysize.
1749
 
1766
 
1750
======================================================================
1767
======================================================================
1751
=================== Function 37 - work with mouse. ===================
1768
=================== Function 37 - work with mouse. ===================
1752
======================================================================
1769
======================================================================
1753
 
1770
 
1754
---------- Subfunction 0 - screen coordinates of the mouse -----------
1771
---------- Subfunction 0 - screen coordinates of the mouse -----------
1755
Parameters:
1772
Parameters:
1756
  * eax = 37 - function number
1773
  * eax = 37 - function number
1757
  * ebx = 0 - subfunction number
1774
  * ebx = 0 - subfunction number
1758
Returned value:
1775
Returned value:
1759
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1776
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1760
    (beginning from 0)
1777
    (beginning from 0)
1761
 
1778
 
1762
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1779
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1763
Parameters:
1780
Parameters:
1764
  * eax = 37 - function number
1781
  * eax = 37 - function number
1765
  * ebx = 1 - subfunction number
1782
  * ebx = 1 - subfunction number
1766
Returned value:
1783
Returned value:
1767
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1784
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1768
    relative to the application window (beginning from 0)
1785
    relative to the application window (beginning from 0)
1769
Remarks:
1786
Remarks:
1770
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1787
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1771
    If y>=ywnd, the low word is non-negative and contains
1788
    If y>=ywnd, the low word is non-negative and contains
1772
    relative y-coordinate, and the high word - relative x-coordinate
1789
    relative y-coordinate, and the high word - relative x-coordinate
1773
    (with correct sign). Otherwise the low word is negative and still
1790
    (with correct sign). Otherwise the low word is negative and still
1774
    contains relative y-coordinate, and to the high word
1791
    contains relative y-coordinate, and to the high word
1775
    1 should be added.
1792
    1 should be added.
1776
 
1793
 
1777
------------ Subfunction 2 - pressed buttons of the mouse ------------
1794
------------ Subfunction 2 - pressed buttons of the mouse ------------
1778
Parameters:
1795
Parameters:
1779
  * eax = 37 - function number
1796
  * eax = 37 - function number
1780
  * ebx = 2 - subfunction number
1797
  * ebx = 2 - subfunction number
1781
Returned value:
1798
Returned value:
1782
  * eax contains information on the pressed mouse buttons:
1799
  * eax contains information on the pressed mouse buttons:
1783
  * bit 0 is set = left button is pressed
1800
  * bit 0 is set = left button is pressed
1784
  * bit 1 is set = right button is pressed
1801
  * bit 1 is set = right button is pressed
1785
  * bit 2 is set = middle button is pressed
1802
  * bit 2 is set = middle button is pressed
1786
  * bit 3 is set = 4th button is pressed
1803
  * bit 3 is set = 4th button is pressed
1787
  * bit 4 is set = 5th button is pressed
1804
  * bit 4 is set = 5th button is pressed
1788
  * other bits are cleared
1805
  * other bits are cleared
1789
 
1806
 
1790
-------------------- Subfunction 4 - load cursor ---------------------
1807
-------------------- Subfunction 4 - load cursor ---------------------
1791
Parameters:
1808
Parameters:
1792
  * eax = 37 - function number
1809
  * eax = 37 - function number
1793
  * ebx = 4 - subfunction number
1810
  * ebx = 4 - subfunction number
1794
  * dx = data source:
1811
  * dx = data source:
1795
  * dx = LOAD_FROM_FILE = 0 - data in a file
1812
  * dx = LOAD_FROM_FILE = 0 - data in a file
1796
    * ecx = pointer to full path to the cursor file
1813
    * ecx = pointer to full path to the cursor file
1797
    * the file must be in the format .cur, which is standard for
1814
    * the file must be in the format .cur, which is standard for
1798
      MS Windows, at that of the size 32*32 pixels
1815
      MS Windows, at that of the size 32*32 pixels
1799
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1816
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1800
    * ecx = pointer to data of the cursor file
1817
    * ecx = pointer to data of the cursor file
1801
    * the data format is the same as in the previous case
1818
    * the data format is the same as in the previous case
1802
  * dx = LOAD_INDIRECT = 2 - data in memory
1819
  * dx = LOAD_INDIRECT = 2 - data in memory
1803
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1820
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1804
    * edx = 0xXXYY0002, where
1821
    * edx = 0xXXYY0002, where
1805
      * XX = x-coordinate of cursor hotspot
1822
      * XX = x-coordinate of cursor hotspot
1806
      * YY = y-coordinate
1823
      * YY = y-coordinate
1807
      * 0 <= XX, YY <= 31
1824
      * 0 <= XX, YY <= 31
1808
Returned value:
1825
Returned value:
1809
  * eax = 0 - failed
1826
  * eax = 0 - failed
1810
  * otherwise eax = cursor handle
1827
  * otherwise eax = cursor handle
1811
 
1828
 
1812
--------------------- Subfunction 5 - set cursor ---------------------
1829
--------------------- Subfunction 5 - set cursor ---------------------
1813
Sets new cursor for the window of the current thread.
1830
Sets new cursor for the window of the current thread.
1814
Parameters:
1831
Parameters:
1815
  * eax = 37 - function number
1832
  * eax = 37 - function number
1816
  * ebx = 5 - subfunction number
1833
  * ebx = 5 - subfunction number
1817
  * ecx = cursor handle
1834
  * ecx = cursor handle
1818
Returned value:
1835
Returned value:
1819
  * eax = handle of previous cursor
1836
  * eax = handle of previous cursor
1820
Remarks:
1837
Remarks:
1821
  * If the handle is incorrect, the function restores the default
1838
  * If the handle is incorrect, the function restores the default
1822
    cursor (standard arrow). In particular, ecx=0 restores it.
1839
    cursor (standard arrow). In particular, ecx=0 restores it.
1823
 
1840
 
1824
------------------- Subfunction 6 - delete cursor --------------------
1841
------------------- Subfunction 6 - delete cursor --------------------
1825
Parameters:
1842
Parameters:
1826
  * eax = 37 - function number
1843
  * eax = 37 - function number
1827
  * ebx = 6 - subfunction number
1844
  * ebx = 6 - subfunction number
1828
  * ecx = cursor handle
1845
  * ecx = cursor handle
1829
Returned value:
1846
Returned value:
1830
  * eax destroyed
1847
  * eax destroyed
1831
Remarks:
1848
Remarks:
1832
  * The cursor must be loaded previously by the current thread
1849
  * The cursor must be loaded previously by the current thread
1833
    (with the call to subfunction 4). The function does not delete
1850
    (with the call to subfunction 4). The function does not delete
1834
    system cursors and cursors, loaded by another applications.
1851
    system cursors and cursors, loaded by another applications.
1835
  * If the active cursor (set by subfunction 5) is deleted,
1852
  * If the active cursor (set by subfunction 5) is deleted,
1836
    the system restores the default cursor (standard arrow).
1853
    the system restores the default cursor (standard arrow).
1837
 
1854
 
1838
------------------ Subfunction 7 - get scroll data -------------------
1855
------------------ Subfunction 7 - get scroll data -------------------
1839
Parameters:
1856
Parameters:
1840
  * eax = 37 - function number
1857
  * eax = 37 - function number
1841
  * ebx = 7 - subfunction number
1858
  * ebx = 7 - subfunction number
1842
Returned value:
1859
Returned value:
1843
  * eax = [horizontal offset]*65536 + [vertical offset]
1860
  * eax = [horizontal offset]*65536 + [vertical offset]
1844
Remarks:
1861
Remarks:
1845
  * Scroll data is available for active window only.
1862
  * Scroll data is available for active window only.
1846
  * Values are zeroed after reading.
1863
  * Values are zeroed after reading.
1847
  * Values are signed.
1864
  * Values are signed.
1848
 
1865
 
1849
======================================================================
1866
======================================================================
1850
====================== Function 38 - draw line. ======================
1867
====================== Function 38 - draw line. ======================
1851
======================================================================
1868
======================================================================
1852
Parameters:
1869
Parameters:
1853
  * eax = 38 - function number
1870
  * eax = 38 - function number
1854
  * ebx = [start coordinate on axis x]*65536 +
1871
  * ebx = [start coordinate on axis x]*65536 +
1855
              [end coordinate on axis x]
1872
              [end coordinate on axis x]
1856
  * ecx = [start coordinate on axis y]*65536 +
1873
  * ecx = [start coordinate on axis y]*65536 +
1857
              [end coordinate on axis y]
1874
              [end coordinate on axis y]
1858
  * edx = 0x00RRGGBB - color
1875
  * edx = 0x00RRGGBB - color
1859
    edx = 0x01xxxxxx - draw inversed line
1876
    edx = 0x01xxxxxx - draw inversed line
1860
          (low 24 bits are ignored)
1877
          (low 24 bits are ignored)
1861
Returned value:
1878
Returned value:
1862
  * function does not return value
1879
  * function does not return value
1863
Remarks:
1880
Remarks:
1864
  * Coordinates are relative to the window.
1881
  * Coordinates are relative to the window.
1865
  * End point is also drawn.
1882
  * End point is also drawn.
1866
 
1883
 
1867
======================================================================
1884
======================================================================
1868
== Function 39, subfunction 1 - get a size of the background image. ==
1885
== Function 39, subfunction 1 - get a size of the background image. ==
1869
======================================================================
1886
======================================================================
1870
Parameters:
1887
Parameters:
1871
  * eax = 39 - function number
1888
  * eax = 39 - function number
1872
  * ebx = 1 - subfunction number
1889
  * ebx = 1 - subfunction number
1873
Returned value:
1890
Returned value:
1874
  * eax = [width]*65536 + [height]
1891
  * eax = [width]*65536 + [height]
1875
Remarks:
1892
Remarks:
1876
  * There is a pair function to set sizes of background image -
1893
  * There is a pair function to set sizes of background image -
1877
    subfunction 1 of function 15. After which it is necessary,
1894
    subfunction 1 of function 15. After which it is necessary,
1878
    of course, anew to define image.
1895
    of course, anew to define image.
1879
 
1896
 
1880
======================================================================
1897
======================================================================
1881
== Function 39, subfunction 2 - get pixel from the background image. =
1898
== Function 39, subfunction 2 - get pixel from the background image. =
1882
======================================================================
1899
======================================================================
1883
Parameters:
1900
Parameters:
1884
  * eax = 39 - function number
1901
  * eax = 39 - function number
1885
  * ebx = 2 - subfunction number
1902
  * ebx = 2 - subfunction number
1886
  * ecx = offset
1903
  * ecx = offset
1887
Returned value:
1904
Returned value:
1888
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1905
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1889
    (less than 0x160000-16)
1906
    (less than 0x160000-16)
1890
  * eax = 2 otherwise
1907
  * eax = 2 otherwise
1891
Remarks:
1908
Remarks:
1892
  * Do not rely on returned value for invalid offsets, it may be
1909
  * Do not rely on returned value for invalid offsets, it may be
1893
    changed in future kernel versions.
1910
    changed in future kernel versions.
1894
  * Offset for pixel with coordinates (x,y)
1911
  * Offset for pixel with coordinates (x,y)
1895
    is calculated as (x+y*xsize)*3.
1912
    is calculated as (x+y*xsize)*3.
1896
  * There is a pair function to set pixel on the background image -
1913
  * There is a pair function to set pixel on the background image -
1897
    subfunction 2 of function 15.
1914
    subfunction 2 of function 15.
1898
 
1915
 
1899
======================================================================
1916
======================================================================
1900
== Function 39, subfunction 4 - get drawing mode for the background. =
1917
== Function 39, subfunction 4 - get drawing mode for the background. =
1901
======================================================================
1918
======================================================================
1902
Parameters:
1919
Parameters:
1903
  * eax = 39 - function number
1920
  * eax = 39 - function number
1904
  * ebx = 4 - subfunction number
1921
  * ebx = 4 - subfunction number
1905
Returned value:
1922
Returned value:
1906
  * eax = 1 - tile
1923
  * eax = 1 - tile
1907
  * eax = 2 - stretch
1924
  * eax = 2 - stretch
1908
Remarks:
1925
Remarks:
1909
  * There is a pair function to set drawing mode -
1926
  * There is a pair function to set drawing mode -
1910
    subfunction 4 of function 15.
1927
    subfunction 4 of function 15.
1911
 
1928
 
1912
======================================================================
1929
======================================================================
1913
=========== Function 40 - set the mask for expected events. ==========
1930
=========== Function 40 - set the mask for expected events. ==========
1914
======================================================================
1931
======================================================================
1915
The mask for expected events affects function working with events
1932
The mask for expected events affects function working with events
1916
10, 11, 23 - they notify only about events allowed by this mask.
1933
10, 11, 23 - they notify only about events allowed by this mask.
1917
Parameters:
1934
Parameters:
1918
  * eax = 40 - function number
1935
  * eax = 40 - function number
1919
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1936
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1920
    (set bit permits notice on event)
1937
    (set bit permits notice on event)
1921
    bit 31: active/inactive filter
1938
    bit 31: active/inactive filter
1922
    bit 31 = 0 - inactive window receive mouse events
1939
    bit 31 = 0 - inactive window receive mouse events
1923
    bit 31 = 1 - inactive window does not receive mouse events
1940
    bit 31 = 1 - inactive window does not receive mouse events
1924
    bit 30: cursor position filter
1941
    bit 30: cursor position filter
1925
    bit 30 = 0 = the window receive mouse events if cursor
1942
    bit 30 = 0 = the window receive mouse events if cursor
1926
                 outside window
1943
                 outside window
1927
    bit 30 = 1 - the window does not receive mouse events if cursor
1944
    bit 30 = 1 - the window does not receive mouse events if cursor
1928
                 outside window
1945
                 outside window
1929
Returned value:
1946
Returned value:
1930
  * eax = previous value of mask
1947
  * eax = previous value of mask
1931
Remarks:
1948
Remarks:
1932
  * Default mask (7=111b) enables nofices about redraw,
1949
  * Default mask (7=111b) enables nofices about redraw,
1933
    keys and buttons. This is enough for many applications.
1950
    keys and buttons. This is enough for many applications.
1934
  * Events prohibited in the mask are saved anyway, when come;
1951
  * Events prohibited in the mask are saved anyway, when come;
1935
    they are simply not informed with event functions.
1952
    they are simply not informed with event functions.
1936
  * Event functions take into account the mask on moment of
1953
  * Event functions take into account the mask on moment of
1937
    function call, not on moment of event arrival.
1954
    function call, not on moment of event arrival.
1938
 
1955
 
1939
 
1956
 
1940
======================================================================
1957
======================================================================
1941
================ Function 43 - input/output to a port. ===============
1958
================ Function 43 - input/output to a port. ===============
1942
======================================================================
1959
======================================================================
1943
 
1960
 
1944
------------------------ Output data to port -------------------------
1961
------------------------ Output data to port -------------------------
1945
Parameters:
1962
Parameters:
1946
  * eax = 43 - function number
1963
  * eax = 43 - function number
1947
  * bl = byte for output
1964
  * bl = byte for output
1948
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1965
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1949
Returned value:
1966
Returned value:
1950
  * eax = 0 - success
1967
  * eax = 0 - success
1951
  * eax = 1 - the thread has not reserved the selected port
1968
  * eax = 1 - the thread has not reserved the selected port
1952
 
1969
 
1953
------------------------ Input data from port ------------------------
1970
------------------------ Input data from port ------------------------
1954
Parameters:
1971
Parameters:
1955
  * eax = 43 - function number
1972
  * eax = 43 - function number
1956
  * ebx is ignored
1973
  * ebx is ignored
1957
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1974
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1958
Returned value:
1975
Returned value:
1959
  * eax = 0 - success, thus ebx = entered byte
1976
  * eax = 0 - success, thus ebx = entered byte
1960
  * eax = 1 - the thread has not reserved the selected port
1977
  * eax = 1 - the thread has not reserved the selected port
1961
Remarks:
1978
Remarks:
1962
  * Previously the thread must reserve the selected port
1979
  * Previously the thread must reserve the selected port
1963
    for itself by function 46.
1980
    for itself by function 46.
1964
  * Instead of call to this function it is better to use
1981
  * Instead of call to this function it is better to use
1965
    processor instructions in/out - this is much
1982
    processor instructions in/out - this is much
1966
    faster and a bit shorter and easier.
1983
    faster and a bit shorter and easier.
1967
 
1984
 
1968
 
1985
 
1969
======================================================================
1986
======================================================================
1970
====== Function 46 - reserve/free a group of input/output ports. =====
1987
====== Function 46 - reserve/free a group of input/output ports. =====
1971
======================================================================
1988
======================================================================
1972
To work with reserved ports an application can access directly by
1989
To work with reserved ports an application can access directly by
1973
commands in/out (recommended way) and can use function 43
1990
commands in/out (recommended way) and can use function 43
1974
(not recommended way).
1991
(not recommended way).
1975
Parameters:
1992
Parameters:
1976
  * eax = 46 - function number
1993
  * eax = 46 - function number
1977
  * ebx = 0 - reserve, 1 - free
1994
  * ebx = 0 - reserve, 1 - free
1978
  * ecx = start port number
1995
  * ecx = start port number
1979
  * edx = end port number (inclusive)
1996
  * edx = end port number (inclusive)
1980
Returned value:
1997
Returned value:
1981
  * eax = 0 - success
1998
  * eax = 0 - success
1982
  * eax = 1 - error
1999
  * eax = 1 - error
1983
Remarks:
2000
Remarks:
1984
  * For ports reservation: an error occurs if and only if
2001
  * For ports reservation: an error occurs if and only if
1985
    one from the following condition satisfies:
2002
    one from the following condition satisfies:
1986
    * start port is more than end port;
2003
    * start port is more than end port;
1987
    * the selected range contains incorrect port number
2004
    * the selected range contains incorrect port number
1988
      (correct are from 0 to 0xFFFF);
2005
      (correct are from 0 to 0xFFFF);
1989
    * limit for the total number of reserved areas is exceeded
2006
    * limit for the total number of reserved areas is exceeded
1990
      (maximum 255 are allowed);
2007
      (maximum 255 are allowed);
1991
    * the selected range intersects with any of earlier reserved
2008
    * the selected range intersects with any of earlier reserved
1992
  * For ports free: an error is an attempt to free range,
2009
  * For ports free: an error is an attempt to free range,
1993
    that was not earlier reserved by this function
2010
    that was not earlier reserved by this function
1994
    (with same ecx,edx).
2011
    (with same ecx,edx).
1995
  * If an error occurs (for both cases) function performs no action.
2012
  * If an error occurs (for both cases) function performs no action.
1996
  * At booting the system reserves for itself ports
2013
  * At booting the system reserves for itself ports
1997
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2014
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
1998
  * When a thread terminates, all reserved by it ports
2015
  * When a thread terminates, all reserved by it ports
1999
    are freed automatically.
2016
    are freed automatically.
2000
 
2017
 
2001
======================================================================
2018
======================================================================
2002
============= Function 47 - draw a number in the window. =============
2019
============= Function 47 - draw a number in the window. =============
2003
======================================================================
2020
======================================================================
2004
Parameters:
2021
Parameters:
2005
  * eax = 47 - function number
2022
  * eax = 47 - function number
2006
  * ebx = parameters of conversion number to text:
2023
  * ebx = parameters of conversion number to text:
2007
    * bl = 0 - ecx contains number
2024
    * bl = 0 - ecx contains number
2008
    * bl = 1 - ecx contains pointer to dword/qword-number
2025
    * bl = 1 - ecx contains pointer to dword/qword-number
2009
    * bh = 0 - display in decimal number system
2026
    * bh = 0 - display in decimal number system
2010
    * bh = 1 - display in hexadecimal system
2027
    * bh = 1 - display in hexadecimal system
2011
    * bh = 2 - display in binary system
2028
    * bh = 2 - display in binary system
2012
    * bits 16-21 = how many digits to display
2029
    * bits 16-21 = how many digits to display
2013
    * bits 22-29 reserved and must be set to 0
2030
    * bits 22-29 reserved and must be set to 0
2014
    * bit 30 set = display qword (64-bit) number (must be bl=1)
2031
    * bit 30 set = display qword (64-bit) number (must be bl=1)
2015
    * bit 31 set = do not display leading zeroes of the number
2032
    * bit 31 set = do not display leading zeroes of the number
2016
  * ecx = number (if bl=0) or pointer (if bl=1)
2033
  * ecx = number (if bl=0) or pointer (if bl=1)
2017
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2034
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2018
  * esi = 0xX0RRGGBB:
2035
  * esi = 0xX0RRGGBB:
2019
    * RR, GG, BB specify the color
2036
    * RR, GG, BB specify the color
2020
    * X = ABnn (bits)
2037
    * X = ABnn (bits)
2021
    * nn = font (0/1)
2038
    * nn = font (0/1)
2022
    * A is ignored
2039
    * A is ignored
2023
    * B=1 - fill background with the color edi
2040
    * B=1 - fill background with the color edi
2024
Returned value:
2041
Returned value:
2025
  * function does not return value
2042
  * function does not return value
2026
Remarks:
2043
Remarks:
2027
  * The given length must not exceed 60.
2044
  * The given length must not exceed 60.
2028
  * The exactly given amount of digits is output. If number is small
2045
  * The exactly given amount of digits is output. If number is small
2029
    and can be written by smaller amount of digits, it is supplemented
2046
    and can be written by smaller amount of digits, it is supplemented
2030
    by leading zeroes; if the number is big and can not be written by
2047
    by leading zeroes; if the number is big and can not be written by
2031
    given amount of digits, extra digits are not drawn.
2048
    given amount of digits, extra digits are not drawn.
2032
  * Parameters of fonts are shown in the description of function 4
2049
  * Parameters of fonts are shown in the description of function 4
2033
    (text output).
2050
    (text output).
2034
 
2051
 
2035
======================================================================
2052
======================================================================
2036
========= Function 48, subfunction 0 - apply screen settings. ========
2053
========= Function 48, subfunction 0 - apply screen settings. ========
2037
======================================================================
2054
======================================================================
2038
Parameters:
2055
Parameters:
2039
  * eax = 48 - function number
2056
  * eax = 48 - function number
2040
  * ebx = 0 - subfunction number
2057
  * ebx = 0 - subfunction number
2041
  * ecx = 0 - reserved
2058
  * ecx = 0 - reserved
2042
Returned value:
2059
Returned value:
2043
  * function does not return value
2060
  * function does not return value
2044
Remarks:
2061
Remarks:
2045
  * Function redraws the screen after parameters change by
2062
  * Function redraws the screen after parameters change by
2046
    subfunctions 1 and 2.
2063
    subfunctions 1 and 2.
2047
  * Function call without prior call to one of indicated subfunctions
2064
  * Function call without prior call to one of indicated subfunctions
2048
    is ignored.
2065
    is ignored.
2049
  * Function call with nonzero ecx is ignored.
2066
  * Function call with nonzero ecx is ignored.
2050
 
2067
 
2051
======================================================================
2068
======================================================================
2052
=========== Function 48, subfunction 1 - set button style. ===========
2069
=========== Function 48, subfunction 1 - set button style. ===========
2053
======================================================================
2070
======================================================================
2054
Parameters:
2071
Parameters:
2055
  * eax = 48 - function number
2072
  * eax = 48 - function number
2056
  * ebx = 1 - subfunction number
2073
  * ebx = 1 - subfunction number
2057
  * ecx = button style:
2074
  * ecx = button style:
2058
    * 0 = flat
2075
    * 0 = flat
2059
    * 1 = 3d
2076
    * 1 = 3d
2060
Returned value:
2077
Returned value:
2061
  * function does not return value
2078
  * function does not return value
2062
Remarks:
2079
Remarks:
2063
  * After call to this function one should redraw the screen by
2080
  * After call to this function one should redraw the screen by
2064
    subfunction 0.
2081
    subfunction 0.
2065
  * Button style influences only to their draw of function 8.
2082
  * Button style influences only to their draw of function 8.
2066
 
2083
 
2067
======================================================================
2084
======================================================================
2068
====== Function 48, subfunction 2 - set standard window colors. ======
2085
====== Function 48, subfunction 2 - set standard window colors. ======
2069
======================================================================
2086
======================================================================
2070
Parameters:
2087
Parameters:
2071
  * eax = 48 - function number
2088
  * eax = 48 - function number
2072
  * ebx = 2 - subfunction number
2089
  * ebx = 2 - subfunction number
2073
  * ecx = pointer to the color table
2090
  * ecx = pointer to the color table
2074
  * edx = size of the color table
2091
  * edx = size of the color table
2075
    (must be 40 bytes for future compatibility)
2092
    (must be 40 bytes for future compatibility)
2076
Format of the color table is shown in description of subfunction 3.
2093
Format of the color table is shown in description of subfunction 3.
2077
Returned value:
2094
Returned value:
2078
  * function does not return value
2095
  * function does not return value
2079
Remarks:
2096
Remarks:
2080
  * After call to this function one should redraw the screen by
2097
  * After call to this function one should redraw the screen by
2081
    subfunction 0.
2098
    subfunction 0.
2082
  * Table of standard colors influences only to applications,
2099
  * Table of standard colors influences only to applications,
2083
    which receive this table obviously (by subfunction 3)
2100
    which receive this table obviously (by subfunction 3)
2084
    and use it (specifying colors from it to drawing functions).
2101
    and use it (specifying colors from it to drawing functions).
2085
  * Table of standard colors is included in skin and is installed
2102
  * Table of standard colors is included in skin and is installed
2086
    anew with skin installation (by subfunction 8).
2103
    anew with skin installation (by subfunction 8).
2087
  * Color table can be viewed/changed interactively with
2104
  * Color table can be viewed/changed interactively with
2088
    the application 'desktop'.
2105
    the application 'desktop'.
2089
 
2106
 
2090
======================================================================
2107
======================================================================
2091
====== Function 48, subfunction 3 - get standard window colors. ======
2108
====== Function 48, subfunction 3 - get standard window colors. ======
2092
======================================================================
2109
======================================================================
2093
Parameters:
2110
Parameters:
2094
  * eax = 48 - function number
2111
  * eax = 48 - function number
2095
  * ebx = 3 - subfunction number
2112
  * ebx = 3 - subfunction number
2096
  * ecx = pointer to the buffer with size edx bytes,
2113
  * ecx = pointer to the buffer with size edx bytes,
2097
    where table will be written
2114
    where table will be written
2098
  * edx = size of color table
2115
  * edx = size of color table
2099
    (must be 40 bytes for future compatibility)
2116
    (must be 40 bytes for future compatibility)
2100
Returned value:
2117
Returned value:
2101
  * function does not return value
2118
  * function does not return value
2102
Format of the color table:
2119
Format of the color table:
2103
each item is dword-value for color 0x00RRGGBB
2120
each item is dword-value for color 0x00RRGGBB
2104
  * +0: dword: frames - color of frame
2121
  * +0: dword: frames - color of frame
2105
  * +4: dword: grab - color of header
2122
  * +4: dword: grab - color of header
2106
  * +8: dword: grab_button - color of button on header bar
2123
  * +8: dword: grab_button - color of button on header bar
2107
  * +12 = +0xC: dword: grab_button_text - color of text on button
2124
  * +12 = +0xC: dword: grab_button_text - color of text on button
2108
    on header bar
2125
    on header bar
2109
  * +16 = +0x10: dword: grab_text - color of text on header
2126
  * +16 = +0x10: dword: grab_text - color of text on header
2110
  * +20 = +0x14: dword: work - color of working area
2127
  * +20 = +0x14: dword: work - color of working area
2111
  * +24 = +0x18: dword: work_button - color of button in working area
2128
  * +24 = +0x18: dword: work_button - color of button in working area
2112
  * +28 = +0x1C: dword: work_button_text - color of text on button
2129
  * +28 = +0x1C: dword: work_button_text - color of text on button
2113
    in working area
2130
    in working area
2114
  * +32 = +0x20: dword: work_text - color of text in working area
2131
  * +32 = +0x20: dword: work_text - color of text in working area
2115
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2132
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2116
Remarks:
2133
Remarks:
2117
  * Structure of the color table is described in the standard
2134
  * Structure of the color table is described in the standard
2118
    include file 'macros.inc' as 'system_colors'; for example,
2135
    include file 'macros.inc' as 'system_colors'; for example,
2119
    it is possible to write:
2136
    it is possible to write:
2120
    	sc	system_colors		; variable declaration
2137
    	sc	system_colors		; variable declaration
2121
    	...				; somewhere one must call
2138
    	...				; somewhere one must call
2122
    					; this function with ecx=sc
2139
    					; this function with ecx=sc
2123
    	mov	ecx, [sc.work_button_text]	; read text color on
2140
    	mov	ecx, [sc.work_button_text]	; read text color on
2124
    					; buttin in working area
2141
    					; buttin in working area
2125
  * A program itself desides to use or not to use color table.
2142
  * A program itself desides to use or not to use color table.
2126
    For usage program must simply at calls to drawing functions select
2143
    For usage program must simply at calls to drawing functions select
2127
    color taken from the table.
2144
    color taken from the table.
2128
  * At change of the table of standard colors (by subfunction 2 with
2145
  * At change of the table of standard colors (by subfunction 2 with
2129
    the subsequent application of changes by subfunction 0 or
2146
    the subsequent application of changes by subfunction 0 or
2130
    at skin set by subfunction 8) the system sends to all windows
2147
    at skin set by subfunction 8) the system sends to all windows
2131
    redraw message (the event with code 1).
2148
    redraw message (the event with code 1).
2132
  * Color table can be viewed/changed interactively with
2149
  * Color table can be viewed/changed interactively with
2133
    the application 'desktop'.
2150
    the application 'desktop'.
2134
 
2151
 
2135
======================================================================
2152
======================================================================
2136
============ Function 48, subfunction 4 - get skin height. ===========
2153
============ Function 48, subfunction 4 - get skin height. ===========
2137
======================================================================
2154
======================================================================
2138
Parameters:
2155
Parameters:
2139
  * eax = 48 - function number
2156
  * eax = 48 - function number
2140
  * ebx = 4 - subfunction number
2157
  * ebx = 4 - subfunction number
2141
Returned value:
2158
Returned value:
2142
  * eax = skin height
2159
  * eax = skin height
2143
Remarks:
2160
Remarks:
2144
  * Skin height is defined as the height of a header
2161
  * Skin height is defined as the height of a header
2145
    of skinned windows.
2162
    of skinned windows.
2146
  * See also general structure of window in the description
2163
  * See also general structure of window in the description
2147
    of function 0.
2164
    of function 0.
2148
 
2165
 
2149
======================================================================
2166
======================================================================
2150
======== Function 48, subfunction 5 - get screen working area. =======
2167
======== Function 48, subfunction 5 - get screen working area. =======
2151
======================================================================
2168
======================================================================
2152
Parameters:
2169
Parameters:
2153
  * eax = 48 - function number
2170
  * eax = 48 - function number
2154
  * ebx = 5 - subfunction number
2171
  * ebx = 5 - subfunction number
2155
Returned value:
2172
Returned value:
2156
  * eax = [left]*65536 + [right]
2173
  * eax = [left]*65536 + [right]
2157
  * ebx = [top]*65536 + [bottom]
2174
  * ebx = [top]*65536 + [bottom]
2158
Remarks:
2175
Remarks:
2159
  * The screen working area defines position and coordinates of
2176
  * The screen working area defines position and coordinates of
2160
    a maximized window.
2177
    a maximized window.
2161
  * The screen working area in view of normal work is all screen
2178
  * The screen working area in view of normal work is all screen
2162
    without system panel (the application '@panel').
2179
    without system panel (the application '@panel').
2163
  * (left,top) are coordinates of the left upper corner,
2180
  * (left,top) are coordinates of the left upper corner,
2164
    (right,bottom) are coordinates of the right lower one.
2181
    (right,bottom) are coordinates of the right lower one.
2165
    Thus the size of working area on x axis can be calculated by
2182
    Thus the size of working area on x axis can be calculated by
2166
    formula right-left+1, on y axis - by formula bottom-right+1.
2183
    formula right-left+1, on y axis - by formula bottom-right+1.
2167
  * See also function 14,
2184
  * See also function 14,
2168
    to get sizes of all screen.
2185
    to get sizes of all screen.
2169
  * There is a pair function to set working area - subfunction 6.
2186
  * There is a pair function to set working area - subfunction 6.
2170
 
2187
 
2171
======================================================================
2188
======================================================================
2172
======== Function 48, subfunction 6 - set screen working area. =======
2189
======== Function 48, subfunction 6 - set screen working area. =======
2173
======================================================================
2190
======================================================================
2174
Parameters:
2191
Parameters:
2175
  * eax = 48 - function number
2192
  * eax = 48 - function number
2176
  * ebx = 6 - subfunction number
2193
  * ebx = 6 - subfunction number
2177
  * ecx = [left]*65536 + [right]
2194
  * ecx = [left]*65536 + [right]
2178
  * edx = [top]*65536 + [bottom]
2195
  * edx = [top]*65536 + [bottom]
2179
Returned value:
2196
Returned value:
2180
  * function does not return value
2197
  * function does not return value
2181
Remarks:
2198
Remarks:
2182
  * The screen working area defines position and coordinates of
2199
  * The screen working area defines position and coordinates of
2183
    a maximized window.
2200
    a maximized window.
2184
  * This function is used only by the application '@panel',
2201
  * This function is used only by the application '@panel',
2185
    which set working area to all screen without system panel.
2202
    which set working area to all screen without system panel.
2186
  * (left,top) are coordinates of the left upper corner,
2203
  * (left,top) are coordinates of the left upper corner,
2187
    (right,bottom) are coordinates of the right lower one.
2204
    (right,bottom) are coordinates of the right lower one.
2188
    Thus the size of working area on x axis can be calculated by
2205
    Thus the size of working area on x axis can be calculated by
2189
    formula right-left+1, on y axis - by formula bottom-right+1.
2206
    formula right-left+1, on y axis - by formula bottom-right+1.
2190
  * If 'left'>='right', x-coordinate of working area is not changed.
2207
  * If 'left'>='right', x-coordinate of working area is not changed.
2191
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2208
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2192
    equal to screen width, 'right' will not be set.
2209
    equal to screen width, 'right' will not be set.
2193
    Similarly on y axis.
2210
    Similarly on y axis.
2194
  * See also function 14,
2211
  * See also function 14,
2195
    to get sizes of all screen.
2212
    to get sizes of all screen.
2196
  * There is a pair function to get working area - subfunction 5.
2213
  * There is a pair function to get working area - subfunction 5.
2197
  * This function redraws the screen automatically,
2214
  * This function redraws the screen automatically,
2198
    updating coordinates and sizes of maximized windows.
2215
    updating coordinates and sizes of maximized windows.
2199
    The system sends to all windows redraw message (the event 1).
2216
    The system sends to all windows redraw message (the event 1).
2200
 
2217
 
2201
======================================================================
2218
======================================================================
2202
=========== Function 48, subfunction 7 - get skin margins. ===========
2219
=========== Function 48, subfunction 7 - get skin margins. ===========
2203
======================================================================
2220
======================================================================
2204
Returns the area of a header of a skinned window, intended for
2221
Returns the area of a header of a skinned window, intended for
2205
a text of a header.
2222
a text of a header.
2206
Parameters:
2223
Parameters:
2207
  * eax = 48 - function number
2224
  * eax = 48 - function number
2208
  * ebx = 7 - subfunction number
2225
  * ebx = 7 - subfunction number
2209
Returned value:
2226
Returned value:
2210
  * eax = [left]*65536 + [right]
2227
  * eax = [left]*65536 + [right]
2211
  * ebx = [top]*65536 + [bottom]
2228
  * ebx = [top]*65536 + [bottom]
2212
Remarks:
2229
Remarks:
2213
  * An application decides itself to use or not to use this function.
2230
  * An application decides itself to use or not to use this function.
2214
  * It is recommended to take into account returned value
2231
  * It is recommended to take into account returned value
2215
    of this function for choice of a place for drawing header text
2232
    of this function for choice of a place for drawing header text
2216
    (by function 4) or a substitute of header text
2233
    (by function 4) or a substitute of header text
2217
    (at the discretion of an application).
2234
    (at the discretion of an application).
2218
 
2235
 
2219
======================================================================
2236
======================================================================
2220
============= Function 48, subfunction 8 - set used skin. ============
2237
============= Function 48, subfunction 8 - set used skin. ============
2221
======================================================================
2238
======================================================================
2222
Parameters:
2239
Parameters:
2223
  * eax = 48 - function number
2240
  * eax = 48 - function number
2224
  * ebx = 8 - subfunction number
2241
  * ebx = 8 - subfunction number
2225
  * ecx = pointer to a block for function 58, in
2242
  * ecx = pointer to a block for function 58, in
2226
    which the fields of intermediate buffer and file name are filled
2243
    which the fields of intermediate buffer and file name are filled
2227
Returned value:
2244
Returned value:
2228
  * eax = 0 - success
2245
  * eax = 0 - success
2229
  * otherwise eax = file system error code; if file does not
2246
  * otherwise eax = file system error code; if file does not
2230
    contain valid skin, function returns error 3
2247
    contain valid skin, function returns error 3
2231
    (unknown file system).
2248
    (unknown file system).
2232
Remarks:
2249
Remarks:
2233
  * After successful skin loading the system sends to all windows
2250
  * After successful skin loading the system sends to all windows
2234
    redraw message (the event 1).
2251
    redraw message (the event 1).
2235
  * At booting the system reads skin from file 'default.skn'
2252
  * At booting the system reads skin from file 'default.skn'
2236
    on ramdisk.
2253
    on ramdisk.
2237
  * User can change the skin statically by creating hisself
2254
  * User can change the skin statically by creating hisself
2238
    'default.skn' or dynamically with the application 'desktop'.
2255
    'default.skn' or dynamically with the application 'desktop'.
2239
 
2256
 
2240
======================================================================
2257
======================================================================
2241
=========== Function 49 - Advanced Power Management (APM). ===========
2258
=========== Function 49 - Advanced Power Management (APM). ===========
2242
======================================================================
2259
======================================================================
2243
Parameters:
2260
Parameters:
2244
  * eax = 49 - function number
2261
  * eax = 49 - function number
2245
  * dx = number of the APM function
2262
  * dx = number of the APM function
2246
    (analogue of ax in APM specification)
2263
    (analogue of ax in APM specification)
2247
  * bx, cx = parameters of the APM function
2264
  * bx, cx = parameters of the APM function
2248
Returned value:
2265
Returned value:
2249
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2266
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2250
    are set according to the APM specification
2267
    are set according to the APM specification
2251
  * high halves of 32-bit registers eax, ebx, ecx,
2268
  * high halves of 32-bit registers eax, ebx, ecx,
2252
    edx, esi, edi are destroyed
2269
    edx, esi, edi are destroyed
2253
Remarks:
2270
Remarks:
2254
  * APM 1.2 specification is described in the document
2271
  * APM 1.2 specification is described in the document
2255
    "Advanced Power Management (APM) BIOS Specification"
2272
    "Advanced Power Management (APM) BIOS Specification"
2256
    (Revision 1.2), available at
2273
    (Revision 1.2), available at
2257
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2274
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2258
    besides it is included in famous Interrupt List by Ralf Brown
2275
    besides it is included in famous Interrupt List by Ralf Brown
2259
    (http://www.pobox.com/~ralf/files.html,
2276
    (http://www.pobox.com/~ralf/files.html,
2260
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2277
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2261
 
2278
 
2262
======================================================================
2279
======================================================================
2263
=================== Function 50 - set window shape. ==================
2280
=================== Function 50 - set window shape. ==================
2264
======================================================================
2281
======================================================================
2265
Normal windows have rectangular shape. This function can give to
2282
Normal windows have rectangular shape. This function can give to
2266
a window any shape. The shape is given by a set of points inside
2283
a window any shape. The shape is given by a set of points inside
2267
the base rectangle belonging to a window. Position and coordinates
2284
the base rectangle belonging to a window. Position and coordinates
2268
of the base rectangle are set by function 0
2285
of the base rectangle are set by function 0
2269
and changed by function 67.
2286
and changed by function 67.
2270
 
2287
 
2271
--------------------------- Set shape data ---------------------------
2288
--------------------------- Set shape data ---------------------------
2272
Parameters:
2289
Parameters:
2273
  * eax = 50 - function number
2290
  * eax = 50 - function number
2274
  * ebx = 0 - subfunction number
2291
  * ebx = 0 - subfunction number
2275
  * ecx = pointer to shape data (array of bytes 0/1)
2292
  * ecx = pointer to shape data (array of bytes 0/1)
2276
Returned value:
2293
Returned value:
2277
  * function does not return value
2294
  * function does not return value
2278
 
2295
 
2279
-------------------------- Set shape scale ---------------------------
2296
-------------------------- Set shape scale ---------------------------
2280
Parameters:
2297
Parameters:
2281
  * eax = 50 - function number
2298
  * eax = 50 - function number
2282
  * ebx = 1 - subfunction number
2299
  * ebx = 1 - subfunction number
2283
  * ecx sets a scale: each byte of data defines
2300
  * ecx sets a scale: each byte of data defines
2284
    (2^scale)*(2^scale) pixels
2301
    (2^scale)*(2^scale) pixels
2285
Returned value:
2302
Returned value:
2286
  * function does not return value
2303
  * function does not return value
2287
Remarks:
2304
Remarks:
2288
  * Default scale is 0 (scale factor is 1). If in the shape data
2305
  * Default scale is 0 (scale factor is 1). If in the shape data
2289
    one byte corresponds to one pixel, there is no necessity
2306
    one byte corresponds to one pixel, there is no necessity
2290
    to set scale.
2307
    to set scale.
2291
  * Let's designate xsize = window width (in pixels), ysize = height;
2308
  * Let's designate xsize = window width (in pixels), ysize = height;
2292
    pay attention, that they are one pixel more than defined by
2309
    pay attention, that they are one pixel more than defined by
2293
    functions 0, 67.
2310
    functions 0, 67.
2294
  * On definition of scale xsize and ysize must be divisible
2311
  * On definition of scale xsize and ysize must be divisible
2295
    on 2^scale.
2312
    on 2^scale.
2296
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2313
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2297
    to a window of square with the side 2^scale (if scale=0,
2314
    to a window of square with the side 2^scale (if scale=0,
2298
    this is one pixel) and coordinates of the left upper corner
2315
    this is one pixel) and coordinates of the left upper corner
2299
    (a mod (xsize shr scale), a div (xsize shr scale))
2316
    (a mod (xsize shr scale), a div (xsize shr scale))
2300
  * Data size: (xsize shr scale)*(ysize shr scale).
2317
  * Data size: (xsize shr scale)*(ysize shr scale).
2301
  * Data must be presented in the memory and not change
2318
  * Data must be presented in the memory and not change
2302
    after set of shape.
2319
    after set of shape.
2303
  * The system views the shape data at every window redraw by
2320
  * The system views the shape data at every window redraw by
2304
    function 0.
2321
    function 0.
2305
  * The call of subfunction 0 with NULL pointer results in return
2322
  * The call of subfunction 0 with NULL pointer results in return
2306
    to the rectangular shape.
2323
    to the rectangular shape.
2307
 
2324
 
2308
======================================================================
2325
======================================================================
2309
==================== Function 51 - create thread. ====================
2326
==================== Function 51 - create thread. ====================
2310
======================================================================
2327
======================================================================
2311
Parameters:
2328
Parameters:
2312
  * eax = 51 - function number
2329
  * eax = 51 - function number
2313
  * ebx = 1 - unique subfunction
2330
  * ebx = 1 - unique subfunction
2314
  * ecx = address of thread entry point (starting eip)
2331
  * ecx = address of thread entry point (starting eip)
2315
  * edx = pointer to thread stack (starting esp)
2332
  * edx = pointer to thread stack (starting esp)
2316
Returned value:
2333
Returned value:
2317
  * eax = -1 - error (there is too many threads)
2334
  * eax = -1 - error (there is too many threads)
2318
  * otherwise eax = TID - thread identifier
2335
  * otherwise eax = TID - thread identifier
2319
    
2336
    
2320
 
2337
 
2321
======================================================================
2338
======================================================================
2322
=== Function 52, subfunction 0 - get network driver configuration. ===
2339
=== Function 52, subfunction 0 - get network driver configuration. ===
2323
======================================================================
2340
======================================================================
2324
Parameters:
2341
Parameters:
2325
  * eax = 52 - function number
2342
  * eax = 52 - function number
2326
  * ebx = 0 - subfunction number
2343
  * ebx = 0 - subfunction number
2327
Returned value:
2344
Returned value:
2328
  * eax = configuration dword
2345
  * eax = configuration dword
2329
Remarks:
2346
Remarks:
2330
  * Configuration dword can be set by subfunction 2.
2347
  * Configuration dword can be set by subfunction 2.
2331
  * The kernel does not use this variable. The value of this
2348
  * The kernel does not use this variable. The value of this
2332
    variable and working with it subfunctions 0 and 2 is represented
2349
    variable and working with it subfunctions 0 and 2 is represented
2333
    doubtful.
2350
    doubtful.
2334
 
2351
 
2335
======================================================================
2352
======================================================================
2336
========= Function 52, subfunction 1 - get local IP-address. =========
2353
========= Function 52, subfunction 1 - get local IP-address. =========
2337
======================================================================
2354
======================================================================
2338
Parameters:
2355
Parameters:
2339
  * eax = 52 - function number
2356
  * eax = 52 - function number
2340
  * ebx = 1 - subfunction number
2357
  * ebx = 1 - subfunction number
2341
Returned value:
2358
Returned value:
2342
  * eax = IP-address (4 bytes)
2359
  * eax = IP-address (4 bytes)
2343
Remarks:
2360
Remarks:
2344
  * Local IP-address is set by subfunction 3.
2361
  * Local IP-address is set by subfunction 3.
2345
 
2362
 
2346
======================================================================
2363
======================================================================
2347
=== Function 52, subfunction 2 - set network driver configuration. ===
2364
=== Function 52, subfunction 2 - set network driver configuration. ===
2348
======================================================================
2365
======================================================================
2349
Parameters:
2366
Parameters:
2350
  * eax = 52 - function number
2367
  * eax = 52 - function number
2351
  * ebx = 2 - subfunction number
2368
  * ebx = 2 - subfunction number
2352
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2369
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2353
    function [re-]initializes Ethernet-card, otherwise
2370
    function [re-]initializes Ethernet-card, otherwise
2354
    Ethernet turns off
2371
    Ethernet turns off
2355
Returned value:
2372
Returned value:
2356
  * if Ethernet-interface is not requested, function returns eax=2,
2373
  * if Ethernet-interface is not requested, function returns eax=2,
2357
    but this can be changed in future kernel versions
2374
    but this can be changed in future kernel versions
2358
  * if Ethernet-interface is requested, eax=0 means error
2375
  * if Ethernet-interface is requested, eax=0 means error
2359
    (absence of Ethernet-card), and nonzero value - success
2376
    (absence of Ethernet-card), and nonzero value - success
2360
Remarks:
2377
Remarks:
2361
  * Configuration dword can be read by subfunction 0.
2378
  * Configuration dword can be read by subfunction 0.
2362
  * The kernel does not use this variable. The value of this
2379
  * The kernel does not use this variable. The value of this
2363
    variable, subfunction 0 and part of subfunction 2, which set it,
2380
    variable, subfunction 0 and part of subfunction 2, which set it,
2364
    is represented doubtful.
2381
    is represented doubtful.
2365
 
2382
 
2366
======================================================================
2383
======================================================================
2367
========= Function 52, subfunction 3 - set local IP-address. =========
2384
========= Function 52, subfunction 3 - set local IP-address. =========
2368
======================================================================
2385
======================================================================
2369
Parameters:
2386
Parameters:
2370
  * eax = 52 - function number
2387
  * eax = 52 - function number
2371
  * ebx = 3 - subfunction number
2388
  * ebx = 3 - subfunction number
2372
  * ecx = IP-address (4 bytes)
2389
  * ecx = IP-address (4 bytes)
2373
Returned value:
2390
Returned value:
2374
  * the current implementation returns eax=3, but this can be changed
2391
  * the current implementation returns eax=3, but this can be changed
2375
    in future versions
2392
    in future versions
2376
Remarks:
2393
Remarks:
2377
  * Local IP-address can be get by subfunction 1.
2394
  * Local IP-address can be get by subfunction 1.
2378
 
2395
 
2379
======================================================================
2396
======================================================================
2380
= Function 52, subfunction 6 - add data to the stack of input queue. =
2397
= Function 52, subfunction 6 - add data to the stack of input queue. =
2381
======================================================================
2398
======================================================================
2382
Parameters:
2399
Parameters:
2383
  * eax = 52 - function number
2400
  * eax = 52 - function number
2384
  * ebx = 6 - subfunction number
2401
  * ebx = 6 - subfunction number
2385
  * edx = data size
2402
  * edx = data size
2386
  * esi = data pointer
2403
  * esi = data pointer
2387
Returned value:
2404
Returned value:
2388
  * eax = -1 - error
2405
  * eax = -1 - error
2389
  * eax = 0 - success
2406
  * eax = 0 - success
2390
Remarks:
2407
Remarks:
2391
  * This function is intended only for slow network drivers
2408
  * This function is intended only for slow network drivers
2392
    (PPP, SLIP).
2409
    (PPP, SLIP).
2393
  * Data size must not exceed 1500 bytes, though function
2410
  * Data size must not exceed 1500 bytes, though function
2394
    performs no checks on correctness.
2411
    performs no checks on correctness.
2395
 
2412
 
2396
======================================================================
2413
======================================================================
2397
 Function 52, subfunction 8 - read data from the network output queue.
2414
 Function 52, subfunction 8 - read data from the network output queue.
2398
======================================================================
2415
======================================================================
2399
Parameters:
2416
Parameters:
2400
  * eax = 52 - function number
2417
  * eax = 52 - function number
2401
  * ebx = 8 - subfunction number
2418
  * ebx = 8 - subfunction number
2402
  * esi = pointer to 1500-byte buffer
2419
  * esi = pointer to 1500-byte buffer
2403
Returned value:
2420
Returned value:
2404
  * eax = number of read bytes (in the current implementation
2421
  * eax = number of read bytes (in the current implementation
2405
    either 0 = no data or 1500)
2422
    either 0 = no data or 1500)
2406
  * data was copied in buffer
2423
  * data was copied in buffer
2407
Remarks:
2424
Remarks:
2408
  * This function is intended only for slow network drivers
2425
  * This function is intended only for slow network drivers
2409
    (PPP, SLIP).
2426
    (PPP, SLIP).
2410
 
2427
 
2411
======================================================================
2428
======================================================================
2412
============ Function 52, subfunction 9 - get gateway IP. ============
2429
============ Function 52, subfunction 9 - get gateway IP. ============
2413
======================================================================
2430
======================================================================
2414
Parameters:
2431
Parameters:
2415
  * eax = 52 - function number
2432
  * eax = 52 - function number
2416
  * ebx = 9 - subfunction number
2433
  * ebx = 9 - subfunction number
2417
Returned value:
2434
Returned value:
2418
  * eax = gateway IP (4 bytes)
2435
  * eax = gateway IP (4 bytes)
2419
 
2436
 
2420
======================================================================
2437
======================================================================
2421
=========== Function 52, subfunction 10 - get subnet mask. ===========
2438
=========== Function 52, subfunction 10 - get subnet mask. ===========
2422
======================================================================
2439
======================================================================
2423
Parameters:
2440
Parameters:
2424
  * eax = 52 - function number
2441
  * eax = 52 - function number
2425
  * ebx = 10 - subfunction number
2442
  * ebx = 10 - subfunction number
2426
Returned value:
2443
Returned value:
2427
  * eax = subnet mask
2444
  * eax = subnet mask
2428
 
2445
 
2429
======================================================================
2446
======================================================================
2430
============ Function 52, subfunction 11 - set gateway IP. ===========
2447
============ Function 52, subfunction 11 - set gateway IP. ===========
2431
======================================================================
2448
======================================================================
2432
Parameters:
2449
Parameters:
2433
  * eax = 52 - function number
2450
  * eax = 52 - function number
2434
  * ebx = 11 - subfunction number
2451
  * ebx = 11 - subfunction number
2435
  * ecx = gateway IP (4 bytes)
2452
  * ecx = gateway IP (4 bytes)
2436
Returned value:
2453
Returned value:
2437
  * the current implementation returns eax=11, but this can be changed
2454
  * the current implementation returns eax=11, but this can be changed
2438
    in future versions
2455
    in future versions
2439
 
2456
 
2440
======================================================================
2457
======================================================================
2441
=========== Function 52, subfunction 12 - set subnet mask. ===========
2458
=========== Function 52, subfunction 12 - set subnet mask. ===========
2442
======================================================================
2459
======================================================================
2443
Parameters:
2460
Parameters:
2444
  * eax = 52 - function number
2461
  * eax = 52 - function number
2445
  * ebx = 12 - subfunction number
2462
  * ebx = 12 - subfunction number
2446
  * ecx = subnet mask
2463
  * ecx = subnet mask
2447
Returned value:
2464
Returned value:
2448
  * the current implementation returns eax=12, but this can be changed
2465
  * the current implementation returns eax=12, but this can be changed
2449
    in future versions
2466
    in future versions
2450
 
2467
 
2451
======================================================================
2468
======================================================================
2452
============== Function 52, subfunction 13 - get DNS IP. =============
2469
============== Function 52, subfunction 13 - get DNS IP. =============
2453
======================================================================
2470
======================================================================
2454
Parameters:
2471
Parameters:
2455
  * eax = 52 - function number
2472
  * eax = 52 - function number
2456
  * ebx = 13 - subfunction number
2473
  * ebx = 13 - subfunction number
2457
Returned value:
2474
Returned value:
2458
  * eax = DNS IP (4 bytes)
2475
  * eax = DNS IP (4 bytes)
2459
 
2476
 
2460
======================================================================
2477
======================================================================
2461
============== Function 52, subfunction 14 - set DNS IP. =============
2478
============== Function 52, subfunction 14 - set DNS IP. =============
2462
======================================================================
2479
======================================================================
2463
Parameters:
2480
Parameters:
2464
  * eax = 52 - function number
2481
  * eax = 52 - function number
2465
  * ebx = 14 - subfunction number
2482
  * ebx = 14 - subfunction number
2466
  * ecx = DNS IP (4 bytes)
2483
  * ecx = DNS IP (4 bytes)
2467
Returned value:
2484
Returned value:
2468
  * the current implementation returns eax=14, but this can be changed
2485
  * the current implementation returns eax=14, but this can be changed
2469
    in future versions
2486
    in future versions
2470
 
2487
 
2471
======================================================================
2488
======================================================================
2472
======== Function 52, subfunction 15 - get local MAC address. ========
2489
======== Function 52, subfunction 15 - get local MAC address. ========
2473
======================================================================
2490
======================================================================
2474
Parameters:
2491
Parameters:
2475
  * eax = 52 - function number
2492
  * eax = 52 - function number
2476
  * ebx = 15 - subfunction number
2493
  * ebx = 15 - subfunction number
2477
  * ecx = 0 - read first 4 bytes,
2494
  * ecx = 0 - read first 4 bytes,
2478
    ecx = 4 - read last 2 bytes
2495
    ecx = 4 - read last 2 bytes
2479
Returned value:
2496
Returned value:
2480
  * for ecx=0: eax = first 4 bytes of MAC address
2497
  * for ecx=0: eax = first 4 bytes of MAC address
2481
  * for ecx=4: ax = last 2 bytes of MAC address,
2498
  * for ecx=4: ax = last 2 bytes of MAC address,
2482
               high half of eax is destroyed
2499
               high half of eax is destroyed
2483
  * for other ecx: eax = -1 indicates an error
2500
  * for other ecx: eax = -1 indicates an error
2484
 
2501
 
2485
======================================================================
2502
======================================================================
2486
============ Function 53, subfunction 0 - open UDP-socket. ===========
2503
============ Function 53, subfunction 0 - open UDP-socket. ===========
2487
======================================================================
2504
======================================================================
2488
Parameters:
2505
Parameters:
2489
  * eax = 53 - function number
2506
  * eax = 53 - function number
2490
  * ebx = 0 - subfunction number
2507
  * ebx = 0 - subfunction number
2491
  * ecx = local port (only low word is taken into account),
2508
  * ecx = local port (only low word is taken into account),
2492
    ecx = 0 - let the system choose a port
2509
    ecx = 0 - let the system choose a port
2493
  * edx = remote port (only low word is taken into account)
2510
  * edx = remote port (only low word is taken into account)
2494
  * esi = remote IP
2511
  * esi = remote IP
2495
Returned value:
2512
Returned value:
2496
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2513
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2497
  * eax = socket handle (some number which unambiguously identifies
2514
  * eax = socket handle (some number which unambiguously identifies
2498
    socket and have sense only for the system) - success;
2515
    socket and have sense only for the system) - success;
2499
    ebx destroyed
2516
    ebx destroyed
2500
 
2517
 
2501
======================================================================
2518
======================================================================
2502
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2519
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2503
======================================================================
2520
======================================================================
2504
Parameters:
2521
Parameters:
2505
  * eax = 53 - function number
2522
  * eax = 53 - function number
2506
  * ebx = 1 - subfunction number
2523
  * ebx = 1 - subfunction number
2507
  * ecx = socket handle
2524
  * ecx = socket handle
2508
Returned value:
2525
Returned value:
2509
  * eax = -1 - incorrect handle
2526
  * eax = -1 - incorrect handle
2510
  * eax = 0 - success
2527
  * eax = 0 - success
2511
  * ebx destroyed
2528
  * ebx destroyed
2512
Remarks:
2529
Remarks:
2513
  * The current implementation does not close automatically all
2530
  * The current implementation does not close automatically all
2514
    sockets of a thread at termination. In particular, one should not
2531
    sockets of a thread at termination. In particular, one should not
2515
    kill a thread with many opened sockets - there will be an outflow
2532
    kill a thread with many opened sockets - there will be an outflow
2516
    of resources.
2533
    of resources.
2517
 
2534
 
2518
======================================================================
2535
======================================================================
2519
============== Function 53, subfunction 2 - poll socket. =============
2536
============== Function 53, subfunction 2 - poll socket. =============
2520
======================================================================
2537
======================================================================
2521
Parameters:
2538
Parameters:
2522
  * eax = 53 - function number
2539
  * eax = 53 - function number
2523
  * ebx = 2 - subfunction number
2540
  * ebx = 2 - subfunction number
2524
  * ecx = socket handle
2541
  * ecx = socket handle
2525
Returned value:
2542
Returned value:
2526
  * eax = number of read bytes, 0 for incorrect handle
2543
  * eax = number of read bytes, 0 for incorrect handle
2527
  * ebx destroyed
2544
  * ebx destroyed
2528
 
2545
 
2529
======================================================================
2546
======================================================================
2530
========= Function 53, subfunction 3 - read byte from socket. ========
2547
========= Function 53, subfunction 3 - read byte from socket. ========
2531
======================================================================
2548
======================================================================
2532
Parameters:
2549
Parameters:
2533
  * eax = 53 - function number
2550
  * eax = 53 - function number
2534
  * ebx = 3 - subfunction number
2551
  * ebx = 3 - subfunction number
2535
  * ecx = socket handle
2552
  * ecx = socket handle
2536
Returned value:
2553
Returned value:
2537
  * if there is no read data or handle is incorrect: eax=0, bl=0,
2554
  * if there is no read data or handle is incorrect: eax=0, bl=0,
2538
    other bytes of ebx are destroyed
2555
    other bytes of ebx are destroyed
2539
  * if there are read data: eax=number of rest bytes
2556
  * if there are read data: eax=number of rest bytes
2540
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2557
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2541
 
2558
 
2542
======================================================================
2559
======================================================================
2543
========== Function 53, subfunction 4 - write to UDP-socket. =========
2560
========== Function 53, subfunction 4 - write to UDP-socket. =========
2544
======================================================================
2561
======================================================================
2545
Parameters:
2562
Parameters:
2546
  * eax = 53 - function number
2563
  * eax = 53 - function number
2547
  * ebx = 4 - subfunction number
2564
  * ebx = 4 - subfunction number
2548
  * ecx = socket handle
2565
  * ecx = socket handle
2549
  * edx = number of bytes to write
2566
  * edx = number of bytes to write
2550
  * esi = pointer to data to write
2567
  * esi = pointer to data to write
2551
Returned value:
2568
Returned value:
2552
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2569
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2553
  * eax = 0 - success
2570
  * eax = 0 - success
2554
  * ebx destroyed
2571
  * ebx destroyed
2555
Remarks:
2572
Remarks:
2556
  * Number of bytes to write must not exceed 1500-28, though
2573
  * Number of bytes to write must not exceed 1500-28, though
2557
    the appropriate check is not made.
2574
    the appropriate check is not made.
2558
 
2575
 
2559
======================================================================
2576
======================================================================
2560
============ Function 53, subfunction 5 - open TCP-socket. ===========
2577
============ Function 53, subfunction 5 - open TCP-socket. ===========
2561
======================================================================
2578
======================================================================
2562
Parameters:
2579
Parameters:
2563
  * eax = 53 - function number
2580
  * eax = 53 - function number
2564
  * ebx = 5 - subfunction number
2581
  * ebx = 5 - subfunction number
2565
  * ecx = local port (only low word is taken into account),
2582
  * ecx = local port (only low word is taken into account),
2566
    ecx = 0 - let the system choose a port
2583
    ecx = 0 - let the system choose a port
2567
  * edx = remote port (only low word is taken into account)
2584
  * edx = remote port (only low word is taken into account)
2568
  * esi = remote IP
2585
  * esi = remote IP
2569
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2586
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2570
Returned value:
2587
Returned value:
2571
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2588
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2572
  * eax = socket handle (some number which unambiguously identifies
2589
  * eax = socket handle (some number which unambiguously identifies
2573
    socket and have sense only for the system) - success;
2590
    socket and have sense only for the system) - success;
2574
    ebx destroyed
2591
    ebx destroyed
2575
 
2592
 
2576
======================================================================
2593
======================================================================
2577
========= Function 53, subfunction 6 - get TCP-socket status. ========
2594
========= Function 53, subfunction 6 - get TCP-socket status. ========
2578
======================================================================
2595
======================================================================
2579
Parameters:
2596
Parameters:
2580
  * eax = 53 - function number
2597
  * eax = 53 - function number
2581
  * ebx = 6 - subfunction number
2598
  * ebx = 6 - subfunction number
2582
  * ecx = socket handle
2599
  * ecx = socket handle
2583
Returned value:
2600
Returned value:
2584
  * eax = 0 for incorrect handle or socket status: one of
2601
  * eax = 0 for incorrect handle or socket status: one of
2585
  * TCB_LISTEN = 1
2602
  * TCB_LISTEN = 1
2586
  * TCB_SYN_SENT = 2
2603
  * TCB_SYN_SENT = 2
2587
  * TCB_SYN_RECEIVED = 3
2604
  * TCB_SYN_RECEIVED = 3
2588
  * TCB_ESTABLISHED = 4
2605
  * TCB_ESTABLISHED = 4
2589
  * TCB_FIN_WAIT_1 = 5
2606
  * TCB_FIN_WAIT_1 = 5
2590
  * TCB_FIN_WAIT_2 = 6
2607
  * TCB_FIN_WAIT_2 = 6
2591
  * TCB_CLOSE_WAIT = 7
2608
  * TCB_CLOSE_WAIT = 7
2592
  * TCB_CLOSING = 8
2609
  * TCB_CLOSING = 8
2593
  * TCB_LAST_ASK = 9
2610
  * TCB_LAST_ASK = 9
2594
  * TCB_TIME_WAIT = 10
2611
  * TCB_TIME_WAIT = 10
2595
  * TCB_CLOSED = 11
2612
  * TCB_CLOSED = 11
2596
  * ebx destroyed
2613
  * ebx destroyed
2597
 
2614
 
2598
======================================================================
2615
======================================================================
2599
========== Function 53, subfunction 7 - write to TCP-socket. =========
2616
========== Function 53, subfunction 7 - write to TCP-socket. =========
2600
======================================================================
2617
======================================================================
2601
Parameters:
2618
Parameters:
2602
  * eax = 53 - function number
2619
  * eax = 53 - function number
2603
  * ebx = 7 - subfunction number
2620
  * ebx = 7 - subfunction number
2604
  * ecx = socket handle
2621
  * ecx = socket handle
2605
  * edx = number of bytes to write
2622
  * edx = number of bytes to write
2606
  * esi = pointer to data to write
2623
  * esi = pointer to data to write
2607
Returned value:
2624
Returned value:
2608
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2625
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2609
  * eax = 0 - success
2626
  * eax = 0 - success
2610
  * ebx destroyed
2627
  * ebx destroyed
2611
Remarks:
2628
Remarks:
2612
  * Number of bytes to write must not exceed 1500-40, though
2629
  * Number of bytes to write must not exceed 1500-40, though
2613
    the appropriate check is not made.
2630
    the appropriate check is not made.
2614
 
2631
 
2615
======================================================================
2632
======================================================================
2616
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2633
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2617
======================================================================
2634
======================================================================
2618
Parameters:
2635
Parameters:
2619
  * eax = 53 - function number
2636
  * eax = 53 - function number
2620
  * ebx = 8 - subfunction number
2637
  * ebx = 8 - subfunction number
2621
  * ecx = socket handle
2638
  * ecx = socket handle
2622
Returned value:
2639
Returned value:
2623
  * eax = -1 - error (invalid handle or
2640
  * eax = -1 - error (invalid handle or
2624
    not enough memory for socket close packet)
2641
    not enough memory for socket close packet)
2625
  * eax = 0 - success
2642
  * eax = 0 - success
2626
  * ebx destroyed
2643
  * ebx destroyed
2627
Remarks:
2644
Remarks:
2628
  * The current implementation does not close automatically all
2645
  * The current implementation does not close automatically all
2629
    sockets of a thread at termination. In particular, one should not
2646
    sockets of a thread at termination. In particular, one should not
2630
    kill a thread with many opened sockets - there will be an outflow
2647
    kill a thread with many opened sockets - there will be an outflow
2631
    of resources.
2648
    of resources.
2632
 
2649
 
2633
======================================================================
2650
======================================================================
2634
=== Function 53, subfunction 9 - check whether local port is free. ===
2651
=== Function 53, subfunction 9 - check whether local port is free. ===
2635
======================================================================
2652
======================================================================
2636
Parameters:
2653
Parameters:
2637
  * eax = 53 - function number
2654
  * eax = 53 - function number
2638
  * ebx = 9 - subfunction number
2655
  * ebx = 9 - subfunction number
2639
  * ecx = local port number (low 16 bits are used only)
2656
  * ecx = local port number (low 16 bits are used only)
2640
Returned value:
2657
Returned value:
2641
  * eax = 0 - port is used
2658
  * eax = 0 - port is used
2642
  * eax = 1 - port is free
2659
  * eax = 1 - port is free
2643
  * ebx destroyed
2660
  * ebx destroyed
2644
 
2661
 
2645
======================================================================
2662
======================================================================
2646
===== Function 53, subfunction 10 - query Ethernet cable status. =====
2663
===== Function 53, subfunction 10 - query Ethernet cable status. =====
2647
======================================================================
2664
======================================================================
2648
Parameters:
2665
Parameters:
2649
  * eax = 53 - function number
2666
  * eax = 53 - function number
2650
  * ebx = 10 - subfunction number
2667
  * ebx = 10 - subfunction number
2651
Returned value:
2668
Returned value:
2652
  * al = -1 - a network driver is not loaded or
2669
  * al = -1 - a network driver is not loaded or
2653
              does not support this function
2670
              does not support this function
2654
  * al = 0 - Ethernet cable is unplugged
2671
  * al = 0 - Ethernet cable is unplugged
2655
  * al = 1 - Ethernet cable is plugged
2672
  * al = 1 - Ethernet cable is plugged
2656
  * ebx destroyed
2673
  * ebx destroyed
2657
Remarks:
2674
Remarks:
2658
  * The current kernel implementation supports this function
2675
  * The current kernel implementation supports this function
2659
    only for RTL8139 network cards.
2676
    only for RTL8139 network cards.
2660
 
2677
 
2661
======================================================================
2678
======================================================================
2662
======= Function 53, subfunction 11 - read network stack data. =======
2679
======= Function 53, subfunction 11 - read network stack data. =======
2663
======================================================================
2680
======================================================================
2664
Paramters:
2681
Paramters:
2665
  * eax = 53 - function number
2682
  * eax = 53 - function number
2666
  * ebx = 11 - subfunction number
2683
  * ebx = 11 - subfunction number
2667
  * ecx = socket handle
2684
  * ecx = socket handle
2668
  * edx = pointer to buffer
2685
  * edx = pointer to buffer
2669
  * esi = number of bytes to read;
2686
  * esi = number of bytes to read;
2670
  * esi = 0 - read all data (maximum 4096 bytes)
2687
  * esi = 0 - read all data (maximum 4096 bytes)
2671
Returned value:
2688
Returned value:
2672
  * eax = number of bytes read (0 for incorrect handle)
2689
  * eax = number of bytes read (0 for incorrect handle)
2673
  * ebx destroyed
2690
  * ebx destroyed
2674
 
2691
 
2675
======================================================================
2692
======================================================================
2676
= Function 53, subfunction 255 - debug information of network driver.
2693
= Function 53, subfunction 255 - debug information of network driver.
2677
======================================================================
2694
======================================================================
2678
Parameters:
2695
Parameters:
2679
  * eax = 53 - function number
2696
  * eax = 53 - function number
2680
  * ebx = 255 - subfunction number
2697
  * ebx = 255 - subfunction number
2681
  * ecx = type of requested information (see below)
2698
  * ecx = type of requested information (see below)
2682
Returned value:
2699
Returned value:
2683
  * eax = requested information
2700
  * eax = requested information
2684
  * ebx destroyed
2701
  * ebx destroyed
2685
Possible values for ecx:
2702
Possible values for ecx:
2686
  * 100: length of queue 0 (empty queue)
2703
  * 100: length of queue 0 (empty queue)
2687
  * 101: length of queue 1 (ip-out queue)
2704
  * 101: length of queue 1 (ip-out queue)
2688
  * 102: length of queue 2 (ip-in queue)
2705
  * 102: length of queue 2 (ip-in queue)
2689
  * 103: length of queue 3 (net1out queue)
2706
  * 103: length of queue 3 (net1out queue)
2690
  * 200: number of items in the ARP table
2707
  * 200: number of items in the ARP table
2691
  * 201: size of the ARP table (in items) (20 for current version)
2708
  * 201: size of the ARP table (in items) (20 for current version)
2692
  * 202: read item at edx of the ARP table to the temporary buffer,
2709
  * 202: read item at edx of the ARP table to the temporary buffer,
2693
    whence 5 following types take information;
2710
    whence 5 following types take information;
2694
    in this case eax is not defined
2711
    in this case eax is not defined
2695
  * 203: IP-address saved by type 202
2712
  * 203: IP-address saved by type 202
2696
  * 204: high dword of MAC-address saved by type 202
2713
  * 204: high dword of MAC-address saved by type 202
2697
  * 205: low word of MAC-address saved by type 202
2714
  * 205: low word of MAC-address saved by type 202
2698
  * 206: status word saved by type 202
2715
  * 206: status word saved by type 202
2699
  * 207: ttl word saved by type 202
2716
  * 207: ttl word saved by type 202
2700
  * 2: total number of received IP-packets
2717
  * 2: total number of received IP-packets
2701
  * 3: total number of transferred IP-packets
2718
  * 3: total number of transferred IP-packets
2702
  * 4: total number of dumped received packets
2719
  * 4: total number of dumped received packets
2703
  * 5: total number of received ARP-packets
2720
  * 5: total number of received ARP-packets
2704
  * 6: status of packet driver, 0=inactive, nonzero=active
2721
  * 6: status of packet driver, 0=inactive, nonzero=active
2705
 
2722
 
2706
======================================================================
2723
======================================================================
2707
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2724
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2708
======================================================================
2725
======================================================================
2709
Parameters:
2726
Parameters:
2710
  * eax = 55 - function number
2727
  * eax = 55 - function number
2711
  * ebx = 55 - subfunction number
2728
  * ebx = 55 - subfunction number
2712
  * esi = pointer to data
2729
  * esi = pointer to data
2713
Returned value:
2730
Returned value:
2714
  * eax = 0 - success
2731
  * eax = 0 - success
2715
  * eax = 55 - error (speaker is off or busy)
2732
  * eax = 55 - error (speaker is off or busy)
2716
Data is an array of items with variable length.
2733
Data is an array of items with variable length.
2717
Format of each item is defined by first byte:
2734
Format of each item is defined by first byte:
2718
  * 0 = end of data
2735
  * 0 = end of data
2719
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2736
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2720
    is defined by immediate value of frequency
2737
    is defined by immediate value of frequency
2721
    * following word (2 bytes) contains frequency divider;
2738
    * following word (2 bytes) contains frequency divider;
2722
      frequency is defined as 1193180/divider
2739
      frequency is defined as 1193180/divider
2723
  * 0x81 = invalid
2740
  * 0x81 = invalid
2724
  * 0x82..0xFF = note is defined by octave and number:
2741
  * 0x82..0xFF = note is defined by octave and number:
2725
    * duration in 1/100 of second = (first byte)-0x81
2742
    * duration in 1/100 of second = (first byte)-0x81
2726
    * there is one more byte;
2743
    * there is one more byte;
2727
    * (second byte)=0xFF - delay
2744
    * (second byte)=0xFF - delay
2728
    * otherwise it looks like a*0x10+b, where b=number of the note in
2745
    * otherwise it looks like a*0x10+b, where b=number of the note in
2729
      an octave from 1 to 12, a=number of octave (beginning from 0)
2746
      an octave from 1 to 12, a=number of octave (beginning from 0)
2730
Remarks:
2747
Remarks:
2731
  * Speaker play can be disabled/enabled by
2748
  * Speaker play can be disabled/enabled by
2732
    subfunction 8 of function 18.
2749
    subfunction 8 of function 18.
2733
  * Function returns control, having informed the system
2750
  * Function returns control, having informed the system
2734
    an information on request. Play itself goes independently from
2751
    an information on request. Play itself goes independently from
2735
    the program.
2752
    the program.
2736
  * The data must be kept in the memory at least up to the end
2753
  * The data must be kept in the memory at least up to the end
2737
    of play.
2754
    of play.
2738
 
2755
 
2739
======================================================================
2756
======================================================================
2740
======================= Function 57 - PCI BIOS. ======================
2757
======================= Function 57 - PCI BIOS. ======================
2741
======================================================================
2758
======================================================================
2742
Parameters:
2759
Parameters:
2743
  * eax = 57 - function number
2760
  * eax = 57 - function number
2744
  * ebp corresponds to al in PCI BIOS specification
2761
  * ebp corresponds to al in PCI BIOS specification
2745
  * other registers are set according to PCI BIOS specification
2762
  * other registers are set according to PCI BIOS specification
2746
Returned value:
2763
Returned value:
2747
  * CF is undefined
2764
  * CF is undefined
2748
  * other registers are set according to PCI BIOS specification
2765
  * other registers are set according to PCI BIOS specification
2749
Remarks:
2766
Remarks:
2750
  * Many effects of this function can be also achieved with
2767
  * Many effects of this function can be also achieved with
2751
    corresponding subfunctions of function 62.
2768
    corresponding subfunctions of function 62.
2752
  * The function calls PCI32 BIOS extension, documented e.g. in
2769
  * The function calls PCI32 BIOS extension, documented e.g. in
2753
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2770
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2754
  * If BIOS does not support this extension, its behavior is emulated
2771
  * If BIOS does not support this extension, its behavior is emulated
2755
    (through kernel-mode analogues of subfunctions of function 62).
2772
    (through kernel-mode analogues of subfunctions of function 62).
2756
 
2773
 
2757
======================================================================
2774
======================================================================
2758
================ Function 58 - work with file system. ================
2775
================ Function 58 - work with file system. ================
2759
======================================================================
2776
======================================================================
2760
Parameters:
2777
Parameters:
2761
  * eax = 58
2778
  * eax = 58
2762
  * ebx = pointer to the information structure
2779
  * ebx = pointer to the information structure
2763
Returned value:
2780
Returned value:
2764
  * eax = 0 - success; otherwise file system error code
2781
  * eax = 0 - success; otherwise file system error code
2765
  * some subfunctions return value in other registers too
2782
  * some subfunctions return value in other registers too
2766
General format of the information structure:
2783
General format of the information structure:
2767
  * +0: dword: subfunction number
2784
  * +0: dword: subfunction number
2768
  * +4: dword: number of block
2785
  * +4: dword: number of block
2769
  * +8: dword: size
2786
  * +8: dword: size
2770
  * +12 = +0xC: dword: pointer to data
2787
  * +12 = +0xC: dword: pointer to data
2771
  * +16 = +0x10: dword: pointer to a memory for system operations
2788
  * +16 = +0x10: dword: pointer to a memory for system operations
2772
    (4096 bytes)
2789
    (4096 bytes)
2773
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2790
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2774
Specifications - in documentation on the appropriate subfunction.
2791
Specifications - in documentation on the appropriate subfunction.
2775
Filename is case-insensitive for latin letters, russian letters
2792
Filename is case-insensitive for latin letters, russian letters
2776
must be capital.
2793
must be capital.
2777
Format of filename:
2794
Format of filename:
2778
/base/number/dir1/dir2/.../dirn/file,
2795
/base/number/dir1/dir2/.../dirn/file,
2779
where /base/number identifies device, on which file is located:
2796
where /base/number identifies device, on which file is located:
2780
one of
2797
one of
2781
  * /RD/1 = /RAMDISK/1 to access ramdisk
2798
  * /RD/1 = /RAMDISK/1 to access ramdisk
2782
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2799
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2783
    /FD/2 = /FLOPPYDISK/2 to access second one
2800
    /FD/2 = /FLOPPYDISK/2 to access second one
2784
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2801
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2785
    (in this case base is defined by subfunction 7 of function 21),
2802
    (in this case base is defined by subfunction 7 of function 21),
2786
    x - partition number (beginning from 1)
2803
    x - partition number (beginning from 1)
2787
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2804
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2788
    IDE0 (Primary Master), IDE1 (Primary Slave),
2805
    IDE0 (Primary Master), IDE1 (Primary Slave),
2789
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2806
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2790
    x - partition number on the selected hard drive, varies from 1
2807
    x - partition number on the selected hard drive, varies from 1
2791
    to 255 (on each hard drive the indexing starts from 1)
2808
    to 255 (on each hard drive the indexing starts from 1)
2792
Remarks:
2809
Remarks:
2793
  * In the first two cases it is also possible to use FIRST
2810
  * In the first two cases it is also possible to use FIRST
2794
    instead of 1, SECOND instead of 2, but it is not recommended
2811
    instead of 1, SECOND instead of 2, but it is not recommended
2795
    for convenience of transition to the future extensions.
2812
    for convenience of transition to the future extensions.
2796
  * Limitation n<=39 is imposed.
2813
  * Limitation n<=39 is imposed.
2797
  * Names of folders and file dir1,...,dirn,file must have the
2814
  * Names of folders and file dir1,...,dirn,file must have the
2798
    format 8.3: name no more than 8 characters, dot, extension no
2815
    format 8.3: name no more than 8 characters, dot, extension no
2799
    more than 3 characters. Trailing spaces are ignored, no other
2816
    more than 3 characters. Trailing spaces are ignored, no other
2800
    spaces is allowed. If name occupies equally 8 characters,
2817
    spaces is allowed. If name occupies equally 8 characters,
2801
    dot may be omitted (though it is not recommended to use this
2818
    dot may be omitted (though it is not recommended to use this
2802
    feature for convenience of transition to the future extensions).
2819
    feature for convenience of transition to the future extensions).
2803
  * This function does not support folders on ramdisk.
2820
  * This function does not support folders on ramdisk.
2804
Examples:
2821
Examples:
2805
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2822
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2806
    '/rd/1/kernel.asm',0
2823
    '/rd/1/kernel.asm',0
2807
  * '/HD0/1/kernel.asm',0
2824
  * '/HD0/1/kernel.asm',0
2808
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2825
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2809
Existing subfunctions:
2826
Existing subfunctions:
2810
  * subfunction 0 - read file/folder
2827
  * subfunction 0 - read file/folder
2811
  * subfunction 8 - LBA-read from device
2828
  * subfunction 8 - LBA-read from device
2812
  * subfunction 15 - get file system information
2829
  * subfunction 15 - get file system information
2813
 
2830
 
2814
======================================================================
2831
======================================================================
2815
=========== Function 58, subfunction 0 - read file/folder. ===========
2832
=========== Function 58, subfunction 0 - read file/folder. ===========
2816
======================================================================
2833
======================================================================
2817
Parameters:
2834
Parameters:
2818
  * eax = 58
2835
  * eax = 58
2819
  * ebx = pointer to the information structure
2836
  * ebx = pointer to the information structure
2820
Format of the information structure:
2837
Format of the information structure:
2821
  * +0: dword: 0 = subfunction number
2838
  * +0: dword: 0 = subfunction number
2822
  * +4: dword: first block to read (beginning from 0)
2839
  * +4: dword: first block to read (beginning from 0)
2823
  * +8: dword: amount of blocks to read
2840
  * +8: dword: amount of blocks to read
2824
  * +12 = +0xC: dword: pointer to buffer for data
2841
  * +12 = +0xC: dword: pointer to buffer for data
2825
  * +16 = +0x10: dword: pointer to buffer for system operations
2842
  * +16 = +0x10: dword: pointer to buffer for system operations
2826
    (4096 bytes)
2843
    (4096 bytes)
2827
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2844
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2828
    given in the general description
2845
    given in the general description
2829
Returned value:
2846
Returned value:
2830
  * eax = 0 - success, otherwise file system error code
2847
  * eax = 0 - success, otherwise file system error code
2831
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2848
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2832
Remarks:
2849
Remarks:
2833
  * Block size is 512 bytes.
2850
  * Block size is 512 bytes.
2834
  * This function is obsolete, for reading files use subfunction 0
2851
  * This function is obsolete, for reading files use subfunction 0
2835
    of function 70, for reading folders - subfunction 1 of
2852
    of function 70, for reading folders - subfunction 1 of
2836
    function 70.
2853
    function 70.
2837
  * Function can read contents of a folder. Only FAT file system is
2854
  * Function can read contents of a folder. Only FAT file system is
2838
    supported. The format of FAT-folder is described
2855
    supported. The format of FAT-folder is described
2839
    in any FAT documentation.
2856
    in any FAT documentation.
2840
  * Size of a folder is determined by size of FAT clusters chain.
2857
  * Size of a folder is determined by size of FAT clusters chain.
2841
  * If file was ended before last requested block was read,
2858
  * If file was ended before last requested block was read,
2842
    the function will read as many as it can, and after that return
2859
    the function will read as many as it can, and after that return
2843
    eax=6 (EOF).
2860
    eax=6 (EOF).
2844
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2861
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2845
    in the first two cases the current implementation does not follow
2862
    in the first two cases the current implementation does not follow
2846
    to the declared rules:
2863
    to the declared rules:
2847
    for /rd/1:
2864
    for /rd/1:
2848
    * if one want to read 0 blocks, function considers,
2865
    * if one want to read 0 blocks, function considers,
2849
      that he requested 1;
2866
      that he requested 1;
2850
    * if one requests more than 14 blocks or starting block is
2867
    * if one requests more than 14 blocks or starting block is
2851
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2868
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2852
    * size of ramdisk root folder is 14 blocks,
2869
    * size of ramdisk root folder is 14 blocks,
2853
      0x1C00=7168 áàéò; but function returns ebx=0
2870
      0x1C00=7168 áàéò; but function returns ebx=0
2854
      (except of the case of previous item);
2871
      (except of the case of previous item);
2855
    * strangely enough, it is possible to read 14th block (which
2872
    * strangely enough, it is possible to read 14th block (which
2856
      generally contains a garbage - I remind, the indexing begins
2873
      generally contains a garbage - I remind, the indexing begins
2857
      from 0);
2874
      from 0);
2858
    * if some block with the number not less than 14 was requested,
2875
    * if some block with the number not less than 14 was requested,
2859
      function returns eax=6(EOF); otherwise eax=0.
2876
      function returns eax=6(EOF); otherwise eax=0.
2860
    For /fd/x:
2877
    For /fd/x:
2861
    * if the start block is not less than 14, function returns
2878
    * if the start block is not less than 14, function returns
2862
      eax=5 (not found) and ebx=0;
2879
      eax=5 (not found) and ebx=0;
2863
    * note that format of FAT12 allows floppies with the root size
2880
    * note that format of FAT12 allows floppies with the root size
2864
      more or less than 14 blocks;
2881
      more or less than 14 blocks;
2865
    * check for length is not performed;
2882
    * check for length is not performed;
2866
    * if data was successful read, function returns
2883
    * if data was successful read, function returns
2867
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2884
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2868
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2885
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2869
    but the result does not correspond to expected (on operations with
2886
    but the result does not correspond to expected (on operations with
2870
    normal files/folders), does not follow the declared rules,
2887
    normal files/folders), does not follow the declared rules,
2871
    may be changed in future versions of the kernel and consequently
2888
    may be changed in future versions of the kernel and consequently
2872
    is not described. To obtain the information about the equipment
2889
    is not described. To obtain the information about the equipment
2873
    use subfunction 11 of function 18 or
2890
    use subfunction 11 of function 18 or
2874
    read corresponding folder with subfunction 1 of function 70.
2891
    read corresponding folder with subfunction 1 of function 70.
2875
 
2892
 
2876
======================================================================
2893
======================================================================
2877
========= Function 58, subfunction 8 - LBA-read from device. =========
2894
========= Function 58, subfunction 8 - LBA-read from device. =========
2878
======================================================================
2895
======================================================================
2879
Parameters:
2896
Parameters:
2880
  * eax = 58 - function number
2897
  * eax = 58 - function number
2881
  * ebx = pointer to the information structure
2898
  * ebx = pointer to the information structure
2882
Format of the information structure:
2899
Format of the information structure:
2883
  * +0: dword: 8 = subfunction number
2900
  * +0: dword: 8 = subfunction number
2884
  * +4: dword: number of block to read (beginning from 0)
2901
  * +4: dword: number of block to read (beginning from 0)
2885
  * +8: dword: ignored (set to 1)
2902
  * +8: dword: ignored (set to 1)
2886
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
2903
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
2887
  * +16 = +0x10: dword: pointer to buffer for system operations
2904
  * +16 = +0x10: dword: pointer to buffer for system operations
2888
    (4096 bytes)
2905
    (4096 bytes)
2889
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
2906
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
2890
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
2907
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
2891
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
2908
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
2892
    Instead of digits it is allowed, though not recommended for
2909
    Instead of digits it is allowed, though not recommended for
2893
    convenience of transition to future extensions, to use
2910
    convenience of transition to future extensions, to use
2894
    'first','second','third','fourth'.
2911
    'first','second','third','fourth'.
2895
Returned value:
2912
Returned value:
2896
  * for device name /hd/xxx, where xxx is not in the list above:
2913
  * for device name /hd/xxx, where xxx is not in the list above:
2897
    * eax = ebx = 1
2914
    * eax = ebx = 1
2898
  * for invalid device name (except for the previous case):
2915
  * for invalid device name (except for the previous case):
2899
    * eax = 5
2916
    * eax = 5
2900
    * ebx does not change
2917
    * ebx does not change
2901
  * if LBA-access is disabled by subfunction 11 of function 21:
2918
  * if LBA-access is disabled by subfunction 11 of function 21:
2902
    * eax = 2
2919
    * eax = 2
2903
    * ebx destroyed
2920
    * ebx destroyed
2904
  * for ramdisk: attempt to read block outside ramdisk
2921
  * for ramdisk: attempt to read block outside ramdisk
2905
    (18*2*80 blocks) results in
2922
    (18*2*80 blocks) results in
2906
    * eax = 3
2923
    * eax = 3
2907
    * ebx = 0
2924
    * ebx = 0
2908
  * for successful read:
2925
  * for successful read:
2909
    * eax = ebx = 0
2926
    * eax = ebx = 0
2910
Remarks:
2927
Remarks:
2911
  * Block size is 512 bytes; function reads one block.
2928
  * Block size is 512 bytes; function reads one block.
2912
  * Do not depend on returned value, it can be changed
2929
  * Do not depend on returned value, it can be changed
2913
    in future versions.
2930
    in future versions.
2914
  * Function requires that LBA-access to devices is enabled by
2931
  * Function requires that LBA-access to devices is enabled by
2915
    subfunction 11 of function 21. To check this one can use
2932
    subfunction 11 of function 21. To check this one can use
2916
    subfunction 11 of function 26.
2933
    subfunction 11 of function 26.
2917
  * LBA-read of floppy is not supported.
2934
  * LBA-read of floppy is not supported.
2918
  * Function reads data on physical hard drive; if for any reason
2935
  * Function reads data on physical hard drive; if for any reason
2919
    data of the concrete partition are required, application must
2936
    data of the concrete partition are required, application must
2920
    define starting sector of this partition (either directly
2937
    define starting sector of this partition (either directly
2921
    through MBR, or from the full structure returned by
2938
    through MBR, or from the full structure returned by
2922
    ïîäôóíêöèåé 11 ôóíêöèè 18).
2939
    ïîäôóíêöèåé 11 ôóíêöèè 18).
2923
  * Function does not check error code of hard disk, so request of
2940
  * Function does not check error code of hard disk, so request of
2924
    nonexisting sector reads something (most probably it will be
2941
    nonexisting sector reads something (most probably it will be
2925
    zeroes, but this is defined by device) and this is considered
2942
    zeroes, but this is defined by device) and this is considered
2926
    as success (eax=0).
2943
    as success (eax=0).
2927
 
2944
 
2928
======================================================================
2945
======================================================================
2929
==== Function 58, subfunction 15 - get information on file system. ===
2946
==== Function 58, subfunction 15 - get information on file system. ===
2930
======================================================================
2947
======================================================================
2931
Parameters:
2948
Parameters:
2932
  * eax = 58 - function number
2949
  * eax = 58 - function number
2933
  * ebx = pointer to the information structure
2950
  * ebx = pointer to the information structure
2934
Format of the information structure:
2951
Format of the information structure:
2935
  * +0: dword: 15 = subfunction number
2952
  * +0: dword: 15 = subfunction number
2936
  * +4: dword: ignored
2953
  * +4: dword: ignored
2937
  * +8: dword: ignored
2954
  * +8: dword: ignored
2938
  * +12 = +0xC: dword: ignored
2955
  * +12 = +0xC: dword: ignored
2939
  * +16 = +0x10: dword: ignored
2956
  * +16 = +0x10: dword: ignored
2940
  * +20 = +0x14: (only second character is checked)
2957
  * +20 = +0x14: (only second character is checked)
2941
    /rd=/RAMDISK or /hd=/HARDDISK
2958
    /rd=/RAMDISK or /hd=/HARDDISK
2942
Returned value:
2959
Returned value:
2943
  * if the second character does not belong to set {'r','R','h','H'}:
2960
  * if the second character does not belong to set {'r','R','h','H'}:
2944
    * eax = 3
2961
    * eax = 3
2945
    * ebx = ecx = dword [fileinfo] = 0
2962
    * ebx = ecx = dword [fileinfo] = 0
2946
  * for ramdisk:
2963
  * for ramdisk:
2947
    * eax = 0 (success)
2964
    * eax = 0 (success)
2948
    * ebx = total number of clusters = 2847
2965
    * ebx = total number of clusters = 2847
2949
    * ecx = number of free clusters
2966
    * ecx = number of free clusters
2950
    * dword [fileinfo] = cluster size = 512
2967
    * dword [fileinfo] = cluster size = 512
2951
  * for hard disk: base and partition are defined by subfunctions
2968
  * for hard disk: base and partition are defined by subfunctions
2952
    7 and 8 of function 21:
2969
    7 and 8 of function 21:
2953
    * eax = 0 (success)
2970
    * eax = 0 (success)
2954
    * ebx = total number of clusters
2971
    * ebx = total number of clusters
2955
    * ecx = number of free clusters
2972
    * ecx = number of free clusters
2956
    * dword [fileinfo] = cluster size (in bytes)
2973
    * dword [fileinfo] = cluster size (in bytes)
2957
Remarks:
2974
Remarks:
2958
  * Be not surprised to strange layout of 4th returned parameter
2975
  * Be not surprised to strange layout of 4th returned parameter
2959
    - when this code was writing, at system calls application got
2976
    - when this code was writing, at system calls application got
2960
    only registers eax,ebx,ecx (from pushad-structure transmitted
2977
    only registers eax,ebx,ecx (from pushad-structure transmitted
2961
    as argument to the system function). Now it is corrected, so,
2978
    as argument to the system function). Now it is corrected, so,
2962
    probably, it is meaningful to return cluster size in edx, while
2979
    probably, it is meaningful to return cluster size in edx, while
2963
    this function is not used yet.
2980
    this function is not used yet.
2964
  * There exists also subfunction 11 of function 18,
2981
  * There exists also subfunction 11 of function 18,
2965
    which returns information on file system. From the full table
2982
    which returns information on file system. From the full table
2966
    of disk subsystem it is possible to deduce cluster size (there
2983
    of disk subsystem it is possible to deduce cluster size (there
2967
    it is stored in sectors) and total number of clusters
2984
    it is stored in sectors) and total number of clusters
2968
    for hard disks.
2985
    for hard disks.
2969
 
2986
 
2970
======================================================================
2987
======================================================================
2971
========== Function 60 - Inter Process Communication (IPC). ==========
2988
========== Function 60 - Inter Process Communication (IPC). ==========
2972
======================================================================
2989
======================================================================
2973
IPC is used for message dispatching from one process/thread to
2990
IPC is used for message dispatching from one process/thread to
2974
another. Previously it is necessary to agree how to interpret
2991
another. Previously it is necessary to agree how to interpret
2975
the concrete message.
2992
the concrete message.
2976
 
2993
 
2977
----------- Subfunction 1 - set the area for IPC receiving -----------
2994
----------- Subfunction 1 - set the area for IPC receiving -----------
2978
Is called by process-receiver.
2995
Is called by process-receiver.
2979
Parameters:
2996
Parameters:
2980
  * eax = 60 - function number
2997
  * eax = 60 - function number
2981
  * ebx = 1 - subfunction number
2998
  * ebx = 1 - subfunction number
2982
  * ecx = pointer to the buffer
2999
  * ecx = pointer to the buffer
2983
  * edx = size of the buffer
3000
  * edx = size of the buffer
2984
Returned value:
3001
Returned value:
2985
  * eax = 0 - always success
3002
  * eax = 0 - always success
2986
Format of IPC-buffer:
3003
Format of IPC-buffer:
2987
  * +0: dword: if nonzero, buffer is considered locked;
3004
  * +0: dword: if nonzero, buffer is considered locked;
2988
    lock/unlock the buffer, when you work with it and need that
3005
    lock/unlock the buffer, when you work with it and need that
2989
    buffer data are not changed from outside (no new messages)
3006
    buffer data are not changed from outside (no new messages)
2990
  * +4: dword: occupied place in the buffer (in bytes)
3007
  * +4: dword: occupied place in the buffer (in bytes)
2991
  * +8: first message
3008
  * +8: first message
2992
  * +8+n: second message
3009
  * +8+n: second message
2993
  * ...
3010
  * ...
2994
Format of a message:
3011
Format of a message:
2995
  * +0: dword: PID of sender
3012
  * +0: dword: PID of sender
2996
  * +4: dword: message length (not including this header)
3013
  * +4: dword: message length (not including this header)
2997
  * +8: n*byte: message data
3014
  * +8: n*byte: message data
2998
 
3015
 
2999
------------------ Subfunction 2 - send IPC message ------------------
3016
------------------ Subfunction 2 - send IPC message ------------------
3000
Is called by process-sender.
3017
Is called by process-sender.
3001
Parameters:
3018
Parameters:
3002
  * eax = 60 - function number
3019
  * eax = 60 - function number
3003
  * ebx = 2 - subfunction number
3020
  * ebx = 2 - subfunction number
3004
  * ecx = PID of receiver
3021
  * ecx = PID of receiver
3005
  * edx = pointer to the message data
3022
  * edx = pointer to the message data
3006
  * esi = message length (in bytes)
3023
  * esi = message length (in bytes)
3007
Returned value:
3024
Returned value:
3008
  * eax = 0 - success
3025
  * eax = 0 - success
3009
  * eax = 1 - the receiver has not defined buffer for IPC messages
3026
  * eax = 1 - the receiver has not defined buffer for IPC messages
3010
    (can be, still have no time,
3027
    (can be, still have no time,
3011
    and can be, this is not right process)
3028
    and can be, this is not right process)
3012
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3029
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3013
  * eax = 3 - overflow of IPC-buffer of the receiver
3030
  * eax = 3 - overflow of IPC-buffer of the receiver
3014
  * eax = 4 - process/thread with such PID does not exist
3031
  * eax = 4 - process/thread with such PID does not exist
3015
Remarks:
3032
Remarks:
3016
  * Immediately after writing of IPC-message to the buffer the system
3033
  * Immediately after writing of IPC-message to the buffer the system
3017
    sends to the receiver the event with code 7 (see event codes).
3034
    sends to the receiver the event with code 7 (see event codes).
3018
 
3035
 
3019
======================================================================
3036
======================================================================
3020
==== Function 61 - get parameters for the direct graphics access. ====
3037
==== Function 61 - get parameters for the direct graphics access. ====
3021
======================================================================
3038
======================================================================
3022
The data of the graphics screen (the memory area which displays
3039
The data of the graphics screen (the memory area which displays
3023
screen contents) are accessible to a program directly, without
3040
screen contents) are accessible to a program directly, without
3024
any system calls, through the selector gs:
3041
any system calls, through the selector gs:
3025
	mov	eax, [gs:0]
3042
	mov	eax, [gs:0]
3026
places in eax the first dword of the buffer, which contains
3043
places in eax the first dword of the buffer, which contains
3027
information on color of the left upper point (and, possibly, colors
3044
information on color of the left upper point (and, possibly, colors
3028
of several following).
3045
of several following).
3029
	mov	[gs:0], eax
3046
	mov	[gs:0], eax
3030
by work in VESA modes with LFB sets color of the left upper point
3047
by work in VESA modes with LFB sets color of the left upper point
3031
(and, possibly, colors of several following).
3048
(and, possibly, colors of several following).
3032
To interpret the data of graphics screen program needs to know
3049
To interpret the data of graphics screen program needs to know
3033
some parameters, returning by this function.
3050
some parameters, returning by this function.
3034
Remarks:
3051
Remarks:
3035
  * Graphics parameters changes very seldom at work,
3052
  * Graphics parameters changes very seldom at work,
3036
    namely, only in cases, when user works with the application VRR.
3053
    namely, only in cases, when user works with the application VRR.
3037
  * At videomode change the system redraws all windows (event
3054
  * At videomode change the system redraws all windows (event
3038
    with code 1) and redraws the background (event 5).
3055
    with code 1) and redraws the background (event 5).
3039
    Same events occur in other cases too, which meet much more often,
3056
    Same events occur in other cases too, which meet much more often,
3040
    than videomode change.
3057
    than videomode change.
3041
  * By operation in videomodes with LFB the selector gs points to
3058
  * By operation in videomodes with LFB the selector gs points to
3042
    LFB itself, so reading/writing on gs result directly in
3059
    LFB itself, so reading/writing on gs result directly in
3043
    change of screen contents. By operation in videomodes without
3060
    change of screen contents. By operation in videomodes without
3044
    LFB gs points to some data area in the kernel, and all functions
3061
    LFB gs points to some data area in the kernel, and all functions
3045
    of screen output fulfil honesty double operation on writing
3062
    of screen output fulfil honesty double operation on writing
3046
    directly to the screen and writing to this buffer. In result
3063
    directly to the screen and writing to this buffer. In result
3047
    at reading contents of this buffer the results correspond to
3064
    at reading contents of this buffer the results correspond to
3048
    screen contents (with, generally speaking, large color
3065
    screen contents (with, generally speaking, large color
3049
    resolution), and writing is ignored.
3066
    resolution), and writing is ignored.
3050
    One exception is the mode 320*200, for which main loop of the
3067
    One exception is the mode 320*200, for which main loop of the
3051
    system thread updates the screen according to mouse movements.
3068
    system thread updates the screen according to mouse movements.
3052
 
3069
 
3053
------------------------- Screen resolution --------------------------
3070
------------------------- Screen resolution --------------------------
3054
Parameters:
3071
Parameters:
3055
  * eax = 61 - function number
3072
  * eax = 61 - function number
3056
  * ebx = 1 - subfunction number
3073
  * ebx = 1 - subfunction number
3057
Returned value:
3074
Returned value:
3058
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3075
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3059
Remarks:
3076
Remarks:
3060
  * One can use function 14 paying attention that
3077
  * One can use function 14 paying attention that
3061
    it returns sizes on 1 pixel less. It is fully equivalent way.
3078
    it returns sizes on 1 pixel less. It is fully equivalent way.
3062
 
3079
 
3063
---------------------- Number of bits per pixel ----------------------
3080
---------------------- Number of bits per pixel ----------------------
3064
Parameters:
3081
Parameters:
3065
  * eax = 61 - function number
3082
  * eax = 61 - function number
3066
  * ebx = 2 - subfunction number
3083
  * ebx = 2 - subfunction number
3067
Returned value:
3084
Returned value:
3068
  * eax = number of bits per pixel (24 or 32)
3085
  * eax = number of bits per pixel (24 or 32)
3069
 
3086
 
3070
-------------------- Number of bytes per scanline --------------------
3087
-------------------- Number of bytes per scanline --------------------
3071
Parameters:
3088
Parameters:
3072
  * eax = 61 - function number
3089
  * eax = 61 - function number
3073
  * ebx = 3 - subfunction number
3090
  * ebx = 3 - subfunction number
3074
Returned value:
3091
Returned value:
3075
  * eax = number of bytes occupied by one scanline
3092
  * eax = number of bytes occupied by one scanline
3076
    (horizontal line on the screen)
3093
    (horizontal line on the screen)
3077
 
3094
 
3078
======================================================================
3095
======================================================================
3079
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3096
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3080
======================================================================
3097
======================================================================
3081
Parameters:
3098
Parameters:
3082
  * eax = 62 - function number
3099
  * eax = 62 - function number
3083
  * bl = 0 - subfunction number
3100
  * bl = 0 - subfunction number
3084
Returned value:
3101
Returned value:
3085
  * eax = -1 - PCI access is disabled; otherwise
3102
  * eax = -1 - PCI access is disabled; otherwise
3086
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3103
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3087
  * high word of eax is zeroed
3104
  * high word of eax is zeroed
3088
Remarks:
3105
Remarks:
3089
  * Previously low-level access to PCI for applications must be
3106
  * Previously low-level access to PCI for applications must be
3090
    enabled by subfunction 12 of function 21.
3107
    enabled by subfunction 12 of function 21.
3091
  * If PCI BIOS is not supported, the value of ax is undefined.
3108
  * If PCI BIOS is not supported, the value of ax is undefined.
3092
 
3109
 
3093
======================================================================
3110
======================================================================
3094
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3111
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3095
======================================================================
3112
======================================================================
3096
Parameters:
3113
Parameters:
3097
  * eax = 62 - function number
3114
  * eax = 62 - function number
3098
  * bl = 1 - subfunction number
3115
  * bl = 1 - subfunction number
3099
Returned value:
3116
Returned value:
3100
  * eax = -1 - access to PCI is disabled; otherwise
3117
  * eax = -1 - access to PCI is disabled; otherwise
3101
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3118
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3102
Remarks:
3119
Remarks:
3103
  * Previously low-level access to PCI for applications must be
3120
  * Previously low-level access to PCI for applications must be
3104
    enabled by subfunction 12 of function 21.
3121
    enabled by subfunction 12 of function 21.
3105
  * If PCI BIOS is not supported, the value of ax is undefined.
3122
  * If PCI BIOS is not supported, the value of ax is undefined.
3106
 
3123
 
3107
======================================================================
3124
======================================================================
3108
===================== Function 62, subfunction 2 =====================
3125
===================== Function 62, subfunction 2 =====================
3109
===== Get mechanism of addressing to the PCI configuration space. ====
3126
===== Get mechanism of addressing to the PCI configuration space. ====
3110
======================================================================
3127
======================================================================
3111
Parameters:
3128
Parameters:
3112
  * eax = 62 - function number
3129
  * eax = 62 - function number
3113
  * bl = 2 - subfunction number
3130
  * bl = 2 - subfunction number
3114
Returned value:
3131
Returned value:
3115
  * eax = -1 - access to PCI is disabled; otherwise
3132
  * eax = -1 - access to PCI is disabled; otherwise
3116
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3133
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3117
Remarks:
3134
Remarks:
3118
  * Previously low-level access to PCI for applications must be
3135
  * Previously low-level access to PCI for applications must be
3119
    enabled by subfunction 12 of function 21.
3136
    enabled by subfunction 12 of function 21.
3120
  * Addressing mechanism is selected depending on
3137
  * Addressing mechanism is selected depending on
3121
    equipment characteristics.
3138
    equipment characteristics.
3122
  * Subfunctions of read and write work automatically
3139
  * Subfunctions of read and write work automatically
3123
    with the selected mechanism.
3140
    with the selected mechanism.
3124
 
3141
 
3125
======================================================================
3142
======================================================================
3126
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3143
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3127
======================================================================
3144
======================================================================
3128
Parameters:
3145
Parameters:
3129
  * eax = 62 - function number
3146
  * eax = 62 - function number
3130
  * bl = 4 - read byte
3147
  * bl = 4 - read byte
3131
  * bl = 5 - read word
3148
  * bl = 5 - read word
3132
  * bl = 6 - read dword
3149
  * bl = 6 - read dword
3133
  * bh = number of PCI-bus
3150
  * bh = number of PCI-bus
3134
  * ch = dddddfff, where ddddd = number of the device on the bus,
3151
  * ch = dddddfff, where ddddd = number of the device on the bus,
3135
    fff = function number of device
3152
    fff = function number of device
3136
  * cl = number of register (must be even for bl=5,
3153
  * cl = number of register (must be even for bl=5,
3137
    divisible by 4 for bl=6)
3154
    divisible by 4 for bl=6)
3138
Returned value:
3155
Returned value:
3139
  * eax = -1 - error (access to PCI is disabled or parameters
3156
  * eax = -1 - error (access to PCI is disabled or parameters
3140
    are not supported); otherwise
3157
    are not supported); otherwise
3141
  * al/ax/eax (depending on requested size) contains the data;
3158
  * al/ax/eax (depending on requested size) contains the data;
3142
    the other part of register eax is destroyed
3159
    the other part of register eax is destroyed
3143
Remarks:
3160
Remarks:
3144
  * Previously low-level access to PCI for applications must be
3161
  * Previously low-level access to PCI for applications must be
3145
    enabled by subfunction 12 of function 21.
3162
    enabled by subfunction 12 of function 21.
3146
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3163
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3147
    function number. To get access mechanism use subfunction 2.
3164
    function number. To get access mechanism use subfunction 2.
3148
  * Some registers are standard and exist for all devices, some are
3165
  * Some registers are standard and exist for all devices, some are
3149
    defined by the concrete device. The list of registers of the
3166
    defined by the concrete device. The list of registers of the
3150
    first type can be found e.g. in famous
3167
    first type can be found e.g. in famous
3151
    Interrupt List by Ralf Brown
3168
    Interrupt List by Ralf Brown
3152
    (http://www.pobox.com/~ralf/files.html,
3169
    (http://www.pobox.com/~ralf/files.html,
3153
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3170
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3154
    registers of the second type must be listed
3171
    registers of the second type must be listed
3155
    in the device documentation.
3172
    in the device documentation.
3156
 
3173
 
3157
======================================================================
3174
======================================================================
3158
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3175
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3159
======================================================================
3176
======================================================================
3160
Parameters:
3177
Parameters:
3161
  * eax = 62 - function number
3178
  * eax = 62 - function number
3162
  * bl = 8 - write byte
3179
  * bl = 8 - write byte
3163
  * bl = 9 - write word
3180
  * bl = 9 - write word
3164
  * bl = 10 - write dword
3181
  * bl = 10 - write dword
3165
  * bh = number of PCI-bus
3182
  * bh = number of PCI-bus
3166
  * ch = dddddfff, where ddddd = number of the device on the bus,
3183
  * ch = dddddfff, where ddddd = number of the device on the bus,
3167
    fff = function number of device
3184
    fff = function number of device
3168
  * cl = number of register (must be even for bl=9,
3185
  * cl = number of register (must be even for bl=9,
3169
    divisible by 4 for bl=10)
3186
    divisible by 4 for bl=10)
3170
  * dl/dx/edx (depending on requested size) contatins
3187
  * dl/dx/edx (depending on requested size) contatins
3171
    the data to write
3188
    the data to write
3172
Returned value:
3189
Returned value:
3173
  * eax = -1 - error (access to PCI is disabled or parameters
3190
  * eax = -1 - error (access to PCI is disabled or parameters
3174
    are not supported)
3191
    are not supported)
3175
  * eax = 0 - success
3192
  * eax = 0 - success
3176
Remarks:
3193
Remarks:
3177
  * Previously low-level access to PCI for applications must be
3194
  * Previously low-level access to PCI for applications must be
3178
    enabled by subfunction 12 of function 21.
3195
    enabled by subfunction 12 of function 21.
3179
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3196
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3180
    function number. To get access mechanism use subfunction 2.
3197
    function number. To get access mechanism use subfunction 2.
3181
  * Some registers are standard and exist for all devices, some are
3198
  * Some registers are standard and exist for all devices, some are
3182
    defined by the concrete device. The list of registers of the
3199
    defined by the concrete device. The list of registers of the
3183
    first type can be found e.g. in famous Interrupt List by
3200
    first type can be found e.g. in famous Interrupt List by
3184
    Ralf Brown; registers of the second type must be listed
3201
    Ralf Brown; registers of the second type must be listed
3185
    in the device documentation.
3202
    in the device documentation.
3186
 
3203
 
3187
======================================================================
3204
======================================================================
3188
============== Function 63 - work with the debug board. ==============
3205
============== Function 63 - work with the debug board. ==============
3189
======================================================================
3206
======================================================================
3190
The debug board is the global system buffer (with the size
3207
The debug board is the global system buffer (with the size
3191
1024 bytes), to which any program can write (generally speaking,
3208
1024 bytes), to which any program can write (generally speaking,
3192
arbitrary) data and from which other program can read these data.
3209
arbitrary) data and from which other program can read these data.
3193
By the agreement written data are text strings interpreted as
3210
By the agreement written data are text strings interpreted as
3194
debug messages on a course of program execution. The kernel in
3211
debug messages on a course of program execution. The kernel in
3195
some situations also writes to the debug board information on
3212
some situations also writes to the debug board information on
3196
execution of some functions; by the agreement kernel messages
3213
execution of some functions; by the agreement kernel messages
3197
begins from the prefix "K : ".
3214
begins from the prefix "K : ".
3198
For view of the debug board the application 'board' was created,
3215
For view of the debug board the application 'board' was created,
3199
which reads data from the buffer and displays them in its window.
3216
which reads data from the buffer and displays them in its window.
3200
'board' interpretes the sequence of codes 13,10 as newline.
3217
'board' interpretes the sequence of codes 13,10 as newline.
3201
A character with null code in an end of line is not necessary,
3218
A character with null code in an end of line is not necessary,
3202
but also does not prevent.
3219
but also does not prevent.
3203
Because debugger has been written, the value of the debug board
3220
Because debugger has been written, the value of the debug board
3204
has decreased, as debugger allows to inspect completely a course of
3221
has decreased, as debugger allows to inspect completely a course of
3205
program execution without any efforts from the direction of program
3222
program execution without any efforts from the direction of program
3206
itself. Nevertheless in some cases the debug board is still useful.
3223
itself. Nevertheless in some cases the debug board is still useful.
3207
 
3224
 
3208
----------------------------- Write byte -----------------------------
3225
----------------------------- Write byte -----------------------------
3209
Parameters:
3226
Parameters:
3210
  * eax = 63 - function number
3227
  * eax = 63 - function number
3211
  * ebx = 1 - subfunction number
3228
  * ebx = 1 - subfunction number
3212
  * cl = data byte
3229
  * cl = data byte
3213
Returned value:
3230
Returned value:
3214
  * function does not return value
3231
  * function does not return value
3215
Remarks:
3232
Remarks:
3216
  * Byte is written to the buffer. Buffer size is 512 bytes.
3233
  * Byte is written to the buffer. Buffer size is 512 bytes.
3217
    At buffer overflow all obtained data are lost.
3234
    At buffer overflow all obtained data are lost.
3218
  * For output to the debug board of more complicated objects
3235
  * For output to the debug board of more complicated objects
3219
    (strings, numbers) it is enough to call this function in cycle.
3236
    (strings, numbers) it is enough to call this function in cycle.
3220
    It is possible not to write the appropriate code manually and use
3237
    It is possible not to write the appropriate code manually and use
3221
    file 'debug.inc', which is included into the distributive.
3238
    file 'debug.inc', which is included into the distributive.
3222
 
3239
 
3223
----------------------------- Read byte ------------------------------
3240
----------------------------- Read byte ------------------------------
3224
Takes away byte from the buffer.
3241
Takes away byte from the buffer.
3225
Parameters:
3242
Parameters:
3226
  * eax = 63 - function number
3243
  * eax = 63 - function number
3227
  * ebx = 2 - subfunction number
3244
  * ebx = 2 - subfunction number
3228
Returned value:
3245
Returned value:
3229
  * eax = ebx = 0 - the buffer is empty
3246
  * eax = ebx = 0 - the buffer is empty
3230
  * eax = byte, ebx = 1 - byte was successfully read
3247
  * eax = byte, ebx = 1 - byte was successfully read
3231
 
3248
 
3232
======================================================================
3249
======================================================================
3233
============== Function 64 - resize application memory. ==============
3250
============== Function 64 - resize application memory. ==============
3234
======================================================================
3251
======================================================================
3235
Parameters:
3252
Parameters:
3236
  * eax = 64 - function number
3253
  * eax = 64 - function number
3237
  * ebx = 1 - unique subfunction
3254
  * ebx = 1 - unique subfunction
3238
  * ecx = new memory size
3255
  * ecx = new memory size
3239
Returned value:
3256
Returned value:
3240
  * eax = 0 - success
3257
  * eax = 0 - success
3241
  * eax = 1 - not enough memory
3258
  * eax = 1 - not enough memory
3242
Remarks:
3259
Remarks:
3243
  * There is another way to dynamically allocate/free memory -
3260
  * There is another way to dynamically allocate/free memory -
3244
    subfunctions 11, 12, 13 of function 68.
3261
    subfunctions 11, 12, 13 of function 68.
3245
  * The function cannot be used together with 68.11, 68.12, 68.13.
3262
  * The function cannot be used together with 68.11, 68.12, 68.13.
3246
    The function call will be ignored after creation of process heap
3263
    The function call will be ignored after creation of process heap
3247
    with function 68.11.
3264
    with function 68.11.
3248
 
3265
 
3249
======================================================================
3266
======================================================================
3250
======== Function 65 - draw image with palette in the window. ========
3267
======== Function 65 - draw image with palette in the window. ========
3251
======================================================================
3268
======================================================================
3252
Parameters:
3269
Parameters:
3253
  * eax = 65 - function number
3270
  * eax = 65 - function number
3254
  * ebx = pointer to the image
3271
  * ebx = pointer to the image
3255
  * ecx = [size on axis x]*65536 + [size on axis y]
3272
  * ecx = [size on axis x]*65536 + [size on axis y]
3256
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3273
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3257
  * esi = number of bits per pixel, must be 1,2,4,8,15,16,24 or 32
3274
  * esi = number of bits per pixel, must be 1,2,4,8,15,16,24 or 32
3258
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
3275
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
3259
          ignored when esi > 8
3276
          ignored when esi > 8
3260
  * ebp = offset of next row data relative to previous row data
3277
  * ebp = offset of next row data relative to previous row data
3261
Returned value:
3278
Returned value:
3262
  * function does not return value
3279
  * function does not return value
3263
Remarks:
3280
Remarks:
3264
  * Coordinates of the image are coordinates of the upper left corner
3281
  * Coordinates of the image are coordinates of the upper left corner
3265
    of the image relative to the window.
3282
    of the image relative to the window.
3266
  * Format of image with 1 bit per pixel: each byte of image
3283
  * Format of image with 1 bit per pixel: each byte of image
3267
    (possibly excluding last bytes in rows), contains information on
3284
    (possibly excluding last bytes in rows), contains information on
3268
    the color of 8 pixels, MSB corresponds to first pixel.
3285
    the color of 8 pixels, MSB corresponds to first pixel.
3269
  * Format of image with 2 bits per pixel: each byte of image
3286
  * Format of image with 2 bits per pixel: each byte of image
3270
    (possibly excluding last bytes in rows), contains information on
3287
    (possibly excluding last bytes in rows), contains information on
3271
    the color of 4 pixels, two MSBs correspond to first pixel.
3288
    the color of 4 pixels, two MSBs correspond to first pixel.
3272
  * Format of image with 4 bits per pixel: each byte of image
3289
  * Format of image with 4 bits per pixel: each byte of image
3273
    excluding last bytes in rows (if width is odd) contains
3290
    excluding last bytes in rows (if width is odd) contains
3274
    information on the color of 2 pixels, high-order tetrad
3291
    information on the color of 2 pixels, high-order tetrad
3275
    corresponds to first pixel.
3292
    corresponds to first pixel.
3276
  * Format of image with 8 bits per pixel: each byte of image is
3293
  * Format of image with 8 bits per pixel: each byte of image is
3277
    index in the palette.
3294
    index in the palette.
3278
  * Format of image with 15 bits per pixel: the color of each pixel
3295
  * Format of image with 15 bits per pixel: the color of each pixel
3279
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
3296
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
3280
    each color.
3297
    each color.
3281
  * Format of image with 16 bits per pixel: the color of each pixel
3298
  * Format of image with 16 bits per pixel: the color of each pixel
3282
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
3299
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
3283
  * Format of image with 24 bits per pixel: the color of each pixel
3300
  * Format of image with 24 bits per pixel: the color of each pixel
3284
    is coded as 3 bytes - sequentially blue, green, red components.
3301
    is coded as 3 bytes - sequentially blue, green, red components.
3285
  * Format of image with 32 bits per pixel: similar to 24, but
3302
  * Format of image with 32 bits per pixel: similar to 24, but
3286
    one additional ignored byte is present.
3303
    one additional ignored byte is present.
3287
  * The call to function 7 is equivalent to call to this function
3304
  * The call to function 7 is equivalent to call to this function
3288
    with esi=24, ebp=0.
3305
    with esi=24, ebp=0.
3289
 
3306
 
3290
======================================================================
3307
======================================================================
3291
================== Function 66 - work with keyboard. =================
3308
================== Function 66 - work with keyboard. =================
3292
======================================================================
3309
======================================================================
3293
The input mode influences results of reading keys by function 2.
3310
The input mode influences results of reading keys by function 2.
3294
When a program loads, ASCII input mode is set for it.
3311
When a program loads, ASCII input mode is set for it.
3295
 
3312
 
3296
-------------- Subfunction 1 - set keyboard input mode. --------------
3313
-------------- Subfunction 1 - set keyboard input mode. --------------
3297
Parameters:
3314
Parameters:
3298
  * eax = 66 - function number
3315
  * eax = 66 - function number
3299
  * ebx = 1 - subfunction number
3316
  * ebx = 1 - subfunction number
3300
  * ecx = mode:
3317
  * ecx = mode:
3301
    * 0 = normal (ASCII-characters)
3318
    * 0 = normal (ASCII-characters)
3302
    * 1 = scancodes
3319
    * 1 = scancodes
3303
Returned value:
3320
Returned value:
3304
  * function does not return value
3321
  * function does not return value
3305
 
3322
 
3306
-------------- Subfunction 2 - get keyboard input mode. --------------
3323
-------------- Subfunction 2 - get keyboard input mode. --------------
3307
Parameters:
3324
Parameters:
3308
  * eax = 66 - function number
3325
  * eax = 66 - function number
3309
  * ebx = 2 - subfunction number
3326
  * ebx = 2 - subfunction number
3310
Returned value:
3327
Returned value:
3311
  * eax = current mode
3328
  * eax = current mode
3312
 
3329
 
3313
------------ Subfunction 3 - get status of control keys. -------------
3330
------------ Subfunction 3 - get status of control keys. -------------
3314
Parameters:
3331
Parameters:
3315
  * eax = 66 - function number
3332
  * eax = 66 - function number
3316
  * ebx = 3 - subfunction number
3333
  * ebx = 3 - subfunction number
3317
Returned value:
3334
Returned value:
3318
  * eax = bit mask:
3335
  * eax = bit mask:
3319
  * bit 0 (mask 1): left Shift is pressed
3336
  * bit 0 (mask 1): left Shift is pressed
3320
  * bit 1 (mask 2): right Shift is pressed
3337
  * bit 1 (mask 2): right Shift is pressed
3321
  * bit 2 (mask 4): left Ctrl is pressed
3338
  * bit 2 (mask 4): left Ctrl is pressed
3322
  * bit 3 (mask 8): right Ctrl is pressed
3339
  * bit 3 (mask 8): right Ctrl is pressed
3323
  * bit 4 (mask 0x10): left Alt is pressed
3340
  * bit 4 (mask 0x10): left Alt is pressed
3324
  * bit 5 (mask 0x20): right Alt is pressed
3341
  * bit 5 (mask 0x20): right Alt is pressed
3325
  * bit 6 (mask 0x40): CapsLock is on
3342
  * bit 6 (mask 0x40): CapsLock is on
3326
  * bit 7 (mask 0x80): NumLock is on
3343
  * bit 7 (mask 0x80): NumLock is on
3327
  * bit 8 (mask 0x100): ScrollLock is on
3344
  * bit 8 (mask 0x100): ScrollLock is on
3328
  * other bits are cleared
3345
  * other bits are cleared
3329
 
3346
 
3330
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3347
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3331
When hotkey is pressed, the system notifies only those applications,
3348
When hotkey is pressed, the system notifies only those applications,
3332
which have installed it; the active application (which receives
3349
which have installed it; the active application (which receives
3333
all normal input) does not receive such keys.
3350
all normal input) does not receive such keys.
3334
The notification consists in sending event with the code 2.
3351
The notification consists in sending event with the code 2.
3335
Reading hotkey is the same as reading normal key - by function 2.
3352
Reading hotkey is the same as reading normal key - by function 2.
3336
Parameters:
3353
Parameters:
3337
  * eax = 66 - function number
3354
  * eax = 66 - function number
3338
  * ebx = 4 - subfunction number
3355
  * ebx = 4 - subfunction number
3339
  * cl determines key scancode;
3356
  * cl determines key scancode;
3340
    use cl=0 to give combinations such as Ctrl+Shift
3357
    use cl=0 to give combinations such as Ctrl+Shift
3341
  * edx = 0xXYZ determines possible states of control keys:
3358
  * edx = 0xXYZ determines possible states of control keys:
3342
    * Z (low 4 bits) determines state of LShift and RShift:
3359
    * Z (low 4 bits) determines state of LShift and RShift:
3343
      * 0 = no key must be pressed;
3360
      * 0 = no key must be pressed;
3344
      * 1 = exactly one key must be pressed;
3361
      * 1 = exactly one key must be pressed;
3345
      * 2 = both keys must be pressed;
3362
      * 2 = both keys must be pressed;
3346
      * 3 = must be pressed LShift, but not RShift;
3363
      * 3 = must be pressed LShift, but not RShift;
3347
      * 4 = must be pressed RShift, but not LShift
3364
      * 4 = must be pressed RShift, but not LShift
3348
    * Y - similar for LCtrl and RCtrl;
3365
    * Y - similar for LCtrl and RCtrl;
3349
    * X - similar for LAlt and RAlt
3366
    * X - similar for LAlt and RAlt
3350
Returned value:
3367
Returned value:
3351
  * eax=0 - success
3368
  * eax=0 - success
3352
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3369
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3353
Remarks:
3370
Remarks:
3354
  * Hotkey can work either at pressing or at release. Release
3371
  * Hotkey can work either at pressing or at release. Release
3355
    scancode of a key is more on 128 than pressing scancode
3372
    scancode of a key is more on 128 than pressing scancode
3356
    (i.e. high bit is set).
3373
    (i.e. high bit is set).
3357
  * Several applications can set the same combination;
3374
  * Several applications can set the same combination;
3358
    all such applications will be informed on pressing
3375
    all such applications will be informed on pressing
3359
    such combination.
3376
    such combination.
3360
 
3377
 
3361
-------------- Subfunction 5 - delete installed hotkey. --------------
3378
-------------- Subfunction 5 - delete installed hotkey. --------------
3362
Parameters:
3379
Parameters:
3363
  * eax = 66 - function number
3380
  * eax = 66 - function number
3364
  * ebx = 5 - subfunction number
3381
  * ebx = 5 - subfunction number
3365
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3382
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3366
Returned value:
3383
Returned value:
3367
  * eax = 0 - success
3384
  * eax = 0 - success
3368
  * eax = 1 - there is no such hotkey
3385
  * eax = 1 - there is no such hotkey
3369
Remarks:
3386
Remarks:
3370
  * When a process/thread terminates, all hotkey installed by it are
3387
  * When a process/thread terminates, all hotkey installed by it are
3371
    deleted.
3388
    deleted.
3372
  * The call to this subfunction does not affect other applications.
3389
  * The call to this subfunction does not affect other applications.
3373
    If other application has defined the same combination, it will
3390
    If other application has defined the same combination, it will
3374
    still receive notices.
3391
    still receive notices.
3375
 
3392
 
3376
======================================================================
3393
======================================================================
3377
========= Function 67 - change position/sizes of the window. =========
3394
========= Function 67 - change position/sizes of the window. =========
3378
======================================================================
3395
======================================================================
3379
Parameters:
3396
Parameters:
3380
  * eax = 67 - function number
3397
  * eax = 67 - function number
3381
  * ebx = new x-coordinate of the window
3398
  * ebx = new x-coordinate of the window
3382
  * ecx = new y-coordinate of the window
3399
  * ecx = new y-coordinate of the window
3383
  * edx = new x-size of the window
3400
  * edx = new x-size of the window
3384
  * esi = new y-size of the window
3401
  * esi = new y-size of the window
3385
Returned value:
3402
Returned value:
3386
  * function does not return value
3403
  * function does not return value
3387
Remarks:
3404
Remarks:
3388
  * The value -1 for a parameter means "do not change"; e.g. to move
3405
  * The value -1 for a parameter means "do not change"; e.g. to move
3389
    the window without resizing it is possible to specify edx=esi=-1.
3406
    the window without resizing it is possible to specify edx=esi=-1.
3390
  * Previously the window must be defined by function 0.
3407
  * Previously the window must be defined by function 0.
3391
    It sets initial coordinates and sizes of the window.
3408
    It sets initial coordinates and sizes of the window.
3392
  * Sizes of the window are understood in sense of function 0,
3409
  * Sizes of the window are understood in sense of function 0,
3393
    that is one pixel less than real sizes.
3410
    that is one pixel less than real sizes.
3394
  * The function call for maximized windows is simply ignored.
3411
  * The function call for maximized windows is simply ignored.
3395
  * For windows of appropriate styles position and/or sizes can be
3412
  * For windows of appropriate styles position and/or sizes can be
3396
    changed by user; current position and sizes can be obtained by
3413
    changed by user; current position and sizes can be obtained by
3397
    call to function 9.
3414
    call to function 9.
3398
  * The function sends to the window redraw event (with the code 1).
3415
  * The function sends to the window redraw event (with the code 1).
3399
 
3416
 
3400
======================================================================
3417
======================================================================
3401
====== Function 68, subfunction 0 - get the task switch counter. =====
3418
====== Function 68, subfunction 0 - get the task switch counter. =====
3402
======================================================================
3419
======================================================================
3403
Parameters:
3420
Parameters:
3404
  * eax = 68 - function number
3421
  * eax = 68 - function number
3405
  * ebx = 0 - subfunction number
3422
  * ebx = 0 - subfunction number
3406
Returned value:
3423
Returned value:
3407
  * eax = number of task switches from the system booting
3424
  * eax = number of task switches from the system booting
3408
    (modulo 2^32)
3425
    (modulo 2^32)
3409
 
3426
 
3410
======================================================================
3427
======================================================================
3411
======= Function 68, subfunction 1 - switch to the next thread. ======
3428
======= Function 68, subfunction 1 - switch to the next thread. ======
3412
======================================================================
3429
======================================================================
3413
The function completes the current time slice allocated to the
3430
The function completes the current time slice allocated to the
3414
thread and switches to the next. (Which thread in which process
3431
thread and switches to the next. (Which thread in which process
3415
will be next, is unpredictable). Later, when execution queue
3432
will be next, is unpredictable). Later, when execution queue
3416
will reach the current thread, execution will be continued.
3433
will reach the current thread, execution will be continued.
3417
Parameters:
3434
Parameters:
3418
  * eax = 68 - function number
3435
  * eax = 68 - function number
3419
  * ebx = 1 - subfunction number
3436
  * ebx = 1 - subfunction number
3420
Returned value:
3437
Returned value:
3421
  * function does not return value
3438
  * function does not return value
3422
 
3439
 
3423
======================================================================
3440
======================================================================
3424
============= Function 68, subfunction 2 - cache + rdpmc. ============
3441
============= Function 68, subfunction 2 - cache + rdpmc. ============
3425
======================================================================
3442
======================================================================
3426
Parameters:
3443
Parameters:
3427
  * eax = 68 - function number
3444
  * eax = 68 - function number
3428
  * ebx = 2 - subfunction number
3445
  * ebx = 2 - subfunction number
3429
  * ecx = required action:
3446
  * ecx = required action:
3430
    * ecx = 0 - enable instruction 'rdpmc'
3447
    * ecx = 0 - enable instruction 'rdpmc'
3431
      (ReaD Performance-Monitoring Counters) for applications
3448
      (ReaD Performance-Monitoring Counters) for applications
3432
    * ecx = 1 - find out whether cache is disabled/enabled
3449
    * ecx = 1 - find out whether cache is disabled/enabled
3433
    * ecx = 2 - enable cache
3450
    * ecx = 2 - enable cache
3434
    * ecx = 3 - disable cache
3451
    * ecx = 3 - disable cache
3435
Returned value:
3452
Returned value:
3436
  * for ecx=0:
3453
  * for ecx=0:
3437
    * eax = the value of cr4
3454
    * eax = the value of cr4
3438
  * for ecx=1:
3455
  * for ecx=1:
3439
    * eax = (cr0 and 0x60000000):
3456
    * eax = (cr0 and 0x60000000):
3440
    * eax = 0 - cache is on
3457
    * eax = 0 - cache is on
3441
    * eax <> 0 - cache is off
3458
    * eax <> 0 - cache is off
3442
  * for ecx=2 and ecx=3:
3459
  * for ecx=2 and ecx=3:
3443
    * function does not return value
3460
    * function does not return value
3444
 
3461
 
3445
======================================================================
3462
======================================================================
3446
=========== Function 68, subfunction 3 - read MSR-register. ==========
3463
=========== Function 68, subfunction 3 - read MSR-register. ==========
3447
======================================================================
3464
======================================================================
3448
MSR = Model Specific Register; the complete list of MSR-registers
3465
MSR = Model Specific Register; the complete list of MSR-registers
3449
of a processor is included to the documentation on it (for example,
3466
of a processor is included to the documentation on it (for example,
3450
IA-32 Intel Architecture Software Developer's Manual,
3467
IA-32 Intel Architecture Software Developer's Manual,
3451
Volume 3, Appendix B); each processor family has its own subset
3468
Volume 3, Appendix B); each processor family has its own subset
3452
of the MSR-registers.
3469
of the MSR-registers.
3453
Parameters:
3470
Parameters:
3454
  * eax = 68 - function number
3471
  * eax = 68 - function number
3455
  * ebx = 3 - subfunction number
3472
  * ebx = 3 - subfunction number
3456
  * ecx is ignored
3473
  * ecx is ignored
3457
  * edx = MSR address
3474
  * edx = MSR address
3458
Returned value:
3475
Returned value:
3459
  * ebx:eax = high:low dword of the result
3476
  * ebx:eax = high:low dword of the result
3460
Remarks:
3477
Remarks:
3461
  * If ecx contains nonexistent or not implemented for this processor
3478
  * If ecx contains nonexistent or not implemented for this processor
3462
    MSR, processor will generate an exception in the kernel, which
3479
    MSR, processor will generate an exception in the kernel, which
3463
    will kill the thread.
3480
    will kill the thread.
3464
  * Previously it is necessary to check, whether MSRs are supported
3481
  * Previously it is necessary to check, whether MSRs are supported
3465
    as a whole, with the instruction 'cpuid'. Otherwise processor
3482
    as a whole, with the instruction 'cpuid'. Otherwise processor
3466
    will generate other exception in the kernel, which will anyway
3483
    will generate other exception in the kernel, which will anyway
3467
    kill the thread.
3484
    kill the thread.
3468
 
3485
 
3469
======================================================================
3486
======================================================================
3470
========= Function 68, subfunction 4 - write to MSR-register. ========
3487
========= Function 68, subfunction 4 - write to MSR-register. ========
3471
======================================================================
3488
======================================================================
3472
MSR = Model Specific Register; the complete list of MSR-registers
3489
MSR = Model Specific Register; the complete list of MSR-registers
3473
of a processor is included to the documentation on it (for example,
3490
of a processor is included to the documentation on it (for example,
3474
IA-32 Intel Architecture Software Developer's Manual,
3491
IA-32 Intel Architecture Software Developer's Manual,
3475
Volume 3, Appendix B); each processor family has its own subset
3492
Volume 3, Appendix B); each processor family has its own subset
3476
of the MSR-registers.
3493
of the MSR-registers.
3477
Parameters:
3494
Parameters:
3478
  * eax = 68 - function number
3495
  * eax = 68 - function number
3479
  * ebx = 4 - subfunction number
3496
  * ebx = 4 - subfunction number
3480
  * ecx is ignored
3497
  * ecx is ignored
3481
  * edx = MSR address
3498
  * edx = MSR address
3482
  * esi:edi = high:low dword
3499
  * esi:edi = high:low dword
3483
Returned value:
3500
Returned value:
3484
  * function does not return value
3501
  * function does not return value
3485
Remarks:
3502
Remarks:
3486
  * If ecx contains nonexistent or not implemented for this processor
3503
  * If ecx contains nonexistent or not implemented for this processor
3487
    MSR, processor will generate an exception in the kernel, which
3504
    MSR, processor will generate an exception in the kernel, which
3488
    will kill the thread.
3505
    will kill the thread.
3489
  * Previously it is necessary to check, whether MSRs are supported
3506
  * Previously it is necessary to check, whether MSRs are supported
3490
    as a whole, with the instruction 'cpuid'. Otherwise processor
3507
    as a whole, with the instruction 'cpuid'. Otherwise processor
3491
    will generate other exception in the kernel, which will anyway
3508
    will generate other exception in the kernel, which will anyway
3492
    kill the thread.
3509
    kill the thread.
3493
 
3510
 
3494
======================================================================
3511
======================================================================
3495
======= Function 68, subfunction 11 - initialize process heap. =======
3512
======= Function 68, subfunction 11 - initialize process heap. =======
3496
======================================================================
3513
======================================================================
3497
Parameters:
3514
Parameters:
3498
  * eax = 68 - function number
3515
  * eax = 68 - function number
3499
  * ebx = 11 - subfunction number
3516
  * ebx = 11 - subfunction number
3500
Returned value:
3517
Returned value:
3501
  * eax = 0 - failed
3518
  * eax = 0 - failed
3502
  * otherwise size of created heap
3519
  * otherwise size of created heap
3503
Remarks:
3520
Remarks:
3504
  * The function call initializes heap, from which one can in future
3521
  * The function call initializes heap, from which one can in future
3505
    allocate and free memory blocks with subfunctions 12 and 13.
3522
    allocate and free memory blocks with subfunctions 12 and 13.
3506
    Heap size is equal to total amount of free application memory.
3523
    Heap size is equal to total amount of free application memory.
3507
  * The second function call from the same process results in
3524
  * The second function call from the same process results in
3508
    returning the size of the existing heap.
3525
    returning the size of the existing heap.
3509
  * After creation of the heap calls to function 64 will be ignored.
3526
  * After creation of the heap calls to function 64 will be ignored.
3510
 
3527
 
3511
======================================================================
3528
======================================================================
3512
======== Function 68, subfunction 12 - allocate memory block. ========
3529
======== Function 68, subfunction 12 - allocate memory block. ========
3513
======================================================================
3530
======================================================================
3514
Parameters:
3531
Parameters:
3515
  * eax = 68 - function number
3532
  * eax = 68 - function number
3516
  * ebx = 12 - subfunction number
3533
  * ebx = 12 - subfunction number
3517
  * ecx = required size in bytes
3534
  * ecx = required size in bytes
3518
Returned value:
3535
Returned value:
3519
  * eax = pointer to the allocated block
3536
  * eax = pointer to the allocated block
3520
Remarks:
3537
Remarks:
3521
  * Before this call one must initialize process heap by call to
3538
  * Before this call one must initialize process heap by call to
3522
    subfunction 11.
3539
    subfunction 11.
3523
  * The function allocates an integer number of pages (4 Kb) in such
3540
  * The function allocates an integer number of pages (4 Kb) in such
3524
    way that the real size of allocated block is more than or equal to
3541
    way that the real size of allocated block is more than or equal to
3525
    requested size.
3542
    requested size.
3526
 
3543
 
3527
======================================================================
3544
======================================================================
3528
========== Function 68, subfunction 13 - free memory block. ==========
3545
========== Function 68, subfunction 13 - free memory block. ==========
3529
======================================================================
3546
======================================================================
3530
Parameters:
3547
Parameters:
3531
  * eax = 68 - function number
3548
  * eax = 68 - function number
3532
  * ebx = 13 - subfunction number
3549
  * ebx = 13 - subfunction number
3533
  * ecx = pointer to the memory block
3550
  * ecx = pointer to the memory block
3534
Returned value:
3551
Returned value:
3535
  * eax = 1 - success
3552
  * eax = 1 - success
3536
  * eax = 0 - failed
3553
  * eax = 0 - failed
3537
Remarks:
3554
Remarks:
3538
  * The memory block must have been allocated by subfunction 12
3555
  * The memory block must have been allocated by subfunction 12
3539
    or subfunction 20.
3556
    or subfunction 20.
3540
 
3557
 
3541
======================================================================
3558
======================================================================
3542
===================== Function 68, subfunction 14 ====================
3559
===================== Function 68, subfunction 14 ====================
3543
============ Wait for signal from another program/driver. ============
3560
============ Wait for signal from another program/driver. ============
3544
======================================================================
3561
======================================================================
3545
Parameters:
3562
Parameters:
3546
  * eax = 68 - function number
3563
  * eax = 68 - function number
3547
  * ebx = 14 - subfunction number
3564
  * ebx = 14 - subfunction number
3548
  * ecx = pointer to the buffer for information (24 bytes)
3565
  * ecx = pointer to the buffer for information (24 bytes)
3549
Returned value:
3566
Returned value:
3550
  * buffer pointed to by ecx contains the following information:
3567
  * buffer pointed to by ecx contains the following information:
3551
    * +0: dword: identifier for following data of signal
3568
    * +0: dword: identifier for following data of signal
3552
    * +4: dword: data of signal (20 bytes), format of which is defined
3569
    * +4: dword: data of signal (20 bytes), format of which is defined
3553
          by the first dword
3570
          by the first dword
3554
 
3571
 
3555
======================================================================
3572
======================================================================
3556
============= Function 68, subfunction 16 - load driver. =============
3573
============= Function 68, subfunction 16 - load driver. =============
3557
======================================================================
3574
======================================================================
3558
Parameters:
3575
Parameters:
3559
  * eax = 68 - function number
3576
  * eax = 68 - function number
3560
  * ebx = 16 - subfunction number
3577
  * ebx = 16 - subfunction number
3561
  * ecx = pointer to ASCIIZ-string with driver name
3578
  * ecx = pointer to ASCIIZ-string with driver name
3562
Returned value:
3579
Returned value:
3563
  * eax = 0 - failed
3580
  * eax = 0 - failed
3564
  * otherwise eax = driver handle
3581
  * otherwise eax = driver handle
3565
Remarks:
3582
Remarks:
3566
  * If the driver was not loaded yet, it is loaded;
3583
  * If the driver was not loaded yet, it is loaded;
3567
    if the driver was loaded yet, nothing happens.
3584
    if the driver was loaded yet, nothing happens.
3568
  * Driver name is case-sensitive.
3585
  * Driver name is case-sensitive.
3569
    Maximum length of the name is 16 characters, including
3586
    Maximum length of the name is 16 characters, including
3570
    terminating null character, the rest is ignored.
3587
    terminating null character, the rest is ignored.
3571
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3588
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3572
 
3589
 
3573
======================================================================
3590
======================================================================
3574
============ Function 68, subfunction 17 - driver control. ===========
3591
============ Function 68, subfunction 17 - driver control. ===========
3575
======================================================================
3592
======================================================================
3576
Parameters:
3593
Parameters:
3577
  * eax = 68 - function number
3594
  * eax = 68 - function number
3578
  * ebx = 17 - subfunction number
3595
  * ebx = 17 - subfunction number
3579
  * ecx = pointer to the control structure:
3596
  * ecx = pointer to the control structure:
3580
    * +0: dword: handle of driver
3597
    * +0: dword: handle of driver
3581
    * +4: dword: code of driver function
3598
    * +4: dword: code of driver function
3582
    * +8: dword: pointer to input data
3599
    * +8: dword: pointer to input data
3583
    * +12 = +0xC: dword: size of input data
3600
    * +12 = +0xC: dword: size of input data
3584
    * +16 = +0x10: dword: pointer to output data
3601
    * +16 = +0x10: dword: pointer to output data
3585
    * +20 = +0x14: dword: size of output data
3602
    * +20 = +0x14: dword: size of output data
3586
Returned value:
3603
Returned value:
3587
  * eax = determined by driver
3604
  * eax = determined by driver
3588
Remarks:
3605
Remarks:
3589
  * Function codes and the structure of input/output data
3606
  * Function codes and the structure of input/output data
3590
    are defined by driver.
3607
    are defined by driver.
3591
  * Previously one must obtain driver handle by subfunction 16.
3608
  * Previously one must obtain driver handle by subfunction 16.
3592
 
3609
 
3593
======================================================================
3610
======================================================================
3594
=============== Function 68, subfunction 19 - load DLL. ==============
3611
=============== Function 68, subfunction 19 - load DLL. ==============
3595
======================================================================
3612
======================================================================
3596
Parameters:
3613
Parameters:
3597
  * eax = 68 - function number
3614
  * eax = 68 - function number
3598
  * ebx = 19 - subfunction number
3615
  * ebx = 19 - subfunction number
3599
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3616
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3600
Returned value:
3617
Returned value:
3601
  * eax = 0 - failed
3618
  * eax = 0 - failed
3602
  * otherwise eax = pointer to DLL export table
3619
  * otherwise eax = pointer to DLL export table
3603
Remarks:
3620
Remarks:
3604
  * Export table is an array of structures of 2 dword's, terminated
3621
  * Export table is an array of structures of 2 dword's, terminated
3605
    by zero. The first dword in structure points to function name,
3622
    by zero. The first dword in structure points to function name,
3606
    the second dword contains address of function.
3623
    the second dword contains address of function.
3607
 
3624
 
3608
======================================================================
3625
======================================================================
3609
======= Function 68, subfunction 20 - reallocate memory block. =======
3626
======= Function 68, subfunction 20 - reallocate memory block. =======
3610
======================================================================
3627
======================================================================
3611
Parameters:
3628
Parameters:
3612
  * eax = 68 - function number
3629
  * eax = 68 - function number
3613
  * ebx = 20 - subfunction number
3630
  * ebx = 20 - subfunction number
3614
  * ecx = new size in bytes
3631
  * ecx = new size in bytes
3615
  * edx = pointer to already allocated block
3632
  * edx = pointer to already allocated block
3616
Returned value:
3633
Returned value:
3617
  * eax = pointer to the reallocated block, 0 = error
3634
  * eax = pointer to the reallocated block, 0 = error
3618
Remarks:
3635
Remarks:
3619
  * Before this call one must initialize process heap by call to
3636
  * Before this call one must initialize process heap by call to
3620
    subfunction 11.
3637
    subfunction 11.
3621
  * The function allocates an integer number of pages (4 Kb) in such
3638
  * The function allocates an integer number of pages (4 Kb) in such
3622
    way that the real size of allocated block is more than or equal to
3639
    way that the real size of allocated block is more than or equal to
3623
    requested size.
3640
    requested size.
3624
  * If edx=0, the function call is equivalent to memory allocation
3641
  * If edx=0, the function call is equivalent to memory allocation
3625
    with subfunction 12. Otherwise the block at edx
3642
    with subfunction 12. Otherwise the block at edx
3626
    must be allocated earlier with subfunction 12 or this subfunction.
3643
    must be allocated earlier with subfunction 12 or this subfunction.
3627
  * If ecx=0, the function frees memory block at edx and returns 0.
3644
  * If ecx=0, the function frees memory block at edx and returns 0.
3628
  * The contents of the block are unchanged up to the shorter of
3645
  * The contents of the block are unchanged up to the shorter of
3629
    the new and old sizes.
3646
    the new and old sizes.
3630
 
3647
 
3631
======================================================================
3648
======================================================================
3632
======== Function 68, subfunction 22 - open named memory area. =======
3649
======== Function 68, subfunction 22 - open named memory area. =======
3633
======================================================================
3650
======================================================================
3634
Parameters:
3651
Parameters:
3635
  * eax = 68 - function number
3652
  * eax = 68 - function number
3636
  * ebx = 22 - subfunction number
3653
  * ebx = 22 - subfunction number
3637
  * ecx = area name. Maximum of 31 characters with terminating zero
3654
  * ecx = area name. Maximum of 31 characters with terminating zero
3638
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3655
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3639
  * esi = flags for open and access:
3656
  * esi = flags for open and access:
3640
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3657
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3641
                          with such name does not exist, the function
3658
                          with such name does not exist, the function
3642
                          will return error code 5.
3659
                          will return error code 5.
3643
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3660
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3644
                          memory area.
3661
                          memory area.
3645
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3662
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3646
                          with such name already exists, the function
3663
                          with such name already exists, the function
3647
                          will return error code 10.
3664
                          will return error code 10.
3648
    * SHM_READ        = 0x00 - only read access
3665
    * SHM_READ        = 0x00 - only read access
3649
    * SHM_WRITE       = 0x01 - read and write access
3666
    * SHM_WRITE       = 0x01 - read and write access
3650
Returned value:
3667
Returned value:
3651
  * eax = pointer to memory area, 0 if error has occured
3668
  * eax = pointer to memory area, 0 if error has occured
3652
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3669
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3653
    edx = 0 - success, otherwise - error code
3670
    edx = 0 - success, otherwise - error code
3654
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3671
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3655
    edx = error code (if eax=0) or area size in bytes
3672
    edx = error code (if eax=0) or area size in bytes
3656
Error codes:
3673
Error codes:
3657
  * E_NOTFOUND = 5
3674
  * E_NOTFOUND = 5
3658
  * E_ACCESS = 10
3675
  * E_ACCESS = 10
3659
  * E_NOMEM = 30
3676
  * E_NOMEM = 30
3660
  * E_PARAM = 33
3677
  * E_PARAM = 33
3661
Remarks:
3678
Remarks:
3662
  * Before this call one must initialize process heap by call to
3679
  * Before this call one must initialize process heap by call to
3663
    subfunction 11.
3680
    subfunction 11.
3664
  * If a new area is created, access flags set maximal rights
3681
  * If a new area is created, access flags set maximal rights
3665
    for other processes. An attempt from other process to open
3682
    for other processes. An attempt from other process to open
3666
    with denied rights will fail with error code E_ACCESS.
3683
    with denied rights will fail with error code E_ACCESS.
3667
  * The process which has created an area always has write access.
3684
  * The process which has created an area always has write access.
3668
 
3685
 
3669
======================================================================
3686
======================================================================
3670
======= Function 68, subfunction 23 - close named memory area. =======
3687
======= Function 68, subfunction 23 - close named memory area. =======
3671
======================================================================
3688
======================================================================
3672
Parameters:
3689
Parameters:
3673
  * eax = 68 - function number
3690
  * eax = 68 - function number
3674
  * ebx = 23 - subfunction number
3691
  * ebx = 23 - subfunction number
3675
  * ecx = area name. Maximum of 31 characters with terminating zero
3692
  * ecx = area name. Maximum of 31 characters with terminating zero
3676
Returned value:
3693
Returned value:
3677
  * eax destroyed
3694
  * eax destroyed
3678
Remarks:
3695
Remarks:
3679
  * A memory area is physically freed (with deleting all data and
3696
  * A memory area is physically freed (with deleting all data and
3680
    freeing physical memory), when all threads which have opened
3697
    freeing physical memory), when all threads which have opened
3681
    this area will close it.
3698
    this area will close it.
3682
  * When thread is terminating, all opened by it areas are closed.
3699
  * When thread is terminating, all opened by it areas are closed.
3683
 
3700
 
3684
======================================================================
3701
======================================================================
3685
======== Function 68, subfunction 24 - set exception handler. ========
3702
======== Function 68, subfunction 24 - set exception handler. ========
3686
======================================================================
3703
======================================================================
3687
Parameters:
3704
Parameters:
3688
  * eax = 68 - function number
3705
  * eax = 68 - function number
3689
  * ebx = 24 - subfunction number
3706
  * ebx = 24 - subfunction number
3690
  * ecx = address of the new exception handler
3707
  * ecx = address of the new exception handler
3691
  * edx = the mask of handled exceptions
3708
  * edx = the mask of handled exceptions
3692
Returned value:
3709
Returned value:
3693
  * eax = address of the old exception handler (0, if it was not set)
3710
  * eax = address of the old exception handler (0, if it was not set)
3694
  * ebx = the old mask of handled exceptions
3711
  * ebx = the old mask of handled exceptions
3695
Remarks:
3712
Remarks:
3696
  * Bit number in mask of exceptions corresponds to exception number
3713
  * Bit number in mask of exceptions corresponds to exception number
3697
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3714
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3698
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3715
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3699
  * The current implementation ignores the inquiry for hook of 7
3716
  * The current implementation ignores the inquiry for hook of 7
3700
    exception - the system handles #NM by its own.
3717
    exception - the system handles #NM by its own.
3701
  * The exception handler is called with exception number as first
3718
  * The exception handler is called with exception number as first
3702
    (and only) stack parameter. So, correct exit from the handler is
3719
    (and only) stack parameter. So, correct exit from the handler is
3703
    RET 4. It returns to the instruction, that caused the exception,
3720
    RET 4. It returns to the instruction, that caused the exception,
3704
    for faults, and to the next instruction for traps (see
3721
    for faults, and to the next instruction for traps (see
3705
    classification of exceptions in CPU specification).
3722
    classification of exceptions in CPU specification).
3706
  * When user handler receives control, the corresponding bit in
3723
  * When user handler receives control, the corresponding bit in
3707
    the exception mask is cleared. Raising this exception
3724
    the exception mask is cleared. Raising this exception
3708
    in consequence leads to default handling, that is,
3725
    in consequence leads to default handling, that is,
3709
    terminating the application in absence of debugger or
3726
    terminating the application in absence of debugger or
3710
    suspend with notification of debugger otherwise.
3727
    suspend with notification of debugger otherwise.
3711
  * After user handler completes critical operations, it can set
3728
  * After user handler completes critical operations, it can set
3712
    the corresponding bit in the exception mask with subfunction 25.
3729
    the corresponding bit in the exception mask with subfunction 25.
3713
    Also user handler is responsible for clearing exceptions flags in
3730
    Also user handler is responsible for clearing exceptions flags in
3714
    FPU and/or SSE.
3731
    FPU and/or SSE.
3715
 
3732
 
3716
======================================================================
3733
======================================================================
3717
====== Function 68, subfunction 25 - set FPU exception handler. ======
3734
====== Function 68, subfunction 25 - set FPU exception handler. ======
3718
======================================================================
3735
======================================================================
3719
Parameters:
3736
Parameters:
3720
  * eax = 68 - function number
3737
  * eax = 68 - function number
3721
  * ebx = 25 - subfunction number
3738
  * ebx = 25 - subfunction number
3722
  * ecx = signal number
3739
  * ecx = signal number
3723
  * edx = value of activity (0/1)
3740
  * edx = value of activity (0/1)
3724
Returned value:
3741
Returned value:
3725
  * eax = -1 - invalid signal number
3742
  * eax = -1 - invalid signal number
3726
  * otherwise eax = old value of activity for this signal (0/1)
3743
  * otherwise eax = old value of activity for this signal (0/1)
3727
Remarks:
3744
Remarks:
3728
  * In current implementation only mask for user excepton handler,
3745
  * In current implementation only mask for user excepton handler,
3729
    which has been previously set by subfunction 24,
3746
    which has been previously set by subfunction 24,
3730
    is changed. Signal number corresponds to exception number.
3747
    is changed. Signal number corresponds to exception number.
3731
 
3748
 
3732
======================================================================
3749
======================================================================
3733
====================== Function 69 - debugging. ======================
3750
====================== Function 69 - debugging. ======================
3734
======================================================================
3751
======================================================================
3735
A process can load other process as debugged by set of corresponding
3752
A process can load other process as debugged by set of corresponding
3736
bit by call to subfunction 7 of function 70.
3753
bit by call to subfunction 7 of function 70.
3737
A process can have only one debugger; one process can debug some
3754
A process can have only one debugger; one process can debug some
3738
others. The system notifies debugger on events occuring with
3755
others. The system notifies debugger on events occuring with
3739
debugged process. Messages are written to the buffer defined by
3756
debugged process. Messages are written to the buffer defined by
3740
subfunction 0.
3757
subfunction 0.
3741
Format of a message:
3758
Format of a message:
3742
  * +0: dword: message code
3759
  * +0: dword: message code
3743
  * +4: dword: PID of debugged process
3760
  * +4: dword: PID of debugged process
3744
  * +8: there can be additional data depending on message code
3761
  * +8: there can be additional data depending on message code
3745
Message codes:
3762
Message codes:
3746
  * 1 = exception
3763
  * 1 = exception
3747
    * in addition dword-number of the exception is given
3764
    * in addition dword-number of the exception is given
3748
    * process is suspended
3765
    * process is suspended
3749
  * 2 = process has terminated
3766
  * 2 = process has terminated
3750
    * comes at any termination: both through the system function -1,
3767
    * comes at any termination: both through the system function -1,
3751
      and at "murder" by any other process (including debugger itself)
3768
      and at "murder" by any other process (including debugger itself)
3752
  * 3 = debug exception int 1 = #DB
3769
  * 3 = debug exception int 1 = #DB
3753
    * in addition dword-image of the register DR6 is given:
3770
    * in addition dword-image of the register DR6 is given:
3754
      * bits 0-3: condition of the corresponding breakpoint (set by
3771
      * bits 0-3: condition of the corresponding breakpoint (set by
3755
        subfunction 9) is satisfied
3772
        subfunction 9) is satisfied
3756
      * áèò 14: exception has occured because of the trace mode
3773
      * áèò 14: exception has occured because of the trace mode
3757
        (flag TF is set TF)
3774
        (flag TF is set TF)
3758
    * process is suspended
3775
    * process is suspended
3759
When debugger terminates, all debugged processes are killed.
3776
When debugger terminates, all debugged processes are killed.
3760
If debugger does not want this, it must previously detach by
3777
If debugger does not want this, it must previously detach by
3761
subfunction 3.
3778
subfunction 3.
3762
 
3779
 
3763
All subfunctions are applicable only to processes/threads started
3780
All subfunctions are applicable only to processes/threads started
3764
from the current by function 70 with set debugging flag.
3781
from the current by function 70 with set debugging flag.
3765
Debugging of multithreaded programs is not supported yet.
3782
Debugging of multithreaded programs is not supported yet.
3766
The full list of subfunctions:
3783
The full list of subfunctions:
3767
  * subfunction 0 - define data area for debug messages
3784
  * subfunction 0 - define data area for debug messages
3768
  * subfunction 1 - get contents of registers of debugged thread
3785
  * subfunction 1 - get contents of registers of debugged thread
3769
  * subfunction 2 - set contents of registers of debugged thread
3786
  * subfunction 2 - set contents of registers of debugged thread
3770
  * subfunction 3 - detach from debugged process
3787
  * subfunction 3 - detach from debugged process
3771
  * subfunction 4 - suspend debugged thread
3788
  * subfunction 4 - suspend debugged thread
3772
  * subfunction 5 - resume debugged thread
3789
  * subfunction 5 - resume debugged thread
3773
  * subfunction 6 - read from the memory of debugged process
3790
  * subfunction 6 - read from the memory of debugged process
3774
  * subfunction 7 - write to the memory of debugged process
3791
  * subfunction 7 - write to the memory of debugged process
3775
  * subfunction 8 - terminate debugged thread
3792
  * subfunction 8 - terminate debugged thread
3776
  * subfunction 9 - set/clear hardware breakpoint
3793
  * subfunction 9 - set/clear hardware breakpoint
3777
 
3794
 
3778
======================================================================
3795
======================================================================
3779
= Function 69, subfunction 0 - define data area fror debug messages. =
3796
= Function 69, subfunction 0 - define data area fror debug messages. =
3780
======================================================================
3797
======================================================================
3781
Parameters:
3798
Parameters:
3782
  * eax = 69 - function number
3799
  * eax = 69 - function number
3783
  * ebx = 0 - subfunction number
3800
  * ebx = 0 - subfunction number
3784
  * ecx = pointer
3801
  * ecx = pointer
3785
Format of data area:
3802
Format of data area:
3786
  * +0: dword: N = buffer size (not including this header)
3803
  * +0: dword: N = buffer size (not including this header)
3787
  * +4: dword: occupied place
3804
  * +4: dword: occupied place
3788
  * +8: N*byte: buffer
3805
  * +8: N*byte: buffer
3789
Returned value:
3806
Returned value:
3790
  * function does not return value
3807
  * function does not return value
3791
Remarks:
3808
Remarks:
3792
  * If the size field is negative, the buffer is considered locked
3809
  * If the size field is negative, the buffer is considered locked
3793
    and at arrival of new message the system will wait.
3810
    and at arrival of new message the system will wait.
3794
    For synchronization frame all work with the buffer by operations
3811
    For synchronization frame all work with the buffer by operations
3795
    lock/unlock
3812
    lock/unlock
3796
    	neg	[bufsize]
3813
    	neg	[bufsize]
3797
  * Data in the buffer are considered as array of items with variable
3814
  * Data in the buffer are considered as array of items with variable
3798
    length - messages. Format of a message is explained in
3815
    length - messages. Format of a message is explained in
3799
    general description.
3816
    general description.
3800
 
3817
 
3801
======================================================================
3818
======================================================================
3802
===================== Function 69, subfunction 1 =====================
3819
===================== Function 69, subfunction 1 =====================
3803
============ Get contents of registers of debugged thread. ===========
3820
============ Get contents of registers of debugged thread. ===========
3804
======================================================================
3821
======================================================================
3805
Parameters:
3822
Parameters:
3806
  * eax = 69 - function number
3823
  * eax = 69 - function number
3807
  * ebx = 1 - subfunction number
3824
  * ebx = 1 - subfunction number
3808
  * ecx = thread identifier
3825
  * ecx = thread identifier
3809
  * edx = size of context structure, must be 0x28=40 bytes
3826
  * edx = size of context structure, must be 0x28=40 bytes
3810
  * esi = pointer to context structure
3827
  * esi = pointer to context structure
3811
Returned value:
3828
Returned value:
3812
  * function does not return value
3829
  * function does not return value
3813
Format of context structure: (FPU is not supported yet)
3830
Format of context structure: (FPU is not supported yet)
3814
  * +0: dword: eip
3831
  * +0: dword: eip
3815
  * +4: dword: eflags
3832
  * +4: dword: eflags
3816
  * +8: dword: eax
3833
  * +8: dword: eax
3817
  * +12 = +0xC: dword: ecx
3834
  * +12 = +0xC: dword: ecx
3818
  * +16 = +0x10: dword: edx
3835
  * +16 = +0x10: dword: edx
3819
  * +20 = +0x14: dword: ebx
3836
  * +20 = +0x14: dword: ebx
3820
  * +24 = +0x18: dword: esp
3837
  * +24 = +0x18: dword: esp
3821
  * +28 = +0x1C: dword: ebp
3838
  * +28 = +0x1C: dword: ebp
3822
  * +32 = +0x20: dword: esi
3839
  * +32 = +0x20: dword: esi
3823
  * +36 = +0x24: dword: edi
3840
  * +36 = +0x24: dword: edi
3824
Remarks:
3841
Remarks:
3825
  * If the thread executes code of ring-0, the function returns
3842
  * If the thread executes code of ring-0, the function returns
3826
    contents of registers of ring-3.
3843
    contents of registers of ring-3.
3827
  * Process must be loaded for debugging (as is shown in
3844
  * Process must be loaded for debugging (as is shown in
3828
    general description).
3845
    general description).
3829
 
3846
 
3830
======================================================================
3847
======================================================================
3831
===================== Function 69, subfunction 2 =====================
3848
===================== Function 69, subfunction 2 =====================
3832
============ Set contents of registers of debugged thread. ===========
3849
============ Set contents of registers of debugged thread. ===========
3833
======================================================================
3850
======================================================================
3834
Parameters:
3851
Parameters:
3835
  * eax = 69 - function number
3852
  * eax = 69 - function number
3836
  * ebx = 2 - subfunction number
3853
  * ebx = 2 - subfunction number
3837
  * ecx = thread identifier
3854
  * ecx = thread identifier
3838
  * edx = size of context structure, must be 0x28=40 bytes
3855
  * edx = size of context structure, must be 0x28=40 bytes
3839
Returned value:
3856
Returned value:
3840
  * function does not return value
3857
  * function does not return value
3841
Format of context structure is shown in the description of
3858
Format of context structure is shown in the description of
3842
subfunction 1.
3859
subfunction 1.
3843
Remarks:
3860
Remarks:
3844
  * If the thread executes code of ring-0, the function returns
3861
  * If the thread executes code of ring-0, the function returns
3845
    contents of registers of ring-3.
3862
    contents of registers of ring-3.
3846
  * Process must be loaded for debugging (as is shown in
3863
  * Process must be loaded for debugging (as is shown in
3847
    general description).
3864
    general description).
3848
 
3865
 
3849
======================================================================
3866
======================================================================
3850
===== Function 69, subfunction 3 - detach from debugged process. =====
3867
===== Function 69, subfunction 3 - detach from debugged process. =====
3851
======================================================================
3868
======================================================================
3852
Parameters:
3869
Parameters:
3853
  * eax = 69 - function number
3870
  * eax = 69 - function number
3854
  * ebx = 3 - subfunction number
3871
  * ebx = 3 - subfunction number
3855
  * ecx = identifier
3872
  * ecx = identifier
3856
Returned value:
3873
Returned value:
3857
  * function does not return value
3874
  * function does not return value
3858
Remarks:
3875
Remarks:
3859
  * If the process was suspended, it resumes execution.
3876
  * If the process was suspended, it resumes execution.
3860
 
3877
 
3861
======================================================================
3878
======================================================================
3862
======== Function 69, subfunction 4 - suspend debugged thread. =======
3879
======== Function 69, subfunction 4 - suspend debugged thread. =======
3863
======================================================================
3880
======================================================================
3864
Parameters:
3881
Parameters:
3865
  * eax = 69 - function number
3882
  * eax = 69 - function number
3866
  * ebx = 4 - subfunction number
3883
  * ebx = 4 - subfunction number
3867
  * ecx = thread identifier
3884
  * ecx = thread identifier
3868
Returned value:
3885
Returned value:
3869
  * function does not return value
3886
  * function does not return value
3870
Remarks:
3887
Remarks:
3871
  * Process must be loaded for debugging (as is shown in
3888
  * Process must be loaded for debugging (as is shown in
3872
    general description).
3889
    general description).
3873
 
3890
 
3874
======================================================================
3891
======================================================================
3875
======== Function 69, subfunction 5 - resume debugged thread. ========
3892
======== Function 69, subfunction 5 - resume debugged thread. ========
3876
======================================================================
3893
======================================================================
3877
Parameters:
3894
Parameters:
3878
  * eax = 69 - function number
3895
  * eax = 69 - function number
3879
  * ebx = 5 - subfunction number
3896
  * ebx = 5 - subfunction number
3880
  * ecx = thread identifier
3897
  * ecx = thread identifier
3881
Returned value:
3898
Returned value:
3882
  * function does not return value
3899
  * function does not return value
3883
Remarks:
3900
Remarks:
3884
  * Process must be loaded for debugging (as is shown in
3901
  * Process must be loaded for debugging (as is shown in
3885
    general description).
3902
    general description).
3886
 
3903
 
3887
======================================================================
3904
======================================================================
3888
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3905
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3889
======================================================================
3906
======================================================================
3890
Parameters:
3907
Parameters:
3891
  * eax = 69 - function number
3908
  * eax = 69 - function number
3892
  * ebx = 6 - subfunction number
3909
  * ebx = 6 - subfunction number
3893
  * ecx = identifier
3910
  * ecx = identifier
3894
  * edx = number of bytes to read
3911
  * edx = number of bytes to read
3895
  * esi = address in the memory of debugged process
3912
  * esi = address in the memory of debugged process
3896
  * edi = pointer to buffer for data
3913
  * edi = pointer to buffer for data
3897
Returned value:
3914
Returned value:
3898
  * eax = -1 at an error (invalid PID or buffer)
3915
  * eax = -1 at an error (invalid PID or buffer)
3899
  * otherwise eax = number of read bytes (possibly, 0,
3916
  * otherwise eax = number of read bytes (possibly, 0,
3900
    if esi is too large)
3917
    if esi is too large)
3901
Remarks:
3918
Remarks:
3902
  * Process must be loaded for debugging (as is shown in
3919
  * Process must be loaded for debugging (as is shown in
3903
    general description).
3920
    general description).
3904
 
3921
 
3905
======================================================================
3922
======================================================================
3906
== Function 69, subfunction 7 - write to memory of debugged process. =
3923
== Function 69, subfunction 7 - write to memory of debugged process. =
3907
======================================================================
3924
======================================================================
3908
Parameters:
3925
Parameters:
3909
  * eax = 69 - function number
3926
  * eax = 69 - function number
3910
  * ebx = 7 - subfunction number
3927
  * ebx = 7 - subfunction number
3911
  * ecx = identifier
3928
  * ecx = identifier
3912
  * edx = number of bytes to write
3929
  * edx = number of bytes to write
3913
  * esi = address of memory in debugged process
3930
  * esi = address of memory in debugged process
3914
  * edi = pointer to data
3931
  * edi = pointer to data
3915
Returned value:
3932
Returned value:
3916
  * eax = -1 at an error (invalid PID or buffer)
3933
  * eax = -1 at an error (invalid PID or buffer)
3917
  * otherwise eax = number of written bytes (possibly, 0,
3934
  * otherwise eax = number of written bytes (possibly, 0,
3918
    if esi is too large)
3935
    if esi is too large)
3919
Remarks:
3936
Remarks:
3920
  * Process must be loaded for debugging (as is shown in
3937
  * Process must be loaded for debugging (as is shown in
3921
    general description).
3938
    general description).
3922
 
3939
 
3923
======================================================================
3940
======================================================================
3924
======= Function 69, subfunction 8 - terminate debugged thread. ======
3941
======= Function 69, subfunction 8 - terminate debugged thread. ======
3925
======================================================================
3942
======================================================================
3926
Parameters:
3943
Parameters:
3927
  * eax = 69 - function number
3944
  * eax = 69 - function number
3928
  * ebx = 8 - subfunction number
3945
  * ebx = 8 - subfunction number
3929
  * ecx = identifier
3946
  * ecx = identifier
3930
Returned value:
3947
Returned value:
3931
  * function does not return value
3948
  * function does not return value
3932
Remarks:
3949
Remarks:
3933
  * Process must be loaded for debugging (as is shown in
3950
  * Process must be loaded for debugging (as is shown in
3934
    general description).
3951
    general description).
3935
  * The function is similar to subfunction 2 of function 18
3952
  * The function is similar to subfunction 2 of function 18
3936
    with two differences: it requires first remark and
3953
    with two differences: it requires first remark and
3937
    accepts PID rather than slot number.
3954
    accepts PID rather than slot number.
3938
 
3955
 
3939
======================================================================
3956
======================================================================
3940
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3957
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3941
======================================================================
3958
======================================================================
3942
Parameters:
3959
Parameters:
3943
  * eax = 69 - function number
3960
  * eax = 69 - function number
3944
  * ebx = 9 - subfunction number
3961
  * ebx = 9 - subfunction number
3945
  * ecx = thread identifier
3962
  * ecx = thread identifier
3946
  * dl = index of breakpoint, from 0 to 3 inclusively
3963
  * dl = index of breakpoint, from 0 to 3 inclusively
3947
  * dh = flags:
3964
  * dh = flags:
3948
    * if high bit is cleared - set breakpoint:
3965
    * if high bit is cleared - set breakpoint:
3949
      * bits 0-1 - condition:
3966
      * bits 0-1 - condition:
3950
        * 00 = breakpoint on execution
3967
        * 00 = breakpoint on execution
3951
        * 01 = breakpoint on read
3968
        * 01 = breakpoint on read
3952
        * 11 = breakpoint on read/write
3969
        * 11 = breakpoint on read/write
3953
      * bits 2-3 - length; for breakpoints on exception it must be
3970
      * bits 2-3 - length; for breakpoints on exception it must be
3954
        00, otherwise one of
3971
        00, otherwise one of
3955
        * 00 = byte
3972
        * 00 = byte
3956
        * 01 = word
3973
        * 01 = word
3957
        * 11 = dword
3974
        * 11 = dword
3958
      * esi = breakpoint address; must be aligned according to
3975
      * esi = breakpoint address; must be aligned according to
3959
        the length (i.e. must be even for word breakpoints,
3976
        the length (i.e. must be even for word breakpoints,
3960
        divisible by 4 for dword)
3977
        divisible by 4 for dword)
3961
    * if high bit is set - clear breakpoint
3978
    * if high bit is set - clear breakpoint
3962
Returned value:
3979
Returned value:
3963
  * eax = 0 - success
3980
  * eax = 0 - success
3964
  * eax = 1 - error in the input data
3981
  * eax = 1 - error in the input data
3965
  * eax = 2 - (reserved, is never returned in the current
3982
  * eax = 2 - (reserved, is never returned in the current
3966
    implementation) a global breakpoint with that index is already set
3983
    implementation) a global breakpoint with that index is already set
3967
Remarks:
3984
Remarks:
3968
  * Process must be loaded for debugging (as is shown in
3985
  * Process must be loaded for debugging (as is shown in
3969
    general description).
3986
    general description).
3970
  * Hardware breakpoints are implemented through DRx-registers of
3987
  * Hardware breakpoints are implemented through DRx-registers of
3971
    the processor, all limitations results from this.
3988
    the processor, all limitations results from this.
3972
  * The function can reinstall the breakpoint, previously set
3989
  * The function can reinstall the breakpoint, previously set
3973
    by it (and it does not inform on this).
3990
    by it (and it does not inform on this).
3974
    Carry on the list of set breakpoints in the debugger.
3991
    Carry on the list of set breakpoints in the debugger.
3975
  * Breakpoints generate debug exception #DB, on which the system
3992
  * Breakpoints generate debug exception #DB, on which the system
3976
    notifies debugger.
3993
    notifies debugger.
3977
  * Breakpoints on write and read/write act after
3994
  * Breakpoints on write and read/write act after
3978
    execution of the caused it instruction.
3995
    execution of the caused it instruction.
3979
 
3996
 
3980
======================================================================
3997
======================================================================
3981
==== Function 70 - work with file system with long names support. ====
3998
==== Function 70 - work with file system with long names support. ====
3982
======================================================================
3999
======================================================================
3983
Parameters:
4000
Parameters:
3984
  * eax = 70
4001
  * eax = 70
3985
  * ebx = pointer to the information structure
4002
  * ebx = pointer to the information structure
3986
Returned value:
4003
Returned value:
3987
  * eax = 0 - success; otherwise file system error code
4004
  * eax = 0 - success; otherwise file system error code
3988
  * some subfunctions return value in other registers too
4005
  * some subfunctions return value in other registers too
3989
General format of the information structure:
4006
General format of the information structure:
3990
  * +0: dword: subfunction number
4007
  * +0: dword: subfunction number
3991
  * +4: dword: file offset
4008
  * +4: dword: file offset
3992
  * +8: dword: high dword of offset (must be 0) or flags field
4009
  * +8: dword: high dword of offset (must be 0) or flags field
3993
  * +12 = +0xC: dword: size
4010
  * +12 = +0xC: dword: size
3994
  * +16 = +0x10: dword: pointer to data
4011
  * +16 = +0x10: dword: pointer to data
3995
  * +20 = +0x14: n db: ASCIIZ-string with the filename
4012
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3996
    or
4013
    or
3997
  * +20 = +0x14: db 0
4014
  * +20 = +0x14: db 0
3998
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
4015
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3999
Specifications - in documentation on the appropriate subfunction.
4016
Specifications - in documentation on the appropriate subfunction.
4000
Filename is case-insensitive. Russian letters must be written in
4017
Filename is case-insensitive. Russian letters must be written in
4001
the encoding cp866 (DOS).
4018
the encoding cp866 (DOS).
4002
Format of filename:
4019
Format of filename:
4003
/base/number/dir1/dir2/.../dirn/file,
4020
/base/number/dir1/dir2/.../dirn/file,
4004
where /base/number identifies device, on which file is located:
4021
where /base/number identifies device, on which file is located:
4005
one of
4022
one of
4006
  * /RD/1 = /RAMDISK/1 to access ramdisk
4023
  * /RD/1 = /RAMDISK/1 to access ramdisk
4007
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
4024
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
4008
    /FD/2 = /FLOPPYDISK/2 to access second one
4025
    /FD/2 = /FLOPPYDISK/2 to access second one
4009
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
4026
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
4010
    IDE0 (Primary Master), IDE1 (Primary Slave),
4027
    IDE0 (Primary Master), IDE1 (Primary Slave),
4011
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
4028
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
4012
    x - partition number on the selected hard drive, varies from 1
4029
    x - partition number on the selected hard drive, varies from 1
4013
    to 255 (on each hard drive the indexing starts from 1)
4030
    to 255 (on each hard drive the indexing starts from 1)
4014
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
4031
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
4015
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
4032
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
4016
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
4033
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
4017
  * /SYS means system folder; with the usual boot (from floppy)
4034
  * /SYS means system folder; with the usual boot (from floppy)
4018
    is equivalent to /RD/1
4035
    is equivalent to /RD/1
4019
Examples:
4036
Examples:
4020
  * '/rd/1/kernel.asm',0
4037
  * '/rd/1/kernel.asm',0
4021
  * '/HD0/1/kernel.asm',0
4038
  * '/HD0/1/kernel.asm',0
4022
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4039
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4023
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4040
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4024
  * '/sys/MySuperApp.ini',0
4041
  * '/sys/MySuperApp.ini',0
4025
Also function supports relative names.  If the path begins not 
4042
Also function supports relative names.  If the path begins not 
4026
with '/', it is considered relative to a current folder. To get or 
4043
with '/', it is considered relative to a current folder. To get or 
4027
set a current folder, use the function 30.
4044
set a current folder, use the function 30.
4028
 
4045
 
4029
Available subfunctions:
4046
Available subfunctions:
4030
  * subfunction 0 - read file
4047
  * subfunction 0 - read file
4031
  * subfunction 1 - read folder
4048
  * subfunction 1 - read folder
4032
  * subfunction 2 - create/rewrite file
4049
  * subfunction 2 - create/rewrite file
4033
  * subfunction 3 - write to existing file
4050
  * subfunction 3 - write to existing file
4034
  * subfunction 4 - set file size
4051
  * subfunction 4 - set file size
4035
  * subfunction 5 - get attributes of file/folder
4052
  * subfunction 5 - get attributes of file/folder
4036
  * subfunction 6 - set attributes of file/folder
4053
  * subfunction 6 - set attributes of file/folder
4037
  * subfunction 7 - start application
4054
  * subfunction 7 - start application
4038
  * subfunction 8 - delete file/folder
4055
  * subfunction 8 - delete file/folder
4039
  * subfunction 9 - create folder
4056
  * subfunction 9 - create folder
4040
For CD-drives due to hardware limitations only subfunctions
4057
For CD-drives due to hardware limitations only subfunctions
4041
0,1,5 and 7 are available, other subfunctions return error
4058
0,1,5 and 7 are available, other subfunctions return error
4042
with code 2.
4059
with code 2.
4043
At the first call of subfunctions 0,1,5,7 to ATAPI devices
4060
At the first call of subfunctions 0,1,5,7 to ATAPI devices
4044
(CD and DVD) the manual control of tray is locked due to caching
4061
(CD and DVD) the manual control of tray is locked due to caching
4045
drive data. Unlocking is made when subfunction 4 of function 24
4062
drive data. Unlocking is made when subfunction 4 of function 24
4046
is called for corresponding device.
4063
is called for corresponding device.
4047
 
4064
 
4048
======================================================================
4065
======================================================================
4049
=== Function 70, subfunction 0 - read file with long names support. ==
4066
=== Function 70, subfunction 0 - read file with long names support. ==
4050
======================================================================
4067
======================================================================
4051
Parameters:
4068
Parameters:
4052
  * eax = 70 - function number
4069
  * eax = 70 - function number
4053
  * ebx = pointer to the information structure
4070
  * ebx = pointer to the information structure
4054
Format of the information structure:
4071
Format of the information structure:
4055
  * +0: dword: 0 = subfunction number
4072
  * +0: dword: 0 = subfunction number
4056
  * +4: dword: file offset (in bytes)
4073
  * +4: dword: file offset (in bytes)
4057
  * +8: dword: 0 (reserved for high dword of offset)
4074
  * +8: dword: 0 (reserved for high dword of offset)
4058
  * +12 = +0xC: dword: number of bytes to read
4075
  * +12 = +0xC: dword: number of bytes to read
4059
  * +16 = +0x10: dword: pointer to buffer for data
4076
  * +16 = +0x10: dword: pointer to buffer for data
4060
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4077
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4061
    given in the general description
4078
    given in the general description
4062
    or
4079
    or
4063
  * +20 = +0x14: db 0
4080
  * +20 = +0x14: db 0
4064
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4081
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4065
Returned value:
4082
Returned value:
4066
  * eax = 0 - success, otherwise file system error code
4083
  * eax = 0 - success, otherwise file system error code
4067
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4084
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4068
Remarks:
4085
Remarks:
4069
  * If file was ended before last requested block was read,
4086
  * If file was ended before last requested block was read,
4070
    the function will read as many as it can, and after that return
4087
    the function will read as many as it can, and after that return
4071
    eax=6 (EOF).
4088
    eax=6 (EOF).
4072
  * The function does not allow to read folder (returns eax=10,
4089
  * The function does not allow to read folder (returns eax=10,
4073
    access denied).
4090
    access denied).
4074
 
4091
 
4075
======================================================================
4092
======================================================================
4076
== Function 70, subfunction 1 - read folder with long names support. =
4093
== Function 70, subfunction 1 - read folder with long names support. =
4077
======================================================================
4094
======================================================================
4078
Parameters:
4095
Parameters:
4079
  * eax = 70 - function number
4096
  * eax = 70 - function number
4080
  * ebx = pointer to the information structure
4097
  * ebx = pointer to the information structure
4081
Format of the information structure:
4098
Format of the information structure:
4082
  * +0: dword: 1 = subfunction number
4099
  * +0: dword: 1 = subfunction number
4083
  * +4: dword: index of starting block (beginning from 0)
4100
  * +4: dword: index of starting block (beginning from 0)
4084
  * +8: dword: flags field:
4101
  * +8: dword: flags field:
4085
    * bit 0 (mask 1): in what format to return names,
4102
    * bit 0 (mask 1): in what format to return names,
4086
      0=ANSI, 1=UNICODE
4103
      0=ANSI, 1=UNICODE
4087
    * other bits are reserved and must be set to 0 for the future
4104
    * other bits are reserved and must be set to 0 for the future
4088
      compatibility
4105
      compatibility
4089
  * +12 = +0xC: dword: number of blocks to read
4106
  * +12 = +0xC: dword: number of blocks to read
4090
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4107
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4091
    must be not less than 32 + [+12]*560 bytes
4108
    must be not less than 32 + [+12]*560 bytes
4092
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4109
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4093
    given in the general description
4110
    given in the general description
4094
    or
4111
    or
4095
  * +20 = +0x14: db 0
4112
  * +20 = +0x14: db 0
4096
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4113
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4097
Returned value:
4114
Returned value:
4098
  * eax = 0 - success, otherwise file system error code
4115
  * eax = 0 - success, otherwise file system error code
4099
  * ebx = number of files, information on which was written to
4116
  * ebx = number of files, information on which was written to
4100
    the buffer, or -1=0xffffffff, if folder was not found
4117
    the buffer, or -1=0xffffffff, if folder was not found
4101
Structure of the buffer:
4118
Structure of the buffer:
4102
  * +0: 32*byte: header
4119
  * +0: 32*byte: header
4103
  * +32 = +0x20: n1*byte: block with information on file 1
4120
  * +32 = +0x20: n1*byte: block with information on file 1
4104
  * +32+n1: n2*byte: block with information on file 2
4121
  * +32+n1: n2*byte: block with information on file 2
4105
  * ...
4122
  * ...
4106
Structure of header:
4123
Structure of header:
4107
  * +0: dword: version of structure (current is 1)
4124
  * +0: dword: version of structure (current is 1)
4108
  * +4: dword: number of placed blocks; is not greater than requested
4125
  * +4: dword: number of placed blocks; is not greater than requested
4109
    in the field +12 of information structure; can be less, if
4126
    in the field +12 of information structure; can be less, if
4110
    there are no more files in folder (the same as in ebx)
4127
    there are no more files in folder (the same as in ebx)
4111
  * +8: dword: total number of files in folder
4128
  * +8: dword: total number of files in folder
4112
  * +12 = +0xC: 20*byte: reserved (zeroed)
4129
  * +12 = +0xC: 20*byte: reserved (zeroed)
4113
Structure of block of data for folder entry (BDFE):
4130
Structure of block of data for folder entry (BDFE):
4114
  * +0: dword: attributes of file:
4131
  * +0: dword: attributes of file:
4115
    * bit 0 (mask 1): file is read-only
4132
    * bit 0 (mask 1): file is read-only
4116
    * bit 1 (mask 2): file is hidden
4133
    * bit 1 (mask 2): file is hidden
4117
    * bit 2 (mask 4): file is system
4134
    * bit 2 (mask 4): file is system
4118
    * bit 3 (mask 8): this is not a file but volume label
4135
    * bit 3 (mask 8): this is not a file but volume label
4119
      (for one partition meets no more than once and
4136
      (for one partition meets no more than once and
4120
      only in root folder)
4137
      only in root folder)
4121
    * bit 4 (mask 0x10): this is a folder
4138
    * bit 4 (mask 0x10): this is a folder
4122
    * bit 5 (mask 0x20): file was not archived - many archivation
4139
    * bit 5 (mask 0x20): file was not archived - many archivation
4123
      programs have an option to archive only files with this bit set,
4140
      programs have an option to archive only files with this bit set,
4124
      and after archiving this bit is cleared - it can be useful
4141
      and after archiving this bit is cleared - it can be useful
4125
      for automatically creating of backup-archives as at writing
4142
      for automatically creating of backup-archives as at writing
4126
      this bit is usually set
4143
      this bit is usually set
4127
  * +4: byte: type of name data:
4144
  * +4: byte: type of name data:
4128
    (coincides with bit 0 of flags in the information structure)
4145
    (coincides with bit 0 of flags in the information structure)
4129
    * 0 = ASCII = 1-byte representation of each character
4146
    * 0 = ASCII = 1-byte representation of each character
4130
    * 1 = UNICODE = 2-byte representation of each character
4147
    * 1 = UNICODE = 2-byte representation of each character
4131
  * +5: 3*byte: reserved (zero)
4148
  * +5: 3*byte: reserved (zero)
4132
  * +8: 4*byte: time of file creation
4149
  * +8: 4*byte: time of file creation
4133
  * +12 = +0xC: 4*byte: date of file creation
4150
  * +12 = +0xC: 4*byte: date of file creation
4134
  * +16 = +0x10: 4*byte: time of last access (read or write)
4151
  * +16 = +0x10: 4*byte: time of last access (read or write)
4135
  * +20 = +0x14: 4*byte: date of last access
4152
  * +20 = +0x14: 4*byte: date of last access
4136
  * +24 = +0x18: 4*byte: time of last modification
4153
  * +24 = +0x18: 4*byte: time of last modification
4137
  * +28 = +0x1C: 4*byte: date of last modification
4154
  * +28 = +0x1C: 4*byte: date of last modification
4138
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4155
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4139
  * +40 = +0x28: name
4156
  * +40 = +0x28: name
4140
    * for ASCII format: maximum length is 263 characters
4157
    * for ASCII format: maximum length is 263 characters
4141
      (263 bytes), byte after the name has value 0
4158
      (263 bytes), byte after the name has value 0
4142
    * for UNICODE format: maximum length is 259 characters
4159
    * for UNICODE format: maximum length is 259 characters
4143
      (518 bytes), 2 bytes after the name have value 0
4160
      (518 bytes), 2 bytes after the name have value 0
4144
Time format:
4161
Time format:
4145
  * +0: byte: seconds
4162
  * +0: byte: seconds
4146
  * +1: byte: minutes
4163
  * +1: byte: minutes
4147
  * +2: byte: hours
4164
  * +2: byte: hours
4148
  * +3: byte: reserved (0)
4165
  * +3: byte: reserved (0)
4149
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4166
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4150
Date format:
4167
Date format:
4151
  * +0: byte: day
4168
  * +0: byte: day
4152
  * +1: byte: month
4169
  * +1: byte: month
4153
  * +2: word: year
4170
  * +2: word: year
4154
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4171
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4155
Remarks:
4172
Remarks:
4156
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4173
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4157
    if UNICODE name - 560 bytes. Value of length is aligned
4174
    if UNICODE name - 560 bytes. Value of length is aligned
4158
    on 16-byte bound (to accelerate processing in CPU cache).
4175
    on 16-byte bound (to accelerate processing in CPU cache).
4159
  * First character after a name is zero (ASCIIZ-string). The further
4176
  * First character after a name is zero (ASCIIZ-string). The further
4160
    data contain garbage.
4177
    data contain garbage.
4161
  * If files in folder were ended before requested number was read,
4178
  * If files in folder were ended before requested number was read,
4162
    the function will read as many as it can, and after that return
4179
    the function will read as many as it can, and after that return
4163
    eax=6 (EOF).
4180
    eax=6 (EOF).
4164
  * Any folder on the disk, except for root, contains two special
4181
  * Any folder on the disk, except for root, contains two special
4165
    entries "." and "..", identifying accordingly the folder itself
4182
    entries "." and "..", identifying accordingly the folder itself
4166
    and the parent folder.
4183
    and the parent folder.
4167
  * The function allows also to read virtual folders "/", "/rd",
4184
  * The function allows also to read virtual folders "/", "/rd",
4168
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4185
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4169
    and times and dates are zeroed. An alternative way to get the
4186
    and times and dates are zeroed. An alternative way to get the
4170
    equipment information - subfunction 11 of function 18.
4187
    equipment information - subfunction 11 of function 18.
4171
 
4188
 
4172
======================================================================
4189
======================================================================
4173
===================== Function 70, subfunction 2 =====================
4190
===================== Function 70, subfunction 2 =====================
4174
============ Create/rewrite file with long names support. ============
4191
============ Create/rewrite file with long names support. ============
4175
======================================================================
4192
======================================================================
4176
Parameters:
4193
Parameters:
4177
  * eax = 70 - function number
4194
  * eax = 70 - function number
4178
  * ebx = pointer to the information structure
4195
  * ebx = pointer to the information structure
4179
Format of the information structure:
4196
Format of the information structure:
4180
  * +0: dword: 2 = subfunction number
4197
  * +0: dword: 2 = subfunction number
4181
  * +4: dword: 0 (reserved)
4198
  * +4: dword: 0 (reserved)
4182
  * +8: dword: 0 (reserved)
4199
  * +8: dword: 0 (reserved)
4183
  * +12 = +0xC: dword: number of bytes to read
4200
  * +12 = +0xC: dword: number of bytes to read
4184
  * +16 = +0x10: dword: pointer to data
4201
  * +16 = +0x10: dword: pointer to data
4185
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4202
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4186
    given in the general description
4203
    given in the general description
4187
    or
4204
    or
4188
  * +20 = +0x14: db 0
4205
  * +20 = +0x14: db 0
4189
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4206
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4190
Returned value:
4207
Returned value:
4191
  * eax = 0 - success, otherwise file system error code
4208
  * eax = 0 - success, otherwise file system error code
4192
  * ebx = number of written bytes (possibly 0)
4209
  * ebx = number of written bytes (possibly 0)
4193
Remarks:
4210
Remarks:
4194
  * If a file with given name did not exist, it is created;
4211
  * If a file with given name did not exist, it is created;
4195
    if it existed, it is rewritten.
4212
    if it existed, it is rewritten.
4196
  * If there is not enough free space on disk, the function will
4213
  * If there is not enough free space on disk, the function will
4197
    write as many as can and then return error code 8.
4214
    write as many as can and then return error code 8.
4198
  * The function is not supported for CD (returns error code 2).
4215
  * The function is not supported for CD (returns error code 2).
4199
 
4216
 
4200
======================================================================
4217
======================================================================
4201
===================== Function 70, subfunction 3 =====================
4218
===================== Function 70, subfunction 3 =====================
4202
=========== Write to existing file with long names support. ==========
4219
=========== Write to existing file with long names support. ==========
4203
======================================================================
4220
======================================================================
4204
Parameters:
4221
Parameters:
4205
  * eax = 70 - function number
4222
  * eax = 70 - function number
4206
  * ebx = pointer to the information structure
4223
  * ebx = pointer to the information structure
4207
Format of the information structure:
4224
Format of the information structure:
4208
  * +0: dword: 3 = subfunction number
4225
  * +0: dword: 3 = subfunction number
4209
  * +4: dword: file offset (in bytes)
4226
  * +4: dword: file offset (in bytes)
4210
  * +8: dword: high dword of offset (must be 0 for FAT)
4227
  * +8: dword: high dword of offset (must be 0 for FAT)
4211
  * +12 = +0xC: dword: number of bytes to write
4228
  * +12 = +0xC: dword: number of bytes to write
4212
  * +16 = +0x10: dword: pointer to data
4229
  * +16 = +0x10: dword: pointer to data
4213
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4230
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4214
    given in the general description
4231
    given in the general description
4215
    or
4232
    or
4216
  * +20 = +0x14: db 0
4233
  * +20 = +0x14: db 0
4217
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4234
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4218
Returned value:
4235
Returned value:
4219
  * eax = 0 - success, otherwise file system error code
4236
  * eax = 0 - success, otherwise file system error code
4220
  * ebx = number of written bytes (possibly 0)
4237
  * ebx = number of written bytes (possibly 0)
4221
Remarks:
4238
Remarks:
4222
  * The file must already exist, otherwise function returns eax=5.
4239
  * The file must already exist, otherwise function returns eax=5.
4223
  * The only result of write 0 bytes is update in the file attributes
4240
  * The only result of write 0 bytes is update in the file attributes
4224
    date/time of modification and access to the current date/time.
4241
    date/time of modification and access to the current date/time.
4225
  * If beginning and/or ending position is greater than file size
4242
  * If beginning and/or ending position is greater than file size
4226
    (except for the previous case), the file is expanded to needed
4243
    (except for the previous case), the file is expanded to needed
4227
    size with zero characters.
4244
    size with zero characters.
4228
  * The function is not supported for CD (returns error code 2).
4245
  * The function is not supported for CD (returns error code 2).
4229
 
4246
 
4230
======================================================================
4247
======================================================================
4231
============ Function 70, subfunction 4 - set end of file. ===========
4248
============ Function 70, subfunction 4 - set end of file. ===========
4232
======================================================================
4249
======================================================================
4233
Parameters:
4250
Parameters:
4234
  * eax = 70 - function number
4251
  * eax = 70 - function number
4235
  * ebx = pointer to the information structure
4252
  * ebx = pointer to the information structure
4236
Format of the information structure:
4253
Format of the information structure:
4237
  * +0: dword: 4 = subfunction number
4254
  * +0: dword: 4 = subfunction number
4238
  * +4: dword: low dword of new file size
4255
  * +4: dword: low dword of new file size
4239
  * +8: dword: high dword of new file size (must be 0 for FAT)
4256
  * +8: dword: high dword of new file size (must be 0 for FAT)
4240
  * +12 = +0xC: dword: 0 (reserved)
4257
  * +12 = +0xC: dword: 0 (reserved)
4241
  * +16 = +0x10: dword: 0 (reserved)
4258
  * +16 = +0x10: dword: 0 (reserved)
4242
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4259
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4243
    given in the general description
4260
    given in the general description
4244
    or
4261
    or
4245
  * +20 = +0x14: db 0
4262
  * +20 = +0x14: db 0
4246
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4263
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4247
Returned value:
4264
Returned value:
4248
  * eax = 0 - success, otherwise file system error code
4265
  * eax = 0 - success, otherwise file system error code
4249
  * ebx destroyed
4266
  * ebx destroyed
4250
Remarks:
4267
Remarks:
4251
  * If the new file size is less than old one, file is truncated.
4268
  * If the new file size is less than old one, file is truncated.
4252
    If the new size is greater than old one, file is expanded with
4269
    If the new size is greater than old one, file is expanded with
4253
    characters with code 0. If the new size is equal to old one,
4270
    characters with code 0. If the new size is equal to old one,
4254
    the only result of call is set date/time of modification and
4271
    the only result of call is set date/time of modification and
4255
    access to the current date/time.
4272
    access to the current date/time.
4256
  * If there is not enough free space on disk for expansion, the
4273
  * If there is not enough free space on disk for expansion, the
4257
    function will expand to maximum possible size and then return
4274
    function will expand to maximum possible size and then return
4258
    error code 8.
4275
    error code 8.
4259
  * The function is not supported for CD (returns error code 2).
4276
  * The function is not supported for CD (returns error code 2).
4260
 
4277
 
4261
======================================================================
4278
======================================================================
4262
==== Function 70, subfunction 5 - get information on file/folder. ====
4279
==== Function 70, subfunction 5 - get information on file/folder. ====
4263
======================================================================
4280
======================================================================
4264
Parameters:
4281
Parameters:
4265
  * eax = 70 - function number
4282
  * eax = 70 - function number
4266
  * ebx = pointer to the information structure
4283
  * ebx = pointer to the information structure
4267
Format of the information structure:
4284
Format of the information structure:
4268
  * +0: dword: 5 = subfunction number
4285
  * +0: dword: 5 = subfunction number
4269
  * +4: dword: 0 (reserved)
4286
  * +4: dword: 0 (reserved)
4270
  * +8: dword: 0 (reserved)
4287
  * +8: dword: 0 (reserved)
4271
  * +12 = +0xC: dword: 0 (reserved)
4288
  * +12 = +0xC: dword: 0 (reserved)
4272
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4289
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4273
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4290
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4274
    given in the general description
4291
    given in the general description
4275
    or
4292
    or
4276
  * +20 = +0x14: db 0
4293
  * +20 = +0x14: db 0
4277
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4294
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4278
Returned value:
4295
Returned value:
4279
  * eax = 0 - success, otherwise file system error code
4296
  * eax = 0 - success, otherwise file system error code
4280
  * ebx destroyed
4297
  * ebx destroyed
4281
Information on file is returned in the BDFE format (block of data
4298
Information on file is returned in the BDFE format (block of data
4282
for folder entry), explained in the description of
4299
for folder entry), explained in the description of
4283
subfunction 1, but without filename
4300
subfunction 1, but without filename
4284
(i.e. only first 40 = 0x28 bytes).
4301
(i.e. only first 40 = 0x28 bytes).
4285
Remarks:
4302
Remarks:
4286
  * The function does not support virtual folders such as /, /rd and
4303
  * The function does not support virtual folders such as /, /rd and
4287
    root folders like /rd/1.
4304
    root folders like /rd/1.
4288
 
4305
 
4289
======================================================================
4306
======================================================================
4290
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4307
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4291
======================================================================
4308
======================================================================
4292
Parameters:
4309
Parameters:
4293
  * eax = 70 - function number
4310
  * eax = 70 - function number
4294
  * ebx = pointer to the information structure
4311
  * ebx = pointer to the information structure
4295
Format of the information structure:
4312
Format of the information structure:
4296
  * +0: dword: 6 = subfunction number
4313
  * +0: dword: 6 = subfunction number
4297
  * +4: dword: 0 (reserved)
4314
  * +4: dword: 0 (reserved)
4298
  * +8: dword: 0 (reserved)
4315
  * +8: dword: 0 (reserved)
4299
  * +12 = +0xC: dword: 0 (reserved)
4316
  * +12 = +0xC: dword: 0 (reserved)
4300
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4317
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4301
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4318
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4302
    given in the general description
4319
    given in the general description
4303
    or
4320
    or
4304
  * +20 = +0x14: db 0
4321
  * +20 = +0x14: db 0
4305
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4322
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4306
Returned value:
4323
Returned value:
4307
  * eax = 0 - success, otherwise file system error code
4324
  * eax = 0 - success, otherwise file system error code
4308
  * ebx destroyed
4325
  * ebx destroyed
4309
File attributes are first 32 bytes in BDFE (block of data
4326
File attributes are first 32 bytes in BDFE (block of data
4310
for folder entry), explained in the description of subfunction 1
4327
for folder entry), explained in the description of subfunction 1
4311
(that is, without name and size of file). Attribute
4328
(that is, without name and size of file). Attribute
4312
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4329
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4313
Byte +4 (name format) is ignored.
4330
Byte +4 (name format) is ignored.
4314
Remarks:
4331
Remarks:
4315
  * The function does not support virtual folders such as /, /rd and
4332
  * The function does not support virtual folders such as /, /rd and
4316
    root folders like /rd/1.
4333
    root folders like /rd/1.
4317
  * The function is not supported for CD (returns error code 2).
4334
  * The function is not supported for CD (returns error code 2).
4318
 
4335
 
4319
======================================================================
4336
======================================================================
4320
=========== Function 70, subfunction 7 - start application. ==========
4337
=========== Function 70, subfunction 7 - start application. ==========
4321
======================================================================
4338
======================================================================
4322
Parameters:
4339
Parameters:
4323
  * eax = 70 - function number
4340
  * eax = 70 - function number
4324
  * ebx = pointer to the information structure
4341
  * ebx = pointer to the information structure
4325
Format of the information structure:
4342
Format of the information structure:
4326
  * +0: dword: 7 = subfunction number
4343
  * +0: dword: 7 = subfunction number
4327
  * +4: dword: flags field:
4344
  * +4: dword: flags field:
4328
    * áèò 0: start process as debugged
4345
    * áèò 0: start process as debugged
4329
    * other bits are reserved and must be set to 0
4346
    * other bits are reserved and must be set to 0
4330
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4347
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4331
  * +12 = +0xC: dword: 0 (reserved)
4348
  * +12 = +0xC: dword: 0 (reserved)
4332
  * +16 = +0x10: dword: 0 (reserved)
4349
  * +16 = +0x10: dword: 0 (reserved)
4333
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4350
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4334
    given in the general description
4351
    given in the general description
4335
    or
4352
    or
4336
  * +20 = +0x14: db 0
4353
  * +20 = +0x14: db 0
4337
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4354
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4338
Returned value:
4355
Returned value:
4339
  * eax > 0 - program is loaded, eax contains PID
4356
  * eax > 0 - program is loaded, eax contains PID
4340
  * eax < 0 - an error has occured, -eax contains
4357
  * eax < 0 - an error has occured, -eax contains
4341
    file system error code
4358
    file system error code
4342
  * ebx destroyed
4359
  * ebx destroyed
4343
Remarks:
4360
Remarks:
4344
  * Command line must be terminated by the character with the code 0
4361
  * Command line must be terminated by the character with the code 0
4345
    (ASCIIZ-string); function takes into account either all characters
4362
    (ASCIIZ-string); function takes into account either all characters
4346
    up to terminating zero inclusively or first 256 character
4363
    up to terminating zero inclusively or first 256 character
4347
    regarding what is less.
4364
    regarding what is less.
4348
  * If the process is started as debugged, it is created in
4365
  * If the process is started as debugged, it is created in
4349
    the suspended state; to run use subfunction 5 of function 69.
4366
    the suspended state; to run use subfunction 5 of function 69.
4350
 
4367
 
4351
======================================================================
4368
======================================================================
4352
========== Function 70, subfunction 8 - delete file/folder. ==========
4369
========== Function 70, subfunction 8 - delete file/folder. ==========
4353
======================================================================
4370
======================================================================
4354
Parameters:
4371
Parameters:
4355
  * eax = 70 - function number
4372
  * eax = 70 - function number
4356
  * ebx = pointer to the information structure
4373
  * ebx = pointer to the information structure
4357
Format of the information structure:
4374
Format of the information structure:
4358
  * +0: dword: 8 = subfunction number
4375
  * +0: dword: 8 = subfunction number
4359
  * +4: dword: 0 (reserved)
4376
  * +4: dword: 0 (reserved)
4360
  * +8: dword: 0 (reserved)
4377
  * +8: dword: 0 (reserved)
4361
  * +12 = +0xC: dword: 0 (reserved)
4378
  * +12 = +0xC: dword: 0 (reserved)
4362
  * +16 = +0x10: dword: 0 (reserved)
4379
  * +16 = +0x10: dword: 0 (reserved)
4363
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4380
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4364
    given in the general description
4381
    given in the general description
4365
    or
4382
    or
4366
  * +20 = +0x14: db 0
4383
  * +20 = +0x14: db 0
4367
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4384
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4368
Returned value:
4385
Returned value:
4369
  * eax = 0 - success, otherwise file system error code
4386
  * eax = 0 - success, otherwise file system error code
4370
  * ebx destroyed
4387
  * ebx destroyed
4371
Remarks:
4388
Remarks:
4372
  * The function is not supported for CD (returns error code 2).
4389
  * The function is not supported for CD (returns error code 2).
4373
  * The function can delete only empty folders (attempt to delete
4390
  * The function can delete only empty folders (attempt to delete
4374
    nonempty folder results in error with code 10, "access denied").
4391
    nonempty folder results in error with code 10, "access denied").
4375
 
4392
 
4376
======================================================================
4393
======================================================================
4377
============= Function 70, subfunction 9 - create folder. ============
4394
============= Function 70, subfunction 9 - create folder. ============
4378
======================================================================
4395
======================================================================
4379
Parameters:
4396
Parameters:
4380
  * eax = 70 - function number
4397
  * eax = 70 - function number
4381
  * ebx = pointer to the information structure
4398
  * ebx = pointer to the information structure
4382
Format of the information structure:
4399
Format of the information structure:
4383
  * +0: dword: 9 = subfunction number
4400
  * +0: dword: 9 = subfunction number
4384
  * +4: dword: 0 (reserved)
4401
  * +4: dword: 0 (reserved)
4385
  * +8: dword: 0 (reserved)
4402
  * +8: dword: 0 (reserved)
4386
  * +12 = +0xC: dword: 0 (reserved)
4403
  * +12 = +0xC: dword: 0 (reserved)
4387
  * +16 = +0x10: dword: 0 (reserved)
4404
  * +16 = +0x10: dword: 0 (reserved)
4388
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4405
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4389
    given in the general description
4406
    given in the general description
4390
    or
4407
    or
4391
  * +20 = +0x14: db 0
4408
  * +20 = +0x14: db 0
4392
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
4409
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
4393
Returned value:
4410
Returned value:
4394
  * eax = 0 - success, otherwise file system error code
4411
  * eax = 0 - success, otherwise file system error code
4395
  * ebx destroyed
4412
  * ebx destroyed
4396
Remarks:
4413
Remarks:
4397
  * The function is not supported for CD (returns error code 2).
4414
  * The function is not supported for CD (returns error code 2).
4398
  * The parent folder must already exist.
4415
  * The parent folder must already exist.
4399
  * If target folder already exists, function returns success (eax=0).
4416
  * If target folder already exists, function returns success (eax=0).
4400
 
4417
 
4401
======================================================================
4418
======================================================================
4402
========== Function 71, subfunction 1 - set window caption. ==========
4419
========== Function 71, subfunction 1 - set window caption. ==========
4403
======================================================================
4420
======================================================================
4404
Parameters:
4421
Parameters:
4405
  * eax = 71 - function number
4422
  * eax = 71 - function number
4406
  * ebx = 1 - subfunction number
4423
  * ebx = 1 - subfunction number
4407
  * ecx = pointer to caption string
4424
  * ecx = pointer to caption string
4408
Returned value:
4425
Returned value:
4409
  * function does not return value
4426
  * function does not return value
4410
Remarks:
4427
Remarks:
4411
  * String must be in the ASCIIZ-format. Disregarding real string
4428
  * String must be in the ASCIIZ-format. Disregarding real string
4412
    length, no more than 255 characters are drawn.
4429
    length, no more than 255 characters are drawn.
4413
  * Pass NULL in ecx to remove caption.
4430
  * Pass NULL in ecx to remove caption.
4414
 
4431
 
4415
======================================================================
4432
======================================================================
4416
=============== Function 72 - send message to a window. ==============
4433
=============== Function 72 - send message to a window. ==============
4417
======================================================================
4434
======================================================================
4418
 
4435
 
4419
- Subfunction 1 - send message with parameter to the active window. --
4436
- Subfunction 1 - send message with parameter to the active window. --
4420
Parameters:
4437
Parameters:
4421
  * eax = 72 - function number
4438
  * eax = 72 - function number
4422
  * ebx = 1 - subfunction number
4439
  * ebx = 1 - subfunction number
4423
  * ecx = event code: 2 or 3
4440
  * ecx = event code: 2 or 3
4424
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
4441
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
4425
Returned value:
4442
Returned value:
4426
  * eax = 0 - success
4443
  * eax = 0 - success
4427
  * eax = 1 - buffer is full
4444
  * eax = 1 - buffer is full
4428
 
4445
 
4429
======================================================================
4446
======================================================================
4430
=============== Function -1 - terminate thread/process ===============
4447
=============== Function -1 - terminate thread/process ===============
4431
======================================================================
4448
======================================================================
4432
Parameters:
4449
Parameters:
4433
  * eax = -1 - function number
4450
  * eax = -1 - function number
4434
Returned value:
4451
Returned value:
4435
  * function does not return neither value nor control
4452
  * function does not return neither value nor control
4436
Remarks:
4453
Remarks:
4437
  * If the process did not create threads obviously, it has only
4454
  * If the process did not create threads obviously, it has only
4438
    one thread, which termination results in process termination.
4455
    one thread, which termination results in process termination.
4439
  * If the current thread is last in the process, its termination
4456
  * If the current thread is last in the process, its termination
4440
    also results in process terminates.
4457
    also results in process terminates.
4441
  * This function terminates the current thread. Other thread can be
4458
  * This function terminates the current thread. Other thread can be
4442
    killed by call to subfunction 2 of function 18.
4459
    killed by call to subfunction 2 of function 18.
4443
 
4460
 
4444
======================================================================
4461
======================================================================
4445
=========================== List of events ===========================
4462
=========================== List of events ===========================
4446
======================================================================
4463
======================================================================
4447
Next event can be retrieved by the call of one from functions 10
4464
Next event can be retrieved by the call of one from functions 10
4448
(to wait for event), 11 (to check without waiting), 23
4465
(to wait for event), 11 (to check without waiting), 23
4449
(to wait during the given time).
4466
(to wait during the given time).
4450
These functions return only those events, which enter into a mask set
4467
These functions return only those events, which enter into a mask set
4451
by function 40. By default it is first three,
4468
by function 40. By default it is first three,
4452
there is enough for most applications.
4469
there is enough for most applications.
4453
Codes of events:
4470
Codes of events:
4454
  * 1 = redraw event (is reset by call to function 0)
4471
  * 1 = redraw event (is reset by call to function 0)
4455
  * 2 = key on keyboard is pressed (acts, only when the window is
4472
  * 2 = key on keyboard is pressed (acts, only when the window is
4456
    active) or hotkey is pressed; is reset, when all keys from
4473
    active) or hotkey is pressed; is reset, when all keys from
4457
    the buffer are read out by function 2
4474
    the buffer are read out by function 2
4458
  * 3 = button is pressed, defined earlier by function 8
4475
  * 3 = button is pressed, defined earlier by function 8
4459
    (or close button, created implicitly by function 0;
4476
    (or close button, created implicitly by function 0;
4460
    minimize button is handled by the system and sends no message;
4477
    minimize button is handled by the system and sends no message;
4461
    acts, only when the window is active;
4478
    acts, only when the window is active;
4462
    is reset when all buttons from the buffer
4479
    is reset when all buttons from the buffer
4463
    are read out by function 17)
4480
    are read out by function 17)
4464
  * 4 = reserved (in current implementation never comes even after
4481
  * 4 = reserved (in current implementation never comes even after
4465
    unmasking by function 40)
4482
    unmasking by function 40)
4466
  * 5 = kernel finished redrawing of the desktop background
4483
  * 5 = kernel finished redrawing of the desktop background
4467
  * 6 = mouse event (something happened - button pressing or moving;
4484
  * 6 = mouse event (something happened - button pressing or moving;
4468
    is reset at reading)
4485
    is reset at reading)
4469
  * 7 = IPC event (see function 60 -
4486
  * 7 = IPC event (see function 60 -
4470
    Inter Process Communication; is reset at reading)
4487
    Inter Process Communication; is reset at reading)
4471
  * 8 = network event (is reset at reading)
4488
  * 8 = network event (is reset at reading)
4472
  * 9 = debug event (is reset at reading; see
4489
  * 9 = debug event (is reset at reading; see
4473
    debug subsystem)
4490
    debug subsystem)
4474
  * 16..31 = event with appropriate IRQ
4491
  * 16..31 = event with appropriate IRQ
4475
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4492
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4476
 
4493
 
4477
======================================================================
4494
======================================================================
4478
=================== Error codes of the file system ===================
4495
=================== Error codes of the file system ===================
4479
======================================================================
4496
======================================================================
4480
  * 0 = success
4497
  * 0 = success
4481
  * 1 = base and/or partition of a hard disk is not defined
4498
  * 1 = base and/or partition of a hard disk is not defined
4482
    (by subfunctions 7, 8 of function 21)
4499
    (by subfunctions 7, 8 of function 21)
4483
  * 2 = function is not supported for the given file system
4500
  * 2 = function is not supported for the given file system
4484
  * 3 = unknown file system
4501
  * 3 = unknown file system
4485
  * 4 = reserved, is never returned in the current implementation
4502
  * 4 = reserved, is never returned in the current implementation
4486
  * 5 = file not found
4503
  * 5 = file not found
4487
  * 6 = end of file, EOF
4504
  * 6 = end of file, EOF
4488
  * 7 = pointer lies outside of application memory
4505
  * 7 = pointer lies outside of application memory
4489
  * 8 = disk is full
4506
  * 8 = disk is full
4490
  * 9 = FAT table is destroyed
4507
  * 9 = FAT table is destroyed
4491
  * 10 = access denied
4508
  * 10 = access denied
4492
  * 11 = device error
4509
  * 11 = device error
4493
Application start functions can return also following errors:
4510
Application start functions can return also following errors:
4494
  * 30 = 0x1E = not enough memory
4511
  * 30 = 0x1E = not enough memory
4495
  * 31 = 0x1F = file is not executable
4512
  * 31 = 0x1F = file is not executable
4496
  * 32 = 0x20 = too many processes
4513
  * 32 = 0x20 = too many processes
4497
>
4514
>
4498
>
4515
>