Subversion Repositories Kolibri OS

Rev

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

Rev 118 Rev 120
1
SYSTEM FUNCTIONS of OS Kolibri 0.5.8.1
1
SYSTEM FUNCTIONS of OS Kolibri 0.5.8.1
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 windows with skin defines standard buttons for close
13
working area. For windows with skin defines standard buttons for close
14
and minimize.
14
and minimize.
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 - window of the fixed size
21
      * Y=0 - type I - window of the fixed size
22
      * Y=1 - only define window area, draw nothing
22
      * Y=1 - only define window area, draw nothing
23
      * Y=2 - type II - window of the variable size
23
      * Y=2 - type II - window of the variable size
24
      * Y=3 - window with skin
24
      * Y=3 - window with skin
25
      * other possible values (from 4 up to 15) are reserved,
25
      * other possible values (from 4 up to 15) are reserved,
26
        function call with such Y is ignored
26
        function call with such Y is ignored
27
    * RR, GG, BB = accordingly red, green, blue components of a color
27
    * RR, GG, BB = accordingly red, green, blue components of a color
28
      of the working area of the window (are ignored for style Y=2)
28
      of the working area of the window (are ignored for style Y=2)
29
    * X = DCBA (bits)
29
    * X = DCBA (bits)
30
      * A = 1 - window has caption; for style Y=3 caption string
30
      * A = 1 - window has caption; for style Y=3 caption string
31
                  must be passed in edi, for other styles use
31
                  must be passed in edi, for other styles use
32
                  subfunction 1 of function 71
32
                  subfunction 1 of function 71
33
      * B = 1 - coordinates of all graphics primitives are relative to
33
      * B = 1 - coordinates of all graphics primitives are relative to
34
                  window client area
34
                  window client area
35
      * C is reserved (set to 0)
35
      * C is reserved (set to 0)
36
      * D = 0 - normal filling of the working area, 1 - gradient
36
      * D = 0 - normal filling of the working area, 1 - gradient
37
    The following parameters are intended for windows
37
    The following parameters are intended for windows
38
    of a type I and II, and ignored for styles Y=1,3:
38
    of a type I and II, and ignored for styles Y=1,3:
39
  * esi = 0xXYRRGGBB - color of the header
39
  * esi = 0xXYRRGGBB - color of the header
40
    * RR, GG, BB define color
40
    * RR, GG, BB define color
41
    * Y=0 - usual window, Y=1 - unmovable window
41
    * Y=0 - usual window, Y=1 - unmovable window
42
    * X defines a gradient of header: X=0 - no gradient,
42
    * X defines a gradient of header: X=0 - no gradient,
43
      X=8 - usual gradient,
43
      X=8 - usual gradient,
44
      for windows of a type II X=4 - negative gradient
44
      for windows of a type II X=4 - negative gradient
45
    * other values of X and Y are reserved
45
    * other values of X and Y are reserved
46
  * edi = 0x00RRGGBB - color of the frame
46
  * edi = 0x00RRGGBB - color of the frame
47
Returned value:
47
Returned value:
48
  * function does not return value
48
  * function does not return value
49
Remarks:
49
Remarks:
50
  * Position and sizes of the window are installed by the first
50
  * Position and sizes of the window are installed by the first
51
    call of this function and are ignored at subsequent; to change
51
    call of this function and are ignored at subsequent; to change
52
    position and/or sizes of already created window use function 67.
52
    position and/or sizes of already created window use function 67.
53
  * For windows with style Y=3 and caption (A=1) caption string is set
53
  * For windows with style Y=3 and caption (A=1) caption string is set
54
    by the first call of this function and is ignored at subsequent
54
    by the first call of this function and is ignored at subsequent
55
    (strictly speaking, is ignored after a call to subfunction 2
55
    (strictly speaking, is ignored after a call to subfunction 2
56
    of function 12 - end redraw); to change caption of already created
56
    of function 12 - end redraw); to change caption of already created
57
    window use subfunction 1 of function 71.
57
    window use subfunction 1 of function 71.
58
  * If the window has appropriate styles, position and/or sizes can be
58
  * If the window has appropriate styles, position and/or sizes can be
59
    changed by user. Current position and sizes can be obtained
59
    changed by user. Current position and sizes can be obtained
60
    by function 9.
60
    by function 9.
61
  * The window must fit on the screen. If the transferred
61
  * The window must fit on the screen. If the transferred
62
    coordinates and sizes do not satisfy to this condition,
62
    coordinates and sizes do not satisfy to this condition,
63
    appropriate coordinate (or, probably, both) is considered as zero,
63
    appropriate coordinate (or, probably, both) is considered as zero,
64
    and if also it does not help, the appropriate size
64
    and if also it does not help, the appropriate size
65
    (or, probably, both) is installed in a size of the screen.
65
    (or, probably, both) is installed in a size of the screen.
66
    
66
    
67
    Further we shall designate xpos,ypos,xsize,ysize - values
67
    Further we shall designate xpos,ypos,xsize,ysize - values
68
    transmitted in ebx,ecx. The coordinates are resulted concerning
68
    transmitted in ebx,ecx. The coordinates are resulted concerning
69
    the left upper corner of the window, which, thus, is set as (0,0),
69
    the left upper corner of the window, which, thus, is set as (0,0),
70
    coordinates of the right lower corner essence (xsize,ysize).
70
    coordinates of the right lower corner essence (xsize,ysize).
71
  * The sizes of the window are understood in sence of coordinates
71
  * The sizes of the window are understood in sence of coordinates
72
    of the right lower corner. This concerns all other functions too.
72
    of the right lower corner. This concerns all other functions too.
73
    It means, that the real sizes are on 1 pixel more.
73
    It means, that the real sizes are on 1 pixel more.
74
  * The window of type I looks as follows:
74
  * The window of type I looks as follows:
75
    * draw external frame of color indicated in edi, 1 pixel in width
75
    * draw external frame of color indicated in edi, 1 pixel in width
76
    * draw header - rectangle with the left upper corner (1,1) and
76
    * draw header - rectangle with the left upper corner (1,1) and
77
      right lower (xsize-1,min(25,ysize)) color indicated in esi
77
      right lower (xsize-1,min(25,ysize)) color indicated in esi
78
      (taking a gradient into account)
78
      (taking a gradient into account)
79
    * if ysize>=26, fill the working area of the window -
79
    * if ysize>=26, fill the working area of the window -
80
      rectangle with the left upper corner (1,21) and right lower
80
      rectangle with the left upper corner (1,21) and right lower
81
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
81
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
82
      indicated in edx (taking a gradient into account)
82
      indicated in edx (taking a gradient into account)
83
    * if A=1 and caption has been already set by subfunction 1
83
    * if A=1 and caption has been already set by subfunction 1
84
      of function 71, it is drawn in the corresponding place of header
84
      of function 71, it is drawn in the corresponding place of header
85
  * The window of style Y=1 looks as follows:
85
  * The window of style Y=1 looks as follows:
86
    * completely defined by the application
86
    * completely defined by the application
87
  * The window of type II looks as follows:
87
  * The window of type II looks as follows:
88
    * draw external frame of width 1 pixel with the "shaded" color
88
    * draw external frame of width 1 pixel with the "shaded" color
89
      edi (all components of the color decrease twice)
89
      edi (all components of the color decrease twice)
90
    * draw intermediate frame of width 3 pixels with color edi
90
    * draw intermediate frame of width 3 pixels with color edi
91
    * draw internal frame of width 1 pixel with the "shaded" color edi
91
    * draw internal frame of width 1 pixel with the "shaded" color edi
92
    * draw header - rectangle with the left upper corner (4,4)
92
    * draw header - rectangle with the left upper corner (4,4)
93
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
93
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
94
      (taking a gradient into account)
94
      (taking a gradient into account)
95
    * if ysize>=26, fill the working area of the window -
95
    * if ysize>=26, fill the working area of the window -
96
      rectangle with the left upper corner (5,20) and right lower
96
      rectangle with the left upper corner (5,20) and right lower
97
      (xsize-5,ysize-5) with color indicated in edx
97
      (xsize-5,ysize-5) with color indicated in edx
98
      (taking a gradient into account)
98
      (taking a gradient into account)
99
    * if A=1 and caption has been already set by subfunction 1
99
    * if A=1 and caption has been already set by subfunction 1
100
      of function 71, it is drawn in the corresponding place of header
100
      of function 71, it is drawn in the corresponding place of header
101
  * The skinned window looks as follows:
101
  * The skinned window looks as follows:
102
    * draw external frame of width 1 pixel
102
    * draw external frame of width 1 pixel
103
      with color 'outer' from the skin
103
      with color 'outer' from the skin
104
    * draw intermediate frame of width 3 pixel
104
    * draw intermediate frame of width 3 pixel
105
      with color 'frame' from the skin
105
      with color 'frame' from the skin
106
    * draw internal frame of width 1 pixel
106
    * draw internal frame of width 1 pixel
107
      with color 'inner' from the skin
107
      with color 'inner' from the skin
108
    * draw header (on bitmaps from the skin) in a rectangle
108
    * draw header (on bitmaps from the skin) in a rectangle
109
      (0,0) - (xsize,_skinh-1)
109
      (0,0) - (xsize,_skinh-1)
110
    * if ysize>=26, fill the working area of the window -
110
    * if ysize>=26, fill the working area of the window -
111
      rectangle with the left upper corner (5,_skinh) and right lower
111
      rectangle with the left upper corner (5,_skinh) and right lower
112
      (xsize-5,ysize-5) with color indicated in edx
112
      (xsize-5,ysize-5) with color indicated in edx
113
      (taking a gradient into account)
113
      (taking a gradient into account)
114
    * define two standard buttons: for close and minimize
114
    * define two standard buttons: for close and minimize
115
      (see function 8)
115
      (see function 8)
116
    * if A=1 and edi contains (nonzero) pointer to caption string,
116
    * if A=1 and edi contains (nonzero) pointer to caption string,
117
      it is drawn in place in header defined in the skin
117
      it is drawn in place in header defined in the skin
118
    * value _skinh is accessible as the result of call
118
    * value _skinh is accessible as the result of call
119
      subfunction 4 of function 48
119
      subfunction 4 of function 48
120
 
120
 
121
======================================================================
121
======================================================================
122
================ Function 1 - put pixel in the window. ===============
122
================ Function 1 - put pixel in the window. ===============
123
======================================================================
123
======================================================================
124
Parameters:
124
Parameters:
125
  * eax = 1 - function number
125
  * eax = 1 - function number
126
  * ebx = x-coordinate (relative to the window)
126
  * ebx = x-coordinate (relative to the window)
127
  * ecx = y-coordinate (relative to the window)
127
  * ecx = y-coordinate (relative to the window)
128
  * edx = 0x00RRGGBB - color of a pixel
128
  * edx = 0x00RRGGBB - color of a pixel
129
    edx = 0x01xxxxxx - invert color of a pixel
129
    edx = 0x01xxxxxx - invert color of a pixel
130
          (low 24 bits are ignored)
130
          (low 24 bits are ignored)
131
Returned value:
131
Returned value:
132
  * function does not return value
132
  * function does not return value
133
 
133
 
134
======================================================================
134
======================================================================
135
============ Function 2 - get the code of the pressed key. ===========
135
============ Function 2 - get the code of the pressed key. ===========
136
======================================================================
136
======================================================================
137
Takes away the code of the pressed key from the buffer.
137
Takes away the code of the pressed key from the buffer.
138
Parameters:
138
Parameters:
139
  * eax = 2 - function number
139
  * eax = 2 - function number
140
Returned value:
140
Returned value:
141
  * if the buffer is empty, function returns eax=1
141
  * if the buffer is empty, function returns eax=1
142
  * if the buffer is not empty, function returns al=0,
142
  * if the buffer is not empty, function returns al=0,
143
    ah=code of the pressed key, high word of eax is zero
143
    ah=code of the pressed key, high word of eax is zero
144
  * if there is "hotkey", function returns al=2,
144
  * if there is "hotkey", function returns al=2,
145
    ah=scancode of the pressed key (0 for control keys),
145
    ah=scancode of the pressed key (0 for control keys),
146
    high word of eax contains a status of control keys at the moment
146
    high word of eax contains a status of control keys at the moment
147
    of pressing a hotkey
147
    of pressing a hotkey
148
Remarks:
148
Remarks:
149
  * There is a common system buffer of the pressed keys
149
  * There is a common system buffer of the pressed keys
150
    by a size of 120 bytes, organized as queue.
150
    by a size of 120 bytes, organized as queue.
151
  * There is one more common system buffer on 120 "hotkeys".
151
  * There is one more common system buffer on 120 "hotkeys".
152
  * If the application with the inactive window calls this function,
152
  * If the application with the inactive window calls this function,
153
    the buffer of the pressed keys is considered to be empty.
153
    the buffer of the pressed keys is considered to be empty.
154
  * By default this function returns ASCII-codes; to switch
154
  * By default this function returns ASCII-codes; to switch
155
    to the scancodes mode (and back) use function 66.
155
    to the scancodes mode (and back) use function 66.
156
    However, hotkeys are always notificated as scancodes.
156
    However, hotkeys are always notificated as scancodes.
157
  * To find out, what keys correspond to what codes, start
157
  * To find out, what keys correspond to what codes, start
158
    the application keyascii and scancode.
158
    the application keyascii and scancode.
159
  * Scancodes come directly from keyboard and are fixed;
159
  * Scancodes come directly from keyboard and are fixed;
160
    ASCII-codes turn out with usage of the conversion tables,
160
    ASCII-codes turn out with usage of the conversion tables,
161
    which can be set by subfunction 2 of function 21
161
    which can be set by subfunction 2 of function 21
162
    and get by subfunction 2 of function 26.
162
    and get by subfunction 2 of function 26.
163
  * As a consequence, ASCII-codes take into account current
163
  * As a consequence, ASCII-codes take into account current
164
    keyboard layout (rus/en) as opposed to scancodes.
164
    keyboard layout (rus/en) as opposed to scancodes.
165
  * This function notifies only about those hotkeys, which were
165
  * This function notifies only about those hotkeys, which were
166
    defined by this thread by subfunction 4 of function 66.
166
    defined by this thread by subfunction 4 of function 66.
167
 
167
 
168
======================================================================
168
======================================================================
169
==================== Function 3 - get system time. ===================
169
==================== Function 3 - get system time. ===================
170
======================================================================
170
======================================================================
171
Parameters:
171
Parameters:
172
  * eax = 3 - function number
172
  * eax = 3 - function number
173
Returned value:
173
Returned value:
174
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
174
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
175
  * each item is BCD-number, for example,
175
  * each item is BCD-number, for example,
176
    for time 23:59:59 function returns 0x00595923
176
    for time 23:59:59 function returns 0x00595923
177
Remarks:
177
Remarks:
178
  * See also subfunction 9 of function 26 - get time from
178
  * See also subfunction 9 of function 26 - get time from
179
    the moment of start of the system; it is more convenient, because
179
    the moment of start of the system; it is more convenient, because
180
    returns simply DWORD-value of the time counter.
180
    returns simply DWORD-value of the time counter.
181
  * System time can be set by function 22.
181
  * System time can be set by function 22.
182
 
182
 
183
======================================================================
183
======================================================================
184
============ Function 4 - draw text string in the window. ============
184
============ Function 4 - draw text string in the window. ============
185
======================================================================
185
======================================================================
186
Parameters:
186
Parameters:
187
  * eax = 4 - function number
187
  * eax = 4 - function number
188
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
188
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
189
  * ecx = 0xX0RRGGBB, where
189
  * ecx = 0xX0RRGGBB, where
190
    * RR, GG, BB specify text color
190
    * RR, GG, BB specify text color
191
    * X specifies the used font: 0=system monospaced,
191
    * X specifies the used font: 0=system monospaced,
192
      1=system font of variable width
192
      1=system font of variable width
193
  * edx = pointer to the beginning of the string
193
  * edx = pointer to the beginning of the string
194
  * esi = length of the string, must not exceed 255
194
  * esi = length of the string, must not exceed 255
195
Returned value:
195
Returned value:
196
  * function does not return value
196
  * function does not return value
197
Remarks:
197
Remarks:
198
  * Function outputs either first (esi and 0xFF) characters or
198
  * Function outputs either first (esi and 0xFF) characters or
199
    all characters before (but not including) terminating zero
199
    all characters before (but not including) terminating zero
200
    (for ASCIIZ-strings) depending on what occurs first.
200
    (for ASCIIZ-strings) depending on what occurs first.
201
  * First system font is read out at loading from the file char.mt,
201
  * First system font is read out at loading from the file char.mt,
202
    second - from char2.mt.
202
    second - from char2.mt.
203
  * Both fonts have height 9 pixels, width of the monospaced font
203
  * Both fonts have height 9 pixels, width of the monospaced font
204
    is equal to 6 pixels.
204
    is equal to 6 pixels.
205
 
205
 
206
======================================================================
206
======================================================================
207
========================= Function 5 - delay. ========================
207
========================= Function 5 - delay. ========================
208
======================================================================
208
======================================================================
209
Delays execution of the program on the given time.
209
Delays execution of the program on the given time.
210
Parameters:
210
Parameters:
211
  * eax = 5 - function number
211
  * eax = 5 - function number
212
  * ebx = time in the 1/100 of second
212
  * ebx = time in the 1/100 of second
213
Returned value:
213
Returned value:
214
  * function does not return value
214
  * function does not return value
215
Remarks:
215
Remarks:
216
  * Passing ebx=0 does not transfer control to the next process
216
  * Passing ebx=0 does not transfer control to the next process
217
    and does not make any operations at all. If it is really required
217
    and does not make any operations at all. If it is really required
218
    to transfer control to the next process (to complete a current
218
    to transfer control to the next process (to complete a current
219
    time slice), use subfunction 1 of function 68.
219
    time slice), use subfunction 1 of function 68.
220
  * At current implementation there will be an immediate return from
220
  * At current implementation there will be an immediate return from
221
    the function, if the addition of ebx with current value of
221
    the function, if the addition of ebx with current value of
222
    time counter will call 32-bit overflow.
222
    time counter will call 32-bit overflow.
223
 
223
 
224
======================================================================
224
======================================================================
225
============== Function 6 - read the file from ramdisk. ==============
225
============== Function 6 - read the file from ramdisk. ==============
226
======================================================================
226
======================================================================
227
Parameters:
227
Parameters:
228
  * eax = 6 - function number
228
  * eax = 6 - function number
229
  * ebx = pointer to the filename
229
  * ebx = pointer to the filename
230
  * ecx = number of start block, beginning from 1;
230
  * ecx = number of start block, beginning from 1;
231
    ecx=0 - read from the beginning of the file (same as ecx=1)
231
    ecx=0 - read from the beginning of the file (same as ecx=1)
232
  * edx = number of blocks to read;
232
  * edx = number of blocks to read;
233
    edx=0 - read one block (same as edx=1)
233
    edx=0 - read one block (same as edx=1)
234
  * esi = pointer to memory area for the data
234
  * esi = pointer to memory area for the data
235
Returned value:
235
Returned value:
236
  * eax = file size in bytes, if the file was successfully read
236
  * eax = file size in bytes, if the file was successfully read
237
  * eax = -1, if the file was not found
237
  * eax = -1, if the file was not found
238
Remarks:
238
Remarks:
239
  * This function is out-of-date; function 70 allows
239
  * This function is out-of-date; function 70 allows
240
    to fulfil the same operations with the extended possibilities.
240
    to fulfil the same operations with the extended possibilities.
241
  * Block = 512 bytes.
241
  * Block = 512 bytes.
242
  * For reading all file you can specify the certainly large value
242
  * For reading all file you can specify the certainly large value
243
    in edx, for example, edx = -1; but in this case be ready that
243
    in edx, for example, edx = -1; but in this case be ready that
244
    the program will "fall", if the file will appear too large and can
244
    the program will "fall", if the file will appear too large and can
245
    not be placed in the program memory.
245
    not be placed in the program memory.
246
  * The filename must be either in the format 8+3 characters
246
  * The filename must be either in the format 8+3 characters
247
    (first 8 characters - name itself, last 3 - extension,
247
    (first 8 characters - name itself, last 3 - extension,
248
    the short names and extensions are supplemented with spaces),
248
    the short names and extensions are supplemented with spaces),
249
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
249
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
250
    (name no more than 8 characters, dot, extension 3 characters
250
    (name no more than 8 characters, dot, extension 3 characters
251
    supplemented if necessary by spaces).
251
    supplemented if necessary by spaces).
252
    The filename must be written with capital letters. The terminating
252
    The filename must be written with capital letters. The terminating
253
    character with code 0 is not necessary (not ASCIIZ-string).
253
    character with code 0 is not necessary (not ASCIIZ-string).
254
  * This function does not support folders on the ramdisk.
254
  * This function does not support folders on the ramdisk.
255
 
255
 
256
======================================================================
256
======================================================================
257
=============== Function 7 - draw image in the window. ===============
257
=============== Function 7 - draw image in the window. ===============
258
======================================================================
258
======================================================================
259
Paramters:
259
Paramters:
260
  * eax = 7 - function number
260
  * eax = 7 - function number
261
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
261
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
262
  * ecx = [size on axis x]*65536 + [size on axis y]
262
  * ecx = [size on axis x]*65536 + [size on axis y]
263
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
263
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
264
Returned value:
264
Returned value:
265
  * function does not return value
265
  * function does not return value
266
Remarks:
266
Remarks:
267
  * Coordinates of the image are coordinates of the upper left corner
267
  * Coordinates of the image are coordinates of the upper left corner
268
    of the image relative to the window.
268
    of the image relative to the window.
269
  * Size of the image in bytes is 3*xsize*ysize.
269
  * Size of the image in bytes is 3*xsize*ysize.
270
 
270
 
271
======================================================================
271
======================================================================
272
=============== Function 8 - define/delete the button. ===============
272
=============== Function 8 - define/delete the button. ===============
273
======================================================================
273
======================================================================
274
Parameters for button definition:
274
Parameters for button definition:
275
  * eax = 8 - function number
275
  * eax = 8 - function number
276
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
276
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
277
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
277
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
278
  * edx = 0xXYnnnnnn, where:
278
  * edx = 0xXYnnnnnn, where:
279
    * nnnnnn = identifier of the button
279
    * nnnnnn = identifier of the button
280
    * high (31st) bit of edx is cleared
280
    * high (31st) bit of edx is cleared
281
    * if 30th bit of edx is set - do not draw the button
281
    * if 30th bit of edx is set - do not draw the button
282
    * if 29th bit of edx is set - do not draw a frame
282
    * if 29th bit of edx is set - do not draw a frame
283
      at pressing the button
283
      at pressing the button
284
  * esi = 0x00RRGGBB - color of the button
284
  * esi = 0x00RRGGBB - color of the button
285
Parameters for button deleting:
285
Parameters for button deleting:
286
  * eax = 8 - function number
286
  * eax = 8 - function number
287
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
287
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
288
Returned value:
288
Returned value:
289
  * function does not return value
289
  * function does not return value
290
Remarks:
290
Remarks:
291
  * Sizes of the button must be more than 0 and less than 0x8000.
291
  * Sizes of the button must be more than 0 and less than 0x8000.
292
  * For windows with skin definition of the window
292
  * For windows with skin definition of the window
293
    (call of 0th function) creates two standard buttons -
293
    (call of 0th function) creates two standard buttons -
294
    for close of the window with identifier 1 and
294
    for close of the window with identifier 1 and
295
    for minimize of the window with identifier 0xffff.
295
    for minimize of the window with identifier 0xffff.
296
  * The creation of two buttons with same identifiers is admitted.
296
  * The creation of two buttons with same identifiers is admitted.
297
  * The button with the identifier 0xffff at pressing is interpreted
297
  * The button with the identifier 0xffff at pressing is interpreted
298
    by the system as the button of minimization, the system handles
298
    by the system as the button of minimization, the system handles
299
    such pressing independently, not accessing to the application.
299
    such pressing independently, not accessing to the application.
300
    In rest it is usual button.
300
    In rest it is usual button.
301
  * Total number of buttons for all applications is limited to 4095.
301
  * Total number of buttons for all applications is limited to 4095.
302
 
302
 
303
======================================================================
303
======================================================================
304
============ Function 9 - information on execution thread. ===========
304
============ Function 9 - information on execution thread. ===========
305
======================================================================
305
======================================================================
306
Parameters:
306
Parameters:
307
  * eax = 9 - function number
307
  * eax = 9 - function number
308
  * ebx = pointer to 1-Kb buffer
308
  * ebx = pointer to 1-Kb buffer
309
  * ecx = number of the slot of the thread
309
  * ecx = number of the slot of the thread
310
    ecx = -1 - get information on the current thread
310
    ecx = -1 - get information on the current thread
311
Returned value:
311
Returned value:
312
  * eax = maximum number of the slot of a thread
312
  * eax = maximum number of the slot of a thread
313
  * buffer pointed to by ebx contains the following information:
313
  * buffer pointed to by ebx contains the following information:
314
    * +0: dword: usage of the processor (how many time units
314
    * +0: dword: usage of the processor (how many time units
315
      per second leaves on execution of this thread)
315
      per second leaves on execution of this thread)
316
    * +4: word: position of the window of thread in the window stack
316
    * +4: word: position of the window of thread in the window stack
317
    * +6: word: (has no relation to the specified thread)
317
    * +6: word: (has no relation to the specified thread)
318
      number of the thread slot, which window has in the window stack
318
      number of the thread slot, which window has in the window stack
319
      position ecx
319
      position ecx
320
    * +8: word: reserved
320
    * +8: word: reserved
321
    * +10 = +0xA: 11 bytes: name of the process
321
    * +10 = +0xA: 11 bytes: name of the process
322
      (name of corresponding executable file in the format 8+3)
322
      (name of corresponding executable file in the format 8+3)
323
    * +21 = +0x15: byte: alignment, this byte preserves
323
    * +21 = +0x15: byte: alignment, this byte preserves
324
    * +22 = +0x16: dword: address of the process in memory
324
    * +22 = +0x16: dword: address of the process in memory
325
    * +26 = +0x1A: dword: size of used memory - 1
325
    * +26 = +0x1A: dword: size of used memory - 1
326
    * +30 = +0x1E: dword: identifier (PID/TID)
326
    * +30 = +0x1E: dword: identifier (PID/TID)
327
    * +34 = +0x22: dword: coordinate of the thread window on axis x
327
    * +34 = +0x22: dword: coordinate of the thread window on axis x
328
    * +38 = +0x26: dword: coordinate of the thread window on axis y
328
    * +38 = +0x26: dword: coordinate of the thread window on axis y
329
    * +42 = +0x2A: dword: size of the thread window on axis x
329
    * +42 = +0x2A: dword: size of the thread window on axis x
330
    * +46 = +0x2E: dword: size of the thread window on axis y
330
    * +46 = +0x2E: dword: size of the thread window on axis y
331
    * +50 = +0x32: word: status of the thread slot:
331
    * +50 = +0x32: word: status of the thread slot:
332
      * 0 = thread is running
332
      * 0 = thread is running
333
      * 1 = thread is suspended
333
      * 1 = thread is suspended
334
      * 2 = thread is suspended while waiting for event
334
      * 2 = thread is suspended while waiting for event
335
      * 3 = thread is terminating as a result of call to function -1
335
      * 3 = thread is terminating as a result of call to function -1
336
        or under duress as a result of call to subfunction 2
336
        or under duress as a result of call to subfunction 2
337
        of function 18 or termination of the system
337
        of function 18 or termination of the system
338
      * 4 = thread is terminating as a result of exception
338
      * 4 = thread is terminating as a result of exception
339
      * 5 = thread waits for event
339
      * 5 = thread waits for event
340
      * 9 = requested slot is free, all other information on the slot
340
      * 9 = requested slot is free, all other information on the slot
341
        is not meaningful
341
        is not meaningful
342
Remarks:
342
Remarks:
343
  * Slots are numbered starting from 1.
343
  * Slots are numbered starting from 1.
344
  * Returned value is not a total number of threads, because there
344
  * Returned value is not a total number of threads, because there
345
    can be free slots.
345
    can be free slots.
346
  * When process is starting, system automatically creates
346
  * When process is starting, system automatically creates
347
    execution thread.
347
    execution thread.
348
  * Function gives information on the thread. Each process has
348
  * Function gives information on the thread. Each process has
349
    at least one thread. One process can create many threads,
349
    at least one thread. One process can create many threads,
350
    in this case each thread has its own slot and the fields
350
    in this case each thread has its own slot and the fields
351
    +10, +22, +26 in these slots coincide.
351
    +10, +22, +26 in these slots coincide.
352
    Applications have no common way to define whether two threads
352
    Applications have no common way to define whether two threads
353
    belong to one process.
353
    belong to one process.
354
  * The active window - window on top of the window stack -
354
  * The active window - window on top of the window stack -
355
    receives the messages on a keyboard input. For such window
355
    receives the messages on a keyboard input. For such window
356
    the position in the window stack coincides with returned value.
356
    the position in the window stack coincides with returned value.
357
  * Slot 1 corresponds to special system thread, for which:
357
  * Slot 1 corresponds to special system thread, for which:
358
    * the window is in the bottom of the window stack, the fields
358
    * the window is in the bottom of the window stack, the fields
359
      +4 and +6 contain value 1
359
      +4 and +6 contain value 1
360
    * name of the process - "OS/IDLE" (supplemented by spaces)
360
    * name of the process - "OS/IDLE" (supplemented by spaces)
361
    * address of the process in memory is 0, size of used memory is
361
    * address of the process in memory is 0, size of used memory is
362
      16 Mb (0x1000000)
362
      16 Mb (0x1000000)
363
    * PID=1
363
    * PID=1
364
    * coordinates and sizes of the window are by convention set to 0
364
    * coordinates and sizes of the window are by convention set to 0
365
    * status of the slot is always 0 (running)
365
    * status of the slot is always 0 (running)
366
    * the execution time adds of time leaving on operations itself
366
    * the execution time adds of time leaving on operations itself
367
      and idle time in waiting for interrupt (which can be got by call
367
      and idle time in waiting for interrupt (which can be got by call
368
      to subfunction 4 of function 18).
368
      to subfunction 4 of function 18).
369
  * Beginning from slot 2, the normal applications are placed.
369
  * Beginning from slot 2, the normal applications are placed.
370
  * The normal applications are placed in memory at the address
370
  * The normal applications are placed in memory at the address
371
    0x10000000 (kernel constand 'std_application_base_address').
371
    0x10000000 (kernel constand 'std_application_base_address').
372
    There is no intersection, as each process has its own page table.
372
    There is no intersection, as each process has its own page table.
373
  * At creation of the thread it is assigned the slot
373
  * At creation of the thread it is assigned the slot
374
    in the system table and identifier (Process/Thread IDentifier =
374
    in the system table and identifier (Process/Thread IDentifier =
375
    PID/TID), which do not vary with time for given thread.
375
    PID/TID), which do not vary with time for given thread.
376
    After completion of the thread its slot can be anew used
376
    After completion of the thread its slot can be anew used
377
    for another thread. The thread identifier can not be assigned
377
    for another thread. The thread identifier can not be assigned
378
    to other thread even after completion of this thread.
378
    to other thread even after completion of this thread.
379
    Identifiers, assigned to new threads, grow monotonously.
379
    Identifiers, assigned to new threads, grow monotonously.
380
  * If the thread has not yet defined the window by call to
380
  * If the thread has not yet defined the window by call to
381
    function 0, the position and the sizes
381
    function 0, the position and the sizes
382
    of its window are considered to be zero.
382
    of its window are considered to be zero.
383
  * At the moment only the part of the buffer by a size
383
  * At the moment only the part of the buffer by a size
384
    52 = 0x34 bytes is used. Nevertheless it is recommended to use
384
    52 = 0x34 bytes is used. Nevertheless it is recommended to use
385
    1-Kb buffer for the future compatibility, in the future
385
    1-Kb buffer for the future compatibility, in the future
386
    some fields can be added.
386
    some fields can be added.
387
 
387
 
388
======================================================================
388
======================================================================
389
==================== Function 10 - wait for event. ===================
389
==================== Function 10 - wait for event. ===================
390
======================================================================
390
======================================================================
391
If the message queue is empty, waits for appearance of the message
391
If the message queue is empty, waits for appearance of the message
392
in queue. In this state thread does not consume CPU time.
392
in queue. In this state thread does not consume CPU time.
393
Then reads out the message from queue.
393
Then reads out the message from queue.
394
 
394
 
395
Parameters:
395
Parameters:
396
  * eax = 10 - function number
396
  * eax = 10 - function number
397
Returned value:
397
Returned value:
398
  * eax = event (see the list of events)
398
  * eax = event (see the list of events)
399
Remarks:
399
Remarks:
400
  * Those events are taken into account only which enter into
400
  * Those events are taken into account only which enter into
401
    a mask set by function 40. By default it is
401
    a mask set by function 40. By default it is
402
    redraw, key and button events.
402
    redraw, key and button events.
403
  * To check, whether there is a message in queue, use function 11.
403
  * To check, whether there is a message in queue, use function 11.
404
    To wait for no more than given time, use function 23.
404
    To wait for no more than given time, use function 23.
405
 
405
 
406
======================================================================
406
======================================================================
407
=============== Function 11 - check for event, no wait. ==============
407
=============== Function 11 - check for event, no wait. ==============
408
======================================================================
408
======================================================================
409
If the message queue contains event, function reads out
409
If the message queue contains event, function reads out
410
and return it. If the queue is empty, function returns 0.
410
and return it. If the queue is empty, function returns 0.
411
Parameters:
411
Parameters:
412
  * eax = 11 - function number
412
  * eax = 11 - function number
413
Returned value:
413
Returned value:
414
  * eax = 0 - message queue is empty
414
  * eax = 0 - message queue is empty
415
  * else eax = event (see the list of events)
415
  * else eax = event (see the list of events)
416
Remarks:
416
Remarks:
417
  * Those events are taken into account only, which enter into
417
  * Those events are taken into account only, which enter into
418
    a mask set by function 40. By default it is
418
    a mask set by function 40. By default it is
419
    redraw, key and button events.
419
    redraw, key and button events.
420
  * To wait for event, use function 10.
420
  * To wait for event, use function 10.
421
    To wait for no more than given time, use function 23.
421
    To wait for no more than given time, use function 23.
422
 
422
 
423
======================================================================
423
======================================================================
424
=============== Function 12 - begin/end window redraw. ===============
424
=============== Function 12 - begin/end window redraw. ===============
425
======================================================================
425
======================================================================
426
 
426
 
427
------------ Subfunction 1 - begin redraw of the window. -------------
427
------------ Subfunction 1 - begin redraw of the window. -------------
428
Parameters:
428
Parameters:
429
  * eax = 12 - function number
429
  * eax = 12 - function number
430
  * ebx = 1 - subfunction number
430
  * ebx = 1 - subfunction number
431
Returned value:
431
Returned value:
432
  * function does not return value
432
  * function does not return value
433
 
433
 
434
------------- Subfunction 2 - end redraw of the window. --------------
434
------------- Subfunction 2 - end redraw of the window. --------------
435
Parameters:
435
Parameters:
436
  * eax = 12 - function number
436
  * eax = 12 - function number
437
  * ebx = 2 - subfunction number
437
  * ebx = 2 - subfunction number
438
Returned value:
438
Returned value:
439
  * function does not return value
439
  * function does not return value
440
Remarks:
440
Remarks:
441
  * Subfunction 1 deletes all buttons defined with
441
  * Subfunction 1 deletes all buttons defined with
442
    function 8, they must be defined again.
442
    function 8, they must be defined again.
443
 
443
 
444
======================================================================
444
======================================================================
445
============ Function 13 - draw a rectangle in the window. ===========
445
============ Function 13 - draw a rectangle in the window. ===========
446
======================================================================
446
======================================================================
447
Parameters:
447
Parameters:
448
  * eax = 13 - function number
448
  * eax = 13 - function number
449
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
449
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
450
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
450
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
451
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
451
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
452
Returned value:
452
Returned value:
453
  * function does not return value
453
  * function does not return value
454
Remarks:
454
Remarks:
455
  * Coordinates are understood as coordinates of the left upper corner
455
  * Coordinates are understood as coordinates of the left upper corner
456
    of a rectangle relative to the window.
456
    of a rectangle relative to the window.
457
 
457
 
458
======================================================================
458
======================================================================
459
=================== Function 14 - get screen size. ===================
459
=================== Function 14 - get screen size. ===================
460
======================================================================
460
======================================================================
461
Parameters:
461
Parameters:
462
  * eax = 14 - function number
462
  * eax = 14 - function number
463
Returned value:
463
Returned value:
464
  * eax = [xsize]*65536 + [ysize], where
464
  * eax = [xsize]*65536 + [ysize], where
465
  * xsize = x-coordinate of the right lower corner of the screen =
465
  * xsize = x-coordinate of the right lower corner of the screen =
466
            horizontal size - 1
466
            horizontal size - 1
467
  * ysize = y-coordinate of the right lower corner of the screen =
467
  * ysize = y-coordinate of the right lower corner of the screen =
468
            vertical size - 1
468
            vertical size - 1
469
Remarks:
469
Remarks:
470
  * See also subfunction 5 of function 48 - get sizes of
470
  * See also subfunction 5 of function 48 - get sizes of
471
    working area of the screen.
471
    working area of the screen.
472
 
472
 
473
======================================================================
473
======================================================================
474
== Function 15, subfunction 1 - set a size of the background image. ==
474
== Function 15, subfunction 1 - set a size of the background image. ==
475
======================================================================
475
======================================================================
476
Parameters:
476
Parameters:
477
  * eax = 15 - function number
477
  * eax = 15 - function number
478
  * ebx = 1 - subfunction number
478
  * ebx = 1 - subfunction number
479
  * ecx = width of the image
479
  * ecx = width of the image
480
  * edx = height of the image
480
  * edx = height of the image
481
Returned value:
481
Returned value:
482
  * function does not return value
482
  * function does not return value
483
Remarks:
483
Remarks:
484
  * There is no checks for correctness. The setting of too large
484
  * There is no checks for correctness. The setting of too large
485
    values will result that the background will contain data abroad
485
    values will result that the background will contain data abroad
486
    of buffer for the background image. Buffer size = 0x160000-0x10,
486
    of buffer for the background image. Buffer size = 0x160000-0x10,
487
    that corresponds to maximum size 800*600. (800*600*3=0x15F900)
487
    that corresponds to maximum size 800*600. (800*600*3=0x15F900)
488
  * For update of the screen (after completion of a series of commands
488
  * For update of the screen (after completion of a series of commands
489
    working with a background) call subfunction 3.
489
    working with a background) call subfunction 3.
490
  * There is a pair function for get size of the background image -
490
  * There is a pair function for get size of the background image -
491
    subfunction 1 of function 39.
491
    subfunction 1 of function 39.
492
 
492
 
493
======================================================================
493
======================================================================
494
=== Function 15, subfunction 2 - put pixel on the background image. ==
494
=== Function 15, subfunction 2 - put pixel on the background image. ==
495
======================================================================
495
======================================================================
496
Parameters:
496
Parameters:
497
  * eax = 15 - function number
497
  * eax = 15 - function number
498
  * ebx = 2 - subfunction number
498
  * ebx = 2 - subfunction number
499
  * ecx = offset
499
  * ecx = offset
500
  * edx = color of a pixel 0xRRGGBB
500
  * edx = color of a pixel 0xRRGGBB
501
Returned value:
501
Returned value:
502
  * function does not return value
502
  * function does not return value
503
Remarks:
503
Remarks:
504
  * Offset for a pixel with coordinates (x,y) is calculated as
504
  * Offset for a pixel with coordinates (x,y) is calculated as
505
    (x+y*xsize)*3.
505
    (x+y*xsize)*3.
506
  * If the given offset exceeds 0x160000-16 = 1.375 Mb - 16 bytes,
506
  * If the given offset exceeds 0x160000-16 = 1.375 Mb - 16 bytes,
507
    the call is ignored.
507
    the call is ignored.
508
  * For update of the screen (after completion of a series of commands
508
  * For update of the screen (after completion of a series of commands
509
    working with a background) call subfunction 3.
509
    working with a background) call subfunction 3.
510
  * There is a pair function for get pixel on the background image -
510
  * There is a pair function for get pixel on the background image -
511
    subfunction 2 of function 39.
511
    subfunction 2 of function 39.
512
 
512
 
513
======================================================================
513
======================================================================
514
=========== Function 15, subfunction 3 - redraw background. ==========
514
=========== Function 15, subfunction 3 - redraw background. ==========
515
======================================================================
515
======================================================================
516
Parameters:
516
Parameters:
517
  * eax = 15 - function number
517
  * eax = 15 - function number
518
  * ebx = 3 - subfunction number
518
  * ebx = 3 - subfunction number
519
Returned value:
519
Returned value:
520
  * function does not return value
520
  * function does not return value
521
 
521
 
522
======================================================================
522
======================================================================
523
== Function 15, subfunction 4 - set drawing mode for the background. =
523
== Function 15, subfunction 4 - set drawing mode for the background. =
524
======================================================================
524
======================================================================
525
Parameters:
525
Parameters:
526
  * eax = 15 - function number
526
  * eax = 15 - function number
527
  * ebx = 4 - subfunction number
527
  * ebx = 4 - subfunction number
528
  * ecx = drawing mode:
528
  * ecx = drawing mode:
529
    * 1 = tile
529
    * 1 = tile
530
    * 2 = stretch
530
    * 2 = stretch
531
Returned value:
531
Returned value:
532
  * function does not return value
532
  * function does not return value
533
Remarks:
533
Remarks:
534
  * For update of the screen (after completion of a series of commands
534
  * For update of the screen (after completion of a series of commands
535
    working with a background) call subfunction 3.
535
    working with a background) call subfunction 3.
536
  * There is a pair function for get drawing mode of the background -
536
  * There is a pair function for get drawing mode of the background -
537
    subfunction 4 of function 39.
537
    subfunction 4 of function 39.
538
 
538
 
539
======================================================================
539
======================================================================
540
===================== Function 15, subfunction 5 =====================
540
===================== Function 15, subfunction 5 =====================
541
============ Put block of pixels on the background image. ============
541
============ Put block of pixels on the background image. ============
542
======================================================================
542
======================================================================
543
Parameters:
543
Parameters:
544
  * eax = 15 - function number
544
  * eax = 15 - function number
545
  * ebx = 5 - subfunction number
545
  * ebx = 5 - subfunction number
546
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
546
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
547
  * edx = offset in data of the background image
547
  * edx = offset in data of the background image
548
  * esi = size of data in bytes = 3 * number of pixels
548
  * esi = size of data in bytes = 3 * number of pixels
549
Returned value:
549
Returned value:
550
  * function does not return value
550
  * function does not return value
551
Remarks:
551
Remarks:
552
  * If the block gets out abroad 0x160000-16 = 1.375 Mb - 16 bytes,
552
  * If the block gets out abroad 0x160000-16 = 1.375 Mb - 16 bytes,
553
    the call is ignored.
553
    the call is ignored.
554
  * Color of each pixel is stored as 3-bytes value BBGGRR.
554
  * Color of each pixel is stored as 3-bytes value BBGGRR.
555
  * Pixels of the background image are written sequentially
555
  * Pixels of the background image are written sequentially
556
    from left to right, from up to down.
556
    from left to right, from up to down.
557
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
557
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
558
  * For update of the screen (after completion of a series of commands
558
  * For update of the screen (after completion of a series of commands
559
    working with a background) call subfunction 3.
559
    working with a background) call subfunction 3.
560
 
560
 
561
======================================================================
561
======================================================================
562
=============== Function 16 - save ramdisk on a floppy. ==============
562
=============== Function 16 - save ramdisk on a floppy. ==============
563
======================================================================
563
======================================================================
564
Parameters:
564
Parameters:
565
  * eax = 16 - function number
565
  * eax = 16 - function number
566
  * ebx = 1 or ebx = 2 - on which floppy save
566
  * ebx = 1 or ebx = 2 - on which floppy save
567
Returned value:
567
Returned value:
568
  * eax = 0 - success
568
  * eax = 0 - success
569
  * eax = 1 - error
569
  * eax = 1 - error
570
 
570
 
571
======================================================================
571
======================================================================
572
======= Function 17 - get the identifier of the pressed button. ======
572
======= Function 17 - get the identifier of the pressed button. ======
573
======================================================================
573
======================================================================
574
Takes away the code of the pressed button from the buffer.
574
Takes away the code of the pressed button from the buffer.
575
Parameters:
575
Parameters:
576
  * eax = 17 - function number
576
  * eax = 17 - function number
577
Returned value:
577
Returned value:
578
  * if the buffer is empty, function returns eax=1
578
  * if the buffer is empty, function returns eax=1
579
  * if the buffer is not empty, function returns al=0,
579
  * if the buffer is not empty, function returns al=0,
580
    high 24 bits of eax contain button identifier (in particular, ah
580
    high 24 bits of eax contain button identifier (in particular, ah
581
    contains low byte of the identifier; if all buttons have
581
    contains low byte of the identifier; if all buttons have
582
    the identifier less than 256, ah is enough to distinguish).
582
    the identifier less than 256, ah is enough to distinguish).
583
Remarks:
583
Remarks:
584
  * "Buffer" keeps only one button, at pressing the new button the
584
  * "Buffer" keeps only one button, at pressing the new button the
585
    information about old is lost.
585
    information about old is lost.
586
  * The call of this function by an application with inactive window
586
  * The call of this function by an application with inactive window
587
    will return answer "buffer is empty".
587
    will return answer "buffer is empty".
588
 
588
 
589
======================================================================
589
======================================================================
590
============ Function 18, subfunction 1 - system shutdown. ===========
590
============ Function 18, subfunction 1 - system shutdown. ===========
591
======================================================================
591
======================================================================
592
Parameters:
592
Parameters:
593
  * eax = 18 - function number
593
  * eax = 18 - function number
594
  * ebx = 1 - subfunction number
594
  * ebx = 1 - subfunction number
595
Returned value:
595
Returned value:
596
  * function always return eax = 0 as tag of success
596
  * function always return eax = 0 as tag of success
597
Remarks:
597
Remarks:
598
  * On the last step menu of exit from the system appears and waits
598
  * On the last step menu of exit from the system appears and waits
599
    response of the user.
599
    response of the user.
600
  * See also subfunction 9, system shutdown with
600
  * See also subfunction 9, system shutdown with
601
    the parameter to force the choice in the exit menu.
601
    the parameter to force the choice in the exit menu.
602
 
602
 
603
======================================================================
603
======================================================================
604
= Function 18, subfunction 2 - terminate process/thread by the slot. =
604
= Function 18, subfunction 2 - terminate process/thread by the slot. =
605
======================================================================
605
======================================================================
606
Parameters:
606
Parameters:
607
  * eax = 18 - function number
607
  * eax = 18 - function number
608
  * ebx = 2 - subfunction number
608
  * ebx = 2 - subfunction number
609
  * ecx = number of the slot of process/thread
609
  * ecx = number of the slot of process/thread
610
Returned value:
610
Returned value:
611
  * function does not return value
611
  * function does not return value
612
Remarks:
612
Remarks:
613
  * It is impossible to terminate system thread OS/IDLE (with
613
  * It is impossible to terminate system thread OS/IDLE (with
614
    number of the slot 1),
614
    number of the slot 1),
615
    it is possible to terminate any normal process/thread.
615
    it is possible to terminate any normal process/thread.
616
  * See also subfunction 18 - terminate
616
  * See also subfunction 18 - terminate
617
    process/thread by the identifier.
617
    process/thread by the identifier.
618
 
618
 
619
======================================================================
619
======================================================================
620
===================== Function 18, subfunction 3 =====================
620
===================== Function 18, subfunction 3 =====================
621
============= Make active the window of the given thread. ============
621
============= Make active the window of the given thread. ============
622
======================================================================
622
======================================================================
623
Parameters:
623
Parameters:
624
  * eax = 18 - function number
624
  * eax = 18 - function number
625
  * ebx = 3 - subfunction number
625
  * ebx = 3 - subfunction number
626
  * ecx = number of the thread slot
626
  * ecx = number of the thread slot
627
Returned value:
627
Returned value:
628
  * function does not return value
628
  * function does not return value
629
Remarks:
629
Remarks:
630
  * If correct, but nonexistent slot is given,
630
  * If correct, but nonexistent slot is given,
631
    some window is made active.
631
    some window is made active.
632
  * To find out, which window is active, use subfunction 7.
632
  * To find out, which window is active, use subfunction 7.
633
 
633
 
634
======================================================================
634
======================================================================
635
===================== Function 18, subfunction 4 =====================
635
===================== Function 18, subfunction 4 =====================
636
=========== Get counter of idle time units per one second. ===========
636
=========== Get counter of idle time units per one second. ===========
637
======================================================================
637
======================================================================
638
Idle time units are units, in which the processor stands idle
638
Idle time units are units, in which the processor stands idle
639
in waiting for interrupt (in the command 'hlt').
639
in waiting for interrupt (in the command 'hlt').
640
 
640
 
641
Parameters:
641
Parameters:
642
  * eax = 18 - function number
642
  * eax = 18 - function number
643
  * ebx = 4 - subfunction number
643
  * ebx = 4 - subfunction number
644
Returned value:
644
Returned value:
645
  * eax = value of the counter of idle time units per one second
645
  * eax = value of the counter of idle time units per one second
646
 
646
 
647
======================================================================
647
======================================================================
648
========== Function 18, subfunction 5 - get CPU clock rate. ==========
648
========== Function 18, subfunction 5 - get CPU clock rate. ==========
649
======================================================================
649
======================================================================
650
Parameters:
650
Parameters:
651
  * eax = 18 - function number
651
  * eax = 18 - function number
652
  * ebx = 5 - subfunction number
652
  * ebx = 5 - subfunction number
653
Returned value:
653
Returned value:
654
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
654
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
655
 
655
 
656
======================================================================
656
======================================================================
657
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
657
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
658
======================================================================
658
======================================================================
659
Parameters:
659
Parameters:
660
  * eax = 18 - function number
660
  * eax = 18 - function number
661
  * ebx = 6 - subfunction number
661
  * ebx = 6 - subfunction number
662
  * ecx defines path to the file:
662
  * ecx defines path to the file:
663
    * 1 = in the folder "/KOLIBRI"
663
    * 1 = in the folder "/KOLIBRI"
664
    * 2 = in the root folder
664
    * 2 = in the root folder
665
    * 3 = edx points to the path (names of folders in the format 8+3,
665
    * 3 = edx points to the path (names of folders in the format 8+3,
666
      divided by '/')
666
      divided by '/')
667
Returned value:
667
Returned value:
668
  * eax = 0 - success
668
  * eax = 0 - success
669
  * else eax = error code of the file system
669
  * else eax = error code of the file system
670
Çàìå÷àíèÿ:
670
Çàìå÷àíèÿ:
671
  * Filename is fixed, "menuet.img" (global kernel variable
671
  * Filename is fixed, "menuet.img" (global kernel variable
672
    'image_save' from 'preboot.inc')
672
    'image_save' from 'preboot.inc')
673
  * Drive and partition are defined by subfunction 7
673
  * Drive and partition are defined by subfunction 7
674
    and subfunction 8 of function 21.
674
    and subfunction 8 of function 21.
675
  * All folders in the given path must exist, otherwise function
675
  * All folders in the given path must exist, otherwise function
676
    returns value 5, "file not found".
676
    returns value 5, "file not found".
677
 
677
 
678
======================================================================
678
======================================================================
679
=========== Function 18, subfunction 7 - get active window. ==========
679
=========== Function 18, subfunction 7 - get active window. ==========
680
======================================================================
680
======================================================================
681
Parameters:
681
Parameters:
682
  * eax = 18 - function number
682
  * eax = 18 - function number
683
  * ebx = 7 - subfunction number
683
  * ebx = 7 - subfunction number
684
Returned value:
684
Returned value:
685
  * eax = number of the active window
685
  * eax = number of the active window
686
    (number of the slot of the thread with active window)
686
    (number of the slot of the thread with active window)
687
Remarks:
687
Remarks:
688
  * Active window is at the top of the window stack and receives
688
  * Active window is at the top of the window stack and receives
689
    messages on all keyboard input.
689
    messages on all keyboard input.
690
  * To make a window active, use subfunction 3.
690
  * To make a window active, use subfunction 3.
691
 
691
 
692
======================================================================
692
======================================================================
693
== Function 18, subfunction 8 - disable/enable the internal speaker. =
693
== Function 18, subfunction 8 - disable/enable the internal speaker. =
694
======================================================================
694
======================================================================
695
If speaker sound is disabled, all calls to subfunction 55 of
695
If speaker sound is disabled, all calls to subfunction 55 of
696
function 55 are ignored. If speaker sound is enabled,
696
function 55 are ignored. If speaker sound is enabled,
697
they are routed on builtin speaker.
697
they are routed on builtin speaker.
698
 
698
 
699
------------------- Subsubfunction 1 - get status. -------------------
699
------------------- Subsubfunction 1 - get status. -------------------
700
Parameters:
700
Parameters:
701
  * eax = 18 - function number
701
  * eax = 18 - function number
702
  * ebx = 8 - subfunction number
702
  * ebx = 8 - subfunction number
703
  * ecx = 1 - number of the subsubfunction
703
  * ecx = 1 - number of the subsubfunction
704
Returned value:
704
Returned value:
705
  * eax = 0 - speaker sound is enabled; 1 - disabled
705
  * eax = 0 - speaker sound is enabled; 1 - disabled
706
 
706
 
707
----------------- Subsubfunction 2 - toggle status. ------------------
707
----------------- Subsubfunction 2 - toggle status. ------------------
708
Toggles states of disable/enable.
708
Toggles states of disable/enable.
709
Parameters:
709
Parameters:
710
  * eax = 18 - function number
710
  * eax = 18 - function number
711
  * ebx = 8 - subfunction number
711
  * ebx = 8 - subfunction number
712
  * ecx = 2 - number of the subsubfunction
712
  * ecx = 2 - number of the subsubfunction
713
Returned value:
713
Returned value:
714
  * function does not return value
714
  * function does not return value
715
 
715
 
716
======================================================================
716
======================================================================
717
== Function 18, subfunction 9 - system shutdown with the parameter. ==
717
== Function 18, subfunction 9 - system shutdown with the parameter. ==
718
======================================================================
718
======================================================================
719
Parameters:
719
Parameters:
720
  * eax = 18 - function number
720
  * eax = 18 - function number
721
  * ebx = 9 - subfunction number
721
  * ebx = 9 - subfunction number
722
  * ecx = parameter:
722
  * ecx = parameter:
723
    * 1 = on the last step of shutdown save ramdisk on a floppy and
723
    * 1 = on the last step of shutdown save ramdisk on a floppy and
724
      then show the exit menu and request further operations
724
      then show the exit menu and request further operations
725
      from the user
725
      from the user
726
    * 2 = turn off computer
726
    * 2 = turn off computer
727
    * 3 = reboot computer
727
    * 3 = reboot computer
728
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
728
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
729
Returned value:
729
Returned value:
730
  * at incorrect ecx the registers do not change (i.e. eax=18)
730
  * at incorrect ecx the registers do not change (i.e. eax=18)
731
  * by correct call function always returns eax=0
731
  * by correct call function always returns eax=0
732
    as the tag of success
732
    as the tag of success
733
Remarks:
733
Remarks:
734
  * Do not rely on returned value by incorrect call, it can be
734
  * Do not rely on returned value by incorrect call, it can be
735
    changed in future versions of the kernel.
735
    changed in future versions of the kernel.
736
  * It is possible to use subfunction 1, that on the last step
736
  * It is possible to use subfunction 1, that on the last step
737
    the user makes choice himself.
737
    the user makes choice himself.
738
  * It is not recommended to use value ecx=1 (to not irritate the user
738
  * It is not recommended to use value ecx=1 (to not irritate the user
739
    with excessive questions); to save ramdisk on a floppy use
739
    with excessive questions); to save ramdisk on a floppy use
740
    function 16 (which admits specification, on which floppy to
740
    function 16 (which admits specification, on which floppy to
741
    write), and to shutdown with the exit menu use already mentioned
741
    write), and to shutdown with the exit menu use already mentioned
742
    subfunction 1.
742
    subfunction 1.
743
 
743
 
744
======================================================================
744
======================================================================
745
===== Function 18, subfunction 10 - minimize application window. =====
745
===== Function 18, subfunction 10 - minimize application window. =====
746
======================================================================
746
======================================================================
747
Minimizes the own window.
747
Minimizes the own window.
748
Parameters:
748
Parameters:
749
  * eax = 18 - function number
749
  * eax = 18 - function number
750
  * ebx = 10 - subfunction number
750
  * ebx = 10 - subfunction number
751
Returned value:
751
Returned value:
752
  * function does not return value
752
  * function does not return value
753
Remarks:
753
Remarks:
754
  * The minimized window from the point of view of function 9
754
  * The minimized window from the point of view of function 9
755
    keeps position and sizes.
755
    keeps position and sizes.
756
  * Restoring of an application window occurs at its activation by 
756
  * Restoring of an application window occurs at its activation by 
757
    subfunction 3.
757
    subfunction 3.
758
  * Usually there is no necessity to minimize/restire a window
758
  * Usually there is no necessity to minimize/restire a window
759
    obviously: minimization of a window is carried out by the system
759
    obviously: minimization of a window is carried out by the system
760
    at pressing the minimization button (for skinned windows
760
    at pressing the minimization button (for skinned windows
761
    it is defined automatically by function 0,
761
    it is defined automatically by function 0,
762
    for other windows it can be defined manually by function 8),
762
    for other windows it can be defined manually by function 8),
763
    restore of a window is done by the application '@panel'.
763
    restore of a window is done by the application '@panel'.
764
 
764
 
765
======================================================================
765
======================================================================
766
 Function 18, subfunction 11 - get information on the disk subsystem. 
766
 Function 18, subfunction 11 - get information on the disk subsystem. 
767
======================================================================
767
======================================================================
768
Parameters:
768
Parameters:
769
  * eax = 18 - function number
769
  * eax = 18 - function number
770
  * ebx = 11 - subfunction number
770
  * ebx = 11 - subfunction number
771
  * ecx = type of the table:
771
  * ecx = type of the table:
772
    * 1 = short version, 10 bytes
772
    * 1 = short version, 10 bytes
773
    * 2 = full version, 65536 bytes
773
    * 2 = full version, 65536 bytes
774
  * edx = pointer to the buffer (in the application) for the table
774
  * edx = pointer to the buffer (in the application) for the table
775
Returned value:
775
Returned value:
776
  * function does not return value
776
  * function does not return value
777
Format of the table: short version:
777
Format of the table: short version:
778
  * +0: byte: information about FDD's (drives for floppies),
778
  * +0: byte: information about FDD's (drives for floppies),
779
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
779
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
780
    of the second regarding to the following list:
780
    of the second regarding to the following list:
781
    * 0 = there is no drive
781
    * 0 = there is no drive
782
    * 1 = 360Kb, 5.25''
782
    * 1 = 360Kb, 5.25''
783
    * 2 = 1.2Mb, 5.25''
783
    * 2 = 1.2Mb, 5.25''
784
    * 3 = 720Kb, 3.5''
784
    * 3 = 720Kb, 3.5''
785
    * 4 = 1.44Mb, 3.5''
785
    * 4 = 1.44Mb, 3.5''
786
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
786
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
787
    For example, for the standard configuration from one 1.44-drive
787
    For example, for the standard configuration from one 1.44-drive
788
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
788
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
789
    the value is 24h.
789
    the value is 24h.
790
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
790
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
791
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
791
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
792
    * 0 = device is absent
792
    * 0 = device is absent
793
    * 1 = hard drive
793
    * 1 = hard drive
794
    * 2 = CD-drive
794
    * 2 = CD-drive
795
    For example, in the case HD on IDE0 and CD on IDE2
795
    For example, in the case HD on IDE0 and CD on IDE2
796
    this field contains 48h.
796
    this field contains 48h.
797
  * +2: 4 db: number of the retrieved partitions on hard disks
797
  * +2: 4 db: number of the retrieved partitions on hard disks
798
    at accordingly IDE0,...,IDE3.
798
    at accordingly IDE0,...,IDE3.
799
    If the hard disk on IDEx is absent, appropriate byte is zero,
799
    If the hard disk on IDEx is absent, appropriate byte is zero,
800
    otherwise it shows number of the recognized partitions, which
800
    otherwise it shows number of the recognized partitions, which
801
    can be not presented (if the drive is not formatted or if
801
    can be not presented (if the drive is not formatted or if
802
    the file system is not supported). Current version of the kernel
802
    the file system is not supported). Current version of the kernel
803
    supports only FAT16 and FAT32 for hard disks.
803
    supports only FAT16 and FAT32 for hard disks.
804
  * +6: 4 db: reserved
804
  * +6: 4 db: reserved
805
Format of the table: full version:
805
Format of the table: full version:
806
  * +0: 10 db: same as for the short version
806
  * +0: 10 db: same as for the short version
807
  * +10: 100 db: data for the first partition
807
  * +10: 100 db: data for the first partition
808
  * +110: 100 db: data for the second partition
808
  * +110: 100 db: data for the second partition
809
  * ...
809
  * ...
810
  * +10+100*(n-1): 100 db: data for the last partition
810
  * +10+100*(n-1): 100 db: data for the last partition
811
The partitions are located as follows: at first sequentially all
811
The partitions are located as follows: at first sequentially all
812
recoginzed partitions on HD on IDE0 (if present),
812
recoginzed partitions on HD on IDE0 (if present),
813
then on HD on IDE1 (if present) and so on up to IDE3.
813
then on HD on IDE1 (if present) and so on up to IDE3.
814
Format of the information about partition
814
Format of the information about partition
815
(at moment only FAT is supported):
815
(at moment only FAT is supported):
816
  * +0: dword: first physical sector of the partition
816
  * +0: dword: first physical sector of the partition
817
  * +4: dword: last physical sector of the partition
817
  * +4: dword: last physical sector of the partition
818
    (belongs to the partition)
818
    (belongs to the partition)
819
  * +8: dword: sectors per one copy of FAT
819
  * +8: dword: sectors per one copy of FAT
820
  * +12 = +0xC: dword: number of copies of FAT
820
  * +12 = +0xC: dword: number of copies of FAT
821
  * +16 = +0x10: dword: number of sectors per cluster
821
  * +16 = +0x10: dword: number of sectors per cluster
822
  * +20 = +0x14: dword: bytes per sector;
822
  * +20 = +0x14: dword: bytes per sector;
823
    current implementation expects 0x200 = 512 in this field
823
    current implementation expects 0x200 = 512 in this field
824
  * +24 = +0x18: dword: first root cluster in FAT32, 0 for FAT16
824
  * +24 = +0x18: dword: first root cluster in FAT32, 0 for FAT16
825
  * +28 = +0x1C: dword: first physical sector of FAT
825
  * +28 = +0x1C: dword: first physical sector of FAT
826
  * +32 = +0x20: dword: first physical root sector for FAT16,
826
  * +32 = +0x20: dword: first physical root sector for FAT16,
827
    ignored for FAT32
827
    ignored for FAT32
828
  * +36 = +0x24: dword: number of root sectors for FAT16,
828
  * +36 = +0x24: dword: number of root sectors for FAT16,
829
    0 for FAT32
829
    0 for FAT32
830
  * +40 = +0x28: dword: physical sector of the beginning of
830
  * +40 = +0x28: dword: physical sector of the beginning of
831
    the data area
831
    the data area
832
  * +44 = +0x2C: dword: maximum number of a cluster
832
  * +44 = +0x2C: dword: maximum number of a cluster
833
  * +48 = +0x30: dword: physical sector of the information
833
  * +48 = +0x30: dword: physical sector of the information
834
    about the file system for FAT32, ignored for FAT16
834
    about the file system for FAT32, ignored for FAT16
835
  * +52 = +0x34: dword: value used as boundary for special
835
  * +52 = +0x34: dword: value used as boundary for special
836
    values in FAT
836
    values in FAT
837
  * +56 = +0x38: dword: value used for bad clusters in FAT
837
  * +56 = +0x38: dword: value used for bad clusters in FAT
838
  * +60 = +0x3C: dword: value used as the end marker for FAT chain
838
  * +60 = +0x3C: dword: value used as the end marker for FAT chain
839
  * +64 = +0x40: dword: mask for FAT items
839
  * +64 = +0x40: dword: mask for FAT items
840
  * +68 = +0x44: byte: file system type: 16 èëè 32
840
  * +68 = +0x44: byte: file system type: 16 èëè 32
841
  * +69 = +0x45: 31 db: reserved
841
  * +69 = +0x45: 31 db: reserved
842
Remarks:
842
Remarks:
843
  * The short table can be used for obtaining the information about
843
  * The short table can be used for obtaining the information about
844
    available devices.
844
    available devices.
845
  * First two fields in the information about partition
845
  * First two fields in the information about partition
846
    gives the parameters of partition, other - parameters of
846
    gives the parameters of partition, other - parameters of
847
    FAT file system. For other file systems (when they will be
847
    FAT file system. For other file systems (when they will be
848
    supported) specific for file system information will be, of
848
    supported) specific for file system information will be, of
849
    course, another, but first two fields will have the same sense.
849
    course, another, but first two fields will have the same sense.
850
 
850
 
851
======================================================================
851
======================================================================
852
========== Function 18, subfunction 13 - get kernel version. =========
852
========== Function 18, subfunction 13 - get kernel version. =========
853
======================================================================
853
======================================================================
854
Parameters:
854
Parameters:
855
  * eax = 18 - function number
855
  * eax = 18 - function number
856
  * ebx = 13 - subfunction number
856
  * ebx = 13 - subfunction number
857
  * ecx = pointer to the buffer (not less than 16 bytes), where
857
  * ecx = pointer to the buffer (not less than 16 bytes), where
858
    the information will be placed
858
    the information will be placed
859
Returned value:
859
Returned value:
860
  * function does not return value
860
  * function does not return value
861
Structure of the buffer:
861
Structure of the buffer:
862
db a,b,c,d for version a.b.c.d
862
db a,b,c,d for version a.b.c.d
863
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
863
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
864
db 'name',0 - ASCIIZ-string with the name
864
db 'name',0 - ASCIIZ-string with the name
865
For Kolibri 0.5.8.1 kernel:
865
For Kolibri 0.5.8.1 kernel:
866
db 0,5,8,1
866
db 0,5,8,1
867
db 2
867
db 2
868
db 'Kolibri',0
868
db 'Kolibri',0
869
 
869
 
870
======================================================================
870
======================================================================
871
======= Function 18, subfunction 14 - wait for screen retrace. =======
871
======= Function 18, subfunction 14 - wait for screen retrace. =======
872
======================================================================
872
======================================================================
873
Waits for the beginning of retrace of the scanning ray of the screen
873
Waits for the beginning of retrace of the scanning ray of the screen
874
monitor.
874
monitor.
875
Parameters:
875
Parameters:
876
  * eax = 18 - function number
876
  * eax = 18 - function number
877
  * ebx = 14 - subfunction number
877
  * ebx = 14 - subfunction number
878
Returned value:
878
Returned value:
879
  * eax = 0 as the tag of success
879
  * eax = 0 as the tag of success
880
Remarks:
880
Remarks:
881
  * Function is intended only for active high-efficiency graphics
881
  * Function is intended only for active high-efficiency graphics
882
    applications; is used for smooth output of a graphics.
882
    applications; is used for smooth output of a graphics.
883
 
883
 
884
======================================================================
884
======================================================================
885
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
885
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
886
======================================================================
886
======================================================================
887
Parameters:
887
Parameters:
888
  * eax = 18 - function number
888
  * eax = 18 - function number
889
  * ebx = 15 - subfunction number
889
  * ebx = 15 - subfunction number
890
Returned value:
890
Returned value:
891
  * eax = 0 as the tag of success
891
  * eax = 0 as the tag of success
892
 
892
 
893
======================================================================
893
======================================================================
894
========= Function 18, subfunction 16 - get size of free RAM. ========
894
========= Function 18, subfunction 16 - get size of free RAM. ========
895
======================================================================
895
======================================================================
896
Parameters:
896
Parameters:
897
  * eax = 18 - function number
897
  * eax = 18 - function number
898
  * ebx = 16 - subfunction number
898
  * ebx = 16 - subfunction number
899
Returned value:
899
Returned value:
900
  * eax = size of free memory in kilobytes
900
  * eax = size of free memory in kilobytes
901
 
901
 
902
======================================================================
902
======================================================================
903
======== Function 18, subfunction 17 - get full amount of RAM. =======
903
======== Function 18, subfunction 17 - get full amount of RAM. =======
904
======================================================================
904
======================================================================
905
Parameters:
905
Parameters:
906
  * eax = 18 - function number
906
  * eax = 18 - function number
907
  * ebx = 17 - subfunction number
907
  * ebx = 17 - subfunction number
908
Returned value:
908
Returned value:
909
  * eax = total size of existing memory in kilobytes
909
  * eax = total size of existing memory in kilobytes
910
 
910
 
911
======================================================================
911
======================================================================
912
===================== Function 18, subfunction 18 ====================
912
===================== Function 18, subfunction 18 ====================
913
============= Terminate process/thread by the identifier. ============
913
============= Terminate process/thread by the identifier. ============
914
======================================================================
914
======================================================================
915
Parameters:
915
Parameters:
916
  * eax = 18 - function number
916
  * eax = 18 - function number
917
  * ebx = 18 - subfunction number
917
  * ebx = 18 - subfunction number
918
  * ecx = identifer of process/thread (PID/TID)
918
  * ecx = identifer of process/thread (PID/TID)
919
Returned value:
919
Returned value:
920
  * eax = 0 - success
920
  * eax = 0 - success
921
  * eax = -1 - error (process is not found or is system)
921
  * eax = -1 - error (process is not found or is system)
922
Remarks:
922
Remarks:
923
  * It is impossible to terminate system thread OS/IDLE (identifier
923
  * It is impossible to terminate system thread OS/IDLE (identifier
924
    1), it is possible to terminate any normal process/thread.
924
    1), it is possible to terminate any normal process/thread.
925
  * See also subfunction 2 - terminate
925
  * See also subfunction 2 - terminate
926
    process/thread by given slot.
926
    process/thread by given slot.
927
 
927
 
928
======================================================================
928
======================================================================
-
 
929
====================== Function 18, subfunction 19 =====================
-
 
930
======================= Get/set mouse features. ======================
-
 
931
======================================================================
-
 
932
Parameters:
-
 
933
  * eax = 18 - function number
-
 
934
  * ebx = 19 - subfunction number
-
 
935
  * ecx = subsubfunction number
-
 
936
 
-
 
937
    ecx = 0 - get mouse speed
-
 
938
    Returned value:
-
 
939
    * eax = current mouse speed
-
 
940
 
-
 
941
    ecx = 1 - set mouse speed
-
 
942
    edx = selected value of speed 
-
 
943
    Returned value:
-
 
944
    * function does not return value
-
 
945
 
-
 
946
    ecx = 2 - get mouse delay
-
 
947
    Returned value:
-
 
948
    * eax = current mouse delay
-
 
949
 
-
 
950
    ecx = 3 - set mouse delay
-
 
951
    edx = selected value of delay
-
 
952
    Returned value:
-
 
953
    * function does not return value
-
 
954
 
-
 
955
    ecx = 4 - set mouse pointer position
-
 
956
    edx = [coordinate on axis x]*65536 + [coordinate on axis y]
-
 
957
    Returned value:
-
 
958
    * function does not return value
-
 
959
 
-
 
960
Remarks:
-
 
961
  * Recommended speed of the mouse (in subfunction 1) from 1 up to 9.
-
 
962
    The installed value is not inspected by the code of a kernel, on this use
-
 
963
    cautiously, at incorrect value the cursor can "freeze".
-
 
964
    Speed of mouse can be regulated through the application SETUP.
-
 
965
  * Recommended delay of the mouse (in subfunction 3) = 10. Lower value
-
 
966
    is not handled COM by mice. At the very large values the movement of
-
 
967
    the mouse on 1 pixel is impossible and the cursor will jump
-
 
968
    on the value of the installed speed (subfunction 1).
-
 
969
    The installed value is not inspected by the code of a kernel.
-
 
970
  * In subfunction 4 the installed value is not inspected by
-
 
971
    the code of a kernel. Before usage it is necessary to find out current
-
 
972
    screen resolution and at installation of a position to watch,
-
 
973
    that the value of a position should do not fall outside
-
 
974
    the limits the screen.
-
 
975
 
-
 
976
======================================================================
929
============ Function 19 - start application from ramdisk. ===========
977
============ Function 19 - start application from ramdisk. ===========
930
======================================================================
978
======================================================================
931
Parameters:
979
Parameters:
932
  * eax = 19 - function number
980
  * eax = 19 - function number
933
  * ebx = pointer to the application name in format similar
981
  * ebx = pointer to the application name in format similar
934
    to function 6
982
    to function 6
935
  * ecx = 0 or ecx = pointer to command line parameters
983
  * ecx = 0 or ecx = pointer to command line parameters
936
Returned value:
984
Returned value:
937
  * If eax > 0, then eax contains PID of the created process
985
  * If eax > 0, then eax contains PID of the created process
938
  * If eax < 0, then -eax - file system error code
986
  * If eax < 0, then -eax - file system error code
939
Remarks:
987
Remarks:
940
  * This function is obsolete; use subfunction 7 of function 70.
988
  * This function is obsolete; use subfunction 7 of function 70.
941
  * Command line must be terminated by the character with the code 0
989
  * Command line must be terminated by the character with the code 0
942
    (ASCIIZ-string); function takes into account either all characters
990
    (ASCIIZ-string); function takes into account either all characters
943
    up to terminating zero inclusively or first 256 character
991
    up to terminating zero inclusively or first 256 character
944
    regarding what is less.
992
    regarding what is less.
945
 
993
 
946
======================================================================
994
======================================================================
947
==================== Function 20 - MIDI interface. ===================
995
==================== Function 20 - MIDI interface. ===================
948
======================================================================
996
======================================================================
949
 
997
 
950
----------------------- Subfunction 1 - reset ------------------------
998
----------------------- Subfunction 1 - reset ------------------------
951
Parameters:
999
Parameters:
952
  * eax = 20 - function number
1000
  * eax = 20 - function number
953
  * ebx = 1 - subfunction number
1001
  * ebx = 1 - subfunction number
954
 
1002
 
955
-------------------- Subfunction 2 - output byte ---------------------
1003
-------------------- Subfunction 2 - output byte ---------------------
956
Parameters:
1004
Parameters:
957
  * eax = 20 - function number
1005
  * eax = 20 - function number
958
  * ebx = 2 - subfunction number
1006
  * ebx = 2 - subfunction number
959
  * cl = byte for output
1007
  * cl = byte for output
960
Returned value (is the same for both subfunctions):
1008
Returned value (is the same for both subfunctions):
961
  * eax = 0 - success
1009
  * eax = 0 - success
962
  * eax = 1 - base port is not defined
1010
  * eax = 1 - base port is not defined
963
Remarks:
1011
Remarks:
964
  * Previously the base port must be defined by 
1012
  * Previously the base port must be defined by 
965
    subfunction 1 of function 21.
1013
    subfunction 1 of function 21.
966
 
1014
 
967
======================================================================
1015
======================================================================
968
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1016
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
969
======================================================================
1017
======================================================================
970
Parameters:
1018
Parameters:
971
  * eax = 21 - function number
1019
  * eax = 21 - function number
972
  * ebx = 1 - subfunction number
1020
  * ebx = 1 - subfunction number
973
  * ecx = number of base port
1021
  * ecx = number of base port
974
Returned value
1022
Returned value
975
  * eax = 0 - success
1023
  * eax = 0 - success
976
  * eax = -1 - erratic number of a port
1024
  * eax = -1 - erratic number of a port
977
Remarks:
1025
Remarks:
978
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1026
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
979
  * The installation of base is necessary for function 20.
1027
  * The installation of base is necessary for function 20.
980
  * To get base port use subfunction 1 of function 26.
1028
  * To get base port use subfunction 1 of function 26.
981
 
1029
 
982
======================================================================
1030
======================================================================
983
========== Function 21, subfunction 2 - set keyboard layout. =========
1031
========== Function 21, subfunction 2 - set keyboard layout. =========
984
======================================================================
1032
======================================================================
985
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1033
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
986
which will be read by function 2.
1034
which will be read by function 2.
987
Parameters:
1035
Parameters:
988
  * eax = 21 - function number
1036
  * eax = 21 - function number
989
  * ebx = 2 - subfunction number
1037
  * ebx = 2 - subfunction number
990
  * ecx = which layout to set:
1038
  * ecx = which layout to set:
991
    * 1 = normal layout
1039
    * 1 = normal layout
992
    * 2 = layout at pressed Shift
1040
    * 2 = layout at pressed Shift
993
    * 3 = layout at pressed Alt
1041
    * 3 = layout at pressed Alt
994
  * edx = pointer to layout - table of length 128 bytes
1042
  * edx = pointer to layout - table of length 128 bytes
995
Or:
1043
Or:
996
  * ecx = 9
1044
  * ecx = 9
997
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1045
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
998
Returned value:
1046
Returned value:
999
  * eax = 0 - success
1047
  * eax = 0 - success
1000
  * eax = 1 - incorrect parameter
1048
  * eax = 1 - incorrect parameter
1001
Remarks:
1049
Remarks:
1002
  * If Alt is pressed, the layout with Alt is used;
1050
  * If Alt is pressed, the layout with Alt is used;
1003
    if Alt is not pressed, but Shift is pressed,
1051
    if Alt is not pressed, but Shift is pressed,
1004
    the layout with Shift is used;
1052
    the layout with Shift is used;
1005
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1053
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1006
    layout is used and then from the code is subtracted 0x60;
1054
    layout is used and then from the code is subtracted 0x60;
1007
    if no control key is pressed, the normal layout is used.
1055
    if no control key is pressed, the normal layout is used.
1008
  * To get layout and country identifier use 
1056
  * To get layout and country identifier use 
1009
    subfunction 2 of function 26.
1057
    subfunction 2 of function 26.
1010
  * Country identifier is global system variable, which is not used
1058
  * Country identifier is global system variable, which is not used
1011
    by the kernel itself; however the application '@panel' displays
1059
    by the kernel itself; however the application '@panel' displays
1012
    the corresponding icon.
1060
    the corresponding icon.
1013
  * The application @panel switches layouts on user request.
1061
  * The application @panel switches layouts on user request.
1014
 
1062
 
1015
======================================================================
1063
======================================================================
1016
============== Function 21, subfunction 3 - set CD base. =============
1064
============== Function 21, subfunction 3 - set CD base. =============
1017
======================================================================
1065
======================================================================
1018
Parameters:
1066
Parameters:
1019
  * eax = 21 - function number
1067
  * eax = 21 - function number
1020
  * ebx = 3 - subfunction number
1068
  * ebx = 3 - subfunction number
1021
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1069
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1022
Returned value:
1070
Returned value:
1023
  * eax = 0
1071
  * eax = 0
1024
Remarks:
1072
Remarks:
1025
  * CD base is used by function 24.
1073
  * CD base is used by function 24.
1026
  * To get CD base use subfunction 3 of function 26.
1074
  * To get CD base use subfunction 3 of function 26.
1027
 
1075
 
1028
======================================================================
1076
======================================================================
1029
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
1077
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
1030
======================================================================
1078
======================================================================
1031
Parameters:
1079
Parameters:
1032
  * eax = 21 - function number
1080
  * eax = 21 - function number
1033
  * ebx = 4 - subfunction number
1081
  * ebx = 4 - subfunction number
1034
  * ecx = number of the base port
1082
  * ecx = number of the base port
1035
Returned value:
1083
Returned value:
1036
  * eax = 0 - success
1084
  * eax = 0 - success
1037
  * eax = -1 - erratic port number
1085
  * eax = -1 - erratic port number
1038
Remarks:
1086
Remarks:
1039
  * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1087
  * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1040
  * The installation of the base is necessary for
1088
  * The installation of the base is necessary for
1041
    functions 25, 28, 55.
1089
    functions 25, 28, 55.
1042
  * To get base port use subfunction 4 of function 26.
1090
  * To get base port use subfunction 4 of function 26.
1043
 
1091
 
1044
======================================================================
1092
======================================================================
1045
========== Function 21, subfunction 5 - set system language. =========
1093
========== Function 21, subfunction 5 - set system language. =========
1046
======================================================================
1094
======================================================================
1047
Parameters:
1095
Parameters:
1048
  * eax = 21 - function number
1096
  * eax = 21 - function number
1049
  * ebx = 5 - subfunction number
1097
  * ebx = 5 - subfunction number
1050
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1098
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1051
Returned value:
1099
Returned value:
1052
  * eax = 0
1100
  * eax = 0
1053
Remarks:
1101
Remarks:
1054
  * System language is global system variable and is not used
1102
  * System language is global system variable and is not used
1055
    by the kernel itself, however application @panel draws the
1103
    by the kernel itself, however application @panel draws the
1056
    appropriate icon.
1104
    appropriate icon.
1057
  * Function does not check for correctness, as the kernel does not
1105
  * Function does not check for correctness, as the kernel does not
1058
    use this variable.
1106
    use this variable.
1059
  * To get system language use subfunction 5 of function 26.
1107
  * To get system language use subfunction 5 of function 26.
1060
 
1108
 
1061
======================================================================
1109
======================================================================
1062
=========== Function 21, subfunction 6 - set WSS base port. ==========
1110
=========== Function 21, subfunction 6 - set WSS base port. ==========
1063
======================================================================
1111
======================================================================
1064
Parameters:
1112
Parameters:
1065
  * eax = 21 - function number
1113
  * eax = 21 - function number
1066
  * ebx = 6 - subfunction number
1114
  * ebx = 6 - subfunction number
1067
  * ecx = base port
1115
  * ecx = base port
1068
Returned value:
1116
Returned value:
1069
  * eax = 0 - success
1117
  * eax = 0 - success
1070
  * eax = -1 - erratic port number
1118
  * eax = -1 - erratic port number
1071
Remarks:
1119
Remarks:
1072
  * Port number must satisfy to condition 0x100<=ecx.
1120
  * Port number must satisfy to condition 0x100<=ecx.
1073
  * WSS base is used by function 27.
1121
  * WSS base is used by function 27.
1074
  * To get WSS base port use subfunction 6 of function 26.
1122
  * To get WSS base port use subfunction 6 of function 26.
1075
 
1123
 
1076
======================================================================
1124
======================================================================
1077
============== Function 21, subfunction 7 - set HD base. =============
1125
============== Function 21, subfunction 7 - set HD base. =============
1078
======================================================================
1126
======================================================================
1079
The HD base defines hard disk to write with usage of obsolete
1127
The HD base defines hard disk to write with usage of obsolete
1080
file system functions and functions implicitly using the hard disk
1128
file system functions and functions implicitly using the hard disk
1081
(such as subfunction 6 of function 18);
1129
(such as subfunction 6 of function 18);
1082
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1130
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1083
these function set base themselves.
1131
these function set base themselves.
1084
Parameters:
1132
Parameters:
1085
  * eax = 21 - function number
1133
  * eax = 21 - function number
1086
  * ebx = 7 - subfunction number
1134
  * ebx = 7 - subfunction number
1087
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1135
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1088
Returned value:
1136
Returned value:
1089
  * eax = 0
1137
  * eax = 0
1090
Remarks:
1138
Remarks:
1091
  * Any application at any time can change the base.
1139
  * Any application at any time can change the base.
1092
  * Do not change base, when any application works with hard disk.
1140
  * Do not change base, when any application works with hard disk.
1093
    If you do not want system bugs.
1141
    If you do not want system bugs.
1094
  * To get HD base use subfunction 7 of function 26.
1142
  * To get HD base use subfunction 7 of function 26.
1095
  * It is also necessary to define used partition of hard disk by 
1143
  * It is also necessary to define used partition of hard disk by 
1096
    subfunction 8.
1144
    subfunction 8.
1097
 
1145
 
1098
======================================================================
1146
======================================================================
1099
========= Function 21, subfunction 8 - set used HD partition. ========
1147
========= Function 21, subfunction 8 - set used HD partition. ========
1100
======================================================================
1148
======================================================================
1101
The HD partition defines partition of the hard disk to write with
1149
The HD partition defines partition of the hard disk to write with
1102
usage of obsolete file system functions and functions implicitly
1150
usage of obsolete file system functions and functions implicitly
1103
using the hard disk (such as subfunction 6 of function 18);
1151
using the hard disk (such as subfunction 6 of function 18);
1104
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1152
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1105
these functions set base and partition themselves.
1153
these functions set base and partition themselves.
1106
Parameters:
1154
Parameters:
1107
  * eax = 21 - function number
1155
  * eax = 21 - function number
1108
  * ebx = 8 - subfunction number
1156
  * ebx = 8 - subfunction number
1109
  * ecx = HD partition (beginning from 1)
1157
  * ecx = HD partition (beginning from 1)
1110
Return value:
1158
Return value:
1111
  * eax = 0
1159
  * eax = 0
1112
Remarks:
1160
Remarks:
1113
  * Any application at any time can change partition.
1161
  * Any application at any time can change partition.
1114
  * Do not change partition when any application works with hard disk.
1162
  * Do not change partition when any application works with hard disk.
1115
    If you do not want system bugs.
1163
    If you do not want system bugs.
1116
  * To get used partition use subfunction 8 of function 26.
1164
  * To get used partition use subfunction 8 of function 26.
1117
  * There is no correctness checks.
1165
  * There is no correctness checks.
1118
  * To get the number of partitions of a hard disk use 
1166
  * To get the number of partitions of a hard disk use 
1119
    subfunction 11 of function 18.
1167
    subfunction 11 of function 18.
1120
  * It is also necessary to define used HD base by subfunction 7.
1168
  * It is also necessary to define used HD base by subfunction 7.
1121
 
1169
 
1122
======================================================================
1170
======================================================================
1123
======== Function 21, subfunction 10 - set sound DMA channel. ========
1171
======== Function 21, subfunction 10 - set sound DMA channel. ========
1124
======================================================================
1172
======================================================================
1125
Parameters:
1173
Parameters:
1126
  * eax = 21 - function number
1174
  * eax = 21 - function number
1127
  * ebx = 10 - subfunction number
1175
  * ebx = 10 - subfunction number
1128
  * ecx = number of channel (from 0 up to 3 inclusively)
1176
  * ecx = number of channel (from 0 up to 3 inclusively)
1129
Returned value:
1177
Returned value:
1130
  * eax = 0 - success
1178
  * eax = 0 - success
1131
  * eax = -1 - incorrect channel number
1179
  * eax = -1 - incorrect channel number
1132
Remarks:
1180
Remarks:
1133
  * Number of DMA channel is used in subfunction 1 of function 55.
1181
  * Number of DMA channel is used in subfunction 1 of function 55.
1134
  * To get sound DMA channel use subfunction 10 of function 26.
1182
  * To get sound DMA channel use subfunction 10 of function 26.
1135
 
1183
 
1136
======================================================================
1184
======================================================================
1137
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1185
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1138
======================================================================
1186
======================================================================
1139
Parameters:
1187
Parameters:
1140
  * eax = 21 - function number
1188
  * eax = 21 - function number
1141
  * ebx = 11 - subfunction number
1189
  * ebx = 11 - subfunction number
1142
  * ecx = 0/1 - disable/enable
1190
  * ecx = 0/1 - disable/enable
1143
Returned value:
1191
Returned value:
1144
  * eax = 0
1192
  * eax = 0
1145
Remarks:
1193
Remarks:
1146
  * Is used in LBA-read (subfunction 8 of function 58).
1194
  * Is used in LBA-read (subfunction 8 of function 58).
1147
  * The current implementation uses only low bit of ecx.
1195
  * The current implementation uses only low bit of ecx.
1148
  * To get current status use subfunction 11 of function 26.
1196
  * To get current status use subfunction 11 of function 26.
1149
 
1197
 
1150
======================================================================
1198
======================================================================
1151
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1199
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1152
======================================================================
1200
======================================================================
1153
Parameters:
1201
Parameters:
1154
  * eax = 21 - function number
1202
  * eax = 21 - function number
1155
  * ebx = 12 - subfunction number
1203
  * ebx = 12 - subfunction number
1156
  * ecx = 0/1 - disable/enable
1204
  * ecx = 0/1 - disable/enable
1157
Returned value:
1205
Returned value:
1158
  * eax = 0
1206
  * eax = 0
1159
Remarks:
1207
Remarks:
1160
  * Is used in operations with PCI bus (function 62).
1208
  * Is used in operations with PCI bus (function 62).
1161
  * The current implementation uses only low bit of ecx.
1209
  * The current implementation uses only low bit of ecx.
1162
  * To get current status use subfunction 12 of function 26.
1210
  * To get current status use subfunction 12 of function 26.
1163
 
1211
 
1164
======================================================================
1212
======================================================================
1165
============ Function 21, subfunction 13, subsubfunction 1 ===========
1213
============ Function 21, subfunction 13, subsubfunction 1 ===========
1166
======== Initialize + get information on the driver vmode.mdr. =======
1214
======== Initialize + get information on the driver vmode.mdr. =======
1167
======================================================================
1215
======================================================================
1168
Parameters:
1216
Parameters:
1169
  * eax = 21 - function number
1217
  * eax = 21 - function number
1170
  * ebx = 13 - subfunction number
1218
  * ebx = 13 - subfunction number
1171
  * ecx = 1 - number of the driver function
1219
  * ecx = 1 - number of the driver function
1172
  * edx = pointer to 512-bytes buffer
1220
  * edx = pointer to 512-bytes buffer
1173
Returned value:
1221
Returned value:
1174
  * if driver is not loaded
1222
  * if driver is not loaded
1175
    (never happens in the current implementation):
1223
    (never happens in the current implementation):
1176
    * eax = -1
1224
    * eax = -1
1177
    * ebx, ecx destroyed
1225
    * ebx, ecx destroyed
1178
  * if driver is loaded:
1226
  * if driver is loaded:
1179
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1227
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1180
      - signature
1228
      - signature
1181
    * ebx = current frequency of the scanning (in Hz)
1229
    * ebx = current frequency of the scanning (in Hz)
1182
    * ecx destroyed
1230
    * ecx destroyed
1183
    * buffer pointed to by edx is filled
1231
    * buffer pointed to by edx is filled
1184
Format of the buffer:
1232
Format of the buffer:
1185
  * +0: 32*byte: driver name, "Trans VideoDriver"
1233
  * +0: 32*byte: driver name, "Trans VideoDriver"
1186
    (without quotes, supplemented by spaces)
1234
    (without quotes, supplemented by spaces)
1187
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1235
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1188
    y*65536+x), for the current implementation is 1 (1.0)
1236
    y*65536+x), for the current implementation is 1 (1.0)
1189
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1237
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1190
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1238
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1191
    is number of a videomode, after list itself there are zeroes)
1239
    is number of a videomode, after list itself there are zeroes)
1192
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1240
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1193
    scannings for videomodes: for each videomode listed in the
1241
    scannings for videomodes: for each videomode listed in the
1194
    previous field up to 5 supported frequences are given
1242
    previous field up to 5 supported frequences are given
1195
    (unused positions contain zeroes)
1243
    (unused positions contain zeroes)
1196
Remarks:
1244
Remarks:
1197
  * Function initializes the driver (if it is not initialized yet)
1245
  * Function initializes the driver (if it is not initialized yet)
1198
    and must be called first, before others (otherwise they will do
1246
    and must be called first, before others (otherwise they will do
1199
    nothing and return -1).
1247
    nothing and return -1).
1200
  * The current implementation supports only one frequency
1248
  * The current implementation supports only one frequency
1201
    of the scanning on videomode.
1249
    of the scanning on videomode.
1202
 
1250
 
1203
======================================================================
1251
======================================================================
1204
============ Function 21, subfunction 13, subsubfunction 2 ===========
1252
============ Function 21, subfunction 13, subsubfunction 2 ===========
1205
================ Get information on current videomode. ===============
1253
================ Get information on current videomode. ===============
1206
======================================================================
1254
======================================================================
1207
Parameters:
1255
Parameters:
1208
  * eax = 21 - function number
1256
  * eax = 21 - function number
1209
  * ebx = 13 - subfunction number
1257
  * ebx = 13 - subfunction number
1210
  * ecx = 2 - number of the driver function
1258
  * ecx = 2 - number of the driver function
1211
Returned value:
1259
Returned value:
1212
  * eax = -1 - driver is not loaded or not initialized;
1260
  * eax = -1 - driver is not loaded or not initialized;
1213
    ebx,ecx are destroyed
1261
    ebx,ecx are destroyed
1214
  * eax = [width]*65536 + [height]
1262
  * eax = [width]*65536 + [height]
1215
  * ebx = frequency of the vertical scanning (in Hz)
1263
  * ebx = frequency of the vertical scanning (in Hz)
1216
  * ecx = number of current videomode
1264
  * ecx = number of current videomode
1217
Remarks:
1265
Remarks:
1218
  * Driver must be initialized by call to 
1266
  * Driver must be initialized by call to 
1219
    driver function 1.
1267
    driver function 1.
1220
  * If only screen sizes are required, it is more expedient to use
1268
  * If only screen sizes are required, it is more expedient to use
1221
    function 14 taking into account that it
1269
    function 14 taking into account that it
1222
    returns sizes on 1 less.
1270
    returns sizes on 1 less.
1223
 
1271
 
1224
======================================================================
1272
======================================================================
1225
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1273
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1226
======================================================================
1274
======================================================================
1227
Parameters:
1275
Parameters:
1228
  * eax = 21 - function number
1276
  * eax = 21 - function number
1229
  * ebx = 13 - subfunction number
1277
  * ebx = 13 - subfunction number
1230
  * ecx = 3 - number of the driver function
1278
  * ecx = 3 - number of the driver function
1231
  * edx = [scanning frequency]*65536 + [videomode number]
1279
  * edx = [scanning frequency]*65536 + [videomode number]
1232
Returned value:
1280
Returned value:
1233
  * eax = -1 - driver is not loaded, not initialized or
1281
  * eax = -1 - driver is not loaded, not initialized or
1234
    an error has occured
1282
    an error has occured
1235
  * eax = 0 - success
1283
  * eax = 0 - success
1236
  * ebx, ecx destroyed
1284
  * ebx, ecx destroyed
1237
Remarks:
1285
Remarks:
1238
  * Driver must be initialized by driver function 1.
1286
  * Driver must be initialized by driver function 1.
1239
  * The videomode number and frequency must be in the table
1287
  * The videomode number and frequency must be in the table
1240
    returned by driver function 1.
1288
    returned by driver function 1.
1241
 
1289
 
1242
======================================================================
1290
======================================================================
1243
============ Function 21, subfunction 13, subsubfunction 4 ===========
1291
============ Function 21, subfunction 13, subsubfunction 4 ===========
1244
================== Return to the initial videomode. ==================
1292
================== Return to the initial videomode. ==================
1245
======================================================================
1293
======================================================================
1246
Returns the screen to the videomode set at system boot.
1294
Returns the screen to the videomode set at system boot.
1247
Parameters:
1295
Parameters:
1248
  * eax = 21 - function number
1296
  * eax = 21 - function number
1249
  * ebx = 13 - subfunction number
1297
  * ebx = 13 - subfunction number
1250
  * ecx = 4 - number of the driver function
1298
  * ecx = 4 - number of the driver function
1251
Returned value:
1299
Returned value:
1252
  * eax = -1 - driver is not loaded or not initialized
1300
  * eax = -1 - driver is not loaded or not initialized
1253
  * eax = 0 - success
1301
  * eax = 0 - success
1254
  * ebx, ecx destroyed
1302
  * ebx, ecx destroyed
1255
Remarks:
1303
Remarks:
1256
  * Driver must be initialized by call to driver function 1.
1304
  * Driver must be initialized by call to driver function 1.
1257
 
1305
 
1258
======================================================================
1306
======================================================================
1259
============ Function 21, subfunction 13, subsubfunction 5 ===========
1307
============ Function 21, subfunction 13, subsubfunction 5 ===========
1260
===== Increase/decrease the size of the visible area of monitor. =====
1308
===== Increase/decrease the size of the visible area of monitor. =====
1261
======================================================================
1309
======================================================================
1262
Parameters:
1310
Parameters:
1263
  * eax = 21 - function number
1311
  * eax = 21 - function number
1264
  * ebx = 13 - subfunction number
1312
  * ebx = 13 - subfunction number
1265
  * ecx = 5 - number of the driver function
1313
  * ecx = 5 - number of the driver function
1266
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1314
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1267
  * edx = 2/3 - is not supported in the current implementation;
1315
  * edx = 2/3 - is not supported in the current implementation;
1268
    is planned as decrease/increase vertical size on 1 position
1316
    is planned as decrease/increase vertical size on 1 position
1269
Returned value:
1317
Returned value:
1270
  * eax = -1 - driver is not loaded or not initialized
1318
  * eax = -1 - driver is not loaded or not initialized
1271
  * eax = 0 - success
1319
  * eax = 0 - success
1272
  * ebx, ecx destroyed
1320
  * ebx, ecx destroyed
1273
Remarks:
1321
Remarks:
1274
  * Driver must be initialized by call to driver function 1.
1322
  * Driver must be initialized by call to driver function 1.
1275
  * Function influences only the physical size of the screen image;
1323
  * Function influences only the physical size of the screen image;
1276
    the logical size (number of pixels) does not change.
1324
    the logical size (number of pixels) does not change.
1277
 
1325
 
1278
======================================================================
1326
======================================================================
1279
================= Function 22 - set system date/time. ================
1327
================= Function 22 - set system date/time. ================
1280
======================================================================
1328
======================================================================
1281
Parameters:
1329
Parameters:
1282
  * eax = 22 - function number
1330
  * eax = 22 - function number
1283
  * ebx = 0 - set time
1331
  * ebx = 0 - set time
1284
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1332
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1285
    * HH=hour 00..23
1333
    * HH=hour 00..23
1286
    * MM=minute 00..59
1334
    * MM=minute 00..59
1287
    * SS=second 00..59
1335
    * SS=second 00..59
1288
  * ebx = 1 - set date
1336
  * ebx = 1 - set date
1289
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1337
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1290
    * DD=day 01..31
1338
    * DD=day 01..31
1291
    * MM=month 01..12
1339
    * MM=month 01..12
1292
    * YY=year 00..99
1340
    * YY=year 00..99
1293
  * ebx = 2 - set day of week
1341
  * ebx = 2 - set day of week
1294
    * ecx = 1 for Sunday, ..., 7 for Saturday
1342
    * ecx = 1 for Sunday, ..., 7 for Saturday
1295
  * ebx = 3 - set alarm clock
1343
  * ebx = 3 - set alarm clock
1296
    * ecx = 0x00SSMMHH
1344
    * ecx = 0x00SSMMHH
1297
Returned value:
1345
Returned value:
1298
  * eax = 0 - success
1346
  * eax = 0 - success
1299
  * eax = 1 - incorrect parameter
1347
  * eax = 1 - incorrect parameter
1300
  * eax = 2 - CMOS-battery was unloaded
1348
  * eax = 2 - CMOS-battery was unloaded
1301
Remarks:
1349
Remarks:
1302
  * Value of installation of day of week seems to be doubtful,
1350
  * Value of installation of day of week seems to be doubtful,
1303
    as it a little where is used
1351
    as it a little where is used
1304
    (day of week can be calculated by date).
1352
    (day of week can be calculated by date).
1305
  * Alarm clock can be set on operation in the given time every day.
1353
  * Alarm clock can be set on operation in the given time every day.
1306
    But there is no existing system function to disable it.
1354
    But there is no existing system function to disable it.
1307
  * Operation of alarm clock consists in generation IRQ8.
1355
  * Operation of alarm clock consists in generation IRQ8.
1308
  * Generally CMOS supports for alarm clock set of value 0xFF
1356
  * Generally CMOS supports for alarm clock set of value 0xFF
1309
    as one of parameters and it means that the appropriate parameter
1357
    as one of parameters and it means that the appropriate parameter
1310
    is ignored. But current implementation does not allow this
1358
    is ignored. But current implementation does not allow this
1311
    (will return 1).
1359
    (will return 1).
1312
  * Alarm clock is a global system resource; the set of
1360
  * Alarm clock is a global system resource; the set of
1313
    an alarm clock cancels automatically the previous set.
1361
    an alarm clock cancels automatically the previous set.
1314
    However, at moment no program uses it.
1362
    However, at moment no program uses it.
1315
 
1363
 
1316
======================================================================
1364
======================================================================
1317
============= Function 23 - wait for event with timeout. =============
1365
============= Function 23 - wait for event with timeout. =============
1318
======================================================================
1366
======================================================================
1319
If the message queue is empty, waits for new message in the queue,
1367
If the message queue is empty, waits for new message in the queue,
1320
but no more than given time. Then reads out a message from the queue.
1368
but no more than given time. Then reads out a message from the queue.
1321
 
1369
 
1322
Parameters:
1370
Parameters:
1323
  * eax = 23 - function number
1371
  * eax = 23 - function number
1324
  * ebx = timeout (in 1/100 of second)
1372
  * ebx = timeout (in 1/100 of second)
1325
Returned value:
1373
Returned value:
1326
  * eax = 0 - the message queue is empty
1374
  * eax = 0 - the message queue is empty
1327
  * otherwise eax = event (see the list of events)
1375
  * otherwise eax = event (see the list of events)
1328
Remarks:
1376
Remarks:
1329
  * Only those events are taken into account, which enter into
1377
  * Only those events are taken into account, which enter into
1330
    the mask set by function 40. By default it is
1378
    the mask set by function 40. By default it is
1331
    redraw, key and button events.
1379
    redraw, key and button events.
1332
  * To check for presence of a message in the queue use function 11.
1380
  * To check for presence of a message in the queue use function 11.
1333
    To wait without timeout use function 10.
1381
    To wait without timeout use function 10.
1334
  * Transmission ebx=0 results in immediate returning eax=0.
1382
  * Transmission ebx=0 results in immediate returning eax=0.
1335
  * Current implementation returns immediately with eax=0,
1383
  * Current implementation returns immediately with eax=0,
1336
    if the addition of ebx with the current value of time counter
1384
    if the addition of ebx with the current value of time counter
1337
    makes 32-bit overflow.
1385
    makes 32-bit overflow.
1338
 
1386
 
1339
======================================================================
1387
======================================================================
1340
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1388
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1341
======================================================================
1389
======================================================================
1342
Parameters:
1390
Parameters:
1343
  * eax = 24 - function number
1391
  * eax = 24 - function number
1344
  * ebx = 1 - subfunction number
1392
  * ebx = 1 - subfunction number
1345
  * ecx = 0x00FRSSMM, where
1393
  * ecx = 0x00FRSSMM, where
1346
    * MM = starting minute
1394
    * MM = starting minute
1347
    * SS = starting second
1395
    * SS = starting second
1348
    * FR = starting frame
1396
    * FR = starting frame
1349
Returned value:
1397
Returned value:
1350
  * eax = 0 - success
1398
  * eax = 0 - success
1351
  * eax = 1 - CD base is not defined
1399
  * eax = 1 - CD base is not defined
1352
Remarks:
1400
Remarks:
1353
  * Previously CD base must be defined by the call to 
1401
  * Previously CD base must be defined by the call to 
1354
    subfunction 3 of function 21.
1402
    subfunction 3 of function 21.
1355
  * One second includes 75 frames, one minute includes 60 seconds.
1403
  * One second includes 75 frames, one minute includes 60 seconds.
1356
  * The function is asynchronous (returns control, when play begins).
1404
  * The function is asynchronous (returns control, when play begins).
1357
 
1405
 
1358
======================================================================
1406
======================================================================
1359
======= Function 24, subfunction 2 - get information on tracks. ======
1407
======= Function 24, subfunction 2 - get information on tracks. ======
1360
======================================================================
1408
======================================================================
1361
Parameters:
1409
Parameters:
1362
  * eax = 24 - function number
1410
  * eax = 24 - function number
1363
  * ebx = 2 - subfunction number
1411
  * ebx = 2 - subfunction number
1364
  * ecx = pointer to the buffer for the table
1412
  * ecx = pointer to the buffer for the table
1365
    (maximum 8*64h+4 bytes=100 tracks)
1413
    (maximum 8*64h+4 bytes=100 tracks)
1366
Returned value:
1414
Returned value:
1367
  * eax = 0 - success
1415
  * eax = 0 - success
1368
  * eax = 1 - CD base is not defined
1416
  * eax = 1 - CD base is not defined
1369
Remarks:
1417
Remarks:
1370
  * The format of the table with tracks information is the same as
1418
  * The format of the table with tracks information is the same as
1371
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1419
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1372
    Function returns addresses in MSF.
1420
    Function returns addresses in MSF.
1373
  * Previously CD base port must be set by call to 
1421
  * Previously CD base port must be set by call to 
1374
    subfunction 3 of function 21.
1422
    subfunction 3 of function 21.
1375
  * Function returns information only about no more than 100
1423
  * Function returns information only about no more than 100
1376
    first tracks. In most cases it is enough.
1424
    first tracks. In most cases it is enough.
1377
 
1425
 
1378
======================================================================
1426
======================================================================
1379
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1427
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1380
======================================================================
1428
======================================================================
1381
Parameters:
1429
Parameters:
1382
  * eax = 24 - function number
1430
  * eax = 24 - function number
1383
  * ebx = 1 - subfunction number
1431
  * ebx = 1 - subfunction number
1384
Returned value:
1432
Returned value:
1385
  * eax = 0 - success
1433
  * eax = 0 - success
1386
  * eax = 1 - CD base is not defined
1434
  * eax = 1 - CD base is not defined
1387
Çàìå÷àíèÿ:
1435
Çàìå÷àíèÿ:
1388
  * Previously CD base port must be defined by call to 
1436
  * Previously CD base port must be defined by call to 
1389
    subfunction 3 of function 21.
1437
    subfunction 3 of function 21.
1390
 
1438
 
1391
======================================================================
1439
======================================================================
1392
=================== Function 25 - set SBPro volume. ==================
1440
=================== Function 25 - set SBPro volume. ==================
1393
======================================================================
1441
======================================================================
1394
Parameters:
1442
Parameters:
1395
  * eax = 25 - function number
1443
  * eax = 25 - function number
1396
  * ebx = what to set:
1444
  * ebx = what to set:
1397
    * 1 - set common volume
1445
    * 1 - set common volume
1398
    * 2 - set CD-audio volume
1446
    * 2 - set CD-audio volume
1399
  * cl = volume level: high 4 bits for the left column,
1447
  * cl = volume level: high 4 bits for the left column,
1400
    low 4 bits for the right one
1448
    low 4 bits for the right one
1401
Returned value:
1449
Returned value:
1402
  * eax = 0 - success
1450
  * eax = 0 - success
1403
  * eax = 1 - SB base is not defined
1451
  * eax = 1 - SB base is not defined
1404
  * eax = 2 - incorrect subfunction
1452
  * eax = 2 - incorrect subfunction
1405
Remarks:
1453
Remarks:
1406
  * Previously SB base port must be defined by 
1454
  * Previously SB base port must be defined by 
1407
    subfunction 4 of function 21.
1455
    subfunction 4 of function 21.
1408
  * See also function 28 which sets
1456
  * See also function 28 which sets
1409
    volume for the later standard SB16.
1457
    volume for the later standard SB16.
1410
 
1458
 
1411
======================================================================
1459
======================================================================
1412
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1460
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1413
======================================================================
1461
======================================================================
1414
Parameters:
1462
Parameters:
1415
  * eax = 26 - function number
1463
  * eax = 26 - function number
1416
  * ebx = 1 - subfunction number
1464
  * ebx = 1 - subfunction number
1417
Returned value:
1465
Returned value:
1418
  * eax = port number
1466
  * eax = port number
1419
Parameters:
1467
Parameters:
1420
  * To set base port use subfunction 1 of function 21.
1468
  * To set base port use subfunction 1 of function 21.
1421
 
1469
 
1422
======================================================================
1470
======================================================================
1423
========== Function 26, subfunction 2 - get keyboard layout. =========
1471
========== Function 26, subfunction 2 - get keyboard layout. =========
1424
======================================================================
1472
======================================================================
1425
The keyboard layout is used to convert keyboard scancodes to
1473
The keyboard layout is used to convert keyboard scancodes to
1426
ASCII-codes for function 2.
1474
ASCII-codes for function 2.
1427
Parameters:
1475
Parameters:
1428
  * eax = 26 - function number
1476
  * eax = 26 - function number
1429
  * ebx = 2 - subfunction number
1477
  * ebx = 2 - subfunction number
1430
  * ecx = what layout to get:
1478
  * ecx = what layout to get:
1431
    * 1 = normal layout
1479
    * 1 = normal layout
1432
    * 2 = layout with pressed Shift
1480
    * 2 = layout with pressed Shift
1433
    * 3 = layout with pressed Alt
1481
    * 3 = layout with pressed Alt
1434
  * edx = pointer to the 128-bytes buffer, where the layout will be
1482
  * edx = pointer to the 128-bytes buffer, where the layout will be
1435
    copied
1483
    copied
1436
Returned value:
1484
Returned value:
1437
  * function does not return value
1485
  * function does not return value
1438
Or:
1486
Or:
1439
  * eax = 26 - function number
1487
  * eax = 26 - function number
1440
  * ebx = 2 - subfunction number
1488
  * ebx = 2 - subfunction number
1441
  * ecx = 9
1489
  * ecx = 9
1442
Returned value:
1490
Returned value:
1443
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1491
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1444
Remarks:
1492
Remarks:
1445
  * If Alt is pressed, the layout with Alt is used;
1493
  * If Alt is pressed, the layout with Alt is used;
1446
    if Alt is not pressed, but Shift is pressed,
1494
    if Alt is not pressed, but Shift is pressed,
1447
    the layout with Shift is used;
1495
    the layout with Shift is used;
1448
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1496
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1449
    layout is used and then from the code is subtracted 0x60;
1497
    layout is used and then from the code is subtracted 0x60;
1450
    if no control key is pressed, the normal layout is used.
1498
    if no control key is pressed, the normal layout is used.
1451
  * To set layout and country identifier use 
1499
  * To set layout and country identifier use 
1452
    subfunction 2 of function 21.
1500
    subfunction 2 of function 21.
1453
  * Country identifier is global system variable, which is not used
1501
  * Country identifier is global system variable, which is not used
1454
    by the kernel itself; however the application '@panel' displays
1502
    by the kernel itself; however the application '@panel' displays
1455
    the corresponding icon (using this function).
1503
    the corresponding icon (using this function).
1456
  * The application @panel switches layouts on user request.
1504
  * The application @panel switches layouts on user request.
1457
 
1505
 
1458
======================================================================
1506
======================================================================
1459
============== Function 26, subfunction 3 - get CD base. =============
1507
============== Function 26, subfunction 3 - get CD base. =============
1460
======================================================================
1508
======================================================================
1461
Parameters:
1509
Parameters:
1462
  * eax = 26 - function number
1510
  * eax = 26 - function number
1463
  * ebx = 3 - subfunction number
1511
  * ebx = 3 - subfunction number
1464
Returned value:
1512
Returned value:
1465
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1513
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1466
Remarks:
1514
Remarks:
1467
  * CD base is used by function 24.
1515
  * CD base is used by function 24.
1468
  * To set CD base use subfunction 3 of function 21.
1516
  * To set CD base use subfunction 3 of function 21.
1469
 
1517
 
1470
======================================================================
1518
======================================================================
1471
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
1519
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
1472
======================================================================
1520
======================================================================
1473
Parameters:
1521
Parameters:
1474
  * eax = 26 - function number
1522
  * eax = 26 - function number
1475
  * ebx = 4 - subfunction number
1523
  * ebx = 4 - subfunction number
1476
Returned value:
1524
Returned value:
1477
  * eax = base port number
1525
  * eax = base port number
1478
Remarks:
1526
Remarks:
1479
  * Bae port is used by functions 25, 55.
1527
  * Bae port is used by functions 25, 55.
1480
  * To set base port use subfunction 4 of function 21.
1528
  * To set base port use subfunction 4 of function 21.
1481
 
1529
 
1482
======================================================================
1530
======================================================================
1483
========== Function 26, subfunction 5 - get system language. =========
1531
========== Function 26, subfunction 5 - get system language. =========
1484
======================================================================
1532
======================================================================
1485
Parameters:
1533
Parameters:
1486
  * eax = 26 - function number
1534
  * eax = 26 - function number
1487
  * ebx = 5 - subfunction number
1535
  * ebx = 5 - subfunction number
1488
Returned value:
1536
Returned value:
1489
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1537
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1490
Remarks:
1538
Remarks:
1491
  * System language is global system variable and is not used
1539
  * System language is global system variable and is not used
1492
    by the kernel itself, however application @panel draws the
1540
    by the kernel itself, however application @panel draws the
1493
    appropriate icon (using this function).
1541
    appropriate icon (using this function).
1494
  * To set system language use subfunction 5 of function 21.
1542
  * To set system language use subfunction 5 of function 21.
1495
 
1543
 
1496
======================================================================
1544
======================================================================
1497
=========== Function 26, subfunction 6 - get WSS base port. ==========
1545
=========== Function 26, subfunction 6 - get WSS base port. ==========
1498
======================================================================
1546
======================================================================
1499
Parameters:
1547
Parameters:
1500
  * eax = 26 - function number
1548
  * eax = 26 - function number
1501
  * ebx = 6 - subfunction number
1549
  * ebx = 6 - subfunction number
1502
Returned value:
1550
Returned value:
1503
  * eax = base port
1551
  * eax = base port
1504
Remarks:
1552
Remarks:
1505
  * WSS base is used by function 27.
1553
  * WSS base is used by function 27.
1506
  * To set WSS base port use subfunction 6 of function 21.
1554
  * To set WSS base port use subfunction 6 of function 21.
1507
 
1555
 
1508
======================================================================
1556
======================================================================
1509
============== Function 26, subfunction 7 - get HD base. =============
1557
============== Function 26, subfunction 7 - get HD base. =============
1510
======================================================================
1558
======================================================================
1511
The HD base defines hard disk to write with usage of obsolete
1559
The HD base defines hard disk to write with usage of obsolete
1512
file system functions and functions implicitly using the hard disk
1560
file system functions and functions implicitly using the hard disk
1513
(such as subfunction 6 of function 18);
1561
(such as subfunction 6 of function 18);
1514
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1562
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1515
these function set base themselves.
1563
these function set base themselves.
1516
Parameters:
1564
Parameters:
1517
  * eax = 26 - function number
1565
  * eax = 26 - function number
1518
  * ebx = 7 - subfunction number
1566
  * ebx = 7 - subfunction number
1519
Returned value:
1567
Returned value:
1520
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1568
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1521
Remarks:
1569
Remarks:
1522
  * Any application in any time can change HD base.
1570
  * Any application in any time can change HD base.
1523
  * To set base use subfunction 7 of function 21.
1571
  * To set base use subfunction 7 of function 21.
1524
  * To get used partition of hard disk use subfunction 8.
1572
  * To get used partition of hard disk use subfunction 8.
1525
 
1573
 
1526
======================================================================
1574
======================================================================
1527
========= Function 26, subfunction 8 - get used HD partition. ========
1575
========= Function 26, subfunction 8 - get used HD partition. ========
1528
======================================================================
1576
======================================================================
1529
The HD partition defines partition of the hard disk to write with
1577
The HD partition defines partition of the hard disk to write with
1530
usage of obsolete file system functions and functions implicitly
1578
usage of obsolete file system functions and functions implicitly
1531
using the hard disk (such as subfunction 6 of function 18);
1579
using the hard disk (such as subfunction 6 of function 18);
1532
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1580
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1533
these functions set base and partition themselves.
1581
these functions set base and partition themselves.
1534
Parameters:
1582
Parameters:
1535
  * eax = 26 - function number
1583
  * eax = 26 - function number
1536
  * ebx = 8 - subfunction number
1584
  * ebx = 8 - subfunction number
1537
Returned value:
1585
Returned value:
1538
  * eax = HD partition (beginning from 1)
1586
  * eax = HD partition (beginning from 1)
1539
Remarks:
1587
Remarks:
1540
  * Any application in any time can change partition.
1588
  * Any application in any time can change partition.
1541
  * To set partition use subfunction 8 of function 21.
1589
  * To set partition use subfunction 8 of function 21.
1542
  * To get number of partitions on a hard disk use
1590
  * To get number of partitions on a hard disk use
1543
    subfunction 11 of function 18.
1591
    subfunction 11 of function 18.
1544
  * To get base of used hard disk, use subfunction 7.
1592
  * To get base of used hard disk, use subfunction 7.
1545
 
1593
 
1546
======================================================================
1594
======================================================================
1547
=== Function 26, subfunction 9 - get the value of the time counter. ==
1595
=== Function 26, subfunction 9 - get the value of the time counter. ==
1548
======================================================================
1596
======================================================================
1549
Parameters:
1597
Parameters:
1550
  * eax = 26 - function number
1598
  * eax = 26 - function number
1551
  * ebx = 9 - subfunction number
1599
  * ebx = 9 - subfunction number
1552
Returned value:
1600
Returned value:
1553
  * eax = number of 1/100s of second, past from the system boot time
1601
  * eax = number of 1/100s of second, past from the system boot time
1554
Remarks:
1602
Remarks:
1555
  * Counter takes modulo 2^32, that correspond to a little more
1603
  * Counter takes modulo 2^32, that correspond to a little more
1556
    than 497 days.
1604
    than 497 days.
1557
  * To get system time use function 3.
1605
  * To get system time use function 3.
1558
 
1606
 
1559
======================================================================
1607
======================================================================
1560
======== Function 26, subfunction 10 - get sound DMA channel. ========
1608
======== Function 26, subfunction 10 - get sound DMA channel. ========
1561
======================================================================
1609
======================================================================
1562
Parameters:
1610
Parameters:
1563
  * eax = 26 - function number
1611
  * eax = 26 - function number
1564
  * ebx = 10 - subfunction number
1612
  * ebx = 10 - subfunction number
1565
Returned value:
1613
Returned value:
1566
  * eax = number of the channel (from 0 to 3 inclusive)
1614
  * eax = number of the channel (from 0 to 3 inclusive)
1567
Remarks:
1615
Remarks:
1568
  * Number of the DMA channel is used by subfunction 1 of function 55.
1616
  * Number of the DMA channel is used by subfunction 1 of function 55.
1569
  * To set the sound DMA channel use subfunction 10 of function 21.
1617
  * To set the sound DMA channel use subfunction 10 of function 21.
1570
 
1618
 
1571
======================================================================
1619
======================================================================
1572
===================== Function 26, subfunction 11 ====================
1620
===================== Function 26, subfunction 11 ====================
1573
========== Find out whether low-level HD access is enabled. ==========
1621
========== Find out whether low-level HD access is enabled. ==========
1574
======================================================================
1622
======================================================================
1575
Parameters:
1623
Parameters:
1576
  * eax = 26 - function number
1624
  * eax = 26 - function number
1577
  * ebx = 11 - subfunction number
1625
  * ebx = 11 - subfunction number
1578
Returned value:
1626
Returned value:
1579
  * eax = 0/1 - disabled/enabled
1627
  * eax = 0/1 - disabled/enabled
1580
Remarks:
1628
Remarks:
1581
  * Is used in LBA read (subfunction 8 of function 58).
1629
  * Is used in LBA read (subfunction 8 of function 58).
1582
  * To set current state use subfunction 11 of function 21.
1630
  * To set current state use subfunction 11 of function 21.
1583
 
1631
 
1584
======================================================================
1632
======================================================================
1585
===================== Function 26, subfunction 12 ====================
1633
===================== Function 26, subfunction 12 ====================
1586
========== Find out whether low-level PCI access is enabled. =========
1634
========== Find out whether low-level PCI access is enabled. =========
1587
======================================================================
1635
======================================================================
1588
Parameters:
1636
Parameters:
1589
  * eax = 26 - function number
1637
  * eax = 26 - function number
1590
  * ebx = 12 - subfunction number
1638
  * ebx = 12 - subfunction number
1591
Returned value:
1639
Returned value:
1592
  * eax = 0/1 - disabled/enabled
1640
  * eax = 0/1 - disabled/enabled
1593
Remarks:
1641
Remarks:
1594
  * Is used by operations with PCI bus (function 62).
1642
  * Is used by operations with PCI bus (function 62).
1595
  * The current implementation uses only low bit of ecx.
1643
  * The current implementation uses only low bit of ecx.
1596
  * To set the current state use subfunction 12 of function 21.
1644
  * To set the current state use subfunction 12 of function 21.
1597
 
1645
 
1598
======================================================================
1646
======================================================================
1599
======== Function 27 - set Windows Sound System (WSS) volume. ========
1647
======== Function 27 - set Windows Sound System (WSS) volume. ========
1600
======================================================================
1648
======================================================================
1601
Parameters:
1649
Parameters:
1602
  * eax = 27 - function number
1650
  * eax = 27 - function number
1603
  * ebx = what to set:
1651
  * ebx = what to set:
1604
    * 1 - set common volume
1652
    * 1 - set common volume
1605
    * 2 - set Line In volume
1653
    * 2 - set Line In volume
1606
  * cl = volume level (0x0=highest, 0x1F=lowest,
1654
  * cl = volume level (0x0=highest, 0x1F=lowest,
1607
    if bit 0x80 is set=disable)
1655
    if bit 0x80 is set=disable)
1608
Returned value:
1656
Returned value:
1609
  * eax = 0 - success
1657
  * eax = 0 - success
1610
  * eax = 1 - WSS base is not defined
1658
  * eax = 1 - WSS base is not defined
1611
  * eax = 2 - incorrect subfunction
1659
  * eax = 2 - incorrect subfunction
1612
Remarks:
1660
Remarks:
1613
  * Previously WSS base port must be defined by call to 
1661
  * Previously WSS base port must be defined by call to 
1614
    subfunction 6 of function 21.
1662
    subfunction 6 of function 21.
1615
  * Set of common volume is ignored (function simply returns eax=0).
1663
  * Set of common volume is ignored (function simply returns eax=0).
1616
  * Old documentation and kernel sources erraticly name function 2
1664
  * Old documentation and kernel sources erraticly name function 2
1617
    as CD-audio volume.
1665
    as CD-audio volume.
1618
 
1666
 
1619
======================================================================
1667
======================================================================
1620
=================== Function 28 - set SB16 volume. ===================
1668
=================== Function 28 - set SB16 volume. ===================
1621
======================================================================
1669
======================================================================
1622
Parameters:
1670
Parameters:
1623
  * eax = 28 - function number
1671
  * eax = 28 - function number
1624
  * ebx = what to install:
1672
  * ebx = what to install:
1625
    * 1 - install common volume
1673
    * 1 - install common volume
1626
    * 2 - install CD-audio volume
1674
    * 2 - install CD-audio volume
1627
  * cl = volume level (0=off, 0xFF=max)
1675
  * cl = volume level (0=off, 0xFF=max)
1628
Returned value:
1676
Returned value:
1629
  * eax = 0 - success
1677
  * eax = 0 - success
1630
  * eax = 1 - SB base is not defined
1678
  * eax = 1 - SB base is not defined
1631
  * eax = 2 - incorrect subfunction
1679
  * eax = 2 - incorrect subfunction
1632
Remarks:
1680
Remarks:
1633
  * Previously SB base port must be defined by
1681
  * Previously SB base port must be defined by
1634
    subfunction 4 of function 21.
1682
    subfunction 4 of function 21.
1635
  * This function gives more variants for volume, that function 25.
1683
  * This function gives more variants for volume, that function 25.
1636
 
1684
 
1637
======================================================================
1685
======================================================================
1638
=================== Function 29 - get system date. ===================
1686
=================== Function 29 - get system date. ===================
1639
======================================================================
1687
======================================================================
1640
Parameters:
1688
Parameters:
1641
  * eax = 29 - function number
1689
  * eax = 29 - function number
1642
Returned value:
1690
Returned value:
1643
  * eax = 0x00DDMMYY, where
1691
  * eax = 0x00DDMMYY, where
1644
    (binary-decimal coding, BCD, is used)
1692
    (binary-decimal coding, BCD, is used)
1645
  * YY = two low digits of year (00..99)
1693
  * YY = two low digits of year (00..99)
1646
  * MM = month (01..12)
1694
  * MM = month (01..12)
1647
  * DD = day (01..31)
1695
  * DD = day (01..31)
1648
Remarks:
1696
Remarks:
1649
  * To set system date use function 22.
1697
  * To set system date use function 22.
1650
 
1698
 
1651
======================================================================
1699
======================================================================
1652
=============== Function 32 - delete file from ramdisk. ==============
1700
=============== Function 32 - delete file from ramdisk. ==============
1653
======================================================================
1701
======================================================================
1654
Parameters:
1702
Parameters:
1655
  * eax = 32 - function number
1703
  * eax = 32 - function number
1656
  * ebx = pointer to the filename
1704
  * ebx = pointer to the filename
1657
Returned value:
1705
Returned value:
1658
  * eax = 0 - success; otherwise file system error code
1706
  * eax = 0 - success; otherwise file system error code
1659
Remarks:
1707
Remarks:
1660
  * This function is obsolete; function 58 allows to fulfill
1708
  * This function is obsolete; function 58 allows to fulfill
1661
    the same operations with the extended possibilities.
1709
    the same operations with the extended possibilities.
1662
  * The current implementation returns only values 0(success) and
1710
  * The current implementation returns only values 0(success) and
1663
    5(file not found).
1711
    5(file not found).
1664
  * The filename must be either in the format 8+3 characters
1712
  * The filename must be either in the format 8+3 characters
1665
    (first 8 characters - name itself, last 3 - extension,
1713
    (first 8 characters - name itself, last 3 - extension,
1666
    the short names and extensions are supplemented with spaces),
1714
    the short names and extensions are supplemented with spaces),
1667
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1715
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1668
    (name no more than 8 characters, dot, extension 3 characters
1716
    (name no more than 8 characters, dot, extension 3 characters
1669
    supplemented if necessary by spaces).
1717
    supplemented if necessary by spaces).
1670
    The filename must be written with capital letters. The terminating
1718
    The filename must be written with capital letters. The terminating
1671
    character with code 0 is not necessary (not ASCIIZ-string).
1719
    character with code 0 is not necessary (not ASCIIZ-string).
1672
  * This function does not support folders on the ramdisk.
1720
  * This function does not support folders on the ramdisk.
1673
 
1721
 
1674
======================================================================
1722
======================================================================
1675
================ Function 33 - write file to ramdisk. ================
1723
================ Function 33 - write file to ramdisk. ================
1676
======================================================================
1724
======================================================================
1677
Parameters:
1725
Parameters:
1678
  * eax = 33 - function number
1726
  * eax = 33 - function number
1679
  * ebx = pointer to the filename
1727
  * ebx = pointer to the filename
1680
  * ecx = pointer to data for writing
1728
  * ecx = pointer to data for writing
1681
  * edx = number of bytes for writing
1729
  * edx = number of bytes for writing
1682
  * should be set esi=0
1730
  * should be set esi=0
1683
Returned value:
1731
Returned value:
1684
  * eax = 0 - success, otherwise file system error code
1732
  * eax = 0 - success, otherwise file system error code
1685
Remarks:
1733
Remarks:
1686
  * This function is obsolete; function 70 allows to fulfil
1734
  * This function is obsolete; function 70 allows to fulfil
1687
    the same operations with extended possibilities.
1735
    the same operations with extended possibilities.
1688
  * If esi contains non-zero value and selected file already exists,
1736
  * If esi contains non-zero value and selected file already exists,
1689
    one more file with the same name will be created.
1737
    one more file with the same name will be created.
1690
  * Otherwise file will be overwritten.
1738
  * Otherwise file will be overwritten.
1691
  * The filename must be either in the format 8+3 characters
1739
  * The filename must be either in the format 8+3 characters
1692
    (first 8 characters - name itself, last 3 - extension,
1740
    (first 8 characters - name itself, last 3 - extension,
1693
    the short names and extensions are supplemented with spaces),
1741
    the short names and extensions are supplemented with spaces),
1694
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1742
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1695
    (name no more than 8 characters, dot, extension 3 characters
1743
    (name no more than 8 characters, dot, extension 3 characters
1696
    supplemented if necessary by spaces).
1744
    supplemented if necessary by spaces).
1697
    The filename must be written with capital letters. The terminating
1745
    The filename must be written with capital letters. The terminating
1698
    character with code 0 is not necessary (not ASCIIZ-string).
1746
    character with code 0 is not necessary (not ASCIIZ-string).
1699
  * This function does not support folders on the ramdisk.
1747
  * This function does not support folders on the ramdisk.
1700
 
1748
 
1701
======================================================================
1749
======================================================================
1702
======= Function 35 - read the color of a pixel on the screen. =======
1750
======= Function 35 - read the color of a pixel on the screen. =======
1703
======================================================================
1751
======================================================================
1704
Parameters:
1752
Parameters:
1705
  * eax = 35
1753
  * eax = 35
1706
  * ebx = y*xsize+x, where
1754
  * ebx = y*xsize+x, where
1707
  * (x,y) = coordinates of a pixel (beginning from 0)
1755
  * (x,y) = coordinates of a pixel (beginning from 0)
1708
  * xsize = horizontal screen size
1756
  * xsize = horizontal screen size
1709
Returned value:
1757
Returned value:
1710
  * eax = color 0x00RRGGBB
1758
  * eax = color 0x00RRGGBB
1711
Remarks:
1759
Remarks:
1712
  * To get screen sizes use function 14. Pay attention,
1760
  * To get screen sizes use function 14. Pay attention,
1713
    that it subtracts 1 from both sizes.
1761
    that it subtracts 1 from both sizes.
1714
  * There is also direct access (without any system calls)
1762
  * There is also direct access (without any system calls)
1715
    to videomemory through the selector gs. To get parameters of
1763
    to videomemory through the selector gs. To get parameters of
1716
    the current videomode, use function 61.
1764
    the current videomode, use function 61.
1717
 
1765
 
1718
======================================================================
1766
======================================================================
1719
========= Function 37 - get coordinates/status of the mouse. =========
1767
========= Function 37 - get coordinates/status of the mouse. =========
1720
======================================================================
1768
======================================================================
1721
 
1769
 
1722
---------- Subfunction 0 - screen coordinates of the mouse -----------
1770
---------- Subfunction 0 - screen coordinates of the mouse -----------
1723
Parameters:
1771
Parameters:
1724
  * eax = 37 - function number
1772
  * eax = 37 - function number
1725
  * ebx = 0 - subfunction number
1773
  * ebx = 0 - subfunction number
1726
Returned value:
1774
Returned value:
1727
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1775
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1728
    (beginning from 0)
1776
    (beginning from 0)
1729
 
1777
 
1730
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1778
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1731
Parameters:
1779
Parameters:
1732
  * eax = 37 - function number
1780
  * eax = 37 - function number
1733
  * ebx = 1 - subfunction number
1781
  * ebx = 1 - subfunction number
1734
Returned value:
1782
Returned value:
1735
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1783
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1736
    relative to the application window (beginning from 0)
1784
    relative to the application window (beginning from 0)
1737
Remarks:
1785
Remarks:
1738
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1786
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1739
    If y>=ywnd, the low word is non-negative and contains
1787
    If y>=ywnd, the low word is non-negative and contains
1740
    relative y-coordinate, and the high word - relative x-coordinate
1788
    relative y-coordinate, and the high word - relative x-coordinate
1741
    (with correct sign). Otherwise the low word is negative and still
1789
    (with correct sign). Otherwise the low word is negative and still
1742
    contains relative y-coordinate, and to the high word
1790
    contains relative y-coordinate, and to the high word
1743
    1 should be added.
1791
    1 should be added.
1744
 
1792
 
1745
------------ Subfunction 2 - pressed buttons of the mouse ------------
1793
------------ Subfunction 2 - pressed buttons of the mouse ------------
1746
Parameters:
1794
Parameters:
1747
  * eax = 37 - function number
1795
  * eax = 37 - function number
1748
  * ebx = 2 - subfunction number
1796
  * ebx = 2 - subfunction number
1749
Returned value:
1797
Returned value:
1750
  * eax contains information on the pressed mouse buttons:
1798
  * eax contains information on the pressed mouse buttons:
1751
  * bit 0 is set = left button is pressed
1799
  * bit 0 is set = left button is pressed
1752
  * bit 1 is set = right button is pressed
1800
  * bit 1 is set = right button is pressed
1753
  * other bits are cleared
1801
  * other bits are cleared
1754
 
1802
 
1755
======================================================================
1803
======================================================================
1756
====================== Function 38 - draw line. ======================
1804
====================== Function 38 - draw line. ======================
1757
======================================================================
1805
======================================================================
1758
Parameters:
1806
Parameters:
1759
  * eax = 38 - function number
1807
  * eax = 38 - function number
1760
  * ebx = [start coordinate on axis x]*65536 +
1808
  * ebx = [start coordinate on axis x]*65536 +
1761
              [end coordinate on axis x]
1809
              [end coordinate on axis x]
1762
  * ecx = [start coordinate on axis y]*65536 +
1810
  * ecx = [start coordinate on axis y]*65536 +
1763
              [end coordinate on axis y]
1811
              [end coordinate on axis y]
1764
  * edx = 0x00RRGGBB - color
1812
  * edx = 0x00RRGGBB - color
1765
Returned value:
1813
Returned value:
1766
  * function does not return value
1814
  * function does not return value
1767
Remarks:
1815
Remarks:
1768
  * Coordinates are relative to the window.
1816
  * Coordinates are relative to the window.
1769
  * End point is also drawn.
1817
  * End point is also drawn.
1770
 
1818
 
1771
======================================================================
1819
======================================================================
1772
== Function 39, subfunction 1 - get a size of the background image. ==
1820
== Function 39, subfunction 1 - get a size of the background image. ==
1773
======================================================================
1821
======================================================================
1774
Parameters:
1822
Parameters:
1775
  * eax = 39 - function number
1823
  * eax = 39 - function number
1776
  * ebx = 1 - subfunction number
1824
  * ebx = 1 - subfunction number
1777
Returned value:
1825
Returned value:
1778
  * eax = [width]*65536 + [height]
1826
  * eax = [width]*65536 + [height]
1779
Remarks:
1827
Remarks:
1780
  * There is a pair function to set sizes of background image -
1828
  * There is a pair function to set sizes of background image -
1781
    subfunction 1 of function 15. After which it is necessary,
1829
    subfunction 1 of function 15. After which it is necessary,
1782
    of course, anew to define image.
1830
    of course, anew to define image.
1783
 
1831
 
1784
======================================================================
1832
======================================================================
1785
== Function 39, subfunction 2 - get pixel from the background image. =
1833
== Function 39, subfunction 2 - get pixel from the background image. =
1786
======================================================================
1834
======================================================================
1787
Parameters:
1835
Parameters:
1788
  * eax = 39 - function number
1836
  * eax = 39 - function number
1789
  * ebx = 2 - subfunction number
1837
  * ebx = 2 - subfunction number
1790
  * ecx = offset
1838
  * ecx = offset
1791
Returned value:
1839
Returned value:
1792
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1840
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1793
    (less than 0x160000-16)
1841
    (less than 0x160000-16)
1794
  * eax = 2 otherwise
1842
  * eax = 2 otherwise
1795
Remarks:
1843
Remarks:
1796
  * Do not rely on returned value for invalid offsets, it may be
1844
  * Do not rely on returned value for invalid offsets, it may be
1797
    changed in future kernel versions.
1845
    changed in future kernel versions.
1798
  * Offset for pixel with coordinates (x,y)
1846
  * Offset for pixel with coordinates (x,y)
1799
    is calculated as (x+y*xsize)*3.
1847
    is calculated as (x+y*xsize)*3.
1800
  * There is a pair function to set pixel on the background image - 
1848
  * There is a pair function to set pixel on the background image - 
1801
    subfunction 2 of function 15.
1849
    subfunction 2 of function 15.
1802
 
1850
 
1803
======================================================================
1851
======================================================================
1804
== Function 39, subfunction 4 - get drawing mode for the background. =
1852
== Function 39, subfunction 4 - get drawing mode for the background. =
1805
======================================================================
1853
======================================================================
1806
Parameters:
1854
Parameters:
1807
  * eax = 39 - function number
1855
  * eax = 39 - function number
1808
  * ebx = 4 - subfunction number
1856
  * ebx = 4 - subfunction number
1809
Returned value:
1857
Returned value:
1810
  * eax = 1 - tile
1858
  * eax = 1 - tile
1811
  * eax = 2 - stretch
1859
  * eax = 2 - stretch
1812
Remarks:
1860
Remarks:
1813
  * There is a pair function to set drawing mode - 
1861
  * There is a pair function to set drawing mode - 
1814
    subfunction 4 of function 15.
1862
    subfunction 4 of function 15.
1815
 
1863
 
1816
======================================================================
1864
======================================================================
1817
=========== Function 40 - set the mask for expected events. ==========
1865
=========== Function 40 - set the mask for expected events. ==========
1818
======================================================================
1866
======================================================================
1819
The mask for expected events affects function working with events
1867
The mask for expected events affects function working with events
1820
10, 11, 23 - they notify only about events allowed by this mask.
1868
10, 11, 23 - they notify only about events allowed by this mask.
1821
Parameters:
1869
Parameters:
1822
  * eax = 40 - function number
1870
  * eax = 40 - function number
1823
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1871
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1824
    (set bit permits notice on event)
1872
    (set bit permits notice on event)
1825
Returned value:
1873
Returned value:
1826
  * function does not return value
1874
  * function does not return value
1827
Remarks:
1875
Remarks:
1828
  * Default mask (7=111b) enables nofices about redraw,
1876
  * Default mask (7=111b) enables nofices about redraw,
1829
    keys and buttons. This is enough for many applications.
1877
    keys and buttons. This is enough for many applications.
1830
  * Events prohibited in the mask are saved anyway, when come;
1878
  * Events prohibited in the mask are saved anyway, when come;
1831
    they are simply not informed with event functions.
1879
    they are simply not informed with event functions.
1832
  * Event functions take into account the mask on moment of
1880
  * Event functions take into account the mask on moment of
1833
    function call, not on moment of event arrival.
1881
    function call, not on moment of event arrival.
1834
 
1882
 
1835
======================================================================
1883
======================================================================
1836
==================== Function 41 - get IRQ owner. ====================
1884
==================== Function 41 - get IRQ owner. ====================
1837
======================================================================
1885
======================================================================
1838
Parameters:
1886
Parameters:
1839
  * eax = 41 - function number
1887
  * eax = 41 - function number
1840
  * ebx = IRQ number, 0..15
1888
  * ebx = IRQ number, 0..15
1841
Returned value:
1889
Returned value:
1842
  * eax = owner PID
1890
  * eax = owner PID
1843
  * eax = 0, if there is no owner
1891
  * eax = 0, if there is no owner
1844
  * eax = -1 for incorrect ebx
1892
  * eax = -1 for incorrect ebx
1845
 
1893
 
1846
======================================================================
1894
======================================================================
1847
==================== Function 42 - read IRQ data. ====================
1895
==================== Function 42 - read IRQ data. ====================
1848
======================================================================
1896
======================================================================
1849
When an IRQ occurs, the system reads data from ports indicated
1897
When an IRQ occurs, the system reads data from ports indicated
1850
earlier by function 44 and writes this data to
1898
earlier by function 44 and writes this data to
1851
internal buffer. This function reads out data from that buffer
1899
internal buffer. This function reads out data from that buffer
1852
bytewise.
1900
bytewise.
1853
Parameters:
1901
Parameters:
1854
  * eax = 42 - function number
1902
  * eax = 42 - function number
1855
  * ebx = IRQ number, 0..15
1903
  * ebx = IRQ number, 0..15
1856
Returned value: (use value of ecx to distinguish)
1904
Returned value: (use value of ecx to distinguish)
1857
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1905
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1858
    * ecx = 2
1906
    * ecx = 2
1859
  * if there is no data:
1907
  * if there is no data:
1860
    * eax = 0
1908
    * eax = 0
1861
    * ecx = 1
1909
    * ecx = 1
1862
    * ebx destroyed
1910
    * ebx destroyed
1863
  * if all is ok:
1911
  * if all is ok:
1864
    * eax = byte size of data, not yet read from buffer
1912
    * eax = byte size of data, not yet read from buffer
1865
    * ecx = 0
1913
    * ecx = 0
1866
    * ebx = current byte
1914
    * ebx = current byte
1867
Remarks:
1915
Remarks:
1868
  * Previously the thread must reserve indicated IRQ for itself
1916
  * Previously the thread must reserve indicated IRQ for itself
1869
    by function 45.
1917
    by function 45.
1870
  * The size of data buffer is 4000 bytes, on overflow
1918
  * The size of data buffer is 4000 bytes, on overflow
1871
    "fresh" data cease to be written in the buffer.
1919
    "fresh" data cease to be written in the buffer.
1872
 
1920
 
1873
======================================================================
1921
======================================================================
1874
================ Function 43 - input/output to a port. ===============
1922
================ Function 43 - input/output to a port. ===============
1875
======================================================================
1923
======================================================================
1876
 
1924
 
1877
------------------------ Output data to port -------------------------
1925
------------------------ Output data to port -------------------------
1878
Parameters:
1926
Parameters:
1879
  * eax = 43 - function number
1927
  * eax = 43 - function number
1880
  * bl = byte for output
1928
  * bl = byte for output
1881
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1929
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1882
Returned value:
1930
Returned value:
1883
  * eax = 0 - success
1931
  * eax = 0 - success
1884
  * eax = 1 - the thread has not reserved the selected port
1932
  * eax = 1 - the thread has not reserved the selected port
1885
 
1933
 
1886
------------------------ Input data from port ------------------------
1934
------------------------ Input data from port ------------------------
1887
Parameters:
1935
Parameters:
1888
  * eax = 43 - function number
1936
  * eax = 43 - function number
1889
  * ebx is ignored
1937
  * ebx is ignored
1890
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1938
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1891
Returned value:
1939
Returned value:
1892
  * eax = 0 - success, thus ebx = entered byte
1940
  * eax = 0 - success, thus ebx = entered byte
1893
  * eax = 1 - the thread has not reserved the selected port
1941
  * eax = 1 - the thread has not reserved the selected port
1894
Remarks:
1942
Remarks:
1895
  * Previously the thread must reserve the selected port
1943
  * Previously the thread must reserve the selected port
1896
    for itself by function 46.
1944
    for itself by function 46.
1897
  * Instead of call to this function it is better to use
1945
  * Instead of call to this function it is better to use
1898
    processor instructions in/out - this is much
1946
    processor instructions in/out - this is much
1899
    faster and a bit shorter and easier.
1947
    faster and a bit shorter and easier.
1900
 
1948
 
1901
======================================================================
1949
======================================================================
1902
=========== Function 44 - define operations at IRQ arrival. ==========
1950
=========== Function 44 - define operations at IRQ arrival. ==========
1903
======================================================================
1951
======================================================================
1904
At IRQ arrival the system can read the data from ports defined
1952
At IRQ arrival the system can read the data from ports defined
1905
by this function and write these data to internal buffer, whence
1953
by this function and write these data to internal buffer, whence
1906
they can be read by ôóíêöèåé 42.
1954
they can be read by ôóíêöèåé 42.
1907
Parameters:
1955
Parameters:
1908
  * eax = 44 - function number
1956
  * eax = 44 - function number
1909
  * ebx = pointer to the array of structures each describing one port:
1957
  * ebx = pointer to the array of structures each describing one port:
1910
    * +0: word: 0 means end of array, otherwise port number
1958
    * +0: word: 0 means end of array, otherwise port number
1911
    * +2: byte: reserved (ignored)
1959
    * +2: byte: reserved (ignored)
1912
    * +3: byte: 1=read byte from this port, 2=read word
1960
    * +3: byte: 1=read byte from this port, 2=read word
1913
  * ecx = IRQ number, 0..15
1961
  * ecx = IRQ number, 0..15
1914
Returned value:
1962
Returned value:
1915
  * eax = 0 - success
1963
  * eax = 0 - success
1916
  * eax = 1 - the thread is not owner of selected IRQ
1964
  * eax = 1 - the thread is not owner of selected IRQ
1917
Remarks:
1965
Remarks:
1918
  * Previously the thread must reserve for itself selected IRQ
1966
  * Previously the thread must reserve for itself selected IRQ
1919
    by function 45.
1967
    by function 45.
1920
  * First 16 ports are considered only.
1968
  * First 16 ports are considered only.
1921
  * The current implementation considers incorrect value of field +3
1969
  * The current implementation considers incorrect value of field +3
1922
    as a signal to terminate IRQ processing.
1970
    as a signal to terminate IRQ processing.
1923
 
1971
 
1924
======================================================================
1972
======================================================================
1925
=================== Function 45 - reserve/free IRQ. ==================
1973
=================== Function 45 - reserve/free IRQ. ==================
1926
======================================================================
1974
======================================================================
1927
Parameters:
1975
Parameters:
1928
  * eax = 45 - function number
1976
  * eax = 45 - function number
1929
  * ebx = 0 - reserve, 1 = free
1977
  * ebx = 0 - reserve, 1 = free
1930
  * ecx = IRQ number, 0..15
1978
  * ecx = IRQ number, 0..15
1931
Returned value:
1979
Returned value:
1932
  * eax = 0 - success
1980
  * eax = 0 - success
1933
  * eax = 1 - error (invalid IRQ number
1981
  * eax = 1 - error (invalid IRQ number
1934
    or attempt to reserve not free IRQ
1982
    or attempt to reserve not free IRQ
1935
    or to free IRQ, not reserved by this thread)
1983
    or to free IRQ, not reserved by this thread)
1936
Remarks:
1984
Remarks:
1937
  * IRQ reservation is required for functions 42 and 44.
1985
  * IRQ reservation is required for functions 42 and 44.
1938
  * Only one thread can reserve the specific IRQ.
1986
  * Only one thread can reserve the specific IRQ.
1939
  * IRQs, handled by the system itself, are reserved by the system
1987
  * IRQs, handled by the system itself, are reserved by the system
1940
    (thread 1) at booting.
1988
    (thread 1) at booting.
1941
  * When a thread terminates, all reserved by it IRQs
1989
  * When a thread terminates, all reserved by it IRQs
1942
    are freed automatically.
1990
    are freed automatically.
1943
 
1991
 
1944
======================================================================
1992
======================================================================
1945
====== Function 46 - reserve/free a group of input/output ports. =====
1993
====== Function 46 - reserve/free a group of input/output ports. =====
1946
======================================================================
1994
======================================================================
1947
To work with reserved ports an application can access directly by
1995
To work with reserved ports an application can access directly by
1948
commands in/out (recommended way) and can use function 43
1996
commands in/out (recommended way) and can use function 43
1949
(not recommended way).
1997
(not recommended way).
1950
Parameters:
1998
Parameters:
1951
  * eax = 46 - function number
1999
  * eax = 46 - function number
1952
  * ebx = 0 - reserve, 1 - free
2000
  * ebx = 0 - reserve, 1 - free
1953
  * ecx = start port number
2001
  * ecx = start port number
1954
  * edx = end port number (inclusive)
2002
  * edx = end port number (inclusive)
1955
Returned value:
2003
Returned value:
1956
  * eax = 0 - success
2004
  * eax = 0 - success
1957
  * eax = 1 - error
2005
  * eax = 1 - error
1958
Remarks:
2006
Remarks:
1959
  * For ports reservation: an error occurs if and only if
2007
  * For ports reservation: an error occurs if and only if
1960
    one from the following condition satisfies:
2008
    one from the following condition satisfies:
1961
    * start port is more than end port;
2009
    * start port is more than end port;
1962
    * the selected range contains incorrect port number
2010
    * the selected range contains incorrect port number
1963
      (correct are from 0 to 0xFFFF);
2011
      (correct are from 0 to 0xFFFF);
1964
    * limit for the total number of reserved areas is exceeded
2012
    * limit for the total number of reserved areas is exceeded
1965
      (maximum 255 are allowed);
2013
      (maximum 255 are allowed);
1966
    * the selected range intersects with any of earlier reserved
2014
    * the selected range intersects with any of earlier reserved
1967
  * For ports free: an error is an attempt to free range,
2015
  * For ports free: an error is an attempt to free range,
1968
    that was not earlier reserved by this function
2016
    that was not earlier reserved by this function
1969
    (with same ecx,edx).
2017
    (with same ecx,edx).
1970
  * If an error occurs (for both cases) function performs no action.
2018
  * If an error occurs (for both cases) function performs no action.
1971
  * At booting the system reserves for itself ports 0..0xff, and if
2019
  * At booting the system reserves for itself ports 0..0xff, and if
1972
    COM-mouse is detected - additionally range of COM-ports
2020
    COM-mouse is detected - additionally range of COM-ports
1973
    0x3f0..0x3ff and/or 0x2f0..0x2ff.
2021
    0x3f0..0x3ff and/or 0x2f0..0x2ff.
1974
  * When a thread terminates, all reserved by it ports
2022
  * When a thread terminates, all reserved by it ports
1975
    are freed automatically.
2023
    are freed automatically.
1976
 
2024
 
1977
======================================================================
2025
======================================================================
1978
============= Function 47 - draw a number in the window. =============
2026
============= Function 47 - draw a number in the window. =============
1979
======================================================================
2027
======================================================================
1980
Parameters:
2028
Parameters:
1981
  * eax = 47 - function number
2029
  * eax = 47 - function number
1982
  * ebx = parameters of conversion number to text:
2030
  * ebx = parameters of conversion number to text:
1983
    * bl = 0 - ecx contains number
2031
    * bl = 0 - ecx contains number
1984
    * bl = 1 - ecx contains pointer to dword-number
2032
    * bl = 1 - ecx contains pointer to dword-number
1985
    * bh = 0 - display in decimal number system
2033
    * bh = 0 - display in decimal number system
1986
    * bh = 1 - display in hexadecimal system
2034
    * bh = 1 - display in hexadecimal system
1987
    * bh = 2 - display in binary system
2035
    * bh = 2 - display in binary system
1988
    * áèòû 16-21 = how many digits to display
2036
    * áèòû 16-21 = how many digits to display
1989
    * áèòû 22-31 reserved and must be set to 0
2037
    * áèòû 22-31 reserved and must be set to 0
1990
  * ecx = number (if bl=0) or pointer (if bl=1)
2038
  * ecx = number (if bl=0) or pointer (if bl=1)
1991
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2039
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1992
  * esi = 0xN0RRGGBB, RRGGBB=color, N=font (0/1)
2040
  * esi = 0xN0RRGGBB, RRGGBB=color, N=font (0/1)
1993
Returned value:
2041
Returned value:
1994
  * function does not return value
2042
  * function does not return value
1995
Remarks:
2043
Remarks:
1996
  * The given length must not exceed 60.
2044
  * The given length must not exceed 60.
1997
  * The exactly given amount of digits is output. If number is small
2045
  * The exactly given amount of digits is output. If number is small
1998
    and can be written by smaller amount of digits, it is supplemented
2046
    and can be written by smaller amount of digits, it is supplemented
1999
    by leading zeroes; if the number is big and can not be written by
2047
    by leading zeroes; if the number is big and can not be written by
2000
    given amount of digits, extra digits are not drawn.
2048
    given amount of digits, extra digits are not drawn.
2001
  * Parameters of fonts are shown in the description of function 4
2049
  * Parameters of fonts are shown in the description of function 4
2002
    (text output).
2050
    (text output).
2003
 
2051
 
2004
======================================================================
2052
======================================================================
2005
========= Function 48, subfunction 0 - apply screen settings. ========
2053
========= Function 48, subfunction 0 - apply screen settings. ========
2006
======================================================================
2054
======================================================================
2007
Parameters:
2055
Parameters:
2008
  * eax = 48 - function number
2056
  * eax = 48 - function number
2009
  * ebx = 0 - subfunction number
2057
  * ebx = 0 - subfunction number
2010
  * ecx = 0 - reserved
2058
  * ecx = 0 - reserved
2011
Returned value:
2059
Returned value:
2012
  * function does not return value
2060
  * function does not return value
2013
Remarks:
2061
Remarks:
2014
  * Function redraws the screen after parameters change by
2062
  * Function redraws the screen after parameters change by
2015
    subfunctions 1 and 2.
2063
    subfunctions 1 and 2.
2016
  * Function call without prior call to one of indicated subfunctions
2064
  * Function call without prior call to one of indicated subfunctions
2017
    is ignored.
2065
    is ignored.
2018
  * Function call with nonzero ecx is ignored.
2066
  * Function call with nonzero ecx is ignored.
2019
 
2067
 
2020
======================================================================
2068
======================================================================
2021
=========== Function 48, subfunction 1 - set button style. ===========
2069
=========== Function 48, subfunction 1 - set button style. ===========
2022
======================================================================
2070
======================================================================
2023
Parameters:
2071
Parameters:
2024
  * eax = 48 - function number
2072
  * eax = 48 - function number
2025
  * ebx = 1 - subfunction number
2073
  * ebx = 1 - subfunction number
2026
  * ecx = button style:
2074
  * ecx = button style:
2027
    * 0 = flat
2075
    * 0 = flat
2028
    * 1 = 3d
2076
    * 1 = 3d
2029
Returned value:
2077
Returned value:
2030
  * function does not return value
2078
  * function does not return value
2031
Remarks:
2079
Remarks:
2032
  * After call to this function one should redraw the screen by
2080
  * After call to this function one should redraw the screen by
2033
    subfunction 0.
2081
    subfunction 0.
2034
  * Button style influences only to their draw of function 8.
2082
  * Button style influences only to their draw of function 8.
2035
 
2083
 
2036
======================================================================
2084
======================================================================
2037
====== Function 48, subfunction 2 - set standard window colors. ======
2085
====== Function 48, subfunction 2 - set standard window colors. ======
2038
======================================================================
2086
======================================================================
2039
Parameters:
2087
Parameters:
2040
  * eax = 48 - function number
2088
  * eax = 48 - function number
2041
  * ebx = 2 - subfunction number
2089
  * ebx = 2 - subfunction number
2042
  * ecx = pointer to the color table
2090
  * ecx = pointer to the color table
2043
  * edx = size of the color table
2091
  * edx = size of the color table
2044
    (must be 40 bytes for future compatibility)
2092
    (must be 40 bytes for future compatibility)
2045
Format of the color table is shown in description of subfunction 3.
2093
Format of the color table is shown in description of subfunction 3.
2046
Returned value:
2094
Returned value:
2047
  * function does not return value
2095
  * function does not return value
2048
Remarks:
2096
Remarks:
2049
  * After call to this function one should redraw the screen by
2097
  * After call to this function one should redraw the screen by
2050
    subfunction 0.
2098
    subfunction 0.
2051
  * Table of standard colors influences only to applications,
2099
  * Table of standard colors influences only to applications,
2052
    which receive this table obviously (by subfunction 3)
2100
    which receive this table obviously (by subfunction 3)
2053
    and use it (specifying colors from it to drawing functions).
2101
    and use it (specifying colors from it to drawing functions).
2054
  * Table of standard colors is included in skin and is installed
2102
  * Table of standard colors is included in skin and is installed
2055
    anew with skin installation (by subfunction 8).
2103
    anew with skin installation (by subfunction 8).
2056
  * Color table can be viewed/changed interactively with
2104
  * Color table can be viewed/changed interactively with
2057
    the application 'desktop'.
2105
    the application 'desktop'.
2058
 
2106
 
2059
======================================================================
2107
======================================================================
2060
====== Function 48, subfunction 3 - get standard window colors. ======
2108
====== Function 48, subfunction 3 - get standard window colors. ======
2061
======================================================================
2109
======================================================================
2062
Parameters:
2110
Parameters:
2063
  * eax = 48 - function number
2111
  * eax = 48 - function number
2064
  * ebx = 3 - subfunction number
2112
  * ebx = 3 - subfunction number
2065
  * ecx = pointer to the buffer with size edx bytes,
2113
  * ecx = pointer to the buffer with size edx bytes,
2066
    where table will be written
2114
    where table will be written
2067
  * edx = size of color table
2115
  * edx = size of color table
2068
    (must be 40 bytes for future compatibility)
2116
    (must be 40 bytes for future compatibility)
2069
Returned value:
2117
Returned value:
2070
  * function does not return value
2118
  * function does not return value
2071
Format of the color table:
2119
Format of the color table:
2072
each item is dword-value for color 0x00RRGGBB
2120
each item is dword-value for color 0x00RRGGBB
2073
  * +0: dword: frames - color of frame
2121
  * +0: dword: frames - color of frame
2074
  * +4: dword: grab - color of header
2122
  * +4: dword: grab - color of header
2075
  * +8: dword: grab_button - color of button on header bar
2123
  * +8: dword: grab_button - color of button on header bar
2076
  * +12 = +0xC: dword: grab_button_text - color of text on button
2124
  * +12 = +0xC: dword: grab_button_text - color of text on button
2077
    on header bar
2125
    on header bar
2078
  * +16 = +0x10: dword: grab_text - color of text on header
2126
  * +16 = +0x10: dword: grab_text - color of text on header
2079
  * +20 = +0x14: dword: work - color of working area
2127
  * +20 = +0x14: dword: work - color of working area
2080
  * +24 = +0x18: dword: work_button - color of button in working area
2128
  * +24 = +0x18: dword: work_button - color of button in working area
2081
  * +28 = +0x1C: dword: work_button_text - color of text on button
2129
  * +28 = +0x1C: dword: work_button_text - color of text on button
2082
    in working area
2130
    in working area
2083
  * +32 = +0x20: dword: work_text - color of text in working area
2131
  * +32 = +0x20: dword: work_text - color of text in working area
2084
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2132
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2085
Remarks:
2133
Remarks:
2086
  * Structure of the color table is described in the standard
2134
  * Structure of the color table is described in the standard
2087
    include file 'macros.inc' as 'system_colors'; for example,
2135
    include file 'macros.inc' as 'system_colors'; for example,
2088
    it is possible to write:
2136
    it is possible to write:
2089
    	sc	system_colors		; variable declaration
2137
        sc    system_colors        ; variable declaration
2090
    	...				; somewhere one must call
2138
        ...                ; somewhere one must call
2091
    					; this function with ecx=sc
2139
                        ; this function with ecx=sc
2092
    	mov	ecx, [sc.work_button_text]	; read text color on
2140
        mov    ecx, [sc.work_button_text]    ; read text color on
2093
    					; buttin in working area
2141
                        ; buttin in working area
2094
  * A program itself desides to use or not to use color table.
2142
  * A program itself desides to use or not to use color table.
2095
    For usage program must simply at calls to drawing functions select
2143
    For usage program must simply at calls to drawing functions select
2096
    color taken from the table.
2144
    color taken from the table.
2097
  * At change of the table of standard colors (by subfunction 2 with
2145
  * At change of the table of standard colors (by subfunction 2 with
2098
    the subsequent application of changes by subfunction 0 or
2146
    the subsequent application of changes by subfunction 0 or
2099
    at skin set by subfunction 8) the system sends to all windows
2147
    at skin set by subfunction 8) the system sends to all windows
2100
    redraw message (the event with code 1).
2148
    redraw message (the event with code 1).
2101
  * Color table can be viewed/changed interactively with
2149
  * Color table can be viewed/changed interactively with
2102
    the application 'desktop'.
2150
    the application 'desktop'.
2103
 
2151
 
2104
======================================================================
2152
======================================================================
2105
============ Function 48, subfunction 4 - get skin height. ===========
2153
============ Function 48, subfunction 4 - get skin height. ===========
2106
======================================================================
2154
======================================================================
2107
Parameters:
2155
Parameters:
2108
  * eax = 48 - function number
2156
  * eax = 48 - function number
2109
  * ebx = 4 - subfunction number
2157
  * ebx = 4 - subfunction number
2110
Returned value:
2158
Returned value:
2111
  * eax = skin height
2159
  * eax = skin height
2112
Remarks:
2160
Remarks:
2113
  * Skin height is defined as the height of a header
2161
  * Skin height is defined as the height of a header
2114
    of skinned windows.
2162
    of skinned windows.
2115
  * See also general structure of window in the description
2163
  * See also general structure of window in the description
2116
    of function 0.
2164
    of function 0.
2117
 
2165
 
2118
======================================================================
2166
======================================================================
2119
======== Function 48, subfunction 5 - get screen working area. =======
2167
======== Function 48, subfunction 5 - get screen working area. =======
2120
======================================================================
2168
======================================================================
2121
Parameters:
2169
Parameters:
2122
  * eax = 48 - function number
2170
  * eax = 48 - function number
2123
  * ebx = 5 - subfunction number
2171
  * ebx = 5 - subfunction number
2124
Returned value:
2172
Returned value:
2125
  * eax = [left]*65536 + [right]
2173
  * eax = [left]*65536 + [right]
2126
  * ebx = [top]*65536 + [bottom]
2174
  * ebx = [top]*65536 + [bottom]
2127
Remarks:
2175
Remarks:
2128
  * The screen working area defines position and coordinates of
2176
  * The screen working area defines position and coordinates of
2129
    a maximized window.
2177
    a maximized window.
2130
  * The screen working area in view of normal work is all screen
2178
  * The screen working area in view of normal work is all screen
2131
    without system panel (the application '@panel').
2179
    without system panel (the application '@panel').
2132
  * (left,top) are coordinates of the left upper corner,
2180
  * (left,top) are coordinates of the left upper corner,
2133
    (right,bottom) are coordinates of the right lower one.
2181
    (right,bottom) are coordinates of the right lower one.
2134
    Thus the size of working area on x axis can be calculated by
2182
    Thus the size of working area on x axis can be calculated by
2135
    formula right-left+1, on y axis - by formula bottom-right+1.
2183
    formula right-left+1, on y axis - by formula bottom-right+1.
2136
  * See also function 14,
2184
  * See also function 14,
2137
    to get sizes of all screen.
2185
    to get sizes of all screen.
2138
  * There is a pair function to set working area - subfunction 6.
2186
  * There is a pair function to set working area - subfunction 6.
2139
 
2187
 
2140
======================================================================
2188
======================================================================
2141
======== Function 48, subfunction 6 - set screen working area. =======
2189
======== Function 48, subfunction 6 - set screen working area. =======
2142
======================================================================
2190
======================================================================
2143
Parameters:
2191
Parameters:
2144
  * eax = 48 - function number
2192
  * eax = 48 - function number
2145
  * ebx = 6 - subfunction number
2193
  * ebx = 6 - subfunction number
2146
  * ecx = [left]*65536 + [right]
2194
  * ecx = [left]*65536 + [right]
2147
  * edx = [top]*65536 + [bottom]
2195
  * edx = [top]*65536 + [bottom]
2148
Returned value:
2196
Returned value:
2149
  * function does not return value
2197
  * function does not return value
2150
Remarks:
2198
Remarks:
2151
  * The screen working area defines position and coordinates of
2199
  * The screen working area defines position and coordinates of
2152
    a maximized window.
2200
    a maximized window.
2153
  * This function is used only by the application '@panel',
2201
  * This function is used only by the application '@panel',
2154
    which set working area to all screen without system panel.
2202
    which set working area to all screen without system panel.
2155
  * (left,top) are coordinates of the left upper corner,
2203
  * (left,top) are coordinates of the left upper corner,
2156
    (right,bottom) are coordinates of the right lower one.
2204
    (right,bottom) are coordinates of the right lower one.
2157
    Thus the size of working area on x axis can be calculated by
2205
    Thus the size of working area on x axis can be calculated by
2158
    formula right-left+1, on y axis - by formula bottom-right+1.
2206
    formula right-left+1, on y axis - by formula bottom-right+1.
2159
  * If 'left'>='right', x-coordinate of working area is not changed.
2207
  * If 'left'>='right', x-coordinate of working area is not changed.
2160
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2208
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2161
    equal to screen width, 'right' will not be set.
2209
    equal to screen width, 'right' will not be set.
2162
    Similarly on y axis.
2210
    Similarly on y axis.
2163
  * See also function 14,
2211
  * See also function 14,
2164
    to get sizes of all screen.
2212
    to get sizes of all screen.
2165
  * There is a pair function to get working area - subfunction 5.
2213
  * There is a pair function to get working area - subfunction 5.
2166
  * This function redraws the screen automatically,
2214
  * This function redraws the screen automatically,
2167
    updating coordinates and sizes of maximized windows.
2215
    updating coordinates and sizes of maximized windows.
2168
    The system sends to all windows redraw message (the event 1).
2216
    The system sends to all windows redraw message (the event 1).
2169
 
2217
 
2170
======================================================================
2218
======================================================================
2171
=========== Function 48, subfunction 7 - get skin margins. ===========
2219
=========== Function 48, subfunction 7 - get skin margins. ===========
2172
======================================================================
2220
======================================================================
2173
Returns the area of a header of a skinned window, intended for
2221
Returns the area of a header of a skinned window, intended for
2174
a text of a header.
2222
a text of a header.
2175
Parameters:
2223
Parameters:
2176
  * eax = 48 - function number
2224
  * eax = 48 - function number
2177
  * ebx = 7 - subfunction number
2225
  * ebx = 7 - subfunction number
2178
Returned value:
2226
Returned value:
2179
  * eax = [left]*65536 + [right]
2227
  * eax = [left]*65536 + [right]
2180
  * ebx = [top]*65536 + [bottom]
2228
  * ebx = [top]*65536 + [bottom]
2181
Remarks:
2229
Remarks:
2182
  * An application decides itself to use or not to use this function.
2230
  * An application decides itself to use or not to use this function.
2183
  * It is recommended to take into account returned value
2231
  * It is recommended to take into account returned value
2184
    of this function for choice of a place for drawing header text
2232
    of this function for choice of a place for drawing header text
2185
    (by function 4) or a substitute of header text
2233
    (by function 4) or a substitute of header text
2186
    (at the discretion of an application).
2234
    (at the discretion of an application).
2187
 
2235
 
2188
======================================================================
2236
======================================================================
2189
============= Function 48, subfunction 8 - set used skin. ============
2237
============= Function 48, subfunction 8 - set used skin. ============
2190
======================================================================
2238
======================================================================
2191
Parameters:
2239
Parameters:
2192
  * eax = 48 - function number
2240
  * eax = 48 - function number
2193
  * ebx = 8 - subfunction number
2241
  * ebx = 8 - subfunction number
2194
  * ecx = pointer to a block for function 58, in
2242
  * ecx = pointer to a block for function 58, in
2195
    which the fields of intermediate buffer and file name are filled
2243
    which the fields of intermediate buffer and file name are filled
2196
Returned value:
2244
Returned value:
2197
  * eax = 0 - success
2245
  * eax = 0 - success
2198
  * otherwise eax = file system error code; if file does not
2246
  * otherwise eax = file system error code; if file does not
2199
    contain valid skin, function returns error 3
2247
    contain valid skin, function returns error 3
2200
    (unknown file system).
2248
    (unknown file system).
2201
Remarks:
2249
Remarks:
2202
  * After successful skin loading the system sends to all windows
2250
  * After successful skin loading the system sends to all windows
2203
    redraw message (the event 1).
2251
    redraw message (the event 1).
2204
  * At booting the system reads skin from file 'default.skn'
2252
  * At booting the system reads skin from file 'default.skn'
2205
    on ramdisk.
2253
    on ramdisk.
2206
  * User can change the skin statically by creating hisself
2254
  * User can change the skin statically by creating hisself
2207
    'default.skn' or dynamically with the application 'desktop'.
2255
    'default.skn' or dynamically with the application 'desktop'.
2208
 
2256
 
2209
======================================================================
2257
======================================================================
2210
=========== Function 49 - Advanced Power Management (APM). ===========
2258
=========== Function 49 - Advanced Power Management (APM). ===========
2211
======================================================================
2259
======================================================================
2212
Parameters:
2260
Parameters:
2213
  * eax = 49 - function number
2261
  * eax = 49 - function number
2214
  * dx = number of the APM function
2262
  * dx = number of the APM function
2215
    (analogue of ax in APM specification)
2263
    (analogue of ax in APM specification)
2216
  * bx, cx = parameters of the APM function
2264
  * bx, cx = parameters of the APM function
2217
Returned value:
2265
Returned value:
2218
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2266
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2219
    are set according to the APM specification
2267
    are set according to the APM specification
2220
  * high halves of 32-bit registers eax, ebx, ecx,
2268
  * high halves of 32-bit registers eax, ebx, ecx,
2221
    edx, esi, edi are destroyed
2269
    edx, esi, edi are destroyed
2222
Remarks:
2270
Remarks:
2223
  * APM 1.2 specification is described in the document
2271
  * APM 1.2 specification is described in the document
2224
    "Advanced Power Management (APM) BIOS Specification"
2272
    "Advanced Power Management (APM) BIOS Specification"
2225
    (Revision 1.2), available at
2273
    (Revision 1.2), available at
2226
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2274
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2227
    besides it is included in famous Interrupt List by Ralf Brown
2275
    besides it is included in famous Interrupt List by Ralf Brown
2228
    (http://www.pobox.com/~ralf/files.html,
2276
    (http://www.pobox.com/~ralf/files.html,
2229
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2277
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2230
 
2278
 
2231
======================================================================
2279
======================================================================
2232
=================== Function 50 - set window shape. ==================
2280
=================== Function 50 - set window shape. ==================
2233
======================================================================
2281
======================================================================
2234
Normal windows have rectangular shape. This function can give to
2282
Normal windows have rectangular shape. This function can give to
2235
a window any shape. The shape is given by a set of points inside
2283
a window any shape. The shape is given by a set of points inside
2236
the base rectangle belonging to a window. Position and coordinates
2284
the base rectangle belonging to a window. Position and coordinates
2237
of the base rectangle are set by function 0
2285
of the base rectangle are set by function 0
2238
and changed by function 67.
2286
and changed by function 67.
2239
 
2287
 
2240
--------------------------- Set shape data ---------------------------
2288
--------------------------- Set shape data ---------------------------
2241
Parameters:
2289
Parameters:
2242
  * eax = 50 - function number
2290
  * eax = 50 - function number
2243
  * ebx = 0 - subfunction number
2291
  * ebx = 0 - subfunction number
2244
  * ecx = pointer to shape data (array of bytes 0/1)
2292
  * ecx = pointer to shape data (array of bytes 0/1)
2245
Returned value:
2293
Returned value:
2246
  * function does not return value
2294
  * function does not return value
2247
 
2295
 
2248
-------------------------- Set shape scale ---------------------------
2296
-------------------------- Set shape scale ---------------------------
2249
Parameters:
2297
Parameters:
2250
  * eax = 50 - function number
2298
  * eax = 50 - function number
2251
  * ebx = 1 - subfunction number
2299
  * ebx = 1 - subfunction number
2252
  * ecx sets a scale: each byte of data defines
2300
  * ecx sets a scale: each byte of data defines
2253
    (2^scale)*(2^scale) pixels
2301
    (2^scale)*(2^scale) pixels
2254
Returned value:
2302
Returned value:
2255
  * function does not return value
2303
  * function does not return value
2256
Remarks:
2304
Remarks:
2257
  * Default scale is 0 (scale factor is 1). If in the shape data
2305
  * Default scale is 0 (scale factor is 1). If in the shape data
2258
    one byte corresponds to one pixel, there is no necessity
2306
    one byte corresponds to one pixel, there is no necessity
2259
    to set scale.
2307
    to set scale.
2260
  * Let's designate xsize = window width (in pixels), ysize = height;
2308
  * Let's designate xsize = window width (in pixels), ysize = height;
2261
    pay attention, that they are one pixel more than defined by
2309
    pay attention, that they are one pixel more than defined by
2262
    functions 0, 67.
2310
    functions 0, 67.
2263
  * On definition of scale xsize and ysize must be divisible
2311
  * On definition of scale xsize and ysize must be divisible
2264
    on 2^scale.
2312
    on 2^scale.
2265
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2313
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2266
    to a window of square with the side 2^scale (if scale=0,
2314
    to a window of square with the side 2^scale (if scale=0,
2267
    this is one pixel) and coordinates of the left upper corner
2315
    this is one pixel) and coordinates of the left upper corner
2268
    (a mod (xsize shr scale), a div (xsize shr scale))
2316
    (a mod (xsize shr scale), a div (xsize shr scale))
2269
  * Data size: (xsize shr scale)*(ysize shr scale).
2317
  * Data size: (xsize shr scale)*(ysize shr scale).
2270
  * Data must be presented in the memory and not change
2318
  * Data must be presented in the memory and not change
2271
    after set of shape.
2319
    after set of shape.
2272
  * The system views the shape data at every window redraw by
2320
  * The system views the shape data at every window redraw by
2273
    function 0.
2321
    function 0.
2274
  * The call of subfunction 0 with NULL pointer results in return
2322
  * The call of subfunction 0 with NULL pointer results in return
2275
    to the rectangular shape.
2323
    to the rectangular shape.
2276
 
2324
 
2277
======================================================================
2325
======================================================================
2278
==================== Function 51 - create thread. ====================
2326
==================== Function 51 - create thread. ====================
2279
======================================================================
2327
======================================================================
2280
Parameters:
2328
Parameters:
2281
  * eax = 51 - function number
2329
  * eax = 51 - function number
2282
  * ebx = 1 - unique subfunction
2330
  * ebx = 1 - unique subfunction
2283
  * ecx = address of thread entry point (starting eip)
2331
  * ecx = address of thread entry point (starting eip)
2284
  * edx = pointer to thread stack (starting esp)
2332
  * edx = pointer to thread stack (starting esp)
2285
Returned value:
2333
Returned value:
2286
  * eax = -1 - error (there is too many threads)
2334
  * eax = -1 - error (there is too many threads)
2287
  * otherwise eax = TID - thread identifier
2335
  * otherwise eax = TID - thread identifier
2288
         
2336
         
2289
 
2337
 
2290
======================================================================
2338
======================================================================
2291
=== Function 52, subfunction 0 - get network driver configuration. ===
2339
=== Function 52, subfunction 0 - get network driver configuration. ===
2292
======================================================================
2340
======================================================================
2293
Parameters:
2341
Parameters:
2294
  * eax = 52 - function number
2342
  * eax = 52 - function number
2295
  * ebx = 0 - subfunction number
2343
  * ebx = 0 - subfunction number
2296
Returned value:
2344
Returned value:
2297
  * eax = configuration dword
2345
  * eax = configuration dword
2298
Remarks:
2346
Remarks:
2299
  * Configuration dword can be set by subfunction 2.
2347
  * Configuration dword can be set by subfunction 2.
2300
  * The kernel does not use this variable. The value of this
2348
  * The kernel does not use this variable. The value of this
2301
    variable and working with it subfunctions 0 and 2 is represented
2349
    variable and working with it subfunctions 0 and 2 is represented
2302
    doubtful.
2350
    doubtful.
2303
 
2351
 
2304
======================================================================
2352
======================================================================
2305
========= Function 52, subfunction 1 - get local IP-address. =========
2353
========= Function 52, subfunction 1 - get local IP-address. =========
2306
======================================================================
2354
======================================================================
2307
Parameters:
2355
Parameters:
2308
  * eax = 52 - function number
2356
  * eax = 52 - function number
2309
  * ebx = 1 - subfunction number
2357
  * ebx = 1 - subfunction number
2310
Returned value:
2358
Returned value:
2311
  * eax = IP-address (4 bytes)
2359
  * eax = IP-address (4 bytes)
2312
Remarks:
2360
Remarks:
2313
  * Local IP-address is set by subfunction 3.
2361
  * Local IP-address is set by subfunction 3.
2314
 
2362
 
2315
======================================================================
2363
======================================================================
2316
=== Function 52, subfunction 2 - set network driver configuration. ===
2364
=== Function 52, subfunction 2 - set network driver configuration. ===
2317
======================================================================
2365
======================================================================
2318
Parameters:
2366
Parameters:
2319
  * eax = 52 - function number
2367
  * eax = 52 - function number
2320
  * ebx = 2 - subfunction number
2368
  * ebx = 2 - subfunction number
2321
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2369
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2322
    function [re-]initializes Ethernet-card, otherwise
2370
    function [re-]initializes Ethernet-card, otherwise
2323
    Ethernet turns off
2371
    Ethernet turns off
2324
Returned value:
2372
Returned value:
2325
  * if Ethernet-interface is not requested, function returns eax=2,
2373
  * if Ethernet-interface is not requested, function returns eax=2,
2326
    but this can be changed in future kernel versions
2374
    but this can be changed in future kernel versions
2327
  * if Ethernet-interface is requested, eax=0 means error
2375
  * if Ethernet-interface is requested, eax=0 means error
2328
    (absence of Ethernet-card), and nonzero value - success
2376
    (absence of Ethernet-card), and nonzero value - success
2329
Remarks:
2377
Remarks:
2330
  * Configuration dword can be read by subfunction 0.
2378
  * Configuration dword can be read by subfunction 0.
2331
  * The kernel does not use this variable. The value of this
2379
  * The kernel does not use this variable. The value of this
2332
    variable, subfunction 0 and part of subfunction 2, which set it,
2380
    variable, subfunction 0 and part of subfunction 2, which set it,
2333
    is represented doubtful.
2381
    is represented doubtful.
2334
 
2382
 
2335
======================================================================
2383
======================================================================
2336
========= Function 52, subfunction 3 - set local IP-address. =========
2384
========= Function 52, subfunction 3 - set local IP-address. =========
2337
======================================================================
2385
======================================================================
2338
Parameters:
2386
Parameters:
2339
  * eax = 52 - function number
2387
  * eax = 52 - function number
2340
  * ebx = 3 - subfunction number
2388
  * ebx = 3 - subfunction number
2341
  * ecx = IP-address (4 bytes)
2389
  * ecx = IP-address (4 bytes)
2342
Returned value:
2390
Returned value:
2343
  * the current implementation returns eax=3, but this can be changed
2391
  * the current implementation returns eax=3, but this can be changed
2344
    in future versions
2392
    in future versions
2345
Remarks:
2393
Remarks:
2346
  * Local IP-address can be get by subfunction 1.
2394
  * Local IP-address can be get by subfunction 1.
2347
 
2395
 
2348
======================================================================
2396
======================================================================
2349
= Function 52, subfunction 6 - add data to the stack of input queue. =
2397
= Function 52, subfunction 6 - add data to the stack of input queue. =
2350
======================================================================
2398
======================================================================
2351
Parameters:
2399
Parameters:
2352
  * eax = 52 - function number
2400
  * eax = 52 - function number
2353
  * ebx = 6 - subfunction number
2401
  * ebx = 6 - subfunction number
2354
  * edx = data size
2402
  * edx = data size
2355
  * esi = data pointer
2403
  * esi = data pointer
2356
Returned value:
2404
Returned value:
2357
  * eax = -1 - error
2405
  * eax = -1 - error
2358
  * eax = 0 - success
2406
  * eax = 0 - success
2359
Remarks:
2407
Remarks:
2360
  * This function is intended only for slow network drivers
2408
  * This function is intended only for slow network drivers
2361
    (PPP, SLIP).
2409
    (PPP, SLIP).
2362
  * Data size must not exceed 1500 bytes, though function
2410
  * Data size must not exceed 1500 bytes, though function
2363
    performs no checks on correctness.
2411
    performs no checks on correctness.
2364
 
2412
 
2365
======================================================================
2413
======================================================================
2366
 Function 52, subfunction 8 - read data from the network output queue. 
2414
 Function 52, subfunction 8 - read data from the network output queue. 
2367
======================================================================
2415
======================================================================
2368
Parameters:
2416
Parameters:
2369
  * eax = 52 - function number
2417
  * eax = 52 - function number
2370
  * ebx = 8 - subfunction number
2418
  * ebx = 8 - subfunction number
2371
  * esi = pointer to 1500-byte buffer
2419
  * esi = pointer to 1500-byte buffer
2372
Returned value:
2420
Returned value:
2373
  * eax = number of read bytes (in the current implementation
2421
  * eax = number of read bytes (in the current implementation
2374
    either 0 = no data or 1500)
2422
    either 0 = no data or 1500)
2375
  * data was copied in buffer
2423
  * data was copied in buffer
2376
Remarks:
2424
Remarks:
2377
  * This function is intended only for slow network drivers
2425
  * This function is intended only for slow network drivers
2378
    (PPP, SLIP).
2426
    (PPP, SLIP).
2379
 
2427
 
2380
======================================================================
2428
======================================================================
2381
============ Function 52, subfunction 9 - get gateway IP. ============
2429
============ Function 52, subfunction 9 - get gateway IP. ============
2382
======================================================================
2430
======================================================================
2383
Parameters:
2431
Parameters:
2384
  * eax = 52 - function number
2432
  * eax = 52 - function number
2385
  * ebx = 9 - subfunction number
2433
  * ebx = 9 - subfunction number
2386
Returned value:
2434
Returned value:
2387
  * eax = gateway IP (4 bytes)
2435
  * eax = gateway IP (4 bytes)
2388
 
2436
 
2389
======================================================================
2437
======================================================================
2390
=========== Function 52, subfunction 10 - get subnet mask. ===========
2438
=========== Function 52, subfunction 10 - get subnet mask. ===========
2391
======================================================================
2439
======================================================================
2392
Parameters:
2440
Parameters:
2393
  * eax = 52 - function number
2441
  * eax = 52 - function number
2394
  * ebx = 10 - subfunction number
2442
  * ebx = 10 - subfunction number
2395
Returned value:
2443
Returned value:
2396
  * eax = subnet mask
2444
  * eax = subnet mask
2397
 
2445
 
2398
======================================================================
2446
======================================================================
2399
============ Function 52, subfunction 11 - set gateway IP. ===========
2447
============ Function 52, subfunction 11 - set gateway IP. ===========
2400
======================================================================
2448
======================================================================
2401
Parameters:
2449
Parameters:
2402
  * eax = 52 - function number
2450
  * eax = 52 - function number
2403
  * ebx = 11 - subfunction number
2451
  * ebx = 11 - subfunction number
2404
  * ecx = gateway IP (4 bytes)
2452
  * ecx = gateway IP (4 bytes)
2405
Returned value:
2453
Returned value:
2406
  * the current implementation returns eax=11, but this can be changed
2454
  * the current implementation returns eax=11, but this can be changed
2407
    in future versions
2455
    in future versions
2408
 
2456
 
2409
======================================================================
2457
======================================================================
2410
=========== Function 52, subfunction 12 - set subnet mask. ===========
2458
=========== Function 52, subfunction 12 - set subnet mask. ===========
2411
======================================================================
2459
======================================================================
2412
Parameters:
2460
Parameters:
2413
  * eax = 52 - function number
2461
  * eax = 52 - function number
2414
  * ebx = 12 - subfunction number
2462
  * ebx = 12 - subfunction number
2415
  * ecx = subnet mask
2463
  * ecx = subnet mask
2416
Returned value:
2464
Returned value:
2417
  * the current implementation returns eax=12, but this can be changed
2465
  * the current implementation returns eax=12, but this can be changed
2418
    in future versions
2466
    in future versions
2419
 
2467
 
2420
======================================================================
2468
======================================================================
2421
============== Function 52, subfunction 13 - get DNS IP. =============
2469
============== Function 52, subfunction 13 - get DNS IP. =============
2422
======================================================================
2470
======================================================================
2423
Parameters:
2471
Parameters:
2424
  * eax = 52 - function number
2472
  * eax = 52 - function number
2425
  * ebx = 13 - subfunction number
2473
  * ebx = 13 - subfunction number
2426
Returned value:
2474
Returned value:
2427
  * eax = DNS IP (4 bytes)
2475
  * eax = DNS IP (4 bytes)
2428
 
2476
 
2429
======================================================================
2477
======================================================================
2430
============== Function 52, subfunction 14 - set DNS IP. =============
2478
============== Function 52, subfunction 14 - set DNS IP. =============
2431
======================================================================
2479
======================================================================
2432
Parameters:
2480
Parameters:
2433
  * eax = 52 - function number
2481
  * eax = 52 - function number
2434
  * ebx = 14 - subfunction number
2482
  * ebx = 14 - subfunction number
2435
  * ecx = DNS IP (4 bytes)
2483
  * ecx = DNS IP (4 bytes)
2436
Returned value:
2484
Returned value:
2437
  * the current implementation returns eax=14, but this can be changed
2485
  * the current implementation returns eax=14, but this can be changed
2438
    in future versions
2486
    in future versions
2439
 
2487
 
2440
======================================================================
2488
======================================================================
2441
============ Function 53, subfunction 0 - open UDP-socket. ===========
2489
============ Function 53, subfunction 0 - open UDP-socket. ===========
2442
======================================================================
2490
======================================================================
2443
Parameters:
2491
Parameters:
2444
  * eax = 53 - function number
2492
  * eax = 53 - function number
2445
  * ebx = 0 - subfunction number
2493
  * ebx = 0 - subfunction number
2446
  * ecx = local port (only low word is taken into account)
2494
  * ecx = local port (only low word is taken into account)
2447
  * edx = remote port (only low word is taken into account)
2495
  * edx = remote port (only low word is taken into account)
2448
  * esi = remote IP
2496
  * esi = remote IP
2449
Returned value:
2497
Returned value:
2450
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2498
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2451
  * eax = socket handle (some number which unambiguously identifies
2499
  * eax = socket handle (some number which unambiguously identifies
2452
    socket and have sense only for the system) - success;
2500
    socket and have sense only for the system) - success;
2453
    ebx destroyed
2501
    ebx destroyed
2454
 
2502
 
2455
======================================================================
2503
======================================================================
2456
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2504
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2457
======================================================================
2505
======================================================================
2458
Parameters:
2506
Parameters:
2459
  * eax = 53 - function number
2507
  * eax = 53 - function number
2460
  * ebx = 1 - subfunction number
2508
  * ebx = 1 - subfunction number
2461
  * ecx = socket handle
2509
  * ecx = socket handle
2462
Returned value:
2510
Returned value:
2463
  * eax = -1 - incorrect handle
2511
  * eax = -1 - incorrect handle
2464
  * eax = 0 - success
2512
  * eax = 0 - success
2465
  * ebx destroyed
2513
  * ebx destroyed
2466
Remarks:
2514
Remarks:
2467
  * The current implementation does not close automatically all
2515
  * The current implementation does not close automatically all
2468
    sockets of a thread at termination. In particular, one should not
2516
    sockets of a thread at termination. In particular, one should not
2469
    kill a thread with many opened sockets - there will be an outflow
2517
    kill a thread with many opened sockets - there will be an outflow
2470
    of resources.
2518
    of resources.
2471
  * The current implementation does no checks on correctness
2519
  * The current implementation does no checks on correctness
2472
    (function returns error only if thread tries to close not opened
2520
    (function returns error only if thread tries to close not opened
2473
    socket with correct handle).
2521
    socket with correct handle).
2474
 
2522
 
2475
======================================================================
2523
======================================================================
2476
============== Function 53, subfunction 2 - poll socket. =============
2524
============== Function 53, subfunction 2 - poll socket. =============
2477
======================================================================
2525
======================================================================
2478
Parameters:
2526
Parameters:
2479
  * eax = 53 - function number
2527
  * eax = 53 - function number
2480
  * ebx = 2 - subfunction number
2528
  * ebx = 2 - subfunction number
2481
  * ecx = socket handle
2529
  * ecx = socket handle
2482
Returned value:
2530
Returned value:
2483
  * eax = number of read bytes
2531
  * eax = number of read bytes
2484
  * ebx destroyed
2532
  * ebx destroyed
2485
Remarks:
2533
Remarks:
2486
  * There is no checks for correctness.
2534
  * There is no checks for correctness.
2487
 
2535
 
2488
======================================================================
2536
======================================================================
2489
========= Function 53, subfunction 3 - read byte from socket. ========
2537
========= Function 53, subfunction 3 - read byte from socket. ========
2490
======================================================================
2538
======================================================================
2491
Parameters:
2539
Parameters:
2492
  * eax = 53 - function number
2540
  * eax = 53 - function number
2493
  * ebx = 3 - subfunction number
2541
  * ebx = 3 - subfunction number
2494
  * ecx = socket handle
2542
  * ecx = socket handle
2495
Returned value:
2543
Returned value:
2496
  * if there is no read data: eax=0, bl=0,
2544
  * if there is no read data: eax=0, bl=0,
2497
    other bytes of ebx are destroyed
2545
    other bytes of ebx are destroyed
2498
  * if there are read data: eax=number of rest bytes
2546
  * if there are read data: eax=number of rest bytes
2499
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2547
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2500
Remarks:
2548
Remarks:
2501
  * There is no checks for correctness.
2549
  * There is no checks for correctness.
2502
 
2550
 
2503
======================================================================
2551
======================================================================
2504
========== Function 53, subfunction 4 - write to UDP-socket. =========
2552
========== Function 53, subfunction 4 - write to UDP-socket. =========
2505
======================================================================
2553
======================================================================
2506
Parameters:
2554
Parameters:
2507
  * eax = 53 - function number
2555
  * eax = 53 - function number
2508
  * ebx = 4 - subfunction number
2556
  * ebx = 4 - subfunction number
2509
  * ecx = socket handle
2557
  * ecx = socket handle
2510
  * edx = number of bytes to write
2558
  * edx = number of bytes to write
2511
  * esi = pointer to data to write
2559
  * esi = pointer to data to write
2512
Returned value:
2560
Returned value:
2513
  * eax = 0xffffffff - invalid handle
2561
  * eax = 0xffffffff - invalid handle
2514
  * eax = 0xffff - not enough memory
2562
  * eax = 0xffff - not enough memory
2515
  * eax = 0 - success
2563
  * eax = 0 - success
2516
  * ebx destroyed
2564
  * ebx destroyed
2517
Remarks:
2565
Remarks:
2518
  * Check on validity of handle is minimal - only not very incorrect
2566
  * Check on validity of handle is minimal - only not very incorrect
2519
    not opened handles are eliminated.
2567
    not opened handles are eliminated.
2520
  * Number of bytes to write must not exceed 1500-28, though
2568
  * Number of bytes to write must not exceed 1500-28, though
2521
    the appropriate check is not made.
2569
    the appropriate check is not made.
2522
 
2570
 
2523
======================================================================
2571
======================================================================
2524
============ Function 53, subfunction 5 - open TCP-socket. ===========
2572
============ Function 53, subfunction 5 - open TCP-socket. ===========
2525
======================================================================
2573
======================================================================
2526
Parameters:
2574
Parameters:
2527
  * eax = 53 - function number
2575
  * eax = 53 - function number
2528
  * ebx = 5 - subfunction number
2576
  * ebx = 5 - subfunction number
2529
  * ecx = local port (only low word is taken into account)
2577
  * ecx = local port (only low word is taken into account)
2530
  * edx = remote port (only low word is taken into account)
2578
  * edx = remote port (only low word is taken into account)
2531
  * esi = remote IP
2579
  * esi = remote IP
2532
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2580
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2533
Returned value:
2581
Returned value:
2534
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2582
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2535
  * eax = socket handle (some number which unambiguously identifies
2583
  * eax = socket handle (some number which unambiguously identifies
2536
    socket and have sense only for the system) - success;
2584
    socket and have sense only for the system) - success;
2537
    ebx destroyed
2585
    ebx destroyed
2538
 
2586
 
2539
======================================================================
2587
======================================================================
2540
========= Function 53, subfunction 6 - get TCP-socket status. ========
2588
========= Function 53, subfunction 6 - get TCP-socket status. ========
2541
======================================================================
2589
======================================================================
2542
Parameters:
2590
Parameters:
2543
  * eax = 53 - function number
2591
  * eax = 53 - function number
2544
  * ebx = 6 - subfunction number
2592
  * ebx = 6 - subfunction number
2545
  * ecx = socket handle
2593
  * ecx = socket handle
2546
Returned value:
2594
Returned value:
2547
  * eax = socket status: one of
2595
  * eax = socket status: one of
2548
  * TCB_LISTEN = 1
2596
  * TCB_LISTEN = 1
2549
  * TCB_SYN_SENT = 2
2597
  * TCB_SYN_SENT = 2
2550
  * TCB_SYN_RECEIVED = 3
2598
  * TCB_SYN_RECEIVED = 3
2551
  * TCB_ESTABLISHED = 4
2599
  * TCB_ESTABLISHED = 4
2552
  * TCB_FIN_WAIT_1 = 5
2600
  * TCB_FIN_WAIT_1 = 5
2553
  * TCB_FIN_WAIT_2 = 6
2601
  * TCB_FIN_WAIT_2 = 6
2554
  * TCB_CLOSE_WAIT = 7
2602
  * TCB_CLOSE_WAIT = 7
2555
  * TCB_CLOSING = 8
2603
  * TCB_CLOSING = 8
2556
  * TCB_LAST_ASK = 9
2604
  * TCB_LAST_ASK = 9
2557
  * TCB_TIME_WAIT = 10
2605
  * TCB_TIME_WAIT = 10
2558
  * TCB_CLOSED = 11
2606
  * TCB_CLOSED = 11
2559
  * ebx destroys
2607
  * ebx destroys
2560
Remarks:
2608
Remarks:
2561
  * There is no checks for correctness.
2609
  * There is no checks for correctness.
2562
 
2610
 
2563
======================================================================
2611
======================================================================
2564
========== Function 53, subfunction 7 - write to TCP-socket. =========
2612
========== Function 53, subfunction 7 - write to TCP-socket. =========
2565
======================================================================
2613
======================================================================
2566
Parameters:
2614
Parameters:
2567
  * eax = 53 - function number
2615
  * eax = 53 - function number
2568
  * ebx = 7 - subfunction number
2616
  * ebx = 7 - subfunction number
2569
  * ecx = socket handle
2617
  * ecx = socket handle
2570
  * edx = number of bytes to write
2618
  * edx = number of bytes to write
2571
  * esi = pointer to data to write
2619
  * esi = pointer to data to write
2572
Returned value:
2620
Returned value:
2573
  * eax = 0xffffffff - error
2621
  * eax = 0xffffffff - error
2574
  * eax = 0xffff - not enough memory
2622
  * eax = 0xffff - not enough memory
2575
  * eax = 0 - success
2623
  * eax = 0 - success
2576
  * ebx destroyed
2624
  * ebx destroyed
2577
Remarks:
2625
Remarks:
2578
  * Check on validity of handle is minimal - only not very incorrect
2626
  * Check on validity of handle is minimal - only not very incorrect
2579
    not opened handles are eliminated.
2627
    not opened handles are eliminated.
2580
  * Number of bytes to write must not exceed 1500-40, though
2628
  * Number of bytes to write must not exceed 1500-40, though
2581
    the appropriate check is not made.
2629
    the appropriate check is not made.
2582
 
2630
 
2583
======================================================================
2631
======================================================================
2584
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2632
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2585
======================================================================
2633
======================================================================
2586
Parameters:
2634
Parameters:
2587
  * eax = 53 - function number
2635
  * eax = 53 - function number
2588
  * ebx = 8 - subfunction number
2636
  * ebx = 8 - subfunction number
2589
  * ecx = socket handle
2637
  * ecx = socket handle
2590
Returned value:
2638
Returned value:
2591
  * eax = -1 - invalid handle
2639
  * eax = -1 - invalid handle
2592
  * eax = 0xffff - not enough memory for socket close packet
2640
  * eax = 0xffff - not enough memory for socket close packet
2593
  * eax = 0 - success
2641
  * eax = 0 - success
2594
  * in many cases eax is destroyed (the result of function 'queue'
2642
  * in many cases eax is destroyed (the result of function 'queue'
2595
    is returned) - probably this is bug, which will be corrected
2643
    is returned) - probably this is bug, which will be corrected
2596
  * ebx destroyed
2644
  * ebx destroyed
2597
Remarks:
2645
Remarks:
2598
  * The current implementation does not close automatically all
2646
  * The current implementation does not close automatically all
2599
    sockets of a thread at termination. In particular, one should not
2647
    sockets of a thread at termination. In particular, one should not
2600
    kill a thread with many opened sockets - there will be an outflow
2648
    kill a thread with many opened sockets - there will be an outflow
2601
    of resources.
2649
    of resources.
2602
  * The current implementation does no checks on correctness
2650
  * The current implementation does no checks on correctness
2603
    (function returns error only if thread tries to close not opened
2651
    (function returns error only if thread tries to close not opened
2604
    socket with correct handle).
2652
    socket with correct handle).
2605
 
2653
 
2606
======================================================================
2654
======================================================================
2607
=== Function 53, subfunction 9 - check whether local port is free. ===
2655
=== Function 53, subfunction 9 - check whether local port is free. ===
2608
======================================================================
2656
======================================================================
2609
Parameters:
2657
Parameters:
2610
  * eax = 53 - function number
2658
  * eax = 53 - function number
2611
  * ebx = 9 - subfunction number
2659
  * ebx = 9 - subfunction number
2612
  * ecx = local port number (low 16 bits are used only)
2660
  * ecx = local port number (low 16 bits are used only)
2613
Returned value:
2661
Returned value:
2614
  * eax = 0 - port is used
2662
  * eax = 0 - port is used
2615
  * eax = 1 - port is free
2663
  * eax = 1 - port is free
2616
  * ebx destroyed
2664
  * ebx destroyed
2617
 
2665
 
2618
======================================================================
2666
======================================================================
2619
= Function 53, subfunction 255 - debug information of network driver. 
2667
= Function 53, subfunction 255 - debug information of network driver. 
2620
======================================================================
2668
======================================================================
2621
Parameters:
2669
Parameters:
2622
  * eax = 53 - function number
2670
  * eax = 53 - function number
2623
  * ebx = 255 - subfunction number
2671
  * ebx = 255 - subfunction number
2624
  * ecx = type of requested information (see below)
2672
  * ecx = type of requested information (see below)
2625
Returned value:
2673
Returned value:
2626
  * eax = requested information
2674
  * eax = requested information
2627
  * ebx destroyed
2675
  * ebx destroyed
2628
Possible values for ecx:
2676
Possible values for ecx:
2629
  * 100: length of queue 0 (empty queue)
2677
  * 100: length of queue 0 (empty queue)
2630
  * 101: length of queue 1 (ip-out queue)
2678
  * 101: length of queue 1 (ip-out queue)
2631
  * 102: length of queue 2 (ip-in queue)
2679
  * 102: length of queue 2 (ip-in queue)
2632
  * 103: length of queue 3 (net1out queue)
2680
  * 103: length of queue 3 (net1out queue)
2633
  * 200: number of items in the ARP table
2681
  * 200: number of items in the ARP table
2634
  * 201: size of the ARP table (in items) (20 for current version)
2682
  * 201: size of the ARP table (in items) (20 for current version)
2635
  * 202: read item at edx of the ARP table to the temporary buffer,
2683
  * 202: read item at edx of the ARP table to the temporary buffer,
2636
    whence 5 following types take information;
2684
    whence 5 following types take information;
2637
    in this case eax is not defined
2685
    in this case eax is not defined
2638
  * 203: IP-address saved by type 202
2686
  * 203: IP-address saved by type 202
2639
  * 204: high dword of MAC-address saved by type 202
2687
  * 204: high dword of MAC-address saved by type 202
2640
  * 205: low word of MAC-address saved by type 202
2688
  * 205: low word of MAC-address saved by type 202
2641
  * 206: status word saved by type 202
2689
  * 206: status word saved by type 202
2642
  * 207: ttl word saved by type 202
2690
  * 207: ttl word saved by type 202
2643
  * 2: total number of received IP-packets
2691
  * 2: total number of received IP-packets
2644
  * 3: total number of transferred IP-packets
2692
  * 3: total number of transferred IP-packets
2645
  * 4: total number of dumped received packets
2693
  * 4: total number of dumped received packets
2646
  * 5: total number of received ARP-packets
2694
  * 5: total number of received ARP-packets
2647
  * 6: status of packet driver, 0=inactive, nonzero=active
2695
  * 6: status of packet driver, 0=inactive, nonzero=active
2648
 
2696
 
2649
======================================================================
2697
======================================================================
2650
========== Function 55, subfunction 0 - load data for SB16. ==========
2698
========== Function 55, subfunction 0 - load data for SB16. ==========
2651
======================================================================
2699
======================================================================
2652
Parameters:
2700
Parameters:
2653
  * eax = 55 - function number
2701
  * eax = 55 - function number
2654
  * ebx = 0 - subfunction number
2702
  * ebx = 0 - subfunction number
2655
  * ecx = pointer to data (is copied 64 kilobytes, is used as much as
2703
  * ecx = pointer to data (is copied 64 kilobytes, is used as much as
2656
    set by subfunction 2)
2704
    set by subfunction 2)
2657
Returned value:
2705
Returned value:
2658
  * function does not return value
2706
  * function does not return value
2659
Remarks:
2707
Remarks:
2660
  * Format and size of data are set by subfunction 2.
2708
  * Format and size of data are set by subfunction 2.
2661
 
2709
 
2662
======================================================================
2710
======================================================================
2663
======== Function 55, subfunction 1 - begin play data on SB16. =======
2711
======== Function 55, subfunction 1 - begin play data on SB16. =======
2664
======================================================================
2712
======================================================================
2665
Parameters:
2713
Parameters:
2666
  * eax = 55 - function number
2714
  * eax = 55 - function number
2667
  * ebx = 1 - subfunction number
2715
  * ebx = 1 - subfunction number
2668
Returned value:
2716
Returned value:
2669
  * function does not return value
2717
  * function does not return value
2670
Remarks:
2718
Remarks:
2671
  * Previously data must be loaded by subfunction 0 and
2719
  * Previously data must be loaded by subfunction 0 and
2672
    their format must be defined by subfunction 2.
2720
    their format must be defined by subfunction 2.
2673
  * Function returns control, when playing of data began; after that
2721
  * Function returns control, when playing of data began; after that
2674
    play goes independently from application (and does not use
2722
    play goes independently from application (and does not use
2675
    processor time at all).
2723
    processor time at all).
2676
  * Previously must be defined SB16 base port
2724
  * Previously must be defined SB16 base port
2677
    (by subfunction 4 of function 21) and DMA channel
2725
    (by subfunction 4 of function 21) and DMA channel
2678
    (by subfunction 10 of function 21).
2726
    (by subfunction 10 of function 21).
2679
 
2727
 
2680
======================================================================
2728
======================================================================
2681
======== Function 55, subfunction 2 - set format of SB16 data. =======
2729
======== Function 55, subfunction 2 - set format of SB16 data. =======
2682
======================================================================
2730
======================================================================
2683
Parameters:
2731
Parameters:
2684
  * eax = 55 - function number
2732
  * eax = 55 - function number
2685
  * ebx = 2 - subfunction number
2733
  * ebx = 2 - subfunction number
2686
  * ecx = 0 - set digit capacity
2734
  * ecx = 0 - set digit capacity
2687
    * edx = 1 - 8bit mono
2735
    * edx = 1 - 8bit mono
2688
    * edx = 2 - 8bit stereo
2736
    * edx = 2 - 8bit stereo
2689
  * ecx = 1 - set data size
2737
  * ecx = 1 - set data size
2690
    * edx = size in bytes
2738
    * edx = size in bytes
2691
  * ecx = 2 - set play frequency
2739
  * ecx = 2 - set play frequency
2692
    * edx = frequency
2740
    * edx = frequency
2693
Returned value:
2741
Returned value:
2694
  * function does not return value
2742
  * function does not return value
2695
Remarks:
2743
Remarks:
2696
  * When the system boots, it sets following default parameters:
2744
  * When the system boots, it sets following default parameters:
2697
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
2745
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
2698
    Nevertheless it is recommended to set necessary values obviously
2746
    Nevertheless it is recommended to set necessary values obviously
2699
    as they could be reset by some application.
2747
    as they could be reset by some application.
2700
 
2748
 
2701
======================================================================
2749
======================================================================
2702
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2750
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2703
======================================================================
2751
======================================================================
2704
Parameters:
2752
Parameters:
2705
  * eax = 55 - function number
2753
  * eax = 55 - function number
2706
  * ebx = 55 - subfunction number
2754
  * ebx = 55 - subfunction number
2707
  * esi = pointer to data
2755
  * esi = pointer to data
2708
Returned value:
2756
Returned value:
2709
  * eax = 0 - success
2757
  * eax = 0 - success
2710
  * eax = 55 - error (speaker is off or busy)
2758
  * eax = 55 - error (speaker is off or busy)
2711
Data is an array of items with variable length.
2759
Data is an array of items with variable length.
2712
Format of each item is defined by first byte:
2760
Format of each item is defined by first byte:
2713
  * 0 = end of data
2761
  * 0 = end of data
2714
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2762
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2715
    is defined by immediate value of frequency
2763
    is defined by immediate value of frequency
2716
    * following word (2 bytes) contains frequency divider;
2764
    * following word (2 bytes) contains frequency divider;
2717
      frequency is defined as 1193180/divider
2765
      frequency is defined as 1193180/divider
2718
  * 0x81 = invalid
2766
  * 0x81 = invalid
2719
  * 0x82..0xFF = note is defined by octave and number:
2767
  * 0x82..0xFF = note is defined by octave and number:
2720
    * duration in 1/100 of second = (first byte)-0x81
2768
    * duration in 1/100 of second = (first byte)-0x81
2721
    * there is one more byte;
2769
    * there is one more byte;
2722
    * (second byte)=0xFF - delay
2770
    * (second byte)=0xFF - delay
2723
    * otherwise it looks like a*0x10+b, where b=number of the note in
2771
    * otherwise it looks like a*0x10+b, where b=number of the note in
2724
      an octave from 1 to 12, a=number of octave (beginning from 0)
2772
      an octave from 1 to 12, a=number of octave (beginning from 0)
2725
Remarks:
2773
Remarks:
2726
  * Speaker play can be disabled/enabled by
2774
  * Speaker play can be disabled/enabled by
2727
    subfunction 8 of function 18.
2775
    subfunction 8 of function 18.
2728
  * Function returns control, having informed the system
2776
  * Function returns control, having informed the system
2729
    an information on request. Play itself goes independently from
2777
    an information on request. Play itself goes independently from
2730
    the program.
2778
    the program.
2731
  * The data must be kept in the memory at least up to the end
2779
  * The data must be kept in the memory at least up to the end
2732
    of play.
2780
    of play.
2733
 
2781
 
2734
======================================================================
2782
======================================================================
2735
=============== Function 56 - write file to hard disk. ===============
2783
=============== Function 56 - write file to hard disk. ===============
2736
======================================================================
2784
======================================================================
2737
Parameters:
2785
Parameters:
2738
  * eax = 56 - function number
2786
  * eax = 56 - function number
2739
  * ebx = pointer to the file name
2787
  * ebx = pointer to the file name
2740
  * ecx = size of data to write (in bytes)
2788
  * ecx = size of data to write (in bytes)
2741
  * edx = pointer to data to write
2789
  * edx = pointer to data to write
2742
  * esi = pointer to path (ASCIIZ-string)
2790
  * esi = pointer to path (ASCIIZ-string)
2743
Returned value:
2791
Returned value:
2744
  * eax = 0 - success, otherwise file system error code
2792
  * eax = 0 - success, otherwise file system error code
2745
Remarks:
2793
Remarks:
2746
  * This function is obsolete; function 70 allows to fulfil the same
2794
  * This function is obsolete; function 70 allows to fulfil the same
2747
    operations with the extended possibilities.
2795
    operations with the extended possibilities.
2748
  * This function assumes that during its call by one application
2796
  * This function assumes that during its call by one application
2749
    no other application works with hard disk.
2797
    no other application works with hard disk.
2750
  * The path to file is ASCIIZ-string, which may be empty
2798
  * The path to file is ASCIIZ-string, which may be empty
2751
    (if the file is created in the root folder) or have the format
2799
    (if the file is created in the root folder) or have the format
2752
    /d1/d2/.../dn, where all folder names must have the 8+3 format,
2800
    /d1/d2/.../dn, where all folder names must have the 8+3 format,
2753
    i.e. 8 characters of name and 3 characters of the extension
2801
    i.e. 8 characters of name and 3 characters of the extension
2754
    without separator, supplemented by blanks if necessary;
2802
    without separator, supplemented by blanks if necessary;
2755
    all letters must be capital.
2803
    all letters must be capital.
2756
  * The file name must also have the format 8+3.
2804
  * The file name must also have the format 8+3.
2757
 
2805
 
2758
======================================================================
2806
======================================================================
2759
================ Function 58 - work with file system. ================
2807
================ Function 58 - work with file system. ================
2760
======================================================================
2808
======================================================================
2761
Parameters:
2809
Parameters:
2762
  * eax = 58
2810
  * eax = 58
2763
  * ebx = pointer to the information structure
2811
  * ebx = pointer to the information structure
2764
Returned value:
2812
Returned value:
2765
  * eax = 0 - success; otherwise file system error code
2813
  * eax = 0 - success; otherwise file system error code
2766
  * some subfunctions return value in other registers too
2814
  * some subfunctions return value in other registers too
2767
General format of the information structure:
2815
General format of the information structure:
2768
  * +0: dword: subfunction number
2816
  * +0: dword: subfunction number
2769
  * +4: dword: number of block
2817
  * +4: dword: number of block
2770
  * +8: dword: size
2818
  * +8: dword: size
2771
  * +12 = +0xC: dword: pointer to data
2819
  * +12 = +0xC: dword: pointer to data
2772
  * +16 = +0x10: dword: pointer to a memory for system operations
2820
  * +16 = +0x10: dword: pointer to a memory for system operations
2773
    (4096 bytes)
2821
    (4096 bytes)
2774
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2822
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2775
Specifications - in documentation on the appropriate subfunction.
2823
Specifications - in documentation on the appropriate subfunction.
2776
Filename is case-insensitive for latin letters, russian letters
2824
Filename is case-insensitive for latin letters, russian letters
2777
must be capital.
2825
must be capital.
2778
Format of filename:
2826
Format of filename:
2779
/base/number/dir1/dir2/.../dirn/file,
2827
/base/number/dir1/dir2/.../dirn/file,
2780
where /base/number identifies device, on which file is located:
2828
where /base/number identifies device, on which file is located:
2781
one of
2829
one of
2782
  * /RD/1 = /RAMDISK/1 to access ramdisk
2830
  * /RD/1 = /RAMDISK/1 to access ramdisk
2783
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2831
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2784
    /FD/2 = /FLOPPYDISK/2 to access second one
2832
    /FD/2 = /FLOPPYDISK/2 to access second one
2785
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2833
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2786
    (in this case base is defined by subfunction 7 of function 21),
2834
    (in this case base is defined by subfunction 7 of function 21),
2787
    x - partition number (beginning from 1)
2835
    x - partition number (beginning from 1)
2788
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2836
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2789
    IDE0 (Primary Master), IDE1 (Primary Slave),
2837
    IDE0 (Primary Master), IDE1 (Primary Slave),
2790
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2838
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2791
    x - partition number on the selected hard drive, varies from 1
2839
    x - partition number on the selected hard drive, varies from 1
2792
    to 255 (on each hard drive the indexing starts from 1)
2840
    to 255 (on each hard drive the indexing starts from 1)
2793
Remarks:
2841
Remarks:
2794
  * In the first two cases it is also possible to use FIRST
2842
  * In the first two cases it is also possible to use FIRST
2795
    instead of 1, SECOND instead of 2, but it is not recommended
2843
    instead of 1, SECOND instead of 2, but it is not recommended
2796
    for convenience of transition to the future extensions.
2844
    for convenience of transition to the future extensions.
2797
  * Limitation n<=39 is imposed.
2845
  * Limitation n<=39 is imposed.
2798
  * Names of folders and file dir1,...,dirn,file must have the
2846
  * Names of folders and file dir1,...,dirn,file must have the
2799
    format 8.3: name no more than 8 characters, dot, extension no
2847
    format 8.3: name no more than 8 characters, dot, extension no
2800
    more than 3 characters. Trailing spaces are ignored, no other
2848
    more than 3 characters. Trailing spaces are ignored, no other
2801
    spaces is allowed. If name occupies equally 8 characters,
2849
    spaces is allowed. If name occupies equally 8 characters,
2802
    dot may be omitted (though it is not recommended to use this
2850
    dot may be omitted (though it is not recommended to use this
2803
    feature for convenience of transition to the future extensions).
2851
    feature for convenience of transition to the future extensions).
2804
  * This function does not support folders on ramdisk.
2852
  * This function does not support folders on ramdisk.
2805
Examples:
2853
Examples:
2806
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2854
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2807
    '/rd/1/kernel.asm',0
2855
    '/rd/1/kernel.asm',0
2808
  * '/HD0/1/kernel.asm',0
2856
  * '/HD0/1/kernel.asm',0
2809
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2857
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2810
Existing subfunctions:
2858
Existing subfunctions:
2811
  * subfunction 0 - read file/folder
2859
  * subfunction 0 - read file/folder
2812
  * subfunction 1 - rewrite file
2860
  * subfunction 1 - rewrite file
2813
  * subfunction 2 - delete file/folder
2861
  * subfunction 2 - delete file/folder
2814
  * subfunction 3 - write to existing file
2862
  * subfunction 3 - write to existing file
2815
  * subfunction 4 - make folder
2863
  * subfunction 4 - make folder
2816
  * subfunction 5 - rename/move file/folder
2864
  * subfunction 5 - rename/move file/folder
2817
  * subfunction 8 - LBA-read from device
2865
  * subfunction 8 - LBA-read from device
2818
  * subfunction 15 - get file system information
2866
  * subfunction 15 - get file system information
2819
  * subfunction 16 - start application
2867
  * subfunction 16 - start application
2820
 
2868
 
2821
======================================================================
2869
======================================================================
2822
=========== Function 58, subfunction 0 - read file/folder. ===========
2870
=========== Function 58, subfunction 0 - read file/folder. ===========
2823
======================================================================
2871
======================================================================
2824
Parameters:
2872
Parameters:
2825
  * eax = 58
2873
  * eax = 58
2826
  * ebx = pointer to the information structure
2874
  * ebx = pointer to the information structure
2827
Format of the information structure:
2875
Format of the information structure:
2828
  * +0: dword: 0 = subfunction number
2876
  * +0: dword: 0 = subfunction number
2829
  * +4: dword: first block to read (beginning from 0)
2877
  * +4: dword: first block to read (beginning from 0)
2830
  * +8: dword: amount of blocks to read
2878
  * +8: dword: amount of blocks to read
2831
  * +12 = +0xC: dword: pointer to buffer for data
2879
  * +12 = +0xC: dword: pointer to buffer for data
2832
  * +16 = +0x10: dword: pointer to buffer for system operations
2880
  * +16 = +0x10: dword: pointer to buffer for system operations
2833
    (4096 bytes)
2881
    (4096 bytes)
2834
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2882
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2835
    given in the general description
2883
    given in the general description
2836
Returned value:
2884
Returned value:
2837
  * eax = 0 - success, otherwise file system error code
2885
  * eax = 0 - success, otherwise file system error code
2838
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2886
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2839
Remarks:
2887
Remarks:
2840
  * Block size is 512 bytes.
2888
  * Block size is 512 bytes.
2841
  * This function is obsolete, for reading files use subfunction 0
2889
  * This function is obsolete, for reading files use subfunction 0
2842
    of function 70, for reading folders - subfunction 1 of
2890
    of function 70, for reading folders - subfunction 1 of
2843
    function 70.
2891
    function 70.
2844
  * Function can read contents of a folder. Only FAT file system is
2892
  * Function can read contents of a folder. Only FAT file system is
2845
    supported. The format of FAT-folder is described
2893
    supported. The format of FAT-folder is described
2846
    in any FAT documentation.
2894
    in any FAT documentation.
2847
  * Size of a folder is determined by size of FAT clusters chain.
2895
  * Size of a folder is determined by size of FAT clusters chain.
2848
  * If file was ended before last requested block was read,
2896
  * If file was ended before last requested block was read,
2849
    the function will read as many as it can, and after that return
2897
    the function will read as many as it can, and after that return
2850
    eax=6 (EOF).
2898
    eax=6 (EOF).
2851
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2899
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2852
    in the first two cases the current implementation does not follow
2900
    in the first two cases the current implementation does not follow
2853
    to the declared rules:
2901
    to the declared rules:
2854
    for /rd/1:
2902
    for /rd/1:
2855
    * if one want to read 0 blocks, function considers,
2903
    * if one want to read 0 blocks, function considers,
2856
      that he requested 1;
2904
      that he requested 1;
2857
    * if one requests more than 14 blocks or starting block is
2905
    * if one requests more than 14 blocks or starting block is
2858
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2906
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2859
    * size of ramdisk root folder is 14 blocks, 
2907
    * size of ramdisk root folder is 14 blocks, 
2860
      0x1C00=7168 áàéò; but function returns ebx=0
2908
      0x1C00=7168 áàéò; but function returns ebx=0
2861
      (except of the case of previous item);
2909
      (except of the case of previous item);
2862
    * strangely enough, it is possible to read 14th block (which
2910
    * strangely enough, it is possible to read 14th block (which
2863
      generally contains a garbage - I remind, the indexing begins
2911
      generally contains a garbage - I remind, the indexing begins
2864
      from 0);
2912
      from 0);
2865
    * if some block with the number not less than 14 was requested,
2913
    * if some block with the number not less than 14 was requested,
2866
      function returns eax=6(EOF); otherwise eax=0.
2914
      function returns eax=6(EOF); otherwise eax=0.
2867
    For /fd/x:
2915
    For /fd/x:
2868
    * if the start block is not less than 14, function returns
2916
    * if the start block is not less than 14, function returns
2869
      eax=5 (not found) and ebx=0;
2917
      eax=5 (not found) and ebx=0;
2870
    * note that format of FAT12 allows floppies with the root size
2918
    * note that format of FAT12 allows floppies with the root size
2871
      more or less than 14 blocks;
2919
      more or less than 14 blocks;
2872
    * check for length is not performed;
2920
    * check for length is not performed;
2873
    * if data was successful read, function returns
2921
    * if data was successful read, function returns
2874
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2922
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2875
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2923
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2876
    but the result does not correspond to expected (on operations with
2924
    but the result does not correspond to expected (on operations with
2877
    normal files/folders), does not follow the declared rules,
2925
    normal files/folders), does not follow the declared rules,
2878
    may be changed in future versions of the kernel and consequently
2926
    may be changed in future versions of the kernel and consequently
2879
    is not described. To obtain the information about the equipment
2927
    is not described. To obtain the information about the equipment
2880
    use subfunction 11 of function 18 or
2928
    use subfunction 11 of function 18 or
2881
    read corresponding folder with subfunction 1 of function 70.
2929
    read corresponding folder with subfunction 1 of function 70.
2882
 
2930
 
2883
======================================================================
2931
======================================================================
2884
============= Function 58, subfunction 1 - rewrite file. =============
2932
============= Function 58, subfunction 1 - rewrite file. =============
2885
======================================================================
2933
======================================================================
2886
If the file does not exist, it is created.
2934
If the file does not exist, it is created.
2887
If the file exists, it is rewritten.
2935
If the file exists, it is rewritten.
2888
Parameters:
2936
Parameters:
2889
  * eax = 58 - function number
2937
  * eax = 58 - function number
2890
  * ebx = pointer to the information structure
2938
  * ebx = pointer to the information structure
2891
Format of the information structure:
2939
Format of the information structure:
2892
  * +0: dword: 1 = subfunction number
2940
  * +0: dword: 1 = subfunction number
2893
  * +4: dword: ignored (set to 0)
2941
  * +4: dword: ignored (set to 0)
2894
  * +8: dword: number of bytes to write
2942
  * +8: dword: number of bytes to write
2895
  * +12 = +0xC: dword: pointer to data to write
2943
  * +12 = +0xC: dword: pointer to data to write
2896
  * +16 = +0x10: dword: pointer to buffer for system operations
2944
  * +16 = +0x10: dword: pointer to buffer for system operations
2897
    (4096 bytes)
2945
    (4096 bytes)
2898
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2946
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2899
    given in the general description
2947
    given in the general description
2900
Returned value:
2948
Returned value:
2901
  * eax = 0 - success, otherwise file system error code
2949
  * eax = 0 - success, otherwise file system error code
2902
  * ebx destroyed
2950
  * ebx destroyed
2903
Remarks:
2951
Remarks:
2904
  * This function is obsolete, use subfunction 2 of function 70.
2952
  * This function is obsolete, use subfunction 2 of function 70.
2905
 
2953
 
2906
======================================================================
2954
======================================================================
2907
========== Function 58, subfunction 2 - delete file/folder. ==========
2955
========== Function 58, subfunction 2 - delete file/folder. ==========
2908
======================================================================
2956
======================================================================
2909
Parameters:
2957
Parameters:
2910
  * eax = 58 - function number
2958
  * eax = 58 - function number
2911
  * ebx = pointer to the information structure
2959
  * ebx = pointer to the information structure
2912
Format of the information structure:
2960
Format of the information structure:
2913
  * +0: dword: 2 = subfunction number
2961
  * +0: dword: 2 = subfunction number
2914
  * +4: dword: ignored
2962
  * +4: dword: ignored
2915
  * +8: dword: ignored
2963
  * +8: dword: ignored
2916
  * +12 = +0xC: dword: ignored
2964
  * +12 = +0xC: dword: ignored
2917
  * +16 = +0x10: dword: pointer to buffer for system operations
2965
  * +16 = +0x10: dword: pointer to buffer for system operations
2918
    (4096 bytes)
2966
    (4096 bytes)
2919
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2967
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2920
    given in the general description
2968
    given in the general description
2921
Returned value:
2969
Returned value:
2922
  * eax = 0 - success, otherwise file system error code
2970
  * eax = 0 - success, otherwise file system error code
2923
  * ebx destroyed
2971
  * ebx destroyed
2924
Remarks:
2972
Remarks:
2925
  * By operations with a floppy one should not delete not empty
2973
  * By operations with a floppy one should not delete not empty
2926
    folder. The code working with hard disk deletes not empty folders
2974
    folder. The code working with hard disk deletes not empty folders
2927
    correctly (i.e. recursively with all files and nested folders).
2975
    correctly (i.e. recursively with all files and nested folders).
2928
    Function 58 does not support folders on ramdisk.
2976
    Function 58 does not support folders on ramdisk.
2929
 
2977
 
2930
======================================================================
2978
======================================================================
2931
==== Function 58, subfunction 3 - write data to the existing file. ===
2979
==== Function 58, subfunction 3 - write data to the existing file. ===
2932
======================================================================
2980
======================================================================
2933
Parameters:
2981
Parameters:
2934
  * eax = 58 - function number
2982
  * eax = 58 - function number
2935
  * ebx = pointer to the information structure
2983
  * ebx = pointer to the information structure
2936
Format of the information structure:
2984
Format of the information structure:
2937
  * +0: dword: 3 = subfunction number
2985
  * +0: dword: 3 = subfunction number
2938
  * +4: dword: starting position in the file; -1 = append to the end
2986
  * +4: dword: starting position in the file; -1 = append to the end
2939
  * +8: dword: number of bytes to write
2987
  * +8: dword: number of bytes to write
2940
  * +12 = +0xC: dword: pointer to data to write
2988
  * +12 = +0xC: dword: pointer to data to write
2941
  * +16 = +0x10: dword: pointer to buffer for system operations
2989
  * +16 = +0x10: dword: pointer to buffer for system operations
2942
    (4096 bytes)
2990
    (4096 bytes)
2943
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2991
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2944
    given in the general description
2992
    given in the general description
2945
Returned value:
2993
Returned value:
2946
  * eax = 0 - success, otherwise file system error code
2994
  * eax = 0 - success, otherwise file system error code
2947
  * ebx destroyed
2995
  * ebx destroyed
2948
Remarks:
2996
Remarks:
2949
  * Ramdisk and floppies do not support this function, it is only
2997
  * Ramdisk and floppies do not support this function, it is only
2950
    for hard disks.
2998
    for hard disks.
2951
  * File must already exist (otherwise function returns 5, not found).
2999
  * File must already exist (otherwise function returns 5, not found).
2952
    To create files use subfunction 1.
3000
    To create files use subfunction 1.
2953
  * If the starting position is greater than file size, the function
3001
  * If the starting position is greater than file size, the function
2954
    returns eax=6(EOF). If the end position is greater than file size,
3002
    returns eax=6(EOF). If the end position is greater than file size,
2955
    file is extended.
3003
    file is extended.
2956
  * The code of write processing for hard disk interpretes zero
3004
  * The code of write processing for hard disk interpretes zero
2957
    value of the field +8 as the instruction to truncate the file to
3005
    value of the field +8 as the instruction to truncate the file to
2958
    the size, given in the field +4. However the code of processing
3006
    the size, given in the field +4. However the code of processing
2959
    58th function blocks this possibility for applications by
3007
    58th function blocks this possibility for applications by
2960
    immediate return (with eax=0) in the case of zero size.
3008
    immediate return (with eax=0) in the case of zero size.
2961
 
3009
 
2962
======================================================================
3010
======================================================================
2963
============== Function 58, subfunction 4 - make folder. =============
3011
============== Function 58, subfunction 4 - make folder. =============
2964
======================================================================
3012
======================================================================
2965
Parameters:
3013
Parameters:
2966
  * eax = 58 - function number
3014
  * eax = 58 - function number
2967
  * ebx = pointer to the information structure
3015
  * ebx = pointer to the information structure
2968
Format of the information structure:
3016
Format of the information structure:
2969
  * +0: dword: 4 = subfunction number
3017
  * +0: dword: 4 = subfunction number
2970
  * +4: dword: ignored
3018
  * +4: dword: ignored
2971
  * +8: dword: ignored
3019
  * +8: dword: ignored
2972
  * +12 = +0xC: dword: ignored
3020
  * +12 = +0xC: dword: ignored
2973
  * +16 = +0x10: dword: pointer to buffer for system operations
3021
  * +16 = +0x10: dword: pointer to buffer for system operations
2974
    (4096 bytes)
3022
    (4096 bytes)
2975
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3023
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2976
    given in the general description
3024
    given in the general description
2977
Returned value:
3025
Returned value:
2978
  * eax = 0 - success, otherwise file system error code
3026
  * eax = 0 - success, otherwise file system error code
2979
  * ebx destroyed
3027
  * ebx destroyed
2980
Remarks:
3028
Remarks:
2981
  * Ramdisk and floppies do not support this function, it is only
3029
  * Ramdisk and floppies do not support this function, it is only
2982
    for hard disks.
3030
    for hard disks.
2983
 
3031
 
2984
======================================================================
3032
======================================================================
2985
======== Function 58, subfunction 5 - rename/move file/folder. =======
3033
======== Function 58, subfunction 5 - rename/move file/folder. =======
2986
======================================================================
3034
======================================================================
2987
Parameters:
3035
Parameters:
2988
  * eax = 58 - function number
3036
  * eax = 58 - function number
2989
  * ebx = pointer to the information structure
3037
  * ebx = pointer to the information structure
2990
Format of the information structure:
3038
Format of the information structure:
2991
  * +0: dword: 5 = subfunction number
3039
  * +0: dword: 5 = subfunction number
2992
  * +4: dword: ignored
3040
  * +4: dword: ignored
2993
  * +8: dword: ignored
3041
  * +8: dword: ignored
2994
  * +12 = +0xC: dword: ignored
3042
  * +12 = +0xC: dword: ignored
2995
  * +16 = +0x10: dword: pointer to buffer for system operations
3043
  * +16 = +0x10: dword: pointer to buffer for system operations
2996
    (4096 bytes)
3044
    (4096 bytes)
2997
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3045
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2998
    given in the general description
3046
    given in the general description
2999
  * +20+n: (at once after terminating null character) new
3047
  * +20+n: (at once after terminating null character) new
3000
    ASCIIZ-name, must start from /hd/1, that is interpreted as
3048
    ASCIIZ-name, must start from /hd/1, that is interpreted as
3001
    the hard disk, indicated in the first name
3049
    the hard disk, indicated in the first name
3002
    (moving from one disk to another is not supported)
3050
    (moving from one disk to another is not supported)
3003
Returned value:
3051
Returned value:
3004
  * eax = 0 - success, otherwise file system error code
3052
  * eax = 0 - success, otherwise file system error code
3005
  * ebx destroyed
3053
  * ebx destroyed
3006
Remarks:
3054
Remarks:
3007
  * Ramdisk and floppies do not support this function, it is only
3055
  * Ramdisk and floppies do not support this function, it is only
3008
    for hard disks.
3056
    for hard disks.
3009
  * If the new ASCIIZ-name is strongly incorrect, i.e. does not start
3057
  * If the new ASCIIZ-name is strongly incorrect, i.e. does not start
3010
    from /hd/1, /hd/first, /harddisk/1, /harddisk/first or after this
3058
    from /hd/1, /hd/first, /harddisk/1, /harddisk/first or after this
3011
    space or null character follows, function returns, strangely
3059
    space or null character follows, function returns, strangely
3012
    enough, error code 4. It is the only function which returns
3060
    enough, error code 4. It is the only function which returns
3013
    this code.
3061
    this code.
3014
 
3062
 
3015
======================================================================
3063
======================================================================
3016
========= Function 58, subfunction 8 - LBA-read from device. =========
3064
========= Function 58, subfunction 8 - LBA-read from device. =========
3017
======================================================================
3065
======================================================================
3018
Parameters:
3066
Parameters:
3019
  * eax = 58 - function number
3067
  * eax = 58 - function number
3020
  * ebx = pointer to the information structure
3068
  * ebx = pointer to the information structure
3021
Format of the information structure:
3069
Format of the information structure:
3022
  * +0: dword: 8 = subfunction number
3070
  * +0: dword: 8 = subfunction number
3023
  * +4: dword: number of block to read (beginning from 0)
3071
  * +4: dword: number of block to read (beginning from 0)
3024
  * +8: dword: ignored (set to 1)
3072
  * +8: dword: ignored (set to 1)
3025
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
3073
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
3026
  * +16 = +0x10: dword: pointer to buffer for system operations
3074
  * +16 = +0x10: dword: pointer to buffer for system operations
3027
    (4096 bytes)
3075
    (4096 bytes)
3028
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
3076
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
3029
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
3077
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
3030
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
3078
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
3031
    Instead of digits it is allowed, though not recommended for
3079
    Instead of digits it is allowed, though not recommended for
3032
    convenience of transition to future extensions, to use
3080
    convenience of transition to future extensions, to use
3033
    'first','second','third','fourth'.
3081
    'first','second','third','fourth'.
3034
Returned value:
3082
Returned value:
3035
  * for device name /hd/xxx, where xxx is not in the list above:
3083
  * for device name /hd/xxx, where xxx is not in the list above:
3036
    * eax = ebx = 1
3084
    * eax = ebx = 1
3037
  * for invalid device name (except for the previous case):
3085
  * for invalid device name (except for the previous case):
3038
    * eax = 5
3086
    * eax = 5
3039
    * ebx does not change
3087
    * ebx does not change
3040
  * if LBA-access is disabled by subfunction 11 of function 21:
3088
  * if LBA-access is disabled by subfunction 11 of function 21:
3041
    * eax = 2
3089
    * eax = 2
3042
    * ebx destroyed
3090
    * ebx destroyed
3043
  * for ramdisk: attempt to read block outside ramdisk
3091
  * for ramdisk: attempt to read block outside ramdisk
3044
    (18*2*80 blocks) results in
3092
    (18*2*80 blocks) results in
3045
    * eax = 3
3093
    * eax = 3
3046
    * ebx = 0
3094
    * ebx = 0
3047
  * for successful read:
3095
  * for successful read:
3048
    * eax = ebx = 0
3096
    * eax = ebx = 0
3049
Remarks:
3097
Remarks:
3050
  * Block size is 512 bytes; function reads one block.
3098
  * Block size is 512 bytes; function reads one block.
3051
  * Do not depend on returned value, it can be changed
3099
  * Do not depend on returned value, it can be changed
3052
    in future versions.
3100
    in future versions.
3053
  * Function requires that LBA-access to devices is enabled by 
3101
  * Function requires that LBA-access to devices is enabled by 
3054
    subfunction 11 of function 21. To check this one can use 
3102
    subfunction 11 of function 21. To check this one can use 
3055
    subfunction 11 of function 26.
3103
    subfunction 11 of function 26.
3056
  * LBA-read of floppy is not supported.
3104
  * LBA-read of floppy is not supported.
3057
  * Function reads data on physical hard drive; if for any reason
3105
  * Function reads data on physical hard drive; if for any reason
3058
    data of the concrete partition are required, application must
3106
    data of the concrete partition are required, application must
3059
    define starting sector of this partition (either directly
3107
    define starting sector of this partition (either directly
3060
    through MBR, or from the full structure returned by
3108
    through MBR, or from the full structure returned by
3061
    ïîäôóíêöèåé 11 ôóíêöèè 18).
3109
    ïîäôóíêöèåé 11 ôóíêöèè 18).
3062
  * Function does not check error code of hard disk, so request of
3110
  * Function does not check error code of hard disk, so request of
3063
    nonexisting sector reads something (most probably it will be
3111
    nonexisting sector reads something (most probably it will be
3064
    zeroes, but this is defined by device) and this is considered
3112
    zeroes, but this is defined by device) and this is considered
3065
    as success (eax=0).
3113
    as success (eax=0).
3066
 
3114
 
3067
======================================================================
3115
======================================================================
3068
==== Function 58, subfunction 15 - get information on file system. ===
3116
==== Function 58, subfunction 15 - get information on file system. ===
3069
======================================================================
3117
======================================================================
3070
Parameters:
3118
Parameters:
3071
  * eax = 58 - function number
3119
  * eax = 58 - function number
3072
  * ebx = pointer to the information structure
3120
  * ebx = pointer to the information structure
3073
Format of the information structure:
3121
Format of the information structure:
3074
  * +0: dword: 15 = subfunction number
3122
  * +0: dword: 15 = subfunction number
3075
  * +4: dword: ignored
3123
  * +4: dword: ignored
3076
  * +8: dword: ignored
3124
  * +8: dword: ignored
3077
  * +12 = +0xC: dword: ignored
3125
  * +12 = +0xC: dword: ignored
3078
  * +16 = +0x10: dword: ignored
3126
  * +16 = +0x10: dword: ignored
3079
  * +20 = +0x14: (only second character is checked)
3127
  * +20 = +0x14: (only second character is checked)
3080
    /rd=/RAMDISK or /hd=/HARDDISK
3128
    /rd=/RAMDISK or /hd=/HARDDISK
3081
Returned value:
3129
Returned value:
3082
  * if the second character does not belong to set {'r','R','h','H'}:
3130
  * if the second character does not belong to set {'r','R','h','H'}:
3083
    * eax = 3
3131
    * eax = 3
3084
    * ebx = ecx = dword [fileinfo] = 0
3132
    * ebx = ecx = dword [fileinfo] = 0
3085
  * for ramdisk:
3133
  * for ramdisk:
3086
    * eax = 0 (success)
3134
    * eax = 0 (success)
3087
    * ebx = total number of clusters = 2847
3135
    * ebx = total number of clusters = 2847
3088
    * ecx = number of free clusters
3136
    * ecx = number of free clusters
3089
    * dword [fileinfo] = cluster size = 512
3137
    * dword [fileinfo] = cluster size = 512
3090
  * for hard disk: base and partition are defined by subfunctions
3138
  * for hard disk: base and partition are defined by subfunctions
3091
    7 and 8 of function 21:
3139
    7 and 8 of function 21:
3092
    * eax = 0 (success)
3140
    * eax = 0 (success)
3093
    * ebx = total number of clusters
3141
    * ebx = total number of clusters
3094
    * ecx = number of free clusters
3142
    * ecx = number of free clusters
3095
    * dword [fileinfo] = cluster size (in bytes)
3143
    * dword [fileinfo] = cluster size (in bytes)
3096
Remarks:
3144
Remarks:
3097
  * Be not surprised to strange layout of 4th returned parameter
3145
  * Be not surprised to strange layout of 4th returned parameter
3098
    - when this code was writing, at system calls application got
3146
    - when this code was writing, at system calls application got
3099
    only registers eax,ebx,ecx (from pushad-structure transmitted
3147
    only registers eax,ebx,ecx (from pushad-structure transmitted
3100
    as argument to the system function). Now it is corrected, so,
3148
    as argument to the system function). Now it is corrected, so,
3101
    probably, it is meaningful to return cluster size in edx, while
3149
    probably, it is meaningful to return cluster size in edx, while
3102
    this function is not used yet.
3150
    this function is not used yet.
3103
  * There exists also subfunction 11 of function 18,
3151
  * There exists also subfunction 11 of function 18,
3104
    which returns information on file system. From the full table
3152
    which returns information on file system. From the full table
3105
    of disk subsystem it is possible to deduce cluster size (there
3153
    of disk subsystem it is possible to deduce cluster size (there
3106
    it is stored in sectors) and total number of clusters
3154
    it is stored in sectors) and total number of clusters
3107
    for hard disks.
3155
    for hard disks.
3108
 
3156
 
3109
======================================================================
3157
======================================================================
3110
========== Function 58, subfunction 16 - start application. ==========
3158
========== Function 58, subfunction 16 - start application. ==========
3111
======================================================================
3159
======================================================================
3112
Parameters:
3160
Parameters:
3113
  * eax = 58 - function number
3161
  * eax = 58 - function number
3114
  * ebx = pointer to the information structure
3162
  * ebx = pointer to the information structure
3115
Format of the information structure:
3163
Format of the information structure:
3116
  * +0: dword: 16 = subfunction number
3164
  * +0: dword: 16 = subfunction number
3117
  * +4: dword: flags:
3165
  * +4: dword: flags:
3118
    * bit 0: start the process as debugged
3166
    * bit 0: start the process as debugged
3119
    * other bits are reserved and must be cleared
3167
    * other bits are reserved and must be cleared
3120
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
3168
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
3121
  * +12 = +0xC: dword: ignored
3169
  * +12 = +0xC: dword: ignored
3122
  * +16 = +0x10: dword: pointer to buffer for system operations
3170
  * +16 = +0x10: dword: pointer to buffer for system operations
3123
    (4096 bytes)
3171
    (4096 bytes)
3124
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3172
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3125
    given in the general description
3173
    given in the general description
3126
Returned value:
3174
Returned value:
3127
  * eax > 0 - the program is loaded, eax contains PID
3175
  * eax > 0 - the program is loaded, eax contains PID
3128
  * eax < 0 - an error has occured, -eax contains
3176
  * eax < 0 - an error has occured, -eax contains
3129
    file system error code
3177
    file system error code
3130
Remarks:
3178
Remarks:
3131
  * This function is obsolete, use subfunction 7 of function 70.
3179
  * This function is obsolete, use subfunction 7 of function 70.
3132
  * Command line must be terminated by character with code 0
3180
  * Command line must be terminated by character with code 0
3133
    (ASCIIZ-string); function takes into account either all characters
3181
    (ASCIIZ-string); function takes into account either all characters
3134
    up to terminating null inclusively or the first 256 charachters
3182
    up to terminating null inclusively or the first 256 charachters
3135
    depending on what is less.
3183
    depending on what is less.
3136
  * If the process is started as debugged, it is created in
3184
  * If the process is started as debugged, it is created in
3137
    the suspended state; to run use subfunction 5 of function 69.
3185
    the suspended state; to run use subfunction 5 of function 69.
3138
 
3186
 
3139
======================================================================
3187
======================================================================
3140
=============== Function 59 - trace last system calls. ===============
3188
=============== Function 59 - trace last system calls. ===============
3141
======================================================================
3189
======================================================================
3142
Gets data on all system calls of all processes.
3190
Gets data on all system calls of all processes.
3143
Parameters:
3191
Parameters:
3144
  * eax = 59 - function number
3192
  * eax = 59 - function number
3145
  * ebx = 0 - unique subfunction
3193
  * ebx = 0 - unique subfunction
3146
  * ecx = pointer to the buffer
3194
  * ecx = pointer to the buffer
3147
  * edx = size of the buffer
3195
  * edx = size of the buffer
3148
Returned value:
3196
Returned value:
3149
  * eax = total number of system calls made from system boot
3197
  * eax = total number of system calls made from system boot
3150
    (modulo 2^32)
3198
    (modulo 2^32)
3151
  * ebx = 0
3199
  * ebx = 0
3152
Format of information on one call: (size = 0x40 = 64 bytes)
3200
Format of information on one call: (size = 0x40 = 64 bytes)
3153
  * +0: dword: PID of process/thread
3201
  * +0: dword: PID of process/thread
3154
  * +4: 7*dword: garbage
3202
  * +4: 7*dword: garbage
3155
  * +32 = +0x20: dword: value of edi at the call
3203
  * +32 = +0x20: dword: value of edi at the call
3156
  * +36 = +0x24: dword: esi
3204
  * +36 = +0x24: dword: esi
3157
  * +40 = +0x28: dword: ebp
3205
  * +40 = +0x28: dword: ebp
3158
  * +44 = +0x2C: dword: stack pointer of the kernel handler
3206
  * +44 = +0x2C: dword: stack pointer of the kernel handler
3159
  * +48 = +0x30: dword: ebx
3207
  * +48 = +0x30: dword: ebx
3160
  * +52 = +0x34: dword: edx
3208
  * +52 = +0x34: dword: edx
3161
  * +56 = +0x38: dword: ecx
3209
  * +56 = +0x38: dword: ecx
3162
  * +60 = +0x3C: dword: eax (=number of system function)
3210
  * +60 = +0x3C: dword: eax (=number of system function)
3163
Remarks:
3211
Remarks:
3164
  * The function is used only in the application 'systrace'.
3212
  * The function is used only in the application 'systrace'.
3165
    It is rather difficult to imagine a situation, in which
3213
    It is rather difficult to imagine a situation, in which
3166
    this application or this function are really useful;
3214
    this application or this function are really useful;
3167
    and all system calls for support of this function are a little
3215
    and all system calls for support of this function are a little
3168
    decelerated (though not strongly)...
3216
    decelerated (though not strongly)...
3169
  * So there is a proposition to delete from the kernel
3217
  * So there is a proposition to delete from the kernel
3170
    support of this function, together with application 'systrace'.
3218
    support of this function, together with application 'systrace'.
3171
  * The information on system calls saves in the system
3219
  * The information on system calls saves in the system
3172
    ring buffer with 0x10 entries.
3220
    ring buffer with 0x10 entries.
3173
    This function simply copies the given size of data
3221
    This function simply copies the given size of data
3174
    from this buffer to the given address.
3222
    from this buffer to the given address.
3175
  * One can determine, which entry in the buffer corresponds to
3223
  * One can determine, which entry in the buffer corresponds to
3176
    last system call, by value of eax, namely, it is the entry
3224
    last system call, by value of eax, namely, it is the entry
3177
    (eax and 0xF) (at offset (eax and 0xF)*0x40).
3225
    (eax and 0xF) (at offset (eax and 0xF)*0x40).
3178
  * In the current implementation there can be the seldom
3226
  * In the current implementation there can be the seldom
3179
    meeting problems of unsynchronization, when the information
3227
    meeting problems of unsynchronization, when the information
3180
    on some calls becomes outdated.
3228
    on some calls becomes outdated.
3181
  * Under the system buffer one page, 4Kb, is allocated.
3229
  * Under the system buffer one page, 4Kb, is allocated.
3182
    Size of an entry = 64 bytes. Why only 16 entries are used,
3230
    Size of an entry = 64 bytes. Why only 16 entries are used,
3183
    is not clearly.
3231
    is not clearly.
3184
  * The value of esp at the moment of system call cannot
3232
  * The value of esp at the moment of system call cannot
3185
    be determined by this function.
3233
    be determined by this function.
3186
  * The current implementation does not check edx for correctness.
3234
  * The current implementation does not check edx for correctness.
3187
 
3235
 
3188
======================================================================
3236
======================================================================
3189
========== Function 60 - Inter Process Communication (IPC). ==========
3237
========== Function 60 - Inter Process Communication (IPC). ==========
3190
======================================================================
3238
======================================================================
3191
IPC is used for message dispatching from one process/thread to
3239
IPC is used for message dispatching from one process/thread to
3192
another. Previously it is necessary to agree how to interpret
3240
another. Previously it is necessary to agree how to interpret
3193
the concrete message.
3241
the concrete message.
3194
 
3242
 
3195
----------- Subfunction 1 - set the area for IPC receiving -----------
3243
----------- Subfunction 1 - set the area for IPC receiving -----------
3196
Is called by process-receiver.
3244
Is called by process-receiver.
3197
Parameters:
3245
Parameters:
3198
  * eax = 60 - function number
3246
  * eax = 60 - function number
3199
  * ebx = 1 - subfunction number
3247
  * ebx = 1 - subfunction number
3200
  * ecx = pointer to the buffer
3248
  * ecx = pointer to the buffer
3201
  * edx = size of the buffer
3249
  * edx = size of the buffer
3202
Returned value:
3250
Returned value:
3203
  * eax = 0 - always success
3251
  * eax = 0 - always success
3204
Format of IPC-buffer:
3252
Format of IPC-buffer:
3205
  * +0: dword: if nonzero, buffer is considered locked;
3253
  * +0: dword: if nonzero, buffer is considered locked;
3206
    lock/unlock the buffer, when you work with it and need that
3254
    lock/unlock the buffer, when you work with it and need that
3207
    buffer data are not changed from outside (no new messages)
3255
    buffer data are not changed from outside (no new messages)
3208
  * +4: dword: occupied place in the buffer (in bytes)
3256
  * +4: dword: occupied place in the buffer (in bytes)
3209
  * +8: first message
3257
  * +8: first message
3210
  * +8+n: second message
3258
  * +8+n: second message
3211
  * ...
3259
  * ...
3212
Format of a message:
3260
Format of a message:
3213
  * +0: dword: PID of sender
3261
  * +0: dword: PID of sender
3214
  * +4: dword: message length (not including this header)
3262
  * +4: dword: message length (not including this header)
3215
  * +8: n*byte: message data
3263
  * +8: n*byte: message data
3216
 
3264
 
3217
------------------ Subfunction 2 - send IPC message ------------------
3265
------------------ Subfunction 2 - send IPC message ------------------
3218
Is called by process-sender.
3266
Is called by process-sender.
3219
Parameters:
3267
Parameters:
3220
  * eax = 60 - function number
3268
  * eax = 60 - function number
3221
  * ebx = 2 - subfunction number
3269
  * ebx = 2 - subfunction number
3222
  * ecx = PID of receiver
3270
  * ecx = PID of receiver
3223
  * edx = pointer to the message data
3271
  * edx = pointer to the message data
3224
  * esi = message length (in bytes)
3272
  * esi = message length (in bytes)
3225
Returned value:
3273
Returned value:
3226
  * eax = 0 - success
3274
  * eax = 0 - success
3227
  * eax = 1 - the receiver has not defined buffer for IPC messages
3275
  * eax = 1 - the receiver has not defined buffer for IPC messages
3228
    (can be, still have no time,
3276
    (can be, still have no time,
3229
    and can be, this is not right process)
3277
    and can be, this is not right process)
3230
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3278
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3231
  * eax = 3 - overflow of IPC-buffer of the receiver
3279
  * eax = 3 - overflow of IPC-buffer of the receiver
3232
  * eax = 4 - process/thread with such PID does not exist
3280
  * eax = 4 - process/thread with such PID does not exist
3233
Remarks:
3281
Remarks:
3234
  * Immediately after writing of IPC-message to the buffer the system
3282
  * Immediately after writing of IPC-message to the buffer the system
3235
    sends to the receiver the event with code 7 (see event codes).
3283
    sends to the receiver the event with code 7 (see event codes).
3236
 
3284
 
3237
======================================================================
3285
======================================================================
3238
==== Function 61 - get parameters for the direct graphics access. ====
3286
==== Function 61 - get parameters for the direct graphics access. ====
3239
======================================================================
3287
======================================================================
3240
The data of the graphics screen (the memory area which displays
3288
The data of the graphics screen (the memory area which displays
3241
screen contents) are accessible to a program directly, without
3289
screen contents) are accessible to a program directly, without
3242
any system calls, through the selector gs:
3290
any system calls, through the selector gs:
3243
	mov	eax, [gs:0]
3291
    mov    eax, [gs:0]
3244
places in eax the first dword of the buffer, which contains
3292
places in eax the first dword of the buffer, which contains
3245
information on color of the left upper point (and, possibly, colors
3293
information on color of the left upper point (and, possibly, colors
3246
of several following).
3294
of several following).
3247
	mov	[gs:0], eax
3295
    mov    [gs:0], eax
3248
by work in VESA modes with LFB sets color of the left upper point
3296
by work in VESA modes with LFB sets color of the left upper point
3249
(and, possibly, colors of several following).
3297
(and, possibly, colors of several following).
3250
To interpret the data of graphics screen program needs to know
3298
To interpret the data of graphics screen program needs to know
3251
some parameters, returning by this function.
3299
some parameters, returning by this function.
3252
Remarks:
3300
Remarks:
3253
  * Graphics parameters changes very seldom at work,
3301
  * Graphics parameters changes very seldom at work,
3254
    namely, only in cases, when user works with the application VRR.
3302
    namely, only in cases, when user works with the application VRR.
3255
  * At videomode change the system redraws all windows (event
3303
  * At videomode change the system redraws all windows (event
3256
    with code 1) and redraws the background (event 5).
3304
    with code 1) and redraws the background (event 5).
3257
    Same events occur in other cases too, which meet much more often,
3305
    Same events occur in other cases too, which meet much more often,
3258
    than videomode change.
3306
    than videomode change.
3259
  * By operation in videomodes with LFB the selector gs points to
3307
  * By operation in videomodes with LFB the selector gs points to
3260
    LFB itself, so reading/writing on gs result directly in
3308
    LFB itself, so reading/writing on gs result directly in
3261
    change of screen contents. By operation in videomodes without
3309
    change of screen contents. By operation in videomodes without
3262
    LFB gs points to some data area in the kernel, and all functions
3310
    LFB gs points to some data area in the kernel, and all functions
3263
    of screen output fulfil honesty double operation on writing
3311
    of screen output fulfil honesty double operation on writing
3264
    directly to the screen and writing to this buffer. In result
3312
    directly to the screen and writing to this buffer. In result
3265
    at reading contents of this buffer the results correspond to
3313
    at reading contents of this buffer the results correspond to
3266
    screen contents (with, generally speaking, large color
3314
    screen contents (with, generally speaking, large color
3267
    resolution), and writing is ignored.
3315
    resolution), and writing is ignored.
3268
    One exception is the mode 320*200, for which main loop of the
3316
    One exception is the mode 320*200, for which main loop of the
3269
    system thread updates the screen according to mouse movements.
3317
    system thread updates the screen according to mouse movements.
3270
 
3318
 
3271
------------------------- Screen resolution --------------------------
3319
------------------------- Screen resolution --------------------------
3272
Parameters:
3320
Parameters:
3273
  * eax = 61 - function number
3321
  * eax = 61 - function number
3274
  * ebx = 1 - subfunction number
3322
  * ebx = 1 - subfunction number
3275
Returned value:
3323
Returned value:
3276
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3324
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3277
Remarks:
3325
Remarks:
3278
  * One can use function 14 paying attention that
3326
  * One can use function 14 paying attention that
3279
    it returns sizes on 1 pixel less. It is fully equivalent way.
3327
    it returns sizes on 1 pixel less. It is fully equivalent way.
3280
 
3328
 
3281
---------------------- Number of bits per pixel ----------------------
3329
---------------------- Number of bits per pixel ----------------------
3282
Parameters:
3330
Parameters:
3283
  * eax = 61 - function number
3331
  * eax = 61 - function number
3284
  * ebx = 2 - subfunction number
3332
  * ebx = 2 - subfunction number
3285
Returned value:
3333
Returned value:
3286
  * eax = number of bits per pixel (24 or 32)
3334
  * eax = number of bits per pixel (24 or 32)
3287
 
3335
 
3288
-------------------- Number of bytes per scanline --------------------
3336
-------------------- Number of bytes per scanline --------------------
3289
Parameters:
3337
Parameters:
3290
  * eax = 61 - function number
3338
  * eax = 61 - function number
3291
  * ebx = 3 - subfunction number
3339
  * ebx = 3 - subfunction number
3292
Returned value:
3340
Returned value:
3293
  * eax = number of bytes occupied by one scanline
3341
  * eax = number of bytes occupied by one scanline
3294
    (horizontal line on the screen)
3342
    (horizontal line on the screen)
3295
 
3343
 
3296
======================================================================
3344
======================================================================
3297
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3345
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3298
======================================================================
3346
======================================================================
3299
Parameters:
3347
Parameters:
3300
  * eax = 62 - function number
3348
  * eax = 62 - function number
3301
  * bl = 0 - subfunction number
3349
  * bl = 0 - subfunction number
3302
Returned value:
3350
Returned value:
3303
  * eax = -1 - PCI access is disabled; otherwise
3351
  * eax = -1 - PCI access is disabled; otherwise
3304
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3352
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3305
  * high word of eax is zeroed
3353
  * high word of eax is zeroed
3306
Remarks:
3354
Remarks:
3307
  * Previously low-level access to PCI for applications must be
3355
  * Previously low-level access to PCI for applications must be
3308
    enabled by subfunction 12 of function 21.
3356
    enabled by subfunction 12 of function 21.
3309
  * If PCI BIOS is not supported, the value of ax is undefined.
3357
  * If PCI BIOS is not supported, the value of ax is undefined.
3310
 
3358
 
3311
======================================================================
3359
======================================================================
3312
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3360
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
3313
======================================================================
3361
======================================================================
3314
Parameters:
3362
Parameters:
3315
  * eax = 62 - function number
3363
  * eax = 62 - function number
3316
  * bl = 1 - subfunction number
3364
  * bl = 1 - subfunction number
3317
Returned value:
3365
Returned value:
3318
  * eax = -1 - access to PCI is disabled; otherwise
3366
  * eax = -1 - access to PCI is disabled; otherwise
3319
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3367
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3320
Remarks:
3368
Remarks:
3321
  * Previously low-level access to PCI for applications must be
3369
  * Previously low-level access to PCI for applications must be
3322
    enabled by subfunction 12 of function 21.
3370
    enabled by subfunction 12 of function 21.
3323
  * If PCI BIOS is not supported, the value of ax is undefined.
3371
  * If PCI BIOS is not supported, the value of ax is undefined.
3324
 
3372
 
3325
======================================================================
3373
======================================================================
3326
===================== Function 62, subfunction 2 =====================
3374
===================== Function 62, subfunction 2 =====================
3327
===== Get mechanism of addressing to the PCI configuration space. ====
3375
===== Get mechanism of addressing to the PCI configuration space. ====
3328
======================================================================
3376
======================================================================
3329
Parameters:
3377
Parameters:
3330
  * eax = 62 - function number
3378
  * eax = 62 - function number
3331
  * bl = 2 - subfunction number
3379
  * bl = 2 - subfunction number
3332
Returned value:
3380
Returned value:
3333
  * eax = -1 - access to PCI is disabled; otherwise
3381
  * eax = -1 - access to PCI is disabled; otherwise
3334
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3382
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3335
Remarks:
3383
Remarks:
3336
  * Previously low-level access to PCI for applications must be
3384
  * Previously low-level access to PCI for applications must be
3337
    enabled by subfunction 12 of function 21.
3385
    enabled by subfunction 12 of function 21.
3338
  * Addressing mechanism is selected depending on
3386
  * Addressing mechanism is selected depending on
3339
    equipment characteristics.
3387
    equipment characteristics.
3340
  * Subfunctions of read and write work automatically
3388
  * Subfunctions of read and write work automatically
3341
    with the selected mechanism.
3389
    with the selected mechanism.
3342
 
3390
 
3343
======================================================================
3391
======================================================================
3344
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3392
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
3345
======================================================================
3393
======================================================================
3346
Parameters:
3394
Parameters:
3347
  * eax = 62 - function number
3395
  * eax = 62 - function number
3348
  * bl = 4 - read byte
3396
  * bl = 4 - read byte
3349
  * bl = 5 - read word
3397
  * bl = 5 - read word
3350
  * bl = 6 - read dword
3398
  * bl = 6 - read dword
3351
  * bh = number of PCI-bus
3399
  * bh = number of PCI-bus
3352
  * ch = dddddfff, where ddddd = number of the device on the bus,
3400
  * ch = dddddfff, where ddddd = number of the device on the bus,
3353
    fff = function number of device
3401
    fff = function number of device
3354
  * cl = number of register (must be even for bl=5,
3402
  * cl = number of register (must be even for bl=5,
3355
    divisible by 4 for bl=6)
3403
    divisible by 4 for bl=6)
3356
Returned value:
3404
Returned value:
3357
  * eax = -1 - error (access to PCI is disabled or parameters
3405
  * eax = -1 - error (access to PCI is disabled or parameters
3358
    are not supported); otherwise
3406
    are not supported); otherwise
3359
  * al/ax/eax (depending on requested size) contains the data;
3407
  * al/ax/eax (depending on requested size) contains the data;
3360
    the other part of register eax is destroyed
3408
    the other part of register eax is destroyed
3361
Remarks:
3409
Remarks:
3362
  * Previously low-level access to PCI for applications must be
3410
  * Previously low-level access to PCI for applications must be
3363
    enabled by subfunction 12 of function 21.
3411
    enabled by subfunction 12 of function 21.
3364
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3412
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3365
    function number. To get access mechanism use subfunction 2.
3413
    function number. To get access mechanism use subfunction 2.
3366
  * Some registers are standard and exist for all devices, some are
3414
  * Some registers are standard and exist for all devices, some are
3367
    defined by the concrete device. The list of registers of the
3415
    defined by the concrete device. The list of registers of the
3368
    first type can be found e.g. in famous
3416
    first type can be found e.g. in famous
3369
    Interrupt List by Ralf Brown
3417
    Interrupt List by Ralf Brown
3370
    (http://www.pobox.com/~ralf/files.html,
3418
    (http://www.pobox.com/~ralf/files.html,
3371
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3419
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3372
    registers of the second type must be listed
3420
    registers of the second type must be listed
3373
    in the device documentation.
3421
    in the device documentation.
3374
 
3422
 
3375
======================================================================
3423
======================================================================
3376
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3424
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3377
======================================================================
3425
======================================================================
3378
Parameters:
3426
Parameters:
3379
  * eax = 62 - function number
3427
  * eax = 62 - function number
3380
  * bl = 8 - write byte
3428
  * bl = 8 - write byte
3381
  * bl = 9 - write word
3429
  * bl = 9 - write word
3382
  * bl = 10 - write dword
3430
  * bl = 10 - write dword
3383
  * bh = number of PCI-bus
3431
  * bh = number of PCI-bus
3384
  * ch = dddddfff, where ddddd = number of the device on the bus,
3432
  * ch = dddddfff, where ddddd = number of the device on the bus,
3385
    fff = function number of device
3433
    fff = function number of device
3386
  * cl = number of register (must be even for bl=9,
3434
  * cl = number of register (must be even for bl=9,
3387
    divisible by 4 for bl=10)
3435
    divisible by 4 for bl=10)
3388
  * dl/dx/edx (depending on requested size) contatins
3436
  * dl/dx/edx (depending on requested size) contatins
3389
    the data to write
3437
    the data to write
3390
Returned value:
3438
Returned value:
3391
  * eax = -1 - error (access to PCI is disabled or parameters
3439
  * eax = -1 - error (access to PCI is disabled or parameters
3392
    are not supported)
3440
    are not supported)
3393
  * eax = 0 - success
3441
  * eax = 0 - success
3394
Remarks:
3442
Remarks:
3395
  * Previously low-level access to PCI for applications must be
3443
  * Previously low-level access to PCI for applications must be
3396
    enabled by subfunction 12 of function 21.
3444
    enabled by subfunction 12 of function 21.
3397
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3445
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3398
    function number. To get access mechanism use subfunction 2.
3446
    function number. To get access mechanism use subfunction 2.
3399
  * Some registers are standard and exist for all devices, some are
3447
  * Some registers are standard and exist for all devices, some are
3400
    defined by the concrete device. The list of registers of the
3448
    defined by the concrete device. The list of registers of the
3401
    first type can be found e.g. in famous Interrupt List by
3449
    first type can be found e.g. in famous Interrupt List by
3402
    Ralf Brown; registers of the second type must be listed
3450
    Ralf Brown; registers of the second type must be listed
3403
    in the device documentation.
3451
    in the device documentation.
3404
 
3452
 
3405
======================================================================
3453
======================================================================
3406
============== Function 63 - work with the debug board. ==============
3454
============== Function 63 - work with the debug board. ==============
3407
======================================================================
3455
======================================================================
3408
The debug board is the global system buffer (with the size
3456
The debug board is the global system buffer (with the size
3409
512 bytes), to which any program can write (generally speaking,
3457
512 bytes), to which any program can write (generally speaking,
3410
arbitrary) data and from which other program can read these data.
3458
arbitrary) data and from which other program can read these data.
3411
By the agreement written data are text strings interpreted as
3459
By the agreement written data are text strings interpreted as
3412
debug messages on a course of program execution. The kernel in
3460
debug messages on a course of program execution. The kernel in
3413
some situations also writes to the debug board information on
3461
some situations also writes to the debug board information on
3414
execution of some functions; by the agreement kernel messages
3462
execution of some functions; by the agreement kernel messages
3415
begins from the prefix "K : ".
3463
begins from the prefix "K : ".
3416
For view of the debug board the application 'board' was created,
3464
For view of the debug board the application 'board' was created,
3417
which reads data from the buffer and displays them in its window.
3465
which reads data from the buffer and displays them in its window.
3418
'board' interpretes the sequence of codes 13,10 as newline.
3466
'board' interpretes the sequence of codes 13,10 as newline.
3419
A character with null code in an end of line is not necessary,
3467
A character with null code in an end of line is not necessary,
3420
but also does not prevent.
3468
but also does not prevent.
3421
Because debugger has been written, the value of the debug board
3469
Because debugger has been written, the value of the debug board
3422
has decreased, as debugger allows to inspect completely a course of
3470
has decreased, as debugger allows to inspect completely a course of
3423
program execution without any efforts from the direction of program
3471
program execution without any efforts from the direction of program
3424
itself. Nevertheless in some cases the debug board is still useful.
3472
itself. Nevertheless in some cases the debug board is still useful.
3425
 
3473
 
3426
----------------------------- Write byte -----------------------------
3474
----------------------------- Write byte -----------------------------
3427
Parameters:
3475
Parameters:
3428
  * eax = 63 - function number
3476
  * eax = 63 - function number
3429
  * ebx = 1 - subfunction number
3477
  * ebx = 1 - subfunction number
3430
  * cl = data byte
3478
  * cl = data byte
3431
Returned value:
3479
Returned value:
3432
  * function does not return value
3480
  * function does not return value
3433
Remarks:
3481
Remarks:
3434
  * Byte is written to the buffer. Buffer size is 512 bytes.
3482
  * Byte is written to the buffer. Buffer size is 512 bytes.
3435
    At buffer overflow all obtained data are lost.
3483
    At buffer overflow all obtained data are lost.
3436
  * For output to the debug board of more complicated objects
3484
  * For output to the debug board of more complicated objects
3437
    (strings, numbers) it is enough to call this function in cycle.
3485
    (strings, numbers) it is enough to call this function in cycle.
3438
    It is possible not to write the appropriate code manually and use
3486
    It is possible not to write the appropriate code manually and use
3439
    file 'debug.inc', which is included into the distributive.
3487
    file 'debug.inc', which is included into the distributive.
3440
 
3488
 
3441
----------------------------- Read byte ------------------------------
3489
----------------------------- Read byte ------------------------------
3442
Takes away byte from the buffer.
3490
Takes away byte from the buffer.
3443
Parameters:
3491
Parameters:
3444
  * eax = 63 - function number
3492
  * eax = 63 - function number
3445
  * ebx = 2 - subfunction number
3493
  * ebx = 2 - subfunction number
3446
Returned value:
3494
Returned value:
3447
  * eax = ebx = 0 - the buffer is empty
3495
  * eax = ebx = 0 - the buffer is empty
3448
  * eax = byte, ebx = 1 - byte was successfully read
3496
  * eax = byte, ebx = 1 - byte was successfully read
3449
 
3497
 
3450
======================================================================
3498
======================================================================
3451
============== Function 64 - resize application memory. ==============
3499
============== Function 64 - resize application memory. ==============
3452
======================================================================
3500
======================================================================
3453
Parameters:
3501
Parameters:
3454
  * eax = 64 - function number
3502
  * eax = 64 - function number
3455
  * ebx = 1 - unique subfunction
3503
  * ebx = 1 - unique subfunction
3456
  * ecx = new memory size
3504
  * ecx = new memory size
3457
Returned value:
3505
Returned value:
3458
  * eax = 0 - success
3506
  * eax = 0 - success
3459
  * eax = 1 - not enough memory
3507
  * eax = 1 - not enough memory
3460
Remarks:
3508
Remarks:
3461
  * At the moment this function is a sole resource for dynamic
3509
  * At the moment this function is a sole resource for dynamic
3462
    allocation/free of application memory.
3510
    allocation/free of application memory.
3463
 
3511
 
3464
======================================================================
3512
======================================================================
3465
================== Function 66 - work with keyboard. =================
3513
================== Function 66 - work with keyboard. =================
3466
======================================================================
3514
======================================================================
3467
The input mode influences results of reading keys by function 2.
3515
The input mode influences results of reading keys by function 2.
3468
When a program loads, ASCII input mode is set for it.
3516
When a program loads, ASCII input mode is set for it.
3469
 
3517
 
3470
-------------- Subfunction 1 - set keyboard input mode. --------------
3518
-------------- Subfunction 1 - set keyboard input mode. --------------
3471
Parameters:
3519
Parameters:
3472
  * eax = 66 - function number
3520
  * eax = 66 - function number
3473
  * ebx = 1 - subfunction number
3521
  * ebx = 1 - subfunction number
3474
  * ecx = mode:
3522
  * ecx = mode:
3475
    * 0 = normal (ASCII-characters)
3523
    * 0 = normal (ASCII-characters)
3476
    * 1 = scancodes
3524
    * 1 = scancodes
3477
Returned value:
3525
Returned value:
3478
  * function does not return value
3526
  * function does not return value
3479
 
3527
 
3480
-------------- Subfunction 2 - get keyboard input mode. --------------
3528
-------------- Subfunction 2 - get keyboard input mode. --------------
3481
Parameters:
3529
Parameters:
3482
  * eax = 66 - function number
3530
  * eax = 66 - function number
3483
  * ebx = 2 - subfunction number
3531
  * ebx = 2 - subfunction number
3484
Returned value:
3532
Returned value:
3485
  * eax = current mode
3533
  * eax = current mode
3486
 
3534
 
3487
------------ Subfunction 3 - get status of control keys. -------------
3535
------------ Subfunction 3 - get status of control keys. -------------
3488
Parameters:
3536
Parameters:
3489
  * eax = 66 - function number
3537
  * eax = 66 - function number
3490
  * ebx = 3 - subfunction number
3538
  * ebx = 3 - subfunction number
3491
Returned value:
3539
Returned value:
3492
  * eax = bit mask:
3540
  * eax = bit mask:
3493
  * bit 0 (mask 1): left Shift is pressed
3541
  * bit 0 (mask 1): left Shift is pressed
3494
  * bit 1 (mask 2): right Shift is pressed
3542
  * bit 1 (mask 2): right Shift is pressed
3495
  * bit 2 (mask 4): left Ctrl is pressed
3543
  * bit 2 (mask 4): left Ctrl is pressed
3496
  * bit 3 (mask 8): right Ctrl is pressed
3544
  * bit 3 (mask 8): right Ctrl is pressed
3497
  * bit 4 (mask 0x10): left Alt is pressed
3545
  * bit 4 (mask 0x10): left Alt is pressed
3498
  * bit 5 (mask 0x20): right Alt is pressed
3546
  * bit 5 (mask 0x20): right Alt is pressed
3499
  * bit 6 (mask 0x40): CapsLock is on
3547
  * bit 6 (mask 0x40): CapsLock is on
3500
  * bit 7 (mask 0x80): NumLock is on
3548
  * bit 7 (mask 0x80): NumLock is on
3501
  * bit 8 (mask 0x100): ScrollLock is on
3549
  * bit 8 (mask 0x100): ScrollLock is on
3502
  * other bits are cleared
3550
  * other bits are cleared
3503
 
3551
 
3504
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3552
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3505
When hotkey is pressed, the system notifies only those applications,
3553
When hotkey is pressed, the system notifies only those applications,
3506
which have installed it; the active application (which receives
3554
which have installed it; the active application (which receives
3507
all normal input) does not receive such keys.
3555
all normal input) does not receive such keys.
3508
The notification consists in sending event with the code 2.
3556
The notification consists in sending event with the code 2.
3509
Reading hotkey is the same as reading normal key - by function 2.
3557
Reading hotkey is the same as reading normal key - by function 2.
3510
Parameters:
3558
Parameters:
3511
  * eax = 66 - function number
3559
  * eax = 66 - function number
3512
  * ebx = 4 - subfunction number
3560
  * ebx = 4 - subfunction number
3513
  * cl determines key scancode;
3561
  * cl determines key scancode;
3514
    use cl=0 to give combinations such as Ctrl+Shift
3562
    use cl=0 to give combinations such as Ctrl+Shift
3515
  * edx = 0xXYZ determines possible states of control keys:
3563
  * edx = 0xXYZ determines possible states of control keys:
3516
    * Z (low 4 bits) determines state of LShift and RShift:
3564
    * Z (low 4 bits) determines state of LShift and RShift:
3517
      * 0 = no key must be pressed;
3565
      * 0 = no key must be pressed;
3518
      * 1 = exactly one key must be pressed;
3566
      * 1 = exactly one key must be pressed;
3519
      * 2 = both keys must be pressed;
3567
      * 2 = both keys must be pressed;
3520
      * 3 = must be pressed LShift, but not RShift;
3568
      * 3 = must be pressed LShift, but not RShift;
3521
      * 4 = must be pressed RShift, but not LShift
3569
      * 4 = must be pressed RShift, but not LShift
3522
    * Y - similar for LCtrl and RCtrl;
3570
    * Y - similar for LCtrl and RCtrl;
3523
    * X - similar for LAlt and RAlt
3571
    * X - similar for LAlt and RAlt
3524
Returned value:
3572
Returned value:
3525
  * eax=0 - success
3573
  * eax=0 - success
3526
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3574
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3527
Remarks:
3575
Remarks:
3528
  * Hotkey can work either at pressing or at release. Release
3576
  * Hotkey can work either at pressing or at release. Release
3529
    scancode of a key is more on 128 than pressing scancode
3577
    scancode of a key is more on 128 than pressing scancode
3530
    (i.e. high bit is set).
3578
    (i.e. high bit is set).
3531
  * Several applications can set the same combination;
3579
  * Several applications can set the same combination;
3532
    all such applications will be informed on pressing
3580
    all such applications will be informed on pressing
3533
    such combination.
3581
    such combination.
3534
 
3582
 
3535
-------------- Subfunction 5 - delete installed hotkey. --------------
3583
-------------- Subfunction 5 - delete installed hotkey. --------------
3536
Parameters:
3584
Parameters:
3537
  * eax = 66 - function number
3585
  * eax = 66 - function number
3538
  * ebx = 5 - subfunction number
3586
  * ebx = 5 - subfunction number
3539
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3587
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3540
Returned value:
3588
Returned value:
3541
  * eax = 0 - success
3589
  * eax = 0 - success
3542
  * eax = 1 - there is no such hotkey
3590
  * eax = 1 - there is no such hotkey
3543
Remarks:
3591
Remarks:
3544
  * When a process/thread terminates, all hotkey installed by it are
3592
  * When a process/thread terminates, all hotkey installed by it are
3545
    deleted.
3593
    deleted.
3546
  * The call to this subfunction does not affect other applications.
3594
  * The call to this subfunction does not affect other applications.
3547
    If other application has defined the same combination, it will
3595
    If other application has defined the same combination, it will
3548
    still receive notices.
3596
    still receive notices.
3549
 
3597
 
3550
======================================================================
3598
======================================================================
3551
========= Function 67 - change position/sizes of the window. =========
3599
========= Function 67 - change position/sizes of the window. =========
3552
======================================================================
3600
======================================================================
3553
Parameters:
3601
Parameters:
3554
  * eax = 67 - function number
3602
  * eax = 67 - function number
3555
  * ebx = new x-coordinate of the window
3603
  * ebx = new x-coordinate of the window
3556
  * ecx = new y-coordinate of the window
3604
  * ecx = new y-coordinate of the window
3557
  * edx = new x-size of the window
3605
  * edx = new x-size of the window
3558
  * esi = new y-size of the window
3606
  * esi = new y-size of the window
3559
Returned value:
3607
Returned value:
3560
  * function does not return value
3608
  * function does not return value
3561
Remarks:
3609
Remarks:
3562
  * The value -1 for a parameter means "do not change"; e.g. to move
3610
  * The value -1 for a parameter means "do not change"; e.g. to move
3563
    the window without resizing it is possible to specify edx=esi=-1.
3611
    the window without resizing it is possible to specify edx=esi=-1.
3564
  * Previously the window must be defined by function 0.
3612
  * Previously the window must be defined by function 0.
3565
    It sets initial coordinates and sizes of the window.
3613
    It sets initial coordinates and sizes of the window.
3566
  * Sizes of the window are understood in sense of function 0,
3614
  * Sizes of the window are understood in sense of function 0,
3567
    that is one pixel less than real sizes.
3615
    that is one pixel less than real sizes.
3568
  * The function call for maximized windows is simply ignored.
3616
  * The function call for maximized windows is simply ignored.
3569
  * For windows of appropriate styles position and/or sizes can be
3617
  * For windows of appropriate styles position and/or sizes can be
3570
    changed by user; current position and sizes can be obtained by
3618
    changed by user; current position and sizes can be obtained by
3571
    call to function 9.
3619
    call to function 9.
3572
  * The function sends to the window redraw event (with the code 1).
3620
  * The function sends to the window redraw event (with the code 1).
3573
 
3621
 
3574
======================================================================
3622
======================================================================
3575
====== Function 68, subfunction 0 - get the task switch counter. =====
3623
====== Function 68, subfunction 0 - get the task switch counter. =====
3576
======================================================================
3624
======================================================================
3577
Parameters:
3625
Parameters:
3578
  * eax = 68 - function number
3626
  * eax = 68 - function number
3579
  * ebx = 0 - subfunction number
3627
  * ebx = 0 - subfunction number
3580
Returned value:
3628
Returned value:
3581
  * eax = number of task switches from the system booting
3629
  * eax = number of task switches from the system booting
3582
    (modulo 2^32)
3630
    (modulo 2^32)
3583
 
3631
 
3584
======================================================================
3632
======================================================================
3585
======= Function 68, subfunction 1 - switch to the next thread. ======
3633
======= Function 68, subfunction 1 - switch to the next thread. ======
3586
======================================================================
3634
======================================================================
3587
The function completes the current time slice allocated to the
3635
The function completes the current time slice allocated to the
3588
thread and switches to the next. (Which thread in which process
3636
thread and switches to the next. (Which thread in which process
3589
will be next, is unpredictable). Later, when execution queue
3637
will be next, is unpredictable). Later, when execution queue
3590
will reach the current thread, execution will be continued.
3638
will reach the current thread, execution will be continued.
3591
Parameters:
3639
Parameters:
3592
  * eax = 68 - function number
3640
  * eax = 68 - function number
3593
  * ebx = 1 - subfunction number
3641
  * ebx = 1 - subfunction number
3594
Returned value:
3642
Returned value:
3595
  * function does not return value
3643
  * function does not return value
3596
 
3644
 
3597
======================================================================
3645
======================================================================
3598
============= Function 68, subfunction 2 - cache + rdpmc. ============
3646
============= Function 68, subfunction 2 - cache + rdpmc. ============
3599
======================================================================
3647
======================================================================
3600
Parameters:
3648
Parameters:
3601
  * eax = 68 - function number
3649
  * eax = 68 - function number
3602
  * ebx = 2 - subfunction number
3650
  * ebx = 2 - subfunction number
3603
  * ecx = required action:
3651
  * ecx = required action:
3604
    * ecx = 0 - enable instruction 'rdpmc'
3652
    * ecx = 0 - enable instruction 'rdpmc'
3605
      (ReaD Performance-Monitoring Counters) for applications
3653
      (ReaD Performance-Monitoring Counters) for applications
3606
    * ecx = 1 - find out whether cache is disabled/enabled
3654
    * ecx = 1 - find out whether cache is disabled/enabled
3607
    * ecx = 2 - enable cache
3655
    * ecx = 2 - enable cache
3608
    * ecx = 3 - disable cache
3656
    * ecx = 3 - disable cache
3609
Returned value:
3657
Returned value:
3610
  * for ecx=0:
3658
  * for ecx=0:
3611
    * eax = the value of cr4
3659
    * eax = the value of cr4
3612
  * for ecx=1:
3660
  * for ecx=1:
3613
    * eax = (cr0 and 0x60000000):
3661
    * eax = (cr0 and 0x60000000):
3614
    * eax = 0 - cache is on
3662
    * eax = 0 - cache is on
3615
    * eax <> 0 - cache is off
3663
    * eax <> 0 - cache is off
3616
  * for ecx=2 and ecx=3:
3664
  * for ecx=2 and ecx=3:
3617
    * function does not return value
3665
    * function does not return value
3618
 
3666
 
3619
======================================================================
3667
======================================================================
3620
=========== Function 68, subfunction 3 - read MSR-register. ==========
3668
=========== Function 68, subfunction 3 - read MSR-register. ==========
3621
======================================================================
3669
======================================================================
3622
MSR = Model Specific Register; the complete list of MSR-registers
3670
MSR = Model Specific Register; the complete list of MSR-registers
3623
of a processor is included to the documentation on it (for example,
3671
of a processor is included to the documentation on it (for example,
3624
IA-32 Intel Architecture Software Developer's Manual,
3672
IA-32 Intel Architecture Software Developer's Manual,
3625
Volume 3, Appendix B); each processor family has its own subset
3673
Volume 3, Appendix B); each processor family has its own subset
3626
of the MSR-registers.
3674
of the MSR-registers.
3627
Parameters:
3675
Parameters:
3628
  * eax = 68 - function number
3676
  * eax = 68 - function number
3629
  * ebx = 3 - subfunction number
3677
  * ebx = 3 - subfunction number
3630
  * ecx is ignored
3678
  * ecx is ignored
3631
  * edx = MSR address
3679
  * edx = MSR address
3632
Returned value:
3680
Returned value:
3633
  * ebx:eax = high:low dword of the result
3681
  * ebx:eax = high:low dword of the result
3634
Remarks:
3682
Remarks:
3635
  * If ecx contains nonexistent or not implemented for this processor
3683
  * If ecx contains nonexistent or not implemented for this processor
3636
    MSR, processor will generate an exception in the kernel, which
3684
    MSR, processor will generate an exception in the kernel, which
3637
    will kill the thread.
3685
    will kill the thread.
3638
  * Previously it is necessary to check, whether MSRs are supported
3686
  * Previously it is necessary to check, whether MSRs are supported
3639
    as a whole, with the instruction 'cpuid'. Otherwise processor
3687
    as a whole, with the instruction 'cpuid'. Otherwise processor
3640
    will generate other exception in the kernel, which will anyway
3688
    will generate other exception in the kernel, which will anyway
3641
    kill the thread.
3689
    kill the thread.
3642
 
3690
 
3643
======================================================================
3691
======================================================================
3644
========= Function 68, subfunction 4 - write to MSR-register. ========
3692
========= Function 68, subfunction 4 - write to MSR-register. ========
3645
======================================================================
3693
======================================================================
3646
MSR = Model Specific Register; the complete list of MSR-registers
3694
MSR = Model Specific Register; the complete list of MSR-registers
3647
of a processor is included to the documentation on it (for example,
3695
of a processor is included to the documentation on it (for example,
3648
IA-32 Intel Architecture Software Developer's Manual,
3696
IA-32 Intel Architecture Software Developer's Manual,
3649
Volume 3, Appendix B); each processor family has its own subset
3697
Volume 3, Appendix B); each processor family has its own subset
3650
of the MSR-registers.
3698
of the MSR-registers.
3651
Parameters:
3699
Parameters:
3652
  * eax = 68 - function number
3700
  * eax = 68 - function number
3653
  * ebx = 4 - subfunction number
3701
  * ebx = 4 - subfunction number
3654
  * ecx is ignored
3702
  * ecx is ignored
3655
  * edx = MSR address
3703
  * edx = MSR address
3656
  * esi:edi = high:low dword
3704
  * esi:edi = high:low dword
3657
Returned value:
3705
Returned value:
3658
  * ebx:eax = copy of esi:edi
3706
  * ebx:eax = copy of esi:edi
3659
Çàìå÷àíèÿ:
3707
Çàìå÷àíèÿ:
3660
  * If ecx contains nonexistent or not implemented for this processor
3708
  * If ecx contains nonexistent or not implemented for this processor
3661
    MSR, processor will generate an exception in the kernel, which
3709
    MSR, processor will generate an exception in the kernel, which
3662
    will kill the thread.
3710
    will kill the thread.
3663
  * Previously it is necessary to check, whether MSRs are supported
3711
  * Previously it is necessary to check, whether MSRs are supported
3664
    as a whole, with the instruction 'cpuid'. Otherwise processor
3712
    as a whole, with the instruction 'cpuid'. Otherwise processor
3665
    will generate other exception in the kernel, which will anyway
3713
    will generate other exception in the kernel, which will anyway
3666
    kill the thread.
3714
    kill the thread.
3667
 
3715
 
3668
======================================================================
3716
======================================================================
3669
======= Function 68, subfunction 5 - allocate physical memory. =======
3717
======= Function 68, subfunction 5 - allocate physical memory. =======
3670
======================================================================
3718
======================================================================
3671
Parameters:
3719
Parameters:
3672
  * eax = 68 - function number
3720
  * eax = 68 - function number
3673
  * ebx = 5 - subfunction number
3721
  * ebx = 5 - subfunction number
3674
  * ecx = size (in bytes)
3722
  * ecx = size (in bytes)
3675
Returned value:
3723
Returned value:
3676
  * eax = physical address of allocated memory
3724
  * eax = physical address of allocated memory
3677
Remarks:
3725
Remarks:
3678
  * Normal applications must not use this function, it is intended
3726
  * Normal applications must not use this function, it is intended
3679
    for the case, when for some device it is required to place
3727
    for the case, when for some device it is required to place
3680
    data to the known physical address. (In effect, this function
3728
    data to the known physical address. (In effect, this function
3681
    was developed for AC97WAV.)
3729
    was developed for AC97WAV.)
3682
  * The number of blocks of physical memory is limited (by constant
3730
  * The number of blocks of physical memory is limited (by constant
3683
    24, and this constant includes some blocks for kernel).
3731
    24, and this constant includes some blocks for kernel).
3684
  * To free a memory allocated by such way use
3732
  * To free a memory allocated by such way use
3685
    subfunction 6, to copy data there and back
3733
    subfunction 6, to copy data there and back
3686
    use subfunctions 7 and 8.
3734
    use subfunctions 7 and 8.
3687
 
3735
 
3688
======================================================================
3736
======================================================================
3689
========= Function 68, subfunction 6 - free physical memory. =========
3737
========= Function 68, subfunction 6 - free physical memory. =========
3690
======================================================================
3738
======================================================================
3691
Parameters:
3739
Parameters:
3692
  * eax = 68 - function number
3740
  * eax = 68 - function number
3693
  * ebx = 6 - subfunction number
3741
  * ebx = 6 - subfunction number
3694
  * ecx = physical address of memory
3742
  * ecx = physical address of memory
3695
Returned value:
3743
Returned value:
3696
  * function does not return value
3744
  * function does not return value
3697
Remarks:
3745
Remarks:
3698
  * Normal applications must not use this function, it is intended
3746
  * Normal applications must not use this function, it is intended
3699
    for the case, when for some device it is required to place
3747
    for the case, when for some device it is required to place
3700
    data to the known physical address. (In effect, this function
3748
    data to the known physical address. (In effect, this function
3701
    was developed for AC97WAV.)
3749
    was developed for AC97WAV.)
3702
  * The memory must be previously allocated by subfunction 5.
3750
  * The memory must be previously allocated by subfunction 5.
3703
 
3751
 
3704
======================================================================
3752
======================================================================
3705
===== Function 68, subfunction 7 - write data to physical memory. ====
3753
===== Function 68, subfunction 7 - write data to physical memory. ====
3706
======================================================================
3754
======================================================================
3707
Parameters:
3755
Parameters:
3708
  * eax = 68 - function number
3756
  * eax = 68 - function number
3709
  * ebx = 7 - subfunction number
3757
  * ebx = 7 - subfunction number
3710
  * ecx = physical address
3758
  * ecx = physical address
3711
  * edx = pointer to the data (in the application)
3759
  * edx = pointer to the data (in the application)
3712
  * esi = size of the data (in bytes)
3760
  * esi = size of the data (in bytes)
3713
Returned value:
3761
Returned value:
3714
  * function does not return value
3762
  * function does not return value
3715
Remarks:
3763
Remarks:
3716
  * Normal applications must not use this function, it is intended
3764
  * Normal applications must not use this function, it is intended
3717
    for the case, when for some device it is required to place
3765
    for the case, when for some device it is required to place
3718
    data to the known physical address. (In effect, this function
3766
    data to the known physical address. (In effect, this function
3719
    was developed for AC97WAV.)
3767
    was developed for AC97WAV.)
3720
  * The range of physical addresses should lie inside of previously
3768
  * The range of physical addresses should lie inside of previously
3721
    allocated by subfunction 5 block of physical memory.
3769
    allocated by subfunction 5 block of physical memory.
3722
  * There is no check for correctness.
3770
  * There is no check for correctness.
3723
 
3771
 
3724
======================================================================
3772
======================================================================
3725
==== Function 68, subfunction 8 - read data from physical memory. ====
3773
==== Function 68, subfunction 8 - read data from physical memory. ====
3726
======================================================================
3774
======================================================================
3727
Parameters:
3775
Parameters:
3728
  * eax = 68 - function number
3776
  * eax = 68 - function number
3729
  * ebx = 8 - subfunction number
3777
  * ebx = 8 - subfunction number
3730
  * ecx = physical address
3778
  * ecx = physical address
3731
  * edx = pointer to buffer for data (in application)
3779
  * edx = pointer to buffer for data (in application)
3732
  * esi = size of data (in bytes)
3780
  * esi = size of data (in bytes)
3733
Returned value:
3781
Returned value:
3734
  * function does not return value
3782
  * function does not return value
3735
Remarks:
3783
Remarks:
3736
  * Normal applications must not use this function, it is intended
3784
  * Normal applications must not use this function, it is intended
3737
    for the case, when for some device it is required to place
3785
    for the case, when for some device it is required to place
3738
    data to the known physical address. (In effect, this function
3786
    data to the known physical address. (In effect, this function
3739
    was developed for AC97WAV.)
3787
    was developed for AC97WAV.)
3740
  * The range of physical addresses should lie inside of previously
3788
  * The range of physical addresses should lie inside of previously
3741
    allocated by subfunction 5 block of physical memory.
3789
    allocated by subfunction 5 block of physical memory.
3742
  * There is no check for correctness.
3790
  * There is no check for correctness.
3743
 
3791
 
3744
======================================================================
3792
======================================================================
3745
====================== Fucntion 69 - debugging. ======================
3793
====================== Fucntion 69 - debugging. ======================
3746
======================================================================
3794
======================================================================
3747
A process can load other process as debugged by set of corresponding
3795
A process can load other process as debugged by set of corresponding
3748
bit by call to subfunction 16 of function 58
3796
bit by call to subfunction 16 of function 58
3749
or subfunction 7 of function 70.
3797
or subfunction 7 of function 70.
3750
A process can have only one debugger; one process can debug some
3798
A process can have only one debugger; one process can debug some
3751
others. The system notifies debugger on events occuring with
3799
others. The system notifies debugger on events occuring with
3752
debugged process. Messages are written to the buffer defined by
3800
debugged process. Messages are written to the buffer defined by
3753
subfunction 0.
3801
subfunction 0.
3754
Format of a message:
3802
Format of a message:
3755
  * +0: dword: message code
3803
  * +0: dword: message code
3756
  * +4: dword: PID of debugged process
3804
  * +4: dword: PID of debugged process
3757
  * +8: there can be additional data depending on message code
3805
  * +8: there can be additional data depending on message code
3758
Message codes:
3806
Message codes:
3759
  * 1 = exception
3807
  * 1 = exception
3760
    * in addition dword-number of the exception is given
3808
    * in addition dword-number of the exception is given
3761
    * process is suspended
3809
    * process is suspended
3762
  * 2 = process has terminated
3810
  * 2 = process has terminated
3763
    * comes at any termination: both through the system function -1,
3811
    * comes at any termination: both through the system function -1,
3764
      and at "murder" by any other process (including debugger itself)
3812
      and at "murder" by any other process (including debugger itself)
3765
  * 3 = debug exception int 1 = #DB
3813
  * 3 = debug exception int 1 = #DB
3766
    * in addition dword-image of the register DR6 is given:
3814
    * in addition dword-image of the register DR6 is given:
3767
      * bits 0-3: condition of the corresponding breakpoint (set by
3815
      * bits 0-3: condition of the corresponding breakpoint (set by
3768
        subfunction 9) is satisfied
3816
        subfunction 9) is satisfied
3769
      * áèò 14: exception has occured because of the trace mode
3817
      * áèò 14: exception has occured because of the trace mode
3770
        (flag TF is set TF)
3818
        (flag TF is set TF)
3771
    * process is suspended
3819
    * process is suspended
3772
When debugger terminates, all debugged processes are killed.
3820
When debugger terminates, all debugged processes are killed.
3773
If debugger does not want this, it must previously detach by
3821
If debugger does not want this, it must previously detach by
3774
subfunction 3.
3822
subfunction 3.
3775
 
3823
 
3776
All subfunctions are applicable only to processes/threads started
3824
All subfunctions are applicable only to processes/threads started
3777
from the current by function 58 or 70 with set debugging flag.
3825
from the current by function 58 or 70 with set debugging flag.
3778
Debugging of multithreaded programs is not supported yet.
3826
Debugging of multithreaded programs is not supported yet.
3779
The full list of subfunctions:
3827
The full list of subfunctions:
3780
  * subfunction 0 - define data area for debug messages
3828
  * subfunction 0 - define data area for debug messages
3781
  * subfunction 1 - get contents of registers of debugged thread
3829
  * subfunction 1 - get contents of registers of debugged thread
3782
  * subfunction 2 - set contents of registers of debugged thread
3830
  * subfunction 2 - set contents of registers of debugged thread
3783
  * subfunction 3 - detach from debugged process
3831
  * subfunction 3 - detach from debugged process
3784
  * subfunction 4 - suspend debugged thread
3832
  * subfunction 4 - suspend debugged thread
3785
  * subfunction 5 - resume debugged thread
3833
  * subfunction 5 - resume debugged thread
3786
  * subfunction 6 - read from the memory of debugged process
3834
  * subfunction 6 - read from the memory of debugged process
3787
  * subfunction 7 - write to the memory of debugged process
3835
  * subfunction 7 - write to the memory of debugged process
3788
  * subfunction 8 - terminate debugged thread
3836
  * subfunction 8 - terminate debugged thread
3789
  * subfunction 9 - set/clear hardware breakpoint
3837
  * subfunction 9 - set/clear hardware breakpoint
3790
 
3838
 
3791
======================================================================
3839
======================================================================
3792
= Function 69, subfunction 0 - define data area fror debug messages. =
3840
= Function 69, subfunction 0 - define data area fror debug messages. =
3793
======================================================================
3841
======================================================================
3794
Parameters:
3842
Parameters:
3795
  * eax = 69 - function number
3843
  * eax = 69 - function number
3796
  * ebx = 0 - subfunction number
3844
  * ebx = 0 - subfunction number
3797
  * ecx = pointer
3845
  * ecx = pointer
3798
Format of data area:
3846
Format of data area:
3799
  * +0: dword: N = buffer size (not including this header)
3847
  * +0: dword: N = buffer size (not including this header)
3800
  * +4: dword: occupied place
3848
  * +4: dword: occupied place
3801
  * +8: N*byte: buffer
3849
  * +8: N*byte: buffer
3802
Returned value:
3850
Returned value:
3803
  * function does not return value
3851
  * function does not return value
3804
Remarks:
3852
Remarks:
3805
  * If the size field is negative, the buffer is considered locked
3853
  * If the size field is negative, the buffer is considered locked
3806
    and at arrival of new message the system will wait.
3854
    and at arrival of new message the system will wait.
3807
    For synchronization frame all work with the buffer by operations
3855
    For synchronization frame all work with the buffer by operations
3808
    lock/unlock
3856
    lock/unlock
3809
    	neg	[bufsize]
3857
        neg    [bufsize]
3810
  * Data in the buffer are considered as array of items with variable
3858
  * Data in the buffer are considered as array of items with variable
3811
    length - messages. Format of a message is explained in
3859
    length - messages. Format of a message is explained in
3812
    general description.
3860
    general description.
3813
 
3861
 
3814
======================================================================
3862
======================================================================
3815
===================== Function 69, subfunction 1 =====================
3863
===================== Function 69, subfunction 1 =====================
3816
============ Get contents of registers of debugged thread. ===========
3864
============ Get contents of registers of debugged thread. ===========
3817
======================================================================
3865
======================================================================
3818
Parameters:
3866
Parameters:
3819
  * eax = 69 - function number
3867
  * eax = 69 - function number
3820
  * ebx = 1 - subfunction number
3868
  * ebx = 1 - subfunction number
3821
  * ecx = thread identifier
3869
  * ecx = thread identifier
3822
  * edx = size of context structure, must be 0x28=40 bytes
3870
  * edx = size of context structure, must be 0x28=40 bytes
3823
  * esi = pointer to context structure
3871
  * esi = pointer to context structure
3824
Returned value:
3872
Returned value:
3825
  * function does not return value
3873
  * function does not return value
3826
Format of context structure: (FPU is not supported yet)
3874
Format of context structure: (FPU is not supported yet)
3827
  * +0: dword: eip
3875
  * +0: dword: eip
3828
  * +4: dword: eflags
3876
  * +4: dword: eflags
3829
  * +8: dword: eax
3877
  * +8: dword: eax
3830
  * +12 = +0xC: dword: ecx
3878
  * +12 = +0xC: dword: ecx
3831
  * +16 = +0x10: dword: edx
3879
  * +16 = +0x10: dword: edx
3832
  * +20 = +0x14: dword: ebx
3880
  * +20 = +0x14: dword: ebx
3833
  * +24 = +0x18: dword: esp
3881
  * +24 = +0x18: dword: esp
3834
  * +28 = +0x1C: dword: ebp
3882
  * +28 = +0x1C: dword: ebp
3835
  * +32 = +0x20: dword: esi
3883
  * +32 = +0x20: dword: esi
3836
  * +36 = +0x24: dword: edi
3884
  * +36 = +0x24: dword: edi
3837
Remarks:
3885
Remarks:
3838
  * If the thread executes code of ring-0, the function returns
3886
  * If the thread executes code of ring-0, the function returns
3839
    contents of registers of ring-3.
3887
    contents of registers of ring-3.
3840
  * Process must be loaded for debugging (as is shown in
3888
  * Process must be loaded for debugging (as is shown in
3841
    general description).
3889
    general description).
3842
 
3890
 
3843
======================================================================
3891
======================================================================
3844
===================== Function 69, subfunction 2 =====================
3892
===================== Function 69, subfunction 2 =====================
3845
============ Set contents of registers of debugged thread. ===========
3893
============ Set contents of registers of debugged thread. ===========
3846
======================================================================
3894
======================================================================
3847
Parameters:
3895
Parameters:
3848
  * eax = 69 - function number
3896
  * eax = 69 - function number
3849
  * ebx = 2 - subfunction number
3897
  * ebx = 2 - subfunction number
3850
  * ecx = thread identifier
3898
  * ecx = thread identifier
3851
  * edx = size of context structure, must be 0x28=40 bytes
3899
  * edx = size of context structure, must be 0x28=40 bytes
3852
Returned value:
3900
Returned value:
3853
  * function does not return value
3901
  * function does not return value
3854
Format of context structure is shown in the description of
3902
Format of context structure is shown in the description of
3855
subfunction 1.
3903
subfunction 1.
3856
Remarks:
3904
Remarks:
3857
  * If the thread executes code of ring-0, the function returns
3905
  * If the thread executes code of ring-0, the function returns
3858
    contents of registers of ring-3.
3906
    contents of registers of ring-3.
3859
  * Process must be loaded for debugging (as is shown in
3907
  * Process must be loaded for debugging (as is shown in
3860
    general description).
3908
    general description).
3861
 
3909
 
3862
======================================================================
3910
======================================================================
3863
===== Function 69, subfunction 3 - detach from debugged process. =====
3911
===== Function 69, subfunction 3 - detach from debugged process. =====
3864
======================================================================
3912
======================================================================
3865
Parameters:
3913
Parameters:
3866
  * eax = 69 - function number
3914
  * eax = 69 - function number
3867
  * ebx = 3 - subfunction number
3915
  * ebx = 3 - subfunction number
3868
  * ecx = identifier
3916
  * ecx = identifier
3869
Returned value:
3917
Returned value:
3870
  * function does not return value
3918
  * function does not return value
3871
Remarks:
3919
Remarks:
3872
  * If the process was suspended, it resumes execution.
3920
  * If the process was suspended, it resumes execution.
3873
 
3921
 
3874
======================================================================
3922
======================================================================
3875
======== Function 69, subfunction 4 - suspend debugged thread. =======
3923
======== Function 69, subfunction 4 - suspend debugged thread. =======
3876
======================================================================
3924
======================================================================
3877
Parameters:
3925
Parameters:
3878
  * eax = 69 - function number
3926
  * eax = 69 - function number
3879
  * ebx = 4 - subfunction number
3927
  * ebx = 4 - subfunction number
3880
  * ecx = thread identifier
3928
  * ecx = thread identifier
3881
Returned value:
3929
Returned value:
3882
  * function does not return value
3930
  * function does not return value
3883
Remarks:
3931
Remarks:
3884
  * Process must be loaded for debugging (as is shown in
3932
  * Process must be loaded for debugging (as is shown in
3885
    general description).
3933
    general description).
3886
 
3934
 
3887
======================================================================
3935
======================================================================
3888
======== Function 69, subfunction 5 - resume debugged thread. ========
3936
======== Function 69, subfunction 5 - resume debugged thread. ========
3889
======================================================================
3937
======================================================================
3890
Parameters:
3938
Parameters:
3891
  * eax = 69 - function number
3939
  * eax = 69 - function number
3892
  * ebx = 5 - subfunction number
3940
  * ebx = 5 - subfunction number
3893
  * ecx = thread identifier
3941
  * ecx = thread identifier
3894
Returned value:
3942
Returned value:
3895
  * function does not return value
3943
  * function does not return value
3896
Remarks:
3944
Remarks:
3897
  * Process must be loaded for debugging (as is shown in
3945
  * Process must be loaded for debugging (as is shown in
3898
    general description).
3946
    general description).
3899
 
3947
 
3900
======================================================================
3948
======================================================================
3901
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3949
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3902
======================================================================
3950
======================================================================
3903
Parameters:
3951
Parameters:
3904
  * eax = 69 - function number
3952
  * eax = 69 - function number
3905
  * ebx = 6 - subfunction number
3953
  * ebx = 6 - subfunction number
3906
  * ecx = identifier
3954
  * ecx = identifier
3907
  * edx = number of bytes to read
3955
  * edx = number of bytes to read
3908
  * esi = address in the memory of debugged process
3956
  * esi = address in the memory of debugged process
3909
  * edi = pointer to buffer for data
3957
  * edi = pointer to buffer for data
3910
Returned value:
3958
Returned value:
3911
  * eax = -1 at an error (invalid PID or buffer)
3959
  * eax = -1 at an error (invalid PID or buffer)
3912
  * otherwise eax = number of read bytes (possibly, 0,
3960
  * otherwise eax = number of read bytes (possibly, 0,
3913
    if esi is too large)
3961
    if esi is too large)
3914
Remarks:
3962
Remarks:
3915
  * Process must be loaded for debugging (as is shown in
3963
  * Process must be loaded for debugging (as is shown in
3916
    general description).
3964
    general description).
3917
 
3965
 
3918
======================================================================
3966
======================================================================
3919
== Function 69, subfunction 7 - write to memory of debugged process. =
3967
== Function 69, subfunction 7 - write to memory of debugged process. =
3920
======================================================================
3968
======================================================================
3921
Parameters:
3969
Parameters:
3922
  * eax = 69 - function number
3970
  * eax = 69 - function number
3923
  * ebx = 7 - subfunction number
3971
  * ebx = 7 - subfunction number
3924
  * ecx = identifier
3972
  * ecx = identifier
3925
  * edx = number of bytes to write
3973
  * edx = number of bytes to write
3926
  * esi = address of memory in debugged process
3974
  * esi = address of memory in debugged process
3927
  * edi = pointer to data
3975
  * edi = pointer to data
3928
Returned value:
3976
Returned value:
3929
  * eax = -1 at an error (invalid PID or buffer)
3977
  * eax = -1 at an error (invalid PID or buffer)
3930
  * otherwise eax = number of written bytes (possibly, 0,
3978
  * otherwise eax = number of written bytes (possibly, 0,
3931
    if esi is too large)
3979
    if esi is too large)
3932
Remarks:
3980
Remarks:
3933
  * Process must be loaded for debugging (as is shown in
3981
  * Process must be loaded for debugging (as is shown in
3934
    general description).
3982
    general description).
3935
 
3983
 
3936
======================================================================
3984
======================================================================
3937
======= Function 69, subfunction 8 - terminate debugged thread. ======
3985
======= Function 69, subfunction 8 - terminate debugged thread. ======
3938
======================================================================
3986
======================================================================
3939
Parameters:
3987
Parameters:
3940
  * eax = 69 - function number
3988
  * eax = 69 - function number
3941
  * ebx = 8 - subfunction number
3989
  * ebx = 8 - subfunction number
3942
  * ecx = identifier
3990
  * ecx = identifier
3943
Returned value:
3991
Returned value:
3944
  * function does not return value
3992
  * function does not return value
3945
Remarks:
3993
Remarks:
3946
  * Process must be loaded for debugging (as is shown in
3994
  * Process must be loaded for debugging (as is shown in
3947
    general description).
3995
    general description).
3948
  * The function is similar to subfunction 2 of function 18
3996
  * The function is similar to subfunction 2 of function 18
3949
    with two differences: it requires first remark and
3997
    with two differences: it requires first remark and
3950
    accepts PID rather than slot number.
3998
    accepts PID rather than slot number.
3951
 
3999
 
3952
======================================================================
4000
======================================================================
3953
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
4001
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3954
======================================================================
4002
======================================================================
3955
Parameters:
4003
Parameters:
3956
  * eax = 69 - function number
4004
  * eax = 69 - function number
3957
  * ebx = 9 - subfunction number
4005
  * ebx = 9 - subfunction number
3958
  * ecx = thread identifier
4006
  * ecx = thread identifier
3959
  * dl = index of breakpoint, from 0 to 3 inclusively
4007
  * dl = index of breakpoint, from 0 to 3 inclusively
3960
  * dh = flags:
4008
  * dh = flags:
3961
    * if high bit is cleared - set breakpoint:
4009
    * if high bit is cleared - set breakpoint:
3962
      * bits 0-1 - condition:
4010
      * bits 0-1 - condition:
3963
        * 00 = breakpoint on execution
4011
        * 00 = breakpoint on execution
3964
        * 01 = breakpoint on read
4012
        * 01 = breakpoint on read
3965
        * 11 = breakpoint on read/write
4013
        * 11 = breakpoint on read/write
3966
      * bits 2-3 - length; for breakpoints on exception it must be
4014
      * bits 2-3 - length; for breakpoints on exception it must be
3967
        00, otherwise one of
4015
        00, otherwise one of
3968
        * 00 = byte
4016
        * 00 = byte
3969
        * 01 = word
4017
        * 01 = word
3970
        * 11 = dword
4018
        * 11 = dword
3971
      * esi = breakpoint address; must be aligned according to
4019
      * esi = breakpoint address; must be aligned according to
3972
        the length (i.e. must be even for word breakpoints,
4020
        the length (i.e. must be even for word breakpoints,
3973
        divisible by 4 for dword)
4021
        divisible by 4 for dword)
3974
    * if high bit is set - clear breakpoint
4022
    * if high bit is set - clear breakpoint
3975
Returned value:
4023
Returned value:
3976
  * eax = 0 - success
4024
  * eax = 0 - success
3977
  * eax = 1 - error in the input data
4025
  * eax = 1 - error in the input data
3978
  * eax = 2 - (reserved, is never returned in the current
4026
  * eax = 2 - (reserved, is never returned in the current
3979
    implementation) a global breakpoint with that index is already set
4027
    implementation) a global breakpoint with that index is already set
3980
Remarks:
4028
Remarks:
3981
  * Process must be loaded for debugging (as is shown in
4029
  * Process must be loaded for debugging (as is shown in
3982
    general description).
4030
    general description).
3983
  * Hardware breakpoints are implemented through DRx-registers of
4031
  * Hardware breakpoints are implemented through DRx-registers of
3984
    the processor, all limitations results from this.
4032
    the processor, all limitations results from this.
3985
  * The function can reinstall the breakpoint, previously set
4033
  * The function can reinstall the breakpoint, previously set
3986
    by it (and it does not inform on this).
4034
    by it (and it does not inform on this).
3987
    Carry on the list of set breakpoints in the debugger.
4035
    Carry on the list of set breakpoints in the debugger.
3988
  * Breakpoints generate debug exception #DB, on which the system
4036
  * Breakpoints generate debug exception #DB, on which the system
3989
    notifies debugger.
4037
    notifies debugger.
3990
  * Breakpoints on write and read/write act after
4038
  * Breakpoints on write and read/write act after
3991
    execution of the caused it instruction.
4039
    execution of the caused it instruction.
3992
 
4040
 
3993
======================================================================
4041
======================================================================
3994
==== Function 70 - work with file system with long names support. ====
4042
==== Function 70 - work with file system with long names support. ====
3995
======================================================================
4043
======================================================================
3996
Parameters:
4044
Parameters:
3997
  * eax = 70
4045
  * eax = 70
3998
  * ebx = pointer to the information structure
4046
  * ebx = pointer to the information structure
3999
Returned value:
4047
Returned value:
4000
  * eax = 0 - success; otherwise file system error code
4048
  * eax = 0 - success; otherwise file system error code
4001
  * some subfunctions return value in other registers too
4049
  * some subfunctions return value in other registers too
4002
General format of the information structure:
4050
General format of the information structure:
4003
  * +0: dword: subfunction number
4051
  * +0: dword: subfunction number
4004
  * +4: dword: file offset
4052
  * +4: dword: file offset
4005
  * +8: dword: high dword of offset (must be 0) or flags field
4053
  * +8: dword: high dword of offset (must be 0) or flags field
4006
  * +12 = +0xC: dword: size
4054
  * +12 = +0xC: dword: size
4007
  * +16 = +0x10: dword: pointer to data
4055
  * +16 = +0x10: dword: pointer to data
4008
  * +20 = +0x14: n db: ASCIIZ-string with the filename
4056
  * +20 = +0x14: n db: ASCIIZ-string with the filename
4009
    or
4057
    or
4010
  * +20 = +0x14: db 0
4058
  * +20 = +0x14: db 0
4011
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
4059
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
4012
Specifications - in documentation on the appropriate subfunction.
4060
Specifications - in documentation on the appropriate subfunction.
4013
Filename is case-insensitive. Russian letters must be written in
4061
Filename is case-insensitive. Russian letters must be written in
4014
the encoding cp866 (DOS).
4062
the encoding cp866 (DOS).
4015
Format of filename:
4063
Format of filename:
4016
/base/number/dir1/dir2/.../dirn/file,
4064
/base/number/dir1/dir2/.../dirn/file,
4017
where /base/number identifies device, on which file is located:
4065
where /base/number identifies device, on which file is located:
4018
one of
4066
one of
4019
  * /RD/1 = /RAMDISK/1 to access ramdisk
4067
  * /RD/1 = /RAMDISK/1 to access ramdisk
4020
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
4068
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
4021
    /FD/2 = /FLOPPYDISK/2 to access second one
4069
    /FD/2 = /FLOPPYDISK/2 to access second one
4022
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
4070
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
4023
    IDE0 (Primary Master), IDE1 (Primary Slave),
4071
    IDE0 (Primary Master), IDE1 (Primary Slave),
4024
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
4072
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
4025
    x - partition number on the selected hard drive, varies from 1
4073
    x - partition number on the selected hard drive, varies from 1
4026
    to 255 (on each hard drive the indexing starts from 1)
4074
    to 255 (on each hard drive the indexing starts from 1)
4027
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
4075
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
4028
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
4076
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
4029
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
4077
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
4030
Examples:
4078
Examples:
4031
  * '/rd/1/kernel.asm',0
4079
  * '/rd/1/kernel.asm',0
4032
  * '/HD0/1/kernel.asm',0
4080
  * '/HD0/1/kernel.asm',0
4033
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4081
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4034
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4082
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4035
Available subfunctions:
4083
Available subfunctions:
4036
  * subfunction 0 - read file
4084
  * subfunction 0 - read file
4037
  * subfunction 1 - read folder
4085
  * subfunction 1 - read folder
4038
  * subfunction 2 - create/rewrite file
4086
  * subfunction 2 - create/rewrite file
4039
  * subfunction 5 - get attributes of file/folder
4087
  * subfunction 5 - get attributes of file/folder
4040
  * subfunction 6 - set attributes of file/folder
4088
  * subfunction 6 - set attributes of file/folder
4041
  * subfunction 7 - start application
4089
  * subfunction 7 - start application
4042
For CD-drives due to hardware limitations only subfunctions
4090
For CD-drives due to hardware limitations only subfunctions
4043
0,1,5 and 7 are available, other subfunctions return error
4091
0,1,5 and 7 are available, other subfunctions return error
4044
with code 2.
4092
with code 2.
4045
 
4093
 
4046
======================================================================
4094
======================================================================
4047
=== Function 70, subfunction 0 - read file with long names support. ==
4095
=== Function 70, subfunction 0 - read file with long names support. ==
4048
======================================================================
4096
======================================================================
4049
Parameters:
4097
Parameters:
4050
  * eax = 70 - function number
4098
  * eax = 70 - function number
4051
  * ebx = pointer to the information structure
4099
  * ebx = pointer to the information structure
4052
Format of the information structure:
4100
Format of the information structure:
4053
  * +0: dword: 0 = subfunction number
4101
  * +0: dword: 0 = subfunction number
4054
  * +4: dword: file offset (in bytes)
4102
  * +4: dword: file offset (in bytes)
4055
  * +8: dword: 0 (reserved for high dword of offset)
4103
  * +8: dword: 0 (reserved for high dword of offset)
4056
  * +12 = +0xC: dword: number of bytes to read
4104
  * +12 = +0xC: dword: number of bytes to read
4057
  * +16 = +0x10: dword: pointer to buffer for data
4105
  * +16 = +0x10: dword: pointer to buffer for data
4058
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4106
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4059
    given in the general description
4107
    given in the general description
4060
    or
4108
    or
4061
  * +20 = +0x14: db 0
4109
  * +20 = +0x14: db 0
4062
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4110
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4063
Returned value:
4111
Returned value:
4064
  * eax = 0 - success, otherwise file system error code
4112
  * eax = 0 - success, otherwise file system error code
4065
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4113
  * ebx = number of read bytes or -1=0xffffffff if file was not found
4066
Remarks:
4114
Remarks:
4067
  * If file was ended before last requested block was read,
4115
  * If file was ended before last requested block was read,
4068
    the function will read as many as it can, and after that return
4116
    the function will read as many as it can, and after that return
4069
    eax=6 (EOF).
4117
    eax=6 (EOF).
4070
  * The function does not allow to read folder (returns eax=10,
4118
  * The function does not allow to read folder (returns eax=10,
4071
    access denied).
4119
    access denied).
4072
 
4120
 
4073
======================================================================
4121
======================================================================
4074
== Function 70, subfunction 1 - read folder with long names support. =
4122
== Function 70, subfunction 1 - read folder with long names support. =
4075
======================================================================
4123
======================================================================
4076
Parameters:
4124
Parameters:
4077
  * eax = 70 - function number
4125
  * eax = 70 - function number
4078
  * ebx = pointer to the information structure
4126
  * ebx = pointer to the information structure
4079
Format of the information structure:
4127
Format of the information structure:
4080
  * +0: dword: 1 = subfunction number
4128
  * +0: dword: 1 = subfunction number
4081
  * +4: dword: index of starting block (beginning from 0)
4129
  * +4: dword: index of starting block (beginning from 0)
4082
  * +8: dword: flags field:
4130
  * +8: dword: flags field:
4083
    * bit 0 (mask 1): in what format to return names,
4131
    * bit 0 (mask 1): in what format to return names,
4084
      0=ANSI, 1=UNICODE
4132
      0=ANSI, 1=UNICODE
4085
    * other bits are reserved and must be set to 0 for the future
4133
    * other bits are reserved and must be set to 0 for the future
4086
      compatibility
4134
      compatibility
4087
  * +12 = +0xC: dword: number of blocks to read
4135
  * +12 = +0xC: dword: number of blocks to read
4088
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4136
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4089
    must be not less than 32 + [+12]*560 bytes
4137
    must be not less than 32 + [+12]*560 bytes
4090
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4138
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4091
    given in the general description
4139
    given in the general description
4092
    or
4140
    or
4093
  * +20 = +0x14: db 0
4141
  * +20 = +0x14: db 0
4094
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4142
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4095
Returned value:
4143
Returned value:
4096
  * eax = 0 - success, otherwise file system error code
4144
  * eax = 0 - success, otherwise file system error code
4097
  * ebx = number of files, information on which was written to
4145
  * ebx = number of files, information on which was written to
4098
    the buffer, or -1=0xffffffff, if folder was not found
4146
    the buffer, or -1=0xffffffff, if folder was not found
4099
Structure of the buffer:
4147
Structure of the buffer:
4100
  * +0: 32*byte: header
4148
  * +0: 32*byte: header
4101
  * +32 = +0x20: n1*byte: block with information on file 1
4149
  * +32 = +0x20: n1*byte: block with information on file 1
4102
  * +32+n1: n2*byte: block with information on file 2
4150
  * +32+n1: n2*byte: block with information on file 2
4103
  * ...
4151
  * ...
4104
Structure of header:
4152
Structure of header:
4105
  * +0: dword: version of structure (current is 1)
4153
  * +0: dword: version of structure (current is 1)
4106
  * +4: dword: number of placed blocks; is not greater than requested
4154
  * +4: dword: number of placed blocks; is not greater than requested
4107
    in the field +12 of information structure; can be less, if
4155
    in the field +12 of information structure; can be less, if
4108
    there are no more files in folder (the same as in ebx)
4156
    there are no more files in folder (the same as in ebx)
4109
  * +8: dword: total number of files in folder
4157
  * +8: dword: total number of files in folder
4110
  * +12 = +0xC: 20*byte: reserved (zeroed)
4158
  * +12 = +0xC: 20*byte: reserved (zeroed)
4111
Structure of block of data for folder entry (BDFE):
4159
Structure of block of data for folder entry (BDFE):
4112
  * +0: dword: attributes of file:
4160
  * +0: dword: attributes of file:
4113
    * bit 0 (mask 1): file is read-only
4161
    * bit 0 (mask 1): file is read-only
4114
    * bit 1 (mask 2): file is hidden
4162
    * bit 1 (mask 2): file is hidden
4115
    * bit 2 (mask 4): file is system
4163
    * bit 2 (mask 4): file is system
4116
    * bit 3 (mask 8): this is not a file but volume label
4164
    * bit 3 (mask 8): this is not a file but volume label
4117
      (for one partition meets no more than once and
4165
      (for one partition meets no more than once and
4118
      only in root folder)
4166
      only in root folder)
4119
    * bit 4 (mask 0x10): this is a folder
4167
    * bit 4 (mask 0x10): this is a folder
4120
    * bit 5 (mask 0x20): file was not archived - many archivation
4168
    * bit 5 (mask 0x20): file was not archived - many archivation
4121
      programs have an option to archive only files with this bit set,
4169
      programs have an option to archive only files with this bit set,
4122
      and after archiving this bit is cleared - it can be useful
4170
      and after archiving this bit is cleared - it can be useful
4123
      for automatically creating of backup-archives as at writing
4171
      for automatically creating of backup-archives as at writing
4124
      this bit is usually set
4172
      this bit is usually set
4125
  * +4: byte: type of name data:
4173
  * +4: byte: type of name data:
4126
    (coincides with bit 0 of flags in the information structure)
4174
    (coincides with bit 0 of flags in the information structure)
4127
    * 0 = ASCII = 1-byte representation of each character
4175
    * 0 = ASCII = 1-byte representation of each character
4128
    * 1 = UNICODE = 2-byte representation of each character
4176
    * 1 = UNICODE = 2-byte representation of each character
4129
  * +5: 3*byte: reserved (zero)
4177
  * +5: 3*byte: reserved (zero)
4130
  * +8: 4*byte: time of file creation
4178
  * +8: 4*byte: time of file creation
4131
  * +12 = +0xC: 4*byte: date of file creation
4179
  * +12 = +0xC: 4*byte: date of file creation
4132
  * +16 = +0x10: 4*byte: time of last access (read or write)
4180
  * +16 = +0x10: 4*byte: time of last access (read or write)
4133
  * +20 = +0x14: 4*byte: date of last access
4181
  * +20 = +0x14: 4*byte: date of last access
4134
  * +24 = +0x18: 4*byte: time of last modification
4182
  * +24 = +0x18: 4*byte: time of last modification
4135
  * +28 = +0x1C: 4*byte: date of last modification
4183
  * +28 = +0x1C: 4*byte: date of last modification
4136
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4184
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4137
  * +40 = +0x28: name
4185
  * +40 = +0x28: name
4138
    * for ASCII format: maximum length is 263 characters
4186
    * for ASCII format: maximum length is 263 characters
4139
      (263 bytes), byte after the name has value 0
4187
      (263 bytes), byte after the name has value 0
4140
    * äëÿ ôîðìàòà UNICODE: maximum length is 259 characters
4188
    * äëÿ ôîðìàòà UNICODE: maximum length is 259 characters
4141
      (518 bytes), 2 bytes after the name have value 0
4189
      (518 bytes), 2 bytes after the name have value 0
4142
Time format:
4190
Time format:
4143
  * +0: byte: seconds
4191
  * +0: byte: seconds
4144
  * +1: byte: minutes
4192
  * +1: byte: minutes
4145
  * +2: byte: hours
4193
  * +2: byte: hours
4146
  * +3: byte: reserved (0)
4194
  * +3: byte: reserved (0)
4147
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4195
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4148
Date format:
4196
Date format:
4149
  * +0: byte: day
4197
  * +0: byte: day
4150
  * +1: byte: month
4198
  * +1: byte: month
4151
  * +2: word: year
4199
  * +2: word: year
4152
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4200
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4153
Remarks:
4201
Remarks:
4154
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4202
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4155
    if UNICODE name - 560 bytes. Value of length is aligned
4203
    if UNICODE name - 560 bytes. Value of length is aligned
4156
    on 16-byte bound (to accelerate processing in CPU cache).
4204
    on 16-byte bound (to accelerate processing in CPU cache).
4157
  * First character after a name is zero (ASCIIZ-string). The further
4205
  * First character after a name is zero (ASCIIZ-string). The further
4158
    data contain garbage.
4206
    data contain garbage.
4159
  * If files in folder were ended before requested number was read,
4207
  * If files in folder were ended before requested number was read,
4160
    the function will read as many as it can, and after that return
4208
    the function will read as many as it can, and after that return
4161
    eax=6 (EOF).
4209
    eax=6 (EOF).
4162
  * Any folder on the disk, except for root, contains two special
4210
  * Any folder on the disk, except for root, contains two special
4163
    entries "." and "..", identifying accordingly the folder itself
4211
    entries "." and "..", identifying accordingly the folder itself
4164
    and the parent folder.
4212
    and the parent folder.
4165
  * The function allows also to read virtual folders "/", "/rd",
4213
  * The function allows also to read virtual folders "/", "/rd",
4166
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4214
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4167
    and times and dates are zeroed. An alternative way to get the
4215
    and times and dates are zeroed. An alternative way to get the
4168
    equipment information - subfunction 11 of function 18.
4216
    equipment information - subfunction 11 of function 18.
4169
 
4217
 
4170
======================================================================
4218
======================================================================
4171
===================== Function 70, subfunction 2 =====================
4219
===================== Function 70, subfunction 2 =====================
4172
============ Create/rewrite file with long names support. ============
4220
============ Create/rewrite file with long names support. ============
4173
======================================================================
4221
======================================================================
4174
Parameters:
4222
Parameters:
4175
  * eax = 70 - function number
4223
  * eax = 70 - function number
4176
  * ebx = pointer to the information structure
4224
  * ebx = pointer to the information structure
4177
Format of the information structure:
4225
Format of the information structure:
4178
  * +0: dword: 2 = subfunction number
4226
  * +0: dword: 2 = subfunction number
4179
  * +4: dword: 0 (reserved)
4227
  * +4: dword: 0 (reserved)
4180
  * +8: dword: 0 (reserved)
4228
  * +8: dword: 0 (reserved)
4181
  * +12 = +0xC: dword: number of bytes to read
4229
  * +12 = +0xC: dword: number of bytes to read
4182
  * +16 = +0x10: dword: pointer to data
4230
  * +16 = +0x10: dword: pointer to data
4183
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4231
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4184
    given in the general description
4232
    given in the general description
4185
    or
4233
    or
4186
  * +20 = +0x14: db 0
4234
  * +20 = +0x14: db 0
4187
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4235
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4188
Returned value:
4236
Returned value:
4189
  * eax = 0 - success, otherwise file system error code
4237
  * eax = 0 - success, otherwise file system error code
4190
  * ebx = number of written bytes (possibly 0)
4238
  * ebx = number of written bytes (possibly 0)
4191
Remarks:
4239
Remarks:
4192
  * If a file with given name did not exist, it is created;
4240
  * If a file with given name did not exist, it is created;
4193
    if it existed, it is rewritten.
4241
    if it existed, it is rewritten.
4194
  * If there is not enough free space on disk, the function will
4242
  * If there is not enough free space on disk, the function will
4195
    write as many as can and then return error code 8.
4243
    write as many as can and then return error code 8.
4196
  * The function is not supported for CD (returns error code 2).
4244
  * The function is not supported for CD (returns error code 2).
4197
 
4245
 
4198
======================================================================
4246
======================================================================
4199
==== Function 70, subfunction 5 - get information on file/folder. ====
4247
==== Function 70, subfunction 5 - get information on file/folder. ====
4200
======================================================================
4248
======================================================================
4201
Parameters:
4249
Parameters:
4202
  * eax = 70 - function number
4250
  * eax = 70 - function number
4203
  * ebx = pointer to the information structure
4251
  * ebx = pointer to the information structure
4204
Format of the information structure:
4252
Format of the information structure:
4205
  * +0: dword: 5 = subfunction number
4253
  * +0: dword: 5 = subfunction number
4206
  * +4: dword: 0 (reserved)
4254
  * +4: dword: 0 (reserved)
4207
  * +8: dword: 0 (reserved)
4255
  * +8: dword: 0 (reserved)
4208
  * +12 = +0xC: dword: 0 (reserved)
4256
  * +12 = +0xC: dword: 0 (reserved)
4209
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4257
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4210
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4258
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4211
    given in the general description
4259
    given in the general description
4212
    or
4260
    or
4213
  * +20 = +0x14: db 0
4261
  * +20 = +0x14: db 0
4214
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4262
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4215
Returned value:
4263
Returned value:
4216
  * eax = 0 - success, otherwise file system error code
4264
  * eax = 0 - success, otherwise file system error code
4217
  * ebx destroyed
4265
  * ebx destroyed
4218
Information on file is returned in the BDFE format (block of data
4266
Information on file is returned in the BDFE format (block of data
4219
for folder entry), explained in the description of
4267
for folder entry), explained in the description of
4220
subfunction 1, but without filename
4268
subfunction 1, but without filename
4221
(i.e. only first 40 = 0x28 bytes).
4269
(i.e. only first 40 = 0x28 bytes).
4222
Remarks:
4270
Remarks:
4223
  * The function does not support virtual folders such as /, /rd and
4271
  * The function does not support virtual folders such as /, /rd and
4224
    root folders like /rd/1.
4272
    root folders like /rd/1.
4225
 
4273
 
4226
======================================================================
4274
======================================================================
4227
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4275
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4228
======================================================================
4276
======================================================================
4229
Parameters:
4277
Parameters:
4230
  * eax = 70 - function number
4278
  * eax = 70 - function number
4231
  * ebx = pointer to the information structure
4279
  * ebx = pointer to the information structure
4232
Format of the information structure:
4280
Format of the information structure:
4233
  * +0: dword: 6 = subfunction number
4281
  * +0: dword: 6 = subfunction number
4234
  * +4: dword: 0 (reserved)
4282
  * +4: dword: 0 (reserved)
4235
  * +8: dword: 0 (reserved)
4283
  * +8: dword: 0 (reserved)
4236
  * +12 = +0xC: dword: 0 (reserved)
4284
  * +12 = +0xC: dword: 0 (reserved)
4237
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4285
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4238
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4286
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4239
    given in the general description
4287
    given in the general description
4240
    or
4288
    or
4241
  * +20 = +0x14: db 0
4289
  * +20 = +0x14: db 0
4242
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4290
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4243
Returned value:
4291
Returned value:
4244
  * eax = 0 - success, otherwise file system error code
4292
  * eax = 0 - success, otherwise file system error code
4245
  * ebx destroyed
4293
  * ebx destroyed
4246
File attributes are first 32 bytes in BDFE (block of data
4294
File attributes are first 32 bytes in BDFE (block of data
4247
for folder entry), explained in the description of subfunction 1
4295
for folder entry), explained in the description of subfunction 1
4248
(that is, without name and size of file). Attribute
4296
(that is, without name and size of file). Attribute
4249
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4297
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4250
Byte +4 (name format) is ignored.
4298
Byte +4 (name format) is ignored.
4251
Remarks:
4299
Remarks:
4252
  * The function does not support virtual folders such as /, /rd and
4300
  * The function does not support virtual folders such as /, /rd and
4253
    root folders like /rd/1.
4301
    root folders like /rd/1.
4254
  * The function is not supported for CD (returns error code 2).
4302
  * The function is not supported for CD (returns error code 2).
4255
 
4303
 
4256
======================================================================
4304
======================================================================
4257
=========== Function 70, subfunction 7 - start application. ==========
4305
=========== Function 70, subfunction 7 - start application. ==========
4258
======================================================================
4306
======================================================================
4259
Parameters:
4307
Parameters:
4260
  * eax = 70 - function number
4308
  * eax = 70 - function number
4261
  * ebx = pointer to the information structure
4309
  * ebx = pointer to the information structure
4262
Format of the information structure:
4310
Format of the information structure:
4263
  * +0: dword: 7 = subfunction number
4311
  * +0: dword: 7 = subfunction number
4264
  * +4: dword: flags field:
4312
  * +4: dword: flags field:
4265
    * áèò 0: start process as debugged
4313
    * áèò 0: start process as debugged
4266
    * other bits are reserved and must be set to 0
4314
    * other bits are reserved and must be set to 0
4267
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4315
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4268
  * +12 = +0xC: dword: 0 (reserved)
4316
  * +12 = +0xC: dword: 0 (reserved)
4269
  * +16 = +0x10: dword: 0 (reserved)
4317
  * +16 = +0x10: dword: 0 (reserved)
4270
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4318
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4271
    given in the general description
4319
    given in the general description
4272
    or
4320
    or
4273
  * +20 = +0x14: db 0
4321
  * +20 = +0x14: db 0
4274
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4322
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4275
Returned value:
4323
Returned value:
4276
  * eax > 0 - program is loaded, eax contains PID
4324
  * eax > 0 - program is loaded, eax contains PID
4277
  * eax < 0 - an error has occured, -eax contains
4325
  * eax < 0 - an error has occured, -eax contains
4278
    file system error code
4326
    file system error code
4279
  * ebx destroyed
4327
  * ebx destroyed
4280
Remarks:
4328
Remarks:
4281
  * Command line must be terminated by the character with the code 0
4329
  * Command line must be terminated by the character with the code 0
4282
    (ASCIIZ-string); function takes into account either all characters
4330
    (ASCIIZ-string); function takes into account either all characters
4283
    up to terminating zero inclusively or first 256 character
4331
    up to terminating zero inclusively or first 256 character
4284
    regarding what is less.
4332
    regarding what is less.
4285
  * If the process is started as debugged, it is created in
4333
  * If the process is started as debugged, it is created in
4286
    the suspended state; to run use subfunction 5 of function 69.
4334
    the suspended state; to run use subfunction 5 of function 69.
4287
 
4335
 
4288
======================================================================
4336
======================================================================
4289
========== Function 71, subfunction 1 - set window caption. ==========
4337
========== Function 71, subfunction 1 - set window caption. ==========
4290
======================================================================
4338
======================================================================
4291
Parameters:
4339
Parameters:
4292
  * eax = 71 - function number
4340
  * eax = 71 - function number
4293
  * ebx = 1 - subfunction number
4341
  * ebx = 1 - subfunction number
4294
  * ecx = pointer to caption string
4342
  * ecx = pointer to caption string
4295
Returned value:
4343
Returned value:
4296
  * function does not return value
4344
  * function does not return value
4297
Remarks:
4345
Remarks:
4298
  * String must be in the ASCIIZ-format. Disregarding real string
4346
  * String must be in the ASCIIZ-format. Disregarding real string
4299
    length, no more than 255 characters are drawn.
4347
    length, no more than 255 characters are drawn.
4300
  * Pass NULL in ecx to remove caption.
4348
  * Pass NULL in ecx to remove caption.
4301
 
4349
 
4302
======================================================================
4350
======================================================================
4303
=============== Function -1 - terminate thread/process ===============
4351
=============== Function -1 - terminate thread/process ===============
4304
======================================================================
4352
======================================================================
4305
Parameters:
4353
Parameters:
4306
  * eax = -1 - function number
4354
  * eax = -1 - function number
4307
Returned value:
4355
Returned value:
4308
  * function does not return neither value nor control
4356
  * function does not return neither value nor control
4309
Remarks:
4357
Remarks:
4310
  * If the process did not create threads obviously, it has only
4358
  * If the process did not create threads obviously, it has only
4311
    one thread, which termination results in process termination.
4359
    one thread, which termination results in process termination.
4312
  * If the current thread is last in the process, its termination
4360
  * If the current thread is last in the process, its termination
4313
    also results in process terminates.
4361
    also results in process terminates.
4314
  * This function terminates the current thread. Other thread can be
4362
  * This function terminates the current thread. Other thread can be
4315
    killed by call to subfunction 2 of function 18.
4363
    killed by call to subfunction 2 of function 18.
4316
 
4364
 
4317
======================================================================
4365
======================================================================
4318
=========================== List of events ===========================
4366
=========================== List of events ===========================
4319
======================================================================
4367
======================================================================
4320
Next event can be retrieved by the call of one from functions 10
4368
Next event can be retrieved by the call of one from functions 10
4321
(to wait for event), 11 (to check without waiting), 23
4369
(to wait for event), 11 (to check without waiting), 23
4322
(to wait during the given time).
4370
(to wait during the given time).
4323
These functions return only those events, which enter into a mask set
4371
These functions return only those events, which enter into a mask set
4324
by function 40. By default it is first three,
4372
by function 40. By default it is first three,
4325
there is enough for most applications.
4373
there is enough for most applications.
4326
Codes of events:
4374
Codes of events:
4327
  * 1 = redraw event (is reset by call to function 0)
4375
  * 1 = redraw event (is reset by call to function 0)
4328
  * 2 = key on keyboard is pressed (acts, only when the window is
4376
  * 2 = key on keyboard is pressed (acts, only when the window is
4329
    active) or hotkey is pressed; is reset, when all keys from
4377
    active) or hotkey is pressed; is reset, when all keys from
4330
    the buffer are read out by function 2
4378
    the buffer are read out by function 2
4331
  * 3 = button is pressed, defined earlier by function 8
4379
  * 3 = button is pressed, defined earlier by function 8
4332
    (or close button, created implicitly by function 0;
4380
    (or close button, created implicitly by function 0;
4333
    minimize button is handled by the system and sends no message;
4381
    minimize button is handled by the system and sends no message;
4334
    acts, only when the window is active;
4382
    acts, only when the window is active;
4335
    is reset when all buttons from the buffer
4383
    is reset when all buttons from the buffer
4336
    are read out by function 17)
4384
    are read out by function 17)
4337
  * 4 = reserved (in current implementation never comes even after
4385
  * 4 = reserved (in current implementation never comes even after
4338
    unmasking by function 40)
4386
    unmasking by function 40)
4339
  * 5 = the desktop background is redrawed (is reset automatically
4387
  * 5 = the desktop background is redrawed (is reset automatically
4340
    after redraw, so if in redraw time program does not wait and
4388
    after redraw, so if in redraw time program does not wait and
4341
    does not check events, it will not remark this event)
4389
    does not check events, it will not remark this event)
4342
  * 6 = mouse event (something happened - button pressing or moving;
4390
  * 6 = mouse event (something happened - button pressing or moving;
4343
    is reset at reading)
4391
    is reset at reading)
4344
  * 7 = IPC event (see function 60 -
4392
  * 7 = IPC event (see function 60 -
4345
    Inter Process Communication; is reset at reading)
4393
    Inter Process Communication; is reset at reading)
4346
  * 8 = network event (is reset at reading)
4394
  * 8 = network event (is reset at reading)
4347
  * 9 = debug event (is reset at reading; see
4395
  * 9 = debug event (is reset at reading; see
4348
    debug subsystem)
4396
    debug subsystem)
4349
  * 16..31 = event with appropriate IRQ
4397
  * 16..31 = event with appropriate IRQ
4350
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4398
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4351
 
4399
 
4352
======================================================================
4400
======================================================================
4353
=================== Error codes of the file system ===================
4401
=================== Error codes of the file system ===================
4354
======================================================================
4402
======================================================================
4355
  * 0 = success
4403
  * 0 = success
4356
  * 1 = base and/or partition of a hard disk is not defined
4404
  * 1 = base and/or partition of a hard disk is not defined
4357
    (by subfunctions 7, 8 of function 21)
4405
    (by subfunctions 7, 8 of function 21)
4358
  * 2 = function is not supported for the given file system
4406
  * 2 = function is not supported for the given file system
4359
  * 3 = unknown file system
4407
  * 3 = unknown file system
4360
  * 4 = is returned only from function 'rename' by transmission of
4408
  * 4 = is returned only from function 'rename' by transmission of
4361
    the strongly incorrect parameter and in any way does not
4409
    the strongly incorrect parameter and in any way does not
4362
    correspond to the description in the kernel sources
4410
    correspond to the description in the kernel sources
4363
    "partition not defined at hd"
4411
    "partition not defined at hd"
4364
  * 5 = file not found
4412
  * 5 = file not found
4365
  * 6 = end of file, EOF
4413
  * 6 = end of file, EOF
4366
  * 7 = pointer lies outside of application memory
4414
  * 7 = pointer lies outside of application memory
4367
  * 8 = disk is full
4415
  * 8 = disk is full
4368
  * 9 = FAT table is destroyed
4416
  * 9 = FAT table is destroyed
4369
  * 10 = access denied
4417
  * 10 = access denied
4370
  * 11 = device error
4418
  * 11 = device error
4371
Application start functions can return also following errors:
4419
Application start functions can return also following errors:
4372
  * 30 = 0x1E = not enough memory
4420
  * 30 = 0x1E = not enough memory
4373
  * 31 = 0x1F = file is not executable
4421
  * 31 = 0x1F = file is not executable
4374
  * 32 = 0x20 = too many processes
4422
  * 32 = 0x20 = too many processes
-
 
4423
>
4375
>
4424
>
4376
>
4425
>
4377
>
4426
>
4378
>
4427
>
4379
>
-