Subversion Repositories Kolibri OS

Rev

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

Rev 114 Rev 118
1
SYSTEM FUNCTIONS of OS Kolibri 0.5.8.1
1
SYSTEM FUNCTIONS of OS Kolibri 0.5.8.1
2
 
2
 
3
Number of the function is located in the register eax.
3
Number of the function is located in the register eax.
4
The call of the system function is 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,
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
26
        function call with such Y is ignored
27
    * RR, GG, BB = accordingly red, green, blue
27
    * RR, GG, BB = accordingly red, green, blue components of a color
28
      colours of a working area of the window
28
      of the working area of the window (are ignored for style Y=2)
29
      (is ignored for style Y=2)
-
 
30
    * X = DCBA (bits)
29
    * X = DCBA (bits)
31
      * A = 1 - window has caption; if Y=3, caption string address could be passed in edi,
30
      * A = 1 - window has caption; for style Y=3 caption string
-
 
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
    this function and are ignored at subsequent; for change of location
51
    call of this function and are ignored at subsequent; to change
52
    and/or of sizes already of created window use function 67.
52
    position and/or sizes of already created window use function 67.
53
  * If to use windows of appropriate styles, location and - or the sizes of
53
  * For windows with style Y=3 and caption (A=1) caption string is set
-
 
54
    by the first call of this function and is ignored at subsequent
-
 
55
    (strictly speaking, is ignored after a call to subfunction 2
-
 
56
    of function 12 - end redraw); to change caption of already created
54
    the window can vary by the user.
57
    window use subfunction 1 of function 71.
-
 
58
  * If the window has appropriate styles, position and/or sizes can be
55
    Current location and the sizes can be obtained by function 9.
59
    changed by user. Current position and sizes can be obtained
-
 
60
    by function 9.
56
  * The window should be located on the screen. If the transferred coordinates
61
  * The window must fit on the screen. If the transferred
57
    nd the sizes do not satisfy to this condition, appropriate coordinate
62
    coordinates and sizes do not satisfy to this condition,
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,
-
 
64
    and if also it does not help, the appropriate size
59
    the appropriate size (or, probably, both) is installed in a size of the
65
    (or, probably, both) is installed in a size of the screen.
60
    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.
73
    It means, that the real sizes are on 1 pixel more.
69
  * Look of the window of a type I:
74
  * The window of type I looks as follows:
70
    * draw external frame of colour indicated in edi,
75
    * draw external frame of color indicated in edi, 1 pixel in width
71
      in width 1 pixel
-
 
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 -
76
      upper corner (1,21) and right lower
80
      rectangle with the left upper corner (1,21) and right lower
77
      (xsize-1, ysize-1) (sizes (xsize-1) * (ysize-21)) - colour
81
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
78
       indicated in edx (in view of a gradient) is painted over
82
      indicated in edx (taking a gradient into account)
-
 
83
    * if A=1 and caption has been already set by subfunction 1
-
 
84
      of function 71, it is drawn in the corresponding place of header
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)
89
      edi (all components of the color decrease twice)
84
    * drawn intermediate frame of width 3 pixels of colour edi
90
    * draw intermediate frame of width 3 pixels with color edi
85
    * draw internal frame of width 1 pixel
91
    * draw internal frame of width 1 pixel with the "shaded" color edi
86
      "shaded" colour 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)
90
    * If ysize > =26, the working area of the window is painted over -
95
    * if ysize>=26, fill the working area of the window -
91
      rectangle with the left upper corner (5,20) and right lower
96
      rectangle with the left upper corner (5,20) and right lower
92
      (xsize-5,ysize-5) - colour indicated in edx (in view of a gradient)
97
      (xsize-5,ysize-5) with color indicated in edx
-
 
98
      (taking a gradient into account)
-
 
99
    * if A=1 and caption has been already set by subfunction 1
-
 
100
      of function 71, it is drawn in the corresponding place of header
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)
102
    * If ysize > =26, the working area of the window is painted over -
110
    * if ysize>=26, fill the working area of the window -
103
      rectangle with the left upper corner (5, _skinh) and right lower
111
      rectangle with the left upper corner (5,_skinh) and right lower
104
      (xsize-5,ysize-5) - colour indicated in edx (in view of a gradient)
112
      (xsize-5,ysize-5) with color indicated in edx
-
 
113
      (taking a gradient into account)
105
    * two standard buttons are defined: closings and minimizations
114
    * define two standard buttons: for close and minimize
106
      (see function 8)
115
      (see function 8)
-
 
116
    * if A=1 and edi contains (nonzero) pointer to caption string,
-
 
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
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.
146
  * Ffind out, what keys correspond to what codes, is possible, having started
157
  * To find out, what keys correspond to what codes, start
147
    the applications keyascii and scancode.
158
    the application keyascii and scancode.
148
  * Scancodes come back directly by keyboard and are fixed; ASCII-codes turn
159
  * Scancodes come directly from keyboard and are fixed;
149
    out with usage of the conversion tables, which can be installed
160
    ASCII-codes turn out with usage of the conversion tables,
150
    subfunction 2 functions 21 and to read subfunction 2 functions 26.
161
    which can be set by subfunction 2 of function 21
-
 
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,
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
179
    the moment of start of the system; it is more convenient, because
168
    simply DWORD-value of the counter of time.
180
    returns simply DWORD-value of the time counter.
169
  * System time can be installed by the function 22.
181
  * System time can be set by function 22.
170
 
182
 
171
======================================================================
183
======================================================================
172
================ Function 4 - draw text in the window. ===============
-
 
173
======================================================================
-
 
174
Can output both strings with given length and NULL-terminated strings
-
 
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
182
    * X sets the used font: 0=system monowide,
191
    * X specifies the used font: 0=system monospaced,
183
      1=system font of variable width
192
      1=system font of variable width
184
  * edx = pointer by the beginning of string
193
  * edx = pointer to the beginning of the string
185
  * esi = length of string, should be no more 255
194
  * esi = length of the string, must not exceed 255
186
Returned value:
195
Returned value:
187
  * function does not return value
196
  * function does not return value
188
Remarks:
197
Remarks:
-
 
198
  * Function outputs either first (esi and 0xFF) characters or
-
 
199
    all characters before (but not including) terminating zero
-
 
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:
227
  * The given function is out-of-date; the function 70 allows to fulfil
239
  * This function is out-of-date; function 70 allows
228
    the same operations with the extended possibilities.
240
    to fulfil the same operations with the extended possibilities.
229
  * Block = 512 bytes.
241
  * Block = 512 bytes.
230
  * For reading all file it is possible to specify the certainly large value
242
  * For reading all file you can specify the certainly large value
231
    in edx, for example, edx = -1; but in this case be ready that the program
243
    in edx, for example, edx = -1; but in this case be ready that
232
    "will fall", if the file will appear too large and "will not be placed" in
244
    the program will "fall", if the file will appear too large and can
233
    memory of the program.
245
    not be placed in the program memory.
234
  * The filename should be or in the format 8+3 characters (first 8 characters
246
  * The filename must be either in the format 8+3 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
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
271
  * esi = 0x00RRGGBB - colour of the button
284
  * esi = 0x00RRGGBB - color of the button
272
Parameters for deleting the button:
285
Parameters for button deleting:
273
  * eax = 8 - number of the function
286
  * eax = 8 - function number
274
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
287
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
275
Returned value:
288
Returned value:
276
  * function does not return value
289
  * function does not return value
277
Remarks:
290
Remarks:
278
  * Sizes of the button should be more than 0 and less than 0x8000.
291
  * Sizes of the button must be more than 0 and less than 0x8000.
279
  * For windows with skin at definition of the window (call of 0-th function)
292
  * For windows with skin definition of the window
280
    there are two standard buttons - closing of the window with the
293
    (call of 0th function) creates two standard buttons -
-
 
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
321
      * 3 = thread completed as a result of function call -1 or
335
      * 3 = thread is terminating as a result of call to function -1
322
        under duress as a consequence of call subfunction 2 functions 18
336
        or under duress as a result of call to subfunction 2
323
        or termination of the system
337
        of function 18 or termination of the system
324
      * 4 = thread is completed as a result of exception
338
      * 4 = thread is terminating as a result of exception
325
      * 5 = thread wait event
339
      * 5 = thread waits for event
326
      * 9 = requested slot is free,
340
      * 9 = requested slot is free, all other information on the slot
327
        all other information on the slot is not meaningful
341
        is not meaningful
328
Remarks:
342
Remarks:
329
  * Slots are numbered with 1.
343
  * Slots are numbered starting from 1.
330
  * Returned value not is a total number of streams, as there are free slots.
344
  * Returned value is not a total number of threads, because there
-
 
345
    can be free slots.
331
  * Ïðè ñîçäàíèè ïðîöåññà àâòîìàòè÷åñêè ñîçäàåòñÿ thread âûïîëíåíèÿ.
346
  * When process is starting, system automatically creates
-
 
347
    execution thread.
332
  * Function produces the information on thread. Each process has even one
348
  * Function gives information on the thread. Each process has
333
    thread. One process can create some thread, in this case everyone thread
349
    at least one thread. One process can create many threads,
-
 
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').
355
    Intersection does not occur, as for each process the own page table.
372
    There is no intersection, as each process has its own page table.
356
  * At creation thread to it are assigned the slot in the system table and
373
  * At creation of the thread it is assigned the slot
357
    identifier (Process/Thread IDentifier = PID/TID), which for given thread
374
    in the system table and identifier (Process/Thread IDentifier =
358
    do not vary in the subsequent time.
375
    PID/TID), which do not vary with time for given thread.
359
    After completion thread its slot can be anew used for another thread.
376
    After completion of the thread its slot can be anew used
360
    The identifier thread can not be assigned to other stream even after
377
    for another thread. The thread identifier can not be assigned
361
    completion first.
378
    to other thread even after completion of this thread.
362
    Identifiers, assigned to new thread, monotonously grow.
379
    Identifiers, assigned to new threads, grow monotonously.
363
  * If thread yet has not defined the window by function call 0,
380
  * If the thread has not yet defined the window by call to
364
    a location and the sizes of this window rely in zero.
381
    function 0, the position and the sizes
-
 
382
    of its window are considered to be zero.
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
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
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
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. -------------
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:
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:
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
======================================================================
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
 
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
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
501
Returned value:
519
Returned value:
502
  * function does not return value
520
  * function does not return value
503
 
521
 
504
=========================================================================
522
======================================================================
505
= Function 15, subfunction 4 - set the mode of drawing of a background. =
523
== Function 15, subfunction 4 - set drawing mode for the background. =
506
=========================================================================
524
======================================================================
507
Parameters:
525
Parameters:
508
  * eax = 15 - number of the function
526
  * eax = 15 - function number
509
  * ebx = 4 - number subfunction
527
  * ebx = 4 - subfunction number
510
  * ecx = mode of drawing:
528
  * ecx = drawing mode:
511
    * 1 = tile
529
    * 1 = tile
512
    * 2 = stretch
530
    * 2 = stretch
513
Returned value:
531
Returned value:
514
  * function does not return value
532
  * function does not return value
515
Remarks:
533
Remarks:
516
  * For upgrade of the screen (after completion of a series of commands
534
  * For update of the screen (after completion of a series of commands
517
    working with a background) call subfunction 3 redraw of a background.
535
    working with a background) call subfunction 3.
518
  * There is a pair command of obtaining of the mode redraw of a background
536
  * There is a pair function for get drawing mode of the background -
519
    - subfunction 4 functions 39.
537
    subfunction 4 of function 39.
520
 
538
 
521
===========================================================================
539
======================================================================
-
 
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
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:
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.
556
Parameters:
575
Parameters:
557
  * eax = 17 - number of the function
576
  * eax = 17 - function number
558
Returned value:
577
Returned value:
559
  * If the buffer is empty, comes back eax=1
578
  * if the buffer is empty, function returns eax=1
560
  * If the buffer is nonblank, comes back al=0, the high 24 bits eax contain
579
  * if the buffer is not empty, function returns al=0,
561
    the identifier of the button (in particular, in ah there is a low byte of
580
    high 24 bits of eax contain button identifier (in particular, ah
562
    the identifier; if all buttons have the identifier, smaller 256, for
581
    contains low byte of the identifier; if all buttons have
563
    distinguishing there is enough ah)
582
    the identifier less than 256, ah is enough to distinguish).
564
Remarks:
583
Remarks:
565
  * "Buffer" keeps only one button, at pressing the new button the information
584
  * "Buffer" keeps only one button, at pressing the new button the
566
    about old is lost. 
585
    information about old is lost.
567
  * By call of this function by the application with the inactive window the
586
  * The call of this function by an application with inactive window
568
    answer " the buffer comes back is empty ".
587
    will return answer "buffer is empty".
569
 
588
 
570
======================================================================
589
======================================================================
571
============ Function 18, subfunction 1 - shutdown system. ===========
590
============ Function 18, subfunction 1 - system shutdown. ===========
572
======================================================================
591
======================================================================
573
Parameters:
592
Parameters:
574
  * eax = 18 - number of the function
593
  * eax = 18 - function number
575
  * ebx = 1 - number subfunction
594
  * ebx = 1 - subfunction number
576
Returned value:
595
Returned value:
577
  * Always comes back eax = 0 as tag of success
596
  * function always return eax = 0 as tag of success
578
Remarks:
597
Remarks:
-
 
598
  * On the last step menu of exit from the system appears and waits
579
  * On last step there is a menu of quit waiting responses of the user.
599
    response of the user.
580
  * Look also subfunction 9, termination of the system with the parameter
600
  * See also subfunction 9, system shutdown with
581
    to speed up choice in the menu of an exit.
601
    the parameter to force the choice in the exit menu.
582
 
602
 
583
======================================================================
603
======================================================================
584
= Function 18, subfunction 2 - complete process/thread on the slot. ==
604
= Function 18, subfunction 2 - terminate process/thread by the slot. =
585
======================================================================
605
======================================================================
586
Parameters:
606
Parameters:
587
  * eax = 18 - number of the function
607
  * eax = 18 - function number
588
  * ebx = 2 - number subfunction
608
  * ebx = 2 - subfunction number
589
  * ecx = number of the slot of process/thread
609
  * ecx = number of the slot of process/thread
590
Returned value:
610
Returned value:
591
  * function does not return value
611
  * function does not return value
592
Remarks:
612
Remarks:
593
  * It is impossible to complete thread of an operating system OS/IDLE
613
  * It is impossible to terminate system thread OS/IDLE (with
594
    (number of the slot 1), it is possible to complete
614
    number of the slot 1),
595
    any usual thread/process.
615
    it is possible to terminate any normal process/thread.
596
  * See also subfunction 18 - completion of process/thread
616
  * See also subfunction 18 - terminate
597
    with the given identifier.
617
    process/thread by the identifier.
598
 
618
 
-
 
619
======================================================================
599
=========================================================================
620
===================== Function 18, subfunction 3 =====================
600
= Function 18, subfunction 3 - do to the active window selected thread. =
621
============= Make active the window of the given thread. ============
601
=========================================================================
622
======================================================================
602
Parameters:
623
Parameters:
603
  * eax = 18 - number of the function
624
  * eax = 18 - function number
604
  * ebx = 3 - number subfunction
625
  * ebx = 3 - subfunction number
605
  * ecx = number of the slot thread
626
  * ecx = number of the thread slot
606
Returned value:
627
Returned value:
607
  * function does not return value
628
  * function does not return value
608
Remarks:
629
Remarks:
609
  * At the instruction correct, but nonexistent slot any window is made active.
630
  * If correct, but nonexistent slot is given,
-
 
631
    some window is made active.
610
  * Find out, what window is active, is possible by call subfunction 7.
632
  * To find out, which window is active, use subfunction 7.
611
 
633
 
-
 
634
======================================================================
612
==============================================================================
635
===================== Function 18, subfunction 4 =====================
613
 Function 18, subfunction 4 - get counter of empty clock ticks per one second. 
636
=========== Get counter of idle time units per one second. ===========
614
==============================================================================
637
======================================================================
615
Empty clock ticks are understood as time, in which the processor stands idle
638
Idle time units are units, in which the processor stands idle
616
in waiting interruption (in the instruction hlt).
639
in waiting for interrupt (in the command 'hlt').
617
 
640
 
618
Parameters:
641
Parameters:
619
  * eax = 18 - number of the function
642
  * eax = 18 - function number
620
  * ebx = 4 - number subfunction
643
  * ebx = 4 - subfunction number
621
Returned value:
644
Returned value:
622
  * eax = value of the counter of empty clock ticks per one second
645
  * eax = value of the counter of idle time units per one second
623
 
646
 
624
======================================================================
647
======================================================================
625
=========== Function 18, subfunction 5 - get cpu frequency. ==========
648
========== Function 18, subfunction 5 - get CPU clock rate. ==========
626
======================================================================
649
======================================================================
627
Parameters:
650
Parameters:
628
  * eax = 18 - number of the function
651
  * eax = 18 - function number
629
  * ebx = 5 - number subfunction
652
  * ebx = 5 - subfunction number
630
Returned value:
653
Returned value:
631
  * eax = cpu frequency (modulo 2^32 clock ticks = 4GHz)
654
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
632
 
655
 
633
=====================================================================
656
======================================================================
634
== Function 18, subfunction 6 - save ramdisk in file on hard disk. ==
657
 Function 18, subfunction 6 - save ramdisk to the file on hard drive. 
635
=====================================================================
658
======================================================================
636
Parameters:
659
Parameters:
637
  * eax = 18 - number of the function
660
  * eax = 18 - function number
638
  * ebx = 6 - number subfunction
661
  * ebx = 6 - subfunction number
-
 
662
  * ecx defines path to the file:
639
  * ecx defines path to the file:
663
    * 1 = in the folder "/KOLIBRI"
640
    * 1 = in the directory "/KOLIBRI"
664
    * 2 = in the root folder
641
    * 2 = in the root
665
    * 3 = edx points to the path (names of folders in the format 8+3,
642
    * 3 = edx specifies path (names of folders in the format 8+3, divided '/')
666
      divided by '/')
643
Returned value:
667
Returned value:
644
  * eax = 0 - successfully
668
  * eax = 0 - success
645
  * differently eax = an error code of a file system
669
  * else eax = error code of the file system
646
Remarks:
670
Çàìå÷àíèÿ:
647
  * Filename is fixed, "menuet.img" (global variable of
671
  * Filename is fixed, "menuet.img" (global kernel variable
648
    a kernel image_save from preboot.inc)
672
    'image_save' from 'preboot.inc')
649
  * On what partition what disk the file will be saved, is defined
673
  * Drive and partition are defined by subfunction 7
650
    subfunction 7 and subfunction 8 functions 21.
674
    and subfunction 8 of function 21.
651
  * All directories in the indicated path should exist, differently will
675
  * All folders in the given path must exist, otherwise function
652
    return value 5, " the file is not retrieved ".
676
    returns value 5, "file not found".
653
 
677
 
654
======================================================================
678
======================================================================
655
====== Function 18, subfunction 7 - get number of active window. =====
679
=========== Function 18, subfunction 7 - get active window. ==========
656
======================================================================
680
======================================================================
657
Parameters:
681
Parameters:
658
  * eax = 18 - number of the function
682
  * eax = 18 - function number
659
  * ebx = 7 - number subfunction
683
  * ebx = 7 - subfunction number
660
Returned value:
684
Returned value:
661
  * eax = number of active window (number of the slot thread, which window
685
  * eax = number of the active window
662
    is active)
686
    (number of the slot of the thread with active window)
663
Remarks:
687
Remarks:
664
  * Active window is at the top of the window stack and receives the messages
688
  * Active window is at the top of the window stack and receives
665
    on all keyboard input.
689
    messages on all keyboard input.
-
 
690
  * To make a window active, use subfunction 3.
666
  * Make the window active it is possible by call subfunction 3.
691
 
667
 
692
======================================================================
668
=======================================================================
693
== Function 18, subfunction 8 - disable/enable the internal speaker. =
669
==== Function 18, subfunction 8 - disable/enable a speaker sound . ====
694
======================================================================
670
=======================================================================
695
If speaker sound is disabled, all calls to subfunction 55 of
671
At the disconnected sound the calls subfunction 55 functions 55 are ignored.
696
function 55 are ignored. If speaker sound is enabled,
672
At included - are routed on built - in speaker.
697
they are routed on builtin speaker.
673
 
698
 
674
--------------- Subsubfunction 1 - get a status. ----------------
699
------------------- Subsubfunction 1 - get status. -------------------
675
Parameters:
700
Parameters:
676
  * eax = 18 - number of the function
701
  * eax = 18 - function number
677
  * ebx = 8 - number subfunction
702
  * ebx = 8 - subfunction number
678
  * ecx = 1 - number subsubfunction
703
  * ecx = 1 - number of the subsubfunction
679
Returned value:
704
Returned value:
680
  * eax = 0 - sound speaker is enabled; 1 - is disabled
705
  * eax = 0 - speaker sound is enabled; 1 - disabled
681
 
706
 
682
-------------- Subsubfunction 2 - switch a status. --------------
707
----------------- Subsubfunction 2 - toggle status. ------------------
683
Switches statuses of disable/enable.
708
Toggles states of disable/enable.
684
Parameters:
709
Parameters:
685
  * eax = 18 - number of the function
710
  * eax = 18 - function number
686
  * ebx = 8 - number subfunction
711
  * ebx = 8 - subfunction number
687
  * ecx = 2 - number subsubfunction
712
  * ecx = 2 - number of the subsubfunction
688
Returned value:
713
Returned value:
689
  * function does not return value
714
  * function does not return value
690
 
715
 
691
===========================================================================
716
======================================================================
692
= Function 18, subfunction 9 - shutdown of the system with the parameter. =
717
== Function 18, subfunction 9 - system shutdown with the parameter. ==
693
===========================================================================
718
======================================================================
694
Parameters:
719
Parameters:
695
  * eax = 18 - number of the function
720
  * eax = 18 - function number
696
  * ebx = 9 - number subfunction
721
  * ebx = 9 - subfunction number
697
  * ecx = parameter:
722
  * ecx = parameter:
698
    * 1 = On last step of shutdown to save ramdisk on a diskette then to
723
    * 1 = on the last step of shutdown save ramdisk on a floppy and
-
 
724
      then show the exit menu and request further operations
699
      output the menu of an exit and to request of the user further operations
725
      from the user
700
    * 2 = switch off the computer
726
    * 2 = turn off computer
701
    * 3 = reboot the computer
727
    * 3 = reboot computer
702
    * 4 = restart a kernel from the file kernel.mnt on ramdisk
728
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
703
Returned value:
729
Returned value:
704
  * At incorrect ecx the registers do not vary (i.e. eax=18)
730
  * at incorrect ecx the registers do not change (i.e. eax=18)
-
 
731
  * by correct call function always returns eax=0
705
  * By correct call tag of success eax=0 always comes back
732
    as the tag of success
706
Remarks:
733
Remarks:
707
  * It is not necessary to rely on returned value by incorrect call,
734
  * Do not rely on returned value by incorrect call, it can be
708
    it can vary in the subsequent versions of a kernel.
735
    changed in future versions of the kernel.
709
  * It is possible to use subfunction 1, that on last step of termination
736
  * It is possible to use subfunction 1, that on the last step
710
    the user himself has selected, that it is necessary.
737
    the user makes choice himself.
711
  * It is not recommended to use value ecx=1 (to not irritate the user with
738
  * It is not recommended to use value ecx=1 (to not irritate the user
712
    excessive questions); to save ramdisk on a diskette it is possible by the
739
    with excessive questions); to save ramdisk on a floppy use
713
    function 16 (which admits specification, on which diskette to write), and
740
    function 16 (which admits specification, on which floppy to
714
    to complete operation from the menu of an output(exit) it is possible
741
    write), and to shutdown with the exit menu use already mentioned
715
    already mentioned subfunction 1.
742
    subfunction 1.
716
 
743
 
717
=======================================================================
744
======================================================================
718
====== Function 18, subfunction 10 - minimize application window. =====
745
===== Function 18, subfunction 10 - minimize application window. =====
719
=======================================================================
746
======================================================================
720
Turns off the own window.
747
Minimizes the own window.
721
Parameters:
748
Parameters:
722
  * eax = 18 - number of the function
749
  * eax = 18 - function number
723
  * ebx = 10 - number subfunction
750
  * ebx = 10 - subfunction number
724
Returned value:
751
Returned value:
725
  * function does not return value
752
  * function does not return value
726
Remarks:
753
Remarks:
727
  * The minimized window from the point of view of the function 9 saves
754
  * The minimized window from the point of view of function 9
728
    a location and sizes.
755
    keeps position and sizes.
729
  * Restoring of an application window occurs at activation subfunction 3.
756
  * Restoring of an application window occurs at its activation by 
-
 
757
    subfunction 3.
730
  * Usually there is no necessity obviously to turn off/restore the window:
758
  * Usually there is no necessity to minimize/restire a window
731
    turn off of the window is carried out by the system at pressing the button
759
    obviously: minimization of a window is carried out by the system
732
    of minimization (which for windows with SKIN is defined automatically by
760
    at pressing the minimization button (for skinned windows
-
 
761
    it is defined automatically by function 0,
733
    function 0, for windows without SKIN it is possible to define by the
762
    for other windows it can be defined manually by function 8),
734
    function 8), restoring - application @panel.
763
    restore of a window is done by the application '@panel'.
735
 
764
 
736
======================================================================
-
 
737
==================== Function 18, subfunction 11 =====================
765
======================================================================
738
================ Get information on a disk subsystem. ================
766
 Function 18, subfunction 11 - get information on the disk subsystem. 
739
======================================================================
767
======================================================================
740
Parameters:
768
Parameters:
741
  * eax = 18 - number of the function
769
  * eax = 18 - function number
742
  * ebx = 11 - number subfunction
770
  * ebx = 11 - subfunction number
743
  * ecx = type of the table:
771
  * ecx = type of the table:
744
    * 1 = short version, 10 bytes
772
    * 1 = short version, 10 bytes
745
    * 2 = full version, 65536 bytes
773
    * 2 = full version, 65536 bytes
746
  * edx = pointer on the buffer (in the application) for table
774
  * edx = pointer to the buffer (in the application) for the table
747
Returned value:
775
Returned value:
748
  * function does not return value
776
  * function does not return value
749
Format of the table: the short version:
777
Format of the table: short version:
750
  * +0: byte: information about FDD's (drives for diskettes), AAAABBBB,
778
  * +0: byte: information about FDD's (drives for floppies),
751
    where AAAA sets type of the first drive, BBBB - second disk agrees
779
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
752
    to the following list:
780
    of the second regarding to the following list:
753
    * 0 = there is no drive
781
    * 0 = there is no drive
754
    * 1 = 360Kb, 5.25''
782
    * 1 = 360Kb, 5.25''
755
    * 2 = 1.2Mb, 5.25''
783
    * 2 = 1.2Mb, 5.25''
756
    * 3 = 720Kb, 3.5''
784
    * 3 = 720Kb, 3.5''
757
    * 4 = 1.44Mb, 3.5''
785
    * 4 = 1.44Mb, 3.5''
758
    * 5 = 2.88Mb, 3.5'' (such diskettes already are not used)
786
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
759
    For example, for the standard configuration from one 1.44-drive here will
787
    For example, for the standard configuration from one 1.44-drive
760
    be 40h, and for a case 1.2Mb on A: and 1.44Mb on B: the value appears 24h.
788
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
-
 
789
    the value is 24h.
761
  * +1: byte: information about hard disks and CD - drives, AABBCCDD,
790
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
762
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
791
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
763
    * 0 = device is absent
792
    * 0 = device is absent
764
    * 1 = hard disk
793
    * 1 = hard drive
765
    * 2 = CD - drive
794
    * 2 = CD-drive
766
    For example, in a case HD on IDE0 and CD on IDE2 here will be 48h.
795
    For example, in the case HD on IDE0 and CD on IDE2
-
 
796
    this field contains 48h.
767
  * +2: 4 db: Number of the retrieved sections on hard disks with
797
  * +2: 4 db: number of the retrieved partitions on hard disks
768
    accordingly IDE0..., IDE3.
798
    at accordingly IDE0,...,IDE3.
769
    At absence of the hard disk on IDEx appropriate byte zero, at presence
799
    If the hard disk on IDEx is absent, appropriate byte is zero,
770
    shows number of the recognized partitions, which can and to not be (if the
800
    otherwise it shows number of the recognized partitions, which
771
    drive is not formatted or if the file system is not supported). In the
801
    can be not presented (if the drive is not formatted or if
772
    current version of a kernel for hard disks are supported only FAT16
802
    the file system is not supported). Current version of the kernel
773
    and FAT32.
803
    supports only FAT16 and FAT32 for hard disks.
774
  * +6: 4 db: reserved
804
  * +6: 4 db: reserved
775
Format of the table: the complete version:
805
Format of the table: full version:
776
  * +0: 10 db: same, as well as in the short version
806
  * +0: 10 db: same as for the short version
777
  * +10: 100 db: data for the first partition
807
  * +10: 100 db: data for the first partition
778
  * +110: 100 db: data for the second partition
808
  * +110: 100 db: data for the second partition
779
  * ...
809
  * ...
780
  * +10+100*(n-1): 100 db: data for the last partition
810
  * +10+100*(n-1): 100 db: data for the last partition
781
The sections are located in the following order: at first sequentially all
811
The partitions are located as follows: at first sequentially all
782
recognized partitions on HD on IDE0 (if are), then on HD on IDE1 (if is)
812
recoginzed partitions on HD on IDE0 (if present),
783
etc. up to IDE3.
813
then on HD on IDE1 (if present) and so on up to IDE3.
784
Format of the information about partition (while is supported only FAT):
814
Format of the information about partition
-
 
815
(at moment only FAT is supported):
785
  * +0: dword: first physical sector of the partition
816
  * +0: dword: first physical sector of the partition
786
  * +4: dword: last physical sector of the partition
817
  * +4: dword: last physical sector of the partition
787
    (belongs to partition)
818
    (belongs to the partition)
788
  * +8: dword: sectors in one copy FAT
819
  * +8: dword: sectors per one copy of FAT
789
  * +12 = +0xC: dword: number of copies FAT
820
  * +12 = +0xC: dword: number of copies of FAT
790
  * +16 = +0x10: dword: number of sectors in a cluster
821
  * +16 = +0x10: dword: number of sectors per cluster
791
  * +20 = +0x14: dword: byte in sector; the current implementation expects,
822
  * +20 = +0x14: dword: bytes per sector;
792
    that here 0x200 = 512
823
    current implementation expects 0x200 = 512 in this field
793
  * +24 = +0x18: dword: first cluster of the root in FAT32, 0 for FAT16
824
  * +24 = +0x18: dword: first root cluster in FAT32, 0 for FAT16
794
  * +28 = +0x1C: dword: first physical sector FAT
825
  * +28 = +0x1C: dword: first physical sector of FAT
795
  * +32 = +0x20: dword: first physical sector of the root for FAT16,
826
  * +32 = +0x20: dword: first physical root sector for FAT16,
796
    is ignored for FAT32
827
    ignored for FAT32
797
  * +36 = +0x24: dword: number of sectors in the root for FAT16, 0 for FAT32
828
  * +36 = +0x24: dword: number of root sectors for FAT16,
-
 
829
    0 for FAT32
798
  * +40 = +0x28: dword: physical sector of a beginning of area of the data
830
  * +40 = +0x28: dword: physical sector of the beginning of
-
 
831
    the data area
799
  * +44 = +0x2C: dword: maximum number of a cluster
832
  * +44 = +0x2C: dword: maximum number of a cluster
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
835
  * +52 = +0x34: dword: value used as boundary for special
-
 
836
    values in FAT
803
  * +56 = +0x38: dword: value used for bad clusters 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
-
 
806
  * +64 = +0x40: dword: mask superimposed on a unit FAT
839
  * +64 = +0x40: dword: mask for FAT items
807
  * +68 = +0x44: byte: type of a file system: 16 or 32
840
  * +68 = +0x44: byte: file system type: 16 èëè 32
808
  * +69 = +0x45: 31 db: reserved
841
  * +69 = +0x45: 31 db: reserved
809
Remarks:
842
Remarks:
810
  * Short table can be used for obtaining the information about available
843
  * The short table can be used for obtaining the information about
811
    devices.
844
    available devices.
812
  * First two information fields about partition in the complete version of
845
  * First two fields in the information about partition
813
    the table inform parameters of the unit which has stayed - parameters of
846
    gives the parameters of partition, other - parameters of
814
    a file system FAT. For other file systems (when they will be supported)
847
    FAT file system. For other file systems (when they will be
815
    information, specific to a file system, naturally, there will be another,
848
    supported) specific for file system information will be, of
816
    but first two fields will be saved constant.
849
    course, another, but first two fields will have the same sense.
817
 
850
 
818
======================================================================
851
======================================================================
819
======== Function 18, subfunction 13 - get version of a kernel. ======
852
========== Function 18, subfunction 13 - get kernel version. =========
820
======================================================================
853
======================================================================
821
Parameters:
854
Parameters:
822
  * eax = 18 - number of the function
855
  * eax = 18 - function number
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:
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
864
db 'name',0 - ASCIIZ-string with the name
832
For kernel Kolibri 0.5.8.1:
865
For Kolibri 0.5.8.1 kernel:
833
db 0,5,8,1
866
db 0,5,8,1
834
db 2
867
db 2
835
db 'Kolibri',0
868
db 'Kolibri',0
836
 
869
 
837
=========================================================================
870
======================================================================
838
====================== Function 18, subfunction 14 ======================
-
 
839
= Expect a beginning of retrace of a ray of scanning of screen monitor. =
871
======= Function 18, subfunction 14 - wait for screen retrace. =======
-
 
872
======================================================================
-
 
873
Waits for the beginning of retrace of the scanning ray of the screen
840
=========================================================================
874
monitor.
841
Parameters:
875
Parameters:
842
  * eax = 18 - number of the function
876
  * eax = 18 - function number
843
  * ebx = 14 - number subfunction
877
  * ebx = 14 - subfunction number
844
Returned value:
878
Returned value:
845
  * eax = 0 as tag of success
879
  * eax = 0 as the tag of success
846
Remarks:
880
Remarks:
847
  * Function is intended only for the active high-efficiency graphics
881
  * Function is intended only for active high-efficiency graphics
848
    applications; is used for smooth output of a graphics.
882
    applications; is used for smooth output of a graphics.
849
 
883
 
850
============================================================================
884
======================================================================
851
= Function 18, subfunction 15 - place a mouse pointer in centre of screen. =
885
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
852
============================================================================
886
======================================================================
853
Parameters:
887
Parameters:
854
  * eax = 18 - number of the function
888
  * eax = 18 - function number
855
  * ebx = 15 - number subfunction
889
  * ebx = 15 - subfunction number
856
Returned value:
890
Returned value:
857
  * eax = 0 as tag of success
891
  * eax = 0 as the tag of success
858
 
-
 
859
======================================================================
892
 
860
====================== Function 18, subfunction 16 ===================
893
======================================================================
861
====================== Get a size of the free RAM. ===================
894
========= Function 18, subfunction 16 - get size of free RAM. ========
862
======================================================================
895
======================================================================
863
Parameters:
896
Parameters:
864
  * eax = 18 - number of the function
897
  * eax = 18 - function number
865
  * ebx = 16 - number subfunction
898
  * ebx = 16 - subfunction number
866
Returned value:
899
Returned value:
867
  * eax = size of free memory in kilobytes
900
  * eax = size of free memory in kilobytes
868
 
901
 
869
======================================================================
902
======================================================================
870
====================== Function 18, subfunction 17 ===================
903
======== Function 18, subfunction 17 - get full amount of RAM. =======
871
====================== Get a size of the amount RAM. =================
-
 
872
======================================================================
904
======================================================================
873
Parameters:
905
Parameters:
874
  * eax = 18 - number of the function
906
  * eax = 18 - function number
875
  * ebx = 17 - number subfunction
907
  * ebx = 17 - subfunction number
876
Returned value:
908
Returned value:
877
  * eax = common size of amount memory in kilobytes
909
  * eax = total size of existing memory in kilobytes
878
 
910
 
879
======================================================================
911
======================================================================
880
====================== Function 18, subfunction 18 ===================
912
===================== Function 18, subfunction 18 ====================
881
============= complete process/thread on the identifier. =============
913
============= Terminate process/thread by the identifier. ============
882
======================================================================
914
======================================================================
883
Parameters:
915
Parameters:
884
  * eax = 18 - number of the function
916
  * eax = 18 - function number
885
  * ebx = 18 - number subfunction
917
  * ebx = 18 - subfunction number
886
  * ecx = identifier of process/thread (PID/TID)
918
  * ecx = identifer of process/thread (PID/TID)
887
Returned value:
919
Returned value:
888
  * eax = 0 - successfully
920
  * eax = 0 - success
889
  * eax = -1 - error (the process is not retrieved or is system)
921
  * eax = -1 - error (process is not found or is system)
890
Remarks:
922
Remarks:
891
  * It is impossible to complete thread of an operating system OS/IDLE
923
  * It is impossible to terminate system thread OS/IDLE (identifier
892
   (number of the slot 1), it is possible to complete any usual thread/process.
924
    1), it is possible to terminate any normal process/thread.
-
 
925
  * See also subfunction 2 - terminate
893
  * See also subfunction 2 - completion of process / thread on the given slot.
926
    process/thread by given slot.
894
 
927
 
895
======================================================================
928
======================================================================
896
============ Function 19 - start application with ramdisk. ===========
929
============ Function 19 - start application from ramdisk. ===========
897
======================================================================
930
======================================================================
898
Parameters:
931
Parameters:
-
 
932
  * eax = 19 - function number
899
  * eax = 19 - number of the function
933
  * ebx = pointer to the application name in format similar
900
  * ebx = pointer on an application name in format similar to function 6
934
    to function 6
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
-
 
942
    (ASCIIZ-string); function takes into account either all characters
908
    (ASCIIZ-strings); it are taken into account or all characters up to
943
    up to terminating zero inclusively or first 256 character
909
    completing zero inclusively, or the first 256 characters, that are less.
944
    regarding what is less.
910
 
945
 
911
======================================================================
946
======================================================================
912
==================== Function 20 - interface MIDI. ===================
947
==================== Function 20 - MIDI interface. ===================
913
======================================================================
948
======================================================================
914
 
949
 
915
------------------------ Subfunction 1 - reset ------------------------
950
----------------------- Subfunction 1 - reset ------------------------
916
Parameters:
951
Parameters:
917
  * eax = 20 - number of the function
952
  * eax = 20 - function number
918
  * ebx = 1 - number subfunction
953
  * ebx = 1 - subfunction number
919
 
954
 
920
-------------------- Subfunction 2 - output byte ---------------------
955
-------------------- Subfunction 2 - output byte ---------------------
921
Parameters:
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.
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
959
    * 3 = layout at pressed Alt
993
    * 3 = layout at pressed Alt
960
  * edx = pointer on layout - table of length 128 bytes
994
  * edx = pointer to layout - table of length 128 bytes
961
Or:
995
Or:
962
  * ecx = 9
996
  * ecx = 9
963
  * dx = identifier of the country (1=eng, 2=fi, 3=ger, 4=rus)
997
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
964
Returned value:
998
Returned value:
965
  * eax = 0 - successfully
999
  * eax = 0 - success
966
  * eax = 1 - parameter is given incorrectly
1000
  * eax = 1 - incorrect parameter
967
Remarks:
1001
Remarks:
968
  * If is pressed Alt, the layout with Alt is used; if not is pressed Alt,
1002
  * If Alt is pressed, the layout with Alt is used;
-
 
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
1010
  * Country identifier is global system variable, which is not used
976
    kernel is not used; however application @panel displays an icon,
1011
    by the kernel itself; however the application '@panel' displays
977
    appropriate to the current country.
1012
    the corresponding icon.
978
  * Application @panel switches layouts on search of the user.
1013
  * The application @panel switches layouts on user request.
979
 
1014
 
980
======================================================================
1015
======================================================================
981
=========== Function 21, subfunction 3 - install base CD. ============
1016
============== Function 21, subfunction 3 - set CD base. =============
982
======================================================================
1017
======================================================================
983
Parameters:
1018
Parameters:
984
  * eax = 21 - number of the function
1019
  * eax = 21 - function number
985
  * ebx = 3 - number subfunction
1020
  * ebx = 3 - subfunction number
986
  * ecx = base CD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1021
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
987
Returned value:
1022
Returned value:
988
  * eax = 0
1023
  * eax = 0
989
Remarks:
1024
Remarks:
990
  * Base CD is used by the function 24.
1025
  * CD base is used by function 24.
991
  * Receive the installed base CD it is possible by call
-
 
992
    subfunction 3 functions 26.
1026
  * To get CD base use subfunction 3 of function 26.
993
 
1027
 
994
======================================================================
1028
======================================================================
995
=== Function 21, subfunction 4 - install base port Sound Blaster. ====
1029
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
996
======================================================================
1030
======================================================================
997
Parameters:
1031
Parameters:
998
  * eax = 21 - number of the function
1032
  * eax = 21 - function number
999
  * ebx = 4 - number subfunction
1033
  * ebx = 4 - subfunction number
1000
  * ecx = number base port
1034
  * ecx = number of the base port
1001
Returned value:
1035
Returned value:
1002
  * eax = 0 - successfully
1036
  * eax = 0 - success
1003
  * eax = -1 - erratic number of a port
1037
  * eax = -1 - erratic port number
1004
Remarks:
1038
Remarks:
1005
  * Number of a port should satisfy to conditions 0x100<=ecx<=0xFFFF.
1039
  * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
-
 
1040
  * The installation of the base is necessary for
1006
  * Installation of base is necessary for operation of functions 25, 28, 55.
1041
    functions 25, 28, 55.
1007
  * Get installed base port it is possible by call subfunction 4 functions 26.
1042
  * To get base port use subfunction 4 of function 26.
1008
 
1043
 
1009
======================================================================
1044
======================================================================
1010
==== Function 21, subfunction 5 - install the language of system. ====
1045
========== Function 21, subfunction 5 - set system language. =========
1011
======================================================================
1046
======================================================================
1012
Parameters:
1047
Parameters:
1013
  * eax = 21 - number of the function
1048
  * eax = 21 - function number
1014
  * ebx = 5 - number subfunction
1049
  * ebx = 5 - subfunction number
1015
  * ecx = language of system (1=eng, 2=fi, 3=ger, 4=rus)
1050
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1016
Returned value:
1051
Returned value:
1017
  * eax = 0
1052
  * eax = 0
1018
Remarks:
1053
Remarks:
1019
  * Language of the system - global environment variable in any way which
1054
  * System language is global system variable and is not used
1020
    is not used by kernel, however application @panel draws
1055
    by the kernel itself, however application @panel draws the
1021
    an appropriate icon.
1056
    appropriate icon.
1022
  * Checks on a correctness is not done, as the kernel this variable
1057
  * Function does not check for correctness, as the kernel does not
1023
    does not use.
1058
    use this variable.
1024
  * Get language of the system it is possible by call
-
 
1025
    subfunction 5 functions 26.
1059
  * To get system language use subfunction 5 of function 26.
1026
 
1060
 
1027
======================================================================
1061
======================================================================
1028
========= Function 21, subfunction 6 - install base port WSS. ========
1062
=========== Function 21, subfunction 6 - set WSS base port. ==========
1029
======================================================================
1063
======================================================================
1030
Parameters:
1064
Parameters:
1031
  * eax = 21 - number of the function
1065
  * eax = 21 - function number
1032
  * ebx = 6 - number subfunction
1066
  * ebx = 6 - subfunction number
1033
  * ecx = base port
1067
  * ecx = base port
1034
Returned value:
1068
Returned value:
1035
  * eax = 0 - successfully
1069
  * eax = 0 - success
1036
  * eax = -1 - erratic number of a port
1070
  * eax = -1 - erratic port number
1037
Remarks:
1071
Remarks:
1038
  * Number of a port should satisfy to conditions 0x100<=ecx.
1072
  * Port number must satisfy to condition 0x100<=ecx.
1039
  * Base WSS is used by the function 27.
-
 
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.
1083
these function set base themselves.
1051
Parameters:
1084
Parameters:
1052
  * eax = 21 - number of the function
1085
  * eax = 21 - function number
1053
  * ebx = 7 - number subfunction
1086
  * ebx = 7 - subfunction number
1054
  * ecx = base HD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1087
  * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1055
Returned value:
1088
Returned value:
1056
  * eax = 0
1089
  * eax = 0
1057
Remarks:
1090
Remarks:
1058
  * Any application at any moment of time can change base.
1091
  * Any application at any time can change the base.
1059
  * It is not necessary to change base, when any application works
1092
  * Do not change base, when any application works with hard disk.
1060
    with the hard disk. If not want errors of the system.
1093
    If you do not want system bugs.
1061
  * Get installed base it is possible by call subfunction 7 functions 26.
1094
  * To get HD base use subfunction 7 of function 26.
1062
  * It is necessary also to define used partition of
1095
  * It is also necessary to define used partition of hard disk by 
1063
    the hard disk subfunction 8.
1096
    subfunction 8.
1064
 
1097
 
1065
======================================================================
1098
======================================================================
1066
========= Function 21, subfunction 8 - install partition HD. =========
1099
========= Function 21, subfunction 8 - set used HD partition. ========
1067
======================================================================
1100
======================================================================
1068
The section HD is necessary for definition, on what partition of the hard disk
1101
The HD partition defines partition of the hard disk to write with
1069
to write, at usage of out-of-date functions of operation with a file system and
1102
usage of obsolete file system functions and functions implicitly
1070
functions implicitly using the hard disk (such as subfunction of 6 functions
1103
using the hard disk (such as subfunction 6 of function 18);
1071
18); at usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
1104
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1072
these functions install base and partition.
1105
these functions set base and partition themselves.
1073
Parameters:
1106
Parameters:
1074
  * eax = 21 - number of the function
1107
  * eax = 21 - function number
1075
  * ebx = 8 - number subfunction
1108
  * ebx = 8 - subfunction number
1076
  * ecx = partition HD (beginning from 1)
1109
  * ecx = HD partition (beginning from 1)
1077
Returned value:
1110
Return value:
1078
  * eax = 0
1111
  * eax = 0
1079
Remarks:
1112
Remarks:
1080
  * Any application at any moment of time can change partition.
1113
  * Any application at any time can change partition.
1081
  * It is not necessary to change partition, when any application works
1114
  * Do not change partition when any application works with hard disk.
1082
    with the hard disk. If not want errors of the system.
1115
    If you do not want system bugs.
1083
  * Get installed partition it is possible by call subfunction 8 functions 26.
1116
  * To get used partition use subfunction 8 of function 26.
1084
  * Checks on a correctness is not done.
1117
  * There is no correctness checks.
1085
  * Find out number of partitions on the hard disk it is possible by call
1118
  * To get the number of partitions of a hard disk use 
1086
    subfunction 11 functions 18.
1119
    subfunction 11 of function 18.
1087
  * It is necessary also to define used base of the hard disk subfunction 7
1120
  * It is also necessary to define used HD base by subfunction 7.
1088
 
1121
 
1089
======================================================================
1122
======================================================================
1090
=== Function 21, subfunction 10 - install channel DMA for a sound. ===
1123
======== Function 21, subfunction 10 - set sound DMA channel. ========
1091
======================================================================
1124
======================================================================
1092
Parameters:
1125
Parameters:
1093
  * eax = 21 - number of the function
1126
  * eax = 21 - function number
1094
  * ebx = 10 - number subfunction
1127
  * ebx = 10 - subfunction number
1095
  * ecx = number of channel (from 0 up to 3 inclusively)
1128
  * ecx = number of channel (from 0 up to 3 inclusively)
1096
Returned value:
1129
Returned value:
1097
  * eax = 0 - successfully
1130
  * eax = 0 - success
1098
  * eax = -1 - incorrect number of the channel
1131
  * eax = -1 - incorrect channel number
1099
Remarks:
1132
Remarks:
1100
  * Number of the channel DMA is used in subfunction of 1 function 55.
-
 
1101
  * Get channel DMA for a sound it is possible by call
1133
  * Number of DMA channel is used in subfunction 1 of function 55.
1102
    subfunction 10 functions 26.
1134
  * To get sound DMA channel use subfunction 10 of function 26.
1103
 
-
 
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
======================================================================
-
 
1120
====================== Function 21, subfunction 12 ===================
1150
======================================================================
1121
============= Permit/prohibit low level access to PCI. ===============
1151
 Function 21, subfunction 12 - enable/disable low-level access to PCI. 
1122
======================================================================
1152
======================================================================
1123
Parameters:
1153
Parameters:
1124
  * eax = 21 - number of the function
1154
  * eax = 21 - function number
1125
  * ebx = 12 - number subfunction
1155
  * ebx = 12 - subfunction number
1126
  * ecx = 0/1 - prohibit/permit
1156
  * ecx = 0/1 - disable/enable
1127
Returned value:
1157
Returned value:
1128
  * eax = 0
1158
  * eax = 0
1129
Remarks:
1159
Remarks:
1130
  * Is used by operation with the bus PCI (function 62).
1160
  * Is used in operations with PCI bus (function 62).
1131
  * Current realization uses only low bit ecx.
1161
  * The current implementation uses only low bit of ecx.
1132
  * Get a current status it is possible by call subfunction 12 functions 26.
1162
  * To get current status use subfunction 12 of function 26.
1133
 
1163
 
1134
======================================================================
1164
======================================================================
1135
============= Function 21, subfunction 13, subsubfunction 1 ==========
1165
============ Function 21, subfunction 13, subsubfunction 1 ===========
1136
======= Initialize + get information on the driver vmode.mdr. ========
1166
======== Initialize + get information on the driver vmode.mdr. =======
1137
======================================================================
1167
======================================================================
1138
Parameters:
1168
Parameters:
1139
  * eax = 21 - number of the function
1169
  * eax = 21 - function number
1140
  * ebx = 13 - number subfunction
1170
  * ebx = 13 - subfunction number
1141
  * ecx = 1 - number of the function äðàéâåðà
1171
  * ecx = 1 - number of the driver function
1142
  * edx = pointer on the buffer of a size of 512 bytes
1172
  * edx = pointer to 512-bytes buffer
-
 
1173
Returned value:
1143
Returned value:
1174
  * if driver is not loaded
1144
  * If the driver is not loaded (never it happens in current implementation):
1175
    (never happens in the current implementation):
1145
    * eax = -1
1176
    * eax = -1
1146
    * ebx, ecx fail
1177
    * ebx, ecx destroyed
1147
  * If the driver is loaded:
1178
  * if driver is loaded:
1148
    * eax = 'MDAZ' (in style fasm, i.e. 'M' - low byte,
1179
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1149
    'Z' - high) - signature
1180
      - signature
1150
    * ebx = current frequency of the scanning (in a Hz)
1181
    * ebx = current frequency of the scanning (in Hz)
1151
    * ecx fail
1182
    * ecx destroyed
1152
    * buffer, which specifies edx, is filled
1183
    * buffer pointed to by edx is filled
1153
Format of the buffer:
1184
Format of the buffer:
1154
  * +0: 32*byte: name of the driver, " Trans VideoDriver " (without quotes,
1185
  * +0: 32*byte: driver name, "Trans VideoDriver"
1155
    is supplemented by blanks)
1186
    (without quotes, supplemented by spaces)
1156
  * +32 = +0x20: dword: version of the driver (version x.y is encoded
1187
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1157
    as y*65536+x), for current implementation 1 (1.0)
1188
    y*65536+x), for the current implementation is 1 (1.0)
1158
  * +36 = +0x24: 7*dword: reserved (0 in current implementation)
1189
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1159
  * +64 = +0x40: 32*word: list of supported videomodes (each word - number
1190
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1160
    of videomode, after the purely list there are zero)
1191
    is number of a videomode, after list itself there are zeroes)
1161
  * +128 = +0x80: 32*(5*word): list of supported frequencies of the scannings
1192
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1162
    for videomodes: for each videomode indicated in the previous field,
1193
    scannings for videomodes: for each videomode listed in the
1163
    up to 5 supported frequencies (in unused positions are indicated the zero)
1194
    previous field up to 5 supported frequences are given
1164
    are written.
1195
    (unused positions contain zeroes)
1165
Remarks:
1196
Remarks:
1166
  * Function initializes the driver (if it is not initialized yet) and should
1197
  * Function initializes the driver (if it is not initialized yet)
1167
    be called by first, before others (differently they will return -1,
1198
    and must be called first, before others (otherwise they will do
1168
    nothing doing).
1199
    nothing and return -1).
1169
  * In current implementation one frequency of the scanning on videomode
1200
  * The current implementation supports only one frequency
1170
    is supported only.
1201
    of the scanning on videomode.
1171
 
1202
 
1172
======================================================================
1203
======================================================================
1173
============= Function 21, subfunction 13, subsubfunction 2 ==========
1204
============ Function 21, subfunction 13, subsubfunction 2 ===========
1174
================= Get information on current videomode. ==============
1205
================ Get information on current videomode. ===============
1175
======================================================================
1206
======================================================================
1176
Parameters:
1207
Parameters:
1177
  * eax = 21 - number of the function
1208
  * eax = 21 - function number
1178
  * ebx = 13 - number subfunction
1209
  * ebx = 13 - subfunction number
1179
  * ecx = 2 - number of the function of the driver
1210
  * ecx = 2 - number of the driver function
1180
Returned value:
1211
Returned value:
1181
  * eax = -1 - driver is not loaded or is not initialized;
1212
  * eax = -1 - driver is not loaded or not initialized;
1182
    ebx,ecx fail
1213
    ebx,ecx are destroyed
1183
  * eax = [width]*65536 + [height]
1214
  * eax = [width]*65536 + [height]
1184
  * ebx = frequency of the vertical scanning (in a Hz)
1215
  * ebx = frequency of the vertical scanning (in Hz)
1185
  * ecx = number of current videomode
1216
  * ecx = number of current videomode
1186
Remarks:
1217
Remarks:
-
 
1218
  * Driver must be initialized by call to 
1187
  * Driver previously should be initialized by function call of the driver 1.
1219
    driver function 1.
-
 
1220
  * If only screen sizes are required, it is more expedient to use
1188
  * If the sizes of the screen are necessary only, it is more expedient
1221
    function 14 taking into account that it
1189
    to use the function 14 that it returns sizes on 1 less.
1222
    returns sizes on 1 less.
1190
 
1223
 
1191
======================================================================
1224
======================================================================
1192
= Function 21, subfunction 13, subsubfunction 3 - install videomode. 
1225
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1193
======================================================================
1226
======================================================================
1194
Parameters:
1227
Parameters:
1195
  * eax = 21 - number of the function
1228
  * eax = 21 - function number
1196
  * ebx = 13 - number subfunction
1229
  * ebx = 13 - subfunction number
1197
  * ecx = 3 - number of the function of the driver
1230
  * ecx = 3 - number of the driver function
1198
  * edx = [frequency of the scanning] *65536 + [number of videomode]
1231
  * edx = [scanning frequency]*65536 + [videomode number]
-
 
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. ==================
1211
======================================================================
1245
======================================================================
1212
Âîçâðàùàåò ýêðàí â videomode, óñòàíîâëåííîì ïðè çàãðóçêå ñèñòåìû.
1246
Returns the screen to the videomode set at system boot.
1213
Parameters:
1247
Parameters:
1214
  * eax = 21 - number of the function
1248
  * eax = 21 - function number
1215
  * ebx = 13 - number subfunction
1249
  * ebx = 13 - subfunction number
1216
  * ecx = 4 - number of the function of the driver
1250
  * ecx = 4 - number of the driver function
1217
Returned value:
1251
Returned value:
1218
  * eax = -1 - driver is not loaded or is not initialized
1252
  * eax = -1 - driver is not loaded or not initialized
1219
  * eax = 0 - successfully
1253
  * eax = 0 - success
1220
  * ebx, ecx fail
1254
  * ebx, ecx destroyed
1221
Remarks:
1255
Remarks:
1222
  * Driver previously should be initialized by function call of the driver 1.
1256
  * Driver must be initialized by call to driver function 1.
1223
 
1257
 
1224
=======================================================================
1258
======================================================================
1225
============= Function 21, subfunction 13, subsubfunction 5 ===========
1259
============ Function 21, subfunction 13, subsubfunction 5 ===========
1226
====== Increase/reduce a size of visible area of screen monitor. ======
1260
===== Increase/decrease the size of the visible area of monitor. =====
1227
=======================================================================
1261
======================================================================
1228
Parameters:
1262
Parameters:
1229
  * eax = 21 - number of the function
1263
  * eax = 21 - function number
1230
  * ebx = 13 - number subfunction
1264
  * ebx = 13 - subfunction number
1231
  * ecx = 5 - number of the function of the driver
1265
  * ecx = 5 - number of the driver function
1232
  * edx = 0/1 - reduce/increase a size on a horizontal by one position
1266
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1233
  * edx = 2/3 - in current realization is not supported; is planned as
1267
  * edx = 2/3 - is not supported in the current implementation;
1234
    decrease/increase of a size on a vertical for one position
1268
    is planned as decrease/increase vertical size on 1 position
1235
Returned value:
1269
Returned value:
1236
  * eax = -1 - driver is not loaded or is not initialized
1270
  * eax = -1 - driver is not loaded or not initialized
1237
  * eax = 0 - successfully
1271
  * eax = 0 - success
1238
  * ebx, ecx fail
1272
  * ebx, ecx destroyed
1239
Remarks:
1273
Remarks:
1240
  * Driver previously should be initialized by function call of the driver 1.
1274
  * Driver must be initialized by call to driver function 1.
1241
  * Function influences only a physical size of the map on the screen monitor;
1275
  * Function influences only the physical size of the screen image;
1242
    the logical size (number of pixels) does not vary.
1276
    the logical size (number of pixels) does not change.
1243
 
1277
 
1244
======================================================================
1278
======================================================================
1245
=============== Function 22 - install system date/time. ==============
1279
================= Function 22 - set system date/time. ================
1246
======================================================================
1280
======================================================================
1247
Parameters:
1281
Parameters:
1248
  * eax = 22 - number of the function
1282
  * eax = 22 - function number
1249
  * ebx = 0 - install time
1283
  * ebx = 0 - set time
1250
    * ecx = 0x00SSMMHH - time in a binary-decimal code (BCD):
1284
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1251
    * HH=hour 00..23
1285
    * HH=hour 00..23
1252
    * MM=minute 00..59
1286
    * MM=minute 00..59
1253
    * SS=second 00..59
1287
    * SS=second 00..59
1254
  * ebx = 1 - óñòàíîâèòü äàòó
1288
  * ebx = 1 - set date
1255
    * ecx = 0x00DDMMYY - date in a binary-decimal code (BCD):
1289
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1256
    * DD=day 01..31
1290
    * DD=day 01..31
1257
    * MM=month 01..12
1291
    * MM=month 01..12
1258
    * YY=year 00..99
1292
    * YY=year 00..99
1259
  * ebx = 2 - install day of week
1293
  * ebx = 2 - set day of week
1260
    * ecx = 1 for Sunday, ..., 7 for Saturday
1294
    * ecx = 1 for Sunday, ..., 7 for Saturday
1261
  * ebx = 3 - install an alarm clock
1295
  * ebx = 3 - set alarm clock
1262
    * ecx = 0x00SSMMHH
1296
    * ecx = 0x00SSMMHH
1263
Returned value:
1297
Returned value:
1264
  * eax = 0 - successfully
1298
  * eax = 0 - success
1265
  * eax = 1 - parameter is given incorrectly
1299
  * eax = 1 - incorrect parameter
1266
  * eax = 2 - CMOS-battery was unloaded
1300
  * eax = 2 - CMOS-battery was unloaded
1267
Remarks:
1301
Remarks:
1268
  * value of installation of day of week is represented doubtful, as it a
1302
  * Value of installation of day of week seems to be doubtful,
-
 
1303
    as it a little where is used
1269
    little where is used (day of week it is possible to calculate by date of).
1304
    (day of week can be calculated by date).
1270
  * Alarm clock can be installed on operation in the given time each day.
1305
  * Alarm clock can be set on operation in the given time every day.
1271
    Thus to disable by its existing system functions it is impossible.
1306
    But there is no existing system function to disable it.
1272
  * Operation of an alarm clock consists in generation IRQ8.
1307
  * Operation of alarm clock consists in generation IRQ8.
1273
  * Generally CMOS supports for an alarm clock installation of value 0xFF
1308
  * Generally CMOS supports for alarm clock set of value 0xFF
1274
    as one of parameters and means it, that the appropriate parameter
1309
    as one of parameters and it means that the appropriate parameter
1275
    is ignored. But in current implementation it will not pass
1310
    is ignored. But current implementation does not allow this
1276
    (will return value 1).
1311
    (will return 1).
1277
  * Alarm clock - global system resource; the installation of an alarm clock
1312
  * Alarm clock is a global system resource; the set of
1278
    automatically cancels the previous installation. However, at present any
1313
    an alarm clock cancels automatically the previous set.
1279
    program it does not use.
1314
    However, at moment no program uses it.
1280
 
1315
 
1281
======================================================================
1316
======================================================================
1282
============== Function 23 - expect event with timeout. =============
1317
============= Function 23 - wait for event with timeout. =============
1283
======================================================================
1318
======================================================================
-
 
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
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,
1300
    with eax=0, if the addition ebx with current value of the counter of time
1336
    if the addition of ebx with the current value of time counter
1301
    will call 32-bit overflow.
1337
    makes 32-bit overflow.
1302
 
1338
 
1303
======================================================================
1339
======================================================================
1304
======= Function 24, subfunction 1 - begin to play a CD - audio. =====
1340
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1305
======================================================================
1341
======================================================================
1306
Parameters:
1342
Parameters:
1307
  * eax = 24 - number of the function
1343
  * eax = 24 - function number
1308
  * ebx = 1 - number subfunction
1344
  * ebx = 1 - subfunction number
1309
  * ecx = 0x00FRSSMM, where
1345
  * ecx = 0x00FRSSMM, where
1310
     * MM = initial minute
1346
    * MM = starting minute
1311
     * SS = initial second
1347
    * SS = starting second
1312
     * FR = initial frame
1348
    * FR = starting frame
1313
Returned value:
1349
Returned value:
1314
   * eax = 0 - successfully
1350
  * eax = 0 - success
1315
   * eax = 1 - base CD is not defined
1351
  * eax = 1 - CD base is not defined
1316
Remarks:
1352
Remarks:
1317
  * Previously it is necessary to define a base port CD by call
1353
  * Previously CD base must be defined by the call to 
1318
    subfunction 3 functions 21.
1354
    subfunction 3 of function 21.
1319
  * In one second 75 frames, in one minute 60 seconds.
1355
  * One second includes 75 frames, one minute includes 60 seconds.
1320
  * Function is asynchronous (returns handle, when the playing) began.
1356
  * The function is asynchronous (returns control, when play begins).
1321
 
1357
 
1322
======================================================================
1358
======================================================================
1323
====== Function 24, subfunction 2 - get information on tracks. =======
1359
======= Function 24, subfunction 2 - get information on tracks. ======
1324
======================================================================
1360
======================================================================
1325
Parameters:
1361
Parameters:
1326
  * eax = 24 - number of the function
1362
  * eax = 24 - function number
1327
  * ebx = 2 - number subfunction
1363
  * ebx = 2 - subfunction number
1328
  * ecx = pointer on the buffer for the table
1364
  * ecx = pointer to the buffer for the table
1329
    (maximal 8*64h+4 byte =100 tracks)
1365
    (maximum 8*64h+4 bytes=100 tracks)
1330
Returned value:
1366
Returned value:
1331
  * eax = 0 - successfully
1367
  * eax = 0 - success
1332
  * eax = 1 - base CD is not defined
1368
  * eax = 1 - CD base is not defined
1333
Remarks:
1369
Remarks:
1334
  * The format of the table with the information on tracks same, as well
1370
  * The format of the table with tracks information is the same as
1335
    as for a ATAPI-CD of the command 43h (READ TOC), usual table
1371
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1336
    (subcommand 00h). The addresses come back in the format MSF.
1372
    Function returns addresses in MSF.
1337
  * Previously it is necessary to define a base port CD by call
1373
  * Previously CD base port must be set by call to 
1338
    subfunction 3 functions 21.
1374
    subfunction 3 of function 21.
1339
  * Function returns the information only about no more than 100 first tracks.
1375
  * Function returns information only about no more than 100
1340
    In most cases it is enough of it.
1376
    first tracks. In most cases it is enough.
1341
 
1377
 
1342
======================================================================
1378
======================================================================
1343
========= Function 24, subfunction 3 - stop play CD - audio. =========
1379
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1344
======================================================================
1380
======================================================================
1345
Parameters:
1381
Parameters:
1346
  * eax = 24 - number of the function
1382
  * eax = 24 - function number
1347
  * ebx = 1 - number subfunction
1383
  * ebx = 1 - subfunction number
1348
Returned value:
1384
Returned value:
1349
  * eax = 0 - successfully
1385
  * eax = 0 - success
1350
  * eax = 1 - base CD is not defined
1386
  * eax = 1 - CD base is not defined
1351
Remarks:
1387
Çàìå÷àíèÿ:
1352
  * Previously it is necessary to define a base port CD by call
1388
  * Previously CD base port must be defined by call to 
1353
    subfunction 3 functions 21.
1389
    subfunction 3 of function 21.
1354
 
1390
 
1355
======================================================================
1391
======================================================================
1356
================= Function 25 - install volume SBPro. ================
1392
=================== Function 25 - set SBPro volume. ==================
1357
======================================================================
1393
======================================================================
-
 
1394
Parameters:
1358
Parameters:
1395
  * eax = 25 - function number
1359
  * eax = 25 - number of the function
1396
  * ebx = what to set:
1360
  * ebx = what to install:
1397
    * 1 - set common volume
1361
    * 1 - install common volume
1398
    * 2 - set CD-audio volume
1362
    * 2 - install volume of CD - audio
1399
  * cl = volume level: high 4 bits for the left column,
1363
  * cl = Level of volume: high 4 bits for the left column, low 4 - for right
1400
    low 4 bits for the right one
1364
Returned value:
1401
Returned value:
-
 
1402
  * eax = 0 - success
1365
  * eax = 0 - successfully
1403
  * eax = 1 - SB base is not defined
1366
  * eax = 1 - base SB is not defined
1404
  * eax = 2 - incorrect subfunction
1367
  * eax = 2 - incorrect subfunction
1405
Remarks:
1368
Remarks:
1406
  * Previously SB base port must be defined by 
1369
  * Previously it is necessary to define a base port SB by call
1407
    subfunction 4 of function 21.
1370
    subfunction 4 functions 21.
1408
  * See also function 28 which sets
1371
  * See also function 28 installations of a sound for later standard SB16.
1409
    volume for the later standard SB16.
1372
 
1410
 
1373
======================================================================
1411
======================================================================
1374
======== Function 26, subfunction 1 - get base port MPU MIDI. ========
1412
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1375
======================================================================
1413
======================================================================
1376
Parameters:
1414
Parameters:
1377
  * eax = 26 - number of the function
1415
  * eax = 26 - function number
1378
  * ebx = 1 - number subfunction
1416
  * ebx = 1 - subfunction number
1379
Returned value:
1417
Returned value:
1380
  * eax = number of a port
1418
  * eax = port number
1381
Remarks:
1419
Parameters:
1382
  * Install a base port it is possible by call subfunction of 1 function 21.
1420
  * To set base port use subfunction 1 of function 21.
1383
 
1421
 
1384
======================================================================
1422
======================================================================
1385
========== Function 26, subfunction 2 - get keyboard layout. =========
1423
========== Function 26, subfunction 2 - get keyboard layout. =========
1386
======================================================================
1424
======================================================================
1387
The keyboard layout is used for conversion scancodes, acting from the keyboard,
1425
The keyboard layout is used to convert keyboard scancodes to
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:
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;
-
 
1446
    if Alt is not pressed, but Shift is pressed,
1408
    but is pressed Shift, the layout with Shift is used; if not are
1447
    the layout with Shift is used;
1409
    pressed Alt and Shift, but is pressed Ctrl, the normal layout is used,
1448
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1410
    then from the code is subtracted 0x60; if not any of direction keys
1449
    layout is used and then from the code is subtracted 0x60;
1411
    is pressed, the normal layout is used.
1450
    if no control key is pressed, the normal layout is used.
1412
  * Install layouts and identifier of the country it is possible with the help
1451
  * To set layout and country identifier use 
1413
    subfunction 2 functions 21.
1452
    subfunction 2 of function 21.
1414
  * The identifier of the country - global environment variable, which by
1453
  * Country identifier is global system variable, which is not used
1415
    kernel is not used; however application @panel displays an icon,
1454
    by the kernel itself; however the application '@panel' displays
1416
    appropriate to the current country (using the described function).
1455
    the corresponding icon (using this function).
1417
  * Application @panel switches layouts on search of the user.
1456
  * The application @panel switches layouts on user request.
1418
 
1457
 
1419
======================================================================
1458
======================================================================
1420
============= Function 26, subfunction 3 - get base CD. ==============
1459
============== Function 26, subfunction 3 - get CD base. =============
1421
======================================================================
1460
======================================================================
1422
Parameters:
1461
Parameters:
1423
  * eax = 26 - number of the function
1462
  * eax = 26 - function number
1424
  * ebx = 3 - number subfunction
1463
  * ebx = 3 - subfunction number
1425
Returned value:
1464
Returned value:
1426
  * eax = base CD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1465
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1427
Remarks:
1466
Remarks:
1428
  * Base CD is used by the function 24.
1467
  * CD base is used by function 24.
1429
  * Install base CD it is possible by call subfunction 3 functions 21.
1468
  * To set CD base use subfunction 3 of function 21.
1430
 
1469
 
1431
======================================================================
1470
======================================================================
1432
====== Function 26, subfunction 4 - get base port Sound Blaster. =====
1471
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
1433
======================================================================
1472
======================================================================
1434
Parameters:
1473
Parameters:
1435
  * eax = 26 - number of the function
1474
  * eax = 26 - function number
1436
  * ebx = 4 - number subfunction
1475
  * ebx = 4 - subfunction number
1437
Returned value:
1476
Returned value:
1438
  * eax = number of a base port
1477
  * eax = base port number
1439
Remarks:
1478
Remarks:
1440
  * Installation of base is necessary for operation of functions 25, 55.
1479
  * Bae port is used by functions 25, 55.
1441
  * Install a base port it is possible by call subfunction 4 functions 21.
1480
  * To set base port use subfunction 4 of function 21.
1442
 
1481
 
1443
======================================================================
1482
======================================================================
1444
======== Function 26, subfunction 5 - get language of system. ========
1483
========== Function 26, subfunction 5 - get system language. =========
1445
======================================================================
1484
======================================================================
1446
Parameters:
1485
Parameters:
1447
  * eax = 26 - number of the function
1486
  * eax = 26 - function number
1448
  * ebx = 5 - number subfunction
1487
  * ebx = 5 - subfunction number
1449
Returned value:
1488
Returned value:
1450
  * eax = language of system (1=eng, 2=fi, 3=ger, 4=rus)
1489
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1451
Remarks:
1490
Remarks:
1452
  * Language of the system - global environment variable in any way which
-
 
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
======================================================================
1496
======================================================================
1459
=========== Function 26, subfunction 6 - get base port WSS. ==========
1497
=========== Function 26, subfunction 6 - get WSS base port. ==========
1460
======================================================================
1498
======================================================================
1461
Parameters:
1499
Parameters:
1462
  * eax = 26 - number of the function
1500
  * eax = 26 - function number
1463
  * ebx = 6 - number subfunction
1501
  * ebx = 6 - subfunction number
1464
Returned value:
1502
Returned value:
1465
  * eax = base port
1503
  * eax = base port
1466
Remarks:
1504
Remarks:
1467
  * Base WSS is used by the function 27.
1505
  * WSS base is used by function 27.
1468
  * Install a base port WSS it is possible by call subfunction 6 functions 21.
1506
  * To set WSS base port use subfunction 6 of function 21.
1469
 
1507
 
1470
======================================================================
1508
======================================================================
1471
============== Function 26, subfunction 7 - get base HD. =============
1509
============== Function 26, subfunction 7 - get HD base. =============
1472
======================================================================
1510
======================================================================
1473
The base HD is necessary for definition, on what hard disk to write, at usage
1511
The HD base defines hard disk to write with usage of obsolete
1474
of out-of-date functions of operation with a file system and functions
1512
file system functions and functions implicitly using the hard disk
1475
implicitly using the hard disk (such as subfunction of 6 functions 18);
1513
(such as subfunction 6 of function 18);
1476
At usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
1514
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1477
these functions install base.
1515
these function set base themselves.
1478
Parameters:
1516
Parameters:
1479
  * eax = 26 - number of the function
1517
  * eax = 26 - function number
1480
  * ebx = 7 - number subfunction
1518
  * ebx = 7 - subfunction number
1481
Returned value:
1519
Returned value:
1482
  * eax = base HD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1520
  * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1483
Remarks:
1521
Remarks:
1484
  * Any application at any moment of time can change áàçó.
1522
  * Any application in any time can change HD base.
1485
  * Install base it is possible by call subfunction 7 functions 21.
1523
  * To set base use subfunction 7 of function 21.
1486
  * Get used partition of the hard disk it is possible subfunction 8.
1524
  * To get used partition of hard disk use subfunction 8.
1487
 
1525
 
1488
======================================================================
1526
======================================================================
1489
=========== Function 26, subfunction 8 - get partition HD. ===========
1527
========= Function 26, subfunction 8 - get used HD partition. ========
1490
======================================================================
1528
======================================================================
1491
The partition HD is necessary for definition, on what partition of the hard disk
1529
The HD partition defines partition of the hard disk to write with
1492
to write, at usage of out-of-date functions of operation with a file system and
1530
usage of obsolete file system functions and functions implicitly
1493
functions implicitly using the hard disk (such as subfunction of 6 functions
1531
using the hard disk (such as subfunction 6 of function 18);
1494
18); at usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
1532
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
1495
these functions install base and partition.
1533
these functions set base and partition themselves.
1496
Parameters:
1534
Parameters:
1497
  * eax = 26 - number of the function
1535
  * eax = 26 - function number
1498
  * ebx = 8 - number subfunction
1536
  * ebx = 8 - subfunction number
1499
Returned value:
1537
Returned value:
1500
  * eax = partition HD (beginning from 1)
1538
  * eax = HD partition (beginning from 1)
1501
Remarks:
1539
Remarks:
1502
  * Any application at any moment of time can change partition.
1540
  * Any application in any time can change partition.
1503
  * Install partition it is possible by call subfunction 8 functions 21.
1541
  * To set partition use subfunction 8 of function 21.
1504
  * Find out number of partitions on the hard disk it is possible by call
1542
  * To get number of partitions on a hard disk use
1505
    subfunction 11 functions 18.
1543
    subfunction 11 of function 18.
1506
  * Get used base of the hard disk it is possible subfunction 7.
1544
  * To get base of used hard disk, use subfunction 7.
1507
 
1545
 
1508
======================================================================
1546
======================================================================
1509
=== Function 26, subfunction 9 - get value of the counter of time. ===
1547
=== Function 26, subfunction 9 - get the value of the time counter. ==
1510
======================================================================
1548
======================================================================
1511
Parameters:
1549
Parameters:
1512
  * eax = 26 - number of the function
1550
  * eax = 26 - function number
1513
  * ebx = 9 - number subfunction
1551
  * ebx = 9 - subfunction number
1514
Returned value:
1552
Returned value:
1515
  * eax = number of 1/100 second, past from the moment of start of the system
1553
  * eax = number of 1/100s of second, past from the system boot time
1516
Remarks:
1554
Remarks:
1517
  * counter takes modulo 2^32, that there corresponds by little more+
1555
  * Counter takes modulo 2^32, that correspond to a little more
1518
    than 497 day.
1556
    than 497 days.
1519
  * System time can be get by the function 3.
1557
  * To get system time use function 3.
1520
 
1558
 
1521
======================================================================
1559
======================================================================
1522
====== Function 26, subfunction 10 - get channel DMA for a sound. ====
1560
======== Function 26, subfunction 10 - get sound DMA channel. ========
1523
======================================================================
1561
======================================================================
1524
Parameters:
1562
Parameters:
1525
  * eax = 26 - number of the function
1563
  * eax = 26 - function number
1526
  * ebx = 10 - number subfunction
1564
  * ebx = 10 - subfunction number
1527
Returned value:
1565
Returned value:
1528
  * eax = number of the channel (from 0 up to 3 inclusively)
-
 
1529
Remarks:
1566
  * eax = number of the channel (from 0 to 3 inclusive)
1530
  * Number of the channel DMA is used in subfunction 1 function 55.
1567
Remarks:
1531
  * Install the channel DMA for a sound it is possible by call
1568
  * Number of the DMA channel is used by subfunction 1 of function 55.
1532
    subfunction 10 functions 21.
1569
  * To set the sound DMA channel use subfunction 10 of function 21.
1533
 
1570
 
1534
======================================================================
1571
======================================================================
1535
====================== Function 26, subfunction 11 ===================
1572
===================== Function 26, subfunction 11 ====================
1536
========= Find out, whether low level access to HD is allowed. =======
1573
========== Find out whether low-level HD access is enabled. ==========
1537
======================================================================
1574
======================================================================
1538
Parameters:
1575
Parameters:
1539
  * eax = 26 - number of the function
1576
  * eax = 26 - function number
1540
  * ebx = 11 - number subfunction
-
 
1541
Returned value:
1577
  * ebx = 11 - subfunction number
1542
  * eax = 0/1 - prohibit/permit
1578
Returned value:
1543
Remarks:
1579
  * eax = 0/1 - disabled/enabled
1544
  * Is used at LBA-reading (subfunction 8 functions 58).
1580
Remarks:
1545
  * Install a current status it is possible by call
1581
  * Is used in LBA read (subfunction 8 of function 58).
1546
    subfunction 11 functions 21.
1582
  * To set current state use subfunction 11 of function 21.
1547
 
1583
 
1548
======================================================================
1584
======================================================================
1549
====================== Function 26, subfunction 12 ===================
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:
-
 
1556
  * eax = 0/1 - prohibit/permit
1591
Returned value:
1557
Remarks:
1592
  * eax = 0/1 - disabled/enabled
1558
  * Is used by operation with the bus PCI (function 62).
1593
Remarks:
1559
  * Current realization uses only low bit ecx.
1594
  * Is used by operations with PCI bus (function 62).
1560
  * install a current status it is possible by call
1595
  * The current implementation uses only low bit of ecx.
1561
    subfunction 12 functions 21.
1596
  * To set the current state use subfunction 12 of function 21.
1562
 
1597
 
1563
======================================================================
1598
======================================================================
1564
==== Function 27 - install volume Windows Sound System (WSS). ===
1599
======== Function 27 - set Windows Sound System (WSS) volume. ========
1565
======================================================================
1600
======================================================================
1566
Parameters:
1601
Parameters:
1567
  * eax = 27 - number of the function
1602
  * eax = 27 - function number
1568
   * ebx = what to install:
1603
  * ebx = what to set:
1569
     * 1 - install common volume
1604
    * 1 - set common volume
1570
     * 2 - install volume Line In
1605
    * 2 - set Line In volume
1571
  * cl = Level of volume (0x0 = highest, 0x1F = lowest,
1606
  * cl = volume level (0x0=highest, 0x1F=lowest,
1572
    installed bit 0x80 = to disable)
1607
    if bit 0x80 is set=disable)
1573
Returned value:
1608
Returned value:
1574
  * eax = 0 - successfully
1609
  * eax = 0 - success
1575
  * eax = 1 - the base WSS is not defined
1610
  * eax = 1 - WSS base is not defined
1576
  * eax = 2 - incorrect subfunction
1611
  * eax = 2 - incorrect subfunction
1577
Remarks:
1612
Remarks:
1578
  * Previously it is necessary to define a base port WSS by call
1613
  * Previously WSS base port must be defined by call to 
1579
    subfunction 6 functions 21.
1614
    subfunction 6 of function 21.
1580
  * Installation of common volume is actually ignored (comes back eax=0).
1615
  * Set of common volume is ignored (function simply returns eax=0).
1581
  * In old documentation and in source code of a kernel subfunction 2
1616
  * Old documentation and kernel sources erraticly name function 2
1582
    is erraticly called as volume of a CD - audio.
1617
    as CD-audio volume.
1583
 
1618
 
1584
======================================================================
1619
======================================================================
1585
================= Function 28 - install volume SB16. =================
1620
=================== Function 28 - set SB16 volume. ===================
1586
======================================================================
1621
======================================================================
1587
Parameters:
1622
Parameters:
1588
  * eax = 28 - number of the function
1623
  * eax = 28 - function number
1589
  * ebx = what to install:
1624
  * ebx = what to install:
1590
    * 1 - install common volume
1625
    * 1 - install common volume
1591
    * 2 - install volume of a CD - audio
1626
    * 2 - install CD-audio volume
1592
  * cl = level of volume (0=off, 0xFF=max)
1627
  * cl = volume level (0=off, 0xFF=max)
1593
Returned value:
1628
Returned value:
1594
  * eax = 0 - successfully
1629
  * eax = 0 - success
1595
  * eax = 1 - the base SB is not defined
1630
  * eax = 1 - SB base is not defined
1596
  * eax = 2 - incorrect subfunction
1631
  * eax = 2 - incorrect subfunction
1597
Remarks:
1632
Remarks:
1598
  * Previously it is necessary to define a base port SB by call
1633
  * Previously SB base port must be defined by
1599
    subfunction 4 functions 21.
1634
    subfunction 4 of function 21.
1600
  * This function gives more variants for volume, than function 25.
1635
  * This function gives more variants for volume, that function 25.
1601
 
1636
 
1602
======================================================================
1637
======================================================================
1603
==================== Function 29 - get system date. ==================
1638
=================== Function 29 - get system date. ===================
1604
======================================================================
1639
======================================================================
1605
Parameters:
1640
Parameters:
1606
  * eax = 29 - number of the function
1641
  * eax = 29 - function number
1607
Returned value:
1642
Returned value:
1608
  * eax = 0x00DDMMYY, where
1643
  * eax = 0x00DDMMYY, where
1609
    (binary-decimal coding is used, BCD)
1644
    (binary-decimal coding, BCD, is used)
1610
   * YY = two low digits of year (00.. 99)
1645
  * YY = two low digits of year (00..99)
1611
   * MM = month (01.. 12)
1646
  * MM = month (01..12)
1612
   * DD = day (01.. 31)
1647
  * DD = day (01..31)
1613
Remarks:
1648
Remarks:
1614
   * The system date can be installed by the function 22.
1649
  * To set system date use function 22.
1615
 
1650
 
1616
======================================================================
1651
======================================================================
1617
=============== Function 32 - delete file with ramdisk. ==============
1652
=============== Function 32 - delete file from ramdisk. ==============
1618
======================================================================
1653
======================================================================
1619
Parameters:
1654
Parameters:
1620
  * eax = 32 - number of the function
1655
  * eax = 32 - function number
1621
  * ebx = pointer on a filename
1656
  * ebx = pointer to the filename
1622
Returned value:
1657
Returned value:
1623
  * eax = 0 - successfully; differently error code of a file system
1658
  * eax = 0 - success; otherwise file system error code
1624
Remarks:
1659
Remarks:
1625
  * This function is obsolete; the function 58 allows to fulfil the same
1660
  * This function is obsolete; function 58 allows to fulfill
1626
    operations with the extended possibilities.
1661
    the same operations with the extended possibilities.
1627
  * Current realization returns only values 0 (successes)
1662
  * The current implementation returns only values 0(success) and
1628
    and 5 (the file is not retrieved).
1663
    5(file not found).
-
 
1664
  * The filename must be either in the format 8+3 characters
1629
  * The filename should be or in the format 8+3 characters (first 8 characters
1665
    (first 8 characters - name itself, last 3 - extension,
1630
    - purely name, last 3 - extension, the short names and extensions are
1666
    the short names and extensions are supplemented with spaces),
1631
    supplemented by blanks), or in the format 8.3 characters
1667
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1632
    "FILE.EXT" / "FILE.EX" (name no more than 8 characters, point,
1668
    (name no more than 8 characters, dot, extension 3 characters
1633
    extension 3 characters supplemented if necessary by blanks).
1669
    supplemented if necessary by spaces).
1634
    Filename should be written by capital letters. The completing character
1670
    The filename must be written with capital letters. The terminating
-
 
1671
    character with code 0 is not necessary (not ASCIIZ-string).
1635
    with the code 0 is not necessary (ASCIIZ-string).
1672
  * This function does not support folders on the ramdisk.
1636
 
1673
 
1637
======================================================================
1674
======================================================================
1638
=============== Function 33 - save file on ramdisk. ==================
1675
================ Function 33 - write file to ramdisk. ================
1639
======================================================================
1676
======================================================================
1640
Parameters:
1677
Parameters:
1641
  * eax = 33 - number of the function
1678
  * eax = 33 - function number
1642
  * ebx = pointer on a filename
1679
  * ebx = pointer to the filename
1643
  * ecx = pointer on data for save
1680
  * ecx = pointer to data for writing
1644
  * edx = number byte for save
1681
  * edx = number of bytes for writing
1645
  * it is necessary to install esi=0
1682
  * should be set esi=0
1646
Returned value:
1683
Returned value:
1647
  * eax = 0 - successfully, differently error code of a file system
1684
  * eax = 0 - success, otherwise file system error code
1648
Remarks:
1685
Remarks:
1649
  * This function is obsolete; the function 58 allows to fulfil the same
1686
  * This function is obsolete; function 70 allows to fulfil
1650
    operations with the extended possibilities.
1687
    the same operations with extended possibilities.
1651
  * If to specify non-zero value in esi and on ramdisk already there is an
1688
  * If esi contains non-zero value and selected file already exists,
1652
    indicated file, one more file with the same name will be created.
1689
    one more file with the same name will be created.
1653
  * Otherwise file is resave.
1690
  * Otherwise file will be overwritten.
-
 
1691
  * The filename must be either in the format 8+3 characters
1654
  * The filename should be or in the format 8+3 characters (first 8 characters
1692
    (first 8 characters - name itself, last 3 - extension,
1655
    - purely name, last 3 - extension, the short names and extensions are
1693
    the short names and extensions are supplemented with spaces),
1656
    supplemented by blanks), or in the format 8.3 characters
1694
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
1657
    "FILE.EXT" / "FILE.EX" (name no more than 8 characters, point,
1695
    (name no more than 8 characters, dot, extension 3 characters
1658
    extension 3 characters supplemented if necessary by blanks).
1696
    supplemented if necessary by spaces).
1659
    Filename should be written by capital letters. The completing character
1697
    The filename must be written with capital letters. The terminating
-
 
1698
    character with code 0 is not necessary (not ASCIIZ-string).
1660
    with the code 0 is not necessary (ASCIIZ-string).
1699
  * This function does not support folders on the ramdisk.
1661
 
1700
 
1662
======================================================================
1701
======================================================================
1663
======== Function 35 - read colour of a point on the screen. =========
1702
======= Function 35 - read the color of a pixel on the screen. =======
1664
======================================================================
1703
======================================================================
1665
Parameters:
1704
Parameters:
1666
  * eax = 35
1705
  * eax = 35
1667
  * ebx = y*xsize+x, where
1706
  * ebx = y*xsize+x, where
1668
  * (x,y) = coordinates of a point (considering from 0)
1707
  * (x,y) = coordinates of a pixel (beginning from 0)
1669
  * xsize = size of the screen on a horizontal
1708
  * xsize = horizontal screen size
1670
Returned value:
1709
Returned value:
1671
  * eax = colour 0x00RRGGBB
1710
  * eax = color 0x00RRGGBB
1672
Remarks:
1711
Remarks:
1673
  * Find out sizes of the screen it is possible by function call 14.
1712
  * To get screen sizes use function 14. Pay attention,
1674
    Pay attention, that it subtracts 1 of both sizes.
1713
    that it subtracts 1 from both sizes.
1675
  * To a video memory there is also direct access (without calls of system
1714
  * There is also direct access (without any system calls)
1676
    functions) through the selector gs. Parameters of current videomode
1715
    to videomemory through the selector gs. To get parameters of
1677
    it is possible to receive by the function 61.
1716
    the current videomode, use function 61.
1678
 
1717
 
1679
======================================================================
1718
======================================================================
1680
=========== Function 37 - get coordinate/status of mouse. ============
1719
========= Function 37 - get coordinates/status of the mouse. =========
1681
======================================================================
1720
======================================================================
1682
 
1721
 
1683
------------ Subfunction 0 - screen coordinates of mouse -------------
1722
---------- Subfunction 0 - screen coordinates of the mouse -----------
1684
Parameters:
1723
Parameters:
1685
  * eax = 37 - number of the function
1724
  * eax = 37 - function number
1686
  * ebx = 0 - number subfunction
1725
  * ebx = 0 - subfunction number
-
 
1726
Returned value:
1687
Returned value:
1727
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1688
  * eax = x*65536 + y, (x,y)=coordinates of mouse pointer (considering from 0)
1728
    (beginning from 0)
1689
 
1729
 
1690
------ Subfunction 1 - coordinates of mouse concerning  window -------
1730
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1691
Parameters:
1731
Parameters:
1692
  * eax = 37 - number of the function
1732
  * eax = 37 - function number
1693
  * ebx = 1 - number subfunction
1733
  * ebx = 1 - subfunction number
1694
Returned value:
1734
Returned value:
1695
  * eax = x*65536 + y, (x,y)=coordinates of mouse pointer concerning
1735
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1696
    an application window (considering from 0)
1736
    relative to the application window (beginning from 0)
1697
Remarks:
1737
Remarks:
1698
  * Value is calculated under the formula (x-xwnd) *65536 + (y-ywnd).
1738
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1699
    If y > =ywnd, the low word nonnegatively also contains relative
1739
    If y>=ywnd, the low word is non-negative and contains
-
 
1740
    relative y-coordinate, and the high word - relative x-coordinate
1700
    y-coordinate, and high - relative x-coordinate (correct sign).
1741
    (with correct sign). Otherwise the low word is negative and still
1701
    Otherwise low word negatively and all the same contains relative
1742
    contains relative y-coordinate, and to the high word
1702
    y-coordinate, and to a high word it is necessary to add 1.
1743
    1 should be added.
1703
 
1744
 
1704
---------------- Subfunction 2 - pressed mouse buttons ----------------
1745
------------ Subfunction 2 - pressed buttons of the mouse ------------
1705
Parameters:
1746
Parameters:
1706
  * eax = 37 - number of the function
1747
  * eax = 37 - function number
1707
  * ebx = 2 - number subfunction
1748
  * ebx = 2 - subfunction number
1708
Returned value:
1749
Returned value:
1709
  * eax contains  information on the pressed mouse buttons:
1750
  * eax contains information on the pressed mouse buttons:
1710
  * Bit 0 installed = left button pressed
1751
  * bit 0 is set = left button is pressed
1711
  * Bit 1 installed = right button pressed
1752
  * bit 1 is set = right button is pressed
1712
  * Other bits are reset
1753
  * other bits are cleared
1713
 
1754
 
1714
======================================================================
1755
======================================================================
1715
====================== Function 38 - draw line. ======================
1756
====================== Function 38 - draw line. ======================
1716
======================================================================
1757
======================================================================
1717
Parameters:
1758
Parameters:
1718
  * eax = 38 - number of the function
1759
  * eax = 38 - function number
1719
  * ebx = [coordinate began on axis x] *65536 +
1760
  * ebx = [start coordinate on axis x]*65536 +
1720
              [coordinate of the end on axis x]
1761
              [end coordinate on axis x]
1721
  * ecx = [coordinate began on axis y]*65536 +
1762
  * ecx = [start coordinate on axis y]*65536 +
1722
              [coordinate of the end on axis y]
1763
              [end coordinate on axis y]
1723
  * edx = 0x00RRGGBB - colour
1764
  * edx = 0x00RRGGBB - color
1724
Returned value:
1765
Returned value:
1725
  * function does not return value
1766
  * function does not return value
1726
Remarks:
1767
Remarks:
1727
  * Coordinates take concerning window.
1768
  * Coordinates are relative to the window.
1728
  * Finite point also is drawn.
1769
  * End point is also drawn.
1729
 
1770
 
1730
======================================================================
1771
======================================================================
1731
===== Function 39, subfunction 1 - get size of background image. =====
1772
== Function 39, subfunction 1 - get a size of the background image. ==
1732
======================================================================
1773
======================================================================
1733
Parameters:
1774
Parameters:
1734
  * eax = 39 - number of the function
1775
  * eax = 39 - function number
1735
  * ebx = 1 - number subfunction
1776
  * ebx = 1 - subfunction number
1736
Returned value:
1777
Returned value:
1737
  * eax = [width]*65536 + [height]
1778
  * eax = [width]*65536 + [height]
1738
Remarks:
1779
Remarks:
1739
  * There is a pair command of installation of sizes of background image -
1780
  * There is a pair function to set sizes of background image -
1740
    subfunction of 1 function 15. After which, certainly, it is necessary
1781
    subfunction 1 of function 15. After which it is necessary,
1741
    anew to define image.
1782
    of course, anew to define image.
1742
 
1783
 
1743
======================================================================
1784
======================================================================
1744
== Function 39, subfunction 2 - read a point from background image. ==
1785
== Function 39, subfunction 2 - get pixel from the background image. =
1745
======================================================================
1786
======================================================================
1746
Parameters:
1787
Parameters:
1747
  * eax = 39 - number of the function
1788
  * eax = 39 - function number
1748
  * ebx = 2 - number subfunction
1789
  * ebx = 2 - subfunction number
1749
  * ecx = offset
1790
  * ecx = offset
1750
Returned value:
1791
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.
-
 
1798
  * Offset for pixel with coordinates (x,y)
1756
  * Offset of a point with coordinates (x, y) is calculated as (x+y*xsize) *3.
1799
    is calculated as (x+y*xsize)*3.
1757
  * There is a pair function of installation of a point on background image -
1800
  * There is a pair function to set pixel on the background image - 
1758
    subfunction 2 functions 15.
1801
    subfunction 2 of function 15.
1759
 
1802
 
1760
======================================================================
1803
======================================================================
1761
==== Function 39, subfunction 4 - get mode redraw of background. =====
1804
== Function 39, subfunction 4 - get drawing mode for the background. =
1762
======================================================================
1805
======================================================================
1763
Parameters:
1806
Parameters:
1764
  * eax = 39 - number of the function
1807
  * eax = 39 - function number
1765
  * ebx = 4 - number subfunction
1808
  * ebx = 4 - subfunction number
1766
Returned value:
1809
Returned value:
1767
  * eax = 1 - tiled
1810
  * eax = 1 - tile
1768
  * eax = 2 - stretched
1811
  * eax = 2 - stretch
1769
Remarks:
1812
Remarks:
1770
  * There is a pair function of installation of mode redraw of a background -
1813
  * There is a pair function to set drawing mode - 
1771
    subfunction 4 functions 15.
1814
    subfunction 4 of function 15.
1772
 
1815
 
1773
======================================================================
1816
======================================================================
1774
========== Function 40 - install a mask for expected events. =========
1817
=========== Function 40 - set the mask for expected events. ==========
1775
======================================================================
1818
======================================================================
1776
Mask for expected events influences function of operation with events 10,
1819
The mask for expected events affects function working with events
1777
11, 23 - they inform only events allowed by this mask.
1820
10, 11, 23 - they notify only about events allowed by this mask.
1778
Parameters:
1821
Parameters:
1779
  * eax = 40 - number of the function
1822
  * eax = 40 - function number
1780
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1823
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1781
    (installed bit permits notice on event)
1824
    (set bit permits notice on event)
1782
Returned value:
1825
Returned value:
1783
  * function does not return value
1826
  * function does not return value
1784
Remarks:
1827
Remarks:
1785
  * Mask by default (7=111b) permits notices about redraw,
1828
  * Default mask (7=111b) enables nofices about redraw,
1786
    pressings keys and buttons.
-
 
1787
    It is enough of it for the majority of the applications.
1829
    keys and buttons. This is enough for many applications.
1788
  * The events prohibited in a mask, are all same saved, if come;
1830
  * Events prohibited in the mask are saved anyway, when come;
1789
    with events simply do not inform on them functions of operation.
1831
    they are simply not informed with event functions.
1790
  * Functions of operation with events take into account a mask on moment
1832
  * Event functions take into account the mask on moment of
1791
    of function call, instead of on moment of arrival of message.
1833
    function call, not on moment of event arrival.
1792
 
1834
 
1793
======================================================================
1835
======================================================================
1794
=============== Function 41 - find out the owner IRQ. ================
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
1803
 
1845
 
1804
======================================================================
1846
======================================================================
1805
=============== Function 42 - read data obtained on IRQ. =============
1847
==================== Function 42 - read IRQ data. ====================
1806
======================================================================
1848
======================================================================
1807
At occurrence IRQ system can read out data from indicated earlier by
1849
When an IRQ occurs, the system reads data from ports indicated
1808
function 44 ports and to write these data in buffer.
1850
earlier by function 44 and writes this data to
1809
Described function reads out on byte the data from this buffer.
1851
internal buffer. This function reads out data from that buffer
-
 
1852
bytewise.
1810
Parameters:
1853
Parameters:
1811
  * eax = 42 - number of the function
1854
  * eax = 42 - function number
1812
  * ebx = number IRQ, 0..15
1855
  * ebx = IRQ number, 0..15
1813
Returned value: (situation can be distinguished on value ecx)
1856
Returned value: (use value of ecx to distinguish)
1814
  * if thread is not owner IRQ
1857
  * if the thread is not IRQ owner (or IRQ number is incorrect):
1815
    (or number IRQ is given incorrectly):
-
 
1816
    * ecx = 2
1858
    * ecx = 2
1817
  * if data is not present:
1859
  * if there is no data:
1818
    * eax = 0
1860
    * eax = 0
1819
    * ecx = 1
1861
    * ecx = 1
1820
    * ebx fail
1862
    * ebx destroyed
1821
  * if all in the order and data were:
1863
  * if all is ok:
1822
    * eax = size given, yet not read from the buffer (in bytes)
1864
    * eax = byte size of data, not yet read from buffer
1823
    * ecx = 0
1865
    * ecx = 0
1824
    * ebx = current byte
1866
    * ebx = current byte
1825
Remarks:
1867
Remarks:
1826
  * Previously thread should reserve for itself indicated IRQ
1868
  * Previously the thread must reserve indicated IRQ for itself
1827
    by the function 45.
1869
    by function 45.
1828
  * Size of the buffer for the data - 4000 bytes, at overflow
1870
  * The size of data buffer is 4000 bytes, on overflow
1829
    the "fresh" data cease to be written in the buffer.
1871
    "fresh" data cease to be written in the buffer.
1830
 
1872
 
1831
======================================================================
1873
======================================================================
1832
================ Function 43 - input/output in port. =================
1874
================ Function 43 - input/output to a port. ===============
1833
======================================================================
1875
======================================================================
1834
 
1876
 
1835
------------------------ Data output in port -------------------------
1877
------------------------ Output data to port -------------------------
1836
Parameters:
1878
Parameters:
1837
  * eax = 43 - number of the function
1879
  * eax = 43 - function number
1838
  * bl = byte for output
1880
  * bl = byte for output
1839
  * ecx = number of port 0xnnnn (from 0 up to 0xFFFF)          
1881
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1840
Returned value:
1882
Returned value:
1841
  * eax = 0 - successfully
1883
  * eax = 0 - success
1842
  * eax = 1 - thread the indicated port has not reserved
1884
  * eax = 1 - the thread has not reserved the selected port
1843
 
1885
 
1844
------------------------ Data input from a port ------------------------
1886
------------------------ Input data from port ------------------------
1845
Parameters:
1887
Parameters:
1846
  * eax = 43 - number of the function              
1888
  * eax = 43 - function number
1847
  * ebx ignored
1889
  * ebx is ignored
1848
  * ecx = 0x8000nnnn, where nnnn = number of port (from 0 up to 0xFFFF)
1890
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1849
Returned value:
1891
Returned value:
1850
  * eax = 0 - successfully, thus ebx = entered byte
1892
  * eax = 0 - success, thus ebx = entered byte
1851
  * eax = 1 - thread the given port has not reserved
1893
  * eax = 1 - the thread has not reserved the selected port
1852
Remarks:
1894
Remarks:
1853
  * Previously thread should reserve behind itself the indicated port
1895
  * Previously the thread must reserve the selected port
1854
    by the function 46.
1896
    for itself by function 46.
1855
  * For the reserved ports instead of call of these functions it is better
-
 
1856
    to use commands of the processor in/out is much faster both a little bit
1897
  * Instead of call to this function it is better to use
1857
    more shortly and easier. From the non-reserved ports to read all the same
1898
    processor instructions in/out - this is much
1858
    it is impossible.
1899
    faster and a bit shorter and easier.
1859
 
1900
 
1860
======================================================================
1901
======================================================================
1861
=========== Function 44 - define operations at arrival IRQ. ==========
1902
=========== Function 44 - define operations at IRQ arrival. ==========
1862
======================================================================
1903
======================================================================
1863
At occurrence IRQ the system can read out the data from the ports, indicated
1904
At IRQ arrival the system can read the data from ports defined
1864
by this function, and to write these data in the buffer, whence they can be
1905
by this function and write these data to internal buffer, whence
1865
read by the function 42.
1906
they can be read by ôóíêöèåé 42.
1866
Parameters:
1907
Parameters:
1867
  * eax = 44 - number of the function
1908
  * eax = 44 - function number
1868
  * ebx = pointer on the array of structures describing on one port:
1909
  * ebx = pointer to the array of structures each describing one port:
1869
    * +0: word: 0 means the end of the array, differently number of a port
1910
    * +0: word: 0 means end of array, otherwise port number
1870
    * +2: byte: reserved (ignored)
1911
    * +2: byte: reserved (ignored)
1871
    * +3: byte: 1 = read out byte from this port, 2 = read out a word
1912
    * +3: byte: 1=read byte from this port, 2=read word
1872
  * ecx = number IRQ, 0..15
1913
  * ecx = IRQ number, 0..15
1873
Returned value:
1914
Returned value:
1874
  * eax = 0 - successfully
1915
  * eax = 0 - success
1875
  * eax = 1 - thread is not owner indicated IRQ
1916
  * eax = 1 - the thread is not owner of selected IRQ
1876
Remarks:
1917
Remarks:
1877
  * Previously thread should reserve behind itself indicated IRQ
1918
  * Previously the thread must reserve for itself selected IRQ
1878
    by the function 45.
1919
    by function 45.
1879
  * First 16 ports are considered only.
1920
  * First 16 ports are considered only.
1880
  * Current implementation considers incorrect value of a field +3
1921
  * The current implementation considers incorrect value of field +3
1881
    as a signal of termination of processing IRQ.
1922
    as a signal to terminate IRQ processing.
1882
 
1923
 
1883
======================================================================
1924
======================================================================
1884
============ Function 45 - reserve/free IRQ. ============
1925
=================== Function 45 - reserve/free IRQ. ==================
1885
======================================================================
1926
======================================================================
1886
Parameters:
1927
Parameters:
-
 
1928
  * eax = 45 - function number
1887
  * eax = 45 - number of the function
1929
  * ebx = 0 - reserve, 1 = free
1888
  * ebx = 0 - reserve, 1 = free
1930
  * ecx = IRQ number, 0..15
1889
  * ecx = number IRQ, 0..15
1931
Returned value:
1890
Returned value:
1932
  * eax = 0 - success
1891
  * eax = 0 - successfully
1933
  * eax = 1 - error (invalid IRQ number
1892
  * eax = 1 - error (incorrect number IRQ or attempt reserve not free IRQ
1934
    or attempt to reserve not free IRQ
1893
    or to free IRQ, not reserved by current stream)
1935
    or to free IRQ, not reserved by this thread)
1894
Remarks:
1936
Remarks:
-
 
1937
  * IRQ reservation is required for functions 42 and 44.
1895
  * Reserved IRQ is necessary for operation of functions 42 and 44.
1938
  * Only one thread can reserve the specific IRQ.
1896
  * Only one thread can reserve selected IRQ.
1939
  * IRQs, handled by the system itself, are reserved by the system
1897
  * IRQ, processed by the system is independent, are reserved by
1940
    (thread 1) at booting.
1898
    the system (stream 1) at loading.
1941
  * When a thread terminates, all reserved by it IRQs
1899
  * At completion thread are automatically released all reserved by it IRQ.
1942
    are freed automatically.
-
 
1943
 
1900
 
1944
======================================================================
1901
======================================================================
1945
====== Function 46 - reserve/free a group of input/output ports. =====
1902
==== Function 46 - reserve/free group of ports of input/output. ====== 
1946
======================================================================
1903
======================================================================
1947
To work with reserved ports an application can access directly by
1904
It is possible to access to the reserved ports directly from the application by
1948
commands in/out (recommended way) and can use function 43
1905
commands in/out (recommended way) and function call 43 (not recommended way).
1949
(not recommended way).
1906
Parameters:
1950
Parameters:
1907
  * eax = 46 - number of the function
1951
  * eax = 46 - function number
1908
  * ebx = 0 - reserve, 1 - free
1952
  * ebx = 0 - reserve, 1 - free
1909
  * ecx = number of a beginning of a range of ports
1953
  * ecx = start port number
1910
  * edx = number of the end of a range of ports (inclusively)
1954
  * edx = end port number (inclusive)
1911
Returned value:
1955
Returned value:
1912
  * eax = 0 - successfully
1956
  * eax = 0 - success
1913
  * eax = 1 - error
1957
  * eax = 1 - error
1914
Remarks:
1958
Remarks:
1915
  * In case of backup of ports the error considers execution of one
1959
  * For ports reservation: an error occurs if and only if
1916
    of conditions:
1960
    one from the following condition satisfies:
1917
    * beginning address more than end address;
1961
    * start port is more than end port;
1918
    * indicated range contains incorrect number of a port
1962
    * the selected range contains incorrect port number
1919
      (correct - from 0 up to 0xFFFF);
1963
      (correct are from 0 to 0xFFFF);
1920
    * limitation on a total number of the reserved areas -
1964
    * limit for the total number of reserved areas is exceeded
1921
      is exceeded the maximal 255 is admitted;
1965
      (maximum 255 are allowed);
1922
    * indicated range is intersected with one of earlier reserved
1966
    * the selected range intersects with any of earlier reserved
1923
  * In case of release of ports the error considers attempt of release of
1967
  * For ports free: an error is an attempt to free range,
1924
    a range, which was not wholly reserved by same function (with the same
1968
    that was not earlier reserved by this function
-
 
1969
    (with same ecx,edx).
1925
    values ecx, edx) earlier.
1970
  * If an error occurs (for both cases) function performs no action.
1926
  * At detection of an error (in both cases) any operations is not does.
1971
  * At booting the system reserves for itself ports 0..0xff, and if
1927
  * At loading the system reserved behind itself ports 0.. 0xff, and at
1972
    COM-mouse is detected - additionally range of COM-ports
1928
    detection of COM-mouse - in addition range of COM-ports 0x3f0.. 0x3ff
1973
    0x3f0..0x3ff and/or 0x2f0..0x2ff.
1929
    and/or 0x2f0.. 0x2ff.
1974
  * When a thread terminates, all reserved by it ports
1930
  * At completion thread all ports, reserved by it are automatically free.
1975
    are freed automatically.
1931
 
1976
 
1932
======================================================================
1977
======================================================================
1933
============== Function 47 - draw number in window. ==================
1978
============= Function 47 - draw a number in the window. =============
1934
======================================================================
1979
======================================================================
1935
Parameters:
1980
Parameters:
1936
  * eax = 47 - number of the function
1981
  * eax = 47 - function number
1937
  * ebx = parameters of conversion of number in the text:
1982
  * ebx = parameters of conversion number to text:
1938
    * bl = 0 - ecx contains number
1983
    * bl = 0 - ecx contains number
1939
    * bl = 1 - ecx contains the pointer on dword-number
1984
    * bl = 1 - ecx contains pointer to dword-number
1940
    * bh = 0 - to display in a decimal number system
1985
    * bh = 0 - display in decimal number system
1941
    * bh = 1 - to display in the hexadecimal system
1986
    * bh = 1 - display in hexadecimal system
1942
    * bh = 2 - to display in the binary system
1987
    * bh = 2 - display in binary system
1943
    * Bits 16-21 = how many digits to display
1988
    * áèòû 16-21 = how many digits to display
1944
    * The bits 22-31 are reserved and should be installed in 0
1989
    * áèòû 22-31 reserved and must be set to 0
1945
  * ecx = number (at bl=0) or pointer (at bl=1)
1990
  * ecx = number (if bl=0) or pointer (if bl=1)
1946
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1991
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1947
  * esi = 0xN0RRGGBB, RRGGBB=colour, N=font (0/1)
1992
  * esi = 0xN0RRGGBB, RRGGBB=color, N=font (0/1)
1948
Returned value:
1993
Returned value:
1949
  * function does not return value
1994
  * function does not return value
1950
Remarks:
1995
Remarks:
1951
  * Indicated length should not exceed 60.
1996
  * The given length must not exceed 60.
1952
  * The equally indicated amount of digits is output. If the number a little
1997
  * The exactly given amount of digits is output. If number is small
1953
    also can be written by smaller amount of digits, it is supplemented by
1998
    and can be written by smaller amount of digits, it is supplemented
1954
    leading zeroes; if the number is great and can not be written by such
1999
    by leading zeroes; if the number is big and can not be written by
1955
    amount of digits, the "superfluous" carrying on digits are not draw.
2000
    given amount of digits, extra digits are not drawn.
1956
  * Parameters of fonts are indicated in the description of the function 4
2001
  * Parameters of fonts are shown in the description of function 4
1957
    (output of the text).
2002
    (text output).
1958
 
2003
 
1959
======================================================================
2004
======================================================================
1960
===== Function 48, subfunction 0 - apply adjustments of screen. ======
2005
========= Function 48, subfunction 0 - apply screen settings. ========
1961
======================================================================
2006
======================================================================
1962
Parameters:
2007
Parameters:
1963
  * eax = 48 - number of the function
2008
  * eax = 48 - function number
1964
  * ebx = 0 - number subfunction
2009
  * ebx = 0 - subfunction number
1965
  * ecx = 0 - reserved
2010
  * ecx = 0 - reserved
1966
Returned value:
2011
Returned value:
1967
  * function does not return value
2012
  * function does not return value
1968
Remarks:
2013
Remarks:
1969
  * Function redraw the screen after change of parameters
2014
  * Function redraws the screen after parameters change by
1970
    subfunctions 1 and 2.
2015
    subfunctions 1 and 2.
1971
  * Function call without prior calls indicated subfunctions is ignored.
2016
  * Function call without prior call to one of indicated subfunctions
-
 
2017
    is ignored.
1972
  * Function call with non-zero ecx is ignored.
2018
  * Function call with nonzero ecx is ignored.
1973
 
2019
 
1974
======================================================================
2020
======================================================================
1975
======= Function 48, subfunction 1 - install style of buttons. =======
2021
=========== Function 48, subfunction 1 - set button style. ===========
1976
======================================================================
2022
======================================================================
1977
Parameters:
2023
Parameters:
1978
  * eax = 48 - number of the function
2024
  * eax = 48 - function number
1979
  * ebx = 1 - number subfunction
2025
  * ebx = 1 - subfunction number
1980
  * ecx = type of buttons:
2026
  * ecx = button style:
1981
    * 0 = flat buttons
2027
    * 0 = flat
1982
    * 1 = 3d buttons
-
 
1983
Returned value:
-
 
1984
  * function does not return value
-
 
1985
Remarks:
-
 
1986
  * After call of the described function follows redraw
-
 
1987
    the screen subfunction 0.
-
 
1988
  * Type of buttons influences only their plotting by the function 8.
-
 
1989
 
-
 
1990
========================================================================
-
 
1991
== Function 48, subfunction 2 - install standard colours of windows. ===
-
 
1992
========================================================================
-
 
1993
Parameters:
-
 
1994
  * eax = 48 - number of the function
-
 
1995
  * ebx = 2 - number subfunction
-
 
1996
  * ecx = pointer on the color table
-
 
1997
  * edx = size of the color table
-
 
1998
    (should be 40 bytes for the future compatibility)
-
 
1999
Format of the color table is indicated in the description subfunction 3.
2028
    * 1 = 3d
2000
Returned value:
2029
Returned value:
2001
  * function does not return value
2030
  * function does not return value
2002
Remarks:
2031
Remarks:
2003
  * After call of the described function follows redraw
2032
  * After call to this function one should redraw the screen by
2004
    the screen subfunction 0.
2033
    subfunction 0.
2005
  * Table of standard colours influences only the applications, which receive
2034
  * Button style influences only to their draw of function 8.
2006
    this table by an obvious way (subfunction 3) and use (specifying colours
-
 
2007
    from it by calls of functions of drawing).
-
 
2008
  * Table of standard colours enters in skin and is installed anew
-
 
2009
    at installation skin (subfunction 8).
-
 
2010
  * Color table can be viewed/changed online with the help of
-
 
2011
    the application desktop.
-
 
2012
 
2035
 
2013
======================================================================
2036
======================================================================
2014
=== Function 48, subfunction 3 - get standard colours of windows. ====
2037
====== Function 48, subfunction 2 - set standard window colors. ======
2015
======================================================================
2038
======================================================================
2016
Parameters:
2039
Parameters:
2017
  * eax = 48 - number of the function
2040
  * eax = 48 - function number
2018
  * ebx = 3 - number subfunction
2041
  * ebx = 2 - subfunction number
2019
  * ecx = pointer on the buffer the size edx byte, where will write the table
2042
  * ecx = pointer to the color table
2020
  * edx = size of the color table
2043
  * edx = size of the color table
-
 
2044
    (must be 40 bytes for future compatibility)
2021
    (should be 40 bytes for the future compatibility)
2045
Format of the color table is shown in description of subfunction 3.
2022
Returned value:
2046
Returned value:
-
 
2047
  * function does not return value
-
 
2048
Remarks:
-
 
2049
  * After call to this function one should redraw the screen by
-
 
2050
    subfunction 0.
-
 
2051
  * Table of standard colors influences only to applications,
-
 
2052
    which receive this table obviously (by subfunction 3)
-
 
2053
    and use it (specifying colors from it to drawing functions).
-
 
2054
  * Table of standard colors is included in skin and is installed
-
 
2055
    anew with skin installation (by subfunction 8).
-
 
2056
  * Color table can be viewed/changed interactively with
-
 
2057
    the application 'desktop'.
-
 
2058
 
-
 
2059
======================================================================
-
 
2060
====== Function 48, subfunction 3 - get standard window colors. ======
-
 
2061
======================================================================
-
 
2062
Parameters:
-
 
2063
  * eax = 48 - function number
-
 
2064
  * ebx = 3 - subfunction number
-
 
2065
  * ecx = pointer to the buffer with size edx bytes,
-
 
2066
    where table will be written
-
 
2067
  * edx = size of color table
-
 
2068
    (must be 40 bytes for future compatibility)
-
 
2069
Returned value:
2023
  * function does not return value
2070
  * function does not return value
2024
Format of the color table: each unit -
2071
Format of the color table:
2025
dword-value of colour 0x00RRGGBB
2072
each item is dword-value for color 0x00RRGGBB
2026
  * +0: dword: frames - colour of frame
2073
  * +0: dword: frames - color of frame
2027
  * +4: dword: grab - colour of header
2074
  * +4: dword: grab - color of header
2028
  * +8: dword: grab_button - colour of the button on a bar of header
2075
  * +8: dword: grab_button - color of button on header bar
2029
  * +12 = +0xC: dword: grab_button_text - colour of the text on the button
2076
  * +12 = +0xC: dword: grab_button_text - color of text on button
2030
    on a bar of header
2077
    on header bar
2031
  * +16 = +0x10: dword: grab_text - colour of the text on header
2078
  * +16 = +0x10: dword: grab_text - color of text on header
2032
  * +20 = +0x14: dword: work - colour of a working area
2079
  * +20 = +0x14: dword: work - color of working area
2033
  * +24 = +0x18: dword: work_button - colour of the button in a working area
2080
  * +24 = +0x18: dword: work_button - color of button in working area
2034
  * +28 = +0x1C: dword: work_button_text - colour of the text on the button
2081
  * +28 = +0x1C: dword: work_button_text - color of text on button
2035
    in a working area
2082
    in working area
2036
  * +32 = +0x20: dword: work_text - colour of the text in a working area
2083
  * +32 = +0x20: dword: work_text - color of text in working area
2037
  * +36 = +0x24: dword: work_graph - colour of a graphics in a working area
2084
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2038
Remarks:
2085
Remarks:
2039
  * structure of the color table is described in the standard included file
2086
  * Structure of the color table is described in the standard
2040
    macros.inc under the name system_colors; for example, it is possible
2087
    include file 'macros.inc' as 'system_colors'; for example,
2041
    to write:
2088
    it is possible to write:
2042
        sc    system_colors        ; declaration of a variable
2089
    	sc	system_colors		; variable declaration
2043
        ...                ; where it is necessary to call
2090
    	...				; somewhere one must call
2044
                        ; described function with ecx=sc
2091
    					; this function with ecx=sc
2045
        mov    ecx, [sc.work_button_text]    ; read colour of the text
2092
    	mov	ecx, [sc.work_button_text]	; read text color on
2046
                        ; on the button in a working area
2093
    					; buttin in working area
2047
  * Usage/non-use of these colours - business is exclusively of the  program.
2094
  * A program itself desides to use or not to use color table.
2048
    For usage it is necessary simply at call of functions of drawing to
2095
    For usage program must simply at calls to drawing functions select
2049
    specify colour, taken from this table.
2096
    color taken from the table.
2050
  * At change of the table of standard colours (subfunction 2 with the
2097
  * At change of the table of standard colors (by subfunction 2 with
2051
    subsequent application of changes subfunction 0 or at installation skin
2098
    the subsequent application of changes by subfunction 0 or
2052
    subfunction 8) all windows the message on necessity redraw (event with
2099
    at skin set by subfunction 8) the system sends to all windows
2053
    the code 1) is dispatched.
2100
    redraw message (the event with code 1).
2054
  * Color table can be viewed/changed online with the help of
2101
  * Color table can be viewed/changed interactively with
2055
    the application desktop.
2102
    the application 'desktop'.
2056
 
2103
 
2057
======================================================================
2104
======================================================================
2058
========== Function 48, subfunction 4 - get height of skin. ==========
2105
============ Function 48, subfunction 4 - get skin height. ===========
2059
======================================================================
2106
======================================================================
2060
Parameters:
2107
Parameters:
2061
  * eax = 48 - number of the function
2108
  * eax = 48 - function number
2062
  * ebx = 4 - number subfunction
2109
  * ebx = 4 - subfunction number
2063
Returned value:
2110
Returned value:
2064
  * eax = height of skin
2111
  * eax = skin height
2065
Remarks:
2112
Remarks:
2066
  * Height skin on definition considers height of header
2113
  * Skin height is defined as the height of a header
2067
    of windows using skin.
2114
    of skinned windows.
2068
  * See also common structure of the window in the description
2115
  * See also general structure of window in the description
2069
    of the function 0.
2116
    of function 0.
2070
 
2117
 
2071
======================================================================
2118
======================================================================
2072
==== Function 48, subfunction 5 - get working area of the screen. ====
2119
======== Function 48, subfunction 5 - get screen working area. =======
2073
======================================================================
2120
======================================================================
2074
Parameters:
2121
Parameters:
2075
  * eax = 48 - number of the function
2122
  * eax = 48 - function number
2076
  * ebx = 5 - number subfunction
2123
  * ebx = 5 - subfunction number
2077
Returned value:
2124
Returned value:
2078
  * eax = [left]*65536 + [right]
2125
  * eax = [left]*65536 + [right]
2079
  * ebx = [top]*65536 + [bottom]
2126
  * ebx = [top]*65536 + [bottom]
2080
Remarks:
2127
Remarks:
2081
  * Working area of the screen defines a location and coordinates
2128
  * The screen working area defines position and coordinates of
2082
    of the maximized window.
2129
    a maximized window.
2083
  * Working area of the screen by normal operation is all screen
2130
  * The screen working area in view of normal work is all screen
2084
    minus the panel (@panel).
2131
    without system panel (the application '@panel').
2085
  * (left,top) - coordinates of the left upper corner,
2132
  * (left,top) are coordinates of the left upper corner,
2086
    (right,bottom) - coordinates of the right lower corner.
2133
    (right,bottom) are coordinates of the right lower one.
2087
    Thus, the size of a working area on an axis x is defined by
2134
    Thus the size of working area on x axis can be calculated by
2088
    the formula right-left+1, on an axis y - formula bottom-right+1.
2135
    formula right-left+1, on y axis - by formula bottom-right+1.
-
 
2136
  * See also function 14,
2089
  * See also function 14, permitting to define sizes of all screen.
2137
    to get sizes of all screen.
2090
  * There is a pair function of installation of a working area - 
2138
  * There is a pair function to set working area - subfunction 6.
2091
    subfunction 6.
-
 
2092
 
2139
 
2093
======================================================================
2140
======================================================================
2094
=== Function 48, subfunction 6 - install a working area of screen. ===
2141
======== Function 48, subfunction 6 - set screen working area. =======
2095
======================================================================
2142
======================================================================
2096
Parameters:
2143
Parameters:
2097
  * eax = 48 - number of the function
2144
  * eax = 48 - function number
2098
  * ebx = 6 - number subfunction
2145
  * ebx = 6 - subfunction number
2099
  * ecx = [left]*65536 + [right]
2146
  * ecx = [left]*65536 + [right]
2100
  * edx = [top]*65536 + [bottom]
2147
  * edx = [top]*65536 + [bottom]
2101
Returned value:
2148
Returned value:
2102
  * function does not return value
2149
  * function does not return value
2103
Remarks:
2150
Remarks:
2104
  * Working area of the screen defines a location and coordinates
2151
  * The screen working area defines position and coordinates of
2105
    of the maximized window.
2152
    a maximized window.
2106
  * This function is used only by application @panel, installing by
2153
  * This function is used only by the application '@panel',
2107
    a working area all screen minus the panel.
2154
    which set working area to all screen without system panel.
2108
  * (left,top) - coordinates of the left upper corner,
2155
  * (left,top) are coordinates of the left upper corner,
2109
    (right,bottom) - coordinates of the right lower corner.
2156
    (right,bottom) are coordinates of the right lower one.
2110
    Thus, the size of a working area on an axis x is defined by
2157
    Thus the size of working area on x axis can be calculated by
2111
    the formula right-left+1, on an axis y - formula bottom-right+1.
2158
    formula right-left+1, on y axis - by formula bottom-right+1.
2112
  * If left > =right, the x-coordinates of a working area do not vary.
2159
  * If 'left'>='right', x-coordinate of working area is not changed.
2113
    If left < 0, left is not installed. If right it is more or equally
2160
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2114
    width of the screen, right is not installed. Similarly on an axis y.
2161
    equal to screen width, 'right' will not be set.
-
 
2162
    Similarly on y axis.
-
 
2163
  * See also function 14,
2115
  * See also function 14, permitting to define sizes of all screen.
2164
    to get sizes of all screen.
2116
  * There is a pair function of get of a working area - subfunction 5.
2165
  * There is a pair function to get working area - subfunction 5.
2117
  * This function automatically redraw the screen, on a course of business
2166
  * This function redraws the screen automatically,
2118
    updates coordinates and rule(situation) of the maximized windows.
2167
    updating coordinates and sizes of maximized windows.
2119
    All windows are informed on necessity redraw (event 1).
2168
    The system sends to all windows redraw message (the event 1).
2120
 
2169
 
2121
======================================================================
2170
======================================================================
2122
====================== Function 48, subfunction 7 ====================
-
 
2123
================= Get skin area for the text of header. ==============
2171
=========== Function 48, subfunction 7 - get skin margins. ===========
2124
======================================================================
2172
======================================================================
2125
Returns title bar of the window with skin, intended for output of the
2173
Returns the area of a header of a skinned window, intended for
2126
text of header.
2174
a text of a header.
2127
Parameters:
2175
Parameters:
2128
  * eax = 48 - number of the function
2176
  * eax = 48 - function number
2129
  * ebx = 7 - number subfunction
2177
  * ebx = 7 - subfunction number
2130
Returned value:
2178
Returned value:
2131
  * eax = [left]*65536 + [right]
2179
  * eax = [left]*65536 + [right]
2132
  * ebx = [top]*65536 + [bottom]
2180
  * ebx = [top]*65536 + [bottom]
2133
Remarks:
2181
Remarks:
2134
  * Usage/non-use of this function - personal business of the application.
2182
  * An application decides itself to use or not to use this function.
2135
  * It is recommended to take into account values returned by this function,
2183
  * It is recommended to take into account returned value
2136
    at choice of a place for drawing the text of header (function 4) or any
2184
    of this function for choice of a place for drawing header text
2137
    of a substitute of the text of header (at the discretion of the
2185
    (by function 4) or a substitute of header text
2138
    application).
2186
    (at the discretion of an application).
2139
 
2187
 
2140
======================================================================
2188
======================================================================
2141
===== Function 48, subfunction 8 - install used skin of windows. =====
2189
============= Function 48, subfunction 8 - set used skin. ============
2142
======================================================================
2190
======================================================================
2143
Parameters:
2191
Parameters:
2144
  * eax = 48 - number of the function
2192
  * eax = 48 - function number
2145
  * ebx = 8 - number subfunction
2193
  * ebx = 8 - subfunction number
2146
  * ecx = pointer on the block for the function 58, in which the field of
2194
  * ecx = pointer to a block for function 58, in
2147
    the intermediate buffer is placed(installed) and the filename is indicated
2195
    which the fields of intermediate buffer and file name are filled
2148
Returned value:
2196
Returned value:
2149
  * eax = 0 - successfully
2197
  * eax = 0 - success
-
 
2198
  * otherwise eax = file system error code; if file does not
2150
  * differently eax = an error code of a file system; if the file does
2199
    contain valid skin, function returns error 3
2151
    not set skin, comes back error 3 (unknown file system).
2200
    (unknown file system).
2152
Remarks:
2201
Remarks:
2153
  * At successful loading skin all windows are informed on necessity
2202
  * After successful skin loading the system sends to all windows
2154
    redraw (event 1).
2203
    redraw message (the event 1).
-
 
2204
  * At booting the system reads skin from file 'default.skn'
2155
  * At loading the system reads out skin from the file default.skn on ramdisk.
2205
    on ramdisk.
2156
  * User can change skin statically, having created default.skn,
2206
  * User can change the skin statically by creating hisself
2157
    or dynamically with the help of the application desktop.
2207
    'default.skn' or dynamically with the application 'desktop'.
2158
 
2208
 
2159
======================================================================
2209
======================================================================
2160
============ Function 49 - Advanced Power Management (APM). ===========
2210
=========== Function 49 - Advanced Power Management (APM). ===========
-
 
2211
======================================================================
2161
======================================================================
2212
Parameters:
2162
Parameters:
2213
  * eax = 49 - function number
2163
  * eax = 49 - number of the function
2214
  * dx = number of the APM function
2164
  * dx = number of the function APM (clone ax in the specification)
2215
    (analogue of ax in APM specification)
2165
  * bx, cx = parameters of the function APM
2216
  * bx, cx = parameters of the APM function
2166
Returned value:
2217
Returned value:
2167
  * 16-bit registers ax, bx, cx, dx, si, di and flag CF are installed
2218
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
-
 
2219
    are set according to the APM specification
2168
    according to the specification APM
2220
  * high halves of 32-bit registers eax, ebx, ecx,
2169
  * high halves of 32-bit registers eax, ebx, ecx, edx, esi, edi fail
2221
    edx, esi, edi are destroyed
2170
Remarks:
2222
Remarks:
2171
  * Specification APM 1.2 is described in document 
2223
  * APM 1.2 specification is described in the document
2172
    "Advanced Power Management (APM) BIOS Specification "
2224
    "Advanced Power Management (APM) BIOS Specification"
2173
    (Revision 1.2), accessible on
2225
    (Revision 1.2), available at
2174
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2226
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2175
    besides it is included in known Interrupt List by Ralf Brown
2227
    besides it is included in famous Interrupt List by Ralf Brown
2176
    (http://www.pobox.com/~ralf/files.html,
2228
    (http://www.pobox.com/~ralf/files.html,
2177
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2229
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2178
 
2230
 
2179
======================================================================
2231
======================================================================
2180
=========== Function 50 - installation of form of window. ============
2232
=================== Function 50 - set window shape. ==================
2181
======================================================================
2233
======================================================================
2182
The usual windows represent rectangles. With the help of this function the
2234
Normal windows have rectangular shape. This function can give to
2183
window can add the arbitrary form. The form sets by a set of points inside
2235
a window any shape. The shape is given by a set of points inside
2184
a framing rectangle concerning to the window. Location and the sizes of
2236
the base rectangle belonging to a window. Position and coordinates
2185
a framing rectangle are set by the function 0 and vary with the function 67.
2237
of the base rectangle are set by function 0
-
 
2238
and changed by function 67.
2186
 
2239
 
2187
----------- Installation of data with information on form ------------
2240
--------------------------- Set shape data ---------------------------
2188
Parameters:
2241
Parameters:
2189
  * eax = 50 - number of the function
2242
  * eax = 50 - function number
2190
  * ebx = 0 - number subfunction
2243
  * ebx = 0 - subfunction number
2191
  * ecx = pointer on the given forms (array byte 0/1)
2244
  * ecx = pointer to shape data (array of bytes 0/1)
2192
Returned value:
2245
Returned value:
2193
  * function does not return value
2246
  * function does not return value
2194
 
2247
 
2195
---------------- Installation of a scale of given form ---------------
2248
-------------------------- Set shape scale ---------------------------
2196
Parameters:
2249
Parameters:
2197
  * eax = 50 - number of the function
2250
  * eax = 50 - function number
2198
  * ebx = 1 - number subfunction
2251
  * ebx = 1 - subfunction number
2199
  * ecx sets a scale: each byte of the data defines
2252
  * ecx sets a scale: each byte of data defines
2200
    (2^scale) * (2^scale) of pixels
2253
    (2^scale)*(2^scale) pixels
2201
Returned value:
2254
Returned value:
2202
  * function does not return value
2255
  * function does not return value
2203
Remarks:
2256
Remarks:
2204
  * Scale is by default equal 0 (scaling factor 1). If in the given form
2257
  * Default scale is 0 (scale factor is 1). If in the shape data
2205
    of one byte corresponds to one pixel, the scale is possible to not install.
2258
    one byte corresponds to one pixel, there is no necessity
-
 
2259
    to set scale.
2206
  * Let's designate xsize = width of the window (in pixels), ysize = height;
2260
  * Let's designate xsize = window width (in pixels), ysize = height;
2207
    pay attention, that they on unit are more, than installed by
2261
    pay attention, that they are one pixel more than defined by
2208
    functions 0, 67.
2262
    functions 0, 67.
2209
  * On definition of a scale xsize and ysize should be divided on 2^scale.
2263
  * On definition of scale xsize and ysize must be divisible
-
 
2264
    on 2^scale.
2210
  * Byte of the data on offset a should be 0/1 and defines an accessory to
2265
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2211
    the window of a square with the side 2^scale (at scale=0 we receive
2266
    to a window of square with the side 2^scale (if scale=0,
2212
    a pixel) and coordinates of the left upper corner
2267
    this is one pixel) and coordinates of the left upper corner
2213
    (a mod (xsize shr scale), a div (xsize shr scale))
2268
    (a mod (xsize shr scale), a div (xsize shr scale))
2214
  * Size of the data: (xsize shr scale)*(ysize shr scale).
2269
  * Data size: (xsize shr scale)*(ysize shr scale).
2215
  * Data should be present at memory and not vary after installation
2270
  * Data must be presented in the memory and not change
2216
    of the form.
2271
    after set of shape.
2217
  * System views the data on the form at everyone redraw of the window
2272
  * The system views the shape data at every window redraw by
2218
    by the function 0.
2273
    function 0.
2219
  * Call subfunction 0 with the zero pointer results in return to the
2274
  * The call of subfunction 0 with NULL pointer results in return
2220
    rectangular form.
2275
    to the rectangular shape.
2221
 
2276
 
2222
======================================================================
2277
======================================================================
2223
==================== Function 51 - create thread. ====================
2278
==================== Function 51 - create thread. ====================
2224
======================================================================
2279
======================================================================
2225
Parameters:
2280
Parameters:
2226
  * eax = 51 - number of the function
2281
  * eax = 51 - function number
2227
  * ebx = 1 - sole subfunction
2282
  * ebx = 1 - unique subfunction
2228
  * ecx = address of an entry point thread (begin eip)
2283
  * ecx = address of thread entry point (starting eip)
2229
  * edx = pointer of the stack thread (begin esp)
2284
  * edx = pointer to thread stack (starting esp)
2230
Returned value:
2285
Returned value:
2231
  * eax = -1 - error (In the system it is too much threads)
2286
  * eax = -1 - error (there is too many threads)
2232
  * differently eax = TID - identifier thread
2287
  * otherwise eax = TID - thread identifier
-
 
2288
         
2233
 
2289
 
2234
======================================================================
2290
======================================================================
2235
== Function 52, subfunction 0 - get configuration of network driver. = 
2291
=== Function 52, subfunction 0 - get network driver configuration. ===
2236
======================================================================
2292
======================================================================
2237
Parameters:
2293
Parameters:
2238
  * eax = 52 - number of the function
2294
  * eax = 52 - function number
2239
  * ebx = 0 - number subfunction
2295
  * ebx = 0 - subfunction number
2240
Returned value:
2296
Returned value:
2241
  * eax = double word of the configuration
2297
  * eax = configuration dword
2242
Remarks:
2298
Remarks:
2243
  * Word of the configuration can be installed subfunction 2.
2299
  * Configuration dword can be set by subfunction 2.
2244
  * Kernel does not use an appropriate variable. The value of this variable
2300
  * The kernel does not use this variable. The value of this
-
 
2301
    variable and working with it subfunctions 0 and 2 is represented
2245
    and working with it(her) subfunctions 0 and 2 is represented doubtful.
2302
    doubtful.
2246
 
2303
 
2247
======================================================================
2304
======================================================================
2248
========= Function 52, subfunction 1 - get local IP address. =========
2305
========= Function 52, subfunction 1 - get local IP-address. =========
2249
======================================================================
2306
======================================================================
2250
Parameters:
2307
Parameters:
2251
  * eax = 52 - number of the function
2308
  * eax = 52 - function number
2252
  * ebx = 1 - number subfunction
2309
  * ebx = 1 - subfunction number
2253
Returned value:
2310
Returned value:
2254
  * eax = IP-address (4 bytes)
2311
  * eax = IP-address (4 bytes)
2255
Remarks:
2312
Remarks:
2256
  * Local IP-address is installed subfunction 3.
2313
  * Local IP-address is set by subfunction 3.
2257
 
2314
 
2258
======================================================================
2315
======================================================================
2259
 Function 52, subfunction 2 - install configuration of network driver. 
2316
=== Function 52, subfunction 2 - set network driver configuration. ===
2260
======================================================================
2317
======================================================================
2261
Parameters:
2318
Parameters:
2262
  * eax = 52 - number of the function
2319
  * eax = 52 - function number
2263
  * ebx = 2 - number subfunction
2320
  * ebx = 2 - subfunction number
2264
  * ecx = Double word of the configuration; if the low 7 bits will derivate
2321
  * ecx = configuration dword; if low 7 bits derivate the number 3,
2265
    number 3, it is perceived as call about reinitialization
2322
    function [re-]initializes Ethernet-card, otherwise
2266
    of a Ethernet-map, otherwise Ethernet is switched off
2323
    Ethernet turns off
2267
Returned value:
2324
Returned value:
2268
  * if not the Ethernet-interface is requested, comes back eax=2,
2325
  * if Ethernet-interface is not requested, function returns eax=2,
2269
    but it can vary in the future versions of a kernel
2326
    but this can be changed in future kernel versions
2270
  * if the Ethernet-interface is requested, eax=0 means an error
2327
  * if Ethernet-interface is requested, eax=0 means error
2271
    (absence of a Ethernet-map), and non-zero value - success
2328
    (absence of Ethernet-card), and nonzero value - success
2272
Remarks:
2329
Remarks:
2273
  * Word of the configuration can be read subfunction 0.
2330
  * Configuration dword can be read by subfunction 0.
2274
  * Kernel does not use an appropriate variable. The value of this variable,
2331
  * The kernel does not use this variable. The value of this
2275
    subfunction 0 and part subfunction 2, installing this variable,
2332
    variable, subfunction 0 and part of subfunction 2, which set it,
2276
    is represented doubtful.
2333
    is represented doubtful.
2277
 
2334
 
2278
======================================================================
2335
======================================================================
2279
========= Function 52, subfunction 3 - set local IP-address. =========
2336
========= Function 52, subfunction 3 - set local IP-address. =========
2280
======================================================================
2337
======================================================================
2281
Parameters:
2338
Parameters:
2282
  * eax = 52 - number of the function
2339
  * eax = 52 - function number
2283
  * ebx = 3 - number subfunction
2340
  * ebx = 3 - subfunction number
2284
  * ecx = IP-address (4 bytes)
2341
  * ecx = IP-address (4 bytes)
2285
Returned value:
2342
Returned value:
2286
  * Current realization returns eax=3, but it can be changed
2343
  * the current implementation returns eax=3, but this can be changed
2287
    in the future versions
2344
    in future versions
2288
Remarks:
2345
Remarks:
2289
  * Local IP-address can be received subfunction 1.
2346
  * Local IP-address can be get by subfunction 1.
2290
 
2347
 
2291
======================================================================
2348
======================================================================
2292
= Function 52, subfunction 6 - add data in stack of an input queue. ==
2349
= Function 52, subfunction 6 - add data to the stack of input queue. =
2293
======================================================================
2350
======================================================================
2294
Parameters:
2351
Parameters:
2295
  * eax = 52 - number of the function
2352
  * eax = 52 - function number
2296
  * ebx = 6 - number subfunction
2353
  * ebx = 6 - subfunction number
2297
  * edx = size of the data
2354
  * edx = data size
2298
  * esi = pointer on the data
2355
  * esi = data pointer
2299
Returned value:
2356
Returned value:
2300
  * eax = -1 - error
2357
  * eax = -1 - error
2301
  * eax = 0 - successfully
2358
  * eax = 0 - success
2302
Remarks:
2359
Remarks:
-
 
2360
  * This function is intended only for slow network drivers
2303
  * This function is intended only for slow network drivers (PPP, SLIP).
2361
    (PPP, SLIP).
2304
  * Size of the data should not exceed 1500 bytes, though checks
2362
  * Data size must not exceed 1500 bytes, though function
2305
    of a correctness is not done(made).
2363
    performs no checks on correctness.
2306
 
-
 
2307
======================================================================
2364
 
2308
====================== Function 52, subfunction 8 ====================
2365
======================================================================
2309
============== Read given from a network output queue. ===============
2366
 Function 52, subfunction 8 - read data from the network output queue. 
2310
======================================================================
2367
======================================================================
2311
Parameters:
2368
Parameters:
2312
  * eax = 52 - number of the function
2369
  * eax = 52 - function number
2313
  * ebx = 8 - number subfunction
2370
  * ebx = 8 - subfunction number
2314
  * esi = pointer on the buffer by a size of 1500 bytes
2371
  * esi = pointer to 1500-byte buffer
2315
Returned value:
2372
Returned value:
2316
  * eax = Number read byte (in current implementation or
2373
  * eax = number of read bytes (in the current implementation
2317
    0 = there are no data, or 1500)
2374
    either 0 = no data or 1500)
2318
  * data are copied in the buffer
2375
  * data was copied in buffer
-
 
2376
Remarks:
2319
Remarks:
2377
  * This function is intended only for slow network drivers
2320
  * This function is intended only for slow network drivers (PPP, SLIP).
2378
    (PPP, SLIP).
2321
 
2379
 
2322
======================================================================
2380
======================================================================
2323
=========== Function 52, subfunction 9 - get gateway IP. ==========
2381
============ Function 52, subfunction 9 - get gateway IP. ============
2324
======================================================================
2382
======================================================================
2325
Parameters:
2383
Parameters:
2326
  * eax = 52 - number of the function
2384
  * eax = 52 - function number
2327
  * ebx = 9 - number subfunction
2385
  * ebx = 9 - subfunction number
2328
Returned value:
2386
Returned value:
2329
  * eax = gateway IP (4 bytes)
2387
  * eax = gateway IP (4 bytes)
2330
 
2388
 
2331
======================================================================
2389
======================================================================
2332
========= Function 52, subfunction 10 - get mask of a subnet. ========
2390
=========== Function 52, subfunction 10 - get subnet mask. ===========
2333
======================================================================
2391
======================================================================
2334
Parameters:
2392
Parameters:
2335
  * eax = 52 - number of the function
2393
  * eax = 52 - function number
2336
  * ebx = 10 - number subfunction
2394
  * ebx = 10 - subfunction number
2337
Returned value:
2395
Returned value:
2338
  * eax = mask of a subnet
2396
  * eax = subnet mask
2339
 
2397
 
2340
======================================================================
2398
======================================================================
2341
========= Function 52, subfunction 11 - install gateway IP. =========
2399
============ Function 52, subfunction 11 - set gateway IP. ===========
2342
======================================================================
2400
======================================================================
2343
Parameters:
2401
Parameters:
2344
  * eax = 52 - number of the function
2402
  * eax = 52 - function number
2345
  * ebx = 11 - number subfunction
2403
  * ebx = 11 - subfunction number
2346
  * ecx = gateway IP (4 bytes)
2404
  * ecx = gateway IP (4 bytes)
2347
Returned value:
2405
Returned value:
2348
  * current realization returns eax=11, but it can be changed in the
2406
  * the current implementation returns eax=11, but this can be changed
2349
    future realizations
2407
    in future versions
2350
 
2408
 
2351
======================================================================
2409
======================================================================
2352
====== Function 52, subfunction 12 - install mask of a subnet. =======
2410
=========== Function 52, subfunction 12 - set subnet mask. ===========
2353
======================================================================
2411
======================================================================
2354
Parameters:
2412
Parameters:
2355
  * eax = 52 - number of the function
2413
  * eax = 52 - function number
2356
  * ebx = 12 - number subfunction
2414
  * ebx = 12 - subfunction number
2357
  * ecx = mask of a subnet
2415
  * ecx = subnet mask
2358
Returned value:
2416
Returned value:
2359
  * Current realization returns eax=12, but it can be changed
2417
  * the current implementation returns eax=12, but this can be changed
2360
    in the future versions
2418
    in future versions
2361
 
2419
 
2362
======================================================================
2420
======================================================================
2363
============ Function 52, subfunction 13 - get DNS IP. ============
2421
============== Function 52, subfunction 13 - get DNS IP. =============
2364
======================================================================
2422
======================================================================
2365
Parameters:
2423
Parameters:
2366
  * eax = 52 - number of the function
2424
  * eax = 52 - function number
2367
  * ebx = 13 - number subfunction
2425
  * ebx = 13 - subfunction number
2368
Returned value:
2426
Returned value:
2369
  * eax = DNS IP (4 bytes)
2427
  * eax = DNS IP (4 bytes)
2370
 
2428
 
2371
======================================================================
2429
======================================================================
2372
=========== Function 52, subfunction 14 - install DNS IP. ============
2430
============== Function 52, subfunction 14 - set DNS IP. =============
2373
======================================================================
2431
======================================================================
2374
Parameters:
2432
Parameters:
2375
  * eax = 52 - number of the function
2433
  * eax = 52 - function number
2376
  * ebx = 14 - number subfunction
2434
  * ebx = 14 - subfunction number
2377
  * ecx = DNS IP (4 bytes)
2435
  * ecx = DNS IP (4 bytes)
2378
Returned value:
2436
Returned value:
2379
  * Current realization returns eax=14, but it can be changed
2437
  * the current implementation returns eax=14, but this can be changed
2380
    in the future versions
2438
    in future versions
2381
 
2439
 
2382
======================================================================
2440
======================================================================
2383
============ Function 53, subfunction 0 - open UDP-socket. ============
2441
============ Function 53, subfunction 0 - open UDP-socket. ===========
2384
======================================================================
2442
======================================================================
2385
Parameters:
2443
Parameters:
2386
  * eax = 53 - number of the function
2444
  * eax = 53 - function number
2387
  * ebx = 0 - number subfunction
2445
  * ebx = 0 - subfunction number
2388
  * ecx = local port (is taken into account only low word)
2446
  * ecx = local port (only low word is taken into account)
2389
  * edx = remote port (is taken into account only low word)
2447
  * edx = remote port (only low word is taken into account)
2390
  * esi = remote IP
2448
  * esi = remote IP
2391
Returned value:
2449
Returned value:
2392
  * eax = -1 = 0xFFFFFFFF - error; ebx fail
2450
  * eax = -1 = 0xFFFFFFFF - error; ebx destroyed
2393
  * eax = socket number (some number unambiguously identifying socket and
2451
  * eax = socket handle (some number which unambiguously identifies
2394
    having sense only for the system) - successfully
2452
    socket and have sense only for the system) - success;
2395
    ebx fail
2453
    ebx destroyed
2396
 
2454
 
2397
======================================================================
2455
======================================================================
2398
============ Function 53, subfunction 1 - close UDP-socket. ===========
2456
=========== Function 53, subfunction 1 - close UDP-socket. ===========
2399
======================================================================
2457
======================================================================
2400
Parameters:
2458
Parameters:
2401
  * eax = 53 - number of the function
2459
  * eax = 53 - function number
2402
  * ebx = 1 - number subfunction
2460
  * ebx = 1 - subfunction number
2403
  * ecx = socket number
2461
  * ecx = socket handle
2404
Returned value:
2462
Returned value:
2405
  * eax = -1 - incorrect number
2463
  * eax = -1 - incorrect handle
2406
  * eax = 0 - successfully
2464
  * eax = 0 - success
2407
  * ebx fail
2465
  * ebx destroyed
2408
Remarks:
2466
Remarks:
2409
  * The current realization does not close automatically all sockets thread
2467
  * The current implementation does not close automatically all
-
 
2468
    sockets of a thread at termination. In particular, one should not
2410
    at its completion. In particular, it is not necessary to kill thread
2469
    kill a thread with many opened sockets - there will be an outflow
2411
    with a heap open sockets - there will be an outflow of resources.
2470
    of resources.
2412
  * The current realization does not do checks on a correctness
2471
  * The current implementation does no checks on correctness
2413
    (sole, to what the attempt comes back error, - to close not open socket
2472
    (function returns error only if thread tries to close not opened
2414
    with correct number).
2473
    socket with correct handle).
2415
 
2474
 
2416
======================================================================
2475
======================================================================
2417
============== Function 53, subfunction 2 - poll socket. =============
2476
============== Function 53, subfunction 2 - poll socket. =============
2418
======================================================================
2477
======================================================================
2419
Parameters:
2478
Parameters:
2420
  * eax = 53 - number of the function
2479
  * eax = 53 - function number
2421
  * ebx = 2 - number subfunction
2480
  * ebx = 2 - subfunction number
2422
  * ecx = socket number
2481
  * ecx = socket handle
2423
Returned value:
2482
Returned value:
2424
  * eax = number getting bytes
2483
  * eax = number of read bytes
2425
  * ebx fail
2484
  * ebx destroyed
2426
Remarks:
2485
Remarks:
2427
  * Checks of a correctness is not done.
2486
  * There is no checks for correctness.
2428
 
2487
 
2429
======================================================================
2488
======================================================================
2430
======== Function 53, subfunction 3 - read byte from socket. =========
2489
========= Function 53, subfunction 3 - read byte from socket. ========
2431
======================================================================
2490
======================================================================
2432
Parameters:
2491
Parameters:
2433
  * eax = 53 - number of the function
2492
  * eax = 53 - function number
2434
  * ebx = 3 - number subfunction
2493
  * ebx = 3 - subfunction number
2435
  * ecx = number socket
2494
  * ecx = socket handle
2436
Returned value:
2495
Returned value:
-
 
2496
  * if there is no read data: eax=0, bl=0,
2437
  * if there are no accepted data: eax=0, bl=0, the other bits ebx fail
2497
    other bytes of ebx are destroyed
2438
  * If there were accepted data: eax = number stayed byte (is possible, 0),
2498
  * if there are read data: eax=number of rest bytes
2439
    bl = read byte, the other bits ebx fail
2499
    (possibly 0), bl=read byte, other bytes of ebx are destroyed
2440
Remarks:
2500
Remarks:
2441
  * Checks of a correctness is not done.
2501
  * There is no checks for correctness.
2442
 
2502
 
2443
======================================================================
2503
======================================================================
2444
======== Function 53, subfunction 4 - write in UDP-socket. ===========
2504
========== Function 53, subfunction 4 - write to UDP-socket. =========
2445
======================================================================
2505
======================================================================
2446
Parameters:
2506
Parameters:
2447
  * eax = 53 - number of the function
2507
  * eax = 53 - function number
2448
  * ebx = 4 - number subfunction
2508
  * ebx = 4 - subfunction number
2449
  * ecx = number socket
2509
  * ecx = socket handle
2450
  * edx = number bytes for writing
2510
  * edx = number of bytes to write
2451
  * esi = pointer on data for writing
2511
  * esi = pointer to data to write
2452
Returned value:
2512
Returned value:
2453
  * eax = 0xffffffff - incorrect number
2513
  * eax = 0xffffffff - invalid handle
2454
  * eax = 0xffff - lack of memory
2514
  * eax = 0xffff - not enough memory
2455
  * eax = 0 - successfully
2515
  * eax = 0 - success
2456
  * ebx fail
2516
  * ebx destroyed
2457
Remarks:
2517
Remarks:
2458
  * Check on valid number is minimum - are eliminated only not so incorrect
2518
  * Check on validity of handle is minimal - only not very incorrect
2459
    not open numbers.
2519
    not opened handles are eliminated.
2460
  * Number bytes for writing can not exceed 1500-28, though appropriate
2520
  * Number of bytes to write must not exceed 1500-28, though
2461
    check is not done.
2521
    the appropriate check is not made.
2462
 
2522
 
2463
======================================================================
2523
======================================================================
2464
============ Function 53, subfunction 5 - open TCP-socket. ===========
2524
============ Function 53, subfunction 5 - open TCP-socket. ===========
2465
======================================================================
2525
======================================================================
2466
Parameters:
2526
Parameters:
2467
  * eax = 53 - number of the function
2527
  * eax = 53 - function number
2468
  * ebx = 5 - number subfunction
2528
  * ebx = 5 - subfunction number
2469
  * ecx = local port (is taken into account only low word)
2529
  * ecx = local port (only low word is taken into account)
2470
  * edx = remote port (is taken into account only low word)
2530
  * edx = remote port (only low word is taken into account)
2471
  * esi = remote IP
2531
  * esi = remote IP
2472
  * edi = mode of opening: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2532
  * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
2473
Returned value:
2533
Returned value:
2474
  * eax = -1 = 0xFFFFFFFF - error; ebx fail
2534
  * eax = -1 = 0xFFFFFFFF - error; ebx destroys
2475
  * eax = number socket (some number unambiguously identifying socket
2535
  * eax = socket handle (some number which unambiguously identifies
2476
    and having sense only for the system) - successfully; ebx fails
2536
    socket and have sense only for the system) - success;
-
 
2537
    ebx destroyed
2477
 
2538
 
2478
======================================================================
2539
======================================================================
2479
======== Function 53, subfunction 6 - get status TCP-socket. =========
2540
========= Function 53, subfunction 6 - get TCP-socket status. ========
2480
======================================================================
2541
======================================================================
2481
Parameters:
2542
Parameters:
2482
  * eax = 53 - number of the function
2543
  * eax = 53 - function number
2483
  * ebx = 6 - number subfunction
2544
  * ebx = 6 - subfunction number
2484
  * ecx = number socket
2545
  * ecx = socket handle
2485
Returned value:
2546
Returned value:
2486
  * eax = status socket: one of
2547
  * eax = socket status: one of
2487
  * TCB_LISTEN = 1
2548
  * TCB_LISTEN = 1
2488
  * TCB_SYN_SENT = 2
2549
  * TCB_SYN_SENT = 2
2489
  * TCB_SYN_RECEIVED = 3
2550
  * TCB_SYN_RECEIVED = 3
2490
  * TCB_ESTABLISHED = 4
2551
  * TCB_ESTABLISHED = 4
2491
  * TCB_FIN_WAIT_1 = 5
2552
  * TCB_FIN_WAIT_1 = 5
2492
  * TCB_FIN_WAIT_2 = 6
2553
  * TCB_FIN_WAIT_2 = 6
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.
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
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
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:
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
2644
  * 3: total number of transferred IP-packets
2583
  * 4: a total number dumps of the obtained packages
2645
  * 4: total number of dumped received packets
2584
  * 5: a total number of the obtained ARP-packages
2646
  * 5: total number of received ARP-packets
2585
  * 6: the status of the driver of packages, 0 = is inactive,
2647
  * 6: status of packet driver, 0=inactive, nonzero=active
2586
       non-zero value = is active
-
 
2587
 
-
 
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
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:
2611
  * Previously data should be loaded subfunction 0 and their format
2671
  * Previously data must be loaded by subfunction 0 and
2612
    subfunction 2 is defined.
2672
    their format must be defined by subfunction 2.
2613
  * Function returns handle, when playing the data began; after that the
2673
  * Function returns control, when playing of data began; after that
2614
    playing goes irrespective of the application (and at all does not
2674
    play goes independently from application (and does not use
2615
    require loading the processor).
2675
    processor time at all).
2616
  * Previously should be defined a base port SB16 (subfunction 4 functions 21)
2676
  * Previously must be defined SB16 base port
-
 
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:
2633
  * function does not return value
2694
  * function does not return value
2634
Remarks:
2695
Remarks:
2635
  * At loading the system the following default settings are installed:
2696
  * When the system boots, it sets following default parameters:
2636
    a digit capacity - 8 bits mono, size - 64 KB, frequency 44100 Hz.
2697
    digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
2637
    Nevertheless it is recommended obviously to install necessary values,
2698
    Nevertheless it is recommended to set necessary values obviously
2638
    as they could be reinstalled by any program.
2699
    as they could be reset by some application.
2639
 
2700
 
2640
======================================================================
-
 
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:
2660
    * duration in 1/100 of second = (first byte) - 0x81
2720
    * duration in 1/100 of second = (first byte)-0x81
2661
    * there is one more byte;
2721
    * there is one more byte;
2662
    * (second byte) = 0xFF - pause
2722
    * (second byte)=0xFF - delay
2663
    * differently it looks like a*0x10+b, where b=number of the note
2723
    * otherwise it looks like a*0x10+b, where b=number of the note in
2664
      in an octave from 1 up to 12, a=number of an octave (beginning from 0)
2724
      an octave from 1 to 12, a=number of octave (beginning from 0)
2665
Remarks:
2725
Remarks:
-
 
2726
  * Speaker play can be disabled/enabled by
2666
  * Speaker play can be disable /enable subfunction 8 functions 18.
2727
    subfunction 8 of function 18.
2667
  * Function returns handle, having informed where follows the information
2728
  * Function returns control, having informed the system
-
 
2729
    an information on request. Play itself goes independently from
2668
    on play. Playing goes irrespective of the program.
2730
    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:
2681
  * eax = 0 - successfully, differently error code of a file system
2744
  * eax = 0 - success, otherwise file system error code
2682
Remarks:
2745
Remarks:
2683
  * This function is obsolete; the function 70 allows to fulfil the same
2746
  * This function is obsolete; function 70 allows to fulfil the same
2684
    operations with the extended possibilities.
2747
    operations with the extended possibilities.
2685
  * Given function assumes, that during its call one application any other
2748
  * This function assumes that during its call by one application
2686
    application does not work with the hard disk.
2749
    no other application works with 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
2731
    admitted, but to use this possibility it is not recommended for
2795
    instead of 1, SECOND instead of 2, but it is not recommended
2732
    convenience of transition on the future extensions.
2796
    for convenience of transition to the future extensions.
2733
  * Imposed limitation n<=39.
2797
  * Limitation n<=39 is imposed.
2734
  * Names of folders and file dir1..., dirn, file should be in the format 8.3:
2798
  * Names of folders and file dir1,...,dirn,file must have the
2735
    a name no more than 8 characters, point, extension no more than 3
2799
    format 8.3: name no more than 8 characters, dot, extension no
2736
    characters. The tail blanks are ignored. Other blanks be does not owe.
2800
    more than 3 characters. Trailing spaces are ignored, no other
2737
    If the name occupies equally 8 characters, the point can be omitted
2801
    spaces is allowed. If name occupies equally 8 characters,
2738
    (though to use it it is not recommended for convenience of transition
2802
    dot may be omitted (though it is not recommended to use this
2739
    on the future extensions).
2803
    feature for convenience of transition to 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:
2810
Existing subfunctions:
2746
  * subfunction 0 - reading of a file/folder
2811
  * subfunction 0 - read file/folder
2747
  * subfunction 1 - overwriting of the file
2812
  * subfunction 1 - rewrite file
2748
  * subfunction 2 - deleting of a file/folder
2813
  * subfunction 2 - delete file/folder
2749
  * subfunction 3 - writing data in the existing file
2814
  * subfunction 3 - write to existing file
2750
  * subfunction 4 - creation of a folder
2815
  * subfunction 4 - make folder
2751
  * subfunction 5 - renaming/moving of a file/folder
2816
  * subfunction 5 - rename/move file/folder
2752
  * subfunction 8 - LBA-reading from the device
2817
  * subfunction 8 - LBA-read from device
2753
  * subfunction 12 - definition of a file size
2818
  * subfunction 15 - get file system information
2754
  * subfunction 13 - definition of attributes of a file/folder
-
 
2755
  * subfunction 14 - definition of date/time of a file/folder
-
 
2756
  * subfunction 15 - obtaining of the information about a file system
-
 
2757
  * subfunction 16 - start of the application
2819
  * subfunction 16 - start application
2758
 
-
 
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)
2829
  * +4: dword: first block to read (beginning from 0)
2769
  * +8: dword: éuantity blocks for reading
2830
  * +8: dword: amount of blocks to read
2770
  * +12 = +0xC: dword: pointer on the buffer, where the data will be written
2831
  * +12 = +0xC: dword: pointer to buffer for data
2771
  * +16 = +0x10: dword: pointer on the buffer for system operation
2832
  * +16 = +0x10: dword: pointer to buffer for system operations
2772
    (4096 bytes)
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
-
 
2779
Remarks:
2839
Remarks:
2780
  * Size of block - 512 bytes.
2840
  * Block size is 512 bytes.
2781
  * This function is obsolete, for reading files use subfunction 0
2841
  * This function is obsolete, for reading files use subfunction 0
2782
    functions 70, for reading folders - subfunction of 1 function 70.
2842
    of function 70, for reading folders - subfunction 1 of
-
 
2843
    function 70.
2783
  * Function allows to read contents of a folder. From file systems is
2844
  * Function can read contents of a folder. Only FAT file system is
2784
    supported only FAT. The format of a FAT-folder is described in any
2845
    supported. The format of FAT-folder is described
2785
    documentation on FAT.
2846
    in any FAT documentation.
2786
  * Size of a folder is defined on a size of a chain of clusters in FAT.
2847
  * Size of a folder is determined by size of FAT clusters chain.
2787
  * If the file was terminated earlier, than last requested block was read,
2848
  * If file was ended before last requested block was read,
2788
    the function will read, how many can, then will return eax=6 (EOF).
2849
    the function will read as many as it can, and after that return
-
 
2850
    eax=6 (EOF).
2789
  * Function allows to read root folders /rd/1, /fd/x, /hd [n] /x, but
2851
  * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
2790
    in first two cases the current implementation does not follow the
2852
    in the first two cases the current implementation does not follow
2791
    installed rules:
2853
    to the declared rules:
2792
    for /rd/1:
2854
    for /rd/1:
2793
    * if 0 blocks for reading are indicated, it is considered,
2855
    * if one want to read 0 blocks, function considers,
2794
      that is requested 1;
2856
      that he requested 1;
2795
    * if is requested more than 14 blocks or the initial block is not
2857
    * if one requests more than 14 blocks or starting block is
2796
      less 14, comes back eax=5 (not found) and ebx =-1;
2858
      not less than 14, function returns eax=5 (not found) è ebx=-1;
2797
    * size of the root ramdisk = 14 blocks, 0x1C00=7168 bytes; but comes
2859
    * size of ramdisk root folder is 14 blocks, 
-
 
2860
      0x1C00=7168 áàéò; but function returns ebx=0
2798
      back ebx=0 (except for a case of the previous item);
2861
      (except of the case of previous item);
2799
    * strangely enough, it is possible to read 14 block (there, generally
2862
    * strangely enough, it is possible to read 14th block (which
2800
      speaking, garbage - I remind, the score carries on with 0);
2863
      generally contains a garbage - I remind, the indexing begins
-
 
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;
2806
    * by the way speaking, the format FAT12 admits diskettes with a size
2870
    * note that format of FAT12 allows floppies with the root size
2807
      of the root less or more than 14 blocks;
2871
      more or less than 14 blocks;
2808
    * checks of length is not done;
2872
    * check for length is not performed;
2809
    * if it was possible to read given with a diskette, comes back eax=0,
2873
    * if data was successful read, function returns
2810
      ebx=0; otherwise eax=10 (access denied), ebx =-1.
2874
      eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
2811
  * Function handles reading special folders /, /rd, /fd, /hd [n]; but the
2875
  * The function handles reading of special folders /,/rd,/fd,/hd[n];
2812
    result does not correspond expected (on operation with usual
2876
    but the result does not correspond to expected (on operations with
2813
    files/folders), does not follow the installed rules, can vary in the
2877
    normal files/folders), does not follow the declared rules,
2814
    following versions of a kernel and consequently is not described.
2878
    may be changed in future versions of the kernel and consequently
2815
    For obtaining the information about the equipment use subfunction 11
2879
    is not described. To obtain the information about the equipment
-
 
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)
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
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
2877
    (4096 bytes)
2942
    (4096 bytes)
2878
  * +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
2943
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
2879
    are indicated in the common description
2944
    given in the general description
2880
Returned value:
2945
Returned value:
2881
  * eax = 0 - successfully, differently error code of a file system
2946
  * eax = 0 - success, otherwise file system error code
2882
  * ebx fail
2947
  * ebx destroyed
2883
Remarks:
2948
Remarks:
2884
  * Ramdisk and the diskettes do not support this function,
2949
  * Ramdisk and floppies do not support this function, it is only
2885
    it only for hard disks.
2950
    for hard disks.
2886
  * File should already exist (differently comes back 5, not found).
2951
  * File must already exist (otherwise function returns 5, not found).
2887
    For creation of files use subfunction 1.
2952
    To create files use subfunction 1.
2888
  * If the initial position is more than a file size, comes back eax=6 (EOF).
2953
  * If the starting position is greater than file size, the function
-
 
2954
    returns eax=6(EOF). If the end position is greater than file size,
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
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
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
3011
    space or null character follows, function returns, strangely
2946
    enough, error code 4. Is the sole function, which in general returns
3012
    enough, error code 4. It is the only function which returns
2947
    this code.
3013
    this code.
2948
 
3014
 
2949
======================================================================
3015
======================================================================
2950
====== Function 58, subfunction 8 - LBA-reading from the device. =====
3016
========= Function 58, subfunction 8 - LBA-read from device. =========
2951
======================================================================
3017
======================================================================
2952
Parameters:
3018
Parameters:
2953
  * eax = 58 - number of the function
3019
  * eax = 58 - function number
2954
  * ebx = pointer on information structure
3020
  * ebx = pointer to the information structure
2955
Format of information structure:
3021
Format of the information structure:
2956
  * +0: dword: 8 = number subfunction
3022
  * +0: dword: 8 = subfunction number
2957
  * +4: dword: number of the block for reading (beginning from 0)
3023
  * +4: dword: number of block to read (beginning from 0)
2958
  * +8: dword: ignored (install in 1)
3024
  * +8: dword: ignored (set to 1)
2959
  * +12 = +0xC: dword: pointer on buffer, where data will be written
3025
  * +12 = +0xC: dword: pointer to buffer for data (512 bytes)
2960
    (512 bytes)
-
 
2961
  * +16 = +0x10: dword: pointer on buffer for system operation
3026
  * +16 = +0x10: dword: pointer to buffer for system operations
2962
    (4096 bytes)
3027
    (4096 bytes)
2963
  * +20 = +0x14: ASCIIZ-name of the device: is not sensitive to the register,
3028
  * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
2964
    one of /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
3029
    /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
2965
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
3030
    1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
2966
    Instead of digits is admitted, though usage 'first', 'second', 'third',
3031
    Instead of digits it is allowed, though not recommended for
2967
    'fourth' is not recommended for convenience of transition on the future
3032
    convenience of transition to future extensions, to use
2968
    extensions.
3033
    'first','second','third','fourth'.
2969
Returned value:
3034
Returned value:
2970
  * if device name /hd/xxx is indicated, where xxx is not in list above:
3035
  * for device name /hd/xxx, where xxx is not in the list above:
2971
    * eax = ebx = 1
3036
    * eax = ebx = 1
2972
  * if the incorrect device name is indicated
-
 
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
2982
    * ebx = 0
3046
    * ebx = 0
2983
  * at successful reading:
3047
  * for successful read:
2984
    * eax = ebx = 0
3048
    * eax = ebx = 0
2985
Remarks:
3049
Remarks:
2986
  * Size of the block - 512 bytes; one block is read.
3050
  * Block size is 512 bytes; function reads one block.
2987
  * It is not necessary to rely on returned value, it can vary in
3051
  * Do not depend on returned value, it can be changed
2988
    the following versions.
3052
    in future versions.
2989
  * It is required, that the LBA-access to devices subfunction 11 functions 21
3053
  * Function requires that LBA-access to devices is enabled by 
2990
    should be allowed. Find out it it is possible by call
3054
    subfunction 11 of function 21. To check this one can use 
2991
    subfunction 11 functions 26.
3055
    subfunction 11 of function 26.
2992
  * LBA-reading of a diskette is not supported.
3056
  * LBA-read of floppy is not supported.
2993
  * Function reads out the data of the physical hard disk; if for any reasons
3057
  * Function reads data on physical hard drive; if for any reason
2994
    the data of the concrete unit are necessary, will come to define initial
3058
    data of the concrete partition are required, application must
2995
    sector of this unit (or directly through MBR, or from the extended
3059
    define starting sector of this partition (either directly
2996
    structure returned same subfunction 11 functions 18).
3060
    through MBR, or from the full structure returned by
-
 
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:
3027
    * eax = 0 (success)
3092
    * eax = 0 (success)
3028
    * ebx = total number of clusters
3093
    * ebx = total number of clusters
3029
    * ecx = number of free clusters
3094
    * ecx = number of free clusters
3030
    * dword [fileinfo] = cluster size (in bytes)
3095
    * dword [fileinfo] = cluster size (in bytes)
3031
Remarks:
3096
Remarks:
3032
  * Be not surprised to strange layout of 4-th returned parameter - when this
3097
  * Be not surprised to strange layout of 4th returned parameter
3033
    code was written, at system calls to the application the registers eax,
3098
    - when this code was writing, at system calls application got
3034
    ebx, ecx (from pushad-structure transmitted as argument to the system
3099
    only registers eax,ebx,ecx (from pushad-structure transmitted
3035
    function) came back only. Now it is corrected, so, probably, it is
3100
    as argument to the system function). Now it is corrected, so,
3036
    meaningful to return a cluster size in edx, while this function have
3101
    probably, it is meaningful to return cluster size in edx, while
3037
    not begun to use
3102
    this function is not used yet.
3038
  * Generally still exists subfunction 11 functions 18, returning the
3103
  * There exists also subfunction 11 of function 18,
3039
    information on a file system. Under the extended table of a disk
3104
    which returns information on file system. From the full table
3040
    subsystem it is possible to define a cluster size (there it is stored
3105
    of disk subsystem it is possible to deduce cluster size (there
3041
    in sectors) and total number of clusters for hard disks.
3106
    it is stored in sectors) and total number of clusters
-
 
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
3054
  * +8: dword: 0 or pointer on ASCIIZ-string with parameters
3120
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
3055
  * +12 = +0xC: dword: ignored
3121
  * +12 = +0xC: dword: ignored
3056
  * +16 = +0x10: dword: pointer on buffer for system operation
3122
  * +16 = +0x10: dword: pointer to buffer for system operations
3057
    (4096 bytes)
3123
    (4096 bytes)
3058
  * +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
3124
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3059
    are indicated in the common description
3125
    given in the general description
3060
Returned value:
3126
Returned value:
3061
  * eax > 0 - program is loaded, eax contains PID
3127
  * eax > 0 - the program is loaded, eax contains PID
3062
  * eax < 0 - has taken place error, -eax contains an error code
3128
  * eax < 0 - an error has occured, -eax contains
3063
    of a file system
3129
    file system error code
3064
Remarks:
3130
Remarks:
3065
  * This function is obsolete, use subfunction 7 functions 70.
3131
  * This function is obsolete, use subfunction 7 of function 70.
3066
  * Command line should be ended by the character with the code 0
3132
  * Command line must be terminated by character with code 0
3067
    (ASCIIZ-strings); it are taken into account or all characters up to
3133
    (ASCIIZ-string); function takes into account either all characters
3068
    completing zero inclusively, or the first 256 characters, that are less.
3134
    up to terminating null inclusively or the first 256 charachters
-
 
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:
3082
  * eax = total number of system calls made from moment
3149
  * eax = total number of system calls made from system boot
3083
    of loading system (modulo 2^32)
3150
    (modulo 2^32)
3084
  * ebx = 0
3151
  * ebx = 0
3085
Format of information about one call: (size = 0x40 = 64 bytes)
3152
Format of information on one call: (size = 0x40 = 64 bytes)
3086
  * +0: dword: PID process/thread
3153
  * +0: dword: PID of process/thread
3087
  * +4: 7*dword: garbage
3154
  * +4: 7*dword: garbage
3088
  * +32 = +0x20: dword: value edi by call
3155
  * +32 = +0x20: dword: value of edi at the call
3089
  * +36 = +0x24: dword: esi
3156
  * +36 = +0x24: dword: esi
3090
  * +40 = +0x28: dword: ebp
3157
  * +40 = +0x28: dword: ebp
3091
  * +44 = +0x2C: dword: pointer of stack of kernel handler
3158
  * +44 = +0x2C: dword: stack pointer of the kernel handler
3092
  * +48 = +0x30: dword: ebx
3159
  * +48 = +0x30: dword: ebx
3093
  * +52 = +0x34: dword: edx
3160
  * +52 = +0x34: dword: edx
3094
  * +56 = +0x38: dword: ecx
3161
  * +56 = +0x38: dword: ecx
3095
  * +60 = +0x3C: dword: eax (=number system function)
3162
  * +60 = +0x3C: dword: eax (=number of system function)
3096
Remarks:
3163
Remarks:
3097
  * Function is used only in the application systrace. It is rather difficult
3164
  * The function is used only in the application 'systrace'.
-
 
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)...
3101
  * In this connection there is a sentence support of this function from
3169
  * So there is a proposition to delete from the kernel
3102
    a kernel to remove absolutely, together with the application systrace.
3170
    support of this function, together with application 'systrace'.
3103
  * Information on system calls is saved in system ring buffer
3171
  * The information on system calls saves in the system
3104
    on 0x10 of inputs.
3172
    ring buffer with 0x10 entries.
3105
    This function simply copies the indicated size given from the mentioned
3173
    This function simply copies the given size of data
3106
    buffer to the indicated address.
3174
    from this buffer to the given address.
3107
  * To what from inputs in the buffer corresponds to last call, it is possible
3175
  * One can determine, which entry in the buffer corresponds to
3108
    to define on value eax, namely,
3176
    last system call, by value of eax, namely, it is the entry
3109
    input (eax and 0xF) (on offset (eax and 0xF) *0x40).
3177
    (eax and 0xF) (at offset (eax and 0xF)*0x40).
3110
  * In current implementation the seldom meeting problems of
3178
  * In the current implementation there can be the seldom
3111
    unsynchronization are possible, when about some calls the
3179
    meeting problems of unsynchronization, when the information
3112
    information becomes outdated.
3180
    on some calls becomes outdated.
3113
  * Under the system buffer the page, 4 KB is allocated.
3181
  * Under the system buffer one page, 4Kb, is allocated.
3114
    Size of an input = 64 bytes.
3182
    Size of an entry = 64 bytes. Why only 16 entries are used,
3115
    Why 16 inputs - not clearly are used only.
3183
    is not clearly.
3116
  * Value esp at moment of system call by this function cannot be found out.
3184
  * The value of esp at the moment of system call cannot
-
 
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
======================================================================
3190
======================================================================
3122
IPC is applied to sendings the messages from one process / thread to another.
3191
IPC is used for message dispatching from one process/thread to
3123
Thus it is necessary previously to agree how to interpreted
3192
another. Previously it is necessary to agree how to interpret
3124
the concrete message.
3193
the concrete message.
3125
 
3194
 
3126
-------- Subfunction 1 - install area for obtaining IPC ---------
3195
----------- Subfunction 1 - set the area for IPC receiving -----------
3127
Is called by the process - receiver.
3196
Is called by process-receiver.
3128
Parameters:
3197
Parameters:
3129
  * eax = 60 - number of the function
3198
  * eax = 60 - function number
3130
  * ebx = 1 - number subfunction
3199
  * ebx = 1 - subfunction number
3131
  * ecx = pointer on buffer
3200
  * ecx = pointer to the buffer
3132
  * edx = size of buffer
3201
  * edx = size of the buffer
3133
Returned value:
3202
Returned value:
3134
  * eax = 0 - always successfully
3203
  * eax = 0 - always success
3135
Ôîðìàò IPC-áóôåðà:
3204
Format of IPC-buffer:
3136
  * +0: dword: if here not 0, the buffer is considered disabled; lock/unblock
3205
  * +0: dword: if nonzero, buffer is considered locked;
3137
    the buffer, when you with it actively work also to you it is necessary,
-
 
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
 
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:
3158
  * eax = 0 - successfully
3226
  * eax = 0 - success
3159
  * eax = 1 - receiver has not defined buffer for IPC-messages
3227
  * eax = 1 - the receiver has not defined buffer for IPC messages
3160
   (can be, was not in time yet, and there can be, it not that thread,
3228
    (can be, still have no time,
3161
   which is necessary)
3229
    and can be, this is not right process)
3162
  * eax = 2 - receiver has blocked the IPC-buffer; try slightly to wait
3230
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
3163
  * eax = 3 - overflow of IPC-buffer of receiver
3231
  * eax = 3 - overflow of IPC-buffer of the receiver
3164
  * eax = 4 - process/thread with such PID does not exist
3232
  * eax = 4 - process/thread with such PID does not exist
3165
Remarks:
3233
Remarks:
3166
  * System at once after writing the IPC-message in the buffer dispatches
3234
  * Immediately after writing of IPC-message to the buffer the system
3167
    to stream - receiver event with the code 7 (see codes of events).
3235
    sends to the receiver the event with code 7 (see event codes).
3168
 
3236
 
3169
======================================================================
3237
======================================================================
3170
==== Function 61 - get parameters for direct access to a graphics. ===
3238
==== Function 61 - get parameters for the direct graphics access. ====
3171
======================================================================
3239
======================================================================
3172
Data of graphics screen are accessible to program (area of memory, which purely
3240
The data of the graphics screen (the memory area which displays
3173
also displays contents of  screen) directly without calls of system functions
3241
screen contents) are accessible to a program directly, without
3174
through the selector gs:
3242
any system calls, through the selector gs:
3175
    mov    eax, [gs:0]
3243
	mov	eax, [gs:0]
-
 
3244
places in eax the first dword of the buffer, which contains
3176
will place in eax first dword of buffer containing information on colour
3245
information on color of the left upper point (and, possibly, colors
3177
of left upper point (and, probably, colour of several following).
3246
of several following).
3178
    mov    [gs:0], eax
3247
	mov	[gs:0], eax
3179
by operation in modes VESA c LFB will install colour of left upper point
3248
by work in VESA modes with LFB sets color of the left upper point
3180
(and, probably, colour of several following).
3249
(and, possibly, colors of several following).
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.
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
-
 
3260
    LFB itself, so reading/writing on gs result directly in
3191
    LFB, so reading /  writing on gs result directly in change of contents of
3261
    change of screen contents. By operation in videomodes without
3192
    the screen. By operation in videomodes without LFB gs specifies some area
3262
    LFB gs points to some data area in the kernel, and all functions
3193
    of the given kernel, and all functions of output on the screen honesty
3263
    of screen output fulfil honesty double operation on writing
3194
    fulfil double operation on writing directly on the screen and on
3264
    directly to the screen and writing to this buffer. In result
3195
    writing in this buffer. In result at reading contents of this buffer the
3265
    at reading contents of this buffer the results correspond to
3196
    results correspond to contents of the screen (with, generally speaking,
3266
    screen contents (with, generally speaking, large color
3197
    large colour permission), and writing ignored.
3267
    resolution), and writing is ignored.
3198
    Exception is the mode 320*200, for which in main loop system thread the
-
 
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 --------------------------
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:
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
======================================================================
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. ====
3244
======================================================================
3313
======================================================================
3245
Parameters:
3314
Parameters:
3246
  * eax = 62 - number of the function
3315
  * eax = 62 - function number
3247
  * bl = 1 - number subfunction
3316
  * bl = 1 - subfunction number
3248
Returned value:
3317
Returned value:
3249
  * eax = -1 - access to PCI is prohibited; differently
3318
  * eax = -1 - access to PCI is disabled; otherwise
3250
  * al = number of last PCI-bus; the stayed bits eax fail
3319
  * al = number of the last PCI-bus; other bytes of eax are destroyed
3251
Remarks:
3320
Remarks:
3252
  * Low level access to PCI for applications subfunction 12
3321
  * Previously low-level access to PCI for applications must be
3253
    functions 21 previously should be allowed.
3322
    enabled by subfunction 12 of function 21.
3254
  * If PCI BIOS is not supported, the value al is not defined.
3323
  * If PCI BIOS is not supported, the value of ax is undefined.
3255
 
3324
 
3256
======================================================================
3325
======================================================================
3257
====================== Function 62, subfunction 2 ====================
3326
===================== Function 62, subfunction 2 =====================
3258
=========== Get mechanism of call to configuration space PCI. ========
3327
===== Get mechanism of addressing to the PCI configuration space. ====
3259
======================================================================
3328
======================================================================
3260
Parameters:
3329
Parameters:
3261
  * eax = 62 - number of the function
3330
  * eax = 62 - function number
3262
  * bl = 2 - number subfunction
3331
  * bl = 2 - subfunction number
3263
Returned value:
3332
Returned value:
3264
  * eax = -1 - access to PCI is prohibited; differently
3333
  * eax = -1 - access to PCI is disabled; otherwise
3265
  * al = mechanism (1 or 2); the other bits eax fail
3334
  * al = mechanism (1 or 2); other bytes of eax are destroyed
3266
Remarks:
3335
Remarks:
3267
  * Low level access to PCI for applications subfunction 12
3336
  * Previously low-level access to PCI for applications must be
-
 
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.
3339
    equipment characteristics.
3270
  * Subfunctions of reading and writing automatically work with
3340
  * Subfunctions of read and write work automatically
3271
    selected mechanism.
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. ========
3275
======================================================================
3345
======================================================================
3276
Parameters:
3346
Parameters:
3277
  * eax = 62 - number of the function
3347
  * eax = 62 - function number
3278
  * bl = 4 - read bytes
3348
  * bl = 4 - read byte
3279
  * bl = 5 - read a word
3349
  * bl = 5 - read word
3280
  * bl = 6 - tread a double word
3350
  * bl = 6 - read dword
3281
  * bh = number of PCI-bus
3351
  * bh = number of PCI-bus
3282
  * ch = dddddfff, where ddddd = number of device on bus,
3352
  * ch = dddddfff, where ddddd = number of the device on the bus,
3283
    fff = number of function of device
3353
    fff = function number of device
3284
  * cl = number of the register (should be even for bl=5,
3354
  * cl = number of register (must be even for bl=5,
3285
    be divided on 4 for bl=6)
3355
    divisible by 4 for bl=6)
3286
Returned value:
3356
Returned value:
3287
  * eax = -1 - error (prohibited access to PCI
3357
  * eax = -1 - error (access to PCI is disabled or parameters
3288
    or unsupported parameters); differently
3358
    are not supported); otherwise
3289
  * al/ax/eax (depending on the requested size) contains the data;
3359
  * al/ax/eax (depending on requested size) contains the data;
3290
    the rest of the register eax fail
3360
    the other part of register eax is destroyed
3291
Remarks:
3361
Remarks:
3292
  * Low level access to PCI for applications subfunction 12
3362
  * Previously low-level access to PCI for applications must be
3293
    functions 21 previously should be allowed.
-
 
3294
  * Access mechanism 2 supports only 16 devices on the bus and ignores number
3363
    enabled by subfunction 12 of function 21.
3295
    of the function. To receive an access mechanism it is possible by call
3364
  * Access mechanism 2 supports only 16 devices on a bus and ignores
-
 
3365
    function number. To get access mechanism use subfunction 2.
3296
    subfunction 2.
3366
  * Some registers are standard and exist for all devices, some are
3297
  * Some registers are standard and exist for all devices, some are defined
3367
    defined by the concrete device. The list of registers of the
3298
    by the concrete device. The list first enters, for example, in known
3368
    first type can be found e.g. in famous
3299
    Interrupt List by Ralf Brown
3369
    Interrupt List by Ralf Brown
3300
    (http://www.pobox.com/~ralf/files.html,
3370
    (http://www.pobox.com/~ralf/files.html,
3301
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
3371
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
-
 
3372
    registers of the second type must be listed
3302
    list second should be indicated in documentation on the device.
3373
    in the device documentation.
3303
 
3374
 
3304
======================================================================
3375
======================================================================
3305
====== Function 62, subfunction 8,9,10 - write in PCI-register. ======
3376
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
3306
======================================================================
3377
======================================================================
3307
Parameters:
3378
Parameters:
3308
  * eax = 62 - number of the function
3379
  * eax = 62 - function number
3309
  * bl = 8 - write bytes
3380
  * bl = 8 - write byte
3310
  * bl = 9 - write a word
3381
  * bl = 9 - write word
3311
  * bl = 10 - write a double word
3382
  * bl = 10 - write dword
3312
  * bh = number of PCI-bus
3383
  * bh = number of PCI-bus
3313
  * ch = dddddfff, where ddddd = number of the device on bus,
3384
  * ch = dddddfff, where ddddd = number of the device on the bus,
3314
    fff = number of  function of device
3385
    fff = function number of device
3315
  * cl = number of register (should be even for bl=9,
3386
  * cl = number of register (must be even for bl=9,
3316
    be divided on 4 for bl=10)
3387
    divisible by 4 for bl=10)
-
 
3388
  * dl/dx/edx (depending on requested size) contatins
3317
  * dl/dx/edx (depending on requested size) contains given for writing
3389
    the data to write
3318
Returned value:
3390
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
3397
  * Access mechanism 2 supports only 16 devices on a bus and ignores
3325
    of the function. To receive an access mechanism it is possible by call
-
 
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
-
 
3400
    defined by the concrete device. The list of registers of the
3328
    by the concrete device. The list first enters, for example, in known
3401
    first type can be found e.g. in famous Interrupt List by
3329
    Interrupt List by Ralf Brown;
3402
    Ralf Brown; registers of the second type must be listed
3330
    list second should be indicated in documentation on the device.
3403
    in the device documentation.
3331
 
3404
 
3332
======================================================================
3405
======================================================================
3333
============== Function 63 - work with debugging board. ==============
3406
============== Function 63 - work with the debug board. ==============
3334
======================================================================
3407
======================================================================
3335
Debugging board represents the system buffer (on 512 bytes), in which any
3408
The debug board is the global system buffer (with the size
3336
program can write (generally speaking, arbitrary) data and from which other
3409
512 bytes), to which any program can write (generally speaking,
3337
program can these data read.
3410
arbitrary) data and from which other program can read these data.
3338
There is an agreement, according to which written given - text strings
3411
By the agreement written data are text strings interpreted as
3339
interpreted as of the debug message on a course of execution of the program.
3412
debug messages on a course of program execution. The kernel in
3340
The kernel in the defined situations also writes to board of debugging of the
3413
some situations also writes to the debug board information on
3341
item of information about execution of some functions; under the agreement of
3414
execution of some functions; by the agreement kernel messages
3342
the message of a kernel start with the prefix " K: ".
3415
begins from the prefix "K : ".
3343
For review of board of debugging the application board is created which reads
3416
For view of the debug board the application 'board' was created,
3344
out the data from the buffer and displays them in the window. board understands
3417
which reads data from the buffer and displays them in its window.
3345
a sequence of codes 13,10 as transition on new string
3418
'board' interpretes the sequence of codes 13,10 as newline.
3346
Character with the zero code at the end of string is not mandatory,
3419
A character with null code in an end of line is not necessary,
3347
but also does not prevent.
3420
but also does not prevent.
3348
As has appeared of the debugger necessity of board of debugging a little has
3421
Because debugger has been written, the value of the debug board
3349
decreased, as the debugger allows completely to inspect a course of execution
3422
has decreased, as debugger allows to inspect completely a course of
3350
of the program, and for this purpose it is not required of any efforts on the
3423
program execution without any efforts from the direction of program
3351
part of the  program. Nevertheless in many cases the board of debugging
-
 
3352
continues to remain useful.
3424
itself. Nevertheless in some cases the debug board is still useful.
3353
 
3425
 
3354
---------------------------- Writing of byte ----------------------------
3426
----------------------------- Write byte -----------------------------
3355
Parameters:
3427
Parameters:
3356
  * eax = 63 - number of the function
3428
  * eax = 63 - function number
3357
  * ebx = 1 - number subfunction
3429
  * ebx = 1 - subfunction number
3358
  * cl = bytes of data
3430
  * cl = data byte
3359
Returned value:
3431
Returned value:
3360
  * function does not return value
3432
  * function does not return value
3361
Remarks:
3433
Remarks:
3362
  * Byte is written in buffer. Length of buffer - 512 bytes.
3434
  * Byte is written to the buffer. Buffer size is 512 bytes.
3363
    At overflow of the buffer all obtained data are lost also filling
3435
    At buffer overflow all obtained data are lost.
3364
    starts again with zero.
-
 
3365
  * For output to board of debugging of more complex objects (strings, numbers)
3436
  * For output to the debug board of more complicated objects
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
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. ==============
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
 
3399
-------- Subfunction 1 - install a keyboard mode. ---------
3470
-------------- Subfunction 1 - set keyboard input mode. --------------
3400
Parameters:
3471
Parameters:
3401
  * eax = 66 - number of the function
3472
  * eax = 66 - function number
3402
  * ebx = 1 - number subfunction
3473
  * ebx = 1 - subfunction number
3403
  * ecx = mode:
3474
  * ecx = mode:
3404
    * 0 = normal (ASCII-characters)
3475
    * 0 = normal (ASCII-characters)
3405
    * 1 = scancodes
3476
    * 1 = scancodes
3406
Returned value:
3477
Returned value:
3407
  * function does not return value
3478
  * function does not return value
3408
 
3479
 
3409
--------- Subfunction 2 - get a keyboard mode. ----------
3480
-------------- Subfunction 2 - get keyboard input mode. --------------
3410
Parameters:
3481
Parameters:
3411
  * eax = 66 - number of the function
3482
  * eax = 66 - function number
3412
  * ebx = 2 - number subfunction
3483
  * ebx = 2 - subfunction number
3413
Returned value:
3484
Returned value:
3414
  * eax = current mode
3485
  * eax = current mode
3415
 
3486
 
3416
------- Subfunction 3 - get a status of direction keys. --------
3487
------------ Subfunction 3 - get status of control keys. -------------
3417
Parameters:
3488
Parameters:
3418
  * eax = 66 - number of the function
3489
  * eax = 66 - function number
3419
  * ebx = 3 - number subfunction
3490
  * ebx = 3 - subfunction number
3420
Returned value:
3491
Returned value:
3421
  * eax = bit mask:
3492
  * eax = bit mask:
3422
  * Bit 0 (mask 1): left Shift is pressed
3493
  * bit 0 (mask 1): left Shift is pressed
3423
  * Bit 1 (mask 2): right Shift is pressed
3494
  * bit 1 (mask 2): right Shift is pressed
3424
  * Bit 2 (mask 4): left Ctrl is pressed
3495
  * bit 2 (mask 4): left Ctrl is pressed
3425
  * Bit 3 (mask 8): right Ctrl is pressed
3496
  * bit 3 (mask 8): right Ctrl is pressed
3426
  * Bit 4 (mask 0x10): left Alt is pressed
3497
  * bit 4 (mask 0x10): left Alt is pressed
3427
  * Bit 5 (mask 0x20): right Alt is pressed
3498
  * bit 5 (mask 0x20): right Alt is pressed
3428
  * Bit 6 (mask 0x40): CapsLock is included
3499
  * bit 6 (mask 0x40): CapsLock is on
3429
  * Bit 7 (mask 0x80): NumLock is included
3500
  * bit 7 (mask 0x80): NumLock is on
3430
  * Bit 8 (mask 0x100): ScrollLock is included
3501
  * bit 8 (mask 0x100): ScrollLock is on
3431
  * The other bits are reset
3502
  * other bits are cleared
3432
 
3503
 
-
 
3504
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3433
----- Subfunction 4 - install common system "hotkey". -----
3505
When hotkey is pressed, the system notifies only those applications,
3434
Applications which have installed it are informed only on pressing "hotkey";
3506
which have installed it; the active application (which receives
3435
the active application (to which acts all normal input) such keys does not get.
3507
all normal input) does not receive such keys.
3436
Notice consists in sending event with the code 2.
3508
The notification consists in sending event with the code 2.
3437
To read "hotkey" it is possible the same as also usual, - function 2.
3509
Reading hotkey is the same as reading normal key - by function 2.
3438
Parameters:
3510
Parameters:
3439
  * eax = 66 - number of the function
3511
  * eax = 66 - function number
3440
  * ebx = 4 - number subfunction
3512
  * ebx = 4 - subfunction number
3441
  * cl sets scancode of the key;
3513
  * cl determines key scancode;
3442
    ãse cl=0 for definition of combinations of a type Ctrl+Shift
3514
    use cl=0 to give combinations such as Ctrl+Shift
3443
  * edx = 0xXYZ ûets possible statuses of direction keys:
3515
  * edx = 0xXYZ determines possible states of control keys:
3444
    * Z (low 4 bits) are set by a status of keys LShift and RShift:
3516
    * Z (low 4 bits) determines state of LShift and RShift:
3445
      * 0 = any of keys should not be pressed;
3517
      * 0 = no key must be pressed;
3446
      * 1 = only one of keys is should be pressed;
3518
      * 1 = exactly one key must be pressed;
3447
      * 2 = both keys should be pressed;
3519
      * 2 = both keys must be pressed;
3448
      * 3 = should be pressed LShift, but not RShift;
3520
      * 3 = must be pressed LShift, but not RShift;
3449
      * 4 = should be pressed RShift, but not LShift
3521
      * 4 = must be pressed RShift, but not LShift
3450
    * Y - is similar for LCtrl and RCtrl;
3522
    * Y - similar for LCtrl and RCtrl;
3451
    * X - is similar for LAlt and RAlt
3523
    * X - similar for LAlt and RAlt
3452
Returned value:
3524
Returned value:
3453
  * eax=0 - successfully
3525
  * eax=0 - success
3454
  * eax=1 - too much "hotkey" is admitted (maximal 256)
3526
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3455
Remarks:
3527
Remarks:
3456
  * Hotkey can work either at pressing, or at release. Scancode of release
3528
  * Hotkey can work either at pressing or at release. Release
3457
    of the key on 128 it is more, than scancode of pressing
3529
    scancode of a key is more on 128 than pressing scancode
3458
    (i.e. high bit is installed).
3530
    (i.e. high bit is set).
3459
  * Some applications can install the same combination; all such applications
3531
  * Several applications can set the same combination;
-
 
3532
    all such applications will be informed on pressing
3460
    will be informed on pressing such combination.
3533
    such combination.
3461
 
3534
 
3462
------ Subfunction 5 - delete installed "hotkey". -------
3535
-------------- Subfunction 5 - delete installed hotkey. --------------
3463
Parameters:
3536
Parameters:
3464
  * eax = 66 - number of the function
3537
  * eax = 66 - function number
3465
  * ebx = 5 - number subfunction
3538
  * ebx = 5 - subfunction number
3466
  * cl = scancode of key and edx = 0xXYZ same, as well as in subfunction 4
3539
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3467
Returned value:
3540
Returned value:
3468
  * eax = 0 - successfully
3541
  * eax = 0 - success
3469
  * eax = 1 - there is no such hotkey
3542
  * eax = 1 - there is no such hotkey
3470
Remarks:
3543
Remarks:
-
 
3544
  * When a process/thread terminates, all hotkey installed by it are
3471
  * At completion of process / thread all hotkey, installed by it are deleted.
3545
    deleted.
3472
  * Function call does not influence other applications. If other application
3546
  * The call to this subfunction does not affect other applications.
-
 
3547
    If other application has defined the same combination, it will
3473
    has defined same combination, it will receive still notices.
3548
    still receive notices.
3474
 
3549
 
3475
======================================================================
3550
======================================================================
3476
============ Function 67 - change location/sizes of window. ===========
3551
========= Function 67 - change position/sizes of the window. =========
3477
======================================================================
3552
======================================================================
3478
Parameters:
3553
Parameters:
3479
  * eax = 67 - number of the function
3554
  * eax = 67 - function number
3480
  * ebx = new x-coordinate of the window
3555
  * ebx = new x-coordinate of the window
3481
  * ecx = new y-coordinate of the window
3556
  * ecx = new y-coordinate of the window
3482
  * edx = new x-size of the window
3557
  * edx = new x-size of the window
3483
  * esi = new y-size of the window
3558
  * esi = new y-size of the window
3484
Returned value:
3559
Returned value:
3485
  * function does not return value
3560
  * function does not return value
3486
Remarks:
3561
Remarks:
3487
  * Value -1 for the parameter means "to not change"; for example, for moving
3562
  * The value -1 for a parameter means "do not change"; e.g. to move
3488
    the window without resizing it is possible to specify edx=esi =-1.
3563
    the window without resizing it is possible to specify edx=esi=-1.
3489
  * Previously window should be defined by the function 0.
3564
  * Previously the window must be defined by function 0.
3490
    It sets initial coordinates and sizes of the window.
3565
    It sets initial coordinates and sizes of the window.
3491
  * Sizes of the window are understood in sense of the function 0,
3566
  * Sizes of the window are understood in sense of function 0,
3492
    i.e. on one pixel it is less, than real sizes.
3567
    that is one pixel less than real sizes.
3493
  * Function call for the maximized windows is simple ignored.
3568
  * The function call for maximized windows is simply ignored.
3494
  * For windows of appropriate styles a location and/or the sizes can be
3569
  * For windows of appropriate styles position and/or sizes can be
3495
    changed by the user; current a location and the sizes can be obtained
3570
    changed by user; current position and sizes can be obtained by
3496
    by function call 9.
3571
    call to function 9.
3497
  * Function dispatches to window event redraw (with the code 1).
3572
  * The function sends to the window redraw event (with the code 1).
3498
 
3573
 
3499
======================================================================
3574
======================================================================
3500
== Function 68, subfunction 0 - get the counter of task switchings. ==
3575
====== Function 68, subfunction 0 - get the task switch counter. =====
3501
======================================================================
3576
======================================================================
3502
Parameters:
3577
Parameters:
3503
  * eax = 68 - number of the function
3578
  * eax = 68 - function number
3504
  * ebx = 0 - number subfunction
3579
  * ebx = 0 - subfunction number
3505
Returned value:
3580
Returned value:
3506
  * eax = number of task switchings from the moment of loading the system
3581
  * eax = number of task switches from the system booting
3507
   (modulo 2^32)
3582
    (modulo 2^32)
3508
 
3583
 
3509
======================================================================
3584
======================================================================
3510
====================== Function 68, subfunction 1 ====================
3585
======= Function 68, subfunction 1 - switch to the next thread. ======
3511
=========== To switch to the following thread of execution. ==========
-
 
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.
-
 
3518
Parameters:
3591
Parameters:
3519
  * eax = 68 - number of the function
3592
  * eax = 68 - function number
3520
  * ebx = 1 - number subfunction
3593
  * ebx = 1 - subfunction number
3521
Returned value:
3594
Returned value:
3522
  * function does not return value
3595
  * function does not return value
3523
 
3596
 
3524
======================================================================
3597
======================================================================
3525
============ Function 68, subfunction 2 - cache + rdpmc. =============
3598
============= Function 68, subfunction 2 - cache + rdpmc. ============
3526
======================================================================
3599
======================================================================
3527
Parameters:
3600
Parameters:
3528
  * eax = 68 - number of the function
3601
  * eax = 68 - function number
3529
  * ebx = 2 - number subfunction
3602
  * ebx = 2 - subfunction number
3530
  * ecx = required operation:
3603
  * ecx = required action:
3531
    * ecx = 0 - to permit execution of the instruction rdpmc
3604
    * ecx = 0 - enable instruction 'rdpmc'
3532
      (ReaD Performance-Monitoring Counters)
3605
      (ReaD Performance-Monitoring Counters) for applications
3533
    * ecx = 1 - find out, enabled/disabled cache
3606
    * ecx = 1 - find out whether cache is disabled/enabled
3534
    * ecx = 2 - enabled cache
3607
    * ecx = 2 - enable cache
3535
    * ecx = 3 - disabled cache
3608
    * ecx = 3 - disable cache
3536
Returned value:
3609
Returned value:
3537
  * for ecx=0:
3610
  * for ecx=0:
3538
    * eax = value cr4
3611
    * eax = the value of cr4
3539
  * for ecx=1:
3612
  * for ecx=1:
3540
    * eax = (cr0 and 0x60000000):
3613
    * eax = (cr0 and 0x60000000):
3541
    * eax = 0 - cache enabled
3614
    * eax = 0 - cache is on
3542
    * eax <> 0 - cache disabled
3615
    * eax <> 0 - cache is off
3543
  * for ecx=2 and ecx=3:
3616
  * for ecx=2 and ecx=3:
3544
    * function does not return value
3617
    * function does not return value
3545
 
3618
 
3546
======================================================================
3619
======================================================================
3547
=========== Function 68, subfunction 3 - read MSR-register. ==========
3620
=========== Function 68, subfunction 3 - read MSR-register. ==========
3548
======================================================================
3621
======================================================================
3549
MSR = Model Specific Register; the complete list of the MSR-registers of the
3622
MSR = Model Specific Register; the complete list of MSR-registers
3550
processor contains in documentation on the processor (for example, IA-32 Intel
3623
of a processor is included to the documentation on it (for example,
3551
Architecture Software Developer's Manual, Volume 3, Appendix B); each set of
3624
IA-32 Intel Architecture Software Developer's Manual,
-
 
3625
Volume 3, Appendix B); each processor family has its own subset
3552
processors has the subset of the MSR-registers.
3626
of the MSR-registers.
3553
Parameters:
3627
Parameters:
3554
  * eax = 68 - number of the function
3628
  * eax = 68 - function number
3555
  * ebx = 3 - number subfunction
3629
  * ebx = 3 - subfunction number
3556
  * ecx ignored
3630
  * ecx is ignored
3557
  * edx = address MSR
3631
  * edx = MSR address
3558
Returned value:
3632
Returned value:
3559
  * ebx:eax = high:low dword of result
3633
  * ebx:eax = high:low dword of the result
3560
Remarks:
3634
Remarks:
3561
  * Instruction in ecx nonexistent or non-realized for of the given processor
3635
  * If ecx contains nonexistent or not implemented for this processor
3562
    MSR will entail exception in a kernel, which will kill thread.
3636
    MSR, processor will generate an exception in the kernel, which
-
 
3637
    will kill the thread.
3563
  * Previously it is necessary to define, whether are supported MSR as a whole,
3638
  * Previously it is necessary to check, whether MSRs are supported
3564
    command cpuid. Differently there will be already other exception in a
3639
    as a whole, with the instruction 'cpuid'. Otherwise processor
3565
    kernel, which all the same will kill thread.
3640
    will generate other exception in the kernel, which will anyway
-
 
3641
    kill the thread.
3566
 
3642
 
3567
======================================================================
3643
======================================================================
3568
========= Function 68, subfunction 4 - çàïèñàòü â MSR-ðåãèñòð. =========
3644
========= Function 68, subfunction 4 - write to MSR-register. ========
3569
======================================================================
3645
======================================================================
3570
MSR = Model Specific Register; the complete list of the MSR-registers of the
3646
MSR = Model Specific Register; the complete list of MSR-registers
3571
processor contains in documentation on the processor (for example, IA-32 Intel
3647
of a processor is included to the documentation on it (for example,
3572
Architecture Software Developer's Manual, Volume 3, Appendix B); each set of
3648
IA-32 Intel Architecture Software Developer's Manual,
-
 
3649
Volume 3, Appendix B); each processor family has its own subset
3573
processors has the subset of the MSR-registers.
3650
of the MSR-registers.
3574
Parameters:
3651
Parameters:
3575
  * eax = 68 - number of the function
3652
  * eax = 68 - function number
3576
  * ebx = 4 - number subfunction
3653
  * ebx = 4 - subfunction number
3577
  * ecx ignored
3654
  * ecx is ignored
3578
  * edx = address MSR
3655
  * edx = MSR address
3579
  * esi:edi = high:low dword of result
3656
  * esi:edi = high:low dword
3580
Returned value:
3657
Returned value:
3581
  * ebx:eax = copy esi:edi
3658
  * ebx:eax = copy of esi:edi
3582
Remarks:
3659
Çàìå÷àíèÿ:
3583
  * Instruction in ecx nonexistent or non-realized for of the given processor
3660
  * If ecx contains nonexistent or not implemented for this processor
3584
    MSR will entail exception in a kernel, which will kill thread.
3661
    MSR, processor will generate an exception in the kernel, which
-
 
3662
    will kill the thread.
3585
  * Previously it is necessary to define, whether are supported MSR as a whole,
3663
  * Previously it is necessary to check, whether MSRs are supported
3586
    command cpuid. Differently there will be already other exception in a
3664
    as a whole, with the instruction 'cpuid'. Otherwise processor
3587
    kernel, which all the same will kill thread.
3665
    will generate other exception in the kernel, which will anyway
-
 
3666
    kill the thread.
3588
 
3667
 
3589
======================================================================
3668
======================================================================
3590
======= Function 68, subfunction 5 - allocate physical memory. =======
3669
======= Function 68, subfunction 5 - allocate physical memory. =======
3591
======================================================================
3670
======================================================================
3592
Parameters:
3671
Parameters:
3593
  * eax = 68 - number of the function
3672
  * eax = 68 - function number
3594
  * ebx = 5 - number subfunction
3673
  * ebx = 5 - subfunction number
3595
  * ecx = size (in bytes)
3674
  * ecx = size (in bytes)
3596
Returned value:
3675
Returned value:
3597
  * eax = physical address of allocated memory
3676
  * eax = physical address of allocated memory
3598
Remarks:
3677
Remarks:
3599
  * Usual applications should not use this function, it is intended for of a
3678
  * Normal applications must not use this function, it is intended
3600
    case, when by operation with any device it is required to place the data
3679
    for the case, when for some device it is required to place
3601
    to the known physical address. (In effect, this function was developed for
3680
    data to the known physical address. (In effect, this function
3602
    AC97WAV.)
3681
    was developed for AC97WAV.)
3603
  * Number of blocks of the actual storage is limited (constant 24, and this
3682
  * The number of blocks of physical memory is limited (by constant
3604
    constant includes and some memories for of needs of a kernel).
3683
    24, and this constant includes some blocks for kernel).
3605
  * Free allocated memory it is possible subfunction 6, in copying data
3684
  * To free a memory allocated by such way use
-
 
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
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
 
3624
======================================================================
3704
======================================================================
3625
==== Function 68, subfunction 7 - write data in physical memory. =====
3705
===== Function 68, subfunction 7 - write data to physical memory. ====
3626
======================================================================
3706
======================================================================
3627
Parameters:
3707
Parameters:
3628
  * eax = 68 - number of the function
3708
  * eax = 68 - function number
3629
  * ebx = 7 - number subfunction
3709
  * ebx = 7 - subfunction number
3630
  * ecx = physical address
3710
  * ecx = physical address
3631
  * edx = pointer on data (in application)
3711
  * edx = pointer to the data (in the application)
3632
  * esi = data size (in bytes)
3712
  * esi = size of the data (in bytes)
3633
Returned value:
3713
Returned value:
3634
  * function does not return value
3714
  * function does not return value
3635
Remarks:
3715
Remarks:
3636
  * Usual applications should not use this function, it is intended for of a
3716
  * Normal applications must not use this function, it is intended
3637
    case, when by operation with any device it is required to place the data
3717
    for the case, when for some device it is required to place
3638
    to the known physical address. (In effect, this function was developed for
3718
    data to the known physical address. (In effect, this function
3639
    AC97WAV.)
3719
    was developed for AC97WAV.)
3640
  * Range of physical addresses should lay inside allocated subfunction 5
3720
  * The range of physical addresses should lie inside of previously
3641
    blocks of physical memory.
3721
    allocated by subfunction 5 block of physical memory.
3642
  * Checks of a correctness is not made.
3722
  * There is no check for correctness.
3643
 
3723
 
3644
======================================================================
3724
======================================================================
3645
==== Function 68, subfunction 8 - read data from physical memory. ====
3725
==== Function 68, subfunction 8 - read data from physical memory. ====
3646
======================================================================
3726
======================================================================
3647
Parameters:
3727
Parameters:
3648
  * eax = 68 - number of the function
3728
  * eax = 68 - function number
3649
  * ebx = 8 - number subfunction
3729
  * ebx = 8 - subfunction number
3650
  * ecx = physical address
3730
  * ecx = physical address
3651
  * edx = pointer on buffer for data (in application)
3731
  * edx = pointer to buffer for data (in application)
3652
  * esi = data size (in bytes)
3732
  * esi = size of data (in bytes)
3653
Returned value:
3733
Returned value:
3654
  * function does not return value
3734
  * function does not return value
3655
Remarks:
3735
Remarks:
3656
  * Usual applications should not use this function, it is intended for of a
3736
  * Normal applications must not use this function, it is intended
3657
    case, when by operation with any device it is required to place the data
3737
    for the case, when for some device it is required to place
3658
    to the known physical address. (In effect, this function was developed for
3738
    data to the known physical address. (In effect, this function
3659
    AC97WAV.)
3739
    was developed for AC97WAV.)
3660
  * Range of physical addresses should lay inside allocated subfunction 5
3740
  * The range of physical addresses should lie inside of previously
3661
    blocks of physical memory.
3741
    allocated by subfunction 5 block of physical memory.
3662
  * Checks of a correctness is not made.
3742
  * There is no check for correctness.
3663
 
3743
 
3664
======================================================================
3744
======================================================================
3665
====================== Function 69 - debugging. ======================
3745
====================== Fucntion 69 - debugging. ======================
3666
======================================================================
3746
======================================================================
3667
Process can load other process as debugged by installation of appropriate bit
3747
A process can load other process as debugged by set of corresponding
-
 
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.
-
 
3750
A process can have only one debugger; one process can debug some
3669
one process can debug some processes. System notifies the debugger on events
3751
others. The system notifies debugger on events occuring with
3670
occurring to the debugged process. Messages are written in the buffer defined
3752
debugged process. Messages are written to the buffer defined by
3671
subfunction 0.
3753
subfunction 0.
3672
Ôîðìàò ñîîáùåíèÿ:
3754
Format of a message:
3673
  +0: dword: the code of the message
3755
  * +0: dword: message code
3674
  +4: dword: PID of the debugged process
3756
  * +4: dword: PID of debugged process
3675
  +8: there can be additional data defined by the code of the message
3757
  * +8: there can be additional data depending on message code
3676
Codes of messages:
3758
Message codes:
3677
  * 1 = exception
3759
  * 1 = exception
3678
    * in addition transfers dword-number of exception
3760
    * in addition dword-number of the exception is given
3679
    * process is paused
3761
    * process is suspended
3680
  * 2 = process was completed
3762
  * 2 = process has terminated
3681
    * comes at any completion: both through the system function -1,
3763
    * comes at any termination: both through the system function -1,
3682
      and at "murder" by any other process (including debugger)
3764
      and at "murder" by any other process (including debugger itself)
3683
  * 3 = debug exception int 1 = #DB
3765
  * 3 = debug exception int 1 = #DB
3684
    * in addition transfers a dword-image of the register DR6:
3766
    * in addition dword-image of the register DR6 is given:
3685
      * Bits 0-3: the condition of appropriate breakpoint
3767
      * bits 0-3: condition of the corresponding breakpoint (set by
3686
        (installed subfunction 9) is fulfilled
3768
        subfunction 9) is satisfied
3687
      * Bit 14: the exception has taken place because of the mode of step
3769
      * áèò 14: exception has occured because of the trace mode
3688
        tracing (the flag TF is installed)
3770
        (flag TF is set TF)
3689
    * process is paused
3771
    * process is suspended
3690
At completion of the debugger all debugged processes are killed.
3772
When debugger terminates, all debugged processes are killed.
3691
If the debugger it does not want, it should previously be disabled
3773
If debugger does not want this, it must previously detach by
3692
subfunction 3.
3774
subfunction 3.
3693
 
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
3702
  * subfunction 4 - paused debugged thread
3784
  * subfunction 4 - suspend debugged thread
3703
  * subfunction 5 - restored execution debugged thread
3785
  * subfunction 5 - resume debugged thread
3704
  * subfunction 6 - read from memory of the debugged process
3786
  * subfunction 6 - read from the memory of debugged process
3705
  * subfunction 7 - write in memory of the debugged process
3787
  * subfunction 7 - write to the memory of debugged process
3706
  * subfunction 8 - complete debugged thread
3788
  * subfunction 8 - terminate debugged thread
3707
  * subfunction 9 - place/remove the hardware point break
-
 
3708
 
3789
  * subfunction 9 - set/clear hardware breakpoint
3709
======================================================================
3790
 
3710
====================== Function 69, subfunction 0 ====================
3791
======================================================================
3711
============= Define area given for of debug messages. ===============
3792
= Function 69, subfunction 0 - define data area fror debug messages. =
3712
======================================================================
3793
======================================================================
3713
Parameters:
3794
Parameters:
3714
  * eax = 69 - number of the function
3795
  * eax = 69 - function number
3715
  * ebx = 0 - number subfunction
3796
  * ebx = 0 - subfunction number
3716
  * ecx = pointer
3797
  * ecx = pointer
3717
Format of data area:
3798
Format of data area:
3718
  * +0: dword: N = size of buffer (not including this header)
3799
  * +0: dword: N = buffer size (not including this header)
3719
  * +4: dword: occupied in buffer
3800
  * +4: dword: occupied place
3720
  * +8: N*byte: buffer
3801
  * +8: N*byte: buffer
3721
Returned value:
3802
Returned value:
3722
  * function does not return value
3803
  * function does not return value
3723
Remarks:
3804
Remarks:
3724
  * If a field of a size negatively, the buffer is considered disabled and
3805
  * If the size field is negative, the buffer is considered locked
3725
    at arrival of the new message the system will wait.
3806
    and at arrival of new message the system will wait.
3726
    For synchronization frame all operation with the buffer by operations
3807
    For synchronization frame all work with the buffer by operations
3727
    of the locking/unlocking
3808
    lock/unlock
3728
        neg    [bufsize]
3809
    	neg	[bufsize]
3729
  * Data in the buffer are treated as the array of units of a variable
3810
  * Data in the buffer are considered as array of items with variable
3730
    length - messages. The format of the message is indicated in
3811
    length - messages. Format of a message is explained in
3731
    the common description.
3812
    general description.
3732
 
3813
 
3733
======================================================================
3814
======================================================================
3734
====================== Function 69, subfunction 1 ====================
3815
===================== Function 69, subfunction 1 =====================
3735
=========== Get a status of the registers debugged thread. ===========
3816
============ Get contents of registers of debugged thread. ===========
3736
======================================================================
3817
======================================================================
3737
Parameters:
3818
Parameters:
3738
  * eax = 69 - number of the function
3819
  * eax = 69 - function number
3739
  * ebx = 1 - number subfunction
3820
  * ebx = 1 - subfunction number
3740
  * ecx = thread identifier
3821
  * ecx = thread identifier
-
 
3822
  * edx = size of context structure, must be 0x28=40 bytes
3741
  * edx = length of structure of a context, should be 0x28=40 bytes
3823
  * esi = pointer to context structure
3742
Returned value:
3824
Returned value:
3743
  * function does not return value
3825
  * function does not return value
3744
Format of structure of a context: (FPU is not supported yet)
3826
Format of context structure: (FPU is not supported yet)
3745
  * +0: dword: eip
3827
  * +0: dword: eip
3746
  * +4: dword: eflags
3828
  * +4: dword: eflags
3747
  * +8: dword: eax
3829
  * +8: dword: eax
3748
  * +12 = +0xC: dword: ecx
3830
  * +12 = +0xC: dword: ecx
3749
  * +16 = +0x10: dword: edx
3831
  * +16 = +0x10: dword: edx
3750
  * +20 = +0x14: dword: ebx
3832
  * +20 = +0x14: dword: ebx
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).
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
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
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
3800
Remarks:
3883
Remarks:
3801
  * Process should be loaded for of debugging (as is indicated in
3884
  * Process must be loaded for debugging (as is shown in
3802
    the common description).
3885
    general description).
3803
 
3886
 
3804
======================================================================
-
 
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:
3813
  * function does not return value
3895
  * function does not return value
3814
Remarks:
3896
Remarks:
3815
  * Process should be loaded for of debugging (as is indicated in
3897
  * Process must be loaded for debugging (as is shown in
3816
    the common description).
3898
    general description).
3817
 
3899
 
3818
======================================================================
-
 
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)
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:
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:
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
3946
  * Process must be loaded for debugging (as is shown in
3866
    the common description).
3947
    general description).
3867
  * Function is similar subfunction 2 functions 18 with two differences:
3948
  * The function is similar to subfunction 2 of function 18
3868
    the execution of the first remark is required and is accepted PID,
3949
    with two differences: it requires first remark and
3869
    instead of number of the slot.
3950
    accepts PID rather than slot number.
3870
 
3951
 
3871
======================================================================
3952
======================================================================
3872
====================== Function 69, subfunction 9 ====================
-
 
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
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
3926
  * +12 = +0xC: dword: size
4006
  * +12 = +0xC: dword: size
3927
  * +16 = +0x10: dword: pointer on data
4007
  * +16 = +0x10: dword: pointer to data
3928
  * +20 = +0x14: n db: ASCIIZ-string with a filename
4008
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3929
    or
4009
    or
3930
  * +20 = +0x14: db 0
4010
  * +20 = +0x14: db 0
3931
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4011
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3932
Specifications - in documentation on appropriate subfunction.
4012
Specifications - in documentation on the appropriate subfunction.
3933
Filename is insensitive to the register of characters. Russian characters should be written in the coding cp866 (DOS).
4013
Filename is case-insensitive. Russian letters must be written in
3934
Ôîðìàò èìåíè ôàéëà:
4014
the encoding cp866 (DOS).
-
 
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
3952
  * '/hd0/2/menuet/pics/tanzania.bmp',0
4033
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3953
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
4034
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3954
Accessible subfunctions:
4035
Available subfunctions:
3955
  * subfunction 0 - read file
4036
  * subfunction 0 - read file
3956
  * subfunction 1 - read folder
4037
  * subfunction 1 - read folder
3957
  * subfunction 2 - create/rewrite file
4038
  * subfunction 2 - create/rewrite file
3958
  * subfunction 5 - get file/directory attributes structure
4039
  * subfunction 5 - get attributes of file/folder
3959
  * subfunction 6 - set file/directory attributes structure
4040
  * subfunction 6 - set attributes of file/folder
3960
  * subfunction 7 - start application
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
-
 
4063
Returned value:
-
 
4064
  * eax = 0 - success, otherwise file system error code
-
 
4065
  * ebx = number of read bytes or -1=0xffffffff if file was not found
-
 
4066
Remarks:
-
 
4067
  * If file was ended before last requested block was read,
-
 
4068
    the function will read as many as it can, and after that return
-
 
4069
    eax=6 (EOF).
-
 
4070
  * The function does not allow to read folder (returns eax=10,
-
 
4071
    access denied).
3961
 
4072
 
3962
======================================================================
4073
======================================================================
3963
= Function 70, subfunction 0 - read file with support of long names. =
4074
== Function 70, subfunction 1 - read folder with long names support. =
3964
======================================================================
4075
======================================================================
3965
Parameters:
4076
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,
-
 
3985
    the function will read, how many can, then will return eax=6 (EOF).
-
 
3986
  * Function does not allow to read folders
-
 
3987
    (will return eax=10, access denied).
-
 
3988
 
-
 
3989
========================================================================
-
 
3990
= Function 70, subfunction 1 - read folder with support of long names. =
-
 
3991
========================================================================
-
 
3992
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,
4088
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
4005
    size of buffer should be not less than 32 + [+12] *560 bytes
4089
    must be not less than 32 + [+12]*560 bytes
4006
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
4090
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4007
    are indicated in the common description
4091
    given in the general description
4008
    or
4092
    or
4009
  * +20 = +0x14: db 0
4093
  * +20 = +0x14: db 0
4010
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4094
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4011
Returned value:
4095
Returned value:
4012
  * eax = 0 - successfully, differently error code of a file system
4096
  * eax = 0 - success, otherwise file system error code
4013
  * ebx = number of files, the information about which was written 
-
 
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
4025
    can be less, if in a folder the files (same, as in ebx) were terminated
4108
    there are no more files in folder (the same as in ebx)
4026
  * +8: dword: total number of files in a folder
4109
  * +8: dword: total number of files in folder
4027
  * +12 = +0xC: 20*byte: reserved (zero)
4110
  * +12 = +0xC: 20*byte: reserved (zeroed)
4028
Structure of data block of input of directory (DBID):
4111
Structure of block of data for folder entry (BDFE):
4029
  * +0: dword: file attributes:
4112
  * +0: dword: attributes of file:
4030
    * áèò 0 (ìàñêà 1): file only for reading
4113
    * bit 0 (mask 1): file is read-only
4031
    * áèò 1 (ìàñêà 2): file is hidden
4114
    * bit 1 (mask 2): file is hidden
4032
    * áèò 2 (ìàñêà 4): file is system
4115
    * bit 2 (mask 4): file is system
4033
    * áèò 3 (ìàñêà 8): it not file, it is volume label
4116
    * bit 3 (mask 8): this is not a file but volume label
4034
      (on given partition meets no more once and only in a root folder)
4117
      (for one partition meets no more than once and
-
 
4118
      only in root folder)
4035
    * áèò 4 (ìàñêà 0x10): It is a folder
4119
    * bit 4 (mask 0x10): this is a folder
4036
    * áèò 5 (ìàñêà 0x20): file was not archived - many programs of archiving
4120
    * bit 5 (mask 0x20): file was not archived - many archivation
4037
      have an option, on which the files with installed this bit are archived
4121
      programs have an option to archive only files with this bit set,
4038
      only, then this bit is dumped(reset) is it can be useful for of automatic
4122
      and after archiving this bit is cleared - it can be useful
4039
      creation of backup-archives, for at recording bit is usually installed
4123
      for automatically creating of backup-archives as at writing
-
 
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
4101
  * +20 = +0x14: db 0
4186
  * +20 = +0x14: db 0
4102
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4187
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4103
Returned value:
4188
Returned value:
4104
  * eax = 0 - successfully, differently error code of a file system
4189
  * eax = 0 - success, otherwise file system error code
4105
  * ebx = number written bytes (is possible, 0)
4190
  * ebx = number of written bytes (possibly 0)
4106
Remarks:
4191
Remarks:
4107
  * If the file with such name did not exist, it creates; if existed,
4192
  * If a file with given name did not exist, it is created;
4108
    is rewritten.
4193
    if it existed, it is rewritten.
4109
  * If it is not enough of free space on of the disk, the function will write,
4194
  * If there is not enough free space on disk, the function will
4110
    how many can, then will return an error code 8.
4195
    write as many as can and then return 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)
4123
  * +16 = +0x10: dword: pointer on buffer, where data will be written (40 bytes)
4209
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4124
  * +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
4210
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4125
    are indicated in the common description
4211
    given in the general description
4126
    or
4212
    or
4127
  * +20 = +0x14: db 0
4213
  * +20 = +0x14: db 0
4128
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4214
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4129
Returned value:
4215
Returned value:
4130
  * eax = 0 - successfully, differently error code of a file system
4216
  * eax = 0 - success, otherwise file system error code
4131
  * ebx fail
4217
  * ebx destroyed
4132
Information on the file comes back in the format DBID
4218
Information on file is returned in the BDFE format (block of data
4133
(data block of input of directory), indicated in the description subfunction 1,
4219
for folder entry), explained in the description of
-
 
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
4155
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4242
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4156
Returned value:
4243
Returned value:
4157
  * eax = 0 - successfully, differently error code of a file system
4244
  * eax = 0 - success, otherwise file system error code
4158
  * ebx fail
4245
  * ebx destroyed
4159
File attributes - first 32 bytes in DBID (data block of input of directory),
4246
File attributes are first 32 bytes in BDFE (block of data
4160
which format is indicated in the description subfunction 1
4247
for folder entry), explained in the description of subfunction 1
4161
(that is without a name and file size). Attribute the file/folder/volume label
4248
(that is, without name and size of file). Attribute
4162
(bits 3,4 in dword +0) does not vary.
4249
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4163
Byte +4 (format of a name) ignored.
4250
Byte +4 (name format) is ignored.
4164
Remarks:
4251
Remarks:
4165
  * Function does not support virtual folders such as /, /rd
4252
  * The function does not support virtual folders such as /, /rd and
4166
    and root folders such as /rd/1.
4253
    root folders like /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
4184
    or
4272
    or
4185
  * +20 = +0x14: db 0
4273
  * +20 = +0x14: db 0
4186
  * +21 = +0x15: dd pointer on ASCIIZ-string with a filename
4274
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4187
Returned value:
4275
Returned value:
4188
  * eax > 0 - program is loaded, eax contains PID
4276
  * eax > 0 - program is loaded, eax contains PID
4189
  * eax < 0 - has taken place error,
4277
  * eax < 0 - an error has occured, -eax contains
4190
    -eax contains an error code of a file system
4278
    file system error code
4191
  * ebx fail
4279
  * ebx destroyed
4192
Remarks:
4280
Remarks:
4193
  * Command line should be ended by the character with the code 0
4281
  * Command line must be terminated by the character with the code 0
4194
    (ASCIIZ-strings); it are taken into account or all characters up to
4282
    (ASCIIZ-string); function takes into account either all characters
4195
    completing zero inclusively, or the first 256 characters, that are less.
4283
    up to terminating zero inclusively or first 256 character
-
 
4284
    regarding what is less.
4196
  * If the process is started as debugged, it creates in the frozen status;
4285
  * If the process is started as debugged, it is created in
4197
    for of start use subfunction 5 functions 69.
4286
    the suspended state; to run use subfunction 5 of function 69.
4198
 
4287
 
4199
======================================================================
4288
======================================================================
4200
=========== Function 71, subfunction 1 - set window caption ==========
4289
========== Function 71, subfunction 1 - set window caption. ==========
4201
======================================================================
4290
======================================================================
4202
Parameters:
4291
Parameters:
4203
  * eax = 71 - function number
4292
  * eax = 71 - function number
4204
  * ebx = 1 - subfunction number
4293
  * ebx = 1 - subfunction number
4205
  * eáx = caption string address
4294
  * ecx = pointer to caption string
4206
Returned value:
4295
Returned value:
4207
  * eax = 0 - caption changed successfully
-
 
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
 
4214
======================================================================
4302
======================================================================
4215
========== Function -1 - complete execution of thread/proces =========
4303
=============== Function -1 - terminate thread/process ===============
4216
======================================================================
4304
======================================================================
4217
Parameters:
4305
Parameters:
4218
  * eax = -1 - number of the function
4306
  * eax = -1 - function number
4219
Returned value:
4307
Returned value:
4220
  * function does not return neither value, nor handle
4308
  * function does not return neither value nor control
4221
Remarks:
4309
Remarks:
4222
  * If the process obviously did not create streams, it has only one thread,
4310
  * If the process did not create threads obviously, it has only
4223
    which completion results in completion of the process.
4311
    one thread, which termination results in process termination.
4224
  * If current thread - last in process, its completion also results
4312
  * If the current thread is last in the process, its termination
4225
    in completion of the process.
4313
    also results in process terminates.
4226
  * This function completes current thread. Another thread
4314
  * This function terminates the current thread. Other thread can be
4227
    is possible kill by call subfunction 2 functions 18.
4315
    killed by call to subfunction 2 of function 18.
4228
 
4316
 
4229
======================================================================
4317
======================================================================
4230
=========================== List of events ===========================
4318
=========================== List of events ===========================
4231
======================================================================
4319
======================================================================
4232
Next event is possible get by call of one from functions 10 (to expect event),
4320
Next event can be retrieved by the call of one from functions 10
-
 
4321
(to wait for event), 11 (to check without waiting), 23
4233
11 (to check up without waiting), 23 (to expect during the given time).
4322
(to wait during the given time).
4234
These functions return only those events, which enter into a mask installed by
4323
These functions return only those events, which enter into a mask set
4235
the function 40. By default it is first three, that there is enough for of many
4324
by function 40. By default it is first three,
4236
applications of.
4325
there is enough for most applications.
4237
Codes of events:
4326
Codes of events:
4238
  * 1 = message about redraw (is reset at function call 0)
4327
  * 1 = redraw event (is reset by call to function 0)
4239
  * 2 = key on keyboard is pressed (acts, only when the window is active)
4328
  * 2 = key on keyboard is pressed (acts, only when the window is
4240
    or "hotkey" is pressed; is reset, when all keys from the buffer are read
4329
    active) or hotkey is pressed; is reset, when all keys from
4241
    out by the function 2
4330
    the buffer are read out by function 2
4242
  * 3 = button is pressed, defined earlier by function 8(or buttons of closing,
4331
  * 3 = button is pressed, defined earlier by function 8
4243
    created implicitly by function 0 is pressed; the button of minimization is
4332
    (or close button, created implicitly by function 0;
4244
    handled by the system and about it of the message does not come; acts, only
4333
    minimize button is handled by the system and sends no message;
-
 
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
4344
  * 7 = IPC event (see function 60 -
4255
    Communication; is reset at reading)
4345
    Inter Process Communication; is reset at reading)
4256
  * 8 = there was a network event (is reset at reading; look operation
4346
  * 8 = network event (is reset at reading)
4257
    with the network)
-
 
4258
  * 9 = there was a debug event (is reset at reading; look a debug subsystem)
4347
  * 9 = debug event (is reset at reading; see
-
 
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)
-
 
4270
  * 3 = Unknown file system
4359
  * 3 = unknown file system
4271
  * 4 = comes back only by function rename by transmission of the strongly
4360
  * 4 = is returned only from function 'rename' by transmission of
4272
    incorrect parameter and in any way does not correspond to the description
4361
    the strongly incorrect parameter and in any way does not
-
 
4362
    correspond to the description in the kernel sources
4273
    in sources of a kernel " partition not defined at hd "
4363
    "partition not defined at hd"
4274
  * 5 = file is not retrieved
4364
  * 5 = file not found
4275
  * 6 = file was completed
4365
  * 6 = end of file, EOF
4276
  * 7 = pointer outside of memory of the application
4366
  * 7 = pointer lies outside of application memory
4277
  * 8 = disk is filled
4367
  * 8 = disk is full
4278
  * 9 = table FAT is destroyed
4368
  * 9 = FAT table is destroyed
4279
  * 10 = access denied
4369
  * 10 = access denied
4280
  * 11 = error of the device
4370
  * 11 = device error
4281
At start of the program the following error codes are possible also:
4371
Application start functions can return also following errors:
4282
  * 30 = 0x1E = not enough of memory
4372
  * 30 = 0x1E = not enough memory
4283
  * 31 = 0x1F = file is not application
4373
  * 31 = 0x1F = file is not executable
4284
  * 32 = 0x20 = too much processes
4374
  * 32 = 0x20 = too many processes
4285
>
-
 
4286
>
4375
>
4287
>
4376
>
4288
>
4377
>
4289
>
4378
>
4290
>
4379
>