Subversion Repositories Kolibri OS

Rev

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

Rev 2106 Rev 2268
1
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
1
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.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
      * Y=4 - skinned fixed-size window
25
      * Y=4 - skinned fixed-size window
26
      * other possible values (from 5 up to 15) are reserved,
26
      * other possible values (from 5 up to 15) are reserved,
27
        function call with such Y is ignored
27
        function call with such Y is ignored
28
    * RR, GG, BB = accordingly red, green, blue components of a color
28
    * RR, GG, BB = accordingly red, green, blue components of a color
29
      of the working area of the window (are ignored for style Y=2)
29
      of the working area of the window (are ignored for style Y=2)
30
    * X = DCBA (bits)
30
    * X = DCBA (bits)
31
      * A = 1 - window has caption; for styles Y=3,4 caption string
31
      * A = 1 - window has caption; for styles Y=3,4 caption string
32
                  must be passed in edi, for other styles use
32
                  must be passed in edi, for other styles use
33
                  subfunction 1 of function 71
33
                  subfunction 1 of function 71
34
      * B = 1 - coordinates of all graphics primitives are relative to
34
      * B = 1 - coordinates of all graphics primitives are relative to
35
                  window client area
35
                  window client area
36
      * C = 1 - don't fill working area on window draw
36
      * C = 1 - don't fill working area on window draw
37
      * D = 0 - normal filling of the working area, 1 - gradient
37
      * D = 0 - normal filling of the working area, 1 - gradient
38
    The following parameters are intended for windows
38
    The following parameters are intended for windows
39
    of a type I and II, and ignored for styles Y=1,3:
39
    of a type I and II, and ignored for styles Y=1,3:
40
  * esi = 0xXYRRGGBB - color of the header
40
  * esi = 0xXYRRGGBB - color of the header
41
    * RR, GG, BB define color
41
    * RR, GG, BB define color
42
    * Y=0 - usual window, Y=1 - unmovable window
42
    * Y=0 - usual window, Y=1 - unmovable window
43
    * X defines a gradient of header: X=0 - no gradient,
43
    * X defines a gradient of header: X=0 - no gradient,
44
      X=8 - usual gradient,
44
      X=8 - usual gradient,
45
      for windows of a type II X=4 - negative gradient
45
      for windows of a type II X=4 - negative gradient
46
    * other values of X and Y are reserved
46
    * other values of X and Y are reserved
47
  * edi = 0x00RRGGBB - color of the frame
47
  * edi = 0x00RRGGBB - color of the frame
48
Returned value:
48
Returned value:
49
  * function does not return value
49
  * function does not return value
50
Remarks:
50
Remarks:
51
  * Position and sizes of the window are installed by the first
51
  * Position and sizes of the window are installed by the first
52
    call of this function and are ignored at subsequent; to change
52
    call of this function and are ignored at subsequent; to change
53
    position and/or sizes of already created window use function 67.
53
    position and/or sizes of already created window use function 67.
54
  * For windows with styles Y=3,4 and caption (A=1) caption string
54
  * For windows with styles Y=3,4 and caption (A=1) caption string
55
    is set by the first call of this function and is ignored
55
    is set by the first call of this function and is ignored
56
    at subsequent (strictly speaking, is ignored after a call to
56
    at subsequent (strictly speaking, is ignored after a call to
57
    subfunction 2 of function 12 - end redraw); to change caption of
57
    subfunction 2 of function 12 - end redraw); to change caption of
58
    already created window use subfunction 1 of function 71.
58
    already created window use subfunction 1 of function 71.
59
  * If the window has appropriate styles, position and/or sizes can be
59
  * If the window has appropriate styles, position and/or sizes can be
60
    changed by user. Current position and sizes can be obtained
60
    changed by user. Current position and sizes can be obtained
61
    by function 9.
61
    by function 9.
62
  * The window must fit on the screen. If the transferred
62
  * The window must fit on the screen. If the transferred
63
    coordinates and sizes do not satisfy to this condition,
63
    coordinates and sizes do not satisfy to this condition,
64
    appropriate coordinate (or, probably, both) is considered as zero,
64
    appropriate coordinate (or, probably, both) is considered as zero,
65
    and if it does not help too, the appropriate size
65
    and if it does not help too, the appropriate size
66
    (or, probably, both) is installed in a size of the screen.
66
    (or, probably, both) is installed in a size of the screen.
67
    
67
    
68
    Further let us designate xpos,ypos,xsize,ysize - values passed
68
    Further let us designate xpos,ypos,xsize,ysize - values passed
69
    in ebx,ecx. The coordinates are resulted concerning
69
    in ebx,ecx. The coordinates are resulted concerning
70
    the left upper corner of the window, which, thus, is set as (0,0),
70
    the left upper corner of the window, which, thus, is set as (0,0),
71
    coordinates of the right lower corner essence (xsize,ysize).
71
    coordinates of the right lower corner essence (xsize,ysize).
72
  * The sizes of the window are understood in sence of coordinates
72
  * The sizes of the window are understood in sence of coordinates
73
    of the right lower corner. This concerns all other functions too.
73
    of the right lower corner. This concerns all other functions too.
74
    It means, that the real sizes are on 1 pixel more.
74
    It means, that the real sizes are on 1 pixel more.
75
  * The window of type I looks as follows:
75
  * The window of type I looks as follows:
76
    * draw external frame of color indicated in edi, 1 pixel in width
76
    * draw external frame of color indicated in edi, 1 pixel in width
77
    * draw header - rectangle with the left upper corner (1,1) and
77
    * draw header - rectangle with the left upper corner (1,1) and
78
      right lower (xsize-1,min(25,ysize)) color indicated in esi
78
      right lower (xsize-1,min(25,ysize)) color indicated in esi
79
      (taking a gradient into account)
79
      (taking a gradient into account)
80
    * if ysize>=26, fill the working area of the window -
80
    * if ysize>=26, fill the working area of the window -
81
      rectangle with the left upper corner (1,21) and right lower
81
      rectangle with the left upper corner (1,21) and right lower
82
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
82
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
83
      indicated in edx (taking a gradient into account)
83
      indicated in edx (taking a gradient into account)
84
    * if A=1 and caption has been already set by subfunction 1
84
    * if A=1 and caption has been already set by subfunction 1
85
      of function 71, it is drawn in the corresponding place of header
85
      of function 71, it is drawn in the corresponding place of header
86
  * The window of style Y=1 looks as follows:
86
  * The window of style Y=1 looks as follows:
87
    * completely defined by the application
87
    * completely defined by the application
88
  * The window of type II looks as follows:
88
  * The window of type II looks as follows:
89
    * draw external frame of width 1 pixel with the "shaded" color
89
    * draw external frame of width 1 pixel with the "shaded" color
90
      edi (all components of the color decrease twice)
90
      edi (all components of the color decrease twice)
91
    * draw intermediate frame of width 3 pixels with color edi
91
    * draw intermediate frame of width 3 pixels with color edi
92
    * draw internal frame of width 1 pixel with the "shaded" color edi
92
    * draw internal frame of width 1 pixel with the "shaded" color edi
93
    * draw header - rectangle with the left upper corner (4,4)
93
    * draw header - rectangle with the left upper corner (4,4)
94
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
94
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
95
      (taking a gradient into account)
95
      (taking a gradient into account)
96
    * if ysize>=26, fill the working area of the window -
96
    * if ysize>=26, fill the working area of the window -
97
      rectangle with the left upper corner (5,20) and right lower
97
      rectangle with the left upper corner (5,20) and right lower
98
      (xsize-5,ysize-5) with color indicated in edx
98
      (xsize-5,ysize-5) with color indicated in edx
99
      (taking a gradient into account)
99
      (taking a gradient into account)
100
    * if A=1 and caption has been already set by subfunction 1
100
    * if A=1 and caption has been already set by subfunction 1
101
      of function 71, it is drawn in the corresponding place of header
101
      of function 71, it is drawn in the corresponding place of header
102
  * The skinned window looks as follows:
102
  * The skinned window looks as follows:
103
    * draw external frame of width 1 pixel
103
    * draw external frame of width 1 pixel
104
      with color 'outer' from the skin
104
      with color 'outer' from the skin
105
    * draw intermediate frame of width 3 pixel
105
    * draw intermediate frame of width 3 pixel
106
      with color 'frame' from the skin
106
      with color 'frame' from the skin
107
    * draw internal frame of width 1 pixel
107
    * draw internal frame of width 1 pixel
108
      with color 'inner' from the skin
108
      with color 'inner' from the skin
109
    * draw header (on bitmaps from the skin) in a rectangle
109
    * draw header (on bitmaps from the skin) in a rectangle
110
      (0,0) - (xsize,_skinh-1)
110
      (0,0) - (xsize,_skinh-1)
111
    * if ysize>=26, fill the working area of the window -
111
    * if ysize>=26, fill the working area of the window -
112
      rectangle with the left upper corner (5,_skinh) and right lower
112
      rectangle with the left upper corner (5,_skinh) and right lower
113
      (xsize-5,ysize-5) with color indicated in edx
113
      (xsize-5,ysize-5) with color indicated in edx
114
      (taking a gradient into account)
114
      (taking a gradient into account)
115
    * define two standard buttons: close and minimize
115
    * define two standard buttons: close and minimize
116
      (see function 8)
116
      (see function 8)
117
    * if A=1 and edi contains (nonzero) pointer to caption string,
117
    * if A=1 and edi contains (nonzero) pointer to caption string,
118
      it is drawn in place in header defined in the skin
118
      it is drawn in place in header defined in the skin
119
    * value _skinh is accessible as the result of call
119
    * value _skinh is accessible as the result of call
120
      subfunction 4 of function 48
120
      subfunction 4 of function 48
121
 
121
 
122
======================================================================
122
======================================================================
123
================ Function 1 - put pixel in the window. ===============
123
================ Function 1 - put pixel in the window. ===============
124
======================================================================
124
======================================================================
125
Parameters:
125
Parameters:
126
  * eax = 1 - function number
126
  * eax = 1 - function number
127
  * ebx = x-coordinate (relative to the window)
127
  * ebx = x-coordinate (relative to the window)
128
  * ecx = y-coordinate (relative to the window)
128
  * ecx = y-coordinate (relative to the window)
129
  * edx = 0x00RRGGBB - color of a pixel
129
  * edx = 0x00RRGGBB - color of a pixel
130
    edx = 0x01xxxxxx - invert color of a pixel
130
    edx = 0x01xxxxxx - invert color of a pixel
131
          (low 24 bits are ignored)
131
          (low 24 bits are ignored)
132
Returned value:
132
Returned value:
133
  * function does not return value
133
  * function does not return value
134
 
134
 
135
======================================================================
135
======================================================================
136
============ Function 2 - get the code of the pressed key. ===========
136
============ Function 2 - get the code of the pressed key. ===========
137
======================================================================
137
======================================================================
138
Takes away the code of the pressed key from the buffer.
138
Takes away the code of the pressed key from the buffer.
139
Parameters:
139
Parameters:
140
  * eax = 2 - function number
140
  * eax = 2 - function number
141
Returned value:
141
Returned value:
142
  * if the buffer is empty, function returns eax=1
142
  * if the buffer is empty, function returns eax=1
143
  * if the buffer is not empty, function returns al=0,
143
  * if the buffer is not empty, function returns al=0,
144
    ah=code of the pressed key, high word of eax is zero
144
    ah=code of the pressed key, high word of eax is zero
145
  * if there is "hotkey", function returns al=2,
145
  * if there is "hotkey", function returns al=2,
146
    ah=scancode of the pressed key (0 for control keys),
146
    ah=scancode of the pressed key (0 for control keys),
147
    high word of eax contains a status of control keys at the moment
147
    high word of eax contains a status of control keys at the moment
148
    of pressing a hotkey
148
    of pressing a hotkey
149
Remarks:
149
Remarks:
150
  * There is a common system buffer of the pressed keys
150
  * There is a common system buffer of the pressed keys
151
    by a size of 120 bytes, organized as queue.
151
    by a size of 120 bytes, organized as queue.
152
  * There is one more common system buffer on 120 "hotkeys".
152
  * There is one more common system buffer on 120 "hotkeys".
153
  * If the application with the inactive window calls this function,
153
  * If the application with the inactive window calls this function,
154
    the buffer of the pressed keys is considered to be empty.
154
    the buffer of the pressed keys is considered to be empty.
155
  * By default this function returns ASCII-codes; to switch
155
  * By default this function returns ASCII-codes; to switch
156
    to the scancodes mode (and back) use function 66.
156
    to the scancodes mode (and back) use function 66.
157
    However, hotkeys are always notificated as scancodes.
157
    However, hotkeys are always notificated as scancodes.
158
  * To find out, what keys correspond to what codes, start
158
  * To find out, what keys correspond to what codes, start
159
    the application keyascii and scancode.
159
    the application keyascii and scancode.
160
  * Scancodes come directly from keyboard and are fixed;
160
  * Scancodes come directly from keyboard and are fixed;
161
    ASCII-codes turn out with usage of the conversion tables,
161
    ASCII-codes turn out with usage of the conversion tables,
162
    which can be set by subfunction 2 of function 21
162
    which can be set by subfunction 2 of function 21
163
    and get by subfunction 2 of function 26.
163
    and get by subfunction 2 of function 26.
164
  * As a consequence, ASCII-codes take into account current
164
  * As a consequence, ASCII-codes take into account current
165
    keyboard layout (rus/en) as opposed to scancodes.
165
    keyboard layout (rus/en) as opposed to scancodes.
166
  * This function notifies only about those hotkeys, which were
166
  * This function notifies only about those hotkeys, which were
167
    defined by this thread by subfunction 4 of function 66.
167
    defined by this thread by subfunction 4 of function 66.
168
 
168
 
169
======================================================================
169
======================================================================
170
==================== Function 3 - get system time. ===================
170
==================== Function 3 - get system time. ===================
171
======================================================================
171
======================================================================
172
Parameters:
172
Parameters:
173
  * eax = 3 - function number
173
  * eax = 3 - function number
174
Returned value:
174
Returned value:
175
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
175
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
176
  * each item is BCD-number, for example,
176
  * each item is BCD-number, for example,
177
    for time 23:59:59 function returns 0x00595923
177
    for time 23:59:59 function returns 0x00595923
178
Remarks:
178
Remarks:
179
  * See also subfunction 9 of function 26 - get time from
179
  * See also subfunction 9 of function 26 - get time from
180
    the moment of start of the system; it is more convenient, because
180
    the moment of start of the system; it is more convenient, because
181
    returns simply DWORD-value of the time counter.
181
    returns simply DWORD-value of the time counter.
182
  * System time can be set by function 22.
182
  * System time can be set by function 22.
183
 
183
 
184
======================================================================
184
======================================================================
185
============ Function 4 - draw text string in the window. ============
185
============ Function 4 - draw text string in the window. ============
186
======================================================================
186
======================================================================
187
Parameters:
187
Parameters:
188
  * eax = 4 - function number
188
  * eax = 4 - function number
189
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
189
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
190
  * ecx = 0xX0RRGGBB, where
190
  * ecx = 0xX0RRGGBB, where
191
    * RR, GG, BB specify text color
191
    * RR, GG, BB specify text color
192
    * X=ABnn (bits):
192
    * X=ABnn (bits):
193
    * nn specifies the used font: 0=system monospaced,
193
    * nn specifies the used font: 0=system monospaced,
194
      1=system font of variable width
194
      1=system font of variable width
195
    * A=0 - output esi characters, A=1 - output ASCIIZ-string
195
    * A=0 - output esi characters, A=1 - output ASCIIZ-string
196
    * B=1 - fill background with the color edi
196
    * B=1 - fill background with the color edi
197
  * edx = pointer to the beginning of the string
197
  * edx = pointer to the beginning of the string
198
  * esi = for A=0 length of the string, must not exceed 255;
198
  * esi = for A=0 length of the string, must not exceed 255;
199
          for A=1 is ignored
199
          for A=1 is ignored
200
Returned value:
200
Returned value:
201
  * function does not return value
201
  * function does not return value
202
Remarks:
202
Remarks:
203
  * First system font is read out at loading from the file char.mt,
203
  * First system font is read out at loading from the file char.mt,
204
    second - from char2.mt.
204
    second - from char2.mt.
205
  * Both fonts have height 9 pixels, width of the monospaced font
205
  * Both fonts have height 9 pixels, width of the monospaced font
206
    is equal to 6 pixels.
206
    is equal to 6 pixels.
207
 
207
 
208
======================================================================
208
======================================================================
209
========================= Function 5 - delay. ========================
209
========================= Function 5 - delay. ========================
210
======================================================================
210
======================================================================
211
Delays execution of the program on the given time.
211
Delays execution of the program on the given time.
212
Parameters:
212
Parameters:
213
  * eax = 5 - function number
213
  * eax = 5 - function number
214
  * ebx = time in the 1/100 of second
214
  * ebx = time in the 1/100 of second
215
Returned value:
215
Returned value:
216
  * function does not return value
216
  * function does not return value
217
Remarks:
217
Remarks:
218
  * Passing ebx=0 does not transfer control to the next process
218
  * Passing ebx=0 does not transfer control to the next process
219
    and does not make any operations at all. If it is really required
219
    and does not make any operations at all. If it is really required
220
    to transfer control to the next process (to complete a current
220
    to transfer control to the next process (to complete a current
221
    time slice), use subfunction 1 of function 68.
221
    time slice), use subfunction 1 of function 68.
222
 
222
 
223
======================================================================
223
======================================================================
224
============== Function 6 - read the file from ramdisk. ==============
224
============== Function 6 - read the file from ramdisk. ==============
225
======================================================================
225
======================================================================
226
Parameters:
226
Parameters:
227
  * eax = 6 - function number
227
  * eax = 6 - function number
228
  * ebx = pointer to the filename
228
  * ebx = pointer to the filename
229
  * ecx = number of start block, beginning from 1;
229
  * ecx = number of start block, beginning from 1;
230
    ecx=0 - read from the beginning of the file (same as ecx=1)
230
    ecx=0 - read from the beginning of the file (same as ecx=1)
231
  * edx = number of blocks to read;
231
  * edx = number of blocks to read;
232
    edx=0 - read one block (same as edx=1)
232
    edx=0 - read one block (same as edx=1)
233
  * esi = pointer to memory area for the data
233
  * esi = pointer to memory area for the data
234
Returned value:
234
Returned value:
235
  * eax = file size in bytes, if the file was successfully read
235
  * eax = file size in bytes, if the file was successfully read
236
  * eax = -1, if the file was not found
236
  * eax = -1, if the file was not found
237
Remarks:
237
Remarks:
238
  * This function is out-of-date; function 70 allows
238
  * This function is out-of-date; function 70 allows
239
    to fulfil the same operations with the extended possibilities.
239
    to fulfil the same operations with the extended possibilities.
240
  * Block = 512 bytes.
240
  * Block = 512 bytes.
241
  * For reading all file you can specify the certainly large value
241
  * For reading all file you can specify the certainly large value
242
    in edx, for example, edx = -1; but in this case be ready that
242
    in edx, for example, edx = -1; but in this case be ready that
243
    the program will "fall", if the file will appear too large and can
243
    the program will "fall", if the file will appear too large and can
244
    not be placed in the program memory.
244
    not be placed in the program memory.
245
  * The filename must be either in the format 8+3 characters
245
  * The filename must be either in the format 8+3 characters
246
    (first 8 characters - name itself, last 3 - extension,
246
    (first 8 characters - name itself, last 3 - extension,
247
    the short names and extensions are supplemented with spaces),
247
    the short names and extensions are supplemented with spaces),
248
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
248
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
249
    (name no more than 8 characters, dot, extension 3 characters
249
    (name no more than 8 characters, dot, extension 3 characters
250
    supplemented if necessary by spaces).
250
    supplemented if necessary by spaces).
251
    The filename must be written with capital letters. The terminating
251
    The filename must be written with capital letters. The terminating
252
    character with code 0 is not necessary (not ASCIIZ-string).
252
    character with code 0 is not necessary (not ASCIIZ-string).
253
  * This function does not support folders on the ramdisk.
253
  * This function does not support folders on the ramdisk.
254
 
254
 
255
======================================================================
255
======================================================================
256
=============== Function 7 - draw image in the window. ===============
256
=============== Function 7 - draw image in the window. ===============
257
======================================================================
257
======================================================================
258
Paramters:
258
Paramters:
259
  * eax = 7 - function number
259
  * eax = 7 - function number
260
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
260
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
261
  * ecx = [size on axis x]*65536 + [size on axis y]
261
  * ecx = [size on axis x]*65536 + [size on axis y]
262
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
262
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
263
Returned value:
263
Returned value:
264
  * function does not return value
264
  * function does not return value
265
Remarks:
265
Remarks:
266
  * Coordinates of the image are coordinates of the upper left corner
266
  * Coordinates of the image are coordinates of the upper left corner
267
    of the image relative to the window.
267
    of the image relative to the window.
268
  * Size of the image in bytes is 3*xsize*ysize.
268
  * Size of the image in bytes is 3*xsize*ysize.
269
 
269
 
270
======================================================================
270
======================================================================
271
=============== Function 8 - define/delete the button. ===============
271
=============== Function 8 - define/delete the button. ===============
272
======================================================================
272
======================================================================
273
Parameters for button definition:
273
Parameters for button definition:
274
  * eax = 8 - function number
274
  * eax = 8 - function number
275
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
275
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
276
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
276
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
277
  * edx = 0xXYnnnnnn, where:
277
  * edx = 0xXYnnnnnn, where:
278
    * nnnnnn = identifier of the button
278
    * nnnnnn = identifier of the button
279
    * high (31st) bit of edx is cleared
279
    * high (31st) bit of edx is cleared
280
    * if 30th bit of edx is set - do not draw the button
280
    * if 30th bit of edx is set - do not draw the button
281
    * if 29th bit of edx is set - do not draw a frame
281
    * if 29th bit of edx is set - do not draw a frame
282
      at pressing the button
282
      at pressing the button
283
  * esi = 0x00RRGGBB - color of the button
283
  * esi = 0x00RRGGBB - color of the button
284
Parameters for button deleting:
284
Parameters for button deleting:
285
  * eax = 8 - function number
285
  * eax = 8 - function number
286
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
286
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
287
Returned value:
287
Returned value:
288
  * function does not return value
288
  * function does not return value
289
Remarks:
289
Remarks:
290
  * Sizes of the button must be more than 0 and less than 0x8000.
290
  * Sizes of the button must be more than 0 and less than 0x8000.
291
  * For skinned windows definition of the window
291
  * For skinned windows definition of the window
292
    (call of 0th function) creates two standard buttons -
292
    (call of 0th function) creates two standard buttons -
293
    for close of the window with identifier 1 and
293
    for close of the window with identifier 1 and
294
    for minimize of the window with identifier 0xffff.
294
    for minimize of the window with identifier 0xffff.
295
  * The creation of two buttons with same identifiers is admitted.
295
  * The creation of two buttons with same identifiers is admitted.
296
  * The button with the identifier 0xffff at pressing is interpreted
296
  * The button with the identifier 0xffff at pressing is interpreted
297
    by the system as the button of minimization, the system handles
297
    by the system as the button of minimization, the system handles
298
    such pressing independently, not accessing to the application.
298
    such pressing independently, not accessing to the application.
299
    In rest it is usual button.
299
    In rest it is usual button.
300
  * Total number of buttons for all applications is limited to 4095.
300
  * Total number of buttons for all applications is limited to 4095.
301
 
301
 
302
======================================================================
302
======================================================================
303
============ Function 9 - information on execution thread. ===========
303
============ Function 9 - information on execution thread. ===========
304
======================================================================
304
======================================================================
305
Parameters:
305
Parameters:
306
  * eax = 9 - function number
306
  * eax = 9 - function number
307
  * ebx = pointer to 1-Kb buffer
307
  * ebx = pointer to 1-Kb buffer
308
  * ecx = number of the slot of the thread
308
  * ecx = number of the slot of the thread
309
    ecx = -1 - get information on the current thread
309
    ecx = -1 - get information on the current thread
310
Returned value:
310
Returned value:
311
  * eax = maximum number of the slot of a thread
311
  * eax = maximum number of the slot of a thread
312
  * buffer pointed to by ebx contains the following information:
312
  * buffer pointed to by ebx contains the following information:
313
    * +0: dword: usage of the processor (how many time units
313
    * +0: dword: usage of the processor (how many time units
314
      per second leaves on execution of this thread)
314
      per second leaves on execution of this thread)
315
    * +4: word: position of the window of thread in the window stack
315
    * +4: word: position of the window of thread in the window stack
316
    * +6: word: (has no relation to the specified thread)
316
    * +6: word: (has no relation to the specified thread)
317
      number of the thread slot, which window has in the window stack
317
      number of the thread slot, which window has in the window stack
318
      position ecx
318
      position ecx
319
    * +8: word: reserved
319
    * +8: word: reserved
320
    * +10 = +0xA: 11 bytes: name of the process
320
    * +10 = +0xA: 11 bytes: name of the process
321
      (name of corresponding executable file in the format 8+3)
321
      (name of corresponding executable file in the format 8+3)
322
    * +21 = +0x15: byte: reserved, this byte is not changed
322
    * +21 = +0x15: byte: reserved, this byte is not changed
323
    * +22 = +0x16: dword: address of the process in memory
323
    * +22 = +0x16: dword: address of the process in memory
324
    * +26 = +0x1A: dword: size of used memory - 1
324
    * +26 = +0x1A: dword: size of used memory - 1
325
    * +30 = +0x1E: dword: identifier (PID/TID)
325
    * +30 = +0x1E: dword: identifier (PID/TID)
326
    * +34 = +0x22: dword: coordinate of the thread window on axis x
326
    * +34 = +0x22: dword: coordinate of the thread window on axis x
327
    * +38 = +0x26: dword: coordinate of the thread window on axis y
327
    * +38 = +0x26: dword: coordinate of the thread window on axis y
328
    * +42 = +0x2A: dword: size of the thread window on axis x
328
    * +42 = +0x2A: dword: size of the thread window on axis x
329
    * +46 = +0x2E: dword: size of the thread window on axis y
329
    * +46 = +0x2E: dword: size of the thread window on axis y
330
    * +50 = +0x32: word: status of the thread slot:
330
    * +50 = +0x32: word: status of the thread slot:
331
      * 0 = thread is running
331
      * 0 = thread is running
332
      * 1 = thread is suspended
332
      * 1 = thread is suspended
333
      * 2 = thread is suspended while waiting for event
333
      * 2 = thread is suspended while waiting for event
334
      * 3 = thread is terminating as a result of call to function -1
334
      * 3 = thread is terminating as a result of call to function -1
335
        or under duress as a result of call to subfunction 2
335
        or under duress as a result of call to subfunction 2
336
        of function 18 or termination of the system
336
        of function 18 or termination of the system
337
      * 4 = thread is terminating as a result of exception
337
      * 4 = thread is terminating as a result of exception
338
      * 5 = thread waits for event
338
      * 5 = thread waits for event
339
      * 9 = requested slot is free, all other information on the slot
339
      * 9 = requested slot is free, all other information on the slot
340
        is not meaningful
340
        is not meaningful
341
    * +52 = +0x34: word: reserved, this word is not changed
341
    * +52 = +0x34: word: reserved, this word is not changed
342
    * +54 = +0x36: dword: coordinate of the client area on axis x
342
    * +54 = +0x36: dword: coordinate of the client area on axis x
343
    * +58 = +0x3A: dword: coordinate of the client area on axis y
343
    * +58 = +0x3A: dword: coordinate of the client area on axis y
344
    * +62 = +0x3E: dword: width of the client area
344
    * +62 = +0x3E: dword: width of the client area
345
    * +66 = +0x42: dword: height of the client area
345
    * +66 = +0x42: dword: height of the client area
346
    * +70 = +0x46: byte: state of the window - bitfield
346
    * +70 = +0x46: byte: state of the window - bitfield
347
      * bit 0 (mask 1): window is maximized
347
      * bit 0 (mask 1): window is maximized
348
      * bit 1 (mask 2): window is minimized to panel
348
      * bit 1 (mask 2): window is minimized to panel
349
      * bit 2 (mask 4): window is rolled up
349
      * bit 2 (mask 4): window is rolled up
350
    * +71 = +0x47: dword: event mask
350
    * +71 = +0x47: dword: event mask
351
Remarks:
351
Remarks:
352
  * Slots are numbered starting from 1.
352
  * Slots are numbered starting from 1.
353
  * Returned value is not a total number of threads, because there
353
  * Returned value is not a total number of threads, because there
354
    can be free slots.
354
    can be free slots.
355
  * When process is starting, system automatically creates
355
  * When process is starting, system automatically creates
356
    execution thread.
356
    execution thread.
357
  * Function gives information on the thread. Each process has
357
  * Function gives information on the thread. Each process has
358
    at least one thread. One process can create many threads,
358
    at least one thread. One process can create many threads,
359
    in this case each thread has its own slot and the fields
359
    in this case each thread has its own slot and the fields
360
    +10, +22, +26 in these slots coincide.
360
    +10, +22, +26 in these slots coincide.
361
    Applications have no common way to define whether two threads
361
    Applications have no common way to define whether two threads
362
    belong to one process.
362
    belong to one process.
363
  * The active window - window on top of the window stack -
363
  * The active window - window on top of the window stack -
364
    receives the messages on a keyboard input. For such window
364
    receives the messages on a keyboard input. For such window
365
    the position in the window stack coincides with returned value.
365
    the position in the window stack coincides with returned value.
366
  * Slot 1 corresponds to special system thread, for which:
366
  * Slot 1 corresponds to special system thread, for which:
367
    * the window is in the bottom of the window stack, the fields
367
    * the window is in the bottom of the window stack, the fields
368
      +4 and +6 contain value 1
368
      +4 and +6 contain value 1
369
    * name of the process - "OS/IDLE" (supplemented by spaces)
369
    * name of the process - "OS/IDLE" (supplemented by spaces)
370
    * address of the process in memory is 0, size of used memory is
370
    * address of the process in memory is 0, size of used memory is
371
      16 Mb (0x1000000)
371
      16 Mb (0x1000000)
372
    * PID=1
372
    * PID=1
373
    * coordinates and sizes of the window and the client area are by
373
    * coordinates and sizes of the window and the client area are by
374
      convention set to 0
374
      convention set to 0
375
    * status of the slot is always 0 (running)
375
    * status of the slot is always 0 (running)
376
    * the execution time adds of time leaving on operations itself
376
    * the execution time adds of time leaving on operations itself
377
      and idle time in waiting for interrupt (which can be got by call
377
      and idle time in waiting for interrupt (which can be got by call
378
      to subfunction 4 of function 18).
378
      to subfunction 4 of function 18).
379
  * Beginning from slot 2, the normal applications are placed.
379
  * Beginning from slot 2, the normal applications are placed.
380
  * The normal applications are placed in memory at the address
380
  * The normal applications are placed in memory at the address
381
    0 (kernel constant 'std_application_base_address').
381
    0 (kernel constant 'std_application_base_address').
382
    There is no intersection, as each process has its own page table.
382
    There is no intersection, as each process has its own page table.
383
  * At creation of the thread it is assigned the slot
383
  * At creation of the thread it is assigned the slot
384
    in the system table and identifier (Process/Thread IDentifier =
384
    in the system table and identifier (Process/Thread IDentifier =
385
    PID/TID), which do not vary with time for given thread.
385
    PID/TID), which do not vary with time for given thread.
386
    After completion of the thread its slot can be anew used
386
    After completion of the thread its slot can be anew used
387
    for another thread. The thread identifier can not be assigned
387
    for another thread. The thread identifier can not be assigned
388
    to other thread even after completion of this thread.
388
    to other thread even after completion of this thread.
389
    Identifiers, assigned to new threads, grow monotonously.
389
    Identifiers, assigned to new threads, grow monotonously.
390
  * If the thread has not yet defined the window by call to
390
  * If the thread has not yet defined the window by call to
391
    function 0, the position and the sizes
391
    function 0, the position and the sizes
392
    of its window are considered to be zero.
392
    of its window are considered to be zero.
393
  * Coordinates of the client area are relative to the window.
393
  * Coordinates of the client area are relative to the window.
394
  * At the moment only the part of the buffer by a size
394
  * At the moment only the part of the buffer by a size
395
    71 = 0x37 bytes is used. Nevertheless it is recommended to use
395
    71 = 0x37 bytes is used. Nevertheless it is recommended to use
396
    1-Kb buffer for the future compatibility, in the future
396
    1-Kb buffer for the future compatibility, in the future
397
    some fields can be added.
397
    some fields can be added.
398
 
398
 
399
======================================================================
399
======================================================================
400
==================== Function 10 - wait for event. ===================
400
==================== Function 10 - wait for event. ===================
401
======================================================================
401
======================================================================
402
If the message queue is empty, waits for appearance of the message
402
If the message queue is empty, waits for appearance of the message
403
in queue. In this state thread does not consume CPU time.
403
in queue. In this state thread does not consume CPU time.
404
Then reads out the message from queue.
404
Then reads out the message from queue.
405
 
405
 
406
Parameters:
406
Parameters:
407
  * eax = 10 - function number
407
  * eax = 10 - function number
408
Returned value:
408
Returned value:
409
  * eax = event (see the list of events)
409
  * eax = event (see the list of events)
410
Remarks:
410
Remarks:
411
  * Those events are taken into account only which enter into
411
  * Those events are taken into account only which enter into
412
    a mask set by function 40. By default it is
412
    a mask set by function 40. By default it is
413
    redraw, key and button events.
413
    redraw, key and button events.
414
  * To check, whether there is a message in queue, use function 11.
414
  * To check, whether there is a message in queue, use function 11.
415
    To wait for no more than given time, use function 23.
415
    To wait for no more than given time, use function 23.
416
 
416
 
417
======================================================================
417
======================================================================
418
=============== Function 11 - check for event, no wait. ==============
418
=============== Function 11 - check for event, no wait. ==============
419
======================================================================
419
======================================================================
420
If the message queue contains event, function reads out
420
If the message queue contains event, function reads out
421
and return it. If the queue is empty, function returns 0.
421
and return it. If the queue is empty, function returns 0.
422
Parameters:
422
Parameters:
423
  * eax = 11 - function number
423
  * eax = 11 - function number
424
Returned value:
424
Returned value:
425
  * eax = 0 - message queue is empty
425
  * eax = 0 - message queue is empty
426
  * else eax = event (see the list of events)
426
  * else eax = event (see the list of events)
427
Remarks:
427
Remarks:
428
  * Those events are taken into account only, which enter into
428
  * Those events are taken into account only, which enter into
429
    a mask set by function 40. By default it is
429
    a mask set by function 40. By default it is
430
    redraw, key and button events.
430
    redraw, key and button events.
431
  * To wait for event, use function 10.
431
  * To wait for event, use function 10.
432
    To wait for no more than given time, use function 23.
432
    To wait for no more than given time, use function 23.
433
 
433
 
434
======================================================================
434
======================================================================
435
=============== Function 12 - begin/end window redraw. ===============
435
=============== Function 12 - begin/end window redraw. ===============
436
======================================================================
436
======================================================================
437
 
437
 
438
---------------- Subfunction 1 - begin window redraw. ----------------
438
---------------- Subfunction 1 - begin window redraw. ----------------
439
Parameters:
439
Parameters:
440
  * eax = 12 - function number
440
  * eax = 12 - function number
441
  * ebx = 1 - subfunction number
441
  * ebx = 1 - subfunction number
442
Returned value:
442
Returned value:
443
  * function does not return value
443
  * function does not return value
444
 
444
 
445
----------------- Subfunction 2 - end window redraw. -----------------
445
----------------- Subfunction 2 - end window redraw. -----------------
446
Parameters:
446
Parameters:
447
  * eax = 12 - function number
447
  * eax = 12 - function number
448
  * ebx = 2 - subfunction number
448
  * ebx = 2 - subfunction number
449
Returned value:
449
Returned value:
450
  * function does not return value
450
  * function does not return value
451
Remarks:
451
Remarks:
452
  * Subfunction 1 deletes all buttons defined with
452
  * Subfunction 1 deletes all buttons defined with
453
    function 8, they must be defined again.
453
    function 8, they must be defined again.
454
 
454
 
455
======================================================================
455
======================================================================
456
============ Function 13 - draw a rectangle in the window. ===========
456
============ Function 13 - draw a rectangle in the window. ===========
457
======================================================================
457
======================================================================
458
Parameters:
458
Parameters:
459
  * eax = 13 - function number
459
  * eax = 13 - function number
460
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
460
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
461
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
461
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
462
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
462
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
463
Returned value:
463
Returned value:
464
  * function does not return value
464
  * function does not return value
465
Remarks:
465
Remarks:
466
  * Coordinates are understood as coordinates of the left upper corner
466
  * Coordinates are understood as coordinates of the left upper corner
467
    of a rectangle relative to the window.
467
    of a rectangle relative to the window.
468
 
468
 
469
======================================================================
469
======================================================================
470
=================== Function 14 - get screen size. ===================
470
=================== Function 14 - get screen size. ===================
471
======================================================================
471
======================================================================
472
Parameters:
472
Parameters:
473
  * eax = 14 - function number
473
  * eax = 14 - function number
474
Returned value:
474
Returned value:
475
  * eax = [xsize]*65536 + [ysize], where
475
  * eax = [xsize]*65536 + [ysize], where
476
  * xsize = x-coordinate of the right lower corner of the screen =
476
  * xsize = x-coordinate of the right lower corner of the screen =
477
            horizontal size - 1
477
            horizontal size - 1
478
  * ysize = y-coordinate of the right lower corner of the screen =
478
  * ysize = y-coordinate of the right lower corner of the screen =
479
            vertical size - 1
479
            vertical size - 1
480
Remarks:
480
Remarks:
481
  * See also subfunction 5 of function 48 - get sizes of
481
  * See also subfunction 5 of function 48 - get sizes of
482
    working area of the screen.
482
    working area of the screen.
483
 
483
 
484
======================================================================
484
======================================================================
485
== Function 15, subfunction 1 - set a size of the background image. ==
485
== Function 15, subfunction 1 - set a size of the background image. ==
486
======================================================================
486
======================================================================
487
Parameters:
487
Parameters:
488
  * eax = 15 - function number
488
  * eax = 15 - function number
489
  * ebx = 1 - subfunction number
489
  * ebx = 1 - subfunction number
490
  * ecx = width of the image
490
  * ecx = width of the image
491
  * edx = height of the image
491
  * edx = height of the image
492
Returned value:
492
Returned value:
493
  * function does not return value
493
  * function does not return value
494
Remarks:
494
Remarks:
495
  * Before calling subfunctions 2 and 5 you should call this function
495
  * Before calling subfunctions 2 and 5 you should call this function
496
    to set image size!
496
    to set image size!
497
  * For update of the screen (after completion of a series of commands
497
  * For update of the screen (after completion of a series of commands
498
    working with a background) call subfunction 3.
498
    working with a background) call subfunction 3.
499
  * There is a pair function for get size of the background image -
499
  * There is a pair function for get size of the background image -
500
    subfunction 1 of function 39.
500
    subfunction 1 of function 39.
501
 
501
 
502
======================================================================
502
======================================================================
503
=== Function 15, subfunction 2 - put pixel on the background image. ==
503
=== Function 15, subfunction 2 - put pixel on the background image. ==
504
======================================================================
504
======================================================================
505
Parameters:
505
Parameters:
506
  * eax = 15 - function number
506
  * eax = 15 - function number
507
  * ebx = 2 - subfunction number
507
  * ebx = 2 - subfunction number
508
  * ecx = offset
508
  * ecx = offset
509
  * edx = color of a pixel 0xRRGGBB
509
  * edx = color of a pixel 0xRRGGBB
510
Returned value:
510
Returned value:
511
  * function does not return value
511
  * function does not return value
512
Remarks:
512
Remarks:
513
  * Offset for a pixel with coordinates (x,y) is calculated as
513
  * Offset for a pixel with coordinates (x,y) is calculated as
514
    (x+y*xsize)*3.
514
    (x+y*xsize)*3.
515
  * If the given offset exceeds size set by subfunction 1,
515
  * If the given offset exceeds size set by subfunction 1,
516
    the call is ignored.
516
    the call is ignored.
517
  * For update of the screen (after completion of a series of commands
517
  * For update of the screen (after completion of a series of commands
518
    working with a background) call subfunction 3.
518
    working with a background) call subfunction 3.
519
  * There is a pair function for get pixel on the background image -
519
  * There is a pair function for get pixel on the background image -
520
    subfunction 2 of function 39.
520
    subfunction 2 of function 39.
521
 
521
 
522
======================================================================
522
======================================================================
523
=========== Function 15, subfunction 3 - redraw background. ==========
523
=========== Function 15, subfunction 3 - redraw background. ==========
524
======================================================================
524
======================================================================
525
Parameters:
525
Parameters:
526
  * eax = 15 - function number
526
  * eax = 15 - function number
527
  * ebx = 3 - subfunction number
527
  * ebx = 3 - subfunction number
528
Returned value:
528
Returned value:
529
  * function does not return value
529
  * function does not return value
530
 
530
 
531
======================================================================
531
======================================================================
532
== Function 15, subfunction 4 - set drawing mode for the background. =
532
== Function 15, subfunction 4 - set drawing mode for the background. =
533
======================================================================
533
======================================================================
534
Parameters:
534
Parameters:
535
  * eax = 15 - function number
535
  * eax = 15 - function number
536
  * ebx = 4 - subfunction number
536
  * ebx = 4 - subfunction number
537
  * ecx = drawing mode:
537
  * ecx = drawing mode:
538
    * 1 = tile
538
    * 1 = tile
539
    * 2 = stretch
539
    * 2 = stretch
540
Returned value:
540
Returned value:
541
  * function does not return value
541
  * function does not return value
542
Remarks:
542
Remarks:
543
  * For update of the screen (after completion of a series of commands
543
  * For update of the screen (after completion of a series of commands
544
    working with a background) call subfunction 3.
544
    working with a background) call subfunction 3.
545
  * There is a pair function for get drawing mode of the background -
545
  * There is a pair function for get drawing mode of the background -
546
    subfunction 4 of function 39.
546
    subfunction 4 of function 39.
547
 
547
 
548
======================================================================
548
======================================================================
549
===================== Function 15, subfunction 5 =====================
549
===================== Function 15, subfunction 5 =====================
550
============ Put block of pixels on the background image. ============
550
============ Put block of pixels on the background image. ============
551
======================================================================
551
======================================================================
552
Parameters:
552
Parameters:
553
  * eax = 15 - function number
553
  * eax = 15 - function number
554
  * ebx = 5 - subfunction number
554
  * ebx = 5 - subfunction number
555
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
555
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
556
  * edx = offset in data of the background image
556
  * edx = offset in data of the background image
557
  * esi = size of data in bytes = 3 * number of pixels
557
  * esi = size of data in bytes = 3 * number of pixels
558
Returned value:
558
Returned value:
559
  * function does not return value
559
  * function does not return value
560
Remarks:
560
Remarks:
561
  * Offset and size are not checked for correctness.
561
  * Offset and size are not checked for correctness.
562
  * Color of each pixel is stored as 3-bytes value BBGGRR.
562
  * Color of each pixel is stored as 3-bytes value BBGGRR.
563
  * Pixels of the background image are written sequentially
563
  * Pixels of the background image are written sequentially
564
    from left to right, from up to down.
564
    from left to right, from up to down.
565
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
565
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
566
  * For update of the screen (after completion of a series of commands
566
  * For update of the screen (after completion of a series of commands
567
    working with a background) call subfunction 3.
567
    working with a background) call subfunction 3.
568
 
568
 
569
======================================================================
569
======================================================================
570
===================== Function 15, subfunction 6 =====================
570
===================== Function 15, subfunction 6 =====================
571
======== Map background data to the address space of process. ========
571
======== Map background data to the address space of process. ========
572
======================================================================
572
======================================================================
573
Parameters:
573
Parameters:
574
  * eax = 15 - function number
574
  * eax = 15 - function number
575
  * ebx = 6 - subfunction number
575
  * ebx = 6 - subfunction number
576
Returned value:
576
Returned value:
577
  * eax = pointer to background data, 0 if error
577
  * eax = pointer to background data, 0 if error
578
Remarks:
578
Remarks:
579
  * Mapped data are available for read and write.
579
  * Mapped data are available for read and write.
580
  * Size of background data is 3*xsize*ysize. The system blocks
580
  * Size of background data is 3*xsize*ysize. The system blocks
581
    changes of background sizes while process works with mapped data.
581
    changes of background sizes while process works with mapped data.
582
  * Color of each pixel is stored as 3-bytes value BBGGRR.
582
  * Color of each pixel is stored as 3-bytes value BBGGRR.
583
  * Pixels of the background image are written sequentially
583
  * Pixels of the background image are written sequentially
584
    from left to right, from up to down.
584
    from left to right, from up to down.
585
 
585
 
586
======================================================================
586
======================================================================
587
===== Function 15, subfunction 7 - close mapped background data. =====
587
===== Function 15, subfunction 7 - close mapped background data. =====
588
======================================================================
588
======================================================================
589
Parameters:
589
Parameters:
590
  * eax = 15 - function number
590
  * eax = 15 - function number
591
  * ebx = 7 - subfunction number
591
  * ebx = 7 - subfunction number
592
  * ecx = pointer to mapped data
592
  * ecx = pointer to mapped data
593
Returned value:
593
Returned value:
594
  * eax = 1 - success, 0 - error
594
  * eax = 1 - success, 0 - error
595
 
595
 
596
======================================================================
596
======================================================================
597
=============== Function 16 - save ramdisk on a floppy. ==============
597
=============== Function 16 - save ramdisk on a floppy. ==============
598
======================================================================
598
======================================================================
599
Parameters:
599
Parameters:
600
  * eax = 16 - function number
600
  * eax = 16 - function number
601
  * ebx = 1 or ebx = 2 - on which floppy save
601
  * ebx = 1 or ebx = 2 - on which floppy save
602
Returned value:
602
Returned value:
603
  * eax = 0 - success
603
  * eax = 0 - success
604
  * eax = 1 - error
604
  * eax = 1 - error
605
 
605
 
606
======================================================================
606
======================================================================
607
======= Function 17 - get the identifier of the pressed button. ======
607
======= Function 17 - get the identifier of the pressed button. ======
608
======================================================================
608
======================================================================
609
Takes away the code of the pressed button from the buffer.
609
Takes away the code of the pressed button from the buffer.
610
Parameters:
610
Parameters:
611
  * eax = 17 - function number
611
  * eax = 17 - function number
612
Returned value:
612
Returned value:
613
  * if the buffer is empty, function returns eax=1
613
  * if the buffer is empty, function returns eax=1
614
  * if the buffer is not empty:
614
  * if the buffer is not empty:
615
    * high 24 bits of eax contain button identifier (in particular,
615
    * high 24 bits of eax contain button identifier (in particular,
616
      ah contains low byte of the identifier; if all buttons have
616
      ah contains low byte of the identifier; if all buttons have
617
      the identifier less than 256, ah is enough to distinguish)
617
      the identifier less than 256, ah is enough to distinguish)
618
    * al = 0 - the button was pressed with left mouse button
618
    * al = 0 - the button was pressed with left mouse button
619
    * al = bit corresponding to used mouse button otherwise
619
    * al = bit corresponding to used mouse button otherwise
620
Remarks:
620
Remarks:
621
  * "Buffer" keeps only one button, at pressing the new button the
621
  * "Buffer" keeps only one button, at pressing the new button the
622
    information about old is lost.
622
    information about old is lost.
623
  * The call of this function by an application with inactive window
623
  * The call of this function by an application with inactive window
624
    will return answer "buffer is empty".
624
    will return answer "buffer is empty".
625
  * Returned value for al corresponds to the state of mouse buttons
625
  * Returned value for al corresponds to the state of mouse buttons
626
    as in subfunction 2 of function 37 at the beginning
626
    as in subfunction 2 of function 37 at the beginning
627
    of button press, excluding lower bit, which is cleared.
627
    of button press, excluding lower bit, which is cleared.
628
 
628
 
629
======================================================================
629
======================================================================
-
 
630
===================== Function 18, subfunction 1 =====================
-
 
631
============= Make deactive the window of the given thread. ==========
-
 
632
======================================================================
-
 
633
Parameters:
-
 
634
  * eax = 18 - function number
-
 
635
  * ebx = 1 - subfunction number
-
 
636
  * ecx = number of the thread slot
-
 
637
Returned value:
-
 
638
  * function does not return value
-
 
639
	
-
 
640
======================================================================
630
= Function 18, subfunction 2 - terminate process/thread by the slot. =
641
= Function 18, subfunction 2 - terminate process/thread by the slot. =
631
======================================================================
642
======================================================================
632
Parameters:
643
Parameters:
633
  * eax = 18 - function number
644
  * eax = 18 - function number
634
  * ebx = 2 - subfunction number
645
  * ebx = 2 - subfunction number
635
  * ecx = number of the slot of process/thread
646
  * ecx = number of the slot of process/thread
636
Returned value:
647
Returned value:
637
  * function does not return value
648
  * function does not return value
638
Remarks:
649
Remarks:
639
  * It is impossible to terminate system thread OS/IDLE (with
650
  * It is impossible to terminate system thread OS/IDLE (with
640
    number of the slot 1),
651
    number of the slot 1),
641
    it is possible to terminate any normal process/thread.
652
    it is possible to terminate any normal process/thread.
642
  * See also subfunction 18 - terminate
653
  * See also subfunction 18 - terminate
643
    process/thread by the identifier.
654
    process/thread by the identifier.
644
 
655
 
645
======================================================================
656
======================================================================
646
===================== Function 18, subfunction 3 =====================
657
===================== Function 18, subfunction 3 =====================
647
============= Make active the window of the given thread. ============
658
============= Make active the window of the given thread. ============
648
======================================================================
659
======================================================================
649
Parameters:
660
Parameters:
650
  * eax = 18 - function number
661
  * eax = 18 - function number
651
  * ebx = 3 - subfunction number
662
  * ebx = 3 - subfunction number
652
  * ecx = number of the thread slot
663
  * ecx = number of the thread slot
653
Returned value:
664
Returned value:
654
  * function does not return value
665
  * function does not return value
655
Remarks:
666
Remarks:
656
  * If correct, but nonexistent slot is given,
667
  * If correct, but nonexistent slot is given,
657
    some window is made active.
668
    some window is made active.
658
  * To find out, which window is active, use subfunction 7.
669
  * To find out, which window is active, use subfunction 7.
659
 
670
 
660
======================================================================
671
======================================================================
661
===================== Function 18, subfunction 4 =====================
672
===================== Function 18, subfunction 4 =====================
662
=========== Get counter of idle time units per one second. ===========
673
=========== Get counter of idle time units per one second. ===========
663
======================================================================
674
======================================================================
664
Idle time units are units, in which the processor stands idle
675
Idle time units are units, in which the processor stands idle
665
in waiting for interrupt (in the command 'hlt').
676
in waiting for interrupt (in the command 'hlt').
666
 
677
 
667
Parameters:
678
Parameters:
668
  * eax = 18 - function number
679
  * eax = 18 - function number
669
  * ebx = 4 - subfunction number
680
  * ebx = 4 - subfunction number
670
Returned value:
681
Returned value:
671
  * eax = value of the counter of idle time units per one second
682
  * eax = value of the counter of idle time units per one second
672
 
683
 
673
======================================================================
684
======================================================================
674
========== Function 18, subfunction 5 - get CPU clock rate. ==========
685
========== Function 18, subfunction 5 - get CPU clock rate. ==========
675
======================================================================
686
======================================================================
676
Parameters:
687
Parameters:
677
  * eax = 18 - function number
688
  * eax = 18 - function number
678
  * ebx = 5 - subfunction number
689
  * ebx = 5 - subfunction number
679
Returned value:
690
Returned value:
680
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
691
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
681
 
692
 
682
======================================================================
693
======================================================================
683
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
694
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
684
======================================================================
695
======================================================================
685
Parameters:
696
Parameters:
686
  * eax = 18 - function number
697
  * eax = 18 - function number
687
  * ebx = 6 - subfunction number
698
  * ebx = 6 - subfunction number
688
  * ecx = pointer to the full path to file
699
  * ecx = pointer to the full path to file
689
    (for example, "/hd0/1/kolibri/kolibri.img")
700
    (for example, "/hd0/1/kolibri/kolibri.img")
690
Returned value:
701
Returned value:
691
  * eax = 0 - success
702
  * eax = 0 - success
692
  * else eax = error code of the file system
703
  * else eax = error code of the file system
693
Remarks:
704
Remarks:
694
  * All folders in the given path must exist, otherwise function
705
  * All folders in the given path must exist, otherwise function
695
    returns value 5, "file not found".
706
    returns value 5, "file not found".
696
 
707
 
697
======================================================================
708
======================================================================
698
=========== Function 18, subfunction 7 - get active window. ==========
709
=========== Function 18, subfunction 7 - get active window. ==========
699
======================================================================
710
======================================================================
700
Parameters:
711
Parameters:
701
  * eax = 18 - function number
712
  * eax = 18 - function number
702
  * ebx = 7 - subfunction number
713
  * ebx = 7 - subfunction number
703
Returned value:
714
Returned value:
704
  * eax = number of the active window
715
  * eax = number of the active window
705
    (number of the slot of the thread with active window)
716
    (number of the slot of the thread with active window)
706
Remarks:
717
Remarks:
707
  * Active window is at the top of the window stack and receives
718
  * Active window is at the top of the window stack and receives
708
    messages on all keyboard input.
719
    messages on all keyboard input.
709
  * To make a window active, use subfunction 3.
720
  * To make a window active, use subfunction 3.
710
 
721
 
711
======================================================================
722
======================================================================
712
== Function 18, subfunction 8 - disable/enable the internal speaker. =
723
== Function 18, subfunction 8 - disable/enable the internal speaker. =
713
======================================================================
724
======================================================================
714
If speaker sound is disabled, all calls to subfunction 55 of
725
If speaker sound is disabled, all calls to subfunction 55 of
715
function 55 are ignored. If speaker sound is enabled,
726
function 55 are ignored. If speaker sound is enabled,
716
they are routed on builtin speaker.
727
they are routed on builtin speaker.
717
 
728
 
718
------------------- Subsubfunction 1 - get status. -------------------
729
------------------- Subsubfunction 1 - get status. -------------------
719
Parameters:
730
Parameters:
720
  * eax = 18 - function number
731
  * eax = 18 - function number
721
  * ebx = 8 - subfunction number
732
  * ebx = 8 - subfunction number
722
  * ecx = 1 - number of the subsubfunction
733
  * ecx = 1 - number of the subsubfunction
723
Returned value:
734
Returned value:
724
  * eax = 0 - speaker sound is enabled; 1 - disabled
735
  * eax = 0 - speaker sound is enabled; 1 - disabled
725
 
736
 
726
----------------- Subsubfunction 2 - toggle status. ------------------
737
----------------- Subsubfunction 2 - toggle status. ------------------
727
Toggles states of disable/enable.
738
Toggles states of disable/enable.
728
Parameters:
739
Parameters:
729
  * eax = 18 - function number
740
  * eax = 18 - function number
730
  * ebx = 8 - subfunction number
741
  * ebx = 8 - subfunction number
731
  * ecx = 2 - number of the subsubfunction
742
  * ecx = 2 - number of the subsubfunction
732
Returned value:
743
Returned value:
733
  * function does not return value
744
  * function does not return value
734
 
745
 
735
======================================================================
746
======================================================================
736
== Function 18, subfunction 9 - system shutdown with the parameter. ==
747
== Function 18, subfunction 9 - system shutdown with the parameter. ==
737
======================================================================
748
======================================================================
738
Parameters:
749
Parameters:
739
  * eax = 18 - function number
750
  * eax = 18 - function number
740
  * ebx = 9 - subfunction number
751
  * ebx = 9 - subfunction number
741
  * ecx = parameter:
752
  * ecx = parameter:
742
    * 2 = turn off computer
753
    * 2 = turn off computer
743
    * 3 = reboot computer
754
    * 3 = reboot computer
744
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
755
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
745
Returned value:
756
Returned value:
746
  * at incorrect ecx the registers do not change (i.e. eax=18)
757
  * at incorrect ecx the registers do not change (i.e. eax=18)
747
  * by correct call function always returns eax=0
758
  * by correct call function always returns eax=0
748
    as the tag of success
759
    as the tag of success
749
Remarks:
760
Remarks:
750
  * Do not rely on returned value by incorrect call, it can be
761
  * Do not rely on returned value by incorrect call, it can be
751
    changed in future versions of the kernel.
762
    changed in future versions of the kernel.
752
 
763
 
753
======================================================================
764
======================================================================
754
===== Function 18, subfunction 10 - minimize application window. =====
765
===== Function 18, subfunction 10 - minimize application window. =====
755
======================================================================
766
======================================================================
756
Minimizes the own window.
767
Minimizes the own window.
757
Parameters:
768
Parameters:
758
  * eax = 18 - function number
769
  * eax = 18 - function number
759
  * ebx = 10 - subfunction number
770
  * ebx = 10 - subfunction number
760
Returned value:
771
Returned value:
761
  * function does not return value
772
  * function does not return value
762
Remarks:
773
Remarks:
763
  * The minimized window from the point of view of function 9
774
  * The minimized window from the point of view of function 9
764
    keeps position and sizes.
775
    keeps position and sizes.
765
  * Restoring of an application window occurs at its activation by 
776
  * Restoring of an application window occurs at its activation by 
766
    subfunction 3.
777
    subfunction 3.
767
  * Usually there is no necessity to minimize/restire a window
778
  * Usually there is no necessity to minimize/restire a window
768
    obviously: minimization of a window is carried out by the system
779
    obviously: minimization of a window is carried out by the system
769
    at pressing the minimization button (for skinned windows
780
    at pressing the minimization button (for skinned windows
770
    it is defined automatically by function 0,
781
    it is defined automatically by function 0,
771
    for other windows it can be defined manually by function 8),
782
    for other windows it can be defined manually by function 8),
772
    restore of a window is done by the application '@panel'.
783
    restore of a window is done by the application '@panel'.
773
 
784
 
774
======================================================================
785
======================================================================
775
 Function 18, subfunction 11 - get information on the disk subsystem. 
786
 Function 18, subfunction 11 - get information on the disk subsystem. 
776
======================================================================
787
======================================================================
777
Parameters:
788
Parameters:
778
  * eax = 18 - function number
789
  * eax = 18 - function number
779
  * ebx = 11 - subfunction number
790
  * ebx = 11 - subfunction number
780
  * ecx = type of the table:
791
  * ecx = type of the table:
781
    * 1 = short version, 10 bytes
792
    * 1 = short version, 10 bytes
782
    * 2 = full version, 65536 bytes
793
    * 2 = full version, 65536 bytes
783
  * edx = pointer to the buffer (in the application) for the table
794
  * edx = pointer to the buffer (in the application) for the table
784
Returned value:
795
Returned value:
785
  * function does not return value
796
  * function does not return value
786
Format of the table: short version:
797
Format of the table: short version:
787
  * +0: byte: information about FDD's (drives for floppies),
798
  * +0: byte: information about FDD's (drives for floppies),
788
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
799
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
789
    of the second regarding to the following list:
800
    of the second regarding to the following list:
790
    * 0 = there is no drive
801
    * 0 = there is no drive
791
    * 1 = 360Kb, 5.25''
802
    * 1 = 360Kb, 5.25''
792
    * 2 = 1.2Mb, 5.25''
803
    * 2 = 1.2Mb, 5.25''
793
    * 3 = 720Kb, 3.5''
804
    * 3 = 720Kb, 3.5''
794
    * 4 = 1.44Mb, 3.5''
805
    * 4 = 1.44Mb, 3.5''
795
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
806
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
796
    For example, for the standard configuration from one 1.44-drive
807
    For example, for the standard configuration from one 1.44-drive
797
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
808
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
798
    the value is 24h.
809
    the value is 24h.
799
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
810
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
800
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
811
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
801
    * 0 = device is absent
812
    * 0 = device is absent
802
    * 1 = hard drive
813
    * 1 = hard drive
803
    * 2 = CD-drive
814
    * 2 = CD-drive
804
    For example, in the case HD on IDE0 and CD on IDE2
815
    For example, in the case HD on IDE0 and CD on IDE2
805
    this field contains 48h.
816
    this field contains 48h.
806
  * +2: 4 db: number of the retrieved partitions on hard disks
817
  * +2: 4 db: number of the retrieved partitions on hard disks
807
    at accordingly IDE0,...,IDE3.
818
    at accordingly IDE0,...,IDE3.
808
    If the hard disk on IDEx is absent, appropriate byte is zero,
819
    If the hard disk on IDEx is absent, appropriate byte is zero,
809
    otherwise it shows number of the recognized partitions, which
820
    otherwise it shows number of the recognized partitions, which
810
    can be not presented (if the drive is not formatted or if
821
    can be not presented (if the drive is not formatted or if
811
    the file system is not supported). Current version of the kernel
822
    the file system is not supported). Current version of the kernel
812
    supports only FAT16, FAT32 and NTFS for hard disks.
823
    supports only FAT16, FAT32 and NTFS for hard disks.
813
  * +6: 4 db: reserved
824
  * +6: 4 db: reserved
814
Format of the table: full version:
825
Format of the table: full version:
815
  * +0: 10 db: same as for the short version
826
  * +0: 10 db: same as for the short version
816
  * +10: 100 db: data for the first partition
827
  * +10: 100 db: data for the first partition
817
  * +110: 100 db: data for the second partition
828
  * +110: 100 db: data for the second partition
818
  * ...
829
  * ...
819
  * +10+100*(n-1): 100 db: data for the last partition
830
  * +10+100*(n-1): 100 db: data for the last partition
820
The partitions are located as follows: at first sequentially all
831
The partitions are located as follows: at first sequentially all
821
recoginzed partitions on HD on IDE0 (if present),
832
recoginzed partitions on HD on IDE0 (if present),
822
then on HD on IDE1 (if present) and so on up to IDE3.
833
then on HD on IDE1 (if present) and so on up to IDE3.
823
Format of the information about partition
834
Format of the information about partition
824
(at moment only FAT is supported):
835
(at moment only FAT is supported):
825
  * +0: dword: first physical sector of the partition
836
  * +0: dword: first physical sector of the partition
826
  * +4: dword: last physical sector of the partition
837
  * +4: dword: last physical sector of the partition
827
    (belongs to the partition)
838
    (belongs to the partition)
828
  * +8: byte: file system type:
839
  * +8: byte: file system type:
829
    16=FAT16, 32=FAT32, 1=NTFS
840
    16=FAT16, 32=FAT32, 1=NTFS
830
  * other data are dependent on file system, are modified with
841
  * other data are dependent on file system, are modified with
831
    kernel modifications and therefore are not described
842
    kernel modifications and therefore are not described
832
Remarks:
843
Remarks:
833
  * The short table can be used for obtaining the information about
844
  * The short table can be used for obtaining the information about
834
    available devices.
845
    available devices.
835
 
846
 
836
======================================================================
847
======================================================================
837
========== Function 18, subfunction 13 - get kernel version. =========
848
========== Function 18, subfunction 13 - get kernel version. =========
838
======================================================================
849
======================================================================
839
Parameters:
850
Parameters:
840
  * eax = 18 - function number
851
  * eax = 18 - function number
841
  * ebx = 13 - subfunction number
852
  * ebx = 13 - subfunction number
842
  * ecx = pointer to the buffer (not less than 16 bytes), where
853
  * ecx = pointer to the buffer (not less than 16 bytes), where
843
    the information will be placed
854
    the information will be placed
844
Returned value:
855
Returned value:
845
  * function does not return value
856
  * function does not return value
846
Structure of the buffer:
857
Structure of the buffer:
847
db a,b,c,d for version a.b.c.d
858
db a,b,c,d for version a.b.c.d
848
db 0: reserved
859
db 0: reserved
849
dd REV - kernel SVN revision number
860
dd REV - kernel SVN revision number
850
For Kolibri 0.7.7.0+ kernel:
861
For Kolibri 0.7.7.0+ kernel:
851
db 0,7,7,0
862
db 0,7,7,0
852
db 0
863
db 0
853
dd 1675
864
dd 1675
854
 
865
 
855
======================================================================
866
======================================================================
856
======= Function 18, subfunction 14 - wait for screen retrace. =======
867
======= Function 18, subfunction 14 - wait for screen retrace. =======
857
======================================================================
868
======================================================================
858
Waits for the beginning of retrace of the scanning ray of the screen
869
Waits for the beginning of retrace of the scanning ray of the screen
859
monitor.
870
monitor.
860
Parameters:
871
Parameters:
861
  * eax = 18 - function number
872
  * eax = 18 - function number
862
  * ebx = 14 - subfunction number
873
  * ebx = 14 - subfunction number
863
Returned value:
874
Returned value:
864
  * eax = 0 as the tag of success
875
  * eax = 0 as the tag of success
865
Remarks:
876
Remarks:
866
  * Function is intended only for active high-efficiency graphics
877
  * Function is intended only for active high-efficiency graphics
867
    applications; is used for smooth output of a graphics.
878
    applications; is used for smooth output of a graphics.
868
 
879
 
869
======================================================================
880
======================================================================
870
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
881
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
871
======================================================================
882
======================================================================
872
Parameters:
883
Parameters:
873
  * eax = 18 - function number
884
  * eax = 18 - function number
874
  * ebx = 15 - subfunction number
885
  * ebx = 15 - subfunction number
875
Returned value:
886
Returned value:
876
  * eax = 0 as the tag of success
887
  * eax = 0 as the tag of success
877
 
888
 
878
======================================================================
889
======================================================================
879
========= Function 18, subfunction 16 - get size of free RAM. ========
890
========= Function 18, subfunction 16 - get size of free RAM. ========
880
======================================================================
891
======================================================================
881
Parameters:
892
Parameters:
882
  * eax = 18 - function number
893
  * eax = 18 - function number
883
  * ebx = 16 - subfunction number
894
  * ebx = 16 - subfunction number
884
Returned value:
895
Returned value:
885
  * eax = size of free memory in kilobytes
896
  * eax = size of free memory in kilobytes
886
 
897
 
887
======================================================================
898
======================================================================
888
======== Function 18, subfunction 17 - get full amount of RAM. =======
899
======== Function 18, subfunction 17 - get full amount of RAM. =======
889
======================================================================
900
======================================================================
890
Parameters:
901
Parameters:
891
  * eax = 18 - function number
902
  * eax = 18 - function number
892
  * ebx = 17 - subfunction number
903
  * ebx = 17 - subfunction number
893
Returned value:
904
Returned value:
894
  * eax = total size of existing memory in kilobytes
905
  * eax = total size of existing memory in kilobytes
895
 
906
 
896
======================================================================
907
======================================================================
897
===================== Function 18, subfunction 18 ====================
908
===================== Function 18, subfunction 18 ====================
898
============= Terminate process/thread by the identifier. ============
909
============= Terminate process/thread by the identifier. ============
899
======================================================================
910
======================================================================
900
Parameters:
911
Parameters:
901
  * eax = 18 - function number
912
  * eax = 18 - function number
902
  * ebx = 18 - subfunction number
913
  * ebx = 18 - subfunction number
903
  * ecx = identifer of process/thread (PID/TID)
914
  * ecx = identifer of process/thread (PID/TID)
904
Returned value:
915
Returned value:
905
  * eax = 0 - success
916
  * eax = 0 - success
906
  * eax = -1 - error (process is not found or is system)
917
  * eax = -1 - error (process is not found or is system)
907
Remarks:
918
Remarks:
908
  * It is impossible to terminate system thread OS/IDLE (identifier
919
  * It is impossible to terminate system thread OS/IDLE (identifier
909
    1), it is possible to terminate any normal process/thread.
920
    1), it is possible to terminate any normal process/thread.
910
  * See also subfunction 2 - terminate
921
  * See also subfunction 2 - terminate
911
    process/thread by given slot.
922
    process/thread by given slot.
912
 
923
 
913
======================================================================
924
======================================================================
914
======== Function 18, subfunction 19 - get/set mouse features. =======
925
======== Function 18, subfunction 19 - get/set mouse features. =======
915
======================================================================
926
======================================================================
916
 
927
 
917
---------------- Subsubfunction 0 - get mouse speed. -----------------
928
---------------- Subsubfunction 0 - get mouse speed. -----------------
918
Parameters:
929
Parameters:
919
  * eax = 18 - function number
930
  * eax = 18 - function number
920
  * ebx = 19 - subfunction number
931
  * ebx = 19 - subfunction number
921
  * ecx = 0 - subsubfunction number
932
  * ecx = 0 - subsubfunction number
922
Returned value:
933
Returned value:
923
  * eax = current mouse speed
934
  * eax = current mouse speed
924
 
935
 
925
---------------- Subsubfunction 1 - set mouse speed. -----------------
936
---------------- Subsubfunction 1 - set mouse speed. -----------------
926
Parameters:
937
Parameters:
927
  * eax = 18 - function number
938
  * eax = 18 - function number
928
  * ebx = 19 - subfunction number
939
  * ebx = 19 - subfunction number
929
  * ecx = 1 - subsubfunction number
940
  * ecx = 1 - subsubfunction number
930
  * edx = new value for speed
941
  * edx = new value for speed
931
Returned value:
942
Returned value:
932
  * function does not return value
943
  * function does not return value
933
 
944
 
934
---------------- Subsubfunction 2 - get mouse delay. -----------------
945
---------------- Subsubfunction 2 - get mouse delay. -----------------
935
Parameters:
946
Parameters:
936
  * eax = 18 - function number
947
  * eax = 18 - function number
937
  * ebx = 19 - subfunction number
948
  * ebx = 19 - subfunction number
938
  * ecx = 2 - subsubfunction number
949
  * ecx = 2 - subsubfunction number
939
Returned value:
950
Returned value:
940
  * eax = current mouse delay
951
  * eax = current mouse delay
941
 
952
 
942
---------------- Subsubfunction 3 - set mouse delay. -----------------
953
---------------- Subsubfunction 3 - set mouse delay. -----------------
943
Parameters:
954
Parameters:
944
  * eax = 18 - function number
955
  * eax = 18 - function number
945
  * ebx = 19 - subfunction number
956
  * ebx = 19 - subfunction number
946
  * ecx = 3 - subsubfunction number
957
  * ecx = 3 - subsubfunction number
947
  * edx = new value for mouse delay
958
  * edx = new value for mouse delay
948
Returned value:
959
Returned value:
949
  * function does not return value
960
  * function does not return value
950
 
961
 
951
----------- Subsubfunction 4 - set mouse pointer position. -----------
962
----------- Subsubfunction 4 - set mouse pointer position. -----------
952
Parameters:
963
Parameters:
953
  * eax = 18 - function number
964
  * eax = 18 - function number
954
  * ebx = 19 - subfunction number
965
  * ebx = 19 - subfunction number
955
  * ecx = 4 - subsubfunction number
966
  * ecx = 4 - subsubfunction number
956
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
967
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
957
Returned value:
968
Returned value:
958
  * function does not return value
969
  * function does not return value
959
 
970
 
960
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
971
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
961
Parameters:
972
Parameters:
962
  * eax = 18 - function number
973
  * eax = 18 - function number
963
  * ebx = 19 - subfunction number
974
  * ebx = 19 - subfunction number
964
  * ecx = 5 - subsubfunction number
975
  * ecx = 5 - subsubfunction number
965
  * edx = information about emulated state of mouse buttons:
976
  * edx = information about emulated state of mouse buttons:
966
    (same as return value in subfunction 2 of function 37)
977
    (same as return value in subfunction 2 of function 37)
967
    * bit 0 is set = left button is pressed
978
    * bit 0 is set = left button is pressed
968
    * bit 1 is set = right button is pressed
979
    * bit 1 is set = right button is pressed
969
    * bit 2 is set = middle button is pressed
980
    * bit 2 is set = middle button is pressed
970
    * bit 3 is set = 4th button is pressed
981
    * bit 3 is set = 4th button is pressed
971
    * bit 4 is set = 5th button is pressed
982
    * bit 4 is set = 5th button is pressed
972
Returned value:
983
Returned value:
973
  * function does not return value
984
  * function does not return value
974
Remarks:
985
Remarks:
975
  * It is recommended to set speed of the mouse (in subsubfunction 1)
986
  * It is recommended to set speed of the mouse (in subsubfunction 1)
976
    from 1 up to 9. The installed value is not inspected by the kernel
987
    from 1 up to 9. The installed value is not inspected by the kernel
977
    code, so set it carefully, at incorrect value the cursor
988
    code, so set it carefully, at incorrect value the cursor
978
    can "freeze". Speed of the mouse can be regulated through the
989
    can "freeze". Speed of the mouse can be regulated through the
979
    application SETUP.
990
    application SETUP.
980
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
991
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
981
    value is not handled by COM mice. At the very large values the
992
    value is not handled by COM mice. At the very large values the
982
    movement of the mouse on 1 pixel is impossible and the cursor will
993
    movement of the mouse on 1 pixel is impossible and the cursor will
983
    jump on the value of installed speed (subsubfunction 1). The
994
    jump on the value of installed speed (subsubfunction 1). The
984
    installed value is not inspected by the kernel code.
995
    installed value is not inspected by the kernel code.
985
    Mouse delay can be regulated through the application SETUP.
996
    Mouse delay can be regulated through the application SETUP.
986
  * The subsubfunction 4 does not check the passed value. Before
997
  * The subsubfunction 4 does not check the passed value. Before
987
    its call find out current screen resolution (with function 14)
998
    its call find out current screen resolution (with function 14)
988
    and check that the value of position is inside the limits of the
999
    and check that the value of position is inside the limits of the
989
    screen.
1000
    screen.
990
 
1001
 
991
======================================================================
1002
======================================================================
992
======== Function 18, subfunction 20 - get information on RAM. =======
1003
======== Function 18, subfunction 20 - get information on RAM. =======
993
======================================================================
1004
======================================================================
994
Parameters:
1005
Parameters:
995
  * eax = 18 - function number
1006
  * eax = 18 - function number
996
  * ebx = 20 - subfunction number
1007
  * ebx = 20 - subfunction number
997
  * ecx = pointer to the buffer for information (36 bytes)
1008
  * ecx = pointer to the buffer for information (36 bytes)
998
Returned value:
1009
Returned value:
999
  * eax = total size of existing RAM in pages
1010
  * eax = total size of existing RAM in pages
1000
    or -1 if error has occured
1011
    or -1 if error has occured
1001
  * buffer pointed to by ecx contains the following information:
1012
  * buffer pointed to by ecx contains the following information:
1002
    * +0:  dword: total size of existing RAM in pages
1013
    * +0:  dword: total size of existing RAM in pages
1003
    * +4:  dword: size of free RAM in pages
1014
    * +4:  dword: size of free RAM in pages
1004
    * +8:  dword: number of page faults (exceptions #PF)
1015
    * +8:  dword: number of page faults (exceptions #PF)
1005
                 in applications
1016
                 in applications
1006
    * +12: dword: size of kernel heap in bytes
1017
    * +12: dword: size of kernel heap in bytes
1007
    * +16: dword: free in kernel heap in bytes
1018
    * +16: dword: free in kernel heap in bytes
1008
    * +20: dword: total number of memory blocks in kernel heap
1019
    * +20: dword: total number of memory blocks in kernel heap
1009
    * +24: dword: number of free memory blocks in kernel heap
1020
    * +24: dword: number of free memory blocks in kernel heap
1010
    * +28: dword: size of maximum free block in kernel heap
1021
    * +28: dword: size of maximum free block in kernel heap
1011
                 (reserved)
1022
                 (reserved)
1012
    * +32: dword: size of maximum allocated block in kernel heap
1023
    * +32: dword: size of maximum allocated block in kernel heap
1013
                 (reserved)
1024
                 (reserved)
1014
 
1025
 
1015
======================================================================
1026
======================================================================
1016
===================== Function 18, subfunction 21 ====================
1027
===================== Function 18, subfunction 21 ====================
1017
======== Get slot number of process/thread by the identifier. ========
1028
======== Get slot number of process/thread by the identifier. ========
1018
======================================================================
1029
======================================================================
1019
Parameters:
1030
Parameters:
1020
  * eax = 18 - function number
1031
  * eax = 18 - function number
1021
  * ebx = 21 - subfunction number
1032
  * ebx = 21 - subfunction number
1022
  * ecx = identifer of process/thread (PID/TID)
1033
  * ecx = identifer of process/thread (PID/TID)
1023
Returned value:
1034
Returned value:
1024
  * eax = 0 - error (invalid identifier)
1035
  * eax = 0 - error (invalid identifier)
1025
  * otherwise eax = slot number
1036
  * otherwise eax = slot number
1026
 
1037
 
1027
======================================================================
1038
======================================================================
1028
===================== Function 18, subfunction 22 ====================
1039
===================== Function 18, subfunction 22 ====================
1029
============== Operations with window of another thread. =============
1040
============== Operations with window of another thread. =============
1030
======================================================================
1041
======================================================================
1031
Parameters:
1042
Parameters:
1032
  * eax = 18 - function number
1043
  * eax = 18 - function number
1033
  * ebx = 22 - subfunction number
1044
  * ebx = 22 - subfunction number
1034
  * ecx = operation type:
1045
  * ecx = operation type:
1035
    * 0 = minimize window of the thread with given slot number
1046
    * 0 = minimize window of the thread with given slot number
1036
    * 1 = minimize window of the thread with given identifier
1047
    * 1 = minimize window of the thread with given identifier
1037
    * 2 = restore window of the thread with given slot number
1048
    * 2 = restore window of the thread with given slot number
1038
    * 3 = restore window of the thread with given identifier
1049
    * 3 = restore window of the thread with given identifier
1039
  * edx = parameter (slot number or PID/TID)
1050
  * edx = parameter (slot number or PID/TID)
1040
Returned value:
1051
Returned value:
1041
  * eax = 0 - success
1052
  * eax = 0 - success
1042
  * eax = -1 - error (invalid identifier)
1053
  * eax = -1 - error (invalid identifier)
1043
Remarks:
1054
Remarks:
1044
  * The thread can minimize its window with subfunction 10.
1055
  * The thread can minimize its window with subfunction 10.
1045
  * One can restore and activate window simultaneously with
1056
  * One can restore and activate window simultaneously with
1046
    subfunction 3 (which requires slot number).
1057
    subfunction 3 (which requires slot number).
1047
 
1058
 
1048
======================================================================
1059
======================================================================
1049
==================== Function 20 - MIDI interface. ===================
1060
==================== Function 20 - MIDI interface. ===================
1050
======================================================================
1061
======================================================================
1051
 
1062
 
1052
----------------------- Subfunction 1 - reset ------------------------
1063
----------------------- Subfunction 1 - reset ------------------------
1053
Parameters:
1064
Parameters:
1054
  * eax = 20 - function number
1065
  * eax = 20 - function number
1055
  * ebx = 1 - subfunction number
1066
  * ebx = 1 - subfunction number
1056
 
1067
 
1057
-------------------- Subfunction 2 - output byte ---------------------
1068
-------------------- Subfunction 2 - output byte ---------------------
1058
Parameters:
1069
Parameters:
1059
  * eax = 20 - function number
1070
  * eax = 20 - function number
1060
  * ebx = 2 - subfunction number
1071
  * ebx = 2 - subfunction number
1061
  * cl = byte for output
1072
  * cl = byte for output
1062
Returned value (is the same for both subfunctions):
1073
Returned value (is the same for both subfunctions):
1063
  * eax = 0 - success
1074
  * eax = 0 - success
1064
  * eax = 1 - base port is not defined
1075
  * eax = 1 - base port is not defined
1065
Remarks:
1076
Remarks:
1066
  * Previously the base port must be defined by 
1077
  * Previously the base port must be defined by 
1067
    subfunction 1 of function 21.
1078
    subfunction 1 of function 21.
1068
 
1079
 
1069
======================================================================
1080
======================================================================
1070
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1081
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1071
======================================================================
1082
======================================================================
1072
Parameters:
1083
Parameters:
1073
  * eax = 21 - function number
1084
  * eax = 21 - function number
1074
  * ebx = 1 - subfunction number
1085
  * ebx = 1 - subfunction number
1075
  * ecx = number of base port
1086
  * ecx = number of base port
1076
Returned value
1087
Returned value
1077
  * eax = 0 - success
1088
  * eax = 0 - success
1078
  * eax = -1 - erratic number of a port
1089
  * eax = -1 - erratic number of a port
1079
Remarks:
1090
Remarks:
1080
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1091
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1081
  * The installation of base is necessary for function 20.
1092
  * The installation of base is necessary for function 20.
1082
  * To get base port use subfunction 1 of function 26.
1093
  * To get base port use subfunction 1 of function 26.
1083
 
1094
 
1084
======================================================================
1095
======================================================================
1085
========== Function 21, subfunction 2 - set keyboard layout. =========
1096
========== Function 21, subfunction 2 - set keyboard layout. =========
1086
======================================================================
1097
======================================================================
1087
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1098
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1088
which will be read by function 2.
1099
which will be read by function 2.
1089
Parameters:
1100
Parameters:
1090
  * eax = 21 - function number
1101
  * eax = 21 - function number
1091
  * ebx = 2 - subfunction number
1102
  * ebx = 2 - subfunction number
1092
  * ecx = which layout to set:
1103
  * ecx = which layout to set:
1093
    * 1 = normal layout
1104
    * 1 = normal layout
1094
    * 2 = layout at pressed Shift
1105
    * 2 = layout at pressed Shift
1095
    * 3 = layout at pressed Alt
1106
    * 3 = layout at pressed Alt
1096
  * edx = pointer to layout - table of length 128 bytes
1107
  * edx = pointer to layout - table of length 128 bytes
1097
Or:
1108
Or:
1098
  * ecx = 9
1109
  * ecx = 9
1099
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1110
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1100
Returned value:
1111
Returned value:
1101
  * eax = 0 - success
1112
  * eax = 0 - success
1102
  * eax = 1 - incorrect parameter
1113
  * eax = 1 - incorrect parameter
1103
Remarks:
1114
Remarks:
1104
  * If Alt is pressed, the layout with Alt is used;
1115
  * If Alt is pressed, the layout with Alt is used;
1105
    if Alt is not pressed, but Shift is pressed,
1116
    if Alt is not pressed, but Shift is pressed,
1106
    the layout with Shift is used;
1117
    the layout with Shift is used;
1107
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1118
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1108
    layout is used and then from the code is subtracted 0x60;
1119
    layout is used and then from the code is subtracted 0x60;
1109
    if no control key is pressed, the normal layout is used.
1120
    if no control key is pressed, the normal layout is used.
1110
  * To get layout and country identifier use 
1121
  * To get layout and country identifier use 
1111
    subfunction 2 of function 26.
1122
    subfunction 2 of function 26.
1112
  * Country identifier is global system variable, which is not used
1123
  * Country identifier is global system variable, which is not used
1113
    by the kernel itself; however the application '@panel' displays
1124
    by the kernel itself; however the application '@panel' displays
1114
    the corresponding icon.
1125
    the corresponding icon.
1115
  * The application @panel switches layouts on user request.
1126
  * The application @panel switches layouts on user request.
1116
 
1127
 
1117
======================================================================
1128
======================================================================
1118
============== Function 21, subfunction 3 - set CD base. =============
1129
============== Function 21, subfunction 3 - set CD base. =============
1119
======================================================================
1130
======================================================================
1120
Parameters:
1131
Parameters:
1121
  * eax = 21 - function number
1132
  * eax = 21 - function number
1122
  * ebx = 3 - subfunction number
1133
  * ebx = 3 - subfunction number
1123
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1134
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1124
Returned value:
1135
Returned value:
1125
  * eax = 0
1136
  * eax = 0
1126
Remarks:
1137
Remarks:
1127
  * CD base is used by function 24.
1138
  * CD base is used by function 24.
1128
  * To get CD base use subfunction 3 of function 26.
1139
  * To get CD base use subfunction 3 of function 26.
1129
 
1140
 
1130
======================================================================
1141
======================================================================
1131
========== Function 21, subfunction 5 - set system language. =========
1142
========== Function 21, subfunction 5 - set system language. =========
1132
======================================================================
1143
======================================================================
1133
Parameters:
1144
Parameters:
1134
  * eax = 21 - function number
1145
  * eax = 21 - function number
1135
  * ebx = 5 - subfunction number
1146
  * ebx = 5 - subfunction number
1136
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1147
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1137
Returned value:
1148
Returned value:
1138
  * eax = 0
1149
  * eax = 0
1139
Remarks:
1150
Remarks:
1140
  * System language is global system variable and is not used
1151
  * System language is global system variable and is not used
1141
    by the kernel itself, however application @panel draws the
1152
    by the kernel itself, however application @panel draws the
1142
    appropriate icon.
1153
    appropriate icon.
1143
  * Function does not check for correctness, as the kernel does not
1154
  * Function does not check for correctness, as the kernel does not
1144
    use this variable.
1155
    use this variable.
1145
  * To get system language use subfunction 5 of function 26.
1156
  * To get system language use subfunction 5 of function 26.
1146
 
1157
 
1147
======================================================================
1158
======================================================================
1148
============== Function 21, subfunction 7 - set HD base. =============
1159
============== Function 21, subfunction 7 - set HD base. =============
1149
======================================================================
1160
======================================================================
1150
The HD base defines hard disk to write with usage of obsolete
1161
The HD base defines hard disk to write with usage of obsolete
1151
syntax /HD in obsolete function 58; at usage of modern syntax
1162
syntax /HD in obsolete function 58; at usage of modern syntax
1152
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1163
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1153
Parameters:
1164
Parameters:
1154
  * eax = 21 - function number
1165
  * eax = 21 - function number
1155
  * ebx = 7 - subfunction number
1166
  * ebx = 7 - subfunction number
1156
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1167
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1157
Returned value:
1168
Returned value:
1158
  * eax = 0
1169
  * eax = 0
1159
Remarks:
1170
Remarks:
1160
  * Any application at any time can change the base.
1171
  * Any application at any time can change the base.
1161
  * Do not change base, when any application works with hard disk.
1172
  * Do not change base, when any application works with hard disk.
1162
    If you do not want system bugs.
1173
    If you do not want system bugs.
1163
  * To get HD base use subfunction 7 of function 26.
1174
  * To get HD base use subfunction 7 of function 26.
1164
  * It is also necessary to define used partition of hard disk by 
1175
  * It is also necessary to define used partition of hard disk by 
1165
    subfunction 8.
1176
    subfunction 8.
1166
 
1177
 
1167
======================================================================
1178
======================================================================
1168
========= Function 21, subfunction 8 - set used HD partition. ========
1179
========= Function 21, subfunction 8 - set used HD partition. ========
1169
======================================================================
1180
======================================================================
1170
The HD partition defines partition of the hard disk to write with
1181
The HD partition defines partition of the hard disk to write with
1171
usage of obsolete syntax /HD and obsolete function 58;
1182
usage of obsolete syntax /HD and obsolete function 58;
1172
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1183
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1173
base and partition are set automatically.
1184
base and partition are set automatically.
1174
Parameters:
1185
Parameters:
1175
  * eax = 21 - function number
1186
  * eax = 21 - function number
1176
  * ebx = 8 - subfunction number
1187
  * ebx = 8 - subfunction number
1177
  * ecx = HD partition (beginning from 1)
1188
  * ecx = HD partition (beginning from 1)
1178
Return value:
1189
Return value:
1179
  * eax = 0
1190
  * eax = 0
1180
Remarks:
1191
Remarks:
1181
  * Any application at any time can change partition.
1192
  * Any application at any time can change partition.
1182
  * Do not change partition when any application works with hard disk.
1193
  * Do not change partition when any application works with hard disk.
1183
    If you do not want system bugs.
1194
    If you do not want system bugs.
1184
  * To get used partition use subfunction 8 of function 26.
1195
  * To get used partition use subfunction 8 of function 26.
1185
  * There is no correctness checks.
1196
  * There is no correctness checks.
1186
  * To get the number of partitions of a hard disk use 
1197
  * To get the number of partitions of a hard disk use 
1187
    subfunction 11 of function 18.
1198
    subfunction 11 of function 18.
1188
  * It is also necessary to define used HD base by subfunction 7.
1199
  * It is also necessary to define used HD base by subfunction 7.
1189
 
1200
 
1190
======================================================================
1201
======================================================================
1191
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1202
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1192
======================================================================
1203
======================================================================
1193
Parameters:
1204
Parameters:
1194
  * eax = 21 - function number
1205
  * eax = 21 - function number
1195
  * ebx = 11 - subfunction number
1206
  * ebx = 11 - subfunction number
1196
  * ecx = 0/1 - disable/enable
1207
  * ecx = 0/1 - disable/enable
1197
Returned value:
1208
Returned value:
1198
  * eax = 0
1209
  * eax = 0
1199
Remarks:
1210
Remarks:
1200
  * Is used in LBA-read (subfunction 8 of function 58).
1211
  * Is used in LBA-read (subfunction 8 of function 58).
1201
  * The current implementation uses only low bit of ecx.
1212
  * The current implementation uses only low bit of ecx.
1202
  * To get current status use subfunction 11 of function 26.
1213
  * To get current status use subfunction 11 of function 26.
1203
 
1214
 
1204
======================================================================
1215
======================================================================
1205
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1216
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1206
======================================================================
1217
======================================================================
1207
Parameters:
1218
Parameters:
1208
  * eax = 21 - function number
1219
  * eax = 21 - function number
1209
  * ebx = 12 - subfunction number
1220
  * ebx = 12 - subfunction number
1210
  * ecx = 0/1 - disable/enable
1221
  * ecx = 0/1 - disable/enable
1211
Returned value:
1222
Returned value:
1212
  * eax = 0
1223
  * eax = 0
1213
Remarks:
1224
Remarks:
1214
  * Is used in operations with PCI bus (function 62).
1225
  * Is used in operations with PCI bus (function 62).
1215
  * The current implementation uses only low bit of ecx.
1226
  * The current implementation uses only low bit of ecx.
1216
  * To get current status use subfunction 12 of function 26.
1227
  * To get current status use subfunction 12 of function 26.
1217
 
1228
 
1218
======================================================================
1229
======================================================================
1219
============ Function 21, subfunction 13, subsubfunction 1 ===========
1230
============ Function 21, subfunction 13, subsubfunction 1 ===========
1220
======== Initialize + get information on the driver vmode.mdr. =======
1231
======== Initialize + get information on the driver vmode.mdr. =======
1221
======================================================================
1232
======================================================================
1222
Parameters:
1233
Parameters:
1223
  * eax = 21 - function number
1234
  * eax = 21 - function number
1224
  * ebx = 13 - subfunction number
1235
  * ebx = 13 - subfunction number
1225
  * ecx = 1 - number of the driver function
1236
  * ecx = 1 - number of the driver function
1226
  * edx = pointer to 512-bytes buffer
1237
  * edx = pointer to 512-bytes buffer
1227
Returned value:
1238
Returned value:
1228
  * if driver is not loaded
1239
  * if driver is not loaded
1229
    (never happens in the current implementation):
1240
    (never happens in the current implementation):
1230
    * eax = -1
1241
    * eax = -1
1231
    * ebx, ecx destroyed
1242
    * ebx, ecx destroyed
1232
  * if driver is loaded:
1243
  * if driver is loaded:
1233
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1244
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1234
      - signature
1245
      - signature
1235
    * ebx = current frequency of the scanning (in Hz)
1246
    * ebx = current frequency of the scanning (in Hz)
1236
    * ecx destroyed
1247
    * ecx destroyed
1237
    * buffer pointed to by edx is filled
1248
    * buffer pointed to by edx is filled
1238
Format of the buffer:
1249
Format of the buffer:
1239
  * +0: 32*byte: driver name, "Trans VideoDriver"
1250
  * +0: 32*byte: driver name, "Trans VideoDriver"
1240
    (without quotes, supplemented by spaces)
1251
    (without quotes, supplemented by spaces)
1241
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1252
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1242
    y*65536+x), for the current implementation is 1 (1.0)
1253
    y*65536+x), for the current implementation is 1 (1.0)
1243
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1254
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1244
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1255
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1245
    is number of a videomode, after list itself there are zeroes)
1256
    is number of a videomode, after list itself there are zeroes)
1246
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1257
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1247
    scannings for videomodes: for each videomode listed in the
1258
    scannings for videomodes: for each videomode listed in the
1248
    previous field up to 5 supported frequences are given
1259
    previous field up to 5 supported frequences are given
1249
    (unused positions contain zeroes)
1260
    (unused positions contain zeroes)
1250
Remarks:
1261
Remarks:
1251
  * Function initializes the driver (if it is not initialized yet)
1262
  * Function initializes the driver (if it is not initialized yet)
1252
    and must be called first, before others (otherwise they will do
1263
    and must be called first, before others (otherwise they will do
1253
    nothing and return -1).
1264
    nothing and return -1).
1254
  * The current implementation supports only one frequency
1265
  * The current implementation supports only one frequency
1255
    of the scanning on videomode.
1266
    of the scanning on videomode.
1256
 
1267
 
1257
======================================================================
1268
======================================================================
1258
============ Function 21, subfunction 13, subsubfunction 2 ===========
1269
============ Function 21, subfunction 13, subsubfunction 2 ===========
1259
================ Get information on current videomode. ===============
1270
================ Get information on current videomode. ===============
1260
======================================================================
1271
======================================================================
1261
Parameters:
1272
Parameters:
1262
  * eax = 21 - function number
1273
  * eax = 21 - function number
1263
  * ebx = 13 - subfunction number
1274
  * ebx = 13 - subfunction number
1264
  * ecx = 2 - number of the driver function
1275
  * ecx = 2 - number of the driver function
1265
Returned value:
1276
Returned value:
1266
  * eax = -1 - driver is not loaded or not initialized;
1277
  * eax = -1 - driver is not loaded or not initialized;
1267
    ebx,ecx are destroyed
1278
    ebx,ecx are destroyed
1268
  * eax = [width]*65536 + [height]
1279
  * eax = [width]*65536 + [height]
1269
  * ebx = frequency of the vertical scanning (in Hz)
1280
  * ebx = frequency of the vertical scanning (in Hz)
1270
  * ecx = number of current videomode
1281
  * ecx = number of current videomode
1271
Remarks:
1282
Remarks:
1272
  * Driver must be initialized by call to 
1283
  * Driver must be initialized by call to 
1273
    driver function 1.
1284
    driver function 1.
1274
  * If only screen sizes are required, it is more expedient to use
1285
  * If only screen sizes are required, it is more expedient to use
1275
    function 14 taking into account that it
1286
    function 14 taking into account that it
1276
    returns sizes on 1 less.
1287
    returns sizes on 1 less.
1277
 
1288
 
1278
======================================================================
1289
======================================================================
1279
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1290
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1280
======================================================================
1291
======================================================================
1281
Parameters:
1292
Parameters:
1282
  * eax = 21 - function number
1293
  * eax = 21 - function number
1283
  * ebx = 13 - subfunction number
1294
  * ebx = 13 - subfunction number
1284
  * ecx = 3 - number of the driver function
1295
  * ecx = 3 - number of the driver function
1285
  * edx = [scanning frequency]*65536 + [videomode number]
1296
  * edx = [scanning frequency]*65536 + [videomode number]
1286
Returned value:
1297
Returned value:
1287
  * eax = -1 - driver is not loaded, not initialized or
1298
  * eax = -1 - driver is not loaded, not initialized or
1288
    an error has occured
1299
    an error has occured
1289
  * eax = 0 - success
1300
  * eax = 0 - success
1290
  * ebx, ecx destroyed
1301
  * ebx, ecx destroyed
1291
Remarks:
1302
Remarks:
1292
  * Driver must be initialized by driver function 1.
1303
  * Driver must be initialized by driver function 1.
1293
  * The videomode number and frequency must be in the table
1304
  * The videomode number and frequency must be in the table
1294
    returned by driver function 1.
1305
    returned by driver function 1.
1295
 
1306
 
1296
======================================================================
1307
======================================================================
1297
============ Function 21, subfunction 13, subsubfunction 4 ===========
1308
============ Function 21, subfunction 13, subsubfunction 4 ===========
1298
================== Return to the initial videomode. ==================
1309
================== Return to the initial videomode. ==================
1299
======================================================================
1310
======================================================================
1300
Returns the screen to the videomode set at system boot.
1311
Returns the screen to the videomode set at system boot.
1301
Parameters:
1312
Parameters:
1302
  * eax = 21 - function number
1313
  * eax = 21 - function number
1303
  * ebx = 13 - subfunction number
1314
  * ebx = 13 - subfunction number
1304
  * ecx = 4 - number of the driver function
1315
  * ecx = 4 - number of the driver function
1305
Returned value:
1316
Returned value:
1306
  * eax = -1 - driver is not loaded or not initialized
1317
  * eax = -1 - driver is not loaded or not initialized
1307
  * eax = 0 - success
1318
  * eax = 0 - success
1308
  * ebx, ecx destroyed
1319
  * ebx, ecx destroyed
1309
Remarks:
1320
Remarks:
1310
  * Driver must be initialized by call to driver function 1.
1321
  * Driver must be initialized by call to driver function 1.
1311
 
1322
 
1312
======================================================================
1323
======================================================================
1313
============ Function 21, subfunction 13, subsubfunction 5 ===========
1324
============ Function 21, subfunction 13, subsubfunction 5 ===========
1314
===== Increase/decrease the size of the visible area of monitor. =====
1325
===== Increase/decrease the size of the visible area of monitor. =====
1315
======================================================================
1326
======================================================================
1316
Parameters:
1327
Parameters:
1317
  * eax = 21 - function number
1328
  * eax = 21 - function number
1318
  * ebx = 13 - subfunction number
1329
  * ebx = 13 - subfunction number
1319
  * ecx = 5 - number of the driver function
1330
  * ecx = 5 - number of the driver function
1320
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1331
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1321
  * edx = 2/3 - is not supported in the current implementation;
1332
  * edx = 2/3 - is not supported in the current implementation;
1322
    is planned as decrease/increase vertical size on 1 position
1333
    is planned as decrease/increase vertical size on 1 position
1323
Returned value:
1334
Returned value:
1324
  * eax = -1 - driver is not loaded or not initialized
1335
  * eax = -1 - driver is not loaded or not initialized
1325
  * eax = 0 - success
1336
  * eax = 0 - success
1326
  * ebx, ecx destroyed
1337
  * ebx, ecx destroyed
1327
Remarks:
1338
Remarks:
1328
  * Driver must be initialized by call to driver function 1.
1339
  * Driver must be initialized by call to driver function 1.
1329
  * Function influences only the physical size of the screen image;
1340
  * Function influences only the physical size of the screen image;
1330
    the logical size (number of pixels) does not change.
1341
    the logical size (number of pixels) does not change.
1331
 
1342
 
1332
======================================================================
1343
======================================================================
1333
================= Function 22 - set system date/time. ================
1344
================= Function 22 - set system date/time. ================
1334
======================================================================
1345
======================================================================
1335
Parameters:
1346
Parameters:
1336
  * eax = 22 - function number
1347
  * eax = 22 - function number
1337
  * ebx = 0 - set time
1348
  * ebx = 0 - set time
1338
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1349
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1339
    * HH=hour 00..23
1350
    * HH=hour 00..23
1340
    * MM=minute 00..59
1351
    * MM=minute 00..59
1341
    * SS=second 00..59
1352
    * SS=second 00..59
1342
  * ebx = 1 - set date
1353
  * ebx = 1 - set date
1343
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1354
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1344
    * DD=day 01..31
1355
    * DD=day 01..31
1345
    * MM=month 01..12
1356
    * MM=month 01..12
1346
    * YY=year 00..99
1357
    * YY=year 00..99
1347
  * ebx = 2 - set day of week
1358
  * ebx = 2 - set day of week
1348
    * ecx = 1 for Sunday, ..., 7 for Saturday
1359
    * ecx = 1 for Sunday, ..., 7 for Saturday
1349
  * ebx = 3 - set alarm clock
1360
  * ebx = 3 - set alarm clock
1350
    * ecx = 0x00SSMMHH
1361
    * ecx = 0x00SSMMHH
1351
Returned value:
1362
Returned value:
1352
  * eax = 0 - success
1363
  * eax = 0 - success
1353
  * eax = 1 - incorrect parameter
1364
  * eax = 1 - incorrect parameter
1354
  * eax = 2 - CMOS-battery was unloaded
1365
  * eax = 2 - CMOS-battery was unloaded
1355
Remarks:
1366
Remarks:
1356
  * Value of installation of day of week seems to be doubtful,
1367
  * Value of installation of day of week seems to be doubtful,
1357
    as it a little where is used
1368
    as it a little where is used
1358
    (day of week can be calculated by date).
1369
    (day of week can be calculated by date).
1359
  * Alarm clock can be set on operation in the given time every day.
1370
  * Alarm clock can be set on operation in the given time every day.
1360
    But there is no existing system function to disable it.
1371
    But there is no existing system function to disable it.
1361
  * Operation of alarm clock consists in generation IRQ8.
1372
  * Operation of alarm clock consists in generation IRQ8.
1362
  * Generally CMOS supports for alarm clock set of value 0xFF
1373
  * Generally CMOS supports for alarm clock set of value 0xFF
1363
    as one of parameters and it means that the appropriate parameter
1374
    as one of parameters and it means that the appropriate parameter
1364
    is ignored. But current implementation does not allow this
1375
    is ignored. But current implementation does not allow this
1365
    (will return 1).
1376
    (will return 1).
1366
  * Alarm clock is a global system resource; the set of
1377
  * Alarm clock is a global system resource; the set of
1367
    an alarm clock cancels automatically the previous set.
1378
    an alarm clock cancels automatically the previous set.
1368
    However, at moment no program uses it.
1379
    However, at moment no program uses it.
1369
 
1380
 
1370
======================================================================
1381
======================================================================
1371
============= Function 23 - wait for event with timeout. =============
1382
============= Function 23 - wait for event with timeout. =============
1372
======================================================================
1383
======================================================================
1373
If the message queue is empty, waits for new message in the queue,
1384
If the message queue is empty, waits for new message in the queue,
1374
but no more than given time. Then reads out a message from the queue.
1385
but no more than given time. Then reads out a message from the queue.
1375
 
1386
 
1376
Parameters:
1387
Parameters:
1377
  * eax = 23 - function number
1388
  * eax = 23 - function number
1378
  * ebx = timeout (in 1/100 of second)
1389
  * ebx = timeout (in 1/100 of second)
1379
Returned value:
1390
Returned value:
1380
  * eax = 0 - the message queue is empty
1391
  * eax = 0 - the message queue is empty
1381
  * otherwise eax = event (see the list of events)
1392
  * otherwise eax = event (see the list of events)
1382
Remarks:
1393
Remarks:
1383
  * Only those events are taken into account, which enter into
1394
  * Only those events are taken into account, which enter into
1384
    the mask set by function 40. By default it is
1395
    the mask set by function 40. By default it is
1385
    redraw, key and button events.
1396
    redraw, key and button events.
1386
  * To check for presence of a message in the queue use function 11.
1397
  * To check for presence of a message in the queue use function 11.
1387
    To wait without timeout use function 10.
1398
    To wait without timeout use function 10.
1388
  * Transmission ebx=0 results in immediate returning eax=0.
1399
  * Transmission ebx=0 results in immediate returning eax=0.
1389
  * Current implementation returns immediately with eax=0,
1400
  * Current implementation returns immediately with eax=0,
1390
    if the addition of ebx with the current value of time counter
1401
    if the addition of ebx with the current value of time counter
1391
    makes 32-bit overflow.
1402
    makes 32-bit overflow.
1392
 
1403
 
1393
======================================================================
1404
======================================================================
1394
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1405
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1395
======================================================================
1406
======================================================================
1396
Parameters:
1407
Parameters:
1397
  * eax = 24 - function number
1408
  * eax = 24 - function number
1398
  * ebx = 1 - subfunction number
1409
  * ebx = 1 - subfunction number
1399
  * ecx = 0x00FRSSMM, where
1410
  * ecx = 0x00FRSSMM, where
1400
    * MM = starting minute
1411
    * MM = starting minute
1401
    * SS = starting second
1412
    * SS = starting second
1402
    * FR = starting frame
1413
    * FR = starting frame
1403
Returned value:
1414
Returned value:
1404
  * eax = 0 - success
1415
  * eax = 0 - success
1405
  * eax = 1 - CD base is not defined
1416
  * eax = 1 - CD base is not defined
1406
Remarks:
1417
Remarks:
1407
  * Previously CD base must be defined by the call to 
1418
  * Previously CD base must be defined by the call to 
1408
    subfunction 3 of function 21.
1419
    subfunction 3 of function 21.
1409
  * One second includes 75 frames, one minute includes 60 seconds.
1420
  * One second includes 75 frames, one minute includes 60 seconds.
1410
  * The function is asynchronous (returns control, when play begins).
1421
  * The function is asynchronous (returns control, when play begins).
1411
 
1422
 
1412
======================================================================
1423
======================================================================
1413
======= Function 24, subfunction 2 - get information on tracks. ======
1424
======= Function 24, subfunction 2 - get information on tracks. ======
1414
======================================================================
1425
======================================================================
1415
Parameters:
1426
Parameters:
1416
  * eax = 24 - function number
1427
  * eax = 24 - function number
1417
  * ebx = 2 - subfunction number
1428
  * ebx = 2 - subfunction number
1418
  * ecx = pointer to the buffer for the table
1429
  * ecx = pointer to the buffer for the table
1419
    (maximum 8*64h+4 bytes=100 tracks)
1430
    (maximum 8*64h+4 bytes=100 tracks)
1420
Returned value:
1431
Returned value:
1421
  * eax = 0 - success
1432
  * eax = 0 - success
1422
  * eax = 1 - CD base is not defined
1433
  * eax = 1 - CD base is not defined
1423
Remarks:
1434
Remarks:
1424
  * The format of the table with tracks information is the same as
1435
  * The format of the table with tracks information is the same as
1425
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1436
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1426
    Function returns addresses in MSF.
1437
    Function returns addresses in MSF.
1427
  * Previously CD base port must be set by call to 
1438
  * Previously CD base port must be set by call to 
1428
    subfunction 3 of function 21.
1439
    subfunction 3 of function 21.
1429
  * Function returns information only about no more than 100
1440
  * Function returns information only about no more than 100
1430
    first tracks. In most cases it is enough.
1441
    first tracks. In most cases it is enough.
1431
 
1442
 
1432
======================================================================
1443
======================================================================
1433
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1444
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1434
======================================================================
1445
======================================================================
1435
Parameters:
1446
Parameters:
1436
  * eax = 24 - function number
1447
  * eax = 24 - function number
1437
  * ebx = 1 - subfunction number
1448
  * ebx = 1 - subfunction number
1438
Returned value:
1449
Returned value:
1439
  * eax = 0 - success
1450
  * eax = 0 - success
1440
  * eax = 1 - CD base is not defined
1451
  * eax = 1 - CD base is not defined
1441
Remarks:
1452
Remarks:
1442
  * Previously CD base port must be defined by call to 
1453
  * Previously CD base port must be defined by call to 
1443
    subfunction 3 of function 21.
1454
    subfunction 3 of function 21.
1444
 
1455
 
1445
======================================================================
1456
======================================================================
1446
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1457
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1447
======================================================================
1458
======================================================================
1448
Parameters:
1459
Parameters:
1449
  * eax = 24 - function number
1460
  * eax = 24 - function number
1450
  * ebx = 4 - subfunction number
1461
  * ebx = 4 - subfunction number
1451
  * ecx = position of CD/DVD-drive
1462
  * ecx = position of CD/DVD-drive
1452
      (from 0=Primary Master to 3=Secondary Slave)
1463
      (from 0=Primary Master to 3=Secondary Slave)
1453
Returned value:
1464
Returned value:
1454
  * function does not return value
1465
  * function does not return value
1455
Remarks:
1466
Remarks:
1456
  * The function is supported only for ATAPI devices (CD and DVD).
1467
  * The function is supported only for ATAPI devices (CD and DVD).
1457
  * When the tray is being ejected,
1468
  * When the tray is being ejected,
1458
    manual control of tray is unlocked.
1469
    manual control of tray is unlocked.
1459
  * When the tray is being ejected, the code clears the cache for
1470
  * When the tray is being ejected, the code clears the cache for
1460
    corresponding device.
1471
    corresponding device.
1461
  * An example of usage of the function is the application CD_tray.
1472
  * An example of usage of the function is the application CD_tray.
1462
 
1473
 
1463
======================================================================
1474
======================================================================
1464
======== Function 24, subfunction 5 - load tray of disk drive. =======
1475
======== Function 24, subfunction 5 - load tray of disk drive. =======
1465
======================================================================
1476
======================================================================
1466
Parameters:
1477
Parameters:
1467
  * eax = 24 - function number
1478
  * eax = 24 - function number
1468
  * ebx = 5 - subfunction number
1479
  * ebx = 5 - subfunction number
1469
  * ecx = position of CD/DVD-drive
1480
  * ecx = position of CD/DVD-drive
1470
      (from 0=Primary Master to 3=Secondary Slave)
1481
      (from 0=Primary Master to 3=Secondary Slave)
1471
Returned value:
1482
Returned value:
1472
  * function does not return value
1483
  * function does not return value
1473
Remarks:
1484
Remarks:
1474
  * The function is supported only for ATAPI devices (CD and DVD).
1485
  * The function is supported only for ATAPI devices (CD and DVD).
1475
  * An example of usage of the function is the application CD_tray.
1486
  * An example of usage of the function is the application CD_tray.
1476
 
1487
 
1477
======================================================================
1488
======================================================================
1478
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1489
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1479
======================================================================
1490
======================================================================
1480
Parameters:
1491
Parameters:
1481
  * eax = 26 - function number
1492
  * eax = 26 - function number
1482
  * ebx = 1 - subfunction number
1493
  * ebx = 1 - subfunction number
1483
Returned value:
1494
Returned value:
1484
  * eax = port number
1495
  * eax = port number
1485
Parameters:
1496
Parameters:
1486
  * To set base port use subfunction 1 of function 21.
1497
  * To set base port use subfunction 1 of function 21.
1487
 
1498
 
1488
======================================================================
1499
======================================================================
1489
========== Function 26, subfunction 2 - get keyboard layout. =========
1500
========== Function 26, subfunction 2 - get keyboard layout. =========
1490
======================================================================
1501
======================================================================
1491
The keyboard layout is used to convert keyboard scancodes to
1502
The keyboard layout is used to convert keyboard scancodes to
1492
ASCII-codes for function 2.
1503
ASCII-codes for function 2.
1493
Parameters:
1504
Parameters:
1494
  * eax = 26 - function number
1505
  * eax = 26 - function number
1495
  * ebx = 2 - subfunction number
1506
  * ebx = 2 - subfunction number
1496
  * ecx = what layout to get:
1507
  * ecx = what layout to get:
1497
    * 1 = normal layout
1508
    * 1 = normal layout
1498
    * 2 = layout with pressed Shift
1509
    * 2 = layout with pressed Shift
1499
    * 3 = layout with pressed Alt
1510
    * 3 = layout with pressed Alt
1500
  * edx = pointer to the 128-bytes buffer, where the layout will be
1511
  * edx = pointer to the 128-bytes buffer, where the layout will be
1501
    copied
1512
    copied
1502
Returned value:
1513
Returned value:
1503
  * function does not return value
1514
  * function does not return value
1504
Or:
1515
Or:
1505
  * eax = 26 - function number
1516
  * eax = 26 - function number
1506
  * ebx = 2 - subfunction number
1517
  * ebx = 2 - subfunction number
1507
  * ecx = 9
1518
  * ecx = 9
1508
Returned value:
1519
Returned value:
1509
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1520
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1510
Remarks:
1521
Remarks:
1511
  * If Alt is pressed, the layout with Alt is used;
1522
  * If Alt is pressed, the layout with Alt is used;
1512
    if Alt is not pressed, but Shift is pressed,
1523
    if Alt is not pressed, but Shift is pressed,
1513
    the layout with Shift is used;
1524
    the layout with Shift is used;
1514
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1525
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1515
    layout is used and then from the code is subtracted 0x60;
1526
    layout is used and then from the code is subtracted 0x60;
1516
    if no control key is pressed, the normal layout is used.
1527
    if no control key is pressed, the normal layout is used.
1517
  * To set layout and country identifier use 
1528
  * To set layout and country identifier use 
1518
    subfunction 2 of function 21.
1529
    subfunction 2 of function 21.
1519
  * Country identifier is global system variable, which is not used
1530
  * Country identifier is global system variable, which is not used
1520
    by the kernel itself; however the application '@panel' displays
1531
    by the kernel itself; however the application '@panel' displays
1521
    the corresponding icon (using this function).
1532
    the corresponding icon (using this function).
1522
  * The application @panel switches layouts on user request.
1533
  * The application @panel switches layouts on user request.
1523
 
1534
 
1524
======================================================================
1535
======================================================================
1525
============== Function 26, subfunction 3 - get CD base. =============
1536
============== Function 26, subfunction 3 - get CD base. =============
1526
======================================================================
1537
======================================================================
1527
Parameters:
1538
Parameters:
1528
  * eax = 26 - function number
1539
  * eax = 26 - function number
1529
  * ebx = 3 - subfunction number
1540
  * ebx = 3 - subfunction number
1530
Returned value:
1541
Returned value:
1531
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1542
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1532
Remarks:
1543
Remarks:
1533
  * CD base is used by function 24.
1544
  * CD base is used by function 24.
1534
  * To set CD base use subfunction 3 of function 21.
1545
  * To set CD base use subfunction 3 of function 21.
1535
 
1546
 
1536
======================================================================
1547
======================================================================
1537
========== Function 26, subfunction 5 - get system language. =========
1548
========== Function 26, subfunction 5 - get system language. =========
1538
======================================================================
1549
======================================================================
1539
Parameters:
1550
Parameters:
1540
  * eax = 26 - function number
1551
  * eax = 26 - function number
1541
  * ebx = 5 - subfunction number
1552
  * ebx = 5 - subfunction number
1542
Returned value:
1553
Returned value:
1543
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1554
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1544
Remarks:
1555
Remarks:
1545
  * System language is global system variable and is not used
1556
  * System language is global system variable and is not used
1546
    by the kernel itself, however application @panel draws the
1557
    by the kernel itself, however application @panel draws the
1547
    appropriate icon (using this function).
1558
    appropriate icon (using this function).
1548
  * To set system language use subfunction 5 of function 21.
1559
  * To set system language use subfunction 5 of function 21.
1549
 
1560
 
1550
======================================================================
1561
======================================================================
1551
============== Function 26, subfunction 7 - get HD base. =============
1562
============== Function 26, subfunction 7 - get HD base. =============
1552
======================================================================
1563
======================================================================
1553
The HD base defines hard disk to write with usage of obsolete
1564
The HD base defines hard disk to write with usage of obsolete
1554
syntax /HD in obsolete function 58; at usage of modern syntax
1565
syntax /HD in obsolete function 58; at usage of modern syntax
1555
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1566
/HD0,/HD1,/HD2,/HD3 base is set automatically.
1556
Parameters:
1567
Parameters:
1557
  * eax = 26 - function number
1568
  * eax = 26 - function number
1558
  * ebx = 7 - subfunction number
1569
  * ebx = 7 - subfunction number
1559
Returned value:
1570
Returned value:
1560
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1571
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1561
Remarks:
1572
Remarks:
1562
  * Any application in any time can change HD base.
1573
  * Any application in any time can change HD base.
1563
  * To set base use subfunction 7 of function 21.
1574
  * To set base use subfunction 7 of function 21.
1564
  * To get used partition of hard disk use subfunction 8.
1575
  * To get used partition of hard disk use subfunction 8.
1565
 
1576
 
1566
======================================================================
1577
======================================================================
1567
========= Function 26, subfunction 8 - get used HD partition. ========
1578
========= Function 26, subfunction 8 - get used HD partition. ========
1568
======================================================================
1579
======================================================================
1569
The HD partition defines partition of the hard disk to write with
1580
The HD partition defines partition of the hard disk to write with
1570
usage of obsolete syntax /HD in obsolete function 58;
1581
usage of obsolete syntax /HD in obsolete function 58;
1571
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1582
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1572
base and partition are set automatically.
1583
base and partition are set automatically.
1573
Parameters:
1584
Parameters:
1574
  * eax = 26 - function number
1585
  * eax = 26 - function number
1575
  * ebx = 8 - subfunction number
1586
  * ebx = 8 - subfunction number
1576
Returned value:
1587
Returned value:
1577
  * eax = HD partition (beginning from 1)
1588
  * eax = HD partition (beginning from 1)
1578
Remarks:
1589
Remarks:
1579
  * Any application in any time can change partition.
1590
  * Any application in any time can change partition.
1580
  * To set partition use subfunction 8 of function 21.
1591
  * To set partition use subfunction 8 of function 21.
1581
  * To get number of partitions on a hard disk use
1592
  * To get number of partitions on a hard disk use
1582
    subfunction 11 of function 18.
1593
    subfunction 11 of function 18.
1583
  * To get base of used hard disk, use subfunction 7.
1594
  * To get base of used hard disk, use subfunction 7.
1584
 
1595
 
1585
======================================================================
1596
======================================================================
1586
=== Function 26, subfunction 9 - get the value of the time counter. ==
1597
=== Function 26, subfunction 9 - get the value of the time counter. ==
1587
======================================================================
1598
======================================================================
1588
Parameters:
1599
Parameters:
1589
  * eax = 26 - function number
1600
  * eax = 26 - function number
1590
  * ebx = 9 - subfunction number
1601
  * ebx = 9 - subfunction number
1591
Returned value:
1602
Returned value:
1592
  * eax = number of 1/100s of second, past from the system boot time
1603
  * eax = number of 1/100s of second, past from the system boot time
1593
Remarks:
1604
Remarks:
1594
  * Counter takes modulo 2^32, that correspond to a little more
1605
  * Counter takes modulo 2^32, that correspond to a little more
1595
    than 497 days.
1606
    than 497 days.
1596
  * To get system time use function 3.
1607
  * To get system time use function 3.
1597
 
1608
 
1598
======================================================================
1609
======================================================================
1599
===================== Function 26, subfunction 11 ====================
1610
===================== Function 26, subfunction 11 ====================
1600
========== Find out whether low-level HD access is enabled. ==========
1611
========== Find out whether low-level HD access is enabled. ==========
1601
======================================================================
1612
======================================================================
1602
Parameters:
1613
Parameters:
1603
  * eax = 26 - function number
1614
  * eax = 26 - function number
1604
  * ebx = 11 - subfunction number
1615
  * ebx = 11 - subfunction number
1605
Returned value:
1616
Returned value:
1606
  * eax = 0/1 - disabled/enabled
1617
  * eax = 0/1 - disabled/enabled
1607
Remarks:
1618
Remarks:
1608
  * Is used in LBA read (subfunction 8 of function 58).
1619
  * Is used in LBA read (subfunction 8 of function 58).
1609
  * To set current state use subfunction 11 of function 21.
1620
  * To set current state use subfunction 11 of function 21.
1610
 
1621
 
1611
======================================================================
1622
======================================================================
1612
===================== Function 26, subfunction 12 ====================
1623
===================== Function 26, subfunction 12 ====================
1613
========== Find out whether low-level PCI access is enabled. =========
1624
========== Find out whether low-level PCI access is enabled. =========
1614
======================================================================
1625
======================================================================
1615
Parameters:
1626
Parameters:
1616
  * eax = 26 - function number
1627
  * eax = 26 - function number
1617
  * ebx = 12 - subfunction number
1628
  * ebx = 12 - subfunction number
1618
Returned value:
1629
Returned value:
1619
  * eax = 0/1 - disabled/enabled
1630
  * eax = 0/1 - disabled/enabled
1620
Remarks:
1631
Remarks:
1621
  * Is used by operations with PCI bus (function 62).
1632
  * Is used by operations with PCI bus (function 62).
1622
  * The current implementation uses only low bit of ecx.
1633
  * The current implementation uses only low bit of ecx.
1623
  * To set the current state use subfunction 12 of function 21.
1634
  * To set the current state use subfunction 12 of function 21.
1624
 
1635
 
1625
======================================================================
1636
======================================================================
1626
=================== Function 29 - get system date. ===================
1637
=================== Function 29 - get system date. ===================
1627
======================================================================
1638
======================================================================
1628
Parameters:
1639
Parameters:
1629
  * eax = 29 - function number
1640
  * eax = 29 - function number
1630
Returned value:
1641
Returned value:
1631
  * eax = 0x00DDMMYY, where
1642
  * eax = 0x00DDMMYY, where
1632
    (binary-decimal coding, BCD, is used)
1643
    (binary-decimal coding, BCD, is used)
1633
  * YY = two low digits of year (00..99)
1644
  * YY = two low digits of year (00..99)
1634
  * MM = month (01..12)
1645
  * MM = month (01..12)
1635
  * DD = day (01..31)
1646
  * DD = day (01..31)
1636
Remarks:
1647
Remarks:
1637
  * To set system date use function 22.
1648
  * To set system date use function 22.
1638
 
1649
 
1639
======================================================================
1650
======================================================================
1640
============= Function 30 - work with the current folder. ============
1651
============= Function 30 - work with the current folder. ============
1641
======================================================================
1652
======================================================================
1642
 
1653
 
1643
--------- Subfunction 1 - set current folder for the thread. ---------
1654
--------- Subfunction 1 - set current folder for the thread. ---------
1644
Parameters:
1655
Parameters:
1645
  * eax = 30 - function number
1656
  * eax = 30 - function number
1646
  * ebx = 1 - subfunction number
1657
  * ebx = 1 - subfunction number
1647
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1658
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1648
Returned value:
1659
Returned value:
1649
  * function does not return value
1660
  * function does not return value
1650
 
1661
 
1651
--------- Subfunction 2 - get current folder for the thread. ---------
1662
--------- Subfunction 2 - get current folder for the thread. ---------
1652
Parameters:
1663
Parameters:
1653
  * eax = 30 - function number
1664
  * eax = 30 - function number
1654
  * ebx = 2 - subfunction number
1665
  * ebx = 2 - subfunction number
1655
  * ecx = pointer to buffer
1666
  * ecx = pointer to buffer
1656
  * edx = size of buffer
1667
  * edx = size of buffer
1657
Returned value:
1668
Returned value:
1658
  * eax = size of the current folder's name (including terminating 0)
1669
  * eax = size of the current folder's name (including terminating 0)
1659
Remarks:
1670
Remarks:
1660
  * If the buffer is too small to hold all data, only first (edx-1)
1671
  * If the buffer is too small to hold all data, only first (edx-1)
1661
    bytes are copied and than terminating 0 is inserted.
1672
    bytes are copied and than terminating 0 is inserted.
1662
  * By default, current folder for the thread is "/rd/1".
1673
  * By default, current folder for the thread is "/rd/1".
1663
  * At process/thread creation the current folder will be inherited 
1674
  * At process/thread creation the current folder will be inherited 
1664
    from the parent.
1675
    from the parent.
1665
 
1676
 
1666
======================================================================
1677
======================================================================
1667
======= Function 35 - read the color of a pixel on the screen. =======
1678
======= Function 35 - read the color of a pixel on the screen. =======
1668
======================================================================
1679
======================================================================
1669
Parameters:
1680
Parameters:
1670
  * eax = 35
1681
  * eax = 35
1671
  * ebx = y*xsize+x, where
1682
  * ebx = y*xsize+x, where
1672
  * (x,y) = coordinates of a pixel (beginning from 0)
1683
  * (x,y) = coordinates of a pixel (beginning from 0)
1673
  * xsize = horizontal screen size
1684
  * xsize = horizontal screen size
1674
Returned value:
1685
Returned value:
1675
  * eax = color 0x00RRGGBB
1686
  * eax = color 0x00RRGGBB
1676
Remarks:
1687
Remarks:
1677
  * To get screen sizes use function 14. Pay attention,
1688
  * To get screen sizes use function 14. Pay attention,
1678
    that it subtracts 1 from both sizes.
1689
    that it subtracts 1 from both sizes.
1679
  * There is also direct access (without any system calls)
1690
  * There is also direct access (without any system calls)
1680
    to videomemory through the selector gs. To get parameters of
1691
    to videomemory through the selector gs. To get parameters of
1681
    the current videomode, use function 61.
1692
    the current videomode, use function 61.
1682
 
1693
 
1683
======================================================================
1694
======================================================================
1684
=================== Function 36 - read screen area. ==================
1695
=================== Function 36 - read screen area. ==================
1685
======================================================================
1696
======================================================================
1686
Paramters:
1697
Paramters:
1687
  * eax = 36 - function number
1698
  * eax = 36 - function number
1688
  * ebx = pointer to the previously allocated memory area,
1699
  * ebx = pointer to the previously allocated memory area,
1689
        where will be placed the image in the format BBGGRRBBGGRR...
1700
        where will be placed the image in the format BBGGRRBBGGRR...
1690
  * ecx = [size on axis x]*65536 + [size on axis y]
1701
  * ecx = [size on axis x]*65536 + [size on axis y]
1691
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1702
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1692
Returned value:
1703
Returned value:
1693
  * function does not return value
1704
  * function does not return value
1694
Remarks:
1705
Remarks:
1695
  * Coordinates of the image are coordinates of the upper left corner
1706
  * Coordinates of the image are coordinates of the upper left corner
1696
    of the image relative to the screen.
1707
    of the image relative to the screen.
1697
  * Size of the image in bytes is 3*xsize*ysize.
1708
  * Size of the image in bytes is 3*xsize*ysize.
1698
 
1709
 
1699
======================================================================
1710
======================================================================
1700
=================== Function 37 - work with mouse. ===================
1711
=================== Function 37 - work with mouse. ===================
1701
======================================================================
1712
======================================================================
1702
 
1713
 
1703
---------- Subfunction 0 - screen coordinates of the mouse -----------
1714
---------- Subfunction 0 - screen coordinates of the mouse -----------
1704
Parameters:
1715
Parameters:
1705
  * eax = 37 - function number
1716
  * eax = 37 - function number
1706
  * ebx = 0 - subfunction number
1717
  * ebx = 0 - subfunction number
1707
Returned value:
1718
Returned value:
1708
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1719
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1709
    (beginning from 0)
1720
    (beginning from 0)
1710
 
1721
 
1711
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1722
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1712
Parameters:
1723
Parameters:
1713
  * eax = 37 - function number
1724
  * eax = 37 - function number
1714
  * ebx = 1 - subfunction number
1725
  * ebx = 1 - subfunction number
1715
Returned value:
1726
Returned value:
1716
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1727
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1717
    relative to the application window (beginning from 0)
1728
    relative to the application window (beginning from 0)
1718
Remarks:
1729
Remarks:
1719
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1730
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1720
    If y>=ywnd, the low word is non-negative and contains
1731
    If y>=ywnd, the low word is non-negative and contains
1721
    relative y-coordinate, and the high word - relative x-coordinate
1732
    relative y-coordinate, and the high word - relative x-coordinate
1722
    (with correct sign). Otherwise the low word is negative and still
1733
    (with correct sign). Otherwise the low word is negative and still
1723
    contains relative y-coordinate, and to the high word
1734
    contains relative y-coordinate, and to the high word
1724
    1 should be added.
1735
    1 should be added.
1725
 
1736
 
1726
------------ Subfunction 2 - pressed buttons of the mouse ------------
1737
------------ Subfunction 2 - pressed buttons of the mouse ------------
1727
Parameters:
1738
Parameters:
1728
  * eax = 37 - function number
1739
  * eax = 37 - function number
1729
  * ebx = 2 - subfunction number
1740
  * ebx = 2 - subfunction number
1730
Returned value:
1741
Returned value:
1731
  * eax contains information on the pressed mouse buttons:
1742
  * eax contains information on the pressed mouse buttons:
1732
  * bit 0 is set = left button is pressed
1743
  * bit 0 is set = left button is pressed
1733
  * bit 1 is set = right button is pressed
1744
  * bit 1 is set = right button is pressed
1734
  * bit 2 is set = middle button is pressed
1745
  * bit 2 is set = middle button is pressed
1735
  * bit 3 is set = 4th button is pressed
1746
  * bit 3 is set = 4th button is pressed
1736
  * bit 4 is set = 5th button is pressed
1747
  * bit 4 is set = 5th button is pressed
1737
  * other bits are cleared
1748
  * other bits are cleared
1738
 
1749
 
1739
-------------------- Subfunction 4 - load cursor ---------------------
1750
-------------------- Subfunction 4 - load cursor ---------------------
1740
Parameters:
1751
Parameters:
1741
  * eax = 37 - function number
1752
  * eax = 37 - function number
1742
  * ebx = 4 - subfunction number
1753
  * ebx = 4 - subfunction number
1743
  * dx = data source:
1754
  * dx = data source:
1744
  * dx = LOAD_FROM_FILE = 0 - data in a file
1755
  * dx = LOAD_FROM_FILE = 0 - data in a file
1745
    * ecx = pointer to full path to the cursor file
1756
    * ecx = pointer to full path to the cursor file
1746
    * the file must be in the format .cur, which is standard for
1757
    * the file must be in the format .cur, which is standard for
1747
      MS Windows, at that of the size 32*32 pixels
1758
      MS Windows, at that of the size 32*32 pixels
1748
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1759
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1749
    * ecx = pointer to data of the cursor file
1760
    * ecx = pointer to data of the cursor file
1750
    * the data format is the same as in the previous case
1761
    * the data format is the same as in the previous case
1751
  * dx = LOAD_INDIRECT = 2 - data in memory
1762
  * dx = LOAD_INDIRECT = 2 - data in memory
1752
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1763
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1753
    * edx = 0xXXYY0002, where
1764
    * edx = 0xXXYY0002, where
1754
      * XX = x-coordinate of cursor hotspot
1765
      * XX = x-coordinate of cursor hotspot
1755
      * YY = y-coordinate
1766
      * YY = y-coordinate
1756
      * 0 <= XX, YY <= 31
1767
      * 0 <= XX, YY <= 31
1757
Returned value:
1768
Returned value:
1758
  * eax = 0 - failed
1769
  * eax = 0 - failed
1759
  * otherwise eax = cursor handle
1770
  * otherwise eax = cursor handle
1760
 
1771
 
1761
--------------------- Subfunction 5 - set cursor ---------------------
1772
--------------------- Subfunction 5 - set cursor ---------------------
1762
Sets new cursor for the window of the current thread.
1773
Sets new cursor for the window of the current thread.
1763
Parameters:
1774
Parameters:
1764
  * eax = 37 - function number
1775
  * eax = 37 - function number
1765
  * ebx = 5 - subfunction number
1776
  * ebx = 5 - subfunction number
1766
  * ecx = cursor handle
1777
  * ecx = cursor handle
1767
Returned value:
1778
Returned value:
1768
  * eax = handle of previous cursor
1779
  * eax = handle of previous cursor
1769
Remarks:
1780
Remarks:
1770
  * If the handle is incorrect, the function restores the default
1781
  * If the handle is incorrect, the function restores the default
1771
    cursor (standard arrow). In particular, ecx=0 restores it.
1782
    cursor (standard arrow). In particular, ecx=0 restores it.
1772
 
1783
 
1773
------------------- Subfunction 6 - delete cursor --------------------
1784
------------------- Subfunction 6 - delete cursor --------------------
1774
Parameters:
1785
Parameters:
1775
  * eax = 37 - function number
1786
  * eax = 37 - function number
1776
  * ebx = 6 - subfunction number
1787
  * ebx = 6 - subfunction number
1777
  * ecx = cursor handle
1788
  * ecx = cursor handle
1778
Returned value:
1789
Returned value:
1779
  * eax destroyed
1790
  * eax destroyed
1780
Remarks:
1791
Remarks:
1781
  * The cursor must be loaded previously by the current thread
1792
  * The cursor must be loaded previously by the current thread
1782
    (with the call to subfunction 4). The function does not delete
1793
    (with the call to subfunction 4). The function does not delete
1783
    system cursors and cursors, loaded by another applications.
1794
    system cursors and cursors, loaded by another applications.
1784
  * If the active cursor (set by subfunction 5) is deleted,
1795
  * If the active cursor (set by subfunction 5) is deleted,
1785
    the system restores the default cursor (standard arrow).
1796
    the system restores the default cursor (standard arrow).
1786
 
1797
 
1787
------------------ Subfunction 7 - get scroll data -------------------
1798
------------------ Subfunction 7 - get scroll data -------------------
1788
Parameters:
1799
Parameters:
1789
  * eax = 37 - function number
1800
  * eax = 37 - function number
1790
  * ebx = 7 - subfunction number
1801
  * ebx = 7 - subfunction number
1791
Returned value:
1802
Returned value:
1792
  * eax = [horizontal offset]*65536 + [vertical offset]
1803
  * eax = [horizontal offset]*65536 + [vertical offset]
1793
Remarks:
1804
Remarks:
1794
  * Scroll data is available for active window only.
1805
  * Scroll data is available for active window only.
1795
  * Values are zeroed after reading.
1806
  * Values are zeroed after reading.
1796
  * Values are signed.
1807
  * Values are signed.
1797
 
1808
 
1798
======================================================================
1809
======================================================================
1799
====================== Function 38 - draw line. ======================
1810
====================== Function 38 - draw line. ======================
1800
======================================================================
1811
======================================================================
1801
Parameters:
1812
Parameters:
1802
  * eax = 38 - function number
1813
  * eax = 38 - function number
1803
  * ebx = [start coordinate on axis x]*65536 +
1814
  * ebx = [start coordinate on axis x]*65536 +
1804
              [end coordinate on axis x]
1815
              [end coordinate on axis x]
1805
  * ecx = [start coordinate on axis y]*65536 +
1816
  * ecx = [start coordinate on axis y]*65536 +
1806
              [end coordinate on axis y]
1817
              [end coordinate on axis y]
1807
  * edx = 0x00RRGGBB - color
1818
  * edx = 0x00RRGGBB - color
1808
    edx = 0x01xxxxxx - draw inversed line
1819
    edx = 0x01xxxxxx - draw inversed line
1809
          (low 24 bits are ignored)
1820
          (low 24 bits are ignored)
1810
Returned value:
1821
Returned value:
1811
  * function does not return value
1822
  * function does not return value
1812
Remarks:
1823
Remarks:
1813
  * Coordinates are relative to the window.
1824
  * Coordinates are relative to the window.
1814
  * End point is also drawn.
1825
  * End point is also drawn.
1815
 
1826
 
1816
======================================================================
1827
======================================================================
1817
== Function 39, subfunction 1 - get a size of the background image. ==
1828
== Function 39, subfunction 1 - get a size of the background image. ==
1818
======================================================================
1829
======================================================================
1819
Parameters:
1830
Parameters:
1820
  * eax = 39 - function number
1831
  * eax = 39 - function number
1821
  * ebx = 1 - subfunction number
1832
  * ebx = 1 - subfunction number
1822
Returned value:
1833
Returned value:
1823
  * eax = [width]*65536 + [height]
1834
  * eax = [width]*65536 + [height]
1824
Remarks:
1835
Remarks:
1825
  * There is a pair function to set sizes of background image -
1836
  * There is a pair function to set sizes of background image -
1826
    subfunction 1 of function 15. After which it is necessary,
1837
    subfunction 1 of function 15. After which it is necessary,
1827
    of course, anew to define image.
1838
    of course, anew to define image.
1828
 
1839
 
1829
======================================================================
1840
======================================================================
1830
== Function 39, subfunction 2 - get pixel from the background image. =
1841
== Function 39, subfunction 2 - get pixel from the background image. =
1831
======================================================================
1842
======================================================================
1832
Parameters:
1843
Parameters:
1833
  * eax = 39 - function number
1844
  * eax = 39 - function number
1834
  * ebx = 2 - subfunction number
1845
  * ebx = 2 - subfunction number
1835
  * ecx = offset
1846
  * ecx = offset
1836
Returned value:
1847
Returned value:
1837
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1848
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1838
    (less than 0x160000-16)
1849
    (less than 0x160000-16)
1839
  * eax = 2 otherwise
1850
  * eax = 2 otherwise
1840
Remarks:
1851
Remarks:
1841
  * Do not rely on returned value for invalid offsets, it may be
1852
  * Do not rely on returned value for invalid offsets, it may be
1842
    changed in future kernel versions.
1853
    changed in future kernel versions.
1843
  * Offset for pixel with coordinates (x,y)
1854
  * Offset for pixel with coordinates (x,y)
1844
    is calculated as (x+y*xsize)*3.
1855
    is calculated as (x+y*xsize)*3.
1845
  * There is a pair function to set pixel on the background image - 
1856
  * There is a pair function to set pixel on the background image - 
1846
    subfunction 2 of function 15.
1857
    subfunction 2 of function 15.
1847
 
1858
 
1848
======================================================================
1859
======================================================================
1849
== Function 39, subfunction 4 - get drawing mode for the background. =
1860
== Function 39, subfunction 4 - get drawing mode for the background. =
1850
======================================================================
1861
======================================================================
1851
Parameters:
1862
Parameters:
1852
  * eax = 39 - function number
1863
  * eax = 39 - function number
1853
  * ebx = 4 - subfunction number
1864
  * ebx = 4 - subfunction number
1854
Returned value:
1865
Returned value:
1855
  * eax = 1 - tile
1866
  * eax = 1 - tile
1856
  * eax = 2 - stretch
1867
  * eax = 2 - stretch
1857
Remarks:
1868
Remarks:
1858
  * There is a pair function to set drawing mode - 
1869
  * There is a pair function to set drawing mode - 
1859
    subfunction 4 of function 15.
1870
    subfunction 4 of function 15.
1860
 
1871
 
1861
======================================================================
1872
======================================================================
1862
=========== Function 40 - set the mask for expected events. ==========
1873
=========== Function 40 - set the mask for expected events. ==========
1863
======================================================================
1874
======================================================================
1864
The mask for expected events affects function working with events
1875
The mask for expected events affects function working with events
1865
10, 11, 23 - they notify only about events allowed by this mask.
1876
10, 11, 23 - they notify only about events allowed by this mask.
1866
Parameters:
1877
Parameters:
1867
  * eax = 40 - function number
1878
  * eax = 40 - function number
1868
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1879
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1869
    (set bit permits notice on event)
1880
    (set bit permits notice on event)
1870
Returned value:
1881
Returned value:
1871
  * eax = previous value of mask
1882
  * eax = previous value of mask
1872
Remarks:
1883
Remarks:
1873
  * Default mask (7=111b) enables nofices about redraw,
1884
  * Default mask (7=111b) enables nofices about redraw,
1874
    keys and buttons. This is enough for many applications.
1885
    keys and buttons. This is enough for many applications.
1875
  * Events prohibited in the mask are saved anyway, when come;
1886
  * Events prohibited in the mask are saved anyway, when come;
1876
    they are simply not informed with event functions.
1887
    they are simply not informed with event functions.
1877
  * Event functions take into account the mask on moment of
1888
  * Event functions take into account the mask on moment of
1878
    function call, not on moment of event arrival.
1889
    function call, not on moment of event arrival.
1879
 
1890
 
1880
 
1891
 
1881
======================================================================
1892
======================================================================
1882
================ Function 43 - input/output to a port. ===============
1893
================ Function 43 - input/output to a port. ===============
1883
======================================================================
1894
======================================================================
1884
 
1895
 
1885
------------------------ Output data to port -------------------------
1896
------------------------ Output data to port -------------------------
1886
Parameters:
1897
Parameters:
1887
  * eax = 43 - function number
1898
  * eax = 43 - function number
1888
  * bl = byte for output
1899
  * bl = byte for output
1889
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1900
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1890
Returned value:
1901
Returned value:
1891
  * eax = 0 - success
1902
  * eax = 0 - success
1892
  * eax = 1 - the thread has not reserved the selected port
1903
  * eax = 1 - the thread has not reserved the selected port
1893
 
1904
 
1894
------------------------ Input data from port ------------------------
1905
------------------------ Input data from port ------------------------
1895
Parameters:
1906
Parameters:
1896
  * eax = 43 - function number
1907
  * eax = 43 - function number
1897
  * ebx is ignored
1908
  * ebx is ignored
1898
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1909
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1899
Returned value:
1910
Returned value:
1900
  * eax = 0 - success, thus ebx = entered byte
1911
  * eax = 0 - success, thus ebx = entered byte
1901
  * eax = 1 - the thread has not reserved the selected port
1912
  * eax = 1 - the thread has not reserved the selected port
1902
Remarks:
1913
Remarks:
1903
  * Previously the thread must reserve the selected port
1914
  * Previously the thread must reserve the selected port
1904
    for itself by function 46.
1915
    for itself by function 46.
1905
  * Instead of call to this function it is better to use
1916
  * Instead of call to this function it is better to use
1906
    processor instructions in/out - this is much
1917
    processor instructions in/out - this is much
1907
    faster and a bit shorter and easier.
1918
    faster and a bit shorter and easier.
1908
 
1919
 
1909
 
1920
 
1910
======================================================================
1921
======================================================================
1911
====== Function 46 - reserve/free a group of input/output ports. =====
1922
====== Function 46 - reserve/free a group of input/output ports. =====
1912
======================================================================
1923
======================================================================
1913
To work with reserved ports an application can access directly by
1924
To work with reserved ports an application can access directly by
1914
commands in/out (recommended way) and can use function 43
1925
commands in/out (recommended way) and can use function 43
1915
(not recommended way).
1926
(not recommended way).
1916
Parameters:
1927
Parameters:
1917
  * eax = 46 - function number
1928
  * eax = 46 - function number
1918
  * ebx = 0 - reserve, 1 - free
1929
  * ebx = 0 - reserve, 1 - free
1919
  * ecx = start port number
1930
  * ecx = start port number
1920
  * edx = end port number (inclusive)
1931
  * edx = end port number (inclusive)
1921
Returned value:
1932
Returned value:
1922
  * eax = 0 - success
1933
  * eax = 0 - success
1923
  * eax = 1 - error
1934
  * eax = 1 - error
1924
Remarks:
1935
Remarks:
1925
  * For ports reservation: an error occurs if and only if
1936
  * For ports reservation: an error occurs if and only if
1926
    one from the following condition satisfies:
1937
    one from the following condition satisfies:
1927
    * start port is more than end port;
1938
    * start port is more than end port;
1928
    * the selected range contains incorrect port number
1939
    * the selected range contains incorrect port number
1929
      (correct are from 0 to 0xFFFF);
1940
      (correct are from 0 to 0xFFFF);
1930
    * limit for the total number of reserved areas is exceeded
1941
    * limit for the total number of reserved areas is exceeded
1931
      (maximum 255 are allowed);
1942
      (maximum 255 are allowed);
1932
    * the selected range intersects with any of earlier reserved
1943
    * the selected range intersects with any of earlier reserved
1933
  * For ports free: an error is an attempt to free range,
1944
  * For ports free: an error is an attempt to free range,
1934
    that was not earlier reserved by this function
1945
    that was not earlier reserved by this function
1935
    (with same ecx,edx).
1946
    (with same ecx,edx).
1936
  * If an error occurs (for both cases) function performs no action.
1947
  * If an error occurs (for both cases) function performs no action.
1937
  * At booting the system reserves for itself ports
1948
  * At booting the system reserves for itself ports
1938
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
1949
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
1939
  * When a thread terminates, all reserved by it ports
1950
  * When a thread terminates, all reserved by it ports
1940
    are freed automatically.
1951
    are freed automatically.
1941
 
1952
 
1942
======================================================================
1953
======================================================================
1943
============= Function 47 - draw a number in the window. =============
1954
============= Function 47 - draw a number in the window. =============
1944
======================================================================
1955
======================================================================
1945
Parameters:
1956
Parameters:
1946
  * eax = 47 - function number
1957
  * eax = 47 - function number
1947
  * ebx = parameters of conversion number to text:
1958
  * ebx = parameters of conversion number to text:
1948
    * bl = 0 - ecx contains number
1959
    * bl = 0 - ecx contains number
1949
    * bl = 1 - ecx contains pointer to dword/qword-number
1960
    * bl = 1 - ecx contains pointer to dword/qword-number
1950
    * bh = 0 - display in decimal number system
1961
    * bh = 0 - display in decimal number system
1951
    * bh = 1 - display in hexadecimal system
1962
    * bh = 1 - display in hexadecimal system
1952
    * bh = 2 - display in binary system
1963
    * bh = 2 - display in binary system
1953
    * bits 16-21 = how many digits to display
1964
    * bits 16-21 = how many digits to display
1954
    * bits 22-29 reserved and must be set to 0
1965
    * bits 22-29 reserved and must be set to 0
1955
    * bit 30 set = display qword (64-bit) number (must be bl=1)
1966
    * bit 30 set = display qword (64-bit) number (must be bl=1)
1956
    * bit 31 set = do not display leading zeroes of the number
1967
    * bit 31 set = do not display leading zeroes of the number
1957
  * ecx = number (if bl=0) or pointer (if bl=1)
1968
  * ecx = number (if bl=0) or pointer (if bl=1)
1958
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1969
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1959
  * esi = 0xX0RRGGBB:
1970
  * esi = 0xX0RRGGBB:
1960
    * RR, GG, BB specify the color
1971
    * RR, GG, BB specify the color
1961
    * X = ABnn (bits)
1972
    * X = ABnn (bits)
1962
    * nn = font (0/1)
1973
    * nn = font (0/1)
1963
    * A is ignored
1974
    * A is ignored
1964
    * B=1 - fill background with the color edi
1975
    * B=1 - fill background with the color edi
1965
Returned value:
1976
Returned value:
1966
  * function does not return value
1977
  * function does not return value
1967
Remarks:
1978
Remarks:
1968
  * The given length must not exceed 60.
1979
  * The given length must not exceed 60.
1969
  * The exactly given amount of digits is output. If number is small
1980
  * The exactly given amount of digits is output. If number is small
1970
    and can be written by smaller amount of digits, it is supplemented
1981
    and can be written by smaller amount of digits, it is supplemented
1971
    by leading zeroes; if the number is big and can not be written by
1982
    by leading zeroes; if the number is big and can not be written by
1972
    given amount of digits, extra digits are not drawn.
1983
    given amount of digits, extra digits are not drawn.
1973
  * Parameters of fonts are shown in the description of function 4
1984
  * Parameters of fonts are shown in the description of function 4
1974
    (text output).
1985
    (text output).
1975
 
1986
 
1976
======================================================================
1987
======================================================================
1977
========= Function 48, subfunction 0 - apply screen settings. ========
1988
========= Function 48, subfunction 0 - apply screen settings. ========
1978
======================================================================
1989
======================================================================
1979
Parameters:
1990
Parameters:
1980
  * eax = 48 - function number
1991
  * eax = 48 - function number
1981
  * ebx = 0 - subfunction number
1992
  * ebx = 0 - subfunction number
1982
  * ecx = 0 - reserved
1993
  * ecx = 0 - reserved
1983
Returned value:
1994
Returned value:
1984
  * function does not return value
1995
  * function does not return value
1985
Remarks:
1996
Remarks:
1986
  * Function redraws the screen after parameters change by
1997
  * Function redraws the screen after parameters change by
1987
    subfunctions 1 and 2.
1998
    subfunctions 1 and 2.
1988
  * Function call without prior call to one of indicated subfunctions
1999
  * Function call without prior call to one of indicated subfunctions
1989
    is ignored.
2000
    is ignored.
1990
  * Function call with nonzero ecx is ignored.
2001
  * Function call with nonzero ecx is ignored.
1991
 
2002
 
1992
======================================================================
2003
======================================================================
1993
=========== Function 48, subfunction 1 - set button style. ===========
2004
=========== Function 48, subfunction 1 - set button style. ===========
1994
======================================================================
2005
======================================================================
1995
Parameters:
2006
Parameters:
1996
  * eax = 48 - function number
2007
  * eax = 48 - function number
1997
  * ebx = 1 - subfunction number
2008
  * ebx = 1 - subfunction number
1998
  * ecx = button style:
2009
  * ecx = button style:
1999
    * 0 = flat
2010
    * 0 = flat
2000
    * 1 = 3d
2011
    * 1 = 3d
2001
Returned value:
2012
Returned value:
2002
  * function does not return value
2013
  * function does not return value
2003
Remarks:
2014
Remarks:
2004
  * After call to this function one should redraw the screen by
2015
  * After call to this function one should redraw the screen by
2005
    subfunction 0.
2016
    subfunction 0.
2006
  * Button style influences only to their draw of function 8.
2017
  * Button style influences only to their draw of function 8.
2007
 
2018
 
2008
======================================================================
2019
======================================================================
2009
====== Function 48, subfunction 2 - set standard window colors. ======
2020
====== Function 48, subfunction 2 - set standard window colors. ======
2010
======================================================================
2021
======================================================================
2011
Parameters:
2022
Parameters:
2012
  * eax = 48 - function number
2023
  * eax = 48 - function number
2013
  * ebx = 2 - subfunction number
2024
  * ebx = 2 - subfunction number
2014
  * ecx = pointer to the color table
2025
  * ecx = pointer to the color table
2015
  * edx = size of the color table
2026
  * edx = size of the color table
2016
    (must be 40 bytes for future compatibility)
2027
    (must be 40 bytes for future compatibility)
2017
Format of the color table is shown in description of subfunction 3.
2028
Format of the color table is shown in description of subfunction 3.
2018
Returned value:
2029
Returned value:
2019
  * function does not return value
2030
  * function does not return value
2020
Remarks:
2031
Remarks:
2021
  * After call to this function one should redraw the screen by
2032
  * After call to this function one should redraw the screen by
2022
    subfunction 0.
2033
    subfunction 0.
2023
  * Table of standard colors influences only to applications,
2034
  * Table of standard colors influences only to applications,
2024
    which receive this table obviously (by subfunction 3)
2035
    which receive this table obviously (by subfunction 3)
2025
    and use it (specifying colors from it to drawing functions).
2036
    and use it (specifying colors from it to drawing functions).
2026
  * Table of standard colors is included in skin and is installed
2037
  * Table of standard colors is included in skin and is installed
2027
    anew with skin installation (by subfunction 8).
2038
    anew with skin installation (by subfunction 8).
2028
  * Color table can be viewed/changed interactively with
2039
  * Color table can be viewed/changed interactively with
2029
    the application 'desktop'.
2040
    the application 'desktop'.
2030
 
2041
 
2031
======================================================================
2042
======================================================================
2032
====== Function 48, subfunction 3 - get standard window colors. ======
2043
====== Function 48, subfunction 3 - get standard window colors. ======
2033
======================================================================
2044
======================================================================
2034
Parameters:
2045
Parameters:
2035
  * eax = 48 - function number
2046
  * eax = 48 - function number
2036
  * ebx = 3 - subfunction number
2047
  * ebx = 3 - subfunction number
2037
  * ecx = pointer to the buffer with size edx bytes,
2048
  * ecx = pointer to the buffer with size edx bytes,
2038
    where table will be written
2049
    where table will be written
2039
  * edx = size of color table
2050
  * edx = size of color table
2040
    (must be 40 bytes for future compatibility)
2051
    (must be 40 bytes for future compatibility)
2041
Returned value:
2052
Returned value:
2042
  * function does not return value
2053
  * function does not return value
2043
Format of the color table:
2054
Format of the color table:
2044
each item is dword-value for color 0x00RRGGBB
2055
each item is dword-value for color 0x00RRGGBB
2045
  * +0: dword: frames - color of frame
2056
  * +0: dword: frames - color of frame
2046
  * +4: dword: grab - color of header
2057
  * +4: dword: grab - color of header
2047
  * +8: dword: grab_button - color of button on header bar
2058
  * +8: dword: grab_button - color of button on header bar
2048
  * +12 = +0xC: dword: grab_button_text - color of text on button
2059
  * +12 = +0xC: dword: grab_button_text - color of text on button
2049
    on header bar
2060
    on header bar
2050
  * +16 = +0x10: dword: grab_text - color of text on header
2061
  * +16 = +0x10: dword: grab_text - color of text on header
2051
  * +20 = +0x14: dword: work - color of working area
2062
  * +20 = +0x14: dword: work - color of working area
2052
  * +24 = +0x18: dword: work_button - color of button in working area
2063
  * +24 = +0x18: dword: work_button - color of button in working area
2053
  * +28 = +0x1C: dword: work_button_text - color of text on button
2064
  * +28 = +0x1C: dword: work_button_text - color of text on button
2054
    in working area
2065
    in working area
2055
  * +32 = +0x20: dword: work_text - color of text in working area
2066
  * +32 = +0x20: dword: work_text - color of text in working area
2056
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2067
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2057
Remarks:
2068
Remarks:
2058
  * Structure of the color table is described in the standard
2069
  * Structure of the color table is described in the standard
2059
    include file 'macros.inc' as 'system_colors'; for example,
2070
    include file 'macros.inc' as 'system_colors'; for example,
2060
    it is possible to write:
2071
    it is possible to write:
2061
    	sc	system_colors		; variable declaration
2072
    	sc	system_colors		; variable declaration
2062
    	...				; somewhere one must call
2073
    	...				; somewhere one must call
2063
    					; this function with ecx=sc
2074
    					; this function with ecx=sc
2064
    	mov	ecx, [sc.work_button_text]	; read text color on
2075
    	mov	ecx, [sc.work_button_text]	; read text color on
2065
    					; buttin in working area
2076
    					; buttin in working area
2066
  * A program itself desides to use or not to use color table.
2077
  * A program itself desides to use or not to use color table.
2067
    For usage program must simply at calls to drawing functions select
2078
    For usage program must simply at calls to drawing functions select
2068
    color taken from the table.
2079
    color taken from the table.
2069
  * At change of the table of standard colors (by subfunction 2 with
2080
  * At change of the table of standard colors (by subfunction 2 with
2070
    the subsequent application of changes by subfunction 0 or
2081
    the subsequent application of changes by subfunction 0 or
2071
    at skin set by subfunction 8) the system sends to all windows
2082
    at skin set by subfunction 8) the system sends to all windows
2072
    redraw message (the event with code 1).
2083
    redraw message (the event with code 1).
2073
  * Color table can be viewed/changed interactively with
2084
  * Color table can be viewed/changed interactively with
2074
    the application 'desktop'.
2085
    the application 'desktop'.
2075
 
2086
 
2076
======================================================================
2087
======================================================================
2077
============ Function 48, subfunction 4 - get skin height. ===========
2088
============ Function 48, subfunction 4 - get skin height. ===========
2078
======================================================================
2089
======================================================================
2079
Parameters:
2090
Parameters:
2080
  * eax = 48 - function number
2091
  * eax = 48 - function number
2081
  * ebx = 4 - subfunction number
2092
  * ebx = 4 - subfunction number
2082
Returned value:
2093
Returned value:
2083
  * eax = skin height
2094
  * eax = skin height
2084
Remarks:
2095
Remarks:
2085
  * Skin height is defined as the height of a header
2096
  * Skin height is defined as the height of a header
2086
    of skinned windows.
2097
    of skinned windows.
2087
  * See also general structure of window in the description
2098
  * See also general structure of window in the description
2088
    of function 0.
2099
    of function 0.
2089
 
2100
 
2090
======================================================================
2101
======================================================================
2091
======== Function 48, subfunction 5 - get screen working area. =======
2102
======== Function 48, subfunction 5 - get screen working area. =======
2092
======================================================================
2103
======================================================================
2093
Parameters:
2104
Parameters:
2094
  * eax = 48 - function number
2105
  * eax = 48 - function number
2095
  * ebx = 5 - subfunction number
2106
  * ebx = 5 - subfunction number
2096
Returned value:
2107
Returned value:
2097
  * eax = [left]*65536 + [right]
2108
  * eax = [left]*65536 + [right]
2098
  * ebx = [top]*65536 + [bottom]
2109
  * ebx = [top]*65536 + [bottom]
2099
Remarks:
2110
Remarks:
2100
  * The screen working area defines position and coordinates of
2111
  * The screen working area defines position and coordinates of
2101
    a maximized window.
2112
    a maximized window.
2102
  * The screen working area in view of normal work is all screen
2113
  * The screen working area in view of normal work is all screen
2103
    without system panel (the application '@panel').
2114
    without system panel (the application '@panel').
2104
  * (left,top) are coordinates of the left upper corner,
2115
  * (left,top) are coordinates of the left upper corner,
2105
    (right,bottom) are coordinates of the right lower one.
2116
    (right,bottom) are coordinates of the right lower one.
2106
    Thus the size of working area on x axis can be calculated by
2117
    Thus the size of working area on x axis can be calculated by
2107
    formula right-left+1, on y axis - by formula bottom-right+1.
2118
    formula right-left+1, on y axis - by formula bottom-right+1.
2108
  * See also function 14,
2119
  * See also function 14,
2109
    to get sizes of all screen.
2120
    to get sizes of all screen.
2110
  * There is a pair function to set working area - subfunction 6.
2121
  * There is a pair function to set working area - subfunction 6.
2111
 
2122
 
2112
======================================================================
2123
======================================================================
2113
======== Function 48, subfunction 6 - set screen working area. =======
2124
======== Function 48, subfunction 6 - set screen working area. =======
2114
======================================================================
2125
======================================================================
2115
Parameters:
2126
Parameters:
2116
  * eax = 48 - function number
2127
  * eax = 48 - function number
2117
  * ebx = 6 - subfunction number
2128
  * ebx = 6 - subfunction number
2118
  * ecx = [left]*65536 + [right]
2129
  * ecx = [left]*65536 + [right]
2119
  * edx = [top]*65536 + [bottom]
2130
  * edx = [top]*65536 + [bottom]
2120
Returned value:
2131
Returned value:
2121
  * function does not return value
2132
  * function does not return value
2122
Remarks:
2133
Remarks:
2123
  * The screen working area defines position and coordinates of
2134
  * The screen working area defines position and coordinates of
2124
    a maximized window.
2135
    a maximized window.
2125
  * This function is used only by the application '@panel',
2136
  * This function is used only by the application '@panel',
2126
    which set working area to all screen without system panel.
2137
    which set working area to all screen without system panel.
2127
  * (left,top) are coordinates of the left upper corner,
2138
  * (left,top) are coordinates of the left upper corner,
2128
    (right,bottom) are coordinates of the right lower one.
2139
    (right,bottom) are coordinates of the right lower one.
2129
    Thus the size of working area on x axis can be calculated by
2140
    Thus the size of working area on x axis can be calculated by
2130
    formula right-left+1, on y axis - by formula bottom-right+1.
2141
    formula right-left+1, on y axis - by formula bottom-right+1.
2131
  * If 'left'>='right', x-coordinate of working area is not changed.
2142
  * If 'left'>='right', x-coordinate of working area is not changed.
2132
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2143
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2133
    equal to screen width, 'right' will not be set.
2144
    equal to screen width, 'right' will not be set.
2134
    Similarly on y axis.
2145
    Similarly on y axis.
2135
  * See also function 14,
2146
  * See also function 14,
2136
    to get sizes of all screen.
2147
    to get sizes of all screen.
2137
  * There is a pair function to get working area - subfunction 5.
2148
  * There is a pair function to get working area - subfunction 5.
2138
  * This function redraws the screen automatically,
2149
  * This function redraws the screen automatically,
2139
    updating coordinates and sizes of maximized windows.
2150
    updating coordinates and sizes of maximized windows.
2140
    The system sends to all windows redraw message (the event 1).
2151
    The system sends to all windows redraw message (the event 1).
2141
 
2152
 
2142
======================================================================
2153
======================================================================
2143
=========== Function 48, subfunction 7 - get skin margins. ===========
2154
=========== Function 48, subfunction 7 - get skin margins. ===========
2144
======================================================================
2155
======================================================================
2145
Returns the area of a header of a skinned window, intended for
2156
Returns the area of a header of a skinned window, intended for
2146
a text of a header.
2157
a text of a header.
2147
Parameters:
2158
Parameters:
2148
  * eax = 48 - function number
2159
  * eax = 48 - function number
2149
  * ebx = 7 - subfunction number
2160
  * ebx = 7 - subfunction number
2150
Returned value:
2161
Returned value:
2151
  * eax = [left]*65536 + [right]
2162
  * eax = [left]*65536 + [right]
2152
  * ebx = [top]*65536 + [bottom]
2163
  * ebx = [top]*65536 + [bottom]
2153
Remarks:
2164
Remarks:
2154
  * An application decides itself to use or not to use this function.
2165
  * An application decides itself to use or not to use this function.
2155
  * It is recommended to take into account returned value
2166
  * It is recommended to take into account returned value
2156
    of this function for choice of a place for drawing header text
2167
    of this function for choice of a place for drawing header text
2157
    (by function 4) or a substitute of header text
2168
    (by function 4) or a substitute of header text
2158
    (at the discretion of an application).
2169
    (at the discretion of an application).
2159
 
2170
 
2160
======================================================================
2171
======================================================================
2161
============= Function 48, subfunction 8 - set used skin. ============
2172
============= Function 48, subfunction 8 - set used skin. ============
2162
======================================================================
2173
======================================================================
2163
Parameters:
2174
Parameters:
2164
  * eax = 48 - function number
2175
  * eax = 48 - function number
2165
  * ebx = 8 - subfunction number
2176
  * ebx = 8 - subfunction number
2166
  * ecx = pointer to a block for function 58, in
2177
  * ecx = pointer to a block for function 58, in
2167
    which the fields of intermediate buffer and file name are filled
2178
    which the fields of intermediate buffer and file name are filled
2168
Returned value:
2179
Returned value:
2169
  * eax = 0 - success
2180
  * eax = 0 - success
2170
  * otherwise eax = file system error code; if file does not
2181
  * otherwise eax = file system error code; if file does not
2171
    contain valid skin, function returns error 3
2182
    contain valid skin, function returns error 3
2172
    (unknown file system).
2183
    (unknown file system).
2173
Remarks:
2184
Remarks:
2174
  * After successful skin loading the system sends to all windows
2185
  * After successful skin loading the system sends to all windows
2175
    redraw message (the event 1).
2186
    redraw message (the event 1).
2176
  * At booting the system reads skin from file 'default.skn'
2187
  * At booting the system reads skin from file 'default.skn'
2177
    on ramdisk.
2188
    on ramdisk.
2178
  * User can change the skin statically by creating hisself
2189
  * User can change the skin statically by creating hisself
2179
    'default.skn' or dynamically with the application 'desktop'.
2190
    'default.skn' or dynamically with the application 'desktop'.
2180
 
2191
 
2181
======================================================================
2192
======================================================================
2182
=========== Function 49 - Advanced Power Management (APM). ===========
2193
=========== Function 49 - Advanced Power Management (APM). ===========
2183
======================================================================
2194
======================================================================
2184
Parameters:
2195
Parameters:
2185
  * eax = 49 - function number
2196
  * eax = 49 - function number
2186
  * dx = number of the APM function
2197
  * dx = number of the APM function
2187
    (analogue of ax in APM specification)
2198
    (analogue of ax in APM specification)
2188
  * bx, cx = parameters of the APM function
2199
  * bx, cx = parameters of the APM function
2189
Returned value:
2200
Returned value:
2190
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2201
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2191
    are set according to the APM specification
2202
    are set according to the APM specification
2192
  * high halves of 32-bit registers eax, ebx, ecx,
2203
  * high halves of 32-bit registers eax, ebx, ecx,
2193
    edx, esi, edi are destroyed
2204
    edx, esi, edi are destroyed
2194
Remarks:
2205
Remarks:
2195
  * APM 1.2 specification is described in the document
2206
  * APM 1.2 specification is described in the document
2196
    "Advanced Power Management (APM) BIOS Specification"
2207
    "Advanced Power Management (APM) BIOS Specification"
2197
    (Revision 1.2), available at
2208
    (Revision 1.2), available at
2198
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2209
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2199
    besides it is included in famous Interrupt List by Ralf Brown
2210
    besides it is included in famous Interrupt List by Ralf Brown
2200
    (http://www.pobox.com/~ralf/files.html,
2211
    (http://www.pobox.com/~ralf/files.html,
2201
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2212
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2202
 
2213
 
2203
======================================================================
2214
======================================================================
2204
=================== Function 50 - set window shape. ==================
2215
=================== Function 50 - set window shape. ==================
2205
======================================================================
2216
======================================================================
2206
Normal windows have rectangular shape. This function can give to
2217
Normal windows have rectangular shape. This function can give to
2207
a window any shape. The shape is given by a set of points inside
2218
a window any shape. The shape is given by a set of points inside
2208
the base rectangle belonging to a window. Position and coordinates
2219
the base rectangle belonging to a window. Position and coordinates
2209
of the base rectangle are set by function 0
2220
of the base rectangle are set by function 0
2210
and changed by function 67.
2221
and changed by function 67.
2211
 
2222
 
2212
--------------------------- Set shape data ---------------------------
2223
--------------------------- Set shape data ---------------------------
2213
Parameters:
2224
Parameters:
2214
  * eax = 50 - function number
2225
  * eax = 50 - function number
2215
  * ebx = 0 - subfunction number
2226
  * ebx = 0 - subfunction number
2216
  * ecx = pointer to shape data (array of bytes 0/1)
2227
  * ecx = pointer to shape data (array of bytes 0/1)
2217
Returned value:
2228
Returned value:
2218
  * function does not return value
2229
  * function does not return value
2219
 
2230
 
2220
-------------------------- Set shape scale ---------------------------
2231
-------------------------- Set shape scale ---------------------------
2221
Parameters:
2232
Parameters:
2222
  * eax = 50 - function number
2233
  * eax = 50 - function number
2223
  * ebx = 1 - subfunction number
2234
  * ebx = 1 - subfunction number
2224
  * ecx sets a scale: each byte of data defines
2235
  * ecx sets a scale: each byte of data defines
2225
    (2^scale)*(2^scale) pixels
2236
    (2^scale)*(2^scale) pixels
2226
Returned value:
2237
Returned value:
2227
  * function does not return value
2238
  * function does not return value
2228
Remarks:
2239
Remarks:
2229
  * Default scale is 0 (scale factor is 1). If in the shape data
2240
  * Default scale is 0 (scale factor is 1). If in the shape data
2230
    one byte corresponds to one pixel, there is no necessity
2241
    one byte corresponds to one pixel, there is no necessity
2231
    to set scale.
2242
    to set scale.
2232
  * Let's designate xsize = window width (in pixels), ysize = height;
2243
  * Let's designate xsize = window width (in pixels), ysize = height;
2233
    pay attention, that they are one pixel more than defined by
2244
    pay attention, that they are one pixel more than defined by
2234
    functions 0, 67.
2245
    functions 0, 67.
2235
  * On definition of scale xsize and ysize must be divisible
2246
  * On definition of scale xsize and ysize must be divisible
2236
    on 2^scale.
2247
    on 2^scale.
2237
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2248
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2238
    to a window of square with the side 2^scale (if scale=0,
2249
    to a window of square with the side 2^scale (if scale=0,
2239
    this is one pixel) and coordinates of the left upper corner
2250
    this is one pixel) and coordinates of the left upper corner
2240
    (a mod (xsize shr scale), a div (xsize shr scale))
2251
    (a mod (xsize shr scale), a div (xsize shr scale))
2241
  * Data size: (xsize shr scale)*(ysize shr scale).
2252
  * Data size: (xsize shr scale)*(ysize shr scale).
2242
  * Data must be presented in the memory and not change
2253
  * Data must be presented in the memory and not change
2243
    after set of shape.
2254
    after set of shape.
2244
  * The system views the shape data at every window redraw by
2255
  * The system views the shape data at every window redraw by
2245
    function 0.
2256
    function 0.
2246
  * The call of subfunction 0 with NULL pointer results in return
2257
  * The call of subfunction 0 with NULL pointer results in return
2247
    to the rectangular shape.
2258
    to the rectangular shape.
2248
 
2259
 
2249
======================================================================
2260
======================================================================
2250
==================== Function 51 - create thread. ====================
2261
==================== Function 51 - create thread. ====================
2251
======================================================================
2262
======================================================================
2252
Parameters:
2263
Parameters:
2253
  * eax = 51 - function number
2264
  * eax = 51 - function number
2254
  * ebx = 1 - unique subfunction
2265
  * ebx = 1 - unique subfunction
2255
  * ecx = address of thread entry point (starting eip)
2266
  * ecx = address of thread entry point (starting eip)
2256
  * edx = pointer to thread stack (starting esp)
2267
  * edx = pointer to thread stack (starting esp)
2257
Returned value:
2268
Returned value:
2258
  * eax = -1 - error (there is too many threads)
2269
  * eax = -1 - error (there is too many threads)
2259
  * otherwise eax = TID - thread identifier
2270
  * otherwise eax = TID - thread identifier
2260
         
2271
         
2261
 
2272
 
2262
======================================================================
2273
======================================================================
2263
=== Function 52, subfunction 0 - get network driver configuration. ===
2274
=== Function 52, subfunction 0 - get network driver configuration. ===
2264
======================================================================
2275
======================================================================
2265
Parameters:
2276
Parameters:
2266
  * eax = 52 - function number
2277
  * eax = 52 - function number
2267
  * ebx = 0 - subfunction number
2278
  * ebx = 0 - subfunction number
2268
Returned value:
2279
Returned value:
2269
  * eax = configuration dword
2280
  * eax = configuration dword
2270
Remarks:
2281
Remarks:
2271
  * Configuration dword can be set by subfunction 2.
2282
  * Configuration dword can be set by subfunction 2.
2272
  * The kernel does not use this variable. The value of this
2283
  * The kernel does not use this variable. The value of this
2273
    variable and working with it subfunctions 0 and 2 is represented
2284
    variable and working with it subfunctions 0 and 2 is represented
2274
    doubtful.
2285
    doubtful.
2275
 
2286
 
2276
======================================================================
2287
======================================================================
2277
========= Function 52, subfunction 1 - get local IP-address. =========
2288
========= Function 52, subfunction 1 - get local IP-address. =========
2278
======================================================================
2289
======================================================================
2279
Parameters:
2290
Parameters:
2280
  * eax = 52 - function number
2291
  * eax = 52 - function number
2281
  * ebx = 1 - subfunction number
2292
  * ebx = 1 - subfunction number
2282
Returned value:
2293
Returned value:
2283
  * eax = IP-address (4 bytes)
2294
  * eax = IP-address (4 bytes)
2284
Remarks:
2295
Remarks:
2285
  * Local IP-address is set by subfunction 3.
2296
  * Local IP-address is set by subfunction 3.
2286
 
2297
 
2287
======================================================================
2298
======================================================================
2288
=== Function 52, subfunction 2 - set network driver configuration. ===
2299
=== Function 52, subfunction 2 - set network driver configuration. ===
2289
======================================================================
2300
======================================================================
2290
Parameters:
2301
Parameters:
2291
  * eax = 52 - function number
2302
  * eax = 52 - function number
2292
  * ebx = 2 - subfunction number
2303
  * ebx = 2 - subfunction number
2293
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2304
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2294
    function [re-]initializes Ethernet-card, otherwise
2305
    function [re-]initializes Ethernet-card, otherwise
2295
    Ethernet turns off
2306
    Ethernet turns off
2296
Returned value:
2307
Returned value:
2297
  * if Ethernet-interface is not requested, function returns eax=2,
2308
  * if Ethernet-interface is not requested, function returns eax=2,
2298
    but this can be changed in future kernel versions
2309
    but this can be changed in future kernel versions
2299
  * if Ethernet-interface is requested, eax=0 means error
2310
  * if Ethernet-interface is requested, eax=0 means error
2300
    (absence of Ethernet-card), and nonzero value - success
2311
    (absence of Ethernet-card), and nonzero value - success
2301
Remarks:
2312
Remarks:
2302
  * Configuration dword can be read by subfunction 0.
2313
  * Configuration dword can be read by subfunction 0.
2303
  * The kernel does not use this variable. The value of this
2314
  * The kernel does not use this variable. The value of this
2304
    variable, subfunction 0 and part of subfunction 2, which set it,
2315
    variable, subfunction 0 and part of subfunction 2, which set it,
2305
    is represented doubtful.
2316
    is represented doubtful.
2306
 
2317
 
2307
======================================================================
2318
======================================================================
2308
========= Function 52, subfunction 3 - set local IP-address. =========
2319
========= Function 52, subfunction 3 - set local IP-address. =========
2309
======================================================================
2320
======================================================================
2310
Parameters:
2321
Parameters:
2311
  * eax = 52 - function number
2322
  * eax = 52 - function number
2312
  * ebx = 3 - subfunction number
2323
  * ebx = 3 - subfunction number
2313
  * ecx = IP-address (4 bytes)
2324
  * ecx = IP-address (4 bytes)
2314
Returned value:
2325
Returned value:
2315
  * the current implementation returns eax=3, but this can be changed
2326
  * the current implementation returns eax=3, but this can be changed
2316
    in future versions
2327
    in future versions
2317
Remarks:
2328
Remarks:
2318
  * Local IP-address can be get by subfunction 1.
2329
  * Local IP-address can be get by subfunction 1.
2319
 
2330
 
2320
======================================================================
2331
======================================================================
2321
= Function 52, subfunction 6 - add data to the stack of input queue. =
2332
= Function 52, subfunction 6 - add data to the stack of input queue. =
2322
======================================================================
2333
======================================================================
2323
Parameters:
2334
Parameters:
2324
  * eax = 52 - function number
2335
  * eax = 52 - function number
2325
  * ebx = 6 - subfunction number
2336
  * ebx = 6 - subfunction number
2326
  * edx = data size
2337
  * edx = data size
2327
  * esi = data pointer
2338
  * esi = data pointer
2328
Returned value:
2339
Returned value:
2329
  * eax = -1 - error
2340
  * eax = -1 - error
2330
  * eax = 0 - success
2341
  * eax = 0 - success
2331
Remarks:
2342
Remarks:
2332
  * This function is intended only for slow network drivers
2343
  * This function is intended only for slow network drivers
2333
    (PPP, SLIP).
2344
    (PPP, SLIP).
2334
  * Data size must not exceed 1500 bytes, though function
2345
  * Data size must not exceed 1500 bytes, though function
2335
    performs no checks on correctness.
2346
    performs no checks on correctness.
2336
 
2347
 
2337
======================================================================
2348
======================================================================
2338
 Function 52, subfunction 8 - read data from the network output queue. 
2349
 Function 52, subfunction 8 - read data from the network output queue. 
2339
======================================================================
2350
======================================================================
2340
Parameters:
2351
Parameters:
2341
  * eax = 52 - function number
2352
  * eax = 52 - function number
2342
  * ebx = 8 - subfunction number
2353
  * ebx = 8 - subfunction number
2343
  * esi = pointer to 1500-byte buffer
2354
  * esi = pointer to 1500-byte buffer
2344
Returned value:
2355
Returned value:
2345
  * eax = number of read bytes (in the current implementation
2356
  * eax = number of read bytes (in the current implementation
2346
    either 0 = no data or 1500)
2357
    either 0 = no data or 1500)
2347
  * data was copied in buffer
2358
  * data was copied in buffer
2348
Remarks:
2359
Remarks:
2349
  * This function is intended only for slow network drivers
2360
  * This function is intended only for slow network drivers
2350
    (PPP, SLIP).
2361
    (PPP, SLIP).
2351
 
2362
 
2352
======================================================================
2363
======================================================================
2353
============ Function 52, subfunction 9 - get gateway IP. ============
2364
============ Function 52, subfunction 9 - get gateway IP. ============
2354
======================================================================
2365
======================================================================
2355
Parameters:
2366
Parameters:
2356
  * eax = 52 - function number
2367
  * eax = 52 - function number
2357
  * ebx = 9 - subfunction number
2368
  * ebx = 9 - subfunction number
2358
Returned value:
2369
Returned value:
2359
  * eax = gateway IP (4 bytes)
2370
  * eax = gateway IP (4 bytes)
2360
 
2371
 
2361
======================================================================
2372
======================================================================
2362
=========== Function 52, subfunction 10 - get subnet mask. ===========
2373
=========== Function 52, subfunction 10 - get subnet mask. ===========
2363
======================================================================
2374
======================================================================
2364
Parameters:
2375
Parameters:
2365
  * eax = 52 - function number
2376
  * eax = 52 - function number
2366
  * ebx = 10 - subfunction number
2377
  * ebx = 10 - subfunction number
2367
Returned value:
2378
Returned value:
2368
  * eax = subnet mask
2379
  * eax = subnet mask
2369
 
2380
 
2370
======================================================================
2381
======================================================================
2371
============ Function 52, subfunction 11 - set gateway IP. ===========
2382
============ Function 52, subfunction 11 - set gateway IP. ===========
2372
======================================================================
2383
======================================================================
2373
Parameters:
2384
Parameters:
2374
  * eax = 52 - function number
2385
  * eax = 52 - function number
2375
  * ebx = 11 - subfunction number
2386
  * ebx = 11 - subfunction number
2376
  * ecx = gateway IP (4 bytes)
2387
  * ecx = gateway IP (4 bytes)
2377
Returned value:
2388
Returned value:
2378
  * the current implementation returns eax=11, but this can be changed
2389
  * the current implementation returns eax=11, but this can be changed
2379
    in future versions
2390
    in future versions
2380
 
2391
 
2381
======================================================================
2392
======================================================================
2382
=========== Function 52, subfunction 12 - set subnet mask. ===========
2393
=========== Function 52, subfunction 12 - set subnet mask. ===========
2383
======================================================================
2394
======================================================================
2384
Parameters:
2395
Parameters:
2385
  * eax = 52 - function number
2396
  * eax = 52 - function number
2386
  * ebx = 12 - subfunction number
2397
  * ebx = 12 - subfunction number
2387
  * ecx = subnet mask
2398
  * ecx = subnet mask
2388
Returned value:
2399
Returned value:
2389
  * the current implementation returns eax=12, but this can be changed
2400
  * the current implementation returns eax=12, but this can be changed
2390
    in future versions
2401
    in future versions
2391
 
2402
 
2392
======================================================================
2403
======================================================================
2393
============== Function 52, subfunction 13 - get DNS IP. =============
2404
============== Function 52, subfunction 13 - get DNS IP. =============
2394
======================================================================
2405
======================================================================
2395
Parameters:
2406
Parameters:
2396
  * eax = 52 - function number
2407
  * eax = 52 - function number
2397
  * ebx = 13 - subfunction number
2408
  * ebx = 13 - subfunction number
2398
Returned value:
2409
Returned value:
2399
  * eax = DNS IP (4 bytes)
2410
  * eax = DNS IP (4 bytes)
2400
 
2411
 
2401
======================================================================
2412
======================================================================
2402
============== Function 52, subfunction 14 - set DNS IP. =============
2413
============== Function 52, subfunction 14 - set DNS IP. =============
2403
======================================================================
2414
======================================================================
2404
Parameters:
2415
Parameters:
2405
  * eax = 52 - function number
2416
  * eax = 52 - function number
2406
  * ebx = 14 - subfunction number
2417
  * ebx = 14 - subfunction number
2407
  * ecx = DNS IP (4 bytes)
2418
  * ecx = DNS IP (4 bytes)
2408
Returned value:
2419
Returned value:
2409
  * the current implementation returns eax=14, but this can be changed
2420
  * the current implementation returns eax=14, but this can be changed
2410
    in future versions
2421
    in future versions
2411
 
2422
 
2412
======================================================================
2423
======================================================================
2413
======== Function 52, subfunction 15 - get local MAC address. ========
2424
======== Function 52, subfunction 15 - get local MAC address. ========
2414
======================================================================
2425
======================================================================
2415
Parameters:
2426
Parameters:
2416
  * eax = 52 - function number
2427
  * eax = 52 - function number
2417
  * ebx = 15 - subfunction number
2428
  * ebx = 15 - subfunction number
2418
  * ecx = 0 - read first 4 bytes,
2429
  * ecx = 0 - read first 4 bytes,
2419
    ecx = 4 - read last 2 bytes
2430
    ecx = 4 - read last 2 bytes
2420
Returned value:
2431
Returned value:
2421
  * for ecx=0: eax = first 4 bytes of MAC address
2432
  * for ecx=0: eax = first 4 bytes of MAC address
2422
  * for ecx=4: ax = last 2 bytes of MAC address,
2433
  * for ecx=4: ax = last 2 bytes of MAC address,
2423
               high half of eax is destroyed
2434
               high half of eax is destroyed
2424
  * for other ecx: eax = -1 indicates an error
2435
  * for other ecx: eax = -1 indicates an error
2425
 
2436
 
2426
======================================================================
2437
======================================================================
2427
============ Function 53, subfunction 0 - open UDP-socket. ===========
2438
============ Function 53, subfunction 0 - open UDP-socket. ===========
2428
======================================================================
2439
======================================================================
2429
Parameters:
2440
Parameters:
2430
  * eax = 53 - function number
2441
  * eax = 53 - function number
2431
  * ebx = 0 - subfunction number
2442
  * ebx = 0 - subfunction number
2432
  * ecx = local port (only low word is taken into account),
2443
  * ecx = local port (only low word is taken into account),
2433
    ecx = 0 - let the system choose a port
2444
    ecx = 0 - let the system choose a port
2434
  * edx = remote port (only low word is taken into account)
2445
  * edx = remote port (only low word is taken into account)
2435
  * esi = remote IP
2446
  * esi = remote IP
2436
Returned value:
2447
Returned value:
2437
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2448
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2438
  * eax = socket handle (some number which unambiguously identifies
2449
  * eax = socket handle (some number which unambiguously identifies
2439
    socket and have sense only for the system) - success;
2450
    socket and have sense only for the system) - success;
2440
    ebx destroyed
2451
    ebx destroyed
2441
 
2452
 
2442
======================================================================
2453
======================================================================
2443
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2454
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2444
======================================================================
2455
======================================================================
2445
Parameters:
2456
Parameters:
2446
  * eax = 53 - function number
2457
  * eax = 53 - function number
2447
  * ebx = 1 - subfunction number
2458
  * ebx = 1 - subfunction number
2448
  * ecx = socket handle
2459
  * ecx = socket handle
2449
Returned value:
2460
Returned value:
2450
  * eax = -1 - incorrect handle
2461
  * eax = -1 - incorrect handle
2451
  * eax = 0 - success
2462
  * eax = 0 - success
2452
  * ebx destroyed
2463
  * ebx destroyed
2453
Remarks:
2464
Remarks:
2454
  * The current implementation does not close automatically all
2465
  * The current implementation does not close automatically all
2455
    sockets of a thread at termination. In particular, one should not
2466
    sockets of a thread at termination. In particular, one should not
2456
    kill a thread with many opened sockets - there will be an outflow
2467
    kill a thread with many opened sockets - there will be an outflow
2457
    of resources.
2468
    of resources.
2458
 
2469
 
2459
======================================================================
2470
======================================================================
2460
============== Function 53, subfunction 2 - poll socket. =============
2471
============== Function 53, subfunction 2 - poll socket. =============
2461
======================================================================
2472
======================================================================
2462
Parameters:
2473
Parameters:
2463
  * eax = 53 - function number
2474
  * eax = 53 - function number
2464
  * ebx = 2 - subfunction number
2475
  * ebx = 2 - subfunction number
2465
  * ecx = socket handle
2476
  * ecx = socket handle
2466
Returned value:
2477
Returned value:
2467
  * eax = number of read bytes, 0 for incorrect handle
2478
  * eax = number of read bytes, 0 for incorrect handle
2468
  * ebx destroyed
2479
  * ebx destroyed
2469
 
2480
 
2470
======================================================================
2481
======================================================================
2471
========= Function 53, subfunction 3 - read byte from socket. ========
2482
========= Function 53, subfunction 3 - read byte from socket. ========
2472
======================================================================
2483
======================================================================
2473
Parameters:
2484
Parameters:
2474
  * eax = 53 - function number
2485
  * eax = 53 - function number
2475
  * ebx = 3 - subfunction number
2486
  * ebx = 3 - subfunction number
2476
  * ecx = socket handle
2487
  * ecx = socket handle
2477
Returned value:
2488
Returned value:
2478
  * if there is no read data or handle is incorrect: eax=0, bl=0,
2489
  * if there is no read data or handle is incorrect: eax=0, bl=0,
2479
    other bytes of ebx are destroyed
2490
    other bytes of ebx are destroyed
2480
  * if there are read data: eax=number of rest bytes
2491
  * if there are read data: eax=number of rest bytes
2481
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2492
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2482
 
2493
 
2483
======================================================================
2494
======================================================================
2484
========== Function 53, subfunction 4 - write to UDP-socket. =========
2495
========== Function 53, subfunction 4 - write to UDP-socket. =========
2485
======================================================================
2496
======================================================================
2486
Parameters:
2497
Parameters:
2487
  * eax = 53 - function number
2498
  * eax = 53 - function number
2488
  * ebx = 4 - subfunction number
2499
  * ebx = 4 - subfunction number
2489
  * ecx = socket handle
2500
  * ecx = socket handle
2490
  * edx = number of bytes to write
2501
  * edx = number of bytes to write
2491
  * esi = pointer to data to write
2502
  * esi = pointer to data to write
2492
Returned value:
2503
Returned value:
2493
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2504
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2494
  * eax = 0 - success
2505
  * eax = 0 - success
2495
  * ebx destroyed
2506
  * ebx destroyed
2496
Remarks:
2507
Remarks:
2497
  * Number of bytes to write must not exceed 1500-28, though
2508
  * Number of bytes to write must not exceed 1500-28, though
2498
    the appropriate check is not made.
2509
    the appropriate check is not made.
2499
 
2510
 
2500
======================================================================
2511
======================================================================
2501
============ Function 53, subfunction 5 - open TCP-socket. ===========
2512
============ Function 53, subfunction 5 - open TCP-socket. ===========
2502
======================================================================
2513
======================================================================
2503
Parameters:
2514
Parameters:
2504
  * eax = 53 - function number
2515
  * eax = 53 - function number
2505
  * ebx = 5 - subfunction number
2516
  * ebx = 5 - subfunction number
2506
  * ecx = local port (only low word is taken into account),
2517
  * ecx = local port (only low word is taken into account),
2507
    ecx = 0 - let the system choose a port
2518
    ecx = 0 - let the system choose a port
2508
  * edx = remote port (only low word is taken into account)
2519
  * edx = remote port (only low word is taken into account)
2509
  * esi = remote IP
2520
  * esi = remote IP
2510
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2521
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2511
Returned value:
2522
Returned value:
2512
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2523
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2513
  * eax = socket handle (some number which unambiguously identifies
2524
  * eax = socket handle (some number which unambiguously identifies
2514
    socket and have sense only for the system) - success;
2525
    socket and have sense only for the system) - success;
2515
    ebx destroyed
2526
    ebx destroyed
2516
 
2527
 
2517
======================================================================
2528
======================================================================
2518
========= Function 53, subfunction 6 - get TCP-socket status. ========
2529
========= Function 53, subfunction 6 - get TCP-socket status. ========
2519
======================================================================
2530
======================================================================
2520
Parameters:
2531
Parameters:
2521
  * eax = 53 - function number
2532
  * eax = 53 - function number
2522
  * ebx = 6 - subfunction number
2533
  * ebx = 6 - subfunction number
2523
  * ecx = socket handle
2534
  * ecx = socket handle
2524
Returned value:
2535
Returned value:
2525
  * eax = 0 for incorrect handle or socket status: one of
2536
  * eax = 0 for incorrect handle or socket status: one of
2526
  * TCB_LISTEN = 1
2537
  * TCB_LISTEN = 1
2527
  * TCB_SYN_SENT = 2
2538
  * TCB_SYN_SENT = 2
2528
  * TCB_SYN_RECEIVED = 3
2539
  * TCB_SYN_RECEIVED = 3
2529
  * TCB_ESTABLISHED = 4
2540
  * TCB_ESTABLISHED = 4
2530
  * TCB_FIN_WAIT_1 = 5
2541
  * TCB_FIN_WAIT_1 = 5
2531
  * TCB_FIN_WAIT_2 = 6
2542
  * TCB_FIN_WAIT_2 = 6
2532
  * TCB_CLOSE_WAIT = 7
2543
  * TCB_CLOSE_WAIT = 7
2533
  * TCB_CLOSING = 8
2544
  * TCB_CLOSING = 8
2534
  * TCB_LAST_ASK = 9
2545
  * TCB_LAST_ASK = 9
2535
  * TCB_TIME_WAIT = 10
2546
  * TCB_TIME_WAIT = 10
2536
  * TCB_CLOSED = 11
2547
  * TCB_CLOSED = 11
2537
  * ebx destroyed
2548
  * ebx destroyed
2538
 
2549
 
2539
======================================================================
2550
======================================================================
2540
========== Function 53, subfunction 7 - write to TCP-socket. =========
2551
========== Function 53, subfunction 7 - write to TCP-socket. =========
2541
======================================================================
2552
======================================================================
2542
Parameters:
2553
Parameters:
2543
  * eax = 53 - function number
2554
  * eax = 53 - function number
2544
  * ebx = 7 - subfunction number
2555
  * ebx = 7 - subfunction number
2545
  * ecx = socket handle
2556
  * ecx = socket handle
2546
  * edx = number of bytes to write
2557
  * edx = number of bytes to write
2547
  * esi = pointer to data to write
2558
  * esi = pointer to data to write
2548
Returned value:
2559
Returned value:
2549
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2560
  * eax = 0xffffffff - error (invalid handle or not enough memory)
2550
  * eax = 0 - success
2561
  * eax = 0 - success
2551
  * ebx destroyed
2562
  * ebx destroyed
2552
Remarks:
2563
Remarks:
2553
  * Number of bytes to write must not exceed 1500-40, though
2564
  * Number of bytes to write must not exceed 1500-40, though
2554
    the appropriate check is not made.
2565
    the appropriate check is not made.
2555
 
2566
 
2556
======================================================================
2567
======================================================================
2557
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2568
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2558
======================================================================
2569
======================================================================
2559
Parameters:
2570
Parameters:
2560
  * eax = 53 - function number
2571
  * eax = 53 - function number
2561
  * ebx = 8 - subfunction number
2572
  * ebx = 8 - subfunction number
2562
  * ecx = socket handle
2573
  * ecx = socket handle
2563
Returned value:
2574
Returned value:
2564
  * eax = -1 - error (invalid handle or
2575
  * eax = -1 - error (invalid handle or
2565
    not enough memory for socket close packet)
2576
    not enough memory for socket close packet)
2566
  * eax = 0 - success
2577
  * eax = 0 - success
2567
  * ebx destroyed
2578
  * ebx destroyed
2568
Remarks:
2579
Remarks:
2569
  * The current implementation does not close automatically all
2580
  * The current implementation does not close automatically all
2570
    sockets of a thread at termination. In particular, one should not
2581
    sockets of a thread at termination. In particular, one should not
2571
    kill a thread with many opened sockets - there will be an outflow
2582
    kill a thread with many opened sockets - there will be an outflow
2572
    of resources.
2583
    of resources.
2573
 
2584
 
2574
======================================================================
2585
======================================================================
2575
=== Function 53, subfunction 9 - check whether local port is free. ===
2586
=== Function 53, subfunction 9 - check whether local port is free. ===
2576
======================================================================
2587
======================================================================
2577
Parameters:
2588
Parameters:
2578
  * eax = 53 - function number
2589
  * eax = 53 - function number
2579
  * ebx = 9 - subfunction number
2590
  * ebx = 9 - subfunction number
2580
  * ecx = local port number (low 16 bits are used only)
2591
  * ecx = local port number (low 16 bits are used only)
2581
Returned value:
2592
Returned value:
2582
  * eax = 0 - port is used
2593
  * eax = 0 - port is used
2583
  * eax = 1 - port is free
2594
  * eax = 1 - port is free
2584
  * ebx destroyed
2595
  * ebx destroyed
2585
 
2596
 
2586
======================================================================
2597
======================================================================
2587
===== Function 53, subfunction 10 - query Ethernet cable status. =====
2598
===== Function 53, subfunction 10 - query Ethernet cable status. =====
2588
======================================================================
2599
======================================================================
2589
Parameters:
2600
Parameters:
2590
  * eax = 53 - function number
2601
  * eax = 53 - function number
2591
  * ebx = 10 - subfunction number
2602
  * ebx = 10 - subfunction number
2592
Returned value:
2603
Returned value:
2593
  * al = -1 - a network driver is not loaded or
2604
  * al = -1 - a network driver is not loaded or
2594
              does not support this function
2605
              does not support this function
2595
  * al = 0 - Ethernet cable is unplugged
2606
  * al = 0 - Ethernet cable is unplugged
2596
  * al = 1 - Ethernet cable is plugged
2607
  * al = 1 - Ethernet cable is plugged
2597
  * ebx destroyed
2608
  * ebx destroyed
2598
Remarks:
2609
Remarks:
2599
  * The current kernel implementation supports this function
2610
  * The current kernel implementation supports this function
2600
    only for RTL8139 network cards.
2611
    only for RTL8139 network cards.
2601
 
2612
 
2602
======================================================================
2613
======================================================================
2603
======= Function 53, subfunction 11 - read network stack data. =======
2614
======= Function 53, subfunction 11 - read network stack data. =======
2604
======================================================================
2615
======================================================================
2605
Paramters:
2616
Paramters:
2606
  * eax = 53 - function number
2617
  * eax = 53 - function number
2607
  * ebx = 11 - subfunction number
2618
  * ebx = 11 - subfunction number
2608
  * ecx = socket handle
2619
  * ecx = socket handle
2609
  * edx = pointer to buffer
2620
  * edx = pointer to buffer
2610
  * esi = number of bytes to read;
2621
  * esi = number of bytes to read;
2611
  * esi = 0 - read all data (maximum 4096 bytes)
2622
  * esi = 0 - read all data (maximum 4096 bytes)
2612
Returned value:
2623
Returned value:
2613
  * eax = number of bytes read (0 for incorrect handle)
2624
  * eax = number of bytes read (0 for incorrect handle)
2614
  * ebx destroyed
2625
  * ebx destroyed
2615
 
2626
 
2616
======================================================================
2627
======================================================================
2617
= Function 53, subfunction 255 - debug information of network driver. 
2628
= Function 53, subfunction 255 - debug information of network driver. 
2618
======================================================================
2629
======================================================================
2619
Parameters:
2630
Parameters:
2620
  * eax = 53 - function number
2631
  * eax = 53 - function number
2621
  * ebx = 255 - subfunction number
2632
  * ebx = 255 - subfunction number
2622
  * ecx = type of requested information (see below)
2633
  * ecx = type of requested information (see below)
2623
Returned value:
2634
Returned value:
2624
  * eax = requested information
2635
  * eax = requested information
2625
  * ebx destroyed
2636
  * ebx destroyed
2626
Possible values for ecx:
2637
Possible values for ecx:
2627
  * 100: length of queue 0 (empty queue)
2638
  * 100: length of queue 0 (empty queue)
2628
  * 101: length of queue 1 (ip-out queue)
2639
  * 101: length of queue 1 (ip-out queue)
2629
  * 102: length of queue 2 (ip-in queue)
2640
  * 102: length of queue 2 (ip-in queue)
2630
  * 103: length of queue 3 (net1out queue)
2641
  * 103: length of queue 3 (net1out queue)
2631
  * 200: number of items in the ARP table
2642
  * 200: number of items in the ARP table
2632
  * 201: size of the ARP table (in items) (20 for current version)
2643
  * 201: size of the ARP table (in items) (20 for current version)
2633
  * 202: read item at edx of the ARP table to the temporary buffer,
2644
  * 202: read item at edx of the ARP table to the temporary buffer,
2634
    whence 5 following types take information;
2645
    whence 5 following types take information;
2635
    in this case eax is not defined
2646
    in this case eax is not defined
2636
  * 203: IP-address saved by type 202
2647
  * 203: IP-address saved by type 202
2637
  * 204: high dword of MAC-address saved by type 202
2648
  * 204: high dword of MAC-address saved by type 202
2638
  * 205: low word of MAC-address saved by type 202
2649
  * 205: low word of MAC-address saved by type 202
2639
  * 206: status word saved by type 202
2650
  * 206: status word saved by type 202
2640
  * 207: ttl word saved by type 202
2651
  * 207: ttl word saved by type 202
2641
  * 2: total number of received IP-packets
2652
  * 2: total number of received IP-packets
2642
  * 3: total number of transferred IP-packets
2653
  * 3: total number of transferred IP-packets
2643
  * 4: total number of dumped received packets
2654
  * 4: total number of dumped received packets
2644
  * 5: total number of received ARP-packets
2655
  * 5: total number of received ARP-packets
2645
  * 6: status of packet driver, 0=inactive, nonzero=active
2656
  * 6: status of packet driver, 0=inactive, nonzero=active
2646
 
2657
 
2647
======================================================================
2658
======================================================================
2648
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2659
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2649
======================================================================
2660
======================================================================
2650
Parameters:
2661
Parameters:
2651
  * eax = 55 - function number
2662
  * eax = 55 - function number
2652
  * ebx = 55 - subfunction number
2663
  * ebx = 55 - subfunction number
2653
  * esi = pointer to data
2664
  * esi = pointer to data
2654
Returned value:
2665
Returned value:
2655
  * eax = 0 - success
2666
  * eax = 0 - success
2656
  * eax = 55 - error (speaker is off or busy)
2667
  * eax = 55 - error (speaker is off or busy)
2657
Data is an array of items with variable length.
2668
Data is an array of items with variable length.
2658
Format of each item is defined by first byte:
2669
Format of each item is defined by first byte:
2659
  * 0 = end of data
2670
  * 0 = end of data
2660
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2671
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2661
    is defined by immediate value of frequency
2672
    is defined by immediate value of frequency
2662
    * following word (2 bytes) contains frequency divider;
2673
    * following word (2 bytes) contains frequency divider;
2663
      frequency is defined as 1193180/divider
2674
      frequency is defined as 1193180/divider
2664
  * 0x81 = invalid
2675
  * 0x81 = invalid
2665
  * 0x82..0xFF = note is defined by octave and number:
2676
  * 0x82..0xFF = note is defined by octave and number:
2666
    * duration in 1/100 of second = (first byte)-0x81
2677
    * duration in 1/100 of second = (first byte)-0x81
2667
    * there is one more byte;
2678
    * there is one more byte;
2668
    * (second byte)=0xFF - delay
2679
    * (second byte)=0xFF - delay
2669
    * otherwise it looks like a*0x10+b, where b=number of the note in
2680
    * otherwise it looks like a*0x10+b, where b=number of the note in
2670
      an octave from 1 to 12, a=number of octave (beginning from 0)
2681
      an octave from 1 to 12, a=number of octave (beginning from 0)
2671
Remarks:
2682
Remarks:
2672
  * Speaker play can be disabled/enabled by
2683
  * Speaker play can be disabled/enabled by
2673
    subfunction 8 of function 18.
2684
    subfunction 8 of function 18.
2674
  * Function returns control, having informed the system
2685
  * Function returns control, having informed the system
2675
    an information on request. Play itself goes independently from
2686
    an information on request. Play itself goes independently from
2676
    the program.
2687
    the program.
2677
  * The data must be kept in the memory at least up to the end
2688
  * The data must be kept in the memory at least up to the end
2678
    of play.
2689
    of play.
2679
 
2690
 
2680
======================================================================
2691
======================================================================
2681
======================= Function 57 - PCI BIOS. ======================
2692
======================= Function 57 - PCI BIOS. ======================
2682
======================================================================
2693
======================================================================
2683
Parameters:
2694
Parameters:
2684
  * eax = 57 - function number
2695
  * eax = 57 - function number
2685
  * ebp corresponds to al in PCI BIOS specification
2696
  * ebp corresponds to al in PCI BIOS specification
2686
  * other registers are set according to PCI BIOS specification
2697
  * other registers are set according to PCI BIOS specification
2687
Returned value:
2698
Returned value:
2688
  * CF is undefined
2699
  * CF is undefined
2689
  * other registers are set according to PCI BIOS specification
2700
  * other registers are set according to PCI BIOS specification
2690
Remarks:
2701
Remarks:
2691
  * Many effects of this function can be also achieved with
2702
  * Many effects of this function can be also achieved with
2692
    corresponding subfunctions of function 62.
2703
    corresponding subfunctions of function 62.
2693
  * The function calls PCI32 BIOS extension, documented e.g. in
2704
  * The function calls PCI32 BIOS extension, documented e.g. in
2694
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2705
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2695
  * If BIOS does not support this extension, its behavior is emulated
2706
  * If BIOS does not support this extension, its behavior is emulated
2696
    (through kernel-mode analogues of subfunctions of function 62).
2707
    (through kernel-mode analogues of subfunctions of function 62).
2697
 
2708
 
2698
======================================================================
2709
======================================================================
2699
================ Function 58 - work with file system. ================
2710
================ Function 58 - work with file system. ================
2700
======================================================================
2711
======================================================================
2701
Parameters:
2712
Parameters:
2702
  * eax = 58
2713
  * eax = 58
2703
  * ebx = pointer to the information structure
2714
  * ebx = pointer to the information structure
2704
Returned value:
2715
Returned value:
2705
  * eax = 0 - success; otherwise file system error code
2716
  * eax = 0 - success; otherwise file system error code
2706
  * some subfunctions return value in other registers too
2717
  * some subfunctions return value in other registers too
2707
General format of the information structure:
2718
General format of the information structure:
2708
  * +0: dword: subfunction number
2719
  * +0: dword: subfunction number
2709
  * +4: dword: number of block
2720
  * +4: dword: number of block
2710
  * +8: dword: size
2721
  * +8: dword: size
2711
  * +12 = +0xC: dword: pointer to data
2722
  * +12 = +0xC: dword: pointer to data
2712
  * +16 = +0x10: dword: pointer to a memory for system operations
2723
  * +16 = +0x10: dword: pointer to a memory for system operations
2713
    (4096 bytes)
2724
    (4096 bytes)
2714
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2725
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2715
Specifications - in documentation on the appropriate subfunction.
2726
Specifications - in documentation on the appropriate subfunction.
2716
Filename is case-insensitive for latin letters, russian letters
2727
Filename is case-insensitive for latin letters, russian letters
2717
must be capital.
2728
must be capital.
2718
Format of filename:
2729
Format of filename:
2719
/base/number/dir1/dir2/.../dirn/file,
2730
/base/number/dir1/dir2/.../dirn/file,
2720
where /base/number identifies device, on which file is located:
2731
where /base/number identifies device, on which file is located:
2721
one of
2732
one of
2722
  * /RD/1 = /RAMDISK/1 to access ramdisk
2733
  * /RD/1 = /RAMDISK/1 to access ramdisk
2723
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2734
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2724
    /FD/2 = /FLOPPYDISK/2 to access second one
2735
    /FD/2 = /FLOPPYDISK/2 to access second one
2725
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2736
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2726
    (in this case base is defined by subfunction 7 of function 21),
2737
    (in this case base is defined by subfunction 7 of function 21),
2727
    x - partition number (beginning from 1)
2738
    x - partition number (beginning from 1)
2728
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2739
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2729
    IDE0 (Primary Master), IDE1 (Primary Slave),
2740
    IDE0 (Primary Master), IDE1 (Primary Slave),
2730
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2741
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2731
    x - partition number on the selected hard drive, varies from 1
2742
    x - partition number on the selected hard drive, varies from 1
2732
    to 255 (on each hard drive the indexing starts from 1)
2743
    to 255 (on each hard drive the indexing starts from 1)
2733
Remarks:
2744
Remarks:
2734
  * In the first two cases it is also possible to use FIRST
2745
  * In the first two cases it is also possible to use FIRST
2735
    instead of 1, SECOND instead of 2, but it is not recommended
2746
    instead of 1, SECOND instead of 2, but it is not recommended
2736
    for convenience of transition to the future extensions.
2747
    for convenience of transition to the future extensions.
2737
  * Limitation n<=39 is imposed.
2748
  * Limitation n<=39 is imposed.
2738
  * Names of folders and file dir1,...,dirn,file must have the
2749
  * Names of folders and file dir1,...,dirn,file must have the
2739
    format 8.3: name no more than 8 characters, dot, extension no
2750
    format 8.3: name no more than 8 characters, dot, extension no
2740
    more than 3 characters. Trailing spaces are ignored, no other
2751
    more than 3 characters. Trailing spaces are ignored, no other
2741
    spaces is allowed. If name occupies equally 8 characters,
2752
    spaces is allowed. If name occupies equally 8 characters,
2742
    dot may be omitted (though it is not recommended to use this
2753
    dot may be omitted (though it is not recommended to use this
2743
    feature for convenience of transition to the future extensions).
2754
    feature for convenience of transition to the future extensions).
2744
  * This function does not support folders on ramdisk.
2755
  * This function does not support folders on ramdisk.
2745
Examples:
2756
Examples:
2746
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2757
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2747
    '/rd/1/kernel.asm',0
2758
    '/rd/1/kernel.asm',0
2748
  * '/HD0/1/kernel.asm',0
2759
  * '/HD0/1/kernel.asm',0
2749
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2760
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2750
Existing subfunctions:
2761
Existing subfunctions:
2751
  * subfunction 0 - read file/folder
2762
  * subfunction 0 - read file/folder
2752
  * subfunction 8 - LBA-read from device
2763
  * subfunction 8 - LBA-read from device
2753
  * subfunction 15 - get file system information
2764
  * subfunction 15 - get file system information
2754
 
2765
 
2755
======================================================================
2766
======================================================================
2756
=========== Function 58, subfunction 0 - read file/folder. ===========
2767
=========== Function 58, subfunction 0 - read file/folder. ===========
2757
======================================================================
2768
======================================================================
2758
Parameters:
2769
Parameters:
2759
  * eax = 58
2770
  * eax = 58
2760
  * ebx = pointer to the information structure
2771
  * ebx = pointer to the information structure
2761
Format of the information structure:
2772
Format of the information structure:
2762
  * +0: dword: 0 = subfunction number
2773
  * +0: dword: 0 = subfunction number
2763
  * +4: dword: first block to read (beginning from 0)
2774
  * +4: dword: first block to read (beginning from 0)
2764
  * +8: dword: amount of blocks to read
2775
  * +8: dword: amount of blocks to read
2765
  * +12 = +0xC: dword: pointer to buffer for data
2776
  * +12 = +0xC: dword: pointer to buffer for data
2766
  * +16 = +0x10: dword: pointer to buffer for system operations
2777
  * +16 = +0x10: dword: pointer to buffer for system operations
2767
    (4096 bytes)
2778
    (4096 bytes)
2768
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2779
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2769
    given in the general description
2780
    given in the general description
2770
Returned value:
2781
Returned value:
2771
  * eax = 0 - success, otherwise file system error code
2782
  * eax = 0 - success, otherwise file system error code
2772
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2783
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2773
Remarks:
2784
Remarks:
2774
  * Block size is 512 bytes.
2785
  * Block size is 512 bytes.
2775
  * This function is obsolete, for reading files use subfunction 0
2786
  * This function is obsolete, for reading files use subfunction 0
2776
    of function 70, for reading folders - subfunction 1 of
2787
    of function 70, for reading folders - subfunction 1 of
2777
    function 70.
2788
    function 70.
2778
  * Function can read contents of a folder. Only FAT file system is
2789
  * Function can read contents of a folder. Only FAT file system is
2779
    supported. The format of FAT-folder is described
2790
    supported. The format of FAT-folder is described
2780
    in any FAT documentation.
2791
    in any FAT documentation.
2781
  * Size of a folder is determined by size of FAT clusters chain.
2792
  * Size of a folder is determined by size of FAT clusters chain.
2782
  * If file was ended before last requested block was read,
2793
  * If file was ended before last requested block was read,
2783
    the function will read as many as it can, and after that return
2794
    the function will read as many as it can, and after that return
2784
    eax=6 (EOF).
2795
    eax=6 (EOF).
2785
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2796
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2786
    in the first two cases the current implementation does not follow
2797
    in the first two cases the current implementation does not follow
2787
    to the declared rules:
2798
    to the declared rules:
2788
    for /rd/1:
2799
    for /rd/1:
2789
    * if one want to read 0 blocks, function considers,
2800
    * if one want to read 0 blocks, function considers,
2790
      that he requested 1;
2801
      that he requested 1;
2791
    * if one requests more than 14 blocks or starting block is
2802
    * if one requests more than 14 blocks or starting block is
2792
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2803
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2793
    * size of ramdisk root folder is 14 blocks, 
2804
    * size of ramdisk root folder is 14 blocks, 
2794
      0x1C00=7168 áàéò; but function returns ebx=0
2805
      0x1C00=7168 áàéò; but function returns ebx=0
2795
      (except of the case of previous item);
2806
      (except of the case of previous item);
2796
    * strangely enough, it is possible to read 14th block (which
2807
    * strangely enough, it is possible to read 14th block (which
2797
      generally contains a garbage - I remind, the indexing begins
2808
      generally contains a garbage - I remind, the indexing begins
2798
      from 0);
2809
      from 0);
2799
    * if some block with the number not less than 14 was requested,
2810
    * if some block with the number not less than 14 was requested,
2800
      function returns eax=6(EOF); otherwise eax=0.
2811
      function returns eax=6(EOF); otherwise eax=0.
2801
    For /fd/x:
2812
    For /fd/x:
2802
    * if the start block is not less than 14, function returns
2813
    * if the start block is not less than 14, function returns
2803
      eax=5 (not found) and ebx=0;
2814
      eax=5 (not found) and ebx=0;
2804
    * note that format of FAT12 allows floppies with the root size
2815
    * note that format of FAT12 allows floppies with the root size
2805
      more or less than 14 blocks;
2816
      more or less than 14 blocks;
2806
    * check for length is not performed;
2817
    * check for length is not performed;
2807
    * if data was successful read, function returns
2818
    * if data was successful read, function returns
2808
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2819
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2809
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2820
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2810
    but the result does not correspond to expected (on operations with
2821
    but the result does not correspond to expected (on operations with
2811
    normal files/folders), does not follow the declared rules,
2822
    normal files/folders), does not follow the declared rules,
2812
    may be changed in future versions of the kernel and consequently
2823
    may be changed in future versions of the kernel and consequently
2813
    is not described. To obtain the information about the equipment
2824
    is not described. To obtain the information about the equipment
2814
    use subfunction 11 of function 18 or
2825
    use subfunction 11 of function 18 or
2815
    read corresponding folder with subfunction 1 of function 70.
2826
    read corresponding folder with subfunction 1 of function 70.
2816
 
2827
 
2817
======================================================================
2828
======================================================================
2818
========= Function 58, subfunction 8 - LBA-read from device. =========
2829
========= Function 58, subfunction 8 - LBA-read from device. =========
2819
======================================================================
2830
======================================================================
2820
Parameters:
2831
Parameters:
2821
  * eax = 58 - function number
2832
  * eax = 58 - function number
2822
  * ebx = pointer to the information structure
2833
  * ebx = pointer to the information structure
2823
Format of the information structure:
2834
Format of the information structure:
2824
  * +0: dword: 8 = subfunction number
2835
  * +0: dword: 8 = subfunction number
2825
  * +4: dword: number of block to read (beginning from 0)
2836
  * +4: dword: number of block to read (beginning from 0)
2826
  * +8: dword: ignored (set to 1)
2837
  * +8: dword: ignored (set to 1)
2827
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
2838
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
2828
  * +16 = +0x10: dword: pointer to buffer for system operations
2839
  * +16 = +0x10: dword: pointer to buffer for system operations
2829
    (4096 bytes)
2840
    (4096 bytes)
2830
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
2841
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
2831
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
2842
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
2832
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
2843
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
2833
    Instead of digits it is allowed, though not recommended for
2844
    Instead of digits it is allowed, though not recommended for
2834
    convenience of transition to future extensions, to use
2845
    convenience of transition to future extensions, to use
2835
    'first','second','third','fourth'.
2846
    'first','second','third','fourth'.
2836
Returned value:
2847
Returned value:
2837
  * for device name /hd/xxx, where xxx is not in the list above:
2848
  * for device name /hd/xxx, where xxx is not in the list above:
2838
    * eax = ebx = 1
2849
    * eax = ebx = 1
2839
  * for invalid device name (except for the previous case):
2850
  * for invalid device name (except for the previous case):
2840
    * eax = 5
2851
    * eax = 5
2841
    * ebx does not change
2852
    * ebx does not change
2842
  * if LBA-access is disabled by subfunction 11 of function 21:
2853
  * if LBA-access is disabled by subfunction 11 of function 21:
2843
    * eax = 2
2854
    * eax = 2
2844
    * ebx destroyed
2855
    * ebx destroyed
2845
  * for ramdisk: attempt to read block outside ramdisk
2856
  * for ramdisk: attempt to read block outside ramdisk
2846
    (18*2*80 blocks) results in
2857
    (18*2*80 blocks) results in
2847
    * eax = 3
2858
    * eax = 3
2848
    * ebx = 0
2859
    * ebx = 0
2849
  * for successful read:
2860
  * for successful read:
2850
    * eax = ebx = 0
2861
    * eax = ebx = 0
2851
Remarks:
2862
Remarks:
2852
  * Block size is 512 bytes; function reads one block.
2863
  * Block size is 512 bytes; function reads one block.
2853
  * Do not depend on returned value, it can be changed
2864
  * Do not depend on returned value, it can be changed
2854
    in future versions.
2865
    in future versions.
2855
  * Function requires that LBA-access to devices is enabled by 
2866
  * Function requires that LBA-access to devices is enabled by 
2856
    subfunction 11 of function 21. To check this one can use 
2867
    subfunction 11 of function 21. To check this one can use 
2857
    subfunction 11 of function 26.
2868
    subfunction 11 of function 26.
2858
  * LBA-read of floppy is not supported.
2869
  * LBA-read of floppy is not supported.
2859
  * Function reads data on physical hard drive; if for any reason
2870
  * Function reads data on physical hard drive; if for any reason
2860
    data of the concrete partition are required, application must
2871
    data of the concrete partition are required, application must
2861
    define starting sector of this partition (either directly
2872
    define starting sector of this partition (either directly
2862
    through MBR, or from the full structure returned by
2873
    through MBR, or from the full structure returned by
2863
    ïîäôóíêöèåé 11 ôóíêöèè 18).
2874
    ïîäôóíêöèåé 11 ôóíêöèè 18).
2864
  * Function does not check error code of hard disk, so request of
2875
  * Function does not check error code of hard disk, so request of
2865
    nonexisting sector reads something (most probably it will be
2876
    nonexisting sector reads something (most probably it will be
2866
    zeroes, but this is defined by device) and this is considered
2877
    zeroes, but this is defined by device) and this is considered
2867
    as success (eax=0).
2878
    as success (eax=0).
2868
 
2879
 
2869
======================================================================
2880
======================================================================
2870
==== Function 58, subfunction 15 - get information on file system. ===
2881
==== Function 58, subfunction 15 - get information on file system. ===
2871
======================================================================
2882
======================================================================
2872
Parameters:
2883
Parameters:
2873
  * eax = 58 - function number
2884
  * eax = 58 - function number
2874
  * ebx = pointer to the information structure
2885
  * ebx = pointer to the information structure
2875
Format of the information structure:
2886
Format of the information structure:
2876
  * +0: dword: 15 = subfunction number
2887
  * +0: dword: 15 = subfunction number
2877
  * +4: dword: ignored
2888
  * +4: dword: ignored
2878
  * +8: dword: ignored
2889
  * +8: dword: ignored
2879
  * +12 = +0xC: dword: ignored
2890
  * +12 = +0xC: dword: ignored
2880
  * +16 = +0x10: dword: ignored
2891
  * +16 = +0x10: dword: ignored
2881
  * +20 = +0x14: (only second character is checked)
2892
  * +20 = +0x14: (only second character is checked)
2882
    /rd=/RAMDISK or /hd=/HARDDISK
2893
    /rd=/RAMDISK or /hd=/HARDDISK
2883
Returned value:
2894
Returned value:
2884
  * if the second character does not belong to set {'r','R','h','H'}:
2895
  * if the second character does not belong to set {'r','R','h','H'}:
2885
    * eax = 3
2896
    * eax = 3
2886
    * ebx = ecx = dword [fileinfo] = 0
2897
    * ebx = ecx = dword [fileinfo] = 0
2887
  * for ramdisk:
2898
  * for ramdisk:
2888
    * eax = 0 (success)
2899
    * eax = 0 (success)
2889
    * ebx = total number of clusters = 2847
2900
    * ebx = total number of clusters = 2847
2890
    * ecx = number of free clusters
2901
    * ecx = number of free clusters
2891
    * dword [fileinfo] = cluster size = 512
2902
    * dword [fileinfo] = cluster size = 512
2892
  * for hard disk: base and partition are defined by subfunctions
2903
  * for hard disk: base and partition are defined by subfunctions
2893
    7 and 8 of function 21:
2904
    7 and 8 of function 21:
2894
    * eax = 0 (success)
2905
    * eax = 0 (success)
2895
    * ebx = total number of clusters
2906
    * ebx = total number of clusters
2896
    * ecx = number of free clusters
2907
    * ecx = number of free clusters
2897
    * dword [fileinfo] = cluster size (in bytes)
2908
    * dword [fileinfo] = cluster size (in bytes)
2898
Remarks:
2909
Remarks:
2899
  * Be not surprised to strange layout of 4th returned parameter
2910
  * Be not surprised to strange layout of 4th returned parameter
2900
    - when this code was writing, at system calls application got
2911
    - when this code was writing, at system calls application got
2901
    only registers eax,ebx,ecx (from pushad-structure transmitted
2912
    only registers eax,ebx,ecx (from pushad-structure transmitted
2902
    as argument to the system function). Now it is corrected, so,
2913
    as argument to the system function). Now it is corrected, so,
2903
    probably, it is meaningful to return cluster size in edx, while
2914
    probably, it is meaningful to return cluster size in edx, while
2904
    this function is not used yet.
2915
    this function is not used yet.
2905
  * There exists also subfunction 11 of function 18,
2916
  * There exists also subfunction 11 of function 18,
2906
    which returns information on file system. From the full table
2917
    which returns information on file system. From the full table
2907
    of disk subsystem it is possible to deduce cluster size (there
2918
    of disk subsystem it is possible to deduce cluster size (there
2908
    it is stored in sectors) and total number of clusters
2919
    it is stored in sectors) and total number of clusters
2909
    for hard disks.
2920
    for hard disks.
2910
 
2921
 
2911
======================================================================
2922
======================================================================
2912
========== Function 60 - Inter Process Communication (IPC). ==========
2923
========== Function 60 - Inter Process Communication (IPC). ==========
2913
======================================================================
2924
======================================================================
2914
IPC is used for message dispatching from one process/thread to
2925
IPC is used for message dispatching from one process/thread to
2915
another. Previously it is necessary to agree how to interpret
2926
another. Previously it is necessary to agree how to interpret
2916
the concrete message.
2927
the concrete message.
2917
 
2928
 
2918
----------- Subfunction 1 - set the area for IPC receiving -----------
2929
----------- Subfunction 1 - set the area for IPC receiving -----------
2919
Is called by process-receiver.
2930
Is called by process-receiver.
2920
Parameters:
2931
Parameters:
2921
  * eax = 60 - function number
2932
  * eax = 60 - function number
2922
  * ebx = 1 - subfunction number
2933
  * ebx = 1 - subfunction number
2923
  * ecx = pointer to the buffer
2934
  * ecx = pointer to the buffer
2924
  * edx = size of the buffer
2935
  * edx = size of the buffer
2925
Returned value:
2936
Returned value:
2926
  * eax = 0 - always success
2937
  * eax = 0 - always success
2927
Format of IPC-buffer:
2938
Format of IPC-buffer:
2928
  * +0: dword: if nonzero, buffer is considered locked;
2939
  * +0: dword: if nonzero, buffer is considered locked;
2929
    lock/unlock the buffer, when you work with it and need that
2940
    lock/unlock the buffer, when you work with it and need that
2930
    buffer data are not changed from outside (no new messages)
2941
    buffer data are not changed from outside (no new messages)
2931
  * +4: dword: occupied place in the buffer (in bytes)
2942
  * +4: dword: occupied place in the buffer (in bytes)
2932
  * +8: first message
2943
  * +8: first message
2933
  * +8+n: second message
2944
  * +8+n: second message
2934
  * ...
2945
  * ...
2935
Format of a message:
2946
Format of a message:
2936
  * +0: dword: PID of sender
2947
  * +0: dword: PID of sender
2937
  * +4: dword: message length (not including this header)
2948
  * +4: dword: message length (not including this header)
2938
  * +8: n*byte: message data
2949
  * +8: n*byte: message data
2939
 
2950
 
2940
------------------ Subfunction 2 - send IPC message ------------------
2951
------------------ Subfunction 2 - send IPC message ------------------
2941
Is called by process-sender.
2952
Is called by process-sender.
2942
Parameters:
2953
Parameters:
2943
  * eax = 60 - function number
2954
  * eax = 60 - function number
2944
  * ebx = 2 - subfunction number
2955
  * ebx = 2 - subfunction number
2945
  * ecx = PID of receiver
2956
  * ecx = PID of receiver
2946
  * edx = pointer to the message data
2957
  * edx = pointer to the message data
2947
  * esi = message length (in bytes)
2958
  * esi = message length (in bytes)
2948
Returned value:
2959
Returned value:
2949
  * eax = 0 - success
2960
  * eax = 0 - success
2950
  * eax = 1 - the receiver has not defined buffer for IPC messages
2961
  * eax = 1 - the receiver has not defined buffer for IPC messages
2951
    (can be, still have no time,
2962
    (can be, still have no time,
2952
    and can be, this is not right process)
2963
    and can be, this is not right process)
2953
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2964
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2954
  * eax = 3 - overflow of IPC-buffer of the receiver
2965
  * eax = 3 - overflow of IPC-buffer of the receiver
2955
  * eax = 4 - process/thread with such PID does not exist
2966
  * eax = 4 - process/thread with such PID does not exist
2956
Remarks:
2967
Remarks:
2957
  * Immediately after writing of IPC-message to the buffer the system
2968
  * Immediately after writing of IPC-message to the buffer the system
2958
    sends to the receiver the event with code 7 (see event codes).
2969
    sends to the receiver the event with code 7 (see event codes).
2959
 
2970
 
2960
======================================================================
2971
======================================================================
2961
==== Function 61 - get parameters for the direct graphics access. ====
2972
==== Function 61 - get parameters for the direct graphics access. ====
2962
======================================================================
2973
======================================================================
2963
The data of the graphics screen (the memory area which displays
2974
The data of the graphics screen (the memory area which displays
2964
screen contents) are accessible to a program directly, without
2975
screen contents) are accessible to a program directly, without
2965
any system calls, through the selector gs:
2976
any system calls, through the selector gs:
2966
	mov	eax, [gs:0]
2977
	mov	eax, [gs:0]
2967
places in eax the first dword of the buffer, which contains
2978
places in eax the first dword of the buffer, which contains
2968
information on color of the left upper point (and, possibly, colors
2979
information on color of the left upper point (and, possibly, colors
2969
of several following).
2980
of several following).
2970
	mov	[gs:0], eax
2981
	mov	[gs:0], eax
2971
by work in VESA modes with LFB sets color of the left upper point
2982
by work in VESA modes with LFB sets color of the left upper point
2972
(and, possibly, colors of several following).
2983
(and, possibly, colors of several following).
2973
To interpret the data of graphics screen program needs to know
2984
To interpret the data of graphics screen program needs to know
2974
some parameters, returning by this function.
2985
some parameters, returning by this function.
2975
Remarks:
2986
Remarks:
2976
  * Graphics parameters changes very seldom at work,
2987
  * Graphics parameters changes very seldom at work,
2977
    namely, only in cases, when user works with the application VRR.
2988
    namely, only in cases, when user works with the application VRR.
2978
  * At videomode change the system redraws all windows (event
2989
  * At videomode change the system redraws all windows (event
2979
    with code 1) and redraws the background (event 5).
2990
    with code 1) and redraws the background (event 5).
2980
    Same events occur in other cases too, which meet much more often,
2991
    Same events occur in other cases too, which meet much more often,
2981
    than videomode change.
2992
    than videomode change.
2982
  * By operation in videomodes with LFB the selector gs points to
2993
  * By operation in videomodes with LFB the selector gs points to
2983
    LFB itself, so reading/writing on gs result directly in
2994
    LFB itself, so reading/writing on gs result directly in
2984
    change of screen contents. By operation in videomodes without
2995
    change of screen contents. By operation in videomodes without
2985
    LFB gs points to some data area in the kernel, and all functions
2996
    LFB gs points to some data area in the kernel, and all functions
2986
    of screen output fulfil honesty double operation on writing
2997
    of screen output fulfil honesty double operation on writing
2987
    directly to the screen and writing to this buffer. In result
2998
    directly to the screen and writing to this buffer. In result
2988
    at reading contents of this buffer the results correspond to
2999
    at reading contents of this buffer the results correspond to
2989
    screen contents (with, generally speaking, large color
3000
    screen contents (with, generally speaking, large color
2990
    resolution), and writing is ignored.
3001
    resolution), and writing is ignored.
2991
    One exception is the mode 320*200, for which main loop of the
3002
    One exception is the mode 320*200, for which main loop of the
2992
    system thread updates the screen according to mouse movements.
3003
    system thread updates the screen according to mouse movements.
2993
 
3004
 
2994
------------------------- Screen resolution --------------------------
3005
------------------------- Screen resolution --------------------------
2995
Parameters:
3006
Parameters:
2996
  * eax = 61 - function number
3007
  * eax = 61 - function number
2997
  * ebx = 1 - subfunction number
3008
  * ebx = 1 - subfunction number
2998
Returned value:
3009
Returned value:
2999
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3010
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3000
Remarks:
3011
Remarks:
3001
  * One can use function 14 paying attention that
3012
  * One can use function 14 paying attention that
3002
    it returns sizes on 1 pixel less. It is fully equivalent way.
3013
    it returns sizes on 1 pixel less. It is fully equivalent way.
3003
 
3014
 
3004
---------------------- Number of bits per pixel ----------------------
3015
---------------------- Number of bits per pixel ----------------------
3005
Parameters:
3016
Parameters:
3006
  * eax = 61 - function number
3017
  * eax = 61 - function number
3007
  * ebx = 2 - subfunction number
3018
  * ebx = 2 - subfunction number
3008
Returned value:
3019
Returned value:
3009
  * eax = number of bits per pixel (24 or 32)
3020
  * eax = number of bits per pixel (24 or 32)
3010
 
3021
 
3011
-------------------- Number of bytes per scanline --------------------
3022
-------------------- Number of bytes per scanline --------------------
3012
Parameters:
3023
Parameters:
3013
  * eax = 61 - function number
3024
  * eax = 61 - function number
3014
  * ebx = 3 - subfunction number
3025
  * ebx = 3 - subfunction number
3015
Returned value:
3026
Returned value:
3016
  * eax = number of bytes occupied by one scanline
3027
  * eax = number of bytes occupied by one scanline
3017
    (horizontal line on the screen)
3028
    (horizontal line on the screen)
3018
 
3029
 
3019
======================================================================
3030
======================================================================
3020
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3031
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3021
======================================================================
3032
======================================================================
3022
Parameters:
3033
Parameters:
3023
  * eax = 62 - function number
3034
  * eax = 62 - function number
3024
  * bl = 0 - subfunction number
3035
  * bl = 0 - subfunction number
3025
Returned value:
3036
Returned value:
3026
  * eax = -1 - PCI access is disabled; otherwise
3037
  * eax = -1 - PCI access is disabled; otherwise
3027
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3038
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3028
  * high word of eax is zeroed
3039
  * high word of eax is zeroed
3029
Remarks:
3040
Remarks:
3030
  * Previously low-level access to PCI for applications must be
3041
  * Previously low-level access to PCI for applications must be
3031
    enabled by subfunction 12 of function 21.
3042
    enabled by subfunction 12 of function 21.
3032
  * If PCI BIOS is not supported, the value of ax is undefined.
3043
  * If PCI BIOS is not supported, the value of ax is undefined.
3033
 
3044
 
3034
======================================================================
3045
======================================================================
3035
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3046
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3036
======================================================================
3047
======================================================================
3037
Parameters:
3048
Parameters:
3038
  * eax = 62 - function number
3049
  * eax = 62 - function number
3039
  * bl = 1 - subfunction number
3050
  * bl = 1 - subfunction number
3040
Returned value:
3051
Returned value:
3041
  * eax = -1 - access to PCI is disabled; otherwise
3052
  * eax = -1 - access to PCI is disabled; otherwise
3042
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3053
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3043
Remarks:
3054
Remarks:
3044
  * Previously low-level access to PCI for applications must be
3055
  * Previously low-level access to PCI for applications must be
3045
    enabled by subfunction 12 of function 21.
3056
    enabled by subfunction 12 of function 21.
3046
  * If PCI BIOS is not supported, the value of ax is undefined.
3057
  * If PCI BIOS is not supported, the value of ax is undefined.
3047
 
3058
 
3048
======================================================================
3059
======================================================================
3049
===================== Function 62, subfunction 2 =====================
3060
===================== Function 62, subfunction 2 =====================
3050
===== Get mechanism of addressing to the PCI configuration space. ====
3061
===== Get mechanism of addressing to the PCI configuration space. ====
3051
======================================================================
3062
======================================================================
3052
Parameters:
3063
Parameters:
3053
  * eax = 62 - function number
3064
  * eax = 62 - function number
3054
  * bl = 2 - subfunction number
3065
  * bl = 2 - subfunction number
3055
Returned value:
3066
Returned value:
3056
  * eax = -1 - access to PCI is disabled; otherwise
3067
  * eax = -1 - access to PCI is disabled; otherwise
3057
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3068
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3058
Remarks:
3069
Remarks:
3059
  * Previously low-level access to PCI for applications must be
3070
  * Previously low-level access to PCI for applications must be
3060
    enabled by subfunction 12 of function 21.
3071
    enabled by subfunction 12 of function 21.
3061
  * Addressing mechanism is selected depending on
3072
  * Addressing mechanism is selected depending on
3062
    equipment characteristics.
3073
    equipment characteristics.
3063
  * Subfunctions of read and write work automatically
3074
  * Subfunctions of read and write work automatically
3064
    with the selected mechanism.
3075
    with the selected mechanism.
3065
 
3076
 
3066
======================================================================
3077
======================================================================
3067
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3078
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3068
======================================================================
3079
======================================================================
3069
Parameters:
3080
Parameters:
3070
  * eax = 62 - function number
3081
  * eax = 62 - function number
3071
  * bl = 4 - read byte
3082
  * bl = 4 - read byte
3072
  * bl = 5 - read word
3083
  * bl = 5 - read word
3073
  * bl = 6 - read dword
3084
  * bl = 6 - read dword
3074
  * bh = number of PCI-bus
3085
  * bh = number of PCI-bus
3075
  * ch = dddddfff, where ddddd = number of the device on the bus,
3086
  * ch = dddddfff, where ddddd = number of the device on the bus,
3076
    fff = function number of device
3087
    fff = function number of device
3077
  * cl = number of register (must be even for bl=5,
3088
  * cl = number of register (must be even for bl=5,
3078
    divisible by 4 for bl=6)
3089
    divisible by 4 for bl=6)
3079
Returned value:
3090
Returned value:
3080
  * eax = -1 - error (access to PCI is disabled or parameters
3091
  * eax = -1 - error (access to PCI is disabled or parameters
3081
    are not supported); otherwise
3092
    are not supported); otherwise
3082
  * al/ax/eax (depending on requested size) contains the data;
3093
  * al/ax/eax (depending on requested size) contains the data;
3083
    the other part of register eax is destroyed
3094
    the other part of register eax is destroyed
3084
Remarks:
3095
Remarks:
3085
  * Previously low-level access to PCI for applications must be
3096
  * Previously low-level access to PCI for applications must be
3086
    enabled by subfunction 12 of function 21.
3097
    enabled by subfunction 12 of function 21.
3087
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3098
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3088
    function number. To get access mechanism use subfunction 2.
3099
    function number. To get access mechanism use subfunction 2.
3089
  * Some registers are standard and exist for all devices, some are
3100
  * Some registers are standard and exist for all devices, some are
3090
    defined by the concrete device. The list of registers of the
3101
    defined by the concrete device. The list of registers of the
3091
    first type can be found e.g. in famous
3102
    first type can be found e.g. in famous
3092
    Interrupt List by Ralf Brown
3103
    Interrupt List by Ralf Brown
3093
    (http://www.pobox.com/~ralf/files.html,
3104
    (http://www.pobox.com/~ralf/files.html,
3094
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3105
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3095
    registers of the second type must be listed
3106
    registers of the second type must be listed
3096
    in the device documentation.
3107
    in the device documentation.
3097
 
3108
 
3098
======================================================================
3109
======================================================================
3099
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3110
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3100
======================================================================
3111
======================================================================
3101
Parameters:
3112
Parameters:
3102
  * eax = 62 - function number
3113
  * eax = 62 - function number
3103
  * bl = 8 - write byte
3114
  * bl = 8 - write byte
3104
  * bl = 9 - write word
3115
  * bl = 9 - write word
3105
  * bl = 10 - write dword
3116
  * bl = 10 - write dword
3106
  * bh = number of PCI-bus
3117
  * bh = number of PCI-bus
3107
  * ch = dddddfff, where ddddd = number of the device on the bus,
3118
  * ch = dddddfff, where ddddd = number of the device on the bus,
3108
    fff = function number of device
3119
    fff = function number of device
3109
  * cl = number of register (must be even for bl=9,
3120
  * cl = number of register (must be even for bl=9,
3110
    divisible by 4 for bl=10)
3121
    divisible by 4 for bl=10)
3111
  * dl/dx/edx (depending on requested size) contatins
3122
  * dl/dx/edx (depending on requested size) contatins
3112
    the data to write
3123
    the data to write
3113
Returned value:
3124
Returned value:
3114
  * eax = -1 - error (access to PCI is disabled or parameters
3125
  * eax = -1 - error (access to PCI is disabled or parameters
3115
    are not supported)
3126
    are not supported)
3116
  * eax = 0 - success
3127
  * eax = 0 - success
3117
Remarks:
3128
Remarks:
3118
  * Previously low-level access to PCI for applications must be
3129
  * Previously low-level access to PCI for applications must be
3119
    enabled by subfunction 12 of function 21.
3130
    enabled by subfunction 12 of function 21.
3120
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3131
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3121
    function number. To get access mechanism use subfunction 2.
3132
    function number. To get access mechanism use subfunction 2.
3122
  * Some registers are standard and exist for all devices, some are
3133
  * Some registers are standard and exist for all devices, some are
3123
    defined by the concrete device. The list of registers of the
3134
    defined by the concrete device. The list of registers of the
3124
    first type can be found e.g. in famous Interrupt List by
3135
    first type can be found e.g. in famous Interrupt List by
3125
    Ralf Brown; registers of the second type must be listed
3136
    Ralf Brown; registers of the second type must be listed
3126
    in the device documentation.
3137
    in the device documentation.
3127
 
3138
 
3128
======================================================================
3139
======================================================================
3129
============== Function 63 - work with the debug board. ==============
3140
============== Function 63 - work with the debug board. ==============
3130
======================================================================
3141
======================================================================
3131
The debug board is the global system buffer (with the size
3142
The debug board is the global system buffer (with the size
3132
1024 bytes), to which any program can write (generally speaking,
3143
1024 bytes), to which any program can write (generally speaking,
3133
arbitrary) data and from which other program can read these data.
3144
arbitrary) data and from which other program can read these data.
3134
By the agreement written data are text strings interpreted as
3145
By the agreement written data are text strings interpreted as
3135
debug messages on a course of program execution. The kernel in
3146
debug messages on a course of program execution. The kernel in
3136
some situations also writes to the debug board information on
3147
some situations also writes to the debug board information on
3137
execution of some functions; by the agreement kernel messages
3148
execution of some functions; by the agreement kernel messages
3138
begins from the prefix "K : ".
3149
begins from the prefix "K : ".
3139
For view of the debug board the application 'board' was created,
3150
For view of the debug board the application 'board' was created,
3140
which reads data from the buffer and displays them in its window.
3151
which reads data from the buffer and displays them in its window.
3141
'board' interpretes the sequence of codes 13,10 as newline.
3152
'board' interpretes the sequence of codes 13,10 as newline.
3142
A character with null code in an end of line is not necessary,
3153
A character with null code in an end of line is not necessary,
3143
but also does not prevent.
3154
but also does not prevent.
3144
Because debugger has been written, the value of the debug board
3155
Because debugger has been written, the value of the debug board
3145
has decreased, as debugger allows to inspect completely a course of
3156
has decreased, as debugger allows to inspect completely a course of
3146
program execution without any efforts from the direction of program
3157
program execution without any efforts from the direction of program
3147
itself. Nevertheless in some cases the debug board is still useful.
3158
itself. Nevertheless in some cases the debug board is still useful.
3148
 
3159
 
3149
----------------------------- Write byte -----------------------------
3160
----------------------------- Write byte -----------------------------
3150
Parameters:
3161
Parameters:
3151
  * eax = 63 - function number
3162
  * eax = 63 - function number
3152
  * ebx = 1 - subfunction number
3163
  * ebx = 1 - subfunction number
3153
  * cl = data byte
3164
  * cl = data byte
3154
Returned value:
3165
Returned value:
3155
  * function does not return value
3166
  * function does not return value
3156
Remarks:
3167
Remarks:
3157
  * Byte is written to the buffer. Buffer size is 512 bytes.
3168
  * Byte is written to the buffer. Buffer size is 512 bytes.
3158
    At buffer overflow all obtained data are lost.
3169
    At buffer overflow all obtained data are lost.
3159
  * For output to the debug board of more complicated objects
3170
  * For output to the debug board of more complicated objects
3160
    (strings, numbers) it is enough to call this function in cycle.
3171
    (strings, numbers) it is enough to call this function in cycle.
3161
    It is possible not to write the appropriate code manually and use
3172
    It is possible not to write the appropriate code manually and use
3162
    file 'debug.inc', which is included into the distributive.
3173
    file 'debug.inc', which is included into the distributive.
3163
 
3174
 
3164
----------------------------- Read byte ------------------------------
3175
----------------------------- Read byte ------------------------------
3165
Takes away byte from the buffer.
3176
Takes away byte from the buffer.
3166
Parameters:
3177
Parameters:
3167
  * eax = 63 - function number
3178
  * eax = 63 - function number
3168
  * ebx = 2 - subfunction number
3179
  * ebx = 2 - subfunction number
3169
Returned value:
3180
Returned value:
3170
  * eax = ebx = 0 - the buffer is empty
3181
  * eax = ebx = 0 - the buffer is empty
3171
  * eax = byte, ebx = 1 - byte was successfully read
3182
  * eax = byte, ebx = 1 - byte was successfully read
3172
 
3183
 
3173
======================================================================
3184
======================================================================
3174
============== Function 64 - resize application memory. ==============
3185
============== Function 64 - resize application memory. ==============
3175
======================================================================
3186
======================================================================
3176
Parameters:
3187
Parameters:
3177
  * eax = 64 - function number
3188
  * eax = 64 - function number
3178
  * ebx = 1 - unique subfunction
3189
  * ebx = 1 - unique subfunction
3179
  * ecx = new memory size
3190
  * ecx = new memory size
3180
Returned value:
3191
Returned value:
3181
  * eax = 0 - success
3192
  * eax = 0 - success
3182
  * eax = 1 - not enough memory
3193
  * eax = 1 - not enough memory
3183
Remarks:
3194
Remarks:
3184
  * There is another way to dynamically allocate/free memory -
3195
  * There is another way to dynamically allocate/free memory -
3185
    subfunctions 11, 12, 13 of function 68.
3196
    subfunctions 11, 12, 13 of function 68.
3186
  * The function cannot be used together with 68.11, 68.12, 68.13.
3197
  * The function cannot be used together with 68.11, 68.12, 68.13.
3187
    The function call will be ignored after creation of process heap
3198
    The function call will be ignored after creation of process heap
3188
    with function 68.11.
3199
    with function 68.11.
3189
 
3200
 
3190
======================================================================
3201
======================================================================
3191
======== Function 65 - draw image with palette in the window. ========
3202
======== Function 65 - draw image with palette in the window. ========
3192
======================================================================
3203
======================================================================
3193
Parameters:
3204
Parameters:
3194
  * eax = 65 - function number
3205
  * eax = 65 - function number
3195
  * ebx = pointer to the image
3206
  * ebx = pointer to the image
3196
  * ecx = [size on axis x]*65536 + [size on axis y]
3207
  * ecx = [size on axis x]*65536 + [size on axis y]
3197
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3208
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3198
  * esi = number of bits per pixel, must be 1,2,4,8,15,16,24 or 32
3209
  * esi = number of bits per pixel, must be 1,2,4,8,15,16,24 or 32
3199
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
3210
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
3200
          ignored when esi > 8
3211
          ignored when esi > 8
3201
  * ebp = offset of next row data relative to previous row data
3212
  * ebp = offset of next row data relative to previous row data
3202
Returned value:
3213
Returned value:
3203
  * function does not return value
3214
  * function does not return value
3204
Remarks:
3215
Remarks:
3205
  * Coordinates of the image are coordinates of the upper left corner
3216
  * Coordinates of the image are coordinates of the upper left corner
3206
    of the image relative to the window.
3217
    of the image relative to the window.
3207
  * Format of image with 1 bit per pixel: each byte of image
3218
  * Format of image with 1 bit per pixel: each byte of image
3208
    (possibly excluding last bytes in rows), contains information on
3219
    (possibly excluding last bytes in rows), contains information on
3209
    the color of 8 pixels, MSB corresponds to first pixel.
3220
    the color of 8 pixels, MSB corresponds to first pixel.
3210
  * Format of image with 2 bits per pixel: each byte of image
3221
  * Format of image with 2 bits per pixel: each byte of image
3211
    (possibly excluding last bytes in rows), contains information on
3222
    (possibly excluding last bytes in rows), contains information on
3212
    the color of 4 pixels, two MSBs correspond to first pixel.
3223
    the color of 4 pixels, two MSBs correspond to first pixel.
3213
  * Format of image with 4 bits per pixel: each byte of image
3224
  * Format of image with 4 bits per pixel: each byte of image
3214
    excluding last bytes in rows (if width is odd) contains
3225
    excluding last bytes in rows (if width is odd) contains
3215
    information on the color of 2 pixels, high-order tetrad
3226
    information on the color of 2 pixels, high-order tetrad
3216
    corresponds to first pixel.
3227
    corresponds to first pixel.
3217
  * Format of image with 8 bits per pixel: each byte of image is
3228
  * Format of image with 8 bits per pixel: each byte of image is
3218
    index in the palette.
3229
    index in the palette.
3219
  * Format of image with 15 bits per pixel: the color of each pixel
3230
  * Format of image with 15 bits per pixel: the color of each pixel
3220
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
3231
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
3221
    each color.
3232
    each color.
3222
  * Format of image with 16 bits per pixel: the color of each pixel
3233
  * Format of image with 16 bits per pixel: the color of each pixel
3223
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
3234
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
3224
  * Format of image with 24 bits per pixel: the color of each pixel
3235
  * Format of image with 24 bits per pixel: the color of each pixel
3225
    is coded as 3 bytes - sequentially blue, green, red components.
3236
    is coded as 3 bytes - sequentially blue, green, red components.
3226
  * Format of image with 32 bits per pixel: similar to 24, but
3237
  * Format of image with 32 bits per pixel: similar to 24, but
3227
    one additional ignored byte is present.
3238
    one additional ignored byte is present.
3228
  * The call to function 7 is equivalent to call to this function
3239
  * The call to function 7 is equivalent to call to this function
3229
    with esi=24, ebp=0.
3240
    with esi=24, ebp=0.
3230
 
3241
 
3231
======================================================================
3242
======================================================================
3232
================== Function 66 - work with keyboard. =================
3243
================== Function 66 - work with keyboard. =================
3233
======================================================================
3244
======================================================================
3234
The input mode influences results of reading keys by function 2.
3245
The input mode influences results of reading keys by function 2.
3235
When a program loads, ASCII input mode is set for it.
3246
When a program loads, ASCII input mode is set for it.
3236
 
3247
 
3237
-------------- Subfunction 1 - set keyboard input mode. --------------
3248
-------------- Subfunction 1 - set keyboard input mode. --------------
3238
Parameters:
3249
Parameters:
3239
  * eax = 66 - function number
3250
  * eax = 66 - function number
3240
  * ebx = 1 - subfunction number
3251
  * ebx = 1 - subfunction number
3241
  * ecx = mode:
3252
  * ecx = mode:
3242
    * 0 = normal (ASCII-characters)
3253
    * 0 = normal (ASCII-characters)
3243
    * 1 = scancodes
3254
    * 1 = scancodes
3244
Returned value:
3255
Returned value:
3245
  * function does not return value
3256
  * function does not return value
3246
 
3257
 
3247
-------------- Subfunction 2 - get keyboard input mode. --------------
3258
-------------- Subfunction 2 - get keyboard input mode. --------------
3248
Parameters:
3259
Parameters:
3249
  * eax = 66 - function number
3260
  * eax = 66 - function number
3250
  * ebx = 2 - subfunction number
3261
  * ebx = 2 - subfunction number
3251
Returned value:
3262
Returned value:
3252
  * eax = current mode
3263
  * eax = current mode
3253
 
3264
 
3254
------------ Subfunction 3 - get status of control keys. -------------
3265
------------ Subfunction 3 - get status of control keys. -------------
3255
Parameters:
3266
Parameters:
3256
  * eax = 66 - function number
3267
  * eax = 66 - function number
3257
  * ebx = 3 - subfunction number
3268
  * ebx = 3 - subfunction number
3258
Returned value:
3269
Returned value:
3259
  * eax = bit mask:
3270
  * eax = bit mask:
3260
  * bit 0 (mask 1): left Shift is pressed
3271
  * bit 0 (mask 1): left Shift is pressed
3261
  * bit 1 (mask 2): right Shift is pressed
3272
  * bit 1 (mask 2): right Shift is pressed
3262
  * bit 2 (mask 4): left Ctrl is pressed
3273
  * bit 2 (mask 4): left Ctrl is pressed
3263
  * bit 3 (mask 8): right Ctrl is pressed
3274
  * bit 3 (mask 8): right Ctrl is pressed
3264
  * bit 4 (mask 0x10): left Alt is pressed
3275
  * bit 4 (mask 0x10): left Alt is pressed
3265
  * bit 5 (mask 0x20): right Alt is pressed
3276
  * bit 5 (mask 0x20): right Alt is pressed
3266
  * bit 6 (mask 0x40): CapsLock is on
3277
  * bit 6 (mask 0x40): CapsLock is on
3267
  * bit 7 (mask 0x80): NumLock is on
3278
  * bit 7 (mask 0x80): NumLock is on
3268
  * bit 8 (mask 0x100): ScrollLock is on
3279
  * bit 8 (mask 0x100): ScrollLock is on
3269
  * other bits are cleared
3280
  * other bits are cleared
3270
 
3281
 
3271
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3282
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3272
When hotkey is pressed, the system notifies only those applications,
3283
When hotkey is pressed, the system notifies only those applications,
3273
which have installed it; the active application (which receives
3284
which have installed it; the active application (which receives
3274
all normal input) does not receive such keys.
3285
all normal input) does not receive such keys.
3275
The notification consists in sending event with the code 2.
3286
The notification consists in sending event with the code 2.
3276
Reading hotkey is the same as reading normal key - by function 2.
3287
Reading hotkey is the same as reading normal key - by function 2.
3277
Parameters:
3288
Parameters:
3278
  * eax = 66 - function number
3289
  * eax = 66 - function number
3279
  * ebx = 4 - subfunction number
3290
  * ebx = 4 - subfunction number
3280
  * cl determines key scancode;
3291
  * cl determines key scancode;
3281
    use cl=0 to give combinations such as Ctrl+Shift
3292
    use cl=0 to give combinations such as Ctrl+Shift
3282
  * edx = 0xXYZ determines possible states of control keys:
3293
  * edx = 0xXYZ determines possible states of control keys:
3283
    * Z (low 4 bits) determines state of LShift and RShift:
3294
    * Z (low 4 bits) determines state of LShift and RShift:
3284
      * 0 = no key must be pressed;
3295
      * 0 = no key must be pressed;
3285
      * 1 = exactly one key must be pressed;
3296
      * 1 = exactly one key must be pressed;
3286
      * 2 = both keys must be pressed;
3297
      * 2 = both keys must be pressed;
3287
      * 3 = must be pressed LShift, but not RShift;
3298
      * 3 = must be pressed LShift, but not RShift;
3288
      * 4 = must be pressed RShift, but not LShift
3299
      * 4 = must be pressed RShift, but not LShift
3289
    * Y - similar for LCtrl and RCtrl;
3300
    * Y - similar for LCtrl and RCtrl;
3290
    * X - similar for LAlt and RAlt
3301
    * X - similar for LAlt and RAlt
3291
Returned value:
3302
Returned value:
3292
  * eax=0 - success
3303
  * eax=0 - success
3293
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3304
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3294
Remarks:
3305
Remarks:
3295
  * Hotkey can work either at pressing or at release. Release
3306
  * Hotkey can work either at pressing or at release. Release
3296
    scancode of a key is more on 128 than pressing scancode
3307
    scancode of a key is more on 128 than pressing scancode
3297
    (i.e. high bit is set).
3308
    (i.e. high bit is set).
3298
  * Several applications can set the same combination;
3309
  * Several applications can set the same combination;
3299
    all such applications will be informed on pressing
3310
    all such applications will be informed on pressing
3300
    such combination.
3311
    such combination.
3301
 
3312
 
3302
-------------- Subfunction 5 - delete installed hotkey. --------------
3313
-------------- Subfunction 5 - delete installed hotkey. --------------
3303
Parameters:
3314
Parameters:
3304
  * eax = 66 - function number
3315
  * eax = 66 - function number
3305
  * ebx = 5 - subfunction number
3316
  * ebx = 5 - subfunction number
3306
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3317
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3307
Returned value:
3318
Returned value:
3308
  * eax = 0 - success
3319
  * eax = 0 - success
3309
  * eax = 1 - there is no such hotkey
3320
  * eax = 1 - there is no such hotkey
3310
Remarks:
3321
Remarks:
3311
  * When a process/thread terminates, all hotkey installed by it are
3322
  * When a process/thread terminates, all hotkey installed by it are
3312
    deleted.
3323
    deleted.
3313
  * The call to this subfunction does not affect other applications.
3324
  * The call to this subfunction does not affect other applications.
3314
    If other application has defined the same combination, it will
3325
    If other application has defined the same combination, it will
3315
    still receive notices.
3326
    still receive notices.
3316
 
3327
 
3317
======================================================================
3328
======================================================================
3318
========= Function 67 - change position/sizes of the window. =========
3329
========= Function 67 - change position/sizes of the window. =========
3319
======================================================================
3330
======================================================================
3320
Parameters:
3331
Parameters:
3321
  * eax = 67 - function number
3332
  * eax = 67 - function number
3322
  * ebx = new x-coordinate of the window
3333
  * ebx = new x-coordinate of the window
3323
  * ecx = new y-coordinate of the window
3334
  * ecx = new y-coordinate of the window
3324
  * edx = new x-size of the window
3335
  * edx = new x-size of the window
3325
  * esi = new y-size of the window
3336
  * esi = new y-size of the window
3326
Returned value:
3337
Returned value:
3327
  * function does not return value
3338
  * function does not return value
3328
Remarks:
3339
Remarks:
3329
  * The value -1 for a parameter means "do not change"; e.g. to move
3340
  * The value -1 for a parameter means "do not change"; e.g. to move
3330
    the window without resizing it is possible to specify edx=esi=-1.
3341
    the window without resizing it is possible to specify edx=esi=-1.
3331
  * Previously the window must be defined by function 0.
3342
  * Previously the window must be defined by function 0.
3332
    It sets initial coordinates and sizes of the window.
3343
    It sets initial coordinates and sizes of the window.
3333
  * Sizes of the window are understood in sense of function 0,
3344
  * Sizes of the window are understood in sense of function 0,
3334
    that is one pixel less than real sizes.
3345
    that is one pixel less than real sizes.
3335
  * The function call for maximized windows is simply ignored.
3346
  * The function call for maximized windows is simply ignored.
3336
  * For windows of appropriate styles position and/or sizes can be
3347
  * For windows of appropriate styles position and/or sizes can be
3337
    changed by user; current position and sizes can be obtained by
3348
    changed by user; current position and sizes can be obtained by
3338
    call to function 9.
3349
    call to function 9.
3339
  * The function sends to the window redraw event (with the code 1).
3350
  * The function sends to the window redraw event (with the code 1).
3340
 
3351
 
3341
======================================================================
3352
======================================================================
3342
====== Function 68, subfunction 0 - get the task switch counter. =====
3353
====== Function 68, subfunction 0 - get the task switch counter. =====
3343
======================================================================
3354
======================================================================
3344
Parameters:
3355
Parameters:
3345
  * eax = 68 - function number
3356
  * eax = 68 - function number
3346
  * ebx = 0 - subfunction number
3357
  * ebx = 0 - subfunction number
3347
Returned value:
3358
Returned value:
3348
  * eax = number of task switches from the system booting
3359
  * eax = number of task switches from the system booting
3349
    (modulo 2^32)
3360
    (modulo 2^32)
3350
 
3361
 
3351
======================================================================
3362
======================================================================
3352
======= Function 68, subfunction 1 - switch to the next thread. ======
3363
======= Function 68, subfunction 1 - switch to the next thread. ======
3353
======================================================================
3364
======================================================================
3354
The function completes the current time slice allocated to the
3365
The function completes the current time slice allocated to the
3355
thread and switches to the next. (Which thread in which process
3366
thread and switches to the next. (Which thread in which process
3356
will be next, is unpredictable). Later, when execution queue
3367
will be next, is unpredictable). Later, when execution queue
3357
will reach the current thread, execution will be continued.
3368
will reach the current thread, execution will be continued.
3358
Parameters:
3369
Parameters:
3359
  * eax = 68 - function number
3370
  * eax = 68 - function number
3360
  * ebx = 1 - subfunction number
3371
  * ebx = 1 - subfunction number
3361
Returned value:
3372
Returned value:
3362
  * function does not return value
3373
  * function does not return value
3363
 
3374
 
3364
======================================================================
3375
======================================================================
3365
============= Function 68, subfunction 2 - cache + rdpmc. ============
3376
============= Function 68, subfunction 2 - cache + rdpmc. ============
3366
======================================================================
3377
======================================================================
3367
Parameters:
3378
Parameters:
3368
  * eax = 68 - function number
3379
  * eax = 68 - function number
3369
  * ebx = 2 - subfunction number
3380
  * ebx = 2 - subfunction number
3370
  * ecx = required action:
3381
  * ecx = required action:
3371
    * ecx = 0 - enable instruction 'rdpmc'
3382
    * ecx = 0 - enable instruction 'rdpmc'
3372
      (ReaD Performance-Monitoring Counters) for applications
3383
      (ReaD Performance-Monitoring Counters) for applications
3373
    * ecx = 1 - find out whether cache is disabled/enabled
3384
    * ecx = 1 - find out whether cache is disabled/enabled
3374
    * ecx = 2 - enable cache
3385
    * ecx = 2 - enable cache
3375
    * ecx = 3 - disable cache
3386
    * ecx = 3 - disable cache
3376
Returned value:
3387
Returned value:
3377
  * for ecx=0:
3388
  * for ecx=0:
3378
    * eax = the value of cr4
3389
    * eax = the value of cr4
3379
  * for ecx=1:
3390
  * for ecx=1:
3380
    * eax = (cr0 and 0x60000000):
3391
    * eax = (cr0 and 0x60000000):
3381
    * eax = 0 - cache is on
3392
    * eax = 0 - cache is on
3382
    * eax <> 0 - cache is off
3393
    * eax <> 0 - cache is off
3383
  * for ecx=2 and ecx=3:
3394
  * for ecx=2 and ecx=3:
3384
    * function does not return value
3395
    * function does not return value
3385
 
3396
 
3386
======================================================================
3397
======================================================================
3387
=========== Function 68, subfunction 3 - read MSR-register. ==========
3398
=========== Function 68, subfunction 3 - read MSR-register. ==========
3388
======================================================================
3399
======================================================================
3389
MSR = Model Specific Register; the complete list of MSR-registers
3400
MSR = Model Specific Register; the complete list of MSR-registers
3390
of a processor is included to the documentation on it (for example,
3401
of a processor is included to the documentation on it (for example,
3391
IA-32 Intel Architecture Software Developer's Manual,
3402
IA-32 Intel Architecture Software Developer's Manual,
3392
Volume 3, Appendix B); each processor family has its own subset
3403
Volume 3, Appendix B); each processor family has its own subset
3393
of the MSR-registers.
3404
of the MSR-registers.
3394
Parameters:
3405
Parameters:
3395
  * eax = 68 - function number
3406
  * eax = 68 - function number
3396
  * ebx = 3 - subfunction number
3407
  * ebx = 3 - subfunction number
3397
  * ecx is ignored
3408
  * ecx is ignored
3398
  * edx = MSR address
3409
  * edx = MSR address
3399
Returned value:
3410
Returned value:
3400
  * ebx:eax = high:low dword of the result
3411
  * ebx:eax = high:low dword of the result
3401
Remarks:
3412
Remarks:
3402
  * If ecx contains nonexistent or not implemented for this processor
3413
  * If ecx contains nonexistent or not implemented for this processor
3403
    MSR, processor will generate an exception in the kernel, which
3414
    MSR, processor will generate an exception in the kernel, which
3404
    will kill the thread.
3415
    will kill the thread.
3405
  * Previously it is necessary to check, whether MSRs are supported
3416
  * Previously it is necessary to check, whether MSRs are supported
3406
    as a whole, with the instruction 'cpuid'. Otherwise processor
3417
    as a whole, with the instruction 'cpuid'. Otherwise processor
3407
    will generate other exception in the kernel, which will anyway
3418
    will generate other exception in the kernel, which will anyway
3408
    kill the thread.
3419
    kill the thread.
3409
 
3420
 
3410
======================================================================
3421
======================================================================
3411
========= Function 68, subfunction 4 - write to MSR-register. ========
3422
========= Function 68, subfunction 4 - write to MSR-register. ========
3412
======================================================================
3423
======================================================================
3413
MSR = Model Specific Register; the complete list of MSR-registers
3424
MSR = Model Specific Register; the complete list of MSR-registers
3414
of a processor is included to the documentation on it (for example,
3425
of a processor is included to the documentation on it (for example,
3415
IA-32 Intel Architecture Software Developer's Manual,
3426
IA-32 Intel Architecture Software Developer's Manual,
3416
Volume 3, Appendix B); each processor family has its own subset
3427
Volume 3, Appendix B); each processor family has its own subset
3417
of the MSR-registers.
3428
of the MSR-registers.
3418
Parameters:
3429
Parameters:
3419
  * eax = 68 - function number
3430
  * eax = 68 - function number
3420
  * ebx = 4 - subfunction number
3431
  * ebx = 4 - subfunction number
3421
  * ecx is ignored
3432
  * ecx is ignored
3422
  * edx = MSR address
3433
  * edx = MSR address
3423
  * esi:edi = high:low dword
3434
  * esi:edi = high:low dword
3424
Returned value:
3435
Returned value:
3425
  * function does not return value
3436
  * function does not return value
3426
Remarks:
3437
Remarks:
3427
  * If ecx contains nonexistent or not implemented for this processor
3438
  * If ecx contains nonexistent or not implemented for this processor
3428
    MSR, processor will generate an exception in the kernel, which
3439
    MSR, processor will generate an exception in the kernel, which
3429
    will kill the thread.
3440
    will kill the thread.
3430
  * Previously it is necessary to check, whether MSRs are supported
3441
  * Previously it is necessary to check, whether MSRs are supported
3431
    as a whole, with the instruction 'cpuid'. Otherwise processor
3442
    as a whole, with the instruction 'cpuid'. Otherwise processor
3432
    will generate other exception in the kernel, which will anyway
3443
    will generate other exception in the kernel, which will anyway
3433
    kill the thread.
3444
    kill the thread.
3434
 
3445
 
3435
======================================================================
3446
======================================================================
3436
======= Function 68, subfunction 11 - initialize process heap. =======
3447
======= Function 68, subfunction 11 - initialize process heap. =======
3437
======================================================================
3448
======================================================================
3438
Parameters:
3449
Parameters:
3439
  * eax = 68 - function number
3450
  * eax = 68 - function number
3440
  * ebx = 11 - subfunction number
3451
  * ebx = 11 - subfunction number
3441
Returned value:
3452
Returned value:
3442
  * eax = 0 - failed
3453
  * eax = 0 - failed
3443
  * otherwise size of created heap
3454
  * otherwise size of created heap
3444
Remarks:
3455
Remarks:
3445
  * The function call initializes heap, from which one can in future
3456
  * The function call initializes heap, from which one can in future
3446
    allocate and free memory blocks with subfunctions 12 and 13.
3457
    allocate and free memory blocks with subfunctions 12 and 13.
3447
    Heap size is equal to total amount of free application memory.
3458
    Heap size is equal to total amount of free application memory.
3448
  * The second function call from the same process results in
3459
  * The second function call from the same process results in
3449
    returning the size of the existing heap.
3460
    returning the size of the existing heap.
3450
  * After creation of the heap calls to function 64 will be ignored.
3461
  * After creation of the heap calls to function 64 will be ignored.
3451
 
3462
 
3452
======================================================================
3463
======================================================================
3453
======== Function 68, subfunction 12 - allocate memory block. ========
3464
======== Function 68, subfunction 12 - allocate memory block. ========
3454
======================================================================
3465
======================================================================
3455
Parameters:
3466
Parameters:
3456
  * eax = 68 - function number
3467
  * eax = 68 - function number
3457
  * ebx = 12 - subfunction number
3468
  * ebx = 12 - subfunction number
3458
  * ecx = required size in bytes
3469
  * ecx = required size in bytes
3459
Returned value:
3470
Returned value:
3460
  * eax = pointer to the allocated block
3471
  * eax = pointer to the allocated block
3461
Remarks:
3472
Remarks:
3462
  * Before this call one must initialize process heap by call to
3473
  * Before this call one must initialize process heap by call to
3463
    subfunction 11.
3474
    subfunction 11.
3464
  * The function allocates an integer number of pages (4 Kb) in such
3475
  * The function allocates an integer number of pages (4 Kb) in such
3465
    way that the real size of allocated block is more than or equal to
3476
    way that the real size of allocated block is more than or equal to
3466
    requested size.
3477
    requested size.
3467
 
3478
 
3468
======================================================================
3479
======================================================================
3469
========== Function 68, subfunction 13 - free memory block. ==========
3480
========== Function 68, subfunction 13 - free memory block. ==========
3470
======================================================================
3481
======================================================================
3471
Parameters:
3482
Parameters:
3472
  * eax = 68 - function number
3483
  * eax = 68 - function number
3473
  * ebx = 13 - subfunction number
3484
  * ebx = 13 - subfunction number
3474
  * ecx = pointer to the memory block
3485
  * ecx = pointer to the memory block
3475
Returned value:
3486
Returned value:
3476
  * eax = 1 - success
3487
  * eax = 1 - success
3477
  * eax = 0 - failed
3488
  * eax = 0 - failed
3478
Remarks:
3489
Remarks:
3479
  * The memory block must have been allocated by subfunction 12
3490
  * The memory block must have been allocated by subfunction 12
3480
    or subfunction 20.
3491
    or subfunction 20.
3481
 
3492
 
3482
======================================================================
3493
======================================================================
3483
===================== Function 68, subfunction 14 ====================
3494
===================== Function 68, subfunction 14 ====================
3484
============ Wait for signal from another program/driver. ============
3495
============ Wait for signal from another program/driver. ============
3485
======================================================================
3496
======================================================================
3486
Parameters:
3497
Parameters:
3487
  * eax = 68 - function number
3498
  * eax = 68 - function number
3488
  * ebx = 14 - subfunction number
3499
  * ebx = 14 - subfunction number
3489
  * ecx = pointer to the buffer for information (24 bytes)
3500
  * ecx = pointer to the buffer for information (24 bytes)
3490
Returned value:
3501
Returned value:
3491
  * buffer pointed to by ecx contains the following information:
3502
  * buffer pointed to by ecx contains the following information:
3492
    * +0: dword: identifier for following data of signal
3503
    * +0: dword: identifier for following data of signal
3493
    * +4: dword: data of signal (20 bytes), format of which is defined
3504
    * +4: dword: data of signal (20 bytes), format of which is defined
3494
          by the first dword
3505
          by the first dword
3495
 
3506
 
3496
======================================================================
3507
======================================================================
3497
============= Function 68, subfunction 16 - load driver. =============
3508
============= Function 68, subfunction 16 - load driver. =============
3498
======================================================================
3509
======================================================================
3499
Parameters:
3510
Parameters:
3500
  * eax = 68 - function number
3511
  * eax = 68 - function number
3501
  * ebx = 16 - subfunction number
3512
  * ebx = 16 - subfunction number
3502
  * ecx = pointer to ASCIIZ-string with driver name
3513
  * ecx = pointer to ASCIIZ-string with driver name
3503
Returned value:
3514
Returned value:
3504
  * eax = 0 - failed
3515
  * eax = 0 - failed
3505
  * otherwise eax = driver handle
3516
  * otherwise eax = driver handle
3506
Remarks:
3517
Remarks:
3507
  * If the driver was not loaded yet, it is loaded;
3518
  * If the driver was not loaded yet, it is loaded;
3508
    if the driver was loaded yet, nothing happens.
3519
    if the driver was loaded yet, nothing happens.
3509
  * Driver name is case-sensitive.
3520
  * Driver name is case-sensitive.
3510
    Maximum length of the name is 16 characters, including
3521
    Maximum length of the name is 16 characters, including
3511
    terminating null character, the rest is ignored.
3522
    terminating null character, the rest is ignored.
3512
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3523
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3513
 
3524
 
3514
======================================================================
3525
======================================================================
3515
============ Function 68, subfunction 17 - driver control. ===========
3526
============ Function 68, subfunction 17 - driver control. ===========
3516
======================================================================
3527
======================================================================
3517
Parameters:
3528
Parameters:
3518
  * eax = 68 - function number
3529
  * eax = 68 - function number
3519
  * ebx = 17 - subfunction number
3530
  * ebx = 17 - subfunction number
3520
  * ecx = pointer to the control structure:
3531
  * ecx = pointer to the control structure:
3521
    * +0: dword: handle of driver
3532
    * +0: dword: handle of driver
3522
    * +4: dword: code of driver function
3533
    * +4: dword: code of driver function
3523
    * +8: dword: pointer to input data
3534
    * +8: dword: pointer to input data
3524
    * +12 = +0xC: dword: size of input data
3535
    * +12 = +0xC: dword: size of input data
3525
    * +16 = +0x10: dword: pointer to output data
3536
    * +16 = +0x10: dword: pointer to output data
3526
    * +20 = +0x14: dword: size of output data
3537
    * +20 = +0x14: dword: size of output data
3527
Returned value:
3538
Returned value:
3528
  * eax = determined by driver
3539
  * eax = determined by driver
3529
Remarks:
3540
Remarks:
3530
  * Function codes and the structure of input/output data
3541
  * Function codes and the structure of input/output data
3531
    are defined by driver.
3542
    are defined by driver.
3532
  * Previously one must obtain driver handle by subfunction 16.
3543
  * Previously one must obtain driver handle by subfunction 16.
3533
 
3544
 
3534
======================================================================
3545
======================================================================
3535
=============== Function 68, subfunction 19 - load DLL. ==============
3546
=============== Function 68, subfunction 19 - load DLL. ==============
3536
======================================================================
3547
======================================================================
3537
Parameters:
3548
Parameters:
3538
  * eax = 68 - function number
3549
  * eax = 68 - function number
3539
  * ebx = 19 - subfunction number
3550
  * ebx = 19 - subfunction number
3540
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3551
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3541
Returned value:
3552
Returned value:
3542
  * eax = 0 - failed
3553
  * eax = 0 - failed
3543
  * otherwise eax = pointer to DLL export table
3554
  * otherwise eax = pointer to DLL export table
3544
Remarks:
3555
Remarks:
3545
  * Export table is an array of structures of 2 dword's, terminated
3556
  * Export table is an array of structures of 2 dword's, terminated
3546
    by zero. The first dword in structure points to function name,
3557
    by zero. The first dword in structure points to function name,
3547
    the second dword contains address of function.
3558
    the second dword contains address of function.
3548
 
3559
 
3549
======================================================================
3560
======================================================================
3550
======= Function 68, subfunction 20 - reallocate memory block. =======
3561
======= Function 68, subfunction 20 - reallocate memory block. =======
3551
======================================================================
3562
======================================================================
3552
Parameters:
3563
Parameters:
3553
  * eax = 68 - function number
3564
  * eax = 68 - function number
3554
  * ebx = 20 - subfunction number
3565
  * ebx = 20 - subfunction number
3555
  * ecx = new size in bytes
3566
  * ecx = new size in bytes
3556
  * edx = pointer to already allocated block
3567
  * edx = pointer to already allocated block
3557
Returned value:
3568
Returned value:
3558
  * eax = pointer to the reallocated block, 0 = error
3569
  * eax = pointer to the reallocated block, 0 = error
3559
Remarks:
3570
Remarks:
3560
  * Before this call one must initialize process heap by call to
3571
  * Before this call one must initialize process heap by call to
3561
    subfunction 11.
3572
    subfunction 11.
3562
  * The function allocates an integer number of pages (4 Kb) in such
3573
  * The function allocates an integer number of pages (4 Kb) in such
3563
    way that the real size of allocated block is more than or equal to
3574
    way that the real size of allocated block is more than or equal to
3564
    requested size.
3575
    requested size.
3565
  * If edx=0, the function call is equivalent to memory allocation
3576
  * If edx=0, the function call is equivalent to memory allocation
3566
    with subfunction 12. Otherwise the block at edx
3577
    with subfunction 12. Otherwise the block at edx
3567
    must be allocated earlier with subfunction 12 or this subfunction.
3578
    must be allocated earlier with subfunction 12 or this subfunction.
3568
  * If ecx=0, the function frees memory block at edx and returns 0.
3579
  * If ecx=0, the function frees memory block at edx and returns 0.
3569
  * The contents of the block are unchanged up to the shorter of
3580
  * The contents of the block are unchanged up to the shorter of
3570
    the new and old sizes.
3581
    the new and old sizes.
3571
 
3582
 
3572
======================================================================
3583
======================================================================
3573
======== Function 68, subfunction 22 - open named memory area. =======
3584
======== Function 68, subfunction 22 - open named memory area. =======
3574
======================================================================
3585
======================================================================
3575
Parameters:
3586
Parameters:
3576
  * eax = 68 - function number
3587
  * eax = 68 - function number
3577
  * ebx = 22 - subfunction number
3588
  * ebx = 22 - subfunction number
3578
  * ecx = area name. Maximum of 31 characters with terminating zero
3589
  * ecx = area name. Maximum of 31 characters with terminating zero
3579
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3590
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3580
  * esi = flags for open and access:
3591
  * esi = flags for open and access:
3581
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3592
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3582
                          with such name does not exist, the function
3593
                          with such name does not exist, the function
3583
                          will return error code 5.
3594
                          will return error code 5.
3584
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3595
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3585
                          memory area.
3596
                          memory area.
3586
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3597
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3587
                          with such name already exists, the function
3598
                          with such name already exists, the function
3588
                          will return error code 10.
3599
                          will return error code 10.
3589
    * SHM_READ        = 0x00 - only read access
3600
    * SHM_READ        = 0x00 - only read access
3590
    * SHM_WRITE       = 0x01 - read and write access
3601
    * SHM_WRITE       = 0x01 - read and write access
3591
Returned value:
3602
Returned value:
3592
  * eax = pointer to memory area, 0 if error has occured
3603
  * eax = pointer to memory area, 0 if error has occured
3593
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3604
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3594
    edx = 0 - success, otherwise - error code
3605
    edx = 0 - success, otherwise - error code
3595
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3606
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3596
    edx = error code (if eax=0) or area size in bytes
3607
    edx = error code (if eax=0) or area size in bytes
3597
Error codes:
3608
Error codes:
3598
  * E_NOTFOUND = 5
3609
  * E_NOTFOUND = 5
3599
  * E_ACCESS = 10
3610
  * E_ACCESS = 10
3600
  * E_NOMEM = 30
3611
  * E_NOMEM = 30
3601
  * E_PARAM = 33
3612
  * E_PARAM = 33
3602
Remarks:
3613
Remarks:
3603
  * Before this call one must initialize process heap by call to
3614
  * Before this call one must initialize process heap by call to
3604
    subfunction 11.
3615
    subfunction 11.
3605
  * If a new area is created, access flags set maximal rights
3616
  * If a new area is created, access flags set maximal rights
3606
    for other processes. An attempt from other process to open
3617
    for other processes. An attempt from other process to open
3607
    with denied rights will fail with error code E_ACCESS.
3618
    with denied rights will fail with error code E_ACCESS.
3608
  * The process which has created an area always has write access.
3619
  * The process which has created an area always has write access.
3609
 
3620
 
3610
======================================================================
3621
======================================================================
3611
======= Function 68, subfunction 23 - close named memory area. =======
3622
======= Function 68, subfunction 23 - close named memory area. =======
3612
======================================================================
3623
======================================================================
3613
Parameters:
3624
Parameters:
3614
  * eax = 68 - function number
3625
  * eax = 68 - function number
3615
  * ebx = 23 - subfunction number
3626
  * ebx = 23 - subfunction number
3616
  * ecx = area name. Maximum of 31 characters with terminating zero
3627
  * ecx = area name. Maximum of 31 characters with terminating zero
3617
Returned value:
3628
Returned value:
3618
  * eax destroyed
3629
  * eax destroyed
3619
Remarks:
3630
Remarks:
3620
  * A memory area is physically freed (with deleting all data and
3631
  * A memory area is physically freed (with deleting all data and
3621
    freeing physical memory), when all threads which have opened
3632
    freeing physical memory), when all threads which have opened
3622
    this area will close it.
3633
    this area will close it.
3623
  * When thread is terminating, all opened by it areas are closed.
3634
  * When thread is terminating, all opened by it areas are closed.
3624
 
3635
 
3625
======================================================================
3636
======================================================================
3626
======== Function 68, subfunction 24 - set exception handler. ========
3637
======== Function 68, subfunction 24 - set exception handler. ========
3627
======================================================================
3638
======================================================================
3628
Parameters:
3639
Parameters:
3629
  * eax = 68 - function number
3640
  * eax = 68 - function number
3630
  * ebx = 24 - subfunction number
3641
  * ebx = 24 - subfunction number
3631
  * ecx = address of the new exception handler
3642
  * ecx = address of the new exception handler
3632
  * edx = the mask of handled exceptions
3643
  * edx = the mask of handled exceptions
3633
Returned value:
3644
Returned value:
3634
  * eax = address of the old exception handler (0, if it was not set)
3645
  * eax = address of the old exception handler (0, if it was not set)
3635
  * ebx = the old mask of handled exceptions
3646
  * ebx = the old mask of handled exceptions
3636
Remarks:
3647
Remarks:
3637
  * Bit number in mask of exceptions corresponds to exception number
3648
  * Bit number in mask of exceptions corresponds to exception number
3638
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3649
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3639
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3650
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3640
  * The current implementation ignores the inquiry for hook of 7
3651
  * The current implementation ignores the inquiry for hook of 7
3641
    exception - the system handles #NM by its own.
3652
    exception - the system handles #NM by its own.
3642
  * The exception handler is called with exception number as first
3653
  * The exception handler is called with exception number as first
3643
    (and only) stack parameter. So, correct exit from the handler is
3654
    (and only) stack parameter. So, correct exit from the handler is
3644
    RET 4. It returns to the instruction, that caused the exception,
3655
    RET 4. It returns to the instruction, that caused the exception,
3645
    for faults, and to the next instruction for traps (see
3656
    for faults, and to the next instruction for traps (see
3646
    classification of exceptions in CPU specification).
3657
    classification of exceptions in CPU specification).
3647
  * When user handler receives control, the corresponding bit in
3658
  * When user handler receives control, the corresponding bit in
3648
    the exception mask is cleared. Raising this exception
3659
    the exception mask is cleared. Raising this exception
3649
    in consequence leads to default handling, that is,
3660
    in consequence leads to default handling, that is,
3650
    terminating the application in absence of debugger or
3661
    terminating the application in absence of debugger or
3651
    suspend with notification of debugger otherwise.
3662
    suspend with notification of debugger otherwise.
3652
  * After user handler completes critical operations, it can set
3663
  * After user handler completes critical operations, it can set
3653
    the corresponding bit in the exception mask with subfunction 25.
3664
    the corresponding bit in the exception mask with subfunction 25.
3654
    Also user handler is responsible for clearing exceptions flags in
3665
    Also user handler is responsible for clearing exceptions flags in
3655
    FPU and/or SSE.
3666
    FPU and/or SSE.
3656
 
3667
 
3657
======================================================================
3668
======================================================================
3658
====== Function 68, subfunction 25 - set FPU exception handler. ======
3669
====== Function 68, subfunction 25 - set FPU exception handler. ======
3659
======================================================================
3670
======================================================================
3660
Parameters:
3671
Parameters:
3661
  * eax = 68 - function number
3672
  * eax = 68 - function number
3662
  * ebx = 25 - subfunction number
3673
  * ebx = 25 - subfunction number
3663
  * ecx = signal number
3674
  * ecx = signal number
3664
  * edx = value of activity (0/1)
3675
  * edx = value of activity (0/1)
3665
Returned value:
3676
Returned value:
3666
  * eax = -1 - invalid signal number
3677
  * eax = -1 - invalid signal number
3667
  * otherwise eax = old value of activity for this signal (0/1)
3678
  * otherwise eax = old value of activity for this signal (0/1)
3668
Remarks:
3679
Remarks:
3669
  * In current implementation only mask for user excepton handler,
3680
  * In current implementation only mask for user excepton handler,
3670
    which has been previously set by subfunction 24,
3681
    which has been previously set by subfunction 24,
3671
    is changed. Signal number corresponds to exception number.
3682
    is changed. Signal number corresponds to exception number.
3672
 
3683
 
3673
======================================================================
3684
======================================================================
3674
====================== Function 69 - debugging. ======================
3685
====================== Function 69 - debugging. ======================
3675
======================================================================
3686
======================================================================
3676
A process can load other process as debugged by set of corresponding
3687
A process can load other process as debugged by set of corresponding
3677
bit by call to subfunction 7 of function 70.
3688
bit by call to subfunction 7 of function 70.
3678
A process can have only one debugger; one process can debug some
3689
A process can have only one debugger; one process can debug some
3679
others. The system notifies debugger on events occuring with
3690
others. The system notifies debugger on events occuring with
3680
debugged process. Messages are written to the buffer defined by
3691
debugged process. Messages are written to the buffer defined by
3681
subfunction 0.
3692
subfunction 0.
3682
Format of a message:
3693
Format of a message:
3683
  * +0: dword: message code
3694
  * +0: dword: message code
3684
  * +4: dword: PID of debugged process
3695
  * +4: dword: PID of debugged process
3685
  * +8: there can be additional data depending on message code
3696
  * +8: there can be additional data depending on message code
3686
Message codes:
3697
Message codes:
3687
  * 1 = exception
3698
  * 1 = exception
3688
    * in addition dword-number of the exception is given
3699
    * in addition dword-number of the exception is given
3689
    * process is suspended
3700
    * process is suspended
3690
  * 2 = process has terminated
3701
  * 2 = process has terminated
3691
    * comes at any termination: both through the system function -1,
3702
    * comes at any termination: both through the system function -1,
3692
      and at "murder" by any other process (including debugger itself)
3703
      and at "murder" by any other process (including debugger itself)
3693
  * 3 = debug exception int 1 = #DB
3704
  * 3 = debug exception int 1 = #DB
3694
    * in addition dword-image of the register DR6 is given:
3705
    * in addition dword-image of the register DR6 is given:
3695
      * bits 0-3: condition of the corresponding breakpoint (set by
3706
      * bits 0-3: condition of the corresponding breakpoint (set by
3696
        subfunction 9) is satisfied
3707
        subfunction 9) is satisfied
3697
      * áèò 14: exception has occured because of the trace mode
3708
      * áèò 14: exception has occured because of the trace mode
3698
        (flag TF is set TF)
3709
        (flag TF is set TF)
3699
    * process is suspended
3710
    * process is suspended
3700
When debugger terminates, all debugged processes are killed.
3711
When debugger terminates, all debugged processes are killed.
3701
If debugger does not want this, it must previously detach by
3712
If debugger does not want this, it must previously detach by
3702
subfunction 3.
3713
subfunction 3.
3703
 
3714
 
3704
All subfunctions are applicable only to processes/threads started
3715
All subfunctions are applicable only to processes/threads started
3705
from the current by function 70 with set debugging flag.
3716
from the current by function 70 with set debugging flag.
3706
Debugging of multithreaded programs is not supported yet.
3717
Debugging of multithreaded programs is not supported yet.
3707
The full list of subfunctions:
3718
The full list of subfunctions:
3708
  * subfunction 0 - define data area for debug messages
3719
  * subfunction 0 - define data area for debug messages
3709
  * subfunction 1 - get contents of registers of debugged thread
3720
  * subfunction 1 - get contents of registers of debugged thread
3710
  * subfunction 2 - set contents of registers of debugged thread
3721
  * subfunction 2 - set contents of registers of debugged thread
3711
  * subfunction 3 - detach from debugged process
3722
  * subfunction 3 - detach from debugged process
3712
  * subfunction 4 - suspend debugged thread
3723
  * subfunction 4 - suspend debugged thread
3713
  * subfunction 5 - resume debugged thread
3724
  * subfunction 5 - resume debugged thread
3714
  * subfunction 6 - read from the memory of debugged process
3725
  * subfunction 6 - read from the memory of debugged process
3715
  * subfunction 7 - write to the memory of debugged process
3726
  * subfunction 7 - write to the memory of debugged process
3716
  * subfunction 8 - terminate debugged thread
3727
  * subfunction 8 - terminate debugged thread
3717
  * subfunction 9 - set/clear hardware breakpoint
3728
  * subfunction 9 - set/clear hardware breakpoint
3718
 
3729
 
3719
======================================================================
3730
======================================================================
3720
= Function 69, subfunction 0 - define data area fror debug messages. =
3731
= Function 69, subfunction 0 - define data area fror debug messages. =
3721
======================================================================
3732
======================================================================
3722
Parameters:
3733
Parameters:
3723
  * eax = 69 - function number
3734
  * eax = 69 - function number
3724
  * ebx = 0 - subfunction number
3735
  * ebx = 0 - subfunction number
3725
  * ecx = pointer
3736
  * ecx = pointer
3726
Format of data area:
3737
Format of data area:
3727
  * +0: dword: N = buffer size (not including this header)
3738
  * +0: dword: N = buffer size (not including this header)
3728
  * +4: dword: occupied place
3739
  * +4: dword: occupied place
3729
  * +8: N*byte: buffer
3740
  * +8: N*byte: buffer
3730
Returned value:
3741
Returned value:
3731
  * function does not return value
3742
  * function does not return value
3732
Remarks:
3743
Remarks:
3733
  * If the size field is negative, the buffer is considered locked
3744
  * If the size field is negative, the buffer is considered locked
3734
    and at arrival of new message the system will wait.
3745
    and at arrival of new message the system will wait.
3735
    For synchronization frame all work with the buffer by operations
3746
    For synchronization frame all work with the buffer by operations
3736
    lock/unlock
3747
    lock/unlock
3737
    	neg	[bufsize]
3748
    	neg	[bufsize]
3738
  * Data in the buffer are considered as array of items with variable
3749
  * Data in the buffer are considered as array of items with variable
3739
    length - messages. Format of a message is explained in
3750
    length - messages. Format of a message is explained in
3740
    general description.
3751
    general description.
3741
 
3752
 
3742
======================================================================
3753
======================================================================
3743
===================== Function 69, subfunction 1 =====================
3754
===================== Function 69, subfunction 1 =====================
3744
============ Get contents of registers of debugged thread. ===========
3755
============ Get contents of registers of debugged thread. ===========
3745
======================================================================
3756
======================================================================
3746
Parameters:
3757
Parameters:
3747
  * eax = 69 - function number
3758
  * eax = 69 - function number
3748
  * ebx = 1 - subfunction number
3759
  * ebx = 1 - subfunction number
3749
  * ecx = thread identifier
3760
  * ecx = thread identifier
3750
  * edx = size of context structure, must be 0x28=40 bytes
3761
  * edx = size of context structure, must be 0x28=40 bytes
3751
  * esi = pointer to context structure
3762
  * esi = pointer to context structure
3752
Returned value:
3763
Returned value:
3753
  * function does not return value
3764
  * function does not return value
3754
Format of context structure: (FPU is not supported yet)
3765
Format of context structure: (FPU is not supported yet)
3755
  * +0: dword: eip
3766
  * +0: dword: eip
3756
  * +4: dword: eflags
3767
  * +4: dword: eflags
3757
  * +8: dword: eax
3768
  * +8: dword: eax
3758
  * +12 = +0xC: dword: ecx
3769
  * +12 = +0xC: dword: ecx
3759
  * +16 = +0x10: dword: edx
3770
  * +16 = +0x10: dword: edx
3760
  * +20 = +0x14: dword: ebx
3771
  * +20 = +0x14: dword: ebx
3761
  * +24 = +0x18: dword: esp
3772
  * +24 = +0x18: dword: esp
3762
  * +28 = +0x1C: dword: ebp
3773
  * +28 = +0x1C: dword: ebp
3763
  * +32 = +0x20: dword: esi
3774
  * +32 = +0x20: dword: esi
3764
  * +36 = +0x24: dword: edi
3775
  * +36 = +0x24: dword: edi
3765
Remarks:
3776
Remarks:
3766
  * If the thread executes code of ring-0, the function returns
3777
  * If the thread executes code of ring-0, the function returns
3767
    contents of registers of ring-3.
3778
    contents of registers of ring-3.
3768
  * Process must be loaded for debugging (as is shown in
3779
  * Process must be loaded for debugging (as is shown in
3769
    general description).
3780
    general description).
3770
 
3781
 
3771
======================================================================
3782
======================================================================
3772
===================== Function 69, subfunction 2 =====================
3783
===================== Function 69, subfunction 2 =====================
3773
============ Set contents of registers of debugged thread. ===========
3784
============ Set contents of registers of debugged thread. ===========
3774
======================================================================
3785
======================================================================
3775
Parameters:
3786
Parameters:
3776
  * eax = 69 - function number
3787
  * eax = 69 - function number
3777
  * ebx = 2 - subfunction number
3788
  * ebx = 2 - subfunction number
3778
  * ecx = thread identifier
3789
  * ecx = thread identifier
3779
  * edx = size of context structure, must be 0x28=40 bytes
3790
  * edx = size of context structure, must be 0x28=40 bytes
3780
Returned value:
3791
Returned value:
3781
  * function does not return value
3792
  * function does not return value
3782
Format of context structure is shown in the description of
3793
Format of context structure is shown in the description of
3783
subfunction 1.
3794
subfunction 1.
3784
Remarks:
3795
Remarks:
3785
  * If the thread executes code of ring-0, the function returns
3796
  * If the thread executes code of ring-0, the function returns
3786
    contents of registers of ring-3.
3797
    contents of registers of ring-3.
3787
  * Process must be loaded for debugging (as is shown in
3798
  * Process must be loaded for debugging (as is shown in
3788
    general description).
3799
    general description).
3789
 
3800
 
3790
======================================================================
3801
======================================================================
3791
===== Function 69, subfunction 3 - detach from debugged process. =====
3802
===== Function 69, subfunction 3 - detach from debugged process. =====
3792
======================================================================
3803
======================================================================
3793
Parameters:
3804
Parameters:
3794
  * eax = 69 - function number
3805
  * eax = 69 - function number
3795
  * ebx = 3 - subfunction number
3806
  * ebx = 3 - subfunction number
3796
  * ecx = identifier
3807
  * ecx = identifier
3797
Returned value:
3808
Returned value:
3798
  * function does not return value
3809
  * function does not return value
3799
Remarks:
3810
Remarks:
3800
  * If the process was suspended, it resumes execution.
3811
  * If the process was suspended, it resumes execution.
3801
 
3812
 
3802
======================================================================
3813
======================================================================
3803
======== Function 69, subfunction 4 - suspend debugged thread. =======
3814
======== Function 69, subfunction 4 - suspend debugged thread. =======
3804
======================================================================
3815
======================================================================
3805
Parameters:
3816
Parameters:
3806
  * eax = 69 - function number
3817
  * eax = 69 - function number
3807
  * ebx = 4 - subfunction number
3818
  * ebx = 4 - subfunction number
3808
  * ecx = thread identifier
3819
  * ecx = thread identifier
3809
Returned value:
3820
Returned value:
3810
  * function does not return value
3821
  * function does not return value
3811
Remarks:
3822
Remarks:
3812
  * Process must be loaded for debugging (as is shown in
3823
  * Process must be loaded for debugging (as is shown in
3813
    general description).
3824
    general description).
3814
 
3825
 
3815
======================================================================
3826
======================================================================
3816
======== Function 69, subfunction 5 - resume debugged thread. ========
3827
======== Function 69, subfunction 5 - resume debugged thread. ========
3817
======================================================================
3828
======================================================================
3818
Parameters:
3829
Parameters:
3819
  * eax = 69 - function number
3830
  * eax = 69 - function number
3820
  * ebx = 5 - subfunction number
3831
  * ebx = 5 - subfunction number
3821
  * ecx = thread identifier
3832
  * ecx = thread identifier
3822
Returned value:
3833
Returned value:
3823
  * function does not return value
3834
  * function does not return value
3824
Remarks:
3835
Remarks:
3825
  * Process must be loaded for debugging (as is shown in
3836
  * Process must be loaded for debugging (as is shown in
3826
    general description).
3837
    general description).
3827
 
3838
 
3828
======================================================================
3839
======================================================================
3829
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3840
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3830
======================================================================
3841
======================================================================
3831
Parameters:
3842
Parameters:
3832
  * eax = 69 - function number
3843
  * eax = 69 - function number
3833
  * ebx = 6 - subfunction number
3844
  * ebx = 6 - subfunction number
3834
  * ecx = identifier
3845
  * ecx = identifier
3835
  * edx = number of bytes to read
3846
  * edx = number of bytes to read
3836
  * esi = address in the memory of debugged process
3847
  * esi = address in the memory of debugged process
3837
  * edi = pointer to buffer for data
3848
  * edi = pointer to buffer for data
3838
Returned value:
3849
Returned value:
3839
  * eax = -1 at an error (invalid PID or buffer)
3850
  * eax = -1 at an error (invalid PID or buffer)
3840
  * otherwise eax = number of read bytes (possibly, 0,
3851
  * otherwise eax = number of read bytes (possibly, 0,
3841
    if esi is too large)
3852
    if esi is too large)
3842
Remarks:
3853
Remarks:
3843
  * Process must be loaded for debugging (as is shown in
3854
  * Process must be loaded for debugging (as is shown in
3844
    general description).
3855
    general description).
3845
 
3856
 
3846
======================================================================
3857
======================================================================
3847
== Function 69, subfunction 7 - write to memory of debugged process. =
3858
== Function 69, subfunction 7 - write to memory of debugged process. =
3848
======================================================================
3859
======================================================================
3849
Parameters:
3860
Parameters:
3850
  * eax = 69 - function number
3861
  * eax = 69 - function number
3851
  * ebx = 7 - subfunction number
3862
  * ebx = 7 - subfunction number
3852
  * ecx = identifier
3863
  * ecx = identifier
3853
  * edx = number of bytes to write
3864
  * edx = number of bytes to write
3854
  * esi = address of memory in debugged process
3865
  * esi = address of memory in debugged process
3855
  * edi = pointer to data
3866
  * edi = pointer to data
3856
Returned value:
3867
Returned value:
3857
  * eax = -1 at an error (invalid PID or buffer)
3868
  * eax = -1 at an error (invalid PID or buffer)
3858
  * otherwise eax = number of written bytes (possibly, 0,
3869
  * otherwise eax = number of written bytes (possibly, 0,
3859
    if esi is too large)
3870
    if esi is too large)
3860
Remarks:
3871
Remarks:
3861
  * Process must be loaded for debugging (as is shown in
3872
  * Process must be loaded for debugging (as is shown in
3862
    general description).
3873
    general description).
3863
 
3874
 
3864
======================================================================
3875
======================================================================
3865
======= Function 69, subfunction 8 - terminate debugged thread. ======
3876
======= Function 69, subfunction 8 - terminate debugged thread. ======
3866
======================================================================
3877
======================================================================
3867
Parameters:
3878
Parameters:
3868
  * eax = 69 - function number
3879
  * eax = 69 - function number
3869
  * ebx = 8 - subfunction number
3880
  * ebx = 8 - subfunction number
3870
  * ecx = identifier
3881
  * ecx = identifier
3871
Returned value:
3882
Returned value:
3872
  * function does not return value
3883
  * function does not return value
3873
Remarks:
3884
Remarks:
3874
  * Process must be loaded for debugging (as is shown in
3885
  * Process must be loaded for debugging (as is shown in
3875
    general description).
3886
    general description).
3876
  * The function is similar to subfunction 2 of function 18
3887
  * The function is similar to subfunction 2 of function 18
3877
    with two differences: it requires first remark and
3888
    with two differences: it requires first remark and
3878
    accepts PID rather than slot number.
3889
    accepts PID rather than slot number.
3879
 
3890
 
3880
======================================================================
3891
======================================================================
3881
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3892
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3882
======================================================================
3893
======================================================================
3883
Parameters:
3894
Parameters:
3884
  * eax = 69 - function number
3895
  * eax = 69 - function number
3885
  * ebx = 9 - subfunction number
3896
  * ebx = 9 - subfunction number
3886
  * ecx = thread identifier
3897
  * ecx = thread identifier
3887
  * dl = index of breakpoint, from 0 to 3 inclusively
3898
  * dl = index of breakpoint, from 0 to 3 inclusively
3888
  * dh = flags:
3899
  * dh = flags:
3889
    * if high bit is cleared - set breakpoint:
3900
    * if high bit is cleared - set breakpoint:
3890
      * bits 0-1 - condition:
3901
      * bits 0-1 - condition:
3891
        * 00 = breakpoint on execution
3902
        * 00 = breakpoint on execution
3892
        * 01 = breakpoint on read
3903
        * 01 = breakpoint on read
3893
        * 11 = breakpoint on read/write
3904
        * 11 = breakpoint on read/write
3894
      * bits 2-3 - length; for breakpoints on exception it must be
3905
      * bits 2-3 - length; for breakpoints on exception it must be
3895
        00, otherwise one of
3906
        00, otherwise one of
3896
        * 00 = byte
3907
        * 00 = byte
3897
        * 01 = word
3908
        * 01 = word
3898
        * 11 = dword
3909
        * 11 = dword
3899
      * esi = breakpoint address; must be aligned according to
3910
      * esi = breakpoint address; must be aligned according to
3900
        the length (i.e. must be even for word breakpoints,
3911
        the length (i.e. must be even for word breakpoints,
3901
        divisible by 4 for dword)
3912
        divisible by 4 for dword)
3902
    * if high bit is set - clear breakpoint
3913
    * if high bit is set - clear breakpoint
3903
Returned value:
3914
Returned value:
3904
  * eax = 0 - success
3915
  * eax = 0 - success
3905
  * eax = 1 - error in the input data
3916
  * eax = 1 - error in the input data
3906
  * eax = 2 - (reserved, is never returned in the current
3917
  * eax = 2 - (reserved, is never returned in the current
3907
    implementation) a global breakpoint with that index is already set
3918
    implementation) a global breakpoint with that index is already set
3908
Remarks:
3919
Remarks:
3909
  * Process must be loaded for debugging (as is shown in
3920
  * Process must be loaded for debugging (as is shown in
3910
    general description).
3921
    general description).
3911
  * Hardware breakpoints are implemented through DRx-registers of
3922
  * Hardware breakpoints are implemented through DRx-registers of
3912
    the processor, all limitations results from this.
3923
    the processor, all limitations results from this.
3913
  * The function can reinstall the breakpoint, previously set
3924
  * The function can reinstall the breakpoint, previously set
3914
    by it (and it does not inform on this).
3925
    by it (and it does not inform on this).
3915
    Carry on the list of set breakpoints in the debugger.
3926
    Carry on the list of set breakpoints in the debugger.
3916
  * Breakpoints generate debug exception #DB, on which the system
3927
  * Breakpoints generate debug exception #DB, on which the system
3917
    notifies debugger.
3928
    notifies debugger.
3918
  * Breakpoints on write and read/write act after
3929
  * Breakpoints on write and read/write act after
3919
    execution of the caused it instruction.
3930
    execution of the caused it instruction.
3920
 
3931
 
3921
======================================================================
3932
======================================================================
3922
==== Function 70 - work with file system with long names support. ====
3933
==== Function 70 - work with file system with long names support. ====
3923
======================================================================
3934
======================================================================
3924
Parameters:
3935
Parameters:
3925
  * eax = 70
3936
  * eax = 70
3926
  * ebx = pointer to the information structure
3937
  * ebx = pointer to the information structure
3927
Returned value:
3938
Returned value:
3928
  * eax = 0 - success; otherwise file system error code
3939
  * eax = 0 - success; otherwise file system error code
3929
  * some subfunctions return value in other registers too
3940
  * some subfunctions return value in other registers too
3930
General format of the information structure:
3941
General format of the information structure:
3931
  * +0: dword: subfunction number
3942
  * +0: dword: subfunction number
3932
  * +4: dword: file offset
3943
  * +4: dword: file offset
3933
  * +8: dword: high dword of offset (must be 0) or flags field
3944
  * +8: dword: high dword of offset (must be 0) or flags field
3934
  * +12 = +0xC: dword: size
3945
  * +12 = +0xC: dword: size
3935
  * +16 = +0x10: dword: pointer to data
3946
  * +16 = +0x10: dword: pointer to data
3936
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3947
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3937
    or
3948
    or
3938
  * +20 = +0x14: db 0
3949
  * +20 = +0x14: db 0
3939
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3950
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3940
Specifications - in documentation on the appropriate subfunction.
3951
Specifications - in documentation on the appropriate subfunction.
3941
Filename is case-insensitive. Russian letters must be written in
3952
Filename is case-insensitive. Russian letters must be written in
3942
the encoding cp866 (DOS).
3953
the encoding cp866 (DOS).
3943
Format of filename:
3954
Format of filename:
3944
/base/number/dir1/dir2/.../dirn/file,
3955
/base/number/dir1/dir2/.../dirn/file,
3945
where /base/number identifies device, on which file is located:
3956
where /base/number identifies device, on which file is located:
3946
one of
3957
one of
3947
  * /RD/1 = /RAMDISK/1 to access ramdisk
3958
  * /RD/1 = /RAMDISK/1 to access ramdisk
3948
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3959
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3949
    /FD/2 = /FLOPPYDISK/2 to access second one
3960
    /FD/2 = /FLOPPYDISK/2 to access second one
3950
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3961
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3951
    IDE0 (Primary Master), IDE1 (Primary Slave),
3962
    IDE0 (Primary Master), IDE1 (Primary Slave),
3952
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3963
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3953
    x - partition number on the selected hard drive, varies from 1
3964
    x - partition number on the selected hard drive, varies from 1
3954
    to 255 (on each hard drive the indexing starts from 1)
3965
    to 255 (on each hard drive the indexing starts from 1)
3955
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3966
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3956
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3967
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3957
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3968
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3958
  * /SYS means system folder; with the usual boot (from floppy)
3969
  * /SYS means system folder; with the usual boot (from floppy)
3959
    is equivalent to /RD/1
3970
    is equivalent to /RD/1
3960
Examples:
3971
Examples:
3961
  * '/rd/1/kernel.asm',0
3972
  * '/rd/1/kernel.asm',0
3962
  * '/HD0/1/kernel.asm',0
3973
  * '/HD0/1/kernel.asm',0
3963
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3974
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3964
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3975
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3965
  * '/sys/MySuperApp.ini',0
3976
  * '/sys/MySuperApp.ini',0
3966
Also function supports relative names.  If the path begins not 
3977
Also function supports relative names.  If the path begins not 
3967
with '/', it is considered relative to a current folder. To get or 
3978
with '/', it is considered relative to a current folder. To get or 
3968
set a current folder, use the function 30.
3979
set a current folder, use the function 30.
3969
 
3980
 
3970
Available subfunctions:
3981
Available subfunctions:
3971
  * subfunction 0 - read file
3982
  * subfunction 0 - read file
3972
  * subfunction 1 - read folder
3983
  * subfunction 1 - read folder
3973
  * subfunction 2 - create/rewrite file
3984
  * subfunction 2 - create/rewrite file
3974
  * subfunction 3 - write to existing file
3985
  * subfunction 3 - write to existing file
3975
  * subfunction 4 - set file size
3986
  * subfunction 4 - set file size
3976
  * subfunction 5 - get attributes of file/folder
3987
  * subfunction 5 - get attributes of file/folder
3977
  * subfunction 6 - set attributes of file/folder
3988
  * subfunction 6 - set attributes of file/folder
3978
  * subfunction 7 - start application
3989
  * subfunction 7 - start application
3979
  * subfunction 8 - delete file/folder
3990
  * subfunction 8 - delete file/folder
3980
  * subfunction 9 - create folder
3991
  * subfunction 9 - create folder
3981
For CD-drives due to hardware limitations only subfunctions
3992
For CD-drives due to hardware limitations only subfunctions
3982
0,1,5 and 7 are available, other subfunctions return error
3993
0,1,5 and 7 are available, other subfunctions return error
3983
with code 2.
3994
with code 2.
3984
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3995
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3985
(CD and DVD) the manual control of tray is locked due to caching
3996
(CD and DVD) the manual control of tray is locked due to caching
3986
drive data. Unlocking is made when subfunction 4 of function 24
3997
drive data. Unlocking is made when subfunction 4 of function 24
3987
is called for corresponding device.
3998
is called for corresponding device.
3988
 
3999
 
3989
======================================================================
4000
======================================================================
3990
=== Function 70, subfunction 0 - read file with long names support. ==
4001
=== Function 70, subfunction 0 - read file with long names support. ==
3991
======================================================================
4002
======================================================================
3992
Parameters:
4003
Parameters:
3993
  * eax = 70 - function number
4004
  * eax = 70 - function number
3994
  * ebx = pointer to the information structure
4005
  * ebx = pointer to the information structure
3995
Format of the information structure:
4006
Format of the information structure:
3996
  * +0: dword: 0 = subfunction number
4007
  * +0: dword: 0 = subfunction number
3997
  * +4: dword: file offset (in bytes)
4008
  * +4: dword: file offset (in bytes)
3998
  * +8: dword: 0 (reserved for high dword of offset)
4009
  * +8: dword: 0 (reserved for high dword of offset)
3999
  * +12 = +0xC: dword: number of bytes to read
4010
  * +12 = +0xC: dword: number of bytes to read
4000
  * +16 = +0x10: dword: pointer to buffer for data
4011
  * +16 = +0x10: dword: pointer to buffer for data
4001
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4012
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4002
    given in the general description
4013
    given in the general description
4003
    or
4014
    or
4004
  * +20 = +0x14: db 0
4015
  * +20 = +0x14: db 0
4005
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4016
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4006
Returned value:
4017
Returned value:
4007
  * eax = 0 - success, otherwise file system error code
4018
  * eax = 0 - success, otherwise file system error code
4008
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4019
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4009
Remarks:
4020
Remarks:
4010
  * If file was ended before last requested block was read,
4021
  * If file was ended before last requested block was read,
4011
    the function will read as many as it can, and after that return
4022
    the function will read as many as it can, and after that return
4012
    eax=6 (EOF).
4023
    eax=6 (EOF).
4013
  * The function does not allow to read folder (returns eax=10,
4024
  * The function does not allow to read folder (returns eax=10,
4014
    access denied).
4025
    access denied).
4015
 
4026
 
4016
======================================================================
4027
======================================================================
4017
== Function 70, subfunction 1 - read folder with long names support. =
4028
== Function 70, subfunction 1 - read folder with long names support. =
4018
======================================================================
4029
======================================================================
4019
Parameters:
4030
Parameters:
4020
  * eax = 70 - function number
4031
  * eax = 70 - function number
4021
  * ebx = pointer to the information structure
4032
  * ebx = pointer to the information structure
4022
Format of the information structure:
4033
Format of the information structure:
4023
  * +0: dword: 1 = subfunction number
4034
  * +0: dword: 1 = subfunction number
4024
  * +4: dword: index of starting block (beginning from 0)
4035
  * +4: dword: index of starting block (beginning from 0)
4025
  * +8: dword: flags field:
4036
  * +8: dword: flags field:
4026
    * bit 0 (mask 1): in what format to return names,
4037
    * bit 0 (mask 1): in what format to return names,
4027
      0=ANSI, 1=UNICODE
4038
      0=ANSI, 1=UNICODE
4028
    * other bits are reserved and must be set to 0 for the future
4039
    * other bits are reserved and must be set to 0 for the future
4029
      compatibility
4040
      compatibility
4030
  * +12 = +0xC: dword: number of blocks to read
4041
  * +12 = +0xC: dword: number of blocks to read
4031
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4042
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4032
    must be not less than 32 + [+12]*560 bytes
4043
    must be not less than 32 + [+12]*560 bytes
4033
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4044
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4034
    given in the general description
4045
    given in the general description
4035
    or
4046
    or
4036
  * +20 = +0x14: db 0
4047
  * +20 = +0x14: db 0
4037
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4048
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4038
Returned value:
4049
Returned value:
4039
  * eax = 0 - success, otherwise file system error code
4050
  * eax = 0 - success, otherwise file system error code
4040
  * ebx = number of files, information on which was written to
4051
  * ebx = number of files, information on which was written to
4041
    the buffer, or -1=0xffffffff, if folder was not found
4052
    the buffer, or -1=0xffffffff, if folder was not found
4042
Structure of the buffer:
4053
Structure of the buffer:
4043
  * +0: 32*byte: header
4054
  * +0: 32*byte: header
4044
  * +32 = +0x20: n1*byte: block with information on file 1
4055
  * +32 = +0x20: n1*byte: block with information on file 1
4045
  * +32+n1: n2*byte: block with information on file 2
4056
  * +32+n1: n2*byte: block with information on file 2
4046
  * ...
4057
  * ...
4047
Structure of header:
4058
Structure of header:
4048
  * +0: dword: version of structure (current is 1)
4059
  * +0: dword: version of structure (current is 1)
4049
  * +4: dword: number of placed blocks; is not greater than requested
4060
  * +4: dword: number of placed blocks; is not greater than requested
4050
    in the field +12 of information structure; can be less, if
4061
    in the field +12 of information structure; can be less, if
4051
    there are no more files in folder (the same as in ebx)
4062
    there are no more files in folder (the same as in ebx)
4052
  * +8: dword: total number of files in folder
4063
  * +8: dword: total number of files in folder
4053
  * +12 = +0xC: 20*byte: reserved (zeroed)
4064
  * +12 = +0xC: 20*byte: reserved (zeroed)
4054
Structure of block of data for folder entry (BDFE):
4065
Structure of block of data for folder entry (BDFE):
4055
  * +0: dword: attributes of file:
4066
  * +0: dword: attributes of file:
4056
    * bit 0 (mask 1): file is read-only
4067
    * bit 0 (mask 1): file is read-only
4057
    * bit 1 (mask 2): file is hidden
4068
    * bit 1 (mask 2): file is hidden
4058
    * bit 2 (mask 4): file is system
4069
    * bit 2 (mask 4): file is system
4059
    * bit 3 (mask 8): this is not a file but volume label
4070
    * bit 3 (mask 8): this is not a file but volume label
4060
      (for one partition meets no more than once and
4071
      (for one partition meets no more than once and
4061
      only in root folder)
4072
      only in root folder)
4062
    * bit 4 (mask 0x10): this is a folder
4073
    * bit 4 (mask 0x10): this is a folder
4063
    * bit 5 (mask 0x20): file was not archived - many archivation
4074
    * bit 5 (mask 0x20): file was not archived - many archivation
4064
      programs have an option to archive only files with this bit set,
4075
      programs have an option to archive only files with this bit set,
4065
      and after archiving this bit is cleared - it can be useful
4076
      and after archiving this bit is cleared - it can be useful
4066
      for automatically creating of backup-archives as at writing
4077
      for automatically creating of backup-archives as at writing
4067
      this bit is usually set
4078
      this bit is usually set
4068
  * +4: byte: type of name data:
4079
  * +4: byte: type of name data:
4069
    (coincides with bit 0 of flags in the information structure)
4080
    (coincides with bit 0 of flags in the information structure)
4070
    * 0 = ASCII = 1-byte representation of each character
4081
    * 0 = ASCII = 1-byte representation of each character
4071
    * 1 = UNICODE = 2-byte representation of each character
4082
    * 1 = UNICODE = 2-byte representation of each character
4072
  * +5: 3*byte: reserved (zero)
4083
  * +5: 3*byte: reserved (zero)
4073
  * +8: 4*byte: time of file creation
4084
  * +8: 4*byte: time of file creation
4074
  * +12 = +0xC: 4*byte: date of file creation
4085
  * +12 = +0xC: 4*byte: date of file creation
4075
  * +16 = +0x10: 4*byte: time of last access (read or write)
4086
  * +16 = +0x10: 4*byte: time of last access (read or write)
4076
  * +20 = +0x14: 4*byte: date of last access
4087
  * +20 = +0x14: 4*byte: date of last access
4077
  * +24 = +0x18: 4*byte: time of last modification
4088
  * +24 = +0x18: 4*byte: time of last modification
4078
  * +28 = +0x1C: 4*byte: date of last modification
4089
  * +28 = +0x1C: 4*byte: date of last modification
4079
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4090
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4080
  * +40 = +0x28: name
4091
  * +40 = +0x28: name
4081
    * for ASCII format: maximum length is 263 characters
4092
    * for ASCII format: maximum length is 263 characters
4082
      (263 bytes), byte after the name has value 0
4093
      (263 bytes), byte after the name has value 0
4083
    * for UNICODE format: maximum length is 259 characters
4094
    * for UNICODE format: maximum length is 259 characters
4084
      (518 bytes), 2 bytes after the name have value 0
4095
      (518 bytes), 2 bytes after the name have value 0
4085
Time format:
4096
Time format:
4086
  * +0: byte: seconds
4097
  * +0: byte: seconds
4087
  * +1: byte: minutes
4098
  * +1: byte: minutes
4088
  * +2: byte: hours
4099
  * +2: byte: hours
4089
  * +3: byte: reserved (0)
4100
  * +3: byte: reserved (0)
4090
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4101
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4091
Date format:
4102
Date format:
4092
  * +0: byte: day
4103
  * +0: byte: day
4093
  * +1: byte: month
4104
  * +1: byte: month
4094
  * +2: word: year
4105
  * +2: word: year
4095
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4106
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4096
Remarks:
4107
Remarks:
4097
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4108
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4098
    if UNICODE name - 560 bytes. Value of length is aligned
4109
    if UNICODE name - 560 bytes. Value of length is aligned
4099
    on 16-byte bound (to accelerate processing in CPU cache).
4110
    on 16-byte bound (to accelerate processing in CPU cache).
4100
  * First character after a name is zero (ASCIIZ-string). The further
4111
  * First character after a name is zero (ASCIIZ-string). The further
4101
    data contain garbage.
4112
    data contain garbage.
4102
  * If files in folder were ended before requested number was read,
4113
  * If files in folder were ended before requested number was read,
4103
    the function will read as many as it can, and after that return
4114
    the function will read as many as it can, and after that return
4104
    eax=6 (EOF).
4115
    eax=6 (EOF).
4105
  * Any folder on the disk, except for root, contains two special
4116
  * Any folder on the disk, except for root, contains two special
4106
    entries "." and "..", identifying accordingly the folder itself
4117
    entries "." and "..", identifying accordingly the folder itself
4107
    and the parent folder.
4118
    and the parent folder.
4108
  * The function allows also to read virtual folders "/", "/rd",
4119
  * The function allows also to read virtual folders "/", "/rd",
4109
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4120
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4110
    and times and dates are zeroed. An alternative way to get the
4121
    and times and dates are zeroed. An alternative way to get the
4111
    equipment information - subfunction 11 of function 18.
4122
    equipment information - subfunction 11 of function 18.
4112
 
4123
 
4113
======================================================================
4124
======================================================================
4114
===================== Function 70, subfunction 2 =====================
4125
===================== Function 70, subfunction 2 =====================
4115
============ Create/rewrite file with long names support. ============
4126
============ Create/rewrite file with long names support. ============
4116
======================================================================
4127
======================================================================
4117
Parameters:
4128
Parameters:
4118
  * eax = 70 - function number
4129
  * eax = 70 - function number
4119
  * ebx = pointer to the information structure
4130
  * ebx = pointer to the information structure
4120
Format of the information structure:
4131
Format of the information structure:
4121
  * +0: dword: 2 = subfunction number
4132
  * +0: dword: 2 = subfunction number
4122
  * +4: dword: 0 (reserved)
4133
  * +4: dword: 0 (reserved)
4123
  * +8: dword: 0 (reserved)
4134
  * +8: dword: 0 (reserved)
4124
  * +12 = +0xC: dword: number of bytes to read
4135
  * +12 = +0xC: dword: number of bytes to read
4125
  * +16 = +0x10: dword: pointer to data
4136
  * +16 = +0x10: dword: pointer to data
4126
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4137
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4127
    given in the general description
4138
    given in the general description
4128
    or
4139
    or
4129
  * +20 = +0x14: db 0
4140
  * +20 = +0x14: db 0
4130
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4141
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4131
Returned value:
4142
Returned value:
4132
  * eax = 0 - success, otherwise file system error code
4143
  * eax = 0 - success, otherwise file system error code
4133
  * ebx = number of written bytes (possibly 0)
4144
  * ebx = number of written bytes (possibly 0)
4134
Remarks:
4145
Remarks:
4135
  * If a file with given name did not exist, it is created;
4146
  * If a file with given name did not exist, it is created;
4136
    if it existed, it is rewritten.
4147
    if it existed, it is rewritten.
4137
  * If there is not enough free space on disk, the function will
4148
  * If there is not enough free space on disk, the function will
4138
    write as many as can and then return error code 8.
4149
    write as many as can and then return error code 8.
4139
  * The function is not supported for CD (returns error code 2).
4150
  * The function is not supported for CD (returns error code 2).
4140
 
4151
 
4141
======================================================================
4152
======================================================================
4142
===================== Function 70, subfunction 3 =====================
4153
===================== Function 70, subfunction 3 =====================
4143
=========== Write to existing file with long names support. ==========
4154
=========== Write to existing file with long names support. ==========
4144
======================================================================
4155
======================================================================
4145
Parameters:
4156
Parameters:
4146
  * eax = 70 - function number
4157
  * eax = 70 - function number
4147
  * ebx = pointer to the information structure
4158
  * ebx = pointer to the information structure
4148
Format of the information structure:
4159
Format of the information structure:
4149
  * +0: dword: 3 = subfunction number
4160
  * +0: dword: 3 = subfunction number
4150
  * +4: dword: file offset (in bytes)
4161
  * +4: dword: file offset (in bytes)
4151
  * +8: dword: high dword of offset (must be 0 for FAT)
4162
  * +8: dword: high dword of offset (must be 0 for FAT)
4152
  * +12 = +0xC: dword: number of bytes to write
4163
  * +12 = +0xC: dword: number of bytes to write
4153
  * +16 = +0x10: dword: pointer to data
4164
  * +16 = +0x10: dword: pointer to data
4154
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4165
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4155
    given in the general description
4166
    given in the general description
4156
    or
4167
    or
4157
  * +20 = +0x14: db 0
4168
  * +20 = +0x14: db 0
4158
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4169
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4159
Returned value:
4170
Returned value:
4160
  * eax = 0 - success, otherwise file system error code
4171
  * eax = 0 - success, otherwise file system error code
4161
  * ebx = number of written bytes (possibly 0)
4172
  * ebx = number of written bytes (possibly 0)
4162
Remarks:
4173
Remarks:
4163
  * The file must already exist, otherwise function returns eax=5.
4174
  * The file must already exist, otherwise function returns eax=5.
4164
  * The only result of write 0 bytes is update in the file attributes
4175
  * The only result of write 0 bytes is update in the file attributes
4165
    date/time of modification and access to the current date/time.
4176
    date/time of modification and access to the current date/time.
4166
  * If beginning and/or ending position is greater than file size
4177
  * If beginning and/or ending position is greater than file size
4167
    (except for the previous case), the file is expanded to needed
4178
    (except for the previous case), the file is expanded to needed
4168
    size with zero characters.
4179
    size with zero characters.
4169
  * The function is not supported for CD (returns error code 2).
4180
  * The function is not supported for CD (returns error code 2).
4170
 
4181
 
4171
======================================================================
4182
======================================================================
4172
============ Function 70, subfunction 4 - set end of file. ===========
4183
============ Function 70, subfunction 4 - set end of file. ===========
4173
======================================================================
4184
======================================================================
4174
Parameters:
4185
Parameters:
4175
  * eax = 70 - function number
4186
  * eax = 70 - function number
4176
  * ebx = pointer to the information structure
4187
  * ebx = pointer to the information structure
4177
Format of the information structure:
4188
Format of the information structure:
4178
  * +0: dword: 4 = subfunction number
4189
  * +0: dword: 4 = subfunction number
4179
  * +4: dword: low dword of new file size
4190
  * +4: dword: low dword of new file size
4180
  * +8: dword: high dword of new file size (must be 0 for FAT)
4191
  * +8: dword: high dword of new file size (must be 0 for FAT)
4181
  * +12 = +0xC: dword: 0 (reserved)
4192
  * +12 = +0xC: dword: 0 (reserved)
4182
  * +16 = +0x10: dword: 0 (reserved)
4193
  * +16 = +0x10: dword: 0 (reserved)
4183
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4194
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4184
    given in the general description
4195
    given in the general description
4185
    or
4196
    or
4186
  * +20 = +0x14: db 0
4197
  * +20 = +0x14: db 0
4187
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4198
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4188
Returned value:
4199
Returned value:
4189
  * eax = 0 - success, otherwise file system error code
4200
  * eax = 0 - success, otherwise file system error code
4190
  * ebx destroyed
4201
  * ebx destroyed
4191
Remarks:
4202
Remarks:
4192
  * If the new file size is less than old one, file is truncated.
4203
  * If the new file size is less than old one, file is truncated.
4193
    If the new size is greater than old one, file is expanded with
4204
    If the new size is greater than old one, file is expanded with
4194
    characters with code 0. If the new size is equal to old one,
4205
    characters with code 0. If the new size is equal to old one,
4195
    the only result of call is set date/time of modification and
4206
    the only result of call is set date/time of modification and
4196
    access to the current date/time.
4207
    access to the current date/time.
4197
  * If there is not enough free space on disk for expansion, the
4208
  * If there is not enough free space on disk for expansion, the
4198
    function will expand to maximum possible size and then return
4209
    function will expand to maximum possible size and then return
4199
    error code 8.
4210
    error code 8.
4200
  * The function is not supported for CD (returns error code 2).
4211
  * The function is not supported for CD (returns error code 2).
4201
 
4212
 
4202
======================================================================
4213
======================================================================
4203
==== Function 70, subfunction 5 - get information on file/folder. ====
4214
==== Function 70, subfunction 5 - get information on file/folder. ====
4204
======================================================================
4215
======================================================================
4205
Parameters:
4216
Parameters:
4206
  * eax = 70 - function number
4217
  * eax = 70 - function number
4207
  * ebx = pointer to the information structure
4218
  * ebx = pointer to the information structure
4208
Format of the information structure:
4219
Format of the information structure:
4209
  * +0: dword: 5 = subfunction number
4220
  * +0: dword: 5 = subfunction number
4210
  * +4: dword: 0 (reserved)
4221
  * +4: dword: 0 (reserved)
4211
  * +8: dword: 0 (reserved)
4222
  * +8: dword: 0 (reserved)
4212
  * +12 = +0xC: dword: 0 (reserved)
4223
  * +12 = +0xC: dword: 0 (reserved)
4213
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4224
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4214
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4225
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4215
    given in the general description
4226
    given in the general description
4216
    or
4227
    or
4217
  * +20 = +0x14: db 0
4228
  * +20 = +0x14: db 0
4218
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4229
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4219
Returned value:
4230
Returned value:
4220
  * eax = 0 - success, otherwise file system error code
4231
  * eax = 0 - success, otherwise file system error code
4221
  * ebx destroyed
4232
  * ebx destroyed
4222
Information on file is returned in the BDFE format (block of data
4233
Information on file is returned in the BDFE format (block of data
4223
for folder entry), explained in the description of
4234
for folder entry), explained in the description of
4224
subfunction 1, but without filename
4235
subfunction 1, but without filename
4225
(i.e. only first 40 = 0x28 bytes).
4236
(i.e. only first 40 = 0x28 bytes).
4226
Remarks:
4237
Remarks:
4227
  * The function does not support virtual folders such as /, /rd and
4238
  * The function does not support virtual folders such as /, /rd and
4228
    root folders like /rd/1.
4239
    root folders like /rd/1.
4229
 
4240
 
4230
======================================================================
4241
======================================================================
4231
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4242
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4232
======================================================================
4243
======================================================================
4233
Parameters:
4244
Parameters:
4234
  * eax = 70 - function number
4245
  * eax = 70 - function number
4235
  * ebx = pointer to the information structure
4246
  * ebx = pointer to the information structure
4236
Format of the information structure:
4247
Format of the information structure:
4237
  * +0: dword: 6 = subfunction number
4248
  * +0: dword: 6 = subfunction number
4238
  * +4: dword: 0 (reserved)
4249
  * +4: dword: 0 (reserved)
4239
  * +8: dword: 0 (reserved)
4250
  * +8: dword: 0 (reserved)
4240
  * +12 = +0xC: dword: 0 (reserved)
4251
  * +12 = +0xC: dword: 0 (reserved)
4241
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4252
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4242
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4253
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4243
    given in the general description
4254
    given in the general description
4244
    or
4255
    or
4245
  * +20 = +0x14: db 0
4256
  * +20 = +0x14: db 0
4246
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4257
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4247
Returned value:
4258
Returned value:
4248
  * eax = 0 - success, otherwise file system error code
4259
  * eax = 0 - success, otherwise file system error code
4249
  * ebx destroyed
4260
  * ebx destroyed
4250
File attributes are first 32 bytes in BDFE (block of data
4261
File attributes are first 32 bytes in BDFE (block of data
4251
for folder entry), explained in the description of subfunction 1
4262
for folder entry), explained in the description of subfunction 1
4252
(that is, without name and size of file). Attribute
4263
(that is, without name and size of file). Attribute
4253
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4264
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4254
Byte +4 (name format) is ignored.
4265
Byte +4 (name format) is ignored.
4255
Remarks:
4266
Remarks:
4256
  * The function does not support virtual folders such as /, /rd and
4267
  * The function does not support virtual folders such as /, /rd and
4257
    root folders like /rd/1.
4268
    root folders like /rd/1.
4258
  * The function is not supported for CD (returns error code 2).
4269
  * The function is not supported for CD (returns error code 2).
4259
 
4270
 
4260
======================================================================
4271
======================================================================
4261
=========== Function 70, subfunction 7 - start application. ==========
4272
=========== Function 70, subfunction 7 - start application. ==========
4262
======================================================================
4273
======================================================================
4263
Parameters:
4274
Parameters:
4264
  * eax = 70 - function number
4275
  * eax = 70 - function number
4265
  * ebx = pointer to the information structure
4276
  * ebx = pointer to the information structure
4266
Format of the information structure:
4277
Format of the information structure:
4267
  * +0: dword: 7 = subfunction number
4278
  * +0: dword: 7 = subfunction number
4268
  * +4: dword: flags field:
4279
  * +4: dword: flags field:
4269
    * áèò 0: start process as debugged
4280
    * áèò 0: start process as debugged
4270
    * other bits are reserved and must be set to 0
4281
    * other bits are reserved and must be set to 0
4271
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4282
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4272
  * +12 = +0xC: dword: 0 (reserved)
4283
  * +12 = +0xC: dword: 0 (reserved)
4273
  * +16 = +0x10: dword: 0 (reserved)
4284
  * +16 = +0x10: dword: 0 (reserved)
4274
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4285
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4275
    given in the general description
4286
    given in the general description
4276
    or
4287
    or
4277
  * +20 = +0x14: db 0
4288
  * +20 = +0x14: db 0
4278
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4289
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4279
Returned value:
4290
Returned value:
4280
  * eax > 0 - program is loaded, eax contains PID
4291
  * eax > 0 - program is loaded, eax contains PID
4281
  * eax < 0 - an error has occured, -eax contains
4292
  * eax < 0 - an error has occured, -eax contains
4282
    file system error code
4293
    file system error code
4283
  * ebx destroyed
4294
  * ebx destroyed
4284
Remarks:
4295
Remarks:
4285
  * Command line must be terminated by the character with the code 0
4296
  * Command line must be terminated by the character with the code 0
4286
    (ASCIIZ-string); function takes into account either all characters
4297
    (ASCIIZ-string); function takes into account either all characters
4287
    up to terminating zero inclusively or first 256 character
4298
    up to terminating zero inclusively or first 256 character
4288
    regarding what is less.
4299
    regarding what is less.
4289
  * If the process is started as debugged, it is created in
4300
  * If the process is started as debugged, it is created in
4290
    the suspended state; to run use subfunction 5 of function 69.
4301
    the suspended state; to run use subfunction 5 of function 69.
4291
 
4302
 
4292
======================================================================
4303
======================================================================
4293
========== Function 70, subfunction 8 - delete file/folder. ==========
4304
========== Function 70, subfunction 8 - delete file/folder. ==========
4294
======================================================================
4305
======================================================================
4295
Parameters:
4306
Parameters:
4296
  * eax = 70 - function number
4307
  * eax = 70 - function number
4297
  * ebx = pointer to the information structure
4308
  * ebx = pointer to the information structure
4298
Format of the information structure:
4309
Format of the information structure:
4299
  * +0: dword: 8 = subfunction number
4310
  * +0: dword: 8 = subfunction number
4300
  * +4: dword: 0 (reserved)
4311
  * +4: dword: 0 (reserved)
4301
  * +8: dword: 0 (reserved)
4312
  * +8: dword: 0 (reserved)
4302
  * +12 = +0xC: dword: 0 (reserved)
4313
  * +12 = +0xC: dword: 0 (reserved)
4303
  * +16 = +0x10: dword: 0 (reserved)
4314
  * +16 = +0x10: dword: 0 (reserved)
4304
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4315
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4305
    given in the general description
4316
    given in the general description
4306
    or
4317
    or
4307
  * +20 = +0x14: db 0
4318
  * +20 = +0x14: db 0
4308
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4319
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4309
Returned value:
4320
Returned value:
4310
  * eax = 0 - success, otherwise file system error code
4321
  * eax = 0 - success, otherwise file system error code
4311
  * ebx destroyed
4322
  * ebx destroyed
4312
Remarks:
4323
Remarks:
4313
  * The function is not supported for CD (returns error code 2).
4324
  * The function is not supported for CD (returns error code 2).
4314
  * The function can delete only empty folders (attempt to delete
4325
  * The function can delete only empty folders (attempt to delete
4315
    nonempty folder results in error with code 10, "access denied").
4326
    nonempty folder results in error with code 10, "access denied").
4316
 
4327
 
4317
======================================================================
4328
======================================================================
4318
============= Function 70, subfunction 9 - create folder. ============
4329
============= Function 70, subfunction 9 - create folder. ============
4319
======================================================================
4330
======================================================================
4320
Parameters:
4331
Parameters:
4321
  * eax = 70 - function number
4332
  * eax = 70 - function number
4322
  * ebx = pointer to the information structure
4333
  * ebx = pointer to the information structure
4323
Format of the information structure:
4334
Format of the information structure:
4324
  * +0: dword: 9 = subfunction number
4335
  * +0: dword: 9 = subfunction number
4325
  * +4: dword: 0 (reserved)
4336
  * +4: dword: 0 (reserved)
4326
  * +8: dword: 0 (reserved)
4337
  * +8: dword: 0 (reserved)
4327
  * +12 = +0xC: dword: 0 (reserved)
4338
  * +12 = +0xC: dword: 0 (reserved)
4328
  * +16 = +0x10: dword: 0 (reserved)
4339
  * +16 = +0x10: dword: 0 (reserved)
4329
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4340
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4330
    given in the general description
4341
    given in the general description
4331
    or
4342
    or
4332
  * +20 = +0x14: db 0
4343
  * +20 = +0x14: db 0
4333
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
4344
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
4334
Returned value:
4345
Returned value:
4335
  * eax = 0 - success, otherwise file system error code
4346
  * eax = 0 - success, otherwise file system error code
4336
  * ebx destroyed
4347
  * ebx destroyed
4337
Remarks:
4348
Remarks:
4338
  * The function is not supported for CD (returns error code 2).
4349
  * The function is not supported for CD (returns error code 2).
4339
  * The parent folder must already exist.
4350
  * The parent folder must already exist.
4340
  * If target folder already exists, function returns success (eax=0).
4351
  * If target folder already exists, function returns success (eax=0).
4341
 
4352
 
4342
======================================================================
4353
======================================================================
4343
========== Function 71, subfunction 1 - set window caption. ==========
4354
========== Function 71, subfunction 1 - set window caption. ==========
4344
======================================================================
4355
======================================================================
4345
Parameters:
4356
Parameters:
4346
  * eax = 71 - function number
4357
  * eax = 71 - function number
4347
  * ebx = 1 - subfunction number
4358
  * ebx = 1 - subfunction number
4348
  * ecx = pointer to caption string
4359
  * ecx = pointer to caption string
4349
Returned value:
4360
Returned value:
4350
  * function does not return value
4361
  * function does not return value
4351
Remarks:
4362
Remarks:
4352
  * String must be in the ASCIIZ-format. Disregarding real string
4363
  * String must be in the ASCIIZ-format. Disregarding real string
4353
    length, no more than 255 characters are drawn.
4364
    length, no more than 255 characters are drawn.
4354
  * Pass NULL in ecx to remove caption.
4365
  * Pass NULL in ecx to remove caption.
4355
 
4366
 
4356
======================================================================
4367
======================================================================
4357
=============== Function 72 - send message to a window. ==============
4368
=============== Function 72 - send message to a window. ==============
4358
======================================================================
4369
======================================================================
4359
 
4370
 
4360
- Subfunction 1 - send message with parameter to the active window. --
4371
- Subfunction 1 - send message with parameter to the active window. --
4361
Parameters:
4372
Parameters:
4362
  * eax = 72 - function number
4373
  * eax = 72 - function number
4363
  * ebx = 1 - subfunction number
4374
  * ebx = 1 - subfunction number
4364
  * ecx = event code: 2 or 3
4375
  * ecx = event code: 2 or 3
4365
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
4376
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
4366
Returned value:
4377
Returned value:
4367
  * eax = 0 - success
4378
  * eax = 0 - success
4368
  * eax = 1 - buffer is full
4379
  * eax = 1 - buffer is full
4369
 
4380
 
4370
======================================================================
4381
======================================================================
4371
=============== Function -1 - terminate thread/process ===============
4382
=============== Function -1 - terminate thread/process ===============
4372
======================================================================
4383
======================================================================
4373
Parameters:
4384
Parameters:
4374
  * eax = -1 - function number
4385
  * eax = -1 - function number
4375
Returned value:
4386
Returned value:
4376
  * function does not return neither value nor control
4387
  * function does not return neither value nor control
4377
Remarks:
4388
Remarks:
4378
  * If the process did not create threads obviously, it has only
4389
  * If the process did not create threads obviously, it has only
4379
    one thread, which termination results in process termination.
4390
    one thread, which termination results in process termination.
4380
  * If the current thread is last in the process, its termination
4391
  * If the current thread is last in the process, its termination
4381
    also results in process terminates.
4392
    also results in process terminates.
4382
  * This function terminates the current thread. Other thread can be
4393
  * This function terminates the current thread. Other thread can be
4383
    killed by call to subfunction 2 of function 18.
4394
    killed by call to subfunction 2 of function 18.
4384
 
4395
 
4385
======================================================================
4396
======================================================================
4386
=========================== List of events ===========================
4397
=========================== List of events ===========================
4387
======================================================================
4398
======================================================================
4388
Next event can be retrieved by the call of one from functions 10
4399
Next event can be retrieved by the call of one from functions 10
4389
(to wait for event), 11 (to check without waiting), 23
4400
(to wait for event), 11 (to check without waiting), 23
4390
(to wait during the given time).
4401
(to wait during the given time).
4391
These functions return only those events, which enter into a mask set
4402
These functions return only those events, which enter into a mask set
4392
by function 40. By default it is first three,
4403
by function 40. By default it is first three,
4393
there is enough for most applications.
4404
there is enough for most applications.
4394
Codes of events:
4405
Codes of events:
4395
  * 1 = redraw event (is reset by call to function 0)
4406
  * 1 = redraw event (is reset by call to function 0)
4396
  * 2 = key on keyboard is pressed (acts, only when the window is
4407
  * 2 = key on keyboard is pressed (acts, only when the window is
4397
    active) or hotkey is pressed; is reset, when all keys from
4408
    active) or hotkey is pressed; is reset, when all keys from
4398
    the buffer are read out by function 2
4409
    the buffer are read out by function 2
4399
  * 3 = button is pressed, defined earlier by function 8
4410
  * 3 = button is pressed, defined earlier by function 8
4400
    (or close button, created implicitly by function 0;
4411
    (or close button, created implicitly by function 0;
4401
    minimize button is handled by the system and sends no message;
4412
    minimize button is handled by the system and sends no message;
4402
    acts, only when the window is active;
4413
    acts, only when the window is active;
4403
    is reset when all buttons from the buffer
4414
    is reset when all buttons from the buffer
4404
    are read out by function 17)
4415
    are read out by function 17)
4405
  * 4 = reserved (in current implementation never comes even after
4416
  * 4 = reserved (in current implementation never comes even after
4406
    unmasking by function 40)
4417
    unmasking by function 40)
4407
  * 5 = the desktop background is redrawed (is reset automatically
4418
  * 5 = the desktop background is redrawed (is reset automatically
4408
    after redraw, so if in redraw time program does not wait and
4419
    after redraw, so if in redraw time program does not wait and
4409
    does not check events, it will not remark this event)
4420
    does not check events, it will not remark this event)
4410
  * 6 = mouse event (something happened - button pressing or moving;
4421
  * 6 = mouse event (something happened - button pressing or moving;
4411
    is reset at reading)
4422
    is reset at reading)
4412
  * 7 = IPC event (see function 60 -
4423
  * 7 = IPC event (see function 60 -
4413
    Inter Process Communication; is reset at reading)
4424
    Inter Process Communication; is reset at reading)
4414
  * 8 = network event (is reset at reading)
4425
  * 8 = network event (is reset at reading)
4415
  * 9 = debug event (is reset at reading; see
4426
  * 9 = debug event (is reset at reading; see
4416
    debug subsystem)
4427
    debug subsystem)
4417
  * 16..31 = event with appropriate IRQ
4428
  * 16..31 = event with appropriate IRQ
4418
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4429
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4419
 
4430
 
4420
======================================================================
4431
======================================================================
4421
=================== Error codes of the file system ===================
4432
=================== Error codes of the file system ===================
4422
======================================================================
4433
======================================================================
4423
  * 0 = success
4434
  * 0 = success
4424
  * 1 = base and/or partition of a hard disk is not defined
4435
  * 1 = base and/or partition of a hard disk is not defined
4425
    (by subfunctions 7, 8 of function 21)
4436
    (by subfunctions 7, 8 of function 21)
4426
  * 2 = function is not supported for the given file system
4437
  * 2 = function is not supported for the given file system
4427
  * 3 = unknown file system
4438
  * 3 = unknown file system
4428
  * 4 = reserved, is never returned in the current implementation
4439
  * 4 = reserved, is never returned in the current implementation
4429
  * 5 = file not found
4440
  * 5 = file not found
4430
  * 6 = end of file, EOF
4441
  * 6 = end of file, EOF
4431
  * 7 = pointer lies outside of application memory
4442
  * 7 = pointer lies outside of application memory
4432
  * 8 = disk is full
4443
  * 8 = disk is full
4433
  * 9 = FAT table is destroyed
4444
  * 9 = FAT table is destroyed
4434
  * 10 = access denied
4445
  * 10 = access denied
4435
  * 11 = device error
4446
  * 11 = device error
4436
Application start functions can return also following errors:
4447
Application start functions can return also following errors:
4437
  * 30 = 0x1E = not enough memory
4448
  * 30 = 0x1E = not enough memory
4438
  * 31 = 0x1F = file is not executable
4449
  * 31 = 0x1F = file is not executable
4439
  * 32 = 0x20 = too many processes
4450
  * 32 = 0x20 = too many processes
4440
>
4451
>
4441
>
4452
>