Subversion Repositories Kolibri OS

Rev

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

Rev 4588 Rev 4612
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
7
 
8
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
8
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
9
 
9
 
10
Number of the function is located in the register eax.
10
Number of the function is located in the register eax.
11
The call of the system function is executed by "int 0x40" command.
11
The call of the system function is executed by "int 0x40" command.
12
All registers except explicitly declared in the returned value,
12
All registers except explicitly declared in the returned value,
13
    including eflags, are preserved.
13
    including eflags, are preserved.
14
 
14
 
15
 
15
 
16
======================================================================
16
======================================================================
17
============== Function 0 - define and draw the window. ==============
17
============== Function 0 - define and draw the window. ==============
18
======================================================================
18
======================================================================
19
Defines an application window. Draws a frame of the window, header and
19
Defines an application window. Draws a frame of the window, header and
20
working area. For skinned windows defines standard close and minimize
20
working area. For skinned windows defines standard close and minimize
21
buttons.
21
buttons.
22
Parameters:
22
Parameters:
23
  * eax = 0 - function number
23
  * eax = 0 - function number
24
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
24
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
25
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
25
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
26
  * edx = 0xXYRRGGBB, where:
26
  * edx = 0xXYRRGGBB, where:
27
    * Y = style of the window:
27
    * Y = style of the window:
28
      * Y=0 - type I - fixed-size window
28
      * Y=0 - type I - fixed-size window
29
      * Y=1 - only define window area, draw nothing
29
      * Y=1 - only define window area, draw nothing
30
      * Y=2 - type II - variable-size window
30
      * Y=2 - type II - variable-size window
31
      * Y=3 - skinned window
31
      * Y=3 - skinned window
32
      * Y=4 - skinned fixed-size window
32
      * Y=4 - skinned fixed-size window
33
      * other possible values (from 5 up to 15) are reserved,
33
      * other possible values (from 5 up to 15) are reserved,
34
        function call with such Y is ignored
34
        function call with such Y is ignored
35
    * RR, GG, BB = accordingly red, green, blue components of a color
35
    * RR, GG, BB = accordingly red, green, blue components of a color
36
      of the working area of the window (are ignored for style Y=1)
36
      of the working area of the window (are ignored for style Y=1)
37
    * X = DCBA (bits)
37
    * X = DCBA (bits)
38
      * A = 1 - window has caption; for styles Y=3,4 caption string
38
      * A = 1 - window has caption; for styles Y=3,4 caption string
39
                  must be passed in edi, for other styles use
39
                  must be passed in edi, for other styles use
40
                  subfunction 1 of function 71
40
                  subfunction 1 of function 71
41
      * B = 1 - coordinates of all graphics primitives are relative to
41
      * B = 1 - coordinates of all graphics primitives are relative to
42
                  window client area
42
                  window client area
43
      * C = 1 - don't fill working area on window draw
43
      * C = 1 - don't fill working area on window draw
44
      * D = 0 - normal filling of the working area, 1 - gradient
44
      * D = 0 - normal filling of the working area, 1 - gradient
45
    The following parameters are intended for windows
45
    The following parameters are intended for windows
46
    of a type I and II, and ignored for styles Y=1,3:
46
    of a type I and II, and ignored for styles Y=1,3:
47
  * esi = 0xXYRRGGBB - color of the header
47
  * esi = 0xXYRRGGBB - color of the header
48
    * RR, GG, BB define color
48
    * RR, GG, BB define color
49
    * Y=0 - usual window, Y=1 - unmovable window (works for all window styles)
49
    * Y=0 - usual window, Y=1 - unmovable window (works for all window styles)
50
    * X defines a gradient of header: X=0 - no gradient,
50
    * X defines a gradient of header: X=0 - no gradient,
51
      X=8 - usual gradient,
51
      X=8 - usual gradient,
52
      for windows of a type II X=4 - negative gradient
52
      for windows of a type II X=4 - negative gradient
53
    * other values of X and Y are reserved
53
    * other values of X and Y are reserved
54
  * edi = 0x00RRGGBB - color of the frame
54
  * edi = 0x00RRGGBB - color of the frame
55
Returned value:
55
Returned value:
56
  * function does not return value
56
  * function does not return value
57
Remarks:
57
Remarks:
58
  * Position and sizes of the window are installed by the first
58
  * Position and sizes of the window are installed by the first
59
    call of this function and are ignored at subsequent; to change
59
    call of this function and are ignored at subsequent; to change
60
    position and/or sizes of already created window use function 67.
60
    position and/or sizes of already created window use function 67.
61
  * For windows with styles Y=3,4 and caption (A=1) caption string
61
  * For windows with styles Y=3,4 and caption (A=1) caption string
62
    is set by the first call of this function and is ignored
62
    is set by the first call of this function and is ignored
63
    at subsequent (strictly speaking, is ignored after a call to
63
    at subsequent (strictly speaking, is ignored after a call to
64
    subfunction 2 of function 12 - end redraw); to change caption of
64
    subfunction 2 of function 12 - end redraw); to change caption of
65
    already created window use subfunction 1 of function 71.
65
    already created window use subfunction 1 of function 71.
66
  * If the window has appropriate styles, position and/or sizes can be
66
  * If the window has appropriate styles, position and/or sizes can be
67
    changed by user. Current position and sizes can be obtained
67
    changed by user. Current position and sizes can be obtained
68
    by function 9.
68
    by function 9.
69
  * The window must fit on the screen. If the transferred
69
  * The window must fit on the screen. If the transferred
70
    coordinates and sizes do not satisfy to this condition,
70
    coordinates and sizes do not satisfy to this condition,
71
    appropriate coordinate (or, probably, both) is considered as zero,
71
    appropriate coordinate (or, probably, both) is considered as zero,
72
    and if it does not help too, the appropriate size
72
    and if it does not help too, the appropriate size
73
    (or, probably, both) is installed in a size of the screen.
73
    (or, probably, both) is installed in a size of the screen.
74
 
74
 
75
    Further let us designate xpos,ypos,xsize,ysize - values passed
75
    Further let us designate xpos,ypos,xsize,ysize - values passed
76
    in ebx,ecx. The coordinates are resulted concerning
76
    in ebx,ecx. The coordinates are resulted concerning
77
    the left upper corner of the window, which, thus, is set as (0,0),
77
    the left upper corner of the window, which, thus, is set as (0,0),
78
    coordinates of the right lower corner essence (xsize,ysize).
78
    coordinates of the right lower corner essence (xsize,ysize).
79
  * The sizes of the window are understood in sence of coordinates
79
  * The sizes of the window are understood in sence of coordinates
80
    of the right lower corner. This concerns all other functions too.
80
    of the right lower corner. This concerns all other functions too.
81
    It means, that the real sizes are on 1 pixel more.
81
    It means, that the real sizes are on 1 pixel more.
82
  * The window of type I looks as follows:
82
  * The window of type I looks as follows:
83
    * draw external frame of color indicated in edi, 1 pixel in width
83
    * draw external frame of color indicated in edi, 1 pixel in width
84
    * draw header - rectangle with the left upper corner (1,1) and
84
    * draw header - rectangle with the left upper corner (1,1) and
85
      right lower (xsize-1,min(20,ysize-1)) color indicated in esi
85
      right lower (xsize-1,min(20,ysize-1)) color indicated in esi
86
      (taking a gradient into account)
86
      (taking a gradient into account)
87
    * if ysize>21, fill the working area of the window -
87
    * if ysize>21, fill the working area of the window -
88
      rectangle with the left upper corner (1,21) and right lower
88
      rectangle with the left upper corner (1,21) and right lower
89
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
89
      (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
90
      indicated in edx (taking a gradient into account)
90
      indicated in edx (taking a gradient into account)
91
    * if A=1 and caption has been already set by subfunction 1
91
    * if A=1 and caption has been already set by subfunction 1
92
      of function 71, it is drawn in the corresponding place of header
92
      of function 71, it is drawn in the corresponding place of header
93
  * The window of style Y=1 looks as follows:
93
  * The window of style Y=1 looks as follows:
94
    * completely defined by the application
94
    * completely defined by the application
95
  * The window of type II looks as follows:
95
  * The window of type II looks as follows:
96
    * draw external frame of width 1 pixel with the "shaded" color
96
    * draw external frame of width 1 pixel with the "shaded" color
97
      edi (all components of the color decrease twice)
97
      edi (all components of the color decrease twice)
98
    * draw intermediate frame of width 3 pixels with color edi
98
    * draw intermediate frame of width 3 pixels with color edi
99
    * draw internal frame of width 1 pixel with the "shaded" color edi
99
    * draw internal frame of width 1 pixel with the "shaded" color edi
100
    * draw header - rectangle with the left upper corner (4,4)
100
    * draw header - rectangle with the left upper corner (4,4)
101
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
101
      and right lower (xsize-4,min(20,ysize)) color, indicated in esi
102
      (taking a gradient into account)
102
      (taking a gradient into account)
103
    * if ysize>=26, fill the working area of the window -
103
    * if ysize>=26, fill the working area of the window -
104
      rectangle with the left upper corner (5,20) and right lower
104
      rectangle with the left upper corner (5,20) and right lower
105
      (xsize-5,ysize-5) with color indicated in edx
105
      (xsize-5,ysize-5) with color indicated in edx
106
      (taking a gradient into account)
106
      (taking a gradient into account)
107
    * if A=1 and caption has been already set by subfunction 1
107
    * if A=1 and caption has been already set by subfunction 1
108
      of function 71, it is drawn in the corresponding place of header
108
      of function 71, it is drawn in the corresponding place of header
109
  * The skinned window looks as follows:
109
  * The skinned window looks as follows:
110
    * draw external frame of width 1 pixel
110
    * draw external frame of width 1 pixel
111
      with color 'outer' from the skin
111
      with color 'outer' from the skin
112
    * draw intermediate frame of width 3 pixel
112
    * draw intermediate frame of width 3 pixel
113
      with color 'frame' from the skin
113
      with color 'frame' from the skin
114
    * draw internal frame of width 1 pixel
114
    * draw internal frame of width 1 pixel
115
      with color 'inner' from the skin
115
      with color 'inner' from the skin
116
    * draw header (on bitmaps from the skin) in a rectangle
116
    * draw header (on bitmaps from the skin) in a rectangle
117
      (0,0) - (xsize,_skinh-1)
117
      (0,0) - (xsize,_skinh-1)
118
    * if ysize>=26, fill the working area of the window -
118
    * if ysize>=26, fill the working area of the window -
119
      rectangle with the left upper corner (5,_skinh) and right lower
119
      rectangle with the left upper corner (5,_skinh) and right lower
120
      (xsize-5,ysize-5) with color indicated in edx
120
      (xsize-5,ysize-5) with color indicated in edx
121
      (taking a gradient into account)
121
      (taking a gradient into account)
122
    * define two standard buttons: close and minimize
122
    * define two standard buttons: close and minimize
123
      (see function 8)
123
      (see function 8)
124
    * if A=1 and edi contains (nonzero) pointer to caption string,
124
    * if A=1 and edi contains (nonzero) pointer to caption string,
125
      it is drawn in place in header defined in the skin
125
      it is drawn in place in header defined in the skin
126
    * value _skinh is accessible as the result of call
126
    * value _skinh is accessible as the result of call
127
      subfunction 4 of function 48
127
      subfunction 4 of function 48
128
 
128
 
129
======================================================================
129
======================================================================
130
================ Function 1 - put pixel in the window. ===============
130
================ Function 1 - put pixel in the window. ===============
131
======================================================================
131
======================================================================
132
Parameters:
132
Parameters:
133
  * eax = 1 - function number
133
  * eax = 1 - function number
134
  * ebx = x-coordinate (relative to the window)
134
  * ebx = x-coordinate (relative to the window)
135
  * ecx = y-coordinate (relative to the window)
135
  * ecx = y-coordinate (relative to the window)
136
  * edx = 0x00RRGGBB - color of a pixel
136
  * edx = 0x00RRGGBB - color of a pixel
137
    edx = 0x01xxxxxx - invert color of a pixel
137
    edx = 0x01xxxxxx - invert color of a pixel
138
          (low 24 bits are ignored)
138
          (low 24 bits are ignored)
139
Returned value:
139
Returned value:
140
  * function does not return value
140
  * function does not return value
141
 
141
 
142
======================================================================
142
======================================================================
143
============ Function 2 - get the code of the pressed key. ===========
143
============ Function 2 - get the code of the pressed key. ===========
144
======================================================================
144
======================================================================
145
Takes away the code of the pressed key from the buffer.
145
Takes away the code of the pressed key from the buffer.
146
Parameters:
146
Parameters:
147
  * eax = 2 - function number
147
  * eax = 2 - function number
148
Returned value:
148
Returned value:
149
  * if the buffer is empty, function returns eax=1
149
  * if the buffer is empty, function returns eax=1
150
  * if the buffer is not empty, function returns al=0,
150
  * if the buffer is not empty, function returns al=0,
151
    ah=code of the pressed key,
151
    ah=code of the pressed key,
152
    bits 16-23 = contain scancode for pressed key,
152
    bits 16-23 = contain scancode for pressed key in ASCII mode,
-
 
153
                 in the scancodes mode this bits cleared.
153
    bits 23-31 = zero
154
    bits 23-31 = zero
154
  * if there is "hotkey", function returns al=2,
155
  * if there is "hotkey", function returns al=2,
155
    ah=scancode of the pressed key (0 for control keys),
156
    ah=scancode of the pressed key (0 for control keys),
156
    high word of eax contains a status of control keys at the moment
157
    high word of eax contains a status of control keys at the moment
157
    of pressing a hotkey
158
    of pressing a hotkey
158
Remarks:
159
Remarks:
159
  * There is a common system buffer of the pressed keys
160
  * There is a common system buffer of the pressed keys
160
    by a size of 120 bytes, organized as queue.
161
    by a size of 120 bytes, organized as queue.
161
  * There is one more common system buffer on 120 "hotkeys".
162
  * There is one more common system buffer on 120 "hotkeys".
162
  * If the application with the inactive window calls this function,
163
  * If the application with the inactive window calls this function,
163
    the buffer of the pressed keys is considered to be empty.
164
    the buffer of the pressed keys is considered to be empty.
164
  * By default this function returns ASCII-codes; to switch
165
  * By default this function returns ASCII-codes; to switch
165
    to the scancodes mode (and back) use function 66.
166
    to the scancodes mode (and back) use function 66.
166
    However, hotkeys are always notificated as scancodes.
167
    However, hotkeys are always notificated as scancodes.
167
  * To find out, what keys correspond to what codes, start
168
  * To find out, what keys correspond to what codes, start
168
    the application keyascii and scancode.
169
    the application keyascii and scancode.
169
  * Scancodes come directly from keyboard and are fixed;
170
  * Scancodes come directly from keyboard and are fixed;
170
    ASCII-codes turn out with usage of the conversion tables,
171
    ASCII-codes turn out with usage of the conversion tables,
171
    which can be set by subfunction 2 of function 21
172
    which can be set by subfunction 2 of function 21
172
    and get by subfunction 2 of function 26.
173
    and get by subfunction 2 of function 26.
173
  * As a consequence, ASCII-codes take into account current
174
  * As a consequence, ASCII-codes take into account current
174
    keyboard layout (rus/en) as opposed to scancodes.
175
    keyboard layout (rus/en) as opposed to scancodes.
175
  * This function notifies only about those hotkeys, which were
176
  * This function notifies only about those hotkeys, which were
176
    defined by this thread by subfunction 4 of function 66.
177
    defined by this thread by subfunction 4 of function 66.
177
 
178
 
178
======================================================================
179
======================================================================
179
==================== Function 3 - get system time. ===================
180
==================== Function 3 - get system time. ===================
180
======================================================================
181
======================================================================
181
Parameters:
182
Parameters:
182
  * eax = 3 - function number
183
  * eax = 3 - function number
183
Returned value:
184
Returned value:
184
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
185
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
185
  * each item is BCD-number, for example,
186
  * each item is BCD-number, for example,
186
    for time 23:59:59 function returns 0x00595923
187
    for time 23:59:59 function returns 0x00595923
187
Remarks:
188
Remarks:
188
  * See also subfunction 9 of function 26 - get time from
189
  * See also subfunction 9 of function 26 - get time from
189
    the moment of start of the system; it is more convenient, because
190
    the moment of start of the system; it is more convenient, because
190
    returns simply DWORD-value of the time counter.
191
    returns simply DWORD-value of the time counter.
191
  * System time can be set by function 22.
192
  * System time can be set by function 22.
192
 
193
 
193
======================================================================
194
======================================================================
194
============ Function 4 - draw text string in the window. ============
195
============ Function 4 - draw text string in the window. ============
195
======================================================================
196
======================================================================
196
Parameters:
197
Parameters:
197
  * eax = 4 - function number
198
  * eax = 4 - function number
198
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
199
  * ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
199
  * ecx = 0xXYRRGGBB, where
200
  * ecx = 0xXYRRGGBB, where
200
    * RR, GG, BB specify text color
201
    * RR, GG, BB specify text color
201
    * X=ABnn (bits):
202
    * X=ABnn (bits):
202
      * nn specifies the used font: 0=system monospaced,
203
      * nn specifies the used font: 0=system monospaced,
203
        1=system font of variable width
204
        1=system font of variable width
204
      * A=0 - output esi characters, A=1 - output ASCIIZ-string
205
      * A=0 - output esi characters, A=1 - output ASCIIZ-string
205
      * B=1 - fill background with the color edi
206
      * B=1 - fill background with the color edi
206
    * Y = Cnnn
207
    * Y = Cnnn
207
      * C=1 redirect the output to the user area, specified in edi
208
      * C=1 redirect the output to the user area, specified in edi
208
      * nnn - not used in the current, must be 0 (zero)
209
      * nnn - not used in the current, must be 0 (zero)
209
  * edx = pointer to the beginning of the string
210
  * edx = pointer to the beginning of the string
210
  * esi = for A=0 length of the string, must not exceed 255;
211
  * esi = for A=0 length of the string, must not exceed 255;
211
          for A=1 is ignored
212
          for A=1 is ignored
212
  * edi = color to fill background, if B=1
213
  * edi = color to fill background, if B=1
213
  * edi = pointer to user area, for redirect, if C=1
214
  * edi = pointer to user area, for redirect, if C=1
214
 
215
 
215
Returned value:
216
Returned value:
216
  * function does not return value
217
  * function does not return value
217
Remarks:
218
Remarks:
218
  * First system font is read out at loading from the file char.mt,
219
  * First system font is read out at loading from the file char.mt,
219
    second - from char2.mt.
220
    second - from char2.mt.
220
  * Both fonts have height 9 pixels, width of the monospaced font
221
  * Both fonts have height 9 pixels, width of the monospaced font
221
    is equal to 6 pixels.
222
    is equal to 6 pixels.
222
  * C=1, pixel depth = 32 bits, user area is as follows:
223
  * C=1, pixel depth = 32 bits, user area is as follows:
223
    dword Xsize
224
    dword Xsize
224
    dword Ysize
225
    dword Ysize
225
    rest of the area = Xsize * Y size * 4
226
    rest of the area = Xsize * Y size * 4
226
  * You can not use B = 1 and C = 1, at the same time. Since in both
227
  * You can not use B = 1 and C = 1, at the same time. Since in both
227
    cases, the register edi is used for different purposes.
228
    cases, the register edi is used for different purposes.
228
 
229
 
229
======================================================================
230
======================================================================
230
========================= Function 5 - delay. ========================
231
========================= Function 5 - delay. ========================
231
======================================================================
232
======================================================================
232
Delays execution of the program on the given time.
233
Delays execution of the program on the given time.
233
Parameters:
234
Parameters:
234
  * eax = 5 - function number
235
  * eax = 5 - function number
235
  * ebx = time in the 1/100 of second
236
  * ebx = time in the 1/100 of second
236
Returned value:
237
Returned value:
237
  * function does not return value
238
  * function does not return value
238
Remarks:
239
Remarks:
239
  * Passing ebx=0 does not transfer control to the next process
240
  * Passing ebx=0 does not transfer control to the next process
240
    and does not make any operations at all. If it is really required
241
    and does not make any operations at all. If it is really required
241
    to transfer control to the next process (to complete a current
242
    to transfer control to the next process (to complete a current
242
    time slice), use subfunction 1 of function 68.
243
    time slice), use subfunction 1 of function 68.
243
 
244
 
244
======================================================================
245
======================================================================
245
============== Function 6 - read the file from ramdisk. ==============
246
============== Function 6 - read the file from ramdisk. ==============
246
======================================================================
247
======================================================================
247
Parameters:
248
Parameters:
248
  * eax = 6 - function number
249
  * eax = 6 - function number
249
  * ebx = pointer to the filename
250
  * ebx = pointer to the filename
250
  * ecx = number of start block, beginning from 1;
251
  * ecx = number of start block, beginning from 1;
251
    ecx=0 - read from the beginning of the file (same as ecx=1)
252
    ecx=0 - read from the beginning of the file (same as ecx=1)
252
  * edx = number of blocks to read;
253
  * edx = number of blocks to read;
253
    edx=0 - read one block (same as edx=1)
254
    edx=0 - read one block (same as edx=1)
254
  * esi = pointer to memory area for the data
255
  * esi = pointer to memory area for the data
255
Returned value:
256
Returned value:
256
  * eax = file size in bytes, if the file was successfully read
257
  * eax = file size in bytes, if the file was successfully read
257
  * eax = -1, if the file was not found
258
  * eax = -1, if the file was not found
258
Remarks:
259
Remarks:
259
  * This function is out-of-date; function 70 allows
260
  * This function is out-of-date; function 70 allows
260
    to fulfil the same operations with the extended possibilities.
261
    to fulfil the same operations with the extended possibilities.
261
  * Block = 512 bytes.
262
  * Block = 512 bytes.
262
  * For reading all file you can specify the certainly large value
263
  * For reading all file you can specify the certainly large value
263
    in edx, for example, edx = -1; but in this case be ready that
264
    in edx, for example, edx = -1; but in this case be ready that
264
    the program will "fall", if the file will appear too large and can
265
    the program will "fall", if the file will appear too large and can
265
    not be placed in the program memory.
266
    not be placed in the program memory.
266
  * The filename must be either in the format 8+3 characters
267
  * The filename must be either in the format 8+3 characters
267
    (first 8 characters - name itself, last 3 - extension,
268
    (first 8 characters - name itself, last 3 - extension,
268
    the short names and extensions are supplemented with spaces),
269
    the short names and extensions are supplemented with spaces),
269
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
270
    or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
270
    (name no more than 8 characters, dot, extension 3 characters
271
    (name no more than 8 characters, dot, extension 3 characters
271
    supplemented if necessary by spaces).
272
    supplemented if necessary by spaces).
272
    The filename must be written with capital letters. The terminating
273
    The filename must be written with capital letters. The terminating
273
    character with code 0 is not necessary (not ASCIIZ-string).
274
    character with code 0 is not necessary (not ASCIIZ-string).
274
  * This function does not support folders on the ramdisk.
275
  * This function does not support folders on the ramdisk.
275
 
276
 
276
======================================================================
277
======================================================================
277
=============== Function 7 - draw image in the window. ===============
278
=============== Function 7 - draw image in the window. ===============
278
======================================================================
279
======================================================================
279
Paramters:
280
Paramters:
280
  * eax = 7 - function number
281
  * eax = 7 - function number
281
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
282
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
282
  * ecx = [size on axis x]*65536 + [size on axis y]
283
  * ecx = [size on axis x]*65536 + [size on axis y]
283
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
284
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
284
Returned value:
285
Returned value:
285
  * function does not return value
286
  * function does not return value
286
Remarks:
287
Remarks:
287
  * Coordinates of the image are coordinates of the upper left corner
288
  * Coordinates of the image are coordinates of the upper left corner
288
    of the image relative to the window.
289
    of the image relative to the window.
289
  * Size of the image in bytes is 3*xsize*ysize.
290
  * Size of the image in bytes is 3*xsize*ysize.
290
 
291
 
291
======================================================================
292
======================================================================
292
=============== Function 8 - define/delete the button. ===============
293
=============== Function 8 - define/delete the button. ===============
293
======================================================================
294
======================================================================
294
Parameters for button definition:
295
Parameters for button definition:
295
  * eax = 8 - function number
296
  * eax = 8 - function number
296
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
297
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
297
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
298
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
298
  * edx = 0xXYnnnnnn, where:
299
  * edx = 0xXYnnnnnn, where:
299
    * nnnnnn = identifier of the button
300
    * nnnnnn = identifier of the button
300
    * high (31st) bit of edx is cleared
301
    * high (31st) bit of edx is cleared
301
    * if 30th bit of edx is set - do not draw the button
302
    * if 30th bit of edx is set - do not draw the button
302
    * if 29th bit of edx is set - do not draw a frame
303
    * if 29th bit of edx is set - do not draw a frame
303
      at pressing the button
304
      at pressing the button
304
  * esi = 0x00RRGGBB - color of the button
305
  * esi = 0x00RRGGBB - color of the button
305
Parameters for button deleting:
306
Parameters for button deleting:
306
  * eax = 8 - function number
307
  * eax = 8 - function number
307
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
308
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
308
Returned value:
309
Returned value:
309
  * function does not return value
310
  * function does not return value
310
Remarks:
311
Remarks:
311
  * Sizes of the button must be more than 0 and less than 0x8000.
312
  * Sizes of the button must be more than 0 and less than 0x8000.
312
  * For skinned windows definition of the window
313
  * For skinned windows definition of the window
313
    (call of 0th function) creates two standard buttons -
314
    (call of 0th function) creates two standard buttons -
314
    for close of the window with identifier 1 and
315
    for close of the window with identifier 1 and
315
    for minimize of the window with identifier 0xffff.
316
    for minimize of the window with identifier 0xffff.
316
  * The creation of two buttons with same identifiers is admitted.
317
  * The creation of two buttons with same identifiers is admitted.
317
  * The button with the identifier 0xffff at pressing is interpreted
318
  * The button with the identifier 0xffff at pressing is interpreted
318
    by the system as the button of minimization, the system handles
319
    by the system as the button of minimization, the system handles
319
    such pressing independently, not accessing to the application.
320
    such pressing independently, not accessing to the application.
320
    In rest it is usual button.
321
    In rest it is usual button.
321
  * Total number of buttons for all applications is limited to 4095.
322
  * Total number of buttons for all applications is limited to 4095.
322
 
323
 
323
======================================================================
324
======================================================================
324
============ Function 9 - information on execution thread. ===========
325
============ Function 9 - information on execution thread. ===========
325
======================================================================
326
======================================================================
326
Parameters:
327
Parameters:
327
  * eax = 9 - function number
328
  * eax = 9 - function number
328
  * ebx = pointer to 1-Kb buffer
329
  * ebx = pointer to 1-Kb buffer
329
  * ecx = number of the slot of the thread
330
  * ecx = number of the slot of the thread
330
    ecx = -1 - get information on the current thread
331
    ecx = -1 - get information on the current thread
331
Returned value:
332
Returned value:
332
  * eax = maximum number of the slot of a thread
333
  * eax = maximum number of the slot of a thread
333
  * buffer pointed to by ebx contains the following information:
334
  * buffer pointed to by ebx contains the following information:
334
    * +0: dword: usage of the processor (how many time units
335
    * +0: dword: usage of the processor (how many time units
335
      per second leaves on execution of this thread)
336
      per second leaves on execution of this thread)
336
    * +4: word: position of the window of thread in the window stack
337
    * +4: word: position of the window of thread in the window stack
337
    * +6: word: (has no relation to the specified thread)
338
    * +6: word: (has no relation to the specified thread)
338
      number of the thread slot, which window has in the window stack
339
      number of the thread slot, which window has in the window stack
339
      position ecx
340
      position ecx
340
    * +8: word: reserved
341
    * +8: word: reserved
341
    * +10 = +0xA: 11 bytes: name of the process
342
    * +10 = +0xA: 11 bytes: name of the process
342
      (name of the started file - executable file without extension)
343
      (name of the started file - executable file without extension)
343
    * +21 = +0x15: byte: reserved, this byte is not changed
344
    * +21 = +0x15: byte: reserved, this byte is not changed
344
    * +22 = +0x16: dword: address of the process in memory
345
    * +22 = +0x16: dword: address of the process in memory
345
    * +26 = +0x1A: dword: size of used memory - 1
346
    * +26 = +0x1A: dword: size of used memory - 1
346
    * +30 = +0x1E: dword: identifier (PID/TID)
347
    * +30 = +0x1E: dword: identifier (PID/TID)
347
    * +34 = +0x22: dword: coordinate of the thread window on axis x
348
    * +34 = +0x22: dword: coordinate of the thread window on axis x
348
    * +38 = +0x26: dword: coordinate of the thread window on axis y
349
    * +38 = +0x26: dword: coordinate of the thread window on axis y
349
    * +42 = +0x2A: dword: size of the thread window on axis x
350
    * +42 = +0x2A: dword: size of the thread window on axis x
350
    * +46 = +0x2E: dword: size of the thread window on axis y
351
    * +46 = +0x2E: dword: size of the thread window on axis y
351
    * +50 = +0x32: word: status of the thread slot:
352
    * +50 = +0x32: word: status of the thread slot:
352
      * 0 = thread is running
353
      * 0 = thread is running
353
      * 1 = thread is suspended
354
      * 1 = thread is suspended
354
      * 2 = thread is suspended while waiting for event
355
      * 2 = thread is suspended while waiting for event
355
      * 3 = thread is terminating as a result of call to function -1
356
      * 3 = thread is terminating as a result of call to function -1
356
        or under duress as a result of call to subfunction 2
357
        or under duress as a result of call to subfunction 2
357
        of function 18 or termination of the system
358
        of function 18 or termination of the system
358
      * 4 = thread is terminating as a result of exception
359
      * 4 = thread is terminating as a result of exception
359
      * 5 = thread waits for event
360
      * 5 = thread waits for event
360
      * 9 = requested slot is free, all other information on the slot
361
      * 9 = requested slot is free, all other information on the slot
361
        is not meaningful
362
        is not meaningful
362
    * +52 = +0x34: word: reserved, this word is not changed
363
    * +52 = +0x34: word: reserved, this word is not changed
363
    * +54 = +0x36: dword: coordinate of the client area on axis x
364
    * +54 = +0x36: dword: coordinate of the client area on axis x
364
    * +58 = +0x3A: dword: coordinate of the client area on axis y
365
    * +58 = +0x3A: dword: coordinate of the client area on axis y
365
    * +62 = +0x3E: dword: width of the client area
366
    * +62 = +0x3E: dword: width of the client area
366
    * +66 = +0x42: dword: height of the client area
367
    * +66 = +0x42: dword: height of the client area
367
    * +70 = +0x46: byte: state of the window - bitfield
368
    * +70 = +0x46: byte: state of the window - bitfield
368
      * bit 0 (mask 1): window is maximized
369
      * bit 0 (mask 1): window is maximized
369
      * bit 1 (mask 2): window is minimized to panel
370
      * bit 1 (mask 2): window is minimized to panel
370
      * bit 2 (mask 4): window is rolled up
371
      * bit 2 (mask 4): window is rolled up
371
    * +71 = +0x47: dword: event mask
372
    * +71 = +0x47: dword: event mask
372
    * +75 = +0x4B: byte: keyboard mode(ASCII = 0; SCAN = 1)
373
    * +75 = +0x4B: byte: keyboard mode(ASCII = 0; SCAN = 1)
373
Remarks:
374
Remarks:
374
  * Slots are numbered starting from 1.
375
  * Slots are numbered starting from 1.
375
  * Returned value is not a total number of threads, because there
376
  * Returned value is not a total number of threads, because there
376
    can be free slots.
377
    can be free slots.
377
  * When process is starting, system automatically creates
378
  * When process is starting, system automatically creates
378
    execution thread.
379
    execution thread.
379
  * Function gives information on the thread. Each process has
380
  * Function gives information on the thread. Each process has
380
    at least one thread. One process can create many threads,
381
    at least one thread. One process can create many threads,
381
    in this case each thread has its own slot and the fields
382
    in this case each thread has its own slot and the fields
382
    +10, +22, +26 in these slots coincide.
383
    +10, +22, +26 in these slots coincide.
383
    Applications have no common way to define whether two threads
384
    Applications have no common way to define whether two threads
384
    belong to one process.
385
    belong to one process.
385
  * The active window - window on top of the window stack -
386
  * The active window - window on top of the window stack -
386
    receives the messages on a keyboard input. For such window
387
    receives the messages on a keyboard input. For such window
387
    the position in the window stack coincides with returned value.
388
    the position in the window stack coincides with returned value.
388
  * Slot 1 corresponds to special system thread, for which:
389
  * Slot 1 corresponds to special system thread, for which:
389
    * the window is in the bottom of the window stack, the fields
390
    * the window is in the bottom of the window stack, the fields
390
      +4 and +6 contain value 1
391
      +4 and +6 contain value 1
391
    * name of the process - "OS/IDLE" (supplemented by spaces)
392
    * name of the process - "OS/IDLE" (supplemented by spaces)
392
    * address of the process in memory is 0, size of used memory is
393
    * address of the process in memory is 0, size of used memory is
393
      16 Mb (0x1000000)
394
      16 Mb (0x1000000)
394
    * PID=1
395
    * PID=1
395
    * coordinates and sizes of the window and the client area are by
396
    * coordinates and sizes of the window and the client area are by
396
      convention set to 0
397
      convention set to 0
397
    * status of the slot is always 0 (running)
398
    * status of the slot is always 0 (running)
398
    * the execution time adds of time leaving on operations itself
399
    * the execution time adds of time leaving on operations itself
399
      and idle time in waiting for interrupt (which can be got by call
400
      and idle time in waiting for interrupt (which can be got by call
400
      to subfunction 4 of function 18).
401
      to subfunction 4 of function 18).
401
  * Beginning from slot 2, the normal applications are placed.
402
  * Beginning from slot 2, the normal applications are placed.
402
  * The normal applications are placed in memory at the address
403
  * The normal applications are placed in memory at the address
403
    0 (kernel constant 'std_application_base_address').
404
    0 (kernel constant 'std_application_base_address').
404
    There is no intersection, as each process has its own page table.
405
    There is no intersection, as each process has its own page table.
405
  * At creation of the thread it is assigned the slot
406
  * At creation of the thread it is assigned the slot
406
    in the system table and identifier (Process/Thread IDentifier =
407
    in the system table and identifier (Process/Thread IDentifier =
407
    PID/TID), which do not vary with time for given thread.
408
    PID/TID), which do not vary with time for given thread.
408
    After completion of the thread its slot can be anew used
409
    After completion of the thread its slot can be anew used
409
    for another thread. The thread identifier can not be assigned
410
    for another thread. The thread identifier can not be assigned
410
    to other thread even after completion of this thread.
411
    to other thread even after completion of this thread.
411
    Identifiers, assigned to new threads, grow monotonously.
412
    Identifiers, assigned to new threads, grow monotonously.
412
  * If the thread has not yet defined the window by call to
413
  * If the thread has not yet defined the window by call to
413
    function 0, the position and the sizes
414
    function 0, the position and the sizes
414
    of its window are considered to be zero.
415
    of its window are considered to be zero.
415
  * Coordinates of the client area are relative to the window.
416
  * Coordinates of the client area are relative to the window.
416
  * At the moment only the part of the buffer by a size
417
  * At the moment only the part of the buffer by a size
417
    76 = 0x4C bytes is used. Nevertheless it is recommended to use
418
    76 = 0x4C bytes is used. Nevertheless it is recommended to use
418
    1-Kb buffer for the future compatibility, in the future
419
    1-Kb buffer for the future compatibility, in the future
419
    some fields can be added.
420
    some fields can be added.
420
 
421
 
421
======================================================================
422
======================================================================
422
==================== Function 10 - wait for event. ===================
423
==================== Function 10 - wait for event. ===================
423
======================================================================
424
======================================================================
424
If the message queue is empty, waits for appearance of the message
425
If the message queue is empty, waits for appearance of the message
425
in queue. In this state thread does not consume CPU time.
426
in queue. In this state thread does not consume CPU time.
426
Then reads out the message from queue.
427
Then reads out the message from queue.
427
 
428
 
428
Parameters:
429
Parameters:
429
  * eax = 10 - function number
430
  * eax = 10 - function number
430
Returned value:
431
Returned value:
431
  * eax = event (see the list of events)
432
  * eax = event (see the list of events)
432
Remarks:
433
Remarks:
433
  * Those events are taken into account only which enter into
434
  * Those events are taken into account only which enter into
434
    a mask set by function 40. By default it is
435
    a mask set by function 40. By default it is
435
    redraw, key and button events.
436
    redraw, key and button events.
436
  * To check, whether there is a message in queue, use function 11.
437
  * To check, whether there is a message in queue, use function 11.
437
    To wait for no more than given time, use function 23.
438
    To wait for no more than given time, use function 23.
438
 
439
 
439
======================================================================
440
======================================================================
440
=============== Function 11 - check for event, no wait. ==============
441
=============== Function 11 - check for event, no wait. ==============
441
======================================================================
442
======================================================================
442
If the message queue contains event, function reads out
443
If the message queue contains event, function reads out
443
and return it. If the queue is empty, function returns 0.
444
and return it. If the queue is empty, function returns 0.
444
Parameters:
445
Parameters:
445
  * eax = 11 - function number
446
  * eax = 11 - function number
446
Returned value:
447
Returned value:
447
  * eax = 0 - message queue is empty
448
  * eax = 0 - message queue is empty
448
  * else eax = event (see the list of events)
449
  * else eax = event (see the list of events)
449
Remarks:
450
Remarks:
450
  * Those events are taken into account only, which enter into
451
  * Those events are taken into account only, which enter into
451
    a mask set by function 40. By default it is
452
    a mask set by function 40. By default it is
452
    redraw, key and button events.
453
    redraw, key and button events.
453
  * To wait for event, use function 10.
454
  * To wait for event, use function 10.
454
    To wait for no more than given time, use function 23.
455
    To wait for no more than given time, use function 23.
455
 
456
 
456
======================================================================
457
======================================================================
457
=============== Function 12 - begin/end window redraw. ===============
458
=============== Function 12 - begin/end window redraw. ===============
458
======================================================================
459
======================================================================
459
 
460
 
460
---------------- Subfunction 1 - begin window redraw. ----------------
461
---------------- Subfunction 1 - begin window redraw. ----------------
461
Parameters:
462
Parameters:
462
  * eax = 12 - function number
463
  * eax = 12 - function number
463
  * ebx = 1 - subfunction number
464
  * ebx = 1 - subfunction number
464
Returned value:
465
Returned value:
465
  * function does not return value
466
  * function does not return value
466
 
467
 
467
----------------- Subfunction 2 - end window redraw. -----------------
468
----------------- Subfunction 2 - end window redraw. -----------------
468
Parameters:
469
Parameters:
469
  * eax = 12 - function number
470
  * eax = 12 - function number
470
  * ebx = 2 - subfunction number
471
  * ebx = 2 - subfunction number
471
Returned value:
472
Returned value:
472
  * function does not return value
473
  * function does not return value
473
Remarks:
474
Remarks:
474
  * Subfunction 1 deletes all buttons defined with
475
  * Subfunction 1 deletes all buttons defined with
475
    function 8, they must be defined again.
476
    function 8, they must be defined again.
476
 
477
 
477
======================================================================
478
======================================================================
478
============ Function 13 - draw a rectangle in the window. ===========
479
============ Function 13 - draw a rectangle in the window. ===========
479
======================================================================
480
======================================================================
480
Parameters:
481
Parameters:
481
  * eax = 13 - function number
482
  * eax = 13 - function number
482
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
483
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
483
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
484
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
484
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
485
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
485
Returned value:
486
Returned value:
486
  * function does not return value
487
  * function does not return value
487
Remarks:
488
Remarks:
488
  * Coordinates are understood as coordinates of the left upper corner
489
  * Coordinates are understood as coordinates of the left upper corner
489
    of a rectangle relative to the window.
490
    of a rectangle relative to the window.
490
 
491
 
491
======================================================================
492
======================================================================
492
=================== Function 14 - get screen size. ===================
493
=================== Function 14 - get screen size. ===================
493
======================================================================
494
======================================================================
494
Parameters:
495
Parameters:
495
  * eax = 14 - function number
496
  * eax = 14 - function number
496
Returned value:
497
Returned value:
497
  * eax = [xsize]*65536 + [ysize], where
498
  * eax = [xsize]*65536 + [ysize], where
498
  * xsize = x-coordinate of the right lower corner of the screen =
499
  * xsize = x-coordinate of the right lower corner of the screen =
499
            horizontal size - 1
500
            horizontal size - 1
500
  * ysize = y-coordinate of the right lower corner of the screen =
501
  * ysize = y-coordinate of the right lower corner of the screen =
501
            vertical size - 1
502
            vertical size - 1
502
Remarks:
503
Remarks:
503
  * See also subfunction 5 of function 48 - get sizes of
504
  * See also subfunction 5 of function 48 - get sizes of
504
    working area of the screen.
505
    working area of the screen.
505
 
506
 
506
======================================================================
507
======================================================================
507
== Function 15, subfunction 1 - set a size of the background image. ==
508
== Function 15, subfunction 1 - set a size of the background image. ==
508
======================================================================
509
======================================================================
509
Parameters:
510
Parameters:
510
  * eax = 15 - function number
511
  * eax = 15 - function number
511
  * ebx = 1 - subfunction number
512
  * ebx = 1 - subfunction number
512
  * ecx = width of the image
513
  * ecx = width of the image
513
  * edx = height of the image
514
  * edx = height of the image
514
Returned value:
515
Returned value:
515
  * function does not return value
516
  * function does not return value
516
Remarks:
517
Remarks:
517
  * Before calling subfunctions 2 and 5 you should call this function
518
  * Before calling subfunctions 2 and 5 you should call this function
518
    to set image size!
519
    to set image size!
519
  * For update of the screen (after completion of a series of commands
520
  * For update of the screen (after completion of a series of commands
520
    working with a background) call subfunction 3.
521
    working with a background) call subfunction 3.
521
  * There is a pair function for get size of the background image -
522
  * There is a pair function for get size of the background image -
522
    subfunction 1 of function 39.
523
    subfunction 1 of function 39.
523
 
524
 
524
======================================================================
525
======================================================================
525
=== Function 15, subfunction 2 - put pixel on the background image. ==
526
=== Function 15, subfunction 2 - put pixel on the background image. ==
526
======================================================================
527
======================================================================
527
Parameters:
528
Parameters:
528
  * eax = 15 - function number
529
  * eax = 15 - function number
529
  * ebx = 2 - subfunction number
530
  * ebx = 2 - subfunction number
530
  * ecx = offset
531
  * ecx = offset
531
  * edx = color of a pixel 0xRRGGBB
532
  * edx = color of a pixel 0xRRGGBB
532
Returned value:
533
Returned value:
533
  * function does not return value
534
  * function does not return value
534
Remarks:
535
Remarks:
535
  * Offset for a pixel with coordinates (x,y) is calculated as
536
  * Offset for a pixel with coordinates (x,y) is calculated as
536
    (x+y*xsize)*3.
537
    (x+y*xsize)*3.
537
  * If the given offset exceeds size set by subfunction 1,
538
  * If the given offset exceeds size set by subfunction 1,
538
    the call is ignored.
539
    the call is ignored.
539
  * For update of the screen (after completion of a series of commands
540
  * For update of the screen (after completion of a series of commands
540
    working with a background) call subfunction 3.
541
    working with a background) call subfunction 3.
541
  * There is a pair function for get pixel on the background image -
542
  * There is a pair function for get pixel on the background image -
542
    subfunction 2 of function 39.
543
    subfunction 2 of function 39.
543
 
544
 
544
======================================================================
545
======================================================================
545
=========== Function 15, subfunction 3 - redraw background. ==========
546
=========== Function 15, subfunction 3 - redraw background. ==========
546
======================================================================
547
======================================================================
547
Parameters:
548
Parameters:
548
  * eax = 15 - function number
549
  * eax = 15 - function number
549
  * ebx = 3 - subfunction number
550
  * ebx = 3 - subfunction number
550
Returned value:
551
Returned value:
551
  * function does not return value
552
  * function does not return value
552
 
553
 
553
======================================================================
554
======================================================================
554
== Function 15, subfunction 4 - set drawing mode for the background. =
555
== Function 15, subfunction 4 - set drawing mode for the background. =
555
======================================================================
556
======================================================================
556
Parameters:
557
Parameters:
557
  * eax = 15 - function number
558
  * eax = 15 - function number
558
  * ebx = 4 - subfunction number
559
  * ebx = 4 - subfunction number
559
  * ecx = drawing mode:
560
  * ecx = drawing mode:
560
    * 1 = tile
561
    * 1 = tile
561
    * 2 = stretch
562
    * 2 = stretch
562
Returned value:
563
Returned value:
563
  * function does not return value
564
  * function does not return value
564
Remarks:
565
Remarks:
565
  * For update of the screen (after completion of a series of commands
566
  * For update of the screen (after completion of a series of commands
566
    working with a background) call subfunction 3.
567
    working with a background) call subfunction 3.
567
  * There is a pair function for get drawing mode of the background -
568
  * There is a pair function for get drawing mode of the background -
568
    subfunction 4 of function 39.
569
    subfunction 4 of function 39.
569
 
570
 
570
======================================================================
571
======================================================================
571
===================== Function 15, subfunction 5 =====================
572
===================== Function 15, subfunction 5 =====================
572
============ Put block of pixels on the background image. ============
573
============ Put block of pixels on the background image. ============
573
======================================================================
574
======================================================================
574
Parameters:
575
Parameters:
575
  * eax = 15 - function number
576
  * eax = 15 - function number
576
  * ebx = 5 - subfunction number
577
  * ebx = 5 - subfunction number
577
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
578
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
578
  * edx = offset in data of the background image
579
  * edx = offset in data of the background image
579
  * esi = size of data in bytes = 3 * number of pixels
580
  * esi = size of data in bytes = 3 * number of pixels
580
Returned value:
581
Returned value:
581
  * function does not return value
582
  * function does not return value
582
Remarks:
583
Remarks:
583
  * Offset and size are not checked for correctness.
584
  * Offset and size are not checked for correctness.
584
  * Color of each pixel is stored as 3-bytes value BBGGRR.
585
  * Color of each pixel is stored as 3-bytes value BBGGRR.
585
  * Pixels of the background image are written sequentially
586
  * Pixels of the background image are written sequentially
586
    from left to right, from up to down.
587
    from left to right, from up to down.
587
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
588
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
588
  * For update of the screen (after completion of a series of commands
589
  * For update of the screen (after completion of a series of commands
589
    working with a background) call subfunction 3.
590
    working with a background) call subfunction 3.
590
 
591
 
591
======================================================================
592
======================================================================
592
===================== Function 15, subfunction 6 =====================
593
===================== Function 15, subfunction 6 =====================
593
======== Map background data to the address space of process. ========
594
======== Map background data to the address space of process. ========
594
======================================================================
595
======================================================================
595
Parameters:
596
Parameters:
596
  * eax = 15 - function number
597
  * eax = 15 - function number
597
  * ebx = 6 - subfunction number
598
  * ebx = 6 - subfunction number
598
Returned value:
599
Returned value:
599
  * eax = pointer to background data, 0 if error
600
  * eax = pointer to background data, 0 if error
600
Remarks:
601
Remarks:
601
  * Mapped data are available for read and write.
602
  * Mapped data are available for read and write.
602
  * Size of background data is 3*xsize*ysize. The system blocks
603
  * Size of background data is 3*xsize*ysize. The system blocks
603
    changes of background sizes while process works with mapped data.
604
    changes of background sizes while process works with mapped data.
604
  * Color of each pixel is stored as 3-bytes value BBGGRR.
605
  * Color of each pixel is stored as 3-bytes value BBGGRR.
605
  * Pixels of the background image are written sequentially
606
  * Pixels of the background image are written sequentially
606
    from left to right, from up to down.
607
    from left to right, from up to down.
607
 
608
 
608
======================================================================
609
======================================================================
609
===== Function 15, subfunction 7 - close mapped background data. =====
610
===== Function 15, subfunction 7 - close mapped background data. =====
610
======================================================================
611
======================================================================
611
Parameters:
612
Parameters:
612
  * eax = 15 - function number
613
  * eax = 15 - function number
613
  * ebx = 7 - subfunction number
614
  * ebx = 7 - subfunction number
614
  * ecx = pointer to mapped data
615
  * ecx = pointer to mapped data
615
Returned value:
616
Returned value:
616
  * eax = 1 - success, 0 - error
617
  * eax = 1 - success, 0 - error
617
 
618
 
618
======================================================================
619
======================================================================
619
===================== Function 15, subfunction 8 =====================
620
===================== Function 15, subfunction 8 =====================
620
============= Get coordinates of last draw the background ============
621
============= Get coordinates of last draw the background ============
621
======================================================================
622
======================================================================
622
Parameters:
623
Parameters:
623
  * eax = 15 - function number
624
  * eax = 15 - function number
624
  * ebx = 8 - subfunction number
625
  * ebx = 8 - subfunction number
625
Returned value:
626
Returned value:
626
  * eax = [left]*65536 + [right]
627
  * eax = [left]*65536 + [right]
627
  * ebx = [top]*65536 + [bottom]
628
  * ebx = [top]*65536 + [bottom]
628
Remarks:
629
Remarks:
629
  * (left,top) are coordinates of the left upper corner,
630
  * (left,top) are coordinates of the left upper corner,
630
    (right,bottom) are coordinates of the right lower one.
631
    (right,bottom) are coordinates of the right lower one.
631
  * For receiving more reliable information, call the function
632
  * For receiving more reliable information, call the function
632
    immediately after the event:
633
    immediately after the event:
633
             5 = kernel finished redrawing of the desktop background
634
             5 = kernel finished redrawing of the desktop background
634
 
635
 
635
======================================================================
636
======================================================================
636
===================== Function 15, subfunction 9 =====================
637
===================== Function 15, subfunction 9 =====================
637
============= Redraws a rectangular part of the background ===========
638
============= Redraws a rectangular part of the background ===========
638
======================================================================
639
======================================================================
639
Parameters:
640
Parameters:
640
  * eax = 15 - function number
641
  * eax = 15 - function number
641
  * ebx = 9 - subfunction number
642
  * ebx = 9 - subfunction number
642
  * ecx = [left]*65536 + [right]
643
  * ecx = [left]*65536 + [right]
643
  * edx = [top]*65536 + [bottom]
644
  * edx = [top]*65536 + [bottom]
644
Returned value:
645
Returned value:
645
  * function does not return value
646
  * function does not return value
646
Remarks:
647
Remarks:
647
  * (left,top) are coordinates of the left upper corner,
648
  * (left,top) are coordinates of the left upper corner,
648
    (right,bottom) are coordinates of the right lower one.
649
    (right,bottom) are coordinates of the right lower one.
649
  * If parameters are set incorrectly then background is not redrawn.
650
  * If parameters are set incorrectly then background is not redrawn.
650
 
651
 
651
======================================================================
652
======================================================================
652
=============== Function 16 - save ramdisk on a floppy. ==============
653
=============== Function 16 - save ramdisk on a floppy. ==============
653
======================================================================
654
======================================================================
654
Parameters:
655
Parameters:
655
  * eax = 16 - function number
656
  * eax = 16 - function number
656
  * ebx = 1 or ebx = 2 - on which floppy save
657
  * ebx = 1 or ebx = 2 - on which floppy save
657
Returned value:
658
Returned value:
658
  * eax = 0 - success
659
  * eax = 0 - success
659
  * eax = 1 - error
660
  * eax = 1 - error
660
 
661
 
661
======================================================================
662
======================================================================
662
======= Function 17 - get the identifier of the pressed button. ======
663
======= Function 17 - get the identifier of the pressed button. ======
663
======================================================================
664
======================================================================
664
Takes away the code of the pressed button from the buffer.
665
Takes away the code of the pressed button from the buffer.
665
Parameters:
666
Parameters:
666
  * eax = 17 - function number
667
  * eax = 17 - function number
667
Returned value:
668
Returned value:
668
  * if the buffer is empty, function returns eax=1
669
  * if the buffer is empty, function returns eax=1
669
  * if the buffer is not empty:
670
  * if the buffer is not empty:
670
    * high 24 bits of eax contain button identifier (in particular,
671
    * high 24 bits of eax contain button identifier (in particular,
671
      ah contains low byte of the identifier; if all buttons have
672
      ah contains low byte of the identifier; if all buttons have
672
      the identifier less than 256, ah is enough to distinguish)
673
      the identifier less than 256, ah is enough to distinguish)
673
    * al = 0 - the button was pressed with left mouse button
674
    * al = 0 - the button was pressed with left mouse button
674
    * al = bit corresponding to used mouse button otherwise
675
    * al = bit corresponding to used mouse button otherwise
675
Remarks:
676
Remarks:
676
  * "Buffer" keeps only one button, at pressing the new button the
677
  * "Buffer" keeps only one button, at pressing the new button the
677
    information about old is lost.
678
    information about old is lost.
678
  * The call of this function by an application with inactive window
679
  * The call of this function by an application with inactive window
679
    will return answer "buffer is empty".
680
    will return answer "buffer is empty".
680
  * Returned value for al corresponds to the state of mouse buttons
681
  * Returned value for al corresponds to the state of mouse buttons
681
    as in subfunction 2 of function 37 at the beginning
682
    as in subfunction 2 of function 37 at the beginning
682
    of button press, excluding lower bit, which is cleared.
683
    of button press, excluding lower bit, which is cleared.
683
 
684
 
684
======================================================================
685
======================================================================
685
===================== Function 18, subfunction 1 =====================
686
===================== Function 18, subfunction 1 =====================
686
============= Make deactive the window of the given thread. ==========
687
============= Make deactive the window of the given thread. ==========
687
======================================================================
688
======================================================================
688
Parameters:
689
Parameters:
689
  * eax = 18 - function number
690
  * eax = 18 - function number
690
  * ebx = 1 - subfunction number
691
  * ebx = 1 - subfunction number
691
  * ecx = number of the thread slot
692
  * ecx = number of the thread slot
692
Returned value:
693
Returned value:
693
  * function does not return value
694
  * function does not return value
694
 
695
 
695
======================================================================
696
======================================================================
696
= Function 18, subfunction 2 - terminate process/thread by the slot. =
697
= Function 18, subfunction 2 - terminate process/thread by the slot. =
697
======================================================================
698
======================================================================
698
Parameters:
699
Parameters:
699
  * eax = 18 - function number
700
  * eax = 18 - function number
700
  * ebx = 2 - subfunction number
701
  * ebx = 2 - subfunction number
701
  * ecx = number of the slot of process/thread
702
  * ecx = number of the slot of process/thread
702
Returned value:
703
Returned value:
703
  * function does not return value
704
  * function does not return value
704
Remarks:
705
Remarks:
705
  * It is impossible to terminate system thread OS/IDLE (with
706
  * It is impossible to terminate system thread OS/IDLE (with
706
    number of the slot 1),
707
    number of the slot 1),
707
    it is possible to terminate any normal process/thread.
708
    it is possible to terminate any normal process/thread.
708
  * See also subfunction 18 - terminate
709
  * See also subfunction 18 - terminate
709
    process/thread by the identifier.
710
    process/thread by the identifier.
710
 
711
 
711
======================================================================
712
======================================================================
712
===================== Function 18, subfunction 3 =====================
713
===================== Function 18, subfunction 3 =====================
713
============= Make active the window of the given thread. ============
714
============= Make active the window of the given thread. ============
714
======================================================================
715
======================================================================
715
Parameters:
716
Parameters:
716
  * eax = 18 - function number
717
  * eax = 18 - function number
717
  * ebx = 3 - subfunction number
718
  * ebx = 3 - subfunction number
718
  * ecx = number of the thread slot
719
  * ecx = number of the thread slot
719
Returned value:
720
Returned value:
720
  * function does not return value
721
  * function does not return value
721
Remarks:
722
Remarks:
722
  * If correct, but nonexistent slot is given,
723
  * If correct, but nonexistent slot is given,
723
    some window is made active.
724
    some window is made active.
724
  * To find out, which window is active, use subfunction 7.
725
  * To find out, which window is active, use subfunction 7.
725
 
726
 
726
======================================================================
727
======================================================================
727
===================== Function 18, subfunction 4 =====================
728
===================== Function 18, subfunction 4 =====================
728
=========== Get counter of idle time units per one second. ===========
729
=========== Get counter of idle time units per one second. ===========
729
======================================================================
730
======================================================================
730
Idle time units are units, in which the processor stands idle
731
Idle time units are units, in which the processor stands idle
731
in waiting for interrupt (in the command 'hlt').
732
in waiting for interrupt (in the command 'hlt').
732
 
733
 
733
Parameters:
734
Parameters:
734
  * eax = 18 - function number
735
  * eax = 18 - function number
735
  * ebx = 4 - subfunction number
736
  * ebx = 4 - subfunction number
736
Returned value:
737
Returned value:
737
  * eax = value of the counter of idle time units per one second
738
  * eax = value of the counter of idle time units per one second
738
 
739
 
739
======================================================================
740
======================================================================
740
========== Function 18, subfunction 5 - get CPU clock rate. ==========
741
========== Function 18, subfunction 5 - get CPU clock rate. ==========
741
======================================================================
742
======================================================================
742
Parameters:
743
Parameters:
743
  * eax = 18 - function number
744
  * eax = 18 - function number
744
  * ebx = 5 - subfunction number
745
  * ebx = 5 - subfunction number
745
Returned value:
746
Returned value:
746
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
747
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
747
 
748
 
748
======================================================================
749
======================================================================
749
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
750
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
750
======================================================================
751
======================================================================
751
Parameters:
752
Parameters:
752
  * eax = 18 - function number
753
  * eax = 18 - function number
753
  * ebx = 6 - subfunction number
754
  * ebx = 6 - subfunction number
754
  * ecx = pointer to the full path to file
755
  * ecx = pointer to the full path to file
755
    (for example, "/hd0/1/kolibri/kolibri.img")
756
    (for example, "/hd0/1/kolibri/kolibri.img")
756
Returned value:
757
Returned value:
757
  * eax = 0 - success
758
  * eax = 0 - success
758
  * else eax = error code of the file system
759
  * else eax = error code of the file system
759
Remarks:
760
Remarks:
760
  * All folders in the given path must exist, otherwise function
761
  * All folders in the given path must exist, otherwise function
761
    returns value 5, "file not found".
762
    returns value 5, "file not found".
762
 
763
 
763
======================================================================
764
======================================================================
764
=========== Function 18, subfunction 7 - get active window. ==========
765
=========== Function 18, subfunction 7 - get active window. ==========
765
======================================================================
766
======================================================================
766
Parameters:
767
Parameters:
767
  * eax = 18 - function number
768
  * eax = 18 - function number
768
  * ebx = 7 - subfunction number
769
  * ebx = 7 - subfunction number
769
Returned value:
770
Returned value:
770
  * eax = number of the active window
771
  * eax = number of the active window
771
    (number of the slot of the thread with active window)
772
    (number of the slot of the thread with active window)
772
Remarks:
773
Remarks:
773
  * Active window is at the top of the window stack and receives
774
  * Active window is at the top of the window stack and receives
774
    messages on all keyboard input.
775
    messages on all keyboard input.
775
  * To make a window active, use subfunction 3.
776
  * To make a window active, use subfunction 3.
776
 
777
 
777
======================================================================
778
======================================================================
778
== Function 18, subfunction 8 - disable/enable the internal speaker. =
779
== Function 18, subfunction 8 - disable/enable the internal speaker. =
779
======================================================================
780
======================================================================
780
If speaker sound is disabled, all calls to subfunction 55 of
781
If speaker sound is disabled, all calls to subfunction 55 of
781
function 55 are ignored. If speaker sound is enabled,
782
function 55 are ignored. If speaker sound is enabled,
782
they are routed on builtin speaker.
783
they are routed on builtin speaker.
783
 
784
 
784
------------------- Subsubfunction 1 - get status. -------------------
785
------------------- Subsubfunction 1 - get status. -------------------
785
Parameters:
786
Parameters:
786
  * eax = 18 - function number
787
  * eax = 18 - function number
787
  * ebx = 8 - subfunction number
788
  * ebx = 8 - subfunction number
788
  * ecx = 1 - number of the subsubfunction
789
  * ecx = 1 - number of the subsubfunction
789
Returned value:
790
Returned value:
790
  * eax = 0 - speaker sound is enabled; 1 - disabled
791
  * eax = 0 - speaker sound is enabled; 1 - disabled
791
 
792
 
792
----------------- Subsubfunction 2 - toggle status. ------------------
793
----------------- Subsubfunction 2 - toggle status. ------------------
793
Toggles states of disable/enable.
794
Toggles states of disable/enable.
794
Parameters:
795
Parameters:
795
  * eax = 18 - function number
796
  * eax = 18 - function number
796
  * ebx = 8 - subfunction number
797
  * ebx = 8 - subfunction number
797
  * ecx = 2 - number of the subsubfunction
798
  * ecx = 2 - number of the subsubfunction
798
Returned value:
799
Returned value:
799
  * function does not return value
800
  * function does not return value
800
 
801
 
801
======================================================================
802
======================================================================
802
== Function 18, subfunction 9 - system shutdown with the parameter. ==
803
== Function 18, subfunction 9 - system shutdown with the parameter. ==
803
======================================================================
804
======================================================================
804
Parameters:
805
Parameters:
805
  * eax = 18 - function number
806
  * eax = 18 - function number
806
  * ebx = 9 - subfunction number
807
  * ebx = 9 - subfunction number
807
  * ecx = parameter:
808
  * ecx = parameter:
808
    * 2 = turn off computer
809
    * 2 = turn off computer
809
    * 3 = reboot computer
810
    * 3 = reboot computer
810
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
811
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
811
Returned value:
812
Returned value:
812
  * at incorrect ecx the registers do not change (i.e. eax=18)
813
  * at incorrect ecx the registers do not change (i.e. eax=18)
813
  * by correct call function always returns eax=0
814
  * by correct call function always returns eax=0
814
    as the tag of success
815
    as the tag of success
815
Remarks:
816
Remarks:
816
  * Do not rely on returned value by incorrect call, it can be
817
  * Do not rely on returned value by incorrect call, it can be
817
    changed in future versions of the kernel.
818
    changed in future versions of the kernel.
818
 
819
 
819
======================================================================
820
======================================================================
820
======= Function 18, subfunction 10 - minimize topmost window. =======
821
======= Function 18, subfunction 10 - minimize topmost window. =======
821
======================================================================
822
======================================================================
822
Minimizes the topmost (active) window.
823
Minimizes the topmost (active) window.
823
Parameters:
824
Parameters:
824
  * eax = 18 - function number
825
  * eax = 18 - function number
825
  * ebx = 10 - subfunction number
826
  * ebx = 10 - subfunction number
826
Returned value:
827
Returned value:
827
  * function does not return value
828
  * function does not return value
828
Remarks:
829
Remarks:
829
  * The minimized window from the point of view of function 9
830
  * The minimized window from the point of view of function 9
830
    keeps position and sizes.
831
    keeps position and sizes.
831
  * Restoring of an application window occurs at its activation by
832
  * Restoring of an application window occurs at its activation by
832
    subfunction 3.
833
    subfunction 3.
833
  * Usually there is no necessity to minimize/restore a window
834
  * Usually there is no necessity to minimize/restore a window
834
    explicitly: minimization of a window is carried out by the system
835
    explicitly: minimization of a window is carried out by the system
835
    at pressing the minimization button (for skinned windows
836
    at pressing the minimization button (for skinned windows
836
    it is defined automatically by function 0,
837
    it is defined automatically by function 0,
837
    for other windows it can be defined manually by function 8),
838
    for other windows it can be defined manually by function 8),
838
    restore of a window is done by the application '@panel'.
839
    restore of a window is done by the application '@panel'.
839
 
840
 
840
======================================================================
841
======================================================================
841
 Function 18, subfunction 11 - get information on the disk subsystem.
842
 Function 18, subfunction 11 - get information on the disk subsystem.
842
======================================================================
843
======================================================================
843
Parameters:
844
Parameters:
844
  * eax = 18 - function number
845
  * eax = 18 - function number
845
  * ebx = 11 - subfunction number
846
  * ebx = 11 - subfunction number
846
  * ecx = type of the table:
847
  * ecx = type of the table:
847
    * 1 = short version, 10 bytes
848
    * 1 = short version, 10 bytes
848
    * 2 = full version, 65536 bytes
849
    * 2 = full version, 65536 bytes
849
  * edx = pointer to the buffer (in the application) for the table
850
  * edx = pointer to the buffer (in the application) for the table
850
Returned value:
851
Returned value:
851
  * function does not return value
852
  * function does not return value
852
Format of the table: short version:
853
Format of the table: short version:
853
  * +0: byte: information about FDD's (drives for floppies),
854
  * +0: byte: information about FDD's (drives for floppies),
854
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
855
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
855
    of the second regarding to the following list:
856
    of the second regarding to the following list:
856
    * 0 = there is no drive
857
    * 0 = there is no drive
857
    * 1 = 360Kb, 5.25''
858
    * 1 = 360Kb, 5.25''
858
    * 2 = 1.2Mb, 5.25''
859
    * 2 = 1.2Mb, 5.25''
859
    * 3 = 720Kb, 3.5''
860
    * 3 = 720Kb, 3.5''
860
    * 4 = 1.44Mb, 3.5''
861
    * 4 = 1.44Mb, 3.5''
861
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
862
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
862
    For example, for the standard configuration from one 1.44-drive
863
    For example, for the standard configuration from one 1.44-drive
863
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
864
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
864
    the value is 24h.
865
    the value is 24h.
865
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
866
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
866
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
867
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
867
    * 0 = device is absent
868
    * 0 = device is absent
868
    * 1 = hard drive
869
    * 1 = hard drive
869
    * 2 = CD-drive
870
    * 2 = CD-drive
870
    For example, in the case HD on IDE0 and CD on IDE2
871
    For example, in the case HD on IDE0 and CD on IDE2
871
    this field contains 48h.
872
    this field contains 48h.
872
  * +2: 4 db: number of the retrieved partitions on hard disks
873
  * +2: 4 db: number of the retrieved partitions on hard disks
873
    at accordingly IDE0,...,IDE3.
874
    at accordingly IDE0,...,IDE3.
874
    If the hard disk on IDEx is absent, appropriate byte is zero,
875
    If the hard disk on IDEx is absent, appropriate byte is zero,
875
    otherwise it shows number of the recognized partitions, which
876
    otherwise it shows number of the recognized partitions, which
876
    can be not presented (if the drive is not formatted or if
877
    can be not presented (if the drive is not formatted or if
877
    the file system is not supported). Current version of the kernel
878
    the file system is not supported). Current version of the kernel
878
    supports only FAT16, FAT32 and NTFS for hard disks.
879
    supports only FAT16, FAT32 and NTFS for hard disks.
879
  * +6: 4 db: reserved
880
  * +6: 4 db: reserved
880
Format of the table: full version:
881
Format of the table: full version:
881
  * +0: 10 db: same as for the short version
882
  * +0: 10 db: same as for the short version
882
  * +10: 100 db: data for the first partition
883
  * +10: 100 db: data for the first partition
883
  * +110: 100 db: data for the second partition
884
  * +110: 100 db: data for the second partition
884
  * ...
885
  * ...
885
  * +10+100*(n-1): 100 db: data for the last partition
886
  * +10+100*(n-1): 100 db: data for the last partition
886
The partitions are located as follows: at first sequentially all
887
The partitions are located as follows: at first sequentially all
887
recoginzed partitions on HD on IDE0 (if present),
888
recoginzed partitions on HD on IDE0 (if present),
888
then on HD on IDE1 (if present) and so on up to IDE3.
889
then on HD on IDE1 (if present) and so on up to IDE3.
889
Format of the information about partition
890
Format of the information about partition
890
(at moment only FAT is supported):
891
(at moment only FAT is supported):
891
  * +0: dword: first physical sector of the partition
892
  * +0: dword: first physical sector of the partition
892
  * +4: dword: last physical sector of the partition
893
  * +4: dword: last physical sector of the partition
893
    (belongs to the partition)
894
    (belongs to the partition)
894
  * +8: byte: file system type:
895
  * +8: byte: file system type:
895
    16=FAT16, 32=FAT32, 1=NTFS
896
    16=FAT16, 32=FAT32, 1=NTFS
896
  * other data are dependent on file system, are modified with
897
  * other data are dependent on file system, are modified with
897
    kernel modifications and therefore are not described
898
    kernel modifications and therefore are not described
898
Remarks:
899
Remarks:
899
  * The short table can be used for obtaining the information about
900
  * The short table can be used for obtaining the information about
900
    available devices.
901
    available devices.
901
 
902
 
902
======================================================================
903
======================================================================
903
========== Function 18, subfunction 13 - get kernel version. =========
904
========== Function 18, subfunction 13 - get kernel version. =========
904
======================================================================
905
======================================================================
905
Parameters:
906
Parameters:
906
  * eax = 18 - function number
907
  * eax = 18 - function number
907
  * ebx = 13 - subfunction number
908
  * ebx = 13 - subfunction number
908
  * ecx = pointer to the buffer (not less than 16 bytes), where
909
  * ecx = pointer to the buffer (not less than 16 bytes), where
909
    the information will be placed
910
    the information will be placed
910
Returned value:
911
Returned value:
911
  * function does not return value
912
  * function does not return value
912
Structure of the buffer:
913
Structure of the buffer:
913
db a,b,c,d for version a.b.c.d
914
db a,b,c,d for version a.b.c.d
914
db 0: reserved
915
db 0: reserved
915
dd REV - kernel SVN revision number
916
dd REV - kernel SVN revision number
916
For Kolibri 0.7.7.0+ kernel:
917
For Kolibri 0.7.7.0+ kernel:
917
db 0,7,7,0
918
db 0,7,7,0
918
db 0
919
db 0
919
dd 1675
920
dd 1675
920
 
921
 
921
======================================================================
922
======================================================================
922
======= Function 18, subfunction 14 - wait for screen retrace. =======
923
======= Function 18, subfunction 14 - wait for screen retrace. =======
923
======================================================================
924
======================================================================
924
Waits for the beginning of retrace of the scanning ray of the screen
925
Waits for the beginning of retrace of the scanning ray of the screen
925
monitor.
926
monitor.
926
Parameters:
927
Parameters:
927
  * eax = 18 - function number
928
  * eax = 18 - function number
928
  * ebx = 14 - subfunction number
929
  * ebx = 14 - subfunction number
929
Returned value:
930
Returned value:
930
  * eax = 0 as the tag of success
931
  * eax = 0 as the tag of success
931
Remarks:
932
Remarks:
932
  * Function is intended only for active high-efficiency graphics
933
  * Function is intended only for active high-efficiency graphics
933
    applications; is used for smooth output of a graphics.
934
    applications; is used for smooth output of a graphics.
934
 
935
 
935
======================================================================
936
======================================================================
936
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
937
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
937
======================================================================
938
======================================================================
938
Parameters:
939
Parameters:
939
  * eax = 18 - function number
940
  * eax = 18 - function number
940
  * ebx = 15 - subfunction number
941
  * ebx = 15 - subfunction number
941
Returned value:
942
Returned value:
942
  * eax = 0 as the tag of success
943
  * eax = 0 as the tag of success
943
 
944
 
944
======================================================================
945
======================================================================
945
========= Function 18, subfunction 16 - get size of free RAM. ========
946
========= Function 18, subfunction 16 - get size of free RAM. ========
946
======================================================================
947
======================================================================
947
Parameters:
948
Parameters:
948
  * eax = 18 - function number
949
  * eax = 18 - function number
949
  * ebx = 16 - subfunction number
950
  * ebx = 16 - subfunction number
950
Returned value:
951
Returned value:
951
  * eax = size of free memory in kilobytes
952
  * eax = size of free memory in kilobytes
952
 
953
 
953
======================================================================
954
======================================================================
954
======== Function 18, subfunction 17 - get full amount of RAM. =======
955
======== Function 18, subfunction 17 - get full amount of RAM. =======
955
======================================================================
956
======================================================================
956
Parameters:
957
Parameters:
957
  * eax = 18 - function number
958
  * eax = 18 - function number
958
  * ebx = 17 - subfunction number
959
  * ebx = 17 - subfunction number
959
Returned value:
960
Returned value:
960
  * eax = total size of existing memory in kilobytes
961
  * eax = total size of existing memory in kilobytes
961
 
962
 
962
======================================================================
963
======================================================================
963
===================== Function 18, subfunction 18 ====================
964
===================== Function 18, subfunction 18 ====================
964
============= Terminate process/thread by the identifier. ============
965
============= Terminate process/thread by the identifier. ============
965
======================================================================
966
======================================================================
966
Parameters:
967
Parameters:
967
  * eax = 18 - function number
968
  * eax = 18 - function number
968
  * ebx = 18 - subfunction number
969
  * ebx = 18 - subfunction number
969
  * ecx = identifer of process/thread (PID/TID)
970
  * ecx = identifer of process/thread (PID/TID)
970
Returned value:
971
Returned value:
971
  * eax = 0 - success
972
  * eax = 0 - success
972
  * eax = -1 - error (process is not found or is system)
973
  * eax = -1 - error (process is not found or is system)
973
Remarks:
974
Remarks:
974
  * It is impossible to terminate system thread OS/IDLE (identifier
975
  * It is impossible to terminate system thread OS/IDLE (identifier
975
    1), it is possible to terminate any normal process/thread.
976
    1), it is possible to terminate any normal process/thread.
976
  * See also subfunction 2 - terminate
977
  * See also subfunction 2 - terminate
977
    process/thread by given slot.
978
    process/thread by given slot.
978
 
979
 
979
======================================================================
980
======================================================================
980
======== Function 18, subfunction 19 - get/set mouse features. =======
981
======== Function 18, subfunction 19 - get/set mouse features. =======
981
======================================================================
982
======================================================================
982
 
983
 
983
---------------- Subsubfunction 0 - get mouse speed. -----------------
984
---------------- Subsubfunction 0 - get mouse speed. -----------------
984
Parameters:
985
Parameters:
985
  * eax = 18 - function number
986
  * eax = 18 - function number
986
  * ebx = 19 - subfunction number
987
  * ebx = 19 - subfunction number
987
  * ecx = 0 - subsubfunction number
988
  * ecx = 0 - subsubfunction number
988
Returned value:
989
Returned value:
989
  * eax = current mouse speed
990
  * eax = current mouse speed
990
 
991
 
991
---------------- Subsubfunction 1 - set mouse speed. -----------------
992
---------------- Subsubfunction 1 - set mouse speed. -----------------
992
Parameters:
993
Parameters:
993
  * eax = 18 - function number
994
  * eax = 18 - function number
994
  * ebx = 19 - subfunction number
995
  * ebx = 19 - subfunction number
995
  * ecx = 1 - subsubfunction number
996
  * ecx = 1 - subsubfunction number
996
  * edx = new value for speed
997
  * edx = new value for speed
997
Returned value:
998
Returned value:
998
  * function does not return value
999
  * function does not return value
999
 
1000
 
1000
---------------- Subsubfunction 2 - get mouse delay. -----------------
1001
---------------- Subsubfunction 2 - get mouse delay. -----------------
1001
Parameters:
1002
Parameters:
1002
  * eax = 18 - function number
1003
  * eax = 18 - function number
1003
  * ebx = 19 - subfunction number
1004
  * ebx = 19 - subfunction number
1004
  * ecx = 2 - subsubfunction number
1005
  * ecx = 2 - subsubfunction number
1005
Returned value:
1006
Returned value:
1006
  * eax = current mouse delay
1007
  * eax = current mouse delay
1007
 
1008
 
1008
---------------- Subsubfunction 3 - set mouse delay. -----------------
1009
---------------- Subsubfunction 3 - set mouse delay. -----------------
1009
Parameters:
1010
Parameters:
1010
  * eax = 18 - function number
1011
  * eax = 18 - function number
1011
  * ebx = 19 - subfunction number
1012
  * ebx = 19 - subfunction number
1012
  * ecx = 3 - subsubfunction number
1013
  * ecx = 3 - subsubfunction number
1013
  * edx = new value for mouse delay
1014
  * edx = new value for mouse delay
1014
Returned value:
1015
Returned value:
1015
  * function does not return value
1016
  * function does not return value
1016
 
1017
 
1017
----------- Subsubfunction 4 - set mouse pointer position. -----------
1018
----------- Subsubfunction 4 - set mouse pointer position. -----------
1018
Parameters:
1019
Parameters:
1019
  * eax = 18 - function number
1020
  * eax = 18 - function number
1020
  * ebx = 19 - subfunction number
1021
  * ebx = 19 - subfunction number
1021
  * ecx = 4 - subsubfunction number
1022
  * ecx = 4 - subsubfunction number
1022
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1023
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1023
Returned value:
1024
Returned value:
1024
  * function does not return value
1025
  * function does not return value
1025
 
1026
 
1026
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
1027
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
1027
Parameters:
1028
Parameters:
1028
  * eax = 18 - function number
1029
  * eax = 18 - function number
1029
  * ebx = 19 - subfunction number
1030
  * ebx = 19 - subfunction number
1030
  * ecx = 5 - subsubfunction number
1031
  * ecx = 5 - subsubfunction number
1031
  * edx = information about emulated state of mouse buttons:
1032
  * edx = information about emulated state of mouse buttons:
1032
    (same as return value in subfunction 2 of function 37)
1033
    (same as return value in subfunction 2 of function 37)
1033
    * bit 0 is set = left button is pressed
1034
    * bit 0 is set = left button is pressed
1034
    * bit 1 is set = right button is pressed
1035
    * bit 1 is set = right button is pressed
1035
    * bit 2 is set = middle button is pressed
1036
    * bit 2 is set = middle button is pressed
1036
    * bit 3 is set = 4th button is pressed
1037
    * bit 3 is set = 4th button is pressed
1037
    * bit 4 is set = 5th button is pressed
1038
    * bit 4 is set = 5th button is pressed
1038
Returned value:
1039
Returned value:
1039
  * function does not return value
1040
  * function does not return value
1040
Remarks:
1041
Remarks:
1041
  * It is recommended to set speed of the mouse (in subsubfunction 1)
1042
  * It is recommended to set speed of the mouse (in subsubfunction 1)
1042
    from 1 up to 9. The installed value is not inspected by the kernel
1043
    from 1 up to 9. The installed value is not inspected by the kernel
1043
    code, so set it carefully, at incorrect value the cursor
1044
    code, so set it carefully, at incorrect value the cursor
1044
    can "freeze". Speed of the mouse can be regulated through the
1045
    can "freeze". Speed of the mouse can be regulated through the
1045
    application SETUP.
1046
    application SETUP.
1046
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
1047
  * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
1047
    value is not handled by COM mice. At the very large values the
1048
    value is not handled by COM mice. At the very large values the
1048
    movement of the mouse on 1 pixel is impossible and the cursor will
1049
    movement of the mouse on 1 pixel is impossible and the cursor will
1049
    jump on the value of installed speed (subsubfunction 1). The
1050
    jump on the value of installed speed (subsubfunction 1). The
1050
    installed value is not inspected by the kernel code.
1051
    installed value is not inspected by the kernel code.
1051
    Mouse delay can be regulated through the application SETUP.
1052
    Mouse delay can be regulated through the application SETUP.
1052
  * The subsubfunction 4 does not check the passed value. Before
1053
  * The subsubfunction 4 does not check the passed value. Before
1053
    its call find out current screen resolution (with function 14)
1054
    its call find out current screen resolution (with function 14)
1054
    and check that the value of position is inside the limits of the
1055
    and check that the value of position is inside the limits of the
1055
    screen.
1056
    screen.
1056
 
1057
 
1057
======================================================================
1058
======================================================================
1058
======== Function 18, subfunction 20 - get information on RAM. =======
1059
======== Function 18, subfunction 20 - get information on RAM. =======
1059
======================================================================
1060
======================================================================
1060
Parameters:
1061
Parameters:
1061
  * eax = 18 - function number
1062
  * eax = 18 - function number
1062
  * ebx = 20 - subfunction number
1063
  * ebx = 20 - subfunction number
1063
  * ecx = pointer to the buffer for information (36 bytes)
1064
  * ecx = pointer to the buffer for information (36 bytes)
1064
Returned value:
1065
Returned value:
1065
  * eax = total size of existing RAM in pages
1066
  * eax = total size of existing RAM in pages
1066
    or -1 if error has occured
1067
    or -1 if error has occured
1067
  * buffer pointed to by ecx contains the following information:
1068
  * buffer pointed to by ecx contains the following information:
1068
    * +0:  dword: total size of existing RAM in pages
1069
    * +0:  dword: total size of existing RAM in pages
1069
    * +4:  dword: size of free RAM in pages
1070
    * +4:  dword: size of free RAM in pages
1070
    * +8:  dword: number of page faults (exceptions #PF)
1071
    * +8:  dword: number of page faults (exceptions #PF)
1071
                 in applications
1072
                 in applications
1072
    * +12: dword: size of kernel heap in bytes
1073
    * +12: dword: size of kernel heap in bytes
1073
    * +16: dword: free in kernel heap in bytes
1074
    * +16: dword: free in kernel heap in bytes
1074
    * +20: dword: total number of memory blocks in kernel heap
1075
    * +20: dword: total number of memory blocks in kernel heap
1075
    * +24: dword: number of free memory blocks in kernel heap
1076
    * +24: dword: number of free memory blocks in kernel heap
1076
    * +28: dword: size of maximum free block in kernel heap
1077
    * +28: dword: size of maximum free block in kernel heap
1077
                 (reserved)
1078
                 (reserved)
1078
    * +32: dword: size of maximum allocated block in kernel heap
1079
    * +32: dword: size of maximum allocated block in kernel heap
1079
                 (reserved)
1080
                 (reserved)
1080
 
1081
 
1081
======================================================================
1082
======================================================================
1082
===================== Function 18, subfunction 21 ====================
1083
===================== Function 18, subfunction 21 ====================
1083
======== Get slot number of process/thread by the identifier. ========
1084
======== Get slot number of process/thread by the identifier. ========
1084
======================================================================
1085
======================================================================
1085
Parameters:
1086
Parameters:
1086
  * eax = 18 - function number
1087
  * eax = 18 - function number
1087
  * ebx = 21 - subfunction number
1088
  * ebx = 21 - subfunction number
1088
  * ecx = identifer of process/thread (PID/TID)
1089
  * ecx = identifer of process/thread (PID/TID)
1089
Returned value:
1090
Returned value:
1090
  * eax = 0 - error (invalid identifier)
1091
  * eax = 0 - error (invalid identifier)
1091
  * otherwise eax = slot number
1092
  * otherwise eax = slot number
1092
 
1093
 
1093
======================================================================
1094
======================================================================
1094
===================== Function 18, subfunction 22 ====================
1095
===================== Function 18, subfunction 22 ====================
1095
============== Operations with window of another thread. =============
1096
============== Operations with window of another thread. =============
1096
======================================================================
1097
======================================================================
1097
Parameters:
1098
Parameters:
1098
  * eax = 18 - function number
1099
  * eax = 18 - function number
1099
  * ebx = 22 - subfunction number
1100
  * ebx = 22 - subfunction number
1100
  * ecx = operation type:
1101
  * ecx = operation type:
1101
    * 0 = minimize window of the thread with given slot number
1102
    * 0 = minimize window of the thread with given slot number
1102
    * 1 = minimize window of the thread with given identifier
1103
    * 1 = minimize window of the thread with given identifier
1103
    * 2 = restore window of the thread with given slot number
1104
    * 2 = restore window of the thread with given slot number
1104
    * 3 = restore window of the thread with given identifier
1105
    * 3 = restore window of the thread with given identifier
1105
  * edx = parameter (slot number or PID/TID)
1106
  * edx = parameter (slot number or PID/TID)
1106
Returned value:
1107
Returned value:
1107
  * eax = 0 - success
1108
  * eax = 0 - success
1108
  * eax = -1 - error (invalid identifier)
1109
  * eax = -1 - error (invalid identifier)
1109
Remarks:
1110
Remarks:
1110
  * The thread can minimize its window with subfunction 10.
1111
  * The thread can minimize its window with subfunction 10.
1111
  * One can restore and activate window simultaneously with
1112
  * One can restore and activate window simultaneously with
1112
    subfunction 3 (which requires slot number).
1113
    subfunction 3 (which requires slot number).
1113
 
1114
 
1114
======================================================================
1115
======================================================================
1115
======== Function 18, subfunction 23 - minimize all windows. ==========
1116
======== Function 18, subfunction 23 - minimize all windows. ==========
1116
======================================================================
1117
======================================================================
1117
Parameters:
1118
Parameters:
1118
  * eax = 18 - function number
1119
  * eax = 18 - function number
1119
  * ebx = 23 - subfunction number
1120
  * ebx = 23 - subfunction number
1120
Returned value:
1121
Returned value:
1121
  * eax = 0 - all windows have been minimized before a function call
1122
  * eax = 0 - all windows have been minimized before a function call
1122
  * eax = N - number of windows minimized from function
1123
  * eax = N - number of windows minimized from function
1123
Remarks:
1124
Remarks:
1124
  * Window of special thread (name begin to symbol @) is not minimize.
1125
  * Window of special thread (name begin to symbol @) is not minimize.
1125
 
1126
 
1126
======================================================================
1127
======================================================================
1127
======= Function 18, subfunction 24 - set limits of screen. ==========
1128
======= Function 18, subfunction 24 - set limits of screen. ==========
1128
======================================================================
1129
======================================================================
1129
Parameters:
1130
Parameters:
1130
  * eax = 18 - function number
1131
  * eax = 18 - function number
1131
  * ebx = 24 - subfunction number
1132
  * ebx = 24 - subfunction number
1132
  * ecx = new X size
1133
  * ecx = new X size
1133
  * edx = new Y size
1134
  * edx = new Y size
1134
Returned value:
1135
Returned value:
1135
  * function does not return value
1136
  * function does not return value
1136
Remarks:
1137
Remarks:
1137
  * The function does not change the physical size of the video mode.
1138
  * The function does not change the physical size of the video mode.
1138
    It is designed for non-standard displays which display the image
1139
    It is designed for non-standard displays which display the image
1139
    partially.
1140
    partially.
1140
  * The sizes specified in the function should not exceed the sizes
1141
  * The sizes specified in the function should not exceed the sizes
1141
    of the current video mode, otherwise the function will not change
1142
    of the current video mode, otherwise the function will not change
1142
    anything.
1143
    anything.
1143
 
1144
 
1144
======================================================================
1145
======================================================================
1145
==================== Function 20 - MIDI interface. ===================
1146
==================== Function 20 - MIDI interface. ===================
1146
======================================================================
1147
======================================================================
1147
 
1148
 
1148
----------------------- Subfunction 1 - reset ------------------------
1149
----------------------- Subfunction 1 - reset ------------------------
1149
Parameters:
1150
Parameters:
1150
  * eax = 20 - function number
1151
  * eax = 20 - function number
1151
  * ebx = 1 - subfunction number
1152
  * ebx = 1 - subfunction number
1152
 
1153
 
1153
-------------------- Subfunction 2 - output byte ---------------------
1154
-------------------- Subfunction 2 - output byte ---------------------
1154
Parameters:
1155
Parameters:
1155
  * eax = 20 - function number
1156
  * eax = 20 - function number
1156
  * ebx = 2 - subfunction number
1157
  * ebx = 2 - subfunction number
1157
  * cl = byte for output
1158
  * cl = byte for output
1158
Returned value (is the same for both subfunctions):
1159
Returned value (is the same for both subfunctions):
1159
  * eax = 0 - success
1160
  * eax = 0 - success
1160
  * eax = 1 - base port is not defined
1161
  * eax = 1 - base port is not defined
1161
Remarks:
1162
Remarks:
1162
  * Previously the base port must be defined by
1163
  * Previously the base port must be defined by
1163
    subfunction 1 of function 21.
1164
    subfunction 1 of function 21.
1164
 
1165
 
1165
======================================================================
1166
======================================================================
1166
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1167
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1167
======================================================================
1168
======================================================================
1168
Parameters:
1169
Parameters:
1169
  * eax = 21 - function number
1170
  * eax = 21 - function number
1170
  * ebx = 1 - subfunction number
1171
  * ebx = 1 - subfunction number
1171
  * ecx = number of base port
1172
  * ecx = number of base port
1172
Returned value
1173
Returned value
1173
  * eax = 0 - success
1174
  * eax = 0 - success
1174
  * eax = -1 - erratic number of a port
1175
  * eax = -1 - erratic number of a port
1175
Remarks:
1176
Remarks:
1176
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1177
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1177
  * The installation of base is necessary for function 20.
1178
  * The installation of base is necessary for function 20.
1178
  * To get base port use subfunction 1 of function 26.
1179
  * To get base port use subfunction 1 of function 26.
1179
 
1180
 
1180
======================================================================
1181
======================================================================
1181
========== Function 21, subfunction 2 - set keyboard layout. =========
1182
========== Function 21, subfunction 2 - set keyboard layout. =========
1182
======================================================================
1183
======================================================================
1183
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1184
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1184
which will be read by function 2.
1185
which will be read by function 2.
1185
Parameters:
1186
Parameters:
1186
  * eax = 21 - function number
1187
  * eax = 21 - function number
1187
  * ebx = 2 - subfunction number
1188
  * ebx = 2 - subfunction number
1188
  * ecx = which layout to set:
1189
  * ecx = which layout to set:
1189
    * 1 = normal layout
1190
    * 1 = normal layout
1190
    * 2 = layout at pressed Shift
1191
    * 2 = layout at pressed Shift
1191
    * 3 = layout at pressed Alt
1192
    * 3 = layout at pressed Alt
1192
  * edx = pointer to layout - table of length 128 bytes
1193
  * edx = pointer to layout - table of length 128 bytes
1193
Or:
1194
Or:
1194
  * ecx = 9
1195
  * ecx = 9
1195
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1196
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1196
Returned value:
1197
Returned value:
1197
  * eax = 0 - success
1198
  * eax = 0 - success
1198
  * eax = 1 - incorrect parameter
1199
  * eax = 1 - incorrect parameter
1199
Remarks:
1200
Remarks:
1200
  * If Alt is pressed, the layout with Alt is used;
1201
  * If Alt is pressed, the layout with Alt is used;
1201
    if Alt is not pressed, but Shift is pressed,
1202
    if Alt is not pressed, but Shift is pressed,
1202
    the layout with Shift is used;
1203
    the layout with Shift is used;
1203
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1204
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1204
    layout is used and then from the code is subtracted 0x60;
1205
    layout is used and then from the code is subtracted 0x60;
1205
    if no control key is pressed, the normal layout is used.
1206
    if no control key is pressed, the normal layout is used.
1206
  * To get layout and country identifier use
1207
  * To get layout and country identifier use
1207
    subfunction 2 of function 26.
1208
    subfunction 2 of function 26.
1208
  * Country identifier is global system variable, which is not used
1209
  * Country identifier is global system variable, which is not used
1209
    by the kernel itself; however the application '@panel' displays
1210
    by the kernel itself; however the application '@panel' displays
1210
    the corresponding icon.
1211
    the corresponding icon.
1211
  * The application @panel switches layouts on user request.
1212
  * The application @panel switches layouts on user request.
1212
 
1213
 
1213
======================================================================
1214
======================================================================
1214
============== Function 21, subfunction 3 - set CD base. =============
1215
============== Function 21, subfunction 3 - set CD base. =============
1215
======================================================================
1216
======================================================================
1216
Parameters:
1217
Parameters:
1217
  * eax = 21 - function number
1218
  * eax = 21 - function number
1218
  * ebx = 3 - subfunction number
1219
  * ebx = 3 - subfunction number
1219
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1220
  * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1220
Returned value:
1221
Returned value:
1221
  * eax = 0
1222
  * eax = 0
1222
Remarks:
1223
Remarks:
1223
  * CD base is used by function 24.
1224
  * CD base is used by function 24.
1224
  * To get CD base use subfunction 3 of function 26.
1225
  * To get CD base use subfunction 3 of function 26.
1225
 
1226
 
1226
======================================================================
1227
======================================================================
1227
========== Function 21, subfunction 5 - set system language. =========
1228
========== Function 21, subfunction 5 - set system language. =========
1228
======================================================================
1229
======================================================================
1229
Parameters:
1230
Parameters:
1230
  * eax = 21 - function number
1231
  * eax = 21 - function number
1231
  * ebx = 5 - subfunction number
1232
  * ebx = 5 - subfunction number
1232
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1233
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1233
Returned value:
1234
Returned value:
1234
  * eax = 0
1235
  * eax = 0
1235
Remarks:
1236
Remarks:
1236
  * System language is global system variable and is not used
1237
  * System language is global system variable and is not used
1237
    by the kernel itself, however application @panel draws the
1238
    by the kernel itself, however application @panel draws the
1238
    appropriate icon.
1239
    appropriate icon.
1239
  * Function does not check for correctness, as the kernel does not
1240
  * Function does not check for correctness, as the kernel does not
1240
    use this variable.
1241
    use this variable.
1241
  * To get system language use subfunction 5 of function 26.
1242
  * To get system language use subfunction 5 of function 26.
1242
 
1243
 
1243
======================================================================
1244
======================================================================
1244
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1245
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1245
======================================================================
1246
======================================================================
1246
Parameters:
1247
Parameters:
1247
  * eax = 21 - function number
1248
  * eax = 21 - function number
1248
  * ebx = 11 - subfunction number
1249
  * ebx = 11 - subfunction number
1249
  * ecx = 0/1 - disable/enable
1250
  * ecx = 0/1 - disable/enable
1250
Returned value:
1251
Returned value:
1251
  * eax = 0
1252
  * eax = 0
1252
Remarks:
1253
Remarks:
1253
  * Is used in LBA-read (subfunction 8 of function 58).
1254
  * Is used in LBA-read (subfunction 8 of function 58).
1254
  * The current implementation uses only low bit of ecx.
1255
  * The current implementation uses only low bit of ecx.
1255
  * To get current status use subfunction 11 of function 26.
1256
  * To get current status use subfunction 11 of function 26.
1256
 
1257
 
1257
======================================================================
1258
======================================================================
1258
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1259
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1259
======================================================================
1260
======================================================================
1260
Parameters:
1261
Parameters:
1261
  * eax = 21 - function number
1262
  * eax = 21 - function number
1262
  * ebx = 12 - subfunction number
1263
  * ebx = 12 - subfunction number
1263
  * ecx = 0/1 - disable/enable
1264
  * ecx = 0/1 - disable/enable
1264
Returned value:
1265
Returned value:
1265
  * eax = 0
1266
  * eax = 0
1266
Remarks:
1267
Remarks:
1267
  * Is used in operations with PCI bus (function 62).
1268
  * Is used in operations with PCI bus (function 62).
1268
  * The current implementation uses only low bit of ecx.
1269
  * The current implementation uses only low bit of ecx.
1269
  * To get current status use subfunction 12 of function 26.
1270
  * To get current status use subfunction 12 of function 26.
1270
 
1271
 
1271
======================================================================
1272
======================================================================
1272
============ Function 21, subfunction 13, subsubfunction 1 ===========
1273
============ Function 21, subfunction 13, subsubfunction 1 ===========
1273
======== Initialize + get information on the driver vmode.mdr. =======
1274
======== Initialize + get information on the driver vmode.mdr. =======
1274
======================================================================
1275
======================================================================
1275
Parameters:
1276
Parameters:
1276
  * eax = 21 - function number
1277
  * eax = 21 - function number
1277
  * ebx = 13 - subfunction number
1278
  * ebx = 13 - subfunction number
1278
  * ecx = 1 - number of the driver function
1279
  * ecx = 1 - number of the driver function
1279
  * edx = pointer to 512-bytes buffer
1280
  * edx = pointer to 512-bytes buffer
1280
Returned value:
1281
Returned value:
1281
  * if driver is not loaded
1282
  * if driver is not loaded
1282
    (never happens in the current implementation):
1283
    (never happens in the current implementation):
1283
    * eax = -1
1284
    * eax = -1
1284
    * ebx, ecx destroyed
1285
    * ebx, ecx destroyed
1285
  * if driver is loaded:
1286
  * if driver is loaded:
1286
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1287
    * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
1287
      - signature
1288
      - signature
1288
    * ebx = current frequency of the scanning (in Hz)
1289
    * ebx = current frequency of the scanning (in Hz)
1289
    * ecx destroyed
1290
    * ecx destroyed
1290
    * buffer pointed to by edx is filled
1291
    * buffer pointed to by edx is filled
1291
Format of the buffer:
1292
Format of the buffer:
1292
  * +0: 32*byte: driver name, "Trans VideoDriver"
1293
  * +0: 32*byte: driver name, "Trans VideoDriver"
1293
    (without quotes, supplemented by spaces)
1294
    (without quotes, supplemented by spaces)
1294
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1295
  * +32 = +0x20: dword: driver version (version x.y is encoded as
1295
    y*65536+x), for the current implementation is 1 (1.0)
1296
    y*65536+x), for the current implementation is 1 (1.0)
1296
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1297
  * +36 = +0x24: 7*dword: reserved (0 in the current implementation)
1297
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1298
  * +64 = +0x40: 32*word: list of supported videomodes (each word
1298
    is number of a videomode, after list itself there are zeroes)
1299
    is number of a videomode, after list itself there are zeroes)
1299
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1300
  * +128 = +0x80: 32*(5*word): list of supported frequences of the
1300
    scannings for videomodes: for each videomode listed in the
1301
    scannings for videomodes: for each videomode listed in the
1301
    previous field up to 5 supported frequences are given
1302
    previous field up to 5 supported frequences are given
1302
    (unused positions contain zeroes)
1303
    (unused positions contain zeroes)
1303
Remarks:
1304
Remarks:
1304
  * Function initializes the driver (if it is not initialized yet)
1305
  * Function initializes the driver (if it is not initialized yet)
1305
    and must be called first, before others (otherwise they will do
1306
    and must be called first, before others (otherwise they will do
1306
    nothing and return -1).
1307
    nothing and return -1).
1307
  * The current implementation supports only one frequency
1308
  * The current implementation supports only one frequency
1308
    of the scanning on videomode.
1309
    of the scanning on videomode.
1309
 
1310
 
1310
======================================================================
1311
======================================================================
1311
============ Function 21, subfunction 13, subsubfunction 2 ===========
1312
============ Function 21, subfunction 13, subsubfunction 2 ===========
1312
================ Get information on current videomode. ===============
1313
================ Get information on current videomode. ===============
1313
======================================================================
1314
======================================================================
1314
Parameters:
1315
Parameters:
1315
  * eax = 21 - function number
1316
  * eax = 21 - function number
1316
  * ebx = 13 - subfunction number
1317
  * ebx = 13 - subfunction number
1317
  * ecx = 2 - number of the driver function
1318
  * ecx = 2 - number of the driver function
1318
Returned value:
1319
Returned value:
1319
  * eax = -1 - driver is not loaded or not initialized;
1320
  * eax = -1 - driver is not loaded or not initialized;
1320
    ebx,ecx are destroyed
1321
    ebx,ecx are destroyed
1321
  * eax = [width]*65536 + [height]
1322
  * eax = [width]*65536 + [height]
1322
  * ebx = frequency of the vertical scanning (in Hz)
1323
  * ebx = frequency of the vertical scanning (in Hz)
1323
  * ecx = number of current videomode
1324
  * ecx = number of current videomode
1324
Remarks:
1325
Remarks:
1325
  * Driver must be initialized by call to
1326
  * Driver must be initialized by call to
1326
    driver function 1.
1327
    driver function 1.
1327
  * If only screen sizes are required, it is more expedient to use
1328
  * If only screen sizes are required, it is more expedient to use
1328
    function 14 taking into account that it
1329
    function 14 taking into account that it
1329
    returns sizes on 1 less.
1330
    returns sizes on 1 less.
1330
 
1331
 
1331
======================================================================
1332
======================================================================
1332
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1333
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
1333
======================================================================
1334
======================================================================
1334
Parameters:
1335
Parameters:
1335
  * eax = 21 - function number
1336
  * eax = 21 - function number
1336
  * ebx = 13 - subfunction number
1337
  * ebx = 13 - subfunction number
1337
  * ecx = 3 - number of the driver function
1338
  * ecx = 3 - number of the driver function
1338
  * edx = [scanning frequency]*65536 + [videomode number]
1339
  * edx = [scanning frequency]*65536 + [videomode number]
1339
Returned value:
1340
Returned value:
1340
  * eax = -1 - driver is not loaded, not initialized or
1341
  * eax = -1 - driver is not loaded, not initialized or
1341
    an error has occured
1342
    an error has occured
1342
  * eax = 0 - success
1343
  * eax = 0 - success
1343
  * ebx, ecx destroyed
1344
  * ebx, ecx destroyed
1344
Remarks:
1345
Remarks:
1345
  * Driver must be initialized by driver function 1.
1346
  * Driver must be initialized by driver function 1.
1346
  * The videomode number and frequency must be in the table
1347
  * The videomode number and frequency must be in the table
1347
    returned by driver function 1.
1348
    returned by driver function 1.
1348
 
1349
 
1349
======================================================================
1350
======================================================================
1350
============ Function 21, subfunction 13, subsubfunction 4 ===========
1351
============ Function 21, subfunction 13, subsubfunction 4 ===========
1351
================== Return to the initial videomode. ==================
1352
================== Return to the initial videomode. ==================
1352
======================================================================
1353
======================================================================
1353
Returns the screen to the videomode set at system boot.
1354
Returns the screen to the videomode set at system boot.
1354
Parameters:
1355
Parameters:
1355
  * eax = 21 - function number
1356
  * eax = 21 - function number
1356
  * ebx = 13 - subfunction number
1357
  * ebx = 13 - subfunction number
1357
  * ecx = 4 - number of the driver function
1358
  * ecx = 4 - number of the driver function
1358
Returned value:
1359
Returned value:
1359
  * eax = -1 - driver is not loaded or not initialized
1360
  * eax = -1 - driver is not loaded or not initialized
1360
  * eax = 0 - success
1361
  * eax = 0 - success
1361
  * ebx, ecx destroyed
1362
  * ebx, ecx destroyed
1362
Remarks:
1363
Remarks:
1363
  * Driver must be initialized by call to driver function 1.
1364
  * Driver must be initialized by call to driver function 1.
1364
 
1365
 
1365
======================================================================
1366
======================================================================
1366
============ Function 21, subfunction 13, subsubfunction 5 ===========
1367
============ Function 21, subfunction 13, subsubfunction 5 ===========
1367
===== Increase/decrease the size of the visible area of monitor. =====
1368
===== Increase/decrease the size of the visible area of monitor. =====
1368
======================================================================
1369
======================================================================
1369
Parameters:
1370
Parameters:
1370
  * eax = 21 - function number
1371
  * eax = 21 - function number
1371
  * ebx = 13 - subfunction number
1372
  * ebx = 13 - subfunction number
1372
  * ecx = 5 - number of the driver function
1373
  * ecx = 5 - number of the driver function
1373
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1374
  * edx = 0/1 - decrease/increase horizontal size on 1 position
1374
  * edx = 2/3 - is not supported in the current implementation;
1375
  * edx = 2/3 - is not supported in the current implementation;
1375
    is planned as decrease/increase vertical size on 1 position
1376
    is planned as decrease/increase vertical size on 1 position
1376
Returned value:
1377
Returned value:
1377
  * eax = -1 - driver is not loaded or not initialized
1378
  * eax = -1 - driver is not loaded or not initialized
1378
  * eax = 0 - success
1379
  * eax = 0 - success
1379
  * ebx, ecx destroyed
1380
  * ebx, ecx destroyed
1380
Remarks:
1381
Remarks:
1381
  * Driver must be initialized by call to driver function 1.
1382
  * Driver must be initialized by call to driver function 1.
1382
  * Function influences only the physical size of the screen image;
1383
  * Function influences only the physical size of the screen image;
1383
    the logical size (number of pixels) does not change.
1384
    the logical size (number of pixels) does not change.
1384
 
1385
 
1385
======================================================================
1386
======================================================================
1386
================= Function 22 - set system date/time. ================
1387
================= Function 22 - set system date/time. ================
1387
======================================================================
1388
======================================================================
1388
Parameters:
1389
Parameters:
1389
  * eax = 22 - function number
1390
  * eax = 22 - function number
1390
  * ebx = 0 - set time
1391
  * ebx = 0 - set time
1391
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1392
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1392
    * HH=hour 00..23
1393
    * HH=hour 00..23
1393
    * MM=minute 00..59
1394
    * MM=minute 00..59
1394
    * SS=second 00..59
1395
    * SS=second 00..59
1395
  * ebx = 1 - set date
1396
  * ebx = 1 - set date
1396
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1397
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1397
    * DD=day 01..31
1398
    * DD=day 01..31
1398
    * MM=month 01..12
1399
    * MM=month 01..12
1399
    * YY=year 00..99
1400
    * YY=year 00..99
1400
  * ebx = 2 - set day of week
1401
  * ebx = 2 - set day of week
1401
    * ecx = 1 for Sunday, ..., 7 for Saturday
1402
    * ecx = 1 for Sunday, ..., 7 for Saturday
1402
  * ebx = 3 - set alarm clock
1403
  * ebx = 3 - set alarm clock
1403
    * ecx = 0x00SSMMHH
1404
    * ecx = 0x00SSMMHH
1404
Returned value:
1405
Returned value:
1405
  * eax = 0 - success
1406
  * eax = 0 - success
1406
  * eax = 1 - incorrect parameter
1407
  * eax = 1 - incorrect parameter
1407
  * eax = 2 - CMOS-battery was unloaded
1408
  * eax = 2 - CMOS-battery was unloaded
1408
Remarks:
1409
Remarks:
1409
  * Value of installation of day of week seems to be doubtful,
1410
  * Value of installation of day of week seems to be doubtful,
1410
    as it a little where is used
1411
    as it a little where is used
1411
    (day of week can be calculated by date).
1412
    (day of week can be calculated by date).
1412
  * Alarm clock can be set on operation in the given time every day.
1413
  * Alarm clock can be set on operation in the given time every day.
1413
    But there is no existing system function to disable it.
1414
    But there is no existing system function to disable it.
1414
  * Operation of alarm clock consists in generation IRQ8.
1415
  * Operation of alarm clock consists in generation IRQ8.
1415
  * Generally CMOS supports for alarm clock set of value 0xFF
1416
  * Generally CMOS supports for alarm clock set of value 0xFF
1416
    as one of parameters and it means that the appropriate parameter
1417
    as one of parameters and it means that the appropriate parameter
1417
    is ignored. But current implementation does not allow this
1418
    is ignored. But current implementation does not allow this
1418
    (will return 1).
1419
    (will return 1).
1419
  * Alarm clock is a global system resource; the set of
1420
  * Alarm clock is a global system resource; the set of
1420
    an alarm clock cancels automatically the previous set.
1421
    an alarm clock cancels automatically the previous set.
1421
    However, at moment no program uses it.
1422
    However, at moment no program uses it.
1422
 
1423
 
1423
======================================================================
1424
======================================================================
1424
============= Function 23 - wait for event with timeout. =============
1425
============= Function 23 - wait for event with timeout. =============
1425
======================================================================
1426
======================================================================
1426
If the message queue is empty, waits for new message in the queue,
1427
If the message queue is empty, waits for new message in the queue,
1427
but no more than given time. Then reads out a message from the queue.
1428
but no more than given time. Then reads out a message from the queue.
1428
 
1429
 
1429
Parameters:
1430
Parameters:
1430
  * eax = 23 - function number
1431
  * eax = 23 - function number
1431
  * ebx = timeout (in 1/100 of second)
1432
  * ebx = timeout (in 1/100 of second)
1432
Returned value:
1433
Returned value:
1433
  * eax = 0 - the message queue is empty
1434
  * eax = 0 - the message queue is empty
1434
  * otherwise eax = event (see the list of events)
1435
  * otherwise eax = event (see the list of events)
1435
Remarks:
1436
Remarks:
1436
  * Only those events are taken into account, which enter into
1437
  * Only those events are taken into account, which enter into
1437
    the mask set by function 40. By default it is
1438
    the mask set by function 40. By default it is
1438
    redraw, key and button events.
1439
    redraw, key and button events.
1439
  * To check for presence of a message in the queue use function 11.
1440
  * To check for presence of a message in the queue use function 11.
1440
    To wait without timeout use function 10.
1441
    To wait without timeout use function 10.
1441
  * Transmission ebx=0 results in immediate returning eax=0.
1442
  * Transmission ebx=0 results in immediate returning eax=0.
1442
  * Current implementation returns immediately with eax=0,
1443
  * Current implementation returns immediately with eax=0,
1443
    if the addition of ebx with the current value of time counter
1444
    if the addition of ebx with the current value of time counter
1444
    makes 32-bit overflow.
1445
    makes 32-bit overflow.
1445
 
1446
 
1446
======================================================================
1447
======================================================================
1447
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1448
======== Function 24, subfunction 1 - begin to play CD-audio. ========
1448
======================================================================
1449
======================================================================
1449
Parameters:
1450
Parameters:
1450
  * eax = 24 - function number
1451
  * eax = 24 - function number
1451
  * ebx = 1 - subfunction number
1452
  * ebx = 1 - subfunction number
1452
  * ecx = 0x00FRSSMM, where
1453
  * ecx = 0x00FRSSMM, where
1453
    * MM = starting minute
1454
    * MM = starting minute
1454
    * SS = starting second
1455
    * SS = starting second
1455
    * FR = starting frame
1456
    * FR = starting frame
1456
Returned value:
1457
Returned value:
1457
  * eax = 0 - success
1458
  * eax = 0 - success
1458
  * eax = 1 - CD base is not defined
1459
  * eax = 1 - CD base is not defined
1459
Remarks:
1460
Remarks:
1460
  * Previously CD base must be defined by the call to
1461
  * Previously CD base must be defined by the call to
1461
    subfunction 3 of function 21.
1462
    subfunction 3 of function 21.
1462
  * One second includes 75 frames, one minute includes 60 seconds.
1463
  * One second includes 75 frames, one minute includes 60 seconds.
1463
  * The function is asynchronous (returns control, when play begins).
1464
  * The function is asynchronous (returns control, when play begins).
1464
 
1465
 
1465
======================================================================
1466
======================================================================
1466
======= Function 24, subfunction 2 - get information on tracks. ======
1467
======= Function 24, subfunction 2 - get information on tracks. ======
1467
======================================================================
1468
======================================================================
1468
Parameters:
1469
Parameters:
1469
  * eax = 24 - function number
1470
  * eax = 24 - function number
1470
  * ebx = 2 - subfunction number
1471
  * ebx = 2 - subfunction number
1471
  * ecx = pointer to the buffer for the table
1472
  * ecx = pointer to the buffer for the table
1472
    (maximum 8*64h+4 bytes=100 tracks)
1473
    (maximum 8*64h+4 bytes=100 tracks)
1473
Returned value:
1474
Returned value:
1474
  * eax = 0 - success
1475
  * eax = 0 - success
1475
  * eax = 1 - CD base is not defined
1476
  * eax = 1 - CD base is not defined
1476
Remarks:
1477
Remarks:
1477
  * The format of the table with tracks information is the same as
1478
  * The format of the table with tracks information is the same as
1478
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1479
    for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
1479
    Function returns addresses in MSF.
1480
    Function returns addresses in MSF.
1480
  * Previously CD base port must be set by call to
1481
  * Previously CD base port must be set by call to
1481
    subfunction 3 of function 21.
1482
    subfunction 3 of function 21.
1482
  * Function returns information only about no more than 100
1483
  * Function returns information only about no more than 100
1483
    first tracks. In most cases it is enough.
1484
    first tracks. In most cases it is enough.
1484
 
1485
 
1485
======================================================================
1486
======================================================================
1486
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1487
========== Function 24, subfunction 3 - stop play CD-audio. ==========
1487
======================================================================
1488
======================================================================
1488
Parameters:
1489
Parameters:
1489
  * eax = 24 - function number
1490
  * eax = 24 - function number
1490
  * ebx = 1 - subfunction number
1491
  * ebx = 1 - subfunction number
1491
Returned value:
1492
Returned value:
1492
  * eax = 0 - success
1493
  * eax = 0 - success
1493
  * eax = 1 - CD base is not defined
1494
  * eax = 1 - CD base is not defined
1494
Remarks:
1495
Remarks:
1495
  * Previously CD base port must be defined by call to
1496
  * Previously CD base port must be defined by call to
1496
    subfunction 3 of function 21.
1497
    subfunction 3 of function 21.
1497
 
1498
 
1498
======================================================================
1499
======================================================================
1499
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1500
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1500
======================================================================
1501
======================================================================
1501
Parameters:
1502
Parameters:
1502
  * eax = 24 - function number
1503
  * eax = 24 - function number
1503
  * ebx = 4 - subfunction number
1504
  * ebx = 4 - subfunction number
1504
  * ecx = position of CD/DVD-drive
1505
  * ecx = position of CD/DVD-drive
1505
      (from 0=Primary Master to 3=Secondary Slave)
1506
      (from 0=Primary Master to 3=Secondary Slave)
1506
Returned value:
1507
Returned value:
1507
  * function does not return value
1508
  * function does not return value
1508
Remarks:
1509
Remarks:
1509
  * The function is supported only for ATAPI devices (CD and DVD).
1510
  * The function is supported only for ATAPI devices (CD and DVD).
1510
  * When the tray is being ejected,
1511
  * When the tray is being ejected,
1511
    manual control of tray is unlocked.
1512
    manual control of tray is unlocked.
1512
  * When the tray is being ejected, the code clears the cache for
1513
  * When the tray is being ejected, the code clears the cache for
1513
    corresponding device.
1514
    corresponding device.
1514
  * An example of usage of the function is the application CD_tray.
1515
  * An example of usage of the function is the application CD_tray.
1515
 
1516
 
1516
======================================================================
1517
======================================================================
1517
======== Function 24, subfunction 5 - load tray of disk drive. =======
1518
======== Function 24, subfunction 5 - load tray of disk drive. =======
1518
======================================================================
1519
======================================================================
1519
Parameters:
1520
Parameters:
1520
  * eax = 24 - function number
1521
  * eax = 24 - function number
1521
  * ebx = 5 - subfunction number
1522
  * ebx = 5 - subfunction number
1522
  * ecx = position of CD/DVD-drive
1523
  * ecx = position of CD/DVD-drive
1523
      (from 0=Primary Master to 3=Secondary Slave)
1524
      (from 0=Primary Master to 3=Secondary Slave)
1524
Returned value:
1525
Returned value:
1525
  * function does not return value
1526
  * function does not return value
1526
Remarks:
1527
Remarks:
1527
  * The function is supported only for ATAPI devices (CD and DVD).
1528
  * The function is supported only for ATAPI devices (CD and DVD).
1528
  * An example of usage of the function is the application CD_tray.
1529
  * An example of usage of the function is the application CD_tray.
1529
 
1530
 
1530
======================================================================
1531
======================================================================
1531
======= Function 25 - put image area on the background layer. ========
1532
======= Function 25 - put image area on the background layer. ========
1532
======================================================================
1533
======================================================================
1533
Paramters:
1534
Paramters:
1534
  * eax = 25 - function number
1535
  * eax = 25 - function number
1535
  * ebx = pointer to the previously allocated memory area,
1536
  * ebx = pointer to the previously allocated memory area,
1536
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1537
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1537
  * ecx = [size on axis x]*65536 + [size on axis y]
1538
  * ecx = [size on axis x]*65536 + [size on axis y]
1538
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1539
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1539
Returned value:
1540
Returned value:
1540
  * function does not return value
1541
  * function does not return value
1541
Remarks:
1542
Remarks:
1542
  * Coordinates of the image are coordinates of the upper left corner
1543
  * Coordinates of the image are coordinates of the upper left corner
1543
    of the image relative to the screen.
1544
    of the image relative to the screen.
1544
  * Size of the image in bytes is 4*xsize*ysize
1545
  * Size of the image in bytes is 4*xsize*ysize
1545
  * TT - byte pointer of transparency, at current version:
1546
  * TT - byte pointer of transparency, at current version:
1546
         1 to FF - opaque, 0 - transparent.
1547
         1 to FF - opaque, 0 - transparent.
1547
  * The function places the image directly to LFB. It is not for
1548
  * The function places the image directly to LFB. It is not for
1548
    background image f.15. Options f.15 to f.25 does not make sense.
1549
    background image f.15. Options f.15 to f.25 does not make sense.
1549
 
1550
 
1550
======================================================================
1551
======================================================================
1551
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1552
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1552
======================================================================
1553
======================================================================
1553
Parameters:
1554
Parameters:
1554
  * eax = 26 - function number
1555
  * eax = 26 - function number
1555
  * ebx = 1 - subfunction number
1556
  * ebx = 1 - subfunction number
1556
Returned value:
1557
Returned value:
1557
  * eax = port number
1558
  * eax = port number
1558
Parameters:
1559
Parameters:
1559
  * To set base port use subfunction 1 of function 21.
1560
  * To set base port use subfunction 1 of function 21.
1560
 
1561
 
1561
======================================================================
1562
======================================================================
1562
========== Function 26, subfunction 2 - get keyboard layout. =========
1563
========== Function 26, subfunction 2 - get keyboard layout. =========
1563
======================================================================
1564
======================================================================
1564
The keyboard layout is used to convert keyboard scancodes to
1565
The keyboard layout is used to convert keyboard scancodes to
1565
ASCII-codes for function 2.
1566
ASCII-codes for function 2.
1566
Parameters:
1567
Parameters:
1567
  * eax = 26 - function number
1568
  * eax = 26 - function number
1568
  * ebx = 2 - subfunction number
1569
  * ebx = 2 - subfunction number
1569
  * ecx = what layout to get:
1570
  * ecx = what layout to get:
1570
    * 1 = normal layout
1571
    * 1 = normal layout
1571
    * 2 = layout with pressed Shift
1572
    * 2 = layout with pressed Shift
1572
    * 3 = layout with pressed Alt
1573
    * 3 = layout with pressed Alt
1573
  * edx = pointer to the 128-bytes buffer, where the layout will be
1574
  * edx = pointer to the 128-bytes buffer, where the layout will be
1574
    copied
1575
    copied
1575
Returned value:
1576
Returned value:
1576
  * function does not return value
1577
  * function does not return value
1577
Or:
1578
Or:
1578
  * eax = 26 - function number
1579
  * eax = 26 - function number
1579
  * ebx = 2 - subfunction number
1580
  * ebx = 2 - subfunction number
1580
  * ecx = 9
1581
  * ecx = 9
1581
Returned value:
1582
Returned value:
1582
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1583
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1583
Remarks:
1584
Remarks:
1584
  * If Alt is pressed, the layout with Alt is used;
1585
  * If Alt is pressed, the layout with Alt is used;
1585
    if Alt is not pressed, but Shift is pressed,
1586
    if Alt is not pressed, but Shift is pressed,
1586
    the layout with Shift is used;
1587
    the layout with Shift is used;
1587
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1588
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1588
    layout is used and then from the code is subtracted 0x60;
1589
    layout is used and then from the code is subtracted 0x60;
1589
    if no control key is pressed, the normal layout is used.
1590
    if no control key is pressed, the normal layout is used.
1590
  * To set layout and country identifier use
1591
  * To set layout and country identifier use
1591
    subfunction 2 of function 21.
1592
    subfunction 2 of function 21.
1592
  * Country identifier is global system variable, which is not used
1593
  * Country identifier is global system variable, which is not used
1593
    by the kernel itself; however the application '@panel' displays
1594
    by the kernel itself; however the application '@panel' displays
1594
    the corresponding icon (using this function).
1595
    the corresponding icon (using this function).
1595
  * The application @panel switches layouts on user request.
1596
  * The application @panel switches layouts on user request.
1596
 
1597
 
1597
======================================================================
1598
======================================================================
1598
============== Function 26, subfunction 3 - get CD base. =============
1599
============== Function 26, subfunction 3 - get CD base. =============
1599
======================================================================
1600
======================================================================
1600
Parameters:
1601
Parameters:
1601
  * eax = 26 - function number
1602
  * eax = 26 - function number
1602
  * ebx = 3 - subfunction number
1603
  * ebx = 3 - subfunction number
1603
Returned value:
1604
Returned value:
1604
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1605
  * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
1605
Remarks:
1606
Remarks:
1606
  * CD base is used by function 24.
1607
  * CD base is used by function 24.
1607
  * To set CD base use subfunction 3 of function 21.
1608
  * To set CD base use subfunction 3 of function 21.
1608
 
1609
 
1609
======================================================================
1610
======================================================================
1610
========== Function 26, subfunction 5 - get system language. =========
1611
========== Function 26, subfunction 5 - get system language. =========
1611
======================================================================
1612
======================================================================
1612
Parameters:
1613
Parameters:
1613
  * eax = 26 - function number
1614
  * eax = 26 - function number
1614
  * ebx = 5 - subfunction number
1615
  * ebx = 5 - subfunction number
1615
Returned value:
1616
Returned value:
1616
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1617
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1617
Remarks:
1618
Remarks:
1618
  * System language is global system variable and is not used
1619
  * System language is global system variable and is not used
1619
    by the kernel itself, however application @panel draws the
1620
    by the kernel itself, however application @panel draws the
1620
    appropriate icon (using this function).
1621
    appropriate icon (using this function).
1621
  * To set system language use subfunction 5 of function 21.
1622
  * To set system language use subfunction 5 of function 21.
1622
 
1623
 
1623
======================================================================
1624
======================================================================
1624
=== Function 26, subfunction 9 - get the value of the time counter. ==
1625
=== Function 26, subfunction 9 - get the value of the time counter. ==
1625
======================================================================
1626
======================================================================
1626
Parameters:
1627
Parameters:
1627
  * eax = 26 - function number
1628
  * eax = 26 - function number
1628
  * ebx = 9 - subfunction number
1629
  * ebx = 9 - subfunction number
1629
Returned value:
1630
Returned value:
1630
  * eax = number of 1/100s of second, past from the system boot time
1631
  * eax = number of 1/100s of second, past from the system boot time
1631
Remarks:
1632
Remarks:
1632
  * Counter takes modulo 2^32, that correspond to a little more
1633
  * Counter takes modulo 2^32, that correspond to a little more
1633
    than 497 days.
1634
    than 497 days.
1634
  * To get system time use function 3.
1635
  * To get system time use function 3.
1635
 
1636
 
1636
======================================================================
1637
======================================================================
1637
===================== Function 26, subfunction 11 ====================
1638
===================== Function 26, subfunction 11 ====================
1638
========== Find out whether low-level HD access is enabled. ==========
1639
========== Find out whether low-level HD access is enabled. ==========
1639
======================================================================
1640
======================================================================
1640
Parameters:
1641
Parameters:
1641
  * eax = 26 - function number
1642
  * eax = 26 - function number
1642
  * ebx = 11 - subfunction number
1643
  * ebx = 11 - subfunction number
1643
Returned value:
1644
Returned value:
1644
  * eax = 0/1 - disabled/enabled
1645
  * eax = 0/1 - disabled/enabled
1645
Remarks:
1646
Remarks:
1646
  * Is used in LBA read (subfunction 8 of function 58).
1647
  * Is used in LBA read (subfunction 8 of function 58).
1647
  * To set current state use subfunction 11 of function 21.
1648
  * To set current state use subfunction 11 of function 21.
1648
 
1649
 
1649
======================================================================
1650
======================================================================
1650
===================== Function 26, subfunction 12 ====================
1651
===================== Function 26, subfunction 12 ====================
1651
========== Find out whether low-level PCI access is enabled. =========
1652
========== Find out whether low-level PCI access is enabled. =========
1652
======================================================================
1653
======================================================================
1653
Parameters:
1654
Parameters:
1654
  * eax = 26 - function number
1655
  * eax = 26 - function number
1655
  * ebx = 12 - subfunction number
1656
  * ebx = 12 - subfunction number
1656
Returned value:
1657
Returned value:
1657
  * eax = 0/1 - disabled/enabled
1658
  * eax = 0/1 - disabled/enabled
1658
Remarks:
1659
Remarks:
1659
  * Is used by operations with PCI bus (function 62).
1660
  * Is used by operations with PCI bus (function 62).
1660
  * The current implementation uses only low bit of ecx.
1661
  * The current implementation uses only low bit of ecx.
1661
  * To set the current state use subfunction 12 of function 21.
1662
  * To set the current state use subfunction 12 of function 21.
1662
 
1663
 
1663
======================================================================
1664
======================================================================
1664
=================== Function 29 - get system date. ===================
1665
=================== Function 29 - get system date. ===================
1665
======================================================================
1666
======================================================================
1666
Parameters:
1667
Parameters:
1667
  * eax = 29 - function number
1668
  * eax = 29 - function number
1668
Returned value:
1669
Returned value:
1669
  * eax = 0x00DDMMYY, where
1670
  * eax = 0x00DDMMYY, where
1670
    (binary-decimal coding, BCD, is used)
1671
    (binary-decimal coding, BCD, is used)
1671
  * YY = two low digits of year (00..99)
1672
  * YY = two low digits of year (00..99)
1672
  * MM = month (01..12)
1673
  * MM = month (01..12)
1673
  * DD = day (01..31)
1674
  * DD = day (01..31)
1674
Remarks:
1675
Remarks:
1675
  * To set system date use function 22.
1676
  * To set system date use function 22.
1676
 
1677
 
1677
======================================================================
1678
======================================================================
1678
============= Function 30 - work with the current folder. ============
1679
============= Function 30 - work with the current folder. ============
1679
======================================================================
1680
======================================================================
1680
 
1681
 
1681
--------- Subfunction 1 - set current folder for the thread. ---------
1682
--------- Subfunction 1 - set current folder for the thread. ---------
1682
Parameters:
1683
Parameters:
1683
  * eax = 30 - function number
1684
  * eax = 30 - function number
1684
  * ebx = 1 - subfunction number
1685
  * ebx = 1 - subfunction number
1685
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1686
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1686
Returned value:
1687
Returned value:
1687
  * function does not return value
1688
  * function does not return value
1688
 
1689
 
1689
--------- Subfunction 2 - get current folder for the thread. ---------
1690
--------- Subfunction 2 - get current folder for the thread. ---------
1690
Parameters:
1691
Parameters:
1691
  * eax = 30 - function number
1692
  * eax = 30 - function number
1692
  * ebx = 2 - subfunction number
1693
  * ebx = 2 - subfunction number
1693
  * ecx = pointer to buffer
1694
  * ecx = pointer to buffer
1694
  * edx = size of buffer
1695
  * edx = size of buffer
1695
Returned value:
1696
Returned value:
1696
  * eax = size of the current folder's name (including terminating 0)
1697
  * eax = size of the current folder's name (including terminating 0)
1697
Remarks:
1698
Remarks:
1698
  * If the buffer is too small to hold all data, only first (edx-1)
1699
  * If the buffer is too small to hold all data, only first (edx-1)
1699
    bytes are copied and than terminating 0 is inserted.
1700
    bytes are copied and than terminating 0 is inserted.
1700
  * By default, current folder for the thread is "/rd/1".
1701
  * By default, current folder for the thread is "/rd/1".
1701
  * At process/thread creation the current folder will be inherited
1702
  * At process/thread creation the current folder will be inherited
1702
    from the parent.
1703
    from the parent.
1703
 
1704
 
1704
--- Subfunction 3 - install the add.system directory for the kernel --
1705
--- Subfunction 3 - install the add.system directory for the kernel --
1705
Parameters:
1706
Parameters:
1706
  * eax = 30 - function number
1707
  * eax = 30 - function number
1707
  * ebx = 3 - subfunction number
1708
  * ebx = 3 - subfunction number
1708
  * ecx = pointer to a block of data:
1709
  * ecx = pointer to a block of data:
1709
          sysdir_name     rb 64
1710
          sysdir_name     rb 64
1710
          sysdir_path     rb 64
1711
          sysdir_path     rb 64
1711
For example:
1712
For example:
1712
dir_name1       db 'KolibriOS',0
1713
dir_name1       db 'KolibriOS',0
1713
                rb 64-10
1714
                rb 64-10
1714
dir_path1       db 'HD0/1',0
1715
dir_path1       db 'HD0/1',0
1715
                rb 64-6
1716
                rb 64-6
1716
Returned value:
1717
Returned value:
1717
  * function does not return value
1718
  * function does not return value
1718
Remarks:
1719
Remarks:
1719
  * The function can be called only 1 time for 1 session of the OS.
1720
  * The function can be called only 1 time for 1 session of the OS.
1720
 
1721
 
1721
======================================================================
1722
======================================================================
1722
========= Function 34 - who owner the pixel on the screen. ===========
1723
========= Function 34 - who owner the pixel on the screen. ===========
1723
======================================================================
1724
======================================================================
1724
Parameters:
1725
Parameters:
1725
  * eax = 34 - function number
1726
  * eax = 34 - function number
1726
  * ebx = x-coordinate (relative to the display)
1727
  * ebx = x-coordinate (relative to the display)
1727
  * ecx = y-coordinate (relative to the display)
1728
  * ecx = y-coordinate (relative to the display)
1728
 
1729
 
1729
Returned value:
1730
Returned value:
1730
  * eax = 0x000000XX - owner of pixel the slot window N
1731
  * eax = 0x000000XX - owner of pixel the slot window N
1731
    If incorrect values ebx and ecx then function returns 0
1732
    If incorrect values ebx and ecx then function returns 0
1732
  * The function takes the value from the area [_WinMapAddress]
1733
  * The function takes the value from the area [_WinMapAddress]
1733
 
1734
 
1734
======================================================================
1735
======================================================================
1735
======= Function 35 - read the color of a pixel on the screen. =======
1736
======= Function 35 - read the color of a pixel on the screen. =======
1736
======================================================================
1737
======================================================================
1737
Parameters:
1738
Parameters:
1738
  * eax = 35
1739
  * eax = 35
1739
  * ebx = y*xsize+x, where
1740
  * ebx = y*xsize+x, where
1740
  * (x,y) = coordinates of a pixel (beginning from 0)
1741
  * (x,y) = coordinates of a pixel (beginning from 0)
1741
  * xsize = horizontal screen size
1742
  * xsize = horizontal screen size
1742
Returned value:
1743
Returned value:
1743
  * eax = color 0x00RRGGBB
1744
  * eax = color 0x00RRGGBB
1744
Remarks:
1745
Remarks:
1745
  * To get screen sizes use function 14. Pay attention,
1746
  * To get screen sizes use function 14. Pay attention,
1746
    that it subtracts 1 from both sizes.
1747
    that it subtracts 1 from both sizes.
1747
  * There is also direct access (without any system calls)
1748
  * There is also direct access (without any system calls)
1748
    to videomemory through the selector gs. To get parameters of
1749
    to videomemory through the selector gs. To get parameters of
1749
    the current videomode, use function 61.
1750
    the current videomode, use function 61.
1750
 
1751
 
1751
======================================================================
1752
======================================================================
1752
=================== Function 36 - read screen area. ==================
1753
=================== Function 36 - read screen area. ==================
1753
======================================================================
1754
======================================================================
1754
Paramters:
1755
Paramters:
1755
  * eax = 36 - function number
1756
  * eax = 36 - function number
1756
  * ebx = pointer to the previously allocated memory area,
1757
  * ebx = pointer to the previously allocated memory area,
1757
        where will be placed the image in the format BBGGRRBBGGRR...
1758
        where will be placed the image in the format BBGGRRBBGGRR...
1758
  * ecx = [size on axis x]*65536 + [size on axis y]
1759
  * ecx = [size on axis x]*65536 + [size on axis y]
1759
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1760
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1760
Returned value:
1761
Returned value:
1761
  * function does not return value
1762
  * function does not return value
1762
Remarks:
1763
Remarks:
1763
  * Coordinates of the image are coordinates of the upper left corner
1764
  * Coordinates of the image are coordinates of the upper left corner
1764
    of the image relative to the screen.
1765
    of the image relative to the screen.
1765
  * Size of the image in bytes is 3*xsize*ysize.
1766
  * Size of the image in bytes is 3*xsize*ysize.
1766
 
1767
 
1767
======================================================================
1768
======================================================================
1768
=================== Function 37 - work with mouse. ===================
1769
=================== Function 37 - work with mouse. ===================
1769
======================================================================
1770
======================================================================
1770
 
1771
 
1771
---------- Subfunction 0 - screen coordinates of the mouse -----------
1772
---------- Subfunction 0 - screen coordinates of the mouse -----------
1772
Parameters:
1773
Parameters:
1773
  * eax = 37 - function number
1774
  * eax = 37 - function number
1774
  * ebx = 0 - subfunction number
1775
  * ebx = 0 - subfunction number
1775
Returned value:
1776
Returned value:
1776
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1777
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1777
    (beginning from 0)
1778
    (beginning from 0)
1778
 
1779
 
1779
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1780
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1780
Parameters:
1781
Parameters:
1781
  * eax = 37 - function number
1782
  * eax = 37 - function number
1782
  * ebx = 1 - subfunction number
1783
  * ebx = 1 - subfunction number
1783
Returned value:
1784
Returned value:
1784
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1785
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1785
    relative to the application window (beginning from 0)
1786
    relative to the application window (beginning from 0)
1786
Remarks:
1787
Remarks:
1787
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1788
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1788
    If y>=ywnd, the low word is non-negative and contains
1789
    If y>=ywnd, the low word is non-negative and contains
1789
    relative y-coordinate, and the high word - relative x-coordinate
1790
    relative y-coordinate, and the high word - relative x-coordinate
1790
    (with correct sign). Otherwise the low word is negative and still
1791
    (with correct sign). Otherwise the low word is negative and still
1791
    contains relative y-coordinate, and to the high word
1792
    contains relative y-coordinate, and to the high word
1792
    1 should be added.
1793
    1 should be added.
1793
 
1794
 
1794
------------ Subfunction 2 - pressed buttons of the mouse ------------
1795
------------ Subfunction 2 - pressed buttons of the mouse ------------
1795
Parameters:
1796
Parameters:
1796
  * eax = 37 - function number
1797
  * eax = 37 - function number
1797
  * ebx = 2 - subfunction number
1798
  * ebx = 2 - subfunction number
1798
Returned value:
1799
Returned value:
1799
  * eax contains information on the pressed mouse buttons:
1800
  * eax contains information on the pressed mouse buttons:
1800
  * bit 0 is set = left button is pressed
1801
  * bit 0 is set = left button is pressed
1801
  * bit 1 is set = right button is pressed
1802
  * bit 1 is set = right button is pressed
1802
  * bit 2 is set = middle button is pressed
1803
  * bit 2 is set = middle button is pressed
1803
  * bit 3 is set = 4th button is pressed
1804
  * bit 3 is set = 4th button is pressed
1804
  * bit 4 is set = 5th button is pressed
1805
  * bit 4 is set = 5th button is pressed
1805
  * other bits are cleared
1806
  * other bits are cleared
1806
 
1807
 
1807
-------------------- Subfunction 4 - load cursor ---------------------
1808
-------------------- Subfunction 4 - load cursor ---------------------
1808
Parameters:
1809
Parameters:
1809
  * eax = 37 - function number
1810
  * eax = 37 - function number
1810
  * ebx = 4 - subfunction number
1811
  * ebx = 4 - subfunction number
1811
  * dx = data source:
1812
  * dx = data source:
1812
  * dx = LOAD_FROM_FILE = 0 - data in a file
1813
  * dx = LOAD_FROM_FILE = 0 - data in a file
1813
    * ecx = pointer to full path to the cursor file
1814
    * ecx = pointer to full path to the cursor file
1814
    * the file must be in the format .cur, which is standard for
1815
    * the file must be in the format .cur, which is standard for
1815
      MS Windows, at that of the size 32*32 pixels
1816
      MS Windows, at that of the size 32*32 pixels
1816
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1817
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1817
    * ecx = pointer to data of the cursor file
1818
    * ecx = pointer to data of the cursor file
1818
    * the data format is the same as in the previous case
1819
    * the data format is the same as in the previous case
1819
  * dx = LOAD_INDIRECT = 2 - data in memory
1820
  * dx = LOAD_INDIRECT = 2 - data in memory
1820
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1821
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1821
    * edx = 0xXXYY0002, where
1822
    * edx = 0xXXYY0002, where
1822
      * XX = x-coordinate of cursor hotspot
1823
      * XX = x-coordinate of cursor hotspot
1823
      * YY = y-coordinate
1824
      * YY = y-coordinate
1824
      * 0 <= XX, YY <= 31
1825
      * 0 <= XX, YY <= 31
1825
Returned value:
1826
Returned value:
1826
  * eax = 0 - failed
1827
  * eax = 0 - failed
1827
  * otherwise eax = cursor handle
1828
  * otherwise eax = cursor handle
1828
 
1829
 
1829
--------------------- Subfunction 5 - set cursor ---------------------
1830
--------------------- Subfunction 5 - set cursor ---------------------
1830
Sets new cursor for the window of the current thread.
1831
Sets new cursor for the window of the current thread.
1831
Parameters:
1832
Parameters:
1832
  * eax = 37 - function number
1833
  * eax = 37 - function number
1833
  * ebx = 5 - subfunction number
1834
  * ebx = 5 - subfunction number
1834
  * ecx = cursor handle
1835
  * ecx = cursor handle
1835
Returned value:
1836
Returned value:
1836
  * eax = handle of previous cursor
1837
  * eax = handle of previous cursor
1837
Remarks:
1838
Remarks:
1838
  * If the handle is incorrect, the function restores the default
1839
  * If the handle is incorrect, the function restores the default
1839
    cursor (standard arrow). In particular, ecx=0 restores it.
1840
    cursor (standard arrow). In particular, ecx=0 restores it.
1840
 
1841
 
1841
------------------- Subfunction 6 - delete cursor --------------------
1842
------------------- Subfunction 6 - delete cursor --------------------
1842
Parameters:
1843
Parameters:
1843
  * eax = 37 - function number
1844
  * eax = 37 - function number
1844
  * ebx = 6 - subfunction number
1845
  * ebx = 6 - subfunction number
1845
  * ecx = cursor handle
1846
  * ecx = cursor handle
1846
Returned value:
1847
Returned value:
1847
  * eax destroyed
1848
  * eax destroyed
1848
Remarks:
1849
Remarks:
1849
  * The cursor must be loaded previously by the current thread
1850
  * The cursor must be loaded previously by the current thread
1850
    (with the call to subfunction 4). The function does not delete
1851
    (with the call to subfunction 4). The function does not delete
1851
    system cursors and cursors, loaded by another applications.
1852
    system cursors and cursors, loaded by another applications.
1852
  * If the active cursor (set by subfunction 5) is deleted,
1853
  * If the active cursor (set by subfunction 5) is deleted,
1853
    the system restores the default cursor (standard arrow).
1854
    the system restores the default cursor (standard arrow).
1854
 
1855
 
1855
------------------ Subfunction 7 - get scroll data -------------------
1856
------------------ Subfunction 7 - get scroll data -------------------
1856
Parameters:
1857
Parameters:
1857
  * eax = 37 - function number
1858
  * eax = 37 - function number
1858
  * ebx = 7 - subfunction number
1859
  * ebx = 7 - subfunction number
1859
Returned value:
1860
Returned value:
1860
  * eax = [horizontal offset]*65536 + [vertical offset]
1861
  * eax = [horizontal offset]*65536 + [vertical offset]
1861
Remarks:
1862
Remarks:
1862
  * Scroll data is available for active window only.
1863
  * Scroll data is available for active window only.
1863
  * Values are zeroed after reading.
1864
  * Values are zeroed after reading.
1864
  * Values are signed.
1865
  * Values are signed.
1865
 
1866
 
1866
======================================================================
1867
======================================================================
1867
====================== Function 38 - draw line. ======================
1868
====================== Function 38 - draw line. ======================
1868
======================================================================
1869
======================================================================
1869
Parameters:
1870
Parameters:
1870
  * eax = 38 - function number
1871
  * eax = 38 - function number
1871
  * ebx = [start coordinate on axis x]*65536 +
1872
  * ebx = [start coordinate on axis x]*65536 +
1872
              [end coordinate on axis x]
1873
              [end coordinate on axis x]
1873
  * ecx = [start coordinate on axis y]*65536 +
1874
  * ecx = [start coordinate on axis y]*65536 +
1874
              [end coordinate on axis y]
1875
              [end coordinate on axis y]
1875
  * edx = 0x00RRGGBB - color
1876
  * edx = 0x00RRGGBB - color
1876
    edx = 0x01xxxxxx - draw inversed line
1877
    edx = 0x01xxxxxx - draw inversed line
1877
          (low 24 bits are ignored)
1878
          (low 24 bits are ignored)
1878
Returned value:
1879
Returned value:
1879
  * function does not return value
1880
  * function does not return value
1880
Remarks:
1881
Remarks:
1881
  * Coordinates are relative to the window.
1882
  * Coordinates are relative to the window.
1882
  * End point is also drawn.
1883
  * End point is also drawn.
1883
 
1884
 
1884
======================================================================
1885
======================================================================
1885
== Function 39, subfunction 1 - get a size of the background image. ==
1886
== Function 39, subfunction 1 - get a size of the background image. ==
1886
======================================================================
1887
======================================================================
1887
Parameters:
1888
Parameters:
1888
  * eax = 39 - function number
1889
  * eax = 39 - function number
1889
  * ebx = 1 - subfunction number
1890
  * ebx = 1 - subfunction number
1890
Returned value:
1891
Returned value:
1891
  * eax = [width]*65536 + [height]
1892
  * eax = [width]*65536 + [height]
1892
Remarks:
1893
Remarks:
1893
  * There is a pair function to set sizes of background image -
1894
  * There is a pair function to set sizes of background image -
1894
    subfunction 1 of function 15. After which it is necessary,
1895
    subfunction 1 of function 15. After which it is necessary,
1895
    of course, anew to define image.
1896
    of course, anew to define image.
1896
 
1897
 
1897
======================================================================
1898
======================================================================
1898
== Function 39, subfunction 2 - get pixel from the background image. =
1899
== Function 39, subfunction 2 - get pixel from the background image. =
1899
======================================================================
1900
======================================================================
1900
Parameters:
1901
Parameters:
1901
  * eax = 39 - function number
1902
  * eax = 39 - function number
1902
  * ebx = 2 - subfunction number
1903
  * ebx = 2 - subfunction number
1903
  * ecx = offset
1904
  * ecx = offset
1904
Returned value:
1905
Returned value:
1905
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1906
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1906
    (less than 0x160000-16)
1907
    (less than 0x160000-16)
1907
  * eax = 2 otherwise
1908
  * eax = 2 otherwise
1908
Remarks:
1909
Remarks:
1909
  * Do not rely on returned value for invalid offsets, it may be
1910
  * Do not rely on returned value for invalid offsets, it may be
1910
    changed in future kernel versions.
1911
    changed in future kernel versions.
1911
  * Offset for pixel with coordinates (x,y)
1912
  * Offset for pixel with coordinates (x,y)
1912
    is calculated as (x+y*xsize)*3.
1913
    is calculated as (x+y*xsize)*3.
1913
  * There is a pair function to set pixel on the background image -
1914
  * There is a pair function to set pixel on the background image -
1914
    subfunction 2 of function 15.
1915
    subfunction 2 of function 15.
1915
 
1916
 
1916
======================================================================
1917
======================================================================
1917
== Function 39, subfunction 4 - get drawing mode for the background. =
1918
== Function 39, subfunction 4 - get drawing mode for the background. =
1918
======================================================================
1919
======================================================================
1919
Parameters:
1920
Parameters:
1920
  * eax = 39 - function number
1921
  * eax = 39 - function number
1921
  * ebx = 4 - subfunction number
1922
  * ebx = 4 - subfunction number
1922
Returned value:
1923
Returned value:
1923
  * eax = 1 - tile
1924
  * eax = 1 - tile
1924
  * eax = 2 - stretch
1925
  * eax = 2 - stretch
1925
Remarks:
1926
Remarks:
1926
  * There is a pair function to set drawing mode -
1927
  * There is a pair function to set drawing mode -
1927
    subfunction 4 of function 15.
1928
    subfunction 4 of function 15.
1928
 
1929
 
1929
======================================================================
1930
======================================================================
1930
=========== Function 40 - set the mask for expected events. ==========
1931
=========== Function 40 - set the mask for expected events. ==========
1931
======================================================================
1932
======================================================================
1932
The mask for expected events affects function working with events
1933
The mask for expected events affects function working with events
1933
10, 11, 23 - they notify only about events allowed by this mask.
1934
10, 11, 23 - they notify only about events allowed by this mask.
1934
Parameters:
1935
Parameters:
1935
  * eax = 40 - function number
1936
  * eax = 40 - function number
1936
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1937
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1937
    (set bit permits notice on event)
1938
    (set bit permits notice on event)
1938
    bit 31: mouse active/inactive filter
1939
    bit 31: mouse active/inactive filter
1939
    bit 31 = 0 - inactive window receive mouse events
1940
    bit 31 = 0 - inactive window receive mouse events
1940
    bit 31 = 1 - inactive window does not receive mouse events
1941
    bit 31 = 1 - inactive window does not receive mouse events
1941
    bit 30: cursor position filter
1942
    bit 30: cursor position filter
1942
    bit 30 = 0 = the window receive mouse events if cursor
1943
    bit 30 = 0 = the window receive mouse events if cursor
1943
                 outside window
1944
                 outside window
1944
    bit 30 = 1 - the window does not receive mouse events if cursor
1945
    bit 30 = 1 - the window does not receive mouse events if cursor
1945
                 outside window
1946
                 outside window
1946
Returned value:
1947
Returned value:
1947
  * eax = previous value of mask
1948
  * eax = previous value of mask
1948
Remarks:
1949
Remarks:
1949
  * Default mask (7=111b) enables nofices about redraw,
1950
  * Default mask (7=111b) enables nofices about redraw,
1950
    keys and buttons. This is enough for many applications.
1951
    keys and buttons. This is enough for many applications.
1951
  * Events prohibited in the mask are saved anyway, when come;
1952
  * Events prohibited in the mask are saved anyway, when come;
1952
    they are simply not informed with event functions.
1953
    they are simply not informed with event functions.
1953
  * Event functions take into account the mask on moment of
1954
  * Event functions take into account the mask on moment of
1954
    function call, not on moment of event arrival.
1955
    function call, not on moment of event arrival.
1955
 
1956
 
1956
 
1957
 
1957
======================================================================
1958
======================================================================
1958
================ Function 43 - input/output to a port. ===============
1959
================ Function 43 - input/output to a port. ===============
1959
======================================================================
1960
======================================================================
1960
 
1961
 
1961
------------------------ Output data to port -------------------------
1962
------------------------ Output data to port -------------------------
1962
Parameters:
1963
Parameters:
1963
  * eax = 43 - function number
1964
  * eax = 43 - function number
1964
  * bl = byte for output
1965
  * bl = byte for output
1965
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1966
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
1966
Returned value:
1967
Returned value:
1967
  * eax = 0 - success
1968
  * eax = 0 - success
1968
  * eax = 1 - the thread has not reserved the selected port
1969
  * eax = 1 - the thread has not reserved the selected port
1969
 
1970
 
1970
------------------------ Input data from port ------------------------
1971
------------------------ Input data from port ------------------------
1971
Parameters:
1972
Parameters:
1972
  * eax = 43 - function number
1973
  * eax = 43 - function number
1973
  * ebx is ignored
1974
  * ebx is ignored
1974
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1975
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
1975
Returned value:
1976
Returned value:
1976
  * eax = 0 - success, thus ebx = entered byte
1977
  * eax = 0 - success, thus ebx = entered byte
1977
  * eax = 1 - the thread has not reserved the selected port
1978
  * eax = 1 - the thread has not reserved the selected port
1978
Remarks:
1979
Remarks:
1979
  * Previously the thread must reserve the selected port
1980
  * Previously the thread must reserve the selected port
1980
    for itself by function 46.
1981
    for itself by function 46.
1981
  * Instead of call to this function it is better to use
1982
  * Instead of call to this function it is better to use
1982
    processor instructions in/out - this is much
1983
    processor instructions in/out - this is much
1983
    faster and a bit shorter and easier.
1984
    faster and a bit shorter and easier.
1984
 
1985
 
1985
 
1986
 
1986
======================================================================
1987
======================================================================
1987
====== Function 46 - reserve/free a group of input/output ports. =====
1988
====== Function 46 - reserve/free a group of input/output ports. =====
1988
======================================================================
1989
======================================================================
1989
To work with reserved ports an application can access directly by
1990
To work with reserved ports an application can access directly by
1990
commands in/out (recommended way) and can use function 43
1991
commands in/out (recommended way) and can use function 43
1991
(not recommended way).
1992
(not recommended way).
1992
Parameters:
1993
Parameters:
1993
  * eax = 46 - function number
1994
  * eax = 46 - function number
1994
  * ebx = 0 - reserve, 1 - free
1995
  * ebx = 0 - reserve, 1 - free
1995
  * ecx = start port number
1996
  * ecx = start port number
1996
  * edx = end port number (inclusive)
1997
  * edx = end port number (inclusive)
1997
Returned value:
1998
Returned value:
1998
  * eax = 0 - success
1999
  * eax = 0 - success
1999
  * eax = 1 - error
2000
  * eax = 1 - error
2000
Remarks:
2001
Remarks:
2001
  * For ports reservation: an error occurs if and only if
2002
  * For ports reservation: an error occurs if and only if
2002
    one from the following condition satisfies:
2003
    one from the following condition satisfies:
2003
    * start port is more than end port;
2004
    * start port is more than end port;
2004
    * the selected range contains incorrect port number
2005
    * the selected range contains incorrect port number
2005
      (correct are from 0 to 0xFFFF);
2006
      (correct are from 0 to 0xFFFF);
2006
    * limit for the total number of reserved areas is exceeded
2007
    * limit for the total number of reserved areas is exceeded
2007
      (maximum 255 are allowed);
2008
      (maximum 255 are allowed);
2008
    * the selected range intersects with any of earlier reserved
2009
    * the selected range intersects with any of earlier reserved
2009
  * For ports free: an error is an attempt to free range,
2010
  * For ports free: an error is an attempt to free range,
2010
    that was not earlier reserved by this function
2011
    that was not earlier reserved by this function
2011
    (with same ecx,edx).
2012
    (with same ecx,edx).
2012
  * If an error occurs (for both cases) function performs no action.
2013
  * If an error occurs (for both cases) function performs no action.
2013
  * At booting the system reserves for itself ports
2014
  * At booting the system reserves for itself ports
2014
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2015
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2015
  * When a thread terminates, all reserved by it ports
2016
  * When a thread terminates, all reserved by it ports
2016
    are freed automatically.
2017
    are freed automatically.
2017
 
2018
 
2018
======================================================================
2019
======================================================================
2019
============= Function 47 - draw a number in the window. =============
2020
============= Function 47 - draw a number in the window. =============
2020
======================================================================
2021
======================================================================
2021
Parameters:
2022
Parameters:
2022
  * eax = 47 - function number
2023
  * eax = 47 - function number
2023
  * ebx = parameters of conversion number to text:
2024
  * ebx = parameters of conversion number to text:
2024
    * bl = 0 - ecx contains number
2025
    * bl = 0 - ecx contains number
2025
    * bl = 1 - ecx contains pointer to dword/qword-number
2026
    * bl = 1 - ecx contains pointer to dword/qword-number
2026
    * bh = 0 - display in decimal number system
2027
    * bh = 0 - display in decimal number system
2027
    * bh = 1 - display in hexadecimal system
2028
    * bh = 1 - display in hexadecimal system
2028
    * bh = 2 - display in binary system
2029
    * bh = 2 - display in binary system
2029
    * bits 16-21 = how many digits to display
2030
    * bits 16-21 = how many digits to display
2030
    * bits 22-29 reserved and must be set to 0
2031
    * bits 22-29 reserved and must be set to 0
2031
    * bit 30 set = display qword (64-bit) number (must be bl=1)
2032
    * bit 30 set = display qword (64-bit) number (must be bl=1)
2032
    * bit 31 set = do not display leading zeroes of the number
2033
    * bit 31 set = do not display leading zeroes of the number
2033
  * ecx = number (if bl=0) or pointer (if bl=1)
2034
  * ecx = number (if bl=0) or pointer (if bl=1)
2034
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2035
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2035
  * esi = 0xX0RRGGBB:
2036
  * esi = 0xX0RRGGBB:
2036
    * RR, GG, BB specify the color
2037
    * RR, GG, BB specify the color
2037
    * X = ABnn (bits)
2038
    * X = ABnn (bits)
2038
    * nn = font (0/1)
2039
    * nn = font (0/1)
2039
    * A is ignored
2040
    * A is ignored
2040
    * B=1 - fill background with the color edi
2041
    * B=1 - fill background with the color edi
2041
Returned value:
2042
Returned value:
2042
  * function does not return value
2043
  * function does not return value
2043
Remarks:
2044
Remarks:
2044
  * The given length must not exceed 60.
2045
  * The given length must not exceed 60.
2045
  * The exactly given amount of digits is output. If number is small
2046
  * The exactly given amount of digits is output. If number is small
2046
    and can be written by smaller amount of digits, it is supplemented
2047
    and can be written by smaller amount of digits, it is supplemented
2047
    by leading zeroes; if the number is big and can not be written by
2048
    by leading zeroes; if the number is big and can not be written by
2048
    given amount of digits, extra digits are not drawn.
2049
    given amount of digits, extra digits are not drawn.
2049
  * Parameters of fonts are shown in the description of function 4
2050
  * Parameters of fonts are shown in the description of function 4
2050
    (text output).
2051
    (text output).
2051
 
2052
 
2052
======================================================================
2053
======================================================================
2053
========= Function 48, subfunction 0 - apply screen settings. ========
2054
========= Function 48, subfunction 0 - apply screen settings. ========
2054
======================================================================
2055
======================================================================
2055
Parameters:
2056
Parameters:
2056
  * eax = 48 - function number
2057
  * eax = 48 - function number
2057
  * ebx = 0 - subfunction number
2058
  * ebx = 0 - subfunction number
2058
  * ecx = 0 - reserved
2059
  * ecx = 0 - reserved
2059
Returned value:
2060
Returned value:
2060
  * function does not return value
2061
  * function does not return value
2061
Remarks:
2062
Remarks:
2062
  * Function redraws the screen after parameters change by
2063
  * Function redraws the screen after parameters change by
2063
    subfunctions 1 and 2.
2064
    subfunctions 1 and 2.
2064
  * Function call without prior call to one of indicated subfunctions
2065
  * Function call without prior call to one of indicated subfunctions
2065
    is ignored.
2066
    is ignored.
2066
  * Function call with nonzero ecx is ignored.
2067
  * Function call with nonzero ecx is ignored.
2067
 
2068
 
2068
======================================================================
2069
======================================================================
2069
=========== Function 48, subfunction 1 - set button style. ===========
2070
=========== Function 48, subfunction 1 - set button style. ===========
2070
======================================================================
2071
======================================================================
2071
Parameters:
2072
Parameters:
2072
  * eax = 48 - function number
2073
  * eax = 48 - function number
2073
  * ebx = 1 - subfunction number
2074
  * ebx = 1 - subfunction number
2074
  * ecx = button style:
2075
  * ecx = button style:
2075
    * 0 = flat
2076
    * 0 = flat
2076
    * 1 = 3d
2077
    * 1 = 3d
2077
Returned value:
2078
Returned value:
2078
  * function does not return value
2079
  * function does not return value
2079
Remarks:
2080
Remarks:
2080
  * After call to this function one should redraw the screen by
2081
  * After call to this function one should redraw the screen by
2081
    subfunction 0.
2082
    subfunction 0.
2082
  * Button style influences only to their draw of function 8.
2083
  * Button style influences only to their draw of function 8.
2083
 
2084
 
2084
======================================================================
2085
======================================================================
2085
====== Function 48, subfunction 2 - set standard window colors. ======
2086
====== Function 48, subfunction 2 - set standard window colors. ======
2086
======================================================================
2087
======================================================================
2087
Parameters:
2088
Parameters:
2088
  * eax = 48 - function number
2089
  * eax = 48 - function number
2089
  * ebx = 2 - subfunction number
2090
  * ebx = 2 - subfunction number
2090
  * ecx = pointer to the color table
2091
  * ecx = pointer to the color table
2091
  * edx = size of the color table
2092
  * edx = size of the color table
2092
    (must be 40 bytes for future compatibility)
2093
    (must be 40 bytes for future compatibility)
2093
Format of the color table is shown in description of subfunction 3.
2094
Format of the color table is shown in description of subfunction 3.
2094
Returned value:
2095
Returned value:
2095
  * function does not return value
2096
  * function does not return value
2096
Remarks:
2097
Remarks:
2097
  * After call to this function one should redraw the screen by
2098
  * After call to this function one should redraw the screen by
2098
    subfunction 0.
2099
    subfunction 0.
2099
  * Table of standard colors influences only to applications,
2100
  * Table of standard colors influences only to applications,
2100
    which receive this table obviously (by subfunction 3)
2101
    which receive this table obviously (by subfunction 3)
2101
    and use it (specifying colors from it to drawing functions).
2102
    and use it (specifying colors from it to drawing functions).
2102
  * Table of standard colors is included in skin and is installed
2103
  * Table of standard colors is included in skin and is installed
2103
    anew with skin installation (by subfunction 8).
2104
    anew with skin installation (by subfunction 8).
2104
  * Color table can be viewed/changed interactively with
2105
  * Color table can be viewed/changed interactively with
2105
    the application 'desktop'.
2106
    the application 'desktop'.
2106
 
2107
 
2107
======================================================================
2108
======================================================================
2108
====== Function 48, subfunction 3 - get standard window colors. ======
2109
====== Function 48, subfunction 3 - get standard window colors. ======
2109
======================================================================
2110
======================================================================
2110
Parameters:
2111
Parameters:
2111
  * eax = 48 - function number
2112
  * eax = 48 - function number
2112
  * ebx = 3 - subfunction number
2113
  * ebx = 3 - subfunction number
2113
  * ecx = pointer to the buffer with size edx bytes,
2114
  * ecx = pointer to the buffer with size edx bytes,
2114
    where table will be written
2115
    where table will be written
2115
  * edx = size of color table
2116
  * edx = size of color table
2116
    (must be 40 bytes for future compatibility)
2117
    (must be 40 bytes for future compatibility)
2117
Returned value:
2118
Returned value:
2118
  * function does not return value
2119
  * function does not return value
2119
Format of the color table:
2120
Format of the color table:
2120
each item is dword-value for color 0x00RRGGBB
2121
each item is dword-value for color 0x00RRGGBB
2121
  * +0: dword: frames - color of frame
2122
  * +0: dword: frames - color of frame
2122
  * +4: dword: grab - color of header
2123
  * +4: dword: grab - color of header
2123
  * +8: dword: grab_button - color of button on header bar
2124
  * +8: dword: grab_button - color of button on header bar
2124
  * +12 = +0xC: dword: grab_button_text - color of text on button
2125
  * +12 = +0xC: dword: grab_button_text - color of text on button
2125
    on header bar
2126
    on header bar
2126
  * +16 = +0x10: dword: grab_text - color of text on header
2127
  * +16 = +0x10: dword: grab_text - color of text on header
2127
  * +20 = +0x14: dword: work - color of working area
2128
  * +20 = +0x14: dword: work - color of working area
2128
  * +24 = +0x18: dword: work_button - color of button in working area
2129
  * +24 = +0x18: dword: work_button - color of button in working area
2129
  * +28 = +0x1C: dword: work_button_text - color of text on button
2130
  * +28 = +0x1C: dword: work_button_text - color of text on button
2130
    in working area
2131
    in working area
2131
  * +32 = +0x20: dword: work_text - color of text in working area
2132
  * +32 = +0x20: dword: work_text - color of text in working area
2132
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2133
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2133
Remarks:
2134
Remarks:
2134
  * Structure of the color table is described in the standard
2135
  * Structure of the color table is described in the standard
2135
    include file 'macros.inc' as 'system_colors'; for example,
2136
    include file 'macros.inc' as 'system_colors'; for example,
2136
    it is possible to write:
2137
    it is possible to write:
2137
    	sc	system_colors		; variable declaration
2138
    	sc	system_colors		; variable declaration
2138
    	...				; somewhere one must call
2139
    	...				; somewhere one must call
2139
    					; this function with ecx=sc
2140
    					; this function with ecx=sc
2140
    	mov	ecx, [sc.work_button_text]	; read text color on
2141
    	mov	ecx, [sc.work_button_text]	; read text color on
2141
    					; buttin in working area
2142
    					; buttin in working area
2142
  * A program itself desides to use or not to use color table.
2143
  * A program itself desides to use or not to use color table.
2143
    For usage program must simply at calls to drawing functions select
2144
    For usage program must simply at calls to drawing functions select
2144
    color taken from the table.
2145
    color taken from the table.
2145
  * At change of the table of standard colors (by subfunction 2 with
2146
  * At change of the table of standard colors (by subfunction 2 with
2146
    the subsequent application of changes by subfunction 0 or
2147
    the subsequent application of changes by subfunction 0 or
2147
    at skin set by subfunction 8) the system sends to all windows
2148
    at skin set by subfunction 8) the system sends to all windows
2148
    redraw message (the event with code 1).
2149
    redraw message (the event with code 1).
2149
  * Color table can be viewed/changed interactively with
2150
  * Color table can be viewed/changed interactively with
2150
    the application 'desktop'.
2151
    the application 'desktop'.
2151
 
2152
 
2152
======================================================================
2153
======================================================================
2153
============ Function 48, subfunction 4 - get skin height. ===========
2154
============ Function 48, subfunction 4 - get skin height. ===========
2154
======================================================================
2155
======================================================================
2155
Parameters:
2156
Parameters:
2156
  * eax = 48 - function number
2157
  * eax = 48 - function number
2157
  * ebx = 4 - subfunction number
2158
  * ebx = 4 - subfunction number
2158
Returned value:
2159
Returned value:
2159
  * eax = skin height
2160
  * eax = skin height
2160
Remarks:
2161
Remarks:
2161
  * Skin height is defined as the height of a header
2162
  * Skin height is defined as the height of a header
2162
    of skinned windows.
2163
    of skinned windows.
2163
  * See also general structure of window in the description
2164
  * See also general structure of window in the description
2164
    of function 0.
2165
    of function 0.
2165
 
2166
 
2166
======================================================================
2167
======================================================================
2167
======== Function 48, subfunction 5 - get screen working area. =======
2168
======== Function 48, subfunction 5 - get screen working area. =======
2168
======================================================================
2169
======================================================================
2169
Parameters:
2170
Parameters:
2170
  * eax = 48 - function number
2171
  * eax = 48 - function number
2171
  * ebx = 5 - subfunction number
2172
  * ebx = 5 - subfunction number
2172
Returned value:
2173
Returned value:
2173
  * eax = [left]*65536 + [right]
2174
  * eax = [left]*65536 + [right]
2174
  * ebx = [top]*65536 + [bottom]
2175
  * ebx = [top]*65536 + [bottom]
2175
Remarks:
2176
Remarks:
2176
  * The screen working area defines position and coordinates of
2177
  * The screen working area defines position and coordinates of
2177
    a maximized window.
2178
    a maximized window.
2178
  * The screen working area in view of normal work is all screen
2179
  * The screen working area in view of normal work is all screen
2179
    without system panel (the application '@panel').
2180
    without system panel (the application '@panel').
2180
  * (left,top) are coordinates of the left upper corner,
2181
  * (left,top) are coordinates of the left upper corner,
2181
    (right,bottom) are coordinates of the right lower one.
2182
    (right,bottom) are coordinates of the right lower one.
2182
    Thus the size of working area on x axis can be calculated by
2183
    Thus the size of working area on x axis can be calculated by
2183
    formula right-left+1, on y axis - by formula bottom-right+1.
2184
    formula right-left+1, on y axis - by formula bottom-right+1.
2184
  * See also function 14,
2185
  * See also function 14,
2185
    to get sizes of all screen.
2186
    to get sizes of all screen.
2186
  * There is a pair function to set working area - subfunction 6.
2187
  * There is a pair function to set working area - subfunction 6.
2187
 
2188
 
2188
======================================================================
2189
======================================================================
2189
======== Function 48, subfunction 6 - set screen working area. =======
2190
======== Function 48, subfunction 6 - set screen working area. =======
2190
======================================================================
2191
======================================================================
2191
Parameters:
2192
Parameters:
2192
  * eax = 48 - function number
2193
  * eax = 48 - function number
2193
  * ebx = 6 - subfunction number
2194
  * ebx = 6 - subfunction number
2194
  * ecx = [left]*65536 + [right]
2195
  * ecx = [left]*65536 + [right]
2195
  * edx = [top]*65536 + [bottom]
2196
  * edx = [top]*65536 + [bottom]
2196
Returned value:
2197
Returned value:
2197
  * function does not return value
2198
  * function does not return value
2198
Remarks:
2199
Remarks:
2199
  * The screen working area defines position and coordinates of
2200
  * The screen working area defines position and coordinates of
2200
    a maximized window.
2201
    a maximized window.
2201
  * This function is used only by the application '@panel',
2202
  * This function is used only by the application '@panel',
2202
    which set working area to all screen without system panel.
2203
    which set working area to all screen without system panel.
2203
  * (left,top) are coordinates of the left upper corner,
2204
  * (left,top) are coordinates of the left upper corner,
2204
    (right,bottom) are coordinates of the right lower one.
2205
    (right,bottom) are coordinates of the right lower one.
2205
    Thus the size of working area on x axis can be calculated by
2206
    Thus the size of working area on x axis can be calculated by
2206
    formula right-left+1, on y axis - by formula bottom-right+1.
2207
    formula right-left+1, on y axis - by formula bottom-right+1.
2207
  * If 'left'>='right', x-coordinate of working area is not changed.
2208
  * If 'left'>='right', x-coordinate of working area is not changed.
2208
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2209
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2209
    equal to screen width, 'right' will not be set.
2210
    equal to screen width, 'right' will not be set.
2210
    Similarly on y axis.
2211
    Similarly on y axis.
2211
  * See also function 14,
2212
  * See also function 14,
2212
    to get sizes of all screen.
2213
    to get sizes of all screen.
2213
  * There is a pair function to get working area - subfunction 5.
2214
  * There is a pair function to get working area - subfunction 5.
2214
  * This function redraws the screen automatically,
2215
  * This function redraws the screen automatically,
2215
    updating coordinates and sizes of maximized windows.
2216
    updating coordinates and sizes of maximized windows.
2216
    The system sends to all windows redraw message (the event 1).
2217
    The system sends to all windows redraw message (the event 1).
2217
 
2218
 
2218
======================================================================
2219
======================================================================
2219
=========== Function 48, subfunction 7 - get skin margins. ===========
2220
=========== Function 48, subfunction 7 - get skin margins. ===========
2220
======================================================================
2221
======================================================================
2221
Returns the area of a header of a skinned window, intended for
2222
Returns the area of a header of a skinned window, intended for
2222
a text of a header.
2223
a text of a header.
2223
Parameters:
2224
Parameters:
2224
  * eax = 48 - function number
2225
  * eax = 48 - function number
2225
  * ebx = 7 - subfunction number
2226
  * ebx = 7 - subfunction number
2226
Returned value:
2227
Returned value:
2227
  * eax = [left]*65536 + [right]
2228
  * eax = [left]*65536 + [right]
2228
  * ebx = [top]*65536 + [bottom]
2229
  * ebx = [top]*65536 + [bottom]
2229
Remarks:
2230
Remarks:
2230
  * An application decides itself to use or not to use this function.
2231
  * An application decides itself to use or not to use this function.
2231
  * It is recommended to take into account returned value
2232
  * It is recommended to take into account returned value
2232
    of this function for choice of a place for drawing header text
2233
    of this function for choice of a place for drawing header text
2233
    (by function 4) or a substitute of header text
2234
    (by function 4) or a substitute of header text
2234
    (at the discretion of an application).
2235
    (at the discretion of an application).
2235
 
2236
 
2236
======================================================================
2237
======================================================================
2237
============= Function 48, subfunction 8 - set used skin. ============
2238
============= Function 48, subfunction 8 - set used skin. ============
2238
======================================================================
2239
======================================================================
2239
Parameters:
2240
Parameters:
2240
  * eax = 48 - function number
2241
  * eax = 48 - function number
2241
  * ebx = 8 - subfunction number
2242
  * ebx = 8 - subfunction number
2242
  * ecx = pointer to filename of the skin
2243
  * ecx = pointer to filename of the skin
2243
Returned value:
2244
Returned value:
2244
  * eax = 0 - success
2245
  * eax = 0 - success
2245
  * otherwise eax = file system error code; if file does not
2246
  * otherwise eax = file system error code; if file does not
2246
    contain valid skin, function returns error 3
2247
    contain valid skin, function returns error 3
2247
    (unknown file system).
2248
    (unknown file system).
2248
Remarks:
2249
Remarks:
2249
  * After successful skin loading the system sends to all windows
2250
  * After successful skin loading the system sends to all windows
2250
    redraw message (the event 1).
2251
    redraw message (the event 1).
2251
  * At booting the system reads skin from file 'default.skn'
2252
  * At booting the system reads skin from file 'default.skn'
2252
    on ramdisk.
2253
    on ramdisk.
2253
  * User can change the skin statically by creating hisself
2254
  * User can change the skin statically by creating hisself
2254
    'default.skn' or dynamically with the application 'desktop'.
2255
    'default.skn' or dynamically with the application 'desktop'.
2255
 
2256
 
2256
======================================================================
2257
======================================================================
2257
=========== Function 49 - Advanced Power Management (APM). ===========
2258
=========== Function 49 - Advanced Power Management (APM). ===========
2258
======================================================================
2259
======================================================================
2259
Parameters:
2260
Parameters:
2260
  * eax = 49 - function number
2261
  * eax = 49 - function number
2261
  * dx = number of the APM function
2262
  * dx = number of the APM function
2262
    (analogue of ax in APM specification)
2263
    (analogue of ax in APM specification)
2263
  * bx, cx = parameters of the APM function
2264
  * bx, cx = parameters of the APM function
2264
Returned value:
2265
Returned value:
2265
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2266
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2266
    are set according to the APM specification
2267
    are set according to the APM specification
2267
  * high halves of 32-bit registers eax, ebx, ecx,
2268
  * high halves of 32-bit registers eax, ebx, ecx,
2268
    edx, esi, edi are destroyed
2269
    edx, esi, edi are destroyed
2269
Remarks:
2270
Remarks:
2270
  * APM 1.2 specification is described in the document
2271
  * APM 1.2 specification is described in the document
2271
    "Advanced Power Management (APM) BIOS Specification"
2272
    "Advanced Power Management (APM) BIOS Specification"
2272
    (Revision 1.2), available at
2273
    (Revision 1.2), available at
2273
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2274
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2274
    besides it is included in famous Interrupt List by Ralf Brown
2275
    besides it is included in famous Interrupt List by Ralf Brown
2275
    (http://www.pobox.com/~ralf/files.html,
2276
    (http://www.pobox.com/~ralf/files.html,
2276
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2277
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2277
 
2278
 
2278
======================================================================
2279
======================================================================
2279
=================== Function 50 - set window shape. ==================
2280
=================== Function 50 - set window shape. ==================
2280
======================================================================
2281
======================================================================
2281
Normal windows have rectangular shape. This function can give to
2282
Normal windows have rectangular shape. This function can give to
2282
a window any shape. The shape is given by a set of points inside
2283
a window any shape. The shape is given by a set of points inside
2283
the base rectangle belonging to a window. Position and coordinates
2284
the base rectangle belonging to a window. Position and coordinates
2284
of the base rectangle are set by function 0
2285
of the base rectangle are set by function 0
2285
and changed by function 67.
2286
and changed by function 67.
2286
 
2287
 
2287
--------------------------- Set shape data ---------------------------
2288
--------------------------- Set shape data ---------------------------
2288
Parameters:
2289
Parameters:
2289
  * eax = 50 - function number
2290
  * eax = 50 - function number
2290
  * ebx = 0 - subfunction number
2291
  * ebx = 0 - subfunction number
2291
  * ecx = pointer to shape data (array of bytes 0/1)
2292
  * ecx = pointer to shape data (array of bytes 0/1)
2292
Returned value:
2293
Returned value:
2293
  * function does not return value
2294
  * function does not return value
2294
 
2295
 
2295
-------------------------- Set shape scale ---------------------------
2296
-------------------------- Set shape scale ---------------------------
2296
Parameters:
2297
Parameters:
2297
  * eax = 50 - function number
2298
  * eax = 50 - function number
2298
  * ebx = 1 - subfunction number
2299
  * ebx = 1 - subfunction number
2299
  * ecx sets a scale: each byte of data defines
2300
  * ecx sets a scale: each byte of data defines
2300
    (2^scale)*(2^scale) pixels
2301
    (2^scale)*(2^scale) pixels
2301
Returned value:
2302
Returned value:
2302
  * function does not return value
2303
  * function does not return value
2303
Remarks:
2304
Remarks:
2304
  * Default scale is 0 (scale factor is 1). If in the shape data
2305
  * Default scale is 0 (scale factor is 1). If in the shape data
2305
    one byte corresponds to one pixel, there is no necessity
2306
    one byte corresponds to one pixel, there is no necessity
2306
    to set scale.
2307
    to set scale.
2307
  * Let's designate xsize = window width (in pixels), ysize = height;
2308
  * Let's designate xsize = window width (in pixels), ysize = height;
2308
    pay attention, that they are one pixel more than defined by
2309
    pay attention, that they are one pixel more than defined by
2309
    functions 0, 67.
2310
    functions 0, 67.
2310
  * On definition of scale xsize and ysize must be divisible
2311
  * On definition of scale xsize and ysize must be divisible
2311
    on 2^scale.
2312
    on 2^scale.
2312
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2313
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2313
    to a window of square with the side 2^scale (if scale=0,
2314
    to a window of square with the side 2^scale (if scale=0,
2314
    this is one pixel) and coordinates of the left upper corner
2315
    this is one pixel) and coordinates of the left upper corner
2315
    (a mod (xsize shr scale), a div (xsize shr scale))
2316
    (a mod (xsize shr scale), a div (xsize shr scale))
2316
  * Data size: (xsize shr scale)*(ysize shr scale).
2317
  * Data size: (xsize shr scale)*(ysize shr scale).
2317
  * Data must be presented in the memory and not change
2318
  * Data must be presented in the memory and not change
2318
    after set of shape.
2319
    after set of shape.
2319
  * The system views the shape data at every window redraw by
2320
  * The system views the shape data at every window redraw by
2320
    function 0.
2321
    function 0.
2321
  * The call of subfunction 0 with NULL pointer results in return
2322
  * The call of subfunction 0 with NULL pointer results in return
2322
    to the rectangular shape.
2323
    to the rectangular shape.
2323
 
2324
 
2324
======================================================================
2325
======================================================================
2325
==================== Function 51 - create thread. ====================
2326
==================== Function 51 - create thread. ====================
2326
======================================================================
2327
======================================================================
2327
Parameters:
2328
Parameters:
2328
  * eax = 51 - function number
2329
  * eax = 51 - function number
2329
  * ebx = 1 - unique subfunction
2330
  * ebx = 1 - unique subfunction
2330
  * ecx = address of thread entry point (starting eip)
2331
  * ecx = address of thread entry point (starting eip)
2331
  * edx = pointer to thread stack (starting esp)
2332
  * edx = pointer to thread stack (starting esp)
2332
Returned value:
2333
Returned value:
2333
  * eax = -1 - error (there is too many threads)
2334
  * eax = -1 - error (there is too many threads)
2334
  * otherwise eax = TID - thread identifier
2335
  * otherwise eax = TID - thread identifier
2335
    
2336
    
2336
 
2337
 
2337
======================================================================
2338
======================================================================
2338
==================== Function 54, subfunction 0 ======================
2339
==================== Function 54, subfunction 0 ======================
2339
============== Get the number of slots in the clipboard. =============
2340
============== Get the number of slots in the clipboard. =============
2340
======================================================================
2341
======================================================================
2341
Parameters:
2342
Parameters:
2342
  * eax = 54 - function number
2343
  * eax = 54 - function number
2343
  * ebx = 0 - subfunction number
2344
  * ebx = 0 - subfunction number
2344
Returned value:
2345
Returned value:
2345
  * eax = slots in the clipboard
2346
  * eax = slots in the clipboard
2346
  * eax = -1 - main list area not found
2347
  * eax = -1 - main list area not found
2347
 
2348
 
2348
======================================================================
2349
======================================================================
2349
==================== Function 54, subfunction 1 ======================
2350
==================== Function 54, subfunction 1 ======================
2350
================= Read the data from the clipboard. ==================
2351
================= Read the data from the clipboard. ==================
2351
======================================================================
2352
======================================================================
2352
Parameters:
2353
Parameters:
2353
  * eax = 54 - function number
2354
  * eax = 54 - function number
2354
  * ebx = 1 - subfunction number
2355
  * ebx = 1 - subfunction number
2355
  * eсx = slot number
2356
  * eсx = slot number
2356
Returned value:
2357
Returned value:
2357
  * eax = if successful - pointer to a memory with data
2358
  * eax = if successful - pointer to a memory with data
2358
  * eax = 1 - error
2359
  * eax = 1 - error
2359
  * eax = -1 - main list area not found
2360
  * eax = -1 - main list area not found
2360
 
2361
 
2361
======================================================================
2362
======================================================================
2362
==================== Function 54, subfunction 2 ======================
2363
==================== Function 54, subfunction 2 ======================
2363
================= Write the data to the clipboard. ===================
2364
================= Write the data to the clipboard. ===================
2364
======================================================================
2365
======================================================================
2365
Parameters:
2366
Parameters:
2366
  * eax = 54 - function number
2367
  * eax = 54 - function number
2367
  * ebx = 2 - subfunction number
2368
  * ebx = 2 - subfunction number
2368
  * eсx = the number of bytes to be copied
2369
  * eсx = the number of bytes to be copied
2369
  * edx = a pointer to a buffer for data to be copied
2370
  * edx = a pointer to a buffer for data to be copied
2370
Returned value:
2371
Returned value:
2371
  * eax = 0 - success
2372
  * eax = 0 - success
2372
  * eax = 1 - error
2373
  * eax = 1 - error
2373
  * eax = -1 - main list area not found
2374
  * eax = -1 - main list area not found
2374
 
2375
 
2375
======================================================================
2376
======================================================================
2376
===================== Function 54, subfunction 3 =====================
2377
===================== Function 54, subfunction 3 =====================
2377
================ Delete the last slot in the clipboard ===============
2378
================ Delete the last slot in the clipboard ===============
2378
======================================================================
2379
======================================================================
2379
Parameters:
2380
Parameters:
2380
  * eax = 54 - function number
2381
  * eax = 54 - function number
2381
  * ebx = 3 - subfunction number
2382
  * ebx = 3 - subfunction number
2382
Returned value:
2383
Returned value:
2383
  * eax = 0 - success
2384
  * eax = 0 - success
2384
  * eax = 1 - error
2385
  * eax = 1 - error
2385
  * eax = -1 - main list area not found
2386
  * eax = -1 - main list area not found
2386
  
2387
  
2387
======================================================================
2388
======================================================================
2388
===================== Function 54, subfunction 4 =====================
2389
===================== Function 54, subfunction 4 =====================
2389
===================== Alarm reset the lock buffer ====================
2390
===================== Alarm reset the lock buffer ====================
2390
======================================================================
2391
======================================================================
2391
Parameters:
2392
Parameters:
2392
  * eax = 54 - function number
2393
  * eax = 54 - function number
2393
  * ebx = 4 - subfunction number
2394
  * ebx = 4 - subfunction number
2394
Returned value:
2395
Returned value:
2395
  * eax = 0 - success
2396
  * eax = 0 - success
2396
  * eax = -1 - main list area not found or no blocking
2397
  * eax = -1 - main list area not found or no blocking
2397
Remarks:
2398
Remarks:
2398
  * Used in exceptional cases, where no responsible or killed
2399
  * Used in exceptional cases, where no responsible or killed
2399
    application blocked the clipboard operations.
2400
    application blocked the clipboard operations.
2400
 
2401
 
2401
======================================================================
2402
======================================================================
2402
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2403
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2403
======================================================================
2404
======================================================================
2404
Parameters:
2405
Parameters:
2405
  * eax = 55 - function number
2406
  * eax = 55 - function number
2406
  * ebx = 55 - subfunction number
2407
  * ebx = 55 - subfunction number
2407
  * esi = pointer to data
2408
  * esi = pointer to data
2408
Returned value:
2409
Returned value:
2409
  * eax = 0 - success
2410
  * eax = 0 - success
2410
  * eax = 55 - error (speaker is off or busy)
2411
  * eax = 55 - error (speaker is off or busy)
2411
Data is an array of items with variable length.
2412
Data is an array of items with variable length.
2412
Format of each item is defined by first byte:
2413
Format of each item is defined by first byte:
2413
  * 0 = end of data
2414
  * 0 = end of data
2414
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2415
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2415
    is defined by immediate value of frequency
2416
    is defined by immediate value of frequency
2416
    * following word (2 bytes) contains frequency divider;
2417
    * following word (2 bytes) contains frequency divider;
2417
      frequency is defined as 1193180/divider
2418
      frequency is defined as 1193180/divider
2418
  * 0x81 = invalid
2419
  * 0x81 = invalid
2419
  * 0x82..0xFF = note is defined by octave and number:
2420
  * 0x82..0xFF = note is defined by octave and number:
2420
    * duration in 1/100 of second = (first byte)-0x81
2421
    * duration in 1/100 of second = (first byte)-0x81
2421
    * there is one more byte;
2422
    * there is one more byte;
2422
    * (second byte)=0xFF - delay
2423
    * (second byte)=0xFF - delay
2423
    * otherwise it looks like a*0x10+b, where b=number of the note in
2424
    * otherwise it looks like a*0x10+b, where b=number of the note in
2424
      an octave from 1 to 12, a=number of octave (beginning from 0)
2425
      an octave from 1 to 12, a=number of octave (beginning from 0)
2425
Remarks:
2426
Remarks:
2426
  * Speaker play can be disabled/enabled by
2427
  * Speaker play can be disabled/enabled by
2427
    subfunction 8 of function 18.
2428
    subfunction 8 of function 18.
2428
  * Function returns control, having informed the system
2429
  * Function returns control, having informed the system
2429
    an information on request. Play itself goes independently from
2430
    an information on request. Play itself goes independently from
2430
    the program.
2431
    the program.
2431
  * The data must be kept in the memory at least up to the end
2432
  * The data must be kept in the memory at least up to the end
2432
    of play.
2433
    of play.
2433
 
2434
 
2434
======================================================================
2435
======================================================================
2435
======================= Function 57 - PCI BIOS. ======================
2436
======================= Function 57 - PCI BIOS. ======================
2436
======================================================================
2437
======================================================================
2437
Parameters:
2438
Parameters:
2438
  * eax = 57 - function number
2439
  * eax = 57 - function number
2439
  * ebp corresponds to al in PCI BIOS specification
2440
  * ebp corresponds to al in PCI BIOS specification
2440
  * other registers are set according to PCI BIOS specification
2441
  * other registers are set according to PCI BIOS specification
2441
Returned value:
2442
Returned value:
2442
  * CF is undefined
2443
  * CF is undefined
2443
  * other registers are set according to PCI BIOS specification
2444
  * other registers are set according to PCI BIOS specification
2444
Remarks:
2445
Remarks:
2445
  * Many effects of this function can be also achieved with
2446
  * Many effects of this function can be also achieved with
2446
    corresponding subfunctions of function 62.
2447
    corresponding subfunctions of function 62.
2447
  * The function calls PCI32 BIOS extension, documented e.g. in
2448
  * The function calls PCI32 BIOS extension, documented e.g. in
2448
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2449
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2449
  * If BIOS does not support this extension, its behavior is emulated
2450
  * If BIOS does not support this extension, its behavior is emulated
2450
    (through kernel-mode analogues of subfunctions of function 62).
2451
    (through kernel-mode analogues of subfunctions of function 62).
2451
 
2452
 
2452
======================================================================
2453
======================================================================
2453
========== Function 60 - Inter Process Communication (IPC). ==========
2454
========== Function 60 - Inter Process Communication (IPC). ==========
2454
======================================================================
2455
======================================================================
2455
IPC is used for message dispatching from one process/thread to
2456
IPC is used for message dispatching from one process/thread to
2456
another. Previously it is necessary to agree how to interpret
2457
another. Previously it is necessary to agree how to interpret
2457
the concrete message.
2458
the concrete message.
2458
 
2459
 
2459
----------- Subfunction 1 - set the area for IPC receiving -----------
2460
----------- Subfunction 1 - set the area for IPC receiving -----------
2460
Is called by process-receiver.
2461
Is called by process-receiver.
2461
Parameters:
2462
Parameters:
2462
  * eax = 60 - function number
2463
  * eax = 60 - function number
2463
  * ebx = 1 - subfunction number
2464
  * ebx = 1 - subfunction number
2464
  * ecx = pointer to the buffer
2465
  * ecx = pointer to the buffer
2465
  * edx = size of the buffer
2466
  * edx = size of the buffer
2466
Returned value:
2467
Returned value:
2467
  * eax = 0 - always success
2468
  * eax = 0 - always success
2468
Format of IPC-buffer:
2469
Format of IPC-buffer:
2469
  * +0: dword: if nonzero, buffer is considered locked;
2470
  * +0: dword: if nonzero, buffer is considered locked;
2470
    lock/unlock the buffer, when you work with it and need that
2471
    lock/unlock the buffer, when you work with it and need that
2471
    buffer data are not changed from outside (no new messages)
2472
    buffer data are not changed from outside (no new messages)
2472
  * +4: dword: occupied place in the buffer (in bytes)
2473
  * +4: dword: occupied place in the buffer (in bytes)
2473
  * +8: first message
2474
  * +8: first message
2474
  * +8+n: second message
2475
  * +8+n: second message
2475
  * ...
2476
  * ...
2476
Format of a message:
2477
Format of a message:
2477
  * +0: dword: PID of sender
2478
  * +0: dword: PID of sender
2478
  * +4: dword: message length (not including this header)
2479
  * +4: dword: message length (not including this header)
2479
  * +8: n*byte: message data
2480
  * +8: n*byte: message data
2480
 
2481
 
2481
------------------ Subfunction 2 - send IPC message ------------------
2482
------------------ Subfunction 2 - send IPC message ------------------
2482
Is called by process-sender.
2483
Is called by process-sender.
2483
Parameters:
2484
Parameters:
2484
  * eax = 60 - function number
2485
  * eax = 60 - function number
2485
  * ebx = 2 - subfunction number
2486
  * ebx = 2 - subfunction number
2486
  * ecx = PID of receiver
2487
  * ecx = PID of receiver
2487
  * edx = pointer to the message data
2488
  * edx = pointer to the message data
2488
  * esi = message length (in bytes)
2489
  * esi = message length (in bytes)
2489
Returned value:
2490
Returned value:
2490
  * eax = 0 - success
2491
  * eax = 0 - success
2491
  * eax = 1 - the receiver has not defined buffer for IPC messages
2492
  * eax = 1 - the receiver has not defined buffer for IPC messages
2492
    (can be, still have no time,
2493
    (can be, still have no time,
2493
    and can be, this is not right process)
2494
    and can be, this is not right process)
2494
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2495
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2495
  * eax = 3 - overflow of IPC-buffer of the receiver
2496
  * eax = 3 - overflow of IPC-buffer of the receiver
2496
  * eax = 4 - process/thread with such PID does not exist
2497
  * eax = 4 - process/thread with such PID does not exist
2497
Remarks:
2498
Remarks:
2498
  * Immediately after writing of IPC-message to the buffer the system
2499
  * Immediately after writing of IPC-message to the buffer the system
2499
    sends to the receiver the event with code 7 (see event codes).
2500
    sends to the receiver the event with code 7 (see event codes).
2500
 
2501
 
2501
======================================================================
2502
======================================================================
2502
==== Function 61 - get parameters for the direct graphics access. ====
2503
==== Function 61 - get parameters for the direct graphics access. ====
2503
======================================================================
2504
======================================================================
2504
The data of the graphics screen (the memory area which displays
2505
The data of the graphics screen (the memory area which displays
2505
screen contents) are accessible to a program directly, without
2506
screen contents) are accessible to a program directly, without
2506
any system calls, through the selector gs:
2507
any system calls, through the selector gs:
2507
	mov	eax, [gs:0]
2508
	mov	eax, [gs:0]
2508
places in eax the first dword of the buffer, which contains
2509
places in eax the first dword of the buffer, which contains
2509
information on color of the left upper point (and, possibly, colors
2510
information on color of the left upper point (and, possibly, colors
2510
of several following).
2511
of several following).
2511
	mov	[gs:0], eax
2512
	mov	[gs:0], eax
2512
by work in VESA modes with LFB sets color of the left upper point
2513
by work in VESA modes with LFB sets color of the left upper point
2513
(and, possibly, colors of several following).
2514
(and, possibly, colors of several following).
2514
To interpret the data of graphics screen program needs to know
2515
To interpret the data of graphics screen program needs to know
2515
some parameters, returning by this function.
2516
some parameters, returning by this function.
2516
Remarks:
2517
Remarks:
2517
  * Graphics parameters changes very seldom at work,
2518
  * Graphics parameters changes very seldom at work,
2518
    namely, only in cases, when user works with the application VRR.
2519
    namely, only in cases, when user works with the application VRR.
2519
  * At videomode change the system redraws all windows (event
2520
  * At videomode change the system redraws all windows (event
2520
    with code 1) and redraws the background (event 5).
2521
    with code 1) and redraws the background (event 5).
2521
    Same events occur in other cases too, which meet much more often,
2522
    Same events occur in other cases too, which meet much more often,
2522
    than videomode change.
2523
    than videomode change.
2523
  * By operation in videomodes with LFB the selector gs points to
2524
  * By operation in videomodes with LFB the selector gs points to
2524
    LFB itself, so reading/writing on gs result directly in
2525
    LFB itself, so reading/writing on gs result directly in
2525
    change of screen contents. By operation in videomodes without
2526
    change of screen contents. By operation in videomodes without
2526
    LFB gs points to some data area in the kernel, and all functions
2527
    LFB gs points to some data area in the kernel, and all functions
2527
    of screen output fulfil honesty double operation on writing
2528
    of screen output fulfil honesty double operation on writing
2528
    directly to the screen and writing to this buffer. In result
2529
    directly to the screen and writing to this buffer. In result
2529
    at reading contents of this buffer the results correspond to
2530
    at reading contents of this buffer the results correspond to
2530
    screen contents (with, generally speaking, large color
2531
    screen contents (with, generally speaking, large color
2531
    resolution), and writing is ignored.
2532
    resolution), and writing is ignored.
2532
    One exception is the mode 320*200, for which main loop of the
2533
    One exception is the mode 320*200, for which main loop of the
2533
    system thread updates the screen according to mouse movements.
2534
    system thread updates the screen according to mouse movements.
2534
 
2535
 
2535
------------------------- Screen resolution --------------------------
2536
------------------------- Screen resolution --------------------------
2536
Parameters:
2537
Parameters:
2537
  * eax = 61 - function number
2538
  * eax = 61 - function number
2538
  * ebx = 1 - subfunction number
2539
  * ebx = 1 - subfunction number
2539
Returned value:
2540
Returned value:
2540
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
2541
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
2541
Remarks:
2542
Remarks:
2542
  * One can use function 14 paying attention that
2543
  * One can use function 14 paying attention that
2543
    it returns sizes on 1 pixel less. It is fully equivalent way.
2544
    it returns sizes on 1 pixel less. It is fully equivalent way.
2544
 
2545
 
2545
---------------------- Number of bits per pixel ----------------------
2546
---------------------- Number of bits per pixel ----------------------
2546
Parameters:
2547
Parameters:
2547
  * eax = 61 - function number
2548
  * eax = 61 - function number
2548
  * ebx = 2 - subfunction number
2549
  * ebx = 2 - subfunction number
2549
Returned value:
2550
Returned value:
2550
  * eax = number of bits per pixel (24 or 32)
2551
  * eax = number of bits per pixel (24 or 32)
2551
 
2552
 
2552
-------------------- Number of bytes per scanline --------------------
2553
-------------------- Number of bytes per scanline --------------------
2553
Parameters:
2554
Parameters:
2554
  * eax = 61 - function number
2555
  * eax = 61 - function number
2555
  * ebx = 3 - subfunction number
2556
  * ebx = 3 - subfunction number
2556
Returned value:
2557
Returned value:
2557
  * eax = number of bytes occupied by one scanline
2558
  * eax = number of bytes occupied by one scanline
2558
    (horizontal line on the screen)
2559
    (horizontal line on the screen)
2559
 
2560
 
2560
======================================================================
2561
======================================================================
2561
===== Function 62, subfunction 0 - get version of PCI-interface. =====
2562
===== Function 62, subfunction 0 - get version of PCI-interface. =====
2562
======================================================================
2563
======================================================================
2563
Parameters:
2564
Parameters:
2564
  * eax = 62 - function number
2565
  * eax = 62 - function number
2565
  * bl = 0 - subfunction number
2566
  * bl = 0 - subfunction number
2566
Returned value:
2567
Returned value:
2567
  * eax = -1 - PCI access is disabled; otherwise
2568
  * eax = -1 - PCI access is disabled; otherwise
2568
  * ah.al = version of PCI-interface (ah=version, al=subversion)
2569
  * ah.al = version of PCI-interface (ah=version, al=subversion)
2569
  * high word of eax is zeroed
2570
  * high word of eax is zeroed
2570
Remarks:
2571
Remarks:
2571
  * Previously low-level access to PCI for applications must be
2572
  * Previously low-level access to PCI for applications must be
2572
    enabled by subfunction 12 of function 21.
2573
    enabled by subfunction 12 of function 21.
2573
  * If PCI BIOS is not supported, the value of ax is undefined.
2574
  * If PCI BIOS is not supported, the value of ax is undefined.
2574
 
2575
 
2575
======================================================================
2576
======================================================================
2576
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
2577
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
2577
======================================================================
2578
======================================================================
2578
Parameters:
2579
Parameters:
2579
  * eax = 62 - function number
2580
  * eax = 62 - function number
2580
  * bl = 1 - subfunction number
2581
  * bl = 1 - subfunction number
2581
Returned value:
2582
Returned value:
2582
  * eax = -1 - access to PCI is disabled; otherwise
2583
  * eax = -1 - access to PCI is disabled; otherwise
2583
  * al = number of the last PCI-bus; other bytes of eax are destroyed
2584
  * al = number of the last PCI-bus; other bytes of eax are destroyed
2584
Remarks:
2585
Remarks:
2585
  * Previously low-level access to PCI for applications must be
2586
  * Previously low-level access to PCI for applications must be
2586
    enabled by subfunction 12 of function 21.
2587
    enabled by subfunction 12 of function 21.
2587
  * If PCI BIOS is not supported, the value of ax is undefined.
2588
  * If PCI BIOS is not supported, the value of ax is undefined.
2588
 
2589
 
2589
======================================================================
2590
======================================================================
2590
===================== Function 62, subfunction 2 =====================
2591
===================== Function 62, subfunction 2 =====================
2591
===== Get mechanism of addressing to the PCI configuration space. ====
2592
===== Get mechanism of addressing to the PCI configuration space. ====
2592
======================================================================
2593
======================================================================
2593
Parameters:
2594
Parameters:
2594
  * eax = 62 - function number
2595
  * eax = 62 - function number
2595
  * bl = 2 - subfunction number
2596
  * bl = 2 - subfunction number
2596
Returned value:
2597
Returned value:
2597
  * eax = -1 - access to PCI is disabled; otherwise
2598
  * eax = -1 - access to PCI is disabled; otherwise
2598
  * al = mechanism (1 or 2); other bytes of eax are destroyed
2599
  * al = mechanism (1 or 2); other bytes of eax are destroyed
2599
Remarks:
2600
Remarks:
2600
  * Previously low-level access to PCI for applications must be
2601
  * Previously low-level access to PCI for applications must be
2601
    enabled by subfunction 12 of function 21.
2602
    enabled by subfunction 12 of function 21.
2602
  * Addressing mechanism is selected depending on
2603
  * Addressing mechanism is selected depending on
2603
    equipment characteristics.
2604
    equipment characteristics.
2604
  * Subfunctions of read and write work automatically
2605
  * Subfunctions of read and write work automatically
2605
    with the selected mechanism.
2606
    with the selected mechanism.
2606
 
2607
 
2607
======================================================================
2608
======================================================================
2608
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
2609
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
2609
======================================================================
2610
======================================================================
2610
Parameters:
2611
Parameters:
2611
  * eax = 62 - function number
2612
  * eax = 62 - function number
2612
  * bl = 4 - read byte
2613
  * bl = 4 - read byte
2613
  * bl = 5 - read word
2614
  * bl = 5 - read word
2614
  * bl = 6 - read dword
2615
  * bl = 6 - read dword
2615
  * bh = number of PCI-bus
2616
  * bh = number of PCI-bus
2616
  * ch = dddddfff, where ddddd = number of the device on the bus,
2617
  * ch = dddddfff, where ddddd = number of the device on the bus,
2617
    fff = function number of device
2618
    fff = function number of device
2618
  * cl = number of register (must be even for bl=5,
2619
  * cl = number of register (must be even for bl=5,
2619
    divisible by 4 for bl=6)
2620
    divisible by 4 for bl=6)
2620
Returned value:
2621
Returned value:
2621
  * eax = -1 - error (access to PCI is disabled or parameters
2622
  * eax = -1 - error (access to PCI is disabled or parameters
2622
    are not supported); otherwise
2623
    are not supported); otherwise
2623
  * al/ax/eax (depending on requested size) contains the data;
2624
  * al/ax/eax (depending on requested size) contains the data;
2624
    the other part of register eax is destroyed
2625
    the other part of register eax is destroyed
2625
Remarks:
2626
Remarks:
2626
  * Previously low-level access to PCI for applications must be
2627
  * Previously low-level access to PCI for applications must be
2627
    enabled by subfunction 12 of function 21.
2628
    enabled by subfunction 12 of function 21.
2628
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2629
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2629
    function number. To get access mechanism use subfunction 2.
2630
    function number. To get access mechanism use subfunction 2.
2630
  * Some registers are standard and exist for all devices, some are
2631
  * Some registers are standard and exist for all devices, some are
2631
    defined by the concrete device. The list of registers of the
2632
    defined by the concrete device. The list of registers of the
2632
    first type can be found e.g. in famous
2633
    first type can be found e.g. in famous
2633
    Interrupt List by Ralf Brown
2634
    Interrupt List by Ralf Brown
2634
    (http://www.pobox.com/~ralf/files.html,
2635
    (http://www.pobox.com/~ralf/files.html,
2635
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
2636
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
2636
    registers of the second type must be listed
2637
    registers of the second type must be listed
2637
    in the device documentation.
2638
    in the device documentation.
2638
 
2639
 
2639
======================================================================
2640
======================================================================
2640
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
2641
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
2641
======================================================================
2642
======================================================================
2642
Parameters:
2643
Parameters:
2643
  * eax = 62 - function number
2644
  * eax = 62 - function number
2644
  * bl = 8 - write byte
2645
  * bl = 8 - write byte
2645
  * bl = 9 - write word
2646
  * bl = 9 - write word
2646
  * bl = 10 - write dword
2647
  * bl = 10 - write dword
2647
  * bh = number of PCI-bus
2648
  * bh = number of PCI-bus
2648
  * ch = dddddfff, where ddddd = number of the device on the bus,
2649
  * ch = dddddfff, where ddddd = number of the device on the bus,
2649
    fff = function number of device
2650
    fff = function number of device
2650
  * cl = number of register (must be even for bl=9,
2651
  * cl = number of register (must be even for bl=9,
2651
    divisible by 4 for bl=10)
2652
    divisible by 4 for bl=10)
2652
  * dl/dx/edx (depending on requested size) contatins
2653
  * dl/dx/edx (depending on requested size) contatins
2653
    the data to write
2654
    the data to write
2654
Returned value:
2655
Returned value:
2655
  * eax = -1 - error (access to PCI is disabled or parameters
2656
  * eax = -1 - error (access to PCI is disabled or parameters
2656
    are not supported)
2657
    are not supported)
2657
  * eax = 0 - success
2658
  * eax = 0 - success
2658
Remarks:
2659
Remarks:
2659
  * Previously low-level access to PCI for applications must be
2660
  * Previously low-level access to PCI for applications must be
2660
    enabled by subfunction 12 of function 21.
2661
    enabled by subfunction 12 of function 21.
2661
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2662
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2662
    function number. To get access mechanism use subfunction 2.
2663
    function number. To get access mechanism use subfunction 2.
2663
  * Some registers are standard and exist for all devices, some are
2664
  * Some registers are standard and exist for all devices, some are
2664
    defined by the concrete device. The list of registers of the
2665
    defined by the concrete device. The list of registers of the
2665
    first type can be found e.g. in famous Interrupt List by
2666
    first type can be found e.g. in famous Interrupt List by
2666
    Ralf Brown; registers of the second type must be listed
2667
    Ralf Brown; registers of the second type must be listed
2667
    in the device documentation.
2668
    in the device documentation.
2668
 
2669
 
2669
======================================================================
2670
======================================================================
2670
============== Function 63 - work with the debug board. ==============
2671
============== Function 63 - work with the debug board. ==============
2671
======================================================================
2672
======================================================================
2672
The debug board is the global system buffer (with the size
2673
The debug board is the global system buffer (with the size
2673
1024 bytes), to which any program can write (generally speaking,
2674
1024 bytes), to which any program can write (generally speaking,
2674
arbitrary) data and from which other program can read these data.
2675
arbitrary) data and from which other program can read these data.
2675
By the agreement written data are text strings interpreted as
2676
By the agreement written data are text strings interpreted as
2676
debug messages on a course of program execution. The kernel in
2677
debug messages on a course of program execution. The kernel in
2677
some situations also writes to the debug board information on
2678
some situations also writes to the debug board information on
2678
execution of some functions; by the agreement kernel messages
2679
execution of some functions; by the agreement kernel messages
2679
begins from the prefix "K : ".
2680
begins from the prefix "K : ".
2680
For view of the debug board the application 'board' was created,
2681
For view of the debug board the application 'board' was created,
2681
which reads data from the buffer and displays them in its window.
2682
which reads data from the buffer and displays them in its window.
2682
'board' interpretes the sequence of codes 13,10 as newline.
2683
'board' interpretes the sequence of codes 13,10 as newline.
2683
A character with null code in an end of line is not necessary,
2684
A character with null code in an end of line is not necessary,
2684
but also does not prevent.
2685
but also does not prevent.
2685
Because debugger has been written, the value of the debug board
2686
Because debugger has been written, the value of the debug board
2686
has decreased, as debugger allows to inspect completely a course of
2687
has decreased, as debugger allows to inspect completely a course of
2687
program execution without any efforts from the direction of program
2688
program execution without any efforts from the direction of program
2688
itself. Nevertheless in some cases the debug board is still useful.
2689
itself. Nevertheless in some cases the debug board is still useful.
2689
 
2690
 
2690
----------------------------- Write byte -----------------------------
2691
----------------------------- Write byte -----------------------------
2691
Parameters:
2692
Parameters:
2692
  * eax = 63 - function number
2693
  * eax = 63 - function number
2693
  * ebx = 1 - subfunction number
2694
  * ebx = 1 - subfunction number
2694
  * cl = data byte
2695
  * cl = data byte
2695
Returned value:
2696
Returned value:
2696
  * function does not return value
2697
  * function does not return value
2697
Remarks:
2698
Remarks:
2698
  * Byte is written to the buffer. Buffer size is 512 bytes.
2699
  * Byte is written to the buffer. Buffer size is 512 bytes.
2699
    At buffer overflow all obtained data are lost.
2700
    At buffer overflow all obtained data are lost.
2700
  * For output to the debug board of more complicated objects
2701
  * For output to the debug board of more complicated objects
2701
    (strings, numbers) it is enough to call this function in cycle.
2702
    (strings, numbers) it is enough to call this function in cycle.
2702
    It is possible not to write the appropriate code manually and use
2703
    It is possible not to write the appropriate code manually and use
2703
    file 'debug.inc', which is included into the distributive.
2704
    file 'debug.inc', which is included into the distributive.
2704
 
2705
 
2705
----------------------------- Read byte ------------------------------
2706
----------------------------- Read byte ------------------------------
2706
Takes away byte from the buffer.
2707
Takes away byte from the buffer.
2707
Parameters:
2708
Parameters:
2708
  * eax = 63 - function number
2709
  * eax = 63 - function number
2709
  * ebx = 2 - subfunction number
2710
  * ebx = 2 - subfunction number
2710
Returned value:
2711
Returned value:
2711
  * eax = ebx = 0 - the buffer is empty
2712
  * eax = ebx = 0 - the buffer is empty
2712
  * eax = byte, ebx = 1 - byte was successfully read
2713
  * eax = byte, ebx = 1 - byte was successfully read
2713
 
2714
 
2714
======================================================================
2715
======================================================================
2715
============== Function 64 - resize application memory. ==============
2716
============== Function 64 - resize application memory. ==============
2716
======================================================================
2717
======================================================================
2717
Parameters:
2718
Parameters:
2718
  * eax = 64 - function number
2719
  * eax = 64 - function number
2719
  * ebx = 1 - unique subfunction
2720
  * ebx = 1 - unique subfunction
2720
  * ecx = new memory size
2721
  * ecx = new memory size
2721
Returned value:
2722
Returned value:
2722
  * eax = 0 - success
2723
  * eax = 0 - success
2723
  * eax = 1 - not enough memory
2724
  * eax = 1 - not enough memory
2724
Remarks:
2725
Remarks:
2725
  * There is another way to dynamically allocate/free memory -
2726
  * There is another way to dynamically allocate/free memory -
2726
    subfunctions 11, 12, 13 of function 68.
2727
    subfunctions 11, 12, 13 of function 68.
2727
  * The function cannot be used together with 68.11, 68.12, 68.13.
2728
  * The function cannot be used together with 68.11, 68.12, 68.13.
2728
    The function call will be ignored after creation of process heap
2729
    The function call will be ignored after creation of process heap
2729
    with function 68.11.
2730
    with function 68.11.
2730
 
2731
 
2731
======================================================================
2732
======================================================================
2732
======== Function 65 - draw image with palette in the window. ========
2733
======== Function 65 - draw image with palette in the window. ========
2733
======================================================================
2734
======================================================================
2734
Parameters:
2735
Parameters:
2735
  * eax = 65 - function number
2736
  * eax = 65 - function number
2736
  * ebx = pointer to the image
2737
  * ebx = pointer to the image
2737
  * ecx = [size on axis x]*65536 + [size on axis y]
2738
  * ecx = [size on axis x]*65536 + [size on axis y]
2738
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2739
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2739
  * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
2740
  * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
2740
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
2741
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
2741
          ignored when esi > 8
2742
          ignored when esi > 8
2742
  * ebp = offset of next row data relative to previous row data
2743
  * ebp = offset of next row data relative to previous row data
2743
Returned value:
2744
Returned value:
2744
  * function does not return value
2745
  * function does not return value
2745
Remarks:
2746
Remarks:
2746
  * Coordinates of the image are coordinates of the upper left corner
2747
  * Coordinates of the image are coordinates of the upper left corner
2747
    of the image relative to the window.
2748
    of the image relative to the window.
2748
  * Format of image with 1 bit per pixel: each byte of image
2749
  * Format of image with 1 bit per pixel: each byte of image
2749
    (possibly excluding last bytes in rows), contains information on
2750
    (possibly excluding last bytes in rows), contains information on
2750
    the color of 8 pixels, MSB corresponds to first pixel.
2751
    the color of 8 pixels, MSB corresponds to first pixel.
2751
  * Format of image with 2 bits per pixel: each byte of image
2752
  * Format of image with 2 bits per pixel: each byte of image
2752
    (possibly excluding last bytes in rows), contains information on
2753
    (possibly excluding last bytes in rows), contains information on
2753
    the color of 4 pixels, two MSBs correspond to first pixel.
2754
    the color of 4 pixels, two MSBs correspond to first pixel.
2754
  * Format of image with 4 bits per pixel: each byte of image
2755
  * Format of image with 4 bits per pixel: each byte of image
2755
    excluding last bytes in rows (if width is odd) contains
2756
    excluding last bytes in rows (if width is odd) contains
2756
    information on the color of 2 pixels, high-order tetrad
2757
    information on the color of 2 pixels, high-order tetrad
2757
    corresponds to first pixel.
2758
    corresponds to first pixel.
2758
  * Format of image with 8 bits per pixel: each byte of image is
2759
  * Format of image with 8 bits per pixel: each byte of image is
2759
    index in the palette.
2760
    index in the palette.
2760
  * Format of image with 9 bits per pixel: array of one byte values;
2761
  * Format of image with 9 bits per pixel: array of one byte values;
2761
    each byte (8 bit) represents the intensity of gray for one pixel;
2762
    each byte (8 bit) represents the intensity of gray for one pixel;
2762
    this format is equal to 8bpp without palette.
2763
    this format is equal to 8bpp without palette.
2763
  * Format of image with 15 bits per pixel: the color of each pixel
2764
  * Format of image with 15 bits per pixel: the color of each pixel
2764
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
2765
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
2765
    each color.
2766
    each color.
2766
  * Format of image with 16 bits per pixel: the color of each pixel
2767
  * Format of image with 16 bits per pixel: the color of each pixel
2767
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
2768
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
2768
  * Format of image with 24 bits per pixel: the color of each pixel
2769
  * Format of image with 24 bits per pixel: the color of each pixel
2769
    is coded as 3 bytes - sequentially blue, green, red components.
2770
    is coded as 3 bytes - sequentially blue, green, red components.
2770
  * Format of image with 32 bits per pixel: similar to 24, but
2771
  * Format of image with 32 bits per pixel: similar to 24, but
2771
    one additional ignored byte is present.
2772
    one additional ignored byte is present.
2772
  * The call to function 7 is equivalent to call to this function
2773
  * The call to function 7 is equivalent to call to this function
2773
    with esi=24, ebp=0.
2774
    with esi=24, ebp=0.
2774
 
2775
 
2775
======================================================================
2776
======================================================================
2776
================== Function 66 - work with keyboard. =================
2777
================== Function 66 - work with keyboard. =================
2777
======================================================================
2778
======================================================================
2778
The input mode influences results of reading keys by function 2.
2779
The input mode influences results of reading keys by function 2.
2779
When a program loads, ASCII input mode is set for it.
2780
When a program loads, ASCII input mode is set for it.
2780
 
2781
 
2781
-------------- Subfunction 1 - set keyboard input mode. --------------
2782
-------------- Subfunction 1 - set keyboard input mode. --------------
2782
Parameters:
2783
Parameters:
2783
  * eax = 66 - function number
2784
  * eax = 66 - function number
2784
  * ebx = 1 - subfunction number
2785
  * ebx = 1 - subfunction number
2785
  * ecx = mode:
2786
  * ecx = mode:
2786
    * 0 = normal (ASCII-characters)
2787
    * 0 = normal (ASCII-characters)
2787
    * 1 = scancodes
2788
    * 1 = scancodes
2788
Returned value:
2789
Returned value:
2789
  * function does not return value
2790
  * function does not return value
2790
 
2791
 
2791
-------------- Subfunction 2 - get keyboard input mode. --------------
2792
-------------- Subfunction 2 - get keyboard input mode. --------------
2792
Parameters:
2793
Parameters:
2793
  * eax = 66 - function number
2794
  * eax = 66 - function number
2794
  * ebx = 2 - subfunction number
2795
  * ebx = 2 - subfunction number
2795
Returned value:
2796
Returned value:
2796
  * eax = current mode
2797
  * eax = current mode
2797
 
2798
 
2798
------------ Subfunction 3 - get status of control keys. -------------
2799
------------ Subfunction 3 - get status of control keys. -------------
2799
Parameters:
2800
Parameters:
2800
  * eax = 66 - function number
2801
  * eax = 66 - function number
2801
  * ebx = 3 - subfunction number
2802
  * ebx = 3 - subfunction number
2802
Returned value:
2803
Returned value:
2803
  * eax = bit mask:
2804
  * eax = bit mask:
2804
  * bit 0  (mask 1): left Shift is pressed
2805
  * bit 0  (mask 1): left Shift is pressed
2805
  * bit 1  (mask 2): right Shift is pressed
2806
  * bit 1  (mask 2): right Shift is pressed
2806
  * bit 2  (mask 4): left Ctrl is pressed
2807
  * bit 2  (mask 4): left Ctrl is pressed
2807
  * bit 3  (mask 8): right Ctrl is pressed
2808
  * bit 3  (mask 8): right Ctrl is pressed
2808
  * bit 4  (mask 0x10): left Alt is pressed
2809
  * bit 4  (mask 0x10): left Alt is pressed
2809
  * bit 5  (mask 0x20): right Alt is pressed
2810
  * bit 5  (mask 0x20): right Alt is pressed
2810
  * bit 6  (mask 0x40): CapsLock is on
2811
  * bit 6  (mask 0x40): CapsLock is on
2811
  * bit 7  (mask 0x80): NumLock is on
2812
  * bit 7  (mask 0x80): NumLock is on
2812
  * bit 8  (mask 0x100): ScrollLock is on
2813
  * bit 8  (mask 0x100): ScrollLock is on
2813
  * bit 9  (mask 0x200): left Win is pressed
2814
  * bit 9  (mask 0x200): left Win is pressed
2814
  * bit 10 (mask 0x400): right Win is pressed
2815
  * bit 10 (mask 0x400): right Win is pressed
2815
  * other bits are cleared
2816
  * other bits are cleared
2816
 
2817
 
2817
-------------- Subfunction 4 - set system-wide hotkey. ---------------
2818
-------------- Subfunction 4 - set system-wide hotkey. ---------------
2818
When hotkey is pressed, the system notifies only those applications,
2819
When hotkey is pressed, the system notifies only those applications,
2819
which have installed it; the active application (which receives
2820
which have installed it; the active application (which receives
2820
all normal input) does not receive such keys.
2821
all normal input) does not receive such keys.
2821
The notification consists in sending event with the code 2.
2822
The notification consists in sending event with the code 2.
2822
Reading hotkey is the same as reading normal key - by function 2.
2823
Reading hotkey is the same as reading normal key - by function 2.
2823
Parameters:
2824
Parameters:
2824
  * eax = 66 - function number
2825
  * eax = 66 - function number
2825
  * ebx = 4 - subfunction number
2826
  * ebx = 4 - subfunction number
2826
  * cl determines key scancode;
2827
  * cl determines key scancode;
2827
    use cl=0 to give combinations such as Ctrl+Shift
2828
    use cl=0 to give combinations such as Ctrl+Shift
2828
  * edx = 0xXYZ determines possible states of control keys:
2829
  * edx = 0xXYZ determines possible states of control keys:
2829
    * Z (low 4 bits) determines state of LShift and RShift:
2830
    * Z (low 4 bits) determines state of LShift and RShift:
2830
      * 0 = no key must be pressed;
2831
      * 0 = no key must be pressed;
2831
      * 1 = exactly one key must be pressed;
2832
      * 1 = exactly one key must be pressed;
2832
      * 2 = both keys must be pressed;
2833
      * 2 = both keys must be pressed;
2833
      * 3 = must be pressed LShift, but not RShift;
2834
      * 3 = must be pressed LShift, but not RShift;
2834
      * 4 = must be pressed RShift, but not LShift
2835
      * 4 = must be pressed RShift, but not LShift
2835
    * Y - similar for LCtrl and RCtrl;
2836
    * Y - similar for LCtrl and RCtrl;
2836
    * X - similar for LAlt and RAlt
2837
    * X - similar for LAlt and RAlt
2837
Returned value:
2838
Returned value:
2838
  * eax=0 - success
2839
  * eax=0 - success
2839
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
2840
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
2840
Remarks:
2841
Remarks:
2841
  * Hotkey can work either at pressing or at release. Release
2842
  * Hotkey can work either at pressing or at release. Release
2842
    scancode of a key is more on 128 than pressing scancode
2843
    scancode of a key is more on 128 than pressing scancode
2843
    (i.e. high bit is set).
2844
    (i.e. high bit is set).
2844
  * Several applications can set the same combination;
2845
  * Several applications can set the same combination;
2845
    all such applications will be informed on pressing
2846
    all such applications will be informed on pressing
2846
    such combination.
2847
    such combination.
2847
 
2848
 
2848
-------------- Subfunction 5 - delete installed hotkey. --------------
2849
-------------- Subfunction 5 - delete installed hotkey. --------------
2849
Parameters:
2850
Parameters:
2850
  * eax = 66 - function number
2851
  * eax = 66 - function number
2851
  * ebx = 5 - subfunction number
2852
  * ebx = 5 - subfunction number
2852
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
2853
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
2853
Returned value:
2854
Returned value:
2854
  * eax = 0 - success
2855
  * eax = 0 - success
2855
  * eax = 1 - there is no such hotkey
2856
  * eax = 1 - there is no such hotkey
2856
Remarks:
2857
Remarks:
2857
  * When a process/thread terminates, all hotkey installed by it are
2858
  * When a process/thread terminates, all hotkey installed by it are
2858
    deleted.
2859
    deleted.
2859
  * The call to this subfunction does not affect other applications.
2860
  * The call to this subfunction does not affect other applications.
2860
    If other application has defined the same combination, it will
2861
    If other application has defined the same combination, it will
2861
    still receive notices.
2862
    still receive notices.
2862
 
2863
 
2863
--------------- Subfunction 6 - block the normal input. --------------
2864
--------------- Subfunction 6 - block the normal input. --------------
2864
Parameters:
2865
Parameters:
2865
  * eax = 66 - function number
2866
  * eax = 66 - function number
2866
  * ebx = 6 - subfunction number
2867
  * ebx = 6 - subfunction number
2867
Returned value:
2868
Returned value:
2868
  * function does not return value
2869
  * function does not return value
2869
Remarks:
2870
Remarks:
2870
  * Blocking the normal keyboard input for installed hotkeys
2871
  * Blocking the normal keyboard input for installed hotkeys
2871
  * To emulate a mouse via the keyboard, the application MOUSEMUL
2872
  * To emulate a mouse via the keyboard, the application MOUSEMUL
2872
 
2873
 
2873
------------ Subfunction 7 - unlock the normal input. ----------------
2874
------------ Subfunction 7 - unlock the normal input. ----------------
2874
Parameters:
2875
Parameters:
2875
  * eax = 66 - function number
2876
  * eax = 66 - function number
2876
  * ebx = 7 - subfunction number
2877
  * ebx = 7 - subfunction number
2877
Returned value:
2878
Returned value:
2878
  * function does not return value
2879
  * function does not return value
2879
Remarks:
2880
Remarks:
2880
  * Unlocking the results of the f. 66.6
2881
  * Unlocking the results of the f. 66.6
2881
  * To emulate a mouse via the keyboard, the application MOUSEMUL
2882
  * To emulate a mouse via the keyboard, the application MOUSEMUL
2882
 
2883
 
2883
======================================================================
2884
======================================================================
2884
========= Function 67 - change position/sizes of the window. =========
2885
========= Function 67 - change position/sizes of the window. =========
2885
======================================================================
2886
======================================================================
2886
Parameters:
2887
Parameters:
2887
  * eax = 67 - function number
2888
  * eax = 67 - function number
2888
  * ebx = new x-coordinate of the window
2889
  * ebx = new x-coordinate of the window
2889
  * ecx = new y-coordinate of the window
2890
  * ecx = new y-coordinate of the window
2890
  * edx = new x-size of the window
2891
  * edx = new x-size of the window
2891
  * esi = new y-size of the window
2892
  * esi = new y-size of the window
2892
Returned value:
2893
Returned value:
2893
  * function does not return value
2894
  * function does not return value
2894
Remarks:
2895
Remarks:
2895
  * The value -1 for a parameter means "do not change"; e.g. to move
2896
  * The value -1 for a parameter means "do not change"; e.g. to move
2896
    the window without resizing it is possible to specify edx=esi=-1.
2897
    the window without resizing it is possible to specify edx=esi=-1.
2897
  * Previously the window must be defined by function 0.
2898
  * Previously the window must be defined by function 0.
2898
    It sets initial coordinates and sizes of the window.
2899
    It sets initial coordinates and sizes of the window.
2899
  * Sizes of the window are understood in sense of function 0,
2900
  * Sizes of the window are understood in sense of function 0,
2900
    that is one pixel less than real sizes.
2901
    that is one pixel less than real sizes.
2901
  * The function call for maximized windows is simply ignored.
2902
  * The function call for maximized windows is simply ignored.
2902
  * For windows of appropriate styles position and/or sizes can be
2903
  * For windows of appropriate styles position and/or sizes can be
2903
    changed by user; current position and sizes can be obtained by
2904
    changed by user; current position and sizes can be obtained by
2904
    call to function 9.
2905
    call to function 9.
2905
  * The function sends to the window redraw event (with the code 1).
2906
  * The function sends to the window redraw event (with the code 1).
2906
 
2907
 
2907
======================================================================
2908
======================================================================
2908
====== Function 68, subfunction 0 - get the task switch counter. =====
2909
====== Function 68, subfunction 0 - get the task switch counter. =====
2909
======================================================================
2910
======================================================================
2910
Parameters:
2911
Parameters:
2911
  * eax = 68 - function number
2912
  * eax = 68 - function number
2912
  * ebx = 0 - subfunction number
2913
  * ebx = 0 - subfunction number
2913
Returned value:
2914
Returned value:
2914
  * eax = number of task switches from the system booting
2915
  * eax = number of task switches from the system booting
2915
    (modulo 2^32)
2916
    (modulo 2^32)
2916
 
2917
 
2917
======================================================================
2918
======================================================================
2918
======= Function 68, subfunction 1 - switch to the next thread. ======
2919
======= Function 68, subfunction 1 - switch to the next thread. ======
2919
======================================================================
2920
======================================================================
2920
The function completes the current time slice allocated to the
2921
The function completes the current time slice allocated to the
2921
thread and switches to the next. (Which thread in which process
2922
thread and switches to the next. (Which thread in which process
2922
will be next, is unpredictable). Later, when execution queue
2923
will be next, is unpredictable). Later, when execution queue
2923
will reach the current thread, execution will be continued.
2924
will reach the current thread, execution will be continued.
2924
Parameters:
2925
Parameters:
2925
  * eax = 68 - function number
2926
  * eax = 68 - function number
2926
  * ebx = 1 - subfunction number
2927
  * ebx = 1 - subfunction number
2927
Returned value:
2928
Returned value:
2928
  * function does not return value
2929
  * function does not return value
2929
 
2930
 
2930
======================================================================
2931
======================================================================
2931
============= Function 68, subfunction 2 - cache + rdpmc. ============
2932
============= Function 68, subfunction 2 - cache + rdpmc. ============
2932
======================================================================
2933
======================================================================
2933
Parameters:
2934
Parameters:
2934
  * eax = 68 - function number
2935
  * eax = 68 - function number
2935
  * ebx = 2 - subfunction number
2936
  * ebx = 2 - subfunction number
2936
  * ecx = required action:
2937
  * ecx = required action:
2937
    * ecx = 0 - enable instruction 'rdpmc'
2938
    * ecx = 0 - enable instruction 'rdpmc'
2938
      (ReaD Performance-Monitoring Counters) for applications
2939
      (ReaD Performance-Monitoring Counters) for applications
2939
    * ecx = 1 - find out whether cache is disabled/enabled
2940
    * ecx = 1 - find out whether cache is disabled/enabled
2940
    * ecx = 2 - enable cache
2941
    * ecx = 2 - enable cache
2941
    * ecx = 3 - disable cache
2942
    * ecx = 3 - disable cache
2942
Returned value:
2943
Returned value:
2943
  * for ecx=0:
2944
  * for ecx=0:
2944
    * eax = the value of cr4
2945
    * eax = the value of cr4
2945
  * for ecx=1:
2946
  * for ecx=1:
2946
    * eax = (cr0 and 0x60000000):
2947
    * eax = (cr0 and 0x60000000):
2947
    * eax = 0 - cache is on
2948
    * eax = 0 - cache is on
2948
    * eax <> 0 - cache is off
2949
    * eax <> 0 - cache is off
2949
  * for ecx=2 and ecx=3:
2950
  * for ecx=2 and ecx=3:
2950
    * function does not return value
2951
    * function does not return value
2951
 
2952
 
2952
======================================================================
2953
======================================================================
2953
=========== Function 68, subfunction 3 - read MSR-register. ==========
2954
=========== Function 68, subfunction 3 - read MSR-register. ==========
2954
======================================================================
2955
======================================================================
2955
MSR = Model Specific Register; the complete list of MSR-registers
2956
MSR = Model Specific Register; the complete list of MSR-registers
2956
of a processor is included to the documentation on it (for example,
2957
of a processor is included to the documentation on it (for example,
2957
IA-32 Intel Architecture Software Developer's Manual,
2958
IA-32 Intel Architecture Software Developer's Manual,
2958
Volume 3, Appendix B); each processor family has its own subset
2959
Volume 3, Appendix B); each processor family has its own subset
2959
of the MSR-registers.
2960
of the MSR-registers.
2960
Parameters:
2961
Parameters:
2961
  * eax = 68 - function number
2962
  * eax = 68 - function number
2962
  * ebx = 3 - subfunction number
2963
  * ebx = 3 - subfunction number
2963
  * ecx is ignored
2964
  * ecx is ignored
2964
  * edx = MSR address
2965
  * edx = MSR address
2965
Returned value:
2966
Returned value:
2966
  * ebx:eax = high:low dword of the result
2967
  * ebx:eax = high:low dword of the result
2967
Remarks:
2968
Remarks:
2968
  * If ecx contains nonexistent or not implemented for this processor
2969
  * If ecx contains nonexistent or not implemented for this processor
2969
    MSR, processor will generate an exception in the kernel, which
2970
    MSR, processor will generate an exception in the kernel, which
2970
    will kill the thread.
2971
    will kill the thread.
2971
  * Previously it is necessary to check, whether MSRs are supported
2972
  * Previously it is necessary to check, whether MSRs are supported
2972
    as a whole, with the instruction 'cpuid'. Otherwise processor
2973
    as a whole, with the instruction 'cpuid'. Otherwise processor
2973
    will generate other exception in the kernel, which will anyway
2974
    will generate other exception in the kernel, which will anyway
2974
    kill the thread.
2975
    kill the thread.
2975
 
2976
 
2976
======================================================================
2977
======================================================================
2977
========= Function 68, subfunction 4 - write to MSR-register. ========
2978
========= Function 68, subfunction 4 - write to MSR-register. ========
2978
======================================================================
2979
======================================================================
2979
MSR = Model Specific Register; the complete list of MSR-registers
2980
MSR = Model Specific Register; the complete list of MSR-registers
2980
of a processor is included to the documentation on it (for example,
2981
of a processor is included to the documentation on it (for example,
2981
IA-32 Intel Architecture Software Developer's Manual,
2982
IA-32 Intel Architecture Software Developer's Manual,
2982
Volume 3, Appendix B); each processor family has its own subset
2983
Volume 3, Appendix B); each processor family has its own subset
2983
of the MSR-registers.
2984
of the MSR-registers.
2984
Parameters:
2985
Parameters:
2985
  * eax = 68 - function number
2986
  * eax = 68 - function number
2986
  * ebx = 4 - subfunction number
2987
  * ebx = 4 - subfunction number
2987
  * ecx is ignored
2988
  * ecx is ignored
2988
  * edx = MSR address
2989
  * edx = MSR address
2989
  * esi:edi = high:low dword
2990
  * esi:edi = high:low dword
2990
Returned value:
2991
Returned value:
2991
  * function does not return value
2992
  * function does not return value
2992
Remarks:
2993
Remarks:
2993
  * If ecx contains nonexistent or not implemented for this processor
2994
  * If ecx contains nonexistent or not implemented for this processor
2994
    MSR, processor will generate an exception in the kernel, which
2995
    MSR, processor will generate an exception in the kernel, which
2995
    will kill the thread.
2996
    will kill the thread.
2996
  * Previously it is necessary to check, whether MSRs are supported
2997
  * Previously it is necessary to check, whether MSRs are supported
2997
    as a whole, with the instruction 'cpuid'. Otherwise processor
2998
    as a whole, with the instruction 'cpuid'. Otherwise processor
2998
    will generate other exception in the kernel, which will anyway
2999
    will generate other exception in the kernel, which will anyway
2999
    kill the thread.
3000
    kill the thread.
3000
 
3001
 
3001
======================================================================
3002
======================================================================
3002
======= Function 68, subfunction 11 - initialize process heap. =======
3003
======= Function 68, subfunction 11 - initialize process heap. =======
3003
======================================================================
3004
======================================================================
3004
Parameters:
3005
Parameters:
3005
  * eax = 68 - function number
3006
  * eax = 68 - function number
3006
  * ebx = 11 - subfunction number
3007
  * ebx = 11 - subfunction number
3007
Returned value:
3008
Returned value:
3008
  * eax = 0 - failed
3009
  * eax = 0 - failed
3009
  * otherwise size of created heap
3010
  * otherwise size of created heap
3010
Remarks:
3011
Remarks:
3011
  * The function call initializes heap, from which one can in future
3012
  * The function call initializes heap, from which one can in future
3012
    allocate and free memory blocks with subfunctions 12 and 13.
3013
    allocate and free memory blocks with subfunctions 12 and 13.
3013
    Heap size is equal to total amount of free application memory.
3014
    Heap size is equal to total amount of free application memory.
3014
  * The second function call from the same process results in
3015
  * The second function call from the same process results in
3015
    returning the size of the existing heap.
3016
    returning the size of the existing heap.
3016
  * After creation of the heap calls to function 64 will be ignored.
3017
  * After creation of the heap calls to function 64 will be ignored.
3017
 
3018
 
3018
======================================================================
3019
======================================================================
3019
======== Function 68, subfunction 12 - allocate memory block. ========
3020
======== Function 68, subfunction 12 - allocate memory block. ========
3020
======================================================================
3021
======================================================================
3021
Parameters:
3022
Parameters:
3022
  * eax = 68 - function number
3023
  * eax = 68 - function number
3023
  * ebx = 12 - subfunction number
3024
  * ebx = 12 - subfunction number
3024
  * ecx = required size in bytes
3025
  * ecx = required size in bytes
3025
Returned value:
3026
Returned value:
3026
  * eax = pointer to the allocated block
3027
  * eax = pointer to the allocated block
3027
Remarks:
3028
Remarks:
3028
  * Before this call one must initialize process heap by call to
3029
  * Before this call one must initialize process heap by call to
3029
    subfunction 11.
3030
    subfunction 11.
3030
  * The function allocates an integer number of pages (4 Kb) in such
3031
  * The function allocates an integer number of pages (4 Kb) in such
3031
    way that the real size of allocated block is more than or equal to
3032
    way that the real size of allocated block is more than or equal to
3032
    requested size.
3033
    requested size.
3033
 
3034
 
3034
======================================================================
3035
======================================================================
3035
========== Function 68, subfunction 13 - free memory block. ==========
3036
========== Function 68, subfunction 13 - free memory block. ==========
3036
======================================================================
3037
======================================================================
3037
Parameters:
3038
Parameters:
3038
  * eax = 68 - function number
3039
  * eax = 68 - function number
3039
  * ebx = 13 - subfunction number
3040
  * ebx = 13 - subfunction number
3040
  * ecx = pointer to the memory block
3041
  * ecx = pointer to the memory block
3041
Returned value:
3042
Returned value:
3042
  * eax = 1 - success
3043
  * eax = 1 - success
3043
  * eax = 0 - failed
3044
  * eax = 0 - failed
3044
Remarks:
3045
Remarks:
3045
  * The memory block must have been allocated by subfunction 12
3046
  * The memory block must have been allocated by subfunction 12
3046
    or subfunction 20.
3047
    or subfunction 20.
3047
 
3048
 
3048
======================================================================
3049
======================================================================
3049
===================== Function 68, subfunction 14 ====================
3050
===================== Function 68, subfunction 14 ====================
3050
============ Wait for signal from another program/driver. ============
3051
============ Wait for signal from another program/driver. ============
3051
======================================================================
3052
======================================================================
3052
Parameters:
3053
Parameters:
3053
  * eax = 68 - function number
3054
  * eax = 68 - function number
3054
  * ebx = 14 - subfunction number
3055
  * ebx = 14 - subfunction number
3055
  * ecx = pointer to the buffer for information (24 bytes)
3056
  * ecx = pointer to the buffer for information (24 bytes)
3056
Returned value:
3057
Returned value:
3057
  * buffer pointed to by ecx contains the following information:
3058
  * buffer pointed to by ecx contains the following information:
3058
    * +0: dword: identifier for following data of signal
3059
    * +0: dword: identifier for following data of signal
3059
    * +4: dword: data of signal (20 bytes), format of which is defined
3060
    * +4: dword: data of signal (20 bytes), format of which is defined
3060
          by the first dword
3061
          by the first dword
3061
 
3062
 
3062
======================================================================
3063
======================================================================
3063
============= Function 68, subfunction 16 - load driver. =============
3064
============= Function 68, subfunction 16 - load driver. =============
3064
======================================================================
3065
======================================================================
3065
Parameters:
3066
Parameters:
3066
  * eax = 68 - function number
3067
  * eax = 68 - function number
3067
  * ebx = 16 - subfunction number
3068
  * ebx = 16 - subfunction number
3068
  * ecx = pointer to ASCIIZ-string with driver name
3069
  * ecx = pointer to ASCIIZ-string with driver name
3069
Returned value:
3070
Returned value:
3070
  * eax = 0 - failed
3071
  * eax = 0 - failed
3071
  * otherwise eax = driver handle
3072
  * otherwise eax = driver handle
3072
Remarks:
3073
Remarks:
3073
  * If the driver was not loaded yet, it is loaded;
3074
  * If the driver was not loaded yet, it is loaded;
3074
    if the driver was loaded yet, nothing happens.
3075
    if the driver was loaded yet, nothing happens.
3075
  * Driver name is case-sensitive.
3076
  * Driver name is case-sensitive.
3076
    Maximum length of the name is 16 characters, including
3077
    Maximum length of the name is 16 characters, including
3077
    terminating null character, the rest is ignored.
3078
    terminating null character, the rest is ignored.
3078
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3079
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3079
 
3080
 
3080
======================================================================
3081
======================================================================
3081
============ Function 68, subfunction 17 - driver control. ===========
3082
============ Function 68, subfunction 17 - driver control. ===========
3082
======================================================================
3083
======================================================================
3083
Parameters:
3084
Parameters:
3084
  * eax = 68 - function number
3085
  * eax = 68 - function number
3085
  * ebx = 17 - subfunction number
3086
  * ebx = 17 - subfunction number
3086
  * ecx = pointer to the control structure:
3087
  * ecx = pointer to the control structure:
3087
    * +0: dword: handle of driver
3088
    * +0: dword: handle of driver
3088
    * +4: dword: code of driver function
3089
    * +4: dword: code of driver function
3089
    * +8: dword: pointer to input data
3090
    * +8: dword: pointer to input data
3090
    * +12 = +0xC: dword: size of input data
3091
    * +12 = +0xC: dword: size of input data
3091
    * +16 = +0x10: dword: pointer to output data
3092
    * +16 = +0x10: dword: pointer to output data
3092
    * +20 = +0x14: dword: size of output data
3093
    * +20 = +0x14: dword: size of output data
3093
Returned value:
3094
Returned value:
3094
  * eax = determined by driver
3095
  * eax = determined by driver
3095
Remarks:
3096
Remarks:
3096
  * Function codes and the structure of input/output data
3097
  * Function codes and the structure of input/output data
3097
    are defined by driver.
3098
    are defined by driver.
3098
  * Previously one must obtain driver handle by subfunction 16.
3099
  * Previously one must obtain driver handle by subfunction 16.
3099
 
3100
 
3100
======================================================================
3101
======================================================================
3101
=============== Function 68, subfunction 19 - load DLL. ==============
3102
=============== Function 68, subfunction 19 - load DLL. ==============
3102
======================================================================
3103
======================================================================
3103
Parameters:
3104
Parameters:
3104
  * eax = 68 - function number
3105
  * eax = 68 - function number
3105
  * ebx = 19 - subfunction number
3106
  * ebx = 19 - subfunction number
3106
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3107
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3107
Returned value:
3108
Returned value:
3108
  * eax = 0 - failed
3109
  * eax = 0 - failed
3109
  * otherwise eax = pointer to DLL export table
3110
  * otherwise eax = pointer to DLL export table
3110
Remarks:
3111
Remarks:
3111
  * Export table is an array of structures of 2 dword's, terminated
3112
  * Export table is an array of structures of 2 dword's, terminated
3112
    by zero. The first dword in structure points to function name,
3113
    by zero. The first dword in structure points to function name,
3113
    the second dword contains address of function.
3114
    the second dword contains address of function.
3114
 
3115
 
3115
======================================================================
3116
======================================================================
3116
======= Function 68, subfunction 20 - reallocate memory block. =======
3117
======= Function 68, subfunction 20 - reallocate memory block. =======
3117
======================================================================
3118
======================================================================
3118
Parameters:
3119
Parameters:
3119
  * eax = 68 - function number
3120
  * eax = 68 - function number
3120
  * ebx = 20 - subfunction number
3121
  * ebx = 20 - subfunction number
3121
  * ecx = new size in bytes
3122
  * ecx = new size in bytes
3122
  * edx = pointer to already allocated block
3123
  * edx = pointer to already allocated block
3123
Returned value:
3124
Returned value:
3124
  * eax = pointer to the reallocated block, 0 = error
3125
  * eax = pointer to the reallocated block, 0 = error
3125
Remarks:
3126
Remarks:
3126
  * Before this call one must initialize process heap by call to
3127
  * Before this call one must initialize process heap by call to
3127
    subfunction 11.
3128
    subfunction 11.
3128
  * The function allocates an integer number of pages (4 Kb) in such
3129
  * The function allocates an integer number of pages (4 Kb) in such
3129
    way that the real size of allocated block is more than or equal to
3130
    way that the real size of allocated block is more than or equal to
3130
    requested size.
3131
    requested size.
3131
  * If edx=0, the function call is equivalent to memory allocation
3132
  * If edx=0, the function call is equivalent to memory allocation
3132
    with subfunction 12. Otherwise the block at edx
3133
    with subfunction 12. Otherwise the block at edx
3133
    must be allocated earlier with subfunction 12 or this subfunction.
3134
    must be allocated earlier with subfunction 12 or this subfunction.
3134
  * If ecx=0, the function frees memory block at edx and returns 0.
3135
  * If ecx=0, the function frees memory block at edx and returns 0.
3135
  * The contents of the block are unchanged up to the shorter of
3136
  * The contents of the block are unchanged up to the shorter of
3136
    the new and old sizes.
3137
    the new and old sizes.
3137
 
3138
 
3138
======================================================================
3139
======================================================================
3139
=========== Function 68, subfunction 21 - load driver PE. ============
3140
=========== Function 68, subfunction 21 - load driver PE. ============
3140
======================================================================
3141
======================================================================
3141
Parameters:
3142
Parameters:
3142
  * eax = 68 - function number
3143
  * eax = 68 - function number
3143
  * ebx = 21 - subfunction number
3144
  * ebx = 21 - subfunction number
3144
  * ecx = pointer to ASCIIZ-string with driver name
3145
  * ecx = pointer to ASCIIZ-string with driver name
3145
  * edx = pointer to command line
3146
  * edx = pointer to command line
3146
Returned value:
3147
Returned value:
3147
  * eax = 0 - failed
3148
  * eax = 0 - failed
3148
  * otherwise eax = driver handle
3149
  * otherwise eax = driver handle
3149
Remarks:
3150
Remarks:
3150
  * If the driver was not loaded yet, it is loaded;
3151
  * If the driver was not loaded yet, it is loaded;
3151
    if the driver was loaded yet, nothing happens.
3152
    if the driver was loaded yet, nothing happens.
3152
 
3153
 
3153
======================================================================
3154
======================================================================
3154
======== Function 68, subfunction 22 - open named memory area. =======
3155
======== Function 68, subfunction 22 - open named memory area. =======
3155
======================================================================
3156
======================================================================
3156
Parameters:
3157
Parameters:
3157
  * eax = 68 - function number
3158
  * eax = 68 - function number
3158
  * ebx = 22 - subfunction number
3159
  * ebx = 22 - subfunction number
3159
  * ecx = area name. Maximum of 31 characters with terminating zero
3160
  * ecx = area name. Maximum of 31 characters with terminating zero
3160
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3161
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3161
  * esi = flags for open and access:
3162
  * esi = flags for open and access:
3162
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3163
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3163
                          with such name does not exist, the function
3164
                          with such name does not exist, the function
3164
                          will return error code 5.
3165
                          will return error code 5.
3165
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3166
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3166
                          memory area.
3167
                          memory area.
3167
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3168
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3168
                          with such name already exists, the function
3169
                          with such name already exists, the function
3169
                          will return error code 10.
3170
                          will return error code 10.
3170
    * SHM_READ        = 0x00 - only read access
3171
    * SHM_READ        = 0x00 - only read access
3171
    * SHM_WRITE       = 0x01 - read and write access
3172
    * SHM_WRITE       = 0x01 - read and write access
3172
Returned value:
3173
Returned value:
3173
  * eax = pointer to memory area, 0 if error has occured
3174
  * eax = pointer to memory area, 0 if error has occured
3174
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3175
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3175
    edx = 0 - success, otherwise - error code
3176
    edx = 0 - success, otherwise - error code
3176
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3177
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3177
    edx = error code (if eax=0) or area size in bytes
3178
    edx = error code (if eax=0) or area size in bytes
3178
Error codes:
3179
Error codes:
3179
  * E_NOTFOUND = 5
3180
  * E_NOTFOUND = 5
3180
  * E_ACCESS = 10
3181
  * E_ACCESS = 10
3181
  * E_NOMEM = 30
3182
  * E_NOMEM = 30
3182
  * E_PARAM = 33
3183
  * E_PARAM = 33
3183
Remarks:
3184
Remarks:
3184
  * Before this call one must initialize process heap by call to
3185
  * Before this call one must initialize process heap by call to
3185
    subfunction 11.
3186
    subfunction 11.
3186
  * If a new area is created, access flags set maximal rights
3187
  * If a new area is created, access flags set maximal rights
3187
    for other processes. An attempt from other process to open
3188
    for other processes. An attempt from other process to open
3188
    with denied rights will fail with error code E_ACCESS.
3189
    with denied rights will fail with error code E_ACCESS.
3189
  * The process which has created an area always has write access.
3190
  * The process which has created an area always has write access.
3190
 
3191
 
3191
======================================================================
3192
======================================================================
3192
======= Function 68, subfunction 23 - close named memory area. =======
3193
======= Function 68, subfunction 23 - close named memory area. =======
3193
======================================================================
3194
======================================================================
3194
Parameters:
3195
Parameters:
3195
  * eax = 68 - function number
3196
  * eax = 68 - function number
3196
  * ebx = 23 - subfunction number
3197
  * ebx = 23 - subfunction number
3197
  * ecx = area name. Maximum of 31 characters with terminating zero
3198
  * ecx = area name. Maximum of 31 characters with terminating zero
3198
Returned value:
3199
Returned value:
3199
  * eax destroyed
3200
  * eax destroyed
3200
Remarks:
3201
Remarks:
3201
  * A memory area is physically freed (with deleting all data and
3202
  * A memory area is physically freed (with deleting all data and
3202
    freeing physical memory), when all threads which have opened
3203
    freeing physical memory), when all threads which have opened
3203
    this area will close it.
3204
    this area will close it.
3204
  * When thread is terminating, all opened by it areas are closed.
3205
  * When thread is terminating, all opened by it areas are closed.
3205
 
3206
 
3206
======================================================================
3207
======================================================================
3207
======== Function 68, subfunction 24 - set exception handler. ========
3208
======== Function 68, subfunction 24 - set exception handler. ========
3208
======================================================================
3209
======================================================================
3209
Parameters:
3210
Parameters:
3210
  * eax = 68 - function number
3211
  * eax = 68 - function number
3211
  * ebx = 24 - subfunction number
3212
  * ebx = 24 - subfunction number
3212
  * ecx = address of the new exception handler
3213
  * ecx = address of the new exception handler
3213
  * edx = the mask of handled exceptions
3214
  * edx = the mask of handled exceptions
3214
Returned value:
3215
Returned value:
3215
  * eax = address of the old exception handler (0, if it was not set)
3216
  * eax = address of the old exception handler (0, if it was not set)
3216
  * ebx = the old mask of handled exceptions
3217
  * ebx = the old mask of handled exceptions
3217
Remarks:
3218
Remarks:
3218
  * Bit number in mask of exceptions corresponds to exception number
3219
  * Bit number in mask of exceptions corresponds to exception number
3219
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3220
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3220
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3221
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3221
  * The current implementation ignores the inquiry for hook of 7
3222
  * The current implementation ignores the inquiry for hook of 7
3222
    exception - the system handles #NM by its own.
3223
    exception - the system handles #NM by its own.
3223
  * The exception handler is called with exception number as first
3224
  * The exception handler is called with exception number as first
3224
    (and only) stack parameter. So, correct exit from the handler is
3225
    (and only) stack parameter. So, correct exit from the handler is
3225
    RET 4. It returns to the instruction, that caused the exception,
3226
    RET 4. It returns to the instruction, that caused the exception,
3226
    for faults, and to the next instruction for traps (see
3227
    for faults, and to the next instruction for traps (see
3227
    classification of exceptions in CPU specification).
3228
    classification of exceptions in CPU specification).
3228
  * When user handler receives control, the corresponding bit in
3229
  * When user handler receives control, the corresponding bit in
3229
    the exception mask is cleared. Raising this exception
3230
    the exception mask is cleared. Raising this exception
3230
    in consequence leads to default handling, that is,
3231
    in consequence leads to default handling, that is,
3231
    terminating the application in absence of debugger or
3232
    terminating the application in absence of debugger or
3232
    suspend with notification of debugger otherwise.
3233
    suspend with notification of debugger otherwise.
3233
  * After user handler completes critical operations, it can set
3234
  * After user handler completes critical operations, it can set
3234
    the corresponding bit in the exception mask with subfunction 25.
3235
    the corresponding bit in the exception mask with subfunction 25.
3235
    Also user handler is responsible for clearing exceptions flags in
3236
    Also user handler is responsible for clearing exceptions flags in
3236
    FPU and/or SSE.
3237
    FPU and/or SSE.
3237
 
3238
 
3238
======================================================================
3239
======================================================================
3239
====== Function 68, subfunction 25 - set FPU exception handler. ======
3240
====== Function 68, subfunction 25 - set FPU exception handler. ======
3240
======================================================================
3241
======================================================================
3241
Parameters:
3242
Parameters:
3242
  * eax = 68 - function number
3243
  * eax = 68 - function number
3243
  * ebx = 25 - subfunction number
3244
  * ebx = 25 - subfunction number
3244
  * ecx = signal number
3245
  * ecx = signal number
3245
  * edx = value of activity (0/1)
3246
  * edx = value of activity (0/1)
3246
Returned value:
3247
Returned value:
3247
  * eax = -1 - invalid signal number
3248
  * eax = -1 - invalid signal number
3248
  * otherwise eax = old value of activity for this signal (0/1)
3249
  * otherwise eax = old value of activity for this signal (0/1)
3249
Remarks:
3250
Remarks:
3250
  * In current implementation only mask for user excepton handler,
3251
  * In current implementation only mask for user excepton handler,
3251
    which has been previously set by subfunction 24,
3252
    which has been previously set by subfunction 24,
3252
    is changed. Signal number corresponds to exception number.
3253
    is changed. Signal number corresponds to exception number.
3253
 
3254
 
3254
======================================================================
3255
======================================================================
3255
====== Function 68, subfunction 26 - release memory pages ============
3256
====== Function 68, subfunction 26 - release memory pages ============
3256
======================================================================
3257
======================================================================
3257
Parameters:
3258
Parameters:
3258
  * eax = 68 - function number
3259
  * eax = 68 - function number
3259
  * ebx = 26 - subfunction number
3260
  * ebx = 26 - subfunction number
3260
  * ecx = pointer to the memory block, allocated by subfunction 12
3261
  * ecx = pointer to the memory block, allocated by subfunction 12
3261
  * edx = offset from the block beginnings
3262
  * edx = offset from the block beginnings
3262
  * esi = the size of the region of memory to release, in bytes
3263
  * esi = the size of the region of memory to release, in bytes
3263
Remarks:
3264
Remarks:
3264
  * function release range of pages from ecx+edx to ecx+edx+esi
3265
  * function release range of pages from ecx+edx to ecx+edx+esi
3265
    and set virtual memory into reserved state.
3266
    and set virtual memory into reserved state.
3266
 
3267
 
3267
======================================================================
3268
======================================================================
3268
========== Function 68, subfunction 27 - load file ===================
3269
========== Function 68, subfunction 27 - load file ===================
3269
======================================================================
3270
======================================================================
3270
Parameters:
3271
Parameters:
3271
  * eax = 68 - function number
3272
  * eax = 68 - function number
3272
  * ebx = 27 - subfunction number
3273
  * ebx = 27 - subfunction number
3273
  * ecx = pointer to ASCIIZ-string with the filename
3274
  * ecx = pointer to ASCIIZ-string with the filename
3274
Returned value:
3275
Returned value:
3275
  * eax = pointer to the loaded file, or zero
3276
  * eax = pointer to the loaded file, or zero
3276
  * edx = size of the loaded file, or zero
3277
  * edx = size of the loaded file, or zero
3277
Remarks:
3278
Remarks:
3278
  * function loads file and unpacks, if necessary
3279
  * function loads file and unpacks, if necessary
3279
 
3280
 
3280
======================================================================
3281
======================================================================
3281
====================== Function 69 - debugging. ======================
3282
====================== Function 69 - debugging. ======================
3282
======================================================================
3283
======================================================================
3283
A process can load other process as debugged by set of corresponding
3284
A process can load other process as debugged by set of corresponding
3284
bit by call to subfunction 7 of function 70.
3285
bit by call to subfunction 7 of function 70.
3285
A process can have only one debugger; one process can debug some
3286
A process can have only one debugger; one process can debug some
3286
others. The system notifies debugger on events occuring with
3287
others. The system notifies debugger on events occuring with
3287
debugged process. Messages are written to the buffer defined by
3288
debugged process. Messages are written to the buffer defined by
3288
subfunction 0.
3289
subfunction 0.
3289
Format of a message:
3290
Format of a message:
3290
  * +0: dword: message code
3291
  * +0: dword: message code
3291
  * +4: dword: PID of debugged process
3292
  * +4: dword: PID of debugged process
3292
  * +8: there can be additional data depending on message code
3293
  * +8: there can be additional data depending on message code
3293
Message codes:
3294
Message codes:
3294
  * 1 = exception
3295
  * 1 = exception
3295
    * in addition dword-number of the exception is given
3296
    * in addition dword-number of the exception is given
3296
    * process is suspended
3297
    * process is suspended
3297
  * 2 = process has terminated
3298
  * 2 = process has terminated
3298
    * comes at any termination: both through the system function -1,
3299
    * comes at any termination: both through the system function -1,
3299
      and at "murder" by any other process (including debugger itself)
3300
      and at "murder" by any other process (including debugger itself)
3300
  * 3 = debug exception int 1 = #DB
3301
  * 3 = debug exception int 1 = #DB
3301
    * in addition dword-image of the register DR6 is given:
3302
    * in addition dword-image of the register DR6 is given:
3302
      * bits 0-3: condition of the corresponding breakpoint (set by
3303
      * bits 0-3: condition of the corresponding breakpoint (set by
3303
        subfunction 9) is satisfied
3304
        subfunction 9) is satisfied
3304
      * bit 14: exception has occured because of the trace mode
3305
      * bit 14: exception has occured because of the trace mode
3305
        (flag TF is set TF)
3306
        (flag TF is set TF)
3306
    * process is suspended
3307
    * process is suspended
3307
When debugger terminates, all debugged processes are killed.
3308
When debugger terminates, all debugged processes are killed.
3308
If debugger does not want this, it must previously detach by
3309
If debugger does not want this, it must previously detach by
3309
subfunction 3.
3310
subfunction 3.
3310
 
3311
 
3311
All subfunctions are applicable only to processes/threads started
3312
All subfunctions are applicable only to processes/threads started
3312
from the current by function 70 with set debugging flag.
3313
from the current by function 70 with set debugging flag.
3313
Debugging of multithreaded programs is not supported yet.
3314
Debugging of multithreaded programs is not supported yet.
3314
The full list of subfunctions:
3315
The full list of subfunctions:
3315
  * subfunction 0 - define data area for debug messages
3316
  * subfunction 0 - define data area for debug messages
3316
  * subfunction 1 - get contents of registers of debugged thread
3317
  * subfunction 1 - get contents of registers of debugged thread
3317
  * subfunction 2 - set contents of registers of debugged thread
3318
  * subfunction 2 - set contents of registers of debugged thread
3318
  * subfunction 3 - detach from debugged process
3319
  * subfunction 3 - detach from debugged process
3319
  * subfunction 4 - suspend debugged thread
3320
  * subfunction 4 - suspend debugged thread
3320
  * subfunction 5 - resume debugged thread
3321
  * subfunction 5 - resume debugged thread
3321
  * subfunction 6 - read from the memory of debugged process
3322
  * subfunction 6 - read from the memory of debugged process
3322
  * subfunction 7 - write to the memory of debugged process
3323
  * subfunction 7 - write to the memory of debugged process
3323
  * subfunction 8 - terminate debugged thread
3324
  * subfunction 8 - terminate debugged thread
3324
  * subfunction 9 - set/clear hardware breakpoint
3325
  * subfunction 9 - set/clear hardware breakpoint
3325
 
3326
 
3326
======================================================================
3327
======================================================================
3327
= Function 69, subfunction 0 - define data area fror debug messages. =
3328
= Function 69, subfunction 0 - define data area fror debug messages. =
3328
======================================================================
3329
======================================================================
3329
Parameters:
3330
Parameters:
3330
  * eax = 69 - function number
3331
  * eax = 69 - function number
3331
  * ebx = 0 - subfunction number
3332
  * ebx = 0 - subfunction number
3332
  * ecx = pointer
3333
  * ecx = pointer
3333
Format of data area:
3334
Format of data area:
3334
  * +0: dword: N = buffer size (not including this header)
3335
  * +0: dword: N = buffer size (not including this header)
3335
  * +4: dword: occupied place
3336
  * +4: dword: occupied place
3336
  * +8: N*byte: buffer
3337
  * +8: N*byte: buffer
3337
Returned value:
3338
Returned value:
3338
  * function does not return value
3339
  * function does not return value
3339
Remarks:
3340
Remarks:
3340
  * If the size field is negative, the buffer is considered locked
3341
  * If the size field is negative, the buffer is considered locked
3341
    and at arrival of new message the system will wait.
3342
    and at arrival of new message the system will wait.
3342
    For synchronization frame all work with the buffer by operations
3343
    For synchronization frame all work with the buffer by operations
3343
    lock/unlock
3344
    lock/unlock
3344
    	neg	[bufsize]
3345
    	neg	[bufsize]
3345
  * Data in the buffer are considered as array of items with variable
3346
  * Data in the buffer are considered as array of items with variable
3346
    length - messages. Format of a message is explained in
3347
    length - messages. Format of a message is explained in
3347
    general description.
3348
    general description.
3348
 
3349
 
3349
======================================================================
3350
======================================================================
3350
===================== Function 69, subfunction 1 =====================
3351
===================== Function 69, subfunction 1 =====================
3351
============ Get contents of registers of debugged thread. ===========
3352
============ Get contents of registers of debugged thread. ===========
3352
======================================================================
3353
======================================================================
3353
Parameters:
3354
Parameters:
3354
  * eax = 69 - function number
3355
  * eax = 69 - function number
3355
  * ebx = 1 - subfunction number
3356
  * ebx = 1 - subfunction number
3356
  * ecx = thread identifier
3357
  * ecx = thread identifier
3357
  * edx = size of context structure, must be 0x28=40 bytes
3358
  * edx = size of context structure, must be 0x28=40 bytes
3358
  * esi = pointer to context structure
3359
  * esi = pointer to context structure
3359
Returned value:
3360
Returned value:
3360
  * function does not return value
3361
  * function does not return value
3361
Format of context structure: (FPU is not supported yet)
3362
Format of context structure: (FPU is not supported yet)
3362
  * +0: dword: eip
3363
  * +0: dword: eip
3363
  * +4: dword: eflags
3364
  * +4: dword: eflags
3364
  * +8: dword: eax
3365
  * +8: dword: eax
3365
  * +12 = +0xC: dword: ecx
3366
  * +12 = +0xC: dword: ecx
3366
  * +16 = +0x10: dword: edx
3367
  * +16 = +0x10: dword: edx
3367
  * +20 = +0x14: dword: ebx
3368
  * +20 = +0x14: dword: ebx
3368
  * +24 = +0x18: dword: esp
3369
  * +24 = +0x18: dword: esp
3369
  * +28 = +0x1C: dword: ebp
3370
  * +28 = +0x1C: dword: ebp
3370
  * +32 = +0x20: dword: esi
3371
  * +32 = +0x20: dword: esi
3371
  * +36 = +0x24: dword: edi
3372
  * +36 = +0x24: dword: edi
3372
Remarks:
3373
Remarks:
3373
  * If the thread executes code of ring-0, the function returns
3374
  * If the thread executes code of ring-0, the function returns
3374
    contents of registers of ring-3.
3375
    contents of registers of ring-3.
3375
  * Process must be loaded for debugging (as is shown in
3376
  * Process must be loaded for debugging (as is shown in
3376
    general description).
3377
    general description).
3377
 
3378
 
3378
======================================================================
3379
======================================================================
3379
===================== Function 69, subfunction 2 =====================
3380
===================== Function 69, subfunction 2 =====================
3380
============ Set contents of registers of debugged thread. ===========
3381
============ Set contents of registers of debugged thread. ===========
3381
======================================================================
3382
======================================================================
3382
Parameters:
3383
Parameters:
3383
  * eax = 69 - function number
3384
  * eax = 69 - function number
3384
  * ebx = 2 - subfunction number
3385
  * ebx = 2 - subfunction number
3385
  * ecx = thread identifier
3386
  * ecx = thread identifier
3386
  * edx = size of context structure, must be 0x28=40 bytes
3387
  * edx = size of context structure, must be 0x28=40 bytes
3387
Returned value:
3388
Returned value:
3388
  * function does not return value
3389
  * function does not return value
3389
Format of context structure is shown in the description of
3390
Format of context structure is shown in the description of
3390
subfunction 1.
3391
subfunction 1.
3391
Remarks:
3392
Remarks:
3392
  * If the thread executes code of ring-0, the function returns
3393
  * If the thread executes code of ring-0, the function returns
3393
    contents of registers of ring-3.
3394
    contents of registers of ring-3.
3394
  * Process must be loaded for debugging (as is shown in
3395
  * Process must be loaded for debugging (as is shown in
3395
    general description).
3396
    general description).
3396
 
3397
 
3397
======================================================================
3398
======================================================================
3398
===== Function 69, subfunction 3 - detach from debugged process. =====
3399
===== Function 69, subfunction 3 - detach from debugged process. =====
3399
======================================================================
3400
======================================================================
3400
Parameters:
3401
Parameters:
3401
  * eax = 69 - function number
3402
  * eax = 69 - function number
3402
  * ebx = 3 - subfunction number
3403
  * ebx = 3 - subfunction number
3403
  * ecx = identifier
3404
  * ecx = identifier
3404
Returned value:
3405
Returned value:
3405
  * function does not return value
3406
  * function does not return value
3406
Remarks:
3407
Remarks:
3407
  * If the process was suspended, it resumes execution.
3408
  * If the process was suspended, it resumes execution.
3408
 
3409
 
3409
======================================================================
3410
======================================================================
3410
======== Function 69, subfunction 4 - suspend debugged thread. =======
3411
======== Function 69, subfunction 4 - suspend debugged thread. =======
3411
======================================================================
3412
======================================================================
3412
Parameters:
3413
Parameters:
3413
  * eax = 69 - function number
3414
  * eax = 69 - function number
3414
  * ebx = 4 - subfunction number
3415
  * ebx = 4 - subfunction number
3415
  * ecx = thread identifier
3416
  * ecx = thread identifier
3416
Returned value:
3417
Returned value:
3417
  * function does not return value
3418
  * function does not return value
3418
Remarks:
3419
Remarks:
3419
  * Process must be loaded for debugging (as is shown in
3420
  * Process must be loaded for debugging (as is shown in
3420
    general description).
3421
    general description).
3421
 
3422
 
3422
======================================================================
3423
======================================================================
3423
======== Function 69, subfunction 5 - resume debugged thread. ========
3424
======== Function 69, subfunction 5 - resume debugged thread. ========
3424
======================================================================
3425
======================================================================
3425
Parameters:
3426
Parameters:
3426
  * eax = 69 - function number
3427
  * eax = 69 - function number
3427
  * ebx = 5 - subfunction number
3428
  * ebx = 5 - subfunction number
3428
  * ecx = thread identifier
3429
  * ecx = thread identifier
3429
Returned value:
3430
Returned value:
3430
  * function does not return value
3431
  * function does not return value
3431
Remarks:
3432
Remarks:
3432
  * Process must be loaded for debugging (as is shown in
3433
  * Process must be loaded for debugging (as is shown in
3433
    general description).
3434
    general description).
3434
 
3435
 
3435
======================================================================
3436
======================================================================
3436
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3437
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3437
======================================================================
3438
======================================================================
3438
Parameters:
3439
Parameters:
3439
  * eax = 69 - function number
3440
  * eax = 69 - function number
3440
  * ebx = 6 - subfunction number
3441
  * ebx = 6 - subfunction number
3441
  * ecx = identifier
3442
  * ecx = identifier
3442
  * edx = number of bytes to read
3443
  * edx = number of bytes to read
3443
  * esi = address in the memory of debugged process
3444
  * esi = address in the memory of debugged process
3444
  * edi = pointer to buffer for data
3445
  * edi = pointer to buffer for data
3445
Returned value:
3446
Returned value:
3446
  * eax = -1 at an error (invalid PID or buffer)
3447
  * eax = -1 at an error (invalid PID or buffer)
3447
  * otherwise eax = number of read bytes (possibly, 0,
3448
  * otherwise eax = number of read bytes (possibly, 0,
3448
    if esi is too large)
3449
    if esi is too large)
3449
Remarks:
3450
Remarks:
3450
  * Process must be loaded for debugging (as is shown in
3451
  * Process must be loaded for debugging (as is shown in
3451
    general description).
3452
    general description).
3452
 
3453
 
3453
======================================================================
3454
======================================================================
3454
== Function 69, subfunction 7 - write to memory of debugged process. =
3455
== Function 69, subfunction 7 - write to memory of debugged process. =
3455
======================================================================
3456
======================================================================
3456
Parameters:
3457
Parameters:
3457
  * eax = 69 - function number
3458
  * eax = 69 - function number
3458
  * ebx = 7 - subfunction number
3459
  * ebx = 7 - subfunction number
3459
  * ecx = identifier
3460
  * ecx = identifier
3460
  * edx = number of bytes to write
3461
  * edx = number of bytes to write
3461
  * esi = address of memory in debugged process
3462
  * esi = address of memory in debugged process
3462
  * edi = pointer to data
3463
  * edi = pointer to data
3463
Returned value:
3464
Returned value:
3464
  * eax = -1 at an error (invalid PID or buffer)
3465
  * eax = -1 at an error (invalid PID or buffer)
3465
  * otherwise eax = number of written bytes (possibly, 0,
3466
  * otherwise eax = number of written bytes (possibly, 0,
3466
    if esi is too large)
3467
    if esi is too large)
3467
Remarks:
3468
Remarks:
3468
  * Process must be loaded for debugging (as is shown in
3469
  * Process must be loaded for debugging (as is shown in
3469
    general description).
3470
    general description).
3470
 
3471
 
3471
======================================================================
3472
======================================================================
3472
======= Function 69, subfunction 8 - terminate debugged thread. ======
3473
======= Function 69, subfunction 8 - terminate debugged thread. ======
3473
======================================================================
3474
======================================================================
3474
Parameters:
3475
Parameters:
3475
  * eax = 69 - function number
3476
  * eax = 69 - function number
3476
  * ebx = 8 - subfunction number
3477
  * ebx = 8 - subfunction number
3477
  * ecx = identifier
3478
  * ecx = identifier
3478
Returned value:
3479
Returned value:
3479
  * function does not return value
3480
  * function does not return value
3480
Remarks:
3481
Remarks:
3481
  * Process must be loaded for debugging (as is shown in
3482
  * Process must be loaded for debugging (as is shown in
3482
    general description).
3483
    general description).
3483
  * The function is similar to subfunction 2 of function 18
3484
  * The function is similar to subfunction 2 of function 18
3484
    with two differences: it requires first remark and
3485
    with two differences: it requires first remark and
3485
    accepts PID rather than slot number.
3486
    accepts PID rather than slot number.
3486
 
3487
 
3487
======================================================================
3488
======================================================================
3488
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3489
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3489
======================================================================
3490
======================================================================
3490
Parameters:
3491
Parameters:
3491
  * eax = 69 - function number
3492
  * eax = 69 - function number
3492
  * ebx = 9 - subfunction number
3493
  * ebx = 9 - subfunction number
3493
  * ecx = thread identifier
3494
  * ecx = thread identifier
3494
  * dl = index of breakpoint, from 0 to 3 inclusively
3495
  * dl = index of breakpoint, from 0 to 3 inclusively
3495
  * dh = flags:
3496
  * dh = flags:
3496
    * if high bit is cleared - set breakpoint:
3497
    * if high bit is cleared - set breakpoint:
3497
      * bits 0-1 - condition:
3498
      * bits 0-1 - condition:
3498
        * 00 = breakpoint on execution
3499
        * 00 = breakpoint on execution
3499
        * 01 = breakpoint on read
3500
        * 01 = breakpoint on read
3500
        * 11 = breakpoint on read/write
3501
        * 11 = breakpoint on read/write
3501
      * bits 2-3 - length; for breakpoints on exception it must be
3502
      * bits 2-3 - length; for breakpoints on exception it must be
3502
        00, otherwise one of
3503
        00, otherwise one of
3503
        * 00 = byte
3504
        * 00 = byte
3504
        * 01 = word
3505
        * 01 = word
3505
        * 11 = dword
3506
        * 11 = dword
3506
      * esi = breakpoint address; must be aligned according to
3507
      * esi = breakpoint address; must be aligned according to
3507
        the length (i.e. must be even for word breakpoints,
3508
        the length (i.e. must be even for word breakpoints,
3508
        divisible by 4 for dword)
3509
        divisible by 4 for dword)
3509
    * if high bit is set - clear breakpoint
3510
    * if high bit is set - clear breakpoint
3510
Returned value:
3511
Returned value:
3511
  * eax = 0 - success
3512
  * eax = 0 - success
3512
  * eax = 1 - error in the input data
3513
  * eax = 1 - error in the input data
3513
  * eax = 2 - (reserved, is never returned in the current
3514
  * eax = 2 - (reserved, is never returned in the current
3514
    implementation) a global breakpoint with that index is already set
3515
    implementation) a global breakpoint with that index is already set
3515
Remarks:
3516
Remarks:
3516
  * Process must be loaded for debugging (as is shown in
3517
  * Process must be loaded for debugging (as is shown in
3517
    general description).
3518
    general description).
3518
  * Hardware breakpoints are implemented through DRx-registers of
3519
  * Hardware breakpoints are implemented through DRx-registers of
3519
    the processor, all limitations results from this.
3520
    the processor, all limitations results from this.
3520
  * The function can reinstall the breakpoint, previously set
3521
  * The function can reinstall the breakpoint, previously set
3521
    by it (and it does not inform on this).
3522
    by it (and it does not inform on this).
3522
    Carry on the list of set breakpoints in the debugger.
3523
    Carry on the list of set breakpoints in the debugger.
3523
  * Breakpoints generate debug exception #DB, on which the system
3524
  * Breakpoints generate debug exception #DB, on which the system
3524
    notifies debugger.
3525
    notifies debugger.
3525
  * Breakpoints on write and read/write act after
3526
  * Breakpoints on write and read/write act after
3526
    execution of the caused it instruction.
3527
    execution of the caused it instruction.
3527
 
3528
 
3528
======================================================================
3529
======================================================================
3529
==== Function 70 - work with file system with long names support. ====
3530
==== Function 70 - work with file system with long names support. ====
3530
======================================================================
3531
======================================================================
3531
Parameters:
3532
Parameters:
3532
  * eax = 70
3533
  * eax = 70
3533
  * ebx = pointer to the information structure
3534
  * ebx = pointer to the information structure
3534
Returned value:
3535
Returned value:
3535
  * eax = 0 - success; otherwise file system error code
3536
  * eax = 0 - success; otherwise file system error code
3536
  * some subfunctions return value in other registers too
3537
  * some subfunctions return value in other registers too
3537
General format of the information structure:
3538
General format of the information structure:
3538
  * +0: dword: subfunction number
3539
  * +0: dword: subfunction number
3539
  * +4: dword: file offset
3540
  * +4: dword: file offset
3540
  * +8: dword: high dword of offset (must be 0) or flags field
3541
  * +8: dword: high dword of offset (must be 0) or flags field
3541
  * +12 = +0xC: dword: size
3542
  * +12 = +0xC: dword: size
3542
  * +16 = +0x10: dword: pointer to data
3543
  * +16 = +0x10: dword: pointer to data
3543
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3544
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3544
    or
3545
    or
3545
  * +20 = +0x14: db 0
3546
  * +20 = +0x14: db 0
3546
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3547
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3547
Specifications - in documentation on the appropriate subfunction.
3548
Specifications - in documentation on the appropriate subfunction.
3548
Filename is case-insensitive. Russian letters must be written in
3549
Filename is case-insensitive. Russian letters must be written in
3549
the encoding cp866 (DOS).
3550
the encoding cp866 (DOS).
3550
Format of filename:
3551
Format of filename:
3551
/base/number/dir1/dir2/.../dirn/file,
3552
/base/number/dir1/dir2/.../dirn/file,
3552
where /base/number identifies device, on which file is located:
3553
where /base/number identifies device, on which file is located:
3553
one of
3554
one of
3554
  * /RD/1 = /RAMDISK/1 to access ramdisk
3555
  * /RD/1 = /RAMDISK/1 to access ramdisk
3555
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3556
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3556
    /FD/2 = /FLOPPYDISK/2 to access second one
3557
    /FD/2 = /FLOPPYDISK/2 to access second one
3557
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3558
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3558
    IDE0 (Primary Master), IDE1 (Primary Slave),
3559
    IDE0 (Primary Master), IDE1 (Primary Slave),
3559
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3560
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3560
    x - partition number on the selected hard drive, varies from 1
3561
    x - partition number on the selected hard drive, varies from 1
3561
    to 255 (on each hard drive the indexing starts from 1)
3562
    to 255 (on each hard drive the indexing starts from 1)
3562
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3563
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3563
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3564
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3564
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3565
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3565
  * /SYS means system folder; with the usual boot (from floppy)
3566
  * /SYS means system folder; with the usual boot (from floppy)
3566
    is equivalent to /RD/1
3567
    is equivalent to /RD/1
3567
Examples:
3568
Examples:
3568
  * '/rd/1/kernel.asm',0
3569
  * '/rd/1/kernel.asm',0
3569
  * '/HD0/1/kernel.asm',0
3570
  * '/HD0/1/kernel.asm',0
3570
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3571
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3571
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3572
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3572
  * '/sys/MySuperApp.ini',0
3573
  * '/sys/MySuperApp.ini',0
3573
Also function supports relative names.  If the path begins not
3574
Also function supports relative names.  If the path begins not
3574
with '/', it is considered relative to a current folder. To get or
3575
with '/', it is considered relative to a current folder. To get or
3575
set a current folder, use the function 30.
3576
set a current folder, use the function 30.
3576
 
3577
 
3577
Available subfunctions:
3578
Available subfunctions:
3578
  * subfunction 0 - read file
3579
  * subfunction 0 - read file
3579
  * subfunction 1 - read folder
3580
  * subfunction 1 - read folder
3580
  * subfunction 2 - create/rewrite file
3581
  * subfunction 2 - create/rewrite file
3581
  * subfunction 3 - write to existing file
3582
  * subfunction 3 - write to existing file
3582
  * subfunction 4 - set file size
3583
  * subfunction 4 - set file size
3583
  * subfunction 5 - get attributes of file/folder
3584
  * subfunction 5 - get attributes of file/folder
3584
  * subfunction 6 - set attributes of file/folder
3585
  * subfunction 6 - set attributes of file/folder
3585
  * subfunction 7 - start application
3586
  * subfunction 7 - start application
3586
  * subfunction 8 - delete file/folder
3587
  * subfunction 8 - delete file/folder
3587
  * subfunction 9 - create folder
3588
  * subfunction 9 - create folder
3588
For CD-drives due to hardware limitations only subfunctions
3589
For CD-drives due to hardware limitations only subfunctions
3589
0,1,5 and 7 are available, other subfunctions return error
3590
0,1,5 and 7 are available, other subfunctions return error
3590
with code 2.
3591
with code 2.
3591
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3592
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3592
(CD and DVD) the manual control of tray is locked due to caching
3593
(CD and DVD) the manual control of tray is locked due to caching
3593
drive data. Unlocking is made when subfunction 4 of function 24
3594
drive data. Unlocking is made when subfunction 4 of function 24
3594
is called for corresponding device.
3595
is called for corresponding device.
3595
 
3596
 
3596
======================================================================
3597
======================================================================
3597
=== Function 70, subfunction 0 - read file with long names support. ==
3598
=== Function 70, subfunction 0 - read file with long names support. ==
3598
======================================================================
3599
======================================================================
3599
Parameters:
3600
Parameters:
3600
  * eax = 70 - function number
3601
  * eax = 70 - function number
3601
  * ebx = pointer to the information structure
3602
  * ebx = pointer to the information structure
3602
Format of the information structure:
3603
Format of the information structure:
3603
  * +0: dword: 0 = subfunction number
3604
  * +0: dword: 0 = subfunction number
3604
  * +4: dword: file offset (in bytes)
3605
  * +4: dword: file offset (in bytes)
3605
  * +8: dword: 0 (reserved for high dword of offset)
3606
  * +8: dword: 0 (reserved for high dword of offset)
3606
  * +12 = +0xC: dword: number of bytes to read
3607
  * +12 = +0xC: dword: number of bytes to read
3607
  * +16 = +0x10: dword: pointer to buffer for data
3608
  * +16 = +0x10: dword: pointer to buffer for data
3608
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3609
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3609
    given in the general description
3610
    given in the general description
3610
    or
3611
    or
3611
  * +20 = +0x14: db 0
3612
  * +20 = +0x14: db 0
3612
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3613
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3613
Returned value:
3614
Returned value:
3614
  * eax = 0 - success, otherwise file system error code
3615
  * eax = 0 - success, otherwise file system error code
3615
  * ebx = number of read bytes or -1=0xffffffff if file was not found
3616
  * ebx = number of read bytes or -1=0xffffffff if file was not found
3616
Remarks:
3617
Remarks:
3617
  * If file was ended before last requested block was read,
3618
  * If file was ended before last requested block was read,
3618
    the function will read as many as it can, and after that return
3619
    the function will read as many as it can, and after that return
3619
    eax=6 (EOF).
3620
    eax=6 (EOF).
3620
  * The function does not allow to read folder (returns eax=10,
3621
  * The function does not allow to read folder (returns eax=10,
3621
    access denied).
3622
    access denied).
3622
 
3623
 
3623
======================================================================
3624
======================================================================
3624
== Function 70, subfunction 1 - read folder with long names support. =
3625
== Function 70, subfunction 1 - read folder with long names support. =
3625
======================================================================
3626
======================================================================
3626
Parameters:
3627
Parameters:
3627
  * eax = 70 - function number
3628
  * eax = 70 - function number
3628
  * ebx = pointer to the information structure
3629
  * ebx = pointer to the information structure
3629
Format of the information structure:
3630
Format of the information structure:
3630
  * +0: dword: 1 = subfunction number
3631
  * +0: dword: 1 = subfunction number
3631
  * +4: dword: index of starting block (beginning from 0)
3632
  * +4: dword: index of starting block (beginning from 0)
3632
  * +8: dword: flags field:
3633
  * +8: dword: flags field:
3633
    * bit 0 (mask 1): in what format to return names,
3634
    * bit 0 (mask 1): in what format to return names,
3634
      0=ANSI, 1=UNICODE
3635
      0=ANSI, 1=UNICODE
3635
    * other bits are reserved and must be set to 0 for the future
3636
    * other bits are reserved and must be set to 0 for the future
3636
      compatibility
3637
      compatibility
3637
  * +12 = +0xC: dword: number of blocks to read
3638
  * +12 = +0xC: dword: number of blocks to read
3638
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
3639
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
3639
    must be not less than 32 + [+12]*560 bytes
3640
    must be not less than 32 + [+12]*560 bytes
3640
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3641
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3641
    given in the general description
3642
    given in the general description
3642
    or
3643
    or
3643
  * +20 = +0x14: db 0
3644
  * +20 = +0x14: db 0
3644
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3645
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3645
Returned value:
3646
Returned value:
3646
  * eax = 0 - success, otherwise file system error code
3647
  * eax = 0 - success, otherwise file system error code
3647
  * ebx = number of files, information on which was written to
3648
  * ebx = number of files, information on which was written to
3648
    the buffer, or -1=0xffffffff, if folder was not found
3649
    the buffer, or -1=0xffffffff, if folder was not found
3649
Structure of the buffer:
3650
Structure of the buffer:
3650
  * +0: 32*byte: header
3651
  * +0: 32*byte: header
3651
  * +32 = +0x20: n1*byte: block with information on file 1
3652
  * +32 = +0x20: n1*byte: block with information on file 1
3652
  * +32+n1: n2*byte: block with information on file 2
3653
  * +32+n1: n2*byte: block with information on file 2
3653
  * ...
3654
  * ...
3654
Structure of header:
3655
Structure of header:
3655
  * +0: dword: version of structure (current is 1)
3656
  * +0: dword: version of structure (current is 1)
3656
  * +4: dword: number of placed blocks; is not greater than requested
3657
  * +4: dword: number of placed blocks; is not greater than requested
3657
    in the field +12 of information structure; can be less, if
3658
    in the field +12 of information structure; can be less, if
3658
    there are no more files in folder (the same as in ebx)
3659
    there are no more files in folder (the same as in ebx)
3659
  * +8: dword: total number of files in folder
3660
  * +8: dword: total number of files in folder
3660
  * +12 = +0xC: 20*byte: reserved (zeroed)
3661
  * +12 = +0xC: 20*byte: reserved (zeroed)
3661
Structure of block of data for folder entry (BDFE):
3662
Structure of block of data for folder entry (BDFE):
3662
  * +0: dword: attributes of file:
3663
  * +0: dword: attributes of file:
3663
    * bit 0 (mask 1): file is read-only
3664
    * bit 0 (mask 1): file is read-only
3664
    * bit 1 (mask 2): file is hidden
3665
    * bit 1 (mask 2): file is hidden
3665
    * bit 2 (mask 4): file is system
3666
    * bit 2 (mask 4): file is system
3666
    * bit 3 (mask 8): this is not a file but volume label
3667
    * bit 3 (mask 8): this is not a file but volume label
3667
      (for one partition meets no more than once and
3668
      (for one partition meets no more than once and
3668
      only in root folder)
3669
      only in root folder)
3669
    * bit 4 (mask 0x10): this is a folder
3670
    * bit 4 (mask 0x10): this is a folder
3670
    * bit 5 (mask 0x20): file was not archived - many archivation
3671
    * bit 5 (mask 0x20): file was not archived - many archivation
3671
      programs have an option to archive only files with this bit set,
3672
      programs have an option to archive only files with this bit set,
3672
      and after archiving this bit is cleared - it can be useful
3673
      and after archiving this bit is cleared - it can be useful
3673
      for automatically creating of backup-archives as at writing
3674
      for automatically creating of backup-archives as at writing
3674
      this bit is usually set
3675
      this bit is usually set
3675
  * +4: byte: type of name data:
3676
  * +4: byte: type of name data:
3676
    (coincides with bit 0 of flags in the information structure)
3677
    (coincides with bit 0 of flags in the information structure)
3677
    * 0 = ASCII = 1-byte representation of each character
3678
    * 0 = ASCII = 1-byte representation of each character
3678
    * 1 = UNICODE = 2-byte representation of each character
3679
    * 1 = UNICODE = 2-byte representation of each character
3679
  * +5: 3*byte: reserved (zero)
3680
  * +5: 3*byte: reserved (zero)
3680
  * +8: 4*byte: time of file creation
3681
  * +8: 4*byte: time of file creation
3681
  * +12 = +0xC: 4*byte: date of file creation
3682
  * +12 = +0xC: 4*byte: date of file creation
3682
  * +16 = +0x10: 4*byte: time of last access (read or write)
3683
  * +16 = +0x10: 4*byte: time of last access (read or write)
3683
  * +20 = +0x14: 4*byte: date of last access
3684
  * +20 = +0x14: 4*byte: date of last access
3684
  * +24 = +0x18: 4*byte: time of last modification
3685
  * +24 = +0x18: 4*byte: time of last modification
3685
  * +28 = +0x1C: 4*byte: date of last modification
3686
  * +28 = +0x1C: 4*byte: date of last modification
3686
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
3687
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
3687
  * +40 = +0x28: name
3688
  * +40 = +0x28: name
3688
    * for ASCII format: maximum length is 263 characters
3689
    * for ASCII format: maximum length is 263 characters
3689
      (263 bytes), byte after the name has value 0
3690
      (263 bytes), byte after the name has value 0
3690
    * for UNICODE format: maximum length is 259 characters
3691
    * for UNICODE format: maximum length is 259 characters
3691
      (518 bytes), 2 bytes after the name have value 0
3692
      (518 bytes), 2 bytes after the name have value 0
3692
Time format:
3693
Time format:
3693
  * +0: byte: seconds
3694
  * +0: byte: seconds
3694
  * +1: byte: minutes
3695
  * +1: byte: minutes
3695
  * +2: byte: hours
3696
  * +2: byte: hours
3696
  * +3: byte: reserved (0)
3697
  * +3: byte: reserved (0)
3697
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
3698
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
3698
Date format:
3699
Date format:
3699
  * +0: byte: day
3700
  * +0: byte: day
3700
  * +1: byte: month
3701
  * +1: byte: month
3701
  * +2: word: year
3702
  * +2: word: year
3702
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
3703
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
3703
Remarks:
3704
Remarks:
3704
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
3705
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
3705
    if UNICODE name - 560 bytes. Value of length is aligned
3706
    if UNICODE name - 560 bytes. Value of length is aligned
3706
    on 16-byte bound (to accelerate processing in CPU cache).
3707
    on 16-byte bound (to accelerate processing in CPU cache).
3707
  * First character after a name is zero (ASCIIZ-string). The further
3708
  * First character after a name is zero (ASCIIZ-string). The further
3708
    data contain garbage.
3709
    data contain garbage.
3709
  * If files in folder were ended before requested number was read,
3710
  * If files in folder were ended before requested number was read,
3710
    the function will read as many as it can, and after that return
3711
    the function will read as many as it can, and after that return
3711
    eax=6 (EOF).
3712
    eax=6 (EOF).
3712
  * Any folder on the disk, except for root, contains two special
3713
  * Any folder on the disk, except for root, contains two special
3713
    entries "." and "..", identifying accordingly the folder itself
3714
    entries "." and "..", identifying accordingly the folder itself
3714
    and the parent folder.
3715
    and the parent folder.
3715
  * The function allows also to read virtual folders "/", "/rd",
3716
  * The function allows also to read virtual folders "/", "/rd",
3716
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
3717
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
3717
    and times and dates are zeroed. An alternative way to get the
3718
    and times and dates are zeroed. An alternative way to get the
3718
    equipment information - subfunction 11 of function 18.
3719
    equipment information - subfunction 11 of function 18.
3719
 
3720
 
3720
======================================================================
3721
======================================================================
3721
===================== Function 70, subfunction 2 =====================
3722
===================== Function 70, subfunction 2 =====================
3722
============ Create/rewrite file with long names support. ============
3723
============ Create/rewrite file with long names support. ============
3723
======================================================================
3724
======================================================================
3724
Parameters:
3725
Parameters:
3725
  * eax = 70 - function number
3726
  * eax = 70 - function number
3726
  * ebx = pointer to the information structure
3727
  * ebx = pointer to the information structure
3727
Format of the information structure:
3728
Format of the information structure:
3728
  * +0: dword: 2 = subfunction number
3729
  * +0: dword: 2 = subfunction number
3729
  * +4: dword: 0 (reserved)
3730
  * +4: dword: 0 (reserved)
3730
  * +8: dword: 0 (reserved)
3731
  * +8: dword: 0 (reserved)
3731
  * +12 = +0xC: dword: number of bytes to write
3732
  * +12 = +0xC: dword: number of bytes to write
3732
  * +16 = +0x10: dword: pointer to data
3733
  * +16 = +0x10: dword: pointer to data
3733
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3734
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3734
    given in the general description
3735
    given in the general description
3735
    or
3736
    or
3736
  * +20 = +0x14: db 0
3737
  * +20 = +0x14: db 0
3737
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3738
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3738
Returned value:
3739
Returned value:
3739
  * eax = 0 - success, otherwise file system error code
3740
  * eax = 0 - success, otherwise file system error code
3740
  * ebx = number of written bytes (possibly 0)
3741
  * ebx = number of written bytes (possibly 0)
3741
Remarks:
3742
Remarks:
3742
  * If a file with given name did not exist, it is created;
3743
  * If a file with given name did not exist, it is created;
3743
    if it existed, it is rewritten.
3744
    if it existed, it is rewritten.
3744
  * If there is not enough free space on disk, the function will
3745
  * If there is not enough free space on disk, the function will
3745
    write as many as can and then return error code 8.
3746
    write as many as can and then return error code 8.
3746
  * The function is not supported for CD (returns error code 2).
3747
  * The function is not supported for CD (returns error code 2).
3747
 
3748
 
3748
======================================================================
3749
======================================================================
3749
===================== Function 70, subfunction 3 =====================
3750
===================== Function 70, subfunction 3 =====================
3750
=========== Write to existing file with long names support. ==========
3751
=========== Write to existing file with long names support. ==========
3751
======================================================================
3752
======================================================================
3752
Parameters:
3753
Parameters:
3753
  * eax = 70 - function number
3754
  * eax = 70 - function number
3754
  * ebx = pointer to the information structure
3755
  * ebx = pointer to the information structure
3755
Format of the information structure:
3756
Format of the information structure:
3756
  * +0: dword: 3 = subfunction number
3757
  * +0: dword: 3 = subfunction number
3757
  * +4: dword: file offset (in bytes)
3758
  * +4: dword: file offset (in bytes)
3758
  * +8: dword: high dword of offset (must be 0 for FAT)
3759
  * +8: dword: high dword of offset (must be 0 for FAT)
3759
  * +12 = +0xC: dword: number of bytes to write
3760
  * +12 = +0xC: dword: number of bytes to write
3760
  * +16 = +0x10: dword: pointer to data
3761
  * +16 = +0x10: dword: pointer to data
3761
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3762
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3762
    given in the general description
3763
    given in the general description
3763
    or
3764
    or
3764
  * +20 = +0x14: db 0
3765
  * +20 = +0x14: db 0
3765
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3766
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3766
Returned value:
3767
Returned value:
3767
  * eax = 0 - success, otherwise file system error code
3768
  * eax = 0 - success, otherwise file system error code
3768
  * ebx = number of written bytes (possibly 0)
3769
  * ebx = number of written bytes (possibly 0)
3769
Remarks:
3770
Remarks:
3770
  * The file must already exist, otherwise function returns eax=5.
3771
  * The file must already exist, otherwise function returns eax=5.
3771
  * The only result of write 0 bytes is update in the file attributes
3772
  * The only result of write 0 bytes is update in the file attributes
3772
    date/time of modification and access to the current date/time.
3773
    date/time of modification and access to the current date/time.
3773
  * If beginning and/or ending position is greater than file size
3774
  * If beginning and/or ending position is greater than file size
3774
    (except for the previous case), the file is expanded to needed
3775
    (except for the previous case), the file is expanded to needed
3775
    size with zero characters.
3776
    size with zero characters.
3776
  * The function is not supported for CD (returns error code 2).
3777
  * The function is not supported for CD (returns error code 2).
3777
 
3778
 
3778
======================================================================
3779
======================================================================
3779
============ Function 70, subfunction 4 - set end of file. ===========
3780
============ Function 70, subfunction 4 - set end of file. ===========
3780
======================================================================
3781
======================================================================
3781
Parameters:
3782
Parameters:
3782
  * eax = 70 - function number
3783
  * eax = 70 - function number
3783
  * ebx = pointer to the information structure
3784
  * ebx = pointer to the information structure
3784
Format of the information structure:
3785
Format of the information structure:
3785
  * +0: dword: 4 = subfunction number
3786
  * +0: dword: 4 = subfunction number
3786
  * +4: dword: low dword of new file size
3787
  * +4: dword: low dword of new file size
3787
  * +8: dword: high dword of new file size (must be 0 for FAT)
3788
  * +8: dword: high dword of new file size (must be 0 for FAT)
3788
  * +12 = +0xC: dword: 0 (reserved)
3789
  * +12 = +0xC: dword: 0 (reserved)
3789
  * +16 = +0x10: dword: 0 (reserved)
3790
  * +16 = +0x10: dword: 0 (reserved)
3790
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3791
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3791
    given in the general description
3792
    given in the general description
3792
    or
3793
    or
3793
  * +20 = +0x14: db 0
3794
  * +20 = +0x14: db 0
3794
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3795
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3795
Returned value:
3796
Returned value:
3796
  * eax = 0 - success, otherwise file system error code
3797
  * eax = 0 - success, otherwise file system error code
3797
  * ebx destroyed
3798
  * ebx destroyed
3798
Remarks:
3799
Remarks:
3799
  * If the new file size is less than old one, file is truncated.
3800
  * If the new file size is less than old one, file is truncated.
3800
    If the new size is greater than old one, file is expanded with
3801
    If the new size is greater than old one, file is expanded with
3801
    characters with code 0. If the new size is equal to old one,
3802
    characters with code 0. If the new size is equal to old one,
3802
    the only result of call is set date/time of modification and
3803
    the only result of call is set date/time of modification and
3803
    access to the current date/time.
3804
    access to the current date/time.
3804
  * If there is not enough free space on disk for expansion, the
3805
  * If there is not enough free space on disk for expansion, the
3805
    function will expand to maximum possible size and then return
3806
    function will expand to maximum possible size and then return
3806
    error code 8.
3807
    error code 8.
3807
  * The function is not supported for CD (returns error code 2).
3808
  * The function is not supported for CD (returns error code 2).
3808
 
3809
 
3809
======================================================================
3810
======================================================================
3810
==== Function 70, subfunction 5 - get information on file/folder. ====
3811
==== Function 70, subfunction 5 - get information on file/folder. ====
3811
======================================================================
3812
======================================================================
3812
Parameters:
3813
Parameters:
3813
  * eax = 70 - function number
3814
  * eax = 70 - function number
3814
  * ebx = pointer to the information structure
3815
  * ebx = pointer to the information structure
3815
Format of the information structure:
3816
Format of the information structure:
3816
  * +0: dword: 5 = subfunction number
3817
  * +0: dword: 5 = subfunction number
3817
  * +4: dword: 0 (reserved)
3818
  * +4: dword: 0 (reserved)
3818
  * +8: dword: 0 (reserved)
3819
  * +8: dword: 0 (reserved)
3819
  * +12 = +0xC: dword: 0 (reserved)
3820
  * +12 = +0xC: dword: 0 (reserved)
3820
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
3821
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
3821
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3822
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3822
    given in the general description
3823
    given in the general description
3823
    or
3824
    or
3824
  * +20 = +0x14: db 0
3825
  * +20 = +0x14: db 0
3825
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3826
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3826
Returned value:
3827
Returned value:
3827
  * eax = 0 - success, otherwise file system error code
3828
  * eax = 0 - success, otherwise file system error code
3828
  * ebx destroyed
3829
  * ebx destroyed
3829
Information on file is returned in the BDFE format (block of data
3830
Information on file is returned in the BDFE format (block of data
3830
for folder entry), explained in the description of
3831
for folder entry), explained in the description of
3831
subfunction 1, but without filename
3832
subfunction 1, but without filename
3832
(i.e. only first 40 = 0x28 bytes).
3833
(i.e. only first 40 = 0x28 bytes).
3833
Remarks:
3834
Remarks:
3834
  * The function does not support virtual folders such as /, /rd and
3835
  * The function does not support virtual folders such as /, /rd and
3835
    root folders like /rd/1.
3836
    root folders like /rd/1.
3836
 
3837
 
3837
======================================================================
3838
======================================================================
3838
===== Function 70, subfunction 6 - set attributes of file/folder. ====
3839
===== Function 70, subfunction 6 - set attributes of file/folder. ====
3839
======================================================================
3840
======================================================================
3840
Parameters:
3841
Parameters:
3841
  * eax = 70 - function number
3842
  * eax = 70 - function number
3842
  * ebx = pointer to the information structure
3843
  * ebx = pointer to the information structure
3843
Format of the information structure:
3844
Format of the information structure:
3844
  * +0: dword: 6 = subfunction number
3845
  * +0: dword: 6 = subfunction number
3845
  * +4: dword: 0 (reserved)
3846
  * +4: dword: 0 (reserved)
3846
  * +8: dword: 0 (reserved)
3847
  * +8: dword: 0 (reserved)
3847
  * +12 = +0xC: dword: 0 (reserved)
3848
  * +12 = +0xC: dword: 0 (reserved)
3848
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
3849
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
3849
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3850
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3850
    given in the general description
3851
    given in the general description
3851
    or
3852
    or
3852
  * +20 = +0x14: db 0
3853
  * +20 = +0x14: db 0
3853
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3854
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3854
Returned value:
3855
Returned value:
3855
  * eax = 0 - success, otherwise file system error code
3856
  * eax = 0 - success, otherwise file system error code
3856
  * ebx destroyed
3857
  * ebx destroyed
3857
File attributes are first 32 bytes in BDFE (block of data
3858
File attributes are first 32 bytes in BDFE (block of data
3858
for folder entry), explained in the description of subfunction 1
3859
for folder entry), explained in the description of subfunction 1
3859
(that is, without name and size of file). Attribute
3860
(that is, without name and size of file). Attribute
3860
file/folder/volume label (bits 3,4 in dword +0) is not changed.
3861
file/folder/volume label (bits 3,4 in dword +0) is not changed.
3861
Byte +4 (name format) is ignored.
3862
Byte +4 (name format) is ignored.
3862
Remarks:
3863
Remarks:
3863
  * The function does not support virtual folders such as /, /rd and
3864
  * The function does not support virtual folders such as /, /rd and
3864
    root folders like /rd/1.
3865
    root folders like /rd/1.
3865
  * The function is not supported for CD (returns error code 2).
3866
  * The function is not supported for CD (returns error code 2).
3866
 
3867
 
3867
======================================================================
3868
======================================================================
3868
=========== Function 70, subfunction 7 - start application. ==========
3869
=========== Function 70, subfunction 7 - start application. ==========
3869
======================================================================
3870
======================================================================
3870
Parameters:
3871
Parameters:
3871
  * eax = 70 - function number
3872
  * eax = 70 - function number
3872
  * ebx = pointer to the information structure
3873
  * ebx = pointer to the information structure
3873
Format of the information structure:
3874
Format of the information structure:
3874
  * +0: dword: 7 = subfunction number
3875
  * +0: dword: 7 = subfunction number
3875
  * +4: dword: flags field:
3876
  * +4: dword: flags field:
3876
    * bit 0: start process as debugged
3877
    * bit 0: start process as debugged
3877
    * other bits are reserved and must be set to 0
3878
    * other bits are reserved and must be set to 0
3878
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
3879
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
3879
  * +12 = +0xC: dword: 0 (reserved)
3880
  * +12 = +0xC: dword: 0 (reserved)
3880
  * +16 = +0x10: dword: 0 (reserved)
3881
  * +16 = +0x10: dword: 0 (reserved)
3881
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3882
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3882
    given in the general description
3883
    given in the general description
3883
    or
3884
    or
3884
  * +20 = +0x14: db 0
3885
  * +20 = +0x14: db 0
3885
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3886
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3886
Returned value:
3887
Returned value:
3887
  * eax > 0 - program is loaded, eax contains PID
3888
  * eax > 0 - program is loaded, eax contains PID
3888
  * eax < 0 - an error has occured, -eax contains
3889
  * eax < 0 - an error has occured, -eax contains
3889
    file system error code
3890
    file system error code
3890
  * ebx destroyed
3891
  * ebx destroyed
3891
Remarks:
3892
Remarks:
3892
  * Command line must be terminated by the character with the code 0
3893
  * Command line must be terminated by the character with the code 0
3893
    (ASCIIZ-string); function takes into account either all characters
3894
    (ASCIIZ-string); function takes into account either all characters
3894
    up to terminating zero inclusively or first 256 character
3895
    up to terminating zero inclusively or first 256 character
3895
    regarding what is less.
3896
    regarding what is less.
3896
  * If the process is started as debugged, it is created in
3897
  * If the process is started as debugged, it is created in
3897
    the suspended state; to run use subfunction 5 of function 69.
3898
    the suspended state; to run use subfunction 5 of function 69.
3898
 
3899
 
3899
======================================================================
3900
======================================================================
3900
========== Function 70, subfunction 8 - delete file/folder. ==========
3901
========== Function 70, subfunction 8 - delete file/folder. ==========
3901
======================================================================
3902
======================================================================
3902
Parameters:
3903
Parameters:
3903
  * eax = 70 - function number
3904
  * eax = 70 - function number
3904
  * ebx = pointer to the information structure
3905
  * ebx = pointer to the information structure
3905
Format of the information structure:
3906
Format of the information structure:
3906
  * +0: dword: 8 = subfunction number
3907
  * +0: dword: 8 = subfunction number
3907
  * +4: dword: 0 (reserved)
3908
  * +4: dword: 0 (reserved)
3908
  * +8: dword: 0 (reserved)
3909
  * +8: dword: 0 (reserved)
3909
  * +12 = +0xC: dword: 0 (reserved)
3910
  * +12 = +0xC: dword: 0 (reserved)
3910
  * +16 = +0x10: dword: 0 (reserved)
3911
  * +16 = +0x10: dword: 0 (reserved)
3911
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3912
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3912
    given in the general description
3913
    given in the general description
3913
    or
3914
    or
3914
  * +20 = +0x14: db 0
3915
  * +20 = +0x14: db 0
3915
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3916
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3916
Returned value:
3917
Returned value:
3917
  * eax = 0 - success, otherwise file system error code
3918
  * eax = 0 - success, otherwise file system error code
3918
  * ebx destroyed
3919
  * ebx destroyed
3919
Remarks:
3920
Remarks:
3920
  * The function is not supported for CD (returns error code 2).
3921
  * The function is not supported for CD (returns error code 2).
3921
  * The function can delete only empty folders (attempt to delete
3922
  * The function can delete only empty folders (attempt to delete
3922
    nonempty folder results in error with code 10, "access denied").
3923
    nonempty folder results in error with code 10, "access denied").
3923
 
3924
 
3924
======================================================================
3925
======================================================================
3925
============= Function 70, subfunction 9 - create folder. ============
3926
============= Function 70, subfunction 9 - create folder. ============
3926
======================================================================
3927
======================================================================
3927
Parameters:
3928
Parameters:
3928
  * eax = 70 - function number
3929
  * eax = 70 - function number
3929
  * ebx = pointer to the information structure
3930
  * ebx = pointer to the information structure
3930
Format of the information structure:
3931
Format of the information structure:
3931
  * +0: dword: 9 = subfunction number
3932
  * +0: dword: 9 = subfunction number
3932
  * +4: dword: 0 (reserved)
3933
  * +4: dword: 0 (reserved)
3933
  * +8: dword: 0 (reserved)
3934
  * +8: dword: 0 (reserved)
3934
  * +12 = +0xC: dword: 0 (reserved)
3935
  * +12 = +0xC: dword: 0 (reserved)
3935
  * +16 = +0x10: dword: 0 (reserved)
3936
  * +16 = +0x10: dword: 0 (reserved)
3936
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3937
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3937
    given in the general description
3938
    given in the general description
3938
    or
3939
    or
3939
  * +20 = +0x14: db 0
3940
  * +20 = +0x14: db 0
3940
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
3941
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
3941
Returned value:
3942
Returned value:
3942
  * eax = 0 - success, otherwise file system error code
3943
  * eax = 0 - success, otherwise file system error code
3943
  * ebx destroyed
3944
  * ebx destroyed
3944
Remarks:
3945
Remarks:
3945
  * The function is not supported for CD (returns error code 2).
3946
  * The function is not supported for CD (returns error code 2).
3946
  * The parent folder must already exist.
3947
  * The parent folder must already exist.
3947
  * If target folder already exists, function returns success (eax=0).
3948
  * If target folder already exists, function returns success (eax=0).
3948
 
3949
 
3949
======================================================================
3950
======================================================================
3950
========== Function 71, subfunction 1 - set window caption. ==========
3951
========== Function 71, subfunction 1 - set window caption. ==========
3951
======================================================================
3952
======================================================================
3952
Parameters:
3953
Parameters:
3953
  * eax = 71 - function number
3954
  * eax = 71 - function number
3954
  * ebx = 1 - subfunction number
3955
  * ebx = 1 - subfunction number
3955
  * ecx = pointer to caption string
3956
  * ecx = pointer to caption string
3956
Returned value:
3957
Returned value:
3957
  * function does not return value
3958
  * function does not return value
3958
Remarks:
3959
Remarks:
3959
  * String must be in the ASCIIZ-format. Disregarding real string
3960
  * String must be in the ASCIIZ-format. Disregarding real string
3960
    length, no more than 255 characters are drawn.
3961
    length, no more than 255 characters are drawn.
3961
  * Pass NULL in ecx to remove caption.
3962
  * Pass NULL in ecx to remove caption.
3962
 
3963
 
3963
======================================================================
3964
======================================================================
3964
=============== Function 72 - send message to a window. ==============
3965
=============== Function 72 - send message to a window. ==============
3965
======================================================================
3966
======================================================================
3966
 
3967
 
3967
- Subfunction 1 - send message with parameter to the active window. --
3968
- Subfunction 1 - send message with parameter to the active window. --
3968
Parameters:
3969
Parameters:
3969
  * eax = 72 - function number
3970
  * eax = 72 - function number
3970
  * ebx = 1 - subfunction number
3971
  * ebx = 1 - subfunction number
3971
  * ecx = event code: 2 or 3
3972
  * ecx = event code: 2 or 3
3972
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
3973
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
3973
Returned value:
3974
Returned value:
3974
  * eax = 0 - success
3975
  * eax = 0 - success
3975
  * eax = 1 - buffer is full
3976
  * eax = 1 - buffer is full
3976
 
3977
 
3977
======================================================================
3978
======================================================================
3978
===================== Function 73 - blit bitmap  =====================
3979
===================== Function 73 - blit bitmap  =====================
3979
======================================================================
3980
======================================================================
3980
 
3981
 
3981
Parameters:
3982
Parameters:
3982
  * eax = 73 - function number
3983
  * eax = 73 - function number
3983
 
3984
 
3984
  * ebx = ROP and optional flags
3985
  * ebx = ROP and optional flags
3985
     31           6 5  4 3   0
3986
     31           6 5  4 3   0
3986
     [  reserved  ][T][B][ROP]
3987
     [  reserved  ][T][B][ROP]
3987
     ROP - raster operation code
3988
     ROP - raster operation code
3988
        0: Copy
3989
        0: Copy
3989
     1-15: reserved
3990
     1-15: reserved
3990
     B   - blit into the background surface
3991
     B   - blit into the background surface
3991
     T   - transparent blit
3992
     T   - transparent blit
3992
 
3993
 
3993
  * ecx = pointer to the function parameters
3994
  * ecx = pointer to the function parameters
3994
        destination offset and clipping
3995
        destination offset and clipping
3995
     +0 signed dword: destination rectangle X offset from the window
3996
     +0 signed dword: destination rectangle X offset from the window
3996
                      top-left corner
3997
                      top-left corner
3997
     +4 signed dword: destination rectangle Y offset from the window
3998
     +4 signed dword: destination rectangle Y offset from the window
3998
                      top-left corner
3999
                      top-left corner
3999
     +8 dword:        destination rectangle width
4000
     +8 dword:        destination rectangle width
4000
    +12 dword:        destination rectangle height
4001
    +12 dword:        destination rectangle height
4001
 
4002
 
4002
        source offset and clipping
4003
        source offset and clipping
4003
    +16 signed dword: source rectangle X offset from the bitmap
4004
    +16 signed dword: source rectangle X offset from the bitmap
4004
                      top-left corner
4005
                      top-left corner
4005
    +20 signed dword: source rectangle Y offset from the bitmap
4006
    +20 signed dword: source rectangle Y offset from the bitmap
4006
                      top-left corner
4007
                      top-left corner
4007
    +24 dword:        source rectangle width
4008
    +24 dword:        source rectangle width
4008
    +28 dword:        source rectangle height
4009
    +28 dword:        source rectangle height
4009
 
4010
 
4010
    +32: dword: bitmap data - must be 32bpp
4011
    +32: dword: bitmap data - must be 32bpp
4011
    +36: dword: size of the bitmap row in bytes
4012
    +36: dword: size of the bitmap row in bytes
4012
 
4013
 
4013
Returned value:
4014
Returned value:
4014
  * function does not return value
4015
  * function does not return value
4015
 
4016
 
4016
======================================================================
4017
======================================================================
4017
= Function 74, Subfunction -1, Get number of active network devices. =
4018
= Function 74, Subfunction -1, Get number of active network devices. =
4018
======================================================================
4019
======================================================================
4019
Parameters:
4020
Parameters:
4020
  * eax = 74 - function number
4021
  * eax = 74 - function number
4021
  * bl = -1 - subfunction number
4022
  * bl = -1 - subfunction number
4022
Returned value:
4023
Returned value:
4023
  * eax = number of active network devices
4024
  * eax = number of active network devices
4024
 
4025
 
4025
======================================================================
4026
======================================================================
4026
======== Function 74, Subfunction 0, Get network device type. ========
4027
======== Function 74, Subfunction 0, Get network device type. ========
4027
======================================================================
4028
======================================================================
4028
Parameters:
4029
Parameters:
4029
  * eax = 74 - function number
4030
  * eax = 74 - function number
4030
  * bl = 0 - subfunction number
4031
  * bl = 0 - subfunction number
4031
  * bh = device number
4032
  * bh = device number
4032
Returned value:
4033
Returned value:
4033
  * eax = device type
4034
  * eax = device type
4034
 
4035
 
4035
======================================================================
4036
======================================================================
4036
======== Function 74, Subfunction 1, Get network device name. ========
4037
======== Function 74, Subfunction 1, Get network device name. ========
4037
======================================================================
4038
======================================================================
4038
Parameters:
4039
Parameters:
4039
  * eax = 74 - function number
4040
  * eax = 74 - function number
4040
  * bl = 1 - subfunction number
4041
  * bl = 1 - subfunction number
4041
  * bh = device number
4042
  * bh = device number
4042
  * ecx = pointer to 64 byte buffer
4043
  * ecx = pointer to 64 byte buffer
4043
Returned value:
4044
Returned value:
4044
  * eax = -1 on error
4045
  * eax = -1 on error
4045
  * The network device name is written into the buffer, on success
4046
  * The network device name is written into the buffer, on success
4046
 
4047
 
4047
======================================================================
4048
======================================================================
4048
========= Function 74, Subfunction 2, Reset network device. ==========
4049
========= Function 74, Subfunction 2, Reset network device. ==========
4049
======================================================================
4050
======================================================================
4050
Parameters:
4051
Parameters:
4051
  * eax = 74 - function number
4052
  * eax = 74 - function number
4052
  * bl = 2 - subfunction number
4053
  * bl = 2 - subfunction number
4053
  * bh = device number
4054
  * bh = device number
4054
Returned value:
4055
Returned value:
4055
  * eax = -1 on error
4056
  * eax = -1 on error
4056
 
4057
 
4057
======================================================================
4058
======================================================================
4058
========== Function 74, Subfunction 3, Stop network device. ==========
4059
========== Function 74, Subfunction 3, Stop network device. ==========
4059
======================================================================
4060
======================================================================
4060
Parameters:
4061
Parameters:
4061
  * eax = 74 - function number
4062
  * eax = 74 - function number
4062
  * bl = 3 - subfunction number
4063
  * bl = 3 - subfunction number
4063
  * bh = device number
4064
  * bh = device number
4064
Returned value:
4065
Returned value:
4065
  * eax = -1 on error
4066
  * eax = -1 on error
4066
 
4067
 
4067
======================================================================
4068
======================================================================
4068
============== Function 75, Subfunction 0, Open socket. ==============
4069
============== Function 75, Subfunction 0, Open socket. ==============
4069
======================================================================
4070
======================================================================
4070
Parameters:
4071
Parameters:
4071
  * eax = 75 - function number
4072
  * eax = 75 - function number
4072
  * bl = 0 - subfunction number
4073
  * bl = 0 - subfunction number
4073
  * ecx = domain
4074
  * ecx = domain
4074
  * edx = type
4075
  * edx = type
4075
  * esi = protocol
4076
  * esi = protocol
4076
Returned value:
4077
Returned value:
4077
  * eax = socket number, -1 on error
4078
  * eax = socket number, -1 on error
4078
  * ebx = errorcode
4079
  * ebx = errorcode
4079
 
4080
 
4080
======================================================================
4081
======================================================================
4081
============= Function 75, Subfunction 1, Close socket. ==============
4082
============= Function 75, Subfunction 1, Close socket. ==============
4082
======================================================================
4083
======================================================================
4083
Parameters:
4084
Parameters:
4084
  * eax = 75 - function number
4085
  * eax = 75 - function number
4085
  * bl = 1 - subfunction number
4086
  * bl = 1 - subfunction number
4086
  * ecx = socket number
4087
  * ecx = socket number
4087
Returned value:
4088
Returned value:
4088
  * eax = -1 on error
4089
  * eax = -1 on error
4089
  * ebx = errorcode
4090
  * ebx = errorcode
4090
 
4091
 
4091
======================================================================
4092
======================================================================
4092
================== Function 75, Subfunction 2, Bind. =================
4093
================== Function 75, Subfunction 2, Bind. =================
4093
======================================================================
4094
======================================================================
4094
Parameters:
4095
Parameters:
4095
  * eax = 75 - function number
4096
  * eax = 75 - function number
4096
  * bl = 2 - subfunction number
4097
  * bl = 2 - subfunction number
4097
  * ecx = socket number
4098
  * ecx = socket number
4098
  * edx = pointer to sockaddr structure
4099
  * edx = pointer to sockaddr structure
4099
  * esi = length of sockaddr structure
4100
  * esi = length of sockaddr structure
4100
Returned value:
4101
Returned value:
4101
  * eax = -1 on error
4102
  * eax = -1 on error
4102
  * ebx = errorcode
4103
  * ebx = errorcode
4103
 
4104
 
4104
======================================================================
4105
======================================================================
4105
================= Function 75, Subfunction 3, Listen. ================
4106
================= Function 75, Subfunction 3, Listen. ================
4106
======================================================================
4107
======================================================================
4107
Parameters:
4108
Parameters:
4108
  * eax = 75 - function number
4109
  * eax = 75 - function number
4109
  * bl = 3 - subfunction number
4110
  * bl = 3 - subfunction number
4110
  * ecx = socket number
4111
  * ecx = socket number
4111
  * edx = backlog
4112
  * edx = backlog
4112
Returned value:
4113
Returned value:
4113
  * eax = -1 on error
4114
  * eax = -1 on error
4114
  * ebx = errorcode
4115
  * ebx = errorcode
4115
 
4116
 
4116
======================================================================
4117
======================================================================
4117
================ Function 75, Subfunction 4, Connect. ================
4118
================ Function 75, Subfunction 4, Connect. ================
4118
======================================================================
4119
======================================================================
4119
Parameters:
4120
Parameters:
4120
  * eax = 75 - function number
4121
  * eax = 75 - function number
4121
  * bl = 4 - subfunction number
4122
  * bl = 4 - subfunction number
4122
  * ecx = socket number
4123
  * ecx = socket number
4123
  * edx = pointer to sockaddr structure
4124
  * edx = pointer to sockaddr structure
4124
  * esi = length of sockaddr structure
4125
  * esi = length of sockaddr structure
4125
Returned value:
4126
Returned value:
4126
  * eax = -1 on error
4127
  * eax = -1 on error
4127
  * ebx = errorcode
4128
  * ebx = errorcode
4128
 
4129
 
4129
======================================================================
4130
======================================================================
4130
================= Function 75, Subfunction 5, Accept. ================
4131
================= Function 75, Subfunction 5, Accept. ================
4131
======================================================================
4132
======================================================================
4132
Parameters:
4133
Parameters:
4133
  * eax = 75 - function number
4134
  * eax = 75 - function number
4134
  * bl = 5 - subfunction number
4135
  * bl = 5 - subfunction number
4135
  * ecx = socket number
4136
  * ecx = socket number
4136
  * edx = pointer to sockaddr structure
4137
  * edx = pointer to sockaddr structure
4137
  * esi = length of sockaddr structure
4138
  * esi = length of sockaddr structure
4138
Returned value:
4139
Returned value:
4139
  * eax = socket number of accepted socket, -1 on error
4140
  * eax = socket number of accepted socket, -1 on error
4140
  * ebx = errorcode
4141
  * ebx = errorcode
4141
 
4142
 
4142
======================================================================
4143
======================================================================
4143
================== Function 75, Subfunction 6, Send. =================
4144
================== Function 75, Subfunction 6, Send. =================
4144
======================================================================
4145
======================================================================
4145
Parameters:
4146
Parameters:
4146
  * eax = 75 - function number
4147
  * eax = 75 - function number
4147
  * bl = 6 - subfunction number
4148
  * bl = 6 - subfunction number
4148
  * ecx = socket number
4149
  * ecx = socket number
4149
  * edx = pointer to buffer
4150
  * edx = pointer to buffer
4150
  * esi = length of buffer
4151
  * esi = length of buffer
4151
  * edi = flags
4152
  * edi = flags
4152
Returned value:
4153
Returned value:
4153
  * eax = number of bytes copied, -1 on error
4154
  * eax = number of bytes copied, -1 on error
4154
  * ebx = errorcode
4155
  * ebx = errorcode
4155
 
4156
 
4156
======================================================================
4157
======================================================================
4157
================ Function 75, Subfunction 7, Receive. ================
4158
================ Function 75, Subfunction 7, Receive. ================
4158
======================================================================
4159
======================================================================
4159
Parameters:
4160
Parameters:
4160
  * eax = 75 - function number
4161
  * eax = 75 - function number
4161
  * bl = 7 - subfunction number
4162
  * bl = 7 - subfunction number
4162
  * ecx = socket number
4163
  * ecx = socket number
4163
  * edx = pointer to buffer
4164
  * edx = pointer to buffer
4164
  * esi = length of buffer
4165
  * esi = length of buffer
4165
  * edi = flags
4166
  * edi = flags
4166
Returned value:
4167
Returned value:
4167
  * eax = number of bytes copied, -1 on error
4168
  * eax = number of bytes copied, -1 on error
4168
  * ebx = errorcode
4169
  * ebx = errorcode
4169
 
4170
 
4170
======================================================================
4171
======================================================================
4171
=========== Function 75, Subfunction 8, Set socket options. ==========
4172
=========== Function 75, Subfunction 8, Set socket options. ==========
4172
======================================================================
4173
======================================================================
4173
Parameters:
4174
Parameters:
4174
  * eax = 75 - function number
4175
  * eax = 75 - function number
4175
  * bl = 8 - subfunction number
4176
  * bl = 8 - subfunction number
4176
  * ecx = socket number
4177
  * ecx = socket number
4177
  * edx = pointer to optstruct
4178
  * edx = pointer to optstruct
4178
Returned value:
4179
Returned value:
4179
  * eax = -1 on error
4180
  * eax = -1 on error
4180
  * ebx = errorcode
4181
  * ebx = errorcode
4181
Remarks:
4182
Remarks:
4182
 
4183
 
4183
  Optstruct: dd level
4184
  Optstruct: dd level
4184
             dd optionname
4185
             dd optionname
4185
             dd optlength
4186
             dd optlength
4186
             db options...
4187
             db options...
4187
 
4188
 
4188
======================================================================
4189
======================================================================
4189
=========== Function 75, Subfunction 9, Get socket options. ==========
4190
=========== Function 75, Subfunction 9, Get socket options. ==========
4190
======================================================================
4191
======================================================================
4191
Parameters:
4192
Parameters:
4192
  * eax = 75 - function number
4193
  * eax = 75 - function number
4193
  * bl = 9 - subfunction number
4194
  * bl = 9 - subfunction number
4194
  * ecx = socket number
4195
  * ecx = socket number
4195
  * edx = pointer to optstruct
4196
  * edx = pointer to optstruct
4196
Returned value:
4197
Returned value:
4197
  * eax = -1 on error
4198
  * eax = -1 on error
4198
  * ebx = errorcode
4199
  * ebx = errorcode
4199
Remarks:
4200
Remarks:
4200
 
4201
 
4201
  Optstruct: dd level
4202
  Optstruct: dd level
4202
             dd optionname
4203
             dd optionname
4203
             dd optlength
4204
             dd optlength
4204
             db options...
4205
             db options...
4205
 
4206
 
4206
======================================================================
4207
======================================================================
4207
============ Function 75, Subfunction 10, Get socketpair. ===========
4208
============ Function 75, Subfunction 10, Get socketpair. ===========
4208
======================================================================
4209
======================================================================
4209
Parameters:
4210
Parameters:
4210
  * eax = 75 - function number
4211
  * eax = 75 - function number
4211
  * bl = 10 - subfunction number
4212
  * bl = 10 - subfunction number
4212
Returned value:
4213
Returned value:
4213
  * eax = socketnum1, -1 on error
4214
  * eax = socketnum1, -1 on error
4214
  * ebx = socketnum2, errorcode on error
4215
  * ebx = socketnum2, errorcode on error
4215
Remarks:
4216
Remarks:
4216
 
4217
 
4217
  Optstruct: dd level
4218
  Optstruct: dd level
4218
             dd optionname
4219
             dd optionname
4219
             dd optlength
4220
             dd optlength
4220
             db options...
4221
             db options...
4221
 
4222
 
4222
======================================================================
4223
======================================================================
4223
=============== Function -1 - terminate thread/process ===============
4224
=============== Function -1 - terminate thread/process ===============
4224
======================================================================
4225
======================================================================
4225
Parameters:
4226
Parameters:
4226
  * eax = -1 - function number
4227
  * eax = -1 - function number
4227
Returned value:
4228
Returned value:
4228
  * function does not return neither value nor control
4229
  * function does not return neither value nor control
4229
Remarks:
4230
Remarks:
4230
  * If the process did not create threads obviously, it has only
4231
  * If the process did not create threads obviously, it has only
4231
    one thread, which termination results in process termination.
4232
    one thread, which termination results in process termination.
4232
  * If the current thread is last in the process, its termination
4233
  * If the current thread is last in the process, its termination
4233
    also results in process terminates.
4234
    also results in process terminates.
4234
  * This function terminates the current thread. Other thread can be
4235
  * This function terminates the current thread. Other thread can be
4235
    killed by call to subfunction 2 of function 18.
4236
    killed by call to subfunction 2 of function 18.
4236
 
4237
 
4237
======================================================================
4238
======================================================================
4238
=========================== List of events ===========================
4239
=========================== List of events ===========================
4239
======================================================================
4240
======================================================================
4240
Next event can be retrieved by the call of one from functions 10
4241
Next event can be retrieved by the call of one from functions 10
4241
(to wait for event), 11 (to check without waiting), 23
4242
(to wait for event), 11 (to check without waiting), 23
4242
(to wait during the given time).
4243
(to wait during the given time).
4243
These functions return only those events, which enter into a mask set
4244
These functions return only those events, which enter into a mask set
4244
by function 40. By default it is first three,
4245
by function 40. By default it is first three,
4245
there is enough for most applications.
4246
there is enough for most applications.
4246
Codes of events:
4247
Codes of events:
4247
  * 1 = redraw event (is reset by call to function 0)
4248
  * 1 = redraw event (is reset by call to function 0)
4248
  * 2 = key on keyboard is pressed (acts, only when the window is
4249
  * 2 = key on keyboard is pressed (acts, only when the window is
4249
    active) or hotkey is pressed; is reset, when all keys from
4250
    active) or hotkey is pressed; is reset, when all keys from
4250
    the buffer are read out by function 2
4251
    the buffer are read out by function 2
4251
  * 3 = button is pressed, defined earlier by function 8
4252
  * 3 = button is pressed, defined earlier by function 8
4252
    (or close button, created implicitly by function 0;
4253
    (or close button, created implicitly by function 0;
4253
    minimize button is handled by the system and sends no message;
4254
    minimize button is handled by the system and sends no message;
4254
    acts, only when the window is active;
4255
    acts, only when the window is active;
4255
    is reset when all buttons from the buffer
4256
    is reset when all buttons from the buffer
4256
    are read out by function 17)
4257
    are read out by function 17)
4257
  * 4 = reserved (in current implementation never comes even after
4258
  * 4 = reserved (in current implementation never comes even after
4258
    unmasking by function 40)
4259
    unmasking by function 40)
4259
  * 5 = kernel finished redrawing of the desktop background
4260
  * 5 = kernel finished redrawing of the desktop background
4260
  * 6 = mouse event (something happened - button pressing or moving;
4261
  * 6 = mouse event (something happened - button pressing or moving;
4261
    is reset at reading)
4262
    is reset at reading)
4262
  * 7 = IPC event (see function 60 -
4263
  * 7 = IPC event (see function 60 -
4263
    Inter Process Communication; is reset at reading)
4264
    Inter Process Communication; is reset at reading)
4264
  * 8 = network event (is reset at reading)
4265
  * 8 = network event (is reset at reading)
4265
  * 9 = debug event (is reset at reading; see
4266
  * 9 = debug event (is reset at reading; see
4266
    debug subsystem)
4267
    debug subsystem)
4267
  * 16..31 = event with appropriate IRQ
4268
  * 16..31 = event with appropriate IRQ
4268
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4269
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4269
 
4270
 
4270
======================================================================
4271
======================================================================
4271
=================== Error codes of the file system ===================
4272
=================== Error codes of the file system ===================
4272
======================================================================
4273
======================================================================
4273
  * 0 = success
4274
  * 0 = success
4274
  * 1 = base and/or partition of a hard disk is not defined
4275
  * 1 = base and/or partition of a hard disk is not defined
4275
    (by subfunctions 7, 8 of function 21)
4276
    (by subfunctions 7, 8 of function 21)
4276
  * 2 = function is not supported for the given file system
4277
  * 2 = function is not supported for the given file system
4277
  * 3 = unknown file system
4278
  * 3 = unknown file system
4278
  * 4 = reserved, is never returned in the current implementation
4279
  * 4 = reserved, is never returned in the current implementation
4279
  * 5 = file not found
4280
  * 5 = file not found
4280
  * 6 = end of file, EOF
4281
  * 6 = end of file, EOF
4281
  * 7 = pointer lies outside of application memory
4282
  * 7 = pointer lies outside of application memory
4282
  * 8 = disk is full
4283
  * 8 = disk is full
4283
  * 9 = FAT table is destroyed
4284
  * 9 = FAT table is destroyed
4284
  * 10 = access denied
4285
  * 10 = access denied
4285
  * 11 = device error
4286
  * 11 = device error
4286
Application start functions can return also following errors:
4287
Application start functions can return also following errors:
4287
  * 30 = 0x1E = not enough memory
4288
  * 30 = 0x1E = not enough memory
4288
  * 31 = 0x1F = file is not executable
4289
  * 31 = 0x1F = file is not executable
4289
  * 32 = 0x20 = too many processes
4290
  * 32 = 0x20 = too many processes
4290
>
4291
>
4291
>
4292
>