Subversion Repositories Kolibri OS

Rev

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

Rev 193 Rev 277
1
SYSTEM FUNCTIONS of OS Kolibri 0.6.0.0
1
SYSTEM FUNCTIONS of OS Kolibri 0.6.3.0
2
 
2
 
3
Number of the function is located in the register eax.
3
Number of the function is located in the register eax.
4
The call of the system function is executed by "int 0x40" command.
4
The call of the system function is executed by "int 0x40" command.
5
All registers except explicitly declared in the returned value,
5
All registers except explicitly declared in the returned value,
6
    including eflags, are preserved.
6
    including eflags, are preserved.
7
 
7
 
8
 
8
 
9
======================================================================
9
======================================================================
10
============== Function 0 - define and draw the window. ==============
10
============== Function 0 - define and draw the window. ==============
11
======================================================================
11
======================================================================
12
Defines an application window. Draws a frame of the window, header and
12
Defines an application window. Draws a frame of the window, header and
13
working area. For skinned windows defines standard close and minimize
13
working area. For skinned windows defines standard close and minimize
14
buttons.
14
buttons.
15
Parameters:
15
Parameters:
16
  * eax = 0 - function number
16
  * eax = 0 - function number
17
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
17
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
18
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
18
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
19
  * edx = 0xXYRRGGBB, where:
19
  * edx = 0xXYRRGGBB, where:
20
    * Y = style of the window:
20
    * Y = style of the window:
21
      * Y=0 - type I - fixed-size window
21
      * Y=0 - type I - fixed-size window
22
      * Y=1 - only define window area, draw nothing
22
      * Y=1 - only define window area, draw nothing
23
      * Y=2 - type II - variable-size window
23
      * Y=2 - type II - variable-size window
24
      * Y=3 - skinned window
24
      * Y=3 - skinned window
25
      * other possible values (from 4 up to 15) are reserved,
25
      * other possible values (from 4 up to 15) are reserved,
26
        function call with such Y is ignored
26
        function call with such Y is ignored
27
    * RR, GG, BB = accordingly red, green, blue components of a color
27
    * RR, GG, BB = accordingly red, green, blue components of a color
28
      of the working area of the window (are ignored for style Y=2)
28
      of the working area of the window (are ignored for style Y=2)
29
    * X = DCBA (bits)
29
    * X = DCBA (bits)
30
      * A = 1 - window has caption; for style Y=3 caption string
30
      * A = 1 - window has caption; for style Y=3 caption string
31
                  must be passed in edi, for other styles use
31
                  must be passed in edi, for other styles use
32
                  subfunction 1 of function 71
32
                  subfunction 1 of function 71
33
      * B = 1 - coordinates of all graphics primitives are relative to
33
      * B = 1 - coordinates of all graphics primitives are relative to
34
                  window client area
34
                  window client area
35
      * C is reserved (set to 0)
35
      * C is reserved (set to 0)
36
      * D = 0 - normal filling of the working area, 1 - gradient
36
      * D = 0 - normal filling of the working area, 1 - gradient
37
    The following parameters are intended for windows
37
    The following parameters are intended for windows
38
    of a type I and II, and ignored for styles Y=1,3:
38
    of a type I and II, and ignored for styles Y=1,3:
39
  * esi = 0xXYRRGGBB - color of the header
39
  * esi = 0xXYRRGGBB - color of the header
40
    * RR, GG, BB define color
40
    * RR, GG, BB define color
41
    * Y=0 - usual window, Y=1 - unmovable window
41
    * Y=0 - usual window, Y=1 - unmovable window
42
    * X defines a gradient of header: X=0 - no gradient,
42
    * X defines a gradient of header: X=0 - no gradient,
43
      X=8 - usual gradient,
43
      X=8 - usual gradient,
44
      for windows of a type II X=4 - negative gradient
44
      for windows of a type II X=4 - negative gradient
45
    * other values of X and Y are reserved
45
    * other values of X and Y are reserved
46
  * edi = 0x00RRGGBB - color of the frame
46
  * edi = 0x00RRGGBB - color of the frame
47
Returned value:
47
Returned value:
48
  * function does not return value
48
  * function does not return value
49
Remarks:
49
Remarks:
50
  * Position and sizes of the window are installed by the first
50
  * Position and sizes of the window are installed by the first
51
    call of this function and are ignored at subsequent; to change
51
    call of this function and are ignored at subsequent; to change
52
    position and/or sizes of already created window use function 67.
52
    position and/or sizes of already created window use function 67.
53
  * For windows with style Y=3 and caption (A=1) caption string is set
53
  * For windows with style Y=3 and caption (A=1) caption string is set
54
    by the first call of this function and is ignored at subsequent
54
    by the first call of this function and is ignored at subsequent
55
    (strictly speaking, is ignored after a call to subfunction 2
55
    (strictly speaking, is ignored after a call to subfunction 2
56
    of function 12 - end redraw); to change caption of already created
56
    of function 12 - end redraw); to change caption of already created
57
    window use subfunction 1 of function 71.
57
    window use subfunction 1 of function 71.
58
  * If the window has appropriate styles, position and/or sizes can be
58
  * If the window has appropriate styles, position and/or sizes can be
59
    changed by user. Current position and sizes can be obtained
59
    changed by user. Current position and sizes can be obtained
60
    by function 9.
60
    by function 9.
61
  * The window must fit on the screen. If the transferred
61
  * The window must fit on the screen. If the transferred
62
    coordinates and sizes do not satisfy to this condition,
62
    coordinates and sizes do not satisfy to this condition,
63
    appropriate coordinate (or, probably, both) is considered as zero,
63
    appropriate coordinate (or, probably, both) is considered as zero,
64
    and if it does not help too, the appropriate size
64
    and if it does not help too, the appropriate size
65
    (or, probably, both) is installed in a size of the screen.
65
    (or, probably, both) is installed in a size of the screen.
66
    
66
    
67
    Further let us designate xpos,ypos,xsize,ysize - values passed
67
    Further let us designate xpos,ypos,xsize,ysize - values passed
68
    in ebx,ecx. The coordinates are resulted concerning
68
    in ebx,ecx. The coordinates are resulted concerning
69
    the left upper corner of the window, which, thus, is set as (0,0),
69
    the left upper corner of the window, which, thus, is set as (0,0),
70
    coordinates of the right lower corner essence (xsize,ysize).
70
    coordinates of the right lower corner essence (xsize,ysize).
71
  * The sizes of the window are understood in sence of coordinates
71
  * The sizes of the window are understood in sence of coordinates
72
    of the right lower corner. This concerns all other functions too.
72
    of the right lower corner. This concerns all other functions too.
73
    It means, that the real sizes are on 1 pixel more.
73
    It means, that the real sizes are on 1 pixel more.
74
  * The window of type I looks as follows:
74
  * The window of type I looks as follows:
75
    * draw external frame of color indicated in edi, 1 pixel in width
75
    * draw external frame of color indicated in edi, 1 pixel in width
76
    * draw header - rectangle with the left upper corner (1,1) and
76
    * draw header - rectangle with the left upper corner (1,1) and
77
      right lower (xsize-1,min(25,ysize)) color indicated in esi
77
      right lower (xsize-1,min(25,ysize)) color indicated in esi
78
      (taking a gradient into account)
78
      (taking a gradient into account)
79
    * if ysize>=26, fill the working area of the window -
79
    * if ysize>=26, fill the working area of the window -
80
      rectangle with the left upper corner (1,21) and right lower
80
      rectangle with the left upper corner (1,21) and right lower
81
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
81
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
82
      indicated in edx (taking a gradient into account)
82
      indicated in edx (taking a gradient into account)
83
    * if A=1 and caption has been already set by subfunction 1
83
    * if A=1 and caption has been already set by subfunction 1
84
      of function 71, it is drawn in the corresponding place of header
84
      of function 71, it is drawn in the corresponding place of header
85
  * The window of style Y=1 looks as follows:
85
  * The window of style Y=1 looks as follows:
86
    * completely defined by the application
86
    * completely defined by the application
87
  * The window of type II looks as follows:
87
  * The window of type II looks as follows:
88
    * draw external frame of width 1 pixel with the "shaded" color
88
    * draw external frame of width 1 pixel with the "shaded" color
89
      edi (all components of the color decrease twice)
89
      edi (all components of the color decrease twice)
90
    * draw intermediate frame of width 3 pixels with color edi
90
    * draw intermediate frame of width 3 pixels with color edi
91
    * draw internal frame of width 1 pixel with the "shaded" color edi
91
    * draw internal frame of width 1 pixel with the "shaded" color edi
92
    * draw header - rectangle with the left upper corner (4,4)
92
    * draw header - rectangle with the left upper corner (4,4)
93
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
93
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
94
      (taking a gradient into account)
94
      (taking a gradient into account)
95
    * if ysize>=26, fill the working area of the window -
95
    * if ysize>=26, fill the working area of the window -
96
      rectangle with the left upper corner (5,20) and right lower
96
      rectangle with the left upper corner (5,20) and right lower
97
      (xsize-5,ysize-5) with color indicated in edx
97
      (xsize-5,ysize-5) with color indicated in edx
98
      (taking a gradient into account)
98
      (taking a gradient into account)
99
    * if A=1 and caption has been already set by subfunction 1
99
    * if A=1 and caption has been already set by subfunction 1
100
      of function 71, it is drawn in the corresponding place of header
100
      of function 71, it is drawn in the corresponding place of header
101
  * The skinned window looks as follows:
101
  * The skinned window looks as follows:
102
    * draw external frame of width 1 pixel
102
    * draw external frame of width 1 pixel
103
      with color 'outer' from the skin
103
      with color 'outer' from the skin
104
    * draw intermediate frame of width 3 pixel
104
    * draw intermediate frame of width 3 pixel
105
      with color 'frame' from the skin
105
      with color 'frame' from the skin
106
    * draw internal frame of width 1 pixel
106
    * draw internal frame of width 1 pixel
107
      with color 'inner' from the skin
107
      with color 'inner' from the skin
108
    * draw header (on bitmaps from the skin) in a rectangle
108
    * draw header (on bitmaps from the skin) in a rectangle
109
      (0,0) - (xsize,_skinh-1)
109
      (0,0) - (xsize,_skinh-1)
110
    * if ysize>=26, fill the working area of the window -
110
    * if ysize>=26, fill the working area of the window -
111
      rectangle with the left upper corner (5,_skinh) and right lower
111
      rectangle with the left upper corner (5,_skinh) and right lower
112
      (xsize-5,ysize-5) with color indicated in edx
112
      (xsize-5,ysize-5) with color indicated in edx
113
      (taking a gradient into account)
113
      (taking a gradient into account)
114
    * define two standard buttons: close and minimize
114
    * define two standard buttons: close and minimize
115
      (see function 8)
115
      (see function 8)
116
    * if A=1 and edi contains (nonzero) pointer to caption string,
116
    * if A=1 and edi contains (nonzero) pointer to caption string,
117
      it is drawn in place in header defined in the skin
117
      it is drawn in place in header defined in the skin
118
    * value _skinh is accessible as the result of call
118
    * value _skinh is accessible as the result of call
119
      subfunction 4 of function 48
119
      subfunction 4 of function 48
120
 
120
 
121
======================================================================
121
======================================================================
122
================ Function 1 - put pixel in the window. ===============
122
================ Function 1 - put pixel in the window. ===============
123
======================================================================
123
======================================================================
124
Parameters:
124
Parameters:
125
  * eax = 1 - function number
125
  * eax = 1 - function number
126
  * ebx = x-coordinate (relative to the window)
126
  * ebx = x-coordinate (relative to the window)
127
  * ecx = y-coordinate (relative to the window)
127
  * ecx = y-coordinate (relative to the window)
128
  * edx = 0x00RRGGBB - color of a pixel
128
  * edx = 0x00RRGGBB - color of a pixel
129
    edx = 0x01xxxxxx - invert color of a pixel
129
    edx = 0x01xxxxxx - invert color of a pixel
130
          (low 24 bits are ignored)
130
          (low 24 bits are ignored)
131
Returned value:
131
Returned value:
132
  * function does not return value
132
  * function does not return value
133
 
133
 
134
======================================================================
134
======================================================================
135
============ Function 2 - get the code of the pressed key. ===========
135
============ Function 2 - get the code of the pressed key. ===========
136
======================================================================
136
======================================================================
137
Takes away the code of the pressed key from the buffer.
137
Takes away the code of the pressed key from the buffer.
138
Parameters:
138
Parameters:
139
  * eax = 2 - function number
139
  * eax = 2 - function number
140
Returned value:
140
Returned value:
141
  * if the buffer is empty, function returns eax=1
141
  * if the buffer is empty, function returns eax=1
142
  * if the buffer is not empty, function returns al=0,
142
  * if the buffer is not empty, function returns al=0,
143
    ah=code of the pressed key, high word of eax is zero
143
    ah=code of the pressed key, high word of eax is zero
144
  * if there is "hotkey", function returns al=2,
144
  * if there is "hotkey", function returns al=2,
145
    ah=scancode of the pressed key (0 for control keys),
145
    ah=scancode of the pressed key (0 for control keys),
146
    high word of eax contains a status of control keys at the moment
146
    high word of eax contains a status of control keys at the moment
147
    of pressing a hotkey
147
    of pressing a hotkey
148
Remarks:
148
Remarks:
149
  * There is a common system buffer of the pressed keys
149
  * There is a common system buffer of the pressed keys
150
    by a size of 120 bytes, organized as queue.
150
    by a size of 120 bytes, organized as queue.
151
  * There is one more common system buffer on 120 "hotkeys".
151
  * There is one more common system buffer on 120 "hotkeys".
152
  * If the application with the inactive window calls this function,
152
  * If the application with the inactive window calls this function,
153
    the buffer of the pressed keys is considered to be empty.
153
    the buffer of the pressed keys is considered to be empty.
154
  * By default this function returns ASCII-codes; to switch
154
  * By default this function returns ASCII-codes; to switch
155
    to the scancodes mode (and back) use function 66.
155
    to the scancodes mode (and back) use function 66.
156
    However, hotkeys are always notificated as scancodes.
156
    However, hotkeys are always notificated as scancodes.
157
  * To find out, what keys correspond to what codes, start
157
  * To find out, what keys correspond to what codes, start
158
    the application keyascii and scancode.
158
    the application keyascii and scancode.
159
  * Scancodes come directly from keyboard and are fixed;
159
  * Scancodes come directly from keyboard and are fixed;
160
    ASCII-codes turn out with usage of the conversion tables,
160
    ASCII-codes turn out with usage of the conversion tables,
161
    which can be set by subfunction 2 of function 21
161
    which can be set by subfunction 2 of function 21
162
    and get by subfunction 2 of function 26.
162
    and get by subfunction 2 of function 26.
163
  * As a consequence, ASCII-codes take into account current
163
  * As a consequence, ASCII-codes take into account current
164
    keyboard layout (rus/en) as opposed to scancodes.
164
    keyboard layout (rus/en) as opposed to scancodes.
165
  * This function notifies only about those hotkeys, which were
165
  * This function notifies only about those hotkeys, which were
166
    defined by this thread by subfunction 4 of function 66.
166
    defined by this thread by subfunction 4 of function 66.
167
 
167
 
168
======================================================================
168
======================================================================
169
==================== Function 3 - get system time. ===================
169
==================== Function 3 - get system time. ===================
170
======================================================================
170
======================================================================
171
Parameters:
171
Parameters:
172
  * eax = 3 - function number
172
  * eax = 3 - function number
173
Returned value:
173
Returned value:
174
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
174
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
175
  * each item is BCD-number, for example,
175
  * each item is BCD-number, for example,
176
    for time 23:59:59 function returns 0x00595923
176
    for time 23:59:59 function returns 0x00595923
177
Remarks:
177
Remarks:
178
  * See also subfunction 9 of function 26 - get time from
178
  * See also subfunction 9 of function 26 - get time from
179
    the moment of start of the system; it is more convenient, because
179
    the moment of start of the system; it is more convenient, because
180
    returns simply DWORD-value of the time counter.
180
    returns simply DWORD-value of the time counter.
181
  * System time can be set by function 22.
181
  * System time can be set by function 22.
182
 
182
 
183
======================================================================
183
======================================================================
184
============ Function 4 - draw text string in the window. ============
184
============ Function 4 - draw text string in the window. ============
185
======================================================================
185
======================================================================
186
Parameters:
186
Parameters:
187
  * eax = 4 - function number
187
  * eax = 4 - function number
188
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
188
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
189
  * ecx = 0xX0RRGGBB, where
189
  * ecx = 0xX0RRGGBB, where
190
    * RR, GG, BB specify text color
190
    * RR, GG, BB specify text color
191
    * X=ABnn (bits):
191
    * X=ABnn (bits):
192
    * nn specifies the used font: 0=system monospaced,
192
    * nn specifies the used font: 0=system monospaced,
193
      1=system font of variable width
193
      1=system font of variable width
194
    * A=0 - output esi characters, A=1 - output ASCIIZ-string
194
    * A=0 - output esi characters, A=1 - output ASCIIZ-string
195
    * B=1 - fill background with the color edi
195
    * B=1 - fill background with the color edi
196
  * edx = pointer to the beginning of the string
196
  * edx = pointer to the beginning of the string
197
  * esi = for A=0 length of the string, must not exceed 255;
197
  * esi = for A=0 length of the string, must not exceed 255;
198
          for A=1 is ignored
198
          for A=1 is ignored
199
Returned value:
199
Returned value:
200
  * function does not return value
200
  * function does not return value
201
Remarks:
201
Remarks:
202
  * First system font is read out at loading from the file char.mt,
202
  * First system font is read out at loading from the file char.mt,
203
    second - from char2.mt.
203
    second - from char2.mt.
204
  * Both fonts have height 9 pixels, width of the monospaced font
204
  * Both fonts have height 9 pixels, width of the monospaced font
205
    is equal to 6 pixels.
205
    is equal to 6 pixels.
206
 
206
 
207
======================================================================
207
======================================================================
208
========================= Function 5 - delay. ========================
208
========================= Function 5 - delay. ========================
209
======================================================================
209
======================================================================
210
Delays execution of the program on the given time.
210
Delays execution of the program on the given time.
211
Parameters:
211
Parameters:
212
  * eax = 5 - function number
212
  * eax = 5 - function number
213
  * ebx = time in the 1/100 of second
213
  * ebx = time in the 1/100 of second
214
Returned value:
214
Returned value:
215
  * function does not return value
215
  * function does not return value
216
Remarks:
216
Remarks:
217
  * Passing ebx=0 does not transfer control to the next process
217
  * Passing ebx=0 does not transfer control to the next process
218
    and does not make any operations at all. If it is really required
218
    and does not make any operations at all. If it is really required
219
    to transfer control to the next process (to complete a current
219
    to transfer control to the next process (to complete a current
220
    time slice), use subfunction 1 of function 68.
220
    time slice), use subfunction 1 of function 68.
221
  * At current implementation there will be an immediate return from
221
  * At current implementation there will be an immediate return from
222
    the function, if the addition of ebx with current value of
222
    the function, if the addition of ebx with current value of
223
    time counter will call 32-bit overflow.
223
    time counter will call 32-bit overflow.
224
 
224
 
225
======================================================================
225
======================================================================
226
============== Function 6 - read the file from ramdisk. ==============
226
============== Function 6 - read the file from ramdisk. ==============
227
======================================================================
227
======================================================================
228
Parameters:
228
Parameters:
229
  * eax = 6 - function number
229
  * eax = 6 - function number
230
  * ebx = pointer to the filename
230
  * ebx = pointer to the filename
231
  * ecx = number of start block, beginning from 1;
231
  * ecx = number of start block, beginning from 1;
232
    ecx=0 - read from the beginning of the file (same as ecx=1)
232
    ecx=0 - read from the beginning of the file (same as ecx=1)
233
  * edx = number of blocks to read;
233
  * edx = number of blocks to read;
234
    edx=0 - read one block (same as edx=1)
234
    edx=0 - read one block (same as edx=1)
235
  * esi = pointer to memory area for the data
235
  * esi = pointer to memory area for the data
236
Returned value:
236
Returned value:
237
  * eax = file size in bytes, if the file was successfully read
237
  * eax = file size in bytes, if the file was successfully read
238
  * eax = -1, if the file was not found
238
  * eax = -1, if the file was not found
239
Remarks:
239
Remarks:
240
  * This function is out-of-date; function 70 allows
240
  * This function is out-of-date; function 70 allows
241
    to fulfil the same operations with the extended possibilities.
241
    to fulfil the same operations with the extended possibilities.
242
  * Block = 512 bytes.
242
  * Block = 512 bytes.
243
  * For reading all file you can specify the certainly large value
243
  * For reading all file you can specify the certainly large value
244
    in edx, for example, edx = -1; but in this case be ready that
244
    in edx, for example, edx = -1; but in this case be ready that
245
    the program will "fall", if the file will appear too large and can
245
    the program will "fall", if the file will appear too large and can
246
    not be placed in the program memory.
246
    not be placed in the program memory.
247
  * The filename must be either in the format 8+3 characters
247
  * The filename must be either in the format 8+3 characters
248
    (first 8 characters - name itself, last 3 - extension,
248
    (first 8 characters - name itself, last 3 - extension,
249
    the short names and extensions are supplemented with spaces),
249
    the short names and extensions are supplemented with spaces),
250
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
250
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
251
    (name no more than 8 characters, dot, extension 3 characters
251
    (name no more than 8 characters, dot, extension 3 characters
252
    supplemented if necessary by spaces).
252
    supplemented if necessary by spaces).
253
    The filename must be written with capital letters. The terminating
253
    The filename must be written with capital letters. The terminating
254
    character with code 0 is not necessary (not ASCIIZ-string).
254
    character with code 0 is not necessary (not ASCIIZ-string).
255
  * This function does not support folders on the ramdisk.
255
  * This function does not support folders on the ramdisk.
256
 
256
 
257
======================================================================
257
======================================================================
258
=============== Function 7 - draw image in the window. ===============
258
=============== Function 7 - draw image in the window. ===============
259
======================================================================
259
======================================================================
260
Paramters:
260
Paramters:
261
  * eax = 7 - function number
261
  * eax = 7 - function number
262
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
262
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
263
  * ecx = [size on axis x]*65536 + [size on axis y]
263
  * ecx = [size on axis x]*65536 + [size on axis y]
264
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
264
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
265
Returned value:
265
Returned value:
266
  * function does not return value
266
  * function does not return value
267
Remarks:
267
Remarks:
268
  * Coordinates of the image are coordinates of the upper left corner
268
  * Coordinates of the image are coordinates of the upper left corner
269
    of the image relative to the window.
269
    of the image relative to the window.
270
  * Size of the image in bytes is 3*xsize*ysize.
270
  * Size of the image in bytes is 3*xsize*ysize.
271
 
271
 
272
======================================================================
272
======================================================================
273
=============== Function 8 - define/delete the button. ===============
273
=============== Function 8 - define/delete the button. ===============
274
======================================================================
274
======================================================================
275
Parameters for button definition:
275
Parameters for button definition:
276
  * eax = 8 - function number
276
  * eax = 8 - function number
277
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
277
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
278
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
278
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
279
  * edx = 0xXYnnnnnn, where:
279
  * edx = 0xXYnnnnnn, where:
280
    * nnnnnn = identifier of the button
280
    * nnnnnn = identifier of the button
281
    * high (31st) bit of edx is cleared
281
    * high (31st) bit of edx is cleared
282
    * if 30th bit of edx is set - do not draw the button
282
    * if 30th bit of edx is set - do not draw the button
283
    * if 29th bit of edx is set - do not draw a frame
283
    * if 29th bit of edx is set - do not draw a frame
284
      at pressing the button
284
      at pressing the button
285
  * esi = 0x00RRGGBB - color of the button
285
  * esi = 0x00RRGGBB - color of the button
286
Parameters for button deleting:
286
Parameters for button deleting:
287
  * eax = 8 - function number
287
  * eax = 8 - function number
288
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
288
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
289
Returned value:
289
Returned value:
290
  * function does not return value
290
  * function does not return value
291
Remarks:
291
Remarks:
292
  * Sizes of the button must be more than 0 and less than 0x8000.
292
  * Sizes of the button must be more than 0 and less than 0x8000.
293
  * For skinned windows definition of the window
293
  * For skinned windows definition of the window
294
    (call of 0th function) creates two standard buttons -
294
    (call of 0th function) creates two standard buttons -
295
    for close of the window with identifier 1 and
295
    for close of the window with identifier 1 and
296
    for minimize of the window with identifier 0xffff.
296
    for minimize of the window with identifier 0xffff.
297
  * The creation of two buttons with same identifiers is admitted.
297
  * The creation of two buttons with same identifiers is admitted.
298
  * The button with the identifier 0xffff at pressing is interpreted
298
  * The button with the identifier 0xffff at pressing is interpreted
299
    by the system as the button of minimization, the system handles
299
    by the system as the button of minimization, the system handles
300
    such pressing independently, not accessing to the application.
300
    such pressing independently, not accessing to the application.
301
    In rest it is usual button.
301
    In rest it is usual button.
302
  * Total number of buttons for all applications is limited to 4095.
302
  * Total number of buttons for all applications is limited to 4095.
303
 
303
 
304
======================================================================
304
======================================================================
305
============ Function 9 - information on execution thread. ===========
305
============ Function 9 - information on execution thread. ===========
306
======================================================================
306
======================================================================
307
Parameters:
307
Parameters:
308
  * eax = 9 - function number
308
  * eax = 9 - function number
309
  * ebx = pointer to 1-Kb buffer
309
  * ebx = pointer to 1-Kb buffer
310
  * ecx = number of the slot of the thread
310
  * ecx = number of the slot of the thread
311
    ecx = -1 - get information on the current thread
311
    ecx = -1 - get information on the current thread
312
Returned value:
312
Returned value:
313
  * eax = maximum number of the slot of a thread
313
  * eax = maximum number of the slot of a thread
314
  * buffer pointed to by ebx contains the following information:
314
  * buffer pointed to by ebx contains the following information:
315
    * +0: dword: usage of the processor (how many time units
315
    * +0: dword: usage of the processor (how many time units
316
      per second leaves on execution of this thread)
316
      per second leaves on execution of this thread)
317
    * +4: word: position of the window of thread in the window stack
317
    * +4: word: position of the window of thread in the window stack
318
    * +6: word: (has no relation to the specified thread)
318
    * +6: word: (has no relation to the specified thread)
319
      number of the thread slot, which window has in the window stack
319
      number of the thread slot, which window has in the window stack
320
      position ecx
320
      position ecx
321
    * +8: word: reserved
321
    * +8: word: reserved
322
    * +10 = +0xA: 11 bytes: name of the process
322
    * +10 = +0xA: 11 bytes: name of the process
323
      (name of corresponding executable file in the format 8+3)
323
      (name of corresponding executable file in the format 8+3)
324
    * +21 = +0x15: byte: reserved, this byte is not changed
324
    * +21 = +0x15: byte: reserved, this byte is not changed
325
    * +22 = +0x16: dword: address of the process in memory
325
    * +22 = +0x16: dword: address of the process in memory
326
    * +26 = +0x1A: dword: size of used memory - 1
326
    * +26 = +0x1A: dword: size of used memory - 1
327
    * +30 = +0x1E: dword: identifier (PID/TID)
327
    * +30 = +0x1E: dword: identifier (PID/TID)
328
    * +34 = +0x22: dword: coordinate of the thread window on axis x
328
    * +34 = +0x22: dword: coordinate of the thread window on axis x
329
    * +38 = +0x26: dword: coordinate of the thread window on axis y
329
    * +38 = +0x26: dword: coordinate of the thread window on axis y
330
    * +42 = +0x2A: dword: size of the thread window on axis x
330
    * +42 = +0x2A: dword: size of the thread window on axis x
331
    * +46 = +0x2E: dword: size of the thread window on axis y
331
    * +46 = +0x2E: dword: size of the thread window on axis y
332
    * +50 = +0x32: word: status of the thread slot:
332
    * +50 = +0x32: word: status of the thread slot:
333
      * 0 = thread is running
333
      * 0 = thread is running
334
      * 1 = thread is suspended
334
      * 1 = thread is suspended
335
      * 2 = thread is suspended while waiting for event
335
      * 2 = thread is suspended while waiting for event
336
      * 3 = thread is terminating as a result of call to function -1
336
      * 3 = thread is terminating as a result of call to function -1
337
        or under duress as a result of call to subfunction 2
337
        or under duress as a result of call to subfunction 2
338
        of function 18 or termination of the system
338
        of function 18 or termination of the system
339
      * 4 = thread is terminating as a result of exception
339
      * 4 = thread is terminating as a result of exception
340
      * 5 = thread waits for event
340
      * 5 = thread waits for event
341
      * 9 = requested slot is free, all other information on the slot
341
      * 9 = requested slot is free, all other information on the slot
342
        is not meaningful
342
        is not meaningful
343
    * +52 = +0x34: word: reserved, this word is not changed
343
    * +52 = +0x34: word: reserved, this word is not changed
344
    * +54 = +0x36: dword: coordinate of the client area on axis x
344
    * +54 = +0x36: dword: coordinate of the client area on axis x
345
    * +58 = +0x3A: dword: coordinate of the client area on axis y
345
    * +58 = +0x3A: dword: coordinate of the client area on axis y
346
    * +62 = +0x3E: dword: width of the client area
346
    * +62 = +0x3E: dword: width of the client area
347
    * +66 = +0x42: dword: height of the client area
347
    * +66 = +0x42: dword: height of the client area
348
    * +70 = +0x46: byte: state of the window - bitfield
348
    * +70 = +0x46: byte: state of the window - bitfield
349
      * bit 0 (mask 1): window is maximized
349
      * bit 0 (mask 1): window is maximized
350
      * bit 1 (mask 2): window is minimized to panel
350
      * bit 1 (mask 2): window is minimized to panel
351
      * bit 2 (mask 4): window is rolled up
351
      * bit 2 (mask 4): window is rolled up
352
Remarks:
352
Remarks:
353
  * Slots are numbered starting from 1.
353
  * Slots are numbered starting from 1.
354
  * Returned value is not a total number of threads, because there
354
  * Returned value is not a total number of threads, because there
355
    can be free slots.
355
    can be free slots.
356
  * When process is starting, system automatically creates
356
  * When process is starting, system automatically creates
357
    execution thread.
357
    execution thread.
358
  * Function gives information on the thread. Each process has
358
  * Function gives information on the thread. Each process has
359
    at least one thread. One process can create many threads,
359
    at least one thread. One process can create many threads,
360
    in this case each thread has its own slot and the fields
360
    in this case each thread has its own slot and the fields
361
    +10, +22, +26 in these slots coincide.
361
    +10, +22, +26 in these slots coincide.
362
    Applications have no common way to define whether two threads
362
    Applications have no common way to define whether two threads
363
    belong to one process.
363
    belong to one process.
364
  * The active window - window on top of the window stack -
364
  * The active window - window on top of the window stack -
365
    receives the messages on a keyboard input. For such window
365
    receives the messages on a keyboard input. For such window
366
    the position in the window stack coincides with returned value.
366
    the position in the window stack coincides with returned value.
367
  * Slot 1 corresponds to special system thread, for which:
367
  * Slot 1 corresponds to special system thread, for which:
368
    * the window is in the bottom of the window stack, the fields
368
    * the window is in the bottom of the window stack, the fields
369
      +4 and +6 contain value 1
369
      +4 and +6 contain value 1
370
    * name of the process - "OS/IDLE" (supplemented by spaces)
370
    * name of the process - "OS/IDLE" (supplemented by spaces)
371
    * address of the process in memory is 0, size of used memory is
371
    * address of the process in memory is 0, size of used memory is
372
      16 Mb (0x1000000)
372
      16 Mb (0x1000000)
373
    * PID=1
373
    * PID=1
374
    * coordinates and sizes of the window and the client area are by
374
    * coordinates and sizes of the window and the client area are by
375
      convention set to 0
375
      convention set to 0
376
    * status of the slot is always 0 (running)
376
    * status of the slot is always 0 (running)
377
    * the execution time adds of time leaving on operations itself
377
    * the execution time adds of time leaving on operations itself
378
      and idle time in waiting for interrupt (which can be got by call
378
      and idle time in waiting for interrupt (which can be got by call
379
      to subfunction 4 of function 18).
379
      to subfunction 4 of function 18).
380
  * Beginning from slot 2, the normal applications are placed.
380
  * Beginning from slot 2, the normal applications are placed.
381
  * The normal applications are placed in memory at the address
381
  * The normal applications are placed in memory at the address
382
    0x60400000 (kernel constant 'std_application_base_address').
382
    0x60400000 (kernel constant 'std_application_base_address').
383
    There is no intersection, as each process has its own page table.
383
    There is no intersection, as each process has its own page table.
384
  * At creation of the thread it is assigned the slot
384
  * At creation of the thread it is assigned the slot
385
    in the system table and identifier (Process/Thread IDentifier =
385
    in the system table and identifier (Process/Thread IDentifier =
386
    PID/TID), which do not vary with time for given thread.
386
    PID/TID), which do not vary with time for given thread.
387
    After completion of the thread its slot can be anew used
387
    After completion of the thread its slot can be anew used
388
    for another thread. The thread identifier can not be assigned
388
    for another thread. The thread identifier can not be assigned
389
    to other thread even after completion of this thread.
389
    to other thread even after completion of this thread.
390
    Identifiers, assigned to new threads, grow monotonously.
390
    Identifiers, assigned to new threads, grow monotonously.
391
  * If the thread has not yet defined the window by call to
391
  * If the thread has not yet defined the window by call to
392
    function 0, the position and the sizes
392
    function 0, the position and the sizes
393
    of its window are considered to be zero.
393
    of its window are considered to be zero.
394
  * Coordinates of the client area are relative to the window.
394
  * Coordinates of the client area are relative to the window.
395
  * At the moment only the part of the buffer by a size
395
  * At the moment only the part of the buffer by a size
396
    71 = 0x37 bytes is used. Nevertheless it is recommended to use
396
    71 = 0x37 bytes is used. Nevertheless it is recommended to use
397
    1-Kb buffer for the future compatibility, in the future
397
    1-Kb buffer for the future compatibility, in the future
398
    some fields can be added.
398
    some fields can be added.
399
 
399
 
400
======================================================================
400
======================================================================
401
==================== Function 10 - wait for event. ===================
401
==================== Function 10 - wait for event. ===================
402
======================================================================
402
======================================================================
403
If the message queue is empty, waits for appearance of the message
403
If the message queue is empty, waits for appearance of the message
404
in queue. In this state thread does not consume CPU time.
404
in queue. In this state thread does not consume CPU time.
405
Then reads out the message from queue.
405
Then reads out the message from queue.
406
 
406
 
407
Parameters:
407
Parameters:
408
  * eax = 10 - function number
408
  * eax = 10 - function number
409
Returned value:
409
Returned value:
410
  * eax = event (see the list of events)
410
  * eax = event (see the list of events)
411
Remarks:
411
Remarks:
412
  * Those events are taken into account only which enter into
412
  * Those events are taken into account only which enter into
413
    a mask set by function 40. By default it is
413
    a mask set by function 40. By default it is
414
    redraw, key and button events.
414
    redraw, key and button events.
415
  * To check, whether there is a message in queue, use function 11.
415
  * To check, whether there is a message in queue, use function 11.
416
    To wait for no more than given time, use function 23.
416
    To wait for no more than given time, use function 23.
417
 
417
 
418
======================================================================
418
======================================================================
419
=============== Function 11 - check for event, no wait. ==============
419
=============== Function 11 - check for event, no wait. ==============
420
======================================================================
420
======================================================================
421
If the message queue contains event, function reads out
421
If the message queue contains event, function reads out
422
and return it. If the queue is empty, function returns 0.
422
and return it. If the queue is empty, function returns 0.
423
Parameters:
423
Parameters:
424
  * eax = 11 - function number
424
  * eax = 11 - function number
425
Returned value:
425
Returned value:
426
  * eax = 0 - message queue is empty
426
  * eax = 0 - message queue is empty
427
  * else eax = event (see the list of events)
427
  * else eax = event (see the list of events)
428
Remarks:
428
Remarks:
429
  * Those events are taken into account only, which enter into
429
  * Those events are taken into account only, which enter into
430
    a mask set by function 40. By default it is
430
    a mask set by function 40. By default it is
431
    redraw, key and button events.
431
    redraw, key and button events.
432
  * To wait for event, use function 10.
432
  * To wait for event, use function 10.
433
    To wait for no more than given time, use function 23.
433
    To wait for no more than given time, use function 23.
434
 
434
 
435
======================================================================
435
======================================================================
436
=============== Function 12 - begin/end window redraw. ===============
436
=============== Function 12 - begin/end window redraw. ===============
437
======================================================================
437
======================================================================
438
 
438
 
439
---------------- Subfunction 1 - begin window redraw. ----------------
439
---------------- Subfunction 1 - begin window redraw. ----------------
440
Parameters:
440
Parameters:
441
  * eax = 12 - function number
441
  * eax = 12 - function number
442
  * ebx = 1 - subfunction number
442
  * ebx = 1 - subfunction number
443
Returned value:
443
Returned value:
444
  * function does not return value
444
  * function does not return value
445
 
445
 
446
----------------- Subfunction 2 - end window redraw. -----------------
446
----------------- Subfunction 2 - end window redraw. -----------------
447
Parameters:
447
Parameters:
448
  * eax = 12 - function number
448
  * eax = 12 - function number
449
  * ebx = 2 - subfunction number
449
  * ebx = 2 - subfunction number
450
Returned value:
450
Returned value:
451
  * function does not return value
451
  * function does not return value
452
Remarks:
452
Remarks:
453
  * Subfunction 1 deletes all buttons defined with
453
  * Subfunction 1 deletes all buttons defined with
454
    function 8, they must be defined again.
454
    function 8, they must be defined again.
455
 
455
 
456
======================================================================
456
======================================================================
457
============ Function 13 - draw a rectangle in the window. ===========
457
============ Function 13 - draw a rectangle in the window. ===========
458
======================================================================
458
======================================================================
459
Parameters:
459
Parameters:
460
  * eax = 13 - function number
460
  * eax = 13 - function number
461
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
461
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
462
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
462
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
463
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
463
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
464
Returned value:
464
Returned value:
465
  * function does not return value
465
  * function does not return value
466
Remarks:
466
Remarks:
467
  * Coordinates are understood as coordinates of the left upper corner
467
  * Coordinates are understood as coordinates of the left upper corner
468
    of a rectangle relative to the window.
468
    of a rectangle relative to the window.
469
 
469
 
470
======================================================================
470
======================================================================
471
=================== Function 14 - get screen size. ===================
471
=================== Function 14 - get screen size. ===================
472
======================================================================
472
======================================================================
473
Parameters:
473
Parameters:
474
  * eax = 14 - function number
474
  * eax = 14 - function number
475
Returned value:
475
Returned value:
476
  * eax = [xsize]*65536 + [ysize], where
476
  * eax = [xsize]*65536 + [ysize], where
477
  * xsize = x-coordinate of the right lower corner of the screen =
477
  * xsize = x-coordinate of the right lower corner of the screen =
478
            horizontal size - 1
478
            horizontal size - 1
479
  * ysize = y-coordinate of the right lower corner of the screen =
479
  * ysize = y-coordinate of the right lower corner of the screen =
480
            vertical size - 1
480
            vertical size - 1
481
Remarks:
481
Remarks:
482
  * See also subfunction 5 of function 48 - get sizes of
482
  * See also subfunction 5 of function 48 - get sizes of
483
    working area of the screen.
483
    working area of the screen.
484
 
484
 
485
======================================================================
485
======================================================================
486
== Function 15, subfunction 1 - set a size of the background image. ==
486
== Function 15, subfunction 1 - set a size of the background image. ==
487
======================================================================
487
======================================================================
488
Parameters:
488
Parameters:
489
  * eax = 15 - function number
489
  * eax = 15 - function number
490
  * ebx = 1 - subfunction number
490
  * ebx = 1 - subfunction number
491
  * ecx = width of the image
491
  * ecx = width of the image
492
  * edx = height of the image
492
  * edx = height of the image
493
Returned value:
493
Returned value:
494
  * function does not return value
494
  * function does not return value
495
Remarks:
495
Remarks:
496
  * There is no checks for correctness. The setting of too large
496
  * There is no checks for correctness. The setting of too large
497
    values will result that the background will contain data abroad
497
    values will result that the background will contain data abroad
498
    of buffer for the background image. Buffer size = 0x160000-0x10,
498
    of buffer for the background image. Buffer size = 0x160000-0x10,
499
    that corresponds to maximum size 800*600. (800*600*3=0x15F900)
499
    that corresponds to maximum size 800*600. (800*600*3=0x15F900)
500
  * For update of the screen (after completion of a series of commands
500
  * For update of the screen (after completion of a series of commands
501
    working with a background) call subfunction 3.
501
    working with a background) call subfunction 3.
502
  * There is a pair function for get size of the background image -
502
  * There is a pair function for get size of the background image -
503
    subfunction 1 of function 39.
503
    subfunction 1 of function 39.
504
 
504
 
505
======================================================================
505
======================================================================
506
=== Function 15, subfunction 2 - put pixel on the background image. ==
506
=== Function 15, subfunction 2 - put pixel on the background image. ==
507
======================================================================
507
======================================================================
508
Parameters:
508
Parameters:
509
  * eax = 15 - function number
509
  * eax = 15 - function number
510
  * ebx = 2 - subfunction number
510
  * ebx = 2 - subfunction number
511
  * ecx = offset
511
  * ecx = offset
512
  * edx = color of a pixel 0xRRGGBB
512
  * edx = color of a pixel 0xRRGGBB
513
Returned value:
513
Returned value:
514
  * function does not return value
514
  * function does not return value
515
Remarks:
515
Remarks:
516
  * Offset for a pixel with coordinates (x,y) is calculated as
516
  * Offset for a pixel with coordinates (x,y) is calculated as
517
    (x+y*xsize)*3.
517
    (x+y*xsize)*3.
518
  * If the given offset exceeds 0x160000-16 = 1.375 Mb - 16 bytes,
518
  * If the given offset exceeds 0x160000-16 = 1.375 Mb - 16 bytes,
519
    the call is ignored.
519
    the call is ignored.
520
  * For update of the screen (after completion of a series of commands
520
  * For update of the screen (after completion of a series of commands
521
    working with a background) call subfunction 3.
521
    working with a background) call subfunction 3.
522
  * There is a pair function for get pixel on the background image -
522
  * There is a pair function for get pixel on the background image -
523
    subfunction 2 of function 39.
523
    subfunction 2 of function 39.
524
 
524
 
525
======================================================================
525
======================================================================
526
=========== Function 15, subfunction 3 - redraw background. ==========
526
=========== Function 15, subfunction 3 - redraw background. ==========
527
======================================================================
527
======================================================================
528
Parameters:
528
Parameters:
529
  * eax = 15 - function number
529
  * eax = 15 - function number
530
  * ebx = 3 - subfunction number
530
  * ebx = 3 - subfunction number
531
Returned value:
531
Returned value:
532
  * function does not return value
532
  * function does not return value
533
 
533
 
534
======================================================================
534
======================================================================
535
== Function 15, subfunction 4 - set drawing mode for the background. =
535
== Function 15, subfunction 4 - set drawing mode for the background. =
536
======================================================================
536
======================================================================
537
Parameters:
537
Parameters:
538
  * eax = 15 - function number
538
  * eax = 15 - function number
539
  * ebx = 4 - subfunction number
539
  * ebx = 4 - subfunction number
540
  * ecx = drawing mode:
540
  * ecx = drawing mode:
541
    * 1 = tile
541
    * 1 = tile
542
    * 2 = stretch
542
    * 2 = stretch
543
Returned value:
543
Returned value:
544
  * function does not return value
544
  * function does not return value
545
Remarks:
545
Remarks:
546
  * For update of the screen (after completion of a series of commands
546
  * For update of the screen (after completion of a series of commands
547
    working with a background) call subfunction 3.
547
    working with a background) call subfunction 3.
548
  * There is a pair function for get drawing mode of the background -
548
  * There is a pair function for get drawing mode of the background -
549
    subfunction 4 of function 39.
549
    subfunction 4 of function 39.
550
 
550
 
551
======================================================================
551
======================================================================
552
===================== Function 15, subfunction 5 =====================
552
===================== Function 15, subfunction 5 =====================
553
============ Put block of pixels on the background image. ============
553
============ Put block of pixels on the background image. ============
554
======================================================================
554
======================================================================
555
Parameters:
555
Parameters:
556
  * eax = 15 - function number
556
  * eax = 15 - function number
557
  * ebx = 5 - subfunction number
557
  * ebx = 5 - subfunction number
558
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
558
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
559
  * edx = offset in data of the background image
559
  * edx = offset in data of the background image
560
  * esi = size of data in bytes = 3 * number of pixels
560
  * esi = size of data in bytes = 3 * number of pixels
561
Returned value:
561
Returned value:
562
  * function does not return value
562
  * function does not return value
563
Remarks:
563
Remarks:
564
  * If the block gets out abroad 0x160000-16 = 1.375 Mb - 16 bytes,
564
  * If the block gets out abroad 0x160000-16 = 1.375 Mb - 16 bytes,
565
    the call is ignored.
565
    the call is ignored.
566
  * Color of each pixel is stored as 3-bytes value BBGGRR.
566
  * Color of each pixel is stored as 3-bytes value BBGGRR.
567
  * Pixels of the background image are written sequentially
567
  * Pixels of the background image are written sequentially
568
    from left to right, from up to down.
568
    from left to right, from up to down.
569
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
569
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
570
  * For update of the screen (after completion of a series of commands
570
  * For update of the screen (after completion of a series of commands
571
    working with a background) call subfunction 3.
571
    working with a background) call subfunction 3.
572
 
572
 
573
======================================================================
573
======================================================================
574
=============== Function 16 - save ramdisk on a floppy. ==============
574
=============== Function 16 - save ramdisk on a floppy. ==============
575
======================================================================
575
======================================================================
576
Parameters:
576
Parameters:
577
  * eax = 16 - function number
577
  * eax = 16 - function number
578
  * ebx = 1 or ebx = 2 - on which floppy save
578
  * ebx = 1 or ebx = 2 - on which floppy save
579
Returned value:
579
Returned value:
580
  * eax = 0 - success
580
  * eax = 0 - success
581
  * eax = 1 - error
581
  * eax = 1 - error
582
 
582
 
583
======================================================================
583
======================================================================
584
======= Function 17 - get the identifier of the pressed button. ======
584
======= Function 17 - get the identifier of the pressed button. ======
585
======================================================================
585
======================================================================
586
Takes away the code of the pressed button from the buffer.
586
Takes away the code of the pressed button from the buffer.
587
Parameters:
587
Parameters:
588
  * eax = 17 - function number
588
  * eax = 17 - function number
589
Returned value:
589
Returned value:
590
  * if the buffer is empty, function returns eax=1
590
  * if the buffer is empty, function returns eax=1
591
  * if the buffer is not empty, function returns al=0,
591
  * if the buffer is not empty, function returns al=0,
592
    high 24 bits of eax contain button identifier (in particular, ah
592
    high 24 bits of eax contain button identifier (in particular, ah
593
    contains low byte of the identifier; if all buttons have
593
    contains low byte of the identifier; if all buttons have
594
    the identifier less than 256, ah is enough to distinguish).
594
    the identifier less than 256, ah is enough to distinguish).
595
Remarks:
595
Remarks:
596
  * "Buffer" keeps only one button, at pressing the new button the
596
  * "Buffer" keeps only one button, at pressing the new button the
597
    information about old is lost.
597
    information about old is lost.
598
  * The call of this function by an application with inactive window
598
  * The call of this function by an application with inactive window
599
    will return answer "buffer is empty".
599
    will return answer "buffer is empty".
600
 
600
 
601
======================================================================
601
======================================================================
602
============ Function 18, subfunction 1 - system shutdown. ===========
602
============ Function 18, subfunction 1 - system shutdown. ===========
603
======================================================================
603
======================================================================
604
Parameters:
604
Parameters:
605
  * eax = 18 - function number
605
  * eax = 18 - function number
606
  * ebx = 1 - subfunction number
606
  * ebx = 1 - subfunction number
607
Returned value:
607
Returned value:
608
  * function always return eax = 0 as tag of success
608
  * function always return eax = 0 as tag of success
609
Remarks:
609
Remarks:
610
  * On the last step menu of exit from the system appears and waits
610
  * On the last step menu of exit from the system appears and waits
611
    response of the user.
611
    response of the user.
612
  * See also subfunction 9, system shutdown with
612
  * See also subfunction 9, system shutdown with
613
    the parameter to force the choice in the exit menu.
613
    the parameter to force the choice in the exit menu.
614
 
614
 
615
======================================================================
615
======================================================================
616
= Function 18, subfunction 2 - terminate process/thread by the slot. =
616
= Function 18, subfunction 2 - terminate process/thread by the slot. =
617
======================================================================
617
======================================================================
618
Parameters:
618
Parameters:
619
  * eax = 18 - function number
619
  * eax = 18 - function number
620
  * ebx = 2 - subfunction number
620
  * ebx = 2 - subfunction number
621
  * ecx = number of the slot of process/thread
621
  * ecx = number of the slot of process/thread
622
Returned value:
622
Returned value:
623
  * function does not return value
623
  * function does not return value
624
Remarks:
624
Remarks:
625
  * It is impossible to terminate system thread OS/IDLE (with
625
  * It is impossible to terminate system thread OS/IDLE (with
626
    number of the slot 1),
626
    number of the slot 1),
627
    it is possible to terminate any normal process/thread.
627
    it is possible to terminate any normal process/thread.
628
  * See also subfunction 18 - terminate
628
  * See also subfunction 18 - terminate
629
    process/thread by the identifier.
629
    process/thread by the identifier.
630
 
630
 
631
======================================================================
631
======================================================================
632
===================== Function 18, subfunction 3 =====================
632
===================== Function 18, subfunction 3 =====================
633
============= Make active the window of the given thread. ============
633
============= Make active the window of the given thread. ============
634
======================================================================
634
======================================================================
635
Parameters:
635
Parameters:
636
  * eax = 18 - function number
636
  * eax = 18 - function number
637
  * ebx = 3 - subfunction number
637
  * ebx = 3 - subfunction number
638
  * ecx = number of the thread slot
638
  * ecx = number of the thread slot
639
Returned value:
639
Returned value:
640
  * function does not return value
640
  * function does not return value
641
Remarks:
641
Remarks:
642
  * If correct, but nonexistent slot is given,
642
  * If correct, but nonexistent slot is given,
643
    some window is made active.
643
    some window is made active.
644
  * To find out, which window is active, use subfunction 7.
644
  * To find out, which window is active, use subfunction 7.
645
 
645
 
646
======================================================================
646
======================================================================
647
===================== Function 18, subfunction 4 =====================
647
===================== Function 18, subfunction 4 =====================
648
=========== Get counter of idle time units per one second. ===========
648
=========== Get counter of idle time units per one second. ===========
649
======================================================================
649
======================================================================
650
Idle time units are units, in which the processor stands idle
650
Idle time units are units, in which the processor stands idle
651
in waiting for interrupt (in the command 'hlt').
651
in waiting for interrupt (in the command 'hlt').
652
 
652
 
653
Parameters:
653
Parameters:
654
  * eax = 18 - function number
654
  * eax = 18 - function number
655
  * ebx = 4 - subfunction number
655
  * ebx = 4 - subfunction number
656
Returned value:
656
Returned value:
657
  * eax = value of the counter of idle time units per one second
657
  * eax = value of the counter of idle time units per one second
658
 
658
 
659
======================================================================
659
======================================================================
660
========== Function 18, subfunction 5 - get CPU clock rate. ==========
660
========== Function 18, subfunction 5 - get CPU clock rate. ==========
661
======================================================================
661
======================================================================
662
Parameters:
662
Parameters:
663
  * eax = 18 - function number
663
  * eax = 18 - function number
664
  * ebx = 5 - subfunction number
664
  * ebx = 5 - subfunction number
665
Returned value:
665
Returned value:
666
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
666
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
667
 
667
 
668
======================================================================
668
======================================================================
669
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
669
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
670
======================================================================
670
======================================================================
671
Parameters:
671
Parameters:
672
  * eax = 18 - function number
672
  * eax = 18 - function number
673
  * ebx = 6 - subfunction number
673
  * ebx = 6 - subfunction number
674
  * ecx defines path to the file:
674
  * ecx defines path to the file:
675
    * 1 = in the folder "/KOLIBRI"
675
    * 1 = in the folder "/KOLIBRI"
676
    * 2 = in the root folder
676
    * 2 = in the root folder
677
    * 3 = edx points to the path (names of folders in the format 8+3,
677
    * 3 = edx points to the path (names of folders in the format 8+3,
678
      divided by '/')
678
      divided by '/')
679
Returned value:
679
Returned value:
680
  * eax = 0 - success
680
  * eax = 0 - success
681
  * else eax = error code of the file system
681
  * else eax = error code of the file system
682
Çàìå÷àíèÿ:
682
Çàìå÷àíèÿ:
683
  * Filename is fixed, "menuet.img" (global kernel variable
683
  * Filename is fixed, "kolibri.img" (global kernel variable
684
    'image_save' from 'preboot.inc')
684
    'image_save' from 'preboot.inc')
685
  * Drive and partition are defined by subfunction 7
685
  * Drive and partition are defined by subfunction 7
686
    and subfunction 8 of function 21.
686
    and subfunction 8 of function 21.
687
  * All folders in the given path must exist, otherwise function
687
  * All folders in the given path must exist, otherwise function
688
    returns value 5, "file not found".
688
    returns value 5, "file not found".
689
 
689
 
690
======================================================================
690
======================================================================
691
=========== Function 18, subfunction 7 - get active window. ==========
691
=========== Function 18, subfunction 7 - get active window. ==========
692
======================================================================
692
======================================================================
693
Parameters:
693
Parameters:
694
  * eax = 18 - function number
694
  * eax = 18 - function number
695
  * ebx = 7 - subfunction number
695
  * ebx = 7 - subfunction number
696
Returned value:
696
Returned value:
697
  * eax = number of the active window
697
  * eax = number of the active window
698
    (number of the slot of the thread with active window)
698
    (number of the slot of the thread with active window)
699
Remarks:
699
Remarks:
700
  * Active window is at the top of the window stack and receives
700
  * Active window is at the top of the window stack and receives
701
    messages on all keyboard input.
701
    messages on all keyboard input.
702
  * To make a window active, use subfunction 3.
702
  * To make a window active, use subfunction 3.
703
 
703
 
704
======================================================================
704
======================================================================
705
== Function 18, subfunction 8 - disable/enable the internal speaker. =
705
== Function 18, subfunction 8 - disable/enable the internal speaker. =
706
======================================================================
706
======================================================================
707
If speaker sound is disabled, all calls to subfunction 55 of
707
If speaker sound is disabled, all calls to subfunction 55 of
708
function 55 are ignored. If speaker sound is enabled,
708
function 55 are ignored. If speaker sound is enabled,
709
they are routed on builtin speaker.
709
they are routed on builtin speaker.
710
 
710
 
711
------------------- Subsubfunction 1 - get status. -------------------
711
------------------- Subsubfunction 1 - get status. -------------------
712
Parameters:
712
Parameters:
713
  * eax = 18 - function number
713
  * eax = 18 - function number
714
  * ebx = 8 - subfunction number
714
  * ebx = 8 - subfunction number
715
  * ecx = 1 - number of the subsubfunction
715
  * ecx = 1 - number of the subsubfunction
716
Returned value:
716
Returned value:
717
  * eax = 0 - speaker sound is enabled; 1 - disabled
717
  * eax = 0 - speaker sound is enabled; 1 - disabled
718
 
718
 
719
----------------- Subsubfunction 2 - toggle status. ------------------
719
----------------- Subsubfunction 2 - toggle status. ------------------
720
Toggles states of disable/enable.
720
Toggles states of disable/enable.
721
Parameters:
721
Parameters:
722
  * eax = 18 - function number
722
  * eax = 18 - function number
723
  * ebx = 8 - subfunction number
723
  * ebx = 8 - subfunction number
724
  * ecx = 2 - number of the subsubfunction
724
  * ecx = 2 - number of the subsubfunction
725
Returned value:
725
Returned value:
726
  * function does not return value
726
  * function does not return value
727
 
727
 
728
======================================================================
728
======================================================================
729
== Function 18, subfunction 9 - system shutdown with the parameter. ==
729
== Function 18, subfunction 9 - system shutdown with the parameter. ==
730
======================================================================
730
======================================================================
731
Parameters:
731
Parameters:
732
  * eax = 18 - function number
732
  * eax = 18 - function number
733
  * ebx = 9 - subfunction number
733
  * ebx = 9 - subfunction number
734
  * ecx = parameter:
734
  * ecx = parameter:
735
    * 1 = on the last step of shutdown save ramdisk on a floppy and
735
    * 1 = on the last step of shutdown save ramdisk on a floppy and
736
      then show the exit menu and request further operations
736
      then show the exit menu and request further operations
737
      from the user
737
      from the user
738
    * 2 = turn off computer
738
    * 2 = turn off computer
739
    * 3 = reboot computer
739
    * 3 = reboot computer
740
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
740
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
741
Returned value:
741
Returned value:
742
  * at incorrect ecx the registers do not change (i.e. eax=18)
742
  * at incorrect ecx the registers do not change (i.e. eax=18)
743
  * by correct call function always returns eax=0
743
  * by correct call function always returns eax=0
744
    as the tag of success
744
    as the tag of success
745
Remarks:
745
Remarks:
746
  * Do not rely on returned value by incorrect call, it can be
746
  * Do not rely on returned value by incorrect call, it can be
747
    changed in future versions of the kernel.
747
    changed in future versions of the kernel.
748
  * It is possible to use subfunction 1, that on the last step
748
  * It is possible to use subfunction 1, that on the last step
749
    the user makes choice himself.
749
    the user makes choice himself.
750
  * It is not recommended to use value ecx=1 (to not irritate the user
750
  * It is not recommended to use value ecx=1 (to not irritate the user
751
    with excessive questions); to save ramdisk on a floppy use
751
    with excessive questions); to save ramdisk on a floppy use
752
    function 16 (which admits specification, on which floppy to
752
    function 16 (which admits specification, on which floppy to
753
    write), and to shutdown with the exit menu use already mentioned
753
    write), and to shutdown with the exit menu use already mentioned
754
    subfunction 1.
754
    subfunction 1.
755
 
755
 
756
======================================================================
756
======================================================================
757
===== Function 18, subfunction 10 - minimize application window. =====
757
===== Function 18, subfunction 10 - minimize application window. =====
758
======================================================================
758
======================================================================
759
Minimizes the own window.
759
Minimizes the own window.
760
Parameters:
760
Parameters:
761
  * eax = 18 - function number
761
  * eax = 18 - function number
762
  * ebx = 10 - subfunction number
762
  * ebx = 10 - subfunction number
763
Returned value:
763
Returned value:
764
  * function does not return value
764
  * function does not return value
765
Remarks:
765
Remarks:
766
  * The minimized window from the point of view of function 9
766
  * The minimized window from the point of view of function 9
767
    keeps position and sizes.
767
    keeps position and sizes.
768
  * Restoring of an application window occurs at its activation by 
768
  * Restoring of an application window occurs at its activation by 
769
    subfunction 3.
769
    subfunction 3.
770
  * Usually there is no necessity to minimize/restire a window
770
  * Usually there is no necessity to minimize/restire a window
771
    obviously: minimization of a window is carried out by the system
771
    obviously: minimization of a window is carried out by the system
772
    at pressing the minimization button (for skinned windows
772
    at pressing the minimization button (for skinned windows
773
    it is defined automatically by function 0,
773
    it is defined automatically by function 0,
774
    for other windows it can be defined manually by function 8),
774
    for other windows it can be defined manually by function 8),
775
    restore of a window is done by the application '@panel'.
775
    restore of a window is done by the application '@panel'.
776
 
776
 
777
======================================================================
777
======================================================================
778
 Function 18, subfunction 11 - get information on the disk subsystem. 
778
 Function 18, subfunction 11 - get information on the disk subsystem. 
779
======================================================================
779
======================================================================
780
Parameters:
780
Parameters:
781
  * eax = 18 - function number
781
  * eax = 18 - function number
782
  * ebx = 11 - subfunction number
782
  * ebx = 11 - subfunction number
783
  * ecx = type of the table:
783
  * ecx = type of the table:
784
    * 1 = short version, 10 bytes
784
    * 1 = short version, 10 bytes
785
    * 2 = full version, 65536 bytes
785
    * 2 = full version, 65536 bytes
786
  * edx = pointer to the buffer (in the application) for the table
786
  * edx = pointer to the buffer (in the application) for the table
787
Returned value:
787
Returned value:
788
  * function does not return value
788
  * function does not return value
789
Format of the table: short version:
789
Format of the table: short version:
790
  * +0: byte: information about FDD's (drives for floppies),
790
  * +0: byte: information about FDD's (drives for floppies),
791
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
791
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
792
    of the second regarding to the following list:
792
    of the second regarding to the following list:
793
    * 0 = there is no drive
793
    * 0 = there is no drive
794
    * 1 = 360Kb, 5.25''
794
    * 1 = 360Kb, 5.25''
795
    * 2 = 1.2Mb, 5.25''
795
    * 2 = 1.2Mb, 5.25''
796
    * 3 = 720Kb, 3.5''
796
    * 3 = 720Kb, 3.5''
797
    * 4 = 1.44Mb, 3.5''
797
    * 4 = 1.44Mb, 3.5''
798
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
798
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
799
    For example, for the standard configuration from one 1.44-drive
799
    For example, for the standard configuration from one 1.44-drive
800
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
800
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
801
    the value is 24h.
801
    the value is 24h.
802
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
802
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
803
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
803
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
804
    * 0 = device is absent
804
    * 0 = device is absent
805
    * 1 = hard drive
805
    * 1 = hard drive
806
    * 2 = CD-drive
806
    * 2 = CD-drive
807
    For example, in the case HD on IDE0 and CD on IDE2
807
    For example, in the case HD on IDE0 and CD on IDE2
808
    this field contains 48h.
808
    this field contains 48h.
809
  * +2: 4 db: number of the retrieved partitions on hard disks
809
  * +2: 4 db: number of the retrieved partitions on hard disks
810
    at accordingly IDE0,...,IDE3.
810
    at accordingly IDE0,...,IDE3.
811
    If the hard disk on IDEx is absent, appropriate byte is zero,
811
    If the hard disk on IDEx is absent, appropriate byte is zero,
812
    otherwise it shows number of the recognized partitions, which
812
    otherwise it shows number of the recognized partitions, which
813
    can be not presented (if the drive is not formatted or if
813
    can be not presented (if the drive is not formatted or if
814
    the file system is not supported). Current version of the kernel
814
    the file system is not supported). Current version of the kernel
815
    supports only FAT16 and FAT32 for hard disks.
815
    supports only FAT16, FAT32 and NTFS for hard disks.
816
  * +6: 4 db: reserved
816
  * +6: 4 db: reserved
817
Format of the table: full version:
817
Format of the table: full version:
818
  * +0: 10 db: same as for the short version
818
  * +0: 10 db: same as for the short version
819
  * +10: 100 db: data for the first partition
819
  * +10: 100 db: data for the first partition
820
  * +110: 100 db: data for the second partition
820
  * +110: 100 db: data for the second partition
821
  * ...
821
  * ...
822
  * +10+100*(n-1): 100 db: data for the last partition
822
  * +10+100*(n-1): 100 db: data for the last partition
823
The partitions are located as follows: at first sequentially all
823
The partitions are located as follows: at first sequentially all
824
recoginzed partitions on HD on IDE0 (if present),
824
recoginzed partitions on HD on IDE0 (if present),
825
then on HD on IDE1 (if present) and so on up to IDE3.
825
then on HD on IDE1 (if present) and so on up to IDE3.
826
Format of the information about partition
826
Format of the information about partition
827
(at moment only FAT is supported):
827
(at moment only FAT is supported):
828
  * +0: dword: first physical sector of the partition
828
  * +0: dword: first physical sector of the partition
829
  * +4: dword: last physical sector of the partition
829
  * +4: dword: last physical sector of the partition
830
    (belongs to the partition)
830
    (belongs to the partition)
831
  * +8: dword: sectors per one copy of FAT
-
 
832
  * +12 = +0xC: dword: number of copies of FAT
-
 
833
  * +16 = +0x10: dword: number of sectors per cluster
-
 
834
  * +20 = +0x14: dword: bytes per sector;
831
  * +8: byte: file system type:
835
    current implementation expects 0x200 = 512 in this field
-
 
836
  * +24 = +0x18: dword: first root cluster in FAT32, 0 for FAT16
-
 
837
  * +28 = +0x1C: dword: first physical sector of FAT
-
 
838
  * +32 = +0x20: dword: first physical root sector for FAT16,
-
 
839
    ignored for FAT32
832
    16=FAT16, 32=FAT32, 1=NTFS
840
  * +36 = +0x24: dword: number of root sectors for FAT16,
-
 
841
    0 for FAT32
-
 
842
  * +40 = +0x28: dword: physical sector of the beginning of
833
  * other data are dependent on file system, are modified with
843
    the data area
-
 
844
  * +44 = +0x2C: dword: maximum number of a cluster
-
 
845
  * +48 = +0x30: dword: physical sector of the information
-
 
846
    about the file system for FAT32, ignored for FAT16
-
 
847
  * +52 = +0x34: dword: value used as boundary for special
-
 
848
    values in FAT
-
 
849
  * +56 = +0x38: dword: value used for bad clusters in FAT
-
 
850
  * +60 = +0x3C: dword: value used as the end marker for FAT chain
834
    kernel modifications and therefore are not described
851
  * +64 = +0x40: dword: mask for FAT items
-
 
852
  * +68 = +0x44: byte: file system type: 16 èëè 32
-
 
853
  * +69 = +0x45: 31 db: reserved
-
 
854
Remarks:
835
Remarks:
855
  * The short table can be used for obtaining the information about
836
  * The short table can be used for obtaining the information about
856
    available devices.
837
    available devices.
857
  * First two fields in the information about partition
-
 
858
    gives the parameters of partition, other - parameters of
-
 
859
    FAT file system. For other file systems (when they will be
-
 
860
    supported) specific for file system information will be, of
-
 
861
    course, another, but first two fields will have the same sense.
-
 
862
 
838
 
863
======================================================================
839
======================================================================
864
========== Function 18, subfunction 13 - get kernel version. =========
840
========== Function 18, subfunction 13 - get kernel version. =========
865
======================================================================
841
======================================================================
866
Parameters:
842
Parameters:
867
  * eax = 18 - function number
843
  * eax = 18 - function number
868
  * ebx = 13 - subfunction number
844
  * ebx = 13 - subfunction number
869
  * ecx = pointer to the buffer (not less than 16 bytes), where
845
  * ecx = pointer to the buffer (not less than 16 bytes), where
870
    the information will be placed
846
    the information will be placed
871
Returned value:
847
Returned value:
872
  * function does not return value
848
  * function does not return value
873
Structure of the buffer:
849
Structure of the buffer:
874
db a,b,c,d for version a.b.c.d
850
db a,b,c,d for version a.b.c.d
875
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
851
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
876
db 'name',0 - ASCIIZ-string with the name
852
db 'name',0 - ASCIIZ-string with the name
877
For Kolibri 0.5.8.1 kernel:
853
For Kolibri 0.6.3.0 kernel:
878
db 0,5,8,1
854
db 0,6,3,0
879
db 2
855
db 2
880
db 'Kolibri',0
856
db 'Kolibri',0
881
 
857
 
882
======================================================================
858
======================================================================
883
======= Function 18, subfunction 14 - wait for screen retrace. =======
859
======= Function 18, subfunction 14 - wait for screen retrace. =======
884
======================================================================
860
======================================================================
885
Waits for the beginning of retrace of the scanning ray of the screen
861
Waits for the beginning of retrace of the scanning ray of the screen
886
monitor.
862
monitor.
887
Parameters:
863
Parameters:
888
  * eax = 18 - function number
864
  * eax = 18 - function number
889
  * ebx = 14 - subfunction number
865
  * ebx = 14 - subfunction number
890
Returned value:
866
Returned value:
891
  * eax = 0 as the tag of success
867
  * eax = 0 as the tag of success
892
Remarks:
868
Remarks:
893
  * Function is intended only for active high-efficiency graphics
869
  * Function is intended only for active high-efficiency graphics
894
    applications; is used for smooth output of a graphics.
870
    applications; is used for smooth output of a graphics.
895
 
871
 
896
======================================================================
872
======================================================================
897
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
873
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
898
======================================================================
874
======================================================================
899
Parameters:
875
Parameters:
900
  * eax = 18 - function number
876
  * eax = 18 - function number
901
  * ebx = 15 - subfunction number
877
  * ebx = 15 - subfunction number
902
Returned value:
878
Returned value:
903
  * eax = 0 as the tag of success
879
  * eax = 0 as the tag of success
904
 
880
 
905
======================================================================
881
======================================================================
906
========= Function 18, subfunction 16 - get size of free RAM. ========
882
========= Function 18, subfunction 16 - get size of free RAM. ========
907
======================================================================
883
======================================================================
908
Parameters:
884
Parameters:
909
  * eax = 18 - function number
885
  * eax = 18 - function number
910
  * ebx = 16 - subfunction number
886
  * ebx = 16 - subfunction number
911
Returned value:
887
Returned value:
912
  * eax = size of free memory in kilobytes
888
  * eax = size of free memory in kilobytes
913
 
889
 
914
======================================================================
890
======================================================================
915
======== Function 18, subfunction 17 - get full amount of RAM. =======
891
======== Function 18, subfunction 17 - get full amount of RAM. =======
916
======================================================================
892
======================================================================
917
Parameters:
893
Parameters:
918
  * eax = 18 - function number
894
  * eax = 18 - function number
919
  * ebx = 17 - subfunction number
895
  * ebx = 17 - subfunction number
920
Returned value:
896
Returned value:
921
  * eax = total size of existing memory in kilobytes
897
  * eax = total size of existing memory in kilobytes
922
 
898
 
923
======================================================================
899
======================================================================
924
===================== Function 18, subfunction 18 ====================
900
===================== Function 18, subfunction 18 ====================
925
============= Terminate process/thread by the identifier. ============
901
============= Terminate process/thread by the identifier. ============
926
======================================================================
902
======================================================================
927
Parameters:
903
Parameters:
928
  * eax = 18 - function number
904
  * eax = 18 - function number
929
  * ebx = 18 - subfunction number
905
  * ebx = 18 - subfunction number
930
  * ecx = identifer of process/thread (PID/TID)
906
  * ecx = identifer of process/thread (PID/TID)
931
Returned value:
907
Returned value:
932
  * eax = 0 - success
908
  * eax = 0 - success
933
  * eax = -1 - error (process is not found or is system)
909
  * eax = -1 - error (process is not found or is system)
934
Remarks:
910
Remarks:
935
  * It is impossible to terminate system thread OS/IDLE (identifier
911
  * It is impossible to terminate system thread OS/IDLE (identifier
936
    1), it is possible to terminate any normal process/thread.
912
    1), it is possible to terminate any normal process/thread.
937
  * See also subfunction 2 - terminate
913
  * See also subfunction 2 - terminate
938
    process/thread by given slot.
914
    process/thread by given slot.
939
 
915
 
940
======================================================================
916
======================================================================
941
======== Function 18, subfunction 19 - get/set mouse features. =======
917
======== Function 18, subfunction 19 - get/set mouse features. =======
942
======================================================================
918
======================================================================
943
 
919
 
944
---------------- Subsubfunction 0 - get mouse speed. -----------------
920
---------------- Subsubfunction 0 - get mouse speed. -----------------
945
Parameters:
921
Parameters:
946
  * eax = 18 - function number
922
  * eax = 18 - function number
947
  * ebx = 19 - subfunction number
923
  * ebx = 19 - subfunction number
948
  * ecx = 0 - subsubfunction number
924
  * ecx = 0 - subsubfunction number
949
Returned value:
925
Returned value:
950
  * eax = current mouse speed
926
  * eax = current mouse speed
951
 
927
 
952
---------------- Subsubfunction 1 - set mouse speed. -----------------
928
---------------- Subsubfunction 1 - set mouse speed. -----------------
953
Parameters:
929
Parameters:
954
  * eax = 18 - function number
930
  * eax = 18 - function number
955
  * ebx = 19 - subfunction number
931
  * ebx = 19 - subfunction number
956
  * ecx = 1 - subsubfunction number
932
  * ecx = 1 - subsubfunction number
957
  * edx = new value for speed
933
  * edx = new value for speed
958
Returned value:
934
Returned value:
959
  * function does not return value
935
  * function does not return value
960
 
936
 
961
---------------- Subsubfunction 2 - get mouse delay. -----------------
937
---------------- Subsubfunction 2 - get mouse delay. -----------------
962
Parameters:
938
Parameters:
963
  * eax = 18 - function number
939
  * eax = 18 - function number
964
  * ebx = 19 - subfunction number
940
  * ebx = 19 - subfunction number
965
  * ecx = 2 - subsubfunction number
941
  * ecx = 2 - subsubfunction number
966
Returned value:
942
Returned value:
967
  * eax = current mouse delay
943
  * eax = current mouse delay
968
 
944
 
969
---------------- Subsubfunction 3 - set mouse delay. -----------------
945
---------------- Subsubfunction 3 - set mouse delay. -----------------
970
Parameters:
946
Parameters:
971
  * eax = 18 - function number
947
  * eax = 18 - function number
972
  * ebx = 19 - subfunction number
948
  * ebx = 19 - subfunction number
973
  * ecx = 3 - subsubfunction number
949
  * ecx = 3 - subsubfunction number
974
  * edx = new value for mouse delay
950
  * edx = new value for mouse delay
975
Returned value:
951
Returned value:
976
  * function does not return value
952
  * function does not return value
977
 
953
 
978
----------- Subsubfunction 4 - set mouse pointer position. -----------
954
----------- Subsubfunction 4 - set mouse pointer position. -----------
979
Parameters:
955
Parameters:
980
  * eax = 18 - function number
956
  * eax = 18 - function number
981
  * ebx = 19 - subfunction number
957
  * ebx = 19 - subfunction number
982
  * ecx = 4 - subsubfunction number
958
  * ecx = 4 - subsubfunction number
983
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
959
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
984
Returned value:
960
Returned value:
985
  * function does not return value
961
  * function does not return value
986
Remarks:
962
Remarks:
987
  * It is recommended to set speed of the mouse (in subsubfunction 1)
963
  * It is recommended to set speed of the mouse (in subsubfunction 1)
988
    from 1 up to 9. The installed value is not inspected by the kernel
964
    from 1 up to 9. The installed value is not inspected by the kernel
989
    code, so set it carefully, at incorrect value the cursor
965
    code, so set it carefully, at incorrect value the cursor
990
    can "freeze". Speed of the mouse can be regulated through the
966
    can "freeze". Speed of the mouse can be regulated through the
991
    application SETUP.
967
    application SETUP.
992
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
968
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
993
    value is not handled by COM mice. At the very large values the
969
    value is not handled by COM mice. At the very large values the
994
    movement of the mouse on 1 pixel is impossible and the cursor will
970
    movement of the mouse on 1 pixel is impossible and the cursor will
995
    jump on the value of installed speed (subsubfunction 1). The
971
    jump on the value of installed speed (subsubfunction 1). The
996
    installed value is not inspected by the kernel code.
972
    installed value is not inspected by the kernel code.
997
    Mouse delay can be regulated through the application SETUP.
973
    Mouse delay can be regulated through the application SETUP.
998
  * The subsubfunction 4 does not check the passed value. Before
974
  * The subsubfunction 4 does not check the passed value. Before
999
    its call find out current screen resolution (with function 14)
975
    its call find out current screen resolution (with function 14)
1000
    and check that the value of position is inside the limits of the
976
    and check that the value of position is inside the limits of the
1001
    screen.
977
    screen.
1002
 
978
 
1003
======================================================================
979
======================================================================
1004
======== Function 18, subfunction 20 - get information on RAM. =======
980
======== Function 18, subfunction 20 - get information on RAM. =======
1005
======================================================================
981
======================================================================
1006
Parameters:
982
Parameters:
1007
  * eax = 18 - function number
983
  * eax = 18 - function number
1008
  * ebx = 20 - subfunction number
984
  * ebx = 20 - subfunction number
1009
  * ecx = pointer to the buffer for information (36 bytes)
985
  * ecx = pointer to the buffer for information (36 bytes)
1010
Returned value:
986
Returned value:
1011
  * eax = total size of existing RAM in pages
987
  * eax = total size of existing RAM in pages
1012
    or -1 if error has occured
988
    or -1 if error has occured
1013
  * buffer pointed to by ecx contains the following information:
989
  * buffer pointed to by ecx contains the following information:
1014
    * +0:  dword: total size of existing RAM in pages
990
    * +0:  dword: total size of existing RAM in pages
1015
    * +4:  dword: size of free RAM in pages
991
    * +4:  dword: size of free RAM in pages
1016
    * +8:  dword: number of page faults (exceptions #PF)
992
    * +8:  dword: number of page faults (exceptions #PF)
1017
                 in applications
993
                 in applications
1018
    * +12: dword: size of kernel heap in bytes
994
    * +12: dword: size of kernel heap in bytes
1019
    * +16: dword: free in kernel heap in bytes
995
    * +16: dword: free in kernel heap in bytes
1020
    * +20: dword: total number of memory blocks in kernel heap
996
    * +20: dword: total number of memory blocks in kernel heap
1021
    * +24: dword: number of free memory blocks in kernel heap
997
    * +24: dword: number of free memory blocks in kernel heap
1022
    * +28: dword: size of maximum free block in kernel heap
998
    * +28: dword: size of maximum free block in kernel heap
1023
                 (reserved)
999
                 (reserved)
1024
    * +32: dword: size of maximum allocated block in kernel heap
1000
    * +32: dword: size of maximum allocated block in kernel heap
1025
                 (reserved)
1001
                 (reserved)
1026
 
1002
 
1027
======================================================================
1003
======================================================================
1028
==================== Function 20 - MIDI interface. ===================
1004
==================== Function 20 - MIDI interface. ===================
1029
======================================================================
1005
======================================================================
1030
 
1006
 
1031
----------------------- Subfunction 1 - reset ------------------------
1007
----------------------- Subfunction 1 - reset ------------------------
1032
Parameters:
1008
Parameters:
1033
  * eax = 20 - function number
1009
  * eax = 20 - function number
1034
  * ebx = 1 - subfunction number
1010
  * ebx = 1 - subfunction number
1035
 
1011
 
1036
-------------------- Subfunction 2 - output byte ---------------------
1012
-------------------- Subfunction 2 - output byte ---------------------
1037
Parameters:
1013
Parameters:
1038
  * eax = 20 - function number
1014
  * eax = 20 - function number
1039
  * ebx = 2 - subfunction number
1015
  * ebx = 2 - subfunction number
1040
  * cl = byte for output
1016
  * cl = byte for output
1041
Returned value (is the same for both subfunctions):
1017
Returned value (is the same for both subfunctions):
1042
  * eax = 0 - success
1018
  * eax = 0 - success
1043
  * eax = 1 - base port is not defined
1019
  * eax = 1 - base port is not defined
1044
Remarks:
1020
Remarks:
1045
  * Previously the base port must be defined by 
1021
  * Previously the base port must be defined by 
1046
    subfunction 1 of function 21.
1022
    subfunction 1 of function 21.
1047
 
1023
 
1048
======================================================================
1024
======================================================================
1049
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1025
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1050
======================================================================
1026
======================================================================
1051
Parameters:
1027
Parameters:
1052
  * eax = 21 - function number
1028
  * eax = 21 - function number
1053
  * ebx = 1 - subfunction number
1029
  * ebx = 1 - subfunction number
1054
  * ecx = number of base port
1030
  * ecx = number of base port
1055
Returned value
1031
Returned value
1056
  * eax = 0 - success
1032
  * eax = 0 - success
1057
  * eax = -1 - erratic number of a port
1033
  * eax = -1 - erratic number of a port
1058
Remarks:
1034
Remarks:
1059
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1035
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1060
  * The installation of base is necessary for function 20.
1036
  * The installation of base is necessary for function 20.
1061
  * To get base port use subfunction 1 of function 26.
1037
  * To get base port use subfunction 1 of function 26.
1062
 
1038
 
1063
======================================================================
1039
======================================================================
1064
========== Function 21, subfunction 2 - set keyboard layout. =========
1040
========== Function 21, subfunction 2 - set keyboard layout. =========
1065
======================================================================
1041
======================================================================
1066
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1042
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1067
which will be read by function 2.
1043
which will be read by function 2.
1068
Parameters:
1044
Parameters:
1069
  * eax = 21 - function number
1045
  * eax = 21 - function number
1070
  * ebx = 2 - subfunction number
1046
  * ebx = 2 - subfunction number
1071
  * ecx = which layout to set:
1047
  * ecx = which layout to set:
1072
    * 1 = normal layout
1048
    * 1 = normal layout
1073
    * 2 = layout at pressed Shift
1049
    * 2 = layout at pressed Shift
1074
    * 3 = layout at pressed Alt
1050
    * 3 = layout at pressed Alt
1075
  * edx = pointer to layout - table of length 128 bytes
1051
  * edx = pointer to layout - table of length 128 bytes
1076
Or:
1052
Or:
1077
  * ecx = 9
1053
  * ecx = 9
1078
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1054
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1079
Returned value:
1055
Returned value:
1080
  * eax = 0 - success
1056
  * eax = 0 - success
1081
  * eax = 1 - incorrect parameter
1057
  * eax = 1 - incorrect parameter
1082
Remarks:
1058
Remarks:
1083
  * If Alt is pressed, the layout with Alt is used;
1059
  * If Alt is pressed, the layout with Alt is used;
1084
    if Alt is not pressed, but Shift is pressed,
1060
    if Alt is not pressed, but Shift is pressed,
1085
    the layout with Shift is used;
1061
    the layout with Shift is used;
1086
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1062
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1087
    layout is used and then from the code is subtracted 0x60;
1063
    layout is used and then from the code is subtracted 0x60;
1088
    if no control key is pressed, the normal layout is used.
1064
    if no control key is pressed, the normal layout is used.
1089
  * To get layout and country identifier use 
1065
  * To get layout and country identifier use 
1090
    subfunction 2 of function 26.
1066
    subfunction 2 of function 26.
1091
  * Country identifier is global system variable, which is not used
1067
  * Country identifier is global system variable, which is not used
1092
    by the kernel itself; however the application '@panel' displays
1068
    by the kernel itself; however the application '@panel' displays
1093
    the corresponding icon.
1069
    the corresponding icon.
1094
  * The application @panel switches layouts on user request.
1070
  * The application @panel switches layouts on user request.
1095
 
1071
 
1096
======================================================================
1072
======================================================================
1097
============== Function 21, subfunction 3 - set CD base. =============
1073
============== Function 21, subfunction 3 - set CD base. =============
1098
======================================================================
1074
======================================================================
1099
Parameters:
1075
Parameters:
1100
  * eax = 21 - function number
1076
  * eax = 21 - function number
1101
  * ebx = 3 - subfunction number
1077
  * ebx = 3 - subfunction number
1102
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1078
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1103
Returned value:
1079
Returned value:
1104
  * eax = 0
1080
  * eax = 0
1105
Remarks:
1081
Remarks:
1106
  * CD base is used by function 24.
1082
  * CD base is used by function 24.
1107
  * To get CD base use subfunction 3 of function 26.
1083
  * To get CD base use subfunction 3 of function 26.
1108
 
1084
 
1109
======================================================================
1085
======================================================================
1110
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
1086
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
1111
======================================================================
1087
======================================================================
1112
Parameters:
1088
Parameters:
1113
  * eax = 21 - function number
1089
  * eax = 21 - function number
1114
  * ebx = 4 - subfunction number
1090
  * ebx = 4 - subfunction number
1115
  * ecx = number of the base port
1091
  * ecx = number of the base port
1116
Returned value:
1092
Returned value:
1117
  * eax = 0 - success
1093
  * eax = 0 - success
1118
  * eax = -1 - erratic port number
1094
  * eax = -1 - erratic port number
1119
Remarks:
1095
Remarks:
1120
  * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1096
  * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1121
  * The installation of the base is necessary for
1097
  * The installation of the base is necessary for
1122
    functions 25, 28, 55.
1098
    functions 25, 28, 55.
1123
  * To get base port use subfunction 4 of function 26.
1099
  * To get base port use subfunction 4 of function 26.
1124
 
1100
 
1125
======================================================================
1101
======================================================================
1126
========== Function 21, subfunction 5 - set system language. =========
1102
========== Function 21, subfunction 5 - set system language. =========
1127
======================================================================
1103
======================================================================
1128
Parameters:
1104
Parameters:
1129
  * eax = 21 - function number
1105
  * eax = 21 - function number
1130
  * ebx = 5 - subfunction number
1106
  * ebx = 5 - subfunction number
1131
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1107
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1132
Returned value:
1108
Returned value:
1133
  * eax = 0
1109
  * eax = 0
1134
Remarks:
1110
Remarks:
1135
  * System language is global system variable and is not used
1111
  * System language is global system variable and is not used
1136
    by the kernel itself, however application @panel draws the
1112
    by the kernel itself, however application @panel draws the
1137
    appropriate icon.
1113
    appropriate icon.
1138
  * Function does not check for correctness, as the kernel does not
1114
  * Function does not check for correctness, as the kernel does not
1139
    use this variable.
1115
    use this variable.
1140
  * To get system language use subfunction 5 of function 26.
1116
  * To get system language use subfunction 5 of function 26.
1141
 
1117
 
1142
======================================================================
1118
======================================================================
1143
=========== Function 21, subfunction 6 - set WSS base port. ==========
-
 
1144
======================================================================
-
 
1145
Parameters:
-
 
1146
  * eax = 21 - function number
-
 
1147
  * ebx = 6 - subfunction number
-
 
1148
  * ecx = base port
-
 
1149
Returned value:
-
 
1150
  * eax = 0 - success
-
 
1151
  * eax = -1 - erratic port number
-
 
1152
Remarks:
-
 
1153
  * Port number must satisfy to condition 0x100<=ecx.
-
 
1154
  * WSS base is used by function 27.
-
 
1155
  * To get WSS base port use subfunction 6 of function 26.
-
 
1156
 
-
 
1157
======================================================================
-
 
1158
============== Function 21, subfunction 7 - set HD base. =============
1119
============== Function 21, subfunction 7 - set HD base. =============
1159
======================================================================
1120
======================================================================
1160
The HD base defines hard disk to write with usage of obsolete
1121
The HD base defines hard disk to write with usage of obsolete
1161
file system functions and functions implicitly using the hard disk
1122
file system functions and functions implicitly using the hard disk
1162
(such as subfunction 6 of function 18);
1123
(such as subfunction 6 of function 18);
1163
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1124
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1164
these function set base themselves.
1125
these function set base themselves.
1165
Parameters:
1126
Parameters:
1166
  * eax = 21 - function number
1127
  * eax = 21 - function number
1167
  * ebx = 7 - subfunction number
1128
  * ebx = 7 - subfunction number
1168
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1129
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1169
Returned value:
1130
Returned value:
1170
  * eax = 0
1131
  * eax = 0
1171
Remarks:
1132
Remarks:
1172
  * Any application at any time can change the base.
1133
  * Any application at any time can change the base.
1173
  * Do not change base, when any application works with hard disk.
1134
  * Do not change base, when any application works with hard disk.
1174
    If you do not want system bugs.
1135
    If you do not want system bugs.
1175
  * To get HD base use subfunction 7 of function 26.
1136
  * To get HD base use subfunction 7 of function 26.
1176
  * It is also necessary to define used partition of hard disk by 
1137
  * It is also necessary to define used partition of hard disk by 
1177
    subfunction 8.
1138
    subfunction 8.
1178
 
1139
 
1179
======================================================================
1140
======================================================================
1180
========= Function 21, subfunction 8 - set used HD partition. ========
1141
========= Function 21, subfunction 8 - set used HD partition. ========
1181
======================================================================
1142
======================================================================
1182
The HD partition defines partition of the hard disk to write with
1143
The HD partition defines partition of the hard disk to write with
1183
usage of obsolete file system functions and functions implicitly
1144
usage of obsolete file system functions and functions implicitly
1184
using the hard disk (such as subfunction 6 of function 18);
1145
using the hard disk (such as subfunction 6 of function 18);
1185
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1146
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1186
these functions set base and partition themselves.
1147
these functions set base and partition themselves.
1187
Parameters:
1148
Parameters:
1188
  * eax = 21 - function number
1149
  * eax = 21 - function number
1189
  * ebx = 8 - subfunction number
1150
  * ebx = 8 - subfunction number
1190
  * ecx = HD partition (beginning from 1)
1151
  * ecx = HD partition (beginning from 1)
1191
Return value:
1152
Return value:
1192
  * eax = 0
1153
  * eax = 0
1193
Remarks:
1154
Remarks:
1194
  * Any application at any time can change partition.
1155
  * Any application at any time can change partition.
1195
  * Do not change partition when any application works with hard disk.
1156
  * Do not change partition when any application works with hard disk.
1196
    If you do not want system bugs.
1157
    If you do not want system bugs.
1197
  * To get used partition use subfunction 8 of function 26.
1158
  * To get used partition use subfunction 8 of function 26.
1198
  * There is no correctness checks.
1159
  * There is no correctness checks.
1199
  * To get the number of partitions of a hard disk use 
1160
  * To get the number of partitions of a hard disk use 
1200
    subfunction 11 of function 18.
1161
    subfunction 11 of function 18.
1201
  * It is also necessary to define used HD base by subfunction 7.
1162
  * It is also necessary to define used HD base by subfunction 7.
1202
 
1163
 
1203
======================================================================
1164
======================================================================
1204
======== Function 21, subfunction 10 - set sound DMA channel. ========
1165
======== Function 21, subfunction 10 - set sound DMA channel. ========
1205
======================================================================
1166
======================================================================
1206
Parameters:
1167
Parameters:
1207
  * eax = 21 - function number
1168
  * eax = 21 - function number
1208
  * ebx = 10 - subfunction number
1169
  * ebx = 10 - subfunction number
1209
  * ecx = number of channel (from 0 up to 3 inclusively)
1170
  * ecx = number of channel (from 0 up to 3 inclusively)
1210
Returned value:
1171
Returned value:
1211
  * eax = 0 - success
1172
  * eax = 0 - success
1212
  * eax = -1 - incorrect channel number
1173
  * eax = -1 - incorrect channel number
1213
Remarks:
1174
Remarks:
1214
  * Number of DMA channel is used in subfunction 1 of function 55.
1175
  * Number of DMA channel is used in subfunction 1 of function 55.
1215
  * To get sound DMA channel use subfunction 10 of function 26.
1176
  * To get sound DMA channel use subfunction 10 of function 26.
1216
 
1177
 
1217
======================================================================
1178
======================================================================
1218
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1179
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1219
======================================================================
1180
======================================================================
1220
Parameters:
1181
Parameters:
1221
  * eax = 21 - function number
1182
  * eax = 21 - function number
1222
  * ebx = 11 - subfunction number
1183
  * ebx = 11 - subfunction number
1223
  * ecx = 0/1 - disable/enable
1184
  * ecx = 0/1 - disable/enable
1224
Returned value:
1185
Returned value:
1225
  * eax = 0
1186
  * eax = 0
1226
Remarks:
1187
Remarks:
1227
  * Is used in LBA-read (subfunction 8 of function 58).
1188
  * Is used in LBA-read (subfunction 8 of function 58).
1228
  * The current implementation uses only low bit of ecx.
1189
  * The current implementation uses only low bit of ecx.
1229
  * To get current status use subfunction 11 of function 26.
1190
  * To get current status use subfunction 11 of function 26.
1230
 
1191
 
1231
======================================================================
1192
======================================================================
1232
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1193
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1233
======================================================================
1194
======================================================================
1234
Parameters:
1195
Parameters:
1235
  * eax = 21 - function number
1196
  * eax = 21 - function number
1236
  * ebx = 12 - subfunction number
1197
  * ebx = 12 - subfunction number
1237
  * ecx = 0/1 - disable/enable
1198
  * ecx = 0/1 - disable/enable
1238
Returned value:
1199
Returned value:
1239
  * eax = 0
1200
  * eax = 0
1240
Remarks:
1201
Remarks:
1241
  * Is used in operations with PCI bus (function 62).
1202
  * Is used in operations with PCI bus (function 62).
1242
  * The current implementation uses only low bit of ecx.
1203
  * The current implementation uses only low bit of ecx.
1243
  * To get current status use subfunction 12 of function 26.
1204
  * To get current status use subfunction 12 of function 26.
1244
 
1205
 
1245
======================================================================
1206
======================================================================
1246
============ Function 21, subfunction 13, subsubfunction 1 ===========
1207
============ Function 21, subfunction 13, subsubfunction 1 ===========
1247
======== Initialize + get information on the driver vmode.mdr. =======
1208
======== Initialize + get information on the driver vmode.mdr. =======
1248
======================================================================
1209
======================================================================
1249
Parameters:
1210
Parameters:
1250
  * eax = 21 - function number
1211
  * eax = 21 - function number
1251
  * ebx = 13 - subfunction number
1212
  * ebx = 13 - subfunction number
1252
  * ecx = 1 - number of the driver function
1213
  * ecx = 1 - number of the driver function
1253
  * edx = pointer to 512-bytes buffer
1214
  * edx = pointer to 512-bytes buffer
1254
Returned value:
1215
Returned value:
1255
  * if driver is not loaded
1216
  * if driver is not loaded
1256
    (never happens in the current implementation):
1217
    (never happens in the current implementation):
1257
    * eax = -1
1218
    * eax = -1
1258
    * ebx, ecx destroyed
1219
    * ebx, ecx destroyed
1259
  * if driver is loaded:
1220
  * if driver is loaded:
1260
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1221
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1261
      - signature
1222
      - signature
1262
    * ebx = current frequency of the scanning (in Hz)
1223
    * ebx = current frequency of the scanning (in Hz)
1263
    * ecx destroyed
1224
    * ecx destroyed
1264
    * buffer pointed to by edx is filled
1225
    * buffer pointed to by edx is filled
1265
Format of the buffer:
1226
Format of the buffer:
1266
  * +0: 32*byte: driver name, "Trans VideoDriver"
1227
  * +0: 32*byte: driver name, "Trans VideoDriver"
1267
    (without quotes, supplemented by spaces)
1228
    (without quotes, supplemented by spaces)
1268
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1229
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1269
    y*65536+x), for the current implementation is 1 (1.0)
1230
    y*65536+x), for the current implementation is 1 (1.0)
1270
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1231
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1271
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1232
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1272
    is number of a videomode, after list itself there are zeroes)
1233
    is number of a videomode, after list itself there are zeroes)
1273
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1234
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1274
    scannings for videomodes: for each videomode listed in the
1235
    scannings for videomodes: for each videomode listed in the
1275
    previous field up to 5 supported frequences are given
1236
    previous field up to 5 supported frequences are given
1276
    (unused positions contain zeroes)
1237
    (unused positions contain zeroes)
1277
Remarks:
1238
Remarks:
1278
  * Function initializes the driver (if it is not initialized yet)
1239
  * Function initializes the driver (if it is not initialized yet)
1279
    and must be called first, before others (otherwise they will do
1240
    and must be called first, before others (otherwise they will do
1280
    nothing and return -1).
1241
    nothing and return -1).
1281
  * The current implementation supports only one frequency
1242
  * The current implementation supports only one frequency
1282
    of the scanning on videomode.
1243
    of the scanning on videomode.
1283
 
1244
 
1284
======================================================================
1245
======================================================================
1285
============ Function 21, subfunction 13, subsubfunction 2 ===========
1246
============ Function 21, subfunction 13, subsubfunction 2 ===========
1286
================ Get information on current videomode. ===============
1247
================ Get information on current videomode. ===============
1287
======================================================================
1248
======================================================================
1288
Parameters:
1249
Parameters:
1289
  * eax = 21 - function number
1250
  * eax = 21 - function number
1290
  * ebx = 13 - subfunction number
1251
  * ebx = 13 - subfunction number
1291
  * ecx = 2 - number of the driver function
1252
  * ecx = 2 - number of the driver function
1292
Returned value:
1253
Returned value:
1293
  * eax = -1 - driver is not loaded or not initialized;
1254
  * eax = -1 - driver is not loaded or not initialized;
1294
    ebx,ecx are destroyed
1255
    ebx,ecx are destroyed
1295
  * eax = [width]*65536 + [height]
1256
  * eax = [width]*65536 + [height]
1296
  * ebx = frequency of the vertical scanning (in Hz)
1257
  * ebx = frequency of the vertical scanning (in Hz)
1297
  * ecx = number of current videomode
1258
  * ecx = number of current videomode
1298
Remarks:
1259
Remarks:
1299
  * Driver must be initialized by call to 
1260
  * Driver must be initialized by call to 
1300
    driver function 1.
1261
    driver function 1.
1301
  * If only screen sizes are required, it is more expedient to use
1262
  * If only screen sizes are required, it is more expedient to use
1302
    function 14 taking into account that it
1263
    function 14 taking into account that it
1303
    returns sizes on 1 less.
1264
    returns sizes on 1 less.
1304
 
1265
 
1305
======================================================================
1266
======================================================================
1306
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1267
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1307
======================================================================
1268
======================================================================
1308
Parameters:
1269
Parameters:
1309
  * eax = 21 - function number
1270
  * eax = 21 - function number
1310
  * ebx = 13 - subfunction number
1271
  * ebx = 13 - subfunction number
1311
  * ecx = 3 - number of the driver function
1272
  * ecx = 3 - number of the driver function
1312
  * edx = [scanning frequency]*65536 + [videomode number]
1273
  * edx = [scanning frequency]*65536 + [videomode number]
1313
Returned value:
1274
Returned value:
1314
  * eax = -1 - driver is not loaded, not initialized or
1275
  * eax = -1 - driver is not loaded, not initialized or
1315
    an error has occured
1276
    an error has occured
1316
  * eax = 0 - success
1277
  * eax = 0 - success
1317
  * ebx, ecx destroyed
1278
  * ebx, ecx destroyed
1318
Remarks:
1279
Remarks:
1319
  * Driver must be initialized by driver function 1.
1280
  * Driver must be initialized by driver function 1.
1320
  * The videomode number and frequency must be in the table
1281
  * The videomode number and frequency must be in the table
1321
    returned by driver function 1.
1282
    returned by driver function 1.
1322
 
1283
 
1323
======================================================================
1284
======================================================================
1324
============ Function 21, subfunction 13, subsubfunction 4 ===========
1285
============ Function 21, subfunction 13, subsubfunction 4 ===========
1325
================== Return to the initial videomode. ==================
1286
================== Return to the initial videomode. ==================
1326
======================================================================
1287
======================================================================
1327
Returns the screen to the videomode set at system boot.
1288
Returns the screen to the videomode set at system boot.
1328
Parameters:
1289
Parameters:
1329
  * eax = 21 - function number
1290
  * eax = 21 - function number
1330
  * ebx = 13 - subfunction number
1291
  * ebx = 13 - subfunction number
1331
  * ecx = 4 - number of the driver function
1292
  * ecx = 4 - number of the driver function
1332
Returned value:
1293
Returned value:
1333
  * eax = -1 - driver is not loaded or not initialized
1294
  * eax = -1 - driver is not loaded or not initialized
1334
  * eax = 0 - success
1295
  * eax = 0 - success
1335
  * ebx, ecx destroyed
1296
  * ebx, ecx destroyed
1336
Remarks:
1297
Remarks:
1337
  * Driver must be initialized by call to driver function 1.
1298
  * Driver must be initialized by call to driver function 1.
1338
 
1299
 
1339
======================================================================
1300
======================================================================
1340
============ Function 21, subfunction 13, subsubfunction 5 ===========
1301
============ Function 21, subfunction 13, subsubfunction 5 ===========
1341
===== Increase/decrease the size of the visible area of monitor. =====
1302
===== Increase/decrease the size of the visible area of monitor. =====
1342
======================================================================
1303
======================================================================
1343
Parameters:
1304
Parameters:
1344
  * eax = 21 - function number
1305
  * eax = 21 - function number
1345
  * ebx = 13 - subfunction number
1306
  * ebx = 13 - subfunction number
1346
  * ecx = 5 - number of the driver function
1307
  * ecx = 5 - number of the driver function
1347
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1308
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1348
  * edx = 2/3 - is not supported in the current implementation;
1309
  * edx = 2/3 - is not supported in the current implementation;
1349
    is planned as decrease/increase vertical size on 1 position
1310
    is planned as decrease/increase vertical size on 1 position
1350
Returned value:
1311
Returned value:
1351
  * eax = -1 - driver is not loaded or not initialized
1312
  * eax = -1 - driver is not loaded or not initialized
1352
  * eax = 0 - success
1313
  * eax = 0 - success
1353
  * ebx, ecx destroyed
1314
  * ebx, ecx destroyed
1354
Remarks:
1315
Remarks:
1355
  * Driver must be initialized by call to driver function 1.
1316
  * Driver must be initialized by call to driver function 1.
1356
  * Function influences only the physical size of the screen image;
1317
  * Function influences only the physical size of the screen image;
1357
    the logical size (number of pixels) does not change.
1318
    the logical size (number of pixels) does not change.
1358
 
1319
 
1359
======================================================================
1320
======================================================================
1360
================= Function 22 - set system date/time. ================
1321
================= Function 22 - set system date/time. ================
1361
======================================================================
1322
======================================================================
1362
Parameters:
1323
Parameters:
1363
  * eax = 22 - function number
1324
  * eax = 22 - function number
1364
  * ebx = 0 - set time
1325
  * ebx = 0 - set time
1365
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1326
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1366
    * HH=hour 00..23
1327
    * HH=hour 00..23
1367
    * MM=minute 00..59
1328
    * MM=minute 00..59
1368
    * SS=second 00..59
1329
    * SS=second 00..59
1369
  * ebx = 1 - set date
1330
  * ebx = 1 - set date
1370
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1331
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1371
    * DD=day 01..31
1332
    * DD=day 01..31
1372
    * MM=month 01..12
1333
    * MM=month 01..12
1373
    * YY=year 00..99
1334
    * YY=year 00..99
1374
  * ebx = 2 - set day of week
1335
  * ebx = 2 - set day of week
1375
    * ecx = 1 for Sunday, ..., 7 for Saturday
1336
    * ecx = 1 for Sunday, ..., 7 for Saturday
1376
  * ebx = 3 - set alarm clock
1337
  * ebx = 3 - set alarm clock
1377
    * ecx = 0x00SSMMHH
1338
    * ecx = 0x00SSMMHH
1378
Returned value:
1339
Returned value:
1379
  * eax = 0 - success
1340
  * eax = 0 - success
1380
  * eax = 1 - incorrect parameter
1341
  * eax = 1 - incorrect parameter
1381
  * eax = 2 - CMOS-battery was unloaded
1342
  * eax = 2 - CMOS-battery was unloaded
1382
Remarks:
1343
Remarks:
1383
  * Value of installation of day of week seems to be doubtful,
1344
  * Value of installation of day of week seems to be doubtful,
1384
    as it a little where is used
1345
    as it a little where is used
1385
    (day of week can be calculated by date).
1346
    (day of week can be calculated by date).
1386
  * Alarm clock can be set on operation in the given time every day.
1347
  * Alarm clock can be set on operation in the given time every day.
1387
    But there is no existing system function to disable it.
1348
    But there is no existing system function to disable it.
1388
  * Operation of alarm clock consists in generation IRQ8.
1349
  * Operation of alarm clock consists in generation IRQ8.
1389
  * Generally CMOS supports for alarm clock set of value 0xFF
1350
  * Generally CMOS supports for alarm clock set of value 0xFF
1390
    as one of parameters and it means that the appropriate parameter
1351
    as one of parameters and it means that the appropriate parameter
1391
    is ignored. But current implementation does not allow this
1352
    is ignored. But current implementation does not allow this
1392
    (will return 1).
1353
    (will return 1).
1393
  * Alarm clock is a global system resource; the set of
1354
  * Alarm clock is a global system resource; the set of
1394
    an alarm clock cancels automatically the previous set.
1355
    an alarm clock cancels automatically the previous set.
1395
    However, at moment no program uses it.
1356
    However, at moment no program uses it.
1396
 
1357
 
1397
======================================================================
1358
======================================================================
1398
============= Function 23 - wait for event with timeout. =============
1359
============= Function 23 - wait for event with timeout. =============
1399
======================================================================
1360
======================================================================
1400
If the message queue is empty, waits for new message in the queue,
1361
If the message queue is empty, waits for new message in the queue,
1401
but no more than given time. Then reads out a message from the queue.
1362
but no more than given time. Then reads out a message from the queue.
1402
 
1363
 
1403
Parameters:
1364
Parameters:
1404
  * eax = 23 - function number
1365
  * eax = 23 - function number
1405
  * ebx = timeout (in 1/100 of second)
1366
  * ebx = timeout (in 1/100 of second)
1406
Returned value:
1367
Returned value:
1407
  * eax = 0 - the message queue is empty
1368
  * eax = 0 - the message queue is empty
1408
  * otherwise eax = event (see the list of events)
1369
  * otherwise eax = event (see the list of events)
1409
Remarks:
1370
Remarks:
1410
  * Only those events are taken into account, which enter into
1371
  * Only those events are taken into account, which enter into
1411
    the mask set by function 40. By default it is
1372
    the mask set by function 40. By default it is
1412
    redraw, key and button events.
1373
    redraw, key and button events.
1413
  * To check for presence of a message in the queue use function 11.
1374
  * To check for presence of a message in the queue use function 11.
1414
    To wait without timeout use function 10.
1375
    To wait without timeout use function 10.
1415
  * Transmission ebx=0 results in immediate returning eax=0.
1376
  * Transmission ebx=0 results in immediate returning eax=0.
1416
  * Current implementation returns immediately with eax=0,
1377
  * Current implementation returns immediately with eax=0,
1417
    if the addition of ebx with the current value of time counter
1378
    if the addition of ebx with the current value of time counter
1418
    makes 32-bit overflow.
1379
    makes 32-bit overflow.
1419
 
1380
 
1420
======================================================================
1381
======================================================================
1421
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1382
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1422
======================================================================
1383
======================================================================
1423
Parameters:
1384
Parameters:
1424
  * eax = 24 - function number
1385
  * eax = 24 - function number
1425
  * ebx = 1 - subfunction number
1386
  * ebx = 1 - subfunction number
1426
  * ecx = 0x00FRSSMM, where
1387
  * ecx = 0x00FRSSMM, where
1427
    * MM = starting minute
1388
    * MM = starting minute
1428
    * SS = starting second
1389
    * SS = starting second
1429
    * FR = starting frame
1390
    * FR = starting frame
1430
Returned value:
1391
Returned value:
1431
  * eax = 0 - success
1392
  * eax = 0 - success
1432
  * eax = 1 - CD base is not defined
1393
  * eax = 1 - CD base is not defined
1433
Remarks:
1394
Remarks:
1434
  * Previously CD base must be defined by the call to 
1395
  * Previously CD base must be defined by the call to 
1435
    subfunction 3 of function 21.
1396
    subfunction 3 of function 21.
1436
  * One second includes 75 frames, one minute includes 60 seconds.
1397
  * One second includes 75 frames, one minute includes 60 seconds.
1437
  * The function is asynchronous (returns control, when play begins).
1398
  * The function is asynchronous (returns control, when play begins).
1438
 
1399
 
1439
======================================================================
1400
======================================================================
1440
======= Function 24, subfunction 2 - get information on tracks. ======
1401
======= Function 24, subfunction 2 - get information on tracks. ======
1441
======================================================================
1402
======================================================================
1442
Parameters:
1403
Parameters:
1443
  * eax = 24 - function number
1404
  * eax = 24 - function number
1444
  * ebx = 2 - subfunction number
1405
  * ebx = 2 - subfunction number
1445
  * ecx = pointer to the buffer for the table
1406
  * ecx = pointer to the buffer for the table
1446
    (maximum 8*64h+4 bytes=100 tracks)
1407
    (maximum 8*64h+4 bytes=100 tracks)
1447
Returned value:
1408
Returned value:
1448
  * eax = 0 - success
1409
  * eax = 0 - success
1449
  * eax = 1 - CD base is not defined
1410
  * eax = 1 - CD base is not defined
1450
Remarks:
1411
Remarks:
1451
  * The format of the table with tracks information is the same as
1412
  * The format of the table with tracks information is the same as
1452
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1413
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1453
    Function returns addresses in MSF.
1414
    Function returns addresses in MSF.
1454
  * Previously CD base port must be set by call to 
1415
  * Previously CD base port must be set by call to 
1455
    subfunction 3 of function 21.
1416
    subfunction 3 of function 21.
1456
  * Function returns information only about no more than 100
1417
  * Function returns information only about no more than 100
1457
    first tracks. In most cases it is enough.
1418
    first tracks. In most cases it is enough.
1458
 
1419
 
1459
======================================================================
1420
======================================================================
1460
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1421
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1461
======================================================================
1422
======================================================================
1462
Parameters:
1423
Parameters:
1463
  * eax = 24 - function number
1424
  * eax = 24 - function number
1464
  * ebx = 1 - subfunction number
1425
  * ebx = 1 - subfunction number
1465
Returned value:
1426
Returned value:
1466
  * eax = 0 - success
1427
  * eax = 0 - success
1467
  * eax = 1 - CD base is not defined
1428
  * eax = 1 - CD base is not defined
1468
Çàìå÷àíèÿ:
1429
Çàìå÷àíèÿ:
1469
  * Previously CD base port must be defined by call to 
1430
  * Previously CD base port must be defined by call to 
1470
    subfunction 3 of function 21.
1431
    subfunction 3 of function 21.
1471
 
1432
 
1472
======================================================================
1433
======================================================================
1473
=================== Function 25 - set SBPro volume. ==================
1434
=================== Function 25 - set SBPro volume. ==================
1474
======================================================================
1435
======================================================================
1475
Parameters:
1436
Parameters:
1476
  * eax = 25 - function number
1437
  * eax = 25 - function number
1477
  * ebx = what to set:
1438
  * ebx = what to set:
1478
    * 1 - set common volume
1439
    * 1 - set common volume
1479
    * 2 - set CD-audio volume
1440
    * 2 - set CD-audio volume
1480
  * cl = volume level: high 4 bits for the left column,
1441
  * cl = volume level: high 4 bits for the left column,
1481
    low 4 bits for the right one
1442
    low 4 bits for the right one
1482
Returned value:
1443
Returned value:
1483
  * eax = 0 - success
1444
  * eax = 0 - success
1484
  * eax = 1 - SB base is not defined
1445
  * eax = 1 - SB base is not defined
1485
  * eax = 2 - incorrect subfunction
1446
  * eax = 2 - incorrect subfunction
1486
Remarks:
1447
Remarks:
1487
  * Previously SB base port must be defined by 
1448
  * Previously SB base port must be defined by 
1488
    subfunction 4 of function 21.
1449
    subfunction 4 of function 21.
1489
  * See also function 28 which sets
1450
  * See also function 28 which sets
1490
    volume for the later standard SB16.
1451
    volume for the later standard SB16.
1491
 
1452
 
1492
======================================================================
1453
======================================================================
1493
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1454
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1494
======================================================================
1455
======================================================================
1495
Parameters:
1456
Parameters:
1496
  * eax = 26 - function number
1457
  * eax = 26 - function number
1497
  * ebx = 1 - subfunction number
1458
  * ebx = 1 - subfunction number
1498
Returned value:
1459
Returned value:
1499
  * eax = port number
1460
  * eax = port number
1500
Parameters:
1461
Parameters:
1501
  * To set base port use subfunction 1 of function 21.
1462
  * To set base port use subfunction 1 of function 21.
1502
 
1463
 
1503
======================================================================
1464
======================================================================
1504
========== Function 26, subfunction 2 - get keyboard layout. =========
1465
========== Function 26, subfunction 2 - get keyboard layout. =========
1505
======================================================================
1466
======================================================================
1506
The keyboard layout is used to convert keyboard scancodes to
1467
The keyboard layout is used to convert keyboard scancodes to
1507
ASCII-codes for function 2.
1468
ASCII-codes for function 2.
1508
Parameters:
1469
Parameters:
1509
  * eax = 26 - function number
1470
  * eax = 26 - function number
1510
  * ebx = 2 - subfunction number
1471
  * ebx = 2 - subfunction number
1511
  * ecx = what layout to get:
1472
  * ecx = what layout to get:
1512
    * 1 = normal layout
1473
    * 1 = normal layout
1513
    * 2 = layout with pressed Shift
1474
    * 2 = layout with pressed Shift
1514
    * 3 = layout with pressed Alt
1475
    * 3 = layout with pressed Alt
1515
  * edx = pointer to the 128-bytes buffer, where the layout will be
1476
  * edx = pointer to the 128-bytes buffer, where the layout will be
1516
    copied
1477
    copied
1517
Returned value:
1478
Returned value:
1518
  * function does not return value
1479
  * function does not return value
1519
Or:
1480
Or:
1520
  * eax = 26 - function number
1481
  * eax = 26 - function number
1521
  * ebx = 2 - subfunction number
1482
  * ebx = 2 - subfunction number
1522
  * ecx = 9
1483
  * ecx = 9
1523
Returned value:
1484
Returned value:
1524
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1485
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1525
Remarks:
1486
Remarks:
1526
  * If Alt is pressed, the layout with Alt is used;
1487
  * If Alt is pressed, the layout with Alt is used;
1527
    if Alt is not pressed, but Shift is pressed,
1488
    if Alt is not pressed, but Shift is pressed,
1528
    the layout with Shift is used;
1489
    the layout with Shift is used;
1529
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1490
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1530
    layout is used and then from the code is subtracted 0x60;
1491
    layout is used and then from the code is subtracted 0x60;
1531
    if no control key is pressed, the normal layout is used.
1492
    if no control key is pressed, the normal layout is used.
1532
  * To set layout and country identifier use 
1493
  * To set layout and country identifier use 
1533
    subfunction 2 of function 21.
1494
    subfunction 2 of function 21.
1534
  * Country identifier is global system variable, which is not used
1495
  * Country identifier is global system variable, which is not used
1535
    by the kernel itself; however the application '@panel' displays
1496
    by the kernel itself; however the application '@panel' displays
1536
    the corresponding icon (using this function).
1497
    the corresponding icon (using this function).
1537
  * The application @panel switches layouts on user request.
1498
  * The application @panel switches layouts on user request.
1538
 
1499
 
1539
======================================================================
1500
======================================================================
1540
============== Function 26, subfunction 3 - get CD base. =============
1501
============== Function 26, subfunction 3 - get CD base. =============
1541
======================================================================
1502
======================================================================
1542
Parameters:
1503
Parameters:
1543
  * eax = 26 - function number
1504
  * eax = 26 - function number
1544
  * ebx = 3 - subfunction number
1505
  * ebx = 3 - subfunction number
1545
Returned value:
1506
Returned value:
1546
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1507
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1547
Remarks:
1508
Remarks:
1548
  * CD base is used by function 24.
1509
  * CD base is used by function 24.
1549
  * To set CD base use subfunction 3 of function 21.
1510
  * To set CD base use subfunction 3 of function 21.
1550
 
1511
 
1551
======================================================================
1512
======================================================================
1552
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
1513
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
1553
======================================================================
1514
======================================================================
1554
Parameters:
1515
Parameters:
1555
  * eax = 26 - function number
1516
  * eax = 26 - function number
1556
  * ebx = 4 - subfunction number
1517
  * ebx = 4 - subfunction number
1557
Returned value:
1518
Returned value:
1558
  * eax = base port number
1519
  * eax = base port number
1559
Remarks:
1520
Remarks:
1560
  * Bae port is used by functions 25, 55.
1521
  * Bae port is used by functions 25, 55.
1561
  * To set base port use subfunction 4 of function 21.
1522
  * To set base port use subfunction 4 of function 21.
1562
 
1523
 
1563
======================================================================
1524
======================================================================
1564
========== Function 26, subfunction 5 - get system language. =========
1525
========== Function 26, subfunction 5 - get system language. =========
1565
======================================================================
1526
======================================================================
1566
Parameters:
1527
Parameters:
1567
  * eax = 26 - function number
1528
  * eax = 26 - function number
1568
  * ebx = 5 - subfunction number
1529
  * ebx = 5 - subfunction number
1569
Returned value:
1530
Returned value:
1570
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1531
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1571
Remarks:
1532
Remarks:
1572
  * System language is global system variable and is not used
1533
  * System language is global system variable and is not used
1573
    by the kernel itself, however application @panel draws the
1534
    by the kernel itself, however application @panel draws the
1574
    appropriate icon (using this function).
1535
    appropriate icon (using this function).
1575
  * To set system language use subfunction 5 of function 21.
1536
  * To set system language use subfunction 5 of function 21.
1576
 
1537
 
1577
======================================================================
1538
======================================================================
1578
=========== Function 26, subfunction 6 - get WSS base port. ==========
-
 
1579
======================================================================
-
 
1580
Parameters:
-
 
1581
  * eax = 26 - function number
-
 
1582
  * ebx = 6 - subfunction number
-
 
1583
Returned value:
-
 
1584
  * eax = base port
-
 
1585
Remarks:
-
 
1586
  * WSS base is used by function 27.
-
 
1587
  * To set WSS base port use subfunction 6 of function 21.
-
 
1588
 
-
 
1589
======================================================================
-
 
1590
============== Function 26, subfunction 7 - get HD base. =============
1539
============== Function 26, subfunction 7 - get HD base. =============
1591
======================================================================
1540
======================================================================
1592
The HD base defines hard disk to write with usage of obsolete
1541
The HD base defines hard disk to write with usage of obsolete
1593
file system functions and functions implicitly using the hard disk
1542
file system functions and functions implicitly using the hard disk
1594
(such as subfunction 6 of function 18);
1543
(such as subfunction 6 of function 18);
1595
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1544
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1596
these function set base themselves.
1545
these function set base themselves.
1597
Parameters:
1546
Parameters:
1598
  * eax = 26 - function number
1547
  * eax = 26 - function number
1599
  * ebx = 7 - subfunction number
1548
  * ebx = 7 - subfunction number
1600
Returned value:
1549
Returned value:
1601
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1550
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1602
Remarks:
1551
Remarks:
1603
  * Any application in any time can change HD base.
1552
  * Any application in any time can change HD base.
1604
  * To set base use subfunction 7 of function 21.
1553
  * To set base use subfunction 7 of function 21.
1605
  * To get used partition of hard disk use subfunction 8.
1554
  * To get used partition of hard disk use subfunction 8.
1606
 
1555
 
1607
======================================================================
1556
======================================================================
1608
========= Function 26, subfunction 8 - get used HD partition. ========
1557
========= Function 26, subfunction 8 - get used HD partition. ========
1609
======================================================================
1558
======================================================================
1610
The HD partition defines partition of the hard disk to write with
1559
The HD partition defines partition of the hard disk to write with
1611
usage of obsolete file system functions and functions implicitly
1560
usage of obsolete file system functions and functions implicitly
1612
using the hard disk (such as subfunction 6 of function 18);
1561
using the hard disk (such as subfunction 6 of function 18);
1613
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1562
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1614
these functions set base and partition themselves.
1563
these functions set base and partition themselves.
1615
Parameters:
1564
Parameters:
1616
  * eax = 26 - function number
1565
  * eax = 26 - function number
1617
  * ebx = 8 - subfunction number
1566
  * ebx = 8 - subfunction number
1618
Returned value:
1567
Returned value:
1619
  * eax = HD partition (beginning from 1)
1568
  * eax = HD partition (beginning from 1)
1620
Remarks:
1569
Remarks:
1621
  * Any application in any time can change partition.
1570
  * Any application in any time can change partition.
1622
  * To set partition use subfunction 8 of function 21.
1571
  * To set partition use subfunction 8 of function 21.
1623
  * To get number of partitions on a hard disk use
1572
  * To get number of partitions on a hard disk use
1624
    subfunction 11 of function 18.
1573
    subfunction 11 of function 18.
1625
  * To get base of used hard disk, use subfunction 7.
1574
  * To get base of used hard disk, use subfunction 7.
1626
 
1575
 
1627
======================================================================
1576
======================================================================
1628
=== Function 26, subfunction 9 - get the value of the time counter. ==
1577
=== Function 26, subfunction 9 - get the value of the time counter. ==
1629
======================================================================
1578
======================================================================
1630
Parameters:
1579
Parameters:
1631
  * eax = 26 - function number
1580
  * eax = 26 - function number
1632
  * ebx = 9 - subfunction number
1581
  * ebx = 9 - subfunction number
1633
Returned value:
1582
Returned value:
1634
  * eax = number of 1/100s of second, past from the system boot time
1583
  * eax = number of 1/100s of second, past from the system boot time
1635
Remarks:
1584
Remarks:
1636
  * Counter takes modulo 2^32, that correspond to a little more
1585
  * Counter takes modulo 2^32, that correspond to a little more
1637
    than 497 days.
1586
    than 497 days.
1638
  * To get system time use function 3.
1587
  * To get system time use function 3.
1639
 
1588
 
1640
======================================================================
1589
======================================================================
1641
======== Function 26, subfunction 10 - get sound DMA channel. ========
1590
======== Function 26, subfunction 10 - get sound DMA channel. ========
1642
======================================================================
1591
======================================================================
1643
Parameters:
1592
Parameters:
1644
  * eax = 26 - function number
1593
  * eax = 26 - function number
1645
  * ebx = 10 - subfunction number
1594
  * ebx = 10 - subfunction number
1646
Returned value:
1595
Returned value:
1647
  * eax = number of the channel (from 0 to 3 inclusive)
1596
  * eax = number of the channel (from 0 to 3 inclusive)
1648
Remarks:
1597
Remarks:
1649
  * Number of the DMA channel is used by subfunction 1 of function 55.
1598
  * Number of the DMA channel is used by subfunction 1 of function 55.
1650
  * To set the sound DMA channel use subfunction 10 of function 21.
1599
  * To set the sound DMA channel use subfunction 10 of function 21.
1651
 
1600
 
1652
======================================================================
1601
======================================================================
1653
===================== Function 26, subfunction 11 ====================
1602
===================== Function 26, subfunction 11 ====================
1654
========== Find out whether low-level HD access is enabled. ==========
1603
========== Find out whether low-level HD access is enabled. ==========
1655
======================================================================
1604
======================================================================
1656
Parameters:
1605
Parameters:
1657
  * eax = 26 - function number
1606
  * eax = 26 - function number
1658
  * ebx = 11 - subfunction number
1607
  * ebx = 11 - subfunction number
1659
Returned value:
1608
Returned value:
1660
  * eax = 0/1 - disabled/enabled
1609
  * eax = 0/1 - disabled/enabled
1661
Remarks:
1610
Remarks:
1662
  * Is used in LBA read (subfunction 8 of function 58).
1611
  * Is used in LBA read (subfunction 8 of function 58).
1663
  * To set current state use subfunction 11 of function 21.
1612
  * To set current state use subfunction 11 of function 21.
1664
 
1613
 
1665
======================================================================
1614
======================================================================
1666
===================== Function 26, subfunction 12 ====================
1615
===================== Function 26, subfunction 12 ====================
1667
========== Find out whether low-level PCI access is enabled. =========
1616
========== Find out whether low-level PCI access is enabled. =========
1668
======================================================================
1617
======================================================================
1669
Parameters:
1618
Parameters:
1670
  * eax = 26 - function number
1619
  * eax = 26 - function number
1671
  * ebx = 12 - subfunction number
1620
  * ebx = 12 - subfunction number
1672
Returned value:
1621
Returned value:
1673
  * eax = 0/1 - disabled/enabled
1622
  * eax = 0/1 - disabled/enabled
1674
Remarks:
1623
Remarks:
1675
  * Is used by operations with PCI bus (function 62).
1624
  * Is used by operations with PCI bus (function 62).
1676
  * The current implementation uses only low bit of ecx.
1625
  * The current implementation uses only low bit of ecx.
1677
  * To set the current state use subfunction 12 of function 21.
1626
  * To set the current state use subfunction 12 of function 21.
1678
 
1627
 
1679
======================================================================
1628
======================================================================
1680
======== Function 27 - set Windows Sound System (WSS) volume. ========
-
 
1681
======================================================================
-
 
1682
Parameters:
-
 
1683
  * eax = 27 - function number
-
 
1684
  * ebx = what to set:
-
 
1685
    * 1 - set common volume
-
 
1686
    * 2 - set Line In volume
-
 
1687
  * cl = volume level (0x0=highest, 0x1F=lowest,
-
 
1688
    if bit 0x80 is set=disable)
-
 
1689
Returned value:
-
 
1690
  * eax = 0 - success
-
 
1691
  * eax = 1 - WSS base is not defined
-
 
1692
  * eax = 2 - incorrect subfunction
-
 
1693
Remarks:
-
 
1694
  * Previously WSS base port must be defined by call to 
-
 
1695
    subfunction 6 of function 21.
-
 
1696
  * Set of common volume is ignored (function simply returns eax=0).
-
 
1697
  * Old documentation and kernel sources erraticly name function 2
-
 
1698
    as CD-audio volume.
-
 
1699
 
-
 
1700
======================================================================
-
 
1701
=================== Function 28 - set SB16 volume. ===================
1629
=================== Function 28 - set SB16 volume. ===================
1702
======================================================================
1630
======================================================================
1703
Parameters:
1631
Parameters:
1704
  * eax = 28 - function number
1632
  * eax = 28 - function number
1705
  * ebx = what to install:
1633
  * ebx = what to install:
1706
    * 1 - install common volume
1634
    * 1 - install common volume
1707
    * 2 - install CD-audio volume
1635
    * 2 - install CD-audio volume
1708
  * cl = volume level (0=off, 0xFF=max)
1636
  * cl = volume level (0=off, 0xFF=max)
1709
Returned value:
1637
Returned value:
1710
  * eax = 0 - success
1638
  * eax = 0 - success
1711
  * eax = 1 - SB base is not defined
1639
  * eax = 1 - SB base is not defined
1712
  * eax = 2 - incorrect subfunction
1640
  * eax = 2 - incorrect subfunction
1713
Remarks:
1641
Remarks:
1714
  * Previously SB base port must be defined by
1642
  * Previously SB base port must be defined by
1715
    subfunction 4 of function 21.
1643
    subfunction 4 of function 21.
1716
  * This function gives more variants for volume, that function 25.
1644
  * This function gives more variants for volume, that function 25.
1717
 
1645
 
1718
======================================================================
1646
======================================================================
1719
=================== Function 29 - get system date. ===================
1647
=================== Function 29 - get system date. ===================
1720
======================================================================
1648
======================================================================
1721
Parameters:
1649
Parameters:
1722
  * eax = 29 - function number
1650
  * eax = 29 - function number
1723
Returned value:
1651
Returned value:
1724
  * eax = 0x00DDMMYY, where
1652
  * eax = 0x00DDMMYY, where
1725
    (binary-decimal coding, BCD, is used)
1653
    (binary-decimal coding, BCD, is used)
1726
  * YY = two low digits of year (00..99)
1654
  * YY = two low digits of year (00..99)
1727
  * MM = month (01..12)
1655
  * MM = month (01..12)
1728
  * DD = day (01..31)
1656
  * DD = day (01..31)
1729
Remarks:
1657
Remarks:
1730
  * To set system date use function 22.
1658
  * To set system date use function 22.
1731
 
1659
 
1732
======================================================================
1660
======================================================================
1733
=============== Function 32 - delete file from ramdisk. ==============
1661
=============== Function 32 - delete file from ramdisk. ==============
1734
======================================================================
1662
======================================================================
1735
Parameters:
1663
Parameters:
1736
  * eax = 32 - function number
1664
  * eax = 32 - function number
1737
  * ebx = pointer to the filename
1665
  * ebx = pointer to the filename
1738
Returned value:
1666
Returned value:
1739
  * eax = 0 - success; otherwise file system error code
1667
  * eax = 0 - success; otherwise file system error code
1740
Remarks:
1668
Remarks:
1741
  * This function is obsolete; function 58 allows to fulfill
1669
  * This function is obsolete; function 58 allows to fulfill
1742
    the same operations with the extended possibilities.
1670
    the same operations with the extended possibilities.
1743
  * The current implementation returns only values 0(success) and
1671
  * The current implementation returns only values 0(success) and
1744
    5(file not found).
1672
    5(file not found).
1745
  * The filename must be either in the format 8+3 characters
1673
  * The filename must be either in the format 8+3 characters
1746
    (first 8 characters - name itself, last 3 - extension,
1674
    (first 8 characters - name itself, last 3 - extension,
1747
    the short names and extensions are supplemented with spaces),
1675
    the short names and extensions are supplemented with spaces),
1748
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1676
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1749
    (name no more than 8 characters, dot, extension 3 characters
1677
    (name no more than 8 characters, dot, extension 3 characters
1750
    supplemented if necessary by spaces).
1678
    supplemented if necessary by spaces).
1751
    The filename must be written with capital letters. The terminating
1679
    The filename must be written with capital letters. The terminating
1752
    character with code 0 is not necessary (not ASCIIZ-string).
1680
    character with code 0 is not necessary (not ASCIIZ-string).
1753
  * This function does not support folders on the ramdisk.
1681
  * This function does not support folders on the ramdisk.
1754
 
1682
 
1755
======================================================================
1683
======================================================================
1756
================ Function 33 - write file to ramdisk. ================
1684
================ Function 33 - write file to ramdisk. ================
1757
======================================================================
1685
======================================================================
1758
Parameters:
1686
Parameters:
1759
  * eax = 33 - function number
1687
  * eax = 33 - function number
1760
  * ebx = pointer to the filename
1688
  * ebx = pointer to the filename
1761
  * ecx = pointer to data for writing
1689
  * ecx = pointer to data for writing
1762
  * edx = number of bytes for writing
1690
  * edx = number of bytes for writing
1763
  * should be set esi=0
1691
  * should be set esi=0
1764
Returned value:
1692
Returned value:
1765
  * eax = 0 - success, otherwise file system error code
1693
  * eax = 0 - success, otherwise file system error code
1766
Remarks:
1694
Remarks:
1767
  * This function is obsolete; function 70 allows to fulfil
1695
  * This function is obsolete; function 70 allows to fulfil
1768
    the same operations with extended possibilities.
1696
    the same operations with extended possibilities.
1769
  * If esi contains non-zero value and selected file already exists,
1697
  * If esi contains non-zero value and selected file already exists,
1770
    one more file with the same name will be created.
1698
    one more file with the same name will be created.
1771
  * Otherwise file will be overwritten.
1699
  * Otherwise file will be overwritten.
1772
  * The filename must be either in the format 8+3 characters
1700
  * The filename must be either in the format 8+3 characters
1773
    (first 8 characters - name itself, last 3 - extension,
1701
    (first 8 characters - name itself, last 3 - extension,
1774
    the short names and extensions are supplemented with spaces),
1702
    the short names and extensions are supplemented with spaces),
1775
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1703
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1776
    (name no more than 8 characters, dot, extension 3 characters
1704
    (name no more than 8 characters, dot, extension 3 characters
1777
    supplemented if necessary by spaces).
1705
    supplemented if necessary by spaces).
1778
    The filename must be written with capital letters. The terminating
1706
    The filename must be written with capital letters. The terminating
1779
    character with code 0 is not necessary (not ASCIIZ-string).
1707
    character with code 0 is not necessary (not ASCIIZ-string).
1780
  * This function does not support folders on the ramdisk.
1708
  * This function does not support folders on the ramdisk.
1781
 
1709
 
1782
======================================================================
1710
======================================================================
1783
======= Function 35 - read the color of a pixel on the screen. =======
1711
======= Function 35 - read the color of a pixel on the screen. =======
1784
======================================================================
1712
======================================================================
1785
Parameters:
1713
Parameters:
1786
  * eax = 35
1714
  * eax = 35
1787
  * ebx = y*xsize+x, where
1715
  * ebx = y*xsize+x, where
1788
  * (x,y) = coordinates of a pixel (beginning from 0)
1716
  * (x,y) = coordinates of a pixel (beginning from 0)
1789
  * xsize = horizontal screen size
1717
  * xsize = horizontal screen size
1790
Returned value:
1718
Returned value:
1791
  * eax = color 0x00RRGGBB
1719
  * eax = color 0x00RRGGBB
1792
Remarks:
1720
Remarks:
1793
  * To get screen sizes use function 14. Pay attention,
1721
  * To get screen sizes use function 14. Pay attention,
1794
    that it subtracts 1 from both sizes.
1722
    that it subtracts 1 from both sizes.
1795
  * There is also direct access (without any system calls)
1723
  * There is also direct access (without any system calls)
1796
    to videomemory through the selector gs. To get parameters of
1724
    to videomemory through the selector gs. To get parameters of
1797
    the current videomode, use function 61.
1725
    the current videomode, use function 61.
1798
 
1726
 
1799
======================================================================
1727
======================================================================
1800
========= Function 37 - get coordinates/status of the mouse. =========
1728
=================== Function 37 - work with mouse. ===================
1801
======================================================================
1729
======================================================================
1802
 
1730
 
1803
---------- Subfunction 0 - screen coordinates of the mouse -----------
1731
---------- Subfunction 0 - screen coordinates of the mouse -----------
1804
Parameters:
1732
Parameters:
1805
  * eax = 37 - function number
1733
  * eax = 37 - function number
1806
  * ebx = 0 - subfunction number
1734
  * ebx = 0 - subfunction number
1807
Returned value:
1735
Returned value:
1808
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1736
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1809
    (beginning from 0)
1737
    (beginning from 0)
1810
 
1738
 
1811
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1739
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1812
Parameters:
1740
Parameters:
1813
  * eax = 37 - function number
1741
  * eax = 37 - function number
1814
  * ebx = 1 - subfunction number
1742
  * ebx = 1 - subfunction number
1815
Returned value:
1743
Returned value:
1816
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1744
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1817
    relative to the application window (beginning from 0)
1745
    relative to the application window (beginning from 0)
1818
Remarks:
1746
Remarks:
1819
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1747
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1820
    If y>=ywnd, the low word is non-negative and contains
1748
    If y>=ywnd, the low word is non-negative and contains
1821
    relative y-coordinate, and the high word - relative x-coordinate
1749
    relative y-coordinate, and the high word - relative x-coordinate
1822
    (with correct sign). Otherwise the low word is negative and still
1750
    (with correct sign). Otherwise the low word is negative and still
1823
    contains relative y-coordinate, and to the high word
1751
    contains relative y-coordinate, and to the high word
1824
    1 should be added.
1752
    1 should be added.
1825
 
1753
 
1826
------------ Subfunction 2 - pressed buttons of the mouse ------------
1754
------------ Subfunction 2 - pressed buttons of the mouse ------------
1827
Parameters:
1755
Parameters:
1828
  * eax = 37 - function number
1756
  * eax = 37 - function number
1829
  * ebx = 2 - subfunction number
1757
  * ebx = 2 - subfunction number
1830
Returned value:
1758
Returned value:
1831
  * eax contains information on the pressed mouse buttons:
1759
  * eax contains information on the pressed mouse buttons:
1832
  * bit 0 is set = left button is pressed
1760
  * bit 0 is set = left button is pressed
1833
  * bit 1 is set = right button is pressed
1761
  * bit 1 is set = right button is pressed
1834
  * other bits are cleared
1762
  * other bits are cleared
-
 
1763
 
-
 
1764
-------------------- Subfunction 4 - load cursor ---------------------
-
 
1765
Parameters:
-
 
1766
  * eax = 37 - function number
-
 
1767
  * ebx = 4 - subfunction number
-
 
1768
  * dx = data source:
-
 
1769
  * dx = LOAD_FROM_FILE = 0 - data in a file
-
 
1770
    * ecx = pointer to full path to the cursor file
-
 
1771
    * the file must be in the format .cur, which is standard for
-
 
1772
      MS Windows, at that of the size 32*32 pixels
-
 
1773
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
-
 
1774
    * ecx = pointer to data of the cursor file
-
 
1775
    * the data format is the same as in the previous case
-
 
1776
  * dx = LOAD_INDIRECT = 2 - data in memory
-
 
1777
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
-
 
1778
    * edx = 0xXXYY0002, where
-
 
1779
      * XX = x-coordinate of cursor hotspot
-
 
1780
      * YY = y-coordinate
-
 
1781
      * 0 <= XX, YY <= 31
-
 
1782
Returned value:
-
 
1783
  * eax = 0 - failed
-
 
1784
  * otherwise eax = cursor handle
-
 
1785
 
-
 
1786
--------------------- Subfunction 5 - set cursor ---------------------
-
 
1787
Sets new cursor for the window of the current thread.
-
 
1788
Parameters:
-
 
1789
  * eax = 37 - function number
-
 
1790
  * ebx = 5 - subfunction number
-
 
1791
  * ecx = cursor handle
-
 
1792
Returned value:
-
 
1793
  * eax = handle of previous cursor
-
 
1794
Remarks:
-
 
1795
  * If the handle is incorrect, the function restores the default
-
 
1796
    cursor (standard arrow). In particular, ecx=0 restores it.
-
 
1797
 
-
 
1798
------------------- Subfunction 6 - delete cursor --------------------
-
 
1799
Parameters:
-
 
1800
  * eax = 37 - function number
-
 
1801
  * ebx = 6 - subfunction number
-
 
1802
  * ecx = cursor handle
-
 
1803
Returned value:
-
 
1804
  * eax destroyed
-
 
1805
Remarks:
-
 
1806
  * The cursor must be loaded previously by the current thread
-
 
1807
    (with the call to subfunction 4). The function does not delete
-
 
1808
    system cursors and cursors, loaded by another applications.
-
 
1809
  * If the active cursor (set by subfunction 5) is deleted,
-
 
1810
    the system restores the default cursor (standard arrow).
1835
 
1811
 
1836
======================================================================
1812
======================================================================
1837
====================== Function 38 - draw line. ======================
1813
====================== Function 38 - draw line. ======================
1838
======================================================================
1814
======================================================================
1839
Parameters:
1815
Parameters:
1840
  * eax = 38 - function number
1816
  * eax = 38 - function number
1841
  * ebx = [start coordinate on axis x]*65536 +
1817
  * ebx = [start coordinate on axis x]*65536 +
1842
              [end coordinate on axis x]
1818
              [end coordinate on axis x]
1843
  * ecx = [start coordinate on axis y]*65536 +
1819
  * ecx = [start coordinate on axis y]*65536 +
1844
              [end coordinate on axis y]
1820
              [end coordinate on axis y]
1845
  * edx = 0x00RRGGBB - color
1821
  * edx = 0x00RRGGBB - color
1846
    edx = 0x01xxxxxx - draw inversed line
1822
    edx = 0x01xxxxxx - draw inversed line
1847
          (low 24 bits are ignored)
1823
          (low 24 bits are ignored)
1848
Returned value:
1824
Returned value:
1849
  * function does not return value
1825
  * function does not return value
1850
Remarks:
1826
Remarks:
1851
  * Coordinates are relative to the window.
1827
  * Coordinates are relative to the window.
1852
  * End point is also drawn.
1828
  * End point is also drawn.
1853
 
1829
 
1854
======================================================================
1830
======================================================================
1855
== Function 39, subfunction 1 - get a size of the background image. ==
1831
== Function 39, subfunction 1 - get a size of the background image. ==
1856
======================================================================
1832
======================================================================
1857
Parameters:
1833
Parameters:
1858
  * eax = 39 - function number
1834
  * eax = 39 - function number
1859
  * ebx = 1 - subfunction number
1835
  * ebx = 1 - subfunction number
1860
Returned value:
1836
Returned value:
1861
  * eax = [width]*65536 + [height]
1837
  * eax = [width]*65536 + [height]
1862
Remarks:
1838
Remarks:
1863
  * There is a pair function to set sizes of background image -
1839
  * There is a pair function to set sizes of background image -
1864
    subfunction 1 of function 15. After which it is necessary,
1840
    subfunction 1 of function 15. After which it is necessary,
1865
    of course, anew to define image.
1841
    of course, anew to define image.
1866
 
1842
 
1867
======================================================================
1843
======================================================================
1868
== Function 39, subfunction 2 - get pixel from the background image. =
1844
== Function 39, subfunction 2 - get pixel from the background image. =
1869
======================================================================
1845
======================================================================
1870
Parameters:
1846
Parameters:
1871
  * eax = 39 - function number
1847
  * eax = 39 - function number
1872
  * ebx = 2 - subfunction number
1848
  * ebx = 2 - subfunction number
1873
  * ecx = offset
1849
  * ecx = offset
1874
Returned value:
1850
Returned value:
1875
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1851
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1876
    (less than 0x160000-16)
1852
    (less than 0x160000-16)
1877
  * eax = 2 otherwise
1853
  * eax = 2 otherwise
1878
Remarks:
1854
Remarks:
1879
  * Do not rely on returned value for invalid offsets, it may be
1855
  * Do not rely on returned value for invalid offsets, it may be
1880
    changed in future kernel versions.
1856
    changed in future kernel versions.
1881
  * Offset for pixel with coordinates (x,y)
1857
  * Offset for pixel with coordinates (x,y)
1882
    is calculated as (x+y*xsize)*3.
1858
    is calculated as (x+y*xsize)*3.
1883
  * There is a pair function to set pixel on the background image - 
1859
  * There is a pair function to set pixel on the background image - 
1884
    subfunction 2 of function 15.
1860
    subfunction 2 of function 15.
1885
 
1861
 
1886
======================================================================
1862
======================================================================
1887
== Function 39, subfunction 4 - get drawing mode for the background. =
1863
== Function 39, subfunction 4 - get drawing mode for the background. =
1888
======================================================================
1864
======================================================================
1889
Parameters:
1865
Parameters:
1890
  * eax = 39 - function number
1866
  * eax = 39 - function number
1891
  * ebx = 4 - subfunction number
1867
  * ebx = 4 - subfunction number
1892
Returned value:
1868
Returned value:
1893
  * eax = 1 - tile
1869
  * eax = 1 - tile
1894
  * eax = 2 - stretch
1870
  * eax = 2 - stretch
1895
Remarks:
1871
Remarks:
1896
  * There is a pair function to set drawing mode - 
1872
  * There is a pair function to set drawing mode - 
1897
    subfunction 4 of function 15.
1873
    subfunction 4 of function 15.
1898
 
1874
 
1899
======================================================================
1875
======================================================================
1900
=========== Function 40 - set the mask for expected events. ==========
1876
=========== Function 40 - set the mask for expected events. ==========
1901
======================================================================
1877
======================================================================
1902
The mask for expected events affects function working with events
1878
The mask for expected events affects function working with events
1903
10, 11, 23 - they notify only about events allowed by this mask.
1879
10, 11, 23 - they notify only about events allowed by this mask.
1904
Parameters:
1880
Parameters:
1905
  * eax = 40 - function number
1881
  * eax = 40 - function number
1906
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1882
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1907
    (set bit permits notice on event)
1883
    (set bit permits notice on event)
1908
Returned value:
1884
Returned value:
1909
  * function does not return value
1885
  * function does not return value
1910
Remarks:
1886
Remarks:
1911
  * Default mask (7=111b) enables nofices about redraw,
1887
  * Default mask (7=111b) enables nofices about redraw,
1912
    keys and buttons. This is enough for many applications.
1888
    keys and buttons. This is enough for many applications.
1913
  * Events prohibited in the mask are saved anyway, when come;
1889
  * Events prohibited in the mask are saved anyway, when come;
1914
    they are simply not informed with event functions.
1890
    they are simply not informed with event functions.
1915
  * Event functions take into account the mask on moment of
1891
  * Event functions take into account the mask on moment of
1916
    function call, not on moment of event arrival.
1892
    function call, not on moment of event arrival.
1917
 
1893
 
1918
======================================================================
1894
======================================================================
1919
==================== Function 41 - get IRQ owner. ====================
1895
==================== Function 41 - get IRQ owner. ====================
1920
======================================================================
1896
======================================================================
1921
Parameters:
1897
Parameters:
1922
  * eax = 41 - function number
1898
  * eax = 41 - function number
1923
  * ebx = IRQ number, 0..15
1899
  * ebx = IRQ number, 0..15
1924
Returned value:
1900
Returned value:
1925
  * eax = owner PID
1901
  * eax = owner PID
1926
  * eax = 0, if there is no owner
1902
  * eax = 0, if there is no owner
1927
  * eax = -1 for incorrect ebx
1903
  * eax = -1 for incorrect ebx
1928
 
1904
 
1929
======================================================================
1905
======================================================================
1930
==================== Function 42 - read IRQ data. ====================
1906
==================== Function 42 - read IRQ data. ====================
1931
======================================================================
1907
======================================================================
1932
When an IRQ occurs, the system reads data from ports indicated
1908
When an IRQ occurs, the system reads data from ports indicated
1933
earlier by function 44 and writes this data to
1909
earlier by function 44 and writes this data to
1934
internal buffer. This function reads out data from that buffer
1910
internal buffer. This function reads out data from that buffer
1935
bytewise.
1911
bytewise.
1936
Parameters:
1912
Parameters:
1937
  * eax = 42 - function number
1913
  * eax = 42 - function number
1938
  * ebx = IRQ number, 0..15
1914
  * ebx = IRQ number, 0..15
1939
Returned value: (use value of ecx to distinguish)
1915
Returned value: (use value of ecx to distinguish)
1940
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1916
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1941
    * ecx = 2
1917
    * ecx = 2
1942
  * if there is no data:
1918
  * if there is no data:
1943
    * eax = 0
1919
    * eax = 0
1944
    * ecx = 1
1920
    * ecx = 1
1945
    * ebx destroyed
1921
    * ebx destroyed
1946
  * if all is ok:
1922
  * if all is ok:
1947
    * eax = byte size of data, not yet read from buffer
1923
    * eax = byte size of data, not yet read from buffer
1948
    * ecx = 0
1924
    * ecx = 0
1949
    * ebx = current byte
1925
    * ebx = current byte
1950
Remarks:
1926
Remarks:
1951
  * Previously the thread must reserve indicated IRQ for itself
1927
  * Previously the thread must reserve indicated IRQ for itself
1952
    by function 45.
1928
    by function 45.
1953
  * The size of data buffer is 4000 bytes, on overflow
1929
  * The size of data buffer is 4000 bytes, on overflow
1954
    "fresh" data cease to be written in the buffer.
1930
    "fresh" data cease to be written in the buffer.
1955
 
1931
 
1956
======================================================================
1932
======================================================================
1957
================ Function 43 - input/output to a port. ===============
1933
================ Function 43 - input/output to a port. ===============
1958
======================================================================
1934
======================================================================
1959
 
1935
 
1960
------------------------ Output data to port -------------------------
1936
------------------------ Output data to port -------------------------
1961
Parameters:
1937
Parameters:
1962
  * eax = 43 - function number
1938
  * eax = 43 - function number
1963
  * bl = byte for output
1939
  * bl = byte for output
1964
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1940
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1965
Returned value:
1941
Returned value:
1966
  * eax = 0 - success
1942
  * eax = 0 - success
1967
  * eax = 1 - the thread has not reserved the selected port
1943
  * eax = 1 - the thread has not reserved the selected port
1968
 
1944
 
1969
------------------------ Input data from port ------------------------
1945
------------------------ Input data from port ------------------------
1970
Parameters:
1946
Parameters:
1971
  * eax = 43 - function number
1947
  * eax = 43 - function number
1972
  * ebx is ignored
1948
  * ebx is ignored
1973
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1949
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1974
Returned value:
1950
Returned value:
1975
  * eax = 0 - success, thus ebx = entered byte
1951
  * eax = 0 - success, thus ebx = entered byte
1976
  * eax = 1 - the thread has not reserved the selected port
1952
  * eax = 1 - the thread has not reserved the selected port
1977
Remarks:
1953
Remarks:
1978
  * Previously the thread must reserve the selected port
1954
  * Previously the thread must reserve the selected port
1979
    for itself by function 46.
1955
    for itself by function 46.
1980
  * Instead of call to this function it is better to use
1956
  * Instead of call to this function it is better to use
1981
    processor instructions in/out - this is much
1957
    processor instructions in/out - this is much
1982
    faster and a bit shorter and easier.
1958
    faster and a bit shorter and easier.
1983
 
1959
 
1984
======================================================================
1960
======================================================================
1985
=========== Function 44 - define operations at IRQ arrival. ==========
1961
=========== Function 44 - define operations at IRQ arrival. ==========
1986
======================================================================
1962
======================================================================
1987
At IRQ arrival the system can read the data from ports defined
1963
At IRQ arrival the system can read the data from ports defined
1988
by this function and write these data to internal buffer, whence
1964
by this function and write these data to internal buffer, whence
1989
they can be read by ôóíêöèåé 42.
1965
they can be read by ôóíêöèåé 42.
1990
Parameters:
1966
Parameters:
1991
  * eax = 44 - function number
1967
  * eax = 44 - function number
1992
  * ebx = pointer to the array of structures each describing one port:
1968
  * ebx = pointer to the array of structures each describing one port:
1993
    * +0: word: 0 means end of array, otherwise port number
1969
    * +0: word: 0 means end of array, otherwise port number
1994
    * +2: byte: reserved (ignored)
1970
    * +2: byte: reserved (ignored)
1995
    * +3: byte: 1=read byte from this port, 2=read word
1971
    * +3: byte: 1=read byte from this port, 2=read word
1996
  * ecx = IRQ number, 0..15
1972
  * ecx = IRQ number, 0..15
1997
Returned value:
1973
Returned value:
1998
  * eax = 0 - success
1974
  * eax = 0 - success
1999
  * eax = 1 - the thread is not owner of selected IRQ
1975
  * eax = 1 - the thread is not owner of selected IRQ
2000
Remarks:
1976
Remarks:
2001
  * Previously the thread must reserve for itself selected IRQ
1977
  * Previously the thread must reserve for itself selected IRQ
2002
    by function 45.
1978
    by function 45.
2003
  * First 16 ports are considered only.
1979
  * First 16 ports are considered only.
2004
  * The current implementation considers incorrect value of field +3
1980
  * The current implementation considers incorrect value of field +3
2005
    as a signal to terminate IRQ processing.
1981
    as a signal to terminate IRQ processing.
2006
 
1982
 
2007
======================================================================
1983
======================================================================
2008
=================== Function 45 - reserve/free IRQ. ==================
1984
=================== Function 45 - reserve/free IRQ. ==================
2009
======================================================================
1985
======================================================================
2010
Parameters:
1986
Parameters:
2011
  * eax = 45 - function number
1987
  * eax = 45 - function number
2012
  * ebx = 0 - reserve, 1 = free
1988
  * ebx = 0 - reserve, 1 = free
2013
  * ecx = IRQ number, 0..15
1989
  * ecx = IRQ number, 0..15
2014
Returned value:
1990
Returned value:
2015
  * eax = 0 - success
1991
  * eax = 0 - success
2016
  * eax = 1 - error (invalid IRQ number
1992
  * eax = 1 - error (invalid IRQ number
2017
    or attempt to reserve not free IRQ
1993
    or attempt to reserve not free IRQ
2018
    or to free IRQ, not reserved by this thread)
1994
    or to free IRQ, not reserved by this thread)
2019
Remarks:
1995
Remarks:
2020
  * IRQ reservation is required for functions 42 and 44.
1996
  * IRQ reservation is required for functions 42 and 44.
2021
  * Only one thread can reserve the specific IRQ.
1997
  * Only one thread can reserve the specific IRQ.
2022
  * IRQs, handled by the system itself, are reserved by the system
1998
  * IRQs, handled by the system itself, are reserved by the system
2023
    (thread 1) at booting.
1999
    (thread 1) at booting.
2024
  * When a thread terminates, all reserved by it IRQs
2000
  * When a thread terminates, all reserved by it IRQs
2025
    are freed automatically.
2001
    are freed automatically.
2026
 
2002
 
2027
======================================================================
2003
======================================================================
2028
====== Function 46 - reserve/free a group of input/output ports. =====
2004
====== Function 46 - reserve/free a group of input/output ports. =====
2029
======================================================================
2005
======================================================================
2030
To work with reserved ports an application can access directly by
2006
To work with reserved ports an application can access directly by
2031
commands in/out (recommended way) and can use function 43
2007
commands in/out (recommended way) and can use function 43
2032
(not recommended way).
2008
(not recommended way).
2033
Parameters:
2009
Parameters:
2034
  * eax = 46 - function number
2010
  * eax = 46 - function number
2035
  * ebx = 0 - reserve, 1 - free
2011
  * ebx = 0 - reserve, 1 - free
2036
  * ecx = start port number
2012
  * ecx = start port number
2037
  * edx = end port number (inclusive)
2013
  * edx = end port number (inclusive)
2038
Returned value:
2014
Returned value:
2039
  * eax = 0 - success
2015
  * eax = 0 - success
2040
  * eax = 1 - error
2016
  * eax = 1 - error
2041
Remarks:
2017
Remarks:
2042
  * For ports reservation: an error occurs if and only if
2018
  * For ports reservation: an error occurs if and only if
2043
    one from the following condition satisfies:
2019
    one from the following condition satisfies:
2044
    * start port is more than end port;
2020
    * start port is more than end port;
2045
    * the selected range contains incorrect port number
2021
    * the selected range contains incorrect port number
2046
      (correct are from 0 to 0xFFFF);
2022
      (correct are from 0 to 0xFFFF);
2047
    * limit for the total number of reserved areas is exceeded
2023
    * limit for the total number of reserved areas is exceeded
2048
      (maximum 255 are allowed);
2024
      (maximum 255 are allowed);
2049
    * the selected range intersects with any of earlier reserved
2025
    * the selected range intersects with any of earlier reserved
2050
  * For ports free: an error is an attempt to free range,
2026
  * For ports free: an error is an attempt to free range,
2051
    that was not earlier reserved by this function
2027
    that was not earlier reserved by this function
2052
    (with same ecx,edx).
2028
    (with same ecx,edx).
2053
  * If an error occurs (for both cases) function performs no action.
2029
  * If an error occurs (for both cases) function performs no action.
2054
  * At booting the system reserves for itself ports 0..0xff, and if
2030
  * At booting the system reserves for itself ports
2055
    COM-mouse is detected - additionally range of COM-ports
-
 
2056
    0x3f0..0x3ff and/or 0x2f0..0x2ff.
2031
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2057
  * When a thread terminates, all reserved by it ports
2032
  * When a thread terminates, all reserved by it ports
2058
    are freed automatically.
2033
    are freed automatically.
2059
 
2034
 
2060
======================================================================
2035
======================================================================
2061
============= Function 47 - draw a number in the window. =============
2036
============= Function 47 - draw a number in the window. =============
2062
======================================================================
2037
======================================================================
2063
Parameters:
2038
Parameters:
2064
  * eax = 47 - function number
2039
  * eax = 47 - function number
2065
  * ebx = parameters of conversion number to text:
2040
  * ebx = parameters of conversion number to text:
2066
    * bl = 0 - ecx contains number
2041
    * bl = 0 - ecx contains number
2067
    * bl = 1 - ecx contains pointer to dword-number
2042
    * bl = 1 - ecx contains pointer to dword-number
2068
    * bh = 0 - display in decimal number system
2043
    * bh = 0 - display in decimal number system
2069
    * bh = 1 - display in hexadecimal system
2044
    * bh = 1 - display in hexadecimal system
2070
    * bh = 2 - display in binary system
2045
    * bh = 2 - display in binary system
2071
    * áèòû 16-21 = how many digits to display
2046
    * áèòû 16-21 = how many digits to display
2072
    * áèòû 22-31 reserved and must be set to 0
2047
    * áèòû 22-31 reserved and must be set to 0
2073
  * ecx = number (if bl=0) or pointer (if bl=1)
2048
  * ecx = number (if bl=0) or pointer (if bl=1)
2074
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2049
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2075
  * esi = 0xX0RRGGBB:
2050
  * esi = 0xX0RRGGBB:
2076
    * RR, GG, BB specify the color
2051
    * RR, GG, BB specify the color
2077
    * X = ABnn (bits)
2052
    * X = ABnn (bits)
2078
    * nn = font (0/1)
2053
    * nn = font (0/1)
2079
    * A is ignored
2054
    * A is ignored
2080
    * B=1 - fill background with the color edi
2055
    * B=1 - fill background with the color edi
2081
Returned value:
2056
Returned value:
2082
  * function does not return value
2057
  * function does not return value
2083
Remarks:
2058
Remarks:
2084
  * The given length must not exceed 60.
2059
  * The given length must not exceed 60.
2085
  * The exactly given amount of digits is output. If number is small
2060
  * The exactly given amount of digits is output. If number is small
2086
    and can be written by smaller amount of digits, it is supplemented
2061
    and can be written by smaller amount of digits, it is supplemented
2087
    by leading zeroes; if the number is big and can not be written by
2062
    by leading zeroes; if the number is big and can not be written by
2088
    given amount of digits, extra digits are not drawn.
2063
    given amount of digits, extra digits are not drawn.
2089
  * Parameters of fonts are shown in the description of function 4
2064
  * Parameters of fonts are shown in the description of function 4
2090
    (text output).
2065
    (text output).
2091
 
2066
 
2092
======================================================================
2067
======================================================================
2093
========= Function 48, subfunction 0 - apply screen settings. ========
2068
========= Function 48, subfunction 0 - apply screen settings. ========
2094
======================================================================
2069
======================================================================
2095
Parameters:
2070
Parameters:
2096
  * eax = 48 - function number
2071
  * eax = 48 - function number
2097
  * ebx = 0 - subfunction number
2072
  * ebx = 0 - subfunction number
2098
  * ecx = 0 - reserved
2073
  * ecx = 0 - reserved
2099
Returned value:
2074
Returned value:
2100
  * function does not return value
2075
  * function does not return value
2101
Remarks:
2076
Remarks:
2102
  * Function redraws the screen after parameters change by
2077
  * Function redraws the screen after parameters change by
2103
    subfunctions 1 and 2.
2078
    subfunctions 1 and 2.
2104
  * Function call without prior call to one of indicated subfunctions
2079
  * Function call without prior call to one of indicated subfunctions
2105
    is ignored.
2080
    is ignored.
2106
  * Function call with nonzero ecx is ignored.
2081
  * Function call with nonzero ecx is ignored.
2107
 
2082
 
2108
======================================================================
2083
======================================================================
2109
=========== Function 48, subfunction 1 - set button style. ===========
2084
=========== Function 48, subfunction 1 - set button style. ===========
2110
======================================================================
2085
======================================================================
2111
Parameters:
2086
Parameters:
2112
  * eax = 48 - function number
2087
  * eax = 48 - function number
2113
  * ebx = 1 - subfunction number
2088
  * ebx = 1 - subfunction number
2114
  * ecx = button style:
2089
  * ecx = button style:
2115
    * 0 = flat
2090
    * 0 = flat
2116
    * 1 = 3d
2091
    * 1 = 3d
2117
Returned value:
2092
Returned value:
2118
  * function does not return value
2093
  * function does not return value
2119
Remarks:
2094
Remarks:
2120
  * After call to this function one should redraw the screen by
2095
  * After call to this function one should redraw the screen by
2121
    subfunction 0.
2096
    subfunction 0.
2122
  * Button style influences only to their draw of function 8.
2097
  * Button style influences only to their draw of function 8.
2123
 
2098
 
2124
======================================================================
2099
======================================================================
2125
====== Function 48, subfunction 2 - set standard window colors. ======
2100
====== Function 48, subfunction 2 - set standard window colors. ======
2126
======================================================================
2101
======================================================================
2127
Parameters:
2102
Parameters:
2128
  * eax = 48 - function number
2103
  * eax = 48 - function number
2129
  * ebx = 2 - subfunction number
2104
  * ebx = 2 - subfunction number
2130
  * ecx = pointer to the color table
2105
  * ecx = pointer to the color table
2131
  * edx = size of the color table
2106
  * edx = size of the color table
2132
    (must be 40 bytes for future compatibility)
2107
    (must be 40 bytes for future compatibility)
2133
Format of the color table is shown in description of subfunction 3.
2108
Format of the color table is shown in description of subfunction 3.
2134
Returned value:
2109
Returned value:
2135
  * function does not return value
2110
  * function does not return value
2136
Remarks:
2111
Remarks:
2137
  * After call to this function one should redraw the screen by
2112
  * After call to this function one should redraw the screen by
2138
    subfunction 0.
2113
    subfunction 0.
2139
  * Table of standard colors influences only to applications,
2114
  * Table of standard colors influences only to applications,
2140
    which receive this table obviously (by subfunction 3)
2115
    which receive this table obviously (by subfunction 3)
2141
    and use it (specifying colors from it to drawing functions).
2116
    and use it (specifying colors from it to drawing functions).
2142
  * Table of standard colors is included in skin and is installed
2117
  * Table of standard colors is included in skin and is installed
2143
    anew with skin installation (by subfunction 8).
2118
    anew with skin installation (by subfunction 8).
2144
  * Color table can be viewed/changed interactively with
2119
  * Color table can be viewed/changed interactively with
2145
    the application 'desktop'.
2120
    the application 'desktop'.
2146
 
2121
 
2147
======================================================================
2122
======================================================================
2148
====== Function 48, subfunction 3 - get standard window colors. ======
2123
====== Function 48, subfunction 3 - get standard window colors. ======
2149
======================================================================
2124
======================================================================
2150
Parameters:
2125
Parameters:
2151
  * eax = 48 - function number
2126
  * eax = 48 - function number
2152
  * ebx = 3 - subfunction number
2127
  * ebx = 3 - subfunction number
2153
  * ecx = pointer to the buffer with size edx bytes,
2128
  * ecx = pointer to the buffer with size edx bytes,
2154
    where table will be written
2129
    where table will be written
2155
  * edx = size of color table
2130
  * edx = size of color table
2156
    (must be 40 bytes for future compatibility)
2131
    (must be 40 bytes for future compatibility)
2157
Returned value:
2132
Returned value:
2158
  * function does not return value
2133
  * function does not return value
2159
Format of the color table:
2134
Format of the color table:
2160
each item is dword-value for color 0x00RRGGBB
2135
each item is dword-value for color 0x00RRGGBB
2161
  * +0: dword: frames - color of frame
2136
  * +0: dword: frames - color of frame
2162
  * +4: dword: grab - color of header
2137
  * +4: dword: grab - color of header
2163
  * +8: dword: grab_button - color of button on header bar
2138
  * +8: dword: grab_button - color of button on header bar
2164
  * +12 = +0xC: dword: grab_button_text - color of text on button
2139
  * +12 = +0xC: dword: grab_button_text - color of text on button
2165
    on header bar
2140
    on header bar
2166
  * +16 = +0x10: dword: grab_text - color of text on header
2141
  * +16 = +0x10: dword: grab_text - color of text on header
2167
  * +20 = +0x14: dword: work - color of working area
2142
  * +20 = +0x14: dword: work - color of working area
2168
  * +24 = +0x18: dword: work_button - color of button in working area
2143
  * +24 = +0x18: dword: work_button - color of button in working area
2169
  * +28 = +0x1C: dword: work_button_text - color of text on button
2144
  * +28 = +0x1C: dword: work_button_text - color of text on button
2170
    in working area
2145
    in working area
2171
  * +32 = +0x20: dword: work_text - color of text in working area
2146
  * +32 = +0x20: dword: work_text - color of text in working area
2172
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2147
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2173
Remarks:
2148
Remarks:
2174
  * Structure of the color table is described in the standard
2149
  * Structure of the color table is described in the standard
2175
    include file 'macros.inc' as 'system_colors'; for example,
2150
    include file 'macros.inc' as 'system_colors'; for example,
2176
    it is possible to write:
2151
    it is possible to write:
2177
    	sc	system_colors		; variable declaration
2152
    	sc	system_colors		; variable declaration
2178
    	...				; somewhere one must call
2153
    	...				; somewhere one must call
2179
    					; this function with ecx=sc
2154
    					; this function with ecx=sc
2180
    	mov	ecx, [sc.work_button_text]	; read text color on
2155
    	mov	ecx, [sc.work_button_text]	; read text color on
2181
    					; buttin in working area
2156
    					; buttin in working area
2182
  * A program itself desides to use or not to use color table.
2157
  * A program itself desides to use or not to use color table.
2183
    For usage program must simply at calls to drawing functions select
2158
    For usage program must simply at calls to drawing functions select
2184
    color taken from the table.
2159
    color taken from the table.
2185
  * At change of the table of standard colors (by subfunction 2 with
2160
  * At change of the table of standard colors (by subfunction 2 with
2186
    the subsequent application of changes by subfunction 0 or
2161
    the subsequent application of changes by subfunction 0 or
2187
    at skin set by subfunction 8) the system sends to all windows
2162
    at skin set by subfunction 8) the system sends to all windows
2188
    redraw message (the event with code 1).
2163
    redraw message (the event with code 1).
2189
  * Color table can be viewed/changed interactively with
2164
  * Color table can be viewed/changed interactively with
2190
    the application 'desktop'.
2165
    the application 'desktop'.
2191
 
2166
 
2192
======================================================================
2167
======================================================================
2193
============ Function 48, subfunction 4 - get skin height. ===========
2168
============ Function 48, subfunction 4 - get skin height. ===========
2194
======================================================================
2169
======================================================================
2195
Parameters:
2170
Parameters:
2196
  * eax = 48 - function number
2171
  * eax = 48 - function number
2197
  * ebx = 4 - subfunction number
2172
  * ebx = 4 - subfunction number
2198
Returned value:
2173
Returned value:
2199
  * eax = skin height
2174
  * eax = skin height
2200
Remarks:
2175
Remarks:
2201
  * Skin height is defined as the height of a header
2176
  * Skin height is defined as the height of a header
2202
    of skinned windows.
2177
    of skinned windows.
2203
  * See also general structure of window in the description
2178
  * See also general structure of window in the description
2204
    of function 0.
2179
    of function 0.
2205
 
2180
 
2206
======================================================================
2181
======================================================================
2207
======== Function 48, subfunction 5 - get screen working area. =======
2182
======== Function 48, subfunction 5 - get screen working area. =======
2208
======================================================================
2183
======================================================================
2209
Parameters:
2184
Parameters:
2210
  * eax = 48 - function number
2185
  * eax = 48 - function number
2211
  * ebx = 5 - subfunction number
2186
  * ebx = 5 - subfunction number
2212
Returned value:
2187
Returned value:
2213
  * eax = [left]*65536 + [right]
2188
  * eax = [left]*65536 + [right]
2214
  * ebx = [top]*65536 + [bottom]
2189
  * ebx = [top]*65536 + [bottom]
2215
Remarks:
2190
Remarks:
2216
  * The screen working area defines position and coordinates of
2191
  * The screen working area defines position and coordinates of
2217
    a maximized window.
2192
    a maximized window.
2218
  * The screen working area in view of normal work is all screen
2193
  * The screen working area in view of normal work is all screen
2219
    without system panel (the application '@panel').
2194
    without system panel (the application '@panel').
2220
  * (left,top) are coordinates of the left upper corner,
2195
  * (left,top) are coordinates of the left upper corner,
2221
    (right,bottom) are coordinates of the right lower one.
2196
    (right,bottom) are coordinates of the right lower one.
2222
    Thus the size of working area on x axis can be calculated by
2197
    Thus the size of working area on x axis can be calculated by
2223
    formula right-left+1, on y axis - by formula bottom-right+1.
2198
    formula right-left+1, on y axis - by formula bottom-right+1.
2224
  * See also function 14,
2199
  * See also function 14,
2225
    to get sizes of all screen.
2200
    to get sizes of all screen.
2226
  * There is a pair function to set working area - subfunction 6.
2201
  * There is a pair function to set working area - subfunction 6.
2227
 
2202
 
2228
======================================================================
2203
======================================================================
2229
======== Function 48, subfunction 6 - set screen working area. =======
2204
======== Function 48, subfunction 6 - set screen working area. =======
2230
======================================================================
2205
======================================================================
2231
Parameters:
2206
Parameters:
2232
  * eax = 48 - function number
2207
  * eax = 48 - function number
2233
  * ebx = 6 - subfunction number
2208
  * ebx = 6 - subfunction number
2234
  * ecx = [left]*65536 + [right]
2209
  * ecx = [left]*65536 + [right]
2235
  * edx = [top]*65536 + [bottom]
2210
  * edx = [top]*65536 + [bottom]
2236
Returned value:
2211
Returned value:
2237
  * function does not return value
2212
  * function does not return value
2238
Remarks:
2213
Remarks:
2239
  * The screen working area defines position and coordinates of
2214
  * The screen working area defines position and coordinates of
2240
    a maximized window.
2215
    a maximized window.
2241
  * This function is used only by the application '@panel',
2216
  * This function is used only by the application '@panel',
2242
    which set working area to all screen without system panel.
2217
    which set working area to all screen without system panel.
2243
  * (left,top) are coordinates of the left upper corner,
2218
  * (left,top) are coordinates of the left upper corner,
2244
    (right,bottom) are coordinates of the right lower one.
2219
    (right,bottom) are coordinates of the right lower one.
2245
    Thus the size of working area on x axis can be calculated by
2220
    Thus the size of working area on x axis can be calculated by
2246
    formula right-left+1, on y axis - by formula bottom-right+1.
2221
    formula right-left+1, on y axis - by formula bottom-right+1.
2247
  * If 'left'>='right', x-coordinate of working area is not changed.
2222
  * If 'left'>='right', x-coordinate of working area is not changed.
2248
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2223
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2249
    equal to screen width, 'right' will not be set.
2224
    equal to screen width, 'right' will not be set.
2250
    Similarly on y axis.
2225
    Similarly on y axis.
2251
  * See also function 14,
2226
  * See also function 14,
2252
    to get sizes of all screen.
2227
    to get sizes of all screen.
2253
  * There is a pair function to get working area - subfunction 5.
2228
  * There is a pair function to get working area - subfunction 5.
2254
  * This function redraws the screen automatically,
2229
  * This function redraws the screen automatically,
2255
    updating coordinates and sizes of maximized windows.
2230
    updating coordinates and sizes of maximized windows.
2256
    The system sends to all windows redraw message (the event 1).
2231
    The system sends to all windows redraw message (the event 1).
2257
 
2232
 
2258
======================================================================
2233
======================================================================
2259
=========== Function 48, subfunction 7 - get skin margins. ===========
2234
=========== Function 48, subfunction 7 - get skin margins. ===========
2260
======================================================================
2235
======================================================================
2261
Returns the area of a header of a skinned window, intended for
2236
Returns the area of a header of a skinned window, intended for
2262
a text of a header.
2237
a text of a header.
2263
Parameters:
2238
Parameters:
2264
  * eax = 48 - function number
2239
  * eax = 48 - function number
2265
  * ebx = 7 - subfunction number
2240
  * ebx = 7 - subfunction number
2266
Returned value:
2241
Returned value:
2267
  * eax = [left]*65536 + [right]
2242
  * eax = [left]*65536 + [right]
2268
  * ebx = [top]*65536 + [bottom]
2243
  * ebx = [top]*65536 + [bottom]
2269
Remarks:
2244
Remarks:
2270
  * An application decides itself to use or not to use this function.
2245
  * An application decides itself to use or not to use this function.
2271
  * It is recommended to take into account returned value
2246
  * It is recommended to take into account returned value
2272
    of this function for choice of a place for drawing header text
2247
    of this function for choice of a place for drawing header text
2273
    (by function 4) or a substitute of header text
2248
    (by function 4) or a substitute of header text
2274
    (at the discretion of an application).
2249
    (at the discretion of an application).
2275
 
2250
 
2276
======================================================================
2251
======================================================================
2277
============= Function 48, subfunction 8 - set used skin. ============
2252
============= Function 48, subfunction 8 - set used skin. ============
2278
======================================================================
2253
======================================================================
2279
Parameters:
2254
Parameters:
2280
  * eax = 48 - function number
2255
  * eax = 48 - function number
2281
  * ebx = 8 - subfunction number
2256
  * ebx = 8 - subfunction number
2282
  * ecx = pointer to a block for function 58, in
2257
  * ecx = pointer to a block for function 58, in
2283
    which the fields of intermediate buffer and file name are filled
2258
    which the fields of intermediate buffer and file name are filled
2284
Returned value:
2259
Returned value:
2285
  * eax = 0 - success
2260
  * eax = 0 - success
2286
  * otherwise eax = file system error code; if file does not
2261
  * otherwise eax = file system error code; if file does not
2287
    contain valid skin, function returns error 3
2262
    contain valid skin, function returns error 3
2288
    (unknown file system).
2263
    (unknown file system).
2289
Remarks:
2264
Remarks:
2290
  * After successful skin loading the system sends to all windows
2265
  * After successful skin loading the system sends to all windows
2291
    redraw message (the event 1).
2266
    redraw message (the event 1).
2292
  * At booting the system reads skin from file 'default.skn'
2267
  * At booting the system reads skin from file 'default.skn'
2293
    on ramdisk.
2268
    on ramdisk.
2294
  * User can change the skin statically by creating hisself
2269
  * User can change the skin statically by creating hisself
2295
    'default.skn' or dynamically with the application 'desktop'.
2270
    'default.skn' or dynamically with the application 'desktop'.
2296
 
2271
 
2297
======================================================================
2272
======================================================================
2298
=========== Function 49 - Advanced Power Management (APM). ===========
2273
=========== Function 49 - Advanced Power Management (APM). ===========
2299
======================================================================
2274
======================================================================
2300
Parameters:
2275
Parameters:
2301
  * eax = 49 - function number
2276
  * eax = 49 - function number
2302
  * dx = number of the APM function
2277
  * dx = number of the APM function
2303
    (analogue of ax in APM specification)
2278
    (analogue of ax in APM specification)
2304
  * bx, cx = parameters of the APM function
2279
  * bx, cx = parameters of the APM function
2305
Returned value:
2280
Returned value:
2306
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2281
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2307
    are set according to the APM specification
2282
    are set according to the APM specification
2308
  * high halves of 32-bit registers eax, ebx, ecx,
2283
  * high halves of 32-bit registers eax, ebx, ecx,
2309
    edx, esi, edi are destroyed
2284
    edx, esi, edi are destroyed
2310
Remarks:
2285
Remarks:
2311
  * APM 1.2 specification is described in the document
2286
  * APM 1.2 specification is described in the document
2312
    "Advanced Power Management (APM) BIOS Specification"
2287
    "Advanced Power Management (APM) BIOS Specification"
2313
    (Revision 1.2), available at
2288
    (Revision 1.2), available at
2314
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2289
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2315
    besides it is included in famous Interrupt List by Ralf Brown
2290
    besides it is included in famous Interrupt List by Ralf Brown
2316
    (http://www.pobox.com/~ralf/files.html,
2291
    (http://www.pobox.com/~ralf/files.html,
2317
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2292
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2318
 
2293
 
2319
======================================================================
2294
======================================================================
2320
=================== Function 50 - set window shape. ==================
2295
=================== Function 50 - set window shape. ==================
2321
======================================================================
2296
======================================================================
2322
Normal windows have rectangular shape. This function can give to
2297
Normal windows have rectangular shape. This function can give to
2323
a window any shape. The shape is given by a set of points inside
2298
a window any shape. The shape is given by a set of points inside
2324
the base rectangle belonging to a window. Position and coordinates
2299
the base rectangle belonging to a window. Position and coordinates
2325
of the base rectangle are set by function 0
2300
of the base rectangle are set by function 0
2326
and changed by function 67.
2301
and changed by function 67.
2327
 
2302
 
2328
--------------------------- Set shape data ---------------------------
2303
--------------------------- Set shape data ---------------------------
2329
Parameters:
2304
Parameters:
2330
  * eax = 50 - function number
2305
  * eax = 50 - function number
2331
  * ebx = 0 - subfunction number
2306
  * ebx = 0 - subfunction number
2332
  * ecx = pointer to shape data (array of bytes 0/1)
2307
  * ecx = pointer to shape data (array of bytes 0/1)
2333
Returned value:
2308
Returned value:
2334
  * function does not return value
2309
  * function does not return value
2335
 
2310
 
2336
-------------------------- Set shape scale ---------------------------
2311
-------------------------- Set shape scale ---------------------------
2337
Parameters:
2312
Parameters:
2338
  * eax = 50 - function number
2313
  * eax = 50 - function number
2339
  * ebx = 1 - subfunction number
2314
  * ebx = 1 - subfunction number
2340
  * ecx sets a scale: each byte of data defines
2315
  * ecx sets a scale: each byte of data defines
2341
    (2^scale)*(2^scale) pixels
2316
    (2^scale)*(2^scale) pixels
2342
Returned value:
2317
Returned value:
2343
  * function does not return value
2318
  * function does not return value
2344
Remarks:
2319
Remarks:
2345
  * Default scale is 0 (scale factor is 1). If in the shape data
2320
  * Default scale is 0 (scale factor is 1). If in the shape data
2346
    one byte corresponds to one pixel, there is no necessity
2321
    one byte corresponds to one pixel, there is no necessity
2347
    to set scale.
2322
    to set scale.
2348
  * Let's designate xsize = window width (in pixels), ysize = height;
2323
  * Let's designate xsize = window width (in pixels), ysize = height;
2349
    pay attention, that they are one pixel more than defined by
2324
    pay attention, that they are one pixel more than defined by
2350
    functions 0, 67.
2325
    functions 0, 67.
2351
  * On definition of scale xsize and ysize must be divisible
2326
  * On definition of scale xsize and ysize must be divisible
2352
    on 2^scale.
2327
    on 2^scale.
2353
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2328
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2354
    to a window of square with the side 2^scale (if scale=0,
2329
    to a window of square with the side 2^scale (if scale=0,
2355
    this is one pixel) and coordinates of the left upper corner
2330
    this is one pixel) and coordinates of the left upper corner
2356
    (a mod (xsize shr scale), a div (xsize shr scale))
2331
    (a mod (xsize shr scale), a div (xsize shr scale))
2357
  * Data size: (xsize shr scale)*(ysize shr scale).
2332
  * Data size: (xsize shr scale)*(ysize shr scale).
2358
  * Data must be presented in the memory and not change
2333
  * Data must be presented in the memory and not change
2359
    after set of shape.
2334
    after set of shape.
2360
  * The system views the shape data at every window redraw by
2335
  * The system views the shape data at every window redraw by
2361
    function 0.
2336
    function 0.
2362
  * The call of subfunction 0 with NULL pointer results in return
2337
  * The call of subfunction 0 with NULL pointer results in return
2363
    to the rectangular shape.
2338
    to the rectangular shape.
2364
 
2339
 
2365
======================================================================
2340
======================================================================
2366
==================== Function 51 - create thread. ====================
2341
==================== Function 51 - create thread. ====================
2367
======================================================================
2342
======================================================================
2368
Parameters:
2343
Parameters:
2369
  * eax = 51 - function number
2344
  * eax = 51 - function number
2370
  * ebx = 1 - unique subfunction
2345
  * ebx = 1 - unique subfunction
2371
  * ecx = address of thread entry point (starting eip)
2346
  * ecx = address of thread entry point (starting eip)
2372
  * edx = pointer to thread stack (starting esp)
2347
  * edx = pointer to thread stack (starting esp)
2373
Returned value:
2348
Returned value:
2374
  * eax = -1 - error (there is too many threads)
2349
  * eax = -1 - error (there is too many threads)
2375
  * otherwise eax = TID - thread identifier
2350
  * otherwise eax = TID - thread identifier
2376
         
2351
         
2377
 
2352
 
2378
======================================================================
2353
======================================================================
2379
=== Function 52, subfunction 0 - get network driver configuration. ===
2354
=== Function 52, subfunction 0 - get network driver configuration. ===
2380
======================================================================
2355
======================================================================
2381
Parameters:
2356
Parameters:
2382
  * eax = 52 - function number
2357
  * eax = 52 - function number
2383
  * ebx = 0 - subfunction number
2358
  * ebx = 0 - subfunction number
2384
Returned value:
2359
Returned value:
2385
  * eax = configuration dword
2360
  * eax = configuration dword
2386
Remarks:
2361
Remarks:
2387
  * Configuration dword can be set by subfunction 2.
2362
  * Configuration dword can be set by subfunction 2.
2388
  * The kernel does not use this variable. The value of this
2363
  * The kernel does not use this variable. The value of this
2389
    variable and working with it subfunctions 0 and 2 is represented
2364
    variable and working with it subfunctions 0 and 2 is represented
2390
    doubtful.
2365
    doubtful.
2391
 
2366
 
2392
======================================================================
2367
======================================================================
2393
========= Function 52, subfunction 1 - get local IP-address. =========
2368
========= Function 52, subfunction 1 - get local IP-address. =========
2394
======================================================================
2369
======================================================================
2395
Parameters:
2370
Parameters:
2396
  * eax = 52 - function number
2371
  * eax = 52 - function number
2397
  * ebx = 1 - subfunction number
2372
  * ebx = 1 - subfunction number
2398
Returned value:
2373
Returned value:
2399
  * eax = IP-address (4 bytes)
2374
  * eax = IP-address (4 bytes)
2400
Remarks:
2375
Remarks:
2401
  * Local IP-address is set by subfunction 3.
2376
  * Local IP-address is set by subfunction 3.
2402
 
2377
 
2403
======================================================================
2378
======================================================================
2404
=== Function 52, subfunction 2 - set network driver configuration. ===
2379
=== Function 52, subfunction 2 - set network driver configuration. ===
2405
======================================================================
2380
======================================================================
2406
Parameters:
2381
Parameters:
2407
  * eax = 52 - function number
2382
  * eax = 52 - function number
2408
  * ebx = 2 - subfunction number
2383
  * ebx = 2 - subfunction number
2409
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2384
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2410
    function [re-]initializes Ethernet-card, otherwise
2385
    function [re-]initializes Ethernet-card, otherwise
2411
    Ethernet turns off
2386
    Ethernet turns off
2412
Returned value:
2387
Returned value:
2413
  * if Ethernet-interface is not requested, function returns eax=2,
2388
  * if Ethernet-interface is not requested, function returns eax=2,
2414
    but this can be changed in future kernel versions
2389
    but this can be changed in future kernel versions
2415
  * if Ethernet-interface is requested, eax=0 means error
2390
  * if Ethernet-interface is requested, eax=0 means error
2416
    (absence of Ethernet-card), and nonzero value - success
2391
    (absence of Ethernet-card), and nonzero value - success
2417
Remarks:
2392
Remarks:
2418
  * Configuration dword can be read by subfunction 0.
2393
  * Configuration dword can be read by subfunction 0.
2419
  * The kernel does not use this variable. The value of this
2394
  * The kernel does not use this variable. The value of this
2420
    variable, subfunction 0 and part of subfunction 2, which set it,
2395
    variable, subfunction 0 and part of subfunction 2, which set it,
2421
    is represented doubtful.
2396
    is represented doubtful.
2422
 
2397
 
2423
======================================================================
2398
======================================================================
2424
========= Function 52, subfunction 3 - set local IP-address. =========
2399
========= Function 52, subfunction 3 - set local IP-address. =========
2425
======================================================================
2400
======================================================================
2426
Parameters:
2401
Parameters:
2427
  * eax = 52 - function number
2402
  * eax = 52 - function number
2428
  * ebx = 3 - subfunction number
2403
  * ebx = 3 - subfunction number
2429
  * ecx = IP-address (4 bytes)
2404
  * ecx = IP-address (4 bytes)
2430
Returned value:
2405
Returned value:
2431
  * the current implementation returns eax=3, but this can be changed
2406
  * the current implementation returns eax=3, but this can be changed
2432
    in future versions
2407
    in future versions
2433
Remarks:
2408
Remarks:
2434
  * Local IP-address can be get by subfunction 1.
2409
  * Local IP-address can be get by subfunction 1.
2435
 
2410
 
2436
======================================================================
2411
======================================================================
2437
= Function 52, subfunction 6 - add data to the stack of input queue. =
2412
= Function 52, subfunction 6 - add data to the stack of input queue. =
2438
======================================================================
2413
======================================================================
2439
Parameters:
2414
Parameters:
2440
  * eax = 52 - function number
2415
  * eax = 52 - function number
2441
  * ebx = 6 - subfunction number
2416
  * ebx = 6 - subfunction number
2442
  * edx = data size
2417
  * edx = data size
2443
  * esi = data pointer
2418
  * esi = data pointer
2444
Returned value:
2419
Returned value:
2445
  * eax = -1 - error
2420
  * eax = -1 - error
2446
  * eax = 0 - success
2421
  * eax = 0 - success
2447
Remarks:
2422
Remarks:
2448
  * This function is intended only for slow network drivers
2423
  * This function is intended only for slow network drivers
2449
    (PPP, SLIP).
2424
    (PPP, SLIP).
2450
  * Data size must not exceed 1500 bytes, though function
2425
  * Data size must not exceed 1500 bytes, though function
2451
    performs no checks on correctness.
2426
    performs no checks on correctness.
2452
 
2427
 
2453
======================================================================
2428
======================================================================
2454
 Function 52, subfunction 8 - read data from the network output queue. 
2429
 Function 52, subfunction 8 - read data from the network output queue. 
2455
======================================================================
2430
======================================================================
2456
Parameters:
2431
Parameters:
2457
  * eax = 52 - function number
2432
  * eax = 52 - function number
2458
  * ebx = 8 - subfunction number
2433
  * ebx = 8 - subfunction number
2459
  * esi = pointer to 1500-byte buffer
2434
  * esi = pointer to 1500-byte buffer
2460
Returned value:
2435
Returned value:
2461
  * eax = number of read bytes (in the current implementation
2436
  * eax = number of read bytes (in the current implementation
2462
    either 0 = no data or 1500)
2437
    either 0 = no data or 1500)
2463
  * data was copied in buffer
2438
  * data was copied in buffer
2464
Remarks:
2439
Remarks:
2465
  * This function is intended only for slow network drivers
2440
  * This function is intended only for slow network drivers
2466
    (PPP, SLIP).
2441
    (PPP, SLIP).
2467
 
2442
 
2468
======================================================================
2443
======================================================================
2469
============ Function 52, subfunction 9 - get gateway IP. ============
2444
============ Function 52, subfunction 9 - get gateway IP. ============
2470
======================================================================
2445
======================================================================
2471
Parameters:
2446
Parameters:
2472
  * eax = 52 - function number
2447
  * eax = 52 - function number
2473
  * ebx = 9 - subfunction number
2448
  * ebx = 9 - subfunction number
2474
Returned value:
2449
Returned value:
2475
  * eax = gateway IP (4 bytes)
2450
  * eax = gateway IP (4 bytes)
2476
 
2451
 
2477
======================================================================
2452
======================================================================
2478
=========== Function 52, subfunction 10 - get subnet mask. ===========
2453
=========== Function 52, subfunction 10 - get subnet mask. ===========
2479
======================================================================
2454
======================================================================
2480
Parameters:
2455
Parameters:
2481
  * eax = 52 - function number
2456
  * eax = 52 - function number
2482
  * ebx = 10 - subfunction number
2457
  * ebx = 10 - subfunction number
2483
Returned value:
2458
Returned value:
2484
  * eax = subnet mask
2459
  * eax = subnet mask
2485
 
2460
 
2486
======================================================================
2461
======================================================================
2487
============ Function 52, subfunction 11 - set gateway IP. ===========
2462
============ Function 52, subfunction 11 - set gateway IP. ===========
2488
======================================================================
2463
======================================================================
2489
Parameters:
2464
Parameters:
2490
  * eax = 52 - function number
2465
  * eax = 52 - function number
2491
  * ebx = 11 - subfunction number
2466
  * ebx = 11 - subfunction number
2492
  * ecx = gateway IP (4 bytes)
2467
  * ecx = gateway IP (4 bytes)
2493
Returned value:
2468
Returned value:
2494
  * the current implementation returns eax=11, but this can be changed
2469
  * the current implementation returns eax=11, but this can be changed
2495
    in future versions
2470
    in future versions
2496
 
2471
 
2497
======================================================================
2472
======================================================================
2498
=========== Function 52, subfunction 12 - set subnet mask. ===========
2473
=========== Function 52, subfunction 12 - set subnet mask. ===========
2499
======================================================================
2474
======================================================================
2500
Parameters:
2475
Parameters:
2501
  * eax = 52 - function number
2476
  * eax = 52 - function number
2502
  * ebx = 12 - subfunction number
2477
  * ebx = 12 - subfunction number
2503
  * ecx = subnet mask
2478
  * ecx = subnet mask
2504
Returned value:
2479
Returned value:
2505
  * the current implementation returns eax=12, but this can be changed
2480
  * the current implementation returns eax=12, but this can be changed
2506
    in future versions
2481
    in future versions
2507
 
2482
 
2508
======================================================================
2483
======================================================================
2509
============== Function 52, subfunction 13 - get DNS IP. =============
2484
============== Function 52, subfunction 13 - get DNS IP. =============
2510
======================================================================
2485
======================================================================
2511
Parameters:
2486
Parameters:
2512
  * eax = 52 - function number
2487
  * eax = 52 - function number
2513
  * ebx = 13 - subfunction number
2488
  * ebx = 13 - subfunction number
2514
Returned value:
2489
Returned value:
2515
  * eax = DNS IP (4 bytes)
2490
  * eax = DNS IP (4 bytes)
2516
 
2491
 
2517
======================================================================
2492
======================================================================
2518
============== Function 52, subfunction 14 - set DNS IP. =============
2493
============== Function 52, subfunction 14 - set DNS IP. =============
2519
======================================================================
2494
======================================================================
2520
Parameters:
2495
Parameters:
2521
  * eax = 52 - function number
2496
  * eax = 52 - function number
2522
  * ebx = 14 - subfunction number
2497
  * ebx = 14 - subfunction number
2523
  * ecx = DNS IP (4 bytes)
2498
  * ecx = DNS IP (4 bytes)
2524
Returned value:
2499
Returned value:
2525
  * the current implementation returns eax=14, but this can be changed
2500
  * the current implementation returns eax=14, but this can be changed
2526
    in future versions
2501
    in future versions
2527
 
2502
 
2528
======================================================================
2503
======================================================================
-
 
2504
======== Function 52, subfunction 15 - get local MAC address. ========
-
 
2505
======================================================================
-
 
2506
Parameters:
-
 
2507
  * eax = 52 - function number
-
 
2508
  * ebx = 15 - subfunction number
-
 
2509
  * ecx = 0 - read first 4 bytes,
-
 
2510
    ecx = 4 - read last 2 bytes
-
 
2511
Returned value:
-
 
2512
  * for ecx=0: eax = first 4 bytes of MAC address
-
 
2513
  * for ecx=4: ax = last 2 bytes of MAC address,
-
 
2514
               high half of eax is destroyed
-
 
2515
  * for other ecx: eax = -1 indicates an error
-
 
2516
 
-
 
2517
======================================================================
2529
============ Function 53, subfunction 0 - open UDP-socket. ===========
2518
============ Function 53, subfunction 0 - open UDP-socket. ===========
2530
======================================================================
2519
======================================================================
2531
Parameters:
2520
Parameters:
2532
  * eax = 53 - function number
2521
  * eax = 53 - function number
2533
  * ebx = 0 - subfunction number
2522
  * ebx = 0 - subfunction number
2534
  * ecx = local port (only low word is taken into account)
2523
  * ecx = local port (only low word is taken into account)
2535
  * edx = remote port (only low word is taken into account)
2524
  * edx = remote port (only low word is taken into account)
2536
  * esi = remote IP
2525
  * esi = remote IP
2537
Returned value:
2526
Returned value:
2538
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2527
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2539
  * eax = socket handle (some number which unambiguously identifies
2528
  * eax = socket handle (some number which unambiguously identifies
2540
    socket and have sense only for the system) - success;
2529
    socket and have sense only for the system) - success;
2541
    ebx destroyed
2530
    ebx destroyed
2542
 
2531
 
2543
======================================================================
2532
======================================================================
2544
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2533
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2545
======================================================================
2534
======================================================================
2546
Parameters:
2535
Parameters:
2547
  * eax = 53 - function number
2536
  * eax = 53 - function number
2548
  * ebx = 1 - subfunction number
2537
  * ebx = 1 - subfunction number
2549
  * ecx = socket handle
2538
  * ecx = socket handle
2550
Returned value:
2539
Returned value:
2551
  * eax = -1 - incorrect handle
2540
  * eax = -1 - incorrect handle
2552
  * eax = 0 - success
2541
  * eax = 0 - success
2553
  * ebx destroyed
2542
  * ebx destroyed
2554
Remarks:
2543
Remarks:
2555
  * The current implementation does not close automatically all
2544
  * The current implementation does not close automatically all
2556
    sockets of a thread at termination. In particular, one should not
2545
    sockets of a thread at termination. In particular, one should not
2557
    kill a thread with many opened sockets - there will be an outflow
2546
    kill a thread with many opened sockets - there will be an outflow
2558
    of resources.
2547
    of resources.
2559
  * The current implementation does no checks on correctness
2548
  * The current implementation does no checks on correctness
2560
    (function returns error only if thread tries to close not opened
2549
    (function returns error only if thread tries to close not opened
2561
    socket with correct handle).
2550
    socket with correct handle).
2562
 
2551
 
2563
======================================================================
2552
======================================================================
2564
============== Function 53, subfunction 2 - poll socket. =============
2553
============== Function 53, subfunction 2 - poll socket. =============
2565
======================================================================
2554
======================================================================
2566
Parameters:
2555
Parameters:
2567
  * eax = 53 - function number
2556
  * eax = 53 - function number
2568
  * ebx = 2 - subfunction number
2557
  * ebx = 2 - subfunction number
2569
  * ecx = socket handle
2558
  * ecx = socket handle
2570
Returned value:
2559
Returned value:
2571
  * eax = number of read bytes
2560
  * eax = number of read bytes
2572
  * ebx destroyed
2561
  * ebx destroyed
2573
Remarks:
2562
Remarks:
2574
  * There is no checks for correctness.
2563
  * There is no checks for correctness.
2575
 
2564
 
2576
======================================================================
2565
======================================================================
2577
========= Function 53, subfunction 3 - read byte from socket. ========
2566
========= Function 53, subfunction 3 - read byte from socket. ========
2578
======================================================================
2567
======================================================================
2579
Parameters:
2568
Parameters:
2580
  * eax = 53 - function number
2569
  * eax = 53 - function number
2581
  * ebx = 3 - subfunction number
2570
  * ebx = 3 - subfunction number
2582
  * ecx = socket handle
2571
  * ecx = socket handle
2583
Returned value:
2572
Returned value:
2584
  * if there is no read data: eax=0, bl=0,
2573
  * if there is no read data: eax=0, bl=0,
2585
    other bytes of ebx are destroyed
2574
    other bytes of ebx are destroyed
2586
  * if there are read data: eax=number of rest bytes
2575
  * if there are read data: eax=number of rest bytes
2587
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2576
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2588
Remarks:
2577
Remarks:
2589
  * There is no checks for correctness.
2578
  * There is no checks for correctness.
2590
 
2579
 
2591
======================================================================
2580
======================================================================
2592
========== Function 53, subfunction 4 - write to UDP-socket. =========
2581
========== Function 53, subfunction 4 - write to UDP-socket. =========
2593
======================================================================
2582
======================================================================
2594
Parameters:
2583
Parameters:
2595
  * eax = 53 - function number
2584
  * eax = 53 - function number
2596
  * ebx = 4 - subfunction number
2585
  * ebx = 4 - subfunction number
2597
  * ecx = socket handle
2586
  * ecx = socket handle
2598
  * edx = number of bytes to write
2587
  * edx = number of bytes to write
2599
  * esi = pointer to data to write
2588
  * esi = pointer to data to write
2600
Returned value:
2589
Returned value:
2601
  * eax = 0xffffffff - invalid handle
2590
  * eax = 0xffffffff - invalid handle
2602
  * eax = 0xffff - not enough memory
2591
  * eax = 0xffff - not enough memory
2603
  * eax = 0 - success
2592
  * eax = 0 - success
2604
  * ebx destroyed
2593
  * ebx destroyed
2605
Remarks:
2594
Remarks:
2606
  * Check on validity of handle is minimal - only not very incorrect
2595
  * Check on validity of handle is minimal - only not very incorrect
2607
    not opened handles are eliminated.
2596
    not opened handles are eliminated.
2608
  * Number of bytes to write must not exceed 1500-28, though
2597
  * Number of bytes to write must not exceed 1500-28, though
2609
    the appropriate check is not made.
2598
    the appropriate check is not made.
2610
 
2599
 
2611
======================================================================
2600
======================================================================
2612
============ Function 53, subfunction 5 - open TCP-socket. ===========
2601
============ Function 53, subfunction 5 - open TCP-socket. ===========
2613
======================================================================
2602
======================================================================
2614
Parameters:
2603
Parameters:
2615
  * eax = 53 - function number
2604
  * eax = 53 - function number
2616
  * ebx = 5 - subfunction number
2605
  * ebx = 5 - subfunction number
2617
  * ecx = local port (only low word is taken into account)
2606
  * ecx = local port (only low word is taken into account)
2618
  * edx = remote port (only low word is taken into account)
2607
  * edx = remote port (only low word is taken into account)
2619
  * esi = remote IP
2608
  * esi = remote IP
2620
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2609
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2621
Returned value:
2610
Returned value:
2622
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2611
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2623
  * eax = socket handle (some number which unambiguously identifies
2612
  * eax = socket handle (some number which unambiguously identifies
2624
    socket and have sense only for the system) - success;
2613
    socket and have sense only for the system) - success;
2625
    ebx destroyed
2614
    ebx destroyed
2626
 
2615
 
2627
======================================================================
2616
======================================================================
2628
========= Function 53, subfunction 6 - get TCP-socket status. ========
2617
========= Function 53, subfunction 6 - get TCP-socket status. ========
2629
======================================================================
2618
======================================================================
2630
Parameters:
2619
Parameters:
2631
  * eax = 53 - function number
2620
  * eax = 53 - function number
2632
  * ebx = 6 - subfunction number
2621
  * ebx = 6 - subfunction number
2633
  * ecx = socket handle
2622
  * ecx = socket handle
2634
Returned value:
2623
Returned value:
2635
  * eax = socket status: one of
2624
  * eax = socket status: one of
2636
  * TCB_LISTEN = 1
2625
  * TCB_LISTEN = 1
2637
  * TCB_SYN_SENT = 2
2626
  * TCB_SYN_SENT = 2
2638
  * TCB_SYN_RECEIVED = 3
2627
  * TCB_SYN_RECEIVED = 3
2639
  * TCB_ESTABLISHED = 4
2628
  * TCB_ESTABLISHED = 4
2640
  * TCB_FIN_WAIT_1 = 5
2629
  * TCB_FIN_WAIT_1 = 5
2641
  * TCB_FIN_WAIT_2 = 6
2630
  * TCB_FIN_WAIT_2 = 6
2642
  * TCB_CLOSE_WAIT = 7
2631
  * TCB_CLOSE_WAIT = 7
2643
  * TCB_CLOSING = 8
2632
  * TCB_CLOSING = 8
2644
  * TCB_LAST_ASK = 9
2633
  * TCB_LAST_ASK = 9
2645
  * TCB_TIME_WAIT = 10
2634
  * TCB_TIME_WAIT = 10
2646
  * TCB_CLOSED = 11
2635
  * TCB_CLOSED = 11
2647
  * ebx destroys
2636
  * ebx destroys
2648
Remarks:
2637
Remarks:
2649
  * There is no checks for correctness.
2638
  * There is no checks for correctness.
2650
 
2639
 
2651
======================================================================
2640
======================================================================
2652
========== Function 53, subfunction 7 - write to TCP-socket. =========
2641
========== Function 53, subfunction 7 - write to TCP-socket. =========
2653
======================================================================
2642
======================================================================
2654
Parameters:
2643
Parameters:
2655
  * eax = 53 - function number
2644
  * eax = 53 - function number
2656
  * ebx = 7 - subfunction number
2645
  * ebx = 7 - subfunction number
2657
  * ecx = socket handle
2646
  * ecx = socket handle
2658
  * edx = number of bytes to write
2647
  * edx = number of bytes to write
2659
  * esi = pointer to data to write
2648
  * esi = pointer to data to write
2660
Returned value:
2649
Returned value:
2661
  * eax = 0xffffffff - error
2650
  * eax = 0xffffffff - error
2662
  * eax = 0xffff - not enough memory
2651
  * eax = 0xffff - not enough memory
2663
  * eax = 0 - success
2652
  * eax = 0 - success
2664
  * ebx destroyed
2653
  * ebx destroyed
2665
Remarks:
2654
Remarks:
2666
  * Check on validity of handle is minimal - only not very incorrect
2655
  * Check on validity of handle is minimal - only not very incorrect
2667
    not opened handles are eliminated.
2656
    not opened handles are eliminated.
2668
  * Number of bytes to write must not exceed 1500-40, though
2657
  * Number of bytes to write must not exceed 1500-40, though
2669
    the appropriate check is not made.
2658
    the appropriate check is not made.
2670
 
2659
 
2671
======================================================================
2660
======================================================================
2672
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2661
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2673
======================================================================
2662
======================================================================
2674
Parameters:
2663
Parameters:
2675
  * eax = 53 - function number
2664
  * eax = 53 - function number
2676
  * ebx = 8 - subfunction number
2665
  * ebx = 8 - subfunction number
2677
  * ecx = socket handle
2666
  * ecx = socket handle
2678
Returned value:
2667
Returned value:
2679
  * eax = -1 - invalid handle
2668
  * eax = -1 - invalid handle
2680
  * eax = 0xffff - not enough memory for socket close packet
2669
  * eax = 0xffff - not enough memory for socket close packet
2681
  * eax = 0 - success
2670
  * eax = 0 - success
2682
  * in many cases eax is destroyed (the result of function 'queue'
2671
  * in many cases eax is destroyed (the result of function 'queue'
2683
    is returned) - probably this is bug, which will be corrected
2672
    is returned) - probably this is bug, which will be corrected
2684
  * ebx destroyed
2673
  * ebx destroyed
2685
Remarks:
2674
Remarks:
2686
  * The current implementation does not close automatically all
2675
  * The current implementation does not close automatically all
2687
    sockets of a thread at termination. In particular, one should not
2676
    sockets of a thread at termination. In particular, one should not
2688
    kill a thread with many opened sockets - there will be an outflow
2677
    kill a thread with many opened sockets - there will be an outflow
2689
    of resources.
2678
    of resources.
2690
  * The current implementation does no checks on correctness
2679
  * The current implementation does no checks on correctness
2691
    (function returns error only if thread tries to close not opened
2680
    (function returns error only if thread tries to close not opened
2692
    socket with correct handle).
2681
    socket with correct handle).
2693
 
2682
 
2694
======================================================================
2683
======================================================================
2695
=== Function 53, subfunction 9 - check whether local port is free. ===
2684
=== Function 53, subfunction 9 - check whether local port is free. ===
2696
======================================================================
2685
======================================================================
2697
Parameters:
2686
Parameters:
2698
  * eax = 53 - function number
2687
  * eax = 53 - function number
2699
  * ebx = 9 - subfunction number
2688
  * ebx = 9 - subfunction number
2700
  * ecx = local port number (low 16 bits are used only)
2689
  * ecx = local port number (low 16 bits are used only)
2701
Returned value:
2690
Returned value:
2702
  * eax = 0 - port is used
2691
  * eax = 0 - port is used
2703
  * eax = 1 - port is free
2692
  * eax = 1 - port is free
2704
  * ebx destroyed
2693
  * ebx destroyed
2705
 
2694
 
2706
======================================================================
2695
======================================================================
2707
= Function 53, subfunction 255 - debug information of network driver. 
2696
= Function 53, subfunction 255 - debug information of network driver. 
2708
======================================================================
2697
======================================================================
2709
Parameters:
2698
Parameters:
2710
  * eax = 53 - function number
2699
  * eax = 53 - function number
2711
  * ebx = 255 - subfunction number
2700
  * ebx = 255 - subfunction number
2712
  * ecx = type of requested information (see below)
2701
  * ecx = type of requested information (see below)
2713
Returned value:
2702
Returned value:
2714
  * eax = requested information
2703
  * eax = requested information
2715
  * ebx destroyed
2704
  * ebx destroyed
2716
Possible values for ecx:
2705
Possible values for ecx:
2717
  * 100: length of queue 0 (empty queue)
2706
  * 100: length of queue 0 (empty queue)
2718
  * 101: length of queue 1 (ip-out queue)
2707
  * 101: length of queue 1 (ip-out queue)
2719
  * 102: length of queue 2 (ip-in queue)
2708
  * 102: length of queue 2 (ip-in queue)
2720
  * 103: length of queue 3 (net1out queue)
2709
  * 103: length of queue 3 (net1out queue)
2721
  * 200: number of items in the ARP table
2710
  * 200: number of items in the ARP table
2722
  * 201: size of the ARP table (in items) (20 for current version)
2711
  * 201: size of the ARP table (in items) (20 for current version)
2723
  * 202: read item at edx of the ARP table to the temporary buffer,
2712
  * 202: read item at edx of the ARP table to the temporary buffer,
2724
    whence 5 following types take information;
2713
    whence 5 following types take information;
2725
    in this case eax is not defined
2714
    in this case eax is not defined
2726
  * 203: IP-address saved by type 202
2715
  * 203: IP-address saved by type 202
2727
  * 204: high dword of MAC-address saved by type 202
2716
  * 204: high dword of MAC-address saved by type 202
2728
  * 205: low word of MAC-address saved by type 202
2717
  * 205: low word of MAC-address saved by type 202
2729
  * 206: status word saved by type 202
2718
  * 206: status word saved by type 202
2730
  * 207: ttl word saved by type 202
2719
  * 207: ttl word saved by type 202
2731
  * 2: total number of received IP-packets
2720
  * 2: total number of received IP-packets
2732
  * 3: total number of transferred IP-packets
2721
  * 3: total number of transferred IP-packets
2733
  * 4: total number of dumped received packets
2722
  * 4: total number of dumped received packets
2734
  * 5: total number of received ARP-packets
2723
  * 5: total number of received ARP-packets
2735
  * 6: status of packet driver, 0=inactive, nonzero=active
2724
  * 6: status of packet driver, 0=inactive, nonzero=active
2736
 
2725
 
2737
======================================================================
2726
======================================================================
2738
========== Function 55, subfunction 0 - load data for SB16. ==========
2727
========== Function 55, subfunction 0 - load data for SB16. ==========
2739
======================================================================
2728
======================================================================
2740
Parameters:
2729
Parameters:
2741
  * eax = 55 - function number
2730
  * eax = 55 - function number
2742
  * ebx = 0 - subfunction number
2731
  * ebx = 0 - subfunction number
2743
  * ecx = pointer to data (is copied 64 kilobytes, is used as much as
2732
  * ecx = pointer to data (is copied 64 kilobytes, is used as much as
2744
    set by subfunction 2)
2733
    set by subfunction 2)
2745
Returned value:
2734
Returned value:
2746
  * function does not return value
2735
  * function does not return value
2747
Remarks:
2736
Remarks:
2748
  * Format and size of data are set by subfunction 2.
2737
  * Format and size of data are set by subfunction 2.
2749
 
2738
 
2750
======================================================================
2739
======================================================================
2751
======== Function 55, subfunction 1 - begin play data on SB16. =======
2740
======== Function 55, subfunction 1 - begin play data on SB16. =======
2752
======================================================================
2741
======================================================================
2753
Parameters:
2742
Parameters:
2754
  * eax = 55 - function number
2743
  * eax = 55 - function number
2755
  * ebx = 1 - subfunction number
2744
  * ebx = 1 - subfunction number
2756
Returned value:
2745
Returned value:
2757
  * function does not return value
2746
  * function does not return value
2758
Remarks:
2747
Remarks:
2759
  * Previously data must be loaded by subfunction 0 and
2748
  * Previously data must be loaded by subfunction 0 and
2760
    their format must be defined by subfunction 2.
2749
    their format must be defined by subfunction 2.
2761
  * Function returns control, when playing of data began; after that
2750
  * Function returns control, when playing of data began; after that
2762
    play goes independently from application (and does not use
2751
    play goes independently from application (and does not use
2763
    processor time at all).
2752
    processor time at all).
2764
  * Previously must be defined SB16 base port
2753
  * Previously must be defined SB16 base port
2765
    (by subfunction 4 of function 21) and DMA channel
2754
    (by subfunction 4 of function 21) and DMA channel
2766
    (by subfunction 10 of function 21).
2755
    (by subfunction 10 of function 21).
2767
 
2756
 
2768
======================================================================
2757
======================================================================
2769
======== Function 55, subfunction 2 - set format of SB16 data. =======
2758
======== Function 55, subfunction 2 - set format of SB16 data. =======
2770
======================================================================
2759
======================================================================
2771
Parameters:
2760
Parameters:
2772
  * eax = 55 - function number
2761
  * eax = 55 - function number
2773
  * ebx = 2 - subfunction number
2762
  * ebx = 2 - subfunction number
2774
  * ecx = 0 - set digit capacity
2763
  * ecx = 0 - set digit capacity
2775
    * edx = 1 - 8bit mono
2764
    * edx = 1 - 8bit mono
2776
    * edx = 2 - 8bit stereo
2765
    * edx = 2 - 8bit stereo
2777
  * ecx = 1 - set data size
2766
  * ecx = 1 - set data size
2778
    * edx = size in bytes
2767
    * edx = size in bytes
2779
  * ecx = 2 - set play frequency
2768
  * ecx = 2 - set play frequency
2780
    * edx = frequency
2769
    * edx = frequency
2781
Returned value:
2770
Returned value:
2782
  * function does not return value
2771
  * function does not return value
2783
Remarks:
2772
Remarks:
2784
  * When the system boots, it sets following default parameters:
2773
  * When the system boots, it sets following default parameters:
2785
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
2774
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
2786
    Nevertheless it is recommended to set necessary values obviously
2775
    Nevertheless it is recommended to set necessary values obviously
2787
    as they could be reset by some application.
2776
    as they could be reset by some application.
2788
 
2777
 
2789
======================================================================
2778
======================================================================
2790
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2779
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2791
======================================================================
2780
======================================================================
2792
Parameters:
2781
Parameters:
2793
  * eax = 55 - function number
2782
  * eax = 55 - function number
2794
  * ebx = 55 - subfunction number
2783
  * ebx = 55 - subfunction number
2795
  * esi = pointer to data
2784
  * esi = pointer to data
2796
Returned value:
2785
Returned value:
2797
  * eax = 0 - success
2786
  * eax = 0 - success
2798
  * eax = 55 - error (speaker is off or busy)
2787
  * eax = 55 - error (speaker is off or busy)
2799
Data is an array of items with variable length.
2788
Data is an array of items with variable length.
2800
Format of each item is defined by first byte:
2789
Format of each item is defined by first byte:
2801
  * 0 = end of data
2790
  * 0 = end of data
2802
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2791
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2803
    is defined by immediate value of frequency
2792
    is defined by immediate value of frequency
2804
    * following word (2 bytes) contains frequency divider;
2793
    * following word (2 bytes) contains frequency divider;
2805
      frequency is defined as 1193180/divider
2794
      frequency is defined as 1193180/divider
2806
  * 0x81 = invalid
2795
  * 0x81 = invalid
2807
  * 0x82..0xFF = note is defined by octave and number:
2796
  * 0x82..0xFF = note is defined by octave and number:
2808
    * duration in 1/100 of second = (first byte)-0x81
2797
    * duration in 1/100 of second = (first byte)-0x81
2809
    * there is one more byte;
2798
    * there is one more byte;
2810
    * (second byte)=0xFF - delay
2799
    * (second byte)=0xFF - delay
2811
    * otherwise it looks like a*0x10+b, where b=number of the note in
2800
    * otherwise it looks like a*0x10+b, where b=number of the note in
2812
      an octave from 1 to 12, a=number of octave (beginning from 0)
2801
      an octave from 1 to 12, a=number of octave (beginning from 0)
2813
Remarks:
2802
Remarks:
2814
  * Speaker play can be disabled/enabled by
2803
  * Speaker play can be disabled/enabled by
2815
    subfunction 8 of function 18.
2804
    subfunction 8 of function 18.
2816
  * Function returns control, having informed the system
2805
  * Function returns control, having informed the system
2817
    an information on request. Play itself goes independently from
2806
    an information on request. Play itself goes independently from
2818
    the program.
2807
    the program.
2819
  * The data must be kept in the memory at least up to the end
2808
  * The data must be kept in the memory at least up to the end
2820
    of play.
2809
    of play.
2821
 
2810
 
2822
======================================================================
2811
======================================================================
2823
=============== Function 56 - write file to hard disk. ===============
-
 
2824
======================================================================
-
 
2825
Parameters:
-
 
2826
  * eax = 56 - function number
-
 
2827
  * ebx = pointer to the file name
-
 
2828
  * ecx = size of data to write (in bytes)
-
 
2829
  * edx = pointer to data to write
-
 
2830
  * esi = pointer to path (ASCIIZ-string)
-
 
2831
Returned value:
-
 
2832
  * eax = 0 - success, otherwise file system error code
-
 
2833
Remarks:
-
 
2834
  * This function is obsolete; function 70 allows to fulfil the same
-
 
2835
    operations with the extended possibilities.
-
 
2836
  * This function assumes that during its call by one application
-
 
2837
    no other application works with hard disk.
-
 
2838
  * The path to file is ASCIIZ-string, which may be empty
-
 
2839
    (if the file is created in the root folder) or have the format
-
 
2840
    /d1/d2/.../dn, where all folder names must have the 8+3 format,
-
 
2841
    i.e. 8 characters of name and 3 characters of the extension
-
 
2842
    without separator, supplemented by blanks if necessary;
-
 
2843
    all letters must be capital.
-
 
2844
  * The file name must also have the format 8+3.
-
 
2845
 
-
 
2846
======================================================================
-
 
2847
================ Function 58 - work with file system. ================
2812
================ Function 58 - work with file system. ================
2848
======================================================================
2813
======================================================================
2849
Parameters:
2814
Parameters:
2850
  * eax = 58
2815
  * eax = 58
2851
  * ebx = pointer to the information structure
2816
  * ebx = pointer to the information structure
2852
Returned value:
2817
Returned value:
2853
  * eax = 0 - success; otherwise file system error code
2818
  * eax = 0 - success; otherwise file system error code
2854
  * some subfunctions return value in other registers too
2819
  * some subfunctions return value in other registers too
2855
General format of the information structure:
2820
General format of the information structure:
2856
  * +0: dword: subfunction number
2821
  * +0: dword: subfunction number
2857
  * +4: dword: number of block
2822
  * +4: dword: number of block
2858
  * +8: dword: size
2823
  * +8: dword: size
2859
  * +12 = +0xC: dword: pointer to data
2824
  * +12 = +0xC: dword: pointer to data
2860
  * +16 = +0x10: dword: pointer to a memory for system operations
2825
  * +16 = +0x10: dword: pointer to a memory for system operations
2861
    (4096 bytes)
2826
    (4096 bytes)
2862
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2827
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2863
Specifications - in documentation on the appropriate subfunction.
2828
Specifications - in documentation on the appropriate subfunction.
2864
Filename is case-insensitive for latin letters, russian letters
2829
Filename is case-insensitive for latin letters, russian letters
2865
must be capital.
2830
must be capital.
2866
Format of filename:
2831
Format of filename:
2867
/base/number/dir1/dir2/.../dirn/file,
2832
/base/number/dir1/dir2/.../dirn/file,
2868
where /base/number identifies device, on which file is located:
2833
where /base/number identifies device, on which file is located:
2869
one of
2834
one of
2870
  * /RD/1 = /RAMDISK/1 to access ramdisk
2835
  * /RD/1 = /RAMDISK/1 to access ramdisk
2871
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2836
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2872
    /FD/2 = /FLOPPYDISK/2 to access second one
2837
    /FD/2 = /FLOPPYDISK/2 to access second one
2873
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2838
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2874
    (in this case base is defined by subfunction 7 of function 21),
2839
    (in this case base is defined by subfunction 7 of function 21),
2875
    x - partition number (beginning from 1)
2840
    x - partition number (beginning from 1)
2876
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2841
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2877
    IDE0 (Primary Master), IDE1 (Primary Slave),
2842
    IDE0 (Primary Master), IDE1 (Primary Slave),
2878
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2843
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2879
    x - partition number on the selected hard drive, varies from 1
2844
    x - partition number on the selected hard drive, varies from 1
2880
    to 255 (on each hard drive the indexing starts from 1)
2845
    to 255 (on each hard drive the indexing starts from 1)
2881
Remarks:
2846
Remarks:
2882
  * In the first two cases it is also possible to use FIRST
2847
  * In the first two cases it is also possible to use FIRST
2883
    instead of 1, SECOND instead of 2, but it is not recommended
2848
    instead of 1, SECOND instead of 2, but it is not recommended
2884
    for convenience of transition to the future extensions.
2849
    for convenience of transition to the future extensions.
2885
  * Limitation n<=39 is imposed.
2850
  * Limitation n<=39 is imposed.
2886
  * Names of folders and file dir1,...,dirn,file must have the
2851
  * Names of folders and file dir1,...,dirn,file must have the
2887
    format 8.3: name no more than 8 characters, dot, extension no
2852
    format 8.3: name no more than 8 characters, dot, extension no
2888
    more than 3 characters. Trailing spaces are ignored, no other
2853
    more than 3 characters. Trailing spaces are ignored, no other
2889
    spaces is allowed. If name occupies equally 8 characters,
2854
    spaces is allowed. If name occupies equally 8 characters,
2890
    dot may be omitted (though it is not recommended to use this
2855
    dot may be omitted (though it is not recommended to use this
2891
    feature for convenience of transition to the future extensions).
2856
    feature for convenience of transition to the future extensions).
2892
  * This function does not support folders on ramdisk.
2857
  * This function does not support folders on ramdisk.
2893
Examples:
2858
Examples:
2894
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2859
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2895
    '/rd/1/kernel.asm',0
2860
    '/rd/1/kernel.asm',0
2896
  * '/HD0/1/kernel.asm',0
2861
  * '/HD0/1/kernel.asm',0
2897
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2862
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2898
Existing subfunctions:
2863
Existing subfunctions:
2899
  * subfunction 0 - read file/folder
2864
  * subfunction 0 - read file/folder
2900
  * subfunction 1 - rewrite file
2865
  * subfunction 1 - rewrite file
2901
  * subfunction 4 - make folder
2866
  * subfunction 4 - make folder
2902
  * subfunction 5 - rename/move file/folder
2867
  * subfunction 5 - rename/move file/folder
2903
  * subfunction 8 - LBA-read from device
2868
  * subfunction 8 - LBA-read from device
2904
  * subfunction 15 - get file system information
2869
  * subfunction 15 - get file system information
2905
 
2870
 
2906
======================================================================
2871
======================================================================
2907
=========== Function 58, subfunction 0 - read file/folder. ===========
2872
=========== Function 58, subfunction 0 - read file/folder. ===========
2908
======================================================================
2873
======================================================================
2909
Parameters:
2874
Parameters:
2910
  * eax = 58
2875
  * eax = 58
2911
  * ebx = pointer to the information structure
2876
  * ebx = pointer to the information structure
2912
Format of the information structure:
2877
Format of the information structure:
2913
  * +0: dword: 0 = subfunction number
2878
  * +0: dword: 0 = subfunction number
2914
  * +4: dword: first block to read (beginning from 0)
2879
  * +4: dword: first block to read (beginning from 0)
2915
  * +8: dword: amount of blocks to read
2880
  * +8: dword: amount of blocks to read
2916
  * +12 = +0xC: dword: pointer to buffer for data
2881
  * +12 = +0xC: dword: pointer to buffer for data
2917
  * +16 = +0x10: dword: pointer to buffer for system operations
2882
  * +16 = +0x10: dword: pointer to buffer for system operations
2918
    (4096 bytes)
2883
    (4096 bytes)
2919
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2884
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2920
    given in the general description
2885
    given in the general description
2921
Returned value:
2886
Returned value:
2922
  * eax = 0 - success, otherwise file system error code
2887
  * eax = 0 - success, otherwise file system error code
2923
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2888
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2924
Remarks:
2889
Remarks:
2925
  * Block size is 512 bytes.
2890
  * Block size is 512 bytes.
2926
  * This function is obsolete, for reading files use subfunction 0
2891
  * This function is obsolete, for reading files use subfunction 0
2927
    of function 70, for reading folders - subfunction 1 of
2892
    of function 70, for reading folders - subfunction 1 of
2928
    function 70.
2893
    function 70.
2929
  * Function can read contents of a folder. Only FAT file system is
2894
  * Function can read contents of a folder. Only FAT file system is
2930
    supported. The format of FAT-folder is described
2895
    supported. The format of FAT-folder is described
2931
    in any FAT documentation.
2896
    in any FAT documentation.
2932
  * Size of a folder is determined by size of FAT clusters chain.
2897
  * Size of a folder is determined by size of FAT clusters chain.
2933
  * If file was ended before last requested block was read,
2898
  * If file was ended before last requested block was read,
2934
    the function will read as many as it can, and after that return
2899
    the function will read as many as it can, and after that return
2935
    eax=6 (EOF).
2900
    eax=6 (EOF).
2936
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2901
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2937
    in the first two cases the current implementation does not follow
2902
    in the first two cases the current implementation does not follow
2938
    to the declared rules:
2903
    to the declared rules:
2939
    for /rd/1:
2904
    for /rd/1:
2940
    * if one want to read 0 blocks, function considers,
2905
    * if one want to read 0 blocks, function considers,
2941
      that he requested 1;
2906
      that he requested 1;
2942
    * if one requests more than 14 blocks or starting block is
2907
    * if one requests more than 14 blocks or starting block is
2943
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2908
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2944
    * size of ramdisk root folder is 14 blocks, 
2909
    * size of ramdisk root folder is 14 blocks, 
2945
      0x1C00=7168 áàéò; but function returns ebx=0
2910
      0x1C00=7168 áàéò; but function returns ebx=0
2946
      (except of the case of previous item);
2911
      (except of the case of previous item);
2947
    * strangely enough, it is possible to read 14th block (which
2912
    * strangely enough, it is possible to read 14th block (which
2948
      generally contains a garbage - I remind, the indexing begins
2913
      generally contains a garbage - I remind, the indexing begins
2949
      from 0);
2914
      from 0);
2950
    * if some block with the number not less than 14 was requested,
2915
    * if some block with the number not less than 14 was requested,
2951
      function returns eax=6(EOF); otherwise eax=0.
2916
      function returns eax=6(EOF); otherwise eax=0.
2952
    For /fd/x:
2917
    For /fd/x:
2953
    * if the start block is not less than 14, function returns
2918
    * if the start block is not less than 14, function returns
2954
      eax=5 (not found) and ebx=0;
2919
      eax=5 (not found) and ebx=0;
2955
    * note that format of FAT12 allows floppies with the root size
2920
    * note that format of FAT12 allows floppies with the root size
2956
      more or less than 14 blocks;
2921
      more or less than 14 blocks;
2957
    * check for length is not performed;
2922
    * check for length is not performed;
2958
    * if data was successful read, function returns
2923
    * if data was successful read, function returns
2959
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2924
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2960
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2925
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2961
    but the result does not correspond to expected (on operations with
2926
    but the result does not correspond to expected (on operations with
2962
    normal files/folders), does not follow the declared rules,
2927
    normal files/folders), does not follow the declared rules,
2963
    may be changed in future versions of the kernel and consequently
2928
    may be changed in future versions of the kernel and consequently
2964
    is not described. To obtain the information about the equipment
2929
    is not described. To obtain the information about the equipment
2965
    use subfunction 11 of function 18 or
2930
    use subfunction 11 of function 18 or
2966
    read corresponding folder with subfunction 1 of function 70.
2931
    read corresponding folder with subfunction 1 of function 70.
2967
 
2932
 
2968
======================================================================
2933
======================================================================
2969
============= Function 58, subfunction 1 - rewrite file. =============
2934
============= Function 58, subfunction 1 - rewrite file. =============
2970
======================================================================
2935
======================================================================
2971
If the file does not exist, it is created.
2936
If the file does not exist, it is created.
2972
If the file exists, it is rewritten.
2937
If the file exists, it is rewritten.
2973
Parameters:
2938
Parameters:
2974
  * eax = 58 - function number
2939
  * eax = 58 - function number
2975
  * ebx = pointer to the information structure
2940
  * ebx = pointer to the information structure
2976
Format of the information structure:
2941
Format of the information structure:
2977
  * +0: dword: 1 = subfunction number
2942
  * +0: dword: 1 = subfunction number
2978
  * +4: dword: ignored (set to 0)
2943
  * +4: dword: ignored (set to 0)
2979
  * +8: dword: number of bytes to write
2944
  * +8: dword: number of bytes to write
2980
  * +12 = +0xC: dword: pointer to data to write
2945
  * +12 = +0xC: dword: pointer to data to write
2981
  * +16 = +0x10: dword: pointer to buffer for system operations
2946
  * +16 = +0x10: dword: pointer to buffer for system operations
2982
    (4096 bytes)
2947
    (4096 bytes)
2983
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2948
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2984
    given in the general description
2949
    given in the general description
2985
Returned value:
2950
Returned value:
2986
  * eax = 0 - success, otherwise file system error code
2951
  * eax = 0 - success, otherwise file system error code
2987
  * ebx destroyed
2952
  * ebx destroyed
2988
Remarks:
2953
Remarks:
2989
  * This function is obsolete, use subfunction 2 of function 70.
2954
  * This function is obsolete, use subfunction 2 of function 70.
2990
 
2955
 
2991
======================================================================
2956
======================================================================
2992
============== Function 58, subfunction 4 - make folder. =============
2957
============== Function 58, subfunction 4 - make folder. =============
2993
======================================================================
2958
======================================================================
2994
Parameters:
2959
Parameters:
2995
  * eax = 58 - function number
2960
  * eax = 58 - function number
2996
  * ebx = pointer to the information structure
2961
  * ebx = pointer to the information structure
2997
Format of the information structure:
2962
Format of the information structure:
2998
  * +0: dword: 4 = subfunction number
2963
  * +0: dword: 4 = subfunction number
2999
  * +4: dword: ignored
2964
  * +4: dword: ignored
3000
  * +8: dword: ignored
2965
  * +8: dword: ignored
3001
  * +12 = +0xC: dword: ignored
2966
  * +12 = +0xC: dword: ignored
3002
  * +16 = +0x10: dword: pointer to buffer for system operations
2967
  * +16 = +0x10: dword: pointer to buffer for system operations
3003
    (4096 bytes)
2968
    (4096 bytes)
3004
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2969
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3005
    given in the general description
2970
    given in the general description
3006
Returned value:
2971
Returned value:
3007
  * eax = 0 - success, otherwise file system error code
2972
  * eax = 0 - success, otherwise file system error code
3008
  * ebx destroyed
2973
  * ebx destroyed
3009
Remarks:
2974
Remarks:
3010
  * Ramdisk and floppies do not support this function, it is only
2975
  * Ramdisk and floppies do not support this function, it is only
3011
    for hard disks.
2976
    for hard disks.
3012
 
2977
 
3013
======================================================================
2978
======================================================================
3014
======== Function 58, subfunction 5 - rename/move file/folder. =======
2979
======== Function 58, subfunction 5 - rename/move file/folder. =======
3015
======================================================================
2980
======================================================================
3016
Parameters:
2981
Parameters:
3017
  * eax = 58 - function number
2982
  * eax = 58 - function number
3018
  * ebx = pointer to the information structure
2983
  * ebx = pointer to the information structure
3019
Format of the information structure:
2984
Format of the information structure:
3020
  * +0: dword: 5 = subfunction number
2985
  * +0: dword: 5 = subfunction number
3021
  * +4: dword: ignored
2986
  * +4: dword: ignored
3022
  * +8: dword: ignored
2987
  * +8: dword: ignored
3023
  * +12 = +0xC: dword: ignored
2988
  * +12 = +0xC: dword: ignored
3024
  * +16 = +0x10: dword: pointer to buffer for system operations
2989
  * +16 = +0x10: dword: pointer to buffer for system operations
3025
    (4096 bytes)
2990
    (4096 bytes)
3026
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2991
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3027
    given in the general description
2992
    given in the general description
3028
  * +20+n: (at once after terminating null character) new
2993
  * +20+n: (at once after terminating null character) new
3029
    ASCIIZ-name, must start from /hd/1, that is interpreted as
2994
    ASCIIZ-name, must start from /hd/1, that is interpreted as
3030
    the hard disk, indicated in the first name
2995
    the hard disk, indicated in the first name
3031
    (moving from one disk to another is not supported)
2996
    (moving from one disk to another is not supported)
3032
Returned value:
2997
Returned value:
3033
  * eax = 0 - success, otherwise file system error code
2998
  * eax = 0 - success, otherwise file system error code
3034
  * ebx destroyed
2999
  * ebx destroyed
3035
Remarks:
3000
Remarks:
3036
  * Ramdisk and floppies do not support this function, it is only
3001
  * Ramdisk and floppies do not support this function, it is only
3037
    for hard disks.
3002
    for hard disks.
3038
  * If the new ASCIIZ-name is strongly incorrect, i.e. does not start
3003
  * If the new ASCIIZ-name is strongly incorrect, i.e. does not start
3039
    from /hd/1, /hd/first, /harddisk/1, /harddisk/first or after this
3004
    from /hd/1, /hd/first, /harddisk/1, /harddisk/first or after this
3040
    space or null character follows, function returns, strangely
3005
    space or null character follows, function returns, strangely
3041
    enough, error code 4. It is the only function which returns
3006
    enough, error code 4. It is the only function which returns
3042
    this code.
3007
    this code.
3043
 
3008
 
3044
======================================================================
3009
======================================================================
3045
========= Function 58, subfunction 8 - LBA-read from device. =========
3010
========= Function 58, subfunction 8 - LBA-read from device. =========
3046
======================================================================
3011
======================================================================
3047
Parameters:
3012
Parameters:
3048
  * eax = 58 - function number
3013
  * eax = 58 - function number
3049
  * ebx = pointer to the information structure
3014
  * ebx = pointer to the information structure
3050
Format of the information structure:
3015
Format of the information structure:
3051
  * +0: dword: 8 = subfunction number
3016
  * +0: dword: 8 = subfunction number
3052
  * +4: dword: number of block to read (beginning from 0)
3017
  * +4: dword: number of block to read (beginning from 0)
3053
  * +8: dword: ignored (set to 1)
3018
  * +8: dword: ignored (set to 1)
3054
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
3019
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
3055
  * +16 = +0x10: dword: pointer to buffer for system operations
3020
  * +16 = +0x10: dword: pointer to buffer for system operations
3056
    (4096 bytes)
3021
    (4096 bytes)
3057
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
3022
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
3058
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
3023
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
3059
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
3024
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
3060
    Instead of digits it is allowed, though not recommended for
3025
    Instead of digits it is allowed, though not recommended for
3061
    convenience of transition to future extensions, to use
3026
    convenience of transition to future extensions, to use
3062
    'first','second','third','fourth'.
3027
    'first','second','third','fourth'.
3063
Returned value:
3028
Returned value:
3064
  * for device name /hd/xxx, where xxx is not in the list above:
3029
  * for device name /hd/xxx, where xxx is not in the list above:
3065
    * eax = ebx = 1
3030
    * eax = ebx = 1
3066
  * for invalid device name (except for the previous case):
3031
  * for invalid device name (except for the previous case):
3067
    * eax = 5
3032
    * eax = 5
3068
    * ebx does not change
3033
    * ebx does not change
3069
  * if LBA-access is disabled by subfunction 11 of function 21:
3034
  * if LBA-access is disabled by subfunction 11 of function 21:
3070
    * eax = 2
3035
    * eax = 2
3071
    * ebx destroyed
3036
    * ebx destroyed
3072
  * for ramdisk: attempt to read block outside ramdisk
3037
  * for ramdisk: attempt to read block outside ramdisk
3073
    (18*2*80 blocks) results in
3038
    (18*2*80 blocks) results in
3074
    * eax = 3
3039
    * eax = 3
3075
    * ebx = 0
3040
    * ebx = 0
3076
  * for successful read:
3041
  * for successful read:
3077
    * eax = ebx = 0
3042
    * eax = ebx = 0
3078
Remarks:
3043
Remarks:
3079
  * Block size is 512 bytes; function reads one block.
3044
  * Block size is 512 bytes; function reads one block.
3080
  * Do not depend on returned value, it can be changed
3045
  * Do not depend on returned value, it can be changed
3081
    in future versions.
3046
    in future versions.
3082
  * Function requires that LBA-access to devices is enabled by 
3047
  * Function requires that LBA-access to devices is enabled by 
3083
    subfunction 11 of function 21. To check this one can use 
3048
    subfunction 11 of function 21. To check this one can use 
3084
    subfunction 11 of function 26.
3049
    subfunction 11 of function 26.
3085
  * LBA-read of floppy is not supported.
3050
  * LBA-read of floppy is not supported.
3086
  * Function reads data on physical hard drive; if for any reason
3051
  * Function reads data on physical hard drive; if for any reason
3087
    data of the concrete partition are required, application must
3052
    data of the concrete partition are required, application must
3088
    define starting sector of this partition (either directly
3053
    define starting sector of this partition (either directly
3089
    through MBR, or from the full structure returned by
3054
    through MBR, or from the full structure returned by
3090
    ïîäôóíêöèåé 11 ôóíêöèè 18).
3055
    ïîäôóíêöèåé 11 ôóíêöèè 18).
3091
  * Function does not check error code of hard disk, so request of
3056
  * Function does not check error code of hard disk, so request of
3092
    nonexisting sector reads something (most probably it will be
3057
    nonexisting sector reads something (most probably it will be
3093
    zeroes, but this is defined by device) and this is considered
3058
    zeroes, but this is defined by device) and this is considered
3094
    as success (eax=0).
3059
    as success (eax=0).
3095
 
3060
 
3096
======================================================================
3061
======================================================================
3097
==== Function 58, subfunction 15 - get information on file system. ===
3062
==== Function 58, subfunction 15 - get information on file system. ===
3098
======================================================================
3063
======================================================================
3099
Parameters:
3064
Parameters:
3100
  * eax = 58 - function number
3065
  * eax = 58 - function number
3101
  * ebx = pointer to the information structure
3066
  * ebx = pointer to the information structure
3102
Format of the information structure:
3067
Format of the information structure:
3103
  * +0: dword: 15 = subfunction number
3068
  * +0: dword: 15 = subfunction number
3104
  * +4: dword: ignored
3069
  * +4: dword: ignored
3105
  * +8: dword: ignored
3070
  * +8: dword: ignored
3106
  * +12 = +0xC: dword: ignored
3071
  * +12 = +0xC: dword: ignored
3107
  * +16 = +0x10: dword: ignored
3072
  * +16 = +0x10: dword: ignored
3108
  * +20 = +0x14: (only second character is checked)
3073
  * +20 = +0x14: (only second character is checked)
3109
    /rd=/RAMDISK or /hd=/HARDDISK
3074
    /rd=/RAMDISK or /hd=/HARDDISK
3110
Returned value:
3075
Returned value:
3111
  * if the second character does not belong to set {'r','R','h','H'}:
3076
  * if the second character does not belong to set {'r','R','h','H'}:
3112
    * eax = 3
3077
    * eax = 3
3113
    * ebx = ecx = dword [fileinfo] = 0
3078
    * ebx = ecx = dword [fileinfo] = 0
3114
  * for ramdisk:
3079
  * for ramdisk:
3115
    * eax = 0 (success)
3080
    * eax = 0 (success)
3116
    * ebx = total number of clusters = 2847
3081
    * ebx = total number of clusters = 2847
3117
    * ecx = number of free clusters
3082
    * ecx = number of free clusters
3118
    * dword [fileinfo] = cluster size = 512
3083
    * dword [fileinfo] = cluster size = 512
3119
  * for hard disk: base and partition are defined by subfunctions
3084
  * for hard disk: base and partition are defined by subfunctions
3120
    7 and 8 of function 21:
3085
    7 and 8 of function 21:
3121
    * eax = 0 (success)
3086
    * eax = 0 (success)
3122
    * ebx = total number of clusters
3087
    * ebx = total number of clusters
3123
    * ecx = number of free clusters
3088
    * ecx = number of free clusters
3124
    * dword [fileinfo] = cluster size (in bytes)
3089
    * dword [fileinfo] = cluster size (in bytes)
3125
Remarks:
3090
Remarks:
3126
  * Be not surprised to strange layout of 4th returned parameter
3091
  * Be not surprised to strange layout of 4th returned parameter
3127
    - when this code was writing, at system calls application got
3092
    - when this code was writing, at system calls application got
3128
    only registers eax,ebx,ecx (from pushad-structure transmitted
3093
    only registers eax,ebx,ecx (from pushad-structure transmitted
3129
    as argument to the system function). Now it is corrected, so,
3094
    as argument to the system function). Now it is corrected, so,
3130
    probably, it is meaningful to return cluster size in edx, while
3095
    probably, it is meaningful to return cluster size in edx, while
3131
    this function is not used yet.
3096
    this function is not used yet.
3132
  * There exists also subfunction 11 of function 18,
3097
  * There exists also subfunction 11 of function 18,
3133
    which returns information on file system. From the full table
3098
    which returns information on file system. From the full table
3134
    of disk subsystem it is possible to deduce cluster size (there
3099
    of disk subsystem it is possible to deduce cluster size (there
3135
    it is stored in sectors) and total number of clusters
3100
    it is stored in sectors) and total number of clusters
3136
    for hard disks.
3101
    for hard disks.
3137
 
3102
 
3138
======================================================================
3103
======================================================================
3139
=============== Function 59 - trace last system calls. ===============
3104
=============== Function 59 - trace last system calls. ===============
3140
======================================================================
3105
======================================================================
3141
Gets data on all system calls of all processes.
3106
Gets data on all system calls of all processes.
3142
Parameters:
3107
Parameters:
3143
  * eax = 59 - function number
3108
  * eax = 59 - function number
3144
  * ebx = 0 - unique subfunction
3109
  * ebx = 0 - unique subfunction
3145
  * ecx = pointer to the buffer
3110
  * ecx = pointer to the buffer
3146
  * edx = size of the buffer
3111
  * edx = size of the buffer
3147
Returned value:
3112
Returned value:
3148
  * eax = total number of system calls made from system boot
3113
  * eax = total number of system calls made from system boot
3149
    (modulo 2^32)
3114
    (modulo 2^32)
3150
  * ebx = 0
3115
  * ebx = 0
3151
Format of information on one call: (size = 0x40 = 64 bytes)
3116
Format of information on one call: (size = 0x40 = 64 bytes)
3152
  * +0: dword: PID of process/thread
3117
  * +0: dword: PID of process/thread
3153
  * +4: 7*dword: garbage
3118
  * +4: 7*dword: garbage
3154
  * +32 = +0x20: dword: value of edi at the call
3119
  * +32 = +0x20: dword: value of edi at the call
3155
  * +36 = +0x24: dword: esi
3120
  * +36 = +0x24: dword: esi
3156
  * +40 = +0x28: dword: ebp
3121
  * +40 = +0x28: dword: ebp
3157
  * +44 = +0x2C: dword: stack pointer of the kernel handler
3122
  * +44 = +0x2C: dword: stack pointer of the kernel handler
3158
  * +48 = +0x30: dword: ebx
3123
  * +48 = +0x30: dword: ebx
3159
  * +52 = +0x34: dword: edx
3124
  * +52 = +0x34: dword: edx
3160
  * +56 = +0x38: dword: ecx
3125
  * +56 = +0x38: dword: ecx
3161
  * +60 = +0x3C: dword: eax (=number of system function)
3126
  * +60 = +0x3C: dword: eax (=number of system function)
3162
Remarks:
3127
Remarks:
3163
  * The function is used only in the application 'systrace'.
3128
  * The function is used only in the application 'systrace'.
3164
    It is rather difficult to imagine a situation, in which
3129
    It is rather difficult to imagine a situation, in which
3165
    this application or this function are really useful;
3130
    this application or this function are really useful;
3166
    and all system calls for support of this function are a little
3131
    and all system calls for support of this function are a little
3167
    decelerated (though not strongly)...
3132
    decelerated (though not strongly)...
3168
  * So there is a proposition to delete from the kernel
3133
  * So there is a proposition to delete from the kernel
3169
    support of this function, together with application 'systrace'.
3134
    support of this function, together with application 'systrace'.
3170
  * The information on system calls saves in the system
3135
  * The information on system calls saves in the system
3171
    ring buffer with 0x10 entries.
3136
    ring buffer with 0x10 entries.
3172
    This function simply copies the given size of data
3137
    This function simply copies the given size of data
3173
    from this buffer to the given address.
3138
    from this buffer to the given address.
3174
  * One can determine, which entry in the buffer corresponds to
3139
  * One can determine, which entry in the buffer corresponds to
3175
    last system call, by value of eax, namely, it is the entry
3140
    last system call, by value of eax, namely, it is the entry
3176
    (eax and 0xF) (at offset (eax and 0xF)*0x40).
3141
    (eax and 0xF) (at offset (eax and 0xF)*0x40).
3177
  * In the current implementation there can be the seldom
3142
  * In the current implementation there can be the seldom
3178
    meeting problems of unsynchronization, when the information
3143
    meeting problems of unsynchronization, when the information
3179
    on some calls becomes outdated.
3144
    on some calls becomes outdated.
3180
  * Under the system buffer one page, 4Kb, is allocated.
3145
  * Under the system buffer one page, 4Kb, is allocated.
3181
    Size of an entry = 64 bytes. Why only 16 entries are used,
3146
    Size of an entry = 64 bytes. Why only 16 entries are used,
3182
    is not clearly.
3147
    is not clearly.
3183
  * The value of esp at the moment of system call cannot
3148
  * The value of esp at the moment of system call cannot
3184
    be determined by this function.
3149
    be determined by this function.
3185
  * The current implementation does not check edx for correctness.
3150
  * The current implementation does not check edx for correctness.
3186
 
3151
 
3187
======================================================================
3152
======================================================================
3188
========== Function 60 - Inter Process Communication (IPC). ==========
3153
========== Function 60 - Inter Process Communication (IPC). ==========
3189
======================================================================
3154
======================================================================
3190
IPC is used for message dispatching from one process/thread to
3155
IPC is used for message dispatching from one process/thread to
3191
another. Previously it is necessary to agree how to interpret
3156
another. Previously it is necessary to agree how to interpret
3192
the concrete message.
3157
the concrete message.
3193
 
3158
 
3194
----------- Subfunction 1 - set the area for IPC receiving -----------
3159
----------- Subfunction 1 - set the area for IPC receiving -----------
3195
Is called by process-receiver.
3160
Is called by process-receiver.
3196
Parameters:
3161
Parameters:
3197
  * eax = 60 - function number
3162
  * eax = 60 - function number
3198
  * ebx = 1 - subfunction number
3163
  * ebx = 1 - subfunction number
3199
  * ecx = pointer to the buffer
3164
  * ecx = pointer to the buffer
3200
  * edx = size of the buffer
3165
  * edx = size of the buffer
3201
Returned value:
3166
Returned value:
3202
  * eax = 0 - always success
3167
  * eax = 0 - always success
3203
Format of IPC-buffer:
3168
Format of IPC-buffer:
3204
  * +0: dword: if nonzero, buffer is considered locked;
3169
  * +0: dword: if nonzero, buffer is considered locked;
3205
    lock/unlock the buffer, when you work with it and need that
3170
    lock/unlock the buffer, when you work with it and need that
3206
    buffer data are not changed from outside (no new messages)
3171
    buffer data are not changed from outside (no new messages)
3207
  * +4: dword: occupied place in the buffer (in bytes)
3172
  * +4: dword: occupied place in the buffer (in bytes)
3208
  * +8: first message
3173
  * +8: first message
3209
  * +8+n: second message
3174
  * +8+n: second message
3210
  * ...
3175
  * ...
3211
Format of a message:
3176
Format of a message:
3212
  * +0: dword: PID of sender
3177
  * +0: dword: PID of sender
3213
  * +4: dword: message length (not including this header)
3178
  * +4: dword: message length (not including this header)
3214
  * +8: n*byte: message data
3179
  * +8: n*byte: message data
3215
 
3180
 
3216
------------------ Subfunction 2 - send IPC message ------------------
3181
------------------ Subfunction 2 - send IPC message ------------------
3217
Is called by process-sender.
3182
Is called by process-sender.
3218
Parameters:
3183
Parameters:
3219
  * eax = 60 - function number
3184
  * eax = 60 - function number
3220
  * ebx = 2 - subfunction number
3185
  * ebx = 2 - subfunction number
3221
  * ecx = PID of receiver
3186
  * ecx = PID of receiver
3222
  * edx = pointer to the message data
3187
  * edx = pointer to the message data
3223
  * esi = message length (in bytes)
3188
  * esi = message length (in bytes)
3224
Returned value:
3189
Returned value:
3225
  * eax = 0 - success
3190
  * eax = 0 - success
3226
  * eax = 1 - the receiver has not defined buffer for IPC messages
3191
  * eax = 1 - the receiver has not defined buffer for IPC messages
3227
    (can be, still have no time,
3192
    (can be, still have no time,
3228
    and can be, this is not right process)
3193
    and can be, this is not right process)
3229
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3194
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3230
  * eax = 3 - overflow of IPC-buffer of the receiver
3195
  * eax = 3 - overflow of IPC-buffer of the receiver
3231
  * eax = 4 - process/thread with such PID does not exist
3196
  * eax = 4 - process/thread with such PID does not exist
3232
Remarks:
3197
Remarks:
3233
  * Immediately after writing of IPC-message to the buffer the system
3198
  * Immediately after writing of IPC-message to the buffer the system
3234
    sends to the receiver the event with code 7 (see event codes).
3199
    sends to the receiver the event with code 7 (see event codes).
3235
 
3200
 
3236
======================================================================
3201
======================================================================
3237
==== Function 61 - get parameters for the direct graphics access. ====
3202
==== Function 61 - get parameters for the direct graphics access. ====
3238
======================================================================
3203
======================================================================
3239
The data of the graphics screen (the memory area which displays
3204
The data of the graphics screen (the memory area which displays
3240
screen contents) are accessible to a program directly, without
3205
screen contents) are accessible to a program directly, without
3241
any system calls, through the selector gs:
3206
any system calls, through the selector gs:
3242
	mov	eax, [gs:0]
3207
	mov	eax, [gs:0]
3243
places in eax the first dword of the buffer, which contains
3208
places in eax the first dword of the buffer, which contains
3244
information on color of the left upper point (and, possibly, colors
3209
information on color of the left upper point (and, possibly, colors
3245
of several following).
3210
of several following).
3246
	mov	[gs:0], eax
3211
	mov	[gs:0], eax
3247
by work in VESA modes with LFB sets color of the left upper point
3212
by work in VESA modes with LFB sets color of the left upper point
3248
(and, possibly, colors of several following).
3213
(and, possibly, colors of several following).
3249
To interpret the data of graphics screen program needs to know
3214
To interpret the data of graphics screen program needs to know
3250
some parameters, returning by this function.
3215
some parameters, returning by this function.
3251
Remarks:
3216
Remarks:
3252
  * Graphics parameters changes very seldom at work,
3217
  * Graphics parameters changes very seldom at work,
3253
    namely, only in cases, when user works with the application VRR.
3218
    namely, only in cases, when user works with the application VRR.
3254
  * At videomode change the system redraws all windows (event
3219
  * At videomode change the system redraws all windows (event
3255
    with code 1) and redraws the background (event 5).
3220
    with code 1) and redraws the background (event 5).
3256
    Same events occur in other cases too, which meet much more often,
3221
    Same events occur in other cases too, which meet much more often,
3257
    than videomode change.
3222
    than videomode change.
3258
  * By operation in videomodes with LFB the selector gs points to
3223
  * By operation in videomodes with LFB the selector gs points to
3259
    LFB itself, so reading/writing on gs result directly in
3224
    LFB itself, so reading/writing on gs result directly in
3260
    change of screen contents. By operation in videomodes without
3225
    change of screen contents. By operation in videomodes without
3261
    LFB gs points to some data area in the kernel, and all functions
3226
    LFB gs points to some data area in the kernel, and all functions
3262
    of screen output fulfil honesty double operation on writing
3227
    of screen output fulfil honesty double operation on writing
3263
    directly to the screen and writing to this buffer. In result
3228
    directly to the screen and writing to this buffer. In result
3264
    at reading contents of this buffer the results correspond to
3229
    at reading contents of this buffer the results correspond to
3265
    screen contents (with, generally speaking, large color
3230
    screen contents (with, generally speaking, large color
3266
    resolution), and writing is ignored.
3231
    resolution), and writing is ignored.
3267
    One exception is the mode 320*200, for which main loop of the
3232
    One exception is the mode 320*200, for which main loop of the
3268
    system thread updates the screen according to mouse movements.
3233
    system thread updates the screen according to mouse movements.
3269
 
3234
 
3270
------------------------- Screen resolution --------------------------
3235
------------------------- Screen resolution --------------------------
3271
Parameters:
3236
Parameters:
3272
  * eax = 61 - function number
3237
  * eax = 61 - function number
3273
  * ebx = 1 - subfunction number
3238
  * ebx = 1 - subfunction number
3274
Returned value:
3239
Returned value:
3275
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3240
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3276
Remarks:
3241
Remarks:
3277
  * One can use function 14 paying attention that
3242
  * One can use function 14 paying attention that
3278
    it returns sizes on 1 pixel less. It is fully equivalent way.
3243
    it returns sizes on 1 pixel less. It is fully equivalent way.
3279
 
3244
 
3280
---------------------- Number of bits per pixel ----------------------
3245
---------------------- Number of bits per pixel ----------------------
3281
Parameters:
3246
Parameters:
3282
  * eax = 61 - function number
3247
  * eax = 61 - function number
3283
  * ebx = 2 - subfunction number
3248
  * ebx = 2 - subfunction number
3284
Returned value:
3249
Returned value:
3285
  * eax = number of bits per pixel (24 or 32)
3250
  * eax = number of bits per pixel (24 or 32)
3286
 
3251
 
3287
-------------------- Number of bytes per scanline --------------------
3252
-------------------- Number of bytes per scanline --------------------
3288
Parameters:
3253
Parameters:
3289
  * eax = 61 - function number
3254
  * eax = 61 - function number
3290
  * ebx = 3 - subfunction number
3255
  * ebx = 3 - subfunction number
3291
Returned value:
3256
Returned value:
3292
  * eax = number of bytes occupied by one scanline
3257
  * eax = number of bytes occupied by one scanline
3293
    (horizontal line on the screen)
3258
    (horizontal line on the screen)
3294
 
3259
 
3295
======================================================================
3260
======================================================================
3296
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3261
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3297
======================================================================
3262
======================================================================
3298
Parameters:
3263
Parameters:
3299
  * eax = 62 - function number
3264
  * eax = 62 - function number
3300
  * bl = 0 - subfunction number
3265
  * bl = 0 - subfunction number
3301
Returned value:
3266
Returned value:
3302
  * eax = -1 - PCI access is disabled; otherwise
3267
  * eax = -1 - PCI access is disabled; otherwise
3303
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3268
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3304
  * high word of eax is zeroed
3269
  * high word of eax is zeroed
3305
Remarks:
3270
Remarks:
3306
  * Previously low-level access to PCI for applications must be
3271
  * Previously low-level access to PCI for applications must be
3307
    enabled by subfunction 12 of function 21.
3272
    enabled by subfunction 12 of function 21.
3308
  * If PCI BIOS is not supported, the value of ax is undefined.
3273
  * If PCI BIOS is not supported, the value of ax is undefined.
3309
 
3274
 
3310
======================================================================
3275
======================================================================
3311
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3276
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3312
======================================================================
3277
======================================================================
3313
Parameters:
3278
Parameters:
3314
  * eax = 62 - function number
3279
  * eax = 62 - function number
3315
  * bl = 1 - subfunction number
3280
  * bl = 1 - subfunction number
3316
Returned value:
3281
Returned value:
3317
  * eax = -1 - access to PCI is disabled; otherwise
3282
  * eax = -1 - access to PCI is disabled; otherwise
3318
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3283
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3319
Remarks:
3284
Remarks:
3320
  * Previously low-level access to PCI for applications must be
3285
  * Previously low-level access to PCI for applications must be
3321
    enabled by subfunction 12 of function 21.
3286
    enabled by subfunction 12 of function 21.
3322
  * If PCI BIOS is not supported, the value of ax is undefined.
3287
  * If PCI BIOS is not supported, the value of ax is undefined.
3323
 
3288
 
3324
======================================================================
3289
======================================================================
3325
===================== Function 62, subfunction 2 =====================
3290
===================== Function 62, subfunction 2 =====================
3326
===== Get mechanism of addressing to the PCI configuration space. ====
3291
===== Get mechanism of addressing to the PCI configuration space. ====
3327
======================================================================
3292
======================================================================
3328
Parameters:
3293
Parameters:
3329
  * eax = 62 - function number
3294
  * eax = 62 - function number
3330
  * bl = 2 - subfunction number
3295
  * bl = 2 - subfunction number
3331
Returned value:
3296
Returned value:
3332
  * eax = -1 - access to PCI is disabled; otherwise
3297
  * eax = -1 - access to PCI is disabled; otherwise
3333
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3298
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3334
Remarks:
3299
Remarks:
3335
  * Previously low-level access to PCI for applications must be
3300
  * Previously low-level access to PCI for applications must be
3336
    enabled by subfunction 12 of function 21.
3301
    enabled by subfunction 12 of function 21.
3337
  * Addressing mechanism is selected depending on
3302
  * Addressing mechanism is selected depending on
3338
    equipment characteristics.
3303
    equipment characteristics.
3339
  * Subfunctions of read and write work automatically
3304
  * Subfunctions of read and write work automatically
3340
    with the selected mechanism.
3305
    with the selected mechanism.
3341
 
3306
 
3342
======================================================================
3307
======================================================================
3343
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3308
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3344
======================================================================
3309
======================================================================
3345
Parameters:
3310
Parameters:
3346
  * eax = 62 - function number
3311
  * eax = 62 - function number
3347
  * bl = 4 - read byte
3312
  * bl = 4 - read byte
3348
  * bl = 5 - read word
3313
  * bl = 5 - read word
3349
  * bl = 6 - read dword
3314
  * bl = 6 - read dword
3350
  * bh = number of PCI-bus
3315
  * bh = number of PCI-bus
3351
  * ch = dddddfff, where ddddd = number of the device on the bus,
3316
  * ch = dddddfff, where ddddd = number of the device on the bus,
3352
    fff = function number of device
3317
    fff = function number of device
3353
  * cl = number of register (must be even for bl=5,
3318
  * cl = number of register (must be even for bl=5,
3354
    divisible by 4 for bl=6)
3319
    divisible by 4 for bl=6)
3355
Returned value:
3320
Returned value:
3356
  * eax = -1 - error (access to PCI is disabled or parameters
3321
  * eax = -1 - error (access to PCI is disabled or parameters
3357
    are not supported); otherwise
3322
    are not supported); otherwise
3358
  * al/ax/eax (depending on requested size) contains the data;
3323
  * al/ax/eax (depending on requested size) contains the data;
3359
    the other part of register eax is destroyed
3324
    the other part of register eax is destroyed
3360
Remarks:
3325
Remarks:
3361
  * Previously low-level access to PCI for applications must be
3326
  * Previously low-level access to PCI for applications must be
3362
    enabled by subfunction 12 of function 21.
3327
    enabled by subfunction 12 of function 21.
3363
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3328
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3364
    function number. To get access mechanism use subfunction 2.
3329
    function number. To get access mechanism use subfunction 2.
3365
  * Some registers are standard and exist for all devices, some are
3330
  * Some registers are standard and exist for all devices, some are
3366
    defined by the concrete device. The list of registers of the
3331
    defined by the concrete device. The list of registers of the
3367
    first type can be found e.g. in famous
3332
    first type can be found e.g. in famous
3368
    Interrupt List by Ralf Brown
3333
    Interrupt List by Ralf Brown
3369
    (http://www.pobox.com/~ralf/files.html,
3334
    (http://www.pobox.com/~ralf/files.html,
3370
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3335
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3371
    registers of the second type must be listed
3336
    registers of the second type must be listed
3372
    in the device documentation.
3337
    in the device documentation.
3373
 
3338
 
3374
======================================================================
3339
======================================================================
3375
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3340
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3376
======================================================================
3341
======================================================================
3377
Parameters:
3342
Parameters:
3378
  * eax = 62 - function number
3343
  * eax = 62 - function number
3379
  * bl = 8 - write byte
3344
  * bl = 8 - write byte
3380
  * bl = 9 - write word
3345
  * bl = 9 - write word
3381
  * bl = 10 - write dword
3346
  * bl = 10 - write dword
3382
  * bh = number of PCI-bus
3347
  * bh = number of PCI-bus
3383
  * ch = dddddfff, where ddddd = number of the device on the bus,
3348
  * ch = dddddfff, where ddddd = number of the device on the bus,
3384
    fff = function number of device
3349
    fff = function number of device
3385
  * cl = number of register (must be even for bl=9,
3350
  * cl = number of register (must be even for bl=9,
3386
    divisible by 4 for bl=10)
3351
    divisible by 4 for bl=10)
3387
  * dl/dx/edx (depending on requested size) contatins
3352
  * dl/dx/edx (depending on requested size) contatins
3388
    the data to write
3353
    the data to write
3389
Returned value:
3354
Returned value:
3390
  * eax = -1 - error (access to PCI is disabled or parameters
3355
  * eax = -1 - error (access to PCI is disabled or parameters
3391
    are not supported)
3356
    are not supported)
3392
  * eax = 0 - success
3357
  * eax = 0 - success
3393
Remarks:
3358
Remarks:
3394
  * Previously low-level access to PCI for applications must be
3359
  * Previously low-level access to PCI for applications must be
3395
    enabled by subfunction 12 of function 21.
3360
    enabled by subfunction 12 of function 21.
3396
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3361
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3397
    function number. To get access mechanism use subfunction 2.
3362
    function number. To get access mechanism use subfunction 2.
3398
  * Some registers are standard and exist for all devices, some are
3363
  * Some registers are standard and exist for all devices, some are
3399
    defined by the concrete device. The list of registers of the
3364
    defined by the concrete device. The list of registers of the
3400
    first type can be found e.g. in famous Interrupt List by
3365
    first type can be found e.g. in famous Interrupt List by
3401
    Ralf Brown; registers of the second type must be listed
3366
    Ralf Brown; registers of the second type must be listed
3402
    in the device documentation.
3367
    in the device documentation.
3403
 
3368
 
3404
======================================================================
3369
======================================================================
3405
============== Function 63 - work with the debug board. ==============
3370
============== Function 63 - work with the debug board. ==============
3406
======================================================================
3371
======================================================================
3407
The debug board is the global system buffer (with the size
3372
The debug board is the global system buffer (with the size
3408
512 bytes), to which any program can write (generally speaking,
3373
512 bytes), to which any program can write (generally speaking,
3409
arbitrary) data and from which other program can read these data.
3374
arbitrary) data and from which other program can read these data.
3410
By the agreement written data are text strings interpreted as
3375
By the agreement written data are text strings interpreted as
3411
debug messages on a course of program execution. The kernel in
3376
debug messages on a course of program execution. The kernel in
3412
some situations also writes to the debug board information on
3377
some situations also writes to the debug board information on
3413
execution of some functions; by the agreement kernel messages
3378
execution of some functions; by the agreement kernel messages
3414
begins from the prefix "K : ".
3379
begins from the prefix "K : ".
3415
For view of the debug board the application 'board' was created,
3380
For view of the debug board the application 'board' was created,
3416
which reads data from the buffer and displays them in its window.
3381
which reads data from the buffer and displays them in its window.
3417
'board' interpretes the sequence of codes 13,10 as newline.
3382
'board' interpretes the sequence of codes 13,10 as newline.
3418
A character with null code in an end of line is not necessary,
3383
A character with null code in an end of line is not necessary,
3419
but also does not prevent.
3384
but also does not prevent.
3420
Because debugger has been written, the value of the debug board
3385
Because debugger has been written, the value of the debug board
3421
has decreased, as debugger allows to inspect completely a course of
3386
has decreased, as debugger allows to inspect completely a course of
3422
program execution without any efforts from the direction of program
3387
program execution without any efforts from the direction of program
3423
itself. Nevertheless in some cases the debug board is still useful.
3388
itself. Nevertheless in some cases the debug board is still useful.
3424
 
3389
 
3425
----------------------------- Write byte -----------------------------
3390
----------------------------- Write byte -----------------------------
3426
Parameters:
3391
Parameters:
3427
  * eax = 63 - function number
3392
  * eax = 63 - function number
3428
  * ebx = 1 - subfunction number
3393
  * ebx = 1 - subfunction number
3429
  * cl = data byte
3394
  * cl = data byte
3430
Returned value:
3395
Returned value:
3431
  * function does not return value
3396
  * function does not return value
3432
Remarks:
3397
Remarks:
3433
  * Byte is written to the buffer. Buffer size is 512 bytes.
3398
  * Byte is written to the buffer. Buffer size is 512 bytes.
3434
    At buffer overflow all obtained data are lost.
3399
    At buffer overflow all obtained data are lost.
3435
  * For output to the debug board of more complicated objects
3400
  * For output to the debug board of more complicated objects
3436
    (strings, numbers) it is enough to call this function in cycle.
3401
    (strings, numbers) it is enough to call this function in cycle.
3437
    It is possible not to write the appropriate code manually and use
3402
    It is possible not to write the appropriate code manually and use
3438
    file 'debug.inc', which is included into the distributive.
3403
    file 'debug.inc', which is included into the distributive.
3439
 
3404
 
3440
----------------------------- Read byte ------------------------------
3405
----------------------------- Read byte ------------------------------
3441
Takes away byte from the buffer.
3406
Takes away byte from the buffer.
3442
Parameters:
3407
Parameters:
3443
  * eax = 63 - function number
3408
  * eax = 63 - function number
3444
  * ebx = 2 - subfunction number
3409
  * ebx = 2 - subfunction number
3445
Returned value:
3410
Returned value:
3446
  * eax = ebx = 0 - the buffer is empty
3411
  * eax = ebx = 0 - the buffer is empty
3447
  * eax = byte, ebx = 1 - byte was successfully read
3412
  * eax = byte, ebx = 1 - byte was successfully read
3448
 
3413
 
3449
======================================================================
3414
======================================================================
3450
============== Function 64 - resize application memory. ==============
3415
============== Function 64 - resize application memory. ==============
3451
======================================================================
3416
======================================================================
3452
Parameters:
3417
Parameters:
3453
  * eax = 64 - function number
3418
  * eax = 64 - function number
3454
  * ebx = 1 - unique subfunction
3419
  * ebx = 1 - unique subfunction
3455
  * ecx = new memory size
3420
  * ecx = new memory size
3456
Returned value:
3421
Returned value:
3457
  * eax = 0 - success
3422
  * eax = 0 - success
3458
  * eax = 1 - not enough memory
3423
  * eax = 1 - not enough memory
3459
Remarks:
3424
Remarks:
3460
  * There is another way to dynamically allocate/free memory -
3425
  * There is another way to dynamically allocate/free memory -
3461
    subfunctions 11, 12, 13 of function 68.
3426
    subfunctions 11, 12, 13 of function 68.
3462
  * The function cannot be used together with 68.11, 68.12, 68.13.
3427
  * The function cannot be used together with 68.11, 68.12, 68.13.
3463
    The function call will be ignored after creation of process heap
3428
    The function call will be ignored after creation of process heap
3464
    with function 68.11.
3429
    with function 68.11.
3465
 
3430
 
3466
======================================================================
3431
======================================================================
3467
================== Function 66 - work with keyboard. =================
3432
================== Function 66 - work with keyboard. =================
3468
======================================================================
3433
======================================================================
3469
The input mode influences results of reading keys by function 2.
3434
The input mode influences results of reading keys by function 2.
3470
When a program loads, ASCII input mode is set for it.
3435
When a program loads, ASCII input mode is set for it.
3471
 
3436
 
3472
-------------- Subfunction 1 - set keyboard input mode. --------------
3437
-------------- Subfunction 1 - set keyboard input mode. --------------
3473
Parameters:
3438
Parameters:
3474
  * eax = 66 - function number
3439
  * eax = 66 - function number
3475
  * ebx = 1 - subfunction number
3440
  * ebx = 1 - subfunction number
3476
  * ecx = mode:
3441
  * ecx = mode:
3477
    * 0 = normal (ASCII-characters)
3442
    * 0 = normal (ASCII-characters)
3478
    * 1 = scancodes
3443
    * 1 = scancodes
3479
Returned value:
3444
Returned value:
3480
  * function does not return value
3445
  * function does not return value
3481
 
3446
 
3482
-------------- Subfunction 2 - get keyboard input mode. --------------
3447
-------------- Subfunction 2 - get keyboard input mode. --------------
3483
Parameters:
3448
Parameters:
3484
  * eax = 66 - function number
3449
  * eax = 66 - function number
3485
  * ebx = 2 - subfunction number
3450
  * ebx = 2 - subfunction number
3486
Returned value:
3451
Returned value:
3487
  * eax = current mode
3452
  * eax = current mode
3488
 
3453
 
3489
------------ Subfunction 3 - get status of control keys. -------------
3454
------------ Subfunction 3 - get status of control keys. -------------
3490
Parameters:
3455
Parameters:
3491
  * eax = 66 - function number
3456
  * eax = 66 - function number
3492
  * ebx = 3 - subfunction number
3457
  * ebx = 3 - subfunction number
3493
Returned value:
3458
Returned value:
3494
  * eax = bit mask:
3459
  * eax = bit mask:
3495
  * bit 0 (mask 1): left Shift is pressed
3460
  * bit 0 (mask 1): left Shift is pressed
3496
  * bit 1 (mask 2): right Shift is pressed
3461
  * bit 1 (mask 2): right Shift is pressed
3497
  * bit 2 (mask 4): left Ctrl is pressed
3462
  * bit 2 (mask 4): left Ctrl is pressed
3498
  * bit 3 (mask 8): right Ctrl is pressed
3463
  * bit 3 (mask 8): right Ctrl is pressed
3499
  * bit 4 (mask 0x10): left Alt is pressed
3464
  * bit 4 (mask 0x10): left Alt is pressed
3500
  * bit 5 (mask 0x20): right Alt is pressed
3465
  * bit 5 (mask 0x20): right Alt is pressed
3501
  * bit 6 (mask 0x40): CapsLock is on
3466
  * bit 6 (mask 0x40): CapsLock is on
3502
  * bit 7 (mask 0x80): NumLock is on
3467
  * bit 7 (mask 0x80): NumLock is on
3503
  * bit 8 (mask 0x100): ScrollLock is on
3468
  * bit 8 (mask 0x100): ScrollLock is on
3504
  * other bits are cleared
3469
  * other bits are cleared
3505
 
3470
 
3506
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3471
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3507
When hotkey is pressed, the system notifies only those applications,
3472
When hotkey is pressed, the system notifies only those applications,
3508
which have installed it; the active application (which receives
3473
which have installed it; the active application (which receives
3509
all normal input) does not receive such keys.
3474
all normal input) does not receive such keys.
3510
The notification consists in sending event with the code 2.
3475
The notification consists in sending event with the code 2.
3511
Reading hotkey is the same as reading normal key - by function 2.
3476
Reading hotkey is the same as reading normal key - by function 2.
3512
Parameters:
3477
Parameters:
3513
  * eax = 66 - function number
3478
  * eax = 66 - function number
3514
  * ebx = 4 - subfunction number
3479
  * ebx = 4 - subfunction number
3515
  * cl determines key scancode;
3480
  * cl determines key scancode;
3516
    use cl=0 to give combinations such as Ctrl+Shift
3481
    use cl=0 to give combinations such as Ctrl+Shift
3517
  * edx = 0xXYZ determines possible states of control keys:
3482
  * edx = 0xXYZ determines possible states of control keys:
3518
    * Z (low 4 bits) determines state of LShift and RShift:
3483
    * Z (low 4 bits) determines state of LShift and RShift:
3519
      * 0 = no key must be pressed;
3484
      * 0 = no key must be pressed;
3520
      * 1 = exactly one key must be pressed;
3485
      * 1 = exactly one key must be pressed;
3521
      * 2 = both keys must be pressed;
3486
      * 2 = both keys must be pressed;
3522
      * 3 = must be pressed LShift, but not RShift;
3487
      * 3 = must be pressed LShift, but not RShift;
3523
      * 4 = must be pressed RShift, but not LShift
3488
      * 4 = must be pressed RShift, but not LShift
3524
    * Y - similar for LCtrl and RCtrl;
3489
    * Y - similar for LCtrl and RCtrl;
3525
    * X - similar for LAlt and RAlt
3490
    * X - similar for LAlt and RAlt
3526
Returned value:
3491
Returned value:
3527
  * eax=0 - success
3492
  * eax=0 - success
3528
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3493
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3529
Remarks:
3494
Remarks:
3530
  * Hotkey can work either at pressing or at release. Release
3495
  * Hotkey can work either at pressing or at release. Release
3531
    scancode of a key is more on 128 than pressing scancode
3496
    scancode of a key is more on 128 than pressing scancode
3532
    (i.e. high bit is set).
3497
    (i.e. high bit is set).
3533
  * Several applications can set the same combination;
3498
  * Several applications can set the same combination;
3534
    all such applications will be informed on pressing
3499
    all such applications will be informed on pressing
3535
    such combination.
3500
    such combination.
3536
 
3501
 
3537
-------------- Subfunction 5 - delete installed hotkey. --------------
3502
-------------- Subfunction 5 - delete installed hotkey. --------------
3538
Parameters:
3503
Parameters:
3539
  * eax = 66 - function number
3504
  * eax = 66 - function number
3540
  * ebx = 5 - subfunction number
3505
  * ebx = 5 - subfunction number
3541
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3506
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3542
Returned value:
3507
Returned value:
3543
  * eax = 0 - success
3508
  * eax = 0 - success
3544
  * eax = 1 - there is no such hotkey
3509
  * eax = 1 - there is no such hotkey
3545
Remarks:
3510
Remarks:
3546
  * When a process/thread terminates, all hotkey installed by it are
3511
  * When a process/thread terminates, all hotkey installed by it are
3547
    deleted.
3512
    deleted.
3548
  * The call to this subfunction does not affect other applications.
3513
  * The call to this subfunction does not affect other applications.
3549
    If other application has defined the same combination, it will
3514
    If other application has defined the same combination, it will
3550
    still receive notices.
3515
    still receive notices.
3551
 
3516
 
3552
======================================================================
3517
======================================================================
3553
========= Function 67 - change position/sizes of the window. =========
3518
========= Function 67 - change position/sizes of the window. =========
3554
======================================================================
3519
======================================================================
3555
Parameters:
3520
Parameters:
3556
  * eax = 67 - function number
3521
  * eax = 67 - function number
3557
  * ebx = new x-coordinate of the window
3522
  * ebx = new x-coordinate of the window
3558
  * ecx = new y-coordinate of the window
3523
  * ecx = new y-coordinate of the window
3559
  * edx = new x-size of the window
3524
  * edx = new x-size of the window
3560
  * esi = new y-size of the window
3525
  * esi = new y-size of the window
3561
Returned value:
3526
Returned value:
3562
  * function does not return value
3527
  * function does not return value
3563
Remarks:
3528
Remarks:
3564
  * The value -1 for a parameter means "do not change"; e.g. to move
3529
  * The value -1 for a parameter means "do not change"; e.g. to move
3565
    the window without resizing it is possible to specify edx=esi=-1.
3530
    the window without resizing it is possible to specify edx=esi=-1.
3566
  * Previously the window must be defined by function 0.
3531
  * Previously the window must be defined by function 0.
3567
    It sets initial coordinates and sizes of the window.
3532
    It sets initial coordinates and sizes of the window.
3568
  * Sizes of the window are understood in sense of function 0,
3533
  * Sizes of the window are understood in sense of function 0,
3569
    that is one pixel less than real sizes.
3534
    that is one pixel less than real sizes.
3570
  * The function call for maximized windows is simply ignored.
3535
  * The function call for maximized windows is simply ignored.
3571
  * For windows of appropriate styles position and/or sizes can be
3536
  * For windows of appropriate styles position and/or sizes can be
3572
    changed by user; current position and sizes can be obtained by
3537
    changed by user; current position and sizes can be obtained by
3573
    call to function 9.
3538
    call to function 9.
3574
  * The function sends to the window redraw event (with the code 1).
3539
  * The function sends to the window redraw event (with the code 1).
3575
 
3540
 
3576
======================================================================
3541
======================================================================
3577
====== Function 68, subfunction 0 - get the task switch counter. =====
3542
====== Function 68, subfunction 0 - get the task switch counter. =====
3578
======================================================================
3543
======================================================================
3579
Parameters:
3544
Parameters:
3580
  * eax = 68 - function number
3545
  * eax = 68 - function number
3581
  * ebx = 0 - subfunction number
3546
  * ebx = 0 - subfunction number
3582
Returned value:
3547
Returned value:
3583
  * eax = number of task switches from the system booting
3548
  * eax = number of task switches from the system booting
3584
    (modulo 2^32)
3549
    (modulo 2^32)
3585
 
3550
 
3586
======================================================================
3551
======================================================================
3587
======= Function 68, subfunction 1 - switch to the next thread. ======
3552
======= Function 68, subfunction 1 - switch to the next thread. ======
3588
======================================================================
3553
======================================================================
3589
The function completes the current time slice allocated to the
3554
The function completes the current time slice allocated to the
3590
thread and switches to the next. (Which thread in which process
3555
thread and switches to the next. (Which thread in which process
3591
will be next, is unpredictable). Later, when execution queue
3556
will be next, is unpredictable). Later, when execution queue
3592
will reach the current thread, execution will be continued.
3557
will reach the current thread, execution will be continued.
3593
Parameters:
3558
Parameters:
3594
  * eax = 68 - function number
3559
  * eax = 68 - function number
3595
  * ebx = 1 - subfunction number
3560
  * ebx = 1 - subfunction number
3596
Returned value:
3561
Returned value:
3597
  * function does not return value
3562
  * function does not return value
3598
 
3563
 
3599
======================================================================
3564
======================================================================
3600
============= Function 68, subfunction 2 - cache + rdpmc. ============
3565
============= Function 68, subfunction 2 - cache + rdpmc. ============
3601
======================================================================
3566
======================================================================
3602
Parameters:
3567
Parameters:
3603
  * eax = 68 - function number
3568
  * eax = 68 - function number
3604
  * ebx = 2 - subfunction number
3569
  * ebx = 2 - subfunction number
3605
  * ecx = required action:
3570
  * ecx = required action:
3606
    * ecx = 0 - enable instruction 'rdpmc'
3571
    * ecx = 0 - enable instruction 'rdpmc'
3607
      (ReaD Performance-Monitoring Counters) for applications
3572
      (ReaD Performance-Monitoring Counters) for applications
3608
    * ecx = 1 - find out whether cache is disabled/enabled
3573
    * ecx = 1 - find out whether cache is disabled/enabled
3609
    * ecx = 2 - enable cache
3574
    * ecx = 2 - enable cache
3610
    * ecx = 3 - disable cache
3575
    * ecx = 3 - disable cache
3611
Returned value:
3576
Returned value:
3612
  * for ecx=0:
3577
  * for ecx=0:
3613
    * eax = the value of cr4
3578
    * eax = the value of cr4
3614
  * for ecx=1:
3579
  * for ecx=1:
3615
    * eax = (cr0 and 0x60000000):
3580
    * eax = (cr0 and 0x60000000):
3616
    * eax = 0 - cache is on
3581
    * eax = 0 - cache is on
3617
    * eax <> 0 - cache is off
3582
    * eax <> 0 - cache is off
3618
  * for ecx=2 and ecx=3:
3583
  * for ecx=2 and ecx=3:
3619
    * function does not return value
3584
    * function does not return value
3620
 
3585
 
3621
======================================================================
3586
======================================================================
3622
=========== Function 68, subfunction 3 - read MSR-register. ==========
3587
=========== Function 68, subfunction 3 - read MSR-register. ==========
3623
======================================================================
3588
======================================================================
3624
MSR = Model Specific Register; the complete list of MSR-registers
3589
MSR = Model Specific Register; the complete list of MSR-registers
3625
of a processor is included to the documentation on it (for example,
3590
of a processor is included to the documentation on it (for example,
3626
IA-32 Intel Architecture Software Developer's Manual,
3591
IA-32 Intel Architecture Software Developer's Manual,
3627
Volume 3, Appendix B); each processor family has its own subset
3592
Volume 3, Appendix B); each processor family has its own subset
3628
of the MSR-registers.
3593
of the MSR-registers.
3629
Parameters:
3594
Parameters:
3630
  * eax = 68 - function number
3595
  * eax = 68 - function number
3631
  * ebx = 3 - subfunction number
3596
  * ebx = 3 - subfunction number
3632
  * ecx is ignored
3597
  * ecx is ignored
3633
  * edx = MSR address
3598
  * edx = MSR address
3634
Returned value:
3599
Returned value:
3635
  * ebx:eax = high:low dword of the result
3600
  * ebx:eax = high:low dword of the result
3636
Remarks:
3601
Remarks:
3637
  * If ecx contains nonexistent or not implemented for this processor
3602
  * If ecx contains nonexistent or not implemented for this processor
3638
    MSR, processor will generate an exception in the kernel, which
3603
    MSR, processor will generate an exception in the kernel, which
3639
    will kill the thread.
3604
    will kill the thread.
3640
  * Previously it is necessary to check, whether MSRs are supported
3605
  * Previously it is necessary to check, whether MSRs are supported
3641
    as a whole, with the instruction 'cpuid'. Otherwise processor
3606
    as a whole, with the instruction 'cpuid'. Otherwise processor
3642
    will generate other exception in the kernel, which will anyway
3607
    will generate other exception in the kernel, which will anyway
3643
    kill the thread.
3608
    kill the thread.
3644
 
3609
 
3645
======================================================================
3610
======================================================================
3646
========= Function 68, subfunction 4 - write to MSR-register. ========
3611
========= Function 68, subfunction 4 - write to MSR-register. ========
3647
======================================================================
3612
======================================================================
3648
MSR = Model Specific Register; the complete list of MSR-registers
3613
MSR = Model Specific Register; the complete list of MSR-registers
3649
of a processor is included to the documentation on it (for example,
3614
of a processor is included to the documentation on it (for example,
3650
IA-32 Intel Architecture Software Developer's Manual,
3615
IA-32 Intel Architecture Software Developer's Manual,
3651
Volume 3, Appendix B); each processor family has its own subset
3616
Volume 3, Appendix B); each processor family has its own subset
3652
of the MSR-registers.
3617
of the MSR-registers.
3653
Parameters:
3618
Parameters:
3654
  * eax = 68 - function number
3619
  * eax = 68 - function number
3655
  * ebx = 4 - subfunction number
3620
  * ebx = 4 - subfunction number
3656
  * ecx is ignored
3621
  * ecx is ignored
3657
  * edx = MSR address
3622
  * edx = MSR address
3658
  * esi:edi = high:low dword
3623
  * esi:edi = high:low dword
3659
Returned value:
3624
Returned value:
3660
  * ebx:eax = copy of esi:edi
3625
  * ebx:eax = copy of esi:edi
3661
Çàìå÷àíèÿ:
3626
Çàìå÷àíèÿ:
3662
  * If ecx contains nonexistent or not implemented for this processor
3627
  * If ecx contains nonexistent or not implemented for this processor
3663
    MSR, processor will generate an exception in the kernel, which
3628
    MSR, processor will generate an exception in the kernel, which
3664
    will kill the thread.
3629
    will kill the thread.
3665
  * Previously it is necessary to check, whether MSRs are supported
3630
  * Previously it is necessary to check, whether MSRs are supported
3666
    as a whole, with the instruction 'cpuid'. Otherwise processor
3631
    as a whole, with the instruction 'cpuid'. Otherwise processor
3667
    will generate other exception in the kernel, which will anyway
3632
    will generate other exception in the kernel, which will anyway
3668
    kill the thread.
3633
    kill the thread.
3669
 
3634
 
3670
======================================================================
3635
======================================================================
3671
======= Function 68, subfunction 11 - initialize process heap. =======
3636
======= Function 68, subfunction 11 - initialize process heap. =======
3672
======================================================================
3637
======================================================================
3673
Parameters:
3638
Parameters:
3674
  * eax = 68 - function number
3639
  * eax = 68 - function number
3675
  * ebx = 11 - subfunction number
3640
  * ebx = 11 - subfunction number
3676
Returned value:
3641
Returned value:
3677
  * eax = 0 - failed
3642
  * eax = 0 - failed
3678
  * otherwise size of created heap
3643
  * otherwise size of created heap
3679
Remarks:
3644
Remarks:
3680
  * The function call initializes heap, from which one can in future
3645
  * The function call initializes heap, from which one can in future
3681
    allocate and free memory blocks with subfunctions 12 and 13.
3646
    allocate and free memory blocks with subfunctions 12 and 13.
3682
    Heap size is equal to total amount of free application memory.
3647
    Heap size is equal to total amount of free application memory.
3683
  * The second function call from the same process results in
3648
  * The second function call from the same process results in
3684
    returning the size of the existing heap.
3649
    returning the size of the existing heap.
3685
  * After creation of the heap calls to function 64 will be ignored.
3650
  * After creation of the heap calls to function 64 will be ignored.
3686
 
3651
 
3687
======================================================================
3652
======================================================================
3688
======== Function 68, subfunction 12 - allocate memory block. ========
3653
======== Function 68, subfunction 12 - allocate memory block. ========
3689
======================================================================
3654
======================================================================
3690
Parameters:
3655
Parameters:
3691
  * eax = 68 - function number
3656
  * eax = 68 - function number
3692
  * ebx = 12 - subfunction number
3657
  * ebx = 12 - subfunction number
3693
  * ecx = required size in bytes
3658
  * ecx = required size in bytes
3694
Returned value:
3659
Returned value:
3695
  * eax = pointer to the allocated block
3660
  * eax = pointer to the allocated block
3696
Remarks:
3661
Remarks:
3697
  * Before this call one must initialize process heap by call to
3662
  * Before this call one must initialize process heap by call to
3698
    subfunction 11.
3663
    subfunction 11.
3699
  * The function allocates an integer number of pages (4 Kb) in such
3664
  * The function allocates an integer number of pages (4 Kb) in such
3700
    way that the real size of allocated block is more than or equal to
3665
    way that the real size of allocated block is more than or equal to
3701
    requested size.
3666
    requested size.
3702
 
3667
 
3703
======================================================================
3668
======================================================================
3704
========== Function 68, subfunction 13 - free memory block. ==========
3669
========== Function 68, subfunction 13 - free memory block. ==========
3705
======================================================================
3670
======================================================================
3706
Parameters:
3671
Parameters:
3707
  * eax = 68 - function number
3672
  * eax = 68 - function number
3708
  * ebx = 13 - subfunction number
3673
  * ebx = 13 - subfunction number
3709
  * ecx = pointer to the memory block
3674
  * ecx = pointer to the memory block
3710
Returned value:
3675
Returned value:
3711
  * eax = 1 - success
3676
  * eax = 1 - success
3712
  * eax = 0 - failed
3677
  * eax = 0 - failed
3713
Remarks:
3678
Remarks:
3714
  * The memory block must have been allocated by subfunction 12.
3679
  * The memory block must have been allocated by subfunction 12.
3715
 
3680
 
3716
======================================================================
3681
======================================================================
3717
======== Function 68, subfunction 14 - wait for driver notify. =======
3682
======== Function 68, subfunction 14 - wait for driver notify. =======
3718
======================================================================
3683
======================================================================
3719
Parameters:
3684
Parameters:
3720
  * eax = 68 - function number
3685
  * eax = 68 - function number
3721
  * ebx = 14 - subfunction number
3686
  * ebx = 14 - subfunction number
3722
  * ecx = pointer to the buffer for information (8 bytes)
3687
  * ecx = pointer to the buffer for information (8 bytes)
3723
Returned value:
3688
Returned value:
3724
  * buffer pointed to by ecx contains the following information:
3689
  * buffer pointed to by ecx contains the following information:
3725
    * +0: dword: constant EV_INTR = 1
3690
    * +0: dword: constant EV_INTR = 1
3726
    * +4: dword: driver data
3691
    * +4: dword: driver data
3727
Remarks:
3692
Remarks:
3728
  * The current implementation at wait time uses "heavy" operations
3693
  * The current implementation at wait time uses "heavy" operations
3729
    of task switch.
3694
    of task switch.
3730
 
3695
 
3731
======================================================================
3696
======================================================================
3732
====== Function 68, subfunction 15 - set FPU exception handler. ======
3697
====== Function 68, subfunction 15 - set FPU exception handler. ======
3733
======================================================================
3698
======================================================================
3734
Parameters:
3699
Parameters:
3735
  * eax = 68 - function number
3700
  * eax = 68 - function number
3736
  * ebx = 15 - subfunction number
3701
  * ebx = 15 - subfunction number
3737
  * ecx = address of the new exception handler
3702
  * ecx = address of the new exception handler
3738
Returned value:
3703
Returned value:
3739
  * eax = address of the old exception handler (0, if it was not set)
3704
  * eax = address of the old exception handler (0, if it was not set)
3740
 
3705
 
3741
======================================================================
3706
======================================================================
3742
============= Function 68, subfunction 16 - load driver. =============
3707
============= Function 68, subfunction 16 - load driver. =============
3743
======================================================================
3708
======================================================================
3744
Parameters:
3709
Parameters:
3745
  * eax = 68 - function number
3710
  * eax = 68 - function number
3746
  * ebx = 16 - subfunction number
3711
  * ebx = 16 - subfunction number
3747
  * ecx = pointer to ASCIIZ-string with driver name
3712
  * ecx = pointer to ASCIIZ-string with driver name
3748
Returned value:
3713
Returned value:
3749
  * eax = 0 - failed
3714
  * eax = 0 - failed
3750
  * otherwise eax = driver handle
3715
  * otherwise eax = driver handle
3751
Remarks:
3716
Remarks:
3752
  * If the driver was not loaded yet, it is loaded;
3717
  * If the driver was not loaded yet, it is loaded;
3753
    if the driver was loaded yet, nothing happens.
3718
    if the driver was loaded yet, nothing happens.
3754
  * Driver name is case-sensitive.
3719
  * Driver name is case-sensitive.
3755
    Maximum length of the name is 16 characters, including
3720
    Maximum length of the name is 16 characters, including
3756
    terminating null character, the rest is ignored.
3721
    terminating null character, the rest is ignored.
3757
  * The function can load only drivers which are registered in the
3722
  * The function can load only drivers which are registered in the
3758
    system; the current implementation contains
3723
    system; the current implementation contains
3759
    exactly 2 such drivers:
3724
    exactly 2 such drivers:
3760
    * name SOUND, file /rd/1/unisound.obj
3725
    * name SOUND, file /rd/1/drivers/unisound.obj
3761
    * name INFINITY, file /rd/1/infinity.obj
3726
    * name INFINITY, file /rd/1/drivers/infinity.obj
3762
 
3727
 
3763
======================================================================
3728
======================================================================
3764
============ Function 68, subfunction 17 - driver control. ===========
3729
============ Function 68, subfunction 17 - driver control. ===========
3765
======================================================================
3730
======================================================================
3766
Parameters:
3731
Parameters:
3767
  * eax = 68 - function number
3732
  * eax = 68 - function number
3768
  * ebx = 17 - subfunction number
3733
  * ebx = 17 - subfunction number
3769
  * ecx = pointer to the control structure:
3734
  * ecx = pointer to the control structure:
3770
    * +0: dword: handle of driver
3735
    * +0: dword: handle of driver
3771
    * +4: dword: code of driver function
3736
    * +4: dword: code of driver function
3772
    * +8: dword: pointer to input data
3737
    * +8: dword: pointer to input data
3773
    * +12 = +0xC: dword: size of input data
3738
    * +12 = +0xC: dword: size of input data
3774
    * +16 = +0x10: dword: pointer to output data
3739
    * +16 = +0x10: dword: pointer to output data
3775
    * +20 = +0x14: dword: size of output data
3740
    * +20 = +0x14: dword: size of output data
3776
Returned value:
3741
Returned value:
3777
  * eax = determined by driver
3742
  * eax = determined by driver
3778
Remarks:
3743
Remarks:
3779
  * Function codes and the structure of input/output data
3744
  * Function codes and the structure of input/output data
3780
    are defined by driver.
3745
    are defined by driver.
3781
  * Previously one must obtain driver handle by subfunction 16.
3746
  * Previously one must obtain driver handle by subfunction 16.
3782
 
3747
 
3783
======================================================================
3748
======================================================================
3784
====== Function 68, subfunction 18 - set SSE exception handler. ======
3749
====== Function 68, subfunction 18 - set SSE exception handler. ======
3785
======================================================================
3750
======================================================================
3786
Parameters:
3751
Parameters:
3787
  * eax = 68 - function number
3752
  * eax = 68 - function number
3788
  * ebx = 15 - subfunction number
3753
  * ebx = 15 - subfunction number
3789
  * ecx = address of the new exception handler
3754
  * ecx = address of the new exception handler
3790
Returned value:
3755
Returned value:
3791
  * eax = address of the old exception handler (0, if it was not set)
3756
  * eax = address of the old exception handler (0, if it was not set)
-
 
3757
 
-
 
3758
======================================================================
-
 
3759
=============== Function 68, subfunction 19 - load DLL. ==============
-
 
3760
======================================================================
-
 
3761
Parameters:
-
 
3762
  * eax = 68 - function number
-
 
3763
  * ebx = 19 - subfunction number
-
 
3764
  * ecx = pointer to ASCIIZ-string with the full path to DLL
-
 
3765
Returned value:
-
 
3766
  * eax = 0 - failed
-
 
3767
  * otherwise eax = pointer to DLL export table
-
 
3768
Remarks:
-
 
3769
  * Export table is an array of structures of 2 dword's, terminated
-
 
3770
    by zero. The first dword in structure points to function name,
-
 
3771
    the second dword contains address of function.
3792
 
3772
 
3793
======================================================================
3773
======================================================================
3794
====================== Fucntion 69 - debugging. ======================
3774
====================== Fucntion 69 - debugging. ======================
3795
======================================================================
3775
======================================================================
3796
A process can load other process as debugged by set of corresponding
3776
A process can load other process as debugged by set of corresponding
3797
bit by call to subfunction 7 of function 70.
3777
bit by call to subfunction 7 of function 70.
3798
A process can have only one debugger; one process can debug some
3778
A process can have only one debugger; one process can debug some
3799
others. The system notifies debugger on events occuring with
3779
others. The system notifies debugger on events occuring with
3800
debugged process. Messages are written to the buffer defined by
3780
debugged process. Messages are written to the buffer defined by
3801
subfunction 0.
3781
subfunction 0.
3802
Format of a message:
3782
Format of a message:
3803
  * +0: dword: message code
3783
  * +0: dword: message code
3804
  * +4: dword: PID of debugged process
3784
  * +4: dword: PID of debugged process
3805
  * +8: there can be additional data depending on message code
3785
  * +8: there can be additional data depending on message code
3806
Message codes:
3786
Message codes:
3807
  * 1 = exception
3787
  * 1 = exception
3808
    * in addition dword-number of the exception is given
3788
    * in addition dword-number of the exception is given
3809
    * process is suspended
3789
    * process is suspended
3810
  * 2 = process has terminated
3790
  * 2 = process has terminated
3811
    * comes at any termination: both through the system function -1,
3791
    * comes at any termination: both through the system function -1,
3812
      and at "murder" by any other process (including debugger itself)
3792
      and at "murder" by any other process (including debugger itself)
3813
  * 3 = debug exception int 1 = #DB
3793
  * 3 = debug exception int 1 = #DB
3814
    * in addition dword-image of the register DR6 is given:
3794
    * in addition dword-image of the register DR6 is given:
3815
      * bits 0-3: condition of the corresponding breakpoint (set by
3795
      * bits 0-3: condition of the corresponding breakpoint (set by
3816
        subfunction 9) is satisfied
3796
        subfunction 9) is satisfied
3817
      * áèò 14: exception has occured because of the trace mode
3797
      * áèò 14: exception has occured because of the trace mode
3818
        (flag TF is set TF)
3798
        (flag TF is set TF)
3819
    * process is suspended
3799
    * process is suspended
3820
When debugger terminates, all debugged processes are killed.
3800
When debugger terminates, all debugged processes are killed.
3821
If debugger does not want this, it must previously detach by
3801
If debugger does not want this, it must previously detach by
3822
subfunction 3.
3802
subfunction 3.
3823
 
3803
 
3824
All subfunctions are applicable only to processes/threads started
3804
All subfunctions are applicable only to processes/threads started
3825
from the current by function 58 or 70 with set debugging flag.
3805
from the current by function 58 or 70 with set debugging flag.
3826
Debugging of multithreaded programs is not supported yet.
3806
Debugging of multithreaded programs is not supported yet.
3827
The full list of subfunctions:
3807
The full list of subfunctions:
3828
  * subfunction 0 - define data area for debug messages
3808
  * subfunction 0 - define data area for debug messages
3829
  * subfunction 1 - get contents of registers of debugged thread
3809
  * subfunction 1 - get contents of registers of debugged thread
3830
  * subfunction 2 - set contents of registers of debugged thread
3810
  * subfunction 2 - set contents of registers of debugged thread
3831
  * subfunction 3 - detach from debugged process
3811
  * subfunction 3 - detach from debugged process
3832
  * subfunction 4 - suspend debugged thread
3812
  * subfunction 4 - suspend debugged thread
3833
  * subfunction 5 - resume debugged thread
3813
  * subfunction 5 - resume debugged thread
3834
  * subfunction 6 - read from the memory of debugged process
3814
  * subfunction 6 - read from the memory of debugged process
3835
  * subfunction 7 - write to the memory of debugged process
3815
  * subfunction 7 - write to the memory of debugged process
3836
  * subfunction 8 - terminate debugged thread
3816
  * subfunction 8 - terminate debugged thread
3837
  * subfunction 9 - set/clear hardware breakpoint
3817
  * subfunction 9 - set/clear hardware breakpoint
3838
 
3818
 
3839
======================================================================
3819
======================================================================
3840
= Function 69, subfunction 0 - define data area fror debug messages. =
3820
= Function 69, subfunction 0 - define data area fror debug messages. =
3841
======================================================================
3821
======================================================================
3842
Parameters:
3822
Parameters:
3843
  * eax = 69 - function number
3823
  * eax = 69 - function number
3844
  * ebx = 0 - subfunction number
3824
  * ebx = 0 - subfunction number
3845
  * ecx = pointer
3825
  * ecx = pointer
3846
Format of data area:
3826
Format of data area:
3847
  * +0: dword: N = buffer size (not including this header)
3827
  * +0: dword: N = buffer size (not including this header)
3848
  * +4: dword: occupied place
3828
  * +4: dword: occupied place
3849
  * +8: N*byte: buffer
3829
  * +8: N*byte: buffer
3850
Returned value:
3830
Returned value:
3851
  * function does not return value
3831
  * function does not return value
3852
Remarks:
3832
Remarks:
3853
  * If the size field is negative, the buffer is considered locked
3833
  * If the size field is negative, the buffer is considered locked
3854
    and at arrival of new message the system will wait.
3834
    and at arrival of new message the system will wait.
3855
    For synchronization frame all work with the buffer by operations
3835
    For synchronization frame all work with the buffer by operations
3856
    lock/unlock
3836
    lock/unlock
3857
    	neg	[bufsize]
3837
    	neg	[bufsize]
3858
  * Data in the buffer are considered as array of items with variable
3838
  * Data in the buffer are considered as array of items with variable
3859
    length - messages. Format of a message is explained in
3839
    length - messages. Format of a message is explained in
3860
    general description.
3840
    general description.
3861
 
3841
 
3862
======================================================================
3842
======================================================================
3863
===================== Function 69, subfunction 1 =====================
3843
===================== Function 69, subfunction 1 =====================
3864
============ Get contents of registers of debugged thread. ===========
3844
============ Get contents of registers of debugged thread. ===========
3865
======================================================================
3845
======================================================================
3866
Parameters:
3846
Parameters:
3867
  * eax = 69 - function number
3847
  * eax = 69 - function number
3868
  * ebx = 1 - subfunction number
3848
  * ebx = 1 - subfunction number
3869
  * ecx = thread identifier
3849
  * ecx = thread identifier
3870
  * edx = size of context structure, must be 0x28=40 bytes
3850
  * edx = size of context structure, must be 0x28=40 bytes
3871
  * esi = pointer to context structure
3851
  * esi = pointer to context structure
3872
Returned value:
3852
Returned value:
3873
  * function does not return value
3853
  * function does not return value
3874
Format of context structure: (FPU is not supported yet)
3854
Format of context structure: (FPU is not supported yet)
3875
  * +0: dword: eip
3855
  * +0: dword: eip
3876
  * +4: dword: eflags
3856
  * +4: dword: eflags
3877
  * +8: dword: eax
3857
  * +8: dword: eax
3878
  * +12 = +0xC: dword: ecx
3858
  * +12 = +0xC: dword: ecx
3879
  * +16 = +0x10: dword: edx
3859
  * +16 = +0x10: dword: edx
3880
  * +20 = +0x14: dword: ebx
3860
  * +20 = +0x14: dword: ebx
3881
  * +24 = +0x18: dword: esp
3861
  * +24 = +0x18: dword: esp
3882
  * +28 = +0x1C: dword: ebp
3862
  * +28 = +0x1C: dword: ebp
3883
  * +32 = +0x20: dword: esi
3863
  * +32 = +0x20: dword: esi
3884
  * +36 = +0x24: dword: edi
3864
  * +36 = +0x24: dword: edi
3885
Remarks:
3865
Remarks:
3886
  * If the thread executes code of ring-0, the function returns
3866
  * If the thread executes code of ring-0, the function returns
3887
    contents of registers of ring-3.
3867
    contents of registers of ring-3.
3888
  * Process must be loaded for debugging (as is shown in
3868
  * Process must be loaded for debugging (as is shown in
3889
    general description).
3869
    general description).
3890
 
3870
 
3891
======================================================================
3871
======================================================================
3892
===================== Function 69, subfunction 2 =====================
3872
===================== Function 69, subfunction 2 =====================
3893
============ Set contents of registers of debugged thread. ===========
3873
============ Set contents of registers of debugged thread. ===========
3894
======================================================================
3874
======================================================================
3895
Parameters:
3875
Parameters:
3896
  * eax = 69 - function number
3876
  * eax = 69 - function number
3897
  * ebx = 2 - subfunction number
3877
  * ebx = 2 - subfunction number
3898
  * ecx = thread identifier
3878
  * ecx = thread identifier
3899
  * edx = size of context structure, must be 0x28=40 bytes
3879
  * edx = size of context structure, must be 0x28=40 bytes
3900
Returned value:
3880
Returned value:
3901
  * function does not return value
3881
  * function does not return value
3902
Format of context structure is shown in the description of
3882
Format of context structure is shown in the description of
3903
subfunction 1.
3883
subfunction 1.
3904
Remarks:
3884
Remarks:
3905
  * If the thread executes code of ring-0, the function returns
3885
  * If the thread executes code of ring-0, the function returns
3906
    contents of registers of ring-3.
3886
    contents of registers of ring-3.
3907
  * Process must be loaded for debugging (as is shown in
3887
  * Process must be loaded for debugging (as is shown in
3908
    general description).
3888
    general description).
3909
 
3889
 
3910
======================================================================
3890
======================================================================
3911
===== Function 69, subfunction 3 - detach from debugged process. =====
3891
===== Function 69, subfunction 3 - detach from debugged process. =====
3912
======================================================================
3892
======================================================================
3913
Parameters:
3893
Parameters:
3914
  * eax = 69 - function number
3894
  * eax = 69 - function number
3915
  * ebx = 3 - subfunction number
3895
  * ebx = 3 - subfunction number
3916
  * ecx = identifier
3896
  * ecx = identifier
3917
Returned value:
3897
Returned value:
3918
  * function does not return value
3898
  * function does not return value
3919
Remarks:
3899
Remarks:
3920
  * If the process was suspended, it resumes execution.
3900
  * If the process was suspended, it resumes execution.
3921
 
3901
 
3922
======================================================================
3902
======================================================================
3923
======== Function 69, subfunction 4 - suspend debugged thread. =======
3903
======== Function 69, subfunction 4 - suspend debugged thread. =======
3924
======================================================================
3904
======================================================================
3925
Parameters:
3905
Parameters:
3926
  * eax = 69 - function number
3906
  * eax = 69 - function number
3927
  * ebx = 4 - subfunction number
3907
  * ebx = 4 - subfunction number
3928
  * ecx = thread identifier
3908
  * ecx = thread identifier
3929
Returned value:
3909
Returned value:
3930
  * function does not return value
3910
  * function does not return value
3931
Remarks:
3911
Remarks:
3932
  * Process must be loaded for debugging (as is shown in
3912
  * Process must be loaded for debugging (as is shown in
3933
    general description).
3913
    general description).
3934
 
3914
 
3935
======================================================================
3915
======================================================================
3936
======== Function 69, subfunction 5 - resume debugged thread. ========
3916
======== Function 69, subfunction 5 - resume debugged thread. ========
3937
======================================================================
3917
======================================================================
3938
Parameters:
3918
Parameters:
3939
  * eax = 69 - function number
3919
  * eax = 69 - function number
3940
  * ebx = 5 - subfunction number
3920
  * ebx = 5 - subfunction number
3941
  * ecx = thread identifier
3921
  * ecx = thread identifier
3942
Returned value:
3922
Returned value:
3943
  * function does not return value
3923
  * function does not return value
3944
Remarks:
3924
Remarks:
3945
  * Process must be loaded for debugging (as is shown in
3925
  * Process must be loaded for debugging (as is shown in
3946
    general description).
3926
    general description).
3947
 
3927
 
3948
======================================================================
3928
======================================================================
3949
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3929
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3950
======================================================================
3930
======================================================================
3951
Parameters:
3931
Parameters:
3952
  * eax = 69 - function number
3932
  * eax = 69 - function number
3953
  * ebx = 6 - subfunction number
3933
  * ebx = 6 - subfunction number
3954
  * ecx = identifier
3934
  * ecx = identifier
3955
  * edx = number of bytes to read
3935
  * edx = number of bytes to read
3956
  * esi = address in the memory of debugged process
3936
  * esi = address in the memory of debugged process
3957
  * edi = pointer to buffer for data
3937
  * edi = pointer to buffer for data
3958
Returned value:
3938
Returned value:
3959
  * eax = -1 at an error (invalid PID or buffer)
3939
  * eax = -1 at an error (invalid PID or buffer)
3960
  * otherwise eax = number of read bytes (possibly, 0,
3940
  * otherwise eax = number of read bytes (possibly, 0,
3961
    if esi is too large)
3941
    if esi is too large)
3962
Remarks:
3942
Remarks:
3963
  * Process must be loaded for debugging (as is shown in
3943
  * Process must be loaded for debugging (as is shown in
3964
    general description).
3944
    general description).
3965
 
3945
 
3966
======================================================================
3946
======================================================================
3967
== Function 69, subfunction 7 - write to memory of debugged process. =
3947
== Function 69, subfunction 7 - write to memory of debugged process. =
3968
======================================================================
3948
======================================================================
3969
Parameters:
3949
Parameters:
3970
  * eax = 69 - function number
3950
  * eax = 69 - function number
3971
  * ebx = 7 - subfunction number
3951
  * ebx = 7 - subfunction number
3972
  * ecx = identifier
3952
  * ecx = identifier
3973
  * edx = number of bytes to write
3953
  * edx = number of bytes to write
3974
  * esi = address of memory in debugged process
3954
  * esi = address of memory in debugged process
3975
  * edi = pointer to data
3955
  * edi = pointer to data
3976
Returned value:
3956
Returned value:
3977
  * eax = -1 at an error (invalid PID or buffer)
3957
  * eax = -1 at an error (invalid PID or buffer)
3978
  * otherwise eax = number of written bytes (possibly, 0,
3958
  * otherwise eax = number of written bytes (possibly, 0,
3979
    if esi is too large)
3959
    if esi is too large)
3980
Remarks:
3960
Remarks:
3981
  * Process must be loaded for debugging (as is shown in
3961
  * Process must be loaded for debugging (as is shown in
3982
    general description).
3962
    general description).
3983
 
3963
 
3984
======================================================================
3964
======================================================================
3985
======= Function 69, subfunction 8 - terminate debugged thread. ======
3965
======= Function 69, subfunction 8 - terminate debugged thread. ======
3986
======================================================================
3966
======================================================================
3987
Parameters:
3967
Parameters:
3988
  * eax = 69 - function number
3968
  * eax = 69 - function number
3989
  * ebx = 8 - subfunction number
3969
  * ebx = 8 - subfunction number
3990
  * ecx = identifier
3970
  * ecx = identifier
3991
Returned value:
3971
Returned value:
3992
  * function does not return value
3972
  * function does not return value
3993
Remarks:
3973
Remarks:
3994
  * Process must be loaded for debugging (as is shown in
3974
  * Process must be loaded for debugging (as is shown in
3995
    general description).
3975
    general description).
3996
  * The function is similar to subfunction 2 of function 18
3976
  * The function is similar to subfunction 2 of function 18
3997
    with two differences: it requires first remark and
3977
    with two differences: it requires first remark and
3998
    accepts PID rather than slot number.
3978
    accepts PID rather than slot number.
3999
 
3979
 
4000
======================================================================
3980
======================================================================
4001
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3981
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
4002
======================================================================
3982
======================================================================
4003
Parameters:
3983
Parameters:
4004
  * eax = 69 - function number
3984
  * eax = 69 - function number
4005
  * ebx = 9 - subfunction number
3985
  * ebx = 9 - subfunction number
4006
  * ecx = thread identifier
3986
  * ecx = thread identifier
4007
  * dl = index of breakpoint, from 0 to 3 inclusively
3987
  * dl = index of breakpoint, from 0 to 3 inclusively
4008
  * dh = flags:
3988
  * dh = flags:
4009
    * if high bit is cleared - set breakpoint:
3989
    * if high bit is cleared - set breakpoint:
4010
      * bits 0-1 - condition:
3990
      * bits 0-1 - condition:
4011
        * 00 = breakpoint on execution
3991
        * 00 = breakpoint on execution
4012
        * 01 = breakpoint on read
3992
        * 01 = breakpoint on read
4013
        * 11 = breakpoint on read/write
3993
        * 11 = breakpoint on read/write
4014
      * bits 2-3 - length; for breakpoints on exception it must be
3994
      * bits 2-3 - length; for breakpoints on exception it must be
4015
        00, otherwise one of
3995
        00, otherwise one of
4016
        * 00 = byte
3996
        * 00 = byte
4017
        * 01 = word
3997
        * 01 = word
4018
        * 11 = dword
3998
        * 11 = dword
4019
      * esi = breakpoint address; must be aligned according to
3999
      * esi = breakpoint address; must be aligned according to
4020
        the length (i.e. must be even for word breakpoints,
4000
        the length (i.e. must be even for word breakpoints,
4021
        divisible by 4 for dword)
4001
        divisible by 4 for dword)
4022
    * if high bit is set - clear breakpoint
4002
    * if high bit is set - clear breakpoint
4023
Returned value:
4003
Returned value:
4024
  * eax = 0 - success
4004
  * eax = 0 - success
4025
  * eax = 1 - error in the input data
4005
  * eax = 1 - error in the input data
4026
  * eax = 2 - (reserved, is never returned in the current
4006
  * eax = 2 - (reserved, is never returned in the current
4027
    implementation) a global breakpoint with that index is already set
4007
    implementation) a global breakpoint with that index is already set
4028
Remarks:
4008
Remarks:
4029
  * Process must be loaded for debugging (as is shown in
4009
  * Process must be loaded for debugging (as is shown in
4030
    general description).
4010
    general description).
4031
  * Hardware breakpoints are implemented through DRx-registers of
4011
  * Hardware breakpoints are implemented through DRx-registers of
4032
    the processor, all limitations results from this.
4012
    the processor, all limitations results from this.
4033
  * The function can reinstall the breakpoint, previously set
4013
  * The function can reinstall the breakpoint, previously set
4034
    by it (and it does not inform on this).
4014
    by it (and it does not inform on this).
4035
    Carry on the list of set breakpoints in the debugger.
4015
    Carry on the list of set breakpoints in the debugger.
4036
  * Breakpoints generate debug exception #DB, on which the system
4016
  * Breakpoints generate debug exception #DB, on which the system
4037
    notifies debugger.
4017
    notifies debugger.
4038
  * Breakpoints on write and read/write act after
4018
  * Breakpoints on write and read/write act after
4039
    execution of the caused it instruction.
4019
    execution of the caused it instruction.
4040
 
4020
 
4041
======================================================================
4021
======================================================================
4042
==== Function 70 - work with file system with long names support. ====
4022
==== Function 70 - work with file system with long names support. ====
4043
======================================================================
4023
======================================================================
4044
Parameters:
4024
Parameters:
4045
  * eax = 70
4025
  * eax = 70
4046
  * ebx = pointer to the information structure
4026
  * ebx = pointer to the information structure
4047
Returned value:
4027
Returned value:
4048
  * eax = 0 - success; otherwise file system error code
4028
  * eax = 0 - success; otherwise file system error code
4049
  * some subfunctions return value in other registers too
4029
  * some subfunctions return value in other registers too
4050
General format of the information structure:
4030
General format of the information structure:
4051
  * +0: dword: subfunction number
4031
  * +0: dword: subfunction number
4052
  * +4: dword: file offset
4032
  * +4: dword: file offset
4053
  * +8: dword: high dword of offset (must be 0) or flags field
4033
  * +8: dword: high dword of offset (must be 0) or flags field
4054
  * +12 = +0xC: dword: size
4034
  * +12 = +0xC: dword: size
4055
  * +16 = +0x10: dword: pointer to data
4035
  * +16 = +0x10: dword: pointer to data
4056
  * +20 = +0x14: n db: ASCIIZ-string with the filename
4036
  * +20 = +0x14: n db: ASCIIZ-string with the filename
4057
    or
4037
    or
4058
  * +20 = +0x14: db 0
4038
  * +20 = +0x14: db 0
4059
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
4039
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
4060
Specifications - in documentation on the appropriate subfunction.
4040
Specifications - in documentation on the appropriate subfunction.
4061
Filename is case-insensitive. Russian letters must be written in
4041
Filename is case-insensitive. Russian letters must be written in
4062
the encoding cp866 (DOS).
4042
the encoding cp866 (DOS).
4063
Format of filename:
4043
Format of filename:
4064
/base/number/dir1/dir2/.../dirn/file,
4044
/base/number/dir1/dir2/.../dirn/file,
4065
where /base/number identifies device, on which file is located:
4045
where /base/number identifies device, on which file is located:
4066
one of
4046
one of
4067
  * /RD/1 = /RAMDISK/1 to access ramdisk
4047
  * /RD/1 = /RAMDISK/1 to access ramdisk
4068
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
4048
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
4069
    /FD/2 = /FLOPPYDISK/2 to access second one
4049
    /FD/2 = /FLOPPYDISK/2 to access second one
4070
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
4050
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
4071
    IDE0 (Primary Master), IDE1 (Primary Slave),
4051
    IDE0 (Primary Master), IDE1 (Primary Slave),
4072
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
4052
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
4073
    x - partition number on the selected hard drive, varies from 1
4053
    x - partition number on the selected hard drive, varies from 1
4074
    to 255 (on each hard drive the indexing starts from 1)
4054
    to 255 (on each hard drive the indexing starts from 1)
4075
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
4055
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
4076
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
4056
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
4077
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
4057
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
4078
Examples:
4058
Examples:
4079
  * '/rd/1/kernel.asm',0
4059
  * '/rd/1/kernel.asm',0
4080
  * '/HD0/1/kernel.asm',0
4060
  * '/HD0/1/kernel.asm',0
4081
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4061
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4082
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4062
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4083
Available subfunctions:
4063
Available subfunctions:
4084
  * subfunction 0 - read file
4064
  * subfunction 0 - read file
4085
  * subfunction 1 - read folder
4065
  * subfunction 1 - read folder
4086
  * subfunction 2 - create/rewrite file
4066
  * subfunction 2 - create/rewrite file
4087
  * subfunction 3 - write to existing file
4067
  * subfunction 3 - write to existing file
4088
  * subfunction 4 - set file size
4068
  * subfunction 4 - set file size
4089
  * subfunction 5 - get attributes of file/folder
4069
  * subfunction 5 - get attributes of file/folder
4090
  * subfunction 6 - set attributes of file/folder
4070
  * subfunction 6 - set attributes of file/folder
4091
  * subfunction 7 - start application
4071
  * subfunction 7 - start application
4092
  * subfunction 8 - delete file/folder
4072
  * subfunction 8 - delete file/folder
4093
For CD-drives due to hardware limitations only subfunctions
4073
For CD-drives due to hardware limitations only subfunctions
4094
0,1,5 and 7 are available, other subfunctions return error
4074
0,1,5 and 7 are available, other subfunctions return error
4095
with code 2.
4075
with code 2.
4096
 
4076
 
4097
======================================================================
4077
======================================================================
4098
=== Function 70, subfunction 0 - read file with long names support. ==
4078
=== Function 70, subfunction 0 - read file with long names support. ==
4099
======================================================================
4079
======================================================================
4100
Parameters:
4080
Parameters:
4101
  * eax = 70 - function number
4081
  * eax = 70 - function number
4102
  * ebx = pointer to the information structure
4082
  * ebx = pointer to the information structure
4103
Format of the information structure:
4083
Format of the information structure:
4104
  * +0: dword: 0 = subfunction number
4084
  * +0: dword: 0 = subfunction number
4105
  * +4: dword: file offset (in bytes)
4085
  * +4: dword: file offset (in bytes)
4106
  * +8: dword: 0 (reserved for high dword of offset)
4086
  * +8: dword: 0 (reserved for high dword of offset)
4107
  * +12 = +0xC: dword: number of bytes to read
4087
  * +12 = +0xC: dword: number of bytes to read
4108
  * +16 = +0x10: dword: pointer to buffer for data
4088
  * +16 = +0x10: dword: pointer to buffer for data
4109
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4089
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4110
    given in the general description
4090
    given in the general description
4111
    or
4091
    or
4112
  * +20 = +0x14: db 0
4092
  * +20 = +0x14: db 0
4113
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4093
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4114
Returned value:
4094
Returned value:
4115
  * eax = 0 - success, otherwise file system error code
4095
  * eax = 0 - success, otherwise file system error code
4116
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4096
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4117
Remarks:
4097
Remarks:
4118
  * If file was ended before last requested block was read,
4098
  * If file was ended before last requested block was read,
4119
    the function will read as many as it can, and after that return
4099
    the function will read as many as it can, and after that return
4120
    eax=6 (EOF).
4100
    eax=6 (EOF).
4121
  * The function does not allow to read folder (returns eax=10,
4101
  * The function does not allow to read folder (returns eax=10,
4122
    access denied).
4102
    access denied).
4123
 
4103
 
4124
======================================================================
4104
======================================================================
4125
== Function 70, subfunction 1 - read folder with long names support. =
4105
== Function 70, subfunction 1 - read folder with long names support. =
4126
======================================================================
4106
======================================================================
4127
Parameters:
4107
Parameters:
4128
  * eax = 70 - function number
4108
  * eax = 70 - function number
4129
  * ebx = pointer to the information structure
4109
  * ebx = pointer to the information structure
4130
Format of the information structure:
4110
Format of the information structure:
4131
  * +0: dword: 1 = subfunction number
4111
  * +0: dword: 1 = subfunction number
4132
  * +4: dword: index of starting block (beginning from 0)
4112
  * +4: dword: index of starting block (beginning from 0)
4133
  * +8: dword: flags field:
4113
  * +8: dword: flags field:
4134
    * bit 0 (mask 1): in what format to return names,
4114
    * bit 0 (mask 1): in what format to return names,
4135
      0=ANSI, 1=UNICODE
4115
      0=ANSI, 1=UNICODE
4136
    * other bits are reserved and must be set to 0 for the future
4116
    * other bits are reserved and must be set to 0 for the future
4137
      compatibility
4117
      compatibility
4138
  * +12 = +0xC: dword: number of blocks to read
4118
  * +12 = +0xC: dword: number of blocks to read
4139
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4119
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4140
    must be not less than 32 + [+12]*560 bytes
4120
    must be not less than 32 + [+12]*560 bytes
4141
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4121
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4142
    given in the general description
4122
    given in the general description
4143
    or
4123
    or
4144
  * +20 = +0x14: db 0
4124
  * +20 = +0x14: db 0
4145
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4125
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4146
Returned value:
4126
Returned value:
4147
  * eax = 0 - success, otherwise file system error code
4127
  * eax = 0 - success, otherwise file system error code
4148
  * ebx = number of files, information on which was written to
4128
  * ebx = number of files, information on which was written to
4149
    the buffer, or -1=0xffffffff, if folder was not found
4129
    the buffer, or -1=0xffffffff, if folder was not found
4150
Structure of the buffer:
4130
Structure of the buffer:
4151
  * +0: 32*byte: header
4131
  * +0: 32*byte: header
4152
  * +32 = +0x20: n1*byte: block with information on file 1
4132
  * +32 = +0x20: n1*byte: block with information on file 1
4153
  * +32+n1: n2*byte: block with information on file 2
4133
  * +32+n1: n2*byte: block with information on file 2
4154
  * ...
4134
  * ...
4155
Structure of header:
4135
Structure of header:
4156
  * +0: dword: version of structure (current is 1)
4136
  * +0: dword: version of structure (current is 1)
4157
  * +4: dword: number of placed blocks; is not greater than requested
4137
  * +4: dword: number of placed blocks; is not greater than requested
4158
    in the field +12 of information structure; can be less, if
4138
    in the field +12 of information structure; can be less, if
4159
    there are no more files in folder (the same as in ebx)
4139
    there are no more files in folder (the same as in ebx)
4160
  * +8: dword: total number of files in folder
4140
  * +8: dword: total number of files in folder
4161
  * +12 = +0xC: 20*byte: reserved (zeroed)
4141
  * +12 = +0xC: 20*byte: reserved (zeroed)
4162
Structure of block of data for folder entry (BDFE):
4142
Structure of block of data for folder entry (BDFE):
4163
  * +0: dword: attributes of file:
4143
  * +0: dword: attributes of file:
4164
    * bit 0 (mask 1): file is read-only
4144
    * bit 0 (mask 1): file is read-only
4165
    * bit 1 (mask 2): file is hidden
4145
    * bit 1 (mask 2): file is hidden
4166
    * bit 2 (mask 4): file is system
4146
    * bit 2 (mask 4): file is system
4167
    * bit 3 (mask 8): this is not a file but volume label
4147
    * bit 3 (mask 8): this is not a file but volume label
4168
      (for one partition meets no more than once and
4148
      (for one partition meets no more than once and
4169
      only in root folder)
4149
      only in root folder)
4170
    * bit 4 (mask 0x10): this is a folder
4150
    * bit 4 (mask 0x10): this is a folder
4171
    * bit 5 (mask 0x20): file was not archived - many archivation
4151
    * bit 5 (mask 0x20): file was not archived - many archivation
4172
      programs have an option to archive only files with this bit set,
4152
      programs have an option to archive only files with this bit set,
4173
      and after archiving this bit is cleared - it can be useful
4153
      and after archiving this bit is cleared - it can be useful
4174
      for automatically creating of backup-archives as at writing
4154
      for automatically creating of backup-archives as at writing
4175
      this bit is usually set
4155
      this bit is usually set
4176
  * +4: byte: type of name data:
4156
  * +4: byte: type of name data:
4177
    (coincides with bit 0 of flags in the information structure)
4157
    (coincides with bit 0 of flags in the information structure)
4178
    * 0 = ASCII = 1-byte representation of each character
4158
    * 0 = ASCII = 1-byte representation of each character
4179
    * 1 = UNICODE = 2-byte representation of each character
4159
    * 1 = UNICODE = 2-byte representation of each character
4180
  * +5: 3*byte: reserved (zero)
4160
  * +5: 3*byte: reserved (zero)
4181
  * +8: 4*byte: time of file creation
4161
  * +8: 4*byte: time of file creation
4182
  * +12 = +0xC: 4*byte: date of file creation
4162
  * +12 = +0xC: 4*byte: date of file creation
4183
  * +16 = +0x10: 4*byte: time of last access (read or write)
4163
  * +16 = +0x10: 4*byte: time of last access (read or write)
4184
  * +20 = +0x14: 4*byte: date of last access
4164
  * +20 = +0x14: 4*byte: date of last access
4185
  * +24 = +0x18: 4*byte: time of last modification
4165
  * +24 = +0x18: 4*byte: time of last modification
4186
  * +28 = +0x1C: 4*byte: date of last modification
4166
  * +28 = +0x1C: 4*byte: date of last modification
4187
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4167
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4188
  * +40 = +0x28: name
4168
  * +40 = +0x28: name
4189
    * for ASCII format: maximum length is 263 characters
4169
    * for ASCII format: maximum length is 263 characters
4190
      (263 bytes), byte after the name has value 0
4170
      (263 bytes), byte after the name has value 0
4191
    * äëÿ ôîðìàòà UNICODE: maximum length is 259 characters
4171
    * äëÿ ôîðìàòà UNICODE: maximum length is 259 characters
4192
      (518 bytes), 2 bytes after the name have value 0
4172
      (518 bytes), 2 bytes after the name have value 0
4193
Time format:
4173
Time format:
4194
  * +0: byte: seconds
4174
  * +0: byte: seconds
4195
  * +1: byte: minutes
4175
  * +1: byte: minutes
4196
  * +2: byte: hours
4176
  * +2: byte: hours
4197
  * +3: byte: reserved (0)
4177
  * +3: byte: reserved (0)
4198
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4178
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4199
Date format:
4179
Date format:
4200
  * +0: byte: day
4180
  * +0: byte: day
4201
  * +1: byte: month
4181
  * +1: byte: month
4202
  * +2: word: year
4182
  * +2: word: year
4203
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4183
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4204
Remarks:
4184
Remarks:
4205
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4185
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4206
    if UNICODE name - 560 bytes. Value of length is aligned
4186
    if UNICODE name - 560 bytes. Value of length is aligned
4207
    on 16-byte bound (to accelerate processing in CPU cache).
4187
    on 16-byte bound (to accelerate processing in CPU cache).
4208
  * First character after a name is zero (ASCIIZ-string). The further
4188
  * First character after a name is zero (ASCIIZ-string). The further
4209
    data contain garbage.
4189
    data contain garbage.
4210
  * If files in folder were ended before requested number was read,
4190
  * If files in folder were ended before requested number was read,
4211
    the function will read as many as it can, and after that return
4191
    the function will read as many as it can, and after that return
4212
    eax=6 (EOF).
4192
    eax=6 (EOF).
4213
  * Any folder on the disk, except for root, contains two special
4193
  * Any folder on the disk, except for root, contains two special
4214
    entries "." and "..", identifying accordingly the folder itself
4194
    entries "." and "..", identifying accordingly the folder itself
4215
    and the parent folder.
4195
    and the parent folder.
4216
  * The function allows also to read virtual folders "/", "/rd",
4196
  * The function allows also to read virtual folders "/", "/rd",
4217
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4197
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4218
    and times and dates are zeroed. An alternative way to get the
4198
    and times and dates are zeroed. An alternative way to get the
4219
    equipment information - subfunction 11 of function 18.
4199
    equipment information - subfunction 11 of function 18.
4220
 
4200
 
4221
======================================================================
4201
======================================================================
4222
===================== Function 70, subfunction 2 =====================
4202
===================== Function 70, subfunction 2 =====================
4223
============ Create/rewrite file with long names support. ============
4203
============ Create/rewrite file with long names support. ============
4224
======================================================================
4204
======================================================================
4225
Parameters:
4205
Parameters:
4226
  * eax = 70 - function number
4206
  * eax = 70 - function number
4227
  * ebx = pointer to the information structure
4207
  * ebx = pointer to the information structure
4228
Format of the information structure:
4208
Format of the information structure:
4229
  * +0: dword: 2 = subfunction number
4209
  * +0: dword: 2 = subfunction number
4230
  * +4: dword: 0 (reserved)
4210
  * +4: dword: 0 (reserved)
4231
  * +8: dword: 0 (reserved)
4211
  * +8: dword: 0 (reserved)
4232
  * +12 = +0xC: dword: number of bytes to read
4212
  * +12 = +0xC: dword: number of bytes to read
4233
  * +16 = +0x10: dword: pointer to data
4213
  * +16 = +0x10: dword: pointer to data
4234
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4214
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4235
    given in the general description
4215
    given in the general description
4236
    or
4216
    or
4237
  * +20 = +0x14: db 0
4217
  * +20 = +0x14: db 0
4238
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4218
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4239
Returned value:
4219
Returned value:
4240
  * eax = 0 - success, otherwise file system error code
4220
  * eax = 0 - success, otherwise file system error code
4241
  * ebx = number of written bytes (possibly 0)
4221
  * ebx = number of written bytes (possibly 0)
4242
Remarks:
4222
Remarks:
4243
  * If a file with given name did not exist, it is created;
4223
  * If a file with given name did not exist, it is created;
4244
    if it existed, it is rewritten.
4224
    if it existed, it is rewritten.
4245
  * If there is not enough free space on disk, the function will
4225
  * If there is not enough free space on disk, the function will
4246
    write as many as can and then return error code 8.
4226
    write as many as can and then return error code 8.
4247
  * The function is not supported for CD (returns error code 2).
4227
  * The function is not supported for CD (returns error code 2).
4248
 
4228
 
4249
======================================================================
4229
======================================================================
4250
===================== Function 70, subfunction 3 =====================
4230
===================== Function 70, subfunction 3 =====================
4251
=========== Write to existing file with long names support. ==========
4231
=========== Write to existing file with long names support. ==========
4252
======================================================================
4232
======================================================================
4253
Parameters:
4233
Parameters:
4254
  * eax = 70 - function number
4234
  * eax = 70 - function number
4255
  * ebx = pointer to the information structure
4235
  * ebx = pointer to the information structure
4256
Format of the information structure:
4236
Format of the information structure:
4257
  * +0: dword: 3 = subfunction number
4237
  * +0: dword: 3 = subfunction number
4258
  * +4: dword: file offset (in bytes)
4238
  * +4: dword: file offset (in bytes)
4259
  * +8: dword: high dword of offset (must be 0 for FAT)
4239
  * +8: dword: high dword of offset (must be 0 for FAT)
4260
  * +12 = +0xC: dword: number of bytes to write
4240
  * +12 = +0xC: dword: number of bytes to write
4261
  * +16 = +0x10: dword: pointer to data
4241
  * +16 = +0x10: dword: pointer to data
4262
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4242
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4263
    given in the general description
4243
    given in the general description
4264
    or
4244
    or
4265
  * +20 = +0x14: db 0
4245
  * +20 = +0x14: db 0
4266
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4246
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4267
Returned value:
4247
Returned value:
4268
  * eax = 0 - success, otherwise file system error code
4248
  * eax = 0 - success, otherwise file system error code
4269
  * ebx = number of written bytes (possibly 0)
4249
  * ebx = number of written bytes (possibly 0)
4270
Remarks:
4250
Remarks:
4271
  * The file must already exist, otherwise function returns eax=5.
4251
  * The file must already exist, otherwise function returns eax=5.
4272
  * The only result of write 0 bytes is update in the file attributes
4252
  * The only result of write 0 bytes is update in the file attributes
4273
    date/time of modification and access to the current date/time.
4253
    date/time of modification and access to the current date/time.
4274
  * If beginning and/or ending position is greater than file size
4254
  * If beginning and/or ending position is greater than file size
4275
    (except for the previous case), the file is expanded to needed
4255
    (except for the previous case), the file is expanded to needed
4276
    size with zero characters.
4256
    size with zero characters.
4277
  * The function is not supported for CD (returns error code 2).
4257
  * The function is not supported for CD (returns error code 2).
4278
 
4258
 
4279
======================================================================
4259
======================================================================
4280
============ Function 70, subfunction 4 - set end of file. ===========
4260
============ Function 70, subfunction 4 - set end of file. ===========
4281
======================================================================
4261
======================================================================
4282
Parameters:
4262
Parameters:
4283
  * eax = 70 - function number
4263
  * eax = 70 - function number
4284
  * ebx = pointer to the information structure
4264
  * ebx = pointer to the information structure
4285
Format of the information structure:
4265
Format of the information structure:
4286
  * +0: dword: 4 = subfunction number
4266
  * +0: dword: 4 = subfunction number
4287
  * +4: dword: low dword of new file size
4267
  * +4: dword: low dword of new file size
4288
  * +8: dword: high dword of new file size (must be 0 for FAT)
4268
  * +8: dword: high dword of new file size (must be 0 for FAT)
4289
  * +12 = +0xC: dword: 0 (reserved)
4269
  * +12 = +0xC: dword: 0 (reserved)
4290
  * +16 = +0x10: dword: 0 (reserved)
4270
  * +16 = +0x10: dword: 0 (reserved)
4291
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4271
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4292
    given in the general description
4272
    given in the general description
4293
    or
4273
    or
4294
  * +20 = +0x14: db 0
4274
  * +20 = +0x14: db 0
4295
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4275
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4296
Returned value:
4276
Returned value:
4297
  * eax = 0 - success, otherwise file system error code
4277
  * eax = 0 - success, otherwise file system error code
4298
  * ebx destroyed
4278
  * ebx destroyed
4299
Remarks:
4279
Remarks:
4300
  * If the new file size is less than old one, file is truncated.
4280
  * If the new file size is less than old one, file is truncated.
4301
    If the new size is greater than old one, file is expanded with
4281
    If the new size is greater than old one, file is expanded with
4302
    characters with code 0. If the new size is equal to old one,
4282
    characters with code 0. If the new size is equal to old one,
4303
    the only result of call is set date/time of modification and
4283
    the only result of call is set date/time of modification and
4304
    access to the current date/time.
4284
    access to the current date/time.
4305
  * If there is not enough free space on disk for expansion, the
4285
  * If there is not enough free space on disk for expansion, the
4306
    function will expand to maximum possible size and then return
4286
    function will expand to maximum possible size and then return
4307
    error code 8.
4287
    error code 8.
4308
  * The function is not supported for CD (returns error code 2).
4288
  * The function is not supported for CD (returns error code 2).
4309
 
4289
 
4310
======================================================================
4290
======================================================================
4311
==== Function 70, subfunction 5 - get information on file/folder. ====
4291
==== Function 70, subfunction 5 - get information on file/folder. ====
4312
======================================================================
4292
======================================================================
4313
Parameters:
4293
Parameters:
4314
  * eax = 70 - function number
4294
  * eax = 70 - function number
4315
  * ebx = pointer to the information structure
4295
  * ebx = pointer to the information structure
4316
Format of the information structure:
4296
Format of the information structure:
4317
  * +0: dword: 5 = subfunction number
4297
  * +0: dword: 5 = subfunction number
4318
  * +4: dword: 0 (reserved)
4298
  * +4: dword: 0 (reserved)
4319
  * +8: dword: 0 (reserved)
4299
  * +8: dword: 0 (reserved)
4320
  * +12 = +0xC: dword: 0 (reserved)
4300
  * +12 = +0xC: dword: 0 (reserved)
4321
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4301
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4322
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4302
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4323
    given in the general description
4303
    given in the general description
4324
    or
4304
    or
4325
  * +20 = +0x14: db 0
4305
  * +20 = +0x14: db 0
4326
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4306
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4327
Returned value:
4307
Returned value:
4328
  * eax = 0 - success, otherwise file system error code
4308
  * eax = 0 - success, otherwise file system error code
4329
  * ebx destroyed
4309
  * ebx destroyed
4330
Information on file is returned in the BDFE format (block of data
4310
Information on file is returned in the BDFE format (block of data
4331
for folder entry), explained in the description of
4311
for folder entry), explained in the description of
4332
subfunction 1, but without filename
4312
subfunction 1, but without filename
4333
(i.e. only first 40 = 0x28 bytes).
4313
(i.e. only first 40 = 0x28 bytes).
4334
Remarks:
4314
Remarks:
4335
  * The function does not support virtual folders such as /, /rd and
4315
  * The function does not support virtual folders such as /, /rd and
4336
    root folders like /rd/1.
4316
    root folders like /rd/1.
4337
 
4317
 
4338
======================================================================
4318
======================================================================
4339
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4319
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4340
======================================================================
4320
======================================================================
4341
Parameters:
4321
Parameters:
4342
  * eax = 70 - function number
4322
  * eax = 70 - function number
4343
  * ebx = pointer to the information structure
4323
  * ebx = pointer to the information structure
4344
Format of the information structure:
4324
Format of the information structure:
4345
  * +0: dword: 6 = subfunction number
4325
  * +0: dword: 6 = subfunction number
4346
  * +4: dword: 0 (reserved)
4326
  * +4: dword: 0 (reserved)
4347
  * +8: dword: 0 (reserved)
4327
  * +8: dword: 0 (reserved)
4348
  * +12 = +0xC: dword: 0 (reserved)
4328
  * +12 = +0xC: dword: 0 (reserved)
4349
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4329
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4350
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4330
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4351
    given in the general description
4331
    given in the general description
4352
    or
4332
    or
4353
  * +20 = +0x14: db 0
4333
  * +20 = +0x14: db 0
4354
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4334
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4355
Returned value:
4335
Returned value:
4356
  * eax = 0 - success, otherwise file system error code
4336
  * eax = 0 - success, otherwise file system error code
4357
  * ebx destroyed
4337
  * ebx destroyed
4358
File attributes are first 32 bytes in BDFE (block of data
4338
File attributes are first 32 bytes in BDFE (block of data
4359
for folder entry), explained in the description of subfunction 1
4339
for folder entry), explained in the description of subfunction 1
4360
(that is, without name and size of file). Attribute
4340
(that is, without name and size of file). Attribute
4361
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4341
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4362
Byte +4 (name format) is ignored.
4342
Byte +4 (name format) is ignored.
4363
Remarks:
4343
Remarks:
4364
  * The function does not support virtual folders such as /, /rd and
4344
  * The function does not support virtual folders such as /, /rd and
4365
    root folders like /rd/1.
4345
    root folders like /rd/1.
4366
  * The function is not supported for CD (returns error code 2).
4346
  * The function is not supported for CD (returns error code 2).
4367
 
4347
 
4368
======================================================================
4348
======================================================================
4369
=========== Function 70, subfunction 7 - start application. ==========
4349
=========== Function 70, subfunction 7 - start application. ==========
4370
======================================================================
4350
======================================================================
4371
Parameters:
4351
Parameters:
4372
  * eax = 70 - function number
4352
  * eax = 70 - function number
4373
  * ebx = pointer to the information structure
4353
  * ebx = pointer to the information structure
4374
Format of the information structure:
4354
Format of the information structure:
4375
  * +0: dword: 7 = subfunction number
4355
  * +0: dword: 7 = subfunction number
4376
  * +4: dword: flags field:
4356
  * +4: dword: flags field:
4377
    * áèò 0: start process as debugged
4357
    * áèò 0: start process as debugged
4378
    * other bits are reserved and must be set to 0
4358
    * other bits are reserved and must be set to 0
4379
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4359
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4380
  * +12 = +0xC: dword: 0 (reserved)
4360
  * +12 = +0xC: dword: 0 (reserved)
4381
  * +16 = +0x10: dword: 0 (reserved)
4361
  * +16 = +0x10: dword: 0 (reserved)
4382
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4362
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4383
    given in the general description
4363
    given in the general description
4384
    or
4364
    or
4385
  * +20 = +0x14: db 0
4365
  * +20 = +0x14: db 0
4386
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4366
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4387
Returned value:
4367
Returned value:
4388
  * eax > 0 - program is loaded, eax contains PID
4368
  * eax > 0 - program is loaded, eax contains PID
4389
  * eax < 0 - an error has occured, -eax contains
4369
  * eax < 0 - an error has occured, -eax contains
4390
    file system error code
4370
    file system error code
4391
  * ebx destroyed
4371
  * ebx destroyed
4392
Remarks:
4372
Remarks:
4393
  * Command line must be terminated by the character with the code 0
4373
  * Command line must be terminated by the character with the code 0
4394
    (ASCIIZ-string); function takes into account either all characters
4374
    (ASCIIZ-string); function takes into account either all characters
4395
    up to terminating zero inclusively or first 256 character
4375
    up to terminating zero inclusively or first 256 character
4396
    regarding what is less.
4376
    regarding what is less.
4397
  * If the process is started as debugged, it is created in
4377
  * If the process is started as debugged, it is created in
4398
    the suspended state; to run use subfunction 5 of function 69.
4378
    the suspended state; to run use subfunction 5 of function 69.
4399
 
4379
 
4400
======================================================================
4380
======================================================================
4401
========== Function 70, subfunction 8 - delete file/folder. ==========
4381
========== Function 70, subfunction 8 - delete file/folder. ==========
4402
======================================================================
4382
======================================================================
4403
Parameters:
4383
Parameters:
4404
  * eax = 70 - function number
4384
  * eax = 70 - function number
4405
  * ebx = pointer to the information structure
4385
  * ebx = pointer to the information structure
4406
Format of the information structure:
4386
Format of the information structure:
4407
  * +0: dword: 8 = subfunction number
4387
  * +0: dword: 8 = subfunction number
4408
  * +4: dword: 0 (reserved)
4388
  * +4: dword: 0 (reserved)
4409
  * +8: dword: 0 (reserved)
4389
  * +8: dword: 0 (reserved)
4410
  * +12 = +0xC: dword: 0 (reserved)
4390
  * +12 = +0xC: dword: 0 (reserved)
4411
  * +16 = +0x10: dword: 0 (reserved)
4391
  * +16 = +0x10: dword: 0 (reserved)
4412
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4392
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4413
    given in the general description
4393
    given in the general description
4414
    or
4394
    or
4415
  * +20 = +0x14: db 0
4395
  * +20 = +0x14: db 0
4416
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4396
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4417
Returned value:
4397
Returned value:
4418
  * eax = 0 - success, otherwise file system error code
4398
  * eax = 0 - success, otherwise file system error code
4419
  * ebx destroyed
4399
  * ebx destroyed
4420
Remarks:
4400
Remarks:
4421
  * The function is not supported for CD (returns error code 2).
4401
  * The function is not supported for CD (returns error code 2).
4422
  * The function can delete only empty folders (attempt to delete
4402
  * The function can delete only empty folders (attempt to delete
4423
    nonempty folder results in error with code 10, "access denied").
4403
    nonempty folder results in error with code 10, "access denied").
4424
 
4404
 
4425
======================================================================
4405
======================================================================
4426
========== Function 71, subfunction 1 - set window caption. ==========
4406
========== Function 71, subfunction 1 - set window caption. ==========
4427
======================================================================
4407
======================================================================
4428
Parameters:
4408
Parameters:
4429
  * eax = 71 - function number
4409
  * eax = 71 - function number
4430
  * ebx = 1 - subfunction number
4410
  * ebx = 1 - subfunction number
4431
  * ecx = pointer to caption string
4411
  * ecx = pointer to caption string
4432
Returned value:
4412
Returned value:
4433
  * function does not return value
4413
  * function does not return value
4434
Remarks:
4414
Remarks:
4435
  * String must be in the ASCIIZ-format. Disregarding real string
4415
  * String must be in the ASCIIZ-format. Disregarding real string
4436
    length, no more than 255 characters are drawn.
4416
    length, no more than 255 characters are drawn.
4437
  * Pass NULL in ecx to remove caption.
4417
  * Pass NULL in ecx to remove caption.
4438
 
4418
 
4439
======================================================================
4419
======================================================================
4440
=============== Function -1 - terminate thread/process ===============
4420
=============== Function -1 - terminate thread/process ===============
4441
======================================================================
4421
======================================================================
4442
Parameters:
4422
Parameters:
4443
  * eax = -1 - function number
4423
  * eax = -1 - function number
4444
Returned value:
4424
Returned value:
4445
  * function does not return neither value nor control
4425
  * function does not return neither value nor control
4446
Remarks:
4426
Remarks:
4447
  * If the process did not create threads obviously, it has only
4427
  * If the process did not create threads obviously, it has only
4448
    one thread, which termination results in process termination.
4428
    one thread, which termination results in process termination.
4449
  * If the current thread is last in the process, its termination
4429
  * If the current thread is last in the process, its termination
4450
    also results in process terminates.
4430
    also results in process terminates.
4451
  * This function terminates the current thread. Other thread can be
4431
  * This function terminates the current thread. Other thread can be
4452
    killed by call to subfunction 2 of function 18.
4432
    killed by call to subfunction 2 of function 18.
4453
 
4433
 
4454
======================================================================
4434
======================================================================
4455
=========================== List of events ===========================
4435
=========================== List of events ===========================
4456
======================================================================
4436
======================================================================
4457
Next event can be retrieved by the call of one from functions 10
4437
Next event can be retrieved by the call of one from functions 10
4458
(to wait for event), 11 (to check without waiting), 23
4438
(to wait for event), 11 (to check without waiting), 23
4459
(to wait during the given time).
4439
(to wait during the given time).
4460
These functions return only those events, which enter into a mask set
4440
These functions return only those events, which enter into a mask set
4461
by function 40. By default it is first three,
4441
by function 40. By default it is first three,
4462
there is enough for most applications.
4442
there is enough for most applications.
4463
Codes of events:
4443
Codes of events:
4464
  * 1 = redraw event (is reset by call to function 0)
4444
  * 1 = redraw event (is reset by call to function 0)
4465
  * 2 = key on keyboard is pressed (acts, only when the window is
4445
  * 2 = key on keyboard is pressed (acts, only when the window is
4466
    active) or hotkey is pressed; is reset, when all keys from
4446
    active) or hotkey is pressed; is reset, when all keys from
4467
    the buffer are read out by function 2
4447
    the buffer are read out by function 2
4468
  * 3 = button is pressed, defined earlier by function 8
4448
  * 3 = button is pressed, defined earlier by function 8
4469
    (or close button, created implicitly by function 0;
4449
    (or close button, created implicitly by function 0;
4470
    minimize button is handled by the system and sends no message;
4450
    minimize button is handled by the system and sends no message;
4471
    acts, only when the window is active;
4451
    acts, only when the window is active;
4472
    is reset when all buttons from the buffer
4452
    is reset when all buttons from the buffer
4473
    are read out by function 17)
4453
    are read out by function 17)
4474
  * 4 = reserved (in current implementation never comes even after
4454
  * 4 = reserved (in current implementation never comes even after
4475
    unmasking by function 40)
4455
    unmasking by function 40)
4476
  * 5 = the desktop background is redrawed (is reset automatically
4456
  * 5 = the desktop background is redrawed (is reset automatically
4477
    after redraw, so if in redraw time program does not wait and
4457
    after redraw, so if in redraw time program does not wait and
4478
    does not check events, it will not remark this event)
4458
    does not check events, it will not remark this event)
4479
  * 6 = mouse event (something happened - button pressing or moving;
4459
  * 6 = mouse event (something happened - button pressing or moving;
4480
    is reset at reading)
4460
    is reset at reading)
4481
  * 7 = IPC event (see function 60 -
4461
  * 7 = IPC event (see function 60 -
4482
    Inter Process Communication; is reset at reading)
4462
    Inter Process Communication; is reset at reading)
4483
  * 8 = network event (is reset at reading)
4463
  * 8 = network event (is reset at reading)
4484
  * 9 = debug event (is reset at reading; see
4464
  * 9 = debug event (is reset at reading; see
4485
    debug subsystem)
4465
    debug subsystem)
4486
  * 16..31 = event with appropriate IRQ
4466
  * 16..31 = event with appropriate IRQ
4487
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4467
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4488
 
4468
 
4489
======================================================================
4469
======================================================================
4490
=================== Error codes of the file system ===================
4470
=================== Error codes of the file system ===================
4491
======================================================================
4471
======================================================================
4492
  * 0 = success
4472
  * 0 = success
4493
  * 1 = base and/or partition of a hard disk is not defined
4473
  * 1 = base and/or partition of a hard disk is not defined
4494
    (by subfunctions 7, 8 of function 21)
4474
    (by subfunctions 7, 8 of function 21)
4495
  * 2 = function is not supported for the given file system
4475
  * 2 = function is not supported for the given file system
4496
  * 3 = unknown file system
4476
  * 3 = unknown file system
4497
  * 4 = is returned only from function 'rename' by transmission of
4477
  * 4 = is returned only from function 'rename' by transmission of
4498
    the strongly incorrect parameter and in any way does not
4478
    the strongly incorrect parameter and in any way does not
4499
    correspond to the description in the kernel sources
4479
    correspond to the description in the kernel sources
4500
    "partition not defined at hd"
4480
    "partition not defined at hd"
4501
  * 5 = file not found
4481
  * 5 = file not found
4502
  * 6 = end of file, EOF
4482
  * 6 = end of file, EOF
4503
  * 7 = pointer lies outside of application memory
4483
  * 7 = pointer lies outside of application memory
4504
  * 8 = disk is full
4484
  * 8 = disk is full
4505
  * 9 = FAT table is destroyed
4485
  * 9 = FAT table is destroyed
4506
  * 10 = access denied
4486
  * 10 = access denied
4507
  * 11 = device error
4487
  * 11 = device error
4508
Application start functions can return also following errors:
4488
Application start functions can return also following errors:
4509
  * 30 = 0x1E = not enough memory
4489
  * 30 = 0x1E = not enough memory
4510
  * 31 = 0x1F = file is not executable
4490
  * 31 = 0x1F = file is not executable
4511
  * 32 = 0x20 = too many processes
4491
  * 32 = 0x20 = too many processes
4512
>
4492
>
4513
>
4493
>
4514
>
4494
>
4515
>
4495
>
4516
>
-