Subversion Repositories Kolibri OS

Rev

Rev 114 | Rev 120 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 114 Rev 118
Line 1... Line 1...
1
SYSTEM FUNCTIONS of OS Kolibri 0.5.8.1
1
SYSTEM FUNCTIONS of OS Kolibri 0.5.8.1
Line 2... Line 2...
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 carried out by the command "int 0x40".
4
The call of the system function is executed by "int 0x40" command.
5
All registers, except for obviously indicated in returned value,
5
All registers except explicitly declared in the returned value,
Line 6... Line 6...
6
including the register of flags eflags, are saved.
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 ñêèíîì defines standard buttons of closing
13
working area. For windows with skin defines standard buttons for close
14
and minimization.
14
and minimize.
15
Parameters:
15
Parameters:
16
  * eax = 0 - number of the function
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 sizes
21
      * Y=0 - type I - window of the fixed size
22
      * Y=1 - only to define window area, nothing to draw
22
      * Y=1 - only define window area, draw nothing
23
      * Y=2 - type II - window with changed sizes
23
      * Y=2 - type II - window of the variable size
24
      * Y=3 - window with skinned
24
      * Y=3 - window with skin
25
      * other possible values (from 4 up to 15) reserved,
25
      * other possible values (from 4 up to 15) are reserved,
26
        function call with such Y is ignored
-
 
27
    * RR, GG, BB = accordingly red, green, blue
26
        function call with such Y is ignored
28
      colours of a working area of the window
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)
29
      (is ignored for style Y=2)
29
    * X = DCBA (bits)
30
    * X = DCBA (bits)
30
      * A = 1 - window has caption; for style Y=3 caption string
31
      * A = 1 - window has caption; if Y=3, caption string address could be passed in edi,
31
                  must be passed in edi, for other styles use
32
                otherwise use function 71 subfunction 1
32
                  subfunction 1 of function 71
33
      * B = 1 - draw all graphics primitives relative to window client area
33
      * B = 1 - coordinates of all graphics primitives are relative to
34
      * C - reserved
34
                  window client area
35
      * D = 8 - fill client area with gradient
35
      * C is reserved (set to 0)
36
      other values are reserved
36
      * D = 0 - normal filling of the working area, 1 - gradient
37
    The following parameters are intended for windows of a type I and II,
37
    The following parameters are intended for windows
38
    and ignored for styles Y=1,3:
38
    of a type I and II, and ignored for styles Y=1,3:
39
  * esi = 0xXYRRGGBB - colour of header
39
  * esi = 0xXYRRGGBB - color of the header
40
    * RR, GG, BB define colour
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 X and Y reserved
45
    * other values of X and Y are reserved
46
  * edi = 0x00RRGGBB - colour of a 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
  * Location and the sizes of the window are installed by the first call of
50
  * Position and sizes of the window are installed by the first
-
 
51
    call of this function and are ignored at subsequent; to change
-
 
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
51
    this function and are ignored at subsequent; for change of location
54
    by the first call of this function and is ignored at subsequent
-
 
55
    (strictly speaking, is ignored after a call to subfunction 2
52
    and/or of sizes already of created window use function 67.
56
    of function 12 - end redraw); to change caption of already created
-
 
57
    window use subfunction 1 of function 71.
53
  * If to use windows of appropriate styles, location and - or the sizes of
58
  * If the window has appropriate styles, position and/or sizes can be
54
    the window can vary by the user.
59
    changed by user. Current position and sizes can be obtained
55
    Current location and the sizes can be obtained by function 9.
60
    by function 9.
-
 
61
  * The window must fit on the screen. If the transferred
56
  * The window should be located on the screen. If the transferred coordinates
62
    coordinates and sizes do not satisfy to this condition,
57
    nd the sizes do not satisfy to this condition, appropriate coordinate
-
 
58
    (or, probably, is considered both) as zero, and if also it does not help,
63
    appropriate coordinate (or, probably, both) is considered as zero,
59
    the appropriate size (or, probably, both) is installed in a size of the
64
    and if also it does not help, the appropriate size
60
    screen.
65
    (or, probably, both) is installed in a size of the screen.
61
    
66
    
62
    Further we shall designate xpos, ypos, xsize, ysize - values transmitted
67
    Further we shall designate xpos,ypos,xsize,ysize - values
63
    in ebx, ecx. The coordinates are resulted concerning the left upper corner
68
    transmitted in ebx,ecx. The coordinates are resulted concerning
64
    of the window, which, thus, is set as (0,0), coordinate of the right lower
69
    the left upper corner of the window, which, thus, is set as (0,0),
65
    corner essence (xsize, ysize).
70
    coordinates of the right lower corner essence (xsize,ysize).
66
  * The sizes of the window are understood in sense of coordinates of the
71
  * The sizes of the window are understood in sence of coordinates
67
    right lower corner. This concerns and to all other functions. It means,
72
    of the right lower corner. This concerns all other functions too.
68
    that the real sizes on 1 pixel are more.
-
 
69
  * Look of the window of a type I:
73
    It means, that the real sizes are on 1 pixel more.
70
    * draw external frame of colour indicated in edi,
74
  * The window of type I looks as follows:
71
      in width 1 pixel
75
    * draw external frame of color indicated in edi, 1 pixel in width
72
    * draw header - rectangle with the left upper corner (1,1) and right lower
76
    * draw header - rectangle with the left upper corner (1,1) and
73
      (xsize-1, min (25, ysize)) colour indicated in esi
77
      right lower (xsize-1,min(25,ysize)) color indicated in esi
74
      (in view of a gradient)
78
      (taking a gradient into account)
75
    * If ysize > =26, the working area of the window - rectangle with the left
79
    * if ysize>=26, fill the working area of the window -
-
 
80
      rectangle with the left upper corner (1,21) and right lower
-
 
81
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
76
      upper corner (1,21) and right lower
82
      indicated in edx (taking a gradient into account)
77
      (xsize-1, ysize-1) (sizes (xsize-1) * (ysize-21)) - colour
83
    * if A=1 and caption has been already set by subfunction 1
78
       indicated in edx (in view of a gradient) is painted over
84
      of function 71, it is drawn in the corresponding place of header
79
  * Look of the window of a type Y=1:
85
  * The window of style Y=1 looks as follows:
80
    * completely defined by the application
86
    * completely defined by the application
81
  * Look of the window of a type II:
87
  * The window of type II looks as follows:
82
    * draw external frame of width 1 pixel of the "shaded" colour
88
    * draw external frame of width 1 pixel with the "shaded" color
83
      edi (all making colours decrease twice)
-
 
84
    * drawn intermediate frame of width 3 pixels of colour edi
89
      edi (all components of the color decrease twice)
85
    * draw internal frame of width 1 pixel
90
    * draw intermediate frame of width 3 pixels with color edi
86
      "shaded" colour edi
91
    * draw internal frame of width 1 pixel with the "shaded" color edi
87
    * draw header - rectangle with the left upper corner (4,4)
92
    * draw header - rectangle with the left upper corner (4,4)
88
      and right lower (xsize-4,min(20,ysize)) colour, indicated â esi
93
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
89
      (in view of a gradient)
94
      (taking a gradient into account)
-
 
95
    * if ysize>=26, fill the working area of the window -
-
 
96
      rectangle with the left upper corner (5,20) and right lower
-
 
97
      (xsize-5,ysize-5) with color indicated in edx
90
    * If ysize > =26, the working area of the window is painted over -
98
      (taking a gradient into account)
91
      rectangle with the left upper corner (5,20) and right lower
99
    * if A=1 and caption has been already set by subfunction 1
92
      (xsize-5,ysize-5) - colour indicated in edx (in view of a gradient)
100
      of function 71, it is drawn in the corresponding place of header
93
  * Look of the window with skinned:
101
  * The skinned window looks as follows:
94
    * draw external frame of width 1 pixel
102
    * draw external frame of width 1 pixel
95
      colour 'outer' from skin
103
      with color 'outer' from the skin
96
    * draw intermediate framework of width 3 pixels
104
    * draw intermediate frame of width 3 pixel
97
      colour 'frame' from skin
105
      with color 'frame' from the skin
98
    * draw internal framework of width 1 pixel
106
    * draw internal frame of width 1 pixel
99
      colour 'inner' from skin
107
      with color 'inner' from the skin
100
    * draw header (on pictures from skin) in a rectangle
108
    * draw header (on bitmaps from the skin) in a rectangle
101
      (0,0) - (xsize,_skinh-1)
109
      (0,0) - (xsize,_skinh-1)
-
 
110
    * if ysize>=26, fill the working area of the window -
102
    * If ysize > =26, the working area of the window is painted over -
111
      rectangle with the left upper corner (5,_skinh) and right lower
103
      rectangle with the left upper corner (5, _skinh) and right lower
112
      (xsize-5,ysize-5) with color indicated in edx
-
 
113
      (taking a gradient into account)
-
 
114
    * define two standard buttons: for close and minimize
104
      (xsize-5,ysize-5) - colour indicated in edx (in view of a gradient)
115
      (see function 8)
105
    * two standard buttons are defined: closings and minimizations
116
    * if A=1 and edi contains (nonzero) pointer to caption string,
Line 106... Line 117...
106
      (see function 8)
117
      it is drawn in place in header defined in the skin
107
    * value _skinh is accessible as result of call
118
    * value _skinh is accessible as the result of call
108
      subfunction 4 functions 48
119
      subfunction 4 of function 48
109
 
120
 
110
======================================================================
121
======================================================================
111
================= Function 1 - put a point in the window. ============
122
================ Function 1 - put pixel in the window. ===============
112
======================================================================
123
======================================================================
113
Parameters:
124
Parameters:
114
  * eax = 1 - number of the function
125
  * eax = 1 - function number
115
  * ebx = x-coordinate (concerning the window)
126
  * ebx = x-coordinate (relative to the window)
116
  * ecx = y-coordinate (concerning the window)
127
  * ecx = y-coordinate (relative to the window)
117
  * edx = 0x00RRGGBB - colour of a point
128
  * edx = 0x00RRGGBB - color of a pixel
Line 118... Line 129...
118
    edx = 0x01xxxxxx - to invert colour of a point
129
    edx = 0x01xxxxxx - invert color of a pixel
119
          (low 24 bits ignored)
130
          (low 24 bits are ignored)
120
Returned value:
131
Returned value:
121
  * function does not return value
132
  * function does not return value
122
 
133
 
123
======================================================================
134
======================================================================
124
======== Function 2 - receive the code of the pressed key. ===========
135
============ Function 2 - get the code of the pressed key. ===========
125
======================================================================
136
======================================================================
126
Takes away the code of the pressed key from the buffer.
137
Takes away the code of the pressed key from the buffer.
127
Parameters:
138
Parameters:
128
  * eax = 2 - number of the function
139
  * eax = 2 - function number
129
Returned value:
140
Returned value:
130
  * if the buffer is empty, comes back eax=1
141
  * if the buffer is empty, function returns eax=1
131
  * If the buffer is nonblank, that comes back al=0, ah=code of the pressed key,
142
  * if the buffer is not empty, function returns al=0,
132
    high word of the register eax is set zero
143
    ah=code of the pressed key, high word of eax is zero
133
  * If there is "hotkey", comes back
144
  * if there is "hotkey", function returns al=2,
134
    al=2, ah=scancode of the pressed key (0 for direction keys),
145
    ah=scancode of the pressed key (0 for control keys),
135
    high word of the register eax contains a status of direction keys
146
    high word of eax contains a status of control keys at the moment
136
    at the moment of pressing a hotkey
147
    of pressing a hotkey
137
Remarks:
148
Remarks:
138
  * There is a common system buffer of the pressed keys by a size of 120 bytes,
149
  * There is a common system buffer of the pressed keys
139
    organized as queue.
150
    by a size of 120 bytes, organized as queue.
140
  * There is one more common system buffer on 120 "hotkey".
151
  * There is one more common system buffer on 120 "hotkeys".
141
  * By call of this function the application with the inactive window
152
  * If the application with the inactive window calls this function,
142
    considers, that the buffer of the pressed keys is empty.
153
    the buffer of the pressed keys is considered to be empty.
143
  * By default this function returns ASCII-codes; to switch to the mode
154
  * By default this function returns ASCII-codes; to switch
144
    scancode (and back) it is possible with usage of the function 66.
155
    to the scancodes mode (and back) use function 66.
145
    However, the hotkey always come back as scancodes.
156
    However, hotkeys are always notificated as scancodes.
-
 
157
  * To find out, what keys correspond to what codes, start
146
  * Ffind out, what keys correspond to what codes, is possible, having started
158
    the application keyascii and scancode.
147
    the applications keyascii and scancode.
159
  * Scancodes come directly from keyboard and are fixed;
148
  * Scancodes come back directly by keyboard and are fixed; ASCII-codes turn
160
    ASCII-codes turn out with usage of the conversion tables,
149
    out with usage of the conversion tables, which can be installed
161
    which can be set by subfunction 2 of function 21
Line 150... Line 162...
150
    subfunction 2 functions 21 and to read subfunction 2 functions 26.
162
    and get by subfunction 2 of function 26.
151
  * As a consequence, ASCII-codes take into account current keyboard layout
163
  * As a consequence, ASCII-codes take into account current
152
    (rus/en) as against scancodes.
164
    keyboard layout (rus/en) as opposed to scancodes.
153
  * The information only about those hotkeys acts which were defined by this
165
  * This function notifies only about those hotkeys, which were
154
    stream subfunction 4 functions 66.
166
    defined by this thread by subfunction 4 of function 66.
155
 
167
 
156
======================================================================
168
======================================================================
157
================ Function 3 - get system time. =======================
169
==================== Function 3 - get system time. ===================
158
======================================================================
170
======================================================================
159
Parameters:
171
Parameters:
160
  * eax = 3 - number of the function
172
  * eax = 3 - function number
161
Returned value:
173
Returned value:
162
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
174
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
163
  * each unit comes back as BCD-number, for example,
175
  * each item is BCD-number, for example,
Line 164... Line 176...
164
    for time 23:59:59 result will be 0x00595923
176
    for time 23:59:59 function returns 0x00595923
165
Remarks:
177
Remarks:
166
  * Look also subfunction 9 functions 26 - obtaining of time from the moment
178
  * See also subfunction 9 of function 26 - get time from
167
    of start of the system; it in many cases is more convenient, as returns
-
 
168
    simply DWORD-value of the counter of time.
-
 
169
  * System time can be installed by the function 22.
-
 
170
 
179
    the moment of start of the system; it is more convenient, because
171
======================================================================
180
    returns simply DWORD-value of the time counter.
172
================ Function 4 - draw text in the window. ===============
181
  * System time can be set by function 22.
173
======================================================================
182
 
174
Can output both strings with given length and NULL-terminated strings
183
======================================================================
175
(0x0) - ASCIIZ(string  db  'text',0). To draw ASCIIZ string, pass -1
184
============ Function 4 - draw text string in the window. ============
176
in esi (mov esi,-1).
185
======================================================================
177
Parameters:
186
Parameters:
178
  * eax = 4 - number of the function
187
  * eax = 4 - function number
179
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
188
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
180
  * ecx = 0xX0RRGGBB, where
189
  * ecx = 0xX0RRGGBB, where
181
    * RR, GG, BB set colour of the text
190
    * RR, GG, BB specify text color
-
 
191
    * X specifies the used font: 0=system monospaced,
-
 
192
      1=system font of variable width
-
 
193
  * edx = pointer to the beginning of the string
182
    * X sets the used font: 0=system monowide,
194
  * esi = length of the string, must not exceed 255
183
      1=system font of variable width
195
Returned value:
184
  * edx = pointer by the beginning of string
196
  * function does not return value
185
  * esi = length of string, should be no more 255
197
Remarks:
Line 186... Line 198...
186
Returned value:
198
  * Function outputs either first (esi and 0xFF) characters or
187
  * function does not return value
199
    all characters before (but not including) terminating zero
188
Remarks:
200
    (for ASCIIZ-strings) depending on what occurs first.
189
  * The 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,
190
    second system font - from char2.mt.
202
    second - from char2.mt.
191
  * Both fonts have height 9 pixels, width of the monowide font
203
  * Both fonts have height 9 pixels, width of the monospaced font
192
    is equal 6 pixels.
204
    is equal to 6 pixels.
193
 
205
 
194
======================================================================
206
======================================================================
195
========================= Function 5 - pause. =========================
207
========================= Function 5 - delay. ========================
196
======================================================================
208
======================================================================
197
Delays execution of the program on the given time.
209
Delays execution of the program on the given time.
198
Parameters:
210
Parameters:
199
  * eax = 5 - number of the function
211
  * eax = 5 - function number
200
  * ebx = time in the 1/100 of second
212
  * ebx = time in the 1/100 of second
201
Returned value:
213
Returned value:
202
  * function does not return value
214
  * function does not return value
203
Remarks:
215
Remarks:
204
  * The transmission ebx=0 does not transfer handle the following process
216
  * Passing ebx=0 does not transfer control to the next process
205
    and at all does not make any operations. If really it is required to
217
    and does not make any operations at all. If it is really required
206
    transfer handle to the following process (to complete a current time
218
    to transfer control to the next process (to complete a current
207
    slice), use subfunction of 1 function 68.
219
    time slice), use subfunction 1 of function 68.
208
  * At current realization there will be an immediate return from the function,
220
  * At current implementation there will be an immediate return from
209
    if the addition ebx with current value of the counter of time will call
221
    the function, if the addition of ebx with current value of
210
    32-bit overflow.
222
    time counter will call 32-bit overflow.
211
 
223
 
212
======================================================================
224
======================================================================
213
============== Function 6 - read the file with ramdisk. ==============
225
============== Function 6 - read the file from ramdisk. ==============
214
======================================================================
226
======================================================================
215
Parameters:
227
Parameters:
216
  * eax = 6 - number of the function
228
  * eax = 6 - function number
217
  * ebx = pointer on a filename
229
  * ebx = pointer to the filename
218
  * ecx = number of the start block, beginning from 1;
230
  * ecx = number of start block, beginning from 1;
219
    ecx=0 - read from a beginning of the file (same, as ecx=1);
231
    ecx=0 - read from the beginning of the file (same as ecx=1)
220
  * edx = number of blocks for reading;
232
  * edx = number of blocks to read;
221
    edx=0 - read one block (same, as edx=1)
233
    edx=0 - read one block (same as edx=1)
222
  * esi = pointer on area of memory, where the data will be written
234
  * esi = pointer to memory area for the data
223
Returned value:
235
Returned value:
224
  * eax = file size in bytes, if the file is successfully read
236
  * eax = file size in bytes, if the file was successfully read
225
  * eax = -1, if the file is not retrieved
237
  * eax = -1, if the file was not found
226
Remarks:
238
Remarks:
-
 
239
  * This function is out-of-date; function 70 allows
227
  * The given function is out-of-date; the function 70 allows to fulfil
240
    to fulfil the same operations with the extended possibilities.
228
    the same operations with the extended possibilities.
241
  * Block = 512 bytes.
229
  * Block = 512 bytes.
242
  * For reading all file you can specify the certainly large value
230
  * For reading all file it is possible to specify the certainly large value
243
    in edx, for example, edx = -1; but in this case be ready that
231
    in edx, for example, edx = -1; but in this case be ready that the program
244
    the program will "fall", if the file will appear too large and can
232
    "will fall", if the file will appear too large and "will not be placed" in
245
    not be placed in the program memory.
233
    memory of the program.
246
  * The filename must be either in the format 8+3 characters
Line 234... Line 247...
234
  * The filename should be or in the format 8+3 characters (first 8 characters
247
    (first 8 characters - name itself, last 3 - extension,
235
    - purely name, last 3 - extension, the short names and extensions are
248
    the short names and extensions are supplemented with spaces),
236
    supplemented by blanks), or in the format 8.3 characters
249
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
237
    "FILE.EXT" / "FILE.EX " (name no more than 8 characters, point,
250
    (name no more than 8 characters, dot, extension 3 characters
238
    extension 3 characters supplemented if necessary by blanks).
251
    supplemented if necessary by spaces).
239
    The filename should be written by capital letters. The completing
252
    The filename must be written with capital letters. The terminating
240
    character with the code 0 is not necessary (ASCIIZ-string).
253
    character with code 0 is not necessary (not ASCIIZ-string).
241
  * Current implementation ramdisk does not support the directory.
254
  * This function does not support folders on the ramdisk.
242
 
255
 
243
======================================================================
256
======================================================================
244
=============== Function 7 - draw image in the window. ===============
257
=============== Function 7 - draw image in the window. ===============
245
======================================================================
258
======================================================================
246
Parameters:
259
Paramters:
247
  * eax = 7 - number of the function
260
  * eax = 7 - function number
Line 248... Line 261...
248
  * ebx = pointer on the image in the format BBGGRRBBGGRR...
261
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
249
  * ecx = [size on axis x]*65536 + [size on axis y]
262
  * ecx = [size on axis x]*65536 + [size on axis y]
250
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
263
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
251
Returned value:
264
Returned value:
252
  * function does not return value
265
  * function does not return value
253
Remarks:
266
Remarks:
254
  * Coordinates of the image are coordinates of the upper left corner of the
267
  * Coordinates of the image are coordinates of the upper left corner
255
    image concerning the window.
268
    of the image relative to the window.
256
  * Size of the image in bytes is 3*xsize*ysize.
269
  * Size of the image in bytes is 3*xsize*ysize.
257
 
270
 
258
======================================================================
271
======================================================================
259
=============== Function 8 - define/delete the button. ===============
272
=============== Function 8 - define/delete the button. ===============
260
======================================================================
273
======================================================================
261
Parameters for îïðåäåëåíèÿ êíîïêè:
274
Parameters for button definition:
262
  * eax = 8 - number of the function
275
  * eax = 8 - function number
263
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
276
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
264
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
277
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
265
  * edx = 0xXYnnnnnn, where:
278
  * edx = 0xXYnnnnnn, where:
266
    * nnnnnn = identifier of the button
279
    * nnnnnn = identifier of the button
267
    * high (31-st) bit edx is reset
280
    * high (31st) bit of edx is cleared
268
    * if 30-th bit edx is installed - to not draw the button
281
    * if 30th bit of edx is set - do not draw the button
269
    * If 29-th bit edx is installed - to not draw a frame
282
    * if 29th bit of edx is set - do not draw a frame
270
      at pressing the button
283
      at pressing the button
-
 
284
  * esi = 0x00RRGGBB - color of the button
271
  * esi = 0x00RRGGBB - colour of the button
285
Parameters for button deleting:
272
Parameters for deleting the button:
286
  * eax = 8 - function number
273
  * eax = 8 - number of the function
287
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
274
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
288
Returned value:
275
Returned value:
289
  * function does not return value
276
  * function does not return value
290
Remarks:
277
Remarks:
291
  * Sizes of the button must be more than 0 and less than 0x8000.
278
  * Sizes of the button should be more than 0 and less than 0x8000.
292
  * For windows with skin definition of the window
279
  * For windows with skin at definition of the window (call of 0-th function)
293
    (call of 0th function) creates two standard buttons -
280
    there are two standard buttons - closing of the window with the
294
    for close of the window with identifier 1 and
281
    identifier 1 and minimization of the window with the identifier 0xffff.
295
    for minimize of the window with identifier 0xffff.
282
  * The creation of two buttons with identical identifiers is admitted.
296
  * The creation of two buttons with same identifiers is admitted.
283
  * The button with the identifier 0xffff at pressing is interpreted by the
297
  * The button with the identifier 0xffff at pressing is interpreted
284
     system as the button of minimization, the system handles such pressing
298
    by the system as the button of minimization, the system handles
285
     independently, not accessing to the application. In rest it is
299
    such pressing independently, not accessing to the application.
286
     the usual button.
300
    In rest it is usual button.
287
  * Total of buttons for all applications is limited to number 4095.
301
  * Total number of buttons for all applications is limited to 4095.
288
 
302
 
289
======================================================================
303
======================================================================
290
========== Function 9 - information on thread of execution. ==========
304
============ Function 9 - information on execution thread. ===========
291
======================================================================
305
======================================================================
292
Parameters:
306
Parameters:
293
  * eax = 9 - number of the function
307
  * eax = 9 - function number
294
  * ebx = pointer on the buffer of a size 1 Kb
308
  * ebx = pointer to 1-Kb buffer
295
  * ecx = number of the slot of thread
309
  * ecx = number of the slot of the thread
296
    ecx = -1 - get information on current thread
310
    ecx = -1 - get information on the current thread
297
Returned value:
311
Returned value:
298
  * eax = maximum number of the slot of thread
312
  * eax = maximum number of the slot of a thread
299
  * buffer, which specifies ebx, contains the following information:
313
  * buffer pointed to by ebx contains the following information:
300
    * +0: dword: usage of the processor (how many clock ticks per one second
314
    * +0: dword: usage of the processor (how many time units
301
      leaves on fulfilment of this thread)
315
      per second leaves on execution of this thread)
302
    * +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
303
    * +6: word: (there is no ratio to the requested thread)
317
    * +6: word: (has no relation to the specified thread)
304
      number of the slot thread, which window is in the window stack
318
      number of the thread slot, which window has in the window stack
305
      in a position ecx
319
      position ecx
306
    * +8: word: reserved
320
    * +8: word: reserved
307
    * +10 = +0xA: 11 bytes: name of the process
321
    * +10 = +0xA: 11 bytes: name of the process
308
      (name of an appropriate executable file in the format 8+3)
322
      (name of corresponding executable file in the format 8+3)
309
    * +21 = +0x15: byte: alignment, this byte does not vary
323
    * +21 = +0x15: byte: alignment, this byte preserves
310
    * +22 = +0x16: dword: address of the process in memory
324
    * +22 = +0x16: dword: address of the process in memory
311
    * +26 = +0x1A: dword: size of used memory - 1
325
    * +26 = +0x1A: dword: size of used memory - 1
312
    * +30 = +0x1E: dword: identifier (PID/TID)
326
    * +30 = +0x1E: dword: identifier (PID/TID)
313
    * +34 = +0x22: dword: coordinate of the window thread on axis x
327
    * +34 = +0x22: dword: coordinate of the thread window on axis x
314
    * +38 = +0x26: dword: coordinate of the window thread on axis y
328
    * +38 = +0x26: dword: coordinate of the thread window on axis y
315
    * +42 = +0x2A: dword: size of the window thread on axis x
329
    * +42 = +0x2A: dword: size of the thread window on axis x
316
    * +46 = +0x2E: dword: size of the window thread on axis y
330
    * +46 = +0x2E: dword: size of the thread window on axis y
317
    * +50 = +0x32: word: status of the slot thread:
331
    * +50 = +0x32: word: status of the thread slot:
318
      * 0 = thread worked
332
      * 0 = thread is running
319
      * 1 = thread paused
333
      * 1 = thread is suspended
320
      * 2 = thread paused at the moment of waiting event
334
      * 2 = thread is suspended while waiting for event
-
 
335
      * 3 = thread is terminating as a result of call to function -1
321
      * 3 = thread completed as a result of function call -1 or
336
        or under duress as a result of call to subfunction 2
-
 
337
        of function 18 or termination of the system
322
        under duress as a consequence of call subfunction 2 functions 18
338
      * 4 = thread is terminating as a result of exception
323
        or termination of the system
339
      * 5 = thread waits for event
-
 
340
      * 9 = requested slot is free, all other information on the slot
324
      * 4 = thread is completed as a result of exception
341
        is not meaningful
325
      * 5 = thread wait event
342
Remarks:
326
      * 9 = requested slot is free,
343
  * Slots are numbered starting from 1.
327
        all other information on the slot is not meaningful
344
  * Returned value is not a total number of threads, because there
328
Remarks:
345
    can be free slots.
329
  * Slots are numbered with 1.
346
  * When process is starting, system automatically creates
330
  * Returned value not is a total number of streams, as there are free slots.
347
    execution thread.
331
  * Ïðè ñîçäàíèè ïðîöåññà àâòîìàòè÷åñêè ñîçäàåòñÿ thread âûïîëíåíèÿ.
348
  * Function gives information on the thread. Each process has
332
  * Function produces the information on thread. Each process has even one
349
    at least one thread. One process can create many threads,
333
    thread. One process can create some thread, in this case everyone thread
350
    in this case each thread has its own slot and the fields
334
    receives the slot, and the fields +10, +22, +26 in these slots coincide.
351
    +10, +22, +26 in these slots coincide.
335
    For the applications there is no common way to define, whether two thread 
352
    Applications have no common way to define whether two threads
336
    belong to one process.
353
    belong to one process.
337
  * Active window - window which is taking place on top of the window stack,
354
  * The active window - window on top of the window stack -
338
    it receives the messages on a keyboard input. For it the position in the
355
    receives the messages on a keyboard input. For such window
339
    window stack coincides with returned value.
356
    the position in the window stack coincides with returned value.
340
  * Slot 1 corresponds to special thread of an operating system, for which:
357
  * Slot 1 corresponds to special system thread, for which:
341
    * window is in the bottom of the window stack, the fields +4 and +6
358
    * the window is in the bottom of the window stack, the fields
342
      contain value 1
359
      +4 and +6 contain value 1
343
    * Nname of the process - "OS/IDLE" (supplemented by blanks)
360
    * name of the process - "OS/IDLE" (supplemented by spaces)
344
    * address of the process is equal memory 0, size of used memory
361
    * address of the process in memory is 0, size of used memory is
345
      16 Mb (0x1000000)
362
      16 Mb (0x1000000)
346
    * PID=1
363
    * PID=1
347
    * coordinates and sizes of the window conditionally rely equal 0
364
    * coordinates and sizes of the window are by convention set to 0
348
    * status of the slot - always 0 (worked)
365
    * status of the slot is always 0 (running)
349
    * The execution time adds of time leaving on purely operation, and down
366
    * the execution time adds of time leaving on operations itself
350
      time in waiting interruption (which can be received by call
367
      and idle time in waiting for interrupt (which can be got by call
351
      subfunction 4 functions 18).
368
      to subfunction 4 of function 18).
352
  * Since the slot 2, the usual applications are placed.
369
  * Beginning from slot 2, the normal applications are placed.
353
  * Usual applications are placed in memory to the address 0x10000000
370
  * The normal applications are placed in memory at the address
354
    (constant of a kernel 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.
355
    Intersection does not occur, as for each process the own page table.
373
  * At creation of the thread it is assigned the slot
356
  * At creation thread to it are assigned the slot in the system table and
374
    in the system table and identifier (Process/Thread IDentifier =
357
    identifier (Process/Thread IDentifier = PID/TID), which for given thread
375
    PID/TID), which do not vary with time for given thread.
358
    do not vary in the subsequent time.
376
    After completion of the thread its slot can be anew used
Line 359... Line 377...
359
    After completion thread its slot can be anew used for another thread.
377
    for another thread. The thread identifier can not be assigned
360
    The identifier thread can not be assigned to other stream even after
378
    to other thread even after completion of this thread.
361
    completion first.
379
    Identifiers, assigned to new threads, grow monotonously.
362
    Identifiers, assigned to new thread, monotonously grow.
380
  * If the thread has not yet defined the window by call to
363
  * If thread yet has not defined the window by function call 0,
381
    function 0, the position and the sizes
364
    a location and the sizes of this window rely in zero.
382
    of its window are considered to be zero.
Line 365... Line 383...
365
  * In the given moment the part of the buffer by a size 52 = 0x34 of byte
383
  * At the moment only the part of the buffer by a size
366
    is used only. Nevertheless it is recommended to use the buffer
384
    52 = 0x34 bytes is used. Nevertheless it is recommended to use
367
    by a size 1 KB for the future compatibility, in the future some fields
385
    1-Kb buffer for the future compatibility, in the future
368
    can be added.
386
    some fields can be added.
369
 
387
 
370
======================================================================
388
======================================================================
371
====================== Function 10 - wait event. =====================
389
==================== Function 10 - wait for event. ===================
372
======================================================================
390
======================================================================
373
If the message queue is empty, waits for appearance of the message in queue.
391
If the message queue is empty, waits for appearance of the message
374
In such status thread does not receive CPU time.
392
in queue. In this state thread does not consume CPU time.
375
Then reads out the message from queue.
393
Then reads out the message from queue.
376
 
394
 
377
Parameters:
395
Parameters:
378
  * eax = 10 - number of the function
396
  * eax = 10 - function number
379
Returned value:
397
Returned value:
380
  * eax = event (look the list of events)
398
  * eax = event (see the list of events)
381
Remarks:
399
Remarks:
382
  * Those events are taken into account only which enter into a mask installed
400
  * Those events are taken into account only which enter into
383
    by the function 40. By default it is events redraw, pressing keys
401
    a mask set by function 40. By default it is
384
    and buttons.
402
    redraw, key and button events.
385
  * For check, whether there is a message in queue, use the function 11.
403
  * To check, whether there is a message in queue, use function 11.
386
    To wait for the no more defined time, use the function 23.
404
    To wait for no more than given time, use function 23.
387
 
405
 
388
=======================================================================
406
======================================================================
389
= Function 11 - check up, whether there is an event, without waiting. =
407
=============== Function 11 - check for event, no wait. ==============
390
=======================================================================
408
======================================================================
391
If in a message queue there is any event, reads out and returns it.
409
If the message queue contains event, function reads out
Line 392... Line 410...
392
If queue is empty, returns zero.
410
and return it. If the queue is empty, function returns 0.
393
Parameters:
411
Parameters:
394
  * eax = 11 - number of the function
412
  * eax = 11 - function number
Line 395... Line 413...
395
Returned value:
413
Returned value:
396
  * eax = 0 - message queue is empty
414
  * eax = 0 - message queue is empty
397
  * èíà÷å eax = event (look the list of events)
415
  * else eax = event (see the list of events)
398
Remarks:
416
Remarks:
399
  * Those events are taken into account only which enter into a mask installed
417
  * Those events are taken into account only, which enter into
400
    by the function 40. By default it is events redraw, pressing keys
418
    a mask set by function 40. By default it is
Line 401... Line 419...
401
    and buttons.
419
    redraw, key and button events.
402
  * For waiting appearance of event in queue, use the function 10.
420
  * To wait for event, use function 10.
403
    To wait for the no more defined time, use the function 23.
421
    To wait for no more than given time, use function 23.
404
 
422
 
405
======================================================================
423
======================================================================
406
========= Function 12 - begin/complete redraw of the window. =========
424
=============== Function 12 - begin/end window redraw. ===============
407
======================================================================
425
======================================================================
408
 
426
 
409
---------- Subfunction 1 - begin redraw of the window. ---------------
427
------------ Subfunction 1 - begin redraw of the window. -------------
Line 410... Line 428...
410
Parameters:
428
Parameters:
411
  * eax = 12 - number of the function
429
  * eax = 12 - function number
412
  * ebx = 1 - number subfunction
430
  * ebx = 1 - subfunction number
413
Returned value:
431
Returned value:
414
  * function does not return value
432
  * function does not return value
415
 
433
 
416
--------- Subfunction 2 - complete redraw of the window. -------------
434
------------- Subfunction 2 - end redraw of the window. --------------
417
Parameters:
435
Parameters:
418
  * eax = 12 - number of the function
436
  * eax = 12 - function number
419
  * ebx = 2 - number subfunction
437
  * ebx = 2 - subfunction number
420
Returned value:
438
Returned value:
421
  * function does not return value
439
  * function does not return value
422
Remarks:
440
Remarks:
Line 423... Line 441...
423
  * Function of a beginning redraw all deletes defined by the
441
  * Subfunction 1 deletes all buttons defined with
424
    function 8 buttons, they should be defined again.
442
    function 8, they must be defined again.
425
 
443
 
426
======================================================================
444
======================================================================
427
============ Function 13 - draw a rectangle in the window. ===========
445
============ Function 13 - draw a rectangle in the window. ===========
428
======================================================================
446
======================================================================
429
Parameters:
447
Parameters:
430
  * eax = 13 - number of the function
448
  * eax = 13 - function number
431
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
449
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
432
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
450
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
433
  * edx = colour 0xRRGGBB èëè 0x80RRGGBB for a gradient of filling
451
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
434
Returned value:
452
Returned value:
435
  * function does not return value
453
  * function does not return value
436
Remarks:
454
Remarks:
Line 437... Line 455...
437
  * Coordinates are understood as coordinates of the left upper corner
455
  * Coordinates are understood as coordinates of the left upper corner
438
    of a rectangle concerning the window.
456
    of a rectangle relative to the window.
439
 
457
 
440
======================================================================
458
======================================================================
441
================ Function 14 - get sizes of the screen. ==============
459
=================== Function 14 - get screen size. ===================
442
======================================================================
460
======================================================================
443
Parameters:
461
Parameters:
444
  * eax = 14 - number of the function
462
  * eax = 14 - function number
445
Returned value:
463
Returned value:
446
  * eax = [xsize]*65536 + [ysize], where
464
  * eax = [xsize]*65536 + [ysize], where
447
  * xsize = x-coordinate of the right lower corner of the screen =
465
  * xsize = x-coordinate of the right lower corner of the screen =
448
            size on a horizontal - 1
466
            horizontal size - 1
449
  * ysize = y-coordinate of the right lower corner of the screen =
467
  * ysize = y-coordinate of the right lower corner of the screen =
450
            size on a vertical - 1
468
            vertical size - 1
451
Remarks:
469
Remarks:
452
  * Look also subfunction 5 functions 48 - to receive sizes of
470
  * See also subfunction 5 of function 48 - get sizes of
453
    a working area of the screen.
471
    working area of the screen.
454
 
472
 
455
========================================================================
473
======================================================================
Line 456... Line 474...
456
= Function 15, subfunction 1 - install a size of the background image. =
474
== Function 15, subfunction 1 - set a size of the background image. ==
457
========================================================================
475
======================================================================
458
Parameters:
476
Parameters:
459
  * eax = 15 - number of the function
477
  * eax = 15 - function number
460
  * ebx = 1 - number subfunction
478
  * ebx = 1 - subfunction number
461
  * ecx = width of the image
479
  * ecx = width of the image
462
  * edx = height of the image
480
  * edx = height of the image
463
Returned value:
481
Returned value:
464
  * function does not return value
482
  * function does not return value
465
Remarks:
483
Remarks:
466
  * Checks on a correctness is not done. The installation of the too large
484
  * There is no checks for correctness. The setting of too large
467
    values will result that the background will be entered with the data abroad
485
    values will result that the background will contain data abroad
468
    of buffer of the background map. The size of the buffer = 0x160000-0x10,
486
    of buffer for the background image. Buffer size = 0x160000-0x10,
469
    that corresponds to maximum sizes 800*600. (800*600*3=0x15F900)
487
    that corresponds to maximum size 800*600. (800*600*3=0x15F900)
470
  * For upgrade of the screen (after completion of a series of commands
488
  * For update of the screen (after completion of a series of commands
471
    working with a background) call subfunction 3 redraw of a background.
489
    working with a background) call subfunction 3.
472
  * There is a pair function of get of sizes of the background image - 
490
  * There is a pair function for get size of the background image -
473
    subfunction 1 function 39.
491
    subfunction 1 of function 39.
474
 
492
 
Line 475... Line 493...
475
======================================================================
493
======================================================================
476
= Function 15, subfunction 2 - put a point on the background image. ==
494
=== Function 15, subfunction 2 - put pixel on the background image. ==
477
======================================================================
495
======================================================================
478
Parameters:
496
Parameters:
479
  * eax = 15 - number of the function
497
  * eax = 15 - function number
480
  * ebx = 2 - number subfunction
498
  * ebx = 2 - subfunction number
481
  * ecx = offset
499
  * ecx = offset
482
  * edx = colour of a point 0xRRGGBB
500
  * edx = color of a pixel 0xRRGGBB
Line 483... Line 501...
483
Returned value:
501
Returned value:
484
  * function does not return value
502
  * function does not return value
485
Remarks:
503
Remarks:
486
  * Offset for a point with coordinates (x, y) is calculated as
504
  * Offset for a pixel with coordinates (x,y) is calculated as
487
    (x+y*xsize)*3.
505
    (x+y*xsize)*3.
488
  * If the indicated offset exceeds 0x160000-16 =
506
  * If the given offset exceeds 0x160000-16 = 1.375 Mb - 16 bytes,
489
    1.375 Mb - 16 bytes, call is ignored.
507
    the call is ignored.
490
  * For upgrade of the screen (after completion of a series of commands
508
  * For update of the screen (after completion of a series of commands
491
    working with a background) call subfunction 3 redraw of a background.
509
    working with a background) call subfunction 3.
492
  * There is a pair function of obtaining of a point from the background
510
  * There is a pair function for get pixel on the background image -
493
    image - subfunction 2 functions 39.
511
    subfunction 2 of function 39.
494
 
512
 
495
======================================================================
513
======================================================================
496
=========== Function 15, subfunction 3 - redraw background. ==========
514
=========== Function 15, subfunction 3 - redraw background. ==========
497
======================================================================
515
======================================================================
498
Parameters:
516
Parameters:
499
  * eax = 15 - number of the function
517
  * eax = 15 - function number
500
  * ebx = 3 - number subfunction
518
  * ebx = 3 - subfunction number
-
 
519
Returned value:
501
Returned value:
520
  * function does not return value
502
  * function does not return value
521
 
503
 
522
======================================================================
504
=========================================================================
523
== Function 15, subfunction 4 - set drawing mode for the background. =
505
= Function 15, subfunction 4 - set the mode of drawing of a background. =
524
======================================================================
506
=========================================================================
525
Parameters:
507
Parameters:
526
  * eax = 15 - function number
508
  * eax = 15 - number of the function
527
  * ebx = 4 - subfunction number
509
  * ebx = 4 - number subfunction
528
  * ecx = drawing mode:
510
  * ecx = mode of drawing:
529
    * 1 = tile
511
    * 1 = tile
530
    * 2 = stretch
512
    * 2 = stretch
531
Returned value:
513
Returned value:
532
  * function does not return value
514
  * function does not return value
533
Remarks:
515
Remarks:
534
  * For update of the screen (after completion of a series of commands
516
  * For upgrade of the screen (after completion of a series of commands
535
    working with a background) call subfunction 3.
517
    working with a background) call subfunction 3 redraw of a background.
536
  * There is a pair function for get drawing mode of the background -
518
  * There is a pair command of obtaining of the mode redraw of a background
537
    subfunction 4 of function 39.
519
    - subfunction 4 functions 39.
538
 
Line 520... Line 539...
520
 
539
======================================================================
521
===========================================================================
540
===================== Function 15, subfunction 5 =====================
522
= Function 15, subfunction 5 - place the block of pixels on a background. =
541
============ Put block of pixels on the background image. ============
523
===========================================================================
542
======================================================================
524
Parameters:
543
Parameters:
525
  * eax = 15 - number of the function
544
  * eax = 15 - function number
526
  * ebx = 5 - number subfunction
545
  * ebx = 5 - subfunction number
527
  * ecx = pointer on the data in the format BBGGRRBBGGRR...
546
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
528
  * edx = offset in data of the background image
547
  * edx = offset in data of the background image
Line 529... Line 548...
529
  * esi = size given in bytes = 3 * number of pixels
548
  * esi = size of data in bytes = 3 * number of pixels
530
Returned value:
549
Returned value:
531
  * function does not return value
550
  * function does not return value
532
Remarks:
551
Remarks:
533
  * 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,
534
    the call is ignored.
553
    the call is ignored.
535
  * Colour of each pixel is stored as 3 bytes the value BBGGRR.
554
  * Color of each pixel is stored as 3-bytes value BBGGRR.
536
  * Pixels of the background image are written sequentially from left to right,
555
  * Pixels of the background image are written sequentially
537
    from above downwards.
556
    from left to right, from up to down.
538
  * Offset of a pixel with coordinates (x,y) it (x+y*xsize)*3.
557
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
539
  * For upgrade of the screen (after completion of a series of commands
558
  * For update of the screen (after completion of a series of commands
540
    working with a background) call subfunction 3 redraw of a background.
559
    working with a background) call subfunction 3.
541
 
560
 
542
======================================================================
561
======================================================================
543
============= Function 16 - save ramdisk on a diskette. ==============
562
=============== Function 16 - save ramdisk on a floppy. ==============
544
======================================================================
563
======================================================================
545
Parameters:
564
Parameters:
Line 546... Line 565...
546
  * eax = 16 - number of the function
565
  * eax = 16 - function number
547
  * ebx = 1 èëè ebx = 2 - on what floppy to save
566
  * ebx = 1 or ebx = 2 - on which floppy save
548
Returned value:
567
Returned value:
549
  * eax = 0 - successfully
568
  * eax = 0 - success
550
  * eax = 1 - error
569
  * eax = 1 - error
551
 
570
 
552
======================================================================
571
======================================================================
553
============== Function 17 - get code of pressed button. =============
572
======= Function 17 - get the identifier of the pressed button. ======
554
======================================================================
573
======================================================================
555
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:
556
Parameters:
576
  * eax = 17 - function number
557
  * eax = 17 - number of the function
577
Returned value:
Line 558... Line 578...
558
Returned value:
578
  * if the buffer is empty, function returns eax=1
559
  * If the buffer is empty, comes back eax=1
579
  * if the buffer is not empty, function returns al=0,
560
  * If the buffer is nonblank, comes back al=0, the high 24 bits eax contain
580
    high 24 bits of eax contain button identifier (in particular, ah
561
    the identifier of the button (in particular, in ah there is a low byte of
581
    contains low byte of the identifier; if all buttons have
562
    the identifier; if all buttons have the identifier, smaller 256, for
582
    the identifier less than 256, ah is enough to distinguish).
563
    distinguishing there is enough ah)
583
Remarks:
564
Remarks:
584
  * "Buffer" keeps only one button, at pressing the new button the
565
  * "Buffer" keeps only one button, at pressing the new button the information
585
    information about old is lost.
566
    about old is lost. 
586
  * The call of this function by an application with inactive window
567
  * By call of this function by the application with the inactive window the
587
    will return answer "buffer is empty".
568
    answer " the buffer comes back is empty ".
588
 
569
 
589
======================================================================
570
======================================================================
590
============ Function 18, subfunction 1 - system shutdown. ===========
571
============ Function 18, subfunction 1 - shutdown system. ===========
591
======================================================================
572
======================================================================
592
Parameters:
Line 573... Line 593...
573
Parameters:
593
  * eax = 18 - function number
-
 
594
  * ebx = 1 - subfunction number
574
  * eax = 18 - number of the function
595
Returned value:
575
  * ebx = 1 - number subfunction
596
  * function always return eax = 0 as tag of success
576
Returned value:
597
Remarks:
577
  * Always comes back eax = 0 as tag of success
598
  * On the last step menu of exit from the system appears and waits
578
Remarks:
599
    response of the user.
579
  * On last step there is a menu of quit waiting responses of the user.
600
  * See also subfunction 9, system shutdown with
580
  * Look also subfunction 9, termination of the system with the parameter
601
    the parameter to force the choice in the exit menu.
581
    to speed up choice in the menu of an exit.
602
 
582
 
603
======================================================================
583
======================================================================
604
= Function 18, subfunction 2 - terminate process/thread by the slot. =
-
 
605
======================================================================
584
= Function 18, subfunction 2 - complete process/thread on the slot. ==
606
Parameters:
Line 585... Line 607...
585
======================================================================
607
  * eax = 18 - function number
-
 
608
  * ebx = 2 - subfunction number
586
Parameters:
609
  * ecx = number of the slot of process/thread
587
  * eax = 18 - number of the function
610
Returned value:
588
  * ebx = 2 - number subfunction
611
  * function does not return value
589
  * ecx = number of the slot of process/thread
612
Remarks:
Line 590... Line 613...
590
Returned value:
613
  * It is impossible to terminate system thread OS/IDLE (with
591
  * function does not return value
614
    number of the slot 1),
592
Remarks:
615
    it is possible to terminate any normal process/thread.
593
  * It is impossible to complete thread of an operating system OS/IDLE
616
  * See also subfunction 18 - terminate
594
    (number of the slot 1), it is possible to complete
617
    process/thread by the identifier.
Line 595... Line 618...
595
    any usual thread/process.
618
 
596
  * See also subfunction 18 - completion of process/thread
619
======================================================================
597
    with the given identifier.
620
===================== Function 18, subfunction 3 =====================
598
 
621
============= Make active the window of the given thread. ============
599
=========================================================================
622
======================================================================
600
= Function 18, subfunction 3 - do to the active window selected thread. =
623
Parameters:
601
=========================================================================
624
  * eax = 18 - function number
602
Parameters:
625
  * ebx = 3 - subfunction number
Line 603... Line 626...
603
  * eax = 18 - number of the function
626
  * ecx = number of the thread slot
604
  * ebx = 3 - number subfunction
627
Returned value:
605
  * ecx = number of the slot thread
628
  * function does not return value
606
Returned value:
629
Remarks:
607
  * function does not return value
630
  * If correct, but nonexistent slot is given,
608
Remarks:
631
    some window is made active.
609
  * At the instruction correct, but nonexistent slot any window is made active.
632
  * To find out, which window is active, use subfunction 7.
610
  * Find out, what window is active, is possible by call subfunction 7.
633
 
611
 
634
======================================================================
612
==============================================================================
635
===================== Function 18, subfunction 4 =====================
-
 
636
=========== Get counter of idle time units per one second. ===========
613
 Function 18, subfunction 4 - get counter of empty clock ticks per one second. 
637
======================================================================
614
==============================================================================
638
Idle time units are units, in which the processor stands idle
615
Empty clock ticks are understood as time, in which the processor stands idle
639
in waiting for interrupt (in the command 'hlt').
616
in waiting interruption (in the instruction hlt).
640
 
617
 
641
Parameters:
618
Parameters:
642
  * eax = 18 - function number
619
  * eax = 18 - number of the function
643
  * ebx = 4 - subfunction number
620
  * ebx = 4 - number subfunction
644
Returned value:
621
Returned value:
645
  * eax = value of the counter of idle time units per one second
622
  * eax = value of the counter of empty clock ticks per one second
646
 
Line 623... Line 647...
623
 
647
======================================================================
624
======================================================================
648
========== Function 18, subfunction 5 - get CPU clock rate. ==========
625
=========== Function 18, subfunction 5 - get cpu frequency. ==========
649
======================================================================
626
======================================================================
650
Parameters:
627
Parameters:
651
  * eax = 18 - function number
628
  * eax = 18 - number of the function
652
  * ebx = 5 - subfunction number
629
  * ebx = 5 - number subfunction
653
Returned value:
630
Returned value:
654
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
631
  * eax = cpu frequency (modulo 2^32 clock ticks = 4GHz)
655
 
632
 
656
======================================================================
633
=====================================================================
657
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
634
== Function 18, subfunction 6 - save ramdisk in file on hard disk. ==
658
======================================================================
635
=====================================================================
659
Parameters:
Line 636... Line 660...
636
Parameters:
660
  * eax = 18 - function number
637
  * eax = 18 - number of the function
661
  * ebx = 6 - subfunction number
638
  * ebx = 6 - number subfunction
662
  * ecx defines path to the file:
639
  * ecx defines path to the file:
663
    * 1 = in the folder "/KOLIBRI"
-
 
664
    * 2 = in the root folder
640
    * 1 = in the directory "/KOLIBRI"
665
    * 3 = edx points to the path (names of folders in the format 8+3,
Line 641... Line 666...
641
    * 2 = in the root
666
      divided by '/')
642
    * 3 = edx specifies path (names of folders in the format 8+3, divided '/')
667
Returned value:
643
Returned value:
668
  * eax = 0 - success
644
  * eax = 0 - successfully
669
  * else eax = error code of the file system
645
  * differently eax = an error code of a file system
670
Çàìå÷àíèÿ:
646
Remarks:
671
  * Filename is fixed, "menuet.img" (global kernel variable
647
  * Filename is fixed, "menuet.img" (global variable of
672
    'image_save' from 'preboot.inc')
Line 648... Line 673...
648
    a kernel image_save from preboot.inc)
673
  * Drive and partition are defined by subfunction 7
649
  * On what partition what disk the file will be saved, is defined
674
    and subfunction 8 of function 21.
650
    subfunction 7 and subfunction 8 functions 21.
675
  * All folders in the given path must exist, otherwise function
651
  * All directories in the indicated path should exist, differently will
676
    returns value 5, "file not found".
652
    return value 5, " the file is not retrieved ".
677
 
653
 
678
======================================================================
654
======================================================================
679
=========== Function 18, subfunction 7 - get active window. ==========
655
====== Function 18, subfunction 7 - get number of active window. =====
680
======================================================================
Line 656... Line 681...
656
======================================================================
681
Parameters:
657
Parameters:
682
  * eax = 18 - function number
658
  * eax = 18 - number of the function
683
  * ebx = 7 - subfunction number
659
  * ebx = 7 - number subfunction
684
Returned value:
660
Returned value:
685
  * eax = number of the active window
661
  * eax = number of active window (number of the slot thread, which window
686
    (number of the slot of the thread with active window)
662
    is active)
687
Remarks:
663
Remarks:
688
  * Active window is at the top of the window stack and receives
664
  * Active window is at the top of the window stack and receives the messages
689
    messages on all keyboard input.
-
 
690
  * To make a window active, use subfunction 3.
665
    on all keyboard input.
691
 
666
  * Make the window active it is possible by call subfunction 3.
692
======================================================================
667
 
693
== Function 18, subfunction 8 - disable/enable the internal speaker. =
668
=======================================================================
694
======================================================================
669
==== Function 18, subfunction 8 - disable/enable a speaker sound . ====
695
If speaker sound is disabled, all calls to subfunction 55 of
670
=======================================================================
696
function 55 are ignored. If speaker sound is enabled,
-
 
697
they are routed on builtin speaker.
671
At the disconnected sound the calls subfunction 55 functions 55 are ignored.
698
 
672
At included - are routed on built - in speaker.
699
------------------- Subsubfunction 1 - get status. -------------------
673
 
700
Parameters:
674
--------------- Subsubfunction 1 - get a status. ----------------
701
  * eax = 18 - function number
675
Parameters:
702
  * ebx = 8 - subfunction number
676
  * eax = 18 - number of the function
703
  * ecx = 1 - number of the subsubfunction
677
  * ebx = 8 - number subfunction
704
Returned value:
678
  * ecx = 1 - number subsubfunction
705
  * eax = 0 - speaker sound is enabled; 1 - disabled
679
Returned value:
706
 
680
  * eax = 0 - sound speaker is enabled; 1 - is disabled
707
----------------- Subsubfunction 2 - toggle status. ------------------
681
 
708
Toggles states of disable/enable.
682
-------------- Subsubfunction 2 - switch a status. --------------
709
Parameters:
683
Switches statuses of disable/enable.
710
  * eax = 18 - function number
684
Parameters:
711
  * ebx = 8 - subfunction number
685
  * eax = 18 - number of the function
712
  * ecx = 2 - number of the subsubfunction
686
  * ebx = 8 - number subfunction
713
Returned value:
687
  * ecx = 2 - number subsubfunction
714
  * function does not return value
688
Returned value:
715
 
689
  * function does not return value
716
======================================================================
690
 
717
== Function 18, subfunction 9 - system shutdown with the parameter. ==
691
===========================================================================
718
======================================================================
692
= Function 18, subfunction 9 - shutdown of the system with the parameter. =
719
Parameters:
693
===========================================================================
720
  * eax = 18 - function number
694
Parameters:
721
  * ebx = 9 - subfunction number
-
 
722
  * ecx = parameter:
695
  * eax = 18 - number of the function
723
    * 1 = on the last step of shutdown save ramdisk on a floppy and
696
  * ebx = 9 - number subfunction
724
      then show the exit menu and request further operations
697
  * ecx = parameter:
725
      from the user
-
 
726
    * 2 = turn off computer
698
    * 1 = On last step of shutdown to save ramdisk on a diskette then to
727
    * 3 = reboot computer
699
      output the menu of an exit and to request of the user further operations
728
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
Line 700... Line 729...
700
    * 2 = switch off the computer
729
Returned value:
701
    * 3 = reboot the computer
-
 
702
    * 4 = restart a kernel from the file kernel.mnt on ramdisk
730
  * at incorrect ecx the registers do not change (i.e. eax=18)
703
Returned value:
731
  * by correct call function always returns eax=0
704
  * At incorrect ecx the registers do not vary (i.e. eax=18)
732
    as the tag of success
705
  * By correct call tag of success eax=0 always comes back
733
Remarks:
706
Remarks:
734
  * Do not rely on returned value by incorrect call, it can be
707
  * It is not necessary to rely on returned value by incorrect call,
735
    changed in future versions of the kernel.
708
    it can vary in the subsequent versions of a kernel.
736
  * It is possible to use subfunction 1, that on the last step
709
  * It is possible to use subfunction 1, that on last step of termination
737
    the user makes choice himself.
710
    the user himself has selected, that it is necessary.
738
  * It is not recommended to use value ecx=1 (to not irritate the user
711
  * It is not recommended to use value ecx=1 (to not irritate the user with
739
    with excessive questions); to save ramdisk on a floppy use
712
    excessive questions); to save ramdisk on a diskette it is possible by the
740
    function 16 (which admits specification, on which floppy to
713
    function 16 (which admits specification, on which diskette to write), and
741
    write), and to shutdown with the exit menu use already mentioned
714
    to complete operation from the menu of an output(exit) it is possible
742
    subfunction 1.
715
    already mentioned subfunction 1.
743
 
716
 
744
======================================================================
717
=======================================================================
745
===== Function 18, subfunction 10 - minimize application window. =====
718
====== Function 18, subfunction 10 - minimize application window. =====
746
======================================================================
719
=======================================================================
747
Minimizes the own window.
720
Turns off the own window.
748
Parameters:
721
Parameters:
749
  * eax = 18 - function number
722
  * eax = 18 - number of the function
750
  * ebx = 10 - subfunction number
723
  * ebx = 10 - number subfunction
751
Returned value:
724
Returned value:
752
  * function does not return value
-
 
753
Remarks:
725
  * function does not return value
754
  * The minimized window from the point of view of function 9
726
Remarks:
755
    keeps position and sizes.
727
  * The minimized window from the point of view of the function 9 saves
756
  * Restoring of an application window occurs at its activation by 
728
    a location and sizes.
757
    subfunction 3.
729
  * Restoring of an application window occurs at activation subfunction 3.
758
  * Usually there is no necessity to minimize/restire a window
730
  * Usually there is no necessity obviously to turn off/restore the window:
759
    obviously: minimization of a window is carried out by the system
-
 
760
    at pressing the minimization button (for skinned windows
731
    turn off of the window is carried out by the system at pressing the button
761
    it is defined automatically by function 0,
732
    of minimization (which for windows with SKIN is defined automatically by
762
    for other windows it can be defined manually by function 8),
733
    function 0, for windows without SKIN it is possible to define by the
763
    restore of a window is done by the application '@panel'.
734
    function 8), restoring - application @panel.
764
 
735
 
765
======================================================================
736
======================================================================
766
 Function 18, subfunction 11 - get information on the disk subsystem. 
737
==================== Function 18, subfunction 11 =====================
767
======================================================================
738
================ Get information on a disk subsystem. ================
768
Parameters:
739
======================================================================
769
  * eax = 18 - function number
740
Parameters:
770
  * ebx = 11 - subfunction number
741
  * eax = 18 - number of the function
771
  * ecx = type of the table:
742
  * ebx = 11 - number subfunction
772
    * 1 = short version, 10 bytes
743
  * ecx = type of the table:
773
    * 2 = full version, 65536 bytes
744
    * 1 = short version, 10 bytes
774
  * edx = pointer to the buffer (in the application) for the table
745
    * 2 = full version, 65536 bytes
775
Returned value:
746
  * edx = pointer on the buffer (in the application) for table
776
  * function does not return value
747
Returned value:
777
Format of the table: short version:
748
  * function does not return value
778
  * +0: byte: information about FDD's (drives for floppies),
-
 
779
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
749
Format of the table: the short version:
780
    of the second regarding to the following list:
750
  * +0: byte: information about FDD's (drives for diskettes), AAAABBBB,
781
    * 0 = there is no drive
751
    where AAAA sets type of the first drive, BBBB - second disk agrees
782
    * 1 = 360Kb, 5.25''
752
    to the following list:
783
    * 2 = 1.2Mb, 5.25''
753
    * 0 = there is no drive
784
    * 3 = 720Kb, 3.5''
754
    * 1 = 360Kb, 5.25''
785
    * 4 = 1.44Mb, 3.5''
755
    * 2 = 1.2Mb, 5.25''
786
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
756
    * 3 = 720Kb, 3.5''
787
    For example, for the standard configuration from one 1.44-drive
757
    * 4 = 1.44Mb, 3.5''
788
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
758
    * 5 = 2.88Mb, 3.5'' (such diskettes already are not used)
789
    the value is 24h.
759
    For example, for the standard configuration from one 1.44-drive here will
790
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
760
    be 40h, and for a case 1.2Mb on A: and 1.44Mb on B: the value appears 24h.
791
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
761
  * +1: byte: information about hard disks and CD - drives, AABBCCDD,
792
    * 0 = device is absent
-
 
793
    * 1 = hard drive
762
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
794
    * 2 = CD-drive
-
 
795
    For example, in the case HD on IDE0 and CD on IDE2
763
    * 0 = device is absent
796
    this field contains 48h.
764
    * 1 = hard disk
797
  * +2: 4 db: number of the retrieved partitions on hard disks
765
    * 2 = CD - drive
798
    at accordingly IDE0,...,IDE3.
766
    For example, in a case HD on IDE0 and CD on IDE2 here will be 48h.
799
    If the hard disk on IDEx is absent, appropriate byte is zero,
-
 
800
    otherwise it shows number of the recognized partitions, which
767
  * +2: 4 db: Number of the retrieved sections on hard disks with
801
    can be not presented (if the drive is not formatted or if
768
    accordingly IDE0..., IDE3.
802
    the file system is not supported). Current version of the kernel
769
    At absence of the hard disk on IDEx appropriate byte zero, at presence
-
 
770
    shows number of the recognized partitions, which can and to not be (if the
803
    supports only FAT16 and FAT32 for hard disks.
771
    drive is not formatted or if the file system is not supported). In the
804
  * +6: 4 db: reserved
772
    current version of a kernel for hard disks are supported only FAT16
805
Format of the table: full version:
773
    and FAT32.
806
  * +0: 10 db: same as for the short version
774
  * +6: 4 db: reserved
807
  * +10: 100 db: data for the first partition
775
Format of the table: the complete version:
808
  * +110: 100 db: data for the second partition
776
  * +0: 10 db: same, as well as in the short version
809
  * ...
777
  * +10: 100 db: data for the first partition
810
  * +10+100*(n-1): 100 db: data for the last partition
778
  * +110: 100 db: data for the second partition
811
The partitions are located as follows: at first sequentially all
779
  * ...
812
recoginzed partitions on HD on IDE0 (if present),
780
  * +10+100*(n-1): 100 db: data for the last partition
813
then on HD on IDE1 (if present) and so on up to IDE3.
781
The sections are located in the following order: at first sequentially all
814
Format of the information about partition
782
recognized partitions on HD on IDE0 (if are), then on HD on IDE1 (if is)
815
(at moment only FAT is supported):
783
etc. up to IDE3.
816
  * +0: dword: first physical sector of the partition
784
Format of the information about partition (while is supported only FAT):
817
  * +4: dword: last physical sector of the partition
785
  * +0: dword: first physical sector of the partition
818
    (belongs to the partition)
786
  * +4: dword: last physical sector of the partition
819
  * +8: dword: sectors per one copy of FAT
787
    (belongs to partition)
820
  * +12 = +0xC: dword: number of copies of FAT
788
  * +8: dword: sectors in one copy FAT
821
  * +16 = +0x10: dword: number of sectors per cluster
789
  * +12 = +0xC: dword: number of copies FAT
822
  * +20 = +0x14: dword: bytes per sector;
790
  * +16 = +0x10: dword: number of sectors in a cluster
823
    current implementation expects 0x200 = 512 in this field
791
  * +20 = +0x14: dword: byte in sector; the current implementation expects,
824
  * +24 = +0x18: dword: first root cluster in FAT32, 0 for FAT16
792
    that here 0x200 = 512
825
  * +28 = +0x1C: dword: first physical sector of FAT
793
  * +24 = +0x18: dword: first cluster of the root in FAT32, 0 for FAT16
826
  * +32 = +0x20: dword: first physical root sector for FAT16,
794
  * +28 = +0x1C: dword: first physical sector FAT
827
    ignored for FAT32
795
  * +32 = +0x20: dword: first physical sector of the root for FAT16,
828
  * +36 = +0x24: dword: number of root sectors for FAT16,
796
    is ignored for FAT32
829
    0 for FAT32
797
  * +36 = +0x24: dword: number of sectors in the root for FAT16, 0 for FAT32
830
  * +40 = +0x28: dword: physical sector of the beginning of
798
  * +40 = +0x28: dword: physical sector of a beginning of area of the data
831
    the data area
799
  * +44 = +0x2C: dword: maximum number of a cluster
832
  * +44 = +0x2C: dword: maximum number of a cluster
Line 800... Line 833...
800
  * +48 = +0x30: dword: physical sector of the information about a file system
833
  * +48 = +0x30: dword: physical sector of the information
801
    for FAT32, is ignored for FAT16
834
    about the file system for FAT32, ignored for FAT16
802
  * +52 = +0x34: dword: value used as boundary of special values in FAT
-
 
803
  * +56 = +0x38: dword: value used for bad clusters in FAT
835
  * +52 = +0x34: dword: value used as boundary for special
-
 
836
    values in FAT
-
 
837
  * +56 = +0x38: dword: value used for bad clusters in FAT
804
  * +60 = +0x3C: dword: Value used as the end mark at recording of a chain
838
  * +60 = +0x3C: dword: value used as the end marker for FAT chain
805
    in FAT
839
  * +64 = +0x40: dword: mask for FAT items
806
  * +64 = +0x40: dword: mask superimposed on a unit FAT
840
  * +68 = +0x44: byte: file system type: 16 èëè 32
807
  * +68 = +0x44: byte: type of a file system: 16 or 32
841
  * +69 = +0x45: 31 db: reserved
808
  * +69 = +0x45: 31 db: reserved
842
Remarks:
809
Remarks:
843
  * The short table can be used for obtaining the information about
810
  * Short table can be used for obtaining the information about available
844
    available devices.
811
    devices.
845
  * First two fields in the information about partition
Line 812... Line 846...
812
  * First two information fields about partition in the complete version of
846
    gives the parameters of partition, other - parameters of
813
    the table inform parameters of the unit which has stayed - parameters of
847
    FAT file system. For other file systems (when they will be
814
    a file system FAT. For other file systems (when they will be supported)
848
    supported) specific for file system information will be, of
815
    information, specific to a file system, naturally, there will be another,
849
    course, another, but first two fields will have the same sense.
816
    but first two fields will be saved constant.
850
 
817
 
851
======================================================================
818
======================================================================
852
========== Function 18, subfunction 13 - get kernel version. =========
819
======== Function 18, subfunction 13 - get version of a kernel. ======
853
======================================================================
Line 820... Line 854...
820
======================================================================
854
Parameters:
821
Parameters:
855
  * eax = 18 - function number
822
  * eax = 18 - number of the function
-
 
823
  * ebx = 13 - number subfunction
856
  * ebx = 13 - subfunction number
824
  * ecx = pointer on the buffer (not less than 16 bytes), where the
857
  * ecx = pointer to the buffer (not less than 16 bytes), where
825
    information will be placed
858
    the information will be placed
826
Returned value:
859
Returned value:
827
  * function does not return value
860
  * function does not return value
828
Structure of the buffer:
861
Structure of the buffer:
Line 829... Line 862...
829
db a,b,c,d for version a.b.c.d
862
db a,b,c,d for version a.b.c.d
830
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
831
db 'name',0 - ASCIIZ-string with a name
-
 
832
For kernel Kolibri 0.5.8.1:
864
db 'name',0 - ASCIIZ-string with the name
833
db 0,5,8,1
865
For Kolibri 0.5.8.1 kernel:
834
db 2
866
db 0,5,8,1
835
db 'Kolibri',0
867
db 2
836
 
868
db 'Kolibri',0
837
=========================================================================
869
 
Line 838... Line 870...
838
====================== Function 18, subfunction 14 ======================
870
======================================================================
839
= Expect a beginning of retrace of a ray of scanning of screen monitor. =
871
======= Function 18, subfunction 14 - wait for screen retrace. =======
840
=========================================================================
872
======================================================================
841
Parameters:
873
Waits for the beginning of retrace of the scanning ray of the screen
842
  * eax = 18 - number of the function
874
monitor.
843
  * ebx = 14 - number subfunction
875
Parameters:
844
Returned value:
876
  * eax = 18 - function number
845
  * eax = 0 as tag of success
877
  * ebx = 14 - subfunction number
846
Remarks:
878
Returned value:
847
  * Function is intended only for the active high-efficiency graphics
879
  * eax = 0 as the tag of success
848
    applications; is used for smooth output of a graphics.
880
Remarks:
849
 
881
  * Function is intended only for active high-efficiency graphics
850
============================================================================
882
    applications; is used for smooth output of a graphics.
851
= Function 18, subfunction 15 - place a mouse pointer in centre of screen. =
883
 
852
============================================================================
884
======================================================================
-
 
885
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
Line 853... Line 886...
853
Parameters:
886
======================================================================
854
  * eax = 18 - number of the function
887
Parameters:
855
  * ebx = 15 - number subfunction
888
  * eax = 18 - function number
856
Returned value:
889
  * ebx = 15 - subfunction number
857
  * eax = 0 as tag of success
890
Returned value:
858
 
891
  * eax = 0 as the tag of success
-
 
892
 
859
======================================================================
893
======================================================================
860
====================== Function 18, subfunction 16 ===================
894
========= Function 18, subfunction 16 - get size of free RAM. ========
861
====================== Get a size of the free RAM. ===================
895
======================================================================
862
======================================================================
896
Parameters:
863
Parameters:
897
  * eax = 18 - function number
864
  * eax = 18 - number of the function
898
  * ebx = 16 - subfunction number
865
  * ebx = 16 - number subfunction
899
Returned value:
866
Returned value:
900
  * eax = size of free memory in kilobytes
867
  * eax = size of free memory in kilobytes
901
 
-
 
902
======================================================================
Line 868... Line 903...
868
 
903
======== Function 18, subfunction 17 - get full amount of RAM. =======
869
======================================================================
904
======================================================================
870
====================== Function 18, subfunction 17 ===================
905
Parameters:
Line 871... Line 906...
871
====================== Get a size of the amount RAM. =================
906
  * eax = 18 - function number
872
======================================================================
907
  * ebx = 17 - subfunction number
873
Parameters:
908
Returned value:
874
  * eax = 18 - number of the function
909
  * eax = total size of existing memory in kilobytes
Line 875... Line 910...
875
  * ebx = 17 - number subfunction
910
 
876
Returned value:
911
======================================================================
877
  * eax = common size of amount memory in kilobytes
912
===================== Function 18, subfunction 18 ====================
878
 
913
============= Terminate process/thread by the identifier. ============
879
======================================================================
914
======================================================================
880
====================== Function 18, subfunction 18 ===================
915
Parameters:
881
============= complete process/thread on the identifier. =============
916
  * eax = 18 - function number
882
======================================================================
917
  * ebx = 18 - subfunction number
883
Parameters:
918
  * ecx = identifer of process/thread (PID/TID)
884
  * eax = 18 - number of the function
919
Returned value:
885
  * ebx = 18 - number subfunction
920
  * eax = 0 - success
Line 886... Line 921...
886
  * ecx = identifier of process/thread (PID/TID)
921
  * eax = -1 - error (process is not found or is system)
887
Returned value:
922
Remarks:
888
  * eax = 0 - successfully
923
  * It is impossible to terminate system thread OS/IDLE (identifier
889
  * eax = -1 - error (the process is not retrieved or is system)
924
    1), it is possible to terminate any normal process/thread.
890
Remarks:
925
  * See also subfunction 2 - terminate
891
  * It is impossible to complete thread of an operating system OS/IDLE
926
    process/thread by given slot.
892
   (number of the slot 1), it is possible to complete any usual thread/process.
927
 
893
  * See also subfunction 2 - completion of process / thread on the given slot.
928
======================================================================
894
 
929
============ Function 19 - start application from ramdisk. ===========
895
======================================================================
930
======================================================================
896
============ Function 19 - start application with ramdisk. ===========
931
Parameters:
897
======================================================================
932
  * eax = 19 - function number
898
Parameters:
933
  * ebx = pointer to the application name in format similar
899
  * eax = 19 - number of the function
-
 
900
  * ebx = pointer on an application name in format similar to function 6
934
    to function 6
Line 901... Line 935...
901
  * ecx = 0 or ecx = the pointer on parameters of the command line
935
  * ecx = 0 or ecx = pointer to command line parameters
902
Returned value:
936
Returned value:
903
  * If eax > 0, eax contains PID of the created process
937
  * If eax > 0, then eax contains PID of the created process
904
  * If eax < 0, -eax - error code of a file system
938
  * If eax < 0, then -eax - file system error code
905
Remarks:
939
Remarks:
906
  * This function is obsolete; use subfunction 7 functions 70.
940
  * This function is obsolete; use subfunction 7 of function 70.
907
  * Command line should be ended by the character with the code 0
941
  * Command line must be terminated by the character with the code 0
908
    (ASCIIZ-strings); it are taken into account or all characters up to
942
    (ASCIIZ-string); function takes into account either all characters
909
    completing zero inclusively, or the first 256 characters, that are less.
943
    up to terminating zero inclusively or first 256 character
910
 
944
    regarding what is less.
911
======================================================================
945
 
912
==================== Function 20 - interface MIDI. ===================
946
======================================================================
913
======================================================================
947
==================== Function 20 - MIDI interface. ===================
914
 
948
======================================================================
915
------------------------ Subfunction 1 - reset ------------------------
949
 
916
Parameters:
950
----------------------- Subfunction 1 - reset ------------------------
917
  * eax = 20 - number of the function
951
Parameters:
918
  * ebx = 1 - number subfunction
952
  * eax = 20 - function number
919
 
953
  * ebx = 1 - subfunction number
920
-------------------- Subfunction 2 - output byte ---------------------
954
 
921
Parameters:
955
-------------------- Subfunction 2 - output byte ---------------------
-
 
956
Parameters:
922
  * eax = 20 - number of the function
957
  * eax = 20 - function number
923
  * ebx = 2 - number subfunction
958
  * ebx = 2 - subfunction number
924
  * cl = byte for output
959
  * cl = byte for output
925
Returned value (is identical to both subfunctions):
960
Returned value (is the same for both subfunctions):
926
  * eax = 0 - successfully
961
  * eax = 0 - success
927
  * eax = 1 - base port is not defined
962
  * eax = 1 - base port is not defined
928
Remarks:
963
Remarks:
929
  * Base port previously should be defined by call
964
  * Previously the base port must be defined by 
930
    subfunction of 1 function 21.
965
    subfunction 1 of function 21.
931
 
966
 
932
======================================================================
967
======================================================================
933
==== Function 21, subfunction 1 - install a base port MPU MIDI. ======
968
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
934
======================================================================
969
======================================================================
935
Parameters:
970
Parameters:
936
  * eax = 21 - number of the function
971
  * eax = 21 - function number
937
  * ebx = 1 - number subfunction
972
  * ebx = 1 - subfunction number
938
  * ecx = number of a base port
973
  * ecx = number of base port
939
Returned value:
974
Returned value
940
  * eax = 0 - successfully
975
  * eax = 0 - success
941
  * eax = -1 - erratic number of a port
976
  * eax = -1 - erratic number of a port
942
Remarks:
977
Remarks:
943
  * Number of a port should satisfy to conditions 0x100<=ecx<=0xFFFF.
978
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
944
  * Installation of base is necessary for operation of the function 20.
-
 
945
  * Get installed base port it is possible by call
979
  * The installation of base is necessary for function 20.
Line 946... Line 980...
946
    subfunction of 1 function 26.
980
  * To get base port use subfunction 1 of function 26.
947
 
981
 
948
======================================================================
982
======================================================================
949
======== Function 21, subfunction 2 - install keyboard layout. =======
983
========== Function 21, subfunction 2 - set keyboard layout. =========
950
======================================================================
984
======================================================================
951
Keyboard layout is used for conversion scancodes, acting from the keyboard,
985
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
952
in ASCII-codes which were read - out by the function 2.
986
which will be read by function 2.
953
Parameters:
987
Parameters:
954
  * eax = 21 - number of the function
988
  * eax = 21 - function number
955
  * ebx = 2 - number subfunction
989
  * ebx = 2 - subfunction number
956
  * ecx = what layout to install:
990
  * ecx = which layout to set:
957
    * 1 = normal layout
991
    * 1 = normal layout
958
    * 2 = layout at pressed Shift
992
    * 2 = layout at pressed Shift
-
 
993
    * 3 = layout at pressed Alt
959
    * 3 = layout at pressed Alt
994
  * edx = pointer to layout - table of length 128 bytes
Line 960... Line 995...
960
  * edx = pointer on layout - table of length 128 bytes
995
Or:
961
Or:
996
  * ecx = 9
962
  * ecx = 9
997
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
963
  * dx = identifier of the country (1=eng, 2=fi, 3=ger, 4=rus)
998
Returned value:
964
Returned value:
999
  * eax = 0 - success
965
  * eax = 0 - successfully
1000
  * eax = 1 - incorrect parameter
966
  * eax = 1 - parameter is given incorrectly
1001
Remarks:
967
Remarks:
1002
  * If Alt is pressed, the layout with Alt is used;
968
  * If is pressed Alt, the layout with Alt is used; if not is pressed Alt,
1003
    if Alt is not pressed, but Shift is pressed,
969
    but is pressed Shift, the layout with Shift is used; if not are
1004
    the layout with Shift is used;
970
    pressed Alt and Shift, but is pressed Ctrl, the normal layout is used,
1005
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
971
    then from the code is subtracted 0x60; if not any of direction keys
1006
    layout is used and then from the code is subtracted 0x60;
972
    is pressed, the normal layout is used.
1007
    if no control key is pressed, the normal layout is used.
973
  * get layouts and identifier of the country it is possible with the help
1008
  * To get layout and country identifier use 
974
    subfunction 2 functions 26.
1009
    subfunction 2 of function 26.
975
  * The identifier of the country - global environment variable, which by
-
 
976
    kernel is not used; however application @panel displays an icon,
1010
  * Country identifier is global system variable, which is not used
Line 977... Line 1011...
977
    appropriate to the current country.
1011
    by the kernel itself; however the application '@panel' displays
978
  * Application @panel switches layouts on search of the user.
1012
    the corresponding icon.
979
 
1013
  * The application @panel switches layouts on user request.
980
======================================================================
1014
 
981
=========== Function 21, subfunction 3 - install base CD. ============
1015
======================================================================
982
======================================================================
1016
============== Function 21, subfunction 3 - set CD base. =============
983
Parameters:
1017
======================================================================
984
  * eax = 21 - number of the function
1018
Parameters:
985
  * ebx = 3 - number subfunction
1019
  * eax = 21 - function number
986
  * ecx = base CD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1020
  * ebx = 3 - subfunction number
987
Returned value:
1021
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
988
  * eax = 0
1022
Returned value:
989
Remarks:
1023
  * eax = 0
990
  * Base CD is used by the function 24.
-
 
991
  * Receive the installed base CD it is possible by call
1024
Remarks:
992
    subfunction 3 functions 26.
1025
  * CD base is used by function 24.
993
 
1026
  * To get CD base use subfunction 3 of function 26.
994
======================================================================
1027
 
995
=== Function 21, subfunction 4 - install base port Sound Blaster. ====
1028
======================================================================
996
======================================================================
1029
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
997
Parameters:
1030
======================================================================
998
  * eax = 21 - number of the function
1031
Parameters:
999
  * ebx = 4 - number subfunction
1032
  * eax = 21 - function number
1000
  * ecx = number base port
1033
  * ebx = 4 - subfunction number
1001
Returned value:
1034
  * ecx = number of the base port
1002
  * eax = 0 - successfully
1035
Returned value:
1003
  * eax = -1 - erratic number of a port
1036
  * eax = 0 - success
1004
Remarks:
1037
  * eax = -1 - erratic port number
1005
  * Number of a port should satisfy to conditions 0x100<=ecx<=0xFFFF.
1038
Remarks:
1006
  * Installation of base is necessary for operation of functions 25, 28, 55.
1039
  * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1007
  * Get installed base port it is possible by call subfunction 4 functions 26.
1040
  * The installation of the base is necessary for
1008
 
1041
    functions 25, 28, 55.
1009
======================================================================
1042
  * To get base port use subfunction 4 of function 26.
1010
==== Function 21, subfunction 5 - install the language of system. ====
1043
 
1011
======================================================================
1044
======================================================================
1012
Parameters:
1045
========== Function 21, subfunction 5 - set system language. =========
1013
  * eax = 21 - number of the function
1046
======================================================================
1014
  * ebx = 5 - number subfunction
1047
Parameters:
1015
  * ecx = language of system (1=eng, 2=fi, 3=ger, 4=rus)
1048
  * eax = 21 - function number
1016
Returned value:
1049
  * ebx = 5 - subfunction number
1017
  * eax = 0
1050
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1018
Remarks:
1051
Returned value:
1019
  * Language of the system - global environment variable in any way which
1052
  * eax = 0
1020
    is not used by kernel, however application @panel draws
1053
Remarks:
1021
    an appropriate icon.
1054
  * System language is global system variable and is not used
1022
  * Checks on a correctness is not done, as the kernel this variable
1055
    by the kernel itself, however application @panel draws the
1023
    does not use.
1056
    appropriate icon.
1024
  * Get language of the system it is possible by call
1057
  * Function does not check for correctness, as the kernel does not
1025
    subfunction 5 functions 26.
1058
    use this variable.
1026
 
1059
  * To get system language use subfunction 5 of function 26.
1027
======================================================================
1060
 
1028
========= Function 21, subfunction 6 - install base port WSS. ========
1061
======================================================================
1029
======================================================================
1062
=========== Function 21, subfunction 6 - set WSS base port. ==========
1030
Parameters:
1063
======================================================================
1031
  * eax = 21 - number of the function
1064
Parameters:
1032
  * ebx = 6 - number subfunction
1065
  * eax = 21 - function number
1033
  * ecx = base port
1066
  * ebx = 6 - subfunction number
1034
Returned value:
1067
  * ecx = base port
1035
  * eax = 0 - successfully
1068
Returned value:
1036
  * eax = -1 - erratic number of a port
1069
  * eax = 0 - success
1037
Remarks:
1070
  * eax = -1 - erratic port number
Line 1038... Line 1071...
1038
  * Number of a port should satisfy to conditions 0x100<=ecx.
1071
Remarks:
1039
  * Base WSS is used by the function 27.
1072
  * Port number must satisfy to condition 0x100<=ecx.
1040
  * Get installed base port WSS it is possible by call
1073
  * WSS base is used by function 27.
1041
    subfunction 6 functions 26.
1074
  * To get WSS base port use subfunction 6 of function 26.
1042
 
1075
 
1043
======================================================================
1076
======================================================================
1044
=========== Function 21, subfunction 7 - install base HD. ============
1077
============== Function 21, subfunction 7 - set HD base. =============
1045
======================================================================
1078
======================================================================
1046
The base HD is necessary for definition, on what hard disk to write, at usage
1079
The HD base defines hard disk to write with usage of obsolete
1047
of out-of-date functions of operation with a file system and functions
1080
file system functions and functions implicitly using the hard disk
1048
implicitly using the hard disk (such as subfunction of 6 functions 18);
1081
(such as subfunction 6 of function 18);
1049
At usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
1082
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1050
these functions install base.
-
 
1051
Parameters:
1083
these function set base themselves.
Line 1052... Line 1084...
1052
  * eax = 21 - number of the function
1084
Parameters:
1053
  * ebx = 7 - number subfunction
-
 
1054
  * ecx = base HD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1085
  * eax = 21 - function number
1055
Returned value:
1086
  * ebx = 7 - subfunction number
1056
  * eax = 0
1087
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1057
Remarks:
1088
Returned value:
1058
  * Any application at any moment of time can change base.
1089
  * eax = 0
1059
  * It is not necessary to change base, when any application works
1090
Remarks:
1060
    with the hard disk. If not want errors of the system.
1091
  * Any application at any time can change the base.
1061
  * Get installed base it is possible by call subfunction 7 functions 26.
1092
  * Do not change base, when any application works with hard disk.
1062
  * It is necessary also to define used partition of
1093
    If you do not want system bugs.
1063
    the hard disk subfunction 8.
1094
  * To get HD base use subfunction 7 of function 26.
1064
 
1095
  * It is also necessary to define used partition of hard disk by 
1065
======================================================================
1096
    subfunction 8.
Line 1066... Line 1097...
1066
========= Function 21, subfunction 8 - install partition HD. =========
1097
 
1067
======================================================================
-
 
1068
The section HD is necessary for definition, on what partition of the hard disk
1098
======================================================================
1069
to write, at usage of out-of-date functions of operation with a file system and
1099
========= Function 21, subfunction 8 - set used HD partition. ========
1070
functions implicitly using the hard disk (such as subfunction of 6 functions
1100
======================================================================
1071
18); at usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
1101
The HD partition defines partition of the hard disk to write with
1072
these functions install base and partition.
1102
usage of obsolete file system functions and functions implicitly
1073
Parameters:
1103
using the hard disk (such as subfunction 6 of function 18);
1074
  * eax = 21 - number of the function
1104
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1075
  * ebx = 8 - number subfunction
1105
these functions set base and partition themselves.
1076
  * ecx = partition HD (beginning from 1)
1106
Parameters:
1077
Returned value:
1107
  * eax = 21 - function number
1078
  * eax = 0
1108
  * ebx = 8 - subfunction number
1079
Remarks:
1109
  * ecx = HD partition (beginning from 1)
Line 1080... Line 1110...
1080
  * Any application at any moment of time can change partition.
1110
Return value:
1081
  * It is not necessary to change partition, when any application works
1111
  * eax = 0
1082
    with the hard disk. If not want errors of the system.
1112
Remarks:
1083
  * Get installed partition it is possible by call subfunction 8 functions 26.
1113
  * Any application at any time can change partition.
1084
  * Checks on a correctness is not done.
1114
  * Do not change partition when any application works with hard disk.
1085
  * Find out number of partitions on the hard disk it is possible by call
1115
    If you do not want system bugs.
1086
    subfunction 11 functions 18.
1116
  * To get used partition use subfunction 8 of function 26.
1087
  * It is necessary also to define used base of the hard disk subfunction 7
1117
  * There is no correctness checks.
1088
 
1118
  * To get the number of partitions of a hard disk use 
1089
======================================================================
1119
    subfunction 11 of function 18.
-
 
1120
  * It is also necessary to define used HD base by subfunction 7.
1090
=== Function 21, subfunction 10 - install channel DMA for a sound. ===
1121
 
1091
======================================================================
1122
======================================================================
1092
Parameters:
1123
======== Function 21, subfunction 10 - set sound DMA channel. ========
1093
  * eax = 21 - number of the function
1124
======================================================================
1094
  * ebx = 10 - number subfunction
1125
Parameters:
1095
  * ecx = number of channel (from 0 up to 3 inclusively)
1126
  * eax = 21 - function number
1096
Returned value:
1127
  * ebx = 10 - subfunction number
1097
  * eax = 0 - successfully
1128
  * ecx = number of channel (from 0 up to 3 inclusively)
1098
  * eax = -1 - incorrect number of the channel
1129
Returned value:
1099
Remarks:
1130
  * eax = 0 - success
1100
  * Number of the channel DMA is used in subfunction of 1 function 55.
1131
  * eax = -1 - incorrect channel number
1101
  * Get channel DMA for a sound it is possible by call
1132
Remarks:
1102
    subfunction 10 functions 26.
1133
  * Number of DMA channel is used in subfunction 1 of function 55.
1103
 
1134
  * To get sound DMA channel use subfunction 10 of function 26.
1104
======================================================================
1135
 
1105
====================== Function 21, subfunction 11 ===================
1136
======================================================================
1106
=============== Permit/prohibit low level access to HD. ==============
1137
 Function 21, subfunction 11 - enable/disable low-level access to HD. 
1107
======================================================================
1138
======================================================================
1108
Parameters:
1139
Parameters:
1109
  * eax = 21 - number of the function
1140
  * eax = 21 - function number
1110
  * ebx = 11 - number subfunction
1141
  * ebx = 11 - subfunction number
1111
  * ecx = 0/1 - prohibit/permit
1142
  * ecx = 0/1 - disable/enable
1112
Returned value:
1143
Returned value:
1113
  * eax = 0
1144
  * eax = 0
1114
Remarks:
1145
Remarks:
1115
  * Is used at LBA-reading (subfunction 8 functions 58).
1146
  * Is used in LBA-read (subfunction 8 of function 58).
1116
  * Current realization uses only low bit ecx.
1147
  * The current implementation uses only low bit of ecx.
1117
  * Get a current status it is possible by call subfunction 11 functions 26.
1148
  * To get current status use subfunction 11 of function 26.
1118
 
1149
 
1119
======================================================================
1150
======================================================================
1120
====================== Function 21, subfunction 12 ===================
1151
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1121
============= Permit/prohibit low level access to PCI. ===============
1152
======================================================================
1122
======================================================================
1153
Parameters:
1123
Parameters:
1154
  * eax = 21 - function number
1124
  * eax = 21 - number of the function
1155
  * ebx = 12 - subfunction number
1125
  * ebx = 12 - number subfunction
1156
  * ecx = 0/1 - disable/enable
1126
  * ecx = 0/1 - prohibit/permit
1157
Returned value:
1127
Returned value:
1158
  * eax = 0
1128
  * eax = 0
1159
Remarks:
1129
Remarks:
1160
  * Is used in operations with PCI bus (function 62).
1130
  * Is used by operation with the bus PCI (function 62).
1161
  * The current implementation uses only low bit of ecx.
1131
  * Current realization uses only low bit ecx.
1162
  * To get current status use subfunction 12 of function 26.
1132
  * Get a current status it is possible by call subfunction 12 functions 26.
1163
 
1133
 
1164
======================================================================
-
 
1165
============ Function 21, subfunction 13, subsubfunction 1 ===========
1134
======================================================================
1166
======== Initialize + get information on the driver vmode.mdr. =======
-
 
1167
======================================================================
1135
============= Function 21, subfunction 13, subsubfunction 1 ==========
1168
Parameters:
Line 1136... Line 1169...
1136
======= Initialize + get information on the driver vmode.mdr. ========
1169
  * eax = 21 - function number
1137
======================================================================
1170
  * ebx = 13 - subfunction number
1138
Parameters:
1171
  * ecx = 1 - number of the driver function
1139
  * eax = 21 - number of the function
1172
  * edx = pointer to 512-bytes buffer
1140
  * ebx = 13 - number subfunction
1173
Returned value:
1141
  * ecx = 1 - number of the function äðàéâåðà
1174
  * if driver is not loaded
1142
  * edx = pointer on the buffer of a size of 512 bytes
1175
    (never happens in the current implementation):
1143
Returned value:
1176
    * eax = -1
1144
  * If the driver is not loaded (never it happens in current implementation):
1177
    * ebx, ecx destroyed
1145
    * eax = -1
1178
  * if driver is loaded:
-
 
1179
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1146
    * ebx, ecx fail
1180
      - signature
1147
  * If the driver is loaded:
1181
    * ebx = current frequency of the scanning (in Hz)
1148
    * eax = 'MDAZ' (in style fasm, i.e. 'M' - low byte,
1182
    * ecx destroyed
1149
    'Z' - high) - signature
1183
    * buffer pointed to by edx is filled
1150
    * ebx = current frequency of the scanning (in a Hz)
1184
Format of the buffer:
1151
    * ecx fail
1185
  * +0: 32*byte: driver name, "Trans VideoDriver"
Line 1152... Line 1186...
1152
    * buffer, which specifies edx, is filled
1186
    (without quotes, supplemented by spaces)
1153
Format of the buffer:
1187
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1154
  * +0: 32*byte: name of the driver, " Trans VideoDriver " (without quotes,
1188
    y*65536+x), for the current implementation is 1 (1.0)
1155
    is supplemented by blanks)
1189
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1156
  * +32 = +0x20: dword: version of the driver (version x.y is encoded
1190
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1157
    as y*65536+x), for current implementation 1 (1.0)
1191
    is number of a videomode, after list itself there are zeroes)
1158
  * +36 = +0x24: 7*dword: reserved (0 in current implementation)
1192
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1159
  * +64 = +0x40: 32*word: list of supported videomodes (each word - number
1193
    scannings for videomodes: for each videomode listed in the
1160
    of videomode, after the purely list there are zero)
1194
    previous field up to 5 supported frequences are given
1161
  * +128 = +0x80: 32*(5*word): list of supported frequencies of the scannings
1195
    (unused positions contain zeroes)
1162
    for videomodes: for each videomode indicated in the previous field,
1196
Remarks:
1163
    up to 5 supported frequencies (in unused positions are indicated the zero)
1197
  * Function initializes the driver (if it is not initialized yet)
1164
    are written.
1198
    and must be called first, before others (otherwise they will do
1165
Remarks:
1199
    nothing and return -1).
1166
  * Function initializes the driver (if it is not initialized yet) and should
1200
  * The current implementation supports only one frequency
Line 1167... Line 1201...
1167
    be called by first, before others (differently they will return -1,
1201
    of the scanning on videomode.
1168
    nothing doing).
1202
 
1169
  * In current implementation one frequency of the scanning on videomode
1203
======================================================================
1170
    is supported only.
1204
============ Function 21, subfunction 13, subsubfunction 2 ===========
1171
 
1205
================ Get information on current videomode. ===============
1172
======================================================================
1206
======================================================================
1173
============= Function 21, subfunction 13, subsubfunction 2 ==========
1207
Parameters:
1174
================= Get information on current videomode. ==============
1208
  * eax = 21 - function number
1175
======================================================================
1209
  * ebx = 13 - subfunction number
1176
Parameters:
1210
  * ecx = 2 - number of the driver function
1177
  * eax = 21 - number of the function
1211
Returned value:
1178
  * ebx = 13 - number subfunction
1212
  * eax = -1 - driver is not loaded or not initialized;
1179
  * ecx = 2 - number of the function of the driver
1213
    ebx,ecx are destroyed
1180
Returned value:
1214
  * eax = [width]*65536 + [height]
1181
  * eax = -1 - driver is not loaded or is not initialized;
1215
  * ebx = frequency of the vertical scanning (in Hz)
1182
    ebx,ecx fail
1216
  * ecx = number of current videomode
1183
  * eax = [width]*65536 + [height]
1217
Remarks:
1184
  * ebx = frequency of the vertical scanning (in a Hz)
1218
  * Driver must be initialized by call to 
1185
  * ecx = number of current videomode
1219
    driver function 1.
Line 1186... Line 1220...
1186
Remarks:
1220
  * If only screen sizes are required, it is more expedient to use
1187
  * Driver previously should be initialized by function call of the driver 1.
1221
    function 14 taking into account that it
1188
  * If the sizes of the screen are necessary only, it is more expedient
1222
    returns sizes on 1 less.
1189
    to use the function 14 that it returns sizes on 1 less.
1223
 
1190
 
1224
======================================================================
1191
======================================================================
1225
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1192
= Function 21, subfunction 13, subsubfunction 3 - install videomode. 
1226
======================================================================
1193
======================================================================
1227
Parameters:
1194
Parameters:
1228
  * eax = 21 - function number
1195
  * eax = 21 - number of the function
1229
  * ebx = 13 - subfunction number
1196
  * ebx = 13 - number subfunction
1230
  * ecx = 3 - number of the driver function
1197
  * ecx = 3 - number of the function of the driver
1231
  * edx = [scanning frequency]*65536 + [videomode number]
1198
  * edx = [frequency of the scanning] *65536 + [number of videomode]
1232
Returned value:
1199
Returned value:
1233
  * eax = -1 - driver is not loaded, not initialized or
1200
  * eax = -1 - driver is not loaded, not initialized or has taken place error
1234
    an error has occured
1201
  * eax = 0 - successfully
1235
  * eax = 0 - success
1202
  * ebx, ecx fail
1236
  * ebx, ecx destroyed
1203
Remarks:
1237
Remarks:
1204
  * Driver previously should be initialized by function call of the driver 1.
1238
  * Driver must be initialized by driver function 1.
1205
  * Number of videomode and frequency should be in the table returned
1239
  * The videomode number and frequency must be in the table
1206
    function 1 of the driver.
1240
    returned by driver function 1.
1207
 
1241
 
1208
======================================================================
1242
======================================================================
1209
============= Function 21, subfunction 13, subsubfunction 4 ==========
1243
============ Function 21, subfunction 13, subsubfunction 4 ===========
1210
===================== Return to former videomode. ====================
1244
================== Return to the initial videomode. ==================
-
 
1245
======================================================================
1211
======================================================================
1246
Returns the screen to the videomode set at system boot.
1212
Âîçâðàùàåò ýêðàí â videomode, óñòàíîâëåííîì ïðè çàãðóçêå ñèñòåìû.
1247
Parameters:
1213
Parameters:
1248
  * eax = 21 - function number
1214
  * eax = 21 - number of the function
1249
  * ebx = 13 - subfunction number
1215
  * ebx = 13 - number subfunction
1250
  * ecx = 4 - number of the driver function
1216
  * ecx = 4 - number of the function of the driver
1251
Returned value:
1217
Returned value:
1252
  * eax = -1 - driver is not loaded or not initialized
1218
  * eax = -1 - driver is not loaded or is not initialized
1253
  * eax = 0 - success
1219
  * eax = 0 - successfully
1254
  * ebx, ecx destroyed
1220
  * ebx, ecx fail
1255
Remarks:
1221
Remarks:
1256
  * Driver must be initialized by call to driver function 1.
Line 1222... Line 1257...
1222
  * Driver previously should be initialized by function call of the driver 1.
1257
 
1223
 
1258
======================================================================
1224
=======================================================================
1259
============ Function 21, subfunction 13, subsubfunction 5 ===========
1225
============= Function 21, subfunction 13, subsubfunction 5 ===========
1260
===== Increase/decrease the size of the visible area of monitor. =====
-
 
1261
======================================================================
Line 1226... Line 1262...
1226
====== Increase/reduce a size of visible area of screen monitor. ======
1262
Parameters:
1227
=======================================================================
1263
  * eax = 21 - function number
1228
Parameters:
1264
  * ebx = 13 - subfunction number
1229
  * eax = 21 - number of the function
1265
  * ecx = 5 - number of the driver function
1230
  * ebx = 13 - number subfunction
1266
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1231
  * ecx = 5 - number of the function of the driver
1267
  * edx = 2/3 - is not supported in the current implementation;
1232
  * edx = 0/1 - reduce/increase a size on a horizontal by one position
1268
    is planned as decrease/increase vertical size on 1 position
1233
  * edx = 2/3 - in current realization is not supported; is planned as
1269
Returned value:
1234
    decrease/increase of a size on a vertical for one position
1270
  * eax = -1 - driver is not loaded or not initialized
1235
Returned value:
1271
  * eax = 0 - success
1236
  * eax = -1 - driver is not loaded or is not initialized
1272
  * ebx, ecx destroyed
1237
  * eax = 0 - successfully
1273
Remarks:
1238
  * ebx, ecx fail
1274
  * Driver must be initialized by call to driver function 1.
1239
Remarks:
1275
  * Function influences only the physical size of the screen image;
1240
  * Driver previously should be initialized by function call of the driver 1.
1276
    the logical size (number of pixels) does not change.
1241
  * Function influences only a physical size of the map on the screen monitor;
1277
 
Line 1242... Line 1278...
1242
    the logical size (number of pixels) does not vary.
1278
======================================================================
1243
 
1279
================= Function 22 - set system date/time. ================
1244
======================================================================
1280
======================================================================
1245
=============== Function 22 - install system date/time. ==============
1281
Parameters:
1246
======================================================================
1282
  * eax = 22 - function number
1247
Parameters:
1283
  * ebx = 0 - set time
1248
  * eax = 22 - number of the function
1284
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1249
  * ebx = 0 - install time
1285
    * HH=hour 00..23
1250
    * ecx = 0x00SSMMHH - time in a binary-decimal code (BCD):
1286
    * MM=minute 00..59
1251
    * HH=hour 00..23
1287
    * SS=second 00..59
1252
    * MM=minute 00..59
1288
  * ebx = 1 - set date
1253
    * SS=second 00..59
1289
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1254
  * ebx = 1 - óñòàíîâèòü äàòó
1290
    * DD=day 01..31
1255
    * ecx = 0x00DDMMYY - date in a binary-decimal code (BCD):
1291
    * MM=month 01..12
1256
    * DD=day 01..31
1292
    * YY=year 00..99
1257
    * MM=month 01..12
1293
  * ebx = 2 - set day of week
1258
    * YY=year 00..99
1294
    * ecx = 1 for Sunday, ..., 7 for Saturday
1259
  * ebx = 2 - install day of week
1295
  * ebx = 3 - set alarm clock
Line 1260... Line 1296...
1260
    * ecx = 1 for Sunday, ..., 7 for Saturday
1296
    * ecx = 0x00SSMMHH
1261
  * ebx = 3 - install an alarm clock
1297
Returned value:
1262
    * ecx = 0x00SSMMHH
1298
  * eax = 0 - success
1263
Returned value:
1299
  * eax = 1 - incorrect parameter
1264
  * eax = 0 - successfully
1300
  * eax = 2 - CMOS-battery was unloaded
1265
  * eax = 1 - parameter is given incorrectly
1301
Remarks:
1266
  * eax = 2 - CMOS-battery was unloaded
1302
  * Value of installation of day of week seems to be doubtful,
1267
Remarks:
1303
    as it a little where is used
1268
  * value of installation of day of week is represented doubtful, as it a
1304
    (day of week can be calculated by date).
1269
    little where is used (day of week it is possible to calculate by date of).
1305
  * Alarm clock can be set on operation in the given time every day.
1270
  * Alarm clock can be installed on operation in the given time each day.
1306
    But there is no existing system function to disable it.
1271
    Thus to disable by its existing system functions it is impossible.
1307
  * Operation of alarm clock consists in generation IRQ8.
1272
  * Operation of an alarm clock consists in generation IRQ8.
1308
  * Generally CMOS supports for alarm clock set of value 0xFF
1273
  * Generally CMOS supports for an alarm clock installation of value 0xFF
1309
    as one of parameters and it means that the appropriate parameter
1274
    as one of parameters and means it, that the appropriate parameter
1310
    is ignored. But current implementation does not allow this
1275
    is ignored. But in current implementation it will not pass
1311
    (will return 1).
1276
    (will return value 1).
1312
  * Alarm clock is a global system resource; the set of
1277
  * Alarm clock - global system resource; the installation of an alarm clock
1313
    an alarm clock cancels automatically the previous set.
1278
    automatically cancels the previous installation. However, at present any
1314
    However, at moment no program uses it.
Line 1279... Line 1315...
1279
    program it does not use.
1315
 
1280
 
1316
======================================================================
1281
======================================================================
1317
============= Function 23 - wait for event with timeout. =============
1282
============== Function 23 - expect event with timeout. =============
1318
======================================================================
1283
======================================================================
1319
If the message queue is empty, waits for new message in the queue,
1284
If message queue is empty, waits for appearance of the message in queue, but no more indicated time. Then reads out the message from queue.
1320
but no more than given time. Then reads out a message from the queue.
1285
 
1321
 
1286
Parameters:
1322
Parameters:
1287
  * eax = 23 - number of the function
1323
  * eax = 23 - function number
1288
  * ebx = timeout (in 1/100 of second)
1324
  * ebx = timeout (in 1/100 of second)
1289
Returned value:
1325
Returned value:
1290
  * eax = 0 - message queue is empty
1326
  * eax = 0 - the message queue is empty
Line 1291... Line 1327...
1291
  * differently eax = event (look the list of events)
1327
  * otherwise eax = event (see the list of events)
1292
Remarks:
1328
Remarks:
1293
  * Those events are taken into account only which enter into a mask installed
1329
  * Only those events are taken into account, which enter into
1294
    by the function 40. By default it is events redraw, pressing keys
1330
    the mask set by function 40. By default it is
1295
    and buttons.
1331
    redraw, key and button events.
1296
  * For check, whether there is a message in queue, use the function 11.
1332
  * To check for presence of a message in the queue use function 11.
1297
    To wait as much as long, use the function 10.
1333
    To wait without timeout use function 10.
1298
  * Transmission ebx=0 results in instant returning eax=0.
1334
  * Transmission ebx=0 results in immediate returning eax=0.
1299
  * At current realization there will be an immediate return from the function
1335
  * Current implementation returns immediately with eax=0,
-
 
1336
    if the addition of ebx with the current value of time counter
1300
    with eax=0, if the addition ebx with current value of the counter of time
1337
    makes 32-bit overflow.
1301
    will call 32-bit overflow.
1338
 
1302
 
1339
======================================================================
1303
======================================================================
1340
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1304
======= Function 24, subfunction 1 - begin to play a CD - audio. =====
1341
======================================================================
1305
======================================================================
1342
Parameters:
1306
Parameters:
1343
  * eax = 24 - function number
-
 
1344
  * ebx = 1 - subfunction number
1307
  * eax = 24 - number of the function
1345
  * ecx = 0x00FRSSMM, where
Line 1308... Line 1346...
1308
  * ebx = 1 - number subfunction
1346
    * MM = starting minute
1309
  * ecx = 0x00FRSSMM, where
1347
    * SS = starting second
1310
     * MM = initial minute
1348
    * FR = starting frame
1311
     * SS = initial second
1349
Returned value:
1312
     * FR = initial frame
1350
  * eax = 0 - success
1313
Returned value:
1351
  * eax = 1 - CD base is not defined
1314
   * eax = 0 - successfully
1352
Remarks:
1315
   * eax = 1 - base CD is not defined
1353
  * Previously CD base must be defined by the call to 
1316
Remarks:
1354
    subfunction 3 of function 21.
1317
  * Previously it is necessary to define a base port CD by call
1355
  * One second includes 75 frames, one minute includes 60 seconds.
Line 1318... Line 1356...
1318
    subfunction 3 functions 21.
1356
  * The function is asynchronous (returns control, when play begins).
1319
  * In one second 75 frames, in one minute 60 seconds.
1357
 
1320
  * Function is asynchronous (returns handle, when the playing) began.
1358
======================================================================
1321
 
1359
======= Function 24, subfunction 2 - get information on tracks. ======
1322
======================================================================
1360
======================================================================
1323
====== Function 24, subfunction 2 - get information on tracks. =======
1361
Parameters:
1324
======================================================================
1362
  * eax = 24 - function number
1325
Parameters:
1363
  * ebx = 2 - subfunction number
1326
  * eax = 24 - number of the function
1364
  * ecx = pointer to the buffer for the table
1327
  * ebx = 2 - number subfunction
1365
    (maximum 8*64h+4 bytes=100 tracks)
1328
  * ecx = pointer on the buffer for the table
1366
Returned value:
1329
    (maximal 8*64h+4 byte =100 tracks)
1367
  * eax = 0 - success
1330
Returned value:
1368
  * eax = 1 - CD base is not defined
1331
  * eax = 0 - successfully
1369
Remarks:
1332
  * eax = 1 - base CD is not defined
1370
  * The format of the table with tracks information is the same as
1333
Remarks:
1371
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1334
  * The format of the table with the information on tracks same, as well
1372
    Function returns addresses in MSF.
1335
    as for a ATAPI-CD of the command 43h (READ TOC), usual table
1373
  * Previously CD base port must be set by call to 
1336
    (subcommand 00h). The addresses come back in the format MSF.
1374
    subfunction 3 of function 21.
1337
  * Previously it is necessary to define a base port CD by call
1375
  * Function returns information only about no more than 100
1338
    subfunction 3 functions 21.
1376
    first tracks. In most cases it is enough.
1339
  * Function returns the information only about no more than 100 first tracks.
1377
 
1340
    In most cases it is enough of it.
1378
======================================================================
1341
 
1379
========== Function 24, subfunction 3 - stop play CD-audio. ==========
-
 
1380
======================================================================
1342
======================================================================
1381
Parameters:
1343
========= Function 24, subfunction 3 - stop play CD - audio. =========
1382
  * eax = 24 - function number
1344
======================================================================
1383
  * ebx = 1 - subfunction number
1345
Parameters:
1384
Returned value:
1346
  * eax = 24 - number of the function
1385
  * eax = 0 - success
1347
  * ebx = 1 - number subfunction
1386
  * eax = 1 - CD base is not defined
1348
Returned value:
1387
Çàìå÷àíèÿ:
1349
  * eax = 0 - successfully
1388
  * Previously CD base port must be defined by call to 
1350
  * eax = 1 - base CD is not defined
1389
    subfunction 3 of function 21.
1351
Remarks:
1390
 
Line 1352... Line 1391...
1352
  * Previously it is necessary to define a base port CD by call
1391
======================================================================
1353
    subfunction 3 functions 21.
1392
=================== Function 25 - set SBPro volume. ==================
1354
 
1393
======================================================================
1355
======================================================================
1394
Parameters:
1356
================= Function 25 - install volume SBPro. ================
1395
  * eax = 25 - function number
1357
======================================================================
1396
  * ebx = what to set:
1358
Parameters:
1397
    * 1 - set common volume
1359
  * eax = 25 - number of the function
1398
    * 2 - set CD-audio volume
1360
  * ebx = what to install:
1399
  * cl = volume level: high 4 bits for the left column,
1361
    * 1 - install common volume
1400
    low 4 bits for the right one
1362
    * 2 - install volume of CD - audio
1401
Returned value:
Line 1363... Line 1402...
1363
  * cl = Level of volume: high 4 bits for the left column, low 4 - for right
1402
  * eax = 0 - success
1364
Returned value:
1403
  * eax = 1 - SB base is not defined
1365
  * eax = 0 - successfully
1404
  * eax = 2 - incorrect subfunction
1366
  * eax = 1 - base SB is not defined
1405
Remarks:
1367
  * eax = 2 - incorrect subfunction
1406
  * Previously SB base port must be defined by 
1368
Remarks:
1407
    subfunction 4 of function 21.
1369
  * Previously it is necessary to define a base port SB by call
1408
  * See also function 28 which sets
1370
    subfunction 4 functions 21.
1409
    volume for the later standard SB16.
1371
  * See also function 28 installations of a sound for later standard SB16.
1410
 
1372
 
1411
======================================================================
1373
======================================================================
1412
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
Line 1374... Line 1413...
1374
======== Function 26, subfunction 1 - get base port MPU MIDI. ========
1413
======================================================================
1375
======================================================================
1414
Parameters:
1376
Parameters:
1415
  * eax = 26 - function number
1377
  * eax = 26 - number of the function
1416
  * ebx = 1 - subfunction number
1378
  * ebx = 1 - number subfunction
1417
Returned value:
1379
Returned value:
1418
  * eax = port number
1380
  * eax = number of a port
1419
Parameters:
1381
Remarks:
1420
  * To set base port use subfunction 1 of function 21.
1382
  * Install a base port it is possible by call subfunction of 1 function 21.
1421
 
1383
 
1422
======================================================================
1384
======================================================================
1423
========== Function 26, subfunction 2 - get keyboard layout. =========
1385
========== Function 26, subfunction 2 - get keyboard layout. =========
1424
======================================================================
1386
======================================================================
-
 
1387
The keyboard layout is used for conversion scancodes, acting from the keyboard,
1425
The keyboard layout is used to convert keyboard scancodes to
Line 1388... Line 1426...
1388
in ASCII-codes which were read - out by the function 2.
1426
ASCII-codes for function 2.
1389
Parameters:
1427
Parameters:
1390
  * eax = 26 - number of the function
1428
  * eax = 26 - function number
1391
  * ebx = 2 - number subfunction
1429
  * ebx = 2 - subfunction number
1392
  * ecx = what layout to get:
1430
  * ecx = what layout to get:
1393
    * 1 = normal layout
1431
    * 1 = normal layout
1394
    * 2 = layout at pressed Shift
1432
    * 2 = layout with pressed Shift
1395
    * 3 = layout at pressed Alt
1433
    * 3 = layout with pressed Alt
1396
  * edx = pointer on the buffer of length 128 bytes, where the layout
1434
  * edx = pointer to the 128-bytes buffer, where the layout will be
1397
    will be copied
1435
    copied
1398
Returned value:
1436
Returned value:
Line 1399... Line 1437...
1399
  * function does not return value
1437
  * function does not return value
1400
Èëè:
1438
Or:
1401
  * eax = 26 - number of the function
1439
  * eax = 26 - function number
1402
  * ebx = 2 - number subfunction
1440
  * ebx = 2 - subfunction number
1403
  * ecx = 9
1441
  * ecx = 9
1404
Returned value:
1442
Returned value:
1405
  * eax = identifier of the country (1=eng, 2=fi, 3=ger, 4=rus)
1443
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1406
Remarks:
1444
Remarks:
1407
  * If is pressed Alt, the layout with Alt is used; if not is pressed Alt,
1445
  * If Alt is pressed, the layout with Alt is used;
1408
    but is pressed Shift, the layout with Shift is used; if not are
1446
    if Alt is not pressed, but Shift is pressed,
1409
    pressed Alt and Shift, but is pressed Ctrl, the normal layout is used,
1447
    the layout with Shift is used;
1410
    then from the code is subtracted 0x60; if not any of direction keys
1448
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1411
    is pressed, the normal layout is used.
1449
    layout is used and then from the code is subtracted 0x60;
1412
  * Install layouts and identifier of the country it is possible with the help
1450
    if no control key is pressed, the normal layout is used.
1413
    subfunction 2 functions 21.
1451
  * To set layout and country identifier use 
1414
  * The identifier of the country - global environment variable, which by
1452
    subfunction 2 of function 21.
1415
    kernel is not used; however application @panel displays an icon,
1453
  * Country identifier is global system variable, which is not used
Line 1416... Line 1454...
1416
    appropriate to the current country (using the described function).
1454
    by the kernel itself; however the application '@panel' displays
1417
  * Application @panel switches layouts on search of the user.
1455
    the corresponding icon (using this function).
1418
 
1456
  * The application @panel switches layouts on user request.
1419
======================================================================
1457
 
1420
============= Function 26, subfunction 3 - get base CD. ==============
1458
======================================================================
1421
======================================================================
1459
============== Function 26, subfunction 3 - get CD base. =============
1422
Parameters:
1460
======================================================================
1423
  * eax = 26 - number of the function
1461
Parameters:
1424
  * ebx = 3 - number subfunction
1462
  * eax = 26 - function number
1425
Returned value:
1463
  * ebx = 3 - subfunction number
1426
  * eax = base CD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1464
Returned value:
1427
Remarks:
1465
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1428
  * Base CD is used by the function 24.
1466
Remarks:
1429
  * Install base CD it is possible by call subfunction 3 functions 21.
1467
  * CD base is used by function 24.
1430
 
1468
  * To set CD base use subfunction 3 of function 21.
1431
======================================================================
1469
 
1432
====== Function 26, subfunction 4 - get base port Sound Blaster. =====
1470
======================================================================
1433
======================================================================
1471
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
1434
Parameters:
1472
======================================================================
Line 1435... Line 1473...
1435
  * eax = 26 - number of the function
1473
Parameters:
1436
  * ebx = 4 - number subfunction
1474
  * eax = 26 - function number
1437
Returned value:
1475
  * ebx = 4 - subfunction number
1438
  * eax = number of a base port
1476
Returned value:
1439
Remarks:
1477
  * eax = base port number
1440
  * Installation of base is necessary for operation of functions 25, 55.
1478
Remarks:
1441
  * Install a base port it is possible by call subfunction 4 functions 21.
1479
  * Bae port is used by functions 25, 55.
1442
 
1480
  * To set base port use subfunction 4 of function 21.
1443
======================================================================
1481
 
1444
======== Function 26, subfunction 5 - get language of system. ========
1482
======================================================================
1445
======================================================================
1483
========== Function 26, subfunction 5 - get system language. =========
1446
Parameters:
1484
======================================================================
Line 1447... Line 1485...
1447
  * eax = 26 - number of the function
1485
Parameters:
1448
  * ebx = 5 - number subfunction
1486
  * eax = 26 - function number
1449
Returned value:
1487
  * ebx = 5 - subfunction number
1450
  * eax = language of system (1=eng, 2=fi, 3=ger, 4=rus)
1488
Returned value:
1451
Remarks:
1489
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1452
  * Language of the system - global environment variable in any way which
1490
Remarks:
1453
    is not used by kernel, however application @panel draws
1491
  * System language is global system variable and is not used
1454
    an appropriate icon (using described function).
1492
    by the kernel itself, however application @panel draws the
1455
  * Install the language of the system it is possible by call
1493
    appropriate icon (using this function).
1456
    subfunction 5 functions 21.
1494
  * To set system language use subfunction 5 of function 21.
1457
 
1495
 
1458
======================================================================
-
 
Line 1459... Line 1496...
1459
=========== Function 26, subfunction 6 - get base port WSS. ==========
1496
======================================================================
1460
======================================================================
1497
=========== Function 26, subfunction 6 - get WSS base port. ==========
1461
Parameters:
1498
======================================================================
1462
  * eax = 26 - number of the function
1499
Parameters:
1463
  * ebx = 6 - number subfunction
1500
  * eax = 26 - function number
1464
Returned value:
1501
  * ebx = 6 - subfunction number
1465
  * eax = base port
1502
Returned value:
1466
Remarks:
1503
  * eax = base port
1467
  * Base WSS is used by the function 27.
1504
Remarks:
1468
  * Install a base port WSS it is possible by call subfunction 6 functions 21.
1505
  * WSS base is used by function 27.
1469
 
1506
  * To set WSS base port use subfunction 6 of function 21.
1470
======================================================================
-
 
1471
============== Function 26, subfunction 7 - get base HD. =============
1507
 
Line 1472... Line 1508...
1472
======================================================================
1508
======================================================================
1473
The base HD is necessary for definition, on what hard disk to write, at usage
1509
============== Function 26, subfunction 7 - get HD base. =============
1474
of out-of-date functions of operation with a file system and functions
1510
======================================================================
1475
implicitly using the hard disk (such as subfunction of 6 functions 18);
1511
The HD base defines hard disk to write with usage of obsolete
1476
At usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
1512
file system functions and functions implicitly using the hard disk
1477
these functions install base.
1513
(such as subfunction 6 of function 18);
1478
Parameters:
1514
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1479
  * eax = 26 - number of the function
1515
these function set base themselves.
1480
  * ebx = 7 - number subfunction
1516
Parameters:
1481
Returned value:
1517
  * eax = 26 - function number
1482
  * eax = base HD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1518
  * ebx = 7 - subfunction number
1483
Remarks:
1519
Returned value:
1484
  * Any application at any moment of time can change áàçó.
1520
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1485
  * Install base it is possible by call subfunction 7 functions 21.
-
 
Line 1486... Line 1521...
1486
  * Get used partition of the hard disk it is possible subfunction 8.
1521
Remarks:
1487
 
1522
  * Any application in any time can change HD base.
1488
======================================================================
1523
  * To set base use subfunction 7 of function 21.
1489
=========== Function 26, subfunction 8 - get partition HD. ===========
1524
  * To get used partition of hard disk use subfunction 8.
1490
======================================================================
1525
 
1491
The partition HD is necessary for definition, on what partition of the hard disk
1526
======================================================================
1492
to write, at usage of out-of-date functions of operation with a file system and
1527
========= Function 26, subfunction 8 - get used HD partition. ========
1493
functions implicitly using the hard disk (such as subfunction of 6 functions
1528
======================================================================
1494
18); at usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
1529
The HD partition defines partition of the hard disk to write with
1495
these functions install base and partition.
1530
usage of obsolete file system functions and functions implicitly
1496
Parameters:
1531
using the hard disk (such as subfunction 6 of function 18);
1497
  * eax = 26 - number of the function
1532
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1498
  * ebx = 8 - number subfunction
1533
these functions set base and partition themselves.
1499
Returned value:
1534
Parameters:
1500
  * eax = partition HD (beginning from 1)
1535
  * eax = 26 - function number
1501
Remarks:
1536
  * ebx = 8 - subfunction number
1502
  * Any application at any moment of time can change partition.
1537
Returned value:
1503
  * Install partition it is possible by call subfunction 8 functions 21.
1538
  * eax = HD partition (beginning from 1)
1504
  * Find out number of partitions on the hard disk it is possible by call
1539
Remarks:
1505
    subfunction 11 functions 18.
1540
  * Any application in any time can change partition.
Line 1506... Line 1541...
1506
  * Get used base of the hard disk it is possible subfunction 7.
1541
  * To set partition use subfunction 8 of function 21.
1507
 
1542
  * To get number of partitions on a hard disk use
1508
======================================================================
1543
    subfunction 11 of function 18.
1509
=== Function 26, subfunction 9 - get value of the counter of time. ===
1544
  * To get base of used hard disk, use subfunction 7.
1510
======================================================================
1545
 
1511
Parameters:
1546
======================================================================
1512
  * eax = 26 - number of the function
1547
=== Function 26, subfunction 9 - get the value of the time counter. ==
1513
  * ebx = 9 - number subfunction
1548
======================================================================
1514
Returned value:
1549
Parameters:
1515
  * eax = number of 1/100 second, past from the moment of start of the system
1550
  * eax = 26 - function number
1516
Remarks:
1551
  * ebx = 9 - subfunction number
1517
  * counter takes modulo 2^32, that there corresponds by little more+
1552
Returned value:
1518
    than 497 day.
1553
  * eax = number of 1/100s of second, past from the system boot time
1519
  * System time can be get by the function 3.
1554
Remarks:
1520
 
1555
  * Counter takes modulo 2^32, that correspond to a little more
1521
======================================================================
1556
    than 497 days.
1522
====== Function 26, subfunction 10 - get channel DMA for a sound. ====
1557
  * To get system time use function 3.
Line 1523... Line 1558...
1523
======================================================================
1558
 
1524
Parameters:
1559
======================================================================
1525
  * eax = 26 - number of the function
1560
======== Function 26, subfunction 10 - get sound DMA channel. ========
1526
  * ebx = 10 - number subfunction
1561
======================================================================
1527
Returned value:
1562
Parameters:
1528
  * eax = number of the channel (from 0 up to 3 inclusively)
1563
  * eax = 26 - function number
1529
Remarks:
1564
  * ebx = 10 - subfunction number
1530
  * Number of the channel DMA is used in subfunction 1 function 55.
1565
Returned value:
1531
  * Install the channel DMA for a sound it is possible by call
1566
  * eax = number of the channel (from 0 to 3 inclusive)
1532
    subfunction 10 functions 21.
1567
Remarks:
1533
 
1568
  * Number of the DMA channel is used by subfunction 1 of function 55.
1534
======================================================================
1569
  * To set the sound DMA channel use subfunction 10 of function 21.
1535
====================== Function 26, subfunction 11 ===================
1570
 
Line 1536... Line 1571...
1536
========= Find out, whether low level access to HD is allowed. =======
1571
======================================================================
1537
======================================================================
1572
===================== Function 26, subfunction 11 ====================
1538
Parameters:
1573
========== Find out whether low-level HD access is enabled. ==========
1539
  * eax = 26 - number of the function
1574
======================================================================
1540
  * ebx = 11 - number subfunction
1575
Parameters:
1541
Returned value:
1576
  * eax = 26 - function number
1542
  * eax = 0/1 - prohibit/permit
1577
  * ebx = 11 - subfunction number
1543
Remarks:
1578
Returned value:
1544
  * Is used at LBA-reading (subfunction 8 functions 58).
1579
  * eax = 0/1 - disabled/enabled
1545
  * Install a current status it is possible by call
1580
Remarks:
1546
    subfunction 11 functions 21.
1581
  * Is used in LBA read (subfunction 8 of function 58).
1547
 
1582
  * To set current state use subfunction 11 of function 21.
1548
======================================================================
1583
 
1549
====================== Function 26, subfunction 12 ===================
1584
======================================================================
-
 
1585
===================== Function 26, subfunction 12 ====================
1550
======= Find out, whether low level access to PCI is allowed. ========
1586
========== Find out whether low-level PCI access is enabled. =========
1551
======================================================================
1587
======================================================================
1552
Parameters:
1588
Parameters:
1553
  * eax = 26 - number of the function
1589
  * eax = 26 - function number
1554
  * ebx = 12 - number subfunction
1590
  * ebx = 12 - subfunction number
1555
Returned value:
1591
Returned value:
-
 
1592
  * eax = 0/1 - disabled/enabled
1556
  * eax = 0/1 - prohibit/permit
1593
Remarks:
1557
Remarks:
1594
  * Is used by operations with PCI bus (function 62).
1558
  * Is used by operation with the bus PCI (function 62).
1595
  * The current implementation uses only low bit of ecx.
1559
  * Current realization uses only low bit ecx.
1596
  * To set the current state use subfunction 12 of function 21.
1560
  * install a current status it is possible by call
1597
 
1561
    subfunction 12 functions 21.
1598
======================================================================
1562
 
1599
======== Function 27 - set Windows Sound System (WSS) volume. ========
1563
======================================================================
1600
======================================================================
1564
==== Function 27 - install volume Windows Sound System (WSS). ===
1601
Parameters:
1565
======================================================================
1602
  * eax = 27 - function number
1566
Parameters:
1603
  * ebx = what to set:
1567
  * eax = 27 - number of the function
1604
    * 1 - set common volume
1568
   * ebx = what to install:
1605
    * 2 - set Line In volume
1569
     * 1 - install common volume
1606
  * cl = volume level (0x0=highest, 0x1F=lowest,
1570
     * 2 - install volume Line In
1607
    if bit 0x80 is set=disable)
1571
  * cl = Level of volume (0x0 = highest, 0x1F = lowest,
1608
Returned value:
1572
    installed bit 0x80 = to disable)
1609
  * eax = 0 - success
1573
Returned value:
1610
  * eax = 1 - WSS base is not defined
1574
  * eax = 0 - successfully
1611
  * eax = 2 - incorrect subfunction
-
 
1612
Remarks:
1575
  * eax = 1 - the base WSS is not defined
1613
  * Previously WSS base port must be defined by call to 
1576
  * eax = 2 - incorrect subfunction
1614
    subfunction 6 of function 21.
1577
Remarks:
1615
  * Set of common volume is ignored (function simply returns eax=0).
1578
  * Previously it is necessary to define a base port WSS by call
1616
  * Old documentation and kernel sources erraticly name function 2
1579
    subfunction 6 functions 21.
1617
    as CD-audio volume.
1580
  * Installation of common volume is actually ignored (comes back eax=0).
1618
 
-
 
1619
======================================================================
Line 1581... Line 1620...
1581
  * In old documentation and in source code of a kernel subfunction 2
1620
=================== Function 28 - set SB16 volume. ===================
1582
    is erraticly called as volume of a CD - audio.
1621
======================================================================
1583
 
1622
Parameters:
1584
======================================================================
1623
  * eax = 28 - function number
1585
================= Function 28 - install volume SB16. =================
1624
  * ebx = what to install:
1586
======================================================================
1625
    * 1 - install common volume
1587
Parameters:
1626
    * 2 - install CD-audio volume
1588
  * eax = 28 - number of the function
1627
  * cl = volume level (0=off, 0xFF=max)
1589
  * ebx = what to install:
1628
Returned value:
1590
    * 1 - install common volume
1629
  * eax = 0 - success
1591
    * 2 - install volume of a CD - audio
1630
  * eax = 1 - SB base is not defined
1592
  * cl = level of volume (0=off, 0xFF=max)
1631
  * eax = 2 - incorrect subfunction
1593
Returned value:
1632
Remarks:
1594
  * eax = 0 - successfully
1633
  * Previously SB base port must be defined by
1595
  * eax = 1 - the base SB is not defined
1634
    subfunction 4 of function 21.
1596
  * eax = 2 - incorrect subfunction
1635
  * This function gives more variants for volume, that function 25.
Line 1597... Line 1636...
1597
Remarks:
1636
 
1598
  * Previously it is necessary to define a base port SB by call
1637
======================================================================
1599
    subfunction 4 functions 21.
1638
=================== Function 29 - get system date. ===================
Line 1600... Line 1639...
1600
  * This function gives more variants for volume, than function 25.
1639
======================================================================
1601
 
1640
Parameters:
1602
======================================================================
1641
  * eax = 29 - function number
1603
==================== Function 29 - get system date. ==================
1642
Returned value:
1604
======================================================================
1643
  * eax = 0x00DDMMYY, where
1605
Parameters:
1644
    (binary-decimal coding, BCD, is used)
-
 
1645
  * YY = two low digits of year (00..99)
Line 1606... Line 1646...
1606
  * eax = 29 - number of the function
1646
  * MM = month (01..12)
1607
Returned value:
1647
  * DD = day (01..31)
1608
  * eax = 0x00DDMMYY, where
1648
Remarks:
1609
    (binary-decimal coding is used, BCD)
1649
  * To set system date use function 22.
1610
   * YY = two low digits of year (00.. 99)
1650
 
1611
   * MM = month (01.. 12)
1651
======================================================================
1612
   * DD = day (01.. 31)
1652
=============== Function 32 - delete file from ramdisk. ==============
1613
Remarks:
1653
======================================================================
1614
   * The system date can be installed by the function 22.
1654
Parameters:
1615
 
1655
  * eax = 32 - function number
1616
======================================================================
1656
  * ebx = pointer to the filename
1617
=============== Function 32 - delete file with ramdisk. ==============
1657
Returned value:
1618
======================================================================
1658
  * eax = 0 - success; otherwise file system error code
-
 
1659
Remarks:
Line 1619... Line 1660...
1619
Parameters:
1660
  * This function is obsolete; function 58 allows to fulfill
1620
  * eax = 32 - number of the function
1661
    the same operations with the extended possibilities.
1621
  * ebx = pointer on a filename
1662
  * The current implementation returns only values 0(success) and
1622
Returned value:
1663
    5(file not found).
1623
  * eax = 0 - successfully; differently error code of a file system
1664
  * The filename must be either in the format 8+3 characters
1624
Remarks:
1665
    (first 8 characters - name itself, last 3 - extension,
1625
  * This function is obsolete; the function 58 allows to fulfil the same
1666
    the short names and extensions are supplemented with spaces),
1626
    operations with the extended possibilities.
1667
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1627
  * Current realization returns only values 0 (successes)
1668
    (name no more than 8 characters, dot, extension 3 characters
Line 1628... Line 1669...
1628
    and 5 (the file is not retrieved).
1669
    supplemented if necessary by spaces).
1629
  * The filename should be or in the format 8+3 characters (first 8 characters
1670
    The filename must be written with capital letters. The terminating
1630
    - purely name, last 3 - extension, the short names and extensions are
1671
    character with code 0 is not necessary (not ASCIIZ-string).
1631
    supplemented by blanks), or in the format 8.3 characters
1672
  * This function does not support folders on the ramdisk.
1632
    "FILE.EXT" / "FILE.EX" (name no more than 8 characters, point,
1673
 
1633
    extension 3 characters supplemented if necessary by blanks).
1674
======================================================================
1634
    Filename should be written by capital letters. The completing character
1675
================ Function 33 - write file to ramdisk. ================
1635
    with the code 0 is not necessary (ASCIIZ-string).
1676
======================================================================
1636
 
1677
Parameters:
1637
======================================================================
1678
  * eax = 33 - function number
1638
=============== Function 33 - save file on ramdisk. ==================
1679
  * ebx = pointer to the filename
1639
======================================================================
1680
  * ecx = pointer to data for writing
1640
Parameters:
1681
  * edx = number of bytes for writing
1641
  * eax = 33 - number of the function
1682
  * should be set esi=0
1642
  * ebx = pointer on a filename
1683
Returned value:
Line 1643... Line 1684...
1643
  * ecx = pointer on data for save
1684
  * eax = 0 - success, otherwise file system error code
1644
  * edx = number byte for save
1685
Remarks:
1645
  * it is necessary to install esi=0
1686
  * This function is obsolete; function 70 allows to fulfil
1646
Returned value:
1687
    the same operations with extended possibilities.
1647
  * eax = 0 - successfully, differently error code of a file system
1688
  * If esi contains non-zero value and selected file already exists,
1648
Remarks:
1689
    one more file with the same name will be created.
1649
  * This function is obsolete; the function 58 allows to fulfil the same
1690
  * Otherwise file will be overwritten.
1650
    operations with the extended possibilities.
1691
  * The filename must be either in the format 8+3 characters
1651
  * If to specify non-zero value in esi and on ramdisk already there is an
1692
    (first 8 characters - name itself, last 3 - extension,
1652
    indicated file, one more file with the same name will be created.
1693
    the short names and extensions are supplemented with spaces),
1653
  * Otherwise file is resave.
1694
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1654
  * The filename should be or in the format 8+3 characters (first 8 characters
1695
    (name no more than 8 characters, dot, extension 3 characters
Line 1655... Line 1696...
1655
    - purely name, last 3 - extension, the short names and extensions are
1696
    supplemented if necessary by spaces).
1656
    supplemented by blanks), or in the format 8.3 characters
1697
    The filename must be written with capital letters. The terminating
1657
    "FILE.EXT" / "FILE.EX" (name no more than 8 characters, point,
1698
    character with code 0 is not necessary (not ASCIIZ-string).
1658
    extension 3 characters supplemented if necessary by blanks).
1699
  * This function does not support folders on the ramdisk.
1659
    Filename should be written by capital letters. The completing character
1700
 
1660
    with the code 0 is not necessary (ASCIIZ-string).
1701
======================================================================
1661
 
1702
======= Function 35 - read the color of a pixel on the screen. =======
1662
======================================================================
1703
======================================================================
1663
======== Function 35 - read colour of a point on the screen. =========
1704
Parameters:
-
 
1705
  * eax = 35
1664
======================================================================
1706
  * ebx = y*xsize+x, where
1665
Parameters:
1707
  * (x,y) = coordinates of a pixel (beginning from 0)
1666
  * eax = 35
1708
  * xsize = horizontal screen size
1667
  * ebx = y*xsize+x, where
1709
Returned value:
1668
  * (x,y) = coordinates of a point (considering from 0)
1710
  * eax = color 0x00RRGGBB
-
 
1711
Remarks:
1669
  * xsize = size of the screen on a horizontal
1712
  * To get screen sizes use function 14. Pay attention,
1670
Returned value:
1713
    that it subtracts 1 from both sizes.
Line 1671... Line 1714...
1671
  * eax = colour 0x00RRGGBB
1714
  * There is also direct access (without any system calls)
1672
Remarks:
1715
    to videomemory through the selector gs. To get parameters of
1673
  * Find out sizes of the screen it is possible by function call 14.
1716
    the current videomode, use function 61.
1674
    Pay attention, that it subtracts 1 of both sizes.
1717
 
1675
  * To a video memory there is also direct access (without calls of system
1718
======================================================================
1676
    functions) through the selector gs. Parameters of current videomode
1719
========= Function 37 - get coordinates/status of the mouse. =========
1677
    it is possible to receive by the function 61.
1720
======================================================================
1678
 
1721
 
1679
======================================================================
1722
---------- Subfunction 0 - screen coordinates of the mouse -----------
1680
=========== Function 37 - get coordinate/status of mouse. ============
1723
Parameters:
1681
======================================================================
1724
  * eax = 37 - function number
1682
 
1725
  * ebx = 0 - subfunction number
Line 1683... Line 1726...
1683
------------ Subfunction 0 - screen coordinates of mouse -------------
1726
Returned value:
1684
Parameters:
1727
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1685
  * eax = 37 - number of the function
1728
    (beginning from 0)
1686
  * ebx = 0 - number subfunction
1729
 
1687
Returned value:
1730
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1688
  * eax = x*65536 + y, (x,y)=coordinates of mouse pointer (considering from 0)
1731
Parameters:
1689
 
1732
  * eax = 37 - function number
1690
------ Subfunction 1 - coordinates of mouse concerning  window -------
1733
  * ebx = 1 - subfunction number
1691
Parameters:
1734
Returned value:
1692
  * eax = 37 - number of the function
1735
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1693
  * ebx = 1 - number subfunction
1736
    relative to the application window (beginning from 0)
1694
Returned value:
1737
Remarks:
1695
  * eax = x*65536 + y, (x,y)=coordinates of mouse pointer concerning
1738
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1696
    an application window (considering from 0)
-
 
1697
Remarks:
1739
    If y>=ywnd, the low word is non-negative and contains
1698
  * Value is calculated under the formula (x-xwnd) *65536 + (y-ywnd).
1740
    relative y-coordinate, and the high word - relative x-coordinate
1699
    If y > =ywnd, the low word nonnegatively also contains relative
1741
    (with correct sign). Otherwise the low word is negative and still
1700
    y-coordinate, and high - relative x-coordinate (correct sign).
1742
    contains relative y-coordinate, and to the high word
1701
    Otherwise low word negatively and all the same contains relative
1743
    1 should be added.
Line 1702... Line 1744...
1702
    y-coordinate, and to a high word it is necessary to add 1.
1744
 
1703
 
1745
------------ Subfunction 2 - pressed buttons of the mouse ------------
1704
---------------- Subfunction 2 - pressed mouse buttons ----------------
1746
Parameters:
1705
Parameters:
1747
  * eax = 37 - function number
1706
  * eax = 37 - number of the function
1748
  * ebx = 2 - subfunction number
1707
  * ebx = 2 - number subfunction
1749
Returned value:
1708
Returned value:
1750
  * eax contains information on the pressed mouse buttons:
1709
  * eax contains  information on the pressed mouse buttons:
1751
  * bit 0 is set = left button is pressed
1710
  * Bit 0 installed = left button pressed
1752
  * bit 1 is set = right button is pressed
1711
  * Bit 1 installed = right button pressed
1753
  * other bits are cleared
Line 1712... Line 1754...
1712
  * Other bits are reset
1754
 
1713
 
1755
======================================================================
1714
======================================================================
1756
====================== Function 38 - draw line. ======================
1715
====================== Function 38 - draw line. ======================
1757
======================================================================
1716
======================================================================
1758
Parameters:
1717
Parameters:
1759
  * eax = 38 - function number
-
 
1760
  * ebx = [start coordinate on axis x]*65536 +
1718
  * eax = 38 - number of the function
1761
              [end coordinate on axis x]
1719
  * ebx = [coordinate began on axis x] *65536 +
1762
  * ecx = [start coordinate on axis y]*65536 +
1720
              [coordinate of the end on axis x]
1763
              [end coordinate on axis y]
1721
  * ecx = [coordinate began on axis y]*65536 +
1764
  * edx = 0x00RRGGBB - color
1722
              [coordinate of the end on axis y]
1765
Returned value:
1723
  * edx = 0x00RRGGBB - colour
-
 
1724
Returned value:
1766
  * function does not return value
1725
  * function does not return value
1767
Remarks:
1726
Remarks:
1768
  * Coordinates are relative to the window.
1727
  * Coordinates take concerning window.
1769
  * End point is also drawn.
1728
  * Finite point also is drawn.
1770
 
1729
 
1771
======================================================================
1730
======================================================================
1772
== Function 39, subfunction 1 - get a size of the background image. ==
1731
===== Function 39, subfunction 1 - get size of background image. =====
1773
======================================================================
1732
======================================================================
1774
Parameters:
1733
Parameters:
1775
  * eax = 39 - function number
1734
  * eax = 39 - number of the function
1776
  * ebx = 1 - subfunction number
1735
  * ebx = 1 - number subfunction
1777
Returned value:
1736
Returned value:
1778
  * eax = [width]*65536 + [height]
1737
  * eax = [width]*65536 + [height]
1779
Remarks:
Line 1738... Line 1780...
1738
Remarks:
1780
  * There is a pair function to set sizes of background image -
1739
  * There is a pair command of installation of sizes of background image -
1781
    subfunction 1 of function 15. After which it is necessary,
1740
    subfunction of 1 function 15. After which, certainly, it is necessary
1782
    of course, anew to define image.
Line 1741... Line 1783...
1741
    anew to define image.
1783
 
1742
 
1784
======================================================================
1743
======================================================================
1785
== Function 39, subfunction 2 - get pixel from the background image. =
1744
== Function 39, subfunction 2 - read a point from background image. ==
1786
======================================================================
1745
======================================================================
1787
Parameters:
1746
Parameters:
1788
  * eax = 39 - function number
1747
  * eax = 39 - number of the function
1789
  * ebx = 2 - subfunction number
1748
  * ebx = 2 - number subfunction
1790
  * ecx = offset
Line 1749... Line 1791...
1749
  * ecx = offset
1791
Returned value:
1750
Returned value:
1792
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1751
  * eax = 0x00RRGGBB - colour of a point, if offset is valid (less 0x160000-16)
1793
    (less than 0x160000-16)
1752
  * eax = 2 - differently
1794
  * eax = 2 otherwise
1753
Remarks:
1795
Remarks:
1754
  * It is not necessary to rely on returned value in case of incorrect offset,
1796
  * Do not rely on returned value for invalid offsets, it may be
1755
    it can vary in the following versions of a kernel.
1797
    changed in future kernel versions.
1756
  * Offset of a point with coordinates (x, y) is calculated as (x+y*xsize) *3.
1798
  * Offset for pixel with coordinates (x,y)
1757
  * There is a pair function of installation of a point on background image -
1799
    is calculated as (x+y*xsize)*3.
1758
    subfunction 2 functions 15.
1800
  * There is a pair function to set pixel on the background image - 
1759
 
1801
    subfunction 2 of function 15.
1760
======================================================================
1802
 
1761
==== Function 39, subfunction 4 - get mode redraw of background. =====
1803
======================================================================
1762
======================================================================
1804
== Function 39, subfunction 4 - get drawing mode for the background. =
1763
Parameters:
-
 
Line 1764... Line 1805...
1764
  * eax = 39 - number of the function
1805
======================================================================
1765
  * ebx = 4 - number subfunction
1806
Parameters:
1766
Returned value:
1807
  * eax = 39 - function number
1767
  * eax = 1 - tiled
1808
  * ebx = 4 - subfunction number
1768
  * eax = 2 - stretched
1809
Returned value:
1769
Remarks:
1810
  * eax = 1 - tile
1770
  * There is a pair function of installation of mode redraw of a background -
1811
  * eax = 2 - stretch
1771
    subfunction 4 functions 15.
1812
Remarks:
1772
 
1813
  * There is a pair function to set drawing mode - 
1773
======================================================================
1814
    subfunction 4 of function 15.
1774
========== Function 40 - install a mask for expected events. =========
1815
 
1775
======================================================================
1816
======================================================================
1776
Mask for expected events influences function of operation with events 10,
1817
=========== Function 40 - set the mask for expected events. ==========
1777
11, 23 - they inform only events allowed by this mask.
1818
======================================================================
1778
Parameters:
1819
The mask for expected events affects function working with events
1779
  * eax = 40 - number of the function
1820
10, 11, 23 - they notify only about events allowed by this mask.
1780
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1821
Parameters:
1781
    (installed bit permits notice on event)
1822
  * eax = 40 - function number
1782
Returned value:
1823
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1783
  * function does not return value
1824
    (set bit permits notice on event)
1784
Remarks:
1825
Returned value:
1785
  * Mask by default (7=111b) permits notices about redraw,
1826
  * function does not return value
Line 1786... Line 1827...
1786
    pressings keys and buttons.
1827
Remarks:
1787
    It is enough of it for the majority of the applications.
1828
  * Default mask (7=111b) enables nofices about redraw,
1788
  * The events prohibited in a mask, are all same saved, if come;
1829
    keys and buttons. This is enough for many applications.
1789
    with events simply do not inform on them functions of operation.
1830
  * Events prohibited in the mask are saved anyway, when come;
1790
  * Functions of operation with events take into account a mask on moment
1831
    they are simply not informed with event functions.
1791
    of function call, instead of on moment of arrival of message.
1832
  * Event functions take into account the mask on moment of
1792
 
1833
    function call, not on moment of event arrival.
1793
======================================================================
1834
 
1794
=============== Function 41 - find out the owner IRQ. ================
1835
======================================================================
-
 
1836
==================== Function 41 - get IRQ owner. ====================
1795
======================================================================
1837
======================================================================
1796
Parameters:
1838
Parameters:
1797
  * eax = 41 - number of the function
1839
  * eax = 41 - function number
1798
  * ebx = number IRQ, 0..15
1840
  * ebx = IRQ number, 0..15
1799
Returned value:
1841
Returned value:
1800
  * eax = PID of owner
1842
  * eax = owner PID
1801
  * eax = 0, if owner is not present
1843
  * eax = 0, if there is no owner
1802
  * eax = -1 for incorrect ebx
1844
  * eax = -1 for incorrect ebx
-
 
1845
 
Line 1803... Line 1846...
1803
 
1846
======================================================================
1804
======================================================================
1847
==================== Function 42 - read IRQ data. ====================
1805
=============== Function 42 - read data obtained on IRQ. =============
1848
======================================================================
1806
======================================================================
1849
When an IRQ occurs, the system reads data from ports indicated
1807
At occurrence IRQ system can read out data from indicated earlier by
1850
earlier by function 44 and writes this data to
-
 
1851
internal buffer. This function reads out data from that buffer
1808
function 44 ports and to write these data in buffer.
1852
bytewise.
1809
Described function reads out on byte the data from this buffer.
1853
Parameters:
1810
Parameters:
1854
  * eax = 42 - function number
1811
  * eax = 42 - number of the function
1855
  * ebx = IRQ number, 0..15
1812
  * ebx = number IRQ, 0..15
1856
Returned value: (use value of ecx to distinguish)
1813
Returned value: (situation can be distinguished on value ecx)
1857
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1814
  * if thread is not owner IRQ
1858
    * ecx = 2
1815
    (or number IRQ is given incorrectly):
1859
  * if there is no data:
1816
    * ecx = 2
1860
    * eax = 0
1817
  * if data is not present:
1861
    * ecx = 1
1818
    * eax = 0
1862
    * ebx destroyed
1819
    * ecx = 1
1863
  * if all is ok:
1820
    * ebx fail
1864
    * eax = byte size of data, not yet read from buffer
1821
  * if all in the order and data were:
1865
    * ecx = 0
1822
    * eax = size given, yet not read from the buffer (in bytes)
1866
    * ebx = current byte
1823
    * ecx = 0
1867
Remarks:
1824
    * ebx = current byte
1868
  * Previously the thread must reserve indicated IRQ for itself
1825
Remarks:
1869
    by function 45.
1826
  * Previously thread should reserve for itself indicated IRQ
1870
  * The size of data buffer is 4000 bytes, on overflow
1827
    by the function 45.
1871
    "fresh" data cease to be written in the buffer.
1828
  * Size of the buffer for the data - 4000 bytes, at overflow
1872
 
1829
    the "fresh" data cease to be written in the buffer.
1873
======================================================================
1830
 
1874
================ Function 43 - input/output to a port. ===============
1831
======================================================================
1875
======================================================================
1832
================ Function 43 - input/output in port. =================
1876
 
-
 
1877
------------------------ Output data to port -------------------------
Line 1833... Line 1878...
1833
======================================================================
1878
Parameters:
1834
 
1879
  * eax = 43 - function number
1835
------------------------ Data output in port -------------------------
1880
  * bl = byte for output
1836
Parameters:
1881
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1837
  * eax = 43 - number of the function
1882
Returned value:
1838
  * bl = byte for output
1883
  * eax = 0 - success
1839
  * ecx = number of port 0xnnnn (from 0 up to 0xFFFF)          
1884
  * eax = 1 - the thread has not reserved the selected port
1840
Returned value:
1885
 
1841
  * eax = 0 - successfully
1886
------------------------ Input data from port ------------------------
1842
  * eax = 1 - thread the indicated port has not reserved
1887
Parameters:
1843
 
1888
  * eax = 43 - function number
1844
------------------------ Data input from a port ------------------------
1889
  * ebx is ignored
1845
Parameters:
1890
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1846
  * eax = 43 - number of the function              
1891
Returned value:
1847
  * ebx ignored
1892
  * eax = 0 - success, thus ebx = entered byte
1848
  * ecx = 0x8000nnnn, where nnnn = number of port (from 0 up to 0xFFFF)
1893
  * eax = 1 - the thread has not reserved the selected port
1849
Returned value:
1894
Remarks:
1850
  * eax = 0 - successfully, thus ebx = entered byte
1895
  * Previously the thread must reserve the selected port
1851
  * eax = 1 - thread the given port has not reserved
1896
    for itself by function 46.
1852
Remarks:
1897
  * Instead of call to this function it is better to use
1853
  * Previously thread should reserve behind itself the indicated port
1898
    processor instructions in/out - this is much
1854
    by the function 46.
1899
    faster and a bit shorter and easier.
1855
  * For the reserved ports instead of call of these functions it is better
1900
 
1856
    to use commands of the processor in/out is much faster both a little bit
1901
======================================================================
1857
    more shortly and easier. From the non-reserved ports to read all the same
1902
=========== Function 44 - define operations at IRQ arrival. ==========
1858
    it is impossible.
1903
======================================================================
Line 1859... Line 1904...
1859
 
1904
At IRQ arrival the system can read the data from ports defined
1860
======================================================================
1905
by this function and write these data to internal buffer, whence
1861
=========== Function 44 - define operations at arrival IRQ. ==========
1906
they can be read by ôóíêöèåé 42.
1862
======================================================================
1907
Parameters:
1863
At occurrence IRQ the system can read out the data from the ports, indicated
1908
  * eax = 44 - function number
1864
by this function, and to write these data in the buffer, whence they can be
1909
  * ebx = pointer to the array of structures each describing one port:
1865
read by the function 42.
1910
    * +0: word: 0 means end of array, otherwise port number
1866
Parameters:
1911
    * +2: byte: reserved (ignored)
1867
  * eax = 44 - number of the function
1912
    * +3: byte: 1=read byte from this port, 2=read word
1868
  * ebx = pointer on the array of structures describing on one port:
1913
  * ecx = IRQ number, 0..15
1869
    * +0: word: 0 means the end of the array, differently number of a port
1914
Returned value:
1870
    * +2: byte: reserved (ignored)
1915
  * eax = 0 - success
1871
    * +3: byte: 1 = read out byte from this port, 2 = read out a word
1916
  * eax = 1 - the thread is not owner of selected IRQ
-
 
1917
Remarks:
1872
  * ecx = number IRQ, 0..15
1918
  * Previously the thread must reserve for itself selected IRQ
Line 1873... Line 1919...
1873
Returned value:
1919
    by function 45.
1874
  * eax = 0 - successfully
1920
  * First 16 ports are considered only.
1875
  * eax = 1 - thread is not owner indicated IRQ
1921
  * The current implementation considers incorrect value of field +3
1876
Remarks:
1922
    as a signal to terminate IRQ processing.
1877
  * Previously thread should reserve behind itself indicated IRQ
1923
 
1878
    by the function 45.
1924
======================================================================
1879
  * First 16 ports are considered only.
1925
=================== Function 45 - reserve/free IRQ. ==================
1880
  * Current implementation considers incorrect value of a field +3
1926
======================================================================
1881
    as a signal of termination of processing IRQ.
1927
Parameters:
1882
 
-
 
1883
======================================================================
-
 
1884
============ Function 45 - reserve/free IRQ. ============
-
 
1885
======================================================================
-
 
1886
Parameters:
-
 
1887
  * eax = 45 - number of the function
-
 
1888
  * ebx = 0 - reserve, 1 = free
-
 
1889
  * ecx = number IRQ, 0..15
-
 
1890
Returned value:
-
 
1891
  * eax = 0 - successfully
-
 
1892
  * eax = 1 - error (incorrect number IRQ or attempt reserve not free IRQ
-
 
1893
    or to free IRQ, not reserved by current stream)
-
 
1894
Remarks:
-
 
1895
  * Reserved IRQ is necessary for operation of functions 42 and 44.
-
 
1896
  * Only one thread can reserve selected IRQ.
-
 
1897
  * IRQ, processed by the system is independent, are reserved by
-
 
1898
    the system (stream 1) at loading.
-
 
1899
  * At completion thread are automatically released all reserved by it IRQ.
1928
  * eax = 45 - function number
1900
 
1929
  * ebx = 0 - reserve, 1 = free
1901
======================================================================
1930
  * ecx = IRQ number, 0..15
1902
==== Function 46 - reserve/free group of ports of input/output. ====== 
1931
Returned value:
1903
======================================================================
1932
  * eax = 0 - success
1904
It is possible to access to the reserved ports directly from the application by
1933
  * eax = 1 - error (invalid IRQ number
1905
commands in/out (recommended way) and function call 43 (not recommended way).
-
 
1906
Parameters:
-
 
1907
  * eax = 46 - number of the function
-
 
1908
  * ebx = 0 - reserve, 1 - free
-
 
1909
  * ecx = number of a beginning of a range of ports
-
 
1910
  * edx = number of the end of a range of ports (inclusively)
-
 
Line 1911... Line 1934...
1911
Returned value:
1934
    or attempt to reserve not free IRQ
1912
  * eax = 0 - successfully
1935
    or to free IRQ, not reserved by this thread)
1913
  * eax = 1 - error
1936
Remarks:
1914
Remarks:
1937
  * IRQ reservation is required for functions 42 and 44.
1915
  * In case of backup of ports the error considers execution of one
1938
  * Only one thread can reserve the specific IRQ.
1916
    of conditions:
1939
  * IRQs, handled by the system itself, are reserved by the system
1917
    * beginning address more than end address;
1940
    (thread 1) at booting.
1918
    * indicated range contains incorrect number of a port
1941
  * When a thread terminates, all reserved by it IRQs
1919
      (correct - from 0 up to 0xFFFF);
1942
    are freed automatically.
-
 
1943
 
1920
    * limitation on a total number of the reserved areas -
1944
======================================================================
1921
      is exceeded the maximal 255 is admitted;
1945
====== Function 46 - reserve/free a group of input/output ports. =====
-
 
1946
======================================================================
-
 
1947
To work with reserved ports an application can access directly by
-
 
1948
commands in/out (recommended way) and can use function 43
-
 
1949
(not recommended way).
-
 
1950
Parameters:
-
 
1951
  * eax = 46 - function number
-
 
1952
  * ebx = 0 - reserve, 1 - free
-
 
1953
  * ecx = start port number
-
 
1954
  * edx = end port number (inclusive)
-
 
1955
Returned value:
-
 
1956
  * eax = 0 - success
-
 
1957
  * eax = 1 - error
-
 
1958
Remarks:
-
 
1959
  * For ports reservation: an error occurs if and only if
-
 
1960
    one from the following condition satisfies:
-
 
1961
    * start port is more than end port;
-
 
1962
    * the selected range contains incorrect port number
-
 
1963
      (correct are from 0 to 0xFFFF);
-
 
1964
    * limit for the total number of reserved areas is exceeded
-
 
1965
      (maximum 255 are allowed);
-
 
1966
    * the selected range intersects with any of earlier reserved
-
 
1967
  * For ports free: an error is an attempt to free range,
-
 
1968
    that was not earlier reserved by this function
1922
    * indicated range is intersected with one of earlier reserved
1969
    (with same ecx,edx).
1923
  * In case of release of ports the error considers attempt of release of
1970
  * If an error occurs (for both cases) function performs no action.
1924
    a range, which was not wholly reserved by same function (with the same
1971
  * At booting the system reserves for itself ports 0..0xff, and if
1925
    values ecx, edx) earlier.
1972
    COM-mouse is detected - additionally range of COM-ports
1926
  * At detection of an error (in both cases) any operations is not does.
1973
    0x3f0..0x3ff and/or 0x2f0..0x2ff.
1927
  * At loading the system reserved behind itself ports 0.. 0xff, and at
1974
  * When a thread terminates, all reserved by it ports
1928
    detection of COM-mouse - in addition range of COM-ports 0x3f0.. 0x3ff
1975
    are freed automatically.
1929
    and/or 0x2f0.. 0x2ff.
1976
 
1930
  * At completion thread all ports, reserved by it are automatically free.
1977
======================================================================
1931
 
1978
============= Function 47 - draw a number in the window. =============
1932
======================================================================
1979
======================================================================
1933
============== Function 47 - draw number in window. ==================
1980
Parameters:
1934
======================================================================
1981
  * eax = 47 - function number
1935
Parameters:
1982
  * ebx = parameters of conversion number to text:
1936
  * eax = 47 - number of the function
1983
    * bl = 0 - ecx contains number
1937
  * ebx = parameters of conversion of number in the text:
1984
    * bl = 1 - ecx contains pointer to dword-number
1938
    * bl = 0 - ecx contains number
1985
    * bh = 0 - display in decimal number system
1939
    * bl = 1 - ecx contains the pointer on dword-number
1986
    * bh = 1 - display in hexadecimal system
1940
    * bh = 0 - to display in a decimal number system
1987
    * bh = 2 - display in binary system
1941
    * bh = 1 - to display in the hexadecimal system
1988
    * áèòû 16-21 = how many digits to display
1942
    * bh = 2 - to display in the binary system
1989
    * áèòû 22-31 reserved and must be set to 0
1943
    * Bits 16-21 = how many digits to display
1990
  * ecx = number (if bl=0) or pointer (if bl=1)
1944
    * The bits 22-31 are reserved and should be installed in 0
1991
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1945
  * ecx = number (at bl=0) or pointer (at bl=1)
1992
  * esi = 0xN0RRGGBB, RRGGBB=color, N=font (0/1)
1946
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1993
Returned value:
1947
  * esi = 0xN0RRGGBB, RRGGBB=colour, N=font (0/1)
1994
  * function does not return value
1948
Returned value:
1995
Remarks:
1949
  * function does not return value
1996
  * The given length must not exceed 60.
1950
Remarks:
1997
  * The exactly given amount of digits is output. If number is small
1951
  * Indicated length should not exceed 60.
1998
    and can be written by smaller amount of digits, it is supplemented
1952
  * The equally indicated amount of digits is output. If the number a little
1999
    by leading zeroes; if the number is big and can not be written by
1953
    also can be written by smaller amount of digits, it is supplemented by
2000
    given amount of digits, extra digits are not drawn.
1954
    leading zeroes; if the number is great and can not be written by such
2001
  * Parameters of fonts are shown in the description of function 4
1955
    amount of digits, the "superfluous" carrying on digits are not draw.
2002
    (text output).
1956
  * Parameters of fonts are indicated in the description of the function 4
2003
 
1957
    (output of the text).
2004
======================================================================
1958
 
2005
========= Function 48, subfunction 0 - apply screen settings. ========
1959
======================================================================
2006
======================================================================
1960
===== Function 48, subfunction 0 - apply adjustments of screen. ======
2007
Parameters:
1961
======================================================================
2008
  * eax = 48 - function number
1962
Parameters:
2009
  * ebx = 0 - subfunction number
1963
  * eax = 48 - number of the function
2010
  * ecx = 0 - reserved
1964
  * ebx = 0 - number subfunction
2011
Returned value:
1965
  * ecx = 0 - reserved
2012
  * function does not return value
1966
Returned value:
2013
Remarks:
1967
  * function does not return value
2014
  * Function redraws the screen after parameters change by
Line 1968... Line 2015...
1968
Remarks:
2015
    subfunctions 1 and 2.
1969
  * Function redraw the screen after change of parameters
2016
  * Function call without prior call to one of indicated subfunctions
1970
    subfunctions 1 and 2.
2017
    is ignored.
1971
  * Function call without prior calls indicated subfunctions is ignored.
2018
  * Function call with nonzero ecx is ignored.
1972
  * Function call with non-zero ecx is ignored.
2019
 
1973
 
2020
======================================================================
1974
======================================================================
2021
=========== Function 48, subfunction 1 - set button style. ===========
1975
======= Function 48, subfunction 1 - install style of buttons. =======
2022
======================================================================
1976
======================================================================
2023
Parameters:
1977
Parameters:
2024
  * eax = 48 - function number
1978
  * eax = 48 - number of the function
2025
  * ebx = 1 - subfunction number
1979
  * ebx = 1 - number subfunction
2026
  * ecx = button style:
1980
  * ecx = type of buttons:
2027
    * 0 = flat
1981
    * 0 = flat buttons
2028
    * 1 = 3d
1982
    * 1 = 3d buttons
2029
Returned value:
1983
Returned value:
2030
  * function does not return value
1984
  * function does not return value
2031
Remarks:
1985
Remarks:
2032
  * After call to this function one should redraw the screen by
-
 
2033
    subfunction 0.
1986
  * After call of the described function follows redraw
2034
  * Button style influences only to their draw of function 8.
1987
    the screen subfunction 0.
2035
 
1988
  * Type of buttons influences only their plotting by the function 8.
-
 
Line 1989... Line 2036...
1989
 
2036
======================================================================
1990
========================================================================
2037
====== Function 48, subfunction 2 - set standard window colors. ======
1991
== Function 48, subfunction 2 - install standard colours of windows. ===
2038
======================================================================
1992
========================================================================
2039
Parameters:
1993
Parameters:
2040
  * eax = 48 - function number
1994
  * eax = 48 - number of the function
2041
  * ebx = 2 - subfunction number
1995
  * ebx = 2 - number subfunction
2042
  * ecx = pointer to the color table
1996
  * ecx = pointer on the color table
2043
  * edx = size of the color table
1997
  * edx = size of the color table
2044
    (must be 40 bytes for future compatibility)
1998
    (should be 40 bytes for the future compatibility)
2045
Format of the color table is shown in description of subfunction 3.
1999
Format of the color table is indicated in the description subfunction 3.
2046
Returned value:
2000
Returned value:
2047
  * function does not return value
2001
  * function does not return value
2048
Remarks:
2002
Remarks:
2049
  * After call to this function one should redraw the screen by
2003
  * After call of the described function follows redraw
2050
    subfunction 0.
2004
    the screen subfunction 0.
2051
  * Table of standard colors influences only to applications,
2005
  * Table of standard colours influences only the applications, which receive
2052
    which receive this table obviously (by subfunction 3)
2006
    this table by an obvious way (subfunction 3) and use (specifying colours
2053
    and use it (specifying colors from it to drawing functions).
2007
    from it by calls of functions of drawing).
2054
  * Table of standard colors is included in skin and is installed
2008
  * Table of standard colours enters in skin and is installed anew
2055
    anew with skin installation (by subfunction 8).
2009
    at installation skin (subfunction 8).
2056
  * Color table can be viewed/changed interactively with
2010
  * Color table can be viewed/changed online with the help of
2057
    the application 'desktop'.
-
 
2058
 
-
 
2059
======================================================================
2011
    the application desktop.
2060
====== Function 48, subfunction 3 - get standard window colors. ======
2012
 
2061
======================================================================
2013
======================================================================
2062
Parameters:
2014
=== Function 48, subfunction 3 - get standard colours of windows. ====
2063
  * eax = 48 - function number
2015
======================================================================
2064
  * ebx = 3 - subfunction number
Line 2016... Line 2065...
2016
Parameters:
2065
  * ecx = pointer to the buffer with size edx bytes,
2017
  * eax = 48 - number of the function
2066
    where table will be written
2018
  * ebx = 3 - number subfunction
-
 
2019
  * ecx = pointer on the buffer the size edx byte, where will write the table
2067
  * edx = size of color table
2020
  * edx = size of the color table
2068
    (must be 40 bytes for future compatibility)
2021
    (should be 40 bytes for the future compatibility)
2069
Returned value:
2022
Returned value:
2070
  * function does not return value
2023
  * function does not return value
2071
Format of the color table:
2024
Format of the color table: each unit -
2072
each item is dword-value for color 0x00RRGGBB
2025
dword-value of colour 0x00RRGGBB
2073
  * +0: dword: frames - color of frame
2026
  * +0: dword: frames - colour of frame
2074
  * +4: dword: grab - color of header
2027
  * +4: dword: grab - colour of header
2075
  * +8: dword: grab_button - color of button on header bar
2028
  * +8: dword: grab_button - colour of the button on a bar of header
2076
  * +12 = +0xC: dword: grab_button_text - color of text on button
2029
  * +12 = +0xC: dword: grab_button_text - colour of the text on the button
2077
    on header bar
2030
    on a bar of header
2078
  * +16 = +0x10: dword: grab_text - color of text on header
2031
  * +16 = +0x10: dword: grab_text - colour of the text on header
2079
  * +20 = +0x14: dword: work - color of working area
2032
  * +20 = +0x14: dword: work - colour of a working area
2080
  * +24 = +0x18: dword: work_button - color of button in working area
2033
  * +24 = +0x18: dword: work_button - colour of the button in a working area
2081
  * +28 = +0x1C: dword: work_button_text - color of text on button
Line 2034... Line 2082...
2034
  * +28 = +0x1C: dword: work_button_text - colour of the text on the button
2082
    in working area
2035
    in a working area
2083
  * +32 = +0x20: dword: work_text - color of text in working area
2036
  * +32 = +0x20: dword: work_text - colour of the text in a working area
2084
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2037
  * +36 = +0x24: dword: work_graph - colour of a graphics in a working area
2085
Remarks:
2038
Remarks:
2086
  * Structure of the color table is described in the standard
2039
  * structure of the color table is described in the standard included file
2087
    include file 'macros.inc' as 'system_colors'; for example,
2040
    macros.inc under the name system_colors; for example, it is possible
2088
    it is possible to write:
2041
    to write:
2089
    	sc	system_colors		; variable declaration
2042
        sc    system_colors        ; declaration of a variable
2090
    	...				; somewhere one must call
2043
        ...                ; where it is necessary to call
2091
    					; this function with ecx=sc
2044
                        ; described function with ecx=sc
2092
    	mov	ecx, [sc.work_button_text]	; read text color on
-
 
2093
    					; buttin in working area
2045
        mov    ecx, [sc.work_button_text]    ; read colour of the text
2094
  * A program itself desides to use or not to use color table.
2046
                        ; on the button in a working area
2095
    For usage program must simply at calls to drawing functions select
2047
  * Usage/non-use of these colours - business is exclusively of the  program.
2096
    color taken from the table.
2048
    For usage it is necessary simply at call of functions of drawing to
2097
  * At change of the table of standard colors (by subfunction 2 with
2049
    specify colour, taken from this table.
2098
    the subsequent application of changes by subfunction 0 or
-
 
2099
    at skin set by subfunction 8) the system sends to all windows
2050
  * At change of the table of standard colours (subfunction 2 with the
2100
    redraw message (the event with code 1).
2051
    subsequent application of changes subfunction 0 or at installation skin
2101
  * Color table can be viewed/changed interactively with
Line 2052... Line 2102...
2052
    subfunction 8) all windows the message on necessity redraw (event with
2102
    the application 'desktop'.
2053
    the code 1) is dispatched.
2103
 
2054
  * Color table can be viewed/changed online with the help of
2104
======================================================================
2055
    the application desktop.
2105
============ Function 48, subfunction 4 - get skin height. ===========
-
 
2106
======================================================================
2056
 
2107
Parameters:
2057
======================================================================
2108
  * eax = 48 - function number
2058
========== Function 48, subfunction 4 - get height of skin. ==========
2109
  * ebx = 4 - subfunction number
2059
======================================================================
2110
Returned value:
2060
Parameters:
2111
  * eax = skin height
2061
  * eax = 48 - number of the function
2112
Remarks:
2062
  * ebx = 4 - number subfunction
2113
  * Skin height is defined as the height of a header
-
 
2114
    of skinned windows.
2063
Returned value:
2115
  * See also general structure of window in the description
2064
  * eax = height of skin
2116
    of function 0.
2065
Remarks:
2117
 
2066
  * Height skin on definition considers height of header
2118
======================================================================
2067
    of windows using skin.
2119
======== Function 48, subfunction 5 - get screen working area. =======
2068
  * See also common structure of the window in the description
2120
======================================================================
2069
    of the function 0.
2121
Parameters:
2070
 
2122
  * eax = 48 - function number
Line 2071... Line 2123...
2071
======================================================================
2123
  * ebx = 5 - subfunction number
2072
==== Function 48, subfunction 5 - get working area of the screen. ====
2124
Returned value:
2073
======================================================================
2125
  * eax = [left]*65536 + [right]
2074
Parameters:
2126
  * ebx = [top]*65536 + [bottom]
2075
  * eax = 48 - number of the function
2127
Remarks:
2076
  * ebx = 5 - number subfunction
2128
  * The screen working area defines position and coordinates of
2077
Returned value:
2129
    a maximized window.
-
 
2130
  * The screen working area in view of normal work is all screen
Line 2078... Line 2131...
2078
  * eax = [left]*65536 + [right]
2131
    without system panel (the application '@panel').
2079
  * ebx = [top]*65536 + [bottom]
2132
  * (left,top) are coordinates of the left upper corner,
2080
Remarks:
2133
    (right,bottom) are coordinates of the right lower one.
2081
  * Working area of the screen defines a location and coordinates
2134
    Thus the size of working area on x axis can be calculated by
2082
    of the maximized window.
2135
    formula right-left+1, on y axis - by formula bottom-right+1.
2083
  * Working area of the screen by normal operation is all screen
2136
  * See also function 14,
2084
    minus the panel (@panel).
2137
    to get sizes of all screen.
Line 2085... Line 2138...
2085
  * (left,top) - coordinates of the left upper corner,
2138
  * There is a pair function to set working area - subfunction 6.
2086
    (right,bottom) - coordinates of the right lower corner.
2139
 
2087
    Thus, the size of a working area on an axis x is defined by
2140
======================================================================
2088
    the formula right-left+1, on an axis y - formula bottom-right+1.
2141
======== Function 48, subfunction 6 - set screen working area. =======
2089
  * See also function 14, permitting to define sizes of all screen.
2142
======================================================================
2090
  * There is a pair function of installation of a working area - 
2143
Parameters:
2091
    subfunction 6.
2144
  * eax = 48 - function number
2092
 
2145
  * ebx = 6 - subfunction number
2093
======================================================================
2146
  * ecx = [left]*65536 + [right]
2094
=== Function 48, subfunction 6 - install a working area of screen. ===
2147
  * edx = [top]*65536 + [bottom]
2095
======================================================================
2148
Returned value:
-
 
2149
  * function does not return value
2096
Parameters:
2150
Remarks:
2097
  * eax = 48 - number of the function
2151
  * The screen working area defines position and coordinates of
2098
  * ebx = 6 - number subfunction
2152
    a maximized window.
2099
  * ecx = [left]*65536 + [right]
2153
  * This function is used only by the application '@panel',
-
 
2154
    which set working area to all screen without system panel.
2100
  * edx = [top]*65536 + [bottom]
2155
  * (left,top) are coordinates of the left upper corner,
2101
Returned value:
2156
    (right,bottom) are coordinates of the right lower one.
2102
  * function does not return value
2157
    Thus the size of working area on x axis can be calculated by
2103
Remarks:
2158
    formula right-left+1, on y axis - by formula bottom-right+1.
2104
  * Working area of the screen defines a location and coordinates
2159
  * If 'left'>='right', x-coordinate of working area is not changed.
2105
    of the maximized window.
2160
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2106
  * This function is used only by application @panel, installing by
2161
    equal to screen width, 'right' will not be set.
2107
    a working area all screen minus the panel.
2162
    Similarly on y axis.
2108
  * (left,top) - coordinates of the left upper corner,
2163
  * See also function 14,
2109
    (right,bottom) - coordinates of the right lower corner.
2164
    to get sizes of all screen.
2110
    Thus, the size of a working area on an axis x is defined by
2165
  * There is a pair function to get working area - subfunction 5.
Line 2111... Line 2166...
2111
    the formula right-left+1, on an axis y - formula bottom-right+1.
2166
  * This function redraws the screen automatically,
2112
  * If left > =right, the x-coordinates of a working area do not vary.
2167
    updating coordinates and sizes of maximized windows.
2113
    If left < 0, left is not installed. If right it is more or equally
2168
    The system sends to all windows redraw message (the event 1).
2114
    width of the screen, right is not installed. Similarly on an axis y.
2169
 
2115
  * See also function 14, permitting to define sizes of all screen.
2170
======================================================================
2116
  * There is a pair function of get of a working area - subfunction 5.
2171
=========== Function 48, subfunction 7 - get skin margins. ===========
2117
  * This function automatically redraw the screen, on a course of business
2172
======================================================================
2118
    updates coordinates and rule(situation) of the maximized windows.
2173
Returns the area of a header of a skinned window, intended for
2119
    All windows are informed on necessity redraw (event 1).
2174
a text of a header.
2120
 
2175
Parameters:
2121
======================================================================
2176
  * eax = 48 - function number
-
 
2177
  * ebx = 7 - subfunction number
Line 2122... Line 2178...
2122
====================== Function 48, subfunction 7 ====================
2178
Returned value:
2123
================= Get skin area for the text of header. ==============
2179
  * eax = [left]*65536 + [right]
2124
======================================================================
2180
  * ebx = [top]*65536 + [bottom]
2125
Returns title bar of the window with skin, intended for output of the
2181
Remarks:
2126
text of header.
2182
  * An application decides itself to use or not to use this function.
2127
Parameters:
2183
  * It is recommended to take into account returned value
2128
  * eax = 48 - number of the function
2184
    of this function for choice of a place for drawing header text
2129
  * ebx = 7 - number subfunction
2185
    (by function 4) or a substitute of header text
2130
Returned value:
2186
    (at the discretion of an application).
2131
  * eax = [left]*65536 + [right]
2187
 
2132
  * ebx = [top]*65536 + [bottom]
2188
======================================================================
2133
Remarks:
2189
============= Function 48, subfunction 8 - set used skin. ============
-
 
2190
======================================================================
Line 2134... Line 2191...
2134
  * Usage/non-use of this function - personal business of the application.
2191
Parameters:
2135
  * It is recommended to take into account values returned by this function,
2192
  * eax = 48 - function number
2136
    at choice of a place for drawing the text of header (function 4) or any
2193
  * ebx = 8 - subfunction number
2137
    of a substitute of the text of header (at the discretion of the
2194
  * ecx = pointer to a block for function 58, in
2138
    application).
2195
    which the fields of intermediate buffer and file name are filled
2139
 
2196
Returned value:
2140
======================================================================
2197
  * eax = 0 - success
2141
===== Function 48, subfunction 8 - install used skin of windows. =====
2198
  * otherwise eax = file system error code; if file does not
2142
======================================================================
2199
    contain valid skin, function returns error 3
2143
Parameters:
2200
    (unknown file system).
Line 2144... Line 2201...
2144
  * eax = 48 - number of the function
2201
Remarks:
2145
  * ebx = 8 - number subfunction
2202
  * After successful skin loading the system sends to all windows
2146
  * ecx = pointer on the block for the function 58, in which the field of
2203
    redraw message (the event 1).
2147
    the intermediate buffer is placed(installed) and the filename is indicated
2204
  * At booting the system reads skin from file 'default.skn'
2148
Returned value:
2205
    on ramdisk.
2149
  * eax = 0 - successfully
2206
  * User can change the skin statically by creating hisself
2150
  * differently eax = an error code of a file system; if the file does
2207
    'default.skn' or dynamically with the application 'desktop'.
2151
    not set skin, comes back error 3 (unknown file system).
2208
 
2152
Remarks:
2209
======================================================================
2153
  * At successful loading skin all windows are informed on necessity
2210
=========== Function 49 - Advanced Power Management (APM). ===========
2154
    redraw (event 1).
2211
======================================================================
2155
  * At loading the system reads out skin from the file default.skn on ramdisk.
2212
Parameters:
2156
  * User can change skin statically, having created default.skn,
2213
  * eax = 49 - function number
2157
    or dynamically with the help of the application desktop.
2214
  * dx = number of the APM function
2158
 
2215
    (analogue of ax in APM specification)
2159
======================================================================
2216
  * bx, cx = parameters of the APM function
2160
============ Function 49 - Advanced Power Management (APM). ===========
2217
Returned value:
2161
======================================================================
2218
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2162
Parameters:
2219
    are set according to the APM specification
Line 2163... Line 2220...
2163
  * eax = 49 - number of the function
2220
  * high halves of 32-bit registers eax, ebx, ecx,
2164
  * dx = number of the function APM (clone ax in the specification)
2221
    edx, esi, edi are destroyed
2165
  * bx, cx = parameters of the function APM
2222
Remarks:
2166
Returned value:
2223
  * APM 1.2 specification is described in the document
2167
  * 16-bit registers ax, bx, cx, dx, si, di and flag CF are installed
2224
    "Advanced Power Management (APM) BIOS Specification"
2168
    according to the specification APM
2225
    (Revision 1.2), available at
2169
  * high halves of 32-bit registers eax, ebx, ecx, edx, esi, edi fail
2226
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2170
Remarks:
2227
    besides it is included in famous Interrupt List by Ralf Brown
2171
  * Specification APM 1.2 is described in document 
2228
    (http://www.pobox.com/~ralf/files.html,
2172
    "Advanced Power Management (APM) BIOS Specification "
2229
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2173
    (Revision 1.2), accessible on
2230
 
2174
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2231
======================================================================
Line 2175... Line 2232...
2175
    besides it is included in known Interrupt List by Ralf Brown
2232
=================== Function 50 - set window shape. ==================
2176
    (http://www.pobox.com/~ralf/files.html,
2233
======================================================================
2177
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2234
Normal windows have rectangular shape. This function can give to
2178
 
2235
a window any shape. The shape is given by a set of points inside
2179
======================================================================
2236
the base rectangle belonging to a window. Position and coordinates
2180
=========== Function 50 - installation of form of window. ============
2237
of the base rectangle are set by function 0
2181
======================================================================
2238
and changed by function 67.
2182
The usual windows represent rectangles. With the help of this function the
2239
 
2183
window can add the arbitrary form. The form sets by a set of points inside
2240
--------------------------- Set shape data ---------------------------
2184
a framing rectangle concerning to the window. Location and the sizes of
2241
Parameters:
2185
a framing rectangle are set by the function 0 and vary with the function 67.
2242
  * eax = 50 - function number
2186
 
2243
  * ebx = 0 - subfunction number
2187
----------- Installation of data with information on form ------------
2244
  * ecx = pointer to shape data (array of bytes 0/1)
-
 
2245
Returned value:
2188
Parameters:
2246
  * function does not return value
2189
  * eax = 50 - number of the function
2247
 
Line 2190... Line 2248...
2190
  * ebx = 0 - number subfunction
2248
-------------------------- Set shape scale ---------------------------
2191
  * ecx = pointer on the given forms (array byte 0/1)
-
 
2192
Returned value:
2249
Parameters:
2193
  * function does not return value
2250
  * eax = 50 - function number
2194
 
2251
  * ebx = 1 - subfunction number
2195
---------------- Installation of a scale of given form ---------------
2252
  * ecx sets a scale: each byte of data defines
2196
Parameters:
2253
    (2^scale)*(2^scale) pixels
2197
  * eax = 50 - number of the function
2254
Returned value:
2198
  * ebx = 1 - number subfunction
2255
  * function does not return value
2199
  * ecx sets a scale: each byte of the data defines
2256
Remarks:
2200
    (2^scale) * (2^scale) of pixels
2257
  * Default scale is 0 (scale factor is 1). If in the shape data
2201
Returned value:
2258
    one byte corresponds to one pixel, there is no necessity
2202
  * function does not return value
2259
    to set scale.
2203
Remarks:
2260
  * Let's designate xsize = window width (in pixels), ysize = height;
-
 
2261
    pay attention, that they are one pixel more than defined by
Line 2204... Line 2262...
2204
  * Scale is by default equal 0 (scaling factor 1). If in the given form
2262
    functions 0, 67.
2205
    of one byte corresponds to one pixel, the scale is possible to not install.
2263
  * On definition of scale xsize and ysize must be divisible
2206
  * Let's designate xsize = width of the window (in pixels), ysize = height;
2264
    on 2^scale.
2207
    pay attention, that they on unit are more, than installed by
2265
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2208
    functions 0, 67.
2266
    to a window of square with the side 2^scale (if scale=0,
2209
  * On definition of a scale xsize and ysize should be divided on 2^scale.
2267
    this is one pixel) and coordinates of the left upper corner
2210
  * Byte of the data on offset a should be 0/1 and defines an accessory to
2268
    (a mod (xsize shr scale), a div (xsize shr scale))
2211
    the window of a square with the side 2^scale (at scale=0 we receive
2269
  * Data size: (xsize shr scale)*(ysize shr scale).
Line 2212... Line 2270...
2212
    a pixel) and coordinates of the left upper corner
2270
  * Data must be presented in the memory and not change
2213
    (a mod (xsize shr scale), a div (xsize shr scale))
2271
    after set of shape.
2214
  * Size of the data: (xsize shr scale)*(ysize shr scale).
2272
  * The system views the shape data at every window redraw by
2215
  * Data should be present at memory and not vary after installation
2273
    function 0.
2216
    of the form.
2274
  * The call of subfunction 0 with NULL pointer results in return
2217
  * System views the data on the form at everyone redraw of the window
2275
    to the rectangular shape.
2218
    by the function 0.
2276
 
2219
  * Call subfunction 0 with the zero pointer results in return to the
2277
======================================================================
Line 2220... Line 2278...
2220
    rectangular form.
2278
==================== Function 51 - create thread. ====================
2221
 
2279
======================================================================
2222
======================================================================
2280
Parameters:
2223
==================== Function 51 - create thread. ====================
2281
  * eax = 51 - function number
2224
======================================================================
2282
  * ebx = 1 - unique subfunction
2225
Parameters:
2283
  * ecx = address of thread entry point (starting eip)
2226
  * eax = 51 - number of the function
2284
  * edx = pointer to thread stack (starting esp)
2227
  * ebx = 1 - sole subfunction
2285
Returned value:
2228
  * ecx = address of an entry point thread (begin eip)
2286
  * eax = -1 - error (there is too many threads)
2229
  * edx = pointer of the stack thread (begin esp)
2287
  * otherwise eax = TID - thread identifier
Line 2230... Line 2288...
2230
Returned value:
2288
         
2231
  * eax = -1 - error (In the system it is too much threads)
2289
 
2232
  * differently eax = TID - identifier thread
2290
======================================================================
2233
 
2291
=== Function 52, subfunction 0 - get network driver configuration. ===
2234
======================================================================
2292
======================================================================
2235
== Function 52, subfunction 0 - get configuration of network driver. = 
2293
Parameters:
2236
======================================================================
2294
  * eax = 52 - function number
2237
Parameters:
2295
  * ebx = 0 - subfunction number
2238
  * eax = 52 - number of the function
2296
Returned value:
2239
  * ebx = 0 - number subfunction
2297
  * eax = configuration dword
Line 2240... Line 2298...
2240
Returned value:
2298
Remarks:
2241
  * eax = double word of the configuration
2299
  * Configuration dword can be set by subfunction 2.
2242
Remarks:
2300
  * The kernel does not use this variable. The value of this
2243
  * Word of the configuration can be installed subfunction 2.
2301
    variable and working with it subfunctions 0 and 2 is represented
2244
  * Kernel does not use an appropriate variable. The value of this variable
2302
    doubtful.
2245
    and working with it(her) subfunctions 0 and 2 is represented doubtful.
2303
 
2246
 
2304
======================================================================
2247
======================================================================
2305
========= Function 52, subfunction 1 - get local IP-address. =========
Line 2248... Line 2306...
2248
========= Function 52, subfunction 1 - get local IP address. =========
2306
======================================================================
2249
======================================================================
2307
Parameters:
2250
Parameters:
2308
  * eax = 52 - function number
2251
  * eax = 52 - number of the function
2309
  * ebx = 1 - subfunction number
2252
  * ebx = 1 - number subfunction
2310
Returned value:
2253
Returned value:
2311
  * eax = IP-address (4 bytes)
2254
  * eax = IP-address (4 bytes)
2312
Remarks:
2255
Remarks:
2313
  * Local IP-address is set by subfunction 3.
2256
  * Local IP-address is installed subfunction 3.
2314
 
2257
 
2315
======================================================================
Line 2258... Line 2316...
2258
======================================================================
2316
=== Function 52, subfunction 2 - set network driver configuration. ===
2259
 Function 52, subfunction 2 - install configuration of network driver. 
2317
======================================================================
2260
======================================================================
2318
Parameters:
2261
Parameters:
2319
  * eax = 52 - function number
2262
  * eax = 52 - number of the function
2320
  * ebx = 2 - subfunction number
2263
  * ebx = 2 - number subfunction
2321
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2264
  * ecx = Double word of the configuration; if the low 7 bits will derivate
2322
    function [re-]initializes Ethernet-card, otherwise
2265
    number 3, it is perceived as call about reinitialization
2323
    Ethernet turns off
2266
    of a Ethernet-map, otherwise Ethernet is switched off
2324
Returned value:
2267
Returned value:
2325
  * if Ethernet-interface is not requested, function returns eax=2,
2268
  * if not the Ethernet-interface is requested, comes back eax=2,
2326
    but this can be changed in future kernel versions
2269
    but it can vary in the future versions of a kernel
2327
  * if Ethernet-interface is requested, eax=0 means error
2270
  * if the Ethernet-interface is requested, eax=0 means an error
2328
    (absence of Ethernet-card), and nonzero value - success
2271
    (absence of a Ethernet-map), and non-zero value - success
2329
Remarks:
Line 2272... Line 2330...
2272
Remarks:
2330
  * Configuration dword can be read by subfunction 0.
2273
  * Word of the configuration can be read subfunction 0.
2331
  * The kernel does not use this variable. The value of this
2274
  * Kernel does not use an appropriate variable. The value of this variable,
2332
    variable, subfunction 0 and part of subfunction 2, which set it,
2275
    subfunction 0 and part subfunction 2, installing this variable,
2333
    is represented doubtful.
2276
    is represented doubtful.
2334
 
2277
 
2335
======================================================================
2278
======================================================================
2336
========= Function 52, subfunction 3 - set local IP-address. =========
2279
========= Function 52, subfunction 3 - set local IP-address. =========
2337
======================================================================
2280
======================================================================
2338
Parameters:
2281
Parameters:
2339
  * eax = 52 - function number
2282
  * eax = 52 - number of the function
2340
  * ebx = 3 - subfunction number
2283
  * ebx = 3 - number subfunction
2341
  * ecx = IP-address (4 bytes)
2284
  * ecx = IP-address (4 bytes)
2342
Returned value:
2285
Returned value:
2343
  * the current implementation returns eax=3, but this can be changed
2286
  * Current realization returns eax=3, but it can be changed
2344
    in future versions
-
 
2345
Remarks:
2287
    in the future versions
2346
  * Local IP-address can be get by subfunction 1.
2288
Remarks:
2347
 
2289
  * Local IP-address can be received subfunction 1.
2348
======================================================================
Line 2290... Line 2349...
2290
 
2349
= Function 52, subfunction 6 - add data to the stack of input queue. =
2291
======================================================================
2350
======================================================================
2292
= Function 52, subfunction 6 - add data in stack of an input queue. ==
2351
Parameters:
2293
======================================================================
2352
  * eax = 52 - function number
2294
Parameters:
2353
  * ebx = 6 - subfunction number
2295
  * eax = 52 - number of the function
2354
  * edx = data size
2296
  * ebx = 6 - number subfunction
2355
  * esi = data pointer
2297
  * edx = size of the data
2356
Returned value:
2298
  * esi = pointer on the data
2357
  * eax = -1 - error
2299
Returned value:
2358
  * eax = 0 - success
2300
  * eax = -1 - error
2359
Remarks:
2301
  * eax = 0 - successfully
2360
  * This function is intended only for slow network drivers
Line 2302... Line 2361...
2302
Remarks:
2361
    (PPP, SLIP).
2303
  * This function is intended only for slow network drivers (PPP, SLIP).
2362
  * Data size must not exceed 1500 bytes, though function
2304
  * Size of the data should not exceed 1500 bytes, though checks
2363
    performs no checks on correctness.
2305
    of a correctness is not done(made).
2364
 
2306
 
2365
======================================================================
2307
======================================================================
2366
 Function 52, subfunction 8 - read data from the network output queue. 
2308
====================== Function 52, subfunction 8 ====================
2367
======================================================================
2309
============== Read given from a network output queue. ===============
2368
Parameters:
2310
======================================================================
2369
  * eax = 52 - function number
-
 
2370
  * ebx = 8 - subfunction number
2311
Parameters:
2371
  * esi = pointer to 1500-byte buffer
2312
  * eax = 52 - number of the function
2372
Returned value:
2313
  * ebx = 8 - number subfunction
2373
  * eax = number of read bytes (in the current implementation
2314
  * esi = pointer on the buffer by a size of 1500 bytes
2374
    either 0 = no data or 1500)
Line 2315... Line 2375...
2315
Returned value:
2375
  * data was copied in buffer
2316
  * eax = Number read byte (in current implementation or
2376
Remarks:
2317
    0 = there are no data, or 1500)
2377
  * This function is intended only for slow network drivers
2318
  * data are copied in the buffer
2378
    (PPP, SLIP).
2319
Remarks:
2379
 
2320
  * This function is intended only for slow network drivers (PPP, SLIP).
2380
======================================================================
2321
 
2381
============ Function 52, subfunction 9 - get gateway IP. ============
2322
======================================================================
2382
======================================================================
2323
=========== Function 52, subfunction 9 - get gateway IP. ==========
2383
Parameters:
2324
======================================================================
2384
  * eax = 52 - function number
2325
Parameters:
2385
  * ebx = 9 - subfunction number
2326
  * eax = 52 - number of the function
2386
Returned value:
2327
  * ebx = 9 - number subfunction
2387
  * eax = gateway IP (4 bytes)
2328
Returned value:
2388
 
2329
  * eax = gateway IP (4 bytes)
2389
======================================================================
2330
 
2390
=========== Function 52, subfunction 10 - get subnet mask. ===========
2331
======================================================================
2391
======================================================================
2332
========= Function 52, subfunction 10 - get mask of a subnet. ========
2392
Parameters:
2333
======================================================================
2393
  * eax = 52 - function number
Line 2334... Line 2394...
2334
Parameters:
2394
  * ebx = 10 - subfunction number
2335
  * eax = 52 - number of the function
2395
Returned value:
2336
  * ebx = 10 - number subfunction
2396
  * eax = subnet mask
2337
Returned value:
2397
 
2338
  * eax = mask of a subnet
2398
======================================================================
2339
 
2399
============ Function 52, subfunction 11 - set gateway IP. ===========
2340
======================================================================
2400
======================================================================
2341
========= Function 52, subfunction 11 - install gateway IP. =========
2401
Parameters:
2342
======================================================================
2402
  * eax = 52 - function number
2343
Parameters:
2403
  * ebx = 11 - subfunction number
2344
  * eax = 52 - number of the function
2404
  * ecx = gateway IP (4 bytes)
2345
  * ebx = 11 - number subfunction
2405
Returned value:
2346
  * ecx = gateway IP (4 bytes)
2406
  * the current implementation returns eax=11, but this can be changed
2347
Returned value:
2407
    in future versions
-
 
2408
 
Line 2348... Line 2409...
2348
  * current realization returns eax=11, but it can be changed in the
2409
======================================================================
2349
    future realizations
2410
=========== Function 52, subfunction 12 - set subnet mask. ===========
2350
 
2411
======================================================================
2351
======================================================================
2412
Parameters:
2352
====== Function 52, subfunction 12 - install mask of a subnet. =======
2413
  * eax = 52 - function number
2353
======================================================================
2414
  * ebx = 12 - subfunction number
2354
Parameters:
2415
  * ecx = subnet mask
2355
  * eax = 52 - number of the function
2416
Returned value:
2356
  * ebx = 12 - number subfunction
2417
  * the current implementation returns eax=12, but this can be changed
2357
  * ecx = mask of a subnet
2418
    in future versions
2358
Returned value:
2419
 
2359
  * Current realization returns eax=12, but it can be changed
2420
======================================================================
2360
    in the future versions
2421
============== Function 52, subfunction 13 - get DNS IP. =============
2361
 
2422
======================================================================
Line 2493... Line 2554...
2493
  * TCB_CLOSE_WAIT = 7
2554
  * TCB_CLOSE_WAIT = 7
2494
  * TCB_CLOSING = 8
2555
  * TCB_CLOSING = 8
2495
  * TCB_LAST_ASK = 9
2556
  * TCB_LAST_ASK = 9
2496
  * TCB_TIME_WAIT = 10
2557
  * TCB_TIME_WAIT = 10
2497
  * TCB_CLOSED = 11
2558
  * TCB_CLOSED = 11
2498
  * ebx fail
2559
  * ebx destroys
2499
Remarks:
2560
Remarks:
2500
  * Checks of a correctness is not made.
2561
  * There is no checks for correctness.
Line 2501... Line 2562...
2501
 
2562
 
2502
======================================================================
2563
======================================================================
2503
========== Function 53, subfunction 7 - write in TCP-socket. =========
2564
========== Function 53, subfunction 7 - write to TCP-socket. =========
2504
======================================================================
2565
======================================================================
2505
Parameters:
2566
Parameters:
2506
  * eax = 53 - number of the function
2567
  * eax = 53 - function number
2507
  * ebx = 7 - number subfunction
2568
  * ebx = 7 - subfunction number
2508
  * ecx = number socket
2569
  * ecx = socket handle
2509
  * edx = number bytes for writing
2570
  * edx = number of bytes to write
2510
  * esi = pointer on data for writing
2571
  * esi = pointer to data to write
2511
Returned value:
2572
Returned value:
2512
  * eax = 0xffffffff - error
2573
  * eax = 0xffffffff - error
2513
  * eax = 0xffff - lack of memory
2574
  * eax = 0xffff - not enough memory
2514
  * eax = 0 - successfully
2575
  * eax = 0 - success
2515
  * ebx fail
2576
  * ebx destroyed
2516
Remarks:
2577
Remarks:
2517
  * Check on valid number is minimum - are eliminated only not so incorrect
2578
  * Check on validity of handle is minimal - only not very incorrect
2518
    not open numbers.
2579
    not opened handles are eliminated.
2519
  * Number bytes for writing can not exceed 1500-40, though appropriate
2580
  * Number of bytes to write must not exceed 1500-40, though
Line 2520... Line 2581...
2520
    check is not done.
2581
    the appropriate check is not made.
2521
 
2582
 
2522
======================================================================
2583
======================================================================
2523
============ Function 53, subfunction 8 - close TCP-socket. ===========
2584
=========== Function 53, subfunction 8 - close TCP-socket. ===========
2524
======================================================================
2585
======================================================================
2525
Parameters:
2586
Parameters:
2526
  * eax = 53 - number of the function
2587
  * eax = 53 - function number
2527
  * ebx = 8 - number subfunction
2588
  * ebx = 8 - subfunction number
2528
  * ecx = number socket
2589
  * ecx = socket handle
2529
Returned value:
2590
Returned value:
2530
  * eax = -1 - incorrect number
2591
  * eax = -1 - invalid handle
2531
  * eax = 0xffff - lack of memory for the package of closing socket
2592
  * eax = 0xffff - not enough memory for socket close packet
2532
  * eax = 0 - successfully
2593
  * eax = 0 - success
2533
  * in many cases eax fails (comes back the result of the function queue) -
2594
  * in many cases eax is destroyed (the result of function 'queue'
2534
    probably , is an error, which will be corrected
2595
    is returned) - probably this is bug, which will be corrected
2535
  * ebx fail
2596
  * ebx destroyed
2536
Remarks:
2597
Remarks:
2537
  * The current realization does not close automatically all sockets thread
2598
  * The current implementation does not close automatically all
-
 
2599
    sockets of a thread at termination. In particular, one should not
2538
    at its completion. In particular, it is not necessary to kill thread
2600
    kill a thread with many opened sockets - there will be an outflow
2539
    with a heap open sockets - there will be an outflow of resources.
2601
    of resources.
2540
  * The current realization does not do checks on a correctness
2602
  * The current implementation does no checks on correctness
Line 2541... Line 2603...
2541
    (sole, to what the attempt comes back error, - to close not open socket
2603
    (function returns error only if thread tries to close not opened
2542
    with correct number).
2604
    socket with correct handle).
2543
 
2605
 
2544
======================================================================
2606
======================================================================
2545
======== Function 53, subfunction 9 - check - local port is free =====
2607
=== Function 53, subfunction 9 - check whether local port is free. ===
2546
======================================================================
2608
======================================================================
2547
Parameters:
2609
Parameters:
2548
  * eax = 53 - number of the function
2610
  * eax = 53 - function number
2549
  * ebx = 9 - number subfunction
2611
  * ebx = 9 - subfunction number
2550
  * ecx = number of a local port (the low 16 bits are used only)
2612
  * ecx = local port number (low 16 bits are used only)
2551
Returned value:
2613
Returned value:
Line 2552... Line 2614...
2552
  * eax = 0 - port is used
2614
  * eax = 0 - port is used
2553
  * eax = 1 - port is free
2615
  * eax = 1 - port is free
2554
  * ebx fail
2616
  * ebx destroyed
2555
 
2617
 
2556
======================================================================
2618
======================================================================
2557
 Function 53, subfunction 255 - debug information of network driver. =
2619
= Function 53, subfunction 255 - debug information of network driver. 
2558
======================================================================
2620
======================================================================
2559
Parameters:
2621
Parameters:
2560
  * eax = 53 - number of the function
2622
  * eax = 53 - function number
2561
  * ebx = 255 - number subfunction
2623
  * ebx = 255 - subfunction number
2562
  * ecx = type of requested information (see below)
2624
  * ecx = type of requested information (see below)
2563
Returned value:
2625
Returned value:
2564
  * eax = requested information
2626
  * eax = requested information
2565
  * ebx fail
2627
  * ebx destroyed
2566
Possible values ecx:
2628
Possible values for ecx:
2567
  * 100: length of queue 0 (empty queue)
2629
  * 100: length of queue 0 (empty queue)
2568
  * 101: length of queue 1 (ip-out queue)
2630
  * 101: length of queue 1 (ip-out queue)
2569
  * 102: length of queue 2 (ip-in queue)
2631
  * 102: length of queue 2 (ip-in queue)
2570
  * 103: length of queue 3 (net1out queue)
2632
  * 103: length of queue 3 (net1out queue)
2571
  * 200: number of units in the table ARP
2633
  * 200: number of items in the ARP table
2572
  * 201: a size of the table ARP (in units) (20 in the current version)
2634
  * 201: size of the ARP table (in items) (20 for current version)
2573
  * 202: read a unit edx of the table ARP in the temporary buffer,
2635
  * 202: read item at edx of the ARP table to the temporary buffer,
2574
    whence take the information 5 subsequent types;
2636
    whence 5 following types take information;
2575
    in this case eax is not defined
2637
    in this case eax is not defined
2576
  * 203: IP-address saved by the type 202
2638
  * 203: IP-address saved by type 202
2577
  * 204: high dword of MAC-address saved by the type 202
2639
  * 204: high dword of MAC-address saved by type 202
2578
  * 205: low word of MAC-address saved by the type 202
2640
  * 205: low word of MAC-address saved by type 202
2579
  * 206: a word of the status saved by the type 202
2641
  * 206: status word saved by type 202
2580
  * 207: a word ttl, saved by the type 202
2642
  * 207: ttl word saved by type 202
2581
  * 2: a total number of the obtained IP-packages
2643
  * 2: total number of received IP-packets
2582
  * 3: a total number of the transferred(handed) IP-packages
-
 
2583
  * 4: a total number dumps of the obtained packages
-
 
Line 2584... Line 2644...
2584
  * 5: a total number of the obtained ARP-packages
2644
  * 3: total number of transferred IP-packets
2585
  * 6: the status of the driver of packages, 0 = is inactive,
2645
  * 4: total number of dumped received packets
2586
       non-zero value = is active
2646
  * 5: total number of received ARP-packets
2587
 
2647
  * 6: status of packet driver, 0=inactive, nonzero=active
2588
 
2648
 
2589
======================================================================
2649
======================================================================
2590
========== Function 55, subfunction 0 - load data for SB16. ==========
2650
========== Function 55, subfunction 0 - load data for SB16. ==========
2591
======================================================================
2651
======================================================================
2592
Parameters:
2652
Parameters:
2593
  * eax = 55 - number of the function
2653
  * eax = 55 - function number
2594
  * ebx = 0 - number subfunction
2654
  * ebx = 0 - subfunction number
2595
  * ecx = pointer on the data (is copied 64 kilobytes, is used so much,
2655
  * ecx = pointer to data (is copied 64 kilobytes, is used as much as
Line 2596... Line 2656...
2596
    how many is installed subfunction 2)
2656
    set by subfunction 2)
2597
Returned value:
2657
Returned value:
2598
  * function does not return value
2658
  * function does not return value
2599
Remarks:
2659
Remarks:
2600
  * Format and size of data are installed subfunction 2.
2660
  * Format and size of data are set by subfunction 2.
2601
 
2661
 
2602
======================================================================
2662
======================================================================
2603
===== Function 55, subfunction 1 - begin to play data on SB16. =======
2663
======== Function 55, subfunction 1 - begin play data on SB16. =======
2604
======================================================================
2664
======================================================================
2605
Parameters:
2665
Parameters:
2606
  * eax = 55 - number of the function
2666
  * eax = 55 - function number
2607
  * ebx = 1 - number subfunction
2667
  * ebx = 1 - subfunction number
2608
Returned value:
2668
Returned value:
2609
  * function does not return value
2669
  * function does not return value
2610
Remarks:
2670
Remarks:
-
 
2671
  * Previously data must be loaded by subfunction 0 and
2611
  * Previously data should be loaded subfunction 0 and their format
2672
    their format must be defined by subfunction 2.
2612
    subfunction 2 is defined.
2673
  * Function returns control, when playing of data began; after that
2613
  * Function returns handle, when playing the data began; after that the
2674
    play goes independently from application (and does not use
2614
    playing goes irrespective of the application (and at all does not
2675
    processor time at all).
2615
    require loading the processor).
2676
  * Previously must be defined SB16 base port
2616
  * Previously should be defined a base port SB16 (subfunction 4 functions 21)
2677
    (by subfunction 4 of function 21) and DMA channel
2617
    and channel DMA (subfunction 10 functions 21).
2678
    (by subfunction 10 of function 21).
2618
 
2679
 
2619
======================================================================
2680
======================================================================
2620
====== Function 55, subfunction 2 - install a data format SB16. ======
2681
======== Function 55, subfunction 2 - set format of SB16 data. =======
2621
======================================================================
2682
======================================================================
2622
Parameters:
2683
Parameters:
2623
  * eax = 55 - number of the function
2684
  * eax = 55 - function number
2624
  * ebx = 2 - number subfunction
2685
  * ebx = 2 - subfunction number
2625
  * ecx = 0 - install a digit capacity
2686
  * ecx = 0 - set digit capacity
2626
    * edx = 1 - 8 bits mono
2687
    * edx = 1 - 8bit mono
2627
    * edx = 2 - 8 bits stereo
2688
    * edx = 2 - 8bit stereo
2628
  * ecx = 1 - install a size of data
2689
  * ecx = 1 - set data size
2629
    * edx = size in bytes
2690
    * edx = size in bytes
2630
  * ecx = 2 - install frequency of playing
2691
  * ecx = 2 - set play frequency
2631
    * edx = frequency
2692
    * edx = frequency
2632
Returned value:
2693
Returned value:
Line 2633... Line 2694...
2633
  * function does not return value
2694
  * function does not return value
2634
Remarks:
-
 
2635
  * At loading the system the following default settings are installed:
2695
Remarks:
2636
    a digit capacity - 8 bits mono, size - 64 KB, frequency 44100 Hz.
2696
  * When the system boots, it sets following default parameters:
2637
    Nevertheless it is recommended obviously to install necessary values,
2697
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
2638
    as they could be reinstalled by any program.
2698
    Nevertheless it is recommended to set necessary values obviously
2639
 
2699
    as they could be reset by some application.
2640
======================================================================
2700
 
2641
====================== Function 55, subfunction 55 ===================
2701
======================================================================
2642
=============== Begin to play data on built speaker. =================
2702
 Function 55, subfunction 55 - begin to play data on built-in speaker. 
2643
======================================================================
2703
======================================================================
2644
Parameters:
2704
Parameters:
2645
  * eax = 55 - number of the function
2705
  * eax = 55 - function number
2646
  * ebx = 55 - number subfunction
2706
  * ebx = 55 - subfunction number
2647
  * esi = pointer on the data
2707
  * esi = pointer to data
2648
Returned value:
2708
Returned value:
2649
  * eax = 0 - successfully
2709
  * eax = 0 - success
2650
  * eax = 55 - error (speaker is disconnected or occupied)
2710
  * eax = 55 - error (speaker is off or busy)
2651
Data is an array of units of a variable length.
2711
Data is an array of items with variable length.
2652
Format of each unit is defined in first byte:
2712
Format of each item is defined by first byte:
2653
  * 0 = end of data
2713
  * 0 = end of data
2654
  * 1..0x80 = sets duration of sounding in 1/100 of second of note
2714
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2655
    defined by direct value of frequency
2715
    is defined by immediate value of frequency
2656
    * following word (2 bytes) is contained by a divider of frequency;
2716
    * following word (2 bytes) contains frequency divider;
2657
      the frequency is defined as 1193180/divider
2717
      frequency is defined as 1193180/divider
2658
  * 0x81 = invalid
2718
  * 0x81 = invalid
2659
  * 0x82..0xFF = note defined by octave and number:
2719
  * 0x82..0xFF = note is defined by octave and number:
-
 
2720
    * duration in 1/100 of second = (first byte)-0x81
2660
    * duration in 1/100 of second = (first byte) - 0x81
2721
    * there is one more byte;
2661
    * there is one more byte;
2722
    * (second byte)=0xFF - delay
-
 
2723
    * otherwise it looks like a*0x10+b, where b=number of the note in
2662
    * (second byte) = 0xFF - pause
2724
      an octave from 1 to 12, a=number of octave (beginning from 0)
-
 
2725
Remarks:
Line 2663... Line 2726...
2663
    * differently it looks like a*0x10+b, where b=number of the note
2726
  * Speaker play can be disabled/enabled by
2664
      in an octave from 1 up to 12, a=number of an octave (beginning from 0)
2727
    subfunction 8 of function 18.
2665
Remarks:
2728
  * Function returns control, having informed the system
2666
  * Speaker play can be disable /enable subfunction 8 functions 18.
2729
    an information on request. Play itself goes independently from
2667
  * Function returns handle, having informed where follows the information
2730
    the program.
2668
    on play. Playing goes irrespective of the program.
2731
  * The data must be kept in the memory at least up to the end
2669
  * Data should be saved in memory at least up to the end of playing.
2732
    of play.
2670
 
2733
 
2671
======================================================================
2734
======================================================================
2672
================ Function 56 - write file to hard disk. ==============
2735
=============== Function 56 - write file to hard disk. ===============
2673
======================================================================
2736
======================================================================
2674
Parameters:
2737
Parameters:
2675
  * eax = 56 - number of the function
2738
  * eax = 56 - function number
2676
  * ebx = pointer on a filename
2739
  * ebx = pointer to the file name
2677
  * ecx = size data for writing (in bytes)
2740
  * ecx = size of data to write (in bytes)
2678
  * edx = pointer on data for writing
2741
  * edx = pointer to data to write
2679
  * esi = pointer on path (ASCIIZ-string)
2742
  * esi = pointer to path (ASCIIZ-string)
2680
Returned value:
2743
Returned value:
-
 
2744
  * eax = 0 - success, otherwise file system error code
2681
  * eax = 0 - successfully, differently error code of a file system
2745
Remarks:
2682
Remarks:
2746
  * This function is obsolete; function 70 allows to fulfil the same
2683
  * This function is obsolete; the function 70 allows to fulfil the same
2747
    operations with the extended possibilities.
2684
    operations with the extended possibilities.
2748
  * This function assumes that during its call by one application
Line 2685... Line 2749...
2685
  * Given function assumes, that during its call one application any other
2749
    no other application works with hard disk.
2686
    application does not work with the hard disk.
2750
  * The path to file is ASCIIZ-string, which may be empty
2687
  * Path to the file - ASCIIZ-string, which can be empty (if the file creates
2751
    (if the file is created in the root folder) or have the format
2688
    in the root) or to have the format /d1/d2/ .../dn, where all names of
2752
    /d1/d2/.../dn, where all folder names must have the 8+3 format,
2689
    directories should have the format 8+3, i.e. 8 characters of a name
2753
    i.e. 8 characters of name and 3 characters of the extension
2690
    and 3 characters of the extension without a separator if necessary
2754
    without separator, supplemented by blanks if necessary;
2691
    supplemented by blanks; all characters should be capital.
2755
    all letters must be capital.
2692
  * Name to the file also should have the format 8+3.
2756
  * The file name must also have the format 8+3.
2693
 
2757
 
2694
======================================================================
2758
======================================================================
2695
============== Function 58 - ðàáîòà ñ ôàéëîâîé ñèñòåìîé. ==============
2759
================ Function 58 - work with file system. ================
2696
======================================================================
2760
======================================================================
2697
Parameters:
2761
Parameters:
2698
  * eax = 58
2762
  * eax = 58
2699
  * ebx = pointer on information structure
2763
  * ebx = pointer to the information structure
2700
Returned value:
2764
Returned value:
2701
  * eax = 0 - successfully; differently error code of a file system
2765
  * eax = 0 - success; otherwise file system error code
2702
  * depending on subfunction the value and in other registers can come back
2766
  * some subfunctions return value in other registers too
2703
Common format of information structure:
2767
General format of the information structure:
2704
  * +0: dword: number subfunction
2768
  * +0: dword: subfunction number
2705
  * +4: dword: number of block
2769
  * +4: dword: number of block
2706
  * +8: dword: size
2770
  * +8: dword: size
2707
  * +12 = +0xC: dword: pointer on data
2771
  * +12 = +0xC: dword: pointer to data
2708
  * +16 = +0x10: dword: pointer on memory for system operation
2772
  * +16 = +0x10: dword: pointer to a memory for system operations
2709
    (4096 bytes)
2773
    (4096 bytes)
2710
  * +20 = +0x14: n db: ASCIIZ-string with a filename
2774
  * +20 = +0x14: n db: ASCIIZ-string with the file name
2711
Specifications - in documentation on appropriate subfunction.
2775
Specifications - in documentation on the appropriate subfunction.
2712
Filename is insensitive to the register of latin characters,
2776
Filename is case-insensitive for latin letters, russian letters
2713
russian characters should be capital.
2777
must be capital.
2714
Format of a filename:
2778
Format of filename:
2715
/base/number/dir1/dir2/.../dirn/file,
2779
/base/number/dir1/dir2/.../dirn/file,
2716
where /base/number identifies the device, on which the file is searched:
2780
where /base/number identifies device, on which file is located:
2717
one of
2781
one of
2718
  * /RD/1 = /RAMDISK/1 for access to ramdisk
2782
  * /RD/1 = /RAMDISK/1 to access ramdisk
2719
  * /FD/1 = /FLOPPYDISK/1 for access to first floppy - drive,
2783
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
2720
    /FD/2 = /FLOPPYDISK/2 for second floppy - drive
2784
    /FD/2 = /FLOPPYDISK/2 to access second one
2721
  * /HD/x = /HARDDISK/x - out-of-date variant of access to the hard disk
2785
  * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
2722
   (in this case base is defined subfunction 7 functions 21),
2786
    (in this case base is defined by subfunction 7 of function 21),
2723
    x - number of partition (beginning from 1)
2787
    x - partition number (beginning from 1)
2724
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x for access accordingly
2788
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
2725
    to devices IDE0 (Primary Master), IDE1 (Primary Slave),
2789
    IDE0 (Primary Master), IDE1 (Primary Slave),
2726
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2790
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
2727
    x - number of partition on selected hard disk, varies from 1 up to 255
2791
    x - partition number on the selected hard drive, varies from 1
2728
    (on each of hard disks the indexing starts with 1)
2792
    to 255 (on each hard drive the indexing starts from 1)
2729
Remarks:
2793
Remarks:
2730
  * In first two cases usage FIRST instead of 1, SECOND instead of 2 is
2794
  * 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
2731
    admitted, but to use this possibility it is not recommended for
2796
    for convenience of transition to the future extensions.
2732
    convenience of transition on the future extensions.
2797
  * Limitation n<=39 is imposed.
2733
  * Imposed limitation n<=39.
2798
  * Names of folders and file dir1,...,dirn,file must have the
2734
  * Names of folders and file dir1..., dirn, file should be in the format 8.3:
2799
    format 8.3: name no more than 8 characters, dot, extension no
2735
    a name no more than 8 characters, point, extension no more than 3
2800
    more than 3 characters. Trailing spaces are ignored, no other
2736
    characters. The tail blanks are ignored. Other blanks be does not owe.
2801
    spaces is allowed. If name occupies equally 8 characters,
2737
    If the name occupies equally 8 characters, the point can be omitted
2802
    dot may be omitted (though it is not recommended to use this
2738
    (though to use it it is not recommended for convenience of transition
2803
    feature for convenience of transition to the future extensions).
2739
    on the future extensions).
2804
  * This function does not support folders on ramdisk.
2740
Examples:
2805
Examples:
2741
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2806
  * '/RAMDISK/FIRST/KERNEL.ASM',0
2742
    '/rd/1/kernel.asm',0
2807
    '/rd/1/kernel.asm',0
2743
  * '/HD0/1/kernel.asm',0
2808
  * '/HD0/1/kernel.asm',0
2744
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2809
  * '/hd0/1/menuet/pics/tanzania.bmp',0
2745
Accessible subfunction:
-
 
2746
  * subfunction 0 - reading of a file/folder
-
 
2747
  * subfunction 1 - overwriting of the file
-
 
2748
  * subfunction 2 - deleting of a file/folder
2810
Existing subfunctions:
2749
  * subfunction 3 - writing data in the existing file
-
 
Line 2750... Line 2811...
2750
  * subfunction 4 - creation of a folder
2811
  * subfunction 0 - read file/folder
2751
  * subfunction 5 - renaming/moving of a file/folder
2812
  * subfunction 1 - rewrite file
2752
  * subfunction 8 - LBA-reading from the device
2813
  * subfunction 2 - delete file/folder
2753
  * subfunction 12 - definition of a file size
2814
  * subfunction 3 - write to existing file
2754
  * subfunction 13 - definition of attributes of a file/folder
2815
  * subfunction 4 - make folder
2755
  * subfunction 14 - definition of date/time of a file/folder
2816
  * subfunction 5 - rename/move file/folder
2756
  * subfunction 15 - obtaining of the information about a file system
2817
  * subfunction 8 - LBA-read from device
2757
  * subfunction 16 - start of the application
2818
  * subfunction 15 - get file system information
2758
 
2819
  * subfunction 16 - start application
2759
 
2820
 
2760
======================================================================
2821
======================================================================
2761
======= Function 58, subfunction 0 - reading of a file/folder. =======
2822
=========== Function 58, subfunction 0 - read file/folder. ===========
2762
======================================================================
2823
======================================================================
2763
Parameters:
2824
Parameters:
2764
  * eax = 58
2825
  * eax = 58
2765
  * ebx = pointer on information structure
2826
  * ebx = pointer to the information structure
2766
Format of information structure:
2827
Format of the information structure:
2767
  * +0: dword: 0 = number subfunction
2828
  * +0: dword: 0 = subfunction number
2768
  * +4: dword: number of block for reading (beginning from 0)
-
 
2769
  * +8: dword: éuantity blocks for reading
2829
  * +4: dword: first block to read (beginning from 0)
2770
  * +12 = +0xC: dword: pointer on the buffer, where the data will be written
2830
  * +8: dword: amount of blocks to read
2771
  * +16 = +0x10: dword: pointer on the buffer for system operation
2831
  * +12 = +0xC: dword: pointer to buffer for data
2772
    (4096 bytes)
2832
  * +16 = +0x10: dword: pointer to buffer for system operations
-
 
2833
    (4096 bytes)
2773
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
2834
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2774
    are indicated in the common description
2835
    given in the general description
2775
Returned value:
2836
Returned value:
2776
  * eax = 0 - successfully, differently error code of a file system
2837
  * eax = 0 - success, otherwise file system error code
2777
  * ebx = file size (in bytes) or
2838
  * ebx = file size (in bytes) or -1=0xffffffff, if file was not found
2778
    -1=0xffffffff, if the file is not retrieved
2839
Remarks:
-
 
2840
  * Block size is 512 bytes.
2779
Remarks:
2841
  * This function is obsolete, for reading files use subfunction 0
2780
  * Size of block - 512 bytes.
2842
    of function 70, for reading folders - subfunction 1 of
2781
  * This function is obsolete, for reading files use subfunction 0
2843
    function 70.
2782
    functions 70, for reading folders - subfunction of 1 function 70.
2844
  * Function can read contents of a folder. Only FAT file system is
2783
  * Function allows to read contents of a folder. From file systems is
2845
    supported. The format of FAT-folder is described
2784
    supported only FAT. The format of a FAT-folder is described in any
2846
    in any FAT documentation.
2785
    documentation on FAT.
2847
  * Size of a folder is determined by size of FAT clusters chain.
2786
  * Size of a folder is defined on a size of a chain of clusters in FAT.
2848
  * If file was ended before last requested block was read,
2787
  * If the file was terminated earlier, than last requested block was read,
2849
    the function will read as many as it can, and after that return
-
 
2850
    eax=6 (EOF).
2788
    the function will read, how many can, then will return eax=6 (EOF).
2851
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2789
  * Function allows to read root folders /rd/1, /fd/x, /hd [n] /x, but
2852
    in the first two cases the current implementation does not follow
2790
    in first two cases the current implementation does not follow the
2853
    to the declared rules:
-
 
2854
    for /rd/1:
2791
    installed rules:
2855
    * if one want to read 0 blocks, function considers,
2792
    for /rd/1:
2856
      that he requested 1;
2793
    * if 0 blocks for reading are indicated, it is considered,
2857
    * if one requests more than 14 blocks or starting block is
2794
      that is requested 1;
2858
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2795
    * if is requested more than 14 blocks or the initial block is not
2859
    * size of ramdisk root folder is 14 blocks, 
2796
      less 14, comes back eax=5 (not found) and ebx =-1;
2860
      0x1C00=7168 áàéò; but function returns ebx=0
2797
    * size of the root ramdisk = 14 blocks, 0x1C00=7168 bytes; but comes
2861
      (except of the case of previous item);
2798
      back ebx=0 (except for a case of the previous item);
2862
    * strangely enough, it is possible to read 14th block (which
2799
    * strangely enough, it is possible to read 14 block (there, generally
2863
      generally contains a garbage - I remind, the indexing begins
2800
      speaking, garbage - I remind, the score carries on with 0);
2864
      from 0);
2801
    * if one block with number, not smaller 14 was requested even,
2865
    * if some block with the number not less than 14 was requested,
2802
      comes back eax=6 (EOF); differently eax=0.
2866
      function returns eax=6(EOF); otherwise eax=0.
2803
    for /fd/x:
2867
    For /fd/x:
2804
    * if the initial block is not less 14, comes back eax=5 (not found)
2868
    * if the start block is not less than 14, function returns
2805
      and ebx=0;
2869
      eax=5 (not found) and ebx=0;
-
 
2870
    * note that format of FAT12 allows floppies with the root size
2806
    * by the way speaking, the format FAT12 admits diskettes with a size
2871
      more or less than 14 blocks;
Line 2807... Line 2872...
2807
      of the root less or more than 14 blocks;
2872
    * check for length is not performed;
2808
    * checks of length is not done;
2873
    * if data was successful read, function returns
2809
    * if it was possible to read given with a diskette, comes back eax=0,
2874
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2810
      ebx=0; otherwise eax=10 (access denied), ebx =-1.
2875
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2811
  * Function handles reading special folders /, /rd, /fd, /hd [n]; but the
2876
    but the result does not correspond to expected (on operations with
2812
    result does not correspond expected (on operation with usual
2877
    normal files/folders), does not follow the declared rules,
2813
    files/folders), does not follow the installed rules, can vary in the
2878
    may be changed in future versions of the kernel and consequently
2814
    following versions of a kernel and consequently is not described.
2879
    is not described. To obtain the information about the equipment
2815
    For obtaining the information about the equipment use subfunction 11
2880
    use subfunction 11 of function 18 or
2816
    functions 18 or read appropriate folders subfunction of 1 function 70.
2881
    read corresponding folder with subfunction 1 of function 70.
2817
 
2882
 
2818
======================================================================
2883
======================================================================
2819
======== Function 58, subfunction 1 - overwriting of the file. =======
2884
============= Function 58, subfunction 1 - rewrite file. =============
2820
======================================================================
2885
======================================================================
2821
If the file does not exist, it creates.
2886
If the file does not exist, it is created.
2822
If the file exists, it is rewritten.
2887
If the file exists, it is rewritten.
2823
Parameters:
2888
Parameters:
2824
  * eax = 58 - number of the function
2889
  * eax = 58 - function number
2825
  * ebx = pointer on information structure
2890
  * ebx = pointer to the information structure
2826
Format of information structure:
2891
Format of the information structure:
2827
  * +0: dword: 1 = number subfunction
2892
  * +0: dword: 1 = subfunction number
2828
  * +4: dword: ignored (install in 0)
2893
  * +4: dword: ignored (set to 0)
Line 2829... Line 2894...
2829
  * +8: dword: number bytes for writing
2894
  * +8: dword: number of bytes to write
2830
  * +12 = +0xC: dword: pointer on data for çàïèñè
2895
  * +12 = +0xC: dword: pointer to data to write
2831
  * +16 = +0x10: dword: pointer on buffer for system operation
2896
  * +16 = +0x10: dword: pointer to buffer for system operations
2832
    (4096 bytes)
2897
    (4096 bytes)
2833
  * +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
2898
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2834
    are indicated in the common description
2899
    given in the general description
2835
Returned value:
2900
Returned value:
2836
  * eax = 0 - successfully, differently error code of a file system
2901
  * eax = 0 - success, otherwise file system error code
2837
  * ebx fail
2902
  * ebx destroyed
2838
Remarks:
2903
Remarks:
2839
  * This function is obsolete, use subfunction 2 functions 70.
2904
  * This function is obsolete, use subfunction 2 of function 70.
2840
 
2905
 
2841
======================================================================
2906
======================================================================
2842
====== Function 58, subfunction 2 - deleting of a file/folder. =======
2907
========== Function 58, subfunction 2 - delete file/folder. ==========
2843
======================================================================
2908
======================================================================
2844
Parameters:
2909
Parameters:
2845
  * eax = 58 - number of the function
2910
  * eax = 58 - function number
2846
  * ebx = pointer on information structure
2911
  * ebx = pointer to the information structure
2847
Format of information structure:
2912
Format of the information structure:
2848
  * +0: dword: 2 = number subfunction
2913
  * +0: dword: 2 = subfunction number
2849
  * +4: dword: ignored
2914
  * +4: dword: ignored
2850
  * +8: dword: ignored
2915
  * +8: dword: ignored
2851
  * +12 = +0xC: dword: ignored
2916
  * +12 = +0xC: dword: ignored
Line 2852... Line 2917...
2852
  * +16 = +0x10: dword: pointer on buffer for system operation
2917
  * +16 = +0x10: dword: pointer to buffer for system operations
2853
    (4096 bytes)
2918
    (4096 bytes)
2854
  * +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
2919
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2855
    are indicated in the common description
2920
    given in the general description
2856
Returned value:
2921
Returned value:
2857
  * eax = 0 - successfully, differently error code of a file system
2922
  * eax = 0 - success, otherwise file system error code
2858
  * ebx fail
2923
  * ebx destroyed
2859
Remarks:
2924
Remarks:
2860
  * By operation with a diskette it is not necessary to delete a nonblank
2925
  * By operations with a floppy one should not delete not empty
2861
    folder. The code of operation with the hard disk nonblank folders
2926
    folder. The code working with hard disk deletes not empty folders
2862
    deletes correctly (i.e. recursively with all files and nested folders).
2927
    correctly (i.e. recursively with all files and nested folders).
2863
    Ramdisk of folders does not support.
2928
    Function 58 does not support folders on ramdisk.
2864
 
2929
 
2865
======================================================================
2930
======================================================================
2866
=== Function 58, subfunction 3 - writing data in the existing file ===
2931
==== Function 58, subfunction 3 - write data to the existing file. ===
2867
======================================================================
2932
======================================================================
2868
Parameters:
2933
Parameters:
2869
  * eax = 58 - number of the function
2934
  * eax = 58 - function number
2870
  * ebx = pointer on information structure
2935
  * ebx = pointer to the information structure
2871
Format of information structure:
2936
Format of the information structure:
2872
  * +0: dword: 3 = number subfunction
2937
  * +0: dword: 3 = subfunction number
2873
  * +4: dword: initial position in the file; -1 = to add in the end
2938
  * +4: dword: starting position in the file; -1 = append to the end
2874
  * +8: dword: number bytes for writing
2939
  * +8: dword: number of bytes to write
2875
  * +12 = +0xC: dword: pointer on data for writing
2940
  * +12 = +0xC: dword: pointer to data to write
2876
  * +16 = +0x10: dword: pointer on buffer for system operation
2941
  * +16 = +0x10: dword: pointer to buffer for system operations
-
 
2942
    (4096 bytes)
2877
    (4096 bytes)
2943
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2878
  * +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
2944
    given in the general description
2879
    are indicated in the common description
2945
Returned value:
2880
Returned value:
2946
  * eax = 0 - success, otherwise file system error code
2881
  * eax = 0 - successfully, differently error code of a file system
2947
  * ebx destroyed
2882
  * ebx fail
2948
Remarks:
2883
Remarks:
2949
  * Ramdisk and floppies do not support this function, it is only
2884
  * Ramdisk and the diskettes do not support this function,
2950
    for hard disks.
2885
    it only for hard disks.
2951
  * File must already exist (otherwise function returns 5, not found).
2886
  * File should already exist (differently comes back 5, not found).
2952
    To create files use subfunction 1.
2887
    For creation of files use subfunction 1.
2953
  * If the starting position is greater than file size, the function
2888
  * If the initial position is more than a file size, comes back eax=6 (EOF).
2954
    returns eax=6(EOF). If the end position is greater than file size,
2889
    If the finite position is more than a file size, the file extends.
2955
    file is extended.
2890
  * Code of processing of data writing for the hard disk interpretes zero
2956
  * The code of write processing for hard disk interpretes zero
2891
    value of a field +8 as the instruction of a truncation of the file
2957
    value of the field +8 as the instruction to truncate the file to
2892
    up to a size indicated in a field +4. However code of processing of
2958
    the size, given in the field +4. However the code of processing
2893
    58-th function locks this possibility for the applications, at once
2959
    58th function blocks this possibility for applications by
2894
    returning handle (with eax=0) in case of a zero size.
2960
    immediate return (with eax=0) in the case of zero size.
2895
 
2961
 
2896
======================================================================
2962
======================================================================
2897
======== Function 58, subfunction 4 - creation of a folder. ==========
2963
============== Function 58, subfunction 4 - make folder. =============
2898
======================================================================
2964
======================================================================
2899
Parameters:
2965
Parameters:
2900
  * eax = 58 - number of the function
2966
  * eax = 58 - function number
2901
  * ebx = pointer on information structure
2967
  * ebx = pointer to the information structure
2902
Format of information structure:
2968
Format of the information structure:
2903
  * +0: dword: 4 = number subfunction
2969
  * +0: dword: 4 = subfunction number
Line 2904... Line 2970...
2904
  * +4: dword: ignored
2970
  * +4: dword: ignored
2905
  * +8: dword: ignored
2971
  * +8: dword: ignored
2906
  * +12 = +0xC: dword: ignored
2972
  * +12 = +0xC: dword: ignored
2907
  * +16 = +0x10: dword: pointer on buffer for system operation
2973
  * +16 = +0x10: dword: pointer to buffer for system operations
2908
    (4096 bytes)
2974
    (4096 bytes)
2909
  * +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
2975
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2910
    are indicated in the common description
2976
    given in the general description
2911
Returned value:
2977
Returned value:
2912
  * eax = 0 - successfully, differently error code of a file system
2978
  * eax = 0 - success, otherwise file system error code
2913
  * ebx fail
2979
  * ebx destroyed
2914
Remarks:
2980
Remarks:
2915
  * Ramdisk and the diskettes do not support this function,
2981
  * Ramdisk and floppies do not support this function, it is only
2916
    it only for hard disks.
2982
    for hard disks.
2917
 
2983
 
2918
======================================================================
2984
======================================================================
2919
=== Function 58, subfunction 5 - renaming/moving of a file/folder. ===
2985
======== Function 58, subfunction 5 - rename/move file/folder. =======
2920
======================================================================
2986
======================================================================
2921
Parameters:
2987
Parameters:
2922
  * eax = 58 - number of the function
2988
  * eax = 58 - function number
2923
  * ebx = pointer on information structure
2989
  * ebx = pointer to the information structure
2924
Format of information structure:
2990
Format of the information structure:
2925
  * +0: dword: 5 = number subfunction
2991
  * +0: dword: 5 = subfunction number
2926
  * +4: dword: ignored
2992
  * +4: dword: ignored
2927
  * +8: dword: ignored
2993
  * +8: dword: ignored
2928
  * +12 = +0xC: dword: ignored
2994
  * +12 = +0xC: dword: ignored
2929
  * +16 = +0x10: dword: pointer on buffer for system operation
2995
  * +16 = +0x10: dword: pointer to buffer for system operations
2930
    (4096 bytes)
2996
    (4096 bytes)
2931
  * +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
2997
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2932
    are indicated in the common description
2998
    given in the general description
2933
  * +20+n: (at once after a completing null character) new ASCIIZ-name,
2999
  * +20+n: (at once after terminating null character) new
Line 2934... Line 3000...
2934
    should start with /hd/1, that is interpreted as the hard disk
3000
    ASCIIZ-name, must start from /hd/1, that is interpreted as
2935
    indicated in the first name
3001
    the hard disk, indicated in the first name
2936
    (moving from one disk on another is not supported)
3002
    (moving from one disk to another is not supported)
2937
Returned value:
3003
Returned value:
2938
  * eax = 0 - successfully, differently error code of a file system
3004
  * eax = 0 - success, otherwise file system error code
2939
  * ebx fail
3005
  * ebx destroyed
2940
Remarks:
3006
Remarks:
2941
  * Ramdisk and the diskettes do not support this function,
3007
  * Ramdisk and floppies do not support this function, it is only
2942
    it only for hard disks.
3008
    for hard disks.
2943
  * If new ASCIIZ-name strongly incorrect, i.e. does not start with /hd/1,
3009
  * If the new ASCIIZ-name is strongly incorrect, i.e. does not start
2944
    /hd/first, /harddisk/1, /harddisk/first or after that beginnings there
3010
    from /hd/1, /hd/first, /harddisk/1, /harddisk/first or after this
2945
    is a blank or character with the code 0, the function returns, strangely
-
 
2946
    enough, error code 4. Is the sole function, which in general returns
3011
    space or null character follows, function returns, strangely
2947
    this code.
3012
    enough, error code 4. It is the only function which returns
2948
 
3013
    this code.
2949
======================================================================
3014
 
2950
====== Function 58, subfunction 8 - LBA-reading from the device. =====
3015
======================================================================
2951
======================================================================
3016
========= Function 58, subfunction 8 - LBA-read from device. =========
2952
Parameters:
3017
======================================================================
2953
  * eax = 58 - number of the function
3018
Parameters:
2954
  * ebx = pointer on information structure
3019
  * eax = 58 - function number
2955
Format of information structure:
3020
  * ebx = pointer to the information structure
2956
  * +0: dword: 8 = number subfunction
3021
Format of the information structure:
2957
  * +4: dword: number of the block for reading (beginning from 0)
-
 
2958
  * +8: dword: ignored (install in 1)
3022
  * +0: dword: 8 = subfunction number
2959
  * +12 = +0xC: dword: pointer on buffer, where data will be written
3023
  * +4: dword: number of block to read (beginning from 0)
2960
    (512 bytes)
3024
  * +8: dword: ignored (set to 1)
2961
  * +16 = +0x10: dword: pointer on buffer for system operation
3025
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
2962
    (4096 bytes)
3026
  * +16 = +0x10: dword: pointer to buffer for system operations
2963
  * +20 = +0x14: ASCIIZ-name of the device: is not sensitive to the register,
3027
    (4096 bytes)
2964
    one of /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
3028
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
2965
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
3029
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
2966
    Instead of digits is admitted, though usage 'first', 'second', 'third',
3030
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
2967
    'fourth' is not recommended for convenience of transition on the future
3031
    Instead of digits it is allowed, though not recommended for
2968
    extensions.
3032
    convenience of transition to future extensions, to use
2969
Returned value:
3033
    'first','second','third','fourth'.
2970
  * if device name /hd/xxx is indicated, where xxx is not in list above:
3034
Returned value:
2971
    * eax = ebx = 1
3035
  * for device name /hd/xxx, where xxx is not in the list above:
2972
  * if the incorrect device name is indicated
3036
    * eax = ebx = 1
2973
    (except for the previous case):
3037
  * for invalid device name (except for the previous case):
2974
    * eax = 5
3038
    * eax = 5
2975
    * ebx does not vary
3039
    * ebx does not change
2976
  * if the LBA-access is prohibited subfunction 11 functions 21:
3040
  * if LBA-access is disabled by subfunction 11 of function 21:
2977
    * eax = 2
3041
    * eax = 2
2978
    * ebx fail
3042
    * ebx destroyed
2979
  * for ramdisk attempt of reading of the block outside ramdisk
3043
  * for ramdisk: attempt to read block outside ramdisk
2980
    (18*2*80 blocks) results to
3044
    (18*2*80 blocks) results in
2981
    * eax = 3
3045
    * eax = 3
-
 
3046
    * ebx = 0
2982
    * ebx = 0
3047
  * for successful read:
2983
  * at successful reading:
3048
    * eax = ebx = 0
2984
    * eax = ebx = 0
3049
Remarks:
2985
Remarks:
3050
  * Block size is 512 bytes; function reads one block.
2986
  * Size of the block - 512 bytes; one block is read.
3051
  * Do not depend on returned value, it can be changed
2987
  * It is not necessary to rely on returned value, it can vary in
3052
    in future versions.
2988
    the following versions.
3053
  * Function requires that LBA-access to devices is enabled by 
2989
  * It is required, that the LBA-access to devices subfunction 11 functions 21
3054
    subfunction 11 of function 21. To check this one can use 
2990
    should be allowed. Find out it it is possible by call
3055
    subfunction 11 of function 26.
2991
    subfunction 11 functions 26.
3056
  * LBA-read of floppy is not supported.
2992
  * LBA-reading of a diskette is not supported.
3057
  * Function reads data on physical hard drive; if for any reason
2993
  * Function reads out the data of the physical hard disk; if for any reasons
3058
    data of the concrete partition are required, application must
2994
    the data of the concrete unit are necessary, will come to define initial
3059
    define starting sector of this partition (either directly
2995
    sector of this unit (or directly through MBR, or from the extended
3060
    through MBR, or from the full structure returned by
2996
    structure returned same subfunction 11 functions 18).
3061
    ïîäôóíêöèåé 11 ôóíêöèè 18).
2997
  * Function the error code of the hard disk does not check, so search of
3062
  * Function does not check error code of hard disk, so request of
2998
    nonexistent sector all the same something will read (more probably
3063
    nonexisting sector reads something (most probably it will be
2999
    everything, zero, but it is defined by the device) and it will be
3064
    zeroes, but this is defined by device) and this is considered
3000
    considered as success (eax=0).
3065
    as success (eax=0).
3001
 
3066
 
3002
=============================================================================
3067
======================================================================
3003
= Function 58, subfunction 15 - obtaining of information about a file system. 
3068
==== Function 58, subfunction 15 - get information on file system. ===
3004
=============================================================================
3069
======================================================================
3005
Parameters:
3070
Parameters:
3006
  * eax = 58 - number of the function
3071
  * eax = 58 - function number
3007
  * ebx = pointer on information structure
3072
  * ebx = pointer to the information structure
3008
Format of information structure:
3073
Format of the information structure:
3009
  * +0: dword: 15 = number of the function
3074
  * +0: dword: 15 = subfunction number
3010
  * +4: dword: ignored
3075
  * +4: dword: ignored
3011
  * +8: dword: ignored
3076
  * +8: dword: ignored
3012
  * +12 = +0xC: dword: ignored
3077
  * +12 = +0xC: dword: ignored
3013
  * +16 = +0x10: dword: ignored
3078
  * +16 = +0x10: dword: ignored
3014
  * +20 = +0x14: (second character is checked only, at once after /)
3079
  * +20 = +0x14: (only second character is checked)
3015
    /rd=/RAMDISK or /hd=/HARDDISK
3080
    /rd=/RAMDISK or /hd=/HARDDISK
3016
Returned value:
3081
Returned value:
3017
  * If second character does not belong to set {'r','R','h','H'}:
3082
  * if the second character does not belong to set {'r','R','h','H'}:
3018
    * eax = 3
3083
    * eax = 3
3019
    * ebx = ecx = dword [fileinfo] = 0
3084
    * ebx = ecx = dword [fileinfo] = 0
3020
  * for ramdisk:
3085
  * for ramdisk:
3021
    * eax = 0 (success)
3086
    * eax = 0 (success)
3022
    * ebx = total number of clusters = 2847
3087
    * ebx = total number of clusters = 2847
3023
    * ecx = number of free clusters
3088
    * ecx = number of free clusters
3024
    * dword [fileinfo] = cluster size = 512
3089
    * dword [fileinfo] = cluster size = 512
3025
  * for the hard disk: base and partition are defined
3090
  * for hard disk: base and partition are defined by subfunctions
3026
    subfunctions 7 and 8 functions 21:
3091
    7 and 8 of function 21:
-
 
3092
    * eax = 0 (success)
3027
    * eax = 0 (success)
3093
    * ebx = total number of clusters
3028
    * ebx = total number of clusters
3094
    * ecx = number of free clusters
3029
    * ecx = number of free clusters
3095
    * dword [fileinfo] = cluster size (in bytes)
3030
    * dword [fileinfo] = cluster size (in bytes)
3096
Remarks:
3031
Remarks:
3097
  * Be not surprised to strange layout of 4th returned parameter
3032
  * Be not surprised to strange layout of 4-th returned parameter - when this
3098
    - when this code was writing, at system calls application got
3033
    code was written, at system calls to the application the registers eax,
3099
    only registers eax,ebx,ecx (from pushad-structure transmitted
3034
    ebx, ecx (from pushad-structure transmitted as argument to the system
3100
    as argument to the system function). Now it is corrected, so,
3035
    function) came back only. Now it is corrected, so, probably, it is
3101
    probably, it is meaningful to return cluster size in edx, while
3036
    meaningful to return a cluster size in edx, while this function have
3102
    this function is not used yet.
3037
    not begun to use
3103
  * There exists also subfunction 11 of function 18,
3038
  * Generally still exists subfunction 11 functions 18, returning the
3104
    which returns information on file system. From the full table
3039
    information on a file system. Under the extended table of a disk
3105
    of disk subsystem it is possible to deduce cluster size (there
3040
    subsystem it is possible to define a cluster size (there it is stored
3106
    it is stored in sectors) and total number of clusters
3041
    in sectors) and total number of clusters for hard disks.
3107
    for hard disks.
3042
 
3108
 
3043
======================================================================
3109
======================================================================
3044
======== Function 58, subfunction 16 - start of application. =========
3110
========== Function 58, subfunction 16 - start application. ==========
3045
======================================================================
3111
======================================================================
3046
Parameters:
3112
Parameters:
3047
  * eax = 58 - number of the function
3113
  * eax = 58 - function number
3048
  * ebx = pointer on information structure
3114
  * ebx = pointer to the information structure
3049
Format of information structure:
3115
Format of the information structure:
3050
  * +0: dword: 16 = number subfunction
3116
  * +0: dword: 16 = subfunction number
3051
  * +4: dword: Field of flags:
3117
  * +4: dword: flags:
3052
    * bit 0: to start the process as debugged
3118
    * bit 0: start the process as debugged
3053
    * other bits are reserved and should be installed in 0
3119
    * other bits are reserved and must be cleared
-
 
3120
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
3054
  * +8: dword: 0 or pointer on ASCIIZ-string with parameters
3121
  * +12 = +0xC: dword: ignored
3055
  * +12 = +0xC: dword: ignored
3122
  * +16 = +0x10: dword: pointer to buffer for system operations
Line 3056... Line 3123...
3056
  * +16 = +0x10: dword: pointer on buffer for system operation
3123
    (4096 bytes)
3057
    (4096 bytes)
3124
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3058
  * +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
3125
    given in the general description
3059
    are indicated in the common description
3126
Returned value:
3060
Returned value:
3127
  * eax > 0 - the program is loaded, eax contains PID
3061
  * eax > 0 - program is loaded, eax contains PID
3128
  * eax < 0 - an error has occured, -eax contains
3062
  * eax < 0 - has taken place error, -eax contains an error code
3129
    file system error code
3063
    of a file system
3130
Remarks:
3064
Remarks:
3131
  * This function is obsolete, use subfunction 7 of function 70.
3065
  * This function is obsolete, use subfunction 7 functions 70.
3132
  * Command line must be terminated by character with code 0
3066
  * Command line should be ended by the character with the code 0
3133
    (ASCIIZ-string); function takes into account either all characters
3067
    (ASCIIZ-strings); it are taken into account or all characters up to
3134
    up to terminating null inclusively or the first 256 charachters
3068
    completing zero inclusively, or the first 256 characters, that are less.
3135
    depending on what is less.
3069
  * If the process is started as debugged, it creates in the frozen status;
3136
  * If the process is started as debugged, it is created in
3070
    for start use subfunction 5 functions 69.
3137
    the suspended state; to run use subfunction 5 of function 69.
3071
 
3138
 
3072
======================================================================
3139
======================================================================
3073
======== Function 59 - get information on last system calls. =========
3140
=============== Function 59 - trace last system calls. ===============
3074
======================================================================
3141
======================================================================
3075
Get data on all system calls of all processes.
3142
Gets data on all system calls of all processes.
3076
Parameters:
3143
Parameters:
3077
  * eax = 59 - number of the function
3144
  * eax = 59 - function number
3078
  * ebx = 0 - sole subfunction
3145
  * ebx = 0 - unique subfunction
3079
  * ecx = pointer on buffer
3146
  * ecx = pointer to the buffer
3080
  * edx = size of buffer
3147
  * edx = size of the buffer
3081
Returned value:
3148
Returned value:
-
 
3149
  * eax = total number of system calls made from system boot
3082
  * eax = total number of system calls made from moment
3150
    (modulo 2^32)
3083
    of loading system (modulo 2^32)
3151
  * ebx = 0
3084
  * ebx = 0
3152
Format of information on one call: (size = 0x40 = 64 bytes)
3085
Format of information about one call: (size = 0x40 = 64 bytes)
3153
  * +0: dword: PID of process/thread
3086
  * +0: dword: PID process/thread
3154
  * +4: 7*dword: garbage
3087
  * +4: 7*dword: garbage
3155
  * +32 = +0x20: dword: value of edi at the call
3088
  * +32 = +0x20: dword: value edi by call
3156
  * +36 = +0x24: dword: esi
3089
  * +36 = +0x24: dword: esi
3157
  * +40 = +0x28: dword: ebp
3090
  * +40 = +0x28: dword: ebp
3158
  * +44 = +0x2C: dword: stack pointer of the kernel handler
3091
  * +44 = +0x2C: dword: pointer of stack of kernel handler
3159
  * +48 = +0x30: dword: ebx
3092
  * +48 = +0x30: dword: ebx
3160
  * +52 = +0x34: dword: edx
3093
  * +52 = +0x34: dword: edx
3161
  * +56 = +0x38: dword: ecx
3094
  * +56 = +0x38: dword: ecx
3162
  * +60 = +0x3C: dword: eax (=number of system function)
3095
  * +60 = +0x3C: dword: eax (=number system function)
3163
Remarks:
3096
Remarks:
3164
  * The function is used only in the application 'systrace'.
3097
  * Function is used only in the application systrace. It is rather difficult
3165
    It is rather difficult to imagine a situation, in which
3098
    to present a situation, in which this application or this function are
3166
    this application or this function are really useful;
3099
    really useful, and all system calls for support of this function are a
3167
    and all system calls for support of this function are a little
3100
    little decelerated (though and not strongly)...
3168
    decelerated (though not strongly)...
-
 
3169
  * So there is a proposition to delete from the kernel
3101
  * In this connection there is a sentence support of this function from
3170
    support of this function, together with application 'systrace'.
Line 3102... Line 3171...
3102
    a kernel to remove absolutely, together with the application systrace.
3171
  * The information on system calls saves in the system
3103
  * Information on system calls is saved in system ring buffer
3172
    ring buffer with 0x10 entries.
3104
    on 0x10 of inputs.
3173
    This function simply copies the given size of data
3105
    This function simply copies the indicated size given from the mentioned
3174
    from this buffer to the given address.
3106
    buffer to the indicated address.
3175
  * One can determine, which entry in the buffer corresponds to
3107
  * To what from inputs in the buffer corresponds to last call, it is possible
3176
    last system call, by value of eax, namely, it is the entry
Line 3108... Line 3177...
3108
    to define on value eax, namely,
3177
    (eax and 0xF) (at offset (eax and 0xF)*0x40).
3109
    input (eax and 0xF) (on offset (eax and 0xF) *0x40).
3178
  * In the current implementation there can be the seldom
3110
  * In current implementation the seldom meeting problems of
3179
    meeting problems of unsynchronization, when the information
3111
    unsynchronization are possible, when about some calls the
3180
    on some calls becomes outdated.
3112
    information becomes outdated.
3181
  * Under the system buffer one page, 4Kb, is allocated.
3113
  * Under the system buffer the page, 4 KB is allocated.
3182
    Size of an entry = 64 bytes. Why only 16 entries are used,
3114
    Size of an input = 64 bytes.
3183
    is not clearly.
3115
    Why 16 inputs - not clearly are used only.
3184
  * The value of esp at the moment of system call cannot
3116
  * Value esp at moment of system call by this function cannot be found out.
3185
    be determined by this function.
3117
  * Checks of a correctness edx in current implementation is not done.
3186
  * The current implementation does not check edx for correctness.
3118
 
3187
 
3119
======================================================================
3188
======================================================================
3120
=========== Function 60 - Inter Process Communication (IPC). ==========
3189
========== Function 60 - Inter Process Communication (IPC). ==========
3121
======================================================================
-
 
3122
IPC is applied to sendings the messages from one process / thread to another.
3190
======================================================================
3123
Thus it is necessary previously to agree how to interpreted
3191
IPC is used for message dispatching from one process/thread to
3124
the concrete message.
3192
another. Previously it is necessary to agree how to interpret
3125
 
3193
the concrete message.
3126
-------- Subfunction 1 - install area for obtaining IPC ---------
3194
 
3127
Is called by the process - receiver.
3195
----------- Subfunction 1 - set the area for IPC receiving -----------
3128
Parameters:
3196
Is called by process-receiver.
3129
  * eax = 60 - number of the function
3197
Parameters:
Line 3130... Line 3198...
3130
  * ebx = 1 - number subfunction
3198
  * eax = 60 - function number
3131
  * ecx = pointer on buffer
3199
  * ebx = 1 - subfunction number
3132
  * edx = size of buffer
3200
  * ecx = pointer to the buffer
3133
Returned value:
3201
  * edx = size of the buffer
3134
  * eax = 0 - always successfully
3202
Returned value:
3135
Ôîðìàò IPC-áóôåðà:
3203
  * eax = 0 - always success
3136
  * +0: dword: if here not 0, the buffer is considered disabled; lock/unblock
3204
Format of IPC-buffer:
3137
    the buffer, when you with it actively work also to you it is necessary,
3205
  * +0: dword: if nonzero, buffer is considered locked;
3138
    that the data of the buffer from the outside varied
3206
    lock/unlock the buffer, when you work with it and need that
3139
    (the new messages) not acted
3207
    buffer data are not changed from outside (no new messages)
3140
  * +4: dword: occupied place in the buffer (in bytes)
3208
  * +4: dword: occupied place in the buffer (in bytes)
3141
  * +8: first message
3209
  * +8: first message
3142
  * +8+n: second message
3210
  * +8+n: second message
3143
  * ...
3211
  * ...
3144
Format of message:
3212
Format of a message:
3145
  * +0: dword: PID of process / thread which has transmitted the message
3213
  * +0: dword: PID of sender
3146
  * +4: dword: length of the message (not including this header)
3214
  * +4: dword: message length (not including this header)
3147
  * +8: n*byte: data messages
3215
  * +8: n*byte: message data
3148
 
3216
 
Line 3149... Line 3217...
3149
--------------- Subfunction 2 - transmit message IPC. ----------------
3217
------------------ Subfunction 2 - send IPC message ------------------
3150
Is called by the process - initiator.
3218
Is called by process-sender.
3151
Parameters:
3219
Parameters:
3152
  * eax = 60 - number of the function
3220
  * eax = 60 - function number
3153
  * ebx = 2 - number subfunction
3221
  * ebx = 2 - subfunction number
3154
  * ecx = PID of receiver
3222
  * ecx = PID of receiver
3155
  * edx = pointer on message data
3223
  * edx = pointer to the message data
3156
  * esi = length of message (in bytes)
3224
  * esi = message length (in bytes)
3157
Returned value:
3225
Returned value:
-
 
3226
  * eax = 0 - success
3158
  * eax = 0 - successfully
3227
  * eax = 1 - the receiver has not defined buffer for IPC messages
3159
  * eax = 1 - receiver has not defined buffer for IPC-messages
3228
    (can be, still have no time,
3160
   (can be, was not in time yet, and there can be, it not that thread,
3229
    and can be, this is not right process)
3161
   which is necessary)
3230
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3162
  * eax = 2 - receiver has blocked the IPC-buffer; try slightly to wait
3231
  * eax = 3 - overflow of IPC-buffer of the receiver
3163
  * eax = 3 - overflow of IPC-buffer of receiver
3232
  * eax = 4 - process/thread with such PID does not exist
3164
  * eax = 4 - process/thread with such PID does not exist
3233
Remarks:
3165
Remarks:
3234
  * Immediately after writing of IPC-message to the buffer the system
3166
  * System at once after writing the IPC-message in the buffer dispatches
3235
    sends to the receiver the event with code 7 (see event codes).
3167
    to stream - receiver event with the code 7 (see codes of events).
3236
 
3168
 
3237
======================================================================
3169
======================================================================
3238
==== Function 61 - get parameters for the direct graphics access. ====
3170
==== Function 61 - get parameters for direct access to a graphics. ===
3239
======================================================================
3171
======================================================================
3240
The data of the graphics screen (the memory area which displays
3172
Data of graphics screen are accessible to program (area of memory, which purely
3241
screen contents) are accessible to a program directly, without
-
 
3242
any system calls, through the selector gs:
3173
also displays contents of  screen) directly without calls of system functions
3243
	mov	eax, [gs:0]
3174
through the selector gs:
3244
places in eax the first dword of the buffer, which contains
3175
    mov    eax, [gs:0]
3245
information on color of the left upper point (and, possibly, colors
3176
will place in eax first dword of buffer containing information on colour
3246
of several following).
3177
of left upper point (and, probably, colour of several following).
3247
	mov	[gs:0], eax
3178
    mov    [gs:0], eax
3248
by work in VESA modes with LFB sets color of the left upper point
3179
by operation in modes VESA c LFB will install colour of left upper point
3249
(and, possibly, colors of several following).
3180
(and, probably, colour of several following).
-
 
Line 3181... Line 3250...
3181
Interpretations given of the graphics screen need knowledge of some parameters,
3250
To interpret the data of graphics screen program needs to know
3182
which come back by this function.
3251
some parameters, returning by this function.
3183
Remarks:
3252
Remarks:
3184
  * Parameters of a graphics very seldom vary at system operation, namely,
3253
  * Graphics parameters changes very seldom at work,
3185
    only in cases, when the user works with the program VRR.
3254
    namely, only in cases, when user works with the application VRR.
3186
  * At change of videomode the system redraw all windows
3255
  * At videomode change the system redraws all windows (event
3187
    (event with the code 1) and redraw a background (event 5).
3256
    with code 1) and redraws the background (event 5).
3188
    Same events occur and in other cases, which meet much more often,
3257
    Same events occur in other cases too, which meet much more often,
3189
    than change of videomode.
3258
    than videomode change.
Line 3190... Line 3259...
3190
  * By operation in videomodes with LFB the selector gs specifies on purely
3259
  * By operation in videomodes with LFB the selector gs points to
3191
    LFB, so reading /  writing on gs result directly in change of contents of
3260
    LFB itself, so reading/writing on gs result directly in
3192
    the screen. By operation in videomodes without LFB gs specifies some area
3261
    change of screen contents. By operation in videomodes without
3193
    of the given kernel, and all functions of output on the screen honesty
3262
    LFB gs points to some data area in the kernel, and all functions
3194
    fulfil double operation on writing directly on the screen and on
3263
    of screen output fulfil honesty double operation on writing
3195
    writing in this buffer. In result at reading contents of this buffer the
3264
    directly to the screen and writing to this buffer. In result
Line 3196... Line 3265...
3196
    results correspond to contents of the screen (with, generally speaking,
3265
    at reading contents of this buffer the results correspond to
3197
    large colour permission), and writing ignored.
3266
    screen contents (with, generally speaking, large color
3198
    Exception is the mode 320*200, for which in main loop system thread the
3267
    resolution), and writing is ignored.
3199
    upgrade of the screen is fulfilled according to movements 
3268
    One exception is the mode 320*200, for which main loop of the
3200
    of a mouse pointer.
3269
    system thread updates the screen according to mouse movements.
3201
 
3270
 
3202
------------------------- Screen resolution --------------------------
3271
------------------------- Screen resolution --------------------------
Line 3203... Line 3272...
3203
Parameters:
3272
Parameters:
3204
  * eax = 61 - number of the function
3273
  * eax = 61 - function number
3205
  * ebx = 1 - number subfunction
3274
  * ebx = 1 - subfunction number
3206
Returned value:
3275
Returned value:
3207
  * eax = [permission on axis x] *65536 + [permission on axis y]
3276
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
3208
Remarks:
3277
Remarks:
3209
  * It is possible to use the function 14 that it returns sizes on 1 less.
3278
  * One can use function 14 paying attention that
3210
    It completely equivalent way.
3279
    it returns sizes on 1 pixel less. It is fully equivalent way.
3211
 
3280
 
3212
------------------------ Number bits on pixel ------------------------
3281
---------------------- Number of bits per pixel ----------------------
3213
Parameters:
3282
Parameters:
3214
  * eax = 61 - number of the function
3283
  * eax = 61 - function number
3215
  * ebx = 2 - number subfunction
3284
  * ebx = 2 - subfunction number
3216
Returned value:
3285
Returned value:
Line 3217... Line 3286...
3217
  * eax = number bits on pixel (24 or 32)
3286
  * eax = number of bits per pixel (24 or 32)
3218
 
3287
 
3219
------------------------ Number bytes on string ------------------------
3288
-------------------- Number of bytes per scanline --------------------
3220
Parameters:
3289
Parameters:
3221
  * eax = 61 - number of the function
3290
  * eax = 61 - function number
3222
  * ebx = 3 - number subfunction
3291
  * ebx = 3 - subfunction number
3223
Returned value:
3292
Returned value:
3224
  * eax = number bytes, which is occupied by one string of the scanning
3293
  * eax = number of bytes occupied by one scanline
3225
    (horizontal line on the screen)
3294
    (horizontal line on the screen)
3226
 
3295
 
3227
======================================================================
3296
======================================================================
3228
==== Function 62, subfunction 0 - get  version of PCI-interface. =====
3297
===== Function 62, subfunction 0 - get version of PCI-interface. =====
3229
======================================================================
3298
======================================================================
Line 3230... Line 3299...
3230
Parameters:
3299
Parameters:
3231
  * eax = 62 - number of the function
3300
  * eax = 62 - function number
3232
  * bl = 0 - number subfunction
3301
  * bl = 0 - subfunction number
3233
Returned value:
3302
Returned value:
3234
  * eax = -1 - access to PCI is prohibited; differently
3303
  * eax = -1 - PCI access is disabled; otherwise
3235
  * ah.al = version of  PCI-interface (ah=version, al=subversion)
3304
  * ah.al = version of PCI-interface (ah=version, al=subversion)
3236
  * high word eax contains a zero
3305
  * high word of eax is zeroed
3237
Remarks:
3306
Remarks:
3238
  * Low level access to PCI for applications subfunction 12
3307
  * Previously low-level access to PCI for applications must be
3239
    functions 21 previously should be allowed.
3308
    enabled by subfunction 12 of function 21.
3240
  * If PCI BIOS is not supported, the value ax is not defined.
3309
  * If PCI BIOS is not supported, the value of ax is undefined.
3241
 
3310
 
3242
======================================================================
3311
======================================================================
3243
==== Function 62, subfunction 1 - get number of last PCI-bus. ===
3312
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
-
 
3313
======================================================================
3244
======================================================================
3314
Parameters:
3245
Parameters:
3315
  * eax = 62 - function number
Line 3246... Line 3316...
3246
  * eax = 62 - number of the function
3316
  * bl = 1 - subfunction number
3247
  * bl = 1 - number subfunction
3317
Returned value:
3248
Returned value:
3318
  * eax = -1 - access to PCI is disabled; otherwise
3249
  * eax = -1 - access to PCI is prohibited; differently
3319
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3250
  * al = number of last PCI-bus; the stayed bits eax fail
3320
Remarks:
3251
Remarks:
3321
  * Previously low-level access to PCI for applications must be
3252
  * Low level access to PCI for applications subfunction 12
3322
    enabled by subfunction 12 of function 21.
3253
    functions 21 previously should be allowed.
3323
  * If PCI BIOS is not supported, the value of ax is undefined.
3254
  * If PCI BIOS is not supported, the value al is not defined.
3324
 
3255
 
3325
======================================================================
3256
======================================================================
3326
===================== Function 62, subfunction 2 =====================
3257
====================== Function 62, subfunction 2 ====================
3327
===== Get mechanism of addressing to the PCI configuration space. ====
3258
=========== Get mechanism of call to configuration space PCI. ========
3328
======================================================================
3259
======================================================================
3329
Parameters:
3260
Parameters:
3330
  * eax = 62 - function number
3261
  * eax = 62 - number of the function
3331
  * bl = 2 - subfunction number
3262
  * bl = 2 - number subfunction
3332
Returned value:
3263
Returned value:
3333
  * eax = -1 - access to PCI is disabled; otherwise
3264
  * eax = -1 - access to PCI is prohibited; differently
3334
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3265
  * al = mechanism (1 or 2); the other bits eax fail
3335
Remarks:
3266
Remarks:
3336
  * Previously low-level access to PCI for applications must be
3267
  * Low level access to PCI for applications subfunction 12
3337
    enabled by subfunction 12 of function 21.
3268
    functions 21 previously should be allowed.
3338
  * Addressing mechanism is selected depending on
3269
  * Mechanism of call is selected according to characteristics of equipment.
-
 
3270
  * Subfunctions of reading and writing automatically work with
3339
    equipment characteristics.
3271
    selected mechanism.
3340
  * Subfunctions of read and write work automatically
-
 
3341
    with the selected mechanism.
3272
 
3342
 
3273
======================================================================
3343
======================================================================
3274
========= Function 62, subfunction 4,5,6 - read PCI-register. ========
3344
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
-
 
3345
======================================================================
3275
======================================================================
3346
Parameters:
Line 3276... Line 3347...
3276
Parameters:
3347
  * eax = 62 - function number
3277
  * eax = 62 - number of the function
3348
  * bl = 4 - read byte
3278
  * bl = 4 - read bytes
3349
  * bl = 5 - read word
3279
  * bl = 5 - read a word
3350
  * bl = 6 - read dword
3280
  * bl = 6 - tread a double word
3351
  * bh = number of PCI-bus
3281
  * bh = number of PCI-bus
3352
  * ch = dddddfff, where ddddd = number of the device on the bus,
3282
  * ch = dddddfff, where ddddd = number of device on bus,
3353
    fff = function number of device
3283
    fff = number of function of device
3354
  * cl = number of register (must be even for bl=5,
3284
  * cl = number of the register (should be even for bl=5,
3355
    divisible by 4 for bl=6)
3285
    be divided on 4 for bl=6)
3356
Returned value:
3286
Returned value:
3357
  * eax = -1 - error (access to PCI is disabled or parameters
3287
  * eax = -1 - error (prohibited access to PCI
3358
    are not supported); otherwise
3288
    or unsupported parameters); differently
3359
  * al/ax/eax (depending on requested size) contains the data;
3289
  * al/ax/eax (depending on the requested size) contains the data;
3360
    the other part of register eax is destroyed
-
 
3361
Remarks:
3290
    the rest of the register eax fail
3362
  * Previously low-level access to PCI for applications must be
3291
Remarks:
3363
    enabled by subfunction 12 of function 21.
-
 
3364
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3292
  * Low level access to PCI for applications subfunction 12
3365
    function number. To get access mechanism use subfunction 2.
3293
    functions 21 previously should be allowed.
3366
  * Some registers are standard and exist for all devices, some are
3294
  * Access mechanism 2 supports only 16 devices on the bus and ignores number
3367
    defined by the concrete device. The list of registers of the
3295
    of the function. To receive an access mechanism it is possible by call
3368
    first type can be found e.g. in famous
3296
    subfunction 2.
3369
    Interrupt List by Ralf Brown
3297
  * Some registers are standard and exist for all devices, some are defined
3370
    (http://www.pobox.com/~ralf/files.html,
3298
    by the concrete device. The list first enters, for example, in known
-
 
3299
    Interrupt List by Ralf Brown
3371
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3300
    (http://www.pobox.com/~ralf/files.html,
3372
    registers of the second type must be listed
-
 
3373
    in the device documentation.
3301
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3374
 
3302
    list second should be indicated in documentation on the device.
3375
======================================================================
3303
 
3376
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3304
======================================================================
3377
======================================================================
3305
====== Function 62, subfunction 8,9,10 - write in PCI-register. ======
3378
Parameters:
3306
======================================================================
3379
  * eax = 62 - function number
3307
Parameters:
3380
  * bl = 8 - write byte
3308
  * eax = 62 - number of the function
3381
  * bl = 9 - write word
3309
  * bl = 8 - write bytes
3382
  * bl = 10 - write dword
3310
  * bl = 9 - write a word
3383
  * bh = number of PCI-bus
3311
  * bl = 10 - write a double word
3384
  * ch = dddddfff, where ddddd = number of the device on the bus,
3312
  * bh = number of PCI-bus
3385
    fff = function number of device
3313
  * ch = dddddfff, where ddddd = number of the device on bus,
3386
  * cl = number of register (must be even for bl=9,
3314
    fff = number of  function of device
3387
    divisible by 4 for bl=10)
3315
  * cl = number of register (should be even for bl=9,
3388
  * dl/dx/edx (depending on requested size) contatins
3316
    be divided on 4 for bl=10)
3389
    the data to write
3317
  * dl/dx/edx (depending on requested size) contains given for writing
3390
Returned value:
3318
Returned value:
3391
  * eax = -1 - error (access to PCI is disabled or parameters
3319
  * eax = -1 - error (prohibited access to PCI or unsupported parameters)
3392
    are not supported)
3320
  * eax = 0 - successfully
3393
  * eax = 0 - success
3321
Remarks:
3394
Remarks:
3322
  * Low level access to PCI for applications subfunction 12
3395
  * Previously low-level access to PCI for applications must be
3323
    functions 21 previously should be allowed.
3396
    enabled by subfunction 12 of function 21.
3324
  * Access mechanism 2 supports only 16 devices on the bus and ignores number
-
 
Line 3325... Line 3397...
3325
    of the function. To receive an access mechanism it is possible by call
3397
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3326
    subfunction 2.
3398
    function number. To get access mechanism use subfunction 2.
3327
  * Some registers are standard and exist for all devices, some are defined
3399
  * Some registers are standard and exist for all devices, some are
3328
    by the concrete device. The list first enters, for example, in known
3400
    defined by the concrete device. The list of registers of the
3329
    Interrupt List by Ralf Brown;
3401
    first type can be found e.g. in famous Interrupt List by
3330
    list second should be indicated in documentation on the device.
3402
    Ralf Brown; registers of the second type must be listed
3331
 
3403
    in the device documentation.
3332
======================================================================
3404
 
3333
============== Function 63 - work with debugging board. ==============
3405
======================================================================
3334
======================================================================
3406
============== Function 63 - work with the debug board. ==============
3335
Debugging board represents the system buffer (on 512 bytes), in which any
-
 
3336
program can write (generally speaking, arbitrary) data and from which other
3407
======================================================================
3337
program can these data read.
3408
The debug board is the global system buffer (with the size
3338
There is an agreement, according to which written given - text strings
3409
512 bytes), to which any program can write (generally speaking,
3339
interpreted as of the debug message on a course of execution of the program.
3410
arbitrary) data and from which other program can read these data.
Line 3340... Line 3411...
3340
The kernel in the defined situations also writes to board of debugging of the
3411
By the agreement written data are text strings interpreted as
3341
item of information about execution of some functions; under the agreement of
3412
debug messages on a course of program execution. The kernel in
3342
the message of a kernel start with the prefix " K: ".
3413
some situations also writes to the debug board information on
3343
For review of board of debugging the application board is created which reads
3414
execution of some functions; by the agreement kernel messages
3344
out the data from the buffer and displays them in the window. board understands
3415
begins from the prefix "K : ".
3345
a sequence of codes 13,10 as transition on new string
3416
For view of the debug board the application 'board' was created,
3346
Character with the zero code at the end of string is not mandatory,
3417
which reads data from the buffer and displays them in its window.
3347
but also does not prevent.
3418
'board' interpretes the sequence of codes 13,10 as newline.
Line 3348... Line 3419...
3348
As has appeared of the debugger necessity of board of debugging a little has
3419
A character with null code in an end of line is not necessary,
3349
decreased, as the debugger allows completely to inspect a course of execution
3420
but also does not prevent.
3350
of the program, and for this purpose it is not required of any efforts on the
3421
Because debugger has been written, the value of the debug board
3351
part of the  program. Nevertheless in many cases the board of debugging
3422
has decreased, as debugger allows to inspect completely a course of
3352
continues to remain useful.
3423
program execution without any efforts from the direction of program
3353
 
3424
itself. Nevertheless in some cases the debug board is still useful.
3354
---------------------------- Writing of byte ----------------------------
3425
 
3355
Parameters:
3426
----------------------------- Write byte -----------------------------
3356
  * eax = 63 - number of the function
3427
Parameters:
3357
  * ebx = 1 - number subfunction
3428
  * eax = 63 - function number
3358
  * cl = bytes of data
3429
  * ebx = 1 - subfunction number
3359
Returned value:
3430
  * cl = data byte
3360
  * function does not return value
3431
Returned value:
Line 3361... Line 3432...
3361
Remarks:
3432
  * function does not return value
3362
  * Byte is written in buffer. Length of buffer - 512 bytes.
3433
Remarks:
3363
    At overflow of the buffer all obtained data are lost also filling
3434
  * Byte is written to the buffer. Buffer size is 512 bytes.
3364
    starts again with zero.
3435
    At buffer overflow all obtained data are lost.
3365
  * For output to board of debugging of more complex objects (strings, numbers)
3436
  * For output to the debug board of more complicated objects
Line 3366... Line 3437...
3366
    this function called in cycle suffices. It is possible to not write
3437
    (strings, numbers) it is enough to call this function in cycle.
3367
    manually appropriate code, and to take advantage of the file debug.inc,
3438
    It is possible not to write the appropriate code manually and use
3368
    included in the distribution kit.
3439
    file 'debug.inc', which is included into the distributive.
3369
 
3440
 
3370
---------------------------- Reading of byte ----------------------------
3441
----------------------------- Read byte ------------------------------
3371
Takes away bytes from the buffer.
3442
Takes away byte from the buffer.
3372
Parameters:
3443
Parameters:
3373
  * eax = 63 - number of the function
3444
  * eax = 63 - function number
3374
  * ebx = 2 - number subfunction
3445
  * ebx = 2 - subfunction number
Line 3375... Line 3446...
3375
Returned value:
3446
Returned value:
3376
  * eax = ebx = 0 - buffer is empty
3447
  * eax = ebx = 0 - the buffer is empty
3377
  * eax = bytes, ebx = 1 - bytes successfully is read
3448
  * eax = byte, ebx = 1 - byte was successfully read
3378
 
3449
 
3379
======================================================================
3450
======================================================================
3380
========== Function 64 - reallocate memory of application. ==========
3451
============== Function 64 - resize application memory. ==============
Line 3381... Line 3452...
3381
======================================================================
3452
======================================================================
3382
Parameters:
3453
Parameters:
3383
  * eax = 64 - number of the function
3454
  * eax = 64 - function number
3384
  * ebx = 1 - sole subfunction
3455
  * ebx = 1 - unique subfunction
3385
  * ecx = new size of memory
3456
  * ecx = new memory size
3386
Returned value:
3457
Returned value:
3387
  * eax = 0 - successfully
3458
  * eax = 0 - success
3388
  * eax = 1 - not enough of memory
3459
  * eax = 1 - not enough memory
3389
Remarks:
3460
Remarks:
3390
  * At present this function is a sole resource for dynamic
3461
  * At the moment this function is a sole resource for dynamic
3391
    allocation/free of memory for application.
3462
    allocation/free of application memory.
3392
 
3463
 
3393
======================================================================
3464
======================================================================
3394
================= Function 66 - work with keyboard. =================
3465
================== Function 66 - work with keyboard. =================
3395
======================================================================
3466
======================================================================
3396
Mode of input influences results of reading of keys by function 2.
3467
The input mode influences results of reading keys by function 2.
3397
At program loading for it ASCII-mode of input is installed.
3468
When a program loads, ASCII input mode is set for it.
3398
 
3469
 
-
 
3470
-------------- Subfunction 1 - set keyboard input mode. --------------
3399
-------- Subfunction 1 - install a keyboard mode. ---------
3471
Parameters:
3400
Parameters:
3472
  * eax = 66 - function number
3401
  * eax = 66 - number of the function
3473
  * ebx = 1 - subfunction number
3402
  * ebx = 1 - number subfunction
3474
  * ecx = mode:
3403
  * ecx = mode:
3475
    * 0 = normal (ASCII-characters)
3404
    * 0 = normal (ASCII-characters)
3476
    * 1 = scancodes
3405
    * 1 = scancodes
3477
Returned value:
3406
Returned value:
3478
  * function does not return value
3407
  * function does not return value
3479
 
3408
 
3480
-------------- Subfunction 2 - get keyboard input mode. --------------
3409
--------- Subfunction 2 - get a keyboard mode. ----------
3481
Parameters:
3410
Parameters:
3482
  * eax = 66 - function number
3411
  * eax = 66 - number of the function
3483
  * ebx = 2 - subfunction number
3412
  * ebx = 2 - number subfunction
3484
Returned value:
3413
Returned value:
3485
  * eax = current mode
3414
  * eax = current mode
3486
 
3415
 
3487
------------ Subfunction 3 - get status of control keys. -------------
3416
------- Subfunction 3 - get a status of direction keys. --------
3488
Parameters:
3417
Parameters:
3489
  * eax = 66 - function number
3418
  * eax = 66 - number of the function
3490
  * ebx = 3 - subfunction number
3419
  * ebx = 3 - number subfunction
3491
Returned value:
3420
Returned value:
3492
  * eax = bit mask:
3421
  * eax = bit mask:
3493
  * bit 0 (mask 1): left Shift is pressed
3422
  * Bit 0 (mask 1): left Shift is pressed
3494
  * bit 1 (mask 2): right Shift is pressed
3423
  * Bit 1 (mask 2): right Shift is pressed
3495
  * bit 2 (mask 4): left Ctrl is pressed
3424
  * Bit 2 (mask 4): left Ctrl is pressed
3496
  * bit 3 (mask 8): right Ctrl is pressed
3425
  * Bit 3 (mask 8): right Ctrl is pressed
3497
  * bit 4 (mask 0x10): left Alt is pressed
-
 
3498
  * bit 5 (mask 0x20): right Alt is pressed
3426
  * Bit 4 (mask 0x10): left Alt is pressed
3499
  * bit 6 (mask 0x40): CapsLock is on
3427
  * Bit 5 (mask 0x20): right Alt is pressed
3500
  * bit 7 (mask 0x80): NumLock is on
3428
  * Bit 6 (mask 0x40): CapsLock is included
3501
  * bit 8 (mask 0x100): ScrollLock is on
3429
  * Bit 7 (mask 0x80): NumLock is included
3502
  * other bits are cleared
3430
  * Bit 8 (mask 0x100): ScrollLock is included
3503
 
3431
  * The other bits are reset
3504
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3432
 
3505
When hotkey is pressed, the system notifies only those applications,
3433
----- Subfunction 4 - install common system "hotkey". -----
3506
which have installed it; the active application (which receives
3434
Applications which have installed it are informed only on pressing "hotkey";
3507
all normal input) does not receive such keys.
3435
the active application (to which acts all normal input) such keys does not get.
3508
The notification consists in sending event with the code 2.
3436
Notice consists in sending event with the code 2.
3509
Reading hotkey is the same as reading normal key - by function 2.
-
 
3510
Parameters:
3437
To read "hotkey" it is possible the same as also usual, - function 2.
3511
  * eax = 66 - function number
3438
Parameters:
3512
  * ebx = 4 - subfunction number
-
 
3513
  * cl determines key scancode;
Line 3439... Line 3514...
3439
  * eax = 66 - number of the function
3514
    use cl=0 to give combinations such as Ctrl+Shift
3440
  * ebx = 4 - number subfunction
3515
  * edx = 0xXYZ determines possible states of control keys:
3441
  * cl sets scancode of the key;
3516
    * Z (low 4 bits) determines state of LShift and RShift:
3442
    ãse cl=0 for definition of combinations of a type Ctrl+Shift
3517
      * 0 = no key must be pressed;
3443
  * edx = 0xXYZ ûets possible statuses of direction keys:
3518
      * 1 = exactly one key must be pressed;
3444
    * Z (low 4 bits) are set by a status of keys LShift and RShift:
3519
      * 2 = both keys must be pressed;
3445
      * 0 = any of keys should not be pressed;
3520
      * 3 = must be pressed LShift, but not RShift;
3446
      * 1 = only one of keys is should be pressed;
3521
      * 4 = must be pressed RShift, but not LShift
3447
      * 2 = both keys should be pressed;
3522
    * Y - similar for LCtrl and RCtrl;
3448
      * 3 = should be pressed LShift, but not RShift;
3523
    * X - similar for LAlt and RAlt
3449
      * 4 = should be pressed RShift, but not LShift
3524
Returned value:
3450
    * Y - is similar for LCtrl and RCtrl;
3525
  * eax=0 - success
3451
    * X - is similar for LAlt and RAlt
3526
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3452
Returned value:
3527
Remarks:
3453
  * eax=0 - successfully
3528
  * Hotkey can work either at pressing or at release. Release
3454
  * eax=1 - too much "hotkey" is admitted (maximal 256)
3529
    scancode of a key is more on 128 than pressing scancode
3455
Remarks:
3530
    (i.e. high bit is set).
3456
  * Hotkey can work either at pressing, or at release. Scancode of release
3531
  * Several applications can set the same combination;
3457
    of the key on 128 it is more, than scancode of pressing
3532
    all such applications will be informed on pressing
3458
    (i.e. high bit is installed).
3533
    such combination.
3459
  * Some applications can install the same combination; all such applications
3534
 
3460
    will be informed on pressing such combination.
3535
-------------- Subfunction 5 - delete installed hotkey. --------------
3461
 
3536
Parameters:
Line 3462... Line 3537...
3462
------ Subfunction 5 - delete installed "hotkey". -------
3537
  * eax = 66 - function number
3463
Parameters:
3538
  * ebx = 5 - subfunction number
3464
  * eax = 66 - number of the function
3539
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3465
  * ebx = 5 - number subfunction
3540
Returned value:
3466
  * cl = scancode of key and edx = 0xXYZ same, as well as in subfunction 4
3541
  * eax = 0 - success
3467
Returned value:
3542
  * eax = 1 - there is no such hotkey
3468
  * eax = 0 - successfully
3543
Remarks:
3469
  * eax = 1 - there is no such hotkey
3544
  * When a process/thread terminates, all hotkey installed by it are
3470
Remarks:
3545
    deleted.
Line 3471... Line 3546...
3471
  * At completion of process / thread all hotkey, installed by it are deleted.
3546
  * The call to this subfunction does not affect other applications.
3472
  * Function call does not influence other applications. If other application
3547
    If other application has defined the same combination, it will
3473
    has defined same combination, it will receive still notices.
-
 
3474
 
3548
    still receive notices.
3475
======================================================================
3549
 
3476
============ Function 67 - change location/sizes of window. ===========
3550
======================================================================
3477
======================================================================
3551
========= Function 67 - change position/sizes of the window. =========
3478
Parameters:
3552
======================================================================
3479
  * eax = 67 - number of the function
-
 
3480
  * ebx = new x-coordinate of the window
3553
Parameters:
3481
  * ecx = new y-coordinate of the window
3554
  * eax = 67 - function number
3482
  * edx = new x-size of the window
3555
  * ebx = new x-coordinate of the window
3483
  * esi = new y-size of the window
3556
  * ecx = new y-coordinate of the window
3484
Returned value:
3557
  * edx = new x-size of the window
Line 3485... Line 3558...
3485
  * function does not return value
3558
  * esi = new y-size of the window
3486
Remarks:
3559
Returned value:
3487
  * Value -1 for the parameter means "to not change"; for example, for moving
3560
  * function does not return value
3488
    the window without resizing it is possible to specify edx=esi =-1.
3561
Remarks:
3489
  * Previously window should be defined by the function 0.
3562
  * The value -1 for a parameter means "do not change"; e.g. to move
3490
    It sets initial coordinates and sizes of the window.
3563
    the window without resizing it is possible to specify edx=esi=-1.
3491
  * Sizes of the window are understood in sense of the function 0,
3564
  * Previously the window must be defined by function 0.
3492
    i.e. on one pixel it is less, than real sizes.
3565
    It sets initial coordinates and sizes of the window.
3493
  * Function call for the maximized windows is simple ignored.
3566
  * Sizes of the window are understood in sense of function 0,
3494
  * For windows of appropriate styles a location and/or the sizes can be
3567
    that is one pixel less than real sizes.
3495
    changed by the user; current a location and the sizes can be obtained
3568
  * The function call for maximized windows is simply ignored.
3496
    by function call 9.
3569
  * For windows of appropriate styles position and/or sizes can be
3497
  * Function dispatches to window event redraw (with the code 1).
3570
    changed by user; current position and sizes can be obtained by
3498
 
3571
    call to function 9.
3499
======================================================================
3572
  * The function sends to the window redraw event (with the code 1).
3500
== Function 68, subfunction 0 - get the counter of task switchings. ==
3573
 
3501
======================================================================
3574
======================================================================
3502
Parameters:
3575
====== Function 68, subfunction 0 - get the task switch counter. =====
3503
  * eax = 68 - number of the function
3576
======================================================================
3504
  * ebx = 0 - number subfunction
3577
Parameters:
3505
Returned value:
3578
  * eax = 68 - function number
Line 3506... Line 3579...
3506
  * eax = number of task switchings from the moment of loading the system
3579
  * ebx = 0 - subfunction number
3507
   (modulo 2^32)
3580
Returned value:
3508
 
3581
  * eax = number of task switches from the system booting
3509
======================================================================
3582
    (modulo 2^32)
3510
====================== Function 68, subfunction 1 ====================
3583
 
3511
=========== To switch to the following thread of execution. ==========
3584
======================================================================
-
 
3585
======= Function 68, subfunction 1 - switch to the next thread. ======
3512
======================================================================
3586
======================================================================
3513
Function completes a current time slice allocated to stream,
3587
The function completes the current time slice allocated to the
3514
and switches to the following.(What thread what process will be by the
3588
thread and switches to the next. (Which thread in which process
3515
following, to predict it is impossible).
3589
will be next, is unpredictable). Later, when execution queue
3516
Later, when up to current thread queue will reach,
3590
will reach the current thread, execution will be continued.
3517
the execution will be restored.
3591
Parameters:
3518
Parameters:
3592
  * eax = 68 - function number
3519
  * eax = 68 - number of the function
3593
  * ebx = 1 - subfunction number
3520
  * ebx = 1 - number subfunction
3594
Returned value:
3521
Returned value:
3595
  * function does not return value
3522
  * function does not return value
3596
 
-
 
3597
======================================================================
3523
 
3598
============= Function 68, subfunction 2 - cache + rdpmc. ============
3524
======================================================================
3599
======================================================================
3525
============ Function 68, subfunction 2 - cache + rdpmc. =============
3600
Parameters:
-
 
3601
  * eax = 68 - function number
3526
======================================================================
3602
  * ebx = 2 - subfunction number
3527
Parameters:
3603
  * ecx = required action:
3528
  * eax = 68 - number of the function
3604
    * ecx = 0 - enable instruction 'rdpmc'
3529
  * ebx = 2 - number subfunction
3605
      (ReaD Performance-Monitoring Counters) for applications
3530
  * ecx = required operation:
3606
    * ecx = 1 - find out whether cache is disabled/enabled
3531
    * ecx = 0 - to permit execution of the instruction rdpmc
3607
    * ecx = 2 - enable cache
3532
      (ReaD Performance-Monitoring Counters)
3608
    * ecx = 3 - disable cache
-
 
3609
Returned value:
3533
    * ecx = 1 - find out, enabled/disabled cache
3610
  * for ecx=0:
3534
    * ecx = 2 - enabled cache
3611
    * eax = the value of cr4
3535
    * ecx = 3 - disabled cache
3612
  * for ecx=1:
3536
Returned value:
3613
    * eax = (cr0 and 0x60000000):
3537
  * for ecx=0:
3614
    * eax = 0 - cache is on
3538
    * eax = value cr4
3615
    * eax <> 0 - cache is off
3539
  * for ecx=1:
3616
  * for ecx=2 and ecx=3:
3540
    * eax = (cr0 and 0x60000000):
3617
    * function does not return value
3541
    * eax = 0 - cache enabled
3618
 
3542
    * eax <> 0 - cache disabled
3619
======================================================================
3543
  * for ecx=2 and ecx=3:
3620
=========== Function 68, subfunction 3 - read MSR-register. ==========
3544
    * function does not return value
3621
======================================================================
-
 
3622
MSR = Model Specific Register; the complete list of MSR-registers
3545
 
3623
of a processor is included to the documentation on it (for example,
3546
======================================================================
3624
IA-32 Intel Architecture Software Developer's Manual,
3547
=========== Function 68, subfunction 3 - read MSR-register. ==========
3625
Volume 3, Appendix B); each processor family has its own subset
-
 
3626
of the MSR-registers.
Line 3548... Line 3627...
3548
======================================================================
3627
Parameters:
3549
MSR = Model Specific Register; the complete list of the MSR-registers of the
3628
  * eax = 68 - function number
3550
processor contains in documentation on the processor (for example, IA-32 Intel
3629
  * ebx = 3 - subfunction number
3551
Architecture Software Developer's Manual, Volume 3, Appendix B); each set of
3630
  * ecx is ignored
3552
processors has the subset of the MSR-registers.
3631
  * edx = MSR address
3553
Parameters:
3632
Returned value:
3554
  * eax = 68 - number of the function
3633
  * ebx:eax = high:low dword of the result
3555
  * ebx = 3 - number subfunction
3634
Remarks:
3556
  * ecx ignored
3635
  * If ecx contains nonexistent or not implemented for this processor
3557
  * edx = address MSR
3636
    MSR, processor will generate an exception in the kernel, which
3558
Returned value:
3637
    will kill the thread.
3559
  * ebx:eax = high:low dword of result
3638
  * Previously it is necessary to check, whether MSRs are supported
3560
Remarks:
3639
    as a whole, with the instruction 'cpuid'. Otherwise processor
3561
  * Instruction in ecx nonexistent or non-realized for of the given processor
3640
    will generate other exception in the kernel, which will anyway
3562
    MSR will entail exception in a kernel, which will kill thread.
3641
    kill the thread.
3563
  * Previously it is necessary to define, whether are supported MSR as a whole,
3642
 
3564
    command cpuid. Differently there will be already other exception in a
3643
======================================================================
-
 
3644
========= Function 68, subfunction 4 - write to MSR-register. ========
3565
    kernel, which all the same will kill thread.
3645
======================================================================
Line 3566... Line 3646...
3566
 
3646
MSR = Model Specific Register; the complete list of MSR-registers
3567
======================================================================
3647
of a processor is included to the documentation on it (for example,
3568
========= Function 68, subfunction 4 - çàïèñàòü â MSR-ðåãèñòð. =========
3648
IA-32 Intel Architecture Software Developer's Manual,
3569
======================================================================
3649
Volume 3, Appendix B); each processor family has its own subset
3570
MSR = Model Specific Register; the complete list of the MSR-registers of the
3650
of the MSR-registers.
3571
processor contains in documentation on the processor (for example, IA-32 Intel
3651
Parameters:
3572
Architecture Software Developer's Manual, Volume 3, Appendix B); each set of
3652
  * eax = 68 - function number
3573
processors has the subset of the MSR-registers.
3653
  * ebx = 4 - subfunction number
3574
Parameters:
3654
  * ecx is ignored
3575
  * eax = 68 - number of the function
3655
  * edx = MSR address
3576
  * ebx = 4 - number subfunction
3656
  * esi:edi = high:low dword
3577
  * ecx ignored
3657
Returned value:
3578
  * edx = address MSR
3658
  * ebx:eax = copy of esi:edi
3579
  * esi:edi = high:low dword of result
3659
Çàìå÷àíèÿ:
3580
Returned value:
3660
  * If ecx contains nonexistent or not implemented for this processor
Line 3581... Line 3661...
3581
  * ebx:eax = copy esi:edi
3661
    MSR, processor will generate an exception in the kernel, which
3582
Remarks:
3662
    will kill the thread.
3583
  * Instruction in ecx nonexistent or non-realized for of the given processor
3663
  * Previously it is necessary to check, whether MSRs are supported
3584
    MSR will entail exception in a kernel, which will kill thread.
3664
    as a whole, with the instruction 'cpuid'. Otherwise processor
3585
  * Previously it is necessary to define, whether are supported MSR as a whole,
3665
    will generate other exception in the kernel, which will anyway
3586
    command cpuid. Differently there will be already other exception in a
3666
    kill the thread.
3587
    kernel, which all the same will kill thread.
3667
 
3588
 
3668
======================================================================
3589
======================================================================
3669
======= Function 68, subfunction 5 - allocate physical memory. =======
3590
======= Function 68, subfunction 5 - allocate physical memory. =======
3670
======================================================================
3591
======================================================================
3671
Parameters:
3592
Parameters:
3672
  * eax = 68 - function number
3593
  * eax = 68 - number of the function
3673
  * ebx = 5 - subfunction number
3594
  * ebx = 5 - number subfunction
3674
  * ecx = size (in bytes)
3595
  * ecx = size (in bytes)
3675
Returned value:
3596
Returned value:
3676
  * eax = physical address of allocated memory
3597
  * eax = physical address of allocated memory
3677
Remarks:
3598
Remarks:
3678
  * Normal applications must not use this function, it is intended
3599
  * Usual applications should not use this function, it is intended for of a
3679
    for the case, when for some device it is required to place
Line 3600... Line 3680...
3600
    case, when by operation with any device it is required to place the data
3680
    data to the known physical address. (In effect, this function
3601
    to the known physical address. (In effect, this function was developed for
3681
    was developed for AC97WAV.)
3602
    AC97WAV.)
3682
  * The number of blocks of physical memory is limited (by constant
3603
  * Number of blocks of the actual storage is limited (constant 24, and this
3683
    24, and this constant includes some blocks for kernel).
3604
    constant includes and some memories for of needs of a kernel).
3684
  * To free a memory allocated by such way use
3605
  * Free allocated memory it is possible subfunction 6, in copying data
3685
    subfunction 6, to copy data there and back
3606
    there/back are engaged subfunction 7 and 8.
3686
    use subfunctions 7 and 8.
3607
 
3687
 
3608
======================================================================
3688
======================================================================
3609
========= Function 68, subfunction 6 - free physical memory. =========
3689
========= Function 68, subfunction 6 - free physical memory. =========
3610
======================================================================
3690
======================================================================
3611
Parameters:
3691
Parameters:
3612
  * eax = 68 - number of the function
3692
  * eax = 68 - function number
3613
  * ebx = 6 - number subfunction
3693
  * ebx = 6 - subfunction number
3614
  * ecx = physical address of memory
3694
  * ecx = physical address of memory
3615
Returned value:
3695
Returned value:
3616
  * function does not return value
3696
  * function does not return value
3617
Remarks:
3697
Remarks:
3618
  * Usual applications should not use this function, it is intended for of a
3698
  * Normal applications must not use this function, it is intended
Line 3619... Line 3699...
3619
    case, when by operation with any device it is required to place the data
3699
    for the case, when for some device it is required to place
3620
    to the known physical address. (In effect, this function was developed for
3700
    data to the known physical address. (In effect, this function
3621
    AC97WAV.)
3701
    was developed for AC97WAV.)
3622
  * Memory should be earlier allocated subfunction 5.
3702
  * The memory must be previously allocated by subfunction 5.
3623
 
3703
 
-
 
3704
======================================================================
3624
======================================================================
3705
===== Function 68, subfunction 7 - write data to physical memory. ====
-
 
3706
======================================================================
3625
==== Function 68, subfunction 7 - write data in physical memory. =====
3707
Parameters:
3626
======================================================================
3708
  * eax = 68 - function number
3627
Parameters:
3709
  * ebx = 7 - subfunction number
3628
  * eax = 68 - number of the function
3710
  * ecx = physical address
3629
  * ebx = 7 - number subfunction
3711
  * edx = pointer to the data (in the application)
3630
  * ecx = physical address
3712
  * esi = size of the data (in bytes)
3631
  * edx = pointer on data (in application)
3713
Returned value:
3632
  * esi = data size (in bytes)
3714
  * function does not return value
3633
Returned value:
3715
Remarks:
3634
  * function does not return value
3716
  * Normal applications must not use this function, it is intended
3635
Remarks:
3717
    for the case, when for some device it is required to place
3636
  * Usual applications should not use this function, it is intended for of a
3718
    data to the known physical address. (In effect, this function
3637
    case, when by operation with any device it is required to place the data
3719
    was developed for AC97WAV.)
3638
    to the known physical address. (In effect, this function was developed for
3720
  * The range of physical addresses should lie inside of previously
3639
    AC97WAV.)
3721
    allocated by subfunction 5 block of physical memory.
3640
  * Range of physical addresses should lay inside allocated subfunction 5
3722
  * There is no check for correctness.
3641
    blocks of physical memory.
3723
 
3642
  * Checks of a correctness is not made.
3724
======================================================================
3643
 
3725
==== Function 68, subfunction 8 - read data from physical memory. ====
3644
======================================================================
3726
======================================================================
3645
==== Function 68, subfunction 8 - read data from physical memory. ====
3727
Parameters:
3646
======================================================================
3728
  * eax = 68 - function number
3647
Parameters:
3729
  * ebx = 8 - subfunction number
Line 3648... Line 3730...
3648
  * eax = 68 - number of the function
3730
  * ecx = physical address
3649
  * ebx = 8 - number subfunction
3731
  * edx = pointer to buffer for data (in application)
3650
  * ecx = physical address
3732
  * esi = size of data (in bytes)
3651
  * edx = pointer on buffer for data (in application)
3733
Returned value:
3652
  * esi = data size (in bytes)
3734
  * function does not return value
3653
Returned value:
3735
Remarks:
3654
  * function does not return value
3736
  * Normal applications must not use this function, it is intended
3655
Remarks:
3737
    for the case, when for some device it is required to place
3656
  * Usual applications should not use this function, it is intended for of a
3738
    data to the known physical address. (In effect, this function
3657
    case, when by operation with any device it is required to place the data
3739
    was developed for AC97WAV.)
3658
    to the known physical address. (In effect, this function was developed for
3740
  * The range of physical addresses should lie inside of previously
3659
    AC97WAV.)
3741
    allocated by subfunction 5 block of physical memory.
3660
  * Range of physical addresses should lay inside allocated subfunction 5
3742
  * There is no check for correctness.
3661
    blocks of physical memory.
3743
 
Line 3662... Line 3744...
3662
  * Checks of a correctness is not made.
3744
======================================================================
3663
 
-
 
3664
======================================================================
3745
====================== Fucntion 69 - debugging. ======================
3665
====================== Function 69 - debugging. ======================
3746
======================================================================
3666
======================================================================
3747
A process can load other process as debugged by set of corresponding
3667
Process can load other process as debugged by installation of appropriate bit
3748
bit by call to subfunction 16 of function 58
3668
by call subfunction 16 functions 58. Process can have only one debugger;
3749
or subfunction 7 of function 70.
3669
one process can debug some processes. System notifies the debugger on events
3750
A process can have only one debugger; one process can debug some
3670
occurring to the debugged process. Messages are written in the buffer defined
3751
others. The system notifies debugger on events occuring with
3671
subfunction 0.
3752
debugged process. Messages are written to the buffer defined by
3672
Ôîðìàò ñîîáùåíèÿ:
3753
subfunction 0.
3673
  +0: dword: the code of the message
3754
Format of a message:
3674
  +4: dword: PID of the debugged process
3755
  * +0: dword: message code
3675
  +8: there can be additional data defined by the code of the message
3756
  * +4: dword: PID of debugged process
3676
Codes of messages:
3757
  * +8: there can be additional data depending on message code
3677
  * 1 = exception
3758
Message codes:
3678
    * in addition transfers dword-number of exception
3759
  * 1 = exception
3679
    * process is paused
3760
    * in addition dword-number of the exception is given
3680
  * 2 = process was completed
3761
    * process is suspended
3681
    * comes at any completion: both through the system function -1,
3762
  * 2 = process has terminated
3682
      and at "murder" by any other process (including debugger)
3763
    * comes at any termination: both through the system function -1,
3683
  * 3 = debug exception int 1 = #DB
3764
      and at "murder" by any other process (including debugger itself)
3684
    * in addition transfers a dword-image of the register DR6:
3765
  * 3 = debug exception int 1 = #DB
Line 3685... Line 3766...
3685
      * Bits 0-3: the condition of appropriate breakpoint
3766
    * in addition dword-image of the register DR6 is given:
3686
        (installed subfunction 9) is fulfilled
3767
      * bits 0-3: condition of the corresponding breakpoint (set by
3687
      * Bit 14: the exception has taken place because of the mode of step
3768
        subfunction 9) is satisfied
3688
        tracing (the flag TF is installed)
3769
      * áèò 14: exception has occured because of the trace mode
3689
    * process is paused
3770
        (flag TF is set TF)
3690
At completion of the debugger all debugged processes are killed.
3771
    * process is suspended
3691
If the debugger it does not want, it should previously be disabled
3772
When debugger terminates, all debugged processes are killed.
3692
subfunction 3.
3773
If debugger does not want this, it must previously detach by
3693
 
3774
subfunction 3.
-
 
3775
 
3694
All subfunction are applicable only to the processes/threads started from
3776
All subfunctions are applicable only to processes/threads started
3695
current function 58 with a installed  debugging flag.
3777
from the current by function 58 or 70 with set debugging flag.
3696
Debugging of multithread programs is not supported yet.
3778
Debugging of multithreaded programs is not supported yet.
3697
Full list subfunctions:
3779
The full list of subfunctions:
3698
  * subfunction 0 - define area given for of debug messages
3780
  * subfunction 0 - define data area for debug messages
3699
  * subfunction 1 - get a status of the registers debugged thread
3781
  * subfunction 1 - get contents of registers of debugged thread
3700
  * subfunction 2 - install a status of the registers debugged thread
3782
  * subfunction 2 - set contents of registers of debugged thread
3701
  * subfunction 3 - disabled from the debugged process
3783
  * subfunction 3 - detach from debugged process
Line 3751... Line 3833...
3751
  * +24 = +0x18: dword: esp
3833
  * +24 = +0x18: dword: esp
3752
  * +28 = +0x1C: dword: ebp
3834
  * +28 = +0x1C: dword: ebp
3753
  * +32 = +0x20: dword: esi
3835
  * +32 = +0x20: dword: esi
3754
  * +36 = +0x24: dword: edi
3836
  * +36 = +0x24: dword: edi
3755
Remarks:
3837
Remarks:
3756
  * If thread fulfils the code of a ring-0, the status of the registers
3838
  * If the thread executes code of ring-0, the function returns
3757
    of a ring-3 comes back.
3839
    contents of registers of ring-3.
3758
  * Process should be loaded for of debugging (as is indicated in
3840
  * Process must be loaded for debugging (as is shown in
3759
    the common description).
3841
    general description).
Line 3760... Line 3842...
3760
 
3842
 
3761
======================================================================
3843
======================================================================
3762
====================== Function 69, subfunction 2 ======================
3844
===================== Function 69, subfunction 2 =====================
3763
======== Install a status of the registers debugged thread. ========
3845
============ Set contents of registers of debugged thread. ===========
3764
======================================================================
3846
======================================================================
3765
Parameters:
3847
Parameters:
3766
  * eax = 69 - number of the function
3848
  * eax = 69 - function number
3767
  * ebx = 2 - number subfunction
3849
  * ebx = 2 - subfunction number
3768
  * ecx = thread identifier
3850
  * ecx = thread identifier
3769
  * edx = length of structure of a context, should be 0x28=40 bytes
3851
  * edx = size of context structure, must be 0x28=40 bytes
3770
Returned value:
3852
Returned value:
3771
  * function does not return value
3853
  * function does not return value
-
 
3854
Format of context structure is shown in the description of
3772
Format of structure of a context is indicated in the description subfunction 1.
3855
subfunction 1.
3773
Remarks:
3856
Remarks:
3774
  * If thread fulfils the code of a 0-ring, the status of the registers
3857
  * If the thread executes code of ring-0, the function returns
3775
    of a 3-ring is installed.
3858
    contents of registers of ring-3.
3776
  * Process should be loaded for of debugging (as is indicated in
3859
  * Process must be loaded for debugging (as is shown in
Line 3777... Line 3860...
3777
    the common description).
3860
    general description).
3778
 
3861
 
3779
======================================================================
3862
======================================================================
3780
== Function 69, subfunction 3 - disabled from the debugged process. ==
3863
===== Function 69, subfunction 3 - detach from debugged process. =====
3781
======================================================================
3864
======================================================================
3782
Parameters:
3865
Parameters:
3783
  * eax = 69 - number of the function
3866
  * eax = 69 - function number
3784
  * ebx = 3 - number subfunction
3867
  * ebx = 3 - subfunction number
3785
  * ecx = identifier
3868
  * ecx = identifier
3786
Returned value:
3869
Returned value:
3787
  * function does not return value
3870
  * function does not return value
Line 3788... Line 3871...
3788
Remarks:
3871
Remarks:
3789
  * If the process was paused, it restores execution.
3872
  * If the process was suspended, it resumes execution.
3790
 
3873
 
3791
======================================================================
3874
======================================================================
3792
======== Function 69, subfunction 4 - paused debugged thread. ========
3875
======== Function 69, subfunction 4 - suspend debugged thread. =======
3793
======================================================================
3876
======================================================================
3794
Parameters:
3877
Parameters:
3795
  * eax = 69 - number ïðîöåññà
3878
  * eax = 69 - function number
3796
  * ebx = 4 - number subfunction
3879
  * ebx = 4 - subfunction number
3797
  * ecx = identifier
3880
  * ecx = thread identifier
3798
Returned value:
3881
Returned value:
3799
  * function does not return value
3882
  * function does not return value
Line 3800... Line 3883...
3800
Remarks:
3883
Remarks:
3801
  * Process should be loaded for of debugging (as is indicated in
-
 
3802
    the common description).
3884
  * Process must be loaded for debugging (as is shown in
3803
 
3885
    general description).
3804
======================================================================
3886
 
3805
====================== Function 69, subfunction 5 ====================
3887
======================================================================
3806
================ Restored execution debugged thread. =================
3888
======== Function 69, subfunction 5 - resume debugged thread. ========
3807
======================================================================
3889
======================================================================
3808
Parameters:
3890
Parameters:
3809
  * eax = 69 - number of the function
3891
  * eax = 69 - function number
3810
  * ebx = 5 - number subfunction
3892
  * ebx = 5 - subfunction number
3811
  * ecx = identifier
3893
  * ecx = thread identifier
3812
Returned value:
3894
Returned value:
Line 3813... Line 3895...
3813
  * function does not return value
3895
  * function does not return value
3814
Remarks:
-
 
3815
  * Process should be loaded for of debugging (as is indicated in
3896
Remarks:
3816
    the common description).
3897
  * Process must be loaded for debugging (as is shown in
3817
 
3898
    general description).
3818
======================================================================
3899
 
3819
====================== Function 69, subfunction 6 ====================
3900
======================================================================
3820
============= Read from memory of the debugged process. ==============
3901
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3821
======================================================================
3902
======================================================================
3822
Parameters:
3903
Parameters:
3823
  * eax = 69 - number of the function
3904
  * eax = 69 - function number
3824
  * ebx = 6 - number subfunction
3905
  * ebx = 6 - subfunction number
3825
  * ecx = identifier
3906
  * ecx = identifier
3826
  * edx = how many bytes to read
3907
  * edx = number of bytes to read
3827
  * esi = memory address of the debugged process
3908
  * esi = address in the memory of debugged process
3828
  * edi = pointer on buffer for data
3909
  * edi = pointer to buffer for data
3829
Returned value:
3910
Returned value:
3830
  * eax = -1 error (incorrect PID or buffer)
3911
  * eax = -1 at an error (invalid PID or buffer)
Line 3831... Line 3912...
3831
  * differently eax = the number read bytes 
3912
  * otherwise eax = number of read bytes (possibly, 0,
3832
    (is possible, 0, if in esi the too large value)
3913
    if esi is too large)
3833
Remarks:
3914
Remarks:
3834
  * Process should be loaded for of debugging (as is indicated in
3915
  * Process must be loaded for debugging (as is shown in
3835
    the common description).
3916
    general description).
3836
 
3917
 
3837
======================================================================
3918
======================================================================
3838
 Function 69, subfunction 7 - write in memory of the debugged process. 
3919
== Function 69, subfunction 7 - write to memory of debugged process. =
3839
======================================================================
3920
======================================================================
3840
Parameters:
3921
Parameters:
3841
  * eax = 69 - number of the function
3922
  * eax = 69 - function number
3842
  * ebx = 7 - number subfunction
3923
  * ebx = 7 - subfunction number
3843
  * ecx = identifier
3924
  * ecx = identifier
3844
  * edx = how many bytes to write
3925
  * edx = number of bytes to write
3845
  * esi = memory address of the debugged process
3926
  * esi = address of memory in debugged process
3846
  * edi = pointer on data
3927
  * edi = pointer to data
3847
Returned value:
3928
Returned value:
Line 3848... Line 3929...
3848
  * eax = -1 error (incorrect PID or buffer)
3929
  * eax = -1 at an error (invalid PID or buffer)
3849
  * differently eax = the number written bytes
3930
  * otherwise eax = number of written bytes (possibly, 0,
3850
    (is possible, 0, if in esi the too large value)
3931
    if esi is too large)
3851
Remarks:
3932
Remarks:
3852
  * Process should be loaded for of debugging (as is indicated in
3933
  * Process must be loaded for debugging (as is shown in
3853
    the common description).
3934
    general description).
3854
 
3935
 
3855
======================================================================
3936
======================================================================
3856
======= Function 69, subfunction 8 - complete debugged thread. =======
3937
======= Function 69, subfunction 8 - terminate debugged thread. ======
3857
======================================================================
3938
======================================================================
3858
Parameters:
3939
Parameters:
3859
  * eax = 69 - number of the function
3940
  * eax = 69 - function number
3860
  * ebx = 8 - number subfunction
3941
  * ebx = 8 - subfunction number
3861
  * ecx = identifier
3942
  * ecx = identifier
3862
Returned value:
3943
Returned value:
Line 3863... Line 3944...
3863
  * function does not return value
3944
  * function does not return value
3864
Remarks:
3945
Remarks:
3865
  * Process should be loaded for of debugging (as is indicated in
-
 
3866
    the common description).
3946
  * Process must be loaded for debugging (as is shown in
3867
  * Function is similar subfunction 2 functions 18 with two differences:
3947
    general description).
3868
    the execution of the first remark is required and is accepted PID,
3948
  * The function is similar to subfunction 2 of function 18
3869
    instead of number of the slot.
3949
    with two differences: it requires first remark and
3870
 
3950
    accepts PID rather than slot number.
3871
======================================================================
3951
 
3872
====================== Function 69, subfunction 9 ====================
3952
======================================================================
3873
=============== Place/remove the hardware point break. ===============
3953
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3874
======================================================================
3954
======================================================================
3875
Parameters:
3955
Parameters:
3876
  * eax = 69 - number of the function
3956
  * eax = 69 - function number
3877
  * ebx = 9 - number subfunction
3957
  * ebx = 9 - subfunction number
3878
  * ecx = thread identifier
3958
  * ecx = thread identifier
3879
  * dl = index of breakpoint, from 0 up to 3 inclusively
3959
  * dl = index of breakpoint, from 0 to 3 inclusively
3880
  * dh = flags:
3960
  * dh = flags:
3881
    * if high bit is reset - install breakpoint:
3961
    * if high bit is cleared - set breakpoint:
3882
      * bits 0-1 - condition:
3962
      * bits 0-1 - condition:
3883
        * 00 = breakpoint on execution
3963
        * 00 = breakpoint on execution
3884
        * 01 = breakpoint on writing
3964
        * 01 = breakpoint on read
3885
        * 11 = breakpoint on reading/writing
3965
        * 11 = breakpoint on read/write
3886
      * bits 2-3 - length; for breakpoints on fulfilment should be 00,
3966
      * bits 2-3 - length; for breakpoints on exception it must be
3887
        otherwise one of
3967
        00, otherwise one of
3888
        * 00 = bytes
3968
        * 00 = byte
3889
        * 01 = word
3969
        * 01 = word
3890
        * 11 = double word
3970
        * 11 = dword
3891
      * esi = address of breakpoint; should be aligned according to length
3971
      * esi = breakpoint address; must be aligned according to
3892
        (i.e. should be even for of breakpoints on a word, is multiple 4 for
3972
        the length (i.e. must be even for word breakpoints,
3893
        of a double word)
3973
        divisible by 4 for dword)
3894
    * if high bit is installed - reset breakpoint
3974
    * if high bit is set - clear breakpoint
3895
Returned value:
3975
Returned value:
3896
  * eax = 0 - successfully
3976
  * eax = 0 - success
3897
  * eax = 1 - error in the input data
3977
  * eax = 1 - error in the input data
3898
  * eax = 2 - (reserved, never comes back in current realization)
3978
  * eax = 2 - (reserved, is never returned in the current
3899
    with this index global breakpoint already is installed
3979
    implementation) a global breakpoint with that index is already set
3900
Remarks:
3980
Remarks:
3901
  * Process should be loaded for of debugging (as is indicated in
3981
  * Process must be loaded for debugging (as is shown in
3902
    the common description).
3982
    general description).
3903
  * Hardware breakpoints are realized through the DRx-register of the
3983
  * Hardware breakpoints are implemented through DRx-registers of
Line 3904... Line 3984...
3904
    processor, from here all limitations.
3984
    the processor, all limitations results from this.
3905
  * Function can reinstall the breakpoint, earlier installed to it
3985
  * The function can reinstall the breakpoint, previously set
3906
    (in any way not informing about it).
3986
    by it (and it does not inform on this).
3907
    Carry on the list of the installed breakpoints in the debugger.
3987
    Carry on the list of set breakpoints in the debugger.
3908
  * Operation of breakpoint consists in generation of debug exception #DB,
3988
  * Breakpoints generate debug exception #DB, on which the system
3909
    which the system informs to the debugger.
3989
    notifies debugger.
3910
  * Breakpoint on writing and reading/writing works after execution of
3990
  * Breakpoints on write and read/write act after
3911
    the instruction, which has called it.
3991
    execution of the caused it instruction.
3912
 
3992
 
3913
======================================================================
3993
======================================================================
3914
== Function 70 - work with a file system with support of long names. =
3994
==== Function 70 - work with file system with long names support. ====
3915
======================================================================
3995
======================================================================
3916
Parameters:
3996
Parameters:
3917
  * eax = 70
3997
  * eax = 70
3918
  * ebx = pointer on information structure
3998
  * ebx = pointer to the information structure
3919
Returned value:
3999
Returned value:
3920
  * eax = 0 - successfully; differently error code of a file system
4000
  * eax = 0 - success; otherwise file system error code
3921
  * depending on subfunction the value and in other registers can come back
4001
  * some subfunctions return value in other registers too
3922
Common format of information structure:
4002
General format of the information structure:
3923
  * +0: dword: number subfunction
4003
  * +0: dword: subfunction number
3924
  * +4: dword: offset in the file
4004
  * +4: dword: file offset
3925
  * +8: dword: high dword of offset (should be 0) or field of flags
4005
  * +8: dword: high dword of offset (must be 0) or flags field
-
 
4006
  * +12 = +0xC: dword: size
3926
  * +12 = +0xC: dword: size
4007
  * +16 = +0x10: dword: pointer to data
3927
  * +16 = +0x10: dword: pointer on data
4008
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3928
  * +20 = +0x14: n db: ASCIIZ-string with a filename
4009
    or
3929
    or
4010
  * +20 = +0x14: db 0
3930
  * +20 = +0x14: db 0
4011
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3931
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4012
Specifications - in documentation on the appropriate subfunction.
3932
Specifications - in documentation on appropriate subfunction.
4013
Filename is case-insensitive. Russian letters must be written in
3933
Filename is insensitive to the register of characters. Russian characters should be written in the coding cp866 (DOS).
4014
the encoding cp866 (DOS).
3934
Ôîðìàò èìåíè ôàéëà:
4015
Format of filename:
3935
/base/number/dir1/dir2/.../dirn/file,
4016
/base/number/dir1/dir2/.../dirn/file,
3936
where /base/number Identifies the device, on which the file is searched:
4017
where /base/number identifies device, on which file is located:
3937
one of
4018
one of
3938
  * /RD/1 = /RAMDISK/1 for access to ramdisk
4019
  * /RD/1 = /RAMDISK/1 to access ramdisk
3939
  * /FD/1 = /FLOPPYDISK/1 for access to the first floppy-drive,
4020
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3940
    /FD/2 = /FLOPPYDISK/2 for access to the second floppy-drive
4021
    /FD/2 = /FLOPPYDISK/2 to access second one
3941
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x for access accordingly
4022
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3942
    to hard disks on IDE0 (Primary Master), IDE1 (Primary Slave),
4023
    IDE0 (Primary Master), IDE1 (Primary Slave),
3943
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
4024
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3944
    x - number of partition on selected hard disk, varies from 1 up to 255
4025
    x - partition number on the selected hard drive, varies from 1
3945
    (on each of hard disks partitions starts with 1)
4026
    to 255 (on each hard drive the indexing starts from 1)
3946
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 for access accordingly
4027
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3947
    to CD on IDE0 (Primary Master), IDE1 (Primary Slave),
4028
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3948
    IDE2 (Secondary Master), IDE3 (Secondary Slace)
4029
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3949
Examples:
4030
Examples:
3950
  * '/rd/1/kernel.asm',0
4031
  * '/rd/1/kernel.asm',0
3951
  * '/HD0/1/kernel.asm',0
4032
  * '/HD0/1/kernel.asm',0
-
 
4033
  * '/hd0/2/menuet/pics/tanzania.bmp',0
-
 
4034
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
-
 
4035
Available subfunctions:
-
 
4036
  * subfunction 0 - read file
-
 
4037
  * subfunction 1 - read folder
-
 
4038
  * subfunction 2 - create/rewrite file
-
 
4039
  * subfunction 5 - get attributes of file/folder
-
 
4040
  * subfunction 6 - set attributes of file/folder
-
 
4041
  * subfunction 7 - start application
-
 
4042
For CD-drives due to hardware limitations only subfunctions
-
 
4043
0,1,5 and 7 are available, other subfunctions return error
-
 
4044
with code 2.
-
 
4045
 
-
 
4046
======================================================================
-
 
4047
=== Function 70, subfunction 0 - read file with long names support. ==
-
 
4048
======================================================================
-
 
4049
Parameters:
-
 
4050
  * eax = 70 - function number
-
 
4051
  * ebx = pointer to the information structure
-
 
4052
Format of the information structure:
-
 
4053
  * +0: dword: 0 = subfunction number
-
 
4054
  * +4: dword: file offset (in bytes)
-
 
4055
  * +8: dword: 0 (reserved for high dword of offset)
-
 
4056
  * +12 = +0xC: dword: number of bytes to read
-
 
4057
  * +16 = +0x10: dword: pointer to buffer for data
-
 
4058
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
-
 
4059
    given in the general description
-
 
4060
    or
-
 
4061
  * +20 = +0x14: db 0
-
 
4062
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
Line 3952... Line 4063...
3952
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4063
Returned value:
3953
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4064
  * eax = 0 - success, otherwise file system error code
3954
Accessible subfunctions:
4065
  * ebx = number of read bytes or -1=0xffffffff if file was not found
3955
  * subfunction 0 - read file
4066
Remarks:
3956
  * subfunction 1 - read folder
4067
  * If file was ended before last requested block was read,
3957
  * subfunction 2 - create/rewrite file
-
 
3958
  * subfunction 5 - get file/directory attributes structure
-
 
3959
  * subfunction 6 - set file/directory attributes structure
-
 
3960
  * subfunction 7 - start application
-
 
3961
 
-
 
3962
======================================================================
-
 
3963
= Function 70, subfunction 0 - read file with support of long names. =
-
 
3964
======================================================================
-
 
3965
Parameters:
-
 
3966
  * eax = 70 - number of the function
-
 
3967
  * ebx = pointer on information structure
-
 
3968
Format of information structure:
-
 
3969
  * +0: dword: 0 = number subfunction
-
 
3970
  * +4: dword: position in the file (in bytes)
-
 
3971
  * +8: dword: 0 (reserved for high dword of a position)
-
 
3972
  * +12 = +0xC: dword: how many bytes to read
-
 
3973
  * +16 = +0x10: dword: pointer on buffer, where the data will be written
-
 
3974
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
-
 
3975
    are indicated in the common description
-
 
3976
    or
-
 
3977
  * +20 = +0x14: db 0
-
 
3978
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
-
 
3979
Returned value:
-
 
3980
  * eax = 0 - successfully, differently error code of a file system
-
 
3981
  * ebx = number read bytes or
-
 
3982
    -1=0xffffffff, if the file is not retrieved
-
 
3983
Remarks:
-
 
3984
  * If the file was terminated earlier, than last requested block was read,
4068
    the function will read as many as it can, and after that return
3985
    the function will read, how many can, then will return eax=6 (EOF).
4069
    eax=6 (EOF).
3986
  * Function does not allow to read folders
4070
  * The function does not allow to read folder (returns eax=10,
3987
    (will return eax=10, access denied).
4071
    access denied).
3988
 
4072
 
3989
========================================================================
4073
======================================================================
3990
= Function 70, subfunction 1 - read folder with support of long names. =
4074
== Function 70, subfunction 1 - read folder with long names support. =
3991
========================================================================
4075
======================================================================
3992
Parameters:
4076
Parameters:
3993
  * eax = 70 - number of the function
4077
  * eax = 70 - function number
3994
  * ebx = pointer on information structure
4078
  * ebx = pointer to the information structure
3995
Format of information structure:
4079
Format of the information structure:
3996
  * +0: dword: 1 = number subfunction
4080
  * +0: dword: 1 = subfunction number
3997
  * +4: dword: index of the initial block (beginning from 0)
4081
  * +4: dword: index of starting block (beginning from 0)
3998
  * +8: dword: field of flags:
4082
  * +8: dword: flags field:
3999
    * bit 0 (mask 1): in what format to return names,
4083
    * bit 0 (mask 1): in what format to return names,
4000
      0=ANSI, 1=UNICODE
4084
      0=ANSI, 1=UNICODE
4001
    * Other bits are reserved and should be installed in 0
4085
    * other bits are reserved and must be set to 0 for the future
4002
      for of the future compatibility
4086
      compatibility
4003
  * +12 = +0xC: dword: how many blocks to read
4087
  * +12 = +0xC: dword: number of blocks to read
4004
  * +16 = +0x10: dword: pointer on buffer, where the data will be written,
-
 
4005
    size of buffer should be not less than 32 + [+12] *560 bytes
4088
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4006
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
4089
    must be not less than 32 + [+12]*560 bytes
4007
    are indicated in the common description
4090
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4008
    or
4091
    given in the general description
4009
  * +20 = +0x14: db 0
4092
    or
4010
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4093
  * +20 = +0x14: db 0
4011
Returned value:
4094
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4012
  * eax = 0 - successfully, differently error code of a file system
4095
Returned value:
4013
  * ebx = number of files, the information about which was written 
4096
  * eax = 0 - success, otherwise file system error code
4014
    in the buffer,
4097
  * ebx = number of files, information on which was written to
4015
    or -1=0xffffffff, if the folder is not retrieved
4098
    the buffer, or -1=0xffffffff, if folder was not found
4016
Structure of the buffer:
4099
Structure of the buffer:
4017
  * +0: 32*byte: header
4100
  * +0: 32*byte: header
4018
  * +32 = +0x20: n1*byte: block with information on file 1
4101
  * +32 = +0x20: n1*byte: block with information on file 1
4019
  * +32+n1: n2*byte: block with information on file 2 2
4102
  * +32+n1: n2*byte: block with information on file 2
4020
  * ...
4103
  * ...
4021
Structure of header:
4104
Structure of header:
4022
  * +0: dword: version of structure (current version = 1)
4105
  * +0: dword: version of structure (current is 1)
4023
  * +4: dword: amount of the placed blocks; it is no more,
4106
  * +4: dword: number of placed blocks; is not greater than requested
4024
    than +12 information structures are requested in a field;
4107
    in the field +12 of information structure; can be less, if
-
 
4108
    there are no more files in folder (the same as in ebx)
4025
    can be less, if in a folder the files (same, as in ebx) were terminated
4109
  * +8: dword: total number of files in folder
4026
  * +8: dword: total number of files in a folder
4110
  * +12 = +0xC: 20*byte: reserved (zeroed)
4027
  * +12 = +0xC: 20*byte: reserved (zero)
4111
Structure of block of data for folder entry (BDFE):
4028
Structure of data block of input of directory (DBID):
4112
  * +0: dword: attributes of file:
4029
  * +0: dword: file attributes:
4113
    * bit 0 (mask 1): file is read-only
-
 
4114
    * bit 1 (mask 2): file is hidden
4030
    * áèò 0 (ìàñêà 1): file only for reading
4115
    * bit 2 (mask 4): file is system
4031
    * áèò 1 (ìàñêà 2): file is hidden
4116
    * bit 3 (mask 8): this is not a file but volume label
4032
    * áèò 2 (ìàñêà 4): file is system
4117
      (for one partition meets no more than once and
4033
    * áèò 3 (ìàñêà 8): it not file, it is volume label
4118
      only in root folder)
4034
      (on given partition meets no more once and only in a root folder)
4119
    * bit 4 (mask 0x10): this is a folder
4035
    * áèò 4 (ìàñêà 0x10): It is a folder
4120
    * bit 5 (mask 0x20): file was not archived - many archivation
4036
    * áèò 5 (ìàñêà 0x20): file was not archived - many programs of archiving
4121
      programs have an option to archive only files with this bit set,
4037
      have an option, on which the files with installed this bit are archived
4122
      and after archiving this bit is cleared - it can be useful
4038
      only, then this bit is dumped(reset) is it can be useful for of automatic
4123
      for automatically creating of backup-archives as at writing
4039
      creation of backup-archives, for at recording bit is usually installed
4124
      this bit is usually set
4040
  * +4: byte: type of data of a name:
4125
  * +4: byte: type of name data:
4041
    (coincides with bit 0 flags of information structure)
4126
    (coincides with bit 0 of flags in the information structure)
4042
    * 0 = ASCII = 1- byte performance of each character
4127
    * 0 = ASCII = 1-byte representation of each character
4043
    * 1 = UNICODE = 2-byte performance of each character
4128
    * 1 = UNICODE = 2-byte representation of each character
4044
  * +5: 3*byte: reserved (zero)
4129
  * +5: 3*byte: reserved (zero)
4045
  * +8: 4*byte: time of creation of file
4130
  * +8: 4*byte: time of file creation
4046
  * +12 = +0xC: 4*byte: date of creation of file
4131
  * +12 = +0xC: 4*byte: date of file creation
4047
  * +16 = +0x10: 4*byte: time of last access (reading or writing)
4132
  * +16 = +0x10: 4*byte: time of last access (read or write)
4048
  * +20 = +0x14: 4*byte: date of last access
4133
  * +20 = +0x14: 4*byte: date of last access
4049
  * +24 = +0x18: 4*byte: time of a last modification
4134
  * +24 = +0x18: 4*byte: time of last modification
4050
  * +28 = +0x1C: 4*byte: date of a last modification
4135
  * +28 = +0x1C: 4*byte: date of last modification
4051
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tbytes)
4136
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4052
  * +40 = +0x28: name
4137
  * +40 = +0x28: name
4053
    * for of the format ASCII: maximum length of a name 263 characters
4138
    * for ASCII format: maximum length is 263 characters
4054
      (263 bytes), bytes after a name matters 0
4139
      (263 bytes), byte after the name has value 0
4055
    * for of the format UNICODE: maximum length of a name 259 characters
4140
    * äëÿ ôîðìàòà UNICODE: maximum length is 259 characters
4056
      (518 bytes), two bytes after a name matter 0
4141
      (518 bytes), 2 bytes after the name have value 0
4057
Format of time:
4142
Time format:
4058
  * +0: byte: seconds
4143
  * +0: byte: seconds
4059
  * +1: byte: minutes
4144
  * +1: byte: minutes
4060
  * +2: byte: hours
4145
  * +2: byte: hours
4061
  * +3: byte: reserved (0)
4146
  * +3: byte: reserved (0)
4062
  * For example, 23.59.59 is written as (in hex) 3B 3B 17 00
4147
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4063
Format of date:
4148
Date format:
4064
   * +0: byte: day
4149
  * +0: byte: day
4065
   * +1: byte: month
4150
  * +1: byte: month
4066
   * +2: word: year
4151
  * +2: word: year
4067
   * For example, 25.11.1979 is written as (in hex) 19 0B BB 07
4152
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4068
Remarks:
4153
Remarks:
4069
  * If in DBID there is a name in ASCII, length makes 304 bytes,
4154
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
4070
    if in UNICODE - 560 bytes. Value of length aligned on whole
4155
    if UNICODE name - 560 bytes. Value of length is aligned
4071
    multiple 16 bytes (for of acceleration of processing in cache-memory CPU).
4156
    on 16-byte bound (to accelerate processing in CPU cache).
4072
  * First character after a name zero (ASCIIZ-string).
4157
  * First character after a name is zero (ASCIIZ-string). The further
4073
    The further data contain garbage.
4158
    data contain garbage.
4074
  * If the files in a folder were terminated earlier, than the requested
4159
  * If files in folder were ended before requested number was read,
4075
    amount was read, the function will read, how many can,
4160
    the function will read as many as it can, and after that return
4076
    then will return eax=6 (EOF).
4161
    eax=6 (EOF).
4077
  * Any folder on the disk, except for root, contains two special
4162
  * Any folder on the disk, except for root, contains two special
4078
    inputs(entrances) "." And "..", identifying accordingly folder
4163
    entries "." and "..", identifying accordingly the folder itself
4079
    and parent folder.
4164
    and the parent folder.
4080
  * Function allows also to read virtual folders "/", "/rd", "/fd",
4165
  * The function allows also to read virtual folders "/", "/rd",
4081
    "/hd [n] ", thus the attributes subfolders rely equal 0x10, and the times
4166
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4082
    and dates are unset. An alternate way of obtaining of the information
4167
    and times and dates are zeroed. An alternative way to get the
4083
    about the equipment - subfunction 11 functions 18
4168
    equipment information - subfunction 11 of function 18.
4084
 
4169
 
4085
======================================================================
4170
======================================================================
4086
====================== Function 70, subfunction 2 ====================
4171
===================== Function 70, subfunction 2 =====================
4087
========== Create/rewrite file with support of long names. ===========
4172
============ Create/rewrite file with long names support. ============
4088
======================================================================
4173
======================================================================
4089
Parameters:
4174
Parameters:
4090
  * eax = 70 - number of the function
4175
  * eax = 70 - function number
4091
  * ebx = pointer on information structure
4176
  * ebx = pointer to the information structure
4092
Format of information structure:
4177
Format of the information structure:
4093
  * +0: dword: 2 = number subfunction
4178
  * +0: dword: 2 = subfunction number
4094
  * +4: dword: 0 (reserved)
4179
  * +4: dword: 0 (reserved)
4095
  * +8: dword: 0 (reserved)
4180
  * +8: dword: 0 (reserved)
4096
  * +12 = +0xC: dword: how many bytes to write
4181
  * +12 = +0xC: dword: number of bytes to read
4097
  * +16 = +0x10: dword: pointer on data
4182
  * +16 = +0x10: dword: pointer to data
4098
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
4183
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4099
    are indicated in the common description
4184
    given in the general description
4100
    or
4185
    or
-
 
4186
  * +20 = +0x14: db 0
Line 4101... Line 4187...
4101
  * +20 = +0x14: db 0
4187
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4102
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4188
Returned value:
4103
Returned value:
4189
  * eax = 0 - success, otherwise file system error code
4104
  * eax = 0 - successfully, differently error code of a file system
4190
  * ebx = number of written bytes (possibly 0)
4105
  * ebx = number written bytes (is possible, 0)
4191
Remarks:
4106
Remarks:
4192
  * If a file with given name did not exist, it is created;
4107
  * If the file with such name did not exist, it creates; if existed,
4193
    if it existed, it is rewritten.
4108
    is rewritten.
4194
  * If there is not enough free space on disk, the function will
4109
  * If it is not enough of free space on of the disk, the function will write,
4195
    write as many as can and then return error code 8.
4110
    how many can, then will return an error code 8.
4196
  * The function is not supported for CD (returns error code 2).
4111
 
4197
 
4112
======================================================================
4198
======================================================================
4113
= Function 70, subfunction 5 - get file/directory attributes structure. 
4199
==== Function 70, subfunction 5 - get information on file/folder. ====
4114
======================================================================
4200
======================================================================
4115
Parameters:
4201
Parameters:
4116
  * eax = 70 - number of the function
4202
  * eax = 70 - function number
4117
  * ebx = pointer on information structure
4203
  * ebx = pointer to the information structure
4118
Format of information structure:
4204
Format of the information structure:
4119
  * +0: dword: 5 = number subfunction
4205
  * +0: dword: 5 = subfunction number
4120
  * +4: dword: 0 (reserved)
4206
  * +4: dword: 0 (reserved)
4121
  * +8: dword: 0 (reserved)
4207
  * +8: dword: 0 (reserved)
4122
  * +12 = +0xC: dword: 0 (reserved)
4208
  * +12 = +0xC: dword: 0 (reserved)
-
 
4209
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4123
  * +16 = +0x10: dword: pointer on buffer, where data will be written (40 bytes)
4210
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4124
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
4211
    given in the general description
4125
    are indicated in the common description
4212
    or
4126
    or
4213
  * +20 = +0x14: db 0
Line 4127... Line 4214...
4127
  * +20 = +0x14: db 0
4214
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4128
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4215
Returned value:
4129
Returned value:
4216
  * eax = 0 - success, otherwise file system error code
4130
  * eax = 0 - successfully, differently error code of a file system
4217
  * ebx destroyed
4131
  * ebx fail
4218
Information on file is returned in the BDFE format (block of data
4132
Information on the file comes back in the format DBID
4219
for folder entry), explained in the description of
4133
(data block of input of directory), indicated in the description subfunction 1,
4220
subfunction 1, but without filename
4134
but without a filename (only first 40 = 0x28 bytes).
4221
(i.e. only first 40 = 0x28 bytes).
4135
Remarks:
4222
Remarks:
4136
  * Function does not support virtual folders such as /, /rd
4223
  * The function does not support virtual folders such as /, /rd and
4137
    and root folders such as /rd/1.
4224
    root folders like /rd/1.
4138
 
4225
 
4139
======================================================================
4226
======================================================================
4140
= Function 70, subfunction 6 - set file/directory attributes structure. 
4227
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4141
======================================================================
4228
======================================================================
4142
Parameters:
4229
Parameters:
4143
  * eax = 70 - number of the function
4230
  * eax = 70 - function number
4144
  * ebx = pointer on information structure
4231
  * ebx = pointer to the information structure
4145
Format of information structure:
4232
Format of the information structure:
4146
  * +0: dword: 6 = number subfunction
4233
  * +0: dword: 6 = subfunction number
4147
  * +4: dword: 0 (reserved)
4234
  * +4: dword: 0 (reserved)
4148
  * +8: dword: 0 (reserved)
4235
  * +8: dword: 0 (reserved)
4149
  * +12 = +0xC: dword: 0 (reserved)
4236
  * +12 = +0xC: dword: 0 (reserved)
4150
  * +16 = +0x10: dword: pointer on buffer with attributes (32 bytes)
4237
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4151
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
4238
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4152
    are indicated in the common description
4239
    given in the general description
4153
    or
4240
    or
4154
  * +20 = +0x14: db 0
4241
  * +20 = +0x14: db 0
-
 
4242
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4155
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4243
Returned value:
4156
Returned value:
4244
  * eax = 0 - success, otherwise file system error code
4157
  * eax = 0 - successfully, differently error code of a file system
4245
  * ebx destroyed
4158
  * ebx fail
4246
File attributes are first 32 bytes in BDFE (block of data
4159
File attributes - first 32 bytes in DBID (data block of input of directory),
4247
for folder entry), explained in the description of subfunction 1
4160
which format is indicated in the description subfunction 1
4248
(that is, without name and size of file). Attribute
4161
(that is without a name and file size). Attribute the file/folder/volume label
4249
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4162
(bits 3,4 in dword +0) does not vary.
4250
Byte +4 (name format) is ignored.
4163
Byte +4 (format of a name) ignored.
4251
Remarks:
4164
Remarks:
4252
  * The function does not support virtual folders such as /, /rd and
4165
  * Function does not support virtual folders such as /, /rd
4253
    root folders like /rd/1.
4166
    and root folders such as /rd/1.
4254
  * The function is not supported for CD (returns error code 2).
4167
 
4255
 
4168
======================================================================
4256
======================================================================
4169
============ Function 70, subfunction 7 - start application. ============
4257
=========== Function 70, subfunction 7 - start application. ==========
4170
======================================================================
4258
======================================================================
4171
Parameters:
4259
Parameters:
4172
  * eax = 70 - number of the function
4260
  * eax = 70 - function number
4173
  * ebx = pointer on information structure
4261
  * ebx = pointer to the information structure
4174
Format of information structure:
4262
Format of the information structure:
4175
  * +0: dword: 7 = number subfunction
4263
  * +0: dword: 7 = subfunction number
4176
  * +4: dword: field of flags:
4264
  * +4: dword: flags field:
4177
    * áèò 0: to start the process as debugged
4265
    * áèò 0: start process as debugged
4178
    * other bits are reserved and should be installed in 0
4266
    * other bits are reserved and must be set to 0
4179
  * +8: dword: 0 or pointer on ASCIIZ-string with parameters
4267
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4180
  * +12 = +0xC: dword: 0 (reserved)
4268
  * +12 = +0xC: dword: 0 (reserved)
4181
  * +16 = +0x10: dword: 0 (reserved)
4269
  * +16 = +0x10: dword: 0 (reserved)
4182
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
4270
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4183
    are indicated in the common description
4271
    given in the general description
-
 
4272
    or
4184
    or
4273
  * +20 = +0x14: db 0
4185
  * +20 = +0x14: db 0
4274
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
Line 4186... Line 4275...
4186
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4275
Returned value:
4187
Returned value:
4276
  * eax > 0 - program is loaded, eax contains PID
4188
  * eax > 0 - program is loaded, eax contains PID
4277
  * eax < 0 - an error has occured, -eax contains
4189
  * eax < 0 - has taken place error,
4278
    file system error code
4190
    -eax contains an error code of a file system
4279
  * ebx destroyed
4191
  * ebx fail
4280
Remarks:
4192
Remarks:
4281
  * Command line must be terminated by the character with the code 0
4193
  * Command line should be ended by the character with the code 0
4282
    (ASCIIZ-string); function takes into account either all characters
4194
    (ASCIIZ-strings); it are taken into account or all characters up to
-
 
4195
    completing zero inclusively, or the first 256 characters, that are less.
4283
    up to terminating zero inclusively or first 256 character
4196
  * If the process is started as debugged, it creates in the frozen status;
4284
    regarding what is less.
4197
    for of start use subfunction 5 functions 69.
4285
  * If the process is started as debugged, it is created in
4198
 
4286
    the suspended state; to run use subfunction 5 of function 69.
4199
======================================================================
4287
 
Line 4200... Line 4288...
4200
=========== Function 71, subfunction 1 - set window caption ==========
4288
======================================================================
4201
======================================================================
4289
========== Function 71, subfunction 1 - set window caption. ==========
4202
Parameters:
4290
======================================================================
4203
  * eax = 71 - function number
4291
Parameters:
4204
  * ebx = 1 - subfunction number
4292
  * eax = 71 - function number
4205
  * eáx = caption string address
4293
  * ebx = 1 - subfunction number
4206
Returned value:
4294
  * ecx = pointer to caption string
4207
  * eax = 0 - caption changed successfully
4295
Returned value:
4208
  * eax = 1 - error occured
4296
  * function does not return value
4209
Remarks:
4297
Remarks:
4210
  * String should be in ASCIIZ format. Disregarding real string length,
4298
  * String must be in the ASCIIZ-format. Disregarding real string
4211
    no more than 255 chars will be wrawn.
4299
    length, no more than 255 characters are drawn.
4212
  * Pass NULL in ecx to remove caption
4300
  * Pass NULL in ecx to remove caption.
4213
 
4301
 
Line 4214... Line 4302...
4214
======================================================================
4302
======================================================================
4215
========== Function -1 - complete execution of thread/proces =========
4303
=============== Function -1 - terminate thread/process ===============
4216
======================================================================
4304
======================================================================
4217
Parameters:
4305
Parameters:
-
 
4306
  * eax = -1 - function number
4218
  * eax = -1 - number of the function
4307
Returned value:
4219
Returned value:
4308
  * function does not return neither value nor control
4220
  * function does not return neither value, nor handle
4309
Remarks:
4221
Remarks:
4310
  * If the process did not create threads obviously, it has only
4222
  * If the process obviously did not create streams, it has only one thread,
4311
    one thread, which termination results in process termination.
4223
    which completion results in completion of the process.
4312
  * If the current thread is last in the process, its termination
4224
  * If current thread - last in process, its completion also results
4313
    also results in process terminates.
4225
    in completion of the process.
4314
  * This function terminates the current thread. Other thread can be
4226
  * This function completes current thread. Another thread
4315
    killed by call to subfunction 2 of function 18.
4227
    is possible kill by call subfunction 2 functions 18.
4316
 
4228
 
4317
======================================================================
4229
======================================================================
4318
=========================== List of events ===========================
-
 
4319
======================================================================
4230
=========================== List of events ===========================
4320
Next event can be retrieved by the call of one from functions 10
4231
======================================================================
4321
(to wait for event), 11 (to check without waiting), 23
4232
Next event is possible get by call of one from functions 10 (to expect event),
4322
(to wait during the given time).
4233
11 (to check up without waiting), 23 (to expect during the given time).
4323
These functions return only those events, which enter into a mask set
4234
These functions return only those events, which enter into a mask installed by
4324
by function 40. By default it is first three,
4235
the function 40. By default it is first three, that there is enough for of many
4325
there is enough for most applications.
4236
applications of.
4326
Codes of events:
4237
Codes of events:
4327
  * 1 = redraw event (is reset by call to function 0)
4238
  * 1 = message about redraw (is reset at function call 0)
4328
  * 2 = key on keyboard is pressed (acts, only when the window is
4239
  * 2 = key on keyboard is pressed (acts, only when the window is active)
4329
    active) or hotkey is pressed; is reset, when all keys from
4240
    or "hotkey" is pressed; is reset, when all keys from the buffer are read
4330
    the buffer are read out by function 2
4241
    out by the function 2
4331
  * 3 = button is pressed, defined earlier by function 8
4242
  * 3 = button is pressed, defined earlier by function 8(or buttons of closing,
-
 
4243
    created implicitly by function 0 is pressed; the button of minimization is
4332
    (or close button, created implicitly by function 0;
-
 
4333
    minimize button is handled by the system and sends no message;
4244
    handled by the system and about it of the message does not come; acts, only
4334
    acts, only when the window is active;
4245
    when the window is active; is reset, when all buttons from the buffer are
4335
    is reset when all buttons from the buffer
4246
    read out by the function 17)
4336
    are read out by function 17)
4247
  * 4 = reserved (in current implementation never comes even at unmasking 
4337
  * 4 = reserved (in current implementation never comes even after
4248
    by the function 40)
4338
    unmasking by function 40)
4249
  * 5 = redraw the background of a desktop (is reset automatically after
4339
  * 5 = the desktop background is redrawed (is reset automatically
4250
    redraw, so if in time redraw of a background the program does not wait
4340
    after redraw, so if in redraw time program does not wait and
4251
    and does not check event, this event it will not remark)
4341
    does not check events, it will not remark this event)
4252
  * 6 = event from the mouse (something happened - pressing a mouse button
4342
  * 6 = mouse event (something happened - button pressing or moving;
4253
    or moving; is reset at reading)
4343
    is reset at reading)
4254
  * 7 = there was an event IPC (look the function 60 - Inter Process
-
 
4255
    Communication; is reset at reading)
4344
  * 7 = IPC event (see function 60 -
4256
  * 8 = there was a network event (is reset at reading; look operation
4345
    Inter Process Communication; is reset at reading)
4257
    with the network)
4346
  * 8 = network event (is reset at reading)
-
 
4347
  * 9 = debug event (is reset at reading; see
4258
  * 9 = there was a debug event (is reset at reading; look a debug subsystem)
4348
    debug subsystem)
4259
  * 16..31 = there was an event with appropriate IRQ
4349
  * 16..31 = event with appropriate IRQ
4260
    (16=IRQ0, 31=IRQ15) (is reset at reading all data IRQ)
4350
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4261
 
4351
 
4262
======================================================================
4352
======================================================================
4263
==================== Error codes of a file system ====================
4353
=================== Error codes of the file system ===================
4264
======================================================================
4354
======================================================================
4265
  * 0 = successfully
4355
  * 0 = success
4266
  * 1 = base and/or partition of the hard disk is not defined
4356
  * 1 = base and/or partition of a hard disk is not defined
4267
    (subfunctions 7, 8 functions 21) 
4357
    (by subfunctions 7, 8 of function 21)
4268
  * 2 = function is not supported for of the given file system
4358
  * 2 = function is not supported for the given file system
4269
    (comes back in case of attempt of LBA-reading at prohibited LBA)
4359
  * 3 = unknown file system
4270
  * 3 = Unknown file system
-