Subversion Repositories Kolibri OS

Rev

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

Rev 341 Rev 346
1
SYSTEM FUNCTIONS of OS Kolibri 0.6.4.0
1
SYSTEM FUNCTIONS of OS Kolibri 0.6.5.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 = 1 - don't fill working area on window draw
35
      * C = 1 - don't fill working area on window draw
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 = pointer to the full path to file
674
  * ecx = pointer to the full path to file
675
    (for example, "/hd0/1/kolibri/kolibri.img")
675
    (for example, "/hd0/1/kolibri/kolibri.img")
676
Returned value:
676
Returned value:
677
  * eax = 0 - success
677
  * eax = 0 - success
678
  * else eax = error code of the file system
678
  * else eax = error code of the file system
679
Remarks:
679
Çàìå÷àíèÿ:
680
  * All folders in the given path must exist, otherwise function
680
  * All folders in the given path must exist, otherwise function
681
    returns value 5, "file not found".
681
    returns value 5, "file not found".
682
 
682
 
683
======================================================================
683
======================================================================
684
=========== Function 18, subfunction 7 - get active window. ==========
684
=========== Function 18, subfunction 7 - get active window. ==========
685
======================================================================
685
======================================================================
686
Parameters:
686
Parameters:
687
  * eax = 18 - function number
687
  * eax = 18 - function number
688
  * ebx = 7 - subfunction number
688
  * ebx = 7 - subfunction number
689
Returned value:
689
Returned value:
690
  * eax = number of the active window
690
  * eax = number of the active window
691
    (number of the slot of the thread with active window)
691
    (number of the slot of the thread with active window)
692
Remarks:
692
Remarks:
693
  * Active window is at the top of the window stack and receives
693
  * Active window is at the top of the window stack and receives
694
    messages on all keyboard input.
694
    messages on all keyboard input.
695
  * To make a window active, use subfunction 3.
695
  * To make a window active, use subfunction 3.
696
 
696
 
697
======================================================================
697
======================================================================
698
== Function 18, subfunction 8 - disable/enable the internal speaker. =
698
== Function 18, subfunction 8 - disable/enable the internal speaker. =
699
======================================================================
699
======================================================================
700
If speaker sound is disabled, all calls to subfunction 55 of
700
If speaker sound is disabled, all calls to subfunction 55 of
701
function 55 are ignored. If speaker sound is enabled,
701
function 55 are ignored. If speaker sound is enabled,
702
they are routed on builtin speaker.
702
they are routed on builtin speaker.
703
 
703
 
704
------------------- Subsubfunction 1 - get status. -------------------
704
------------------- Subsubfunction 1 - get status. -------------------
705
Parameters:
705
Parameters:
706
  * eax = 18 - function number
706
  * eax = 18 - function number
707
  * ebx = 8 - subfunction number
707
  * ebx = 8 - subfunction number
708
  * ecx = 1 - number of the subsubfunction
708
  * ecx = 1 - number of the subsubfunction
709
Returned value:
709
Returned value:
710
  * eax = 0 - speaker sound is enabled; 1 - disabled
710
  * eax = 0 - speaker sound is enabled; 1 - disabled
711
 
711
 
712
----------------- Subsubfunction 2 - toggle status. ------------------
712
----------------- Subsubfunction 2 - toggle status. ------------------
713
Toggles states of disable/enable.
713
Toggles states of disable/enable.
714
Parameters:
714
Parameters:
715
  * eax = 18 - function number
715
  * eax = 18 - function number
716
  * ebx = 8 - subfunction number
716
  * ebx = 8 - subfunction number
717
  * ecx = 2 - number of the subsubfunction
717
  * ecx = 2 - number of the subsubfunction
718
Returned value:
718
Returned value:
719
  * function does not return value
719
  * function does not return value
720
 
720
 
721
======================================================================
721
======================================================================
722
== Function 18, subfunction 9 - system shutdown with the parameter. ==
722
== Function 18, subfunction 9 - system shutdown with the parameter. ==
723
======================================================================
723
======================================================================
724
Parameters:
724
Parameters:
725
  * eax = 18 - function number
725
  * eax = 18 - function number
726
  * ebx = 9 - subfunction number
726
  * ebx = 9 - subfunction number
727
  * ecx = parameter:
727
  * ecx = parameter:
728
    * 1 = on the last step of shutdown save ramdisk on a floppy and
728
    * 1 = on the last step of shutdown save ramdisk on a floppy and
729
      then show the exit menu and request further operations
729
      then show the exit menu and request further operations
730
      from the user
730
      from the user
731
    * 2 = turn off computer
731
    * 2 = turn off computer
732
    * 3 = reboot computer
732
    * 3 = reboot computer
733
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
733
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
734
Returned value:
734
Returned value:
735
  * at incorrect ecx the registers do not change (i.e. eax=18)
735
  * at incorrect ecx the registers do not change (i.e. eax=18)
736
  * by correct call function always returns eax=0
736
  * by correct call function always returns eax=0
737
    as the tag of success
737
    as the tag of success
738
Remarks:
738
Remarks:
739
  * Do not rely on returned value by incorrect call, it can be
739
  * Do not rely on returned value by incorrect call, it can be
740
    changed in future versions of the kernel.
740
    changed in future versions of the kernel.
741
  * It is possible to use subfunction 1, that on the last step
741
  * It is possible to use subfunction 1, that on the last step
742
    the user makes choice himself.
742
    the user makes choice himself.
743
  * It is not recommended to use value ecx=1 (to not irritate the user
743
  * It is not recommended to use value ecx=1 (to not irritate the user
744
    with excessive questions); to save ramdisk on a floppy use
744
    with excessive questions); to save ramdisk on a floppy use
745
    function 16 (which admits specification, on which floppy to
745
    function 16 (which admits specification, on which floppy to
746
    write), and to shutdown with the exit menu use already mentioned
746
    write), and to shutdown with the exit menu use already mentioned
747
    subfunction 1.
747
    subfunction 1.
748
 
748
 
749
======================================================================
749
======================================================================
750
===== Function 18, subfunction 10 - minimize application window. =====
750
===== Function 18, subfunction 10 - minimize application window. =====
751
======================================================================
751
======================================================================
752
Minimizes the own window.
752
Minimizes the own window.
753
Parameters:
753
Parameters:
754
  * eax = 18 - function number
754
  * eax = 18 - function number
755
  * ebx = 10 - subfunction number
755
  * ebx = 10 - subfunction number
756
Returned value:
756
Returned value:
757
  * function does not return value
757
  * function does not return value
758
Remarks:
758
Remarks:
759
  * The minimized window from the point of view of function 9
759
  * The minimized window from the point of view of function 9
760
    keeps position and sizes.
760
    keeps position and sizes.
761
  * Restoring of an application window occurs at its activation by 
761
  * Restoring of an application window occurs at its activation by 
762
    subfunction 3.
762
    subfunction 3.
763
  * Usually there is no necessity to minimize/restire a window
763
  * Usually there is no necessity to minimize/restire a window
764
    obviously: minimization of a window is carried out by the system
764
    obviously: minimization of a window is carried out by the system
765
    at pressing the minimization button (for skinned windows
765
    at pressing the minimization button (for skinned windows
766
    it is defined automatically by function 0,
766
    it is defined automatically by function 0,
767
    for other windows it can be defined manually by function 8),
767
    for other windows it can be defined manually by function 8),
768
    restore of a window is done by the application '@panel'.
768
    restore of a window is done by the application '@panel'.
769
 
769
 
770
======================================================================
770
======================================================================
771
 Function 18, subfunction 11 - get information on the disk subsystem. 
771
 Function 18, subfunction 11 - get information on the disk subsystem. 
772
======================================================================
772
======================================================================
773
Parameters:
773
Parameters:
774
  * eax = 18 - function number
774
  * eax = 18 - function number
775
  * ebx = 11 - subfunction number
775
  * ebx = 11 - subfunction number
776
  * ecx = type of the table:
776
  * ecx = type of the table:
777
    * 1 = short version, 10 bytes
777
    * 1 = short version, 10 bytes
778
    * 2 = full version, 65536 bytes
778
    * 2 = full version, 65536 bytes
779
  * edx = pointer to the buffer (in the application) for the table
779
  * edx = pointer to the buffer (in the application) for the table
780
Returned value:
780
Returned value:
781
  * function does not return value
781
  * function does not return value
782
Format of the table: short version:
782
Format of the table: short version:
783
  * +0: byte: information about FDD's (drives for floppies),
783
  * +0: byte: information about FDD's (drives for floppies),
784
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
784
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
785
    of the second regarding to the following list:
785
    of the second regarding to the following list:
786
    * 0 = there is no drive
786
    * 0 = there is no drive
787
    * 1 = 360Kb, 5.25''
787
    * 1 = 360Kb, 5.25''
788
    * 2 = 1.2Mb, 5.25''
788
    * 2 = 1.2Mb, 5.25''
789
    * 3 = 720Kb, 3.5''
789
    * 3 = 720Kb, 3.5''
790
    * 4 = 1.44Mb, 3.5''
790
    * 4 = 1.44Mb, 3.5''
791
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
791
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
792
    For example, for the standard configuration from one 1.44-drive
792
    For example, for the standard configuration from one 1.44-drive
793
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
793
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
794
    the value is 24h.
794
    the value is 24h.
795
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
795
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
796
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
796
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
797
    * 0 = device is absent
797
    * 0 = device is absent
798
    * 1 = hard drive
798
    * 1 = hard drive
799
    * 2 = CD-drive
799
    * 2 = CD-drive
800
    For example, in the case HD on IDE0 and CD on IDE2
800
    For example, in the case HD on IDE0 and CD on IDE2
801
    this field contains 48h.
801
    this field contains 48h.
802
  * +2: 4 db: number of the retrieved partitions on hard disks
802
  * +2: 4 db: number of the retrieved partitions on hard disks
803
    at accordingly IDE0,...,IDE3.
803
    at accordingly IDE0,...,IDE3.
804
    If the hard disk on IDEx is absent, appropriate byte is zero,
804
    If the hard disk on IDEx is absent, appropriate byte is zero,
805
    otherwise it shows number of the recognized partitions, which
805
    otherwise it shows number of the recognized partitions, which
806
    can be not presented (if the drive is not formatted or if
806
    can be not presented (if the drive is not formatted or if
807
    the file system is not supported). Current version of the kernel
807
    the file system is not supported). Current version of the kernel
808
    supports only FAT16, FAT32 and NTFS for hard disks.
808
    supports only FAT16, FAT32 and NTFS for hard disks.
809
  * +6: 4 db: reserved
809
  * +6: 4 db: reserved
810
Format of the table: full version:
810
Format of the table: full version:
811
  * +0: 10 db: same as for the short version
811
  * +0: 10 db: same as for the short version
812
  * +10: 100 db: data for the first partition
812
  * +10: 100 db: data for the first partition
813
  * +110: 100 db: data for the second partition
813
  * +110: 100 db: data for the second partition
814
  * ...
814
  * ...
815
  * +10+100*(n-1): 100 db: data for the last partition
815
  * +10+100*(n-1): 100 db: data for the last partition
816
The partitions are located as follows: at first sequentially all
816
The partitions are located as follows: at first sequentially all
817
recoginzed partitions on HD on IDE0 (if present),
817
recoginzed partitions on HD on IDE0 (if present),
818
then on HD on IDE1 (if present) and so on up to IDE3.
818
then on HD on IDE1 (if present) and so on up to IDE3.
819
Format of the information about partition
819
Format of the information about partition
820
(at moment only FAT is supported):
820
(at moment only FAT is supported):
821
  * +0: dword: first physical sector of the partition
821
  * +0: dword: first physical sector of the partition
822
  * +4: dword: last physical sector of the partition
822
  * +4: dword: last physical sector of the partition
823
    (belongs to the partition)
823
    (belongs to the partition)
824
  * +8: byte: file system type:
824
  * +8: byte: file system type:
825
    16=FAT16, 32=FAT32, 1=NTFS
825
    16=FAT16, 32=FAT32, 1=NTFS
826
  * other data are dependent on file system, are modified with
826
  * other data are dependent on file system, are modified with
827
    kernel modifications and therefore are not described
827
    kernel modifications and therefore are not described
828
Remarks:
828
Remarks:
829
  * The short table can be used for obtaining the information about
829
  * The short table can be used for obtaining the information about
830
    available devices.
830
    available devices.
831
 
831
 
832
======================================================================
832
======================================================================
833
========== Function 18, subfunction 13 - get kernel version. =========
833
========== Function 18, subfunction 13 - get kernel version. =========
834
======================================================================
834
======================================================================
835
Parameters:
835
Parameters:
836
  * eax = 18 - function number
836
  * eax = 18 - function number
837
  * ebx = 13 - subfunction number
837
  * ebx = 13 - subfunction number
838
  * ecx = pointer to the buffer (not less than 16 bytes), where
838
  * ecx = pointer to the buffer (not less than 16 bytes), where
839
    the information will be placed
839
    the information will be placed
840
Returned value:
840
Returned value:
841
  * function does not return value
841
  * function does not return value
842
Structure of the buffer:
842
Structure of the buffer:
843
db a,b,c,d for version a.b.c.d
843
db a,b,c,d for version a.b.c.d
844
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
844
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
845
db 'name',0 - ASCIIZ-string with the name
845
db 'name',0 - ASCIIZ-string with the name
846
For Kolibri 0.6.4.0 kernel:
846
For Kolibri 0.6.5.0 kernel:
847
db 0,6,4,0
847
db 0,6,5,0
848
db 2
848
db 2
849
db 'Kolibri',0
849
db 'Kolibri',0
850
 
850
 
851
======================================================================
851
======================================================================
852
======= Function 18, subfunction 14 - wait for screen retrace. =======
852
======= Function 18, subfunction 14 - wait for screen retrace. =======
853
======================================================================
853
======================================================================
854
Waits for the beginning of retrace of the scanning ray of the screen
854
Waits for the beginning of retrace of the scanning ray of the screen
855
monitor.
855
monitor.
856
Parameters:
856
Parameters:
857
  * eax = 18 - function number
857
  * eax = 18 - function number
858
  * ebx = 14 - subfunction number
858
  * ebx = 14 - subfunction number
859
Returned value:
859
Returned value:
860
  * eax = 0 as the tag of success
860
  * eax = 0 as the tag of success
861
Remarks:
861
Remarks:
862
  * Function is intended only for active high-efficiency graphics
862
  * Function is intended only for active high-efficiency graphics
863
    applications; is used for smooth output of a graphics.
863
    applications; is used for smooth output of a graphics.
864
 
864
 
865
======================================================================
865
======================================================================
866
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
866
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
867
======================================================================
867
======================================================================
868
Parameters:
868
Parameters:
869
  * eax = 18 - function number
869
  * eax = 18 - function number
870
  * ebx = 15 - subfunction number
870
  * ebx = 15 - subfunction number
871
Returned value:
871
Returned value:
872
  * eax = 0 as the tag of success
872
  * eax = 0 as the tag of success
873
 
873
 
874
======================================================================
874
======================================================================
875
========= Function 18, subfunction 16 - get size of free RAM. ========
875
========= Function 18, subfunction 16 - get size of free RAM. ========
876
======================================================================
876
======================================================================
877
Parameters:
877
Parameters:
878
  * eax = 18 - function number
878
  * eax = 18 - function number
879
  * ebx = 16 - subfunction number
879
  * ebx = 16 - subfunction number
880
Returned value:
880
Returned value:
881
  * eax = size of free memory in kilobytes
881
  * eax = size of free memory in kilobytes
882
 
882
 
883
======================================================================
883
======================================================================
884
======== Function 18, subfunction 17 - get full amount of RAM. =======
884
======== Function 18, subfunction 17 - get full amount of RAM. =======
885
======================================================================
885
======================================================================
886
Parameters:
886
Parameters:
887
  * eax = 18 - function number
887
  * eax = 18 - function number
888
  * ebx = 17 - subfunction number
888
  * ebx = 17 - subfunction number
889
Returned value:
889
Returned value:
890
  * eax = total size of existing memory in kilobytes
890
  * eax = total size of existing memory in kilobytes
891
 
891
 
892
======================================================================
892
======================================================================
893
===================== Function 18, subfunction 18 ====================
893
===================== Function 18, subfunction 18 ====================
894
============= Terminate process/thread by the identifier. ============
894
============= Terminate process/thread by the identifier. ============
895
======================================================================
895
======================================================================
896
Parameters:
896
Parameters:
897
  * eax = 18 - function number
897
  * eax = 18 - function number
898
  * ebx = 18 - subfunction number
898
  * ebx = 18 - subfunction number
899
  * ecx = identifer of process/thread (PID/TID)
899
  * ecx = identifer of process/thread (PID/TID)
900
Returned value:
900
Returned value:
901
  * eax = 0 - success
901
  * eax = 0 - success
902
  * eax = -1 - error (process is not found or is system)
902
  * eax = -1 - error (process is not found or is system)
903
Remarks:
903
Remarks:
904
  * It is impossible to terminate system thread OS/IDLE (identifier
904
  * It is impossible to terminate system thread OS/IDLE (identifier
905
    1), it is possible to terminate any normal process/thread.
905
    1), it is possible to terminate any normal process/thread.
906
  * See also subfunction 2 - terminate
906
  * See also subfunction 2 - terminate
907
    process/thread by given slot.
907
    process/thread by given slot.
908
 
908
 
909
======================================================================
909
======================================================================
910
======== Function 18, subfunction 19 - get/set mouse features. =======
910
======== Function 18, subfunction 19 - get/set mouse features. =======
911
======================================================================
911
======================================================================
912
 
912
 
913
---------------- Subsubfunction 0 - get mouse speed. -----------------
913
---------------- Subsubfunction 0 - get mouse speed. -----------------
914
Parameters:
914
Parameters:
915
  * eax = 18 - function number
915
  * eax = 18 - function number
916
  * ebx = 19 - subfunction number
916
  * ebx = 19 - subfunction number
917
  * ecx = 0 - subsubfunction number
917
  * ecx = 0 - subsubfunction number
918
Returned value:
918
Returned value:
919
  * eax = current mouse speed
919
  * eax = current mouse speed
920
 
920
 
921
---------------- Subsubfunction 1 - set mouse speed. -----------------
921
---------------- Subsubfunction 1 - set mouse speed. -----------------
922
Parameters:
922
Parameters:
923
  * eax = 18 - function number
923
  * eax = 18 - function number
924
  * ebx = 19 - subfunction number
924
  * ebx = 19 - subfunction number
925
  * ecx = 1 - subsubfunction number
925
  * ecx = 1 - subsubfunction number
926
  * edx = new value for speed
926
  * edx = new value for speed
927
Returned value:
927
Returned value:
928
  * function does not return value
928
  * function does not return value
929
 
929
 
930
---------------- Subsubfunction 2 - get mouse delay. -----------------
930
---------------- Subsubfunction 2 - get mouse delay. -----------------
931
Parameters:
931
Parameters:
932
  * eax = 18 - function number
932
  * eax = 18 - function number
933
  * ebx = 19 - subfunction number
933
  * ebx = 19 - subfunction number
934
  * ecx = 2 - subsubfunction number
934
  * ecx = 2 - subsubfunction number
935
Returned value:
935
Returned value:
936
  * eax = current mouse delay
936
  * eax = current mouse delay
937
 
937
 
938
---------------- Subsubfunction 3 - set mouse delay. -----------------
938
---------------- Subsubfunction 3 - set mouse delay. -----------------
939
Parameters:
939
Parameters:
940
  * eax = 18 - function number
940
  * eax = 18 - function number
941
  * ebx = 19 - subfunction number
941
  * ebx = 19 - subfunction number
942
  * ecx = 3 - subsubfunction number
942
  * ecx = 3 - subsubfunction number
943
  * edx = new value for mouse delay
943
  * edx = new value for mouse delay
944
Returned value:
944
Returned value:
945
  * function does not return value
945
  * function does not return value
946
 
946
 
947
----------- Subsubfunction 4 - set mouse pointer position. -----------
947
----------- Subsubfunction 4 - set mouse pointer position. -----------
948
Parameters:
948
Parameters:
949
  * eax = 18 - function number
949
  * eax = 18 - function number
950
  * ebx = 19 - subfunction number
950
  * ebx = 19 - subfunction number
951
  * ecx = 4 - subsubfunction number
951
  * ecx = 4 - subsubfunction number
952
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
952
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
953
Returned value:
953
Returned value:
954
  * function does not return value
954
  * function does not return value
955
Remarks:
955
Remarks:
956
  * It is recommended to set speed of the mouse (in subsubfunction 1)
956
  * It is recommended to set speed of the mouse (in subsubfunction 1)
957
    from 1 up to 9. The installed value is not inspected by the kernel
957
    from 1 up to 9. The installed value is not inspected by the kernel
958
    code, so set it carefully, at incorrect value the cursor
958
    code, so set it carefully, at incorrect value the cursor
959
    can "freeze". Speed of the mouse can be regulated through the
959
    can "freeze". Speed of the mouse can be regulated through the
960
    application SETUP.
960
    application SETUP.
961
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
961
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
962
    value is not handled by COM mice. At the very large values the
962
    value is not handled by COM mice. At the very large values the
963
    movement of the mouse on 1 pixel is impossible and the cursor will
963
    movement of the mouse on 1 pixel is impossible and the cursor will
964
    jump on the value of installed speed (subsubfunction 1). The
964
    jump on the value of installed speed (subsubfunction 1). The
965
    installed value is not inspected by the kernel code.
965
    installed value is not inspected by the kernel code.
966
    Mouse delay can be regulated through the application SETUP.
966
    Mouse delay can be regulated through the application SETUP.
967
  * The subsubfunction 4 does not check the passed value. Before
967
  * The subsubfunction 4 does not check the passed value. Before
968
    its call find out current screen resolution (with function 14)
968
    its call find out current screen resolution (with function 14)
969
    and check that the value of position is inside the limits of the
969
    and check that the value of position is inside the limits of the
970
    screen.
970
    screen.
971
 
971
 
972
======================================================================
972
======================================================================
973
======== Function 18, subfunction 20 - get information on RAM. =======
973
======== Function 18, subfunction 20 - get information on RAM. =======
974
======================================================================
974
======================================================================
975
Parameters:
975
Parameters:
976
  * eax = 18 - function number
976
  * eax = 18 - function number
977
  * ebx = 20 - subfunction number
977
  * ebx = 20 - subfunction number
978
  * ecx = pointer to the buffer for information (36 bytes)
978
  * ecx = pointer to the buffer for information (36 bytes)
979
Returned value:
979
Returned value:
980
  * eax = total size of existing RAM in pages
980
  * eax = total size of existing RAM in pages
981
    or -1 if error has occured
981
    or -1 if error has occured
982
  * buffer pointed to by ecx contains the following information:
982
  * buffer pointed to by ecx contains the following information:
983
    * +0:  dword: total size of existing RAM in pages
983
    * +0:  dword: total size of existing RAM in pages
984
    * +4:  dword: size of free RAM in pages
984
    * +4:  dword: size of free RAM in pages
985
    * +8:  dword: number of page faults (exceptions #PF)
985
    * +8:  dword: number of page faults (exceptions #PF)
986
                 in applications
986
                 in applications
987
    * +12: dword: size of kernel heap in bytes
987
    * +12: dword: size of kernel heap in bytes
988
    * +16: dword: free in kernel heap in bytes
988
    * +16: dword: free in kernel heap in bytes
989
    * +20: dword: total number of memory blocks in kernel heap
989
    * +20: dword: total number of memory blocks in kernel heap
990
    * +24: dword: number of free memory blocks in kernel heap
990
    * +24: dword: number of free memory blocks in kernel heap
991
    * +28: dword: size of maximum free block in kernel heap
991
    * +28: dword: size of maximum free block in kernel heap
992
                 (reserved)
992
                 (reserved)
993
    * +32: dword: size of maximum allocated block in kernel heap
993
    * +32: dword: size of maximum allocated block in kernel heap
994
                 (reserved)
994
                 (reserved)
995
 
995
 
996
======================================================================
996
======================================================================
997
==================== Function 20 - MIDI interface. ===================
997
==================== Function 20 - MIDI interface. ===================
998
======================================================================
998
======================================================================
999
 
999
 
1000
----------------------- Subfunction 1 - reset ------------------------
1000
----------------------- Subfunction 1 - reset ------------------------
1001
Parameters:
1001
Parameters:
1002
  * eax = 20 - function number
1002
  * eax = 20 - function number
1003
  * ebx = 1 - subfunction number
1003
  * ebx = 1 - subfunction number
1004
 
1004
 
1005
-------------------- Subfunction 2 - output byte ---------------------
1005
-------------------- Subfunction 2 - output byte ---------------------
1006
Parameters:
1006
Parameters:
1007
  * eax = 20 - function number
1007
  * eax = 20 - function number
1008
  * ebx = 2 - subfunction number
1008
  * ebx = 2 - subfunction number
1009
  * cl = byte for output
1009
  * cl = byte for output
1010
Returned value (is the same for both subfunctions):
1010
Returned value (is the same for both subfunctions):
1011
  * eax = 0 - success
1011
  * eax = 0 - success
1012
  * eax = 1 - base port is not defined
1012
  * eax = 1 - base port is not defined
1013
Remarks:
1013
Remarks:
1014
  * Previously the base port must be defined by 
1014
  * Previously the base port must be defined by 
1015
    subfunction 1 of function 21.
1015
    subfunction 1 of function 21.
1016
 
1016
 
1017
======================================================================
1017
======================================================================
1018
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1018
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1019
======================================================================
1019
======================================================================
1020
Parameters:
1020
Parameters:
1021
  * eax = 21 - function number
1021
  * eax = 21 - function number
1022
  * ebx = 1 - subfunction number
1022
  * ebx = 1 - subfunction number
1023
  * ecx = number of base port
1023
  * ecx = number of base port
1024
Returned value
1024
Returned value
1025
  * eax = 0 - success
1025
  * eax = 0 - success
1026
  * eax = -1 - erratic number of a port
1026
  * eax = -1 - erratic number of a port
1027
Remarks:
1027
Remarks:
1028
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1028
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1029
  * The installation of base is necessary for function 20.
1029
  * The installation of base is necessary for function 20.
1030
  * To get base port use subfunction 1 of function 26.
1030
  * To get base port use subfunction 1 of function 26.
1031
 
1031
 
1032
======================================================================
1032
======================================================================
1033
========== Function 21, subfunction 2 - set keyboard layout. =========
1033
========== Function 21, subfunction 2 - set keyboard layout. =========
1034
======================================================================
1034
======================================================================
1035
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1035
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1036
which will be read by function 2.
1036
which will be read by function 2.
1037
Parameters:
1037
Parameters:
1038
  * eax = 21 - function number
1038
  * eax = 21 - function number
1039
  * ebx = 2 - subfunction number
1039
  * ebx = 2 - subfunction number
1040
  * ecx = which layout to set:
1040
  * ecx = which layout to set:
1041
    * 1 = normal layout
1041
    * 1 = normal layout
1042
    * 2 = layout at pressed Shift
1042
    * 2 = layout at pressed Shift
1043
    * 3 = layout at pressed Alt
1043
    * 3 = layout at pressed Alt
1044
  * edx = pointer to layout - table of length 128 bytes
1044
  * edx = pointer to layout - table of length 128 bytes
1045
Or:
1045
Or:
1046
  * ecx = 9
1046
  * ecx = 9
1047
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1047
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1048
Returned value:
1048
Returned value:
1049
  * eax = 0 - success
1049
  * eax = 0 - success
1050
  * eax = 1 - incorrect parameter
1050
  * eax = 1 - incorrect parameter
1051
Remarks:
1051
Remarks:
1052
  * If Alt is pressed, the layout with Alt is used;
1052
  * If Alt is pressed, the layout with Alt is used;
1053
    if Alt is not pressed, but Shift is pressed,
1053
    if Alt is not pressed, but Shift is pressed,
1054
    the layout with Shift is used;
1054
    the layout with Shift is used;
1055
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1055
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1056
    layout is used and then from the code is subtracted 0x60;
1056
    layout is used and then from the code is subtracted 0x60;
1057
    if no control key is pressed, the normal layout is used.
1057
    if no control key is pressed, the normal layout is used.
1058
  * To get layout and country identifier use 
1058
  * To get layout and country identifier use 
1059
    subfunction 2 of function 26.
1059
    subfunction 2 of function 26.
1060
  * Country identifier is global system variable, which is not used
1060
  * Country identifier is global system variable, which is not used
1061
    by the kernel itself; however the application '@panel' displays
1061
    by the kernel itself; however the application '@panel' displays
1062
    the corresponding icon.
1062
    the corresponding icon.
1063
  * The application @panel switches layouts on user request.
1063
  * The application @panel switches layouts on user request.
1064
 
1064
 
1065
======================================================================
1065
======================================================================
1066
============== Function 21, subfunction 3 - set CD base. =============
1066
============== Function 21, subfunction 3 - set CD base. =============
1067
======================================================================
1067
======================================================================
1068
Parameters:
1068
Parameters:
1069
  * eax = 21 - function number
1069
  * eax = 21 - function number
1070
  * ebx = 3 - subfunction number
1070
  * ebx = 3 - subfunction number
1071
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1071
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1072
Returned value:
1072
Returned value:
1073
  * eax = 0
1073
  * eax = 0
1074
Remarks:
1074
Remarks:
1075
  * CD base is used by function 24.
1075
  * CD base is used by function 24.
1076
  * To get CD base use subfunction 3 of function 26.
1076
  * To get CD base use subfunction 3 of function 26.
1077
 
1077
 
1078
======================================================================
1078
======================================================================
1079
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
1079
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
1080
======================================================================
1080
======================================================================
1081
Parameters:
1081
Parameters:
1082
  * eax = 21 - function number
1082
  * eax = 21 - function number
1083
  * ebx = 4 - subfunction number
1083
  * ebx = 4 - subfunction number
1084
  * ecx = number of the base port
1084
  * ecx = number of the base port
1085
Returned value:
1085
Returned value:
1086
  * eax = 0 - success
1086
  * eax = 0 - success
1087
  * eax = -1 - erratic port number
1087
  * eax = -1 - erratic port number
1088
Remarks:
1088
Remarks:
1089
  * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1089
  * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1090
  * The installation of the base is necessary for
1090
  * The installation of the base is necessary for
1091
    functions 25, 28, 55.
1091
    functions 25, 28, 55.
1092
  * To get base port use subfunction 4 of function 26.
1092
  * To get base port use subfunction 4 of function 26.
1093
 
1093
 
1094
======================================================================
1094
======================================================================
1095
========== Function 21, subfunction 5 - set system language. =========
1095
========== Function 21, subfunction 5 - set system language. =========
1096
======================================================================
1096
======================================================================
1097
Parameters:
1097
Parameters:
1098
  * eax = 21 - function number
1098
  * eax = 21 - function number
1099
  * ebx = 5 - subfunction number
1099
  * ebx = 5 - subfunction number
1100
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1100
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1101
Returned value:
1101
Returned value:
1102
  * eax = 0
1102
  * eax = 0
1103
Remarks:
1103
Remarks:
1104
  * System language is global system variable and is not used
1104
  * System language is global system variable and is not used
1105
    by the kernel itself, however application @panel draws the
1105
    by the kernel itself, however application @panel draws the
1106
    appropriate icon.
1106
    appropriate icon.
1107
  * Function does not check for correctness, as the kernel does not
1107
  * Function does not check for correctness, as the kernel does not
1108
    use this variable.
1108
    use this variable.
1109
  * To get system language use subfunction 5 of function 26.
1109
  * To get system language use subfunction 5 of function 26.
1110
 
1110
 
1111
======================================================================
1111
======================================================================
1112
============== Function 21, subfunction 7 - set HD base. =============
1112
============== Function 21, subfunction 7 - set HD base. =============
1113
======================================================================
1113
======================================================================
1114
The HD base defines hard disk to write with usage of obsolete
1114
The HD base defines hard disk to write with usage of obsolete
1115
file system functions and functions implicitly using the hard disk
1115
syntax /HD in obsolete function 58; at usage of modern syntax
1116
(such as subfunction 6 of function 18);
-
 
1117
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
-
 
1118
these function set base themselves.
1116
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1119
Parameters:
1117
Parameters:
1120
  * eax = 21 - function number
1118
  * eax = 21 - function number
1121
  * ebx = 7 - subfunction number
1119
  * ebx = 7 - subfunction number
1122
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1120
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1123
Returned value:
1121
Returned value:
1124
  * eax = 0
1122
  * eax = 0
1125
Remarks:
1123
Remarks:
1126
  * Any application at any time can change the base.
1124
  * Any application at any time can change the base.
1127
  * Do not change base, when any application works with hard disk.
1125
  * Do not change base, when any application works with hard disk.
1128
    If you do not want system bugs.
1126
    If you do not want system bugs.
1129
  * To get HD base use subfunction 7 of function 26.
1127
  * To get HD base use subfunction 7 of function 26.
1130
  * It is also necessary to define used partition of hard disk by 
1128
  * It is also necessary to define used partition of hard disk by 
1131
    subfunction 8.
1129
    subfunction 8.
1132
 
1130
 
1133
======================================================================
1131
======================================================================
1134
========= Function 21, subfunction 8 - set used HD partition. ========
1132
========= Function 21, subfunction 8 - set used HD partition. ========
1135
======================================================================
1133
======================================================================
1136
The HD partition defines partition of the hard disk to write with
1134
The HD partition defines partition of the hard disk to write with
1137
usage of obsolete file system functions and functions implicitly
1135
usage of obsolete syntax /HD and obsolete function 58;
1138
using the hard disk (such as subfunction 6 of function 18);
-
 
1139
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1136
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1140
these functions set base and partition themselves.
1137
base and partition are set automatically.
1141
Parameters:
1138
Parameters:
1142
  * eax = 21 - function number
1139
  * eax = 21 - function number
1143
  * ebx = 8 - subfunction number
1140
  * ebx = 8 - subfunction number
1144
  * ecx = HD partition (beginning from 1)
1141
  * ecx = HD partition (beginning from 1)
1145
Return value:
1142
Return value:
1146
  * eax = 0
1143
  * eax = 0
1147
Remarks:
1144
Remarks:
1148
  * Any application at any time can change partition.
1145
  * Any application at any time can change partition.
1149
  * Do not change partition when any application works with hard disk.
1146
  * Do not change partition when any application works with hard disk.
1150
    If you do not want system bugs.
1147
    If you do not want system bugs.
1151
  * To get used partition use subfunction 8 of function 26.
1148
  * To get used partition use subfunction 8 of function 26.
1152
  * There is no correctness checks.
1149
  * There is no correctness checks.
1153
  * To get the number of partitions of a hard disk use 
1150
  * To get the number of partitions of a hard disk use 
1154
    subfunction 11 of function 18.
1151
    subfunction 11 of function 18.
1155
  * It is also necessary to define used HD base by subfunction 7.
1152
  * It is also necessary to define used HD base by subfunction 7.
1156
 
1153
 
1157
======================================================================
1154
======================================================================
1158
======== Function 21, subfunction 10 - set sound DMA channel. ========
1155
======== Function 21, subfunction 10 - set sound DMA channel. ========
1159
======================================================================
1156
======================================================================
1160
Parameters:
1157
Parameters:
1161
  * eax = 21 - function number
1158
  * eax = 21 - function number
1162
  * ebx = 10 - subfunction number
1159
  * ebx = 10 - subfunction number
1163
  * ecx = number of channel (from 0 up to 3 inclusively)
1160
  * ecx = number of channel (from 0 up to 3 inclusively)
1164
Returned value:
1161
Returned value:
1165
  * eax = 0 - success
1162
  * eax = 0 - success
1166
  * eax = -1 - incorrect channel number
1163
  * eax = -1 - incorrect channel number
1167
Remarks:
1164
Remarks:
1168
  * Number of DMA channel is used in subfunction 1 of function 55.
1165
  * Number of DMA channel is used in subfunction 1 of function 55.
1169
  * To get sound DMA channel use subfunction 10 of function 26.
1166
  * To get sound DMA channel use subfunction 10 of function 26.
1170
 
1167
 
1171
======================================================================
1168
======================================================================
1172
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1169
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1173
======================================================================
1170
======================================================================
1174
Parameters:
1171
Parameters:
1175
  * eax = 21 - function number
1172
  * eax = 21 - function number
1176
  * ebx = 11 - subfunction number
1173
  * ebx = 11 - subfunction number
1177
  * ecx = 0/1 - disable/enable
1174
  * ecx = 0/1 - disable/enable
1178
Returned value:
1175
Returned value:
1179
  * eax = 0
1176
  * eax = 0
1180
Remarks:
1177
Remarks:
1181
  * Is used in LBA-read (subfunction 8 of function 58).
1178
  * Is used in LBA-read (subfunction 8 of function 58).
1182
  * The current implementation uses only low bit of ecx.
1179
  * The current implementation uses only low bit of ecx.
1183
  * To get current status use subfunction 11 of function 26.
1180
  * To get current status use subfunction 11 of function 26.
1184
 
1181
 
1185
======================================================================
1182
======================================================================
1186
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1183
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1187
======================================================================
1184
======================================================================
1188
Parameters:
1185
Parameters:
1189
  * eax = 21 - function number
1186
  * eax = 21 - function number
1190
  * ebx = 12 - subfunction number
1187
  * ebx = 12 - subfunction number
1191
  * ecx = 0/1 - disable/enable
1188
  * ecx = 0/1 - disable/enable
1192
Returned value:
1189
Returned value:
1193
  * eax = 0
1190
  * eax = 0
1194
Remarks:
1191
Remarks:
1195
  * Is used in operations with PCI bus (function 62).
1192
  * Is used in operations with PCI bus (function 62).
1196
  * The current implementation uses only low bit of ecx.
1193
  * The current implementation uses only low bit of ecx.
1197
  * To get current status use subfunction 12 of function 26.
1194
  * To get current status use subfunction 12 of function 26.
1198
 
1195
 
1199
======================================================================
1196
======================================================================
1200
============ Function 21, subfunction 13, subsubfunction 1 ===========
1197
============ Function 21, subfunction 13, subsubfunction 1 ===========
1201
======== Initialize + get information on the driver vmode.mdr. =======
1198
======== Initialize + get information on the driver vmode.mdr. =======
1202
======================================================================
1199
======================================================================
1203
Parameters:
1200
Parameters:
1204
  * eax = 21 - function number
1201
  * eax = 21 - function number
1205
  * ebx = 13 - subfunction number
1202
  * ebx = 13 - subfunction number
1206
  * ecx = 1 - number of the driver function
1203
  * ecx = 1 - number of the driver function
1207
  * edx = pointer to 512-bytes buffer
1204
  * edx = pointer to 512-bytes buffer
1208
Returned value:
1205
Returned value:
1209
  * if driver is not loaded
1206
  * if driver is not loaded
1210
    (never happens in the current implementation):
1207
    (never happens in the current implementation):
1211
    * eax = -1
1208
    * eax = -1
1212
    * ebx, ecx destroyed
1209
    * ebx, ecx destroyed
1213
  * if driver is loaded:
1210
  * if driver is loaded:
1214
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1211
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1215
      - signature
1212
      - signature
1216
    * ebx = current frequency of the scanning (in Hz)
1213
    * ebx = current frequency of the scanning (in Hz)
1217
    * ecx destroyed
1214
    * ecx destroyed
1218
    * buffer pointed to by edx is filled
1215
    * buffer pointed to by edx is filled
1219
Format of the buffer:
1216
Format of the buffer:
1220
  * +0: 32*byte: driver name, "Trans VideoDriver"
1217
  * +0: 32*byte: driver name, "Trans VideoDriver"
1221
    (without quotes, supplemented by spaces)
1218
    (without quotes, supplemented by spaces)
1222
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1219
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1223
    y*65536+x), for the current implementation is 1 (1.0)
1220
    y*65536+x), for the current implementation is 1 (1.0)
1224
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1221
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1225
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1222
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1226
    is number of a videomode, after list itself there are zeroes)
1223
    is number of a videomode, after list itself there are zeroes)
1227
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1224
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1228
    scannings for videomodes: for each videomode listed in the
1225
    scannings for videomodes: for each videomode listed in the
1229
    previous field up to 5 supported frequences are given
1226
    previous field up to 5 supported frequences are given
1230
    (unused positions contain zeroes)
1227
    (unused positions contain zeroes)
1231
Remarks:
1228
Remarks:
1232
  * Function initializes the driver (if it is not initialized yet)
1229
  * Function initializes the driver (if it is not initialized yet)
1233
    and must be called first, before others (otherwise they will do
1230
    and must be called first, before others (otherwise they will do
1234
    nothing and return -1).
1231
    nothing and return -1).
1235
  * The current implementation supports only one frequency
1232
  * The current implementation supports only one frequency
1236
    of the scanning on videomode.
1233
    of the scanning on videomode.
1237
 
1234
 
1238
======================================================================
1235
======================================================================
1239
============ Function 21, subfunction 13, subsubfunction 2 ===========
1236
============ Function 21, subfunction 13, subsubfunction 2 ===========
1240
================ Get information on current videomode. ===============
1237
================ Get information on current videomode. ===============
1241
======================================================================
1238
======================================================================
1242
Parameters:
1239
Parameters:
1243
  * eax = 21 - function number
1240
  * eax = 21 - function number
1244
  * ebx = 13 - subfunction number
1241
  * ebx = 13 - subfunction number
1245
  * ecx = 2 - number of the driver function
1242
  * ecx = 2 - number of the driver function
1246
Returned value:
1243
Returned value:
1247
  * eax = -1 - driver is not loaded or not initialized;
1244
  * eax = -1 - driver is not loaded or not initialized;
1248
    ebx,ecx are destroyed
1245
    ebx,ecx are destroyed
1249
  * eax = [width]*65536 + [height]
1246
  * eax = [width]*65536 + [height]
1250
  * ebx = frequency of the vertical scanning (in Hz)
1247
  * ebx = frequency of the vertical scanning (in Hz)
1251
  * ecx = number of current videomode
1248
  * ecx = number of current videomode
1252
Remarks:
1249
Remarks:
1253
  * Driver must be initialized by call to 
1250
  * Driver must be initialized by call to 
1254
    driver function 1.
1251
    driver function 1.
1255
  * If only screen sizes are required, it is more expedient to use
1252
  * If only screen sizes are required, it is more expedient to use
1256
    function 14 taking into account that it
1253
    function 14 taking into account that it
1257
    returns sizes on 1 less.
1254
    returns sizes on 1 less.
1258
 
1255
 
1259
======================================================================
1256
======================================================================
1260
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1257
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1261
======================================================================
1258
======================================================================
1262
Parameters:
1259
Parameters:
1263
  * eax = 21 - function number
1260
  * eax = 21 - function number
1264
  * ebx = 13 - subfunction number
1261
  * ebx = 13 - subfunction number
1265
  * ecx = 3 - number of the driver function
1262
  * ecx = 3 - number of the driver function
1266
  * edx = [scanning frequency]*65536 + [videomode number]
1263
  * edx = [scanning frequency]*65536 + [videomode number]
1267
Returned value:
1264
Returned value:
1268
  * eax = -1 - driver is not loaded, not initialized or
1265
  * eax = -1 - driver is not loaded, not initialized or
1269
    an error has occured
1266
    an error has occured
1270
  * eax = 0 - success
1267
  * eax = 0 - success
1271
  * ebx, ecx destroyed
1268
  * ebx, ecx destroyed
1272
Remarks:
1269
Remarks:
1273
  * Driver must be initialized by driver function 1.
1270
  * Driver must be initialized by driver function 1.
1274
  * The videomode number and frequency must be in the table
1271
  * The videomode number and frequency must be in the table
1275
    returned by driver function 1.
1272
    returned by driver function 1.
1276
 
1273
 
1277
======================================================================
1274
======================================================================
1278
============ Function 21, subfunction 13, subsubfunction 4 ===========
1275
============ Function 21, subfunction 13, subsubfunction 4 ===========
1279
================== Return to the initial videomode. ==================
1276
================== Return to the initial videomode. ==================
1280
======================================================================
1277
======================================================================
1281
Returns the screen to the videomode set at system boot.
1278
Returns the screen to the videomode set at system boot.
1282
Parameters:
1279
Parameters:
1283
  * eax = 21 - function number
1280
  * eax = 21 - function number
1284
  * ebx = 13 - subfunction number
1281
  * ebx = 13 - subfunction number
1285
  * ecx = 4 - number of the driver function
1282
  * ecx = 4 - number of the driver function
1286
Returned value:
1283
Returned value:
1287
  * eax = -1 - driver is not loaded or not initialized
1284
  * eax = -1 - driver is not loaded or not initialized
1288
  * eax = 0 - success
1285
  * eax = 0 - success
1289
  * ebx, ecx destroyed
1286
  * ebx, ecx destroyed
1290
Remarks:
1287
Remarks:
1291
  * Driver must be initialized by call to driver function 1.
1288
  * Driver must be initialized by call to driver function 1.
1292
 
1289
 
1293
======================================================================
1290
======================================================================
1294
============ Function 21, subfunction 13, subsubfunction 5 ===========
1291
============ Function 21, subfunction 13, subsubfunction 5 ===========
1295
===== Increase/decrease the size of the visible area of monitor. =====
1292
===== Increase/decrease the size of the visible area of monitor. =====
1296
======================================================================
1293
======================================================================
1297
Parameters:
1294
Parameters:
1298
  * eax = 21 - function number
1295
  * eax = 21 - function number
1299
  * ebx = 13 - subfunction number
1296
  * ebx = 13 - subfunction number
1300
  * ecx = 5 - number of the driver function
1297
  * ecx = 5 - number of the driver function
1301
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1298
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1302
  * edx = 2/3 - is not supported in the current implementation;
1299
  * edx = 2/3 - is not supported in the current implementation;
1303
    is planned as decrease/increase vertical size on 1 position
1300
    is planned as decrease/increase vertical size on 1 position
1304
Returned value:
1301
Returned value:
1305
  * eax = -1 - driver is not loaded or not initialized
1302
  * eax = -1 - driver is not loaded or not initialized
1306
  * eax = 0 - success
1303
  * eax = 0 - success
1307
  * ebx, ecx destroyed
1304
  * ebx, ecx destroyed
1308
Remarks:
1305
Remarks:
1309
  * Driver must be initialized by call to driver function 1.
1306
  * Driver must be initialized by call to driver function 1.
1310
  * Function influences only the physical size of the screen image;
1307
  * Function influences only the physical size of the screen image;
1311
    the logical size (number of pixels) does not change.
1308
    the logical size (number of pixels) does not change.
1312
 
1309
 
1313
======================================================================
1310
======================================================================
1314
================= Function 22 - set system date/time. ================
1311
================= Function 22 - set system date/time. ================
1315
======================================================================
1312
======================================================================
1316
Parameters:
1313
Parameters:
1317
  * eax = 22 - function number
1314
  * eax = 22 - function number
1318
  * ebx = 0 - set time
1315
  * ebx = 0 - set time
1319
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1316
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1320
    * HH=hour 00..23
1317
    * HH=hour 00..23
1321
    * MM=minute 00..59
1318
    * MM=minute 00..59
1322
    * SS=second 00..59
1319
    * SS=second 00..59
1323
  * ebx = 1 - set date
1320
  * ebx = 1 - set date
1324
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1321
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1325
    * DD=day 01..31
1322
    * DD=day 01..31
1326
    * MM=month 01..12
1323
    * MM=month 01..12
1327
    * YY=year 00..99
1324
    * YY=year 00..99
1328
  * ebx = 2 - set day of week
1325
  * ebx = 2 - set day of week
1329
    * ecx = 1 for Sunday, ..., 7 for Saturday
1326
    * ecx = 1 for Sunday, ..., 7 for Saturday
1330
  * ebx = 3 - set alarm clock
1327
  * ebx = 3 - set alarm clock
1331
    * ecx = 0x00SSMMHH
1328
    * ecx = 0x00SSMMHH
1332
Returned value:
1329
Returned value:
1333
  * eax = 0 - success
1330
  * eax = 0 - success
1334
  * eax = 1 - incorrect parameter
1331
  * eax = 1 - incorrect parameter
1335
  * eax = 2 - CMOS-battery was unloaded
1332
  * eax = 2 - CMOS-battery was unloaded
1336
Remarks:
1333
Remarks:
1337
  * Value of installation of day of week seems to be doubtful,
1334
  * Value of installation of day of week seems to be doubtful,
1338
    as it a little where is used
1335
    as it a little where is used
1339
    (day of week can be calculated by date).
1336
    (day of week can be calculated by date).
1340
  * Alarm clock can be set on operation in the given time every day.
1337
  * Alarm clock can be set on operation in the given time every day.
1341
    But there is no existing system function to disable it.
1338
    But there is no existing system function to disable it.
1342
  * Operation of alarm clock consists in generation IRQ8.
1339
  * Operation of alarm clock consists in generation IRQ8.
1343
  * Generally CMOS supports for alarm clock set of value 0xFF
1340
  * Generally CMOS supports for alarm clock set of value 0xFF
1344
    as one of parameters and it means that the appropriate parameter
1341
    as one of parameters and it means that the appropriate parameter
1345
    is ignored. But current implementation does not allow this
1342
    is ignored. But current implementation does not allow this
1346
    (will return 1).
1343
    (will return 1).
1347
  * Alarm clock is a global system resource; the set of
1344
  * Alarm clock is a global system resource; the set of
1348
    an alarm clock cancels automatically the previous set.
1345
    an alarm clock cancels automatically the previous set.
1349
    However, at moment no program uses it.
1346
    However, at moment no program uses it.
1350
 
1347
 
1351
======================================================================
1348
======================================================================
1352
============= Function 23 - wait for event with timeout. =============
1349
============= Function 23 - wait for event with timeout. =============
1353
======================================================================
1350
======================================================================
1354
If the message queue is empty, waits for new message in the queue,
1351
If the message queue is empty, waits for new message in the queue,
1355
but no more than given time. Then reads out a message from the queue.
1352
but no more than given time. Then reads out a message from the queue.
1356
 
1353
 
1357
Parameters:
1354
Parameters:
1358
  * eax = 23 - function number
1355
  * eax = 23 - function number
1359
  * ebx = timeout (in 1/100 of second)
1356
  * ebx = timeout (in 1/100 of second)
1360
Returned value:
1357
Returned value:
1361
  * eax = 0 - the message queue is empty
1358
  * eax = 0 - the message queue is empty
1362
  * otherwise eax = event (see the list of events)
1359
  * otherwise eax = event (see the list of events)
1363
Remarks:
1360
Remarks:
1364
  * Only those events are taken into account, which enter into
1361
  * Only those events are taken into account, which enter into
1365
    the mask set by function 40. By default it is
1362
    the mask set by function 40. By default it is
1366
    redraw, key and button events.
1363
    redraw, key and button events.
1367
  * To check for presence of a message in the queue use function 11.
1364
  * To check for presence of a message in the queue use function 11.
1368
    To wait without timeout use function 10.
1365
    To wait without timeout use function 10.
1369
  * Transmission ebx=0 results in immediate returning eax=0.
1366
  * Transmission ebx=0 results in immediate returning eax=0.
1370
  * Current implementation returns immediately with eax=0,
1367
  * Current implementation returns immediately with eax=0,
1371
    if the addition of ebx with the current value of time counter
1368
    if the addition of ebx with the current value of time counter
1372
    makes 32-bit overflow.
1369
    makes 32-bit overflow.
1373
 
1370
 
1374
======================================================================
1371
======================================================================
1375
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1372
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1376
======================================================================
1373
======================================================================
1377
Parameters:
1374
Parameters:
1378
  * eax = 24 - function number
1375
  * eax = 24 - function number
1379
  * ebx = 1 - subfunction number
1376
  * ebx = 1 - subfunction number
1380
  * ecx = 0x00FRSSMM, where
1377
  * ecx = 0x00FRSSMM, where
1381
    * MM = starting minute
1378
    * MM = starting minute
1382
    * SS = starting second
1379
    * SS = starting second
1383
    * FR = starting frame
1380
    * FR = starting frame
1384
Returned value:
1381
Returned value:
1385
  * eax = 0 - success
1382
  * eax = 0 - success
1386
  * eax = 1 - CD base is not defined
1383
  * eax = 1 - CD base is not defined
1387
Remarks:
1384
Remarks:
1388
  * Previously CD base must be defined by the call to 
1385
  * Previously CD base must be defined by the call to 
1389
    subfunction 3 of function 21.
1386
    subfunction 3 of function 21.
1390
  * One second includes 75 frames, one minute includes 60 seconds.
1387
  * One second includes 75 frames, one minute includes 60 seconds.
1391
  * The function is asynchronous (returns control, when play begins).
1388
  * The function is asynchronous (returns control, when play begins).
1392
 
1389
 
1393
======================================================================
1390
======================================================================
1394
======= Function 24, subfunction 2 - get information on tracks. ======
1391
======= Function 24, subfunction 2 - get information on tracks. ======
1395
======================================================================
1392
======================================================================
1396
Parameters:
1393
Parameters:
1397
  * eax = 24 - function number
1394
  * eax = 24 - function number
1398
  * ebx = 2 - subfunction number
1395
  * ebx = 2 - subfunction number
1399
  * ecx = pointer to the buffer for the table
1396
  * ecx = pointer to the buffer for the table
1400
    (maximum 8*64h+4 bytes=100 tracks)
1397
    (maximum 8*64h+4 bytes=100 tracks)
1401
Returned value:
1398
Returned value:
1402
  * eax = 0 - success
1399
  * eax = 0 - success
1403
  * eax = 1 - CD base is not defined
1400
  * eax = 1 - CD base is not defined
1404
Remarks:
1401
Remarks:
1405
  * The format of the table with tracks information is the same as
1402
  * The format of the table with tracks information is the same as
1406
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1403
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1407
    Function returns addresses in MSF.
1404
    Function returns addresses in MSF.
1408
  * Previously CD base port must be set by call to 
1405
  * Previously CD base port must be set by call to 
1409
    subfunction 3 of function 21.
1406
    subfunction 3 of function 21.
1410
  * Function returns information only about no more than 100
1407
  * Function returns information only about no more than 100
1411
    first tracks. In most cases it is enough.
1408
    first tracks. In most cases it is enough.
1412
 
1409
 
1413
======================================================================
1410
======================================================================
1414
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1411
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1415
======================================================================
1412
======================================================================
1416
Parameters:
1413
Parameters:
1417
  * eax = 24 - function number
1414
  * eax = 24 - function number
1418
  * ebx = 1 - subfunction number
1415
  * ebx = 1 - subfunction number
1419
Returned value:
1416
Returned value:
1420
  * eax = 0 - success
1417
  * eax = 0 - success
1421
  * eax = 1 - CD base is not defined
1418
  * eax = 1 - CD base is not defined
1422
Çàìå÷àíèÿ:
1419
Çàìå÷àíèÿ:
1423
  * Previously CD base port must be defined by call to 
1420
  * Previously CD base port must be defined by call to 
1424
    subfunction 3 of function 21.
1421
    subfunction 3 of function 21.
1425
 
1422
 
1426
======================================================================
1423
======================================================================
1427
=================== Function 25 - set SBPro volume. ==================
1424
=================== Function 25 - set SBPro volume. ==================
1428
======================================================================
1425
======================================================================
1429
Parameters:
1426
Parameters:
1430
  * eax = 25 - function number
1427
  * eax = 25 - function number
1431
  * ebx = what to set:
1428
  * ebx = what to set:
1432
    * 1 - set common volume
1429
    * 1 - set common volume
1433
    * 2 - set CD-audio volume
1430
    * 2 - set CD-audio volume
1434
  * cl = volume level: high 4 bits for the left column,
1431
  * cl = volume level: high 4 bits for the left column,
1435
    low 4 bits for the right one
1432
    low 4 bits for the right one
1436
Returned value:
1433
Returned value:
1437
  * eax = 0 - success
1434
  * eax = 0 - success
1438
  * eax = 1 - SB base is not defined
1435
  * eax = 1 - SB base is not defined
1439
  * eax = 2 - incorrect subfunction
1436
  * eax = 2 - incorrect subfunction
1440
Remarks:
1437
Remarks:
1441
  * Previously SB base port must be defined by 
1438
  * Previously SB base port must be defined by 
1442
    subfunction 4 of function 21.
1439
    subfunction 4 of function 21.
1443
  * See also function 28 which sets
1440
  * See also function 28 which sets
1444
    volume for the later standard SB16.
1441
    volume for the later standard SB16.
1445
 
1442
 
1446
======================================================================
1443
======================================================================
1447
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1444
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1448
======================================================================
1445
======================================================================
1449
Parameters:
1446
Parameters:
1450
  * eax = 26 - function number
1447
  * eax = 26 - function number
1451
  * ebx = 1 - subfunction number
1448
  * ebx = 1 - subfunction number
1452
Returned value:
1449
Returned value:
1453
  * eax = port number
1450
  * eax = port number
1454
Parameters:
1451
Parameters:
1455
  * To set base port use subfunction 1 of function 21.
1452
  * To set base port use subfunction 1 of function 21.
1456
 
1453
 
1457
======================================================================
1454
======================================================================
1458
========== Function 26, subfunction 2 - get keyboard layout. =========
1455
========== Function 26, subfunction 2 - get keyboard layout. =========
1459
======================================================================
1456
======================================================================
1460
The keyboard layout is used to convert keyboard scancodes to
1457
The keyboard layout is used to convert keyboard scancodes to
1461
ASCII-codes for function 2.
1458
ASCII-codes for function 2.
1462
Parameters:
1459
Parameters:
1463
  * eax = 26 - function number
1460
  * eax = 26 - function number
1464
  * ebx = 2 - subfunction number
1461
  * ebx = 2 - subfunction number
1465
  * ecx = what layout to get:
1462
  * ecx = what layout to get:
1466
    * 1 = normal layout
1463
    * 1 = normal layout
1467
    * 2 = layout with pressed Shift
1464
    * 2 = layout with pressed Shift
1468
    * 3 = layout with pressed Alt
1465
    * 3 = layout with pressed Alt
1469
  * edx = pointer to the 128-bytes buffer, where the layout will be
1466
  * edx = pointer to the 128-bytes buffer, where the layout will be
1470
    copied
1467
    copied
1471
Returned value:
1468
Returned value:
1472
  * function does not return value
1469
  * function does not return value
1473
Or:
1470
Or:
1474
  * eax = 26 - function number
1471
  * eax = 26 - function number
1475
  * ebx = 2 - subfunction number
1472
  * ebx = 2 - subfunction number
1476
  * ecx = 9
1473
  * ecx = 9
1477
Returned value:
1474
Returned value:
1478
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1475
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1479
Remarks:
1476
Remarks:
1480
  * If Alt is pressed, the layout with Alt is used;
1477
  * If Alt is pressed, the layout with Alt is used;
1481
    if Alt is not pressed, but Shift is pressed,
1478
    if Alt is not pressed, but Shift is pressed,
1482
    the layout with Shift is used;
1479
    the layout with Shift is used;
1483
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1480
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1484
    layout is used and then from the code is subtracted 0x60;
1481
    layout is used and then from the code is subtracted 0x60;
1485
    if no control key is pressed, the normal layout is used.
1482
    if no control key is pressed, the normal layout is used.
1486
  * To set layout and country identifier use 
1483
  * To set layout and country identifier use 
1487
    subfunction 2 of function 21.
1484
    subfunction 2 of function 21.
1488
  * Country identifier is global system variable, which is not used
1485
  * Country identifier is global system variable, which is not used
1489
    by the kernel itself; however the application '@panel' displays
1486
    by the kernel itself; however the application '@panel' displays
1490
    the corresponding icon (using this function).
1487
    the corresponding icon (using this function).
1491
  * The application @panel switches layouts on user request.
1488
  * The application @panel switches layouts on user request.
1492
 
1489
 
1493
======================================================================
1490
======================================================================
1494
============== Function 26, subfunction 3 - get CD base. =============
1491
============== Function 26, subfunction 3 - get CD base. =============
1495
======================================================================
1492
======================================================================
1496
Parameters:
1493
Parameters:
1497
  * eax = 26 - function number
1494
  * eax = 26 - function number
1498
  * ebx = 3 - subfunction number
1495
  * ebx = 3 - subfunction number
1499
Returned value:
1496
Returned value:
1500
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1497
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1501
Remarks:
1498
Remarks:
1502
  * CD base is used by function 24.
1499
  * CD base is used by function 24.
1503
  * To set CD base use subfunction 3 of function 21.
1500
  * To set CD base use subfunction 3 of function 21.
1504
 
1501
 
1505
======================================================================
1502
======================================================================
1506
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
1503
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
1507
======================================================================
1504
======================================================================
1508
Parameters:
1505
Parameters:
1509
  * eax = 26 - function number
1506
  * eax = 26 - function number
1510
  * ebx = 4 - subfunction number
1507
  * ebx = 4 - subfunction number
1511
Returned value:
1508
Returned value:
1512
  * eax = base port number
1509
  * eax = base port number
1513
Remarks:
1510
Remarks:
1514
  * Bae port is used by functions 25, 55.
1511
  * Bae port is used by functions 25, 55.
1515
  * To set base port use subfunction 4 of function 21.
1512
  * To set base port use subfunction 4 of function 21.
1516
 
1513
 
1517
======================================================================
1514
======================================================================
1518
========== Function 26, subfunction 5 - get system language. =========
1515
========== Function 26, subfunction 5 - get system language. =========
1519
======================================================================
1516
======================================================================
1520
Parameters:
1517
Parameters:
1521
  * eax = 26 - function number
1518
  * eax = 26 - function number
1522
  * ebx = 5 - subfunction number
1519
  * ebx = 5 - subfunction number
1523
Returned value:
1520
Returned value:
1524
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1521
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1525
Remarks:
1522
Remarks:
1526
  * System language is global system variable and is not used
1523
  * System language is global system variable and is not used
1527
    by the kernel itself, however application @panel draws the
1524
    by the kernel itself, however application @panel draws the
1528
    appropriate icon (using this function).
1525
    appropriate icon (using this function).
1529
  * To set system language use subfunction 5 of function 21.
1526
  * To set system language use subfunction 5 of function 21.
1530
 
1527
 
1531
======================================================================
1528
======================================================================
1532
============== Function 26, subfunction 7 - get HD base. =============
1529
============== Function 26, subfunction 7 - get HD base. =============
1533
======================================================================
1530
======================================================================
1534
The HD base defines hard disk to write with usage of obsolete
1531
The HD base defines hard disk to write with usage of obsolete
1535
file system functions and functions implicitly using the hard disk
1532
syntax /HD in obsolete function 58; at usage of modern syntax
1536
(such as subfunction 6 of function 18);
-
 
1537
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
-
 
1538
these function set base themselves.
1533
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1539
Parameters:
1534
Parameters:
1540
  * eax = 26 - function number
1535
  * eax = 26 - function number
1541
  * ebx = 7 - subfunction number
1536
  * ebx = 7 - subfunction number
1542
Returned value:
1537
Returned value:
1543
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1538
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1544
Remarks:
1539
Remarks:
1545
  * Any application in any time can change HD base.
1540
  * Any application in any time can change HD base.
1546
  * To set base use subfunction 7 of function 21.
1541
  * To set base use subfunction 7 of function 21.
1547
  * To get used partition of hard disk use subfunction 8.
1542
  * To get used partition of hard disk use subfunction 8.
1548
 
1543
 
1549
======================================================================
1544
======================================================================
1550
========= Function 26, subfunction 8 - get used HD partition. ========
1545
========= Function 26, subfunction 8 - get used HD partition. ========
1551
======================================================================
1546
======================================================================
1552
The HD partition defines partition of the hard disk to write with
1547
The HD partition defines partition of the hard disk to write with
1553
usage of obsolete file system functions and functions implicitly
1548
usage of obsolete syntax /HD in obsolete function 58;
1554
using the hard disk (such as subfunction 6 of function 18);
-
 
1555
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1549
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1556
these functions set base and partition themselves.
1550
base and partition are set automatically.
1557
Parameters:
1551
Parameters:
1558
  * eax = 26 - function number
1552
  * eax = 26 - function number
1559
  * ebx = 8 - subfunction number
1553
  * ebx = 8 - subfunction number
1560
Returned value:
1554
Returned value:
1561
  * eax = HD partition (beginning from 1)
1555
  * eax = HD partition (beginning from 1)
1562
Remarks:
1556
Remarks:
1563
  * Any application in any time can change partition.
1557
  * Any application in any time can change partition.
1564
  * To set partition use subfunction 8 of function 21.
1558
  * To set partition use subfunction 8 of function 21.
1565
  * To get number of partitions on a hard disk use
1559
  * To get number of partitions on a hard disk use
1566
    subfunction 11 of function 18.
1560
    subfunction 11 of function 18.
1567
  * To get base of used hard disk, use subfunction 7.
1561
  * To get base of used hard disk, use subfunction 7.
1568
 
1562
 
1569
======================================================================
1563
======================================================================
1570
=== Function 26, subfunction 9 - get the value of the time counter. ==
1564
=== Function 26, subfunction 9 - get the value of the time counter. ==
1571
======================================================================
1565
======================================================================
1572
Parameters:
1566
Parameters:
1573
  * eax = 26 - function number
1567
  * eax = 26 - function number
1574
  * ebx = 9 - subfunction number
1568
  * ebx = 9 - subfunction number
1575
Returned value:
1569
Returned value:
1576
  * eax = number of 1/100s of second, past from the system boot time
1570
  * eax = number of 1/100s of second, past from the system boot time
1577
Remarks:
1571
Remarks:
1578
  * Counter takes modulo 2^32, that correspond to a little more
1572
  * Counter takes modulo 2^32, that correspond to a little more
1579
    than 497 days.
1573
    than 497 days.
1580
  * To get system time use function 3.
1574
  * To get system time use function 3.
1581
 
1575
 
1582
======================================================================
1576
======================================================================
1583
======== Function 26, subfunction 10 - get sound DMA channel. ========
1577
======== Function 26, subfunction 10 - get sound DMA channel. ========
1584
======================================================================
1578
======================================================================
1585
Parameters:
1579
Parameters:
1586
  * eax = 26 - function number
1580
  * eax = 26 - function number
1587
  * ebx = 10 - subfunction number
1581
  * ebx = 10 - subfunction number
1588
Returned value:
1582
Returned value:
1589
  * eax = number of the channel (from 0 to 3 inclusive)
1583
  * eax = number of the channel (from 0 to 3 inclusive)
1590
Remarks:
1584
Remarks:
1591
  * Number of the DMA channel is used by subfunction 1 of function 55.
1585
  * Number of the DMA channel is used by subfunction 1 of function 55.
1592
  * To set the sound DMA channel use subfunction 10 of function 21.
1586
  * To set the sound DMA channel use subfunction 10 of function 21.
1593
 
1587
 
1594
======================================================================
1588
======================================================================
1595
===================== Function 26, subfunction 11 ====================
1589
===================== Function 26, subfunction 11 ====================
1596
========== Find out whether low-level HD access is enabled. ==========
1590
========== Find out whether low-level HD access is enabled. ==========
1597
======================================================================
1591
======================================================================
1598
Parameters:
1592
Parameters:
1599
  * eax = 26 - function number
1593
  * eax = 26 - function number
1600
  * ebx = 11 - subfunction number
1594
  * ebx = 11 - subfunction number
1601
Returned value:
1595
Returned value:
1602
  * eax = 0/1 - disabled/enabled
1596
  * eax = 0/1 - disabled/enabled
1603
Remarks:
1597
Remarks:
1604
  * Is used in LBA read (subfunction 8 of function 58).
1598
  * Is used in LBA read (subfunction 8 of function 58).
1605
  * To set current state use subfunction 11 of function 21.
1599
  * To set current state use subfunction 11 of function 21.
1606
 
1600
 
1607
======================================================================
1601
======================================================================
1608
===================== Function 26, subfunction 12 ====================
1602
===================== Function 26, subfunction 12 ====================
1609
========== Find out whether low-level PCI access is enabled. =========
1603
========== Find out whether low-level PCI access is enabled. =========
1610
======================================================================
1604
======================================================================
1611
Parameters:
1605
Parameters:
1612
  * eax = 26 - function number
1606
  * eax = 26 - function number
1613
  * ebx = 12 - subfunction number
1607
  * ebx = 12 - subfunction number
1614
Returned value:
1608
Returned value:
1615
  * eax = 0/1 - disabled/enabled
1609
  * eax = 0/1 - disabled/enabled
1616
Remarks:
1610
Remarks:
1617
  * Is used by operations with PCI bus (function 62).
1611
  * Is used by operations with PCI bus (function 62).
1618
  * The current implementation uses only low bit of ecx.
1612
  * The current implementation uses only low bit of ecx.
1619
  * To set the current state use subfunction 12 of function 21.
1613
  * To set the current state use subfunction 12 of function 21.
1620
 
1614
 
1621
======================================================================
1615
======================================================================
1622
=================== Function 28 - set SB16 volume. ===================
1616
=================== Function 28 - set SB16 volume. ===================
1623
======================================================================
1617
======================================================================
1624
Parameters:
1618
Parameters:
1625
  * eax = 28 - function number
1619
  * eax = 28 - function number
1626
  * ebx = what to install:
1620
  * ebx = what to install:
1627
    * 1 - install common volume
1621
    * 1 - install common volume
1628
    * 2 - install CD-audio volume
1622
    * 2 - install CD-audio volume
1629
  * cl = volume level (0=off, 0xFF=max)
1623
  * cl = volume level (0=off, 0xFF=max)
1630
Returned value:
1624
Returned value:
1631
  * eax = 0 - success
1625
  * eax = 0 - success
1632
  * eax = 1 - SB base is not defined
1626
  * eax = 1 - SB base is not defined
1633
  * eax = 2 - incorrect subfunction
1627
  * eax = 2 - incorrect subfunction
1634
Remarks:
1628
Remarks:
1635
  * Previously SB base port must be defined by
1629
  * Previously SB base port must be defined by
1636
    subfunction 4 of function 21.
1630
    subfunction 4 of function 21.
1637
  * This function gives more variants for volume, that function 25.
1631
  * This function gives more variants for volume, that function 25.
1638
 
1632
 
1639
======================================================================
1633
======================================================================
1640
=================== Function 29 - get system date. ===================
1634
=================== Function 29 - get system date. ===================
1641
======================================================================
1635
======================================================================
1642
Parameters:
1636
Parameters:
1643
  * eax = 29 - function number
1637
  * eax = 29 - function number
1644
Returned value:
1638
Returned value:
1645
  * eax = 0x00DDMMYY, where
1639
  * eax = 0x00DDMMYY, where
1646
    (binary-decimal coding, BCD, is used)
1640
    (binary-decimal coding, BCD, is used)
1647
  * YY = two low digits of year (00..99)
1641
  * YY = two low digits of year (00..99)
1648
  * MM = month (01..12)
1642
  * MM = month (01..12)
1649
  * DD = day (01..31)
1643
  * DD = day (01..31)
1650
Remarks:
1644
Remarks:
1651
  * To set system date use function 22.
1645
  * To set system date use function 22.
1652
 
1646
 
1653
======================================================================
1647
======================================================================
1654
=============== Function 32 - delete file from ramdisk. ==============
1648
=============== Function 32 - delete file from ramdisk. ==============
1655
======================================================================
1649
======================================================================
1656
Parameters:
1650
Parameters:
1657
  * eax = 32 - function number
1651
  * eax = 32 - function number
1658
  * ebx = pointer to the filename
1652
  * ebx = pointer to the filename
1659
Returned value:
1653
Returned value:
1660
  * eax = 0 - success; otherwise file system error code
1654
  * eax = 0 - success; otherwise file system error code
1661
Remarks:
1655
Remarks:
1662
  * This function is obsolete; function 58 allows to fulfill
1656
  * This function is obsolete; function 58 allows to fulfill
1663
    the same operations with the extended possibilities.
1657
    the same operations with the extended possibilities.
1664
  * The current implementation returns only values 0(success) and
1658
  * The current implementation returns only values 0(success) and
1665
    5(file not found).
1659
    5(file not found).
1666
  * The filename must be either in the format 8+3 characters
1660
  * The filename must be either in the format 8+3 characters
1667
    (first 8 characters - name itself, last 3 - extension,
1661
    (first 8 characters - name itself, last 3 - extension,
1668
    the short names and extensions are supplemented with spaces),
1662
    the short names and extensions are supplemented with spaces),
1669
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1663
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1670
    (name no more than 8 characters, dot, extension 3 characters
1664
    (name no more than 8 characters, dot, extension 3 characters
1671
    supplemented if necessary by spaces).
1665
    supplemented if necessary by spaces).
1672
    The filename must be written with capital letters. The terminating
1666
    The filename must be written with capital letters. The terminating
1673
    character with code 0 is not necessary (not ASCIIZ-string).
1667
    character with code 0 is not necessary (not ASCIIZ-string).
1674
  * This function does not support folders on the ramdisk.
1668
  * This function does not support folders on the ramdisk.
1675
 
1669
 
1676
======================================================================
1670
======================================================================
1677
================ Function 33 - write file to ramdisk. ================
1671
================ Function 33 - write file to ramdisk. ================
1678
======================================================================
1672
======================================================================
1679
Parameters:
1673
Parameters:
1680
  * eax = 33 - function number
1674
  * eax = 33 - function number
1681
  * ebx = pointer to the filename
1675
  * ebx = pointer to the filename
1682
  * ecx = pointer to data for writing
1676
  * ecx = pointer to data for writing
1683
  * edx = number of bytes for writing
1677
  * edx = number of bytes for writing
1684
  * should be set esi=0
1678
  * should be set esi=0
1685
Returned value:
1679
Returned value:
1686
  * eax = 0 - success, otherwise file system error code
1680
  * eax = 0 - success, otherwise file system error code
1687
Remarks:
1681
Remarks:
1688
  * This function is obsolete; function 70 allows to fulfil
1682
  * This function is obsolete; function 70 allows to fulfil
1689
    the same operations with extended possibilities.
1683
    the same operations with extended possibilities.
1690
  * If esi contains non-zero value and selected file already exists,
1684
  * If esi contains non-zero value and selected file already exists,
1691
    one more file with the same name will be created.
1685
    one more file with the same name will be created.
1692
  * Otherwise file will be overwritten.
1686
  * Otherwise file will be overwritten.
1693
  * The filename must be either in the format 8+3 characters
1687
  * The filename must be either in the format 8+3 characters
1694
    (first 8 characters - name itself, last 3 - extension,
1688
    (first 8 characters - name itself, last 3 - extension,
1695
    the short names and extensions are supplemented with spaces),
1689
    the short names and extensions are supplemented with spaces),
1696
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1690
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1697
    (name no more than 8 characters, dot, extension 3 characters
1691
    (name no more than 8 characters, dot, extension 3 characters
1698
    supplemented if necessary by spaces).
1692
    supplemented if necessary by spaces).
1699
    The filename must be written with capital letters. The terminating
1693
    The filename must be written with capital letters. The terminating
1700
    character with code 0 is not necessary (not ASCIIZ-string).
1694
    character with code 0 is not necessary (not ASCIIZ-string).
1701
  * This function does not support folders on the ramdisk.
1695
  * This function does not support folders on the ramdisk.
1702
 
1696
 
1703
======================================================================
1697
======================================================================
1704
======= Function 35 - read the color of a pixel on the screen. =======
1698
======= Function 35 - read the color of a pixel on the screen. =======
1705
======================================================================
1699
======================================================================
1706
Parameters:
1700
Parameters:
1707
  * eax = 35
1701
  * eax = 35
1708
  * ebx = y*xsize+x, where
1702
  * ebx = y*xsize+x, where
1709
  * (x,y) = coordinates of a pixel (beginning from 0)
1703
  * (x,y) = coordinates of a pixel (beginning from 0)
1710
  * xsize = horizontal screen size
1704
  * xsize = horizontal screen size
1711
Returned value:
1705
Returned value:
1712
  * eax = color 0x00RRGGBB
1706
  * eax = color 0x00RRGGBB
1713
Remarks:
1707
Remarks:
1714
  * To get screen sizes use function 14. Pay attention,
1708
  * To get screen sizes use function 14. Pay attention,
1715
    that it subtracts 1 from both sizes.
1709
    that it subtracts 1 from both sizes.
1716
  * There is also direct access (without any system calls)
1710
  * There is also direct access (without any system calls)
1717
    to videomemory through the selector gs. To get parameters of
1711
    to videomemory through the selector gs. To get parameters of
1718
    the current videomode, use function 61.
1712
    the current videomode, use function 61.
1719
 
1713
 
1720
======================================================================
1714
======================================================================
1721
=================== Function 37 - work with mouse. ===================
1715
=================== Function 37 - work with mouse. ===================
1722
======================================================================
1716
======================================================================
1723
 
1717
 
1724
---------- Subfunction 0 - screen coordinates of the mouse -----------
1718
---------- Subfunction 0 - screen coordinates of the mouse -----------
1725
Parameters:
1719
Parameters:
1726
  * eax = 37 - function number
1720
  * eax = 37 - function number
1727
  * ebx = 0 - subfunction number
1721
  * ebx = 0 - subfunction number
1728
Returned value:
1722
Returned value:
1729
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1723
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1730
    (beginning from 0)
1724
    (beginning from 0)
1731
 
1725
 
1732
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1726
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1733
Parameters:
1727
Parameters:
1734
  * eax = 37 - function number
1728
  * eax = 37 - function number
1735
  * ebx = 1 - subfunction number
1729
  * ebx = 1 - subfunction number
1736
Returned value:
1730
Returned value:
1737
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1731
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1738
    relative to the application window (beginning from 0)
1732
    relative to the application window (beginning from 0)
1739
Remarks:
1733
Remarks:
1740
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1734
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1741
    If y>=ywnd, the low word is non-negative and contains
1735
    If y>=ywnd, the low word is non-negative and contains
1742
    relative y-coordinate, and the high word - relative x-coordinate
1736
    relative y-coordinate, and the high word - relative x-coordinate
1743
    (with correct sign). Otherwise the low word is negative and still
1737
    (with correct sign). Otherwise the low word is negative and still
1744
    contains relative y-coordinate, and to the high word
1738
    contains relative y-coordinate, and to the high word
1745
    1 should be added.
1739
    1 should be added.
1746
 
1740
 
1747
------------ Subfunction 2 - pressed buttons of the mouse ------------
1741
------------ Subfunction 2 - pressed buttons of the mouse ------------
1748
Parameters:
1742
Parameters:
1749
  * eax = 37 - function number
1743
  * eax = 37 - function number
1750
  * ebx = 2 - subfunction number
1744
  * ebx = 2 - subfunction number
1751
Returned value:
1745
Returned value:
1752
  * eax contains information on the pressed mouse buttons:
1746
  * eax contains information on the pressed mouse buttons:
1753
  * bit 0 is set = left button is pressed
1747
  * bit 0 is set = left button is pressed
1754
  * bit 1 is set = right button is pressed
1748
  * bit 1 is set = right button is pressed
1755
  * other bits are cleared
1749
  * other bits are cleared
1756
 
1750
 
1757
-------------------- Subfunction 4 - load cursor ---------------------
1751
-------------------- Subfunction 4 - load cursor ---------------------
1758
Parameters:
1752
Parameters:
1759
  * eax = 37 - function number
1753
  * eax = 37 - function number
1760
  * ebx = 4 - subfunction number
1754
  * ebx = 4 - subfunction number
1761
  * dx = data source:
1755
  * dx = data source:
1762
  * dx = LOAD_FROM_FILE = 0 - data in a file
1756
  * dx = LOAD_FROM_FILE = 0 - data in a file
1763
    * ecx = pointer to full path to the cursor file
1757
    * ecx = pointer to full path to the cursor file
1764
    * the file must be in the format .cur, which is standard for
1758
    * the file must be in the format .cur, which is standard for
1765
      MS Windows, at that of the size 32*32 pixels
1759
      MS Windows, at that of the size 32*32 pixels
1766
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1760
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1767
    * ecx = pointer to data of the cursor file
1761
    * ecx = pointer to data of the cursor file
1768
    * the data format is the same as in the previous case
1762
    * the data format is the same as in the previous case
1769
  * dx = LOAD_INDIRECT = 2 - data in memory
1763
  * dx = LOAD_INDIRECT = 2 - data in memory
1770
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1764
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1771
    * edx = 0xXXYY0002, where
1765
    * edx = 0xXXYY0002, where
1772
      * XX = x-coordinate of cursor hotspot
1766
      * XX = x-coordinate of cursor hotspot
1773
      * YY = y-coordinate
1767
      * YY = y-coordinate
1774
      * 0 <= XX, YY <= 31
1768
      * 0 <= XX, YY <= 31
1775
Returned value:
1769
Returned value:
1776
  * eax = 0 - failed
1770
  * eax = 0 - failed
1777
  * otherwise eax = cursor handle
1771
  * otherwise eax = cursor handle
1778
 
1772
 
1779
--------------------- Subfunction 5 - set cursor ---------------------
1773
--------------------- Subfunction 5 - set cursor ---------------------
1780
Sets new cursor for the window of the current thread.
1774
Sets new cursor for the window of the current thread.
1781
Parameters:
1775
Parameters:
1782
  * eax = 37 - function number
1776
  * eax = 37 - function number
1783
  * ebx = 5 - subfunction number
1777
  * ebx = 5 - subfunction number
1784
  * ecx = cursor handle
1778
  * ecx = cursor handle
1785
Returned value:
1779
Returned value:
1786
  * eax = handle of previous cursor
1780
  * eax = handle of previous cursor
1787
Remarks:
1781
Remarks:
1788
  * If the handle is incorrect, the function restores the default
1782
  * If the handle is incorrect, the function restores the default
1789
    cursor (standard arrow). In particular, ecx=0 restores it.
1783
    cursor (standard arrow). In particular, ecx=0 restores it.
1790
 
1784
 
1791
------------------- Subfunction 6 - delete cursor --------------------
1785
------------------- Subfunction 6 - delete cursor --------------------
1792
Parameters:
1786
Parameters:
1793
  * eax = 37 - function number
1787
  * eax = 37 - function number
1794
  * ebx = 6 - subfunction number
1788
  * ebx = 6 - subfunction number
1795
  * ecx = cursor handle
1789
  * ecx = cursor handle
1796
Returned value:
1790
Returned value:
1797
  * eax destroyed
1791
  * eax destroyed
1798
Remarks:
1792
Remarks:
1799
  * The cursor must be loaded previously by the current thread
1793
  * The cursor must be loaded previously by the current thread
1800
    (with the call to subfunction 4). The function does not delete
1794
    (with the call to subfunction 4). The function does not delete
1801
    system cursors and cursors, loaded by another applications.
1795
    system cursors and cursors, loaded by another applications.
1802
  * If the active cursor (set by subfunction 5) is deleted,
1796
  * If the active cursor (set by subfunction 5) is deleted,
1803
    the system restores the default cursor (standard arrow).
1797
    the system restores the default cursor (standard arrow).
1804
 
1798
 
1805
======================================================================
1799
======================================================================
1806
====================== Function 38 - draw line. ======================
1800
====================== Function 38 - draw line. ======================
1807
======================================================================
1801
======================================================================
1808
Parameters:
1802
Parameters:
1809
  * eax = 38 - function number
1803
  * eax = 38 - function number
1810
  * ebx = [start coordinate on axis x]*65536 +
1804
  * ebx = [start coordinate on axis x]*65536 +
1811
              [end coordinate on axis x]
1805
              [end coordinate on axis x]
1812
  * ecx = [start coordinate on axis y]*65536 +
1806
  * ecx = [start coordinate on axis y]*65536 +
1813
              [end coordinate on axis y]
1807
              [end coordinate on axis y]
1814
  * edx = 0x00RRGGBB - color
1808
  * edx = 0x00RRGGBB - color
1815
    edx = 0x01xxxxxx - draw inversed line
1809
    edx = 0x01xxxxxx - draw inversed line
1816
          (low 24 bits are ignored)
1810
          (low 24 bits are ignored)
1817
Returned value:
1811
Returned value:
1818
  * function does not return value
1812
  * function does not return value
1819
Remarks:
1813
Remarks:
1820
  * Coordinates are relative to the window.
1814
  * Coordinates are relative to the window.
1821
  * End point is also drawn.
1815
  * End point is also drawn.
1822
 
1816
 
1823
======================================================================
1817
======================================================================
1824
== Function 39, subfunction 1 - get a size of the background image. ==
1818
== Function 39, subfunction 1 - get a size of the background image. ==
1825
======================================================================
1819
======================================================================
1826
Parameters:
1820
Parameters:
1827
  * eax = 39 - function number
1821
  * eax = 39 - function number
1828
  * ebx = 1 - subfunction number
1822
  * ebx = 1 - subfunction number
1829
Returned value:
1823
Returned value:
1830
  * eax = [width]*65536 + [height]
1824
  * eax = [width]*65536 + [height]
1831
Remarks:
1825
Remarks:
1832
  * There is a pair function to set sizes of background image -
1826
  * There is a pair function to set sizes of background image -
1833
    subfunction 1 of function 15. After which it is necessary,
1827
    subfunction 1 of function 15. After which it is necessary,
1834
    of course, anew to define image.
1828
    of course, anew to define image.
1835
 
1829
 
1836
======================================================================
1830
======================================================================
1837
== Function 39, subfunction 2 - get pixel from the background image. =
1831
== Function 39, subfunction 2 - get pixel from the background image. =
1838
======================================================================
1832
======================================================================
1839
Parameters:
1833
Parameters:
1840
  * eax = 39 - function number
1834
  * eax = 39 - function number
1841
  * ebx = 2 - subfunction number
1835
  * ebx = 2 - subfunction number
1842
  * ecx = offset
1836
  * ecx = offset
1843
Returned value:
1837
Returned value:
1844
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1838
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1845
    (less than 0x160000-16)
1839
    (less than 0x160000-16)
1846
  * eax = 2 otherwise
1840
  * eax = 2 otherwise
1847
Remarks:
1841
Remarks:
1848
  * Do not rely on returned value for invalid offsets, it may be
1842
  * Do not rely on returned value for invalid offsets, it may be
1849
    changed in future kernel versions.
1843
    changed in future kernel versions.
1850
  * Offset for pixel with coordinates (x,y)
1844
  * Offset for pixel with coordinates (x,y)
1851
    is calculated as (x+y*xsize)*3.
1845
    is calculated as (x+y*xsize)*3.
1852
  * There is a pair function to set pixel on the background image - 
1846
  * There is a pair function to set pixel on the background image - 
1853
    subfunction 2 of function 15.
1847
    subfunction 2 of function 15.
1854
 
1848
 
1855
======================================================================
1849
======================================================================
1856
== Function 39, subfunction 4 - get drawing mode for the background. =
1850
== Function 39, subfunction 4 - get drawing mode for the background. =
1857
======================================================================
1851
======================================================================
1858
Parameters:
1852
Parameters:
1859
  * eax = 39 - function number
1853
  * eax = 39 - function number
1860
  * ebx = 4 - subfunction number
1854
  * ebx = 4 - subfunction number
1861
Returned value:
1855
Returned value:
1862
  * eax = 1 - tile
1856
  * eax = 1 - tile
1863
  * eax = 2 - stretch
1857
  * eax = 2 - stretch
1864
Remarks:
1858
Remarks:
1865
  * There is a pair function to set drawing mode - 
1859
  * There is a pair function to set drawing mode - 
1866
    subfunction 4 of function 15.
1860
    subfunction 4 of function 15.
1867
 
1861
 
1868
======================================================================
1862
======================================================================
1869
=========== Function 40 - set the mask for expected events. ==========
1863
=========== Function 40 - set the mask for expected events. ==========
1870
======================================================================
1864
======================================================================
1871
The mask for expected events affects function working with events
1865
The mask for expected events affects function working with events
1872
10, 11, 23 - they notify only about events allowed by this mask.
1866
10, 11, 23 - they notify only about events allowed by this mask.
1873
Parameters:
1867
Parameters:
1874
  * eax = 40 - function number
1868
  * eax = 40 - function number
1875
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1869
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1876
    (set bit permits notice on event)
1870
    (set bit permits notice on event)
1877
Returned value:
1871
Returned value:
1878
  * function does not return value
1872
  * function does not return value
1879
Remarks:
1873
Remarks:
1880
  * Default mask (7=111b) enables nofices about redraw,
1874
  * Default mask (7=111b) enables nofices about redraw,
1881
    keys and buttons. This is enough for many applications.
1875
    keys and buttons. This is enough for many applications.
1882
  * Events prohibited in the mask are saved anyway, when come;
1876
  * Events prohibited in the mask are saved anyway, when come;
1883
    they are simply not informed with event functions.
1877
    they are simply not informed with event functions.
1884
  * Event functions take into account the mask on moment of
1878
  * Event functions take into account the mask on moment of
1885
    function call, not on moment of event arrival.
1879
    function call, not on moment of event arrival.
1886
 
1880
 
1887
======================================================================
1881
======================================================================
1888
==================== Function 41 - get IRQ owner. ====================
1882
==================== Function 41 - get IRQ owner. ====================
1889
======================================================================
1883
======================================================================
1890
Parameters:
1884
Parameters:
1891
  * eax = 41 - function number
1885
  * eax = 41 - function number
1892
  * ebx = IRQ number, 0..15
1886
  * ebx = IRQ number, 0..15
1893
Returned value:
1887
Returned value:
1894
  * eax = owner PID
1888
  * eax = owner PID
1895
  * eax = 0, if there is no owner
1889
  * eax = 0, if there is no owner
1896
  * eax = -1 for incorrect ebx
1890
  * eax = -1 for incorrect ebx
1897
 
1891
 
1898
======================================================================
1892
======================================================================
1899
==================== Function 42 - read IRQ data. ====================
1893
==================== Function 42 - read IRQ data. ====================
1900
======================================================================
1894
======================================================================
1901
When an IRQ occurs, the system reads data from ports indicated
1895
When an IRQ occurs, the system reads data from ports indicated
1902
earlier by function 44 and writes this data to
1896
earlier by function 44 and writes this data to
1903
internal buffer. This function reads out data from that buffer
1897
internal buffer. This function reads out data from that buffer
1904
bytewise.
1898
bytewise.
1905
Parameters:
1899
Parameters:
1906
  * eax = 42 - function number
1900
  * eax = 42 - function number
1907
  * ebx = IRQ number, 0..15
1901
  * ebx = IRQ number, 0..15
1908
Returned value: (use value of ecx to distinguish)
1902
Returned value: (use value of ecx to distinguish)
1909
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1903
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1910
    * ecx = 2
1904
    * ecx = 2
1911
  * if there is no data:
1905
  * if there is no data:
1912
    * eax = 0
1906
    * eax = 0
1913
    * ecx = 1
1907
    * ecx = 1
1914
    * ebx destroyed
1908
    * ebx destroyed
1915
  * if all is ok:
1909
  * if all is ok:
1916
    * eax = byte size of data, not yet read from buffer
1910
    * eax = byte size of data, not yet read from buffer
1917
    * ecx = 0
1911
    * ecx = 0
1918
    * ebx = current byte
1912
    * ebx = current byte
1919
Remarks:
1913
Remarks:
1920
  * Previously the thread must reserve indicated IRQ for itself
1914
  * Previously the thread must reserve indicated IRQ for itself
1921
    by function 45.
1915
    by function 45.
1922
  * The size of data buffer is 4000 bytes, on overflow
1916
  * The size of data buffer is 4000 bytes, on overflow
1923
    "fresh" data cease to be written in the buffer.
1917
    "fresh" data cease to be written in the buffer.
1924
 
1918
 
1925
======================================================================
1919
======================================================================
1926
================ Function 43 - input/output to a port. ===============
1920
================ Function 43 - input/output to a port. ===============
1927
======================================================================
1921
======================================================================
1928
 
1922
 
1929
------------------------ Output data to port -------------------------
1923
------------------------ Output data to port -------------------------
1930
Parameters:
1924
Parameters:
1931
  * eax = 43 - function number
1925
  * eax = 43 - function number
1932
  * bl = byte for output
1926
  * bl = byte for output
1933
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1927
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1934
Returned value:
1928
Returned value:
1935
  * eax = 0 - success
1929
  * eax = 0 - success
1936
  * eax = 1 - the thread has not reserved the selected port
1930
  * eax = 1 - the thread has not reserved the selected port
1937
 
1931
 
1938
------------------------ Input data from port ------------------------
1932
------------------------ Input data from port ------------------------
1939
Parameters:
1933
Parameters:
1940
  * eax = 43 - function number
1934
  * eax = 43 - function number
1941
  * ebx is ignored
1935
  * ebx is ignored
1942
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1936
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1943
Returned value:
1937
Returned value:
1944
  * eax = 0 - success, thus ebx = entered byte
1938
  * eax = 0 - success, thus ebx = entered byte
1945
  * eax = 1 - the thread has not reserved the selected port
1939
  * eax = 1 - the thread has not reserved the selected port
1946
Remarks:
1940
Remarks:
1947
  * Previously the thread must reserve the selected port
1941
  * Previously the thread must reserve the selected port
1948
    for itself by function 46.
1942
    for itself by function 46.
1949
  * Instead of call to this function it is better to use
1943
  * Instead of call to this function it is better to use
1950
    processor instructions in/out - this is much
1944
    processor instructions in/out - this is much
1951
    faster and a bit shorter and easier.
1945
    faster and a bit shorter and easier.
1952
 
1946
 
1953
======================================================================
1947
======================================================================
1954
=========== Function 44 - define operations at IRQ arrival. ==========
1948
=========== Function 44 - define operations at IRQ arrival. ==========
1955
======================================================================
1949
======================================================================
1956
At IRQ arrival the system can read the data from ports defined
1950
At IRQ arrival the system can read the data from ports defined
1957
by this function and write these data to internal buffer, whence
1951
by this function and write these data to internal buffer, whence
1958
they can be read by ôóíêöèåé 42.
1952
they can be read by ôóíêöèåé 42.
1959
Parameters:
1953
Parameters:
1960
  * eax = 44 - function number
1954
  * eax = 44 - function number
1961
  * ebx = pointer to the array of structures each describing one port:
1955
  * ebx = pointer to the array of structures each describing one port:
1962
    * +0: word: 0 means end of array, otherwise port number
1956
    * +0: word: 0 means end of array, otherwise port number
1963
    * +2: byte: reserved (ignored)
1957
    * +2: byte: reserved (ignored)
1964
    * +3: byte: 1=read byte from this port, 2=read word
1958
    * +3: byte: 1=read byte from this port, 2=read word
1965
  * ecx = IRQ number, 0..15
1959
  * ecx = IRQ number, 0..15
1966
Returned value:
1960
Returned value:
1967
  * eax = 0 - success
1961
  * eax = 0 - success
1968
  * eax = 1 - the thread is not owner of selected IRQ
1962
  * eax = 1 - the thread is not owner of selected IRQ
1969
Remarks:
1963
Remarks:
1970
  * Previously the thread must reserve for itself selected IRQ
1964
  * Previously the thread must reserve for itself selected IRQ
1971
    by function 45.
1965
    by function 45.
1972
  * First 16 ports are considered only.
1966
  * First 16 ports are considered only.
1973
  * The current implementation considers incorrect value of field +3
1967
  * The current implementation considers incorrect value of field +3
1974
    as a signal to terminate IRQ processing.
1968
    as a signal to terminate IRQ processing.
1975
 
1969
 
1976
======================================================================
1970
======================================================================
1977
=================== Function 45 - reserve/free IRQ. ==================
1971
=================== Function 45 - reserve/free IRQ. ==================
1978
======================================================================
1972
======================================================================
1979
Parameters:
1973
Parameters:
1980
  * eax = 45 - function number
1974
  * eax = 45 - function number
1981
  * ebx = 0 - reserve, 1 = free
1975
  * ebx = 0 - reserve, 1 = free
1982
  * ecx = IRQ number, 0..15
1976
  * ecx = IRQ number, 0..15
1983
Returned value:
1977
Returned value:
1984
  * eax = 0 - success
1978
  * eax = 0 - success
1985
  * eax = 1 - error (invalid IRQ number
1979
  * eax = 1 - error (invalid IRQ number
1986
    or attempt to reserve not free IRQ
1980
    or attempt to reserve not free IRQ
1987
    or to free IRQ, not reserved by this thread)
1981
    or to free IRQ, not reserved by this thread)
1988
Remarks:
1982
Remarks:
1989
  * IRQ reservation is required for functions 42 and 44.
1983
  * IRQ reservation is required for functions 42 and 44.
1990
  * Only one thread can reserve the specific IRQ.
1984
  * Only one thread can reserve the specific IRQ.
1991
  * IRQs, handled by the system itself, are reserved by the system
1985
  * IRQs, handled by the system itself, are reserved by the system
1992
    (thread 1) at booting.
1986
    (thread 1) at booting.
1993
  * When a thread terminates, all reserved by it IRQs
1987
  * When a thread terminates, all reserved by it IRQs
1994
    are freed automatically.
1988
    are freed automatically.
1995
 
1989
 
1996
======================================================================
1990
======================================================================
1997
====== Function 46 - reserve/free a group of input/output ports. =====
1991
====== Function 46 - reserve/free a group of input/output ports. =====
1998
======================================================================
1992
======================================================================
1999
To work with reserved ports an application can access directly by
1993
To work with reserved ports an application can access directly by
2000
commands in/out (recommended way) and can use function 43
1994
commands in/out (recommended way) and can use function 43
2001
(not recommended way).
1995
(not recommended way).
2002
Parameters:
1996
Parameters:
2003
  * eax = 46 - function number
1997
  * eax = 46 - function number
2004
  * ebx = 0 - reserve, 1 - free
1998
  * ebx = 0 - reserve, 1 - free
2005
  * ecx = start port number
1999
  * ecx = start port number
2006
  * edx = end port number (inclusive)
2000
  * edx = end port number (inclusive)
2007
Returned value:
2001
Returned value:
2008
  * eax = 0 - success
2002
  * eax = 0 - success
2009
  * eax = 1 - error
2003
  * eax = 1 - error
2010
Remarks:
2004
Remarks:
2011
  * For ports reservation: an error occurs if and only if
2005
  * For ports reservation: an error occurs if and only if
2012
    one from the following condition satisfies:
2006
    one from the following condition satisfies:
2013
    * start port is more than end port;
2007
    * start port is more than end port;
2014
    * the selected range contains incorrect port number
2008
    * the selected range contains incorrect port number
2015
      (correct are from 0 to 0xFFFF);
2009
      (correct are from 0 to 0xFFFF);
2016
    * limit for the total number of reserved areas is exceeded
2010
    * limit for the total number of reserved areas is exceeded
2017
      (maximum 255 are allowed);
2011
      (maximum 255 are allowed);
2018
    * the selected range intersects with any of earlier reserved
2012
    * the selected range intersects with any of earlier reserved
2019
  * For ports free: an error is an attempt to free range,
2013
  * For ports free: an error is an attempt to free range,
2020
    that was not earlier reserved by this function
2014
    that was not earlier reserved by this function
2021
    (with same ecx,edx).
2015
    (with same ecx,edx).
2022
  * If an error occurs (for both cases) function performs no action.
2016
  * If an error occurs (for both cases) function performs no action.
2023
  * At booting the system reserves for itself ports
2017
  * At booting the system reserves for itself ports
2024
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2018
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2025
  * When a thread terminates, all reserved by it ports
2019
  * When a thread terminates, all reserved by it ports
2026
    are freed automatically.
2020
    are freed automatically.
2027
 
2021
 
2028
======================================================================
2022
======================================================================
2029
============= Function 47 - draw a number in the window. =============
2023
============= Function 47 - draw a number in the window. =============
2030
======================================================================
2024
======================================================================
2031
Parameters:
2025
Parameters:
2032
  * eax = 47 - function number
2026
  * eax = 47 - function number
2033
  * ebx = parameters of conversion number to text:
2027
  * ebx = parameters of conversion number to text:
2034
    * bl = 0 - ecx contains number
2028
    * bl = 0 - ecx contains number
2035
    * bl = 1 - ecx contains pointer to dword-number
2029
    * bl = 1 - ecx contains pointer to dword-number
2036
    * bh = 0 - display in decimal number system
2030
    * bh = 0 - display in decimal number system
2037
    * bh = 1 - display in hexadecimal system
2031
    * bh = 1 - display in hexadecimal system
2038
    * bh = 2 - display in binary system
2032
    * bh = 2 - display in binary system
2039
    * áèòû 16-21 = how many digits to display
2033
    * áèòû 16-21 = how many digits to display
2040
    * áèòû 22-31 reserved and must be set to 0
2034
    * áèòû 22-31 reserved and must be set to 0
2041
  * ecx = number (if bl=0) or pointer (if bl=1)
2035
  * ecx = number (if bl=0) or pointer (if bl=1)
2042
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2036
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2043
  * esi = 0xX0RRGGBB:
2037
  * esi = 0xX0RRGGBB:
2044
    * RR, GG, BB specify the color
2038
    * RR, GG, BB specify the color
2045
    * X = ABnn (bits)
2039
    * X = ABnn (bits)
2046
    * nn = font (0/1)
2040
    * nn = font (0/1)
2047
    * A is ignored
2041
    * A is ignored
2048
    * B=1 - fill background with the color edi
2042
    * B=1 - fill background with the color edi
2049
Returned value:
2043
Returned value:
2050
  * function does not return value
2044
  * function does not return value
2051
Remarks:
2045
Remarks:
2052
  * The given length must not exceed 60.
2046
  * The given length must not exceed 60.
2053
  * The exactly given amount of digits is output. If number is small
2047
  * The exactly given amount of digits is output. If number is small
2054
    and can be written by smaller amount of digits, it is supplemented
2048
    and can be written by smaller amount of digits, it is supplemented
2055
    by leading zeroes; if the number is big and can not be written by
2049
    by leading zeroes; if the number is big and can not be written by
2056
    given amount of digits, extra digits are not drawn.
2050
    given amount of digits, extra digits are not drawn.
2057
  * Parameters of fonts are shown in the description of function 4
2051
  * Parameters of fonts are shown in the description of function 4
2058
    (text output).
2052
    (text output).
2059
 
2053
 
2060
======================================================================
2054
======================================================================
2061
========= Function 48, subfunction 0 - apply screen settings. ========
2055
========= Function 48, subfunction 0 - apply screen settings. ========
2062
======================================================================
2056
======================================================================
2063
Parameters:
2057
Parameters:
2064
  * eax = 48 - function number
2058
  * eax = 48 - function number
2065
  * ebx = 0 - subfunction number
2059
  * ebx = 0 - subfunction number
2066
  * ecx = 0 - reserved
2060
  * ecx = 0 - reserved
2067
Returned value:
2061
Returned value:
2068
  * function does not return value
2062
  * function does not return value
2069
Remarks:
2063
Remarks:
2070
  * Function redraws the screen after parameters change by
2064
  * Function redraws the screen after parameters change by
2071
    subfunctions 1 and 2.
2065
    subfunctions 1 and 2.
2072
  * Function call without prior call to one of indicated subfunctions
2066
  * Function call without prior call to one of indicated subfunctions
2073
    is ignored.
2067
    is ignored.
2074
  * Function call with nonzero ecx is ignored.
2068
  * Function call with nonzero ecx is ignored.
2075
 
2069
 
2076
======================================================================
2070
======================================================================
2077
=========== Function 48, subfunction 1 - set button style. ===========
2071
=========== Function 48, subfunction 1 - set button style. ===========
2078
======================================================================
2072
======================================================================
2079
Parameters:
2073
Parameters:
2080
  * eax = 48 - function number
2074
  * eax = 48 - function number
2081
  * ebx = 1 - subfunction number
2075
  * ebx = 1 - subfunction number
2082
  * ecx = button style:
2076
  * ecx = button style:
2083
    * 0 = flat
2077
    * 0 = flat
2084
    * 1 = 3d
2078
    * 1 = 3d
2085
Returned value:
2079
Returned value:
2086
  * function does not return value
2080
  * function does not return value
2087
Remarks:
2081
Remarks:
2088
  * After call to this function one should redraw the screen by
2082
  * After call to this function one should redraw the screen by
2089
    subfunction 0.
2083
    subfunction 0.
2090
  * Button style influences only to their draw of function 8.
2084
  * Button style influences only to their draw of function 8.
2091
 
2085
 
2092
======================================================================
2086
======================================================================
2093
====== Function 48, subfunction 2 - set standard window colors. ======
2087
====== Function 48, subfunction 2 - set standard window colors. ======
2094
======================================================================
2088
======================================================================
2095
Parameters:
2089
Parameters:
2096
  * eax = 48 - function number
2090
  * eax = 48 - function number
2097
  * ebx = 2 - subfunction number
2091
  * ebx = 2 - subfunction number
2098
  * ecx = pointer to the color table
2092
  * ecx = pointer to the color table
2099
  * edx = size of the color table
2093
  * edx = size of the color table
2100
    (must be 40 bytes for future compatibility)
2094
    (must be 40 bytes for future compatibility)
2101
Format of the color table is shown in description of subfunction 3.
2095
Format of the color table is shown in description of subfunction 3.
2102
Returned value:
2096
Returned value:
2103
  * function does not return value
2097
  * function does not return value
2104
Remarks:
2098
Remarks:
2105
  * After call to this function one should redraw the screen by
2099
  * After call to this function one should redraw the screen by
2106
    subfunction 0.
2100
    subfunction 0.
2107
  * Table of standard colors influences only to applications,
2101
  * Table of standard colors influences only to applications,
2108
    which receive this table obviously (by subfunction 3)
2102
    which receive this table obviously (by subfunction 3)
2109
    and use it (specifying colors from it to drawing functions).
2103
    and use it (specifying colors from it to drawing functions).
2110
  * Table of standard colors is included in skin and is installed
2104
  * Table of standard colors is included in skin and is installed
2111
    anew with skin installation (by subfunction 8).
2105
    anew with skin installation (by subfunction 8).
2112
  * Color table can be viewed/changed interactively with
2106
  * Color table can be viewed/changed interactively with
2113
    the application 'desktop'.
2107
    the application 'desktop'.
2114
 
2108
 
2115
======================================================================
2109
======================================================================
2116
====== Function 48, subfunction 3 - get standard window colors. ======
2110
====== Function 48, subfunction 3 - get standard window colors. ======
2117
======================================================================
2111
======================================================================
2118
Parameters:
2112
Parameters:
2119
  * eax = 48 - function number
2113
  * eax = 48 - function number
2120
  * ebx = 3 - subfunction number
2114
  * ebx = 3 - subfunction number
2121
  * ecx = pointer to the buffer with size edx bytes,
2115
  * ecx = pointer to the buffer with size edx bytes,
2122
    where table will be written
2116
    where table will be written
2123
  * edx = size of color table
2117
  * edx = size of color table
2124
    (must be 40 bytes for future compatibility)
2118
    (must be 40 bytes for future compatibility)
2125
Returned value:
2119
Returned value:
2126
  * function does not return value
2120
  * function does not return value
2127
Format of the color table:
2121
Format of the color table:
2128
each item is dword-value for color 0x00RRGGBB
2122
each item is dword-value for color 0x00RRGGBB
2129
  * +0: dword: frames - color of frame
2123
  * +0: dword: frames - color of frame
2130
  * +4: dword: grab - color of header
2124
  * +4: dword: grab - color of header
2131
  * +8: dword: grab_button - color of button on header bar
2125
  * +8: dword: grab_button - color of button on header bar
2132
  * +12 = +0xC: dword: grab_button_text - color of text on button
2126
  * +12 = +0xC: dword: grab_button_text - color of text on button
2133
    on header bar
2127
    on header bar
2134
  * +16 = +0x10: dword: grab_text - color of text on header
2128
  * +16 = +0x10: dword: grab_text - color of text on header
2135
  * +20 = +0x14: dword: work - color of working area
2129
  * +20 = +0x14: dword: work - color of working area
2136
  * +24 = +0x18: dword: work_button - color of button in working area
2130
  * +24 = +0x18: dword: work_button - color of button in working area
2137
  * +28 = +0x1C: dword: work_button_text - color of text on button
2131
  * +28 = +0x1C: dword: work_button_text - color of text on button
2138
    in working area
2132
    in working area
2139
  * +32 = +0x20: dword: work_text - color of text in working area
2133
  * +32 = +0x20: dword: work_text - color of text in working area
2140
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2134
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2141
Remarks:
2135
Remarks:
2142
  * Structure of the color table is described in the standard
2136
  * Structure of the color table is described in the standard
2143
    include file 'macros.inc' as 'system_colors'; for example,
2137
    include file 'macros.inc' as 'system_colors'; for example,
2144
    it is possible to write:
2138
    it is possible to write:
2145
    	sc	system_colors		; variable declaration
2139
    	sc	system_colors		; variable declaration
2146
    	...				; somewhere one must call
2140
    	...				; somewhere one must call
2147
    					; this function with ecx=sc
2141
    					; this function with ecx=sc
2148
    	mov	ecx, [sc.work_button_text]	; read text color on
2142
    	mov	ecx, [sc.work_button_text]	; read text color on
2149
    					; buttin in working area
2143
    					; buttin in working area
2150
  * A program itself desides to use or not to use color table.
2144
  * A program itself desides to use or not to use color table.
2151
    For usage program must simply at calls to drawing functions select
2145
    For usage program must simply at calls to drawing functions select
2152
    color taken from the table.
2146
    color taken from the table.
2153
  * At change of the table of standard colors (by subfunction 2 with
2147
  * At change of the table of standard colors (by subfunction 2 with
2154
    the subsequent application of changes by subfunction 0 or
2148
    the subsequent application of changes by subfunction 0 or
2155
    at skin set by subfunction 8) the system sends to all windows
2149
    at skin set by subfunction 8) the system sends to all windows
2156
    redraw message (the event with code 1).
2150
    redraw message (the event with code 1).
2157
  * Color table can be viewed/changed interactively with
2151
  * Color table can be viewed/changed interactively with
2158
    the application 'desktop'.
2152
    the application 'desktop'.
2159
 
2153
 
2160
======================================================================
2154
======================================================================
2161
============ Function 48, subfunction 4 - get skin height. ===========
2155
============ Function 48, subfunction 4 - get skin height. ===========
2162
======================================================================
2156
======================================================================
2163
Parameters:
2157
Parameters:
2164
  * eax = 48 - function number
2158
  * eax = 48 - function number
2165
  * ebx = 4 - subfunction number
2159
  * ebx = 4 - subfunction number
2166
Returned value:
2160
Returned value:
2167
  * eax = skin height
2161
  * eax = skin height
2168
Remarks:
2162
Remarks:
2169
  * Skin height is defined as the height of a header
2163
  * Skin height is defined as the height of a header
2170
    of skinned windows.
2164
    of skinned windows.
2171
  * See also general structure of window in the description
2165
  * See also general structure of window in the description
2172
    of function 0.
2166
    of function 0.
2173
 
2167
 
2174
======================================================================
2168
======================================================================
2175
======== Function 48, subfunction 5 - get screen working area. =======
2169
======== Function 48, subfunction 5 - get screen working area. =======
2176
======================================================================
2170
======================================================================
2177
Parameters:
2171
Parameters:
2178
  * eax = 48 - function number
2172
  * eax = 48 - function number
2179
  * ebx = 5 - subfunction number
2173
  * ebx = 5 - subfunction number
2180
Returned value:
2174
Returned value:
2181
  * eax = [left]*65536 + [right]
2175
  * eax = [left]*65536 + [right]
2182
  * ebx = [top]*65536 + [bottom]
2176
  * ebx = [top]*65536 + [bottom]
2183
Remarks:
2177
Remarks:
2184
  * The screen working area defines position and coordinates of
2178
  * The screen working area defines position and coordinates of
2185
    a maximized window.
2179
    a maximized window.
2186
  * The screen working area in view of normal work is all screen
2180
  * The screen working area in view of normal work is all screen
2187
    without system panel (the application '@panel').
2181
    without system panel (the application '@panel').
2188
  * (left,top) are coordinates of the left upper corner,
2182
  * (left,top) are coordinates of the left upper corner,
2189
    (right,bottom) are coordinates of the right lower one.
2183
    (right,bottom) are coordinates of the right lower one.
2190
    Thus the size of working area on x axis can be calculated by
2184
    Thus the size of working area on x axis can be calculated by
2191
    formula right-left+1, on y axis - by formula bottom-right+1.
2185
    formula right-left+1, on y axis - by formula bottom-right+1.
2192
  * See also function 14,
2186
  * See also function 14,
2193
    to get sizes of all screen.
2187
    to get sizes of all screen.
2194
  * There is a pair function to set working area - subfunction 6.
2188
  * There is a pair function to set working area - subfunction 6.
2195
 
2189
 
2196
======================================================================
2190
======================================================================
2197
======== Function 48, subfunction 6 - set screen working area. =======
2191
======== Function 48, subfunction 6 - set screen working area. =======
2198
======================================================================
2192
======================================================================
2199
Parameters:
2193
Parameters:
2200
  * eax = 48 - function number
2194
  * eax = 48 - function number
2201
  * ebx = 6 - subfunction number
2195
  * ebx = 6 - subfunction number
2202
  * ecx = [left]*65536 + [right]
2196
  * ecx = [left]*65536 + [right]
2203
  * edx = [top]*65536 + [bottom]
2197
  * edx = [top]*65536 + [bottom]
2204
Returned value:
2198
Returned value:
2205
  * function does not return value
2199
  * function does not return value
2206
Remarks:
2200
Remarks:
2207
  * The screen working area defines position and coordinates of
2201
  * The screen working area defines position and coordinates of
2208
    a maximized window.
2202
    a maximized window.
2209
  * This function is used only by the application '@panel',
2203
  * This function is used only by the application '@panel',
2210
    which set working area to all screen without system panel.
2204
    which set working area to all screen without system panel.
2211
  * (left,top) are coordinates of the left upper corner,
2205
  * (left,top) are coordinates of the left upper corner,
2212
    (right,bottom) are coordinates of the right lower one.
2206
    (right,bottom) are coordinates of the right lower one.
2213
    Thus the size of working area on x axis can be calculated by
2207
    Thus the size of working area on x axis can be calculated by
2214
    formula right-left+1, on y axis - by formula bottom-right+1.
2208
    formula right-left+1, on y axis - by formula bottom-right+1.
2215
  * If 'left'>='right', x-coordinate of working area is not changed.
2209
  * If 'left'>='right', x-coordinate of working area is not changed.
2216
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2210
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2217
    equal to screen width, 'right' will not be set.
2211
    equal to screen width, 'right' will not be set.
2218
    Similarly on y axis.
2212
    Similarly on y axis.
2219
  * See also function 14,
2213
  * See also function 14,
2220
    to get sizes of all screen.
2214
    to get sizes of all screen.
2221
  * There is a pair function to get working area - subfunction 5.
2215
  * There is a pair function to get working area - subfunction 5.
2222
  * This function redraws the screen automatically,
2216
  * This function redraws the screen automatically,
2223
    updating coordinates and sizes of maximized windows.
2217
    updating coordinates and sizes of maximized windows.
2224
    The system sends to all windows redraw message (the event 1).
2218
    The system sends to all windows redraw message (the event 1).
2225
 
2219
 
2226
======================================================================
2220
======================================================================
2227
=========== Function 48, subfunction 7 - get skin margins. ===========
2221
=========== Function 48, subfunction 7 - get skin margins. ===========
2228
======================================================================
2222
======================================================================
2229
Returns the area of a header of a skinned window, intended for
2223
Returns the area of a header of a skinned window, intended for
2230
a text of a header.
2224
a text of a header.
2231
Parameters:
2225
Parameters:
2232
  * eax = 48 - function number
2226
  * eax = 48 - function number
2233
  * ebx = 7 - subfunction number
2227
  * ebx = 7 - subfunction number
2234
Returned value:
2228
Returned value:
2235
  * eax = [left]*65536 + [right]
2229
  * eax = [left]*65536 + [right]
2236
  * ebx = [top]*65536 + [bottom]
2230
  * ebx = [top]*65536 + [bottom]
2237
Remarks:
2231
Remarks:
2238
  * An application decides itself to use or not to use this function.
2232
  * An application decides itself to use or not to use this function.
2239
  * It is recommended to take into account returned value
2233
  * It is recommended to take into account returned value
2240
    of this function for choice of a place for drawing header text
2234
    of this function for choice of a place for drawing header text
2241
    (by function 4) or a substitute of header text
2235
    (by function 4) or a substitute of header text
2242
    (at the discretion of an application).
2236
    (at the discretion of an application).
2243
 
2237
 
2244
======================================================================
2238
======================================================================
2245
============= Function 48, subfunction 8 - set used skin. ============
2239
============= Function 48, subfunction 8 - set used skin. ============
2246
======================================================================
2240
======================================================================
2247
Parameters:
2241
Parameters:
2248
  * eax = 48 - function number
2242
  * eax = 48 - function number
2249
  * ebx = 8 - subfunction number
2243
  * ebx = 8 - subfunction number
2250
  * ecx = pointer to a block for function 58, in
2244
  * ecx = pointer to a block for function 58, in
2251
    which the fields of intermediate buffer and file name are filled
2245
    which the fields of intermediate buffer and file name are filled
2252
Returned value:
2246
Returned value:
2253
  * eax = 0 - success
2247
  * eax = 0 - success
2254
  * otherwise eax = file system error code; if file does not
2248
  * otherwise eax = file system error code; if file does not
2255
    contain valid skin, function returns error 3
2249
    contain valid skin, function returns error 3
2256
    (unknown file system).
2250
    (unknown file system).
2257
Remarks:
2251
Remarks:
2258
  * After successful skin loading the system sends to all windows
2252
  * After successful skin loading the system sends to all windows
2259
    redraw message (the event 1).
2253
    redraw message (the event 1).
2260
  * At booting the system reads skin from file 'default.skn'
2254
  * At booting the system reads skin from file 'default.skn'
2261
    on ramdisk.
2255
    on ramdisk.
2262
  * User can change the skin statically by creating hisself
2256
  * User can change the skin statically by creating hisself
2263
    'default.skn' or dynamically with the application 'desktop'.
2257
    'default.skn' or dynamically with the application 'desktop'.
2264
 
2258
 
2265
======================================================================
2259
======================================================================
2266
=========== Function 49 - Advanced Power Management (APM). ===========
2260
=========== Function 49 - Advanced Power Management (APM). ===========
2267
======================================================================
2261
======================================================================
2268
Parameters:
2262
Parameters:
2269
  * eax = 49 - function number
2263
  * eax = 49 - function number
2270
  * dx = number of the APM function
2264
  * dx = number of the APM function
2271
    (analogue of ax in APM specification)
2265
    (analogue of ax in APM specification)
2272
  * bx, cx = parameters of the APM function
2266
  * bx, cx = parameters of the APM function
2273
Returned value:
2267
Returned value:
2274
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2268
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2275
    are set according to the APM specification
2269
    are set according to the APM specification
2276
  * high halves of 32-bit registers eax, ebx, ecx,
2270
  * high halves of 32-bit registers eax, ebx, ecx,
2277
    edx, esi, edi are destroyed
2271
    edx, esi, edi are destroyed
2278
Remarks:
2272
Remarks:
2279
  * APM 1.2 specification is described in the document
2273
  * APM 1.2 specification is described in the document
2280
    "Advanced Power Management (APM) BIOS Specification"
2274
    "Advanced Power Management (APM) BIOS Specification"
2281
    (Revision 1.2), available at
2275
    (Revision 1.2), available at
2282
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2276
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2283
    besides it is included in famous Interrupt List by Ralf Brown
2277
    besides it is included in famous Interrupt List by Ralf Brown
2284
    (http://www.pobox.com/~ralf/files.html,
2278
    (http://www.pobox.com/~ralf/files.html,
2285
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2279
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2286
 
2280
 
2287
======================================================================
2281
======================================================================
2288
=================== Function 50 - set window shape. ==================
2282
=================== Function 50 - set window shape. ==================
2289
======================================================================
2283
======================================================================
2290
Normal windows have rectangular shape. This function can give to
2284
Normal windows have rectangular shape. This function can give to
2291
a window any shape. The shape is given by a set of points inside
2285
a window any shape. The shape is given by a set of points inside
2292
the base rectangle belonging to a window. Position and coordinates
2286
the base rectangle belonging to a window. Position and coordinates
2293
of the base rectangle are set by function 0
2287
of the base rectangle are set by function 0
2294
and changed by function 67.
2288
and changed by function 67.
2295
 
2289
 
2296
--------------------------- Set shape data ---------------------------
2290
--------------------------- Set shape data ---------------------------
2297
Parameters:
2291
Parameters:
2298
  * eax = 50 - function number
2292
  * eax = 50 - function number
2299
  * ebx = 0 - subfunction number
2293
  * ebx = 0 - subfunction number
2300
  * ecx = pointer to shape data (array of bytes 0/1)
2294
  * ecx = pointer to shape data (array of bytes 0/1)
2301
Returned value:
2295
Returned value:
2302
  * function does not return value
2296
  * function does not return value
2303
 
2297
 
2304
-------------------------- Set shape scale ---------------------------
2298
-------------------------- Set shape scale ---------------------------
2305
Parameters:
2299
Parameters:
2306
  * eax = 50 - function number
2300
  * eax = 50 - function number
2307
  * ebx = 1 - subfunction number
2301
  * ebx = 1 - subfunction number
2308
  * ecx sets a scale: each byte of data defines
2302
  * ecx sets a scale: each byte of data defines
2309
    (2^scale)*(2^scale) pixels
2303
    (2^scale)*(2^scale) pixels
2310
Returned value:
2304
Returned value:
2311
  * function does not return value
2305
  * function does not return value
2312
Remarks:
2306
Remarks:
2313
  * Default scale is 0 (scale factor is 1). If in the shape data
2307
  * Default scale is 0 (scale factor is 1). If in the shape data
2314
    one byte corresponds to one pixel, there is no necessity
2308
    one byte corresponds to one pixel, there is no necessity
2315
    to set scale.
2309
    to set scale.
2316
  * Let's designate xsize = window width (in pixels), ysize = height;
2310
  * Let's designate xsize = window width (in pixels), ysize = height;
2317
    pay attention, that they are one pixel more than defined by
2311
    pay attention, that they are one pixel more than defined by
2318
    functions 0, 67.
2312
    functions 0, 67.
2319
  * On definition of scale xsize and ysize must be divisible
2313
  * On definition of scale xsize and ysize must be divisible
2320
    on 2^scale.
2314
    on 2^scale.
2321
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2315
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2322
    to a window of square with the side 2^scale (if scale=0,
2316
    to a window of square with the side 2^scale (if scale=0,
2323
    this is one pixel) and coordinates of the left upper corner
2317
    this is one pixel) and coordinates of the left upper corner
2324
    (a mod (xsize shr scale), a div (xsize shr scale))
2318
    (a mod (xsize shr scale), a div (xsize shr scale))
2325
  * Data size: (xsize shr scale)*(ysize shr scale).
2319
  * Data size: (xsize shr scale)*(ysize shr scale).
2326
  * Data must be presented in the memory and not change
2320
  * Data must be presented in the memory and not change
2327
    after set of shape.
2321
    after set of shape.
2328
  * The system views the shape data at every window redraw by
2322
  * The system views the shape data at every window redraw by
2329
    function 0.
2323
    function 0.
2330
  * The call of subfunction 0 with NULL pointer results in return
2324
  * The call of subfunction 0 with NULL pointer results in return
2331
    to the rectangular shape.
2325
    to the rectangular shape.
2332
 
2326
 
2333
======================================================================
2327
======================================================================
2334
==================== Function 51 - create thread. ====================
2328
==================== Function 51 - create thread. ====================
2335
======================================================================
2329
======================================================================
2336
Parameters:
2330
Parameters:
2337
  * eax = 51 - function number
2331
  * eax = 51 - function number
2338
  * ebx = 1 - unique subfunction
2332
  * ebx = 1 - unique subfunction
2339
  * ecx = address of thread entry point (starting eip)
2333
  * ecx = address of thread entry point (starting eip)
2340
  * edx = pointer to thread stack (starting esp)
2334
  * edx = pointer to thread stack (starting esp)
2341
Returned value:
2335
Returned value:
2342
  * eax = -1 - error (there is too many threads)
2336
  * eax = -1 - error (there is too many threads)
2343
  * otherwise eax = TID - thread identifier
2337
  * otherwise eax = TID - thread identifier
2344
         
2338
         
2345
 
2339
 
2346
======================================================================
2340
======================================================================
2347
=== Function 52, subfunction 0 - get network driver configuration. ===
2341
=== Function 52, subfunction 0 - get network driver configuration. ===
2348
======================================================================
2342
======================================================================
2349
Parameters:
2343
Parameters:
2350
  * eax = 52 - function number
2344
  * eax = 52 - function number
2351
  * ebx = 0 - subfunction number
2345
  * ebx = 0 - subfunction number
2352
Returned value:
2346
Returned value:
2353
  * eax = configuration dword
2347
  * eax = configuration dword
2354
Remarks:
2348
Remarks:
2355
  * Configuration dword can be set by subfunction 2.
2349
  * Configuration dword can be set by subfunction 2.
2356
  * The kernel does not use this variable. The value of this
2350
  * The kernel does not use this variable. The value of this
2357
    variable and working with it subfunctions 0 and 2 is represented
2351
    variable and working with it subfunctions 0 and 2 is represented
2358
    doubtful.
2352
    doubtful.
2359
 
2353
 
2360
======================================================================
2354
======================================================================
2361
========= Function 52, subfunction 1 - get local IP-address. =========
2355
========= Function 52, subfunction 1 - get local IP-address. =========
2362
======================================================================
2356
======================================================================
2363
Parameters:
2357
Parameters:
2364
  * eax = 52 - function number
2358
  * eax = 52 - function number
2365
  * ebx = 1 - subfunction number
2359
  * ebx = 1 - subfunction number
2366
Returned value:
2360
Returned value:
2367
  * eax = IP-address (4 bytes)
2361
  * eax = IP-address (4 bytes)
2368
Remarks:
2362
Remarks:
2369
  * Local IP-address is set by subfunction 3.
2363
  * Local IP-address is set by subfunction 3.
2370
 
2364
 
2371
======================================================================
2365
======================================================================
2372
=== Function 52, subfunction 2 - set network driver configuration. ===
2366
=== Function 52, subfunction 2 - set network driver configuration. ===
2373
======================================================================
2367
======================================================================
2374
Parameters:
2368
Parameters:
2375
  * eax = 52 - function number
2369
  * eax = 52 - function number
2376
  * ebx = 2 - subfunction number
2370
  * ebx = 2 - subfunction number
2377
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2371
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2378
    function [re-]initializes Ethernet-card, otherwise
2372
    function [re-]initializes Ethernet-card, otherwise
2379
    Ethernet turns off
2373
    Ethernet turns off
2380
Returned value:
2374
Returned value:
2381
  * if Ethernet-interface is not requested, function returns eax=2,
2375
  * if Ethernet-interface is not requested, function returns eax=2,
2382
    but this can be changed in future kernel versions
2376
    but this can be changed in future kernel versions
2383
  * if Ethernet-interface is requested, eax=0 means error
2377
  * if Ethernet-interface is requested, eax=0 means error
2384
    (absence of Ethernet-card), and nonzero value - success
2378
    (absence of Ethernet-card), and nonzero value - success
2385
Remarks:
2379
Remarks:
2386
  * Configuration dword can be read by subfunction 0.
2380
  * Configuration dword can be read by subfunction 0.
2387
  * The kernel does not use this variable. The value of this
2381
  * The kernel does not use this variable. The value of this
2388
    variable, subfunction 0 and part of subfunction 2, which set it,
2382
    variable, subfunction 0 and part of subfunction 2, which set it,
2389
    is represented doubtful.
2383
    is represented doubtful.
2390
 
2384
 
2391
======================================================================
2385
======================================================================
2392
========= Function 52, subfunction 3 - set local IP-address. =========
2386
========= Function 52, subfunction 3 - set local IP-address. =========
2393
======================================================================
2387
======================================================================
2394
Parameters:
2388
Parameters:
2395
  * eax = 52 - function number
2389
  * eax = 52 - function number
2396
  * ebx = 3 - subfunction number
2390
  * ebx = 3 - subfunction number
2397
  * ecx = IP-address (4 bytes)
2391
  * ecx = IP-address (4 bytes)
2398
Returned value:
2392
Returned value:
2399
  * the current implementation returns eax=3, but this can be changed
2393
  * the current implementation returns eax=3, but this can be changed
2400
    in future versions
2394
    in future versions
2401
Remarks:
2395
Remarks:
2402
  * Local IP-address can be get by subfunction 1.
2396
  * Local IP-address can be get by subfunction 1.
2403
 
2397
 
2404
======================================================================
2398
======================================================================
2405
= Function 52, subfunction 6 - add data to the stack of input queue. =
2399
= Function 52, subfunction 6 - add data to the stack of input queue. =
2406
======================================================================
2400
======================================================================
2407
Parameters:
2401
Parameters:
2408
  * eax = 52 - function number
2402
  * eax = 52 - function number
2409
  * ebx = 6 - subfunction number
2403
  * ebx = 6 - subfunction number
2410
  * edx = data size
2404
  * edx = data size
2411
  * esi = data pointer
2405
  * esi = data pointer
2412
Returned value:
2406
Returned value:
2413
  * eax = -1 - error
2407
  * eax = -1 - error
2414
  * eax = 0 - success
2408
  * eax = 0 - success
2415
Remarks:
2409
Remarks:
2416
  * This function is intended only for slow network drivers
2410
  * This function is intended only for slow network drivers
2417
    (PPP, SLIP).
2411
    (PPP, SLIP).
2418
  * Data size must not exceed 1500 bytes, though function
2412
  * Data size must not exceed 1500 bytes, though function
2419
    performs no checks on correctness.
2413
    performs no checks on correctness.
2420
 
2414
 
2421
======================================================================
2415
======================================================================
2422
 Function 52, subfunction 8 - read data from the network output queue. 
2416
 Function 52, subfunction 8 - read data from the network output queue. 
2423
======================================================================
2417
======================================================================
2424
Parameters:
2418
Parameters:
2425
  * eax = 52 - function number
2419
  * eax = 52 - function number
2426
  * ebx = 8 - subfunction number
2420
  * ebx = 8 - subfunction number
2427
  * esi = pointer to 1500-byte buffer
2421
  * esi = pointer to 1500-byte buffer
2428
Returned value:
2422
Returned value:
2429
  * eax = number of read bytes (in the current implementation
2423
  * eax = number of read bytes (in the current implementation
2430
    either 0 = no data or 1500)
2424
    either 0 = no data or 1500)
2431
  * data was copied in buffer
2425
  * data was copied in buffer
2432
Remarks:
2426
Remarks:
2433
  * This function is intended only for slow network drivers
2427
  * This function is intended only for slow network drivers
2434
    (PPP, SLIP).
2428
    (PPP, SLIP).
2435
 
2429
 
2436
======================================================================
2430
======================================================================
2437
============ Function 52, subfunction 9 - get gateway IP. ============
2431
============ Function 52, subfunction 9 - get gateway IP. ============
2438
======================================================================
2432
======================================================================
2439
Parameters:
2433
Parameters:
2440
  * eax = 52 - function number
2434
  * eax = 52 - function number
2441
  * ebx = 9 - subfunction number
2435
  * ebx = 9 - subfunction number
2442
Returned value:
2436
Returned value:
2443
  * eax = gateway IP (4 bytes)
2437
  * eax = gateway IP (4 bytes)
2444
 
2438
 
2445
======================================================================
2439
======================================================================
2446
=========== Function 52, subfunction 10 - get subnet mask. ===========
2440
=========== Function 52, subfunction 10 - get subnet mask. ===========
2447
======================================================================
2441
======================================================================
2448
Parameters:
2442
Parameters:
2449
  * eax = 52 - function number
2443
  * eax = 52 - function number
2450
  * ebx = 10 - subfunction number
2444
  * ebx = 10 - subfunction number
2451
Returned value:
2445
Returned value:
2452
  * eax = subnet mask
2446
  * eax = subnet mask
2453
 
2447
 
2454
======================================================================
2448
======================================================================
2455
============ Function 52, subfunction 11 - set gateway IP. ===========
2449
============ Function 52, subfunction 11 - set gateway IP. ===========
2456
======================================================================
2450
======================================================================
2457
Parameters:
2451
Parameters:
2458
  * eax = 52 - function number
2452
  * eax = 52 - function number
2459
  * ebx = 11 - subfunction number
2453
  * ebx = 11 - subfunction number
2460
  * ecx = gateway IP (4 bytes)
2454
  * ecx = gateway IP (4 bytes)
2461
Returned value:
2455
Returned value:
2462
  * the current implementation returns eax=11, but this can be changed
2456
  * the current implementation returns eax=11, but this can be changed
2463
    in future versions
2457
    in future versions
2464
 
2458
 
2465
======================================================================
2459
======================================================================
2466
=========== Function 52, subfunction 12 - set subnet mask. ===========
2460
=========== Function 52, subfunction 12 - set subnet mask. ===========
2467
======================================================================
2461
======================================================================
2468
Parameters:
2462
Parameters:
2469
  * eax = 52 - function number
2463
  * eax = 52 - function number
2470
  * ebx = 12 - subfunction number
2464
  * ebx = 12 - subfunction number
2471
  * ecx = subnet mask
2465
  * ecx = subnet mask
2472
Returned value:
2466
Returned value:
2473
  * the current implementation returns eax=12, but this can be changed
2467
  * the current implementation returns eax=12, but this can be changed
2474
    in future versions
2468
    in future versions
2475
 
2469
 
2476
======================================================================
2470
======================================================================
2477
============== Function 52, subfunction 13 - get DNS IP. =============
2471
============== Function 52, subfunction 13 - get DNS IP. =============
2478
======================================================================
2472
======================================================================
2479
Parameters:
2473
Parameters:
2480
  * eax = 52 - function number
2474
  * eax = 52 - function number
2481
  * ebx = 13 - subfunction number
2475
  * ebx = 13 - subfunction number
2482
Returned value:
2476
Returned value:
2483
  * eax = DNS IP (4 bytes)
2477
  * eax = DNS IP (4 bytes)
2484
 
2478
 
2485
======================================================================
2479
======================================================================
2486
============== Function 52, subfunction 14 - set DNS IP. =============
2480
============== Function 52, subfunction 14 - set DNS IP. =============
2487
======================================================================
2481
======================================================================
2488
Parameters:
2482
Parameters:
2489
  * eax = 52 - function number
2483
  * eax = 52 - function number
2490
  * ebx = 14 - subfunction number
2484
  * ebx = 14 - subfunction number
2491
  * ecx = DNS IP (4 bytes)
2485
  * ecx = DNS IP (4 bytes)
2492
Returned value:
2486
Returned value:
2493
  * the current implementation returns eax=14, but this can be changed
2487
  * the current implementation returns eax=14, but this can be changed
2494
    in future versions
2488
    in future versions
2495
 
2489
 
2496
======================================================================
2490
======================================================================
2497
======== Function 52, subfunction 15 - get local MAC address. ========
2491
======== Function 52, subfunction 15 - get local MAC address. ========
2498
======================================================================
2492
======================================================================
2499
Parameters:
2493
Parameters:
2500
  * eax = 52 - function number
2494
  * eax = 52 - function number
2501
  * ebx = 15 - subfunction number
2495
  * ebx = 15 - subfunction number
2502
  * ecx = 0 - read first 4 bytes,
2496
  * ecx = 0 - read first 4 bytes,
2503
    ecx = 4 - read last 2 bytes
2497
    ecx = 4 - read last 2 bytes
2504
Returned value:
2498
Returned value:
2505
  * for ecx=0: eax = first 4 bytes of MAC address
2499
  * for ecx=0: eax = first 4 bytes of MAC address
2506
  * for ecx=4: ax = last 2 bytes of MAC address,
2500
  * for ecx=4: ax = last 2 bytes of MAC address,
2507
               high half of eax is destroyed
2501
               high half of eax is destroyed
2508
  * for other ecx: eax = -1 indicates an error
2502
  * for other ecx: eax = -1 indicates an error
2509
 
2503
 
2510
======================================================================
2504
======================================================================
2511
============ Function 53, subfunction 0 - open UDP-socket. ===========
2505
============ Function 53, subfunction 0 - open UDP-socket. ===========
2512
======================================================================
2506
======================================================================
2513
Parameters:
2507
Parameters:
2514
  * eax = 53 - function number
2508
  * eax = 53 - function number
2515
  * ebx = 0 - subfunction number
2509
  * ebx = 0 - subfunction number
2516
  * ecx = local port (only low word is taken into account)
2510
  * ecx = local port (only low word is taken into account)
2517
  * edx = remote port (only low word is taken into account)
2511
  * edx = remote port (only low word is taken into account)
2518
  * esi = remote IP
2512
  * esi = remote IP
2519
Returned value:
2513
Returned value:
2520
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2514
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2521
  * eax = socket handle (some number which unambiguously identifies
2515
  * eax = socket handle (some number which unambiguously identifies
2522
    socket and have sense only for the system) - success;
2516
    socket and have sense only for the system) - success;
2523
    ebx destroyed
2517
    ebx destroyed
2524
 
2518
 
2525
======================================================================
2519
======================================================================
2526
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2520
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2527
======================================================================
2521
======================================================================
2528
Parameters:
2522
Parameters:
2529
  * eax = 53 - function number
2523
  * eax = 53 - function number
2530
  * ebx = 1 - subfunction number
2524
  * ebx = 1 - subfunction number
2531
  * ecx = socket handle
2525
  * ecx = socket handle
2532
Returned value:
2526
Returned value:
2533
  * eax = -1 - incorrect handle
2527
  * eax = -1 - incorrect handle
2534
  * eax = 0 - success
2528
  * eax = 0 - success
2535
  * ebx destroyed
2529
  * ebx destroyed
2536
Remarks:
2530
Remarks:
2537
  * The current implementation does not close automatically all
2531
  * The current implementation does not close automatically all
2538
    sockets of a thread at termination. In particular, one should not
2532
    sockets of a thread at termination. In particular, one should not
2539
    kill a thread with many opened sockets - there will be an outflow
2533
    kill a thread with many opened sockets - there will be an outflow
2540
    of resources.
2534
    of resources.
2541
  * The current implementation does no checks on correctness
2535
  * The current implementation does no checks on correctness
2542
    (function returns error only if thread tries to close not opened
2536
    (function returns error only if thread tries to close not opened
2543
    socket with correct handle).
2537
    socket with correct handle).
2544
 
2538
 
2545
======================================================================
2539
======================================================================
2546
============== Function 53, subfunction 2 - poll socket. =============
2540
============== Function 53, subfunction 2 - poll socket. =============
2547
======================================================================
2541
======================================================================
2548
Parameters:
2542
Parameters:
2549
  * eax = 53 - function number
2543
  * eax = 53 - function number
2550
  * ebx = 2 - subfunction number
2544
  * ebx = 2 - subfunction number
2551
  * ecx = socket handle
2545
  * ecx = socket handle
2552
Returned value:
2546
Returned value:
2553
  * eax = number of read bytes
2547
  * eax = number of read bytes
2554
  * ebx destroyed
2548
  * ebx destroyed
2555
Remarks:
2549
Remarks:
2556
  * There is no checks for correctness.
2550
  * There is no checks for correctness.
2557
 
2551
 
2558
======================================================================
2552
======================================================================
2559
========= Function 53, subfunction 3 - read byte from socket. ========
2553
========= Function 53, subfunction 3 - read byte from socket. ========
2560
======================================================================
2554
======================================================================
2561
Parameters:
2555
Parameters:
2562
  * eax = 53 - function number
2556
  * eax = 53 - function number
2563
  * ebx = 3 - subfunction number
2557
  * ebx = 3 - subfunction number
2564
  * ecx = socket handle
2558
  * ecx = socket handle
2565
Returned value:
2559
Returned value:
2566
  * if there is no read data: eax=0, bl=0,
2560
  * if there is no read data: eax=0, bl=0,
2567
    other bytes of ebx are destroyed
2561
    other bytes of ebx are destroyed
2568
  * if there are read data: eax=number of rest bytes
2562
  * if there are read data: eax=number of rest bytes
2569
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2563
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2570
Remarks:
2564
Remarks:
2571
  * There is no checks for correctness.
2565
  * There is no checks for correctness.
2572
 
2566
 
2573
======================================================================
2567
======================================================================
2574
========== Function 53, subfunction 4 - write to UDP-socket. =========
2568
========== Function 53, subfunction 4 - write to UDP-socket. =========
2575
======================================================================
2569
======================================================================
2576
Parameters:
2570
Parameters:
2577
  * eax = 53 - function number
2571
  * eax = 53 - function number
2578
  * ebx = 4 - subfunction number
2572
  * ebx = 4 - subfunction number
2579
  * ecx = socket handle
2573
  * ecx = socket handle
2580
  * edx = number of bytes to write
2574
  * edx = number of bytes to write
2581
  * esi = pointer to data to write
2575
  * esi = pointer to data to write
2582
Returned value:
2576
Returned value:
2583
  * eax = 0xffffffff - invalid handle
2577
  * eax = 0xffffffff - invalid handle
2584
  * eax = 0xffff - not enough memory
2578
  * eax = 0xffff - not enough memory
2585
  * eax = 0 - success
2579
  * eax = 0 - success
2586
  * ebx destroyed
2580
  * ebx destroyed
2587
Remarks:
2581
Remarks:
2588
  * Check on validity of handle is minimal - only not very incorrect
2582
  * Check on validity of handle is minimal - only not very incorrect
2589
    not opened handles are eliminated.
2583
    not opened handles are eliminated.
2590
  * Number of bytes to write must not exceed 1500-28, though
2584
  * Number of bytes to write must not exceed 1500-28, though
2591
    the appropriate check is not made.
2585
    the appropriate check is not made.
2592
 
2586
 
2593
======================================================================
2587
======================================================================
2594
============ Function 53, subfunction 5 - open TCP-socket. ===========
2588
============ Function 53, subfunction 5 - open TCP-socket. ===========
2595
======================================================================
2589
======================================================================
2596
Parameters:
2590
Parameters:
2597
  * eax = 53 - function number
2591
  * eax = 53 - function number
2598
  * ebx = 5 - subfunction number
2592
  * ebx = 5 - subfunction number
2599
  * ecx = local port (only low word is taken into account)
2593
  * ecx = local port (only low word is taken into account)
2600
  * edx = remote port (only low word is taken into account)
2594
  * edx = remote port (only low word is taken into account)
2601
  * esi = remote IP
2595
  * esi = remote IP
2602
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2596
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2603
Returned value:
2597
Returned value:
2604
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2598
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2605
  * eax = socket handle (some number which unambiguously identifies
2599
  * eax = socket handle (some number which unambiguously identifies
2606
    socket and have sense only for the system) - success;
2600
    socket and have sense only for the system) - success;
2607
    ebx destroyed
2601
    ebx destroyed
2608
 
2602
 
2609
======================================================================
2603
======================================================================
2610
========= Function 53, subfunction 6 - get TCP-socket status. ========
2604
========= Function 53, subfunction 6 - get TCP-socket status. ========
2611
======================================================================
2605
======================================================================
2612
Parameters:
2606
Parameters:
2613
  * eax = 53 - function number
2607
  * eax = 53 - function number
2614
  * ebx = 6 - subfunction number
2608
  * ebx = 6 - subfunction number
2615
  * ecx = socket handle
2609
  * ecx = socket handle
2616
Returned value:
2610
Returned value:
2617
  * eax = socket status: one of
2611
  * eax = socket status: one of
2618
  * TCB_LISTEN = 1
2612
  * TCB_LISTEN = 1
2619
  * TCB_SYN_SENT = 2
2613
  * TCB_SYN_SENT = 2
2620
  * TCB_SYN_RECEIVED = 3
2614
  * TCB_SYN_RECEIVED = 3
2621
  * TCB_ESTABLISHED = 4
2615
  * TCB_ESTABLISHED = 4
2622
  * TCB_FIN_WAIT_1 = 5
2616
  * TCB_FIN_WAIT_1 = 5
2623
  * TCB_FIN_WAIT_2 = 6
2617
  * TCB_FIN_WAIT_2 = 6
2624
  * TCB_CLOSE_WAIT = 7
2618
  * TCB_CLOSE_WAIT = 7
2625
  * TCB_CLOSING = 8
2619
  * TCB_CLOSING = 8
2626
  * TCB_LAST_ASK = 9
2620
  * TCB_LAST_ASK = 9
2627
  * TCB_TIME_WAIT = 10
2621
  * TCB_TIME_WAIT = 10
2628
  * TCB_CLOSED = 11
2622
  * TCB_CLOSED = 11
2629
  * ebx destroys
2623
  * ebx destroys
2630
Remarks:
2624
Remarks:
2631
  * There is no checks for correctness.
2625
  * There is no checks for correctness.
2632
 
2626
 
2633
======================================================================
2627
======================================================================
2634
========== Function 53, subfunction 7 - write to TCP-socket. =========
2628
========== Function 53, subfunction 7 - write to TCP-socket. =========
2635
======================================================================
2629
======================================================================
2636
Parameters:
2630
Parameters:
2637
  * eax = 53 - function number
2631
  * eax = 53 - function number
2638
  * ebx = 7 - subfunction number
2632
  * ebx = 7 - subfunction number
2639
  * ecx = socket handle
2633
  * ecx = socket handle
2640
  * edx = number of bytes to write
2634
  * edx = number of bytes to write
2641
  * esi = pointer to data to write
2635
  * esi = pointer to data to write
2642
Returned value:
2636
Returned value:
2643
  * eax = 0xffffffff - error
2637
  * eax = 0xffffffff - error
2644
  * eax = 0xffff - not enough memory
2638
  * eax = 0xffff - not enough memory
2645
  * eax = 0 - success
2639
  * eax = 0 - success
2646
  * ebx destroyed
2640
  * ebx destroyed
2647
Remarks:
2641
Remarks:
2648
  * Check on validity of handle is minimal - only not very incorrect
2642
  * Check on validity of handle is minimal - only not very incorrect
2649
    not opened handles are eliminated.
2643
    not opened handles are eliminated.
2650
  * Number of bytes to write must not exceed 1500-40, though
2644
  * Number of bytes to write must not exceed 1500-40, though
2651
    the appropriate check is not made.
2645
    the appropriate check is not made.
2652
 
2646
 
2653
======================================================================
2647
======================================================================
2654
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2648
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2655
======================================================================
2649
======================================================================
2656
Parameters:
2650
Parameters:
2657
  * eax = 53 - function number
2651
  * eax = 53 - function number
2658
  * ebx = 8 - subfunction number
2652
  * ebx = 8 - subfunction number
2659
  * ecx = socket handle
2653
  * ecx = socket handle
2660
Returned value:
2654
Returned value:
2661
  * eax = -1 - invalid handle
2655
  * eax = -1 - invalid handle
2662
  * eax = 0xffff - not enough memory for socket close packet
2656
  * eax = 0xffff - not enough memory for socket close packet
2663
  * eax = 0 - success
2657
  * eax = 0 - success
2664
  * in many cases eax is destroyed (the result of function 'queue'
2658
  * in many cases eax is destroyed (the result of function 'queue'
2665
    is returned) - probably this is bug, which will be corrected
2659
    is returned) - probably this is bug, which will be corrected
2666
  * ebx destroyed
2660
  * ebx destroyed
2667
Remarks:
2661
Remarks:
2668
  * The current implementation does not close automatically all
2662
  * The current implementation does not close automatically all
2669
    sockets of a thread at termination. In particular, one should not
2663
    sockets of a thread at termination. In particular, one should not
2670
    kill a thread with many opened sockets - there will be an outflow
2664
    kill a thread with many opened sockets - there will be an outflow
2671
    of resources.
2665
    of resources.
2672
  * The current implementation does no checks on correctness
2666
  * The current implementation does no checks on correctness
2673
    (function returns error only if thread tries to close not opened
2667
    (function returns error only if thread tries to close not opened
2674
    socket with correct handle).
2668
    socket with correct handle).
2675
 
2669
 
2676
======================================================================
2670
======================================================================
2677
=== Function 53, subfunction 9 - check whether local port is free. ===
2671
=== Function 53, subfunction 9 - check whether local port is free. ===
2678
======================================================================
2672
======================================================================
2679
Parameters:
2673
Parameters:
2680
  * eax = 53 - function number
2674
  * eax = 53 - function number
2681
  * ebx = 9 - subfunction number
2675
  * ebx = 9 - subfunction number
2682
  * ecx = local port number (low 16 bits are used only)
2676
  * ecx = local port number (low 16 bits are used only)
2683
Returned value:
2677
Returned value:
2684
  * eax = 0 - port is used
2678
  * eax = 0 - port is used
2685
  * eax = 1 - port is free
2679
  * eax = 1 - port is free
2686
  * ebx destroyed
2680
  * ebx destroyed
2687
 
2681
 
2688
======================================================================
2682
======================================================================
2689
===== Function 53, subfunction 10 - query Ethernet cable status. =====
2683
===== Function 53, subfunction 10 - query Ethernet cable status. =====
2690
======================================================================
2684
======================================================================
2691
Parameters:
2685
Parameters:
2692
  * eax = 53 - function number
2686
  * eax = 53 - function number
2693
  * ebx = 10 - subfunction number
2687
  * ebx = 10 - subfunction number
2694
Returned value:
2688
Returned value:
2695
  * al = -1 - a network driver is not loaded or
2689
  * al = -1 - a network driver is not loaded or
2696
              does not support this function
2690
              does not support this function
2697
  * al = 0 - Ethernet cable is unplugged
2691
  * al = 0 - Ethernet cable is unplugged
2698
  * al = 1 - Ethernet cable is plugged
2692
  * al = 1 - Ethernet cable is plugged
-
 
2693
  * ebx destroyed
2699
Remarks:
2694
Remarks:
2700
  * The current kernel implementation supports this function
2695
  * The current kernel implementation supports this function
2701
    only for RTL8139 network cards.
2696
    only for RTL8139 network cards.
2702
 
2697
 
2703
======================================================================
2698
======================================================================
2704
===== Function 53, subfunction 10 - read data from stack.        =====
2699
======= Function 53, subfunction 11 - read network stack data. =======
2705
======================================================================
2700
======================================================================
2706
Parameters:
2701
Paramters:
2707
  * eax = 53
2702
  * eax = 53 - function number
2708
  * ebx = 11
2703
  * ebx = 11 - subfunction number
2709
  * ecx = socket number
2704
  * ecx = socket handle
2710
  * edx = pointer to where data must be written
2705
  * edx = pointer to buffer
2711
  * esi = buffer size (max bytes of data to copy)
2706
  * esi = number of bytes to read;
-
 
2707
  * esi = 0 - read all data (maximum 4096 bytes)
2712
Returned value: 
2708
Returned value:
2713
  * eax = number of bytes copied
2709
  * eax = number of bytes read
-
 
2710
  * ebx destroyed
2714
Remarks:
2711
Remakrs:
2715
  * if buffer size is zero, all data will be copied 
2712
  * There is no check on handle correctness.
2716
    (this will be max 4096 bytes)
-
 
2717
 
2713
 
2718
======================================================================
2714
======================================================================
2719
= Function 53, subfunction 255 - debug information of network driver. 
2715
= Function 53, subfunction 255 - debug information of network driver. 
2720
======================================================================
2716
======================================================================
2721
Parameters:
2717
Parameters:
2722
  * eax = 53 - function number
2718
  * eax = 53 - function number
2723
  * ebx = 255 - subfunction number
2719
  * ebx = 255 - subfunction number
2724
  * ecx = type of requested information (see below)
2720
  * ecx = type of requested information (see below)
2725
Returned value:
2721
Returned value:
2726
  * eax = requested information
2722
  * eax = requested information
2727
  * ebx destroyed
2723
  * ebx destroyed
2728
Possible values for ecx:
2724
Possible values for ecx:
2729
  * 100: length of queue 0 (empty queue)
2725
  * 100: length of queue 0 (empty queue)
2730
  * 101: length of queue 1 (ip-out queue)
2726
  * 101: length of queue 1 (ip-out queue)
2731
  * 102: length of queue 2 (ip-in queue)
2727
  * 102: length of queue 2 (ip-in queue)
2732
  * 103: length of queue 3 (net1out queue)
2728
  * 103: length of queue 3 (net1out queue)
2733
  * 200: number of items in the ARP table
2729
  * 200: number of items in the ARP table
2734
  * 201: size of the ARP table (in items) (20 for current version)
2730
  * 201: size of the ARP table (in items) (20 for current version)
2735
  * 202: read item at edx of the ARP table to the temporary buffer,
2731
  * 202: read item at edx of the ARP table to the temporary buffer,
2736
    whence 5 following types take information;
2732
    whence 5 following types take information;
2737
    in this case eax is not defined
2733
    in this case eax is not defined
2738
  * 203: IP-address saved by type 202
2734
  * 203: IP-address saved by type 202
2739
  * 204: high dword of MAC-address saved by type 202
2735
  * 204: high dword of MAC-address saved by type 202
2740
  * 205: low word of MAC-address saved by type 202
2736
  * 205: low word of MAC-address saved by type 202
2741
  * 206: status word saved by type 202
2737
  * 206: status word saved by type 202
2742
  * 207: ttl word saved by type 202
2738
  * 207: ttl word saved by type 202
2743
  * 2: total number of received IP-packets
2739
  * 2: total number of received IP-packets
2744
  * 3: total number of transferred IP-packets
2740
  * 3: total number of transferred IP-packets
2745
  * 4: total number of dumped received packets
2741
  * 4: total number of dumped received packets
2746
  * 5: total number of received ARP-packets
2742
  * 5: total number of received ARP-packets
2747
  * 6: status of packet driver, 0=inactive, nonzero=active
2743
  * 6: status of packet driver, 0=inactive, nonzero=active
2748
 
2744
 
2749
======================================================================
2745
======================================================================
2750
========== Function 55, subfunction 0 - load data for SB16. ==========
2746
========== Function 55, subfunction 0 - load data for SB16. ==========
2751
======================================================================
2747
======================================================================
2752
Parameters:
2748
Parameters:
2753
  * eax = 55 - function number
2749
  * eax = 55 - function number
2754
  * ebx = 0 - subfunction number
2750
  * ebx = 0 - subfunction number
2755
  * ecx = pointer to data (is copied 64 kilobytes, is used as much as
2751
  * ecx = pointer to data (is copied 64 kilobytes, is used as much as
2756
    set by subfunction 2)
2752
    set by subfunction 2)
2757
Returned value:
2753
Returned value:
2758
  * function does not return value
2754
  * function does not return value
2759
Remarks:
2755
Remarks:
2760
  * Format and size of data are set by subfunction 2.
2756
  * Format and size of data are set by subfunction 2.
2761
 
2757
 
2762
======================================================================
2758
======================================================================
2763
======== Function 55, subfunction 1 - begin play data on SB16. =======
2759
======== Function 55, subfunction 1 - begin play data on SB16. =======
2764
======================================================================
2760
======================================================================
2765
Parameters:
2761
Parameters:
2766
  * eax = 55 - function number
2762
  * eax = 55 - function number
2767
  * ebx = 1 - subfunction number
2763
  * ebx = 1 - subfunction number
2768
Returned value:
2764
Returned value:
2769
  * function does not return value
2765
  * function does not return value
2770
Remarks:
2766
Remarks:
2771
  * Previously data must be loaded by subfunction 0 and
2767
  * Previously data must be loaded by subfunction 0 and
2772
    their format must be defined by subfunction 2.
2768
    their format must be defined by subfunction 2.
2773
  * Function returns control, when playing of data began; after that
2769
  * Function returns control, when playing of data began; after that
2774
    play goes independently from application (and does not use
2770
    play goes independently from application (and does not use
2775
    processor time at all).
2771
    processor time at all).
2776
  * Previously must be defined SB16 base port
2772
  * Previously must be defined SB16 base port
2777
    (by subfunction 4 of function 21) and DMA channel
2773
    (by subfunction 4 of function 21) and DMA channel
2778
    (by subfunction 10 of function 21).
2774
    (by subfunction 10 of function 21).
2779
 
2775
 
2780
======================================================================
2776
======================================================================
2781
======== Function 55, subfunction 2 - set format of SB16 data. =======
2777
======== Function 55, subfunction 2 - set format of SB16 data. =======
2782
======================================================================
2778
======================================================================
2783
Parameters:
2779
Parameters:
2784
  * eax = 55 - function number
2780
  * eax = 55 - function number
2785
  * ebx = 2 - subfunction number
2781
  * ebx = 2 - subfunction number
2786
  * ecx = 0 - set digit capacity
2782
  * ecx = 0 - set digit capacity
2787
    * edx = 1 - 8bit mono
2783
    * edx = 1 - 8bit mono
2788
    * edx = 2 - 8bit stereo
2784
    * edx = 2 - 8bit stereo
2789
  * ecx = 1 - set data size
2785
  * ecx = 1 - set data size
2790
    * edx = size in bytes
2786
    * edx = size in bytes
2791
  * ecx = 2 - set play frequency
2787
  * ecx = 2 - set play frequency
2792
    * edx = frequency
2788
    * edx = frequency
2793
Returned value:
2789
Returned value:
2794
  * function does not return value
2790
  * function does not return value
2795
Remarks:
2791
Remarks:
2796
  * When the system boots, it sets following default parameters:
2792
  * When the system boots, it sets following default parameters:
2797
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
2793
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
2798
    Nevertheless it is recommended to set necessary values obviously
2794
    Nevertheless it is recommended to set necessary values obviously
2799
    as they could be reset by some application.
2795
    as they could be reset by some application.
2800
 
2796
 
2801
======================================================================
2797
======================================================================
2802
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2798
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2803
======================================================================
2799
======================================================================
2804
Parameters:
2800
Parameters:
2805
  * eax = 55 - function number
2801
  * eax = 55 - function number
2806
  * ebx = 55 - subfunction number
2802
  * ebx = 55 - subfunction number
2807
  * esi = pointer to data
2803
  * esi = pointer to data
2808
Returned value:
2804
Returned value:
2809
  * eax = 0 - success
2805
  * eax = 0 - success
2810
  * eax = 55 - error (speaker is off or busy)
2806
  * eax = 55 - error (speaker is off or busy)
2811
Data is an array of items with variable length.
2807
Data is an array of items with variable length.
2812
Format of each item is defined by first byte:
2808
Format of each item is defined by first byte:
2813
  * 0 = end of data
2809
  * 0 = end of data
2814
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2810
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2815
    is defined by immediate value of frequency
2811
    is defined by immediate value of frequency
2816
    * following word (2 bytes) contains frequency divider;
2812
    * following word (2 bytes) contains frequency divider;
2817
      frequency is defined as 1193180/divider
2813
      frequency is defined as 1193180/divider
2818
  * 0x81 = invalid
2814
  * 0x81 = invalid
2819
  * 0x82..0xFF = note is defined by octave and number:
2815
  * 0x82..0xFF = note is defined by octave and number:
2820
    * duration in 1/100 of second = (first byte)-0x81
2816
    * duration in 1/100 of second = (first byte)-0x81
2821
    * there is one more byte;
2817
    * there is one more byte;
2822
    * (second byte)=0xFF - delay
2818
    * (second byte)=0xFF - delay
2823
    * otherwise it looks like a*0x10+b, where b=number of the note in
2819
    * otherwise it looks like a*0x10+b, where b=number of the note in
2824
      an octave from 1 to 12, a=number of octave (beginning from 0)
2820
      an octave from 1 to 12, a=number of octave (beginning from 0)
2825
Remarks:
2821
Remarks:
2826
  * Speaker play can be disabled/enabled by
2822
  * Speaker play can be disabled/enabled by
2827
    subfunction 8 of function 18.
2823
    subfunction 8 of function 18.
2828
  * Function returns control, having informed the system
2824
  * Function returns control, having informed the system
2829
    an information on request. Play itself goes independently from
2825
    an information on request. Play itself goes independently from
2830
    the program.
2826
    the program.
2831
  * The data must be kept in the memory at least up to the end
2827
  * The data must be kept in the memory at least up to the end
2832
    of play.
2828
    of play.
2833
 
2829
 
2834
======================================================================
2830
======================================================================
2835
================ Function 58 - work with file system. ================
2831
================ Function 58 - work with file system. ================
2836
======================================================================
2832
======================================================================
2837
Parameters:
2833
Parameters:
2838
  * eax = 58
2834
  * eax = 58
2839
  * ebx = pointer to the information structure
2835
  * ebx = pointer to the information structure
2840
Returned value:
2836
Returned value:
2841
  * eax = 0 - success; otherwise file system error code
2837
  * eax = 0 - success; otherwise file system error code
2842
  * some subfunctions return value in other registers too
2838
  * some subfunctions return value in other registers too
2843
General format of the information structure:
2839
General format of the information structure:
2844
  * +0: dword: subfunction number
2840
  * +0: dword: subfunction number
2845
  * +4: dword: number of block
2841
  * +4: dword: number of block
2846
  * +8: dword: size
2842
  * +8: dword: size
2847
  * +12 = +0xC: dword: pointer to data
2843
  * +12 = +0xC: dword: pointer to data
2848
  * +16 = +0x10: dword: pointer to a memory for system operations
2844
  * +16 = +0x10: dword: pointer to a memory for system operations
2849
    (4096 bytes)
2845
    (4096 bytes)
2850
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2846
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2851
Specifications - in documentation on the appropriate subfunction.
2847
Specifications - in documentation on the appropriate subfunction.
2852
Filename is case-insensitive for latin letters, russian letters
2848
Filename is case-insensitive for latin letters, russian letters
2853
must be capital.
2849
must be capital.
2854
Format of filename:
2850
Format of filename:
2855
/base/number/dir1/dir2/.../dirn/file,
2851
/base/number/dir1/dir2/.../dirn/file,
2856
where /base/number identifies device, on which file is located:
2852
where /base/number identifies device, on which file is located:
2857
one of
2853
one of
2858
  * /RD/1 = /RAMDISK/1 to access ramdisk
2854
  * /RD/1 = /RAMDISK/1 to access ramdisk
2859
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2855
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2860
    /FD/2 = /FLOPPYDISK/2 to access second one
2856
    /FD/2 = /FLOPPYDISK/2 to access second one
2861
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2857
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2862
    (in this case base is defined by subfunction 7 of function 21),
2858
    (in this case base is defined by subfunction 7 of function 21),
2863
    x - partition number (beginning from 1)
2859
    x - partition number (beginning from 1)
2864
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2860
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2865
    IDE0 (Primary Master), IDE1 (Primary Slave),
2861
    IDE0 (Primary Master), IDE1 (Primary Slave),
2866
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2862
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2867
    x - partition number on the selected hard drive, varies from 1
2863
    x - partition number on the selected hard drive, varies from 1
2868
    to 255 (on each hard drive the indexing starts from 1)
2864
    to 255 (on each hard drive the indexing starts from 1)
2869
Remarks:
2865
Remarks:
2870
  * In the first two cases it is also possible to use FIRST
2866
  * In the first two cases it is also possible to use FIRST
2871
    instead of 1, SECOND instead of 2, but it is not recommended
2867
    instead of 1, SECOND instead of 2, but it is not recommended
2872
    for convenience of transition to the future extensions.
2868
    for convenience of transition to the future extensions.
2873
  * Limitation n<=39 is imposed.
2869
  * Limitation n<=39 is imposed.
2874
  * Names of folders and file dir1,...,dirn,file must have the
2870
  * Names of folders and file dir1,...,dirn,file must have the
2875
    format 8.3: name no more than 8 characters, dot, extension no
2871
    format 8.3: name no more than 8 characters, dot, extension no
2876
    more than 3 characters. Trailing spaces are ignored, no other
2872
    more than 3 characters. Trailing spaces are ignored, no other
2877
    spaces is allowed. If name occupies equally 8 characters,
2873
    spaces is allowed. If name occupies equally 8 characters,
2878
    dot may be omitted (though it is not recommended to use this
2874
    dot may be omitted (though it is not recommended to use this
2879
    feature for convenience of transition to the future extensions).
2875
    feature for convenience of transition to the future extensions).
2880
  * This function does not support folders on ramdisk.
2876
  * This function does not support folders on ramdisk.
2881
Examples:
2877
Examples:
2882
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2878
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2883
    '/rd/1/kernel.asm',0
2879
    '/rd/1/kernel.asm',0
2884
  * '/HD0/1/kernel.asm',0
2880
  * '/HD0/1/kernel.asm',0
2885
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2881
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2886
Existing subfunctions:
2882
Existing subfunctions:
2887
  * subfunction 0 - read file/folder
2883
  * subfunction 0 - read file/folder
2888
  * subfunction 1 - rewrite file
2884
  * subfunction 1 - rewrite file
2889
  * subfunction 8 - LBA-read from device
2885
  * subfunction 8 - LBA-read from device
2890
  * subfunction 15 - get file system information
2886
  * subfunction 15 - get file system information
2891
 
2887
 
2892
======================================================================
2888
======================================================================
2893
=========== Function 58, subfunction 0 - read file/folder. ===========
2889
=========== Function 58, subfunction 0 - read file/folder. ===========
2894
======================================================================
2890
======================================================================
2895
Parameters:
2891
Parameters:
2896
  * eax = 58
2892
  * eax = 58
2897
  * ebx = pointer to the information structure
2893
  * ebx = pointer to the information structure
2898
Format of the information structure:
2894
Format of the information structure:
2899
  * +0: dword: 0 = subfunction number
2895
  * +0: dword: 0 = subfunction number
2900
  * +4: dword: first block to read (beginning from 0)
2896
  * +4: dword: first block to read (beginning from 0)
2901
  * +8: dword: amount of blocks to read
2897
  * +8: dword: amount of blocks to read
2902
  * +12 = +0xC: dword: pointer to buffer for data
2898
  * +12 = +0xC: dword: pointer to buffer for data
2903
  * +16 = +0x10: dword: pointer to buffer for system operations
2899
  * +16 = +0x10: dword: pointer to buffer for system operations
2904
    (4096 bytes)
2900
    (4096 bytes)
2905
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2901
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2906
    given in the general description
2902
    given in the general description
2907
Returned value:
2903
Returned value:
2908
  * eax = 0 - success, otherwise file system error code
2904
  * eax = 0 - success, otherwise file system error code
2909
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2905
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2910
Remarks:
2906
Remarks:
2911
  * Block size is 512 bytes.
2907
  * Block size is 512 bytes.
2912
  * This function is obsolete, for reading files use subfunction 0
2908
  * This function is obsolete, for reading files use subfunction 0
2913
    of function 70, for reading folders - subfunction 1 of
2909
    of function 70, for reading folders - subfunction 1 of
2914
    function 70.
2910
    function 70.
2915
  * Function can read contents of a folder. Only FAT file system is
2911
  * Function can read contents of a folder. Only FAT file system is
2916
    supported. The format of FAT-folder is described
2912
    supported. The format of FAT-folder is described
2917
    in any FAT documentation.
2913
    in any FAT documentation.
2918
  * Size of a folder is determined by size of FAT clusters chain.
2914
  * Size of a folder is determined by size of FAT clusters chain.
2919
  * If file was ended before last requested block was read,
2915
  * If file was ended before last requested block was read,
2920
    the function will read as many as it can, and after that return
2916
    the function will read as many as it can, and after that return
2921
    eax=6 (EOF).
2917
    eax=6 (EOF).
2922
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2918
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2923
    in the first two cases the current implementation does not follow
2919
    in the first two cases the current implementation does not follow
2924
    to the declared rules:
2920
    to the declared rules:
2925
    for /rd/1:
2921
    for /rd/1:
2926
    * if one want to read 0 blocks, function considers,
2922
    * if one want to read 0 blocks, function considers,
2927
      that he requested 1;
2923
      that he requested 1;
2928
    * if one requests more than 14 blocks or starting block is
2924
    * if one requests more than 14 blocks or starting block is
2929
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2925
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2930
    * size of ramdisk root folder is 14 blocks, 
2926
    * size of ramdisk root folder is 14 blocks, 
2931
      0x1C00=7168 áàéò; but function returns ebx=0
2927
      0x1C00=7168 áàéò; but function returns ebx=0
2932
      (except of the case of previous item);
2928
      (except of the case of previous item);
2933
    * strangely enough, it is possible to read 14th block (which
2929
    * strangely enough, it is possible to read 14th block (which
2934
      generally contains a garbage - I remind, the indexing begins
2930
      generally contains a garbage - I remind, the indexing begins
2935
      from 0);
2931
      from 0);
2936
    * if some block with the number not less than 14 was requested,
2932
    * if some block with the number not less than 14 was requested,
2937
      function returns eax=6(EOF); otherwise eax=0.
2933
      function returns eax=6(EOF); otherwise eax=0.
2938
    For /fd/x:
2934
    For /fd/x:
2939
    * if the start block is not less than 14, function returns
2935
    * if the start block is not less than 14, function returns
2940
      eax=5 (not found) and ebx=0;
2936
      eax=5 (not found) and ebx=0;
2941
    * note that format of FAT12 allows floppies with the root size
2937
    * note that format of FAT12 allows floppies with the root size
2942
      more or less than 14 blocks;
2938
      more or less than 14 blocks;
2943
    * check for length is not performed;
2939
    * check for length is not performed;
2944
    * if data was successful read, function returns
2940
    * if data was successful read, function returns
2945
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2941
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2946
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2942
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2947
    but the result does not correspond to expected (on operations with
2943
    but the result does not correspond to expected (on operations with
2948
    normal files/folders), does not follow the declared rules,
2944
    normal files/folders), does not follow the declared rules,
2949
    may be changed in future versions of the kernel and consequently
2945
    may be changed in future versions of the kernel and consequently
2950
    is not described. To obtain the information about the equipment
2946
    is not described. To obtain the information about the equipment
2951
    use subfunction 11 of function 18 or
2947
    use subfunction 11 of function 18 or
2952
    read corresponding folder with subfunction 1 of function 70.
2948
    read corresponding folder with subfunction 1 of function 70.
2953
 
2949
 
2954
======================================================================
2950
======================================================================
2955
============= Function 58, subfunction 1 - rewrite file. =============
2951
============= Function 58, subfunction 1 - rewrite file. =============
2956
======================================================================
2952
======================================================================
2957
If the file does not exist, it is created.
2953
If the file does not exist, it is created.
2958
If the file exists, it is rewritten.
2954
If the file exists, it is rewritten.
2959
Parameters:
2955
Parameters:
2960
  * eax = 58 - function number
2956
  * eax = 58 - function number
2961
  * ebx = pointer to the information structure
2957
  * ebx = pointer to the information structure
2962
Format of the information structure:
2958
Format of the information structure:
2963
  * +0: dword: 1 = subfunction number
2959
  * +0: dword: 1 = subfunction number
2964
  * +4: dword: ignored (set to 0)
2960
  * +4: dword: ignored (set to 0)
2965
  * +8: dword: number of bytes to write
2961
  * +8: dword: number of bytes to write
2966
  * +12 = +0xC: dword: pointer to data to write
2962
  * +12 = +0xC: dword: pointer to data to write
2967
  * +16 = +0x10: dword: pointer to buffer for system operations
2963
  * +16 = +0x10: dword: pointer to buffer for system operations
2968
    (4096 bytes)
2964
    (4096 bytes)
2969
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2965
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2970
    given in the general description
2966
    given in the general description
2971
Returned value:
2967
Returned value:
2972
  * eax = 0 - success, otherwise file system error code
2968
  * eax = 0 - success, otherwise file system error code
2973
  * ebx destroyed
2969
  * ebx destroyed
2974
Remarks:
2970
Remarks:
2975
  * This function is obsolete, use subfunction 2 of function 70.
2971
  * This function is obsolete, use subfunction 2 of function 70.
2976
 
2972
 
2977
======================================================================
2973
======================================================================
2978
========= Function 58, subfunction 8 - LBA-read from device. =========
2974
========= Function 58, subfunction 8 - LBA-read from device. =========
2979
======================================================================
2975
======================================================================
2980
Parameters:
2976
Parameters:
2981
  * eax = 58 - function number
2977
  * eax = 58 - function number
2982
  * ebx = pointer to the information structure
2978
  * ebx = pointer to the information structure
2983
Format of the information structure:
2979
Format of the information structure:
2984
  * +0: dword: 8 = subfunction number
2980
  * +0: dword: 8 = subfunction number
2985
  * +4: dword: number of block to read (beginning from 0)
2981
  * +4: dword: number of block to read (beginning from 0)
2986
  * +8: dword: ignored (set to 1)
2982
  * +8: dword: ignored (set to 1)
2987
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
2983
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
2988
  * +16 = +0x10: dword: pointer to buffer for system operations
2984
  * +16 = +0x10: dword: pointer to buffer for system operations
2989
    (4096 bytes)
2985
    (4096 bytes)
2990
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
2986
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
2991
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
2987
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
2992
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
2988
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
2993
    Instead of digits it is allowed, though not recommended for
2989
    Instead of digits it is allowed, though not recommended for
2994
    convenience of transition to future extensions, to use
2990
    convenience of transition to future extensions, to use
2995
    'first','second','third','fourth'.
2991
    'first','second','third','fourth'.
2996
Returned value:
2992
Returned value:
2997
  * for device name /hd/xxx, where xxx is not in the list above:
2993
  * for device name /hd/xxx, where xxx is not in the list above:
2998
    * eax = ebx = 1
2994
    * eax = ebx = 1
2999
  * for invalid device name (except for the previous case):
2995
  * for invalid device name (except for the previous case):
3000
    * eax = 5
2996
    * eax = 5
3001
    * ebx does not change
2997
    * ebx does not change
3002
  * if LBA-access is disabled by subfunction 11 of function 21:
2998
  * if LBA-access is disabled by subfunction 11 of function 21:
3003
    * eax = 2
2999
    * eax = 2
3004
    * ebx destroyed
3000
    * ebx destroyed
3005
  * for ramdisk: attempt to read block outside ramdisk
3001
  * for ramdisk: attempt to read block outside ramdisk
3006
    (18*2*80 blocks) results in
3002
    (18*2*80 blocks) results in
3007
    * eax = 3
3003
    * eax = 3
3008
    * ebx = 0
3004
    * ebx = 0
3009
  * for successful read:
3005
  * for successful read:
3010
    * eax = ebx = 0
3006
    * eax = ebx = 0
3011
Remarks:
3007
Remarks:
3012
  * Block size is 512 bytes; function reads one block.
3008
  * Block size is 512 bytes; function reads one block.
3013
  * Do not depend on returned value, it can be changed
3009
  * Do not depend on returned value, it can be changed
3014
    in future versions.
3010
    in future versions.
3015
  * Function requires that LBA-access to devices is enabled by 
3011
  * Function requires that LBA-access to devices is enabled by 
3016
    subfunction 11 of function 21. To check this one can use 
3012
    subfunction 11 of function 21. To check this one can use 
3017
    subfunction 11 of function 26.
3013
    subfunction 11 of function 26.
3018
  * LBA-read of floppy is not supported.
3014
  * LBA-read of floppy is not supported.
3019
  * Function reads data on physical hard drive; if for any reason
3015
  * Function reads data on physical hard drive; if for any reason
3020
    data of the concrete partition are required, application must
3016
    data of the concrete partition are required, application must
3021
    define starting sector of this partition (either directly
3017
    define starting sector of this partition (either directly
3022
    through MBR, or from the full structure returned by
3018
    through MBR, or from the full structure returned by
3023
    ïîäôóíêöèåé 11 ôóíêöèè 18).
3019
    ïîäôóíêöèåé 11 ôóíêöèè 18).
3024
  * Function does not check error code of hard disk, so request of
3020
  * Function does not check error code of hard disk, so request of
3025
    nonexisting sector reads something (most probably it will be
3021
    nonexisting sector reads something (most probably it will be
3026
    zeroes, but this is defined by device) and this is considered
3022
    zeroes, but this is defined by device) and this is considered
3027
    as success (eax=0).
3023
    as success (eax=0).
3028
 
3024
 
3029
======================================================================
3025
======================================================================
3030
==== Function 58, subfunction 15 - get information on file system. ===
3026
==== Function 58, subfunction 15 - get information on file system. ===
3031
======================================================================
3027
======================================================================
3032
Parameters:
3028
Parameters:
3033
  * eax = 58 - function number
3029
  * eax = 58 - function number
3034
  * ebx = pointer to the information structure
3030
  * ebx = pointer to the information structure
3035
Format of the information structure:
3031
Format of the information structure:
3036
  * +0: dword: 15 = subfunction number
3032
  * +0: dword: 15 = subfunction number
3037
  * +4: dword: ignored
3033
  * +4: dword: ignored
3038
  * +8: dword: ignored
3034
  * +8: dword: ignored
3039
  * +12 = +0xC: dword: ignored
3035
  * +12 = +0xC: dword: ignored
3040
  * +16 = +0x10: dword: ignored
3036
  * +16 = +0x10: dword: ignored
3041
  * +20 = +0x14: (only second character is checked)
3037
  * +20 = +0x14: (only second character is checked)
3042
    /rd=/RAMDISK or /hd=/HARDDISK
3038
    /rd=/RAMDISK or /hd=/HARDDISK
3043
Returned value:
3039
Returned value:
3044
  * if the second character does not belong to set {'r','R','h','H'}:
3040
  * if the second character does not belong to set {'r','R','h','H'}:
3045
    * eax = 3
3041
    * eax = 3
3046
    * ebx = ecx = dword [fileinfo] = 0
3042
    * ebx = ecx = dword [fileinfo] = 0
3047
  * for ramdisk:
3043
  * for ramdisk:
3048
    * eax = 0 (success)
3044
    * eax = 0 (success)
3049
    * ebx = total number of clusters = 2847
3045
    * ebx = total number of clusters = 2847
3050
    * ecx = number of free clusters
3046
    * ecx = number of free clusters
3051
    * dword [fileinfo] = cluster size = 512
3047
    * dword [fileinfo] = cluster size = 512
3052
  * for hard disk: base and partition are defined by subfunctions
3048
  * for hard disk: base and partition are defined by subfunctions
3053
    7 and 8 of function 21:
3049
    7 and 8 of function 21:
3054
    * eax = 0 (success)
3050
    * eax = 0 (success)
3055
    * ebx = total number of clusters
3051
    * ebx = total number of clusters
3056
    * ecx = number of free clusters
3052
    * ecx = number of free clusters
3057
    * dword [fileinfo] = cluster size (in bytes)
3053
    * dword [fileinfo] = cluster size (in bytes)
3058
Remarks:
3054
Remarks:
3059
  * Be not surprised to strange layout of 4th returned parameter
3055
  * Be not surprised to strange layout of 4th returned parameter
3060
    - when this code was writing, at system calls application got
3056
    - when this code was writing, at system calls application got
3061
    only registers eax,ebx,ecx (from pushad-structure transmitted
3057
    only registers eax,ebx,ecx (from pushad-structure transmitted
3062
    as argument to the system function). Now it is corrected, so,
3058
    as argument to the system function). Now it is corrected, so,
3063
    probably, it is meaningful to return cluster size in edx, while
3059
    probably, it is meaningful to return cluster size in edx, while
3064
    this function is not used yet.
3060
    this function is not used yet.
3065
  * There exists also subfunction 11 of function 18,
3061
  * There exists also subfunction 11 of function 18,
3066
    which returns information on file system. From the full table
3062
    which returns information on file system. From the full table
3067
    of disk subsystem it is possible to deduce cluster size (there
3063
    of disk subsystem it is possible to deduce cluster size (there
3068
    it is stored in sectors) and total number of clusters
3064
    it is stored in sectors) and total number of clusters
3069
    for hard disks.
3065
    for hard disks.
3070
 
3066
 
3071
======================================================================
3067
======================================================================
3072
========== Function 60 - Inter Process Communication (IPC). ==========
3068
========== Function 60 - Inter Process Communication (IPC). ==========
3073
======================================================================
3069
======================================================================
3074
IPC is used for message dispatching from one process/thread to
3070
IPC is used for message dispatching from one process/thread to
3075
another. Previously it is necessary to agree how to interpret
3071
another. Previously it is necessary to agree how to interpret
3076
the concrete message.
3072
the concrete message.
3077
 
3073
 
3078
----------- Subfunction 1 - set the area for IPC receiving -----------
3074
----------- Subfunction 1 - set the area for IPC receiving -----------
3079
Is called by process-receiver.
3075
Is called by process-receiver.
3080
Parameters:
3076
Parameters:
3081
  * eax = 60 - function number
3077
  * eax = 60 - function number
3082
  * ebx = 1 - subfunction number
3078
  * ebx = 1 - subfunction number
3083
  * ecx = pointer to the buffer
3079
  * ecx = pointer to the buffer
3084
  * edx = size of the buffer
3080
  * edx = size of the buffer
3085
Returned value:
3081
Returned value:
3086
  * eax = 0 - always success
3082
  * eax = 0 - always success
3087
Format of IPC-buffer:
3083
Format of IPC-buffer:
3088
  * +0: dword: if nonzero, buffer is considered locked;
3084
  * +0: dword: if nonzero, buffer is considered locked;
3089
    lock/unlock the buffer, when you work with it and need that
3085
    lock/unlock the buffer, when you work with it and need that
3090
    buffer data are not changed from outside (no new messages)
3086
    buffer data are not changed from outside (no new messages)
3091
  * +4: dword: occupied place in the buffer (in bytes)
3087
  * +4: dword: occupied place in the buffer (in bytes)
3092
  * +8: first message
3088
  * +8: first message
3093
  * +8+n: second message
3089
  * +8+n: second message
3094
  * ...
3090
  * ...
3095
Format of a message:
3091
Format of a message:
3096
  * +0: dword: PID of sender
3092
  * +0: dword: PID of sender
3097
  * +4: dword: message length (not including this header)
3093
  * +4: dword: message length (not including this header)
3098
  * +8: n*byte: message data
3094
  * +8: n*byte: message data
3099
 
3095
 
3100
------------------ Subfunction 2 - send IPC message ------------------
3096
------------------ Subfunction 2 - send IPC message ------------------
3101
Is called by process-sender.
3097
Is called by process-sender.
3102
Parameters:
3098
Parameters:
3103
  * eax = 60 - function number
3099
  * eax = 60 - function number
3104
  * ebx = 2 - subfunction number
3100
  * ebx = 2 - subfunction number
3105
  * ecx = PID of receiver
3101
  * ecx = PID of receiver
3106
  * edx = pointer to the message data
3102
  * edx = pointer to the message data
3107
  * esi = message length (in bytes)
3103
  * esi = message length (in bytes)
3108
Returned value:
3104
Returned value:
3109
  * eax = 0 - success
3105
  * eax = 0 - success
3110
  * eax = 1 - the receiver has not defined buffer for IPC messages
3106
  * eax = 1 - the receiver has not defined buffer for IPC messages
3111
    (can be, still have no time,
3107
    (can be, still have no time,
3112
    and can be, this is not right process)
3108
    and can be, this is not right process)
3113
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3109
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3114
  * eax = 3 - overflow of IPC-buffer of the receiver
3110
  * eax = 3 - overflow of IPC-buffer of the receiver
3115
  * eax = 4 - process/thread with such PID does not exist
3111
  * eax = 4 - process/thread with such PID does not exist
3116
Remarks:
3112
Remarks:
3117
  * Immediately after writing of IPC-message to the buffer the system
3113
  * Immediately after writing of IPC-message to the buffer the system
3118
    sends to the receiver the event with code 7 (see event codes).
3114
    sends to the receiver the event with code 7 (see event codes).
3119
 
3115
 
3120
======================================================================
3116
======================================================================
3121
==== Function 61 - get parameters for the direct graphics access. ====
3117
==== Function 61 - get parameters for the direct graphics access. ====
3122
======================================================================
3118
======================================================================
3123
The data of the graphics screen (the memory area which displays
3119
The data of the graphics screen (the memory area which displays
3124
screen contents) are accessible to a program directly, without
3120
screen contents) are accessible to a program directly, without
3125
any system calls, through the selector gs:
3121
any system calls, through the selector gs:
3126
	mov	eax, [gs:0]
3122
	mov	eax, [gs:0]
3127
places in eax the first dword of the buffer, which contains
3123
places in eax the first dword of the buffer, which contains
3128
information on color of the left upper point (and, possibly, colors
3124
information on color of the left upper point (and, possibly, colors
3129
of several following).
3125
of several following).
3130
	mov	[gs:0], eax
3126
	mov	[gs:0], eax
3131
by work in VESA modes with LFB sets color of the left upper point
3127
by work in VESA modes with LFB sets color of the left upper point
3132
(and, possibly, colors of several following).
3128
(and, possibly, colors of several following).
3133
To interpret the data of graphics screen program needs to know
3129
To interpret the data of graphics screen program needs to know
3134
some parameters, returning by this function.
3130
some parameters, returning by this function.
3135
Remarks:
3131
Remarks:
3136
  * Graphics parameters changes very seldom at work,
3132
  * Graphics parameters changes very seldom at work,
3137
    namely, only in cases, when user works with the application VRR.
3133
    namely, only in cases, when user works with the application VRR.
3138
  * At videomode change the system redraws all windows (event
3134
  * At videomode change the system redraws all windows (event
3139
    with code 1) and redraws the background (event 5).
3135
    with code 1) and redraws the background (event 5).
3140
    Same events occur in other cases too, which meet much more often,
3136
    Same events occur in other cases too, which meet much more often,
3141
    than videomode change.
3137
    than videomode change.
3142
  * By operation in videomodes with LFB the selector gs points to
3138
  * By operation in videomodes with LFB the selector gs points to
3143
    LFB itself, so reading/writing on gs result directly in
3139
    LFB itself, so reading/writing on gs result directly in
3144
    change of screen contents. By operation in videomodes without
3140
    change of screen contents. By operation in videomodes without
3145
    LFB gs points to some data area in the kernel, and all functions
3141
    LFB gs points to some data area in the kernel, and all functions
3146
    of screen output fulfil honesty double operation on writing
3142
    of screen output fulfil honesty double operation on writing
3147
    directly to the screen and writing to this buffer. In result
3143
    directly to the screen and writing to this buffer. In result
3148
    at reading contents of this buffer the results correspond to
3144
    at reading contents of this buffer the results correspond to
3149
    screen contents (with, generally speaking, large color
3145
    screen contents (with, generally speaking, large color
3150
    resolution), and writing is ignored.
3146
    resolution), and writing is ignored.
3151
    One exception is the mode 320*200, for which main loop of the
3147
    One exception is the mode 320*200, for which main loop of the
3152
    system thread updates the screen according to mouse movements.
3148
    system thread updates the screen according to mouse movements.
3153
 
3149
 
3154
------------------------- Screen resolution --------------------------
3150
------------------------- Screen resolution --------------------------
3155
Parameters:
3151
Parameters:
3156
  * eax = 61 - function number
3152
  * eax = 61 - function number
3157
  * ebx = 1 - subfunction number
3153
  * ebx = 1 - subfunction number
3158
Returned value:
3154
Returned value:
3159
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3155
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3160
Remarks:
3156
Remarks:
3161
  * One can use function 14 paying attention that
3157
  * One can use function 14 paying attention that
3162
    it returns sizes on 1 pixel less. It is fully equivalent way.
3158
    it returns sizes on 1 pixel less. It is fully equivalent way.
3163
 
3159
 
3164
---------------------- Number of bits per pixel ----------------------
3160
---------------------- Number of bits per pixel ----------------------
3165
Parameters:
3161
Parameters:
3166
  * eax = 61 - function number
3162
  * eax = 61 - function number
3167
  * ebx = 2 - subfunction number
3163
  * ebx = 2 - subfunction number
3168
Returned value:
3164
Returned value:
3169
  * eax = number of bits per pixel (24 or 32)
3165
  * eax = number of bits per pixel (24 or 32)
3170
 
3166
 
3171
-------------------- Number of bytes per scanline --------------------
3167
-------------------- Number of bytes per scanline --------------------
3172
Parameters:
3168
Parameters:
3173
  * eax = 61 - function number
3169
  * eax = 61 - function number
3174
  * ebx = 3 - subfunction number
3170
  * ebx = 3 - subfunction number
3175
Returned value:
3171
Returned value:
3176
  * eax = number of bytes occupied by one scanline
3172
  * eax = number of bytes occupied by one scanline
3177
    (horizontal line on the screen)
3173
    (horizontal line on the screen)
3178
 
3174
 
3179
======================================================================
3175
======================================================================
3180
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3176
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3181
======================================================================
3177
======================================================================
3182
Parameters:
3178
Parameters:
3183
  * eax = 62 - function number
3179
  * eax = 62 - function number
3184
  * bl = 0 - subfunction number
3180
  * bl = 0 - subfunction number
3185
Returned value:
3181
Returned value:
3186
  * eax = -1 - PCI access is disabled; otherwise
3182
  * eax = -1 - PCI access is disabled; otherwise
3187
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3183
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3188
  * high word of eax is zeroed
3184
  * high word of eax is zeroed
3189
Remarks:
3185
Remarks:
3190
  * Previously low-level access to PCI for applications must be
3186
  * Previously low-level access to PCI for applications must be
3191
    enabled by subfunction 12 of function 21.
3187
    enabled by subfunction 12 of function 21.
3192
  * If PCI BIOS is not supported, the value of ax is undefined.
3188
  * If PCI BIOS is not supported, the value of ax is undefined.
3193
 
3189
 
3194
======================================================================
3190
======================================================================
3195
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3191
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3196
======================================================================
3192
======================================================================
3197
Parameters:
3193
Parameters:
3198
  * eax = 62 - function number
3194
  * eax = 62 - function number
3199
  * bl = 1 - subfunction number
3195
  * bl = 1 - subfunction number
3200
Returned value:
3196
Returned value:
3201
  * eax = -1 - access to PCI is disabled; otherwise
3197
  * eax = -1 - access to PCI is disabled; otherwise
3202
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3198
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3203
Remarks:
3199
Remarks:
3204
  * Previously low-level access to PCI for applications must be
3200
  * Previously low-level access to PCI for applications must be
3205
    enabled by subfunction 12 of function 21.
3201
    enabled by subfunction 12 of function 21.
3206
  * If PCI BIOS is not supported, the value of ax is undefined.
3202
  * If PCI BIOS is not supported, the value of ax is undefined.
3207
 
3203
 
3208
======================================================================
3204
======================================================================
3209
===================== Function 62, subfunction 2 =====================
3205
===================== Function 62, subfunction 2 =====================
3210
===== Get mechanism of addressing to the PCI configuration space. ====
3206
===== Get mechanism of addressing to the PCI configuration space. ====
3211
======================================================================
3207
======================================================================
3212
Parameters:
3208
Parameters:
3213
  * eax = 62 - function number
3209
  * eax = 62 - function number
3214
  * bl = 2 - subfunction number
3210
  * bl = 2 - subfunction number
3215
Returned value:
3211
Returned value:
3216
  * eax = -1 - access to PCI is disabled; otherwise
3212
  * eax = -1 - access to PCI is disabled; otherwise
3217
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3213
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3218
Remarks:
3214
Remarks:
3219
  * Previously low-level access to PCI for applications must be
3215
  * Previously low-level access to PCI for applications must be
3220
    enabled by subfunction 12 of function 21.
3216
    enabled by subfunction 12 of function 21.
3221
  * Addressing mechanism is selected depending on
3217
  * Addressing mechanism is selected depending on
3222
    equipment characteristics.
3218
    equipment characteristics.
3223
  * Subfunctions of read and write work automatically
3219
  * Subfunctions of read and write work automatically
3224
    with the selected mechanism.
3220
    with the selected mechanism.
3225
 
3221
 
3226
======================================================================
3222
======================================================================
3227
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3223
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3228
======================================================================
3224
======================================================================
3229
Parameters:
3225
Parameters:
3230
  * eax = 62 - function number
3226
  * eax = 62 - function number
3231
  * bl = 4 - read byte
3227
  * bl = 4 - read byte
3232
  * bl = 5 - read word
3228
  * bl = 5 - read word
3233
  * bl = 6 - read dword
3229
  * bl = 6 - read dword
3234
  * bh = number of PCI-bus
3230
  * bh = number of PCI-bus
3235
  * ch = dddddfff, where ddddd = number of the device on the bus,
3231
  * ch = dddddfff, where ddddd = number of the device on the bus,
3236
    fff = function number of device
3232
    fff = function number of device
3237
  * cl = number of register (must be even for bl=5,
3233
  * cl = number of register (must be even for bl=5,
3238
    divisible by 4 for bl=6)
3234
    divisible by 4 for bl=6)
3239
Returned value:
3235
Returned value:
3240
  * eax = -1 - error (access to PCI is disabled or parameters
3236
  * eax = -1 - error (access to PCI is disabled or parameters
3241
    are not supported); otherwise
3237
    are not supported); otherwise
3242
  * al/ax/eax (depending on requested size) contains the data;
3238
  * al/ax/eax (depending on requested size) contains the data;
3243
    the other part of register eax is destroyed
3239
    the other part of register eax is destroyed
3244
Remarks:
3240
Remarks:
3245
  * Previously low-level access to PCI for applications must be
3241
  * Previously low-level access to PCI for applications must be
3246
    enabled by subfunction 12 of function 21.
3242
    enabled by subfunction 12 of function 21.
3247
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3243
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3248
    function number. To get access mechanism use subfunction 2.
3244
    function number. To get access mechanism use subfunction 2.
3249
  * Some registers are standard and exist for all devices, some are
3245
  * Some registers are standard and exist for all devices, some are
3250
    defined by the concrete device. The list of registers of the
3246
    defined by the concrete device. The list of registers of the
3251
    first type can be found e.g. in famous
3247
    first type can be found e.g. in famous
3252
    Interrupt List by Ralf Brown
3248
    Interrupt List by Ralf Brown
3253
    (http://www.pobox.com/~ralf/files.html,
3249
    (http://www.pobox.com/~ralf/files.html,
3254
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3250
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3255
    registers of the second type must be listed
3251
    registers of the second type must be listed
3256
    in the device documentation.
3252
    in the device documentation.
3257
 
3253
 
3258
======================================================================
3254
======================================================================
3259
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3255
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3260
======================================================================
3256
======================================================================
3261
Parameters:
3257
Parameters:
3262
  * eax = 62 - function number
3258
  * eax = 62 - function number
3263
  * bl = 8 - write byte
3259
  * bl = 8 - write byte
3264
  * bl = 9 - write word
3260
  * bl = 9 - write word
3265
  * bl = 10 - write dword
3261
  * bl = 10 - write dword
3266
  * bh = number of PCI-bus
3262
  * bh = number of PCI-bus
3267
  * ch = dddddfff, where ddddd = number of the device on the bus,
3263
  * ch = dddddfff, where ddddd = number of the device on the bus,
3268
    fff = function number of device
3264
    fff = function number of device
3269
  * cl = number of register (must be even for bl=9,
3265
  * cl = number of register (must be even for bl=9,
3270
    divisible by 4 for bl=10)
3266
    divisible by 4 for bl=10)
3271
  * dl/dx/edx (depending on requested size) contatins
3267
  * dl/dx/edx (depending on requested size) contatins
3272
    the data to write
3268
    the data to write
3273
Returned value:
3269
Returned value:
3274
  * eax = -1 - error (access to PCI is disabled or parameters
3270
  * eax = -1 - error (access to PCI is disabled or parameters
3275
    are not supported)
3271
    are not supported)
3276
  * eax = 0 - success
3272
  * eax = 0 - success
3277
Remarks:
3273
Remarks:
3278
  * Previously low-level access to PCI for applications must be
3274
  * Previously low-level access to PCI for applications must be
3279
    enabled by subfunction 12 of function 21.
3275
    enabled by subfunction 12 of function 21.
3280
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3276
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3281
    function number. To get access mechanism use subfunction 2.
3277
    function number. To get access mechanism use subfunction 2.
3282
  * Some registers are standard and exist for all devices, some are
3278
  * Some registers are standard and exist for all devices, some are
3283
    defined by the concrete device. The list of registers of the
3279
    defined by the concrete device. The list of registers of the
3284
    first type can be found e.g. in famous Interrupt List by
3280
    first type can be found e.g. in famous Interrupt List by
3285
    Ralf Brown; registers of the second type must be listed
3281
    Ralf Brown; registers of the second type must be listed
3286
    in the device documentation.
3282
    in the device documentation.
3287
 
3283
 
3288
======================================================================
3284
======================================================================
3289
============== Function 63 - work with the debug board. ==============
3285
============== Function 63 - work with the debug board. ==============
3290
======================================================================
3286
======================================================================
3291
The debug board is the global system buffer (with the size
3287
The debug board is the global system buffer (with the size
3292
512 bytes), to which any program can write (generally speaking,
3288
512 bytes), to which any program can write (generally speaking,
3293
arbitrary) data and from which other program can read these data.
3289
arbitrary) data and from which other program can read these data.
3294
By the agreement written data are text strings interpreted as
3290
By the agreement written data are text strings interpreted as
3295
debug messages on a course of program execution. The kernel in
3291
debug messages on a course of program execution. The kernel in
3296
some situations also writes to the debug board information on
3292
some situations also writes to the debug board information on
3297
execution of some functions; by the agreement kernel messages
3293
execution of some functions; by the agreement kernel messages
3298
begins from the prefix "K : ".
3294
begins from the prefix "K : ".
3299
For view of the debug board the application 'board' was created,
3295
For view of the debug board the application 'board' was created,
3300
which reads data from the buffer and displays them in its window.
3296
which reads data from the buffer and displays them in its window.
3301
'board' interpretes the sequence of codes 13,10 as newline.
3297
'board' interpretes the sequence of codes 13,10 as newline.
3302
A character with null code in an end of line is not necessary,
3298
A character with null code in an end of line is not necessary,
3303
but also does not prevent.
3299
but also does not prevent.
3304
Because debugger has been written, the value of the debug board
3300
Because debugger has been written, the value of the debug board
3305
has decreased, as debugger allows to inspect completely a course of
3301
has decreased, as debugger allows to inspect completely a course of
3306
program execution without any efforts from the direction of program
3302
program execution without any efforts from the direction of program
3307
itself. Nevertheless in some cases the debug board is still useful.
3303
itself. Nevertheless in some cases the debug board is still useful.
3308
 
3304
 
3309
----------------------------- Write byte -----------------------------
3305
----------------------------- Write byte -----------------------------
3310
Parameters:
3306
Parameters:
3311
  * eax = 63 - function number
3307
  * eax = 63 - function number
3312
  * ebx = 1 - subfunction number
3308
  * ebx = 1 - subfunction number
3313
  * cl = data byte
3309
  * cl = data byte
3314
Returned value:
3310
Returned value:
3315
  * function does not return value
3311
  * function does not return value
3316
Remarks:
3312
Remarks:
3317
  * Byte is written to the buffer. Buffer size is 512 bytes.
3313
  * Byte is written to the buffer. Buffer size is 512 bytes.
3318
    At buffer overflow all obtained data are lost.
3314
    At buffer overflow all obtained data are lost.
3319
  * For output to the debug board of more complicated objects
3315
  * For output to the debug board of more complicated objects
3320
    (strings, numbers) it is enough to call this function in cycle.
3316
    (strings, numbers) it is enough to call this function in cycle.
3321
    It is possible not to write the appropriate code manually and use
3317
    It is possible not to write the appropriate code manually and use
3322
    file 'debug.inc', which is included into the distributive.
3318
    file 'debug.inc', which is included into the distributive.
3323
 
3319
 
3324
----------------------------- Read byte ------------------------------
3320
----------------------------- Read byte ------------------------------
3325
Takes away byte from the buffer.
3321
Takes away byte from the buffer.
3326
Parameters:
3322
Parameters:
3327
  * eax = 63 - function number
3323
  * eax = 63 - function number
3328
  * ebx = 2 - subfunction number
3324
  * ebx = 2 - subfunction number
3329
Returned value:
3325
Returned value:
3330
  * eax = ebx = 0 - the buffer is empty
3326
  * eax = ebx = 0 - the buffer is empty
3331
  * eax = byte, ebx = 1 - byte was successfully read
3327
  * eax = byte, ebx = 1 - byte was successfully read
3332
 
3328
 
3333
======================================================================
3329
======================================================================
3334
============== Function 64 - resize application memory. ==============
3330
============== Function 64 - resize application memory. ==============
3335
======================================================================
3331
======================================================================
3336
Parameters:
3332
Parameters:
3337
  * eax = 64 - function number
3333
  * eax = 64 - function number
3338
  * ebx = 1 - unique subfunction
3334
  * ebx = 1 - unique subfunction
3339
  * ecx = new memory size
3335
  * ecx = new memory size
3340
Returned value:
3336
Returned value:
3341
  * eax = 0 - success
3337
  * eax = 0 - success
3342
  * eax = 1 - not enough memory
3338
  * eax = 1 - not enough memory
3343
Remarks:
3339
Remarks:
3344
  * There is another way to dynamically allocate/free memory -
3340
  * There is another way to dynamically allocate/free memory -
3345
    subfunctions 11, 12, 13 of function 68.
3341
    subfunctions 11, 12, 13 of function 68.
3346
  * The function cannot be used together with 68.11, 68.12, 68.13.
3342
  * The function cannot be used together with 68.11, 68.12, 68.13.
3347
    The function call will be ignored after creation of process heap
3343
    The function call will be ignored after creation of process heap
3348
    with function 68.11.
3344
    with function 68.11.
3349
 
3345
 
3350
======================================================================
3346
======================================================================
3351
======== Function 65 - draw image with palette in the window. ========
3347
======== Function 65 - draw image with palette in the window. ========
3352
======================================================================
3348
======================================================================
3353
Parameters:
3349
Parameters:
3354
  * eax = 65 - function number
3350
  * eax = 65 - function number
3355
  * ebx = pointer to the image
3351
  * ebx = pointer to the image
3356
  * ecx = [size on axis x]*65536 + [size on axis y]
3352
  * ecx = [size on axis x]*65536 + [size on axis y]
3357
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3353
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3358
  * esi = number of bits per pixel, must be 8, 24 or 32
3354
  * esi = number of bits per pixel, must be 8, 24 or 32
3359
  * edi = pointer to palette (256 colors 0x00RRGGBB);
3355
  * edi = pointer to palette (256 colors 0x00RRGGBB);
3360
          ignored when esi = 24 and 32
3356
          ignored when esi = 24 and 32
3361
  * ebp = offset of next row data relative to previous row data
3357
  * ebp = offset of next row data relative to previous row data
3362
Returned value:
3358
Returned value:
3363
  * function does not return value
3359
  * function does not return value
3364
Remarks:
3360
Remarks:
3365
  * Coordinates of the image are coordinates of the upper left corner
3361
  * Coordinates of the image are coordinates of the upper left corner
3366
    of the image relative to the window.
3362
    of the image relative to the window.
3367
  * Size of the image in bytes is xsize*ysize.
3363
  * Size of the image in bytes is xsize*ysize.
3368
  * Each byte of image is index in the palette.
3364
  * Each byte of image is index in the palette.
3369
  * If the image uses less than 256 colors, palette size may be
3365
  * If the image uses less than 256 colors, palette size may be
3370
    less than 256 too.
3366
    less than 256 too.
3371
  * The call to function 7 is equivalent to call to this function
3367
  * The call to function 7 is equivalent to call to this function
3372
    with esi=24, ebp=0.
3368
    with esi=24, ebp=0.
3373
 
3369
 
3374
======================================================================
3370
======================================================================
3375
================== Function 66 - work with keyboard. =================
3371
================== Function 66 - work with keyboard. =================
3376
======================================================================
3372
======================================================================
3377
The input mode influences results of reading keys by function 2.
3373
The input mode influences results of reading keys by function 2.
3378
When a program loads, ASCII input mode is set for it.
3374
When a program loads, ASCII input mode is set for it.
3379
 
3375
 
3380
-------------- Subfunction 1 - set keyboard input mode. --------------
3376
-------------- Subfunction 1 - set keyboard input mode. --------------
3381
Parameters:
3377
Parameters:
3382
  * eax = 66 - function number
3378
  * eax = 66 - function number
3383
  * ebx = 1 - subfunction number
3379
  * ebx = 1 - subfunction number
3384
  * ecx = mode:
3380
  * ecx = mode:
3385
    * 0 = normal (ASCII-characters)
3381
    * 0 = normal (ASCII-characters)
3386
    * 1 = scancodes
3382
    * 1 = scancodes
3387
Returned value:
3383
Returned value:
3388
  * function does not return value
3384
  * function does not return value
3389
 
3385
 
3390
-------------- Subfunction 2 - get keyboard input mode. --------------
3386
-------------- Subfunction 2 - get keyboard input mode. --------------
3391
Parameters:
3387
Parameters:
3392
  * eax = 66 - function number
3388
  * eax = 66 - function number
3393
  * ebx = 2 - subfunction number
3389
  * ebx = 2 - subfunction number
3394
Returned value:
3390
Returned value:
3395
  * eax = current mode
3391
  * eax = current mode
3396
 
3392
 
3397
------------ Subfunction 3 - get status of control keys. -------------
3393
------------ Subfunction 3 - get status of control keys. -------------
3398
Parameters:
3394
Parameters:
3399
  * eax = 66 - function number
3395
  * eax = 66 - function number
3400
  * ebx = 3 - subfunction number
3396
  * ebx = 3 - subfunction number
3401
Returned value:
3397
Returned value:
3402
  * eax = bit mask:
3398
  * eax = bit mask:
3403
  * bit 0 (mask 1): left Shift is pressed
3399
  * bit 0 (mask 1): left Shift is pressed
3404
  * bit 1 (mask 2): right Shift is pressed
3400
  * bit 1 (mask 2): right Shift is pressed
3405
  * bit 2 (mask 4): left Ctrl is pressed
3401
  * bit 2 (mask 4): left Ctrl is pressed
3406
  * bit 3 (mask 8): right Ctrl is pressed
3402
  * bit 3 (mask 8): right Ctrl is pressed
3407
  * bit 4 (mask 0x10): left Alt is pressed
3403
  * bit 4 (mask 0x10): left Alt is pressed
3408
  * bit 5 (mask 0x20): right Alt is pressed
3404
  * bit 5 (mask 0x20): right Alt is pressed
3409
  * bit 6 (mask 0x40): CapsLock is on
3405
  * bit 6 (mask 0x40): CapsLock is on
3410
  * bit 7 (mask 0x80): NumLock is on
3406
  * bit 7 (mask 0x80): NumLock is on
3411
  * bit 8 (mask 0x100): ScrollLock is on
3407
  * bit 8 (mask 0x100): ScrollLock is on
3412
  * other bits are cleared
3408
  * other bits are cleared
3413
 
3409
 
3414
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3410
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3415
When hotkey is pressed, the system notifies only those applications,
3411
When hotkey is pressed, the system notifies only those applications,
3416
which have installed it; the active application (which receives
3412
which have installed it; the active application (which receives
3417
all normal input) does not receive such keys.
3413
all normal input) does not receive such keys.
3418
The notification consists in sending event with the code 2.
3414
The notification consists in sending event with the code 2.
3419
Reading hotkey is the same as reading normal key - by function 2.
3415
Reading hotkey is the same as reading normal key - by function 2.
3420
Parameters:
3416
Parameters:
3421
  * eax = 66 - function number
3417
  * eax = 66 - function number
3422
  * ebx = 4 - subfunction number
3418
  * ebx = 4 - subfunction number
3423
  * cl determines key scancode;
3419
  * cl determines key scancode;
3424
    use cl=0 to give combinations such as Ctrl+Shift
3420
    use cl=0 to give combinations such as Ctrl+Shift
3425
  * edx = 0xXYZ determines possible states of control keys:
3421
  * edx = 0xXYZ determines possible states of control keys:
3426
    * Z (low 4 bits) determines state of LShift and RShift:
3422
    * Z (low 4 bits) determines state of LShift and RShift:
3427
      * 0 = no key must be pressed;
3423
      * 0 = no key must be pressed;
3428
      * 1 = exactly one key must be pressed;
3424
      * 1 = exactly one key must be pressed;
3429
      * 2 = both keys must be pressed;
3425
      * 2 = both keys must be pressed;
3430
      * 3 = must be pressed LShift, but not RShift;
3426
      * 3 = must be pressed LShift, but not RShift;
3431
      * 4 = must be pressed RShift, but not LShift
3427
      * 4 = must be pressed RShift, but not LShift
3432
    * Y - similar for LCtrl and RCtrl;
3428
    * Y - similar for LCtrl and RCtrl;
3433
    * X - similar for LAlt and RAlt
3429
    * X - similar for LAlt and RAlt
3434
Returned value:
3430
Returned value:
3435
  * eax=0 - success
3431
  * eax=0 - success
3436
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3432
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3437
Remarks:
3433
Remarks:
3438
  * Hotkey can work either at pressing or at release. Release
3434
  * Hotkey can work either at pressing or at release. Release
3439
    scancode of a key is more on 128 than pressing scancode
3435
    scancode of a key is more on 128 than pressing scancode
3440
    (i.e. high bit is set).
3436
    (i.e. high bit is set).
3441
  * Several applications can set the same combination;
3437
  * Several applications can set the same combination;
3442
    all such applications will be informed on pressing
3438
    all such applications will be informed on pressing
3443
    such combination.
3439
    such combination.
3444
 
3440
 
3445
-------------- Subfunction 5 - delete installed hotkey. --------------
3441
-------------- Subfunction 5 - delete installed hotkey. --------------
3446
Parameters:
3442
Parameters:
3447
  * eax = 66 - function number
3443
  * eax = 66 - function number
3448
  * ebx = 5 - subfunction number
3444
  * ebx = 5 - subfunction number
3449
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3445
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3450
Returned value:
3446
Returned value:
3451
  * eax = 0 - success
3447
  * eax = 0 - success
3452
  * eax = 1 - there is no such hotkey
3448
  * eax = 1 - there is no such hotkey
3453
Remarks:
3449
Remarks:
3454
  * When a process/thread terminates, all hotkey installed by it are
3450
  * When a process/thread terminates, all hotkey installed by it are
3455
    deleted.
3451
    deleted.
3456
  * The call to this subfunction does not affect other applications.
3452
  * The call to this subfunction does not affect other applications.
3457
    If other application has defined the same combination, it will
3453
    If other application has defined the same combination, it will
3458
    still receive notices.
3454
    still receive notices.
3459
 
3455
 
3460
======================================================================
3456
======================================================================
3461
========= Function 67 - change position/sizes of the window. =========
3457
========= Function 67 - change position/sizes of the window. =========
3462
======================================================================
3458
======================================================================
3463
Parameters:
3459
Parameters:
3464
  * eax = 67 - function number
3460
  * eax = 67 - function number
3465
  * ebx = new x-coordinate of the window
3461
  * ebx = new x-coordinate of the window
3466
  * ecx = new y-coordinate of the window
3462
  * ecx = new y-coordinate of the window
3467
  * edx = new x-size of the window
3463
  * edx = new x-size of the window
3468
  * esi = new y-size of the window
3464
  * esi = new y-size of the window
3469
Returned value:
3465
Returned value:
3470
  * function does not return value
3466
  * function does not return value
3471
Remarks:
3467
Remarks:
3472
  * The value -1 for a parameter means "do not change"; e.g. to move
3468
  * The value -1 for a parameter means "do not change"; e.g. to move
3473
    the window without resizing it is possible to specify edx=esi=-1.
3469
    the window without resizing it is possible to specify edx=esi=-1.
3474
  * Previously the window must be defined by function 0.
3470
  * Previously the window must be defined by function 0.
3475
    It sets initial coordinates and sizes of the window.
3471
    It sets initial coordinates and sizes of the window.
3476
  * Sizes of the window are understood in sense of function 0,
3472
  * Sizes of the window are understood in sense of function 0,
3477
    that is one pixel less than real sizes.
3473
    that is one pixel less than real sizes.
3478
  * The function call for maximized windows is simply ignored.
3474
  * The function call for maximized windows is simply ignored.
3479
  * For windows of appropriate styles position and/or sizes can be
3475
  * For windows of appropriate styles position and/or sizes can be
3480
    changed by user; current position and sizes can be obtained by
3476
    changed by user; current position and sizes can be obtained by
3481
    call to function 9.
3477
    call to function 9.
3482
  * The function sends to the window redraw event (with the code 1).
3478
  * The function sends to the window redraw event (with the code 1).
3483
 
3479
 
3484
======================================================================
3480
======================================================================
3485
====== Function 68, subfunction 0 - get the task switch counter. =====
3481
====== Function 68, subfunction 0 - get the task switch counter. =====
3486
======================================================================
3482
======================================================================
3487
Parameters:
3483
Parameters:
3488
  * eax = 68 - function number
3484
  * eax = 68 - function number
3489
  * ebx = 0 - subfunction number
3485
  * ebx = 0 - subfunction number
3490
Returned value:
3486
Returned value:
3491
  * eax = number of task switches from the system booting
3487
  * eax = number of task switches from the system booting
3492
    (modulo 2^32)
3488
    (modulo 2^32)
3493
 
3489
 
3494
======================================================================
3490
======================================================================
3495
======= Function 68, subfunction 1 - switch to the next thread. ======
3491
======= Function 68, subfunction 1 - switch to the next thread. ======
3496
======================================================================
3492
======================================================================
3497
The function completes the current time slice allocated to the
3493
The function completes the current time slice allocated to the
3498
thread and switches to the next. (Which thread in which process
3494
thread and switches to the next. (Which thread in which process
3499
will be next, is unpredictable). Later, when execution queue
3495
will be next, is unpredictable). Later, when execution queue
3500
will reach the current thread, execution will be continued.
3496
will reach the current thread, execution will be continued.
3501
Parameters:
3497
Parameters:
3502
  * eax = 68 - function number
3498
  * eax = 68 - function number
3503
  * ebx = 1 - subfunction number
3499
  * ebx = 1 - subfunction number
3504
Returned value:
3500
Returned value:
3505
  * function does not return value
3501
  * function does not return value
3506
 
3502
 
3507
======================================================================
3503
======================================================================
3508
============= Function 68, subfunction 2 - cache + rdpmc. ============
3504
============= Function 68, subfunction 2 - cache + rdpmc. ============
3509
======================================================================
3505
======================================================================
3510
Parameters:
3506
Parameters:
3511
  * eax = 68 - function number
3507
  * eax = 68 - function number
3512
  * ebx = 2 - subfunction number
3508
  * ebx = 2 - subfunction number
3513
  * ecx = required action:
3509
  * ecx = required action:
3514
    * ecx = 0 - enable instruction 'rdpmc'
3510
    * ecx = 0 - enable instruction 'rdpmc'
3515
      (ReaD Performance-Monitoring Counters) for applications
3511
      (ReaD Performance-Monitoring Counters) for applications
3516
    * ecx = 1 - find out whether cache is disabled/enabled
3512
    * ecx = 1 - find out whether cache is disabled/enabled
3517
    * ecx = 2 - enable cache
3513
    * ecx = 2 - enable cache
3518
    * ecx = 3 - disable cache
3514
    * ecx = 3 - disable cache
3519
Returned value:
3515
Returned value:
3520
  * for ecx=0:
3516
  * for ecx=0:
3521
    * eax = the value of cr4
3517
    * eax = the value of cr4
3522
  * for ecx=1:
3518
  * for ecx=1:
3523
    * eax = (cr0 and 0x60000000):
3519
    * eax = (cr0 and 0x60000000):
3524
    * eax = 0 - cache is on
3520
    * eax = 0 - cache is on
3525
    * eax <> 0 - cache is off
3521
    * eax <> 0 - cache is off
3526
  * for ecx=2 and ecx=3:
3522
  * for ecx=2 and ecx=3:
3527
    * function does not return value
3523
    * function does not return value
3528
 
3524
 
3529
======================================================================
3525
======================================================================
3530
=========== Function 68, subfunction 3 - read MSR-register. ==========
3526
=========== Function 68, subfunction 3 - read MSR-register. ==========
3531
======================================================================
3527
======================================================================
3532
MSR = Model Specific Register; the complete list of MSR-registers
3528
MSR = Model Specific Register; the complete list of MSR-registers
3533
of a processor is included to the documentation on it (for example,
3529
of a processor is included to the documentation on it (for example,
3534
IA-32 Intel Architecture Software Developer's Manual,
3530
IA-32 Intel Architecture Software Developer's Manual,
3535
Volume 3, Appendix B); each processor family has its own subset
3531
Volume 3, Appendix B); each processor family has its own subset
3536
of the MSR-registers.
3532
of the MSR-registers.
3537
Parameters:
3533
Parameters:
3538
  * eax = 68 - function number
3534
  * eax = 68 - function number
3539
  * ebx = 3 - subfunction number
3535
  * ebx = 3 - subfunction number
3540
  * ecx is ignored
3536
  * ecx is ignored
3541
  * edx = MSR address
3537
  * edx = MSR address
3542
Returned value:
3538
Returned value:
3543
  * ebx:eax = high:low dword of the result
3539
  * ebx:eax = high:low dword of the result
3544
Remarks:
3540
Remarks:
3545
  * If ecx contains nonexistent or not implemented for this processor
3541
  * If ecx contains nonexistent or not implemented for this processor
3546
    MSR, processor will generate an exception in the kernel, which
3542
    MSR, processor will generate an exception in the kernel, which
3547
    will kill the thread.
3543
    will kill the thread.
3548
  * Previously it is necessary to check, whether MSRs are supported
3544
  * Previously it is necessary to check, whether MSRs are supported
3549
    as a whole, with the instruction 'cpuid'. Otherwise processor
3545
    as a whole, with the instruction 'cpuid'. Otherwise processor
3550
    will generate other exception in the kernel, which will anyway
3546
    will generate other exception in the kernel, which will anyway
3551
    kill the thread.
3547
    kill the thread.
3552
 
3548
 
3553
======================================================================
3549
======================================================================
3554
========= Function 68, subfunction 4 - write to MSR-register. ========
3550
========= Function 68, subfunction 4 - write to MSR-register. ========
3555
======================================================================
3551
======================================================================
3556
MSR = Model Specific Register; the complete list of MSR-registers
3552
MSR = Model Specific Register; the complete list of MSR-registers
3557
of a processor is included to the documentation on it (for example,
3553
of a processor is included to the documentation on it (for example,
3558
IA-32 Intel Architecture Software Developer's Manual,
3554
IA-32 Intel Architecture Software Developer's Manual,
3559
Volume 3, Appendix B); each processor family has its own subset
3555
Volume 3, Appendix B); each processor family has its own subset
3560
of the MSR-registers.
3556
of the MSR-registers.
3561
Parameters:
3557
Parameters:
3562
  * eax = 68 - function number
3558
  * eax = 68 - function number
3563
  * ebx = 4 - subfunction number
3559
  * ebx = 4 - subfunction number
3564
  * ecx is ignored
3560
  * ecx is ignored
3565
  * edx = MSR address
3561
  * edx = MSR address
3566
  * esi:edi = high:low dword
3562
  * esi:edi = high:low dword
3567
Returned value:
3563
Returned value:
3568
  * ebx:eax = copy of esi:edi
3564
  * ebx:eax = copy of esi:edi
3569
Çàìå÷àíèÿ:
3565
Çàìå÷àíèÿ:
3570
  * If ecx contains nonexistent or not implemented for this processor
3566
  * If ecx contains nonexistent or not implemented for this processor
3571
    MSR, processor will generate an exception in the kernel, which
3567
    MSR, processor will generate an exception in the kernel, which
3572
    will kill the thread.
3568
    will kill the thread.
3573
  * Previously it is necessary to check, whether MSRs are supported
3569
  * Previously it is necessary to check, whether MSRs are supported
3574
    as a whole, with the instruction 'cpuid'. Otherwise processor
3570
    as a whole, with the instruction 'cpuid'. Otherwise processor
3575
    will generate other exception in the kernel, which will anyway
3571
    will generate other exception in the kernel, which will anyway
3576
    kill the thread.
3572
    kill the thread.
3577
 
3573
 
3578
======================================================================
3574
======================================================================
3579
======= Function 68, subfunction 11 - initialize process heap. =======
3575
======= Function 68, subfunction 11 - initialize process heap. =======
3580
======================================================================
3576
======================================================================
3581
Parameters:
3577
Parameters:
3582
  * eax = 68 - function number
3578
  * eax = 68 - function number
3583
  * ebx = 11 - subfunction number
3579
  * ebx = 11 - subfunction number
3584
Returned value:
3580
Returned value:
3585
  * eax = 0 - failed
3581
  * eax = 0 - failed
3586
  * otherwise size of created heap
3582
  * otherwise size of created heap
3587
Remarks:
3583
Remarks:
3588
  * The function call initializes heap, from which one can in future
3584
  * The function call initializes heap, from which one can in future
3589
    allocate and free memory blocks with subfunctions 12 and 13.
3585
    allocate and free memory blocks with subfunctions 12 and 13.
3590
    Heap size is equal to total amount of free application memory.
3586
    Heap size is equal to total amount of free application memory.
3591
  * The second function call from the same process results in
3587
  * The second function call from the same process results in
3592
    returning the size of the existing heap.
3588
    returning the size of the existing heap.
3593
  * After creation of the heap calls to function 64 will be ignored.
3589
  * After creation of the heap calls to function 64 will be ignored.
3594
 
3590
 
3595
======================================================================
3591
======================================================================
3596
======== Function 68, subfunction 12 - allocate memory block. ========
3592
======== Function 68, subfunction 12 - allocate memory block. ========
3597
======================================================================
3593
======================================================================
3598
Parameters:
3594
Parameters:
3599
  * eax = 68 - function number
3595
  * eax = 68 - function number
3600
  * ebx = 12 - subfunction number
3596
  * ebx = 12 - subfunction number
3601
  * ecx = required size in bytes
3597
  * ecx = required size in bytes
3602
Returned value:
3598
Returned value:
3603
  * eax = pointer to the allocated block
3599
  * eax = pointer to the allocated block
3604
Remarks:
3600
Remarks:
3605
  * Before this call one must initialize process heap by call to
3601
  * Before this call one must initialize process heap by call to
3606
    subfunction 11.
3602
    subfunction 11.
3607
  * The function allocates an integer number of pages (4 Kb) in such
3603
  * The function allocates an integer number of pages (4 Kb) in such
3608
    way that the real size of allocated block is more than or equal to
3604
    way that the real size of allocated block is more than or equal to
3609
    requested size.
3605
    requested size.
3610
 
3606
 
3611
======================================================================
3607
======================================================================
3612
========== Function 68, subfunction 13 - free memory block. ==========
3608
========== Function 68, subfunction 13 - free memory block. ==========
3613
======================================================================
3609
======================================================================
3614
Parameters:
3610
Parameters:
3615
  * eax = 68 - function number
3611
  * eax = 68 - function number
3616
  * ebx = 13 - subfunction number
3612
  * ebx = 13 - subfunction number
3617
  * ecx = pointer to the memory block
3613
  * ecx = pointer to the memory block
3618
Returned value:
3614
Returned value:
3619
  * eax = 1 - success
3615
  * eax = 1 - success
3620
  * eax = 0 - failed
3616
  * eax = 0 - failed
3621
Remarks:
3617
Remarks:
3622
  * The memory block must have been allocated by subfunction 12.
3618
  * The memory block must have been allocated by subfunction 12.
3623
 
3619
 
3624
======================================================================
3620
======================================================================
3625
======== Function 68, subfunction 14 - wait for driver notify. =======
3621
======== Function 68, subfunction 14 - wait for driver notify. =======
3626
======================================================================
3622
======================================================================
3627
Parameters:
3623
Parameters:
3628
  * eax = 68 - function number
3624
  * eax = 68 - function number
3629
  * ebx = 14 - subfunction number
3625
  * ebx = 14 - subfunction number
3630
  * ecx = pointer to the buffer for information (8 bytes)
3626
  * ecx = pointer to the buffer for information (8 bytes)
3631
Returned value:
3627
Returned value:
3632
  * buffer pointed to by ecx contains the following information:
3628
  * buffer pointed to by ecx contains the following information:
3633
    * +0: dword: constant EV_INTR = 1
3629
    * +0: dword: constant EV_INTR = 1
3634
    * +4: dword: driver data
3630
    * +4: dword: driver data
3635
Remarks:
3631
Remarks:
3636
  * The current implementation at wait time uses "heavy" operations
3632
  * The current implementation at wait time uses "heavy" operations
3637
    of task switch.
3633
    of task switch.
3638
 
3634
 
3639
======================================================================
3635
======================================================================
3640
====== Function 68, subfunction 15 - set FPU exception handler. ======
3636
====== Function 68, subfunction 15 - set FPU exception handler. ======
3641
======================================================================
3637
======================================================================
3642
Parameters:
3638
Parameters:
3643
  * eax = 68 - function number
3639
  * eax = 68 - function number
3644
  * ebx = 15 - subfunction number
3640
  * ebx = 15 - subfunction number
3645
  * ecx = address of the new exception handler
3641
  * ecx = address of the new exception handler
3646
Returned value:
3642
Returned value:
3647
  * eax = address of the old exception handler (0, if it was not set)
3643
  * eax = address of the old exception handler (0, if it was not set)
3648
 
3644
 
3649
======================================================================
3645
======================================================================
3650
============= Function 68, subfunction 16 - load driver. =============
3646
============= Function 68, subfunction 16 - load driver. =============
3651
======================================================================
3647
======================================================================
3652
Parameters:
3648
Parameters:
3653
  * eax = 68 - function number
3649
  * eax = 68 - function number
3654
  * ebx = 16 - subfunction number
3650
  * ebx = 16 - subfunction number
3655
  * ecx = pointer to ASCIIZ-string with driver name
3651
  * ecx = pointer to ASCIIZ-string with driver name
3656
Returned value:
3652
Returned value:
3657
  * eax = 0 - failed
3653
  * eax = 0 - failed
3658
  * otherwise eax = driver handle
3654
  * otherwise eax = driver handle
3659
Remarks:
3655
Remarks:
3660
  * If the driver was not loaded yet, it is loaded;
3656
  * If the driver was not loaded yet, it is loaded;
3661
    if the driver was loaded yet, nothing happens.
3657
    if the driver was loaded yet, nothing happens.
3662
  * Driver name is case-sensitive.
3658
  * Driver name is case-sensitive.
3663
    Maximum length of the name is 16 characters, including
3659
    Maximum length of the name is 16 characters, including
3664
    terminating null character, the rest is ignored.
3660
    terminating null character, the rest is ignored.
3665
  * The function can load only drivers which are registered in the
-
 
3666
    system; the current implementation contains
-
 
3667
    exactly 2 such drivers:
-
 
3668
    * name SOUND, file /rd/1/drivers/unisound.obj
3661
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3669
    * name INFINITY, file /rd/1/drivers/infinity.obj
-
 
3670
 
3662
 
3671
======================================================================
3663
======================================================================
3672
============ Function 68, subfunction 17 - driver control. ===========
3664
============ Function 68, subfunction 17 - driver control. ===========
3673
======================================================================
3665
======================================================================
3674
Parameters:
3666
Parameters:
3675
  * eax = 68 - function number
3667
  * eax = 68 - function number
3676
  * ebx = 17 - subfunction number
3668
  * ebx = 17 - subfunction number
3677
  * ecx = pointer to the control structure:
3669
  * ecx = pointer to the control structure:
3678
    * +0: dword: handle of driver
3670
    * +0: dword: handle of driver
3679
    * +4: dword: code of driver function
3671
    * +4: dword: code of driver function
3680
    * +8: dword: pointer to input data
3672
    * +8: dword: pointer to input data
3681
    * +12 = +0xC: dword: size of input data
3673
    * +12 = +0xC: dword: size of input data
3682
    * +16 = +0x10: dword: pointer to output data
3674
    * +16 = +0x10: dword: pointer to output data
3683
    * +20 = +0x14: dword: size of output data
3675
    * +20 = +0x14: dword: size of output data
3684
Returned value:
3676
Returned value:
3685
  * eax = determined by driver
3677
  * eax = determined by driver
3686
Remarks:
3678
Remarks:
3687
  * Function codes and the structure of input/output data
3679
  * Function codes and the structure of input/output data
3688
    are defined by driver.
3680
    are defined by driver.
3689
  * Previously one must obtain driver handle by subfunction 16.
3681
  * Previously one must obtain driver handle by subfunction 16.
3690
 
3682
 
3691
======================================================================
3683
======================================================================
3692
====== Function 68, subfunction 18 - set SSE exception handler. ======
3684
====== Function 68, subfunction 18 - set SSE exception handler. ======
3693
======================================================================
3685
======================================================================
3694
Parameters:
3686
Parameters:
3695
  * eax = 68 - function number
3687
  * eax = 68 - function number
3696
  * ebx = 15 - subfunction number
3688
  * ebx = 15 - subfunction number
3697
  * ecx = address of the new exception handler
3689
  * ecx = address of the new exception handler
3698
Returned value:
3690
Returned value:
3699
  * eax = address of the old exception handler (0, if it was not set)
3691
  * eax = address of the old exception handler (0, if it was not set)
3700
 
3692
 
3701
======================================================================
3693
======================================================================
3702
=============== Function 68, subfunction 19 - load DLL. ==============
3694
=============== Function 68, subfunction 19 - load DLL. ==============
3703
======================================================================
3695
======================================================================
3704
Parameters:
3696
Parameters:
3705
  * eax = 68 - function number
3697
  * eax = 68 - function number
3706
  * ebx = 19 - subfunction number
3698
  * ebx = 19 - subfunction number
3707
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3699
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3708
Returned value:
3700
Returned value:
3709
  * eax = 0 - failed
3701
  * eax = 0 - failed
3710
  * otherwise eax = pointer to DLL export table
3702
  * otherwise eax = pointer to DLL export table
3711
Remarks:
3703
Remarks:
3712
  * Export table is an array of structures of 2 dword's, terminated
3704
  * Export table is an array of structures of 2 dword's, terminated
3713
    by zero. The first dword in structure points to function name,
3705
    by zero. The first dword in structure points to function name,
3714
    the second dword contains address of function.
3706
    the second dword contains address of function.
3715
 
3707
 
3716
======================================================================
3708
======================================================================
3717
====================== Fucntion 69 - debugging. ======================
3709
====================== Fucntion 69 - debugging. ======================
3718
======================================================================
3710
======================================================================
3719
A process can load other process as debugged by set of corresponding
3711
A process can load other process as debugged by set of corresponding
3720
bit by call to subfunction 7 of function 70.
3712
bit by call to subfunction 7 of function 70.
3721
A process can have only one debugger; one process can debug some
3713
A process can have only one debugger; one process can debug some
3722
others. The system notifies debugger on events occuring with
3714
others. The system notifies debugger on events occuring with
3723
debugged process. Messages are written to the buffer defined by
3715
debugged process. Messages are written to the buffer defined by
3724
subfunction 0.
3716
subfunction 0.
3725
Format of a message:
3717
Format of a message:
3726
  * +0: dword: message code
3718
  * +0: dword: message code
3727
  * +4: dword: PID of debugged process
3719
  * +4: dword: PID of debugged process
3728
  * +8: there can be additional data depending on message code
3720
  * +8: there can be additional data depending on message code
3729
Message codes:
3721
Message codes:
3730
  * 1 = exception
3722
  * 1 = exception
3731
    * in addition dword-number of the exception is given
3723
    * in addition dword-number of the exception is given
3732
    * process is suspended
3724
    * process is suspended
3733
  * 2 = process has terminated
3725
  * 2 = process has terminated
3734
    * comes at any termination: both through the system function -1,
3726
    * comes at any termination: both through the system function -1,
3735
      and at "murder" by any other process (including debugger itself)
3727
      and at "murder" by any other process (including debugger itself)
3736
  * 3 = debug exception int 1 = #DB
3728
  * 3 = debug exception int 1 = #DB
3737
    * in addition dword-image of the register DR6 is given:
3729
    * in addition dword-image of the register DR6 is given:
3738
      * bits 0-3: condition of the corresponding breakpoint (set by
3730
      * bits 0-3: condition of the corresponding breakpoint (set by
3739
        subfunction 9) is satisfied
3731
        subfunction 9) is satisfied
3740
      * áèò 14: exception has occured because of the trace mode
3732
      * áèò 14: exception has occured because of the trace mode
3741
        (flag TF is set TF)
3733
        (flag TF is set TF)
3742
    * process is suspended
3734
    * process is suspended
3743
When debugger terminates, all debugged processes are killed.
3735
When debugger terminates, all debugged processes are killed.
3744
If debugger does not want this, it must previously detach by
3736
If debugger does not want this, it must previously detach by
3745
subfunction 3.
3737
subfunction 3.
3746
 
3738
 
3747
All subfunctions are applicable only to processes/threads started
3739
All subfunctions are applicable only to processes/threads started
3748
from the current by function 58 or 70 with set debugging flag.
3740
from the current by function 58 or 70 with set debugging flag.
3749
Debugging of multithreaded programs is not supported yet.
3741
Debugging of multithreaded programs is not supported yet.
3750
The full list of subfunctions:
3742
The full list of subfunctions:
3751
  * subfunction 0 - define data area for debug messages
3743
  * subfunction 0 - define data area for debug messages
3752
  * subfunction 1 - get contents of registers of debugged thread
3744
  * subfunction 1 - get contents of registers of debugged thread
3753
  * subfunction 2 - set contents of registers of debugged thread
3745
  * subfunction 2 - set contents of registers of debugged thread
3754
  * subfunction 3 - detach from debugged process
3746
  * subfunction 3 - detach from debugged process
3755
  * subfunction 4 - suspend debugged thread
3747
  * subfunction 4 - suspend debugged thread
3756
  * subfunction 5 - resume debugged thread
3748
  * subfunction 5 - resume debugged thread
3757
  * subfunction 6 - read from the memory of debugged process
3749
  * subfunction 6 - read from the memory of debugged process
3758
  * subfunction 7 - write to the memory of debugged process
3750
  * subfunction 7 - write to the memory of debugged process
3759
  * subfunction 8 - terminate debugged thread
3751
  * subfunction 8 - terminate debugged thread
3760
  * subfunction 9 - set/clear hardware breakpoint
3752
  * subfunction 9 - set/clear hardware breakpoint
3761
 
3753
 
3762
======================================================================
3754
======================================================================
3763
= Function 69, subfunction 0 - define data area fror debug messages. =
3755
= Function 69, subfunction 0 - define data area fror debug messages. =
3764
======================================================================
3756
======================================================================
3765
Parameters:
3757
Parameters:
3766
  * eax = 69 - function number
3758
  * eax = 69 - function number
3767
  * ebx = 0 - subfunction number
3759
  * ebx = 0 - subfunction number
3768
  * ecx = pointer
3760
  * ecx = pointer
3769
Format of data area:
3761
Format of data area:
3770
  * +0: dword: N = buffer size (not including this header)
3762
  * +0: dword: N = buffer size (not including this header)
3771
  * +4: dword: occupied place
3763
  * +4: dword: occupied place
3772
  * +8: N*byte: buffer
3764
  * +8: N*byte: buffer
3773
Returned value:
3765
Returned value:
3774
  * function does not return value
3766
  * function does not return value
3775
Remarks:
3767
Remarks:
3776
  * If the size field is negative, the buffer is considered locked
3768
  * If the size field is negative, the buffer is considered locked
3777
    and at arrival of new message the system will wait.
3769
    and at arrival of new message the system will wait.
3778
    For synchronization frame all work with the buffer by operations
3770
    For synchronization frame all work with the buffer by operations
3779
    lock/unlock
3771
    lock/unlock
3780
    	neg	[bufsize]
3772
    	neg	[bufsize]
3781
  * Data in the buffer are considered as array of items with variable
3773
  * Data in the buffer are considered as array of items with variable
3782
    length - messages. Format of a message is explained in
3774
    length - messages. Format of a message is explained in
3783
    general description.
3775
    general description.
3784
 
3776
 
3785
======================================================================
3777
======================================================================
3786
===================== Function 69, subfunction 1 =====================
3778
===================== Function 69, subfunction 1 =====================
3787
============ Get contents of registers of debugged thread. ===========
3779
============ Get contents of registers of debugged thread. ===========
3788
======================================================================
3780
======================================================================
3789
Parameters:
3781
Parameters:
3790
  * eax = 69 - function number
3782
  * eax = 69 - function number
3791
  * ebx = 1 - subfunction number
3783
  * ebx = 1 - subfunction number
3792
  * ecx = thread identifier
3784
  * ecx = thread identifier
3793
  * edx = size of context structure, must be 0x28=40 bytes
3785
  * edx = size of context structure, must be 0x28=40 bytes
3794
  * esi = pointer to context structure
3786
  * esi = pointer to context structure
3795
Returned value:
3787
Returned value:
3796
  * function does not return value
3788
  * function does not return value
3797
Format of context structure: (FPU is not supported yet)
3789
Format of context structure: (FPU is not supported yet)
3798
  * +0: dword: eip
3790
  * +0: dword: eip
3799
  * +4: dword: eflags
3791
  * +4: dword: eflags
3800
  * +8: dword: eax
3792
  * +8: dword: eax
3801
  * +12 = +0xC: dword: ecx
3793
  * +12 = +0xC: dword: ecx
3802
  * +16 = +0x10: dword: edx
3794
  * +16 = +0x10: dword: edx
3803
  * +20 = +0x14: dword: ebx
3795
  * +20 = +0x14: dword: ebx
3804
  * +24 = +0x18: dword: esp
3796
  * +24 = +0x18: dword: esp
3805
  * +28 = +0x1C: dword: ebp
3797
  * +28 = +0x1C: dword: ebp
3806
  * +32 = +0x20: dword: esi
3798
  * +32 = +0x20: dword: esi
3807
  * +36 = +0x24: dword: edi
3799
  * +36 = +0x24: dword: edi
3808
Remarks:
3800
Remarks:
3809
  * If the thread executes code of ring-0, the function returns
3801
  * If the thread executes code of ring-0, the function returns
3810
    contents of registers of ring-3.
3802
    contents of registers of ring-3.
3811
  * Process must be loaded for debugging (as is shown in
3803
  * Process must be loaded for debugging (as is shown in
3812
    general description).
3804
    general description).
3813
 
3805
 
3814
======================================================================
3806
======================================================================
3815
===================== Function 69, subfunction 2 =====================
3807
===================== Function 69, subfunction 2 =====================
3816
============ Set contents of registers of debugged thread. ===========
3808
============ Set contents of registers of debugged thread. ===========
3817
======================================================================
3809
======================================================================
3818
Parameters:
3810
Parameters:
3819
  * eax = 69 - function number
3811
  * eax = 69 - function number
3820
  * ebx = 2 - subfunction number
3812
  * ebx = 2 - subfunction number
3821
  * ecx = thread identifier
3813
  * ecx = thread identifier
3822
  * edx = size of context structure, must be 0x28=40 bytes
3814
  * edx = size of context structure, must be 0x28=40 bytes
3823
Returned value:
3815
Returned value:
3824
  * function does not return value
3816
  * function does not return value
3825
Format of context structure is shown in the description of
3817
Format of context structure is shown in the description of
3826
subfunction 1.
3818
subfunction 1.
3827
Remarks:
3819
Remarks:
3828
  * If the thread executes code of ring-0, the function returns
3820
  * If the thread executes code of ring-0, the function returns
3829
    contents of registers of ring-3.
3821
    contents of registers of ring-3.
3830
  * Process must be loaded for debugging (as is shown in
3822
  * Process must be loaded for debugging (as is shown in
3831
    general description).
3823
    general description).
3832
 
3824
 
3833
======================================================================
3825
======================================================================
3834
===== Function 69, subfunction 3 - detach from debugged process. =====
3826
===== Function 69, subfunction 3 - detach from debugged process. =====
3835
======================================================================
3827
======================================================================
3836
Parameters:
3828
Parameters:
3837
  * eax = 69 - function number
3829
  * eax = 69 - function number
3838
  * ebx = 3 - subfunction number
3830
  * ebx = 3 - subfunction number
3839
  * ecx = identifier
3831
  * ecx = identifier
3840
Returned value:
3832
Returned value:
3841
  * function does not return value
3833
  * function does not return value
3842
Remarks:
3834
Remarks:
3843
  * If the process was suspended, it resumes execution.
3835
  * If the process was suspended, it resumes execution.
3844
 
3836
 
3845
======================================================================
3837
======================================================================
3846
======== Function 69, subfunction 4 - suspend debugged thread. =======
3838
======== Function 69, subfunction 4 - suspend debugged thread. =======
3847
======================================================================
3839
======================================================================
3848
Parameters:
3840
Parameters:
3849
  * eax = 69 - function number
3841
  * eax = 69 - function number
3850
  * ebx = 4 - subfunction number
3842
  * ebx = 4 - subfunction number
3851
  * ecx = thread identifier
3843
  * ecx = thread identifier
3852
Returned value:
3844
Returned value:
3853
  * function does not return value
3845
  * function does not return value
3854
Remarks:
3846
Remarks:
3855
  * Process must be loaded for debugging (as is shown in
3847
  * Process must be loaded for debugging (as is shown in
3856
    general description).
3848
    general description).
3857
 
3849
 
3858
======================================================================
3850
======================================================================
3859
======== Function 69, subfunction 5 - resume debugged thread. ========
3851
======== Function 69, subfunction 5 - resume debugged thread. ========
3860
======================================================================
3852
======================================================================
3861
Parameters:
3853
Parameters:
3862
  * eax = 69 - function number
3854
  * eax = 69 - function number
3863
  * ebx = 5 - subfunction number
3855
  * ebx = 5 - subfunction number
3864
  * ecx = thread identifier
3856
  * ecx = thread identifier
3865
Returned value:
3857
Returned value:
3866
  * function does not return value
3858
  * function does not return value
3867
Remarks:
3859
Remarks:
3868
  * Process must be loaded for debugging (as is shown in
3860
  * Process must be loaded for debugging (as is shown in
3869
    general description).
3861
    general description).
3870
 
3862
 
3871
======================================================================
3863
======================================================================
3872
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3864
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3873
======================================================================
3865
======================================================================
3874
Parameters:
3866
Parameters:
3875
  * eax = 69 - function number
3867
  * eax = 69 - function number
3876
  * ebx = 6 - subfunction number
3868
  * ebx = 6 - subfunction number
3877
  * ecx = identifier
3869
  * ecx = identifier
3878
  * edx = number of bytes to read
3870
  * edx = number of bytes to read
3879
  * esi = address in the memory of debugged process
3871
  * esi = address in the memory of debugged process
3880
  * edi = pointer to buffer for data
3872
  * edi = pointer to buffer for data
3881
Returned value:
3873
Returned value:
3882
  * eax = -1 at an error (invalid PID or buffer)
3874
  * eax = -1 at an error (invalid PID or buffer)
3883
  * otherwise eax = number of read bytes (possibly, 0,
3875
  * otherwise eax = number of read bytes (possibly, 0,
3884
    if esi is too large)
3876
    if esi is too large)
3885
Remarks:
3877
Remarks:
3886
  * Process must be loaded for debugging (as is shown in
3878
  * Process must be loaded for debugging (as is shown in
3887
    general description).
3879
    general description).
3888
 
3880
 
3889
======================================================================
3881
======================================================================
3890
== Function 69, subfunction 7 - write to memory of debugged process. =
3882
== Function 69, subfunction 7 - write to memory of debugged process. =
3891
======================================================================
3883
======================================================================
3892
Parameters:
3884
Parameters:
3893
  * eax = 69 - function number
3885
  * eax = 69 - function number
3894
  * ebx = 7 - subfunction number
3886
  * ebx = 7 - subfunction number
3895
  * ecx = identifier
3887
  * ecx = identifier
3896
  * edx = number of bytes to write
3888
  * edx = number of bytes to write
3897
  * esi = address of memory in debugged process
3889
  * esi = address of memory in debugged process
3898
  * edi = pointer to data
3890
  * edi = pointer to data
3899
Returned value:
3891
Returned value:
3900
  * eax = -1 at an error (invalid PID or buffer)
3892
  * eax = -1 at an error (invalid PID or buffer)
3901
  * otherwise eax = number of written bytes (possibly, 0,
3893
  * otherwise eax = number of written bytes (possibly, 0,
3902
    if esi is too large)
3894
    if esi is too large)
3903
Remarks:
3895
Remarks:
3904
  * Process must be loaded for debugging (as is shown in
3896
  * Process must be loaded for debugging (as is shown in
3905
    general description).
3897
    general description).
3906
 
3898
 
3907
======================================================================
3899
======================================================================
3908
======= Function 69, subfunction 8 - terminate debugged thread. ======
3900
======= Function 69, subfunction 8 - terminate debugged thread. ======
3909
======================================================================
3901
======================================================================
3910
Parameters:
3902
Parameters:
3911
  * eax = 69 - function number
3903
  * eax = 69 - function number
3912
  * ebx = 8 - subfunction number
3904
  * ebx = 8 - subfunction number
3913
  * ecx = identifier
3905
  * ecx = identifier
3914
Returned value:
3906
Returned value:
3915
  * function does not return value
3907
  * function does not return value
3916
Remarks:
3908
Remarks:
3917
  * Process must be loaded for debugging (as is shown in
3909
  * Process must be loaded for debugging (as is shown in
3918
    general description).
3910
    general description).
3919
  * The function is similar to subfunction 2 of function 18
3911
  * The function is similar to subfunction 2 of function 18
3920
    with two differences: it requires first remark and
3912
    with two differences: it requires first remark and
3921
    accepts PID rather than slot number.
3913
    accepts PID rather than slot number.
3922
 
3914
 
3923
======================================================================
3915
======================================================================
3924
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3916
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3925
======================================================================
3917
======================================================================
3926
Parameters:
3918
Parameters:
3927
  * eax = 69 - function number
3919
  * eax = 69 - function number
3928
  * ebx = 9 - subfunction number
3920
  * ebx = 9 - subfunction number
3929
  * ecx = thread identifier
3921
  * ecx = thread identifier
3930
  * dl = index of breakpoint, from 0 to 3 inclusively
3922
  * dl = index of breakpoint, from 0 to 3 inclusively
3931
  * dh = flags:
3923
  * dh = flags:
3932
    * if high bit is cleared - set breakpoint:
3924
    * if high bit is cleared - set breakpoint:
3933
      * bits 0-1 - condition:
3925
      * bits 0-1 - condition:
3934
        * 00 = breakpoint on execution
3926
        * 00 = breakpoint on execution
3935
        * 01 = breakpoint on read
3927
        * 01 = breakpoint on read
3936
        * 11 = breakpoint on read/write
3928
        * 11 = breakpoint on read/write
3937
      * bits 2-3 - length; for breakpoints on exception it must be
3929
      * bits 2-3 - length; for breakpoints on exception it must be
3938
        00, otherwise one of
3930
        00, otherwise one of
3939
        * 00 = byte
3931
        * 00 = byte
3940
        * 01 = word
3932
        * 01 = word
3941
        * 11 = dword
3933
        * 11 = dword
3942
      * esi = breakpoint address; must be aligned according to
3934
      * esi = breakpoint address; must be aligned according to
3943
        the length (i.e. must be even for word breakpoints,
3935
        the length (i.e. must be even for word breakpoints,
3944
        divisible by 4 for dword)
3936
        divisible by 4 for dword)
3945
    * if high bit is set - clear breakpoint
3937
    * if high bit is set - clear breakpoint
3946
Returned value:
3938
Returned value:
3947
  * eax = 0 - success
3939
  * eax = 0 - success
3948
  * eax = 1 - error in the input data
3940
  * eax = 1 - error in the input data
3949
  * eax = 2 - (reserved, is never returned in the current
3941
  * eax = 2 - (reserved, is never returned in the current
3950
    implementation) a global breakpoint with that index is already set
3942
    implementation) a global breakpoint with that index is already set
3951
Remarks:
3943
Remarks:
3952
  * Process must be loaded for debugging (as is shown in
3944
  * Process must be loaded for debugging (as is shown in
3953
    general description).
3945
    general description).
3954
  * Hardware breakpoints are implemented through DRx-registers of
3946
  * Hardware breakpoints are implemented through DRx-registers of
3955
    the processor, all limitations results from this.
3947
    the processor, all limitations results from this.
3956
  * The function can reinstall the breakpoint, previously set
3948
  * The function can reinstall the breakpoint, previously set
3957
    by it (and it does not inform on this).
3949
    by it (and it does not inform on this).
3958
    Carry on the list of set breakpoints in the debugger.
3950
    Carry on the list of set breakpoints in the debugger.
3959
  * Breakpoints generate debug exception #DB, on which the system
3951
  * Breakpoints generate debug exception #DB, on which the system
3960
    notifies debugger.
3952
    notifies debugger.
3961
  * Breakpoints on write and read/write act after
3953
  * Breakpoints on write and read/write act after
3962
    execution of the caused it instruction.
3954
    execution of the caused it instruction.
3963
 
3955
 
3964
======================================================================
3956
======================================================================
3965
==== Function 70 - work with file system with long names support. ====
3957
==== Function 70 - work with file system with long names support. ====
3966
======================================================================
3958
======================================================================
3967
Parameters:
3959
Parameters:
3968
  * eax = 70
3960
  * eax = 70
3969
  * ebx = pointer to the information structure
3961
  * ebx = pointer to the information structure
3970
Returned value:
3962
Returned value:
3971
  * eax = 0 - success; otherwise file system error code
3963
  * eax = 0 - success; otherwise file system error code
3972
  * some subfunctions return value in other registers too
3964
  * some subfunctions return value in other registers too
3973
General format of the information structure:
3965
General format of the information structure:
3974
  * +0: dword: subfunction number
3966
  * +0: dword: subfunction number
3975
  * +4: dword: file offset
3967
  * +4: dword: file offset
3976
  * +8: dword: high dword of offset (must be 0) or flags field
3968
  * +8: dword: high dword of offset (must be 0) or flags field
3977
  * +12 = +0xC: dword: size
3969
  * +12 = +0xC: dword: size
3978
  * +16 = +0x10: dword: pointer to data
3970
  * +16 = +0x10: dword: pointer to data
3979
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3971
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3980
    or
3972
    or
3981
  * +20 = +0x14: db 0
3973
  * +20 = +0x14: db 0
3982
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3974
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3983
Specifications - in documentation on the appropriate subfunction.
3975
Specifications - in documentation on the appropriate subfunction.
3984
Filename is case-insensitive. Russian letters must be written in
3976
Filename is case-insensitive. Russian letters must be written in
3985
the encoding cp866 (DOS).
3977
the encoding cp866 (DOS).
3986
Format of filename:
3978
Format of filename:
3987
/base/number/dir1/dir2/.../dirn/file,
3979
/base/number/dir1/dir2/.../dirn/file,
3988
where /base/number identifies device, on which file is located:
3980
where /base/number identifies device, on which file is located:
3989
one of
3981
one of
3990
  * /RD/1 = /RAMDISK/1 to access ramdisk
3982
  * /RD/1 = /RAMDISK/1 to access ramdisk
3991
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3983
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3992
    /FD/2 = /FLOPPYDISK/2 to access second one
3984
    /FD/2 = /FLOPPYDISK/2 to access second one
3993
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3985
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3994
    IDE0 (Primary Master), IDE1 (Primary Slave),
3986
    IDE0 (Primary Master), IDE1 (Primary Slave),
3995
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3987
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3996
    x - partition number on the selected hard drive, varies from 1
3988
    x - partition number on the selected hard drive, varies from 1
3997
    to 255 (on each hard drive the indexing starts from 1)
3989
    to 255 (on each hard drive the indexing starts from 1)
3998
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3990
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3999
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3991
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
4000
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3992
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
4001
Examples:
3993
Examples:
4002
  * '/rd/1/kernel.asm',0
3994
  * '/rd/1/kernel.asm',0
4003
  * '/HD0/1/kernel.asm',0
3995
  * '/HD0/1/kernel.asm',0
4004
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3996
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4005
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3997
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4006
Available subfunctions:
3998
Available subfunctions:
4007
  * subfunction 0 - read file
3999
  * subfunction 0 - read file
4008
  * subfunction 1 - read folder
4000
  * subfunction 1 - read folder
4009
  * subfunction 2 - create/rewrite file
4001
  * subfunction 2 - create/rewrite file
4010
  * subfunction 3 - write to existing file
4002
  * subfunction 3 - write to existing file
4011
  * subfunction 4 - set file size
4003
  * subfunction 4 - set file size
4012
  * subfunction 5 - get attributes of file/folder
4004
  * subfunction 5 - get attributes of file/folder
4013
  * subfunction 6 - set attributes of file/folder
4005
  * subfunction 6 - set attributes of file/folder
4014
  * subfunction 7 - start application
4006
  * subfunction 7 - start application
4015
  * subfunction 8 - delete file/folder
4007
  * subfunction 8 - delete file/folder
4016
  * subfunction 9 - create folder
4008
  * subfunction 9 - create folder
4017
For CD-drives due to hardware limitations only subfunctions
4009
For CD-drives due to hardware limitations only subfunctions
4018
0,1,5 and 7 are available, other subfunctions return error
4010
0,1,5 and 7 are available, other subfunctions return error
4019
with code 2.
4011
with code 2.
4020
 
4012
 
4021
======================================================================
4013
======================================================================
4022
=== Function 70, subfunction 0 - read file with long names support. ==
4014
=== Function 70, subfunction 0 - read file with long names support. ==
4023
======================================================================
4015
======================================================================
4024
Parameters:
4016
Parameters:
4025
  * eax = 70 - function number
4017
  * eax = 70 - function number
4026
  * ebx = pointer to the information structure
4018
  * ebx = pointer to the information structure
4027
Format of the information structure:
4019
Format of the information structure:
4028
  * +0: dword: 0 = subfunction number
4020
  * +0: dword: 0 = subfunction number
4029
  * +4: dword: file offset (in bytes)
4021
  * +4: dword: file offset (in bytes)
4030
  * +8: dword: 0 (reserved for high dword of offset)
4022
  * +8: dword: 0 (reserved for high dword of offset)
4031
  * +12 = +0xC: dword: number of bytes to read
4023
  * +12 = +0xC: dword: number of bytes to read
4032
  * +16 = +0x10: dword: pointer to buffer for data
4024
  * +16 = +0x10: dword: pointer to buffer for data
4033
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4025
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4034
    given in the general description
4026
    given in the general description
4035
    or
4027
    or
4036
  * +20 = +0x14: db 0
4028
  * +20 = +0x14: db 0
4037
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4029
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4038
Returned value:
4030
Returned value:
4039
  * eax = 0 - success, otherwise file system error code
4031
  * eax = 0 - success, otherwise file system error code
4040
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4032
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4041
Remarks:
4033
Remarks:
4042
  * If file was ended before last requested block was read,
4034
  * If file was ended before last requested block was read,
4043
    the function will read as many as it can, and after that return
4035
    the function will read as many as it can, and after that return
4044
    eax=6 (EOF).
4036
    eax=6 (EOF).
4045
  * The function does not allow to read folder (returns eax=10,
4037
  * The function does not allow to read folder (returns eax=10,
4046
    access denied).
4038
    access denied).
4047
 
4039
 
4048
======================================================================
4040
======================================================================
4049
== Function 70, subfunction 1 - read folder with long names support. =
4041
== Function 70, subfunction 1 - read folder with long names support. =
4050
======================================================================
4042
======================================================================
4051
Parameters:
4043
Parameters:
4052
  * eax = 70 - function number
4044
  * eax = 70 - function number
4053
  * ebx = pointer to the information structure
4045
  * ebx = pointer to the information structure
4054
Format of the information structure:
4046
Format of the information structure:
4055
  * +0: dword: 1 = subfunction number
4047
  * +0: dword: 1 = subfunction number
4056
  * +4: dword: index of starting block (beginning from 0)
4048
  * +4: dword: index of starting block (beginning from 0)
4057
  * +8: dword: flags field:
4049
  * +8: dword: flags field:
4058
    * bit 0 (mask 1): in what format to return names,
4050
    * bit 0 (mask 1): in what format to return names,
4059
      0=ANSI, 1=UNICODE
4051
      0=ANSI, 1=UNICODE
4060
    * other bits are reserved and must be set to 0 for the future
4052
    * other bits are reserved and must be set to 0 for the future
4061
      compatibility
4053
      compatibility
4062
  * +12 = +0xC: dword: number of blocks to read
4054
  * +12 = +0xC: dword: number of blocks to read
4063
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4055
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4064
    must be not less than 32 + [+12]*560 bytes
4056
    must be not less than 32 + [+12]*560 bytes
4065
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4057
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4066
    given in the general description
4058
    given in the general description
4067
    or
4059
    or
4068
  * +20 = +0x14: db 0
4060
  * +20 = +0x14: db 0
4069
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4061
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4070
Returned value:
4062
Returned value:
4071
  * eax = 0 - success, otherwise file system error code
4063
  * eax = 0 - success, otherwise file system error code
4072
  * ebx = number of files, information on which was written to
4064
  * ebx = number of files, information on which was written to
4073
    the buffer, or -1=0xffffffff, if folder was not found
4065
    the buffer, or -1=0xffffffff, if folder was not found
4074
Structure of the buffer:
4066
Structure of the buffer:
4075
  * +0: 32*byte: header
4067
  * +0: 32*byte: header
4076
  * +32 = +0x20: n1*byte: block with information on file 1
4068
  * +32 = +0x20: n1*byte: block with information on file 1
4077
  * +32+n1: n2*byte: block with information on file 2
4069
  * +32+n1: n2*byte: block with information on file 2
4078
  * ...
4070
  * ...
4079
Structure of header:
4071
Structure of header:
4080
  * +0: dword: version of structure (current is 1)
4072
  * +0: dword: version of structure (current is 1)
4081
  * +4: dword: number of placed blocks; is not greater than requested
4073
  * +4: dword: number of placed blocks; is not greater than requested
4082
    in the field +12 of information structure; can be less, if
4074
    in the field +12 of information structure; can be less, if
4083
    there are no more files in folder (the same as in ebx)
4075
    there are no more files in folder (the same as in ebx)
4084
  * +8: dword: total number of files in folder
4076
  * +8: dword: total number of files in folder
4085
  * +12 = +0xC: 20*byte: reserved (zeroed)
4077
  * +12 = +0xC: 20*byte: reserved (zeroed)
4086
Structure of block of data for folder entry (BDFE):
4078
Structure of block of data for folder entry (BDFE):
4087
  * +0: dword: attributes of file:
4079
  * +0: dword: attributes of file:
4088
    * bit 0 (mask 1): file is read-only
4080
    * bit 0 (mask 1): file is read-only
4089
    * bit 1 (mask 2): file is hidden
4081
    * bit 1 (mask 2): file is hidden
4090
    * bit 2 (mask 4): file is system
4082
    * bit 2 (mask 4): file is system
4091
    * bit 3 (mask 8): this is not a file but volume label
4083
    * bit 3 (mask 8): this is not a file but volume label
4092
      (for one partition meets no more than once and
4084
      (for one partition meets no more than once and
4093
      only in root folder)
4085
      only in root folder)
4094
    * bit 4 (mask 0x10): this is a folder
4086
    * bit 4 (mask 0x10): this is a folder
4095
    * bit 5 (mask 0x20): file was not archived - many archivation
4087
    * bit 5 (mask 0x20): file was not archived - many archivation
4096
      programs have an option to archive only files with this bit set,
4088
      programs have an option to archive only files with this bit set,
4097
      and after archiving this bit is cleared - it can be useful
4089
      and after archiving this bit is cleared - it can be useful
4098
      for automatically creating of backup-archives as at writing
4090
      for automatically creating of backup-archives as at writing
4099
      this bit is usually set
4091
      this bit is usually set
4100
  * +4: byte: type of name data:
4092
  * +4: byte: type of name data:
4101
    (coincides with bit 0 of flags in the information structure)
4093
    (coincides with bit 0 of flags in the information structure)
4102
    * 0 = ASCII = 1-byte representation of each character
4094
    * 0 = ASCII = 1-byte representation of each character
4103
    * 1 = UNICODE = 2-byte representation of each character
4095
    * 1 = UNICODE = 2-byte representation of each character
4104
  * +5: 3*byte: reserved (zero)
4096
  * +5: 3*byte: reserved (zero)
4105
  * +8: 4*byte: time of file creation
4097
  * +8: 4*byte: time of file creation
4106
  * +12 = +0xC: 4*byte: date of file creation
4098
  * +12 = +0xC: 4*byte: date of file creation
4107
  * +16 = +0x10: 4*byte: time of last access (read or write)
4099
  * +16 = +0x10: 4*byte: time of last access (read or write)
4108
  * +20 = +0x14: 4*byte: date of last access
4100
  * +20 = +0x14: 4*byte: date of last access
4109
  * +24 = +0x18: 4*byte: time of last modification
4101
  * +24 = +0x18: 4*byte: time of last modification
4110
  * +28 = +0x1C: 4*byte: date of last modification
4102
  * +28 = +0x1C: 4*byte: date of last modification
4111
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4103
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4112
  * +40 = +0x28: name
4104
  * +40 = +0x28: name
4113
    * for ASCII format: maximum length is 263 characters
4105
    * for ASCII format: maximum length is 263 characters
4114
      (263 bytes), byte after the name has value 0
4106
      (263 bytes), byte after the name has value 0
4115
    * for UNICODE format: maximum length is 259 characters
4107
    * for UNICODE format: maximum length is 259 characters
4116
      (518 bytes), 2 bytes after the name have value 0
4108
      (518 bytes), 2 bytes after the name have value 0
4117
Time format:
4109
Time format:
4118
  * +0: byte: seconds
4110
  * +0: byte: seconds
4119
  * +1: byte: minutes
4111
  * +1: byte: minutes
4120
  * +2: byte: hours
4112
  * +2: byte: hours
4121
  * +3: byte: reserved (0)
4113
  * +3: byte: reserved (0)
4122
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4114
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4123
Date format:
4115
Date format:
4124
  * +0: byte: day
4116
  * +0: byte: day
4125
  * +1: byte: month
4117
  * +1: byte: month
4126
  * +2: word: year
4118
  * +2: word: year
4127
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4119
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4128
Remarks:
4120
Remarks:
4129
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4121
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4130
    if UNICODE name - 560 bytes. Value of length is aligned
4122
    if UNICODE name - 560 bytes. Value of length is aligned
4131
    on 16-byte bound (to accelerate processing in CPU cache).
4123
    on 16-byte bound (to accelerate processing in CPU cache).
4132
  * First character after a name is zero (ASCIIZ-string). The further
4124
  * First character after a name is zero (ASCIIZ-string). The further
4133
    data contain garbage.
4125
    data contain garbage.
4134
  * If files in folder were ended before requested number was read,
4126
  * If files in folder were ended before requested number was read,
4135
    the function will read as many as it can, and after that return
4127
    the function will read as many as it can, and after that return
4136
    eax=6 (EOF).
4128
    eax=6 (EOF).
4137
  * Any folder on the disk, except for root, contains two special
4129
  * Any folder on the disk, except for root, contains two special
4138
    entries "." and "..", identifying accordingly the folder itself
4130
    entries "." and "..", identifying accordingly the folder itself
4139
    and the parent folder.
4131
    and the parent folder.
4140
  * The function allows also to read virtual folders "/", "/rd",
4132
  * The function allows also to read virtual folders "/", "/rd",
4141
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4133
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4142
    and times and dates are zeroed. An alternative way to get the
4134
    and times and dates are zeroed. An alternative way to get the
4143
    equipment information - subfunction 11 of function 18.
4135
    equipment information - subfunction 11 of function 18.
4144
 
4136
 
4145
======================================================================
4137
======================================================================
4146
===================== Function 70, subfunction 2 =====================
4138
===================== Function 70, subfunction 2 =====================
4147
============ Create/rewrite file with long names support. ============
4139
============ Create/rewrite file with long names support. ============
4148
======================================================================
4140
======================================================================
4149
Parameters:
4141
Parameters:
4150
  * eax = 70 - function number
4142
  * eax = 70 - function number
4151
  * ebx = pointer to the information structure
4143
  * ebx = pointer to the information structure
4152
Format of the information structure:
4144
Format of the information structure:
4153
  * +0: dword: 2 = subfunction number
4145
  * +0: dword: 2 = subfunction number
4154
  * +4: dword: 0 (reserved)
4146
  * +4: dword: 0 (reserved)
4155
  * +8: dword: 0 (reserved)
4147
  * +8: dword: 0 (reserved)
4156
  * +12 = +0xC: dword: number of bytes to read
4148
  * +12 = +0xC: dword: number of bytes to read
4157
  * +16 = +0x10: dword: pointer to data
4149
  * +16 = +0x10: dword: pointer to data
4158
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4150
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4159
    given in the general description
4151
    given in the general description
4160
    or
4152
    or
4161
  * +20 = +0x14: db 0
4153
  * +20 = +0x14: db 0
4162
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4154
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4163
Returned value:
4155
Returned value:
4164
  * eax = 0 - success, otherwise file system error code
4156
  * eax = 0 - success, otherwise file system error code
4165
  * ebx = number of written bytes (possibly 0)
4157
  * ebx = number of written bytes (possibly 0)
4166
Remarks:
4158
Remarks:
4167
  * If a file with given name did not exist, it is created;
4159
  * If a file with given name did not exist, it is created;
4168
    if it existed, it is rewritten.
4160
    if it existed, it is rewritten.
4169
  * If there is not enough free space on disk, the function will
4161
  * If there is not enough free space on disk, the function will
4170
    write as many as can and then return error code 8.
4162
    write as many as can and then return error code 8.
4171
  * The function is not supported for CD (returns error code 2).
4163
  * The function is not supported for CD (returns error code 2).
4172
 
4164
 
4173
======================================================================
4165
======================================================================
4174
===================== Function 70, subfunction 3 =====================
4166
===================== Function 70, subfunction 3 =====================
4175
=========== Write to existing file with long names support. ==========
4167
=========== Write to existing file with long names support. ==========
4176
======================================================================
4168
======================================================================
4177
Parameters:
4169
Parameters:
4178
  * eax = 70 - function number
4170
  * eax = 70 - function number
4179
  * ebx = pointer to the information structure
4171
  * ebx = pointer to the information structure
4180
Format of the information structure:
4172
Format of the information structure:
4181
  * +0: dword: 3 = subfunction number
4173
  * +0: dword: 3 = subfunction number
4182
  * +4: dword: file offset (in bytes)
4174
  * +4: dword: file offset (in bytes)
4183
  * +8: dword: high dword of offset (must be 0 for FAT)
4175
  * +8: dword: high dword of offset (must be 0 for FAT)
4184
  * +12 = +0xC: dword: number of bytes to write
4176
  * +12 = +0xC: dword: number of bytes to write
4185
  * +16 = +0x10: dword: pointer to data
4177
  * +16 = +0x10: dword: pointer to data
4186
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4178
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4187
    given in the general description
4179
    given in the general description
4188
    or
4180
    or
4189
  * +20 = +0x14: db 0
4181
  * +20 = +0x14: db 0
4190
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4182
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4191
Returned value:
4183
Returned value:
4192
  * eax = 0 - success, otherwise file system error code
4184
  * eax = 0 - success, otherwise file system error code
4193
  * ebx = number of written bytes (possibly 0)
4185
  * ebx = number of written bytes (possibly 0)
4194
Remarks:
4186
Remarks:
4195
  * The file must already exist, otherwise function returns eax=5.
4187
  * The file must already exist, otherwise function returns eax=5.
4196
  * The only result of write 0 bytes is update in the file attributes
4188
  * The only result of write 0 bytes is update in the file attributes
4197
    date/time of modification and access to the current date/time.
4189
    date/time of modification and access to the current date/time.
4198
  * If beginning and/or ending position is greater than file size
4190
  * If beginning and/or ending position is greater than file size
4199
    (except for the previous case), the file is expanded to needed
4191
    (except for the previous case), the file is expanded to needed
4200
    size with zero characters.
4192
    size with zero characters.
4201
  * The function is not supported for CD (returns error code 2).
4193
  * The function is not supported for CD (returns error code 2).
4202
 
4194
 
4203
======================================================================
4195
======================================================================
4204
============ Function 70, subfunction 4 - set end of file. ===========
4196
============ Function 70, subfunction 4 - set end of file. ===========
4205
======================================================================
4197
======================================================================
4206
Parameters:
4198
Parameters:
4207
  * eax = 70 - function number
4199
  * eax = 70 - function number
4208
  * ebx = pointer to the information structure
4200
  * ebx = pointer to the information structure
4209
Format of the information structure:
4201
Format of the information structure:
4210
  * +0: dword: 4 = subfunction number
4202
  * +0: dword: 4 = subfunction number
4211
  * +4: dword: low dword of new file size
4203
  * +4: dword: low dword of new file size
4212
  * +8: dword: high dword of new file size (must be 0 for FAT)
4204
  * +8: dword: high dword of new file size (must be 0 for FAT)
4213
  * +12 = +0xC: dword: 0 (reserved)
4205
  * +12 = +0xC: dword: 0 (reserved)
4214
  * +16 = +0x10: dword: 0 (reserved)
4206
  * +16 = +0x10: dword: 0 (reserved)
4215
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4207
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4216
    given in the general description
4208
    given in the general description
4217
    or
4209
    or
4218
  * +20 = +0x14: db 0
4210
  * +20 = +0x14: db 0
4219
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4211
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4220
Returned value:
4212
Returned value:
4221
  * eax = 0 - success, otherwise file system error code
4213
  * eax = 0 - success, otherwise file system error code
4222
  * ebx destroyed
4214
  * ebx destroyed
4223
Remarks:
4215
Remarks:
4224
  * If the new file size is less than old one, file is truncated.
4216
  * If the new file size is less than old one, file is truncated.
4225
    If the new size is greater than old one, file is expanded with
4217
    If the new size is greater than old one, file is expanded with
4226
    characters with code 0. If the new size is equal to old one,
4218
    characters with code 0. If the new size is equal to old one,
4227
    the only result of call is set date/time of modification and
4219
    the only result of call is set date/time of modification and
4228
    access to the current date/time.
4220
    access to the current date/time.
4229
  * If there is not enough free space on disk for expansion, the
4221
  * If there is not enough free space on disk for expansion, the
4230
    function will expand to maximum possible size and then return
4222
    function will expand to maximum possible size and then return
4231
    error code 8.
4223
    error code 8.
4232
  * The function is not supported for CD (returns error code 2).
4224
  * The function is not supported for CD (returns error code 2).
4233
 
4225
 
4234
======================================================================
4226
======================================================================
4235
==== Function 70, subfunction 5 - get information on file/folder. ====
4227
==== Function 70, subfunction 5 - get information on file/folder. ====
4236
======================================================================
4228
======================================================================
4237
Parameters:
4229
Parameters:
4238
  * eax = 70 - function number
4230
  * eax = 70 - function number
4239
  * ebx = pointer to the information structure
4231
  * ebx = pointer to the information structure
4240
Format of the information structure:
4232
Format of the information structure:
4241
  * +0: dword: 5 = subfunction number
4233
  * +0: dword: 5 = subfunction number
4242
  * +4: dword: 0 (reserved)
4234
  * +4: dword: 0 (reserved)
4243
  * +8: dword: 0 (reserved)
4235
  * +8: dword: 0 (reserved)
4244
  * +12 = +0xC: dword: 0 (reserved)
4236
  * +12 = +0xC: dword: 0 (reserved)
4245
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4237
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4246
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4238
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4247
    given in the general description
4239
    given in the general description
4248
    or
4240
    or
4249
  * +20 = +0x14: db 0
4241
  * +20 = +0x14: db 0
4250
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4242
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4251
Returned value:
4243
Returned value:
4252
  * eax = 0 - success, otherwise file system error code
4244
  * eax = 0 - success, otherwise file system error code
4253
  * ebx destroyed
4245
  * ebx destroyed
4254
Information on file is returned in the BDFE format (block of data
4246
Information on file is returned in the BDFE format (block of data
4255
for folder entry), explained in the description of
4247
for folder entry), explained in the description of
4256
subfunction 1, but without filename
4248
subfunction 1, but without filename
4257
(i.e. only first 40 = 0x28 bytes).
4249
(i.e. only first 40 = 0x28 bytes).
4258
Remarks:
4250
Remarks:
4259
  * The function does not support virtual folders such as /, /rd and
4251
  * The function does not support virtual folders such as /, /rd and
4260
    root folders like /rd/1.
4252
    root folders like /rd/1.
4261
 
4253
 
4262
======================================================================
4254
======================================================================
4263
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4255
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4264
======================================================================
4256
======================================================================
4265
Parameters:
4257
Parameters:
4266
  * eax = 70 - function number
4258
  * eax = 70 - function number
4267
  * ebx = pointer to the information structure
4259
  * ebx = pointer to the information structure
4268
Format of the information structure:
4260
Format of the information structure:
4269
  * +0: dword: 6 = subfunction number
4261
  * +0: dword: 6 = subfunction number
4270
  * +4: dword: 0 (reserved)
4262
  * +4: dword: 0 (reserved)
4271
  * +8: dword: 0 (reserved)
4263
  * +8: dword: 0 (reserved)
4272
  * +12 = +0xC: dword: 0 (reserved)
4264
  * +12 = +0xC: dword: 0 (reserved)
4273
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4265
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4274
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4266
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4275
    given in the general description
4267
    given in the general description
4276
    or
4268
    or
4277
  * +20 = +0x14: db 0
4269
  * +20 = +0x14: db 0
4278
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4270
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4279
Returned value:
4271
Returned value:
4280
  * eax = 0 - success, otherwise file system error code
4272
  * eax = 0 - success, otherwise file system error code
4281
  * ebx destroyed
4273
  * ebx destroyed
4282
File attributes are first 32 bytes in BDFE (block of data
4274
File attributes are first 32 bytes in BDFE (block of data
4283
for folder entry), explained in the description of subfunction 1
4275
for folder entry), explained in the description of subfunction 1
4284
(that is, without name and size of file). Attribute
4276
(that is, without name and size of file). Attribute
4285
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4277
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4286
Byte +4 (name format) is ignored.
4278
Byte +4 (name format) is ignored.
4287
Remarks:
4279
Remarks:
4288
  * The function does not support virtual folders such as /, /rd and
4280
  * The function does not support virtual folders such as /, /rd and
4289
    root folders like /rd/1.
4281
    root folders like /rd/1.
4290
  * The function is not supported for CD (returns error code 2).
4282
  * The function is not supported for CD (returns error code 2).
4291
 
4283
 
4292
======================================================================
4284
======================================================================
4293
=========== Function 70, subfunction 7 - start application. ==========
4285
=========== Function 70, subfunction 7 - start application. ==========
4294
======================================================================
4286
======================================================================
4295
Parameters:
4287
Parameters:
4296
  * eax = 70 - function number
4288
  * eax = 70 - function number
4297
  * ebx = pointer to the information structure
4289
  * ebx = pointer to the information structure
4298
Format of the information structure:
4290
Format of the information structure:
4299
  * +0: dword: 7 = subfunction number
4291
  * +0: dword: 7 = subfunction number
4300
  * +4: dword: flags field:
4292
  * +4: dword: flags field:
4301
    * áèò 0: start process as debugged
4293
    * áèò 0: start process as debugged
4302
    * other bits are reserved and must be set to 0
4294
    * other bits are reserved and must be set to 0
4303
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4295
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4304
  * +12 = +0xC: dword: 0 (reserved)
4296
  * +12 = +0xC: dword: 0 (reserved)
4305
  * +16 = +0x10: dword: 0 (reserved)
4297
  * +16 = +0x10: dword: 0 (reserved)
4306
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4298
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4307
    given in the general description
4299
    given in the general description
4308
    or
4300
    or
4309
  * +20 = +0x14: db 0
4301
  * +20 = +0x14: db 0
4310
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4302
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4311
Returned value:
4303
Returned value:
4312
  * eax > 0 - program is loaded, eax contains PID
4304
  * eax > 0 - program is loaded, eax contains PID
4313
  * eax < 0 - an error has occured, -eax contains
4305
  * eax < 0 - an error has occured, -eax contains
4314
    file system error code
4306
    file system error code
4315
  * ebx destroyed
4307
  * ebx destroyed
4316
Remarks:
4308
Remarks:
4317
  * Command line must be terminated by the character with the code 0
4309
  * Command line must be terminated by the character with the code 0
4318
    (ASCIIZ-string); function takes into account either all characters
4310
    (ASCIIZ-string); function takes into account either all characters
4319
    up to terminating zero inclusively or first 256 character
4311
    up to terminating zero inclusively or first 256 character
4320
    regarding what is less.
4312
    regarding what is less.
4321
  * If the process is started as debugged, it is created in
4313
  * If the process is started as debugged, it is created in
4322
    the suspended state; to run use subfunction 5 of function 69.
4314
    the suspended state; to run use subfunction 5 of function 69.
4323
 
4315
 
4324
======================================================================
4316
======================================================================
4325
========== Function 70, subfunction 8 - delete file/folder. ==========
4317
========== Function 70, subfunction 8 - delete file/folder. ==========
4326
======================================================================
4318
======================================================================
4327
Parameters:
4319
Parameters:
4328
  * eax = 70 - function number
4320
  * eax = 70 - function number
4329
  * ebx = pointer to the information structure
4321
  * ebx = pointer to the information structure
4330
Format of the information structure:
4322
Format of the information structure:
4331
  * +0: dword: 8 = subfunction number
4323
  * +0: dword: 8 = subfunction number
4332
  * +4: dword: 0 (reserved)
4324
  * +4: dword: 0 (reserved)
4333
  * +8: dword: 0 (reserved)
4325
  * +8: dword: 0 (reserved)
4334
  * +12 = +0xC: dword: 0 (reserved)
4326
  * +12 = +0xC: dword: 0 (reserved)
4335
  * +16 = +0x10: dword: 0 (reserved)
4327
  * +16 = +0x10: dword: 0 (reserved)
4336
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4328
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4337
    given in the general description
4329
    given in the general description
4338
    or
4330
    or
4339
  * +20 = +0x14: db 0
4331
  * +20 = +0x14: db 0
4340
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4332
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4341
Returned value:
4333
Returned value:
4342
  * eax = 0 - success, otherwise file system error code
4334
  * eax = 0 - success, otherwise file system error code
4343
  * ebx destroyed
4335
  * ebx destroyed
4344
Remarks:
4336
Remarks:
4345
  * The function is not supported for CD (returns error code 2).
4337
  * The function is not supported for CD (returns error code 2).
4346
  * The function can delete only empty folders (attempt to delete
4338
  * The function can delete only empty folders (attempt to delete
4347
    nonempty folder results in error with code 10, "access denied").
4339
    nonempty folder results in error with code 10, "access denied").
4348
 
4340
 
4349
======================================================================
4341
======================================================================
4350
============= Function 70, subfunction 9 - create folder. ============
4342
============= Function 70, subfunction 9 - create folder. ============
4351
======================================================================
4343
======================================================================
4352
Parameters:
4344
Parameters:
4353
  * eax = 70 - function number
4345
  * eax = 70 - function number
4354
  * ebx = pointer to the information structure
4346
  * ebx = pointer to the information structure
4355
Format of the information structure:
4347
Format of the information structure:
4356
  * +0: dword: 9 = subfunction number
4348
  * +0: dword: 9 = subfunction number
4357
  * +4: dword: 0 (reserved)
4349
  * +4: dword: 0 (reserved)
4358
  * +8: dword: 0 (reserved)
4350
  * +8: dword: 0 (reserved)
4359
  * +12 = +0xC: dword: 0 (reserved)
4351
  * +12 = +0xC: dword: 0 (reserved)
4360
  * +16 = +0x10: dword: 0 (reserved)
4352
  * +16 = +0x10: dword: 0 (reserved)
4361
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4353
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4362
    given in the general description
4354
    given in the general description
4363
    or
4355
    or
4364
  * +20 = +0x14: db 0
4356
  * +20 = +0x14: db 0
4365
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
4357
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
4366
Returned value:
4358
Returned value:
4367
  * eax = 0 - success, otherwise file system error code
4359
  * eax = 0 - success, otherwise file system error code
4368
  * ebx destroyed
4360
  * ebx destroyed
4369
Remarks:
4361
Remarks:
4370
  * The function is not supported for CD (returns error code 2).
4362
  * The function is not supported for CD (returns error code 2).
4371
  * The parent folder must already exist.
4363
  * The parent folder must already exist.
4372
  * If target folder already exists, function returns success (eax=0).
4364
  * If target folder already exists, function returns success (eax=0).
4373
 
4365
 
4374
======================================================================
4366
======================================================================
4375
========== Function 71, subfunction 1 - set window caption. ==========
4367
========== Function 71, subfunction 1 - set window caption. ==========
4376
======================================================================
4368
======================================================================
4377
Parameters:
4369
Parameters:
4378
  * eax = 71 - function number
4370
  * eax = 71 - function number
4379
  * ebx = 1 - subfunction number
4371
  * ebx = 1 - subfunction number
4380
  * ecx = pointer to caption string
4372
  * ecx = pointer to caption string
4381
Returned value:
4373
Returned value:
4382
  * function does not return value
4374
  * function does not return value
4383
Remarks:
4375
Remarks:
4384
  * String must be in the ASCIIZ-format. Disregarding real string
4376
  * String must be in the ASCIIZ-format. Disregarding real string
4385
    length, no more than 255 characters are drawn.
4377
    length, no more than 255 characters are drawn.
4386
  * Pass NULL in ecx to remove caption.
4378
  * Pass NULL in ecx to remove caption.
4387
 
4379
 
4388
======================================================================
4380
======================================================================
4389
=============== Function -1 - terminate thread/process ===============
4381
=============== Function -1 - terminate thread/process ===============
4390
======================================================================
4382
======================================================================
4391
Parameters:
4383
Parameters:
4392
  * eax = -1 - function number
4384
  * eax = -1 - function number
4393
Returned value:
4385
Returned value:
4394
  * function does not return neither value nor control
4386
  * function does not return neither value nor control
4395
Remarks:
4387
Remarks:
4396
  * If the process did not create threads obviously, it has only
4388
  * If the process did not create threads obviously, it has only
4397
    one thread, which termination results in process termination.
4389
    one thread, which termination results in process termination.
4398
  * If the current thread is last in the process, its termination
4390
  * If the current thread is last in the process, its termination
4399
    also results in process terminates.
4391
    also results in process terminates.
4400
  * This function terminates the current thread. Other thread can be
4392
  * This function terminates the current thread. Other thread can be
4401
    killed by call to subfunction 2 of function 18.
4393
    killed by call to subfunction 2 of function 18.
4402
 
4394
 
4403
======================================================================
4395
======================================================================
4404
=========================== List of events ===========================
4396
=========================== List of events ===========================
4405
======================================================================
4397
======================================================================
4406
Next event can be retrieved by the call of one from functions 10
4398
Next event can be retrieved by the call of one from functions 10
4407
(to wait for event), 11 (to check without waiting), 23
4399
(to wait for event), 11 (to check without waiting), 23
4408
(to wait during the given time).
4400
(to wait during the given time).
4409
These functions return only those events, which enter into a mask set
4401
These functions return only those events, which enter into a mask set
4410
by function 40. By default it is first three,
4402
by function 40. By default it is first three,
4411
there is enough for most applications.
4403
there is enough for most applications.
4412
Codes of events:
4404
Codes of events:
4413
  * 1 = redraw event (is reset by call to function 0)
4405
  * 1 = redraw event (is reset by call to function 0)
4414
  * 2 = key on keyboard is pressed (acts, only when the window is
4406
  * 2 = key on keyboard is pressed (acts, only when the window is
4415
    active) or hotkey is pressed; is reset, when all keys from
4407
    active) or hotkey is pressed; is reset, when all keys from
4416
    the buffer are read out by function 2
4408
    the buffer are read out by function 2
4417
  * 3 = button is pressed, defined earlier by function 8
4409
  * 3 = button is pressed, defined earlier by function 8
4418
    (or close button, created implicitly by function 0;
4410
    (or close button, created implicitly by function 0;
4419
    minimize button is handled by the system and sends no message;
4411
    minimize button is handled by the system and sends no message;
4420
    acts, only when the window is active;
4412
    acts, only when the window is active;
4421
    is reset when all buttons from the buffer
4413
    is reset when all buttons from the buffer
4422
    are read out by function 17)
4414
    are read out by function 17)
4423
  * 4 = reserved (in current implementation never comes even after
4415
  * 4 = reserved (in current implementation never comes even after
4424
    unmasking by function 40)
4416
    unmasking by function 40)
4425
  * 5 = the desktop background is redrawed (is reset automatically
4417
  * 5 = the desktop background is redrawed (is reset automatically
4426
    after redraw, so if in redraw time program does not wait and
4418
    after redraw, so if in redraw time program does not wait and
4427
    does not check events, it will not remark this event)
4419
    does not check events, it will not remark this event)
4428
  * 6 = mouse event (something happened - button pressing or moving;
4420
  * 6 = mouse event (something happened - button pressing or moving;
4429
    is reset at reading)
4421
    is reset at reading)
4430
  * 7 = IPC event (see function 60 -
4422
  * 7 = IPC event (see function 60 -
4431
    Inter Process Communication; is reset at reading)
4423
    Inter Process Communication; is reset at reading)
4432
  * 8 = network event (is reset at reading)
4424
  * 8 = network event (is reset at reading)
4433
  * 9 = debug event (is reset at reading; see
4425
  * 9 = debug event (is reset at reading; see
4434
    debug subsystem)
4426
    debug subsystem)
4435
  * 16..31 = event with appropriate IRQ
4427
  * 16..31 = event with appropriate IRQ
4436
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4428
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4437
 
4429
 
4438
======================================================================
4430
======================================================================
4439
=================== Error codes of the file system ===================
4431
=================== Error codes of the file system ===================
4440
======================================================================
4432
======================================================================
4441
  * 0 = success
4433
  * 0 = success
4442
  * 1 = base and/or partition of a hard disk is not defined
4434
  * 1 = base and/or partition of a hard disk is not defined
4443
    (by subfunctions 7, 8 of function 21)
4435
    (by subfunctions 7, 8 of function 21)
4444
  * 2 = function is not supported for the given file system
4436
  * 2 = function is not supported for the given file system
4445
  * 3 = unknown file system
4437
  * 3 = unknown file system
4446
  * 4 = is returned only from function 'rename' by transmission of
4438
  * 4 = is returned only from function 'rename' by transmission of
4447
    the strongly incorrect parameter and in any way does not
4439
    the strongly incorrect parameter and in any way does not
4448
    correspond to the description in the kernel sources
4440
    correspond to the description in the kernel sources
4449
    "partition not defined at hd"
4441
    "partition not defined at hd"
4450
  * 5 = file not found
4442
  * 5 = file not found
4451
  * 6 = end of file, EOF
4443
  * 6 = end of file, EOF
4452
  * 7 = pointer lies outside of application memory
4444
  * 7 = pointer lies outside of application memory
4453
  * 8 = disk is full
4445
  * 8 = disk is full
4454
  * 9 = FAT table is destroyed
4446
  * 9 = FAT table is destroyed
4455
  * 10 = access denied
4447
  * 10 = access denied
4456
  * 11 = device error
4448
  * 11 = device error
4457
Application start functions can return also following errors:
4449
Application start functions can return also following errors:
4458
  * 30 = 0x1E = not enough memory
4450
  * 30 = 0x1E = not enough memory
4459
  * 31 = 0x1F = file is not executable
4451
  * 31 = 0x1F = file is not executable
4460
  * 32 = 0x20 = too many processes
4452
  * 32 = 0x20 = too many processes
4461
>
4453
>
4462
>
4454
>
4463
>
4455
>
4464
>
4456
>