Subversion Repositories Kolibri OS

Rev

Rev 9995 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9995 Rev 10010
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2021. 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=1 - only define window area, draw nothing
28
      * Y=1 - only define window area, draw nothing
29
      * Y=3 - skinned window
29
      * Y=3 - skinned window
30
      * Y=4 - skinned fixed-size window
30
      * Y=4 - skinned fixed-size window
31
      * Y=0,2 window types are outdated and should not be used anymore,
31
      * Y=0,2 window types are outdated and should not be used anymore,
32
        they are retained for compatibility with old programs.
32
        they are retained for compatibility with old programs.
33
      * other possible values (from 5 to 15) are reserved,
33
      * other possible values (from 5 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
38
      * A = 1 - window has caption
39
      * B = 1 - coordinates of all graphics primitives are relative to
39
      * B = 1 - coordinates of all graphics primitives are relative to
40
                  window client area
40
                  window client area
41
      * C = 1 - don't fill working area on window draw
41
      * C = 1 - don't fill working area on window draw
42
      * D = 0 - normal filling of the working area, 1 - gradient
42
      * D = 0 - normal filling of the working area, 1 - gradient
43
    The following parameters are intended for windows
43
    The following parameters are intended for windows
44
    of a type I and II, and ignored for styles Y=1,3:
44
    of a type I and II, and ignored for styles Y=1,3:
45
  * esi = 0xXYRRGGBB - color of the header
45
  * esi = 0xXYRRGGBB - color of the header
46
    * RR, GG, BB define color
46
    * RR, GG, BB define color
47
    * Y=0 - usual window, Y=1 - unmovable window (works for all window styles)
47
    * Y=0 - usual window, Y=1 - unmovable window (works for all window styles)
48
    * X not used, other values of Y are reserved
48
    * X not used, other values of Y are reserved
49
  * edi = caption string for styles Y=3,4 (also can be set by func 71.1)
49
  * edi = caption string for styles Y=3,4 (also can be set by func 71.1)
50
Returned value:
50
Returned value:
51
  * function does not return value
51
  * function does not return value
52
Remarks:
52
Remarks:
53
  * Position and sizes of the window are installed by the first
53
  * Position and sizes of the window are installed by the first
54
    call of this function and are ignored at subsequent; to change
54
    call of this function and are ignored at subsequent; to change
55
    position and/or sizes of already created window use function 67.
55
    position and/or sizes of already created window use function 67.
56
  * For windows with styles Y=3,4 and caption (A=1) caption string
56
  * For windows with styles Y=3,4 and caption (A=1) caption string
57
    is set by the first call of this function and is ignored
57
    is set by the first call of this function and is ignored
58
    at subsequent (strictly speaking, is ignored after a call to
58
    at subsequent (strictly speaking, is ignored after a call to
59
    subfunction 2 of function 12 - end redraw); to change caption of
59
    subfunction 2 of function 12 - end redraw); to change caption of
60
    already created window use subfunction 1 of function 71.
60
    already created window use subfunction 1 of function 71.
61
  * If the window has appropriate styles, position and/or sizes can be
61
  * If the window has appropriate styles, position and/or sizes can be
62
    changed by user. Current position and sizes can be obtained
62
    changed by user. Current position and sizes can be obtained
63
    by function 9.
63
    by function 9.
64
  * The window must fit on the screen. If the transferred
64
  * The window must fit on the screen. If the transferred
65
    coordinates and sizes do not satisfy to this condition,
65
    coordinates and sizes do not satisfy to this condition,
66
    appropriate coordinate (or, probably, both) is considered as zero,
66
    appropriate coordinate (or, probably, both) is considered as zero,
67
    and if it does not help too, the appropriate size
67
    and if it does not help too, the appropriate size
68
    (or, probably, both) is installed in a size of the screen.
68
    (or, probably, both) is installed in a size of the screen.
69
 
69
 
70
    Further let us designate xpos,ypos,xsize,ysize - values passed
70
    Further let us designate xpos,ypos,xsize,ysize - values passed
71
    in ebx,ecx. The coordinates are resulted concerning
71
    in ebx,ecx. The coordinates are resulted concerning
72
    the left upper corner of the window, which, thus, is set as (0,0),
72
    the left upper corner of the window, which, thus, is set as (0,0),
73
    coordinates of the right lower corner essence (xsize,ysize).
73
    coordinates of the right lower corner essence (xsize,ysize).
74
  * The sizes of the window are understood in sense of coordinates
74
  * The sizes of the window are understood in sense of coordinates
75
    of the right lower corner. This concerns all other functions too.
75
    of the right lower corner. This concerns all other functions too.
76
    It means, that the real sizes are on 1 pixel more.
76
    It means, that the real sizes are on 1 pixel more.
77
  * The window of style Y=1 looks as follows:
77
  * The window of style Y=1 looks as follows:
78
    * completely defined by the application
78
    * completely defined by the application
79
  * The skinned window Y=3,4 looks as follows:
79
  * The skinned window Y=3,4 looks as follows:
80
    * draw external frame of width 1 pixel
80
    * draw external frame of width 1 pixel
81
      with color 'outer' from the skin
81
      with color 'outer' from the skin
82
    * draw intermediate frame of width 3 pixel
82
    * draw intermediate frame of width 3 pixel
83
      with color 'frame' from the skin
83
      with color 'frame' from the skin
84
    * draw internal frame of width 1 pixel
84
    * draw internal frame of width 1 pixel
85
      with color 'inner' from the skin
85
      with color 'inner' from the skin
86
    * draw header (on bitmaps from the skin) in a rectangle
86
    * draw header (on bitmaps from the skin) in a rectangle
87
      (0,0) - (xsize,_skinh-1)
87
      (0,0) - (xsize,_skinh-1)
88
    * if ysize>=26, fill the working area of the window -
88
    * if ysize>=26, fill the working area of the window -
89
      rectangle with the left upper corner (5,_skinh) and right lower
89
      rectangle with the left upper corner (5,_skinh) and right lower
90
      (xsize-5,ysize-5) with color indicated in edx
90
      (xsize-5,ysize-5) with color indicated in edx
91
      (taking a gradient into account)
91
      (taking a gradient into account)
92
    * define two standard buttons: close and minimize
92
    * define two standard buttons: close and minimize
93
      (see function 8)
93
      (see function 8)
94
    * if A=1 and edi contains (nonzero) pointer to caption string,
94
    * if A=1 and edi contains (nonzero) pointer to caption string,
95
      it is drawn in place in header defined in the skin
95
      it is drawn in place in header defined in the skin
96
    * value _skinh is accessible as the result of call
96
    * value _skinh is accessible as the result of call
97
      subfunction 4 of function 48
97
      subfunction 4 of function 48
98
 
98
 
99
---------------------- Constants for registers: ----------------------
99
---------------------- Constants for registers: ----------------------
100
  eax - SF_CREATE_WINDOW (0)
100
  eax - SF_CREATE_WINDOW (0)
101
======================================================================
101
======================================================================
102
================ Function 1 - put pixel in the window. ===============
102
================ Function 1 - put pixel in the window. ===============
103
======================================================================
103
======================================================================
104
Parameters:
104
Parameters:
105
  * eax = 1 - function number
105
  * eax = 1 - function number
106
  * ebx = x-coordinate (relative to the window)
106
  * ebx = x-coordinate (relative to the window)
107
  * ecx = y-coordinate (relative to the window)
107
  * ecx = y-coordinate (relative to the window)
108
  * edx = 0x00RRGGBB - color of a pixel
108
  * edx = 0x00RRGGBB - color of a pixel
109
    edx = 0x01xxxxxx - invert color of a pixel
109
    edx = 0x01xxxxxx - invert color of a pixel
110
          (low 24 bits are ignored)
110
          (low 24 bits are ignored)
111
Returned value:
111
Returned value:
112
  * function does not return value
112
  * function does not return value
113
 
113
 
114
---------------------- Constants for registers: ----------------------
114
---------------------- Constants for registers: ----------------------
115
  eax - SF_PUT_PIXEL (1)
115
  eax - SF_PUT_PIXEL (1)
116
======================================================================
116
======================================================================
117
============ Function 2 - get the code of the pressed key. ===========
117
============ Function 2 - get the code of the pressed key. ===========
118
======================================================================
118
======================================================================
119
Takes away the code of the pressed key from the buffer.
119
Takes away the code of the pressed key from the buffer.
120
Parameters:
120
Parameters:
121
  * eax = 2 - function number
121
  * eax = 2 - function number
122
Returned value:
122
Returned value:
123
  * if the buffer is empty, function returns eax=1
123
  * if the buffer is empty, function returns eax=1
124
  * if the buffer is not empty, function returns al=0,
124
  * if the buffer is not empty, function returns al=0,
125
    ah=code of the pressed key,
125
    ah=code of the pressed key,
126
    bits 16-23 = contain scancode for pressed key in ASCII mode,
126
    bits 16-23 = contain scancode for pressed key in ASCII mode,
127
                 in the scancodes mode this bits cleared.
127
                 in the scancodes mode this bits cleared.
128
    bits 23-31 = zero
128
    bits 23-31 = zero
129
  * if there is "hotkey", function returns al=2,
129
  * if there is "hotkey", function returns al=2,
130
    ah=scancode of the pressed key (0 for control keys),
130
    ah=scancode of the pressed key (0 for control keys),
131
    high word of eax contains a status of control keys at the moment
131
    high word of eax contains a status of control keys at the moment
132
    of pressing a hotkey
132
    of pressing a hotkey
133
Remarks:
133
Remarks:
134
  * There is a common system buffer of the pressed keys
134
  * There is a common system buffer of the pressed keys
135
    by a size of 120 bytes, organized as queue.
135
    by a size of 120 bytes, organized as queue.
136
  * There is one more common system buffer on 120 "hotkeys".
136
  * There is one more common system buffer on 120 "hotkeys".
137
  * If the application with the inactive window calls this function,
137
  * If the application with the inactive window calls this function,
138
    the buffer of the pressed keys is considered to be empty.
138
    the buffer of the pressed keys is considered to be empty.
139
  * By default this function returns ASCII-codes; to switch
139
  * By default this function returns ASCII-codes; to switch
140
    to the scancodes mode (and back) use function 66.
140
    to the scancodes mode (and back) use function 66.
141
    However, hotkeys are always notificated as scancodes.
141
    However, hotkeys are always notificated as scancodes.
142
  * To find out, what keys correspond to what codes, start
142
  * To find out, what keys correspond to what codes, start
143
    the application keyascii and scancode.
143
    the application keyascii and scancode.
144
  * Scancodes come directly from keyboard and are fixed;
144
  * Scancodes come directly from keyboard and are fixed;
145
    ASCII-codes turn out with usage of the conversion tables,
145
    ASCII-codes turn out with usage of the conversion tables,
146
    which can be set by subfunction 2 of function 21
146
    which can be set by subfunction 2 of function 21
147
    and get by subfunction 2 of function 26.
147
    and get by subfunction 2 of function 26.
148
  * As a consequence, ASCII-codes take into account current
148
  * As a consequence, ASCII-codes take into account current
149
    keyboard layout (en, fi, etc) as opposed to scancodes.
149
    keyboard layout (en, fi, etc) as opposed to scancodes.
150
  * This function notifies only about those hotkeys, which were
150
  * This function notifies only about those hotkeys, which were
151
    defined by this thread by subfunction 4 of function 66.
151
    defined by this thread by subfunction 4 of function 66.
152
 
152
 
153
---------------------- Constants for registers: ----------------------
153
---------------------- Constants for registers: ----------------------
154
  eax - SF_GET_KEY (2)
154
  eax - SF_GET_KEY (2)
155
======================================================================
155
======================================================================
156
==================== Function 3 - get system time. ===================
156
==================== Function 3 - get system time. ===================
157
======================================================================
157
======================================================================
158
Parameters:
158
Parameters:
159
  * eax = 3 - function number
159
  * eax = 3 - function number
160
Returned value:
160
Returned value:
161
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
161
  * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
162
  * each item is BCD-number, for example,
162
  * each item is BCD-number, for example,
163
    for time 23:59:59 function returns 0x00595923
163
    for time 23:59:59 function returns 0x00595923
164
Remarks:
164
Remarks:
165
  * See also subfunction 9 of function 26 - get time from
165
  * See also subfunction 9 of function 26 - get time from
166
    the moment of start of the system; it is more convenient, because
166
    the moment of start of the system; it is more convenient, because
167
    returns simply DWORD-value of the time counter.
167
    returns simply DWORD-value of the time counter.
168
  * System time can be set by function 22.
168
  * System time can be set by function 22.
169
 
169
 
170
---------------------- Constants for registers: ----------------------
170
---------------------- Constants for registers: ----------------------
171
  eax - SF_GET_SYS_TIME (3)
171
  eax - SF_GET_SYS_TIME (3)
172
======================================================================
172
======================================================================
173
=================== Function 4 - draw text string. ===================
173
=================== Function 4 - draw text string. ===================
174
======================================================================
174
======================================================================
175
Parameters:
175
Parameters:
176
  * eax = 4 - function number
176
  * eax = 4 - function number
177
  * ebx = X*65536+Y, coordinates in the window or buffer
177
  * ebx = X*65536+Y, coordinates in the window or buffer
178
  * ecx = 0xXXRRGGBB, where
178
  * ecx = 0xXXRRGGBB, where
179
    * RR, GG, BB specify text color
179
    * RR, GG, BB specify text color
180
    * XX = ABFFCSSS (bits):
180
    * XX = ABFFCSSS (bits):
181
      * A=1 - output zero terminated string
181
      * A=1 - output zero terminated string
182
      * B=1 - fill background (color = edi)
182
      * B=1 - fill background (color = edi)
183
      * FF specifies the font and encoding:
183
      * FF specifies the font and encoding:
184
        0 = 6x9  cp866
184
        0 = 6x9  cp866
185
        1 = 8x16 cp866
185
        1 = 8x16 cp866
186
        2 = 8x16 UTF-16LE
186
        2 = 8x16 UTF-16LE
187
        3 = 8x16 UTF-8
187
        3 = 8x16 UTF-8
188
      * C=0 - draw to the window,
188
      * C=0 - draw to the window,
189
        C=1 - draw to the user buffer (edi)
189
        C=1 - draw to the user buffer (edi)
190
      * SSS = (size multiplier)-1, so 0 = x1, 7 = x8
190
      * SSS = (size multiplier)-1, so 0 = x1, 7 = x8
191
  * edx = pointer to the beginning of the string
191
  * edx = pointer to the beginning of the string
192
  * esi = for A=0 length of the string, for A=1 is ignored
192
  * esi = for A=0 length of the string, for A=1 is ignored
193
  * edi = for B=1 color to fill background,
193
  * edi = for B=1 color to fill background,
194
          for C=1 pointer to user buffer
194
          for C=1 pointer to user buffer
195
 
195
 
196
Returned value:
196
Returned value:
197
  * function does not return value
197
  * function does not return value
198
Remarks:
198
Remarks:
199
  * You can not use B=1 and C=1 at the same time, since both use edi.
199
  * You can not use B=1 and C=1 at the same time, since both use edi.
200
  * When SSS=0, font may be smoothed, depending on system setting.
200
  * When SSS=0, font may be smoothed, depending on system setting.
201
  * User buffer structure:
201
  * User buffer structure:
202
Xsize       dd
202
Xsize       dd
203
Ysize       dd
203
Ysize       dd
204
picture     rb  Xsize*Ysize*4  ; 32 bpp
204
picture     rb  Xsize*Ysize*4  ; 32 bpp
205
 
205
 
206
---------------------- Constants for registers: ----------------------
206
---------------------- Constants for registers: ----------------------
207
  eax - SF_DRAW_TEXT (4)
207
  eax - SF_DRAW_TEXT (4)
208
======================================================================
208
======================================================================
209
========================= Function 5 - delay. ========================
209
========================= Function 5 - delay. ========================
210
======================================================================
210
======================================================================
211
Delays execution of the program on the given time.
211
Delays execution of the program on the given time.
212
Parameters:
212
Parameters:
213
  * eax = 5 - function number
213
  * eax = 5 - function number
214
  * ebx = time in the 1/100 of second
214
  * ebx = time in the 1/100 of second
215
Returned value:
215
Returned value:
216
  * function does not return value
216
  * function does not return value
217
Remarks:
217
Remarks:
218
  * Passing ebx=0 does not transfer control to the next process
218
  * Passing ebx=0 does not transfer control to the next process
219
    and does not make any operations at all. If it is really required
219
    and does not make any operations at all. If it is really required
220
    to transfer control to the next process (to complete a current
220
    to transfer control to the next process (to complete a current
221
    time slice), use subfunction 1 of function 68.
221
    time slice), use subfunction 1 of function 68.
222
 
222
 
223
---------------------- Constants for registers: ----------------------
223
---------------------- Constants for registers: ----------------------
224
  eax - SF_SLEEP (5)
224
  eax - SF_SLEEP (5)
225
======================================================================
225
======================================================================
226
=============== Function 7 - draw image in the window. ===============
226
=============== Function 7 - draw image in the window. ===============
227
======================================================================
227
======================================================================
228
Paramters:
228
Paramters:
229
  * eax = 7 - function number
229
  * eax = 7 - function number
230
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
230
  * ebx = pointer to the image in the format BBGGRRBBGGRR...
231
  * ecx = [size on axis x]*65536 + [size on axis y]
231
  * ecx = [size on axis x]*65536 + [size on axis y]
232
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
232
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
233
Returned value:
233
Returned value:
234
  * function does not return value
234
  * function does not return value
235
Remarks:
235
Remarks:
236
  * Coordinates of the image are coordinates of the upper left corner
236
  * Coordinates of the image are coordinates of the upper left corner
237
    of the image relative to the window.
237
    of the image relative to the window.
238
  * Size of the image in bytes is 3*xsize*ysize.
238
  * Size of the image in bytes is 3*xsize*ysize.
239
 
239
 
240
---------------------- Constants for registers: ----------------------
240
---------------------- Constants for registers: ----------------------
241
  eax - SF_PUT_IMAGE (7)
241
  eax - SF_PUT_IMAGE (7)
242
======================================================================
242
======================================================================
243
=============== Function 8 - define/delete the button. ===============
243
=============== Function 8 - define/delete the button. ===============
244
======================================================================
244
======================================================================
245
Parameters for button definition:
245
Parameters for button definition:
246
  * eax = 8 - function number
246
  * eax = 8 - function number
247
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
247
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
248
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
248
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
249
  * edx = 0xXYnnnnnn, where:
249
  * edx = 0xXYnnnnnn, where:
250
    * nnnnnn = identifier of the button
250
    * nnnnnn = identifier of the button
251
    * high (31st) bit of edx is cleared
251
    * high (31st) bit of edx is cleared
252
    * if 30th bit of edx is set - do not draw the button
252
    * if 30th bit of edx is set - do not draw the button
253
    * if 29th bit of edx is set - do not draw a frame
253
    * if 29th bit of edx is set - do not draw a frame
254
      at pressing the button
254
      at pressing the button
255
  * esi = 0x00RRGGBB - color of the button
255
  * esi = 0x00RRGGBB - color of the button
256
Parameters for button deleting:
256
Parameters for button deleting:
257
  * eax = 8 - function number
257
  * eax = 8 - function number
258
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
258
  * edx = 0x80nnnnnn, where nnnnnn - identifier of the button
259
Returned value:
259
Returned value:
260
  * function does not return value
260
  * function does not return value
261
Remarks:
261
Remarks:
262
  * Sizes of the button must be more than 0 and less than 0x8000.
262
  * Sizes of the button must be more than 0 and less than 0x8000.
263
  * For skinned windows definition of the window
263
  * For skinned windows definition of the window
264
    (call of 0th function) creates two standard buttons -
264
    (call of 0th function) creates two standard buttons -
265
    for close of the window with identifier 1 and
265
    for close of the window with identifier 1 and
266
    for minimize of the window with identifier 0xffff.
266
    for minimize of the window with identifier 0xffff.
267
  * The creation of two buttons with same identifiers is admitted.
267
  * The creation of two buttons with same identifiers is admitted.
268
  * The button with the identifier 0xffff at pressing is interpreted
268
  * The button with the identifier 0xffff at pressing is interpreted
269
    by the system as the button of minimization, the system handles
269
    by the system as the button of minimization, the system handles
270
    such pressing independently, not accessing to the application.
270
    such pressing independently, not accessing to the application.
271
    In rest it is usual button.
271
    In rest it is usual button.
272
  * Total number of buttons for all applications is limited to 4095.
272
  * Total number of buttons for all applications is limited to 4095.
273
 
273
 
274
---------------------- Constants for registers: ----------------------
274
---------------------- Constants for registers: ----------------------
275
  eax - SF_DEFINE_BUTTON (8)
275
  eax - SF_DEFINE_BUTTON (8)
276
======================================================================
276
======================================================================
277
============ Function 9 - information on execution thread. ===========
277
============ Function 9 - information on execution thread. ===========
278
======================================================================
278
======================================================================
279
Parameters:
279
Parameters:
280
  * eax = 9 - function number
280
  * eax = 9 - function number
281
  * ebx = pointer to 1-Kb buffer
281
  * ebx = pointer to 1-Kb buffer
282
  * ecx = number of the slot of the thread
282
  * ecx = number of the slot of the thread
283
    ecx = -1 - get information on the current thread
283
    ecx = -1 - get information on the current thread
284
Returned value:
284
Returned value:
285
  * eax = maximum number of the slot of a thread
285
  * eax = maximum number of the slot of a thread
286
    but if pointer in ebx is illegal, for example,
286
    but if pointer in ebx is illegal, for example,
287
    [ebx, ebx + 0x4C) region intersects with kernel memory,
287
    [ebx, ebx + 0x4C) region intersects with kernel memory,
288
    then function returns -1
288
    then function returns -1
289
  * buffer pointed to by ebx contains the following information:
289
  * buffer pointed to by ebx contains the following information:
290
    * +0: dword: usage of the processor (how many time units
290
    * +0: dword: usage of the processor (how many time units
291
      per second leaves on execution of this thread)
291
      per second leaves on execution of this thread)
292
    * +4: word: position of the window of thread in the window stack
292
    * +4: word: position of the window of thread in the window stack
293
    * +6: word: (has no relation to the specified thread)
293
    * +6: word: (has no relation to the specified thread)
294
      number of the thread slot, which window has in the window stack
294
      number of the thread slot, which window has in the window stack
295
      position ecx
295
      position ecx
296
    * +8: word: reserved
296
    * +8: word: reserved
297
    * +10 = +0xA: 11 bytes: name of the process
297
    * +10 = +0xA: 11 bytes: name of the process
298
      (name of the started file - executable file without extension)
298
      (name of the started file - executable file without extension)
299
    * +21 = +0x15: byte: reserved, this byte is not changed
299
    * +21 = +0x15: byte: reserved, this byte is not changed
300
    * +22 = +0x16: dword: address of the process in memory
300
    * +22 = +0x16: dword: address of the process in memory
301
    * +26 = +0x1A: dword: size of used memory - 1
301
    * +26 = +0x1A: dword: size of used memory - 1
302
    * +30 = +0x1E: dword: identifier (PID/TID)
302
    * +30 = +0x1E: dword: identifier (PID/TID)
303
    * +34 = +0x22: dword: coordinate of the thread window on axis x
303
    * +34 = +0x22: dword: coordinate of the thread window on axis x
304
    * +38 = +0x26: dword: coordinate of the thread window on axis y
304
    * +38 = +0x26: dword: coordinate of the thread window on axis y
305
    * +42 = +0x2A: dword: size of the thread window on axis x
305
    * +42 = +0x2A: dword: size of the thread window on axis x
306
    * +46 = +0x2E: dword: size of the thread window on axis y
306
    * +46 = +0x2E: dword: size of the thread window on axis y
307
    * +50 = +0x32: word: status of the thread slot:
307
    * +50 = +0x32: word: status of the thread slot:
308
      * 0 = thread is running
308
      * 0 = thread is running
309
      * 1 = thread is suspended
309
      * 1 = thread is suspended
310
      * 2 = thread is suspended while waiting for event
310
      * 2 = thread is suspended while waiting for event
311
      * 3 = thread is terminating as a result of call to function -1
311
      * 3 = thread is terminating as a result of call to function -1
312
        or under duress as a result of call to subfunction 2
312
        or under duress as a result of call to subfunction 2
313
        of function 18 or termination of the system
313
        of function 18 or termination of the system
314
      * 4 = thread is terminating as a result of exception
314
      * 4 = thread is terminating as a result of exception
315
      * 5 = thread waits for event
315
      * 5 = thread waits for event
316
      * 9 = requested slot is free, all other information on the slot
316
      * 9 = requested slot is free, all other information on the slot
317
        is not meaningful
317
        is not meaningful
318
    * +52 = +0x34: word: reserved, this word is not changed
318
    * +52 = +0x34: word: reserved, this word is not changed
319
    * +54 = +0x36: dword: coordinate of the client area on axis x
319
    * +54 = +0x36: dword: coordinate of the client area on axis x
320
    * +58 = +0x3A: dword: coordinate of the client area on axis y
320
    * +58 = +0x3A: dword: coordinate of the client area on axis y
321
    * +62 = +0x3E: dword: width of the client area
321
    * +62 = +0x3E: dword: width of the client area
322
    * +66 = +0x42: dword: height of the client area
322
    * +66 = +0x42: dword: height of the client area
323
    * +70 = +0x46: byte: state of the window - bitfield
323
    * +70 = +0x46: byte: state of the window - bitfield
324
      * bit 0 (mask 1): window is maximized
324
      * bit 0 (mask 1): window is maximized
325
      * bit 1 (mask 2): window is minimized to panel
325
      * bit 1 (mask 2): window is minimized to panel
326
      * bit 2 (mask 4): window is rolled up
326
      * bit 2 (mask 4): window is rolled up
327
    * +71 = +0x47: dword: event mask
327
    * +71 = +0x47: dword: event mask
328
    * +75 = +0x4B: byte: keyboard mode(ASCII = 0; SCAN = 1)
328
    * +75 = +0x4B: byte: keyboard mode(ASCII = 0; SCAN = 1)
329
Remarks:
329
Remarks:
330
  * Slots are numbered starting from 1.
330
  * Slots are numbered starting from 1.
331
  * Returned value is not a total number of threads, because there
331
  * Returned value is not a total number of threads, because there
332
    can be free slots.
332
    can be free slots.
333
  * When process is starting, system automatically creates
333
  * When process is starting, system automatically creates
334
    execution thread.
334
    execution thread.
335
  * Function gives information on the thread. Each process has
335
  * Function gives information on the thread. Each process has
336
    at least one thread. One process can create many threads,
336
    at least one thread. One process can create many threads,
337
    in this case each thread has its own slot and the fields
337
    in this case each thread has its own slot and the fields
338
    +10, +22, +26 in these slots coincide.
338
    +10, +22, +26 in these slots coincide.
339
    Applications have no common way to define whether two threads
339
    Applications have no common way to define whether two threads
340
    belong to one process.
340
    belong to one process.
341
  * The active window - window on top of the window stack -
341
  * The active window - window on top of the window stack -
342
    receives the messages on a keyboard input. For such window
342
    receives the messages on a keyboard input. For such window
343
    the position in the window stack coincides with returned value.
343
    the position in the window stack coincides with returned value.
344
  * Slot 1 corresponds to special system thread, for which:
344
  * Slot 1 corresponds to special system thread, for which:
345
    * the window is in the bottom of the window stack, the fields
345
    * the window is in the bottom of the window stack, the fields
346
      +4 and +6 contain value 1
346
      +4 and +6 contain value 1
347
    * name of the process - "IDLE" (supplemented by spaces)
347
    * name of the process - "IDLE" (supplemented by spaces)
348
    * address of the process in memory is 0, size of used memory is
348
    * address of the process in memory is 0, size of used memory is
349
      16 Mb (0x1000000)
349
      16 Mb (0x1000000)
350
    * PID=1
350
    * PID=1
351
    * coordinates and sizes of the window and the client area are by
351
    * coordinates and sizes of the window and the client area are by
352
      convention set to 0
352
      convention set to 0
353
    * status of the slot is always 0 (running)
353
    * status of the slot is always 0 (running)
354
    * the execution time adds of time leaving on operations itself
354
    * the execution time adds of time leaving on operations itself
355
      and idle time in waiting for interrupt (which can be got by call
355
      and idle time in waiting for interrupt (which can be got by call
356
      to subfunction 4 of function 18).
356
      to subfunction 4 of function 18).
357
  * Slot 2 (and some others) correspond to system threads, for which:
357
  * Slot 2 (and some others) correspond to system threads, for which:
358
    * name of the thread - "OS" (supplemented by spaces)
358
    * name of the thread - "OS" (supplemented by spaces)
359
  * The normal applications are placed in memory at the address
359
  * The normal applications are placed in memory at the address
360
    0 (kernel constant 'std_application_base_address').
360
    0 (kernel constant 'std_application_base_address').
361
    There is no intersection, as each process has its own page table.
361
    There is no intersection, as each process has its own page table.
362
  * At creation of the thread it is assigned the slot
362
  * At creation of the thread it is assigned the slot
363
    in the system table and identifier (Process/Thread IDentifier =
363
    in the system table and identifier (Process/Thread IDentifier =
364
    PID/TID), which do not vary with time for given thread.
364
    PID/TID), which do not vary with time for given thread.
365
    After completion of the thread its slot can be anew used
365
    After completion of the thread its slot can be anew used
366
    for another thread. The thread identifier can not be assigned
366
    for another thread. The thread identifier can not be assigned
367
    to other thread even after completion of this thread.
367
    to other thread even after completion of this thread.
368
    Identifiers, assigned to new threads, grow monotonously.
368
    Identifiers, assigned to new threads, grow monotonously.
369
  * If the thread has not yet defined the window by call to
369
  * If the thread has not yet defined the window by call to
370
    function 0, the position and the sizes
370
    function 0, the position and the sizes
371
    of its window are considered to be zero.
371
    of its window are considered to be zero.
372
  * Coordinates of the client area are relative to the window.
372
  * Coordinates of the client area are relative to the window.
373
  * At the moment only the part of the buffer by a size
373
  * At the moment only the part of the buffer by a size
374
    76 = 0x4C bytes is used. Nevertheless it is recommended to use
374
    76 = 0x4C bytes is used. Nevertheless it is recommended to use
375
    1-Kb buffer for the future compatibility, in the future
375
    1-Kb buffer for the future compatibility, in the future
376
    some fields can be added.
376
    some fields can be added.
377
 
377
 
378
---------------------- Constants for registers: ----------------------
378
---------------------- Constants for registers: ----------------------
379
  eax - SF_THREAD_INFO (9)
379
  eax - SF_THREAD_INFO (9)
380
======================================================================
380
======================================================================
381
==================== Function 10 - wait for event. ===================
381
==================== Function 10 - wait for event. ===================
382
======================================================================
382
======================================================================
383
If the message queue is empty, waits for appearance of the message
383
If the message queue is empty, waits for appearance of the message
384
in queue. In this state thread does not consume CPU time.
384
in queue. In this state thread does not consume CPU time.
385
Then reads out the message from queue.
385
Then reads out the message from queue.
386
 
386
 
387
Parameters:
387
Parameters:
388
  * eax = 10 - function number
388
  * eax = 10 - function number
389
Returned value:
389
Returned value:
390
  * eax = event (see the list of events)
390
  * eax = event (see the list of events)
391
Remarks:
391
Remarks:
392
  * Those events are taken into account only which enter into
392
  * Those events are taken into account only which enter into
393
    a mask set by function 40. By default it is
393
    a mask set by function 40. By default it is
394
    redraw, key and button events.
394
    redraw, key and button events.
395
  * To check, whether there is a message in queue, use function 11.
395
  * To check, whether there is a message in queue, use function 11.
396
    To wait for no more than given time, use function 23.
396
    To wait for no more than given time, use function 23.
397
 
397
 
398
---------------------- Constants for registers: ----------------------
398
---------------------- Constants for registers: ----------------------
399
  eax - SF_WAIT_EVENT (10)
399
  eax - SF_WAIT_EVENT (10)
400
======================================================================
400
======================================================================
401
=============== Function 11 - check for event, no wait. ==============
401
=============== Function 11 - check for event, no wait. ==============
402
======================================================================
402
======================================================================
403
If the message queue contains event, function reads out
403
If the message queue contains event, function reads out
404
and return it. If the queue is empty, function returns 0.
404
and return it. If the queue is empty, function returns 0.
405
Parameters:
405
Parameters:
406
  * eax = 11 - function number
406
  * eax = 11 - function number
407
Returned value:
407
Returned value:
408
  * eax = 0 - message queue is empty
408
  * eax = 0 - message queue is empty
409
  * else eax = event (see the list of events)
409
  * else eax = event (see the list of events)
410
Remarks:
410
Remarks:
411
  * Those events are taken into account only, which enter into
411
  * Those events are taken into account only, which enter into
412
    a mask set by function 40. By default it is
412
    a mask set by function 40. By default it is
413
    redraw, key and button events.
413
    redraw, key and button events.
414
  * To wait for event, use function 10.
414
  * To wait for event, use function 10.
415
    To wait for no more than given time, use function 23.
415
    To wait for no more than given time, use function 23.
416
 
416
 
417
---------------------- Constants for registers: ----------------------
417
---------------------- Constants for registers: ----------------------
418
  eax - SF_CHECK_EVENT (11)
418
  eax - SF_CHECK_EVENT (11)
419
======================================================================
419
======================================================================
420
=============== Function 12 - begin/end window redraw. ===============
420
=============== Function 12 - begin/end window redraw. ===============
421
======================================================================
421
======================================================================
422
 
422
 
423
---------------- Subfunction 1 - begin window redraw. ----------------
423
---------------- Subfunction 1 - begin window redraw. ----------------
424
Parameters:
424
Parameters:
425
  * eax = 12 - function number
425
  * eax = 12 - function number
426
  * ebx = 1 - subfunction number
426
  * ebx = 1 - subfunction number
427
Returned value:
427
Returned value:
428
  * function does not return value
428
  * function does not return value
429
 
429
 
430
----------------- Subfunction 2 - end window redraw. -----------------
430
----------------- Subfunction 2 - end window redraw. -----------------
431
Parameters:
431
Parameters:
432
  * eax = 12 - function number
432
  * eax = 12 - function number
433
  * ebx = 2 - subfunction number
433
  * ebx = 2 - subfunction number
434
Returned value:
434
Returned value:
435
  * function does not return value
435
  * function does not return value
436
Remarks:
436
Remarks:
437
  * Subfunction 1 deletes all buttons defined with
437
  * Subfunction 1 deletes all buttons defined with
438
    function 8, they must be defined again.
438
    function 8, they must be defined again.
439
 
439
 
440
---------------------- Constants for registers: ----------------------
440
---------------------- Constants for registers: ----------------------
441
  eax - SF_REDRAW (12)
441
  eax - SF_REDRAW (12)
442
  ebx - SSF_BEGIN_DRAW (1), SSF_END_DRAW (2)
442
  ebx - SSF_BEGIN_DRAW (1), SSF_END_DRAW (2)
443
======================================================================
443
======================================================================
444
============ Function 13 - draw a rectangle in the window. ===========
444
============ Function 13 - draw a rectangle in the window. ===========
445
======================================================================
445
======================================================================
446
Parameters:
446
Parameters:
447
  * eax = 13 - function number
447
  * eax = 13 - function number
448
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
448
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
449
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
449
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
450
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
450
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
451
Returned value:
451
Returned value:
452
  * function does not return value
452
  * function does not return value
453
Remarks:
453
Remarks:
454
  * Coordinates are understood as coordinates of the left upper corner
454
  * Coordinates are understood as coordinates of the left upper corner
455
    of a rectangle relative to the window.
455
    of a rectangle relative to the window.
456
 
456
 
457
---------------------- Constants for registers: ----------------------
457
---------------------- Constants for registers: ----------------------
458
  eax - SF_DRAW_RECT (13)
458
  eax - SF_DRAW_RECT (13)
459
======================================================================
459
======================================================================
460
=================== Function 14 - get screen size. ===================
460
=================== Function 14 - get screen size. ===================
461
======================================================================
461
======================================================================
462
Parameters:
462
Parameters:
463
  * eax = 14 - function number
463
  * eax = 14 - function number
464
Returned value:
464
Returned value:
465
  * eax = [xsize]*65536 + [ysize], where
465
  * eax = [xsize]*65536 + [ysize], where
466
  * xsize = x-coordinate of the right lower corner of the screen =
466
  * xsize = x-coordinate of the right lower corner of the screen =
467
            horizontal size - 1
467
            horizontal size - 1
468
  * ysize = y-coordinate of the right lower corner of the screen =
468
  * ysize = y-coordinate of the right lower corner of the screen =
469
            vertical size - 1
469
            vertical size - 1
470
Remarks:
470
Remarks:
471
  * See also subfunction 5 of function 48 - get sizes of
471
  * See also subfunction 5 of function 48 - get sizes of
472
    working area of the screen.
472
    working area of the screen.
473
 
473
 
474
---------------------- Constants for registers: ----------------------
474
---------------------- Constants for registers: ----------------------
475
  eax - SF_GET_SCREEN_SIZE (14)
475
  eax - SF_GET_SCREEN_SIZE (14)
476
======================================================================
476
======================================================================
477
== Function 15, subfunction 1 - set a size of the background image. ==
477
== Function 15, subfunction 1 - set a size of the background image. ==
478
======================================================================
478
======================================================================
479
Parameters:
479
Parameters:
480
  * eax = 15 - function number
480
  * eax = 15 - function number
481
  * ebx = 1 - subfunction number
481
  * ebx = 1 - subfunction number
482
  * ecx = width of the image
482
  * ecx = width of the image
483
  * edx = height of the image
483
  * edx = height of the image
484
Returned value:
484
Returned value:
485
  * function does not return value
485
  * function does not return value
486
Remarks:
486
Remarks:
487
  * Before calling subfunctions 2 and 5 you should call this function
487
  * Before calling subfunctions 2 and 5 you should call this function
488
    to set image size!
488
    to set image size!
489
  * For update of the screen (after completion of a series of commands
489
  * For update of the screen (after completion of a series of commands
490
    working with a background) call subfunction 3.
490
    working with a background) call subfunction 3.
491
  * There is a pair function for get size of the background image -
491
  * There is a pair function for get size of the background image -
492
    subfunction 1 of function 39.
492
    subfunction 1 of function 39.
493
 
493
 
494
---------------------- Constants for registers: ----------------------
494
---------------------- Constants for registers: ----------------------
495
  eax - SF_BACKGROUND_SET (15)
495
  eax - SF_BACKGROUND_SET (15)
496
  ebx - SSF_SIZE_BG (1)
496
  ebx - SSF_SIZE_BG (1)
497
======================================================================
497
======================================================================
498
=== Function 15, subfunction 2 - put pixel on the background image. ==
498
=== Function 15, subfunction 2 - put pixel on the background image. ==
499
======================================================================
499
======================================================================
500
Parameters:
500
Parameters:
501
  * eax = 15 - function number
501
  * eax = 15 - function number
502
  * ebx = 2 - subfunction number
502
  * ebx = 2 - subfunction number
503
  * ecx = offset
503
  * ecx = offset
504
  * edx = color of a pixel 0xRRGGBB
504
  * edx = color of a pixel 0xRRGGBB
505
Returned value:
505
Returned value:
506
  * function does not return value
506
  * function does not return value
507
Remarks:
507
Remarks:
508
  * Offset for a pixel with coordinates (x,y) is calculated as
508
  * Offset for a pixel with coordinates (x,y) is calculated as
509
    (x+y*xsize)*3.
509
    (x+y*xsize)*3.
510
  * If the given offset exceeds size set by subfunction 1,
510
  * If the given offset exceeds size set by subfunction 1,
511
    the call is ignored.
511
    the call is ignored.
512
  * For update of the screen (after completion of a series of commands
512
  * For update of the screen (after completion of a series of commands
513
    working with a background) call subfunction 3.
513
    working with a background) call subfunction 3.
514
  * There is a pair function for get pixel on the background image -
514
  * There is a pair function for get pixel on the background image -
515
    subfunction 2 of function 39.
515
    subfunction 2 of function 39.
516
 
516
 
517
---------------------- Constants for registers: ----------------------
517
---------------------- Constants for registers: ----------------------
518
  eax - SF_BACKGROUND_SET (15)
518
  eax - SF_BACKGROUND_SET (15)
519
  ebx - SSF_PIXEL_BG (2)
519
  ebx - SSF_PIXEL_BG (2)
520
======================================================================
520
======================================================================
521
=========== Function 15, subfunction 3 - redraw background. ==========
521
=========== Function 15, subfunction 3 - redraw background. ==========
522
======================================================================
522
======================================================================
523
Parameters:
523
Parameters:
524
  * eax = 15 - function number
524
  * eax = 15 - function number
525
  * ebx = 3 - subfunction number
525
  * ebx = 3 - subfunction number
526
Returned value:
526
Returned value:
527
  * function does not return value
527
  * function does not return value
528
 
528
 
529
---------------------- Constants for registers: ----------------------
529
---------------------- Constants for registers: ----------------------
530
  eax - SF_BACKGROUND_SET (15)
530
  eax - SF_BACKGROUND_SET (15)
531
  ebx - SSF_REDRAW_BG (3)
531
  ebx - SSF_REDRAW_BG (3)
532
======================================================================
532
======================================================================
533
== Function 15, subfunction 4 - set drawing mode for the background. =
533
== Function 15, subfunction 4 - set drawing mode for the background. =
534
======================================================================
534
======================================================================
535
Parameters:
535
Parameters:
536
  * eax = 15 - function number
536
  * eax = 15 - function number
537
  * ebx = 4 - subfunction number
537
  * ebx = 4 - subfunction number
538
  * ecx = drawing mode:
538
  * ecx = drawing mode:
539
    * 1 = tile
539
    * 1 = tile
540
    * 2 = stretch
540
    * 2 = stretch
541
Returned value:
541
Returned value:
542
  * function does not return value
542
  * function does not return value
543
Remarks:
543
Remarks:
544
  * For update of the screen (after completion of a series of commands
544
  * For update of the screen (after completion of a series of commands
545
    working with a background) call subfunction 3.
545
    working with a background) call subfunction 3.
546
  * There is a pair function for get drawing mode of the background -
546
  * There is a pair function for get drawing mode of the background -
547
    subfunction 4 of function 39.
547
    subfunction 4 of function 39.
548
 
548
 
549
---------------------- Constants for registers: ----------------------
549
---------------------- Constants for registers: ----------------------
550
  eax - SF_BACKGROUND_SET (15)
550
  eax - SF_BACKGROUND_SET (15)
551
  ebx - SSF_MODE_BG (4)
551
  ebx - SSF_MODE_BG (4)
552
======================================================================
552
======================================================================
553
===================== Function 15, subfunction 5 =====================
553
===================== Function 15, subfunction 5 =====================
554
============ Put block of pixels on the background image. ============
554
============ Put block of pixels on the background image. ============
555
======================================================================
555
======================================================================
556
Parameters:
556
Parameters:
557
  * eax = 15 - function number
557
  * eax = 15 - function number
558
  * ebx = 5 - subfunction number
558
  * ebx = 5 - subfunction number
559
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
559
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
560
  * edx = offset in data of the background image
560
  * edx = offset in data of the background image
561
  * esi = size of data in bytes = 3 * number of pixels
561
  * esi = size of data in bytes = 3 * number of pixels
562
Returned value:
562
Returned value:
563
  * function does not return value
563
  * function does not return value
564
Remarks:
564
Remarks:
565
  * Offset and size are not checked for correctness.
565
  * Offset and size are not checked for correctness.
566
  * Color of each pixel is stored as 3-bytes value BBGGRR.
566
  * Color of each pixel is stored as 3-bytes value BBGGRR.
567
  * Pixels of the background image are written sequentially
567
  * Pixels of the background image are written sequentially
568
    from left to right, from up to down.
568
    from left to right, from up to down.
569
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
569
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
570
  * For update of the screen (after completion of a series of commands
570
  * For update of the screen (after completion of a series of commands
571
    working with a background) call subfunction 3.
571
    working with a background) call subfunction 3.
572
 
572
 
573
---------------------- Constants for registers: ----------------------
573
---------------------- Constants for registers: ----------------------
574
  eax - SF_BACKGROUND_SET (15)
574
  eax - SF_BACKGROUND_SET (15)
575
  ebx - SSF_IMAGE_BG (5)
575
  ebx - SSF_IMAGE_BG (5)
576
======================================================================
576
======================================================================
577
===================== Function 15, subfunction 6 =====================
577
===================== Function 15, subfunction 6 =====================
578
======== Map background data to the address space of process. ========
578
======== Map background data to the address space of process. ========
579
======================================================================
579
======================================================================
580
Parameters:
580
Parameters:
581
  * eax = 15 - function number
581
  * eax = 15 - function number
582
  * ebx = 6 - subfunction number
582
  * ebx = 6 - subfunction number
583
Returned value:
583
Returned value:
584
  * eax = pointer to background data, 0 if error
584
  * eax = pointer to background data, 0 if error
585
Remarks:
585
Remarks:
586
  * Mapped data are available for read and write.
586
  * Mapped data are available for read and write.
587
  * Size of background data is 3*xsize*ysize. The system blocks
587
  * Size of background data is 3*xsize*ysize. The system blocks
588
    changes of background sizes while process works with mapped data.
588
    changes of background sizes while process works with mapped data.
589
  * Color of each pixel is stored as 3-bytes value BBGGRR.
589
  * Color of each pixel is stored as 3-bytes value BBGGRR.
590
  * Pixels of the background image are written sequentially
590
  * Pixels of the background image are written sequentially
591
    from left to right, from up to down.
591
    from left to right, from up to down.
592
 
592
 
593
---------------------- Constants for registers: ----------------------
593
---------------------- Constants for registers: ----------------------
594
  eax - SF_BACKGROUND_SET (15)
594
  eax - SF_BACKGROUND_SET (15)
595
  ebx - SSF_MAP_BG (6)
595
  ebx - SSF_MAP_BG (6)
596
======================================================================
596
======================================================================
597
===== Function 15, subfunction 7 - close mapped background data. =====
597
===== Function 15, subfunction 7 - close mapped background data. =====
598
======================================================================
598
======================================================================
599
Parameters:
599
Parameters:
600
  * eax = 15 - function number
600
  * eax = 15 - function number
601
  * ebx = 7 - subfunction number
601
  * ebx = 7 - subfunction number
602
  * ecx = pointer to mapped data
602
  * ecx = pointer to mapped data
603
Returned value:
603
Returned value:
604
  * eax = 1 - success, 0 - error
604
  * eax = 1 - success, 0 - error
605
 
605
 
606
---------------------- Constants for registers: ----------------------
606
---------------------- Constants for registers: ----------------------
607
  eax - SF_BACKGROUND_SET (15)
607
  eax - SF_BACKGROUND_SET (15)
608
  ebx - SSF_UNMAP_BG (7)
608
  ebx - SSF_UNMAP_BG (7)
609
======================================================================
609
======================================================================
610
===================== Function 15, subfunction 8 =====================
610
===================== Function 15, subfunction 8 =====================
611
============= Get coordinates of last draw the background ============
611
============= Get coordinates of last draw the background ============
612
======================================================================
612
======================================================================
613
Parameters:
613
Parameters:
614
  * eax = 15 - function number
614
  * eax = 15 - function number
615
  * ebx = 8 - subfunction number
615
  * ebx = 8 - subfunction number
616
Returned value:
616
Returned value:
617
  * eax = [left]*65536 + [right]
617
  * eax = [left]*65536 + [right]
618
  * ebx = [top]*65536 + [bottom]
618
  * ebx = [top]*65536 + [bottom]
619
Remarks:
619
Remarks:
620
  * (left,top) are coordinates of the left upper corner,
620
  * (left,top) are coordinates of the left upper corner,
621
    (right,bottom) are coordinates of the right lower one.
621
    (right,bottom) are coordinates of the right lower one.
622
  * For receiving more reliable information, call the function
622
  * For receiving more reliable information, call the function
623
    immediately after the event:
623
    immediately after the event:
624
             5 = kernel finished redrawing of the desktop background
624
             5 = kernel finished redrawing of the desktop background
625
 
625
 
626
---------------------- Constants for registers: ----------------------
626
---------------------- Constants for registers: ----------------------
627
  eax - SF_BACKGROUND_SET (15)
627
  eax - SF_BACKGROUND_SET (15)
628
  ebx - SSF_LAST_DRAW (8)
628
  ebx - SSF_LAST_DRAW (8)
629
======================================================================
629
======================================================================
630
===================== Function 15, subfunction 9 =====================
630
===================== Function 15, subfunction 9 =====================
631
============= Redraws a rectangular part of the background ===========
631
============= Redraws a rectangular part of the background ===========
632
======================================================================
632
======================================================================
633
Parameters:
633
Parameters:
634
  * eax = 15 - function number
634
  * eax = 15 - function number
635
  * ebx = 9 - subfunction number
635
  * ebx = 9 - subfunction number
636
  * ecx = [left]*65536 + [right]
636
  * ecx = [left]*65536 + [right]
637
  * edx = [top]*65536 + [bottom]
637
  * edx = [top]*65536 + [bottom]
638
Returned value:
638
Returned value:
639
  * function does not return value
639
  * function does not return value
640
Remarks:
640
Remarks:
641
  * (left,top) are coordinates of the left upper corner,
641
  * (left,top) are coordinates of the left upper corner,
642
    (right,bottom) are coordinates of the right lower one.
642
    (right,bottom) are coordinates of the right lower one.
643
  * If parameters are set incorrectly then background is not redrawn.
643
  * If parameters are set incorrectly then background is not redrawn.
644
 
644
 
645
---------------------- Constants for registers: ----------------------
645
---------------------- Constants for registers: ----------------------
646
  eax - SF_BACKGROUND_SET (15)
646
  eax - SF_BACKGROUND_SET (15)
647
  ebx - SSF_REDRAW_RECT (9)
647
  ebx - SSF_REDRAW_RECT (9)
648
======================================================================
648
======================================================================
649
=============== Function 16 - save ramdisk on a floppy. ==============
649
=============== Function 16 - save ramdisk on a floppy. ==============
650
======================================================================
650
======================================================================
651
Parameters:
651
Parameters:
652
  * eax = 16 - function number
652
  * eax = 16 - function number
653
  * ebx = 1 or ebx = 2 - on which floppy save
653
  * ebx = 1 or ebx = 2 - on which floppy save
654
Returned value:
654
Returned value:
655
  * eax = 0 - success
655
  * eax = 0 - success
656
  * eax = 1 - error
656
  * eax = 1 - error
657
 
657
 
658
---------------------- Constants for registers: ----------------------
658
---------------------- Constants for registers: ----------------------
659
  eax - SF_RD_TO_FLOPPY (16)
659
  eax - SF_RD_TO_FLOPPY (16)
660
======================================================================
660
======================================================================
661
======= Function 17 - get the identifier of the pressed button. ======
661
======= Function 17 - get the identifier of the pressed button. ======
662
======================================================================
662
======================================================================
663
Takes away the code of the pressed button from the buffer.
663
Takes away the code of the pressed button from the buffer.
664
Parameters:
664
Parameters:
665
  * eax = 17 - function number
665
  * eax = 17 - function number
666
Returned value:
666
Returned value:
667
  * if the buffer is empty, function returns eax=1
667
  * if the buffer is empty, function returns eax=1
668
  * if the buffer is not empty:
668
  * if the buffer is not empty:
669
    * high 24 bits of eax contain button identifier (in particular,
669
    * high 24 bits of eax contain button identifier (in particular,
670
      ah contains low byte of the identifier; if all buttons have
670
      ah contains low byte of the identifier; if all buttons have
671
      the identifier less than 256, ah is enough to distinguish)
671
      the identifier less than 256, ah is enough to distinguish)
672
    * al = 0 - the button was pressed with left mouse button
672
    * al = 0 - the button was pressed with left mouse button
673
    * al = bit corresponding to used mouse button otherwise
673
    * al = bit corresponding to used mouse button otherwise
674
Remarks:
674
Remarks:
675
  * "Buffer" keeps only one button, at pressing the new button the
675
  * "Buffer" keeps only one button, at pressing the new button the
676
    information about old is lost.
676
    information about old is lost.
677
  * The call of this function by an application with inactive window
677
  * The call of this function by an application with inactive window
678
    will return answer "buffer is empty".
678
    will return answer "buffer is empty".
679
  * Returned value for al corresponds to the state of mouse buttons
679
  * Returned value for al corresponds to the state of mouse buttons
680
    as in subfunction 2 of function 37 at the beginning
680
    as in subfunction 2 of function 37 at the beginning
681
    of button press, excluding lower bit, which is cleared.
681
    of button press, excluding lower bit, which is cleared.
682
 
682
 
683
---------------------- Constants for registers: ----------------------
683
---------------------- Constants for registers: ----------------------
684
  eax - SF_GET_BUTTON (17)
684
  eax - SF_GET_BUTTON (17)
685
======================================================================
685
======================================================================
686
===================== Function 18, subfunction 1 =====================
686
===================== Function 18, subfunction 1 =====================
687
============= Make deactive the window of the given thread. ==========
687
============= Make deactive the window of the given thread. ==========
688
======================================================================
688
======================================================================
689
Parameters:
689
Parameters:
690
  * eax = 18 - function number
690
  * eax = 18 - function number
691
  * ebx = 1 - subfunction number
691
  * ebx = 1 - subfunction number
692
  * ecx = number of the thread slot
692
  * ecx = number of the thread slot
693
Returned value:
693
Returned value:
694
  * function does not return value
694
  * function does not return value
695
 
695
 
696
---------------------- Constants for registers: ----------------------
696
---------------------- Constants for registers: ----------------------
697
  eax - SF_SYSTEM (18)
697
  eax - SF_SYSTEM (18)
698
  ebx - SSF_UNFOCUS_WINDOW (1)
698
  ebx - SSF_UNFOCUS_WINDOW (1)
699
======================================================================
699
======================================================================
700
= Function 18, subfunction 2 - terminate process/thread by the slot. =
700
= Function 18, subfunction 2 - terminate process/thread by the slot. =
701
======================================================================
701
======================================================================
702
Parameters:
702
Parameters:
703
  * eax = 18 - function number
703
  * eax = 18 - function number
704
  * ebx = 2 - subfunction number
704
  * ebx = 2 - subfunction number
705
  * ecx = number of the slot of process/thread
705
  * ecx = number of the slot of process/thread
706
Returned value:
706
Returned value:
707
  * function does not return value
707
  * function does not return value
708
Remarks:
708
Remarks:
709
  * It is impossible to terminate system thread OS/IDLE (with
709
  * It is impossible to terminate system thread OS/IDLE (with
710
    number of the slot 1),
710
    number of the slot 1),
711
    it is possible to terminate any normal process/thread.
711
    it is possible to terminate any normal process/thread.
712
  * See also subfunction 18 - terminate
712
  * See also subfunction 18 - terminate
713
    process/thread by the identifier.
713
    process/thread by the identifier.
714
 
714
 
715
---------------------- Constants for registers: ----------------------
715
---------------------- Constants for registers: ----------------------
716
  eax - SF_SYSTEM (18)
716
  eax - SF_SYSTEM (18)
717
  ebx - SSF_TERMINATE_THREAD (2)
717
  ebx - SSF_TERMINATE_THREAD (2)
718
======================================================================
718
======================================================================
719
===================== Function 18, subfunction 3 =====================
719
===================== Function 18, subfunction 3 =====================
720
============= Make active the window of the given thread. ============
720
============= Make active the window of the given thread. ============
721
======================================================================
721
======================================================================
722
Parameters:
722
Parameters:
723
  * eax = 18 - function number
723
  * eax = 18 - function number
724
  * ebx = 3 - subfunction number
724
  * ebx = 3 - subfunction number
725
  * ecx = number of the thread slot
725
  * ecx = number of the thread slot
726
Returned value:
726
Returned value:
727
  * function does not return value
727
  * function does not return value
728
Remarks:
728
Remarks:
729
  * If correct, but nonexistent slot is given,
729
  * If correct, but nonexistent slot is given,
730
    some window is made active.
730
    some window is made active.
731
  * To find out, which window is active, use subfunction 7.
731
  * To find out, which window is active, use subfunction 7.
732
 
732
 
733
---------------------- Constants for registers: ----------------------
733
---------------------- Constants for registers: ----------------------
734
  eax - SF_SYSTEM (18)
734
  eax - SF_SYSTEM (18)
735
  ebx - SSF_FOCUS_WINDOW (3)
735
  ebx - SSF_FOCUS_WINDOW (3)
736
======================================================================
736
======================================================================
737
===================== Function 18, subfunction 4 =====================
737
===================== Function 18, subfunction 4 =====================
738
=========== Get counter of idle time units per one second. ===========
738
=========== Get counter of idle time units per one second. ===========
739
======================================================================
739
======================================================================
740
Idle time units are units, in which the processor stands idle
740
Idle time units are units, in which the processor stands idle
741
in waiting for interrupt (in the command 'hlt').
741
in waiting for interrupt (in the command 'hlt').
742
 
742
 
743
Parameters:
743
Parameters:
744
  * eax = 18 - function number
744
  * eax = 18 - function number
745
  * ebx = 4 - subfunction number
745
  * ebx = 4 - subfunction number
746
Returned value:
746
Returned value:
747
  * eax = value of the counter of idle time units per one second
747
  * eax = value of the counter of idle time units per one second
748
 
748
 
749
---------------------- Constants for registers: ----------------------
749
---------------------- Constants for registers: ----------------------
750
  eax - SF_SYSTEM (18)
750
  eax - SF_SYSTEM (18)
751
  ebx - SSF_GET_IDLE_COUNT (4)
751
  ebx - SSF_GET_IDLE_COUNT (4)
752
======================================================================
752
======================================================================
753
========== Function 18, subfunction 5 - get CPU clock rate. ==========
753
========== Function 18, subfunction 5 - get CPU clock rate. ==========
754
======================================================================
754
======================================================================
755
Parameters:
755
Parameters:
756
  * eax = 18 - function number
756
  * eax = 18 - function number
757
  * ebx = 5 - subfunction number
757
  * ebx = 5 - subfunction number
758
Returned value:
758
Returned value:
759
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
759
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
760
 
760
 
761
---------------------- Constants for registers: ----------------------
761
---------------------- Constants for registers: ----------------------
762
  eax - SF_SYSTEM (18)
762
  eax - SF_SYSTEM (18)
763
  ebx - SSF_GET_CPU_FREQUENCY (5)
763
  ebx - SSF_GET_CPU_FREQUENCY (5)
764
======================================================================
764
======================================================================
765
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
765
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
766
======================================================================
766
======================================================================
767
Parameters:
767
Parameters:
768
  * eax = 18 - function number
768
  * eax = 18 - function number
769
  * ebx = 6 - subfunction number
769
  * ebx = 6 - subfunction number
770
  * ecx = pointer to the full path to file
770
  * ecx = pointer to the full path to file
771
    (for example, "/hd0/1/kolibri/kolibri.img")
771
    (for example, "/hd0/1/kolibri/kolibri.img")
772
Returned value:
772
Returned value:
773
  * eax = 0 - success
773
  * eax = 0 - success
774
  * else eax = error code of the file system
774
  * else eax = error code of the file system
775
Remarks:
775
Remarks:
776
  * All folders in the given path must exist, otherwise function
776
  * All folders in the given path must exist, otherwise function
777
    returns value 5, "file not found".
777
    returns value 5, "file not found".
778
 
778
 
779
---------------------- Constants for registers: ----------------------
779
---------------------- Constants for registers: ----------------------
780
  eax - SF_SYSTEM (18)
780
  eax - SF_SYSTEM (18)
781
  ebx - SSF_RD_TO_HDD (6)
781
  ebx - SSF_RD_TO_HDD (6)
782
======================================================================
782
======================================================================
783
=========== Function 18, subfunction 7 - get active window. ==========
783
=========== Function 18, subfunction 7 - get active window. ==========
784
======================================================================
784
======================================================================
785
Parameters:
785
Parameters:
786
  * eax = 18 - function number
786
  * eax = 18 - function number
787
  * ebx = 7 - subfunction number
787
  * ebx = 7 - subfunction number
788
Returned value:
788
Returned value:
789
  * eax = number of the active window
789
  * eax = number of the active window
790
    (number of the slot of the thread with active window)
790
    (number of the slot of the thread with active window)
791
Remarks:
791
Remarks:
792
  * Active window is at the top of the window stack and receives
792
  * Active window is at the top of the window stack and receives
793
    messages on all keyboard input.
793
    messages on all keyboard input.
794
  * To make a window active, use subfunction 3.
794
  * To make a window active, use subfunction 3.
795
 
795
 
796
---------------------- Constants for registers: ----------------------
796
---------------------- Constants for registers: ----------------------
797
  eax - SF_SYSTEM (18)
797
  eax - SF_SYSTEM (18)
798
  ebx - SSF_GET_ACTIVE_WINDOW (7)
798
  ebx - SSF_GET_ACTIVE_WINDOW (7)
799
======================================================================
799
======================================================================
800
== Function 18, subfunction 8 - disable/enable the internal speaker. =
800
== Function 18, subfunction 8 - disable/enable the internal speaker. =
801
======================================================================
801
======================================================================
802
If speaker sound is disabled, all calls to subfunction 55 of
802
If speaker sound is disabled, all calls to subfunction 55 of
803
function 55 are ignored. If speaker sound is enabled,
803
function 55 are ignored. If speaker sound is enabled,
804
they are routed on builtin speaker.
804
they are routed on builtin speaker.
805
 
805
 
806
------------------- Subsubfunction 1 - get status. -------------------
806
------------------- Subsubfunction 1 - get status. -------------------
807
Parameters:
807
Parameters:
808
  * eax = 18 - function number
808
  * eax = 18 - function number
809
  * ebx = 8 - subfunction number
809
  * ebx = 8 - subfunction number
810
  * ecx = 1 - number of the subsubfunction
810
  * ecx = 1 - number of the subsubfunction
811
Returned value:
811
Returned value:
812
  * eax = 0 - speaker sound is enabled; 1 - disabled
812
  * eax = 0 - speaker sound is enabled; 1 - disabled
813
 
813
 
814
----------------- Subsubfunction 2 - toggle status. ------------------
814
----------------- Subsubfunction 2 - toggle status. ------------------
815
Toggles states of disable/enable.
815
Toggles states of disable/enable.
816
Parameters:
816
Parameters:
817
  * eax = 18 - function number
817
  * eax = 18 - function number
818
  * ebx = 8 - subfunction number
818
  * ebx = 8 - subfunction number
819
  * ecx = 2 - number of the subsubfunction
819
  * ecx = 2 - number of the subsubfunction
820
Returned value:
820
Returned value:
821
  * function does not return value
821
  * function does not return value
822
 
822
 
823
---------------------- Constants for registers: ----------------------
823
---------------------- Constants for registers: ----------------------
824
  eax - SF_SYSTEM (18)
824
  eax - SF_SYSTEM (18)
825
  ebx - SSF_SPEAKER (8)
825
  ebx - SSF_SPEAKER (8)
826
  ecx - SSSF_GET_STATE (1), SSSF_TOGGLE (2)
826
  ecx - SSSF_GET_STATE (1), SSSF_TOGGLE (2)
827
======================================================================
827
======================================================================
828
== Function 18, subfunction 9 - system shutdown with the parameter. ==
828
== Function 18, subfunction 9 - system shutdown with the parameter. ==
829
======================================================================
829
======================================================================
830
Parameters:
830
Parameters:
831
  * eax = 18 - function number
831
  * eax = 18 - function number
832
  * ebx = 9 - subfunction number
832
  * ebx = 9 - subfunction number
833
  * ecx = parameter:
833
  * ecx = parameter:
834
    * 2 = turn off computer
834
    * 2 = turn off computer
835
    * 3 = reboot computer
835
    * 3 = reboot computer
836
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
836
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
837
Returned value:
837
Returned value:
838
  * at incorrect ecx the registers do not change (i.e. eax=18)
838
  * at incorrect ecx the registers do not change (i.e. eax=18)
839
  * by correct call function always returns eax=0
839
  * by correct call function always returns eax=0
840
    as the tag of success
840
    as the tag of success
841
Remarks:
841
Remarks:
842
  * Do not rely on returned value by incorrect call, it can be
842
  * Do not rely on returned value by incorrect call, it can be
843
    changed in future versions of the kernel.
843
    changed in future versions of the kernel.
844
 
844
 
845
---------------------- Constants for registers: ----------------------
845
---------------------- Constants for registers: ----------------------
846
  eax - SF_SYSTEM (18)
846
  eax - SF_SYSTEM (18)
847
  ebx - SSF_SHUTDOWN (9)
847
  ebx - SSF_SHUTDOWN (9)
848
======================================================================
848
======================================================================
849
======= Function 18, subfunction 10 - minimize topmost window. =======
849
======= Function 18, subfunction 10 - minimize topmost window. =======
850
======================================================================
850
======================================================================
851
Minimizes the topmost (active) window.
851
Minimizes the topmost (active) window.
852
Parameters:
852
Parameters:
853
  * eax = 18 - function number
853
  * eax = 18 - function number
854
  * ebx = 10 - subfunction number
854
  * ebx = 10 - subfunction number
855
Returned value:
855
Returned value:
856
  * function does not return value
856
  * function does not return value
857
Remarks:
857
Remarks:
858
  * The minimized window from the point of view of function 9
858
  * The minimized window from the point of view of function 9
859
    keeps position and sizes.
859
    keeps position and sizes.
860
  * Restoring of an application window occurs at its activation by
860
  * Restoring of an application window occurs at its activation by
861
    subfunction 3.
861
    subfunction 3.
862
  * Usually there is no necessity to minimize/restore a window
862
  * Usually there is no necessity to minimize/restore a window
863
    explicitly: minimization of a window is carried out by the system
863
    explicitly: minimization of a window is carried out by the system
864
    at pressing the minimization button (for skinned windows
864
    at pressing the minimization button (for skinned windows
865
    it is defined automatically by function 0,
865
    it is defined automatically by function 0,
866
    for other windows it can be defined manually by function 8),
866
    for other windows it can be defined manually by function 8),
867
    restore of a window is done by the application '@taskbar'.
867
    restore of a window is done by the application '@taskbar'.
868
 
868
 
869
---------------------- Constants for registers: ----------------------
869
---------------------- Constants for registers: ----------------------
870
  eax - SF_SYSTEM (18)
870
  eax - SF_SYSTEM (18)
871
  ebx - SSF_MINIMIZE_WINDOW (10)
871
  ebx - SSF_MINIMIZE_WINDOW (10)
872
======================================================================
872
======================================================================
873
 Function 18, subfunction 11 - get information on the disk subsystem.
873
 Function 18, subfunction 11 - get information on the disk subsystem.
874
======================================================================
874
======================================================================
875
 
875
 
876
!!! WARNING. This interface is outdated and should not be used !!!
876
!!! WARNING. This interface is outdated and should not be used !!!
877
 
877
 
878
Parameters:
878
Parameters:
879
  * eax = 18 - function number
879
  * eax = 18 - function number
880
  * ebx = 11 - subfunction number
880
  * ebx = 11 - subfunction number
881
  * ecx = type of the table:
881
  * ecx = type of the table:
882
    * 1 = short version, 16 bytes
882
    * 1 = short version, 16 bytes
883
  * edx = pointer to the buffer (in the application) for the table
883
  * edx = pointer to the buffer (in the application) for the table
884
Returned value:
884
Returned value:
885
  * function does not return value
885
  * function does not return value
886
Format of the table: short version:
886
Format of the table: short version:
887
  * +0: byte: information about FDD's (drives for floppies),
887
  * +0: byte: information about FDD's (drives for floppies),
888
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
888
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
889
    of the second regarding to the following list:
889
    of the second regarding to the following list:
890
    * 0 = there is no drive
890
    * 0 = there is no drive
891
    * 1 = 360Kb, 5.25''
891
    * 1 = 360Kb, 5.25''
892
    * 2 = 1.2Mb, 5.25''
892
    * 2 = 1.2Mb, 5.25''
893
    * 3 = 720Kb, 3.5''
893
    * 3 = 720Kb, 3.5''
894
    * 4 = 1.44Mb, 3.5''
894
    * 4 = 1.44Mb, 3.5''
895
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
895
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
896
    For example, for the standard configuration from one 1.44-drive
896
    For example, for the standard configuration from one 1.44-drive
897
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
897
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
898
    the value is 24h.
898
    the value is 24h.
899
 
899
 
900
  First IDE controller:
900
  First IDE controller:
901
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
901
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
902
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
902
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
903
    * 0 = device not found
903
    * 0 = device not found
904
    * 1 = hard drive
904
    * 1 = hard drive
905
    * 2 = CD-drive
905
    * 2 = CD-drive
906
    For example, in the case HD on IDE0 and CD on IDE2
906
    For example, in the case HD on IDE0 and CD on IDE2
907
    this field contains 48h.
907
    this field contains 48h.
908
  * +2: 4 db: number of the retrieved partitions on hard disks
908
  * +2: 4 db: number of the retrieved partitions on hard disks
909
    at accordingly IDE0,...,IDE3.
909
    at accordingly IDE0,...,IDE3.
910
 
910
 
911
  Second IDE controller:
911
  Second IDE controller:
912
  * +6: byte: information about hard disks and CD-drives, AABBCCDD,
912
  * +6: byte: information about hard disks and CD-drives, AABBCCDD,
913
    where AA corresponds to the controller IDE4, ..., DD - IDE7:
913
    where AA corresponds to the controller IDE4, ..., DD - IDE7:
914
    * 0 = device not found
914
    * 0 = device not found
915
    * 1 = hard drive
915
    * 1 = hard drive
916
    * 2 = CD-drive
916
    * 2 = CD-drive
917
    For example, in the case HD on IDE4 and CD on IDE6
917
    For example, in the case HD on IDE4 and CD on IDE6
918
    this field contains 48h.
918
    this field contains 48h.
919
  * +7: 4 db: number of the retrieved partitions on hard disks
919
  * +7: 4 db: number of the retrieved partitions on hard disks
920
    at accordingly IDE4,...,IDE7.
920
    at accordingly IDE4,...,IDE7.
921
 
921
 
922
  Third IDE controller:
922
  Third IDE controller:
923
  * +11: byte: information about hard disks and CD-drives, AABBCCDD,
923
  * +11: byte: information about hard disks and CD-drives, AABBCCDD,
924
    where AA corresponds to the controller IDE8, ..., DD - IDE11:
924
    where AA corresponds to the controller IDE8, ..., DD - IDE11:
925
    * 0 = device not found
925
    * 0 = device not found
926
    * 1 = hard drive
926
    * 1 = hard drive
927
    * 2 = CD-drive
927
    * 2 = CD-drive
928
    For example, in the case HD on IDE8 and CD on IDE10
928
    For example, in the case HD on IDE8 and CD on IDE10
929
    this field contains 48h.
929
    this field contains 48h.
930
  * +12: 4 db: number of the retrieved partitions on hard disks
930
  * +12: 4 db: number of the retrieved partitions on hard disks
931
    at accordingly IDE8,...,IDE11.
931
    at accordingly IDE8,...,IDE11.
932
 
932
 
933
    If the hard disk on IDEx is absent, appropriate byte is zero,
933
    If the hard disk on IDEx is absent, appropriate byte is zero,
934
    otherwise it shows number of the recognized partitions, which
934
    otherwise it shows number of the recognized partitions, which
935
    can be not presented (if the drive is not formatted or if
935
    can be not presented (if the drive is not formatted or if
936
    the file system is not supported). Current version of the kernel
936
    the file system is not supported). Current version of the kernel
937
    supports only FAT12/16/32, NTFS, ext2/3/4 and XFS for hard disks.
937
    supports only FAT12/16/32, NTFS, ext2/3/4 and XFS for hard disks.
938
 
938
 
939
Remarks:
939
Remarks:
940
  * The table can be used for obtaining the information about
940
  * The table can be used for obtaining the information about
941
    available devices.
941
    available devices.
942
 
942
 
943
---------------------- Constants for registers: ----------------------
943
---------------------- Constants for registers: ----------------------
944
  eax - SF_SYSTEM (18)
944
  eax - SF_SYSTEM (18)
945
  ebx - SSF_INFO_DISC_SYS (11)
945
  ebx - SSF_INFO_DISC_SYS (11)
946
======================================================================
946
======================================================================
947
========== Function 18, subfunction 13 - get kernel version. =========
947
========== Function 18, subfunction 13 - get kernel version. =========
948
======================================================================
948
======================================================================
949
Parameters:
949
Parameters:
950
  * eax = 18 - function number
950
  * eax = 18 - function number
951
  * ebx = 13 - subfunction number
951
  * ebx = 13 - subfunction number
952
  * ecx = pointer to the buffer (not less than 16 bytes), where
952
  * ecx = pointer to the buffer (not less than 16 bytes), where
953
    the information will be placed
953
    the information will be placed
954
Returned value:
954
Returned value:
955
  * function does not return value
955
  * function does not return value
956
    but if pointer in ecx is illegal, for example,
956
    but if pointer in ecx is illegal, for example,
957
    [ecx, ecx + 9) region intersects with kernel memory,
957
    [ecx, ecx + 9) region intersects with kernel memory,
958
    then function returns -1
958
    then function returns -1
959
Remarks:
959
Remarks:
960
  * At the moment only the part of the buffer by a size
960
  * At the moment only the part of the buffer by a size
961
    9 bytes is used. Nevertheless it is recommended to use
961
    9 bytes is used. Nevertheless it is recommended to use
962
    16 byte buffer for the future compatibility, in the future
962
    16 byte buffer for the future compatibility, in the future
963
    some fields can be added.
963
    some fields can be added.
964
Structure of the buffer:
964
Structure of the buffer:
965
db a,b,c,d for version a.b.c.d
965
db a,b,c,d for version a.b.c.d
966
db 0: reserved
966
db 0: reserved
967
dd REV - kernel SVN revision number
967
dd REV - kernel SVN revision number
968
For Kolibri 0.7.7.0+ kernel:
968
For Kolibri 0.7.7.0+ kernel:
969
db 0,7,7,0
969
db 0,7,7,0
970
db 0
970
db 0
971
dd 1675
971
dd 1675
972
 
972
 
973
---------------------- Constants for registers: ----------------------
973
---------------------- Constants for registers: ----------------------
974
  eax - SF_SYSTEM (18)
974
  eax - SF_SYSTEM (18)
975
  ebx - SSF_KERNEL_VERSION (13)
975
  ebx - SSF_KERNEL_VERSION (13)
976
======================================================================
976
======================================================================
977
======= Function 18, subfunction 14 - wait for screen retrace. =======
977
======= Function 18, subfunction 14 - wait for screen retrace. =======
978
======================================================================
978
======================================================================
979
Waits for the beginning of retrace of the scanning ray of the screen
979
Waits for the beginning of retrace of the scanning ray of the screen
980
monitor.
980
monitor.
981
Parameters:
981
Parameters:
982
  * eax = 18 - function number
982
  * eax = 18 - function number
983
  * ebx = 14 - subfunction number
983
  * ebx = 14 - subfunction number
984
Returned value:
984
Returned value:
985
  * eax = 0 as the tag of success
985
  * eax = 0 as the tag of success
986
Remarks:
986
Remarks:
987
  * Function is intended only for active high-efficiency graphics
987
  * Function is intended only for active high-efficiency graphics
988
    applications; is used for smooth output of a graphics.
988
    applications; is used for smooth output of a graphics.
989
 
989
 
990
---------------------- Constants for registers: ----------------------
990
---------------------- Constants for registers: ----------------------
991
  eax - SF_SYSTEM (18)
991
  eax - SF_SYSTEM (18)
992
  ebx - SSF_WAIT_RETRACE (14)
992
  ebx - SSF_WAIT_RETRACE (14)
993
======================================================================
993
======================================================================
994
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
994
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
995
======================================================================
995
======================================================================
996
Parameters:
996
Parameters:
997
  * eax = 18 - function number
997
  * eax = 18 - function number
998
  * ebx = 15 - subfunction number
998
  * ebx = 15 - subfunction number
999
Returned value:
999
Returned value:
1000
  * eax = 0 as the tag of success
1000
  * eax = 0 as the tag of success
1001
 
1001
 
1002
---------------------- Constants for registers: ----------------------
1002
---------------------- Constants for registers: ----------------------
1003
  eax - SF_SYSTEM (18)
1003
  eax - SF_SYSTEM (18)
1004
  ebx - SSF_CURSOR_CENTER (15)
1004
  ebx - SSF_CURSOR_CENTER (15)
1005
======================================================================
1005
======================================================================
1006
========= Function 18, subfunction 16 - get size of free RAM. ========
1006
========= Function 18, subfunction 16 - get size of free RAM. ========
1007
======================================================================
1007
======================================================================
1008
Parameters:
1008
Parameters:
1009
  * eax = 18 - function number
1009
  * eax = 18 - function number
1010
  * ebx = 16 - subfunction number
1010
  * ebx = 16 - subfunction number
1011
Returned value:
1011
Returned value:
1012
  * eax = size of free memory in kilobytes
1012
  * eax = size of free memory in kilobytes
1013
 
1013
 
1014
---------------------- Constants for registers: ----------------------
1014
---------------------- Constants for registers: ----------------------
1015
  eax - SF_SYSTEM (18)
1015
  eax - SF_SYSTEM (18)
1016
  ebx - SSF_GET_FREE_RAM (16)
1016
  ebx - SSF_GET_FREE_RAM (16)
1017
======================================================================
1017
======================================================================
1018
======== Function 18, subfunction 17 - get full amount of RAM. =======
1018
======== Function 18, subfunction 17 - get full amount of RAM. =======
1019
======================================================================
1019
======================================================================
1020
Parameters:
1020
Parameters:
1021
  * eax = 18 - function number
1021
  * eax = 18 - function number
1022
  * ebx = 17 - subfunction number
1022
  * ebx = 17 - subfunction number
1023
Returned value:
1023
Returned value:
1024
  * eax = total size of existing memory in kilobytes
1024
  * eax = total size of existing memory in kilobytes
1025
 
1025
 
1026
---------------------- Constants for registers: ----------------------
1026
---------------------- Constants for registers: ----------------------
1027
  eax - SF_SYSTEM (18)
1027
  eax - SF_SYSTEM (18)
1028
  ebx - SSF_GET_TOTAL_RAM (17)
1028
  ebx - SSF_GET_TOTAL_RAM (17)
1029
======================================================================
1029
======================================================================
1030
===================== Function 18, subfunction 18 ====================
1030
===================== Function 18, subfunction 18 ====================
1031
============= Terminate process/thread by the identifier. ============
1031
============= Terminate process/thread by the identifier. ============
1032
======================================================================
1032
======================================================================
1033
Parameters:
1033
Parameters:
1034
  * eax = 18 - function number
1034
  * eax = 18 - function number
1035
  * ebx = 18 - subfunction number
1035
  * ebx = 18 - subfunction number
1036
  * ecx = identifier of process/thread (PID/TID)
1036
  * ecx = identifier of process/thread (PID/TID)
1037
Returned value:
1037
Returned value:
1038
  * eax = 0 - success
1038
  * eax = 0 - success
1039
  * eax = -1 - error (process is not found or is system)
1039
  * eax = -1 - error (process is not found or is system)
1040
Remarks:
1040
Remarks:
1041
  * It is impossible to terminate system thread OS/IDLE (identifier
1041
  * It is impossible to terminate system thread OS/IDLE (identifier
1042
    1), it is possible to terminate any normal process/thread.
1042
    1), it is possible to terminate any normal process/thread.
1043
  * See also subfunction 2 - terminate
1043
  * See also subfunction 2 - terminate
1044
    process/thread by given slot.
1044
    process/thread by given slot.
1045
 
1045
 
1046
---------------------- Constants for registers: ----------------------
1046
---------------------- Constants for registers: ----------------------
1047
  eax - SF_SYSTEM (18)
1047
  eax - SF_SYSTEM (18)
1048
  ebx - SSF_TERMINATE_THREAD_ID (18)
1048
  ebx - SSF_TERMINATE_THREAD_ID (18)
1049
======================================================================
1049
======================================================================
1050
======== Function 18, subfunction 19 - get/set mouse features. =======
1050
======== Function 18, subfunction 19 - get/set mouse features. =======
1051
======================================================================
1051
======================================================================
1052
 
1052
 
1053
---------------- Subsubfunction 0 - get mouse speed. -----------------
1053
---------------- Subsubfunction 0 - get mouse speed. -----------------
1054
Parameters:
1054
Parameters:
1055
  * eax = 18 - function number
1055
  * eax = 18 - function number
1056
  * ebx = 19 - subfunction number
1056
  * ebx = 19 - subfunction number
1057
  * ecx = 0 - subsubfunction number
1057
  * ecx = 0 - subsubfunction number
1058
Returned value:
1058
Returned value:
1059
  * eax = current speed divider
1059
  * eax = current speed divider
1060
 
1060
 
1061
---------------- Subsubfunction 1 - set mouse speed. -----------------
1061
---------------- Subsubfunction 1 - set mouse speed. -----------------
1062
Parameters:
1062
Parameters:
1063
  * eax = 18 - function number
1063
  * eax = 18 - function number
1064
  * ebx = 19 - subfunction number
1064
  * ebx = 19 - subfunction number
1065
  * ecx = 1 - subsubfunction number
1065
  * ecx = 1 - subsubfunction number
1066
  * edx = new value for speed divider
1066
  * edx = new value for speed divider
1067
Returned value:
1067
Returned value:
1068
  * function does not return value
1068
  * function does not return value
1069
 
1069
 
1070
Remark: recommended speed divider = 4
1070
Remark: recommended speed divider = 4
1071
 
1071
 
1072
-------------- Subsubfunction 2 - get mouse sensitivity --------------
1072
-------------- Subsubfunction 2 - get mouse sensitivity --------------
1073
Parameters:
1073
Parameters:
1074
  * eax = 18 - function number
1074
  * eax = 18 - function number
1075
  * ebx = 19 - subfunction number
1075
  * ebx = 19 - subfunction number
1076
  * ecx = 2 - subsubfunction number
1076
  * ecx = 2 - subsubfunction number
1077
Returned value:
1077
Returned value:
1078
  * eax = current sensitivity
1078
  * eax = current sensitivity
1079
 
1079
 
1080
-------------- Subsubfunction 3 - set mouse sensitivity --------------
1080
-------------- Subsubfunction 3 - set mouse sensitivity --------------
1081
Parameters:
1081
Parameters:
1082
  * eax = 18 - function number
1082
  * eax = 18 - function number
1083
  * ebx = 19 - subfunction number
1083
  * ebx = 19 - subfunction number
1084
  * ecx = 3 - subsubfunction number
1084
  * ecx = 3 - subsubfunction number
1085
  * edx = new value for sensitivity
1085
  * edx = new value for sensitivity
1086
Returned value:
1086
Returned value:
1087
  * function does not return value
1087
  * function does not return value
1088
 
1088
 
1089
Remark: recommended sensitivity = 3
1089
Remark: recommended sensitivity = 3
1090
 
1090
 
1091
----------- Subsubfunction 4 - set mouse pointer position. -----------
1091
----------- Subsubfunction 4 - set mouse pointer position. -----------
1092
Parameters:
1092
Parameters:
1093
  * eax = 18 - function number
1093
  * eax = 18 - function number
1094
  * ebx = 19 - subfunction number
1094
  * ebx = 19 - subfunction number
1095
  * ecx = 4 - subsubfunction number
1095
  * ecx = 4 - subsubfunction number
1096
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1096
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1097
Returned value:
1097
Returned value:
1098
  * function does not return value
1098
  * function does not return value
1099
 
1099
 
1100
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
1100
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
1101
Parameters:
1101
Parameters:
1102
  * eax = 18 - function number
1102
  * eax = 18 - function number
1103
  * ebx = 19 - subfunction number
1103
  * ebx = 19 - subfunction number
1104
  * ecx = 5 - subsubfunction number
1104
  * ecx = 5 - subsubfunction number
1105
  * edx = information about emulated state of mouse buttons:
1105
  * edx = information about emulated state of mouse buttons:
1106
    (same as return value in subfunction 2 of function 37)
1106
    (same as return value in subfunction 2 of function 37)
1107
    * bit 0 is set = left button is pressed
1107
    * bit 0 is set = left button is pressed
1108
    * bit 1 is set = right button is pressed
1108
    * bit 1 is set = right button is pressed
1109
    * bit 2 is set = middle button is pressed
1109
    * bit 2 is set = middle button is pressed
1110
    * bit 3 is set = 4th button is pressed
1110
    * bit 3 is set = 4th button is pressed
1111
    * bit 4 is set = 5th button is pressed
1111
    * bit 4 is set = 5th button is pressed
1112
Returned value:
1112
Returned value:
1113
  * function does not return value
1113
  * function does not return value
1114
 
1114
 
1115
-------------- Subsubfunction 6 - get doubleclick delay. -------------
1115
-------------- Subsubfunction 6 - get doubleclick delay. -------------
1116
Parameters:
1116
Parameters:
1117
  * eax = 18 - function number
1117
  * eax = 18 - function number
1118
  * ebx = 19 - subfunction number
1118
  * ebx = 19 - subfunction number
1119
  * ecx = 6 - subsubfunction number
1119
  * ecx = 6 - subsubfunction number
1120
Returned value:
1120
Returned value:
1121
  * eax = current doubleclick delay (100 = 1 second)
1121
  * eax = current doubleclick delay (100 = 1 second)
1122
 
1122
 
1123
-------------- Subsubfunction 7 - set doubleclick delay. -------------
1123
-------------- Subsubfunction 7 - set doubleclick delay. -------------
1124
Parameters:
1124
Parameters:
1125
  * eax = 18 - function number
1125
  * eax = 18 - function number
1126
  * ebx = 19 - subfunction number
1126
  * ebx = 19 - subfunction number
1127
  * ecx = 7 - subsubfunction number
1127
  * ecx = 7 - subsubfunction number
1128
  * dl  = new value for doubleclick delay (100 = 1 second)
1128
  * dl  = new value for doubleclick delay (100 = 1 second)
1129
Returned value:
1129
Returned value:
1130
  * function does not return value
1130
  * function does not return value
1131
 
1131
 
1132
Remark: mouse settings can be modified in the application mouse_cfg.
1132
Remark: mouse settings can be modified in the application mouse_cfg.
1133
 
1133
 
1134
---------------------- Constants for registers: ----------------------
1134
---------------------- Constants for registers: ----------------------
1135
  eax - SF_SYSTEM (18)
1135
  eax - SF_SYSTEM (18)
1136
  ebx - SSF_MOUSE_SETTINGS (19)
1136
  ebx - SSF_MOUSE_SETTINGS (19)
1137
  ecx - SSSF_GET_SPEED (0), SSSF_SET_SPEED (1), SSSF_GET_SPEEDUP (2),
1137
  ecx - SSSF_GET_SPEED (0), SSSF_SET_SPEED (1), SSSF_GET_SPEEDUP (2),
1138
    SSSF_SET_SPEEDUP (3), SSSF_SET_POS (4), SSSF_SET_BUTTON (5),
1138
    SSSF_SET_SPEEDUP (3), SSSF_SET_POS (4), SSSF_SET_BUTTON (5),
1139
    SSSF_GET_DOUBLE_CLICK_DELAY (6), SSSF_SET_DOUBLE_CLICK_DELAY (7)
1139
    SSSF_GET_DOUBLE_CLICK_DELAY (6), SSSF_SET_DOUBLE_CLICK_DELAY (7)
1140
======================================================================
1140
======================================================================
1141
======== Function 18, subfunction 20 - get information on RAM. =======
1141
======== Function 18, subfunction 20 - get information on RAM. =======
1142
======================================================================
1142
======================================================================
1143
Parameters:
1143
Parameters:
1144
  * eax = 18 - function number
1144
  * eax = 18 - function number
1145
  * ebx = 20 - subfunction number
1145
  * ebx = 20 - subfunction number
1146
  * ecx = pointer to the buffer for information (36 bytes)
1146
  * ecx = pointer to the buffer for information (36 bytes)
1147
Returned value:
1147
Returned value:
1148
  * eax = total size of existing RAM in pages
1148
  * eax = total size of existing RAM in pages
1149
    or -1 if error has occurred
1149
    or -1 if error has occurred
1150
  * buffer pointed to by ecx contains the following information:
1150
  * buffer pointed to by ecx contains the following information:
1151
    * +0:  dword: total size of existing RAM in pages
1151
    * +0:  dword: total size of existing RAM in pages
1152
    * +4:  dword: size of free RAM in pages
1152
    * +4:  dword: size of free RAM in pages
1153
    * +8:  dword: number of page faults (exceptions #PF)
1153
    * +8:  dword: number of page faults (exceptions #PF)
1154
                 in applications
1154
                 in applications
1155
    * +12: dword: size of kernel heap in bytes
1155
    * +12: dword: size of kernel heap in bytes
1156
    * +16: dword: free in kernel heap in bytes
1156
    * +16: dword: free in kernel heap in bytes
1157
    * +20: dword: total number of memory blocks in kernel heap
1157
    * +20: dword: total number of memory blocks in kernel heap
1158
    * +24: dword: number of free memory blocks in kernel heap
1158
    * +24: dword: number of free memory blocks in kernel heap
1159
    * +28: dword: size of maximum free block in kernel heap
1159
    * +28: dword: size of maximum free block in kernel heap
1160
                 (reserved)
1160
                 (reserved)
1161
    * +32: dword: size of maximum allocated block in kernel heap
1161
    * +32: dword: size of maximum allocated block in kernel heap
1162
                 (reserved)
1162
                 (reserved)
1163
 
1163
 
1164
---------------------- Constants for registers: ----------------------
1164
---------------------- Constants for registers: ----------------------
1165
  eax - SF_SYSTEM (18)
1165
  eax - SF_SYSTEM (18)
1166
  ebx - SSF_GET_RAM_INFO (20)
1166
  ebx - SSF_GET_RAM_INFO (20)
1167
======================================================================
1167
======================================================================
1168
===================== Function 18, subfunction 21 ====================
1168
===================== Function 18, subfunction 21 ====================
1169
======== Get slot number of process/thread by the identifier. ========
1169
======== Get slot number of process/thread by the identifier. ========
1170
======================================================================
1170
======================================================================
1171
Parameters:
1171
Parameters:
1172
  * eax = 18 - function number
1172
  * eax = 18 - function number
1173
  * ebx = 21 - subfunction number
1173
  * ebx = 21 - subfunction number
1174
  * ecx = identifier of process/thread (PID/TID)
1174
  * ecx = identifier of process/thread (PID/TID)
1175
Returned value:
1175
Returned value:
1176
  * eax = 0 - error (invalid identifier)
1176
  * eax = 0 - error (invalid identifier)
1177
  * otherwise eax = slot number
1177
  * otherwise eax = slot number
1178
 
1178
 
1179
---------------------- Constants for registers: ----------------------
1179
---------------------- Constants for registers: ----------------------
1180
  eax - SF_SYSTEM (18)
1180
  eax - SF_SYSTEM (18)
1181
  ebx - SSF_GET_THREAD_SLOT (21)
1181
  ebx - SSF_GET_THREAD_SLOT (21)
1182
======================================================================
1182
======================================================================
1183
===================== Function 18, subfunction 22 ====================
1183
===================== Function 18, subfunction 22 ====================
1184
============== Operations with window of another thread. =============
1184
============== Operations with window of another thread. =============
1185
======================================================================
1185
======================================================================
1186
Parameters:
1186
Parameters:
1187
  * eax = 18 - function number
1187
  * eax = 18 - function number
1188
  * ebx = 22 - subfunction number
1188
  * ebx = 22 - subfunction number
1189
  * ecx = operation type:
1189
  * ecx = operation type:
1190
    * 0 = minimize window of the thread with given slot number
1190
    * 0 = minimize window of the thread with given slot number
1191
    * 1 = minimize window of the thread with given identifier
1191
    * 1 = minimize window of the thread with given identifier
1192
    * 2 = restore window of the thread with given slot number
1192
    * 2 = restore window of the thread with given slot number
1193
    * 3 = restore window of the thread with given identifier
1193
    * 3 = restore window of the thread with given identifier
1194
  * edx = parameter (slot number or PID/TID)
1194
  * edx = parameter (slot number or PID/TID)
1195
Returned value:
1195
Returned value:
1196
  * eax = 0 - success
1196
  * eax = 0 - success
1197
  * eax = -1 - error (invalid identifier)
1197
  * eax = -1 - error (invalid identifier)
1198
Remarks:
1198
Remarks:
1199
  * The thread can minimize its window with subfunction 10.
1199
  * The thread can minimize its window with subfunction 10.
1200
  * One can restore and activate window simultaneously with
1200
  * One can restore and activate window simultaneously with
1201
    subfunction 3 (which requires slot number).
1201
    subfunction 3 (which requires slot number).
1202
 
1202
 
1203
---------------------- Constants for registers: ----------------------
1203
---------------------- Constants for registers: ----------------------
1204
  eax - SF_SYSTEM (18)
1204
  eax - SF_SYSTEM (18)
1205
  ebx - SSF_FOREIGN_WINDOW (22)
1205
  ebx - SSF_FOREIGN_WINDOW (22)
1206
  ecx - SSSF_MINIMIZE (0), SSSF_MINIMIZE_ID (1), SSSF_RESTORE (2),
1206
  ecx - SSSF_MINIMIZE (0), SSSF_MINIMIZE_ID (1), SSSF_RESTORE (2),
1207
    SSSF_RESTORE_ID (3)
1207
    SSSF_RESTORE_ID (3)
1208
======================================================================
1208
======================================================================
1209
======== Function 18, subfunction 23 - minimize all windows. ==========
1209
======== Function 18, subfunction 23 - minimize all windows. ==========
1210
======================================================================
1210
======================================================================
1211
Parameters:
1211
Parameters:
1212
  * eax = 18 - function number
1212
  * eax = 18 - function number
1213
  * ebx = 23 - subfunction number
1213
  * ebx = 23 - subfunction number
1214
Returned value:
1214
Returned value:
1215
  * eax = 0 - all windows have been minimized before a function call
1215
  * eax = 0 - all windows have been minimized before a function call
1216
  * eax = N - number of windows minimized from function
1216
  * eax = N - number of windows minimized from function
1217
Remarks:
1217
Remarks:
1218
  * Window of special thread (name begin to symbol @) is not minimize.
1218
  * Window of special thread (name begin to symbol @) is not minimize.
1219
 
1219
 
1220
---------------------- Constants for registers: ----------------------
1220
---------------------- Constants for registers: ----------------------
1221
  eax - SF_SYSTEM (18)
1221
  eax - SF_SYSTEM (18)
1222
  ebx - SSF_MINIMIZE_ALL (23)
1222
  ebx - SSF_MINIMIZE_ALL (23)
1223
======================================================================
1223
======================================================================
1224
======= Function 18, subfunction 24 - set limits of screen. ==========
1224
======= Function 18, subfunction 24 - set limits of screen. ==========
1225
======================================================================
1225
======================================================================
1226
Parameters:
1226
Parameters:
1227
  * eax = 18 - function number
1227
  * eax = 18 - function number
1228
  * ebx = 24 - subfunction number
1228
  * ebx = 24 - subfunction number
1229
  * ecx = new X size
1229
  * ecx = new X size
1230
  * edx = new Y size
1230
  * edx = new Y size
1231
Returned value:
1231
Returned value:
1232
  * function does not return value
1232
  * function does not return value
1233
Remarks:
1233
Remarks:
1234
  * The function does not change the physical size of the video mode.
1234
  * The function does not change the physical size of the video mode.
1235
    It is designed for non-standard displays which display the image
1235
    It is designed for non-standard displays which display the image
1236
    partially.
1236
    partially.
1237
  * The sizes specified in the function should not exceed the sizes
1237
  * The sizes specified in the function should not exceed the sizes
1238
    of the current video mode, otherwise the function will not change
1238
    of the current video mode, otherwise the function will not change
1239
    anything.
1239
    anything.
1240
 
1240
 
1241
---------------------- Constants for registers: ----------------------
1241
---------------------- Constants for registers: ----------------------
1242
  eax - SF_SYSTEM (18)
1242
  eax - SF_SYSTEM (18)
1243
  ebx - SSF_SET_SCREEN_LIMITS (24)
1243
  ebx - SSF_SET_SCREEN_LIMITS (24)
1244
======================================================================
1244
======================================================================
1245
===================== Function 18, subfunction 25 ====================
1245
===================== Function 18, subfunction 25 ====================
1246
===== Control position of the window relative to other windows. ======
1246
===== Control position of the window relative to other windows. ======
1247
======================================================================
1247
======================================================================
1248
 
1248
 
1249
------------- Subsubfunction 1 - get position  -----------------------
1249
------------- Subsubfunction 1 - get position  -----------------------
1250
Parameters:
1250
Parameters:
1251
  * eax = 18 - function number
1251
  * eax = 18 - function number
1252
  * ebx = 25 - subfunction number
1252
  * ebx = 25 - subfunction number
1253
  * ecx = 1 - subsubfunction number
1253
  * ecx = 1 - subsubfunction number
1254
  * edx = -1(for current window) or PID application
1254
  * edx = -1(for current window) or PID application
1255
Returned value:
1255
Returned value:
1256
  * eax = one of the constants window position
1256
  * eax = one of the constants window position
1257
 
1257
 
1258
------------- Subsubfunction 2 - set position  -----------------------
1258
------------- Subsubfunction 2 - set position  -----------------------
1259
Parameters:
1259
Parameters:
1260
  * eax = 18 - function number
1260
  * eax = 18 - function number
1261
  * ebx = 25 - subfunction number
1261
  * ebx = 25 - subfunction number
1262
  * ecx = 2 - subsubfunction number
1262
  * ecx = 2 - subsubfunction number
1263
  * edx = -1(for current window) or PID application
1263
  * edx = -1(for current window) or PID application
1264
  * esi = new window position (one of the constants below)
1264
  * esi = new window position (one of the constants below)
1265
Returned value:
1265
Returned value:
1266
  * eax = 0 - error
1266
  * eax = 0 - error
1267
  * eax = 1 - success
1267
  * eax = 1 - success
1268
 
1268
 
1269
Constant position of the window relative to other windows:
1269
Constant position of the window relative to other windows:
1270
 ZPOS_DESKTOP     = -2 - on the background
1270
 ZPOS_DESKTOP     = -2 - on the background
1271
 ZPOS_ALWAYS_BACK = -1 - behind all the windows
1271
 ZPOS_ALWAYS_BACK = -1 - behind all the windows
1272
 ZPOS_NORMAL      = 0  - normal
1272
 ZPOS_NORMAL      = 0  - normal
1273
 ZPOS_ALWAYS_TOP  = 1  - on top of all windows
1273
 ZPOS_ALWAYS_TOP  = 1  - on top of all windows
1274
 
1274
 
1275
---------------------- Constants for registers: ----------------------
1275
---------------------- Constants for registers: ----------------------
1276
  eax - SF_SYSTEM (18)
1276
  eax - SF_SYSTEM (18)
1277
  ebx - SSF_WINDOW_BEHAVIOR (25)
1277
  ebx - SSF_WINDOW_BEHAVIOR (25)
1278
  ecx - SSSF_GET_WB (1), SSSF_SET_WB (2)
1278
  ecx - SSSF_GET_WB (1), SSSF_SET_WB (2)
1279
======================================================================
1279
======================================================================
1280
==================== Function 20 - MIDI interface. ===================
-
 
1281
======================================================================
-
 
1282
 
-
 
1283
!!! WARNING. This interface is outdated and should not be used !!!
-
 
1284
 
-
 
1285
----------------------- Subfunction 1 - reset ------------------------
-
 
1286
Parameters:
-
 
1287
  * eax = 20 - function number
-
 
1288
  * ebx = 1 - subfunction number
-
 
1289
 
-
 
1290
-------------------- Subfunction 2 - output byte ---------------------
-
 
1291
Parameters:
-
 
1292
  * eax = 20 - function number
-
 
1293
  * ebx = 2 - subfunction number
-
 
1294
  * cl = byte for output
-
 
1295
Returned value (is the same for both subfunctions):
-
 
1296
  * eax = 0 - success
-
 
1297
  * eax = 1 - base port is not defined
-
 
1298
Remarks:
-
 
1299
  * Previously the base port must be defined by
-
 
1300
    subfunction 1 of function 21.
-
 
1301
 
-
 
1302
---------------------- Constants for registers: ----------------------
-
 
1303
  eax - SF_MIDI (20)
-
 
1304
  ebx - SSF_RESET (1), SSF_OUTPUT (2)
-
 
1305
======================================================================
-
 
1306
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
-
 
1307
======================================================================
-
 
1308
 
-
 
1309
!!! WARNING. This interface is outdated and should not be used !!!
-
 
1310
 
-
 
1311
Parameters:
-
 
1312
  * eax = 21 - function number
-
 
1313
  * ebx = 1 - subfunction number
-
 
1314
  * ecx = number of base port
-
 
1315
Returned value
-
 
1316
  * eax = 0 - success
-
 
1317
  * eax = -1 - erratic number of a port
-
 
1318
Remarks:
-
 
1319
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
-
 
1320
  * The installation of base is necessary for function 20.
-
 
1321
  * To get base port use subfunction 1 of function 26.
-
 
1322
 
-
 
1323
---------------------- Constants for registers: ----------------------
-
 
1324
  eax - SF_SYSTEM_SET (21)
-
 
1325
  ebx - SSF_MPU_MIDI_BASE (1)
-
 
1326
======================================================================
-
 
1327
========== Function 21, subfunction 2 - set keyboard layout. =========
1280
========== Function 21, subfunction 2 - set keyboard layout. =========
1328
======================================================================
1281
======================================================================
1329
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1282
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1330
which will be read by function 2.
1283
which will be read by function 2.
1331
Parameters:
1284
Parameters:
1332
  * eax = 21 - function number
1285
  * eax = 21 - function number
1333
  * ebx = 2 - subfunction number
1286
  * ebx = 2 - subfunction number
1334
  * ecx = which layout to set:
1287
  * ecx = which layout to set:
1335
    * 1 = normal layout
1288
    * 1 = normal layout
1336
    * 2 = layout at pressed Shift
1289
    * 2 = layout at pressed Shift
1337
    * 3 = layout at pressed Alt
1290
    * 3 = layout at pressed Alt
1338
  * edx = pointer to layout - table of length 128 bytes
1291
  * edx = pointer to layout - table of length 128 bytes
1339
Or:
1292
Or:
1340
  * ecx = 9
1293
  * ecx = 9
1341
  * edx = language id: 1=en, 2=fi, 3=ge, 4=ru, 5=fr, 6=et, 7=ua, 8=it,
1294
  * edx = language id: 1=en, 2=fi, 3=ge, 4=ru, 5=fr, 6=et, 7=ua, 8=it,
1342
                       9=be, 10=sp, 11=ca
1295
                       9=be, 10=sp, 11=ca
1343
Returned value:
1296
Returned value:
1344
  * eax = 0 - success
1297
  * eax = 0 - success
1345
  * eax = -1 - incorrect parameter
1298
  * eax = -1 - incorrect parameter
1346
Remarks:
1299
Remarks:
1347
  * If Alt is pressed, the layout with Alt is used;
1300
  * If Alt is pressed, the layout with Alt is used;
1348
    if Alt is not pressed, but Shift is pressed,
1301
    if Alt is not pressed, but Shift is pressed,
1349
    the layout with Shift is used;
1302
    the layout with Shift is used;
1350
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1303
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1351
    layout is used and then from the code is subtracted 0x60;
1304
    layout is used and then from the code is subtracted 0x60;
1352
    if no control key is pressed, the normal layout is used.
1305
    if no control key is pressed, the normal layout is used.
1353
  * To get layout and country identifier use
1306
  * To get layout and country identifier use
1354
    subfunction 2 of function 26.
1307
    subfunction 2 of function 26.
1355
  * Country identifier is global system variable, which is not used
1308
  * Country identifier is global system variable, which is not used
1356
    by the kernel itself; however the application '@taskbar' displays
1309
    by the kernel itself; however the application '@taskbar' displays
1357
    the corresponding icon.
1310
    the corresponding icon.
1358
  * The application @taskbar switches layouts on user request.
1311
  * The application @taskbar switches layouts on user request.
1359
 
1312
 
1360
---------------------- Constants for registers: ----------------------
1313
---------------------- Constants for registers: ----------------------
1361
  eax - SF_SYSTEM_SET (21)
1314
  eax - SF_SYSTEM_SET (21)
1362
  ebx - SSF_KEYBOARD_LAYOUT (2)
1315
  ebx - SSF_KEYBOARD_LAYOUT (2)
1363
======================================================================
1316
======================================================================
1364
========== Function 21, subfunction 5 - set system language. =========
1317
========== Function 21, subfunction 5 - set system language. =========
1365
======================================================================
1318
======================================================================
1366
Parameters:
1319
Parameters:
1367
  * eax = 21 - function number
1320
  * eax = 21 - function number
1368
  * ebx = 5 - subfunction number
1321
  * ebx = 5 - subfunction number
1369
  * ecx = language id: 1=en, 2=fi, 3=ge, 4=ru, 5=fr, 6=et, 7=ua, 8=it,
1322
  * ecx = language id: 1=en, 2=fi, 3=ge, 4=ru, 5=fr, 6=et, 7=ua, 8=it,
1370
                       9=be, 10=sp, 11=ca
1323
                       9=be, 10=sp, 11=ca
1371
Returned value:
1324
Returned value:
1372
  * eax = 0
1325
  * eax = 0
1373
Remarks:
1326
Remarks:
1374
  * System language is global system variable and is not used
1327
  * System language is global system variable and is not used
1375
    by the kernel itself, however application @taskbar draws the
1328
    by the kernel itself, however application @taskbar draws the
1376
    appropriate icon.
1329
    appropriate icon.
1377
  * Function does not check for correctness, as the kernel does not
1330
  * Function does not check for correctness, as the kernel does not
1378
    use this variable.
1331
    use this variable.
1379
  * To get system language use subfunction 5 of function 26.
1332
  * To get system language use subfunction 5 of function 26.
1380
 
1333
 
1381
---------------------- Constants for registers: ----------------------
1334
---------------------- Constants for registers: ----------------------
1382
  eax - SF_SYSTEM_SET (21)
1335
  eax - SF_SYSTEM_SET (21)
1383
  ebx - SSF_SYS_LANG (5)
1336
  ebx - SSF_SYS_LANG (5)
1384
======================================================================
1337
======================================================================
1385
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1338
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1386
======================================================================
1339
======================================================================
1387
Parameters:
1340
Parameters:
1388
  * eax = 21 - function number
1341
  * eax = 21 - function number
1389
  * ebx = 11 - subfunction number
1342
  * ebx = 11 - subfunction number
1390
  * ecx = 0/1 - disable/enable
1343
  * ecx = 0/1 - disable/enable
1391
Returned value:
1344
Returned value:
1392
  * eax = 0
1345
  * eax = 0
1393
Remarks:
1346
Remarks:
1394
  * Is used in LBA-read (subfunction 8 of function 58).
1347
  * Is used in LBA-read (subfunction 8 of function 58).
1395
  * The current implementation uses only low bit of ecx.
1348
  * The current implementation uses only low bit of ecx.
1396
  * To get current status use subfunction 11 of function 26.
1349
  * To get current status use subfunction 11 of function 26.
1397
 
1350
 
1398
---------------------- Constants for registers: ----------------------
1351
---------------------- Constants for registers: ----------------------
1399
  eax - SF_SYSTEM_SET (21)
1352
  eax - SF_SYSTEM_SET (21)
1400
  ebx - SSF_ACCESS_HD_LBA (11)
1353
  ebx - SSF_ACCESS_HD_LBA (11)
1401
======================================================================
1354
======================================================================
1402
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1355
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1403
======================================================================
1356
======================================================================
1404
Parameters:
1357
Parameters:
1405
  * eax = 21 - function number
1358
  * eax = 21 - function number
1406
  * ebx = 12 - subfunction number
1359
  * ebx = 12 - subfunction number
1407
  * ecx = 0/1 - disable/enable
1360
  * ecx = 0/1 - disable/enable
1408
Returned value:
1361
Returned value:
1409
  * eax = 0
1362
  * eax = 0
1410
Remarks:
1363
Remarks:
1411
  * Is used in operations with PCI bus (function 62).
1364
  * Is used in operations with PCI bus (function 62).
1412
  * The current implementation uses only low bit of ecx.
1365
  * The current implementation uses only low bit of ecx.
1413
  * To get current status use subfunction 12 of function 26.
1366
  * To get current status use subfunction 12 of function 26.
1414
 
1367
 
1415
---------------------- Constants for registers: ----------------------
1368
---------------------- Constants for registers: ----------------------
1416
  eax - SF_SYSTEM_SET (21)
1369
  eax - SF_SYSTEM_SET (21)
1417
  ebx - SSF_ACCESS_PCI (12)
1370
  ebx - SSF_ACCESS_PCI (12)
1418
======================================================================
1371
======================================================================
1419
================= Function 22 - set system date/time. ================
1372
================= Function 22 - set system date/time. ================
1420
======================================================================
1373
======================================================================
1421
Parameters:
1374
Parameters:
1422
  * eax = 22 - function number
1375
  * eax = 22 - function number
1423
  * ebx = 0 - set time
1376
  * ebx = 0 - set time
1424
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1377
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1425
    * HH=hour 00..23
1378
    * HH=hour 00..23
1426
    * MM=minute 00..59
1379
    * MM=minute 00..59
1427
    * SS=second 00..59
1380
    * SS=second 00..59
1428
  * ebx = 1 - set date
1381
  * ebx = 1 - set date
1429
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1382
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1430
    * DD=day 01..31
1383
    * DD=day 01..31
1431
    * MM=month 01..12
1384
    * MM=month 01..12
1432
    * YY=year 00..99
1385
    * YY=year 00..99
1433
  * ebx = 2 - set day of week
1386
  * ebx = 2 - set day of week
1434
    * ecx = 1 for Sunday, ..., 7 for Saturday
1387
    * ecx = 1 for Sunday, ..., 7 for Saturday
1435
  * ebx = 3 - set alarm clock
1388
  * ebx = 3 - set alarm clock
1436
    * ecx = 0x00SSMMHH
1389
    * ecx = 0x00SSMMHH
1437
Returned value:
1390
Returned value:
1438
  * eax = 0 - success
1391
  * eax = 0 - success
1439
  * eax = 1 - incorrect parameter
1392
  * eax = 1 - incorrect parameter
1440
  * eax = 2 - CMOS-battery was unloaded
1393
  * eax = 2 - CMOS-battery was unloaded
1441
Remarks:
1394
Remarks:
1442
  * Value of installation of day of week seems to be doubtful,
1395
  * Value of installation of day of week seems to be doubtful,
1443
    as it a little where is used
1396
    as it a little where is used
1444
    (day of week can be calculated by date).
1397
    (day of week can be calculated by date).
1445
  * Alarm clock can be set on operation in the given time every day.
1398
  * Alarm clock can be set on operation in the given time every day.
1446
    But there is no existing system function to disable it.
1399
    But there is no existing system function to disable it.
1447
  * Operation of alarm clock consists in generation IRQ8.
1400
  * Operation of alarm clock consists in generation IRQ8.
1448
  * Generally CMOS supports for alarm clock set of value 0xFF
1401
  * Generally CMOS supports for alarm clock set of value 0xFF
1449
    as one of parameters and it means that the appropriate parameter
1402
    as one of parameters and it means that the appropriate parameter
1450
    is ignored. But current implementation does not allow this
1403
    is ignored. But current implementation does not allow this
1451
    (will return 1).
1404
    (will return 1).
1452
  * Alarm clock is a global system resource; the set of
1405
  * Alarm clock is a global system resource; the set of
1453
    an alarm clock cancels automatically the previous set.
1406
    an alarm clock cancels automatically the previous set.
1454
    However, at moment no program uses it.
1407
    However, at moment no program uses it.
1455
 
1408
 
1456
---------------------- Constants for registers: ----------------------
1409
---------------------- Constants for registers: ----------------------
1457
  eax - SF_SET_TIME_DATE (22)
1410
  eax - SF_SET_TIME_DATE (22)
1458
======================================================================
1411
======================================================================
1459
============= Function 23 - wait for event with timeout. =============
1412
============= Function 23 - wait for event with timeout. =============
1460
======================================================================
1413
======================================================================
1461
If the message queue is empty, waits for new message in the queue,
1414
If the message queue is empty, waits for new message in the queue,
1462
but no more than given time. Then reads out a message from the queue.
1415
but no more than given time. Then reads out a message from the queue.
1463
 
1416
 
1464
Parameters:
1417
Parameters:
1465
  * eax = 23 - function number
1418
  * eax = 23 - function number
1466
  * ebx = timeout (in 1/100 of second)
1419
  * ebx = timeout (in 1/100 of second)
1467
Returned value:
1420
Returned value:
1468
  * eax = 0 - the message queue is empty
1421
  * eax = 0 - the message queue is empty
1469
  * otherwise eax = event (see the list of events)
1422
  * otherwise eax = event (see the list of events)
1470
Remarks:
1423
Remarks:
1471
  * Only those events are taken into account, which enter into
1424
  * Only those events are taken into account, which enter into
1472
    the mask set by function 40. By default it is
1425
    the mask set by function 40. By default it is
1473
    redraw, key and button events.
1426
    redraw, key and button events.
1474
  * To check for presence of a message in the queue use function 11.
1427
  * To check for presence of a message in the queue use function 11.
1475
    To wait without timeout use function 10.
1428
    To wait without timeout use function 10.
1476
  * Transmission ebx=0 results in immediate returning eax=0.
1429
  * Transmission ebx=0 results in immediate returning eax=0.
1477
  * Current implementation returns immediately with eax=0,
1430
  * Current implementation returns immediately with eax=0,
1478
    if the addition of ebx with the current value of time counter
1431
    if the addition of ebx with the current value of time counter
1479
    makes 32-bit overflow.
1432
    makes 32-bit overflow.
1480
 
1433
 
1481
---------------------- Constants for registers: ----------------------
1434
---------------------- Constants for registers: ----------------------
1482
  eax - SF_WAIT_EVENT_TIMEOUT (23)
1435
  eax - SF_WAIT_EVENT_TIMEOUT (23)
1483
======================================================================
1436
======================================================================
1484
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1437
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1485
======================================================================
1438
======================================================================
1486
 
1439
 
1487
!!! WARNING. This interface is outdated and should not be used !!!
1440
!!! WARNING. This interface is outdated and should not be used !!!
1488
 
1441
 
1489
Parameters:
1442
Parameters:
1490
  * eax = 24 - function number
1443
  * eax = 24 - function number
1491
  * ebx = 4 - subfunction number
1444
  * ebx = 4 - subfunction number
1492
  * ecx = position of CD/DVD-drive
1445
  * ecx = position of CD/DVD-drive
1493
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1446
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1494
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1447
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1495
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1448
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1496
Returned value:
1449
Returned value:
1497
  * function does not return value
1450
  * function does not return value
1498
Remarks:
1451
Remarks:
1499
  * The function is supported only for ATAPI devices (CD and DVD).
1452
  * The function is supported only for ATAPI devices (CD and DVD).
1500
  * When the tray is being ejected,
1453
  * When the tray is being ejected,
1501
    manual control of tray is unlocked.
1454
    manual control of tray is unlocked.
1502
  * When the tray is being ejected, the code clears the cache for
1455
  * When the tray is being ejected, the code clears the cache for
1503
    corresponding device.
1456
    corresponding device.
1504
  * An example of usage of the function is the application CD_tray.
1457
  * An example of usage of the function is the application CD_tray.
1505
 
1458
 
1506
---------------------- Constants for registers: ----------------------
1459
---------------------- Constants for registers: ----------------------
1507
  eax - SF_CD (24)
1460
  eax - SF_CD (24)
1508
  ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
1461
  ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
1509
======================================================================
1462
======================================================================
1510
======== Function 24, subfunction 5 - load tray of disk drive. =======
1463
======== Function 24, subfunction 5 - load tray of disk drive. =======
1511
======================================================================
1464
======================================================================
1512
 
1465
 
1513
!!! WARNING. This interface is outdated and should not be used !!!
1466
!!! WARNING. This interface is outdated and should not be used !!!
1514
 
1467
 
1515
Parameters:
1468
Parameters:
1516
  * eax = 24 - function number
1469
  * eax = 24 - function number
1517
  * ebx = 5 - subfunction number
1470
  * ebx = 5 - subfunction number
1518
  * ecx = position of CD/DVD-drive
1471
  * ecx = position of CD/DVD-drive
1519
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1472
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1520
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1473
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1521
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1474
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1522
Returned value:
1475
Returned value:
1523
  * function does not return value
1476
  * function does not return value
1524
Remarks:
1477
Remarks:
1525
  * The function is supported only for ATAPI devices (CD and DVD).
1478
  * The function is supported only for ATAPI devices (CD and DVD).
1526
  * An example of usage of the function is the application CD_tray.
1479
  * An example of usage of the function is the application CD_tray.
1527
 
1480
 
1528
---------------------- Constants for registers: ----------------------
1481
---------------------- Constants for registers: ----------------------
1529
  eax - SF_CD (24)
1482
  eax - SF_CD (24)
1530
  ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
1483
  ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
1531
======================================================================
1484
======================================================================
1532
======= Function 25 - put image area on the background layer. ========
1485
======= Function 25 - put image area on the background layer. ========
1533
======================================================================
1486
======================================================================
1534
Parameters:
1487
Parameters:
1535
  * eax = 25 - function number
1488
  * eax = 25 - function number
1536
  * ebx = pointer to the previously allocated memory area,
1489
  * ebx = pointer to the previously allocated memory area,
1537
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1490
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1538
  * ecx = [size on axis x]*65536 + [size on axis y]
1491
  * ecx = [size on axis x]*65536 + [size on axis y]
1539
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1492
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1540
Returned value:
1493
Returned value:
1541
  * function does not return value
1494
  * function does not return value
1542
Remarks:
1495
Remarks:
1543
  * Coordinates of the image are coordinates of the upper left corner
1496
  * Coordinates of the image are coordinates of the upper left corner
1544
    of the image relative to the screen.
1497
    of the image relative to the screen.
1545
  * Size of the image in bytes is 4*xsize*ysize
1498
  * Size of the image in bytes is 4*xsize*ysize
1546
  * TT - byte pointer of transparency, at current version:
1499
  * TT - byte pointer of transparency, at current version:
1547
         1 to FF - opaque, 0 - transparent.
1500
         1 to FF - opaque, 0 - transparent.
1548
  * The function places the image directly to LFB. It is not for
1501
  * The function places the image directly to LFB. It is not for
1549
    background image f.15. Options f.15 to f.25 does not make sense.
1502
    background image f.15. Options f.15 to f.25 does not make sense.
1550
 
1503
 
1551
---------------------- Constants for registers: ----------------------
1504
---------------------- Constants for registers: ----------------------
1552
  eax - SF_SCREEN_PUT_IMAGE (25)
1505
  eax - SF_SCREEN_PUT_IMAGE (25)
1553
======================================================================
1506
======================================================================
1554
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
-
 
1555
======================================================================
-
 
1556
 
-
 
1557
!!! WARNING. This interface is outdated and should not be used !!!
-
 
1558
 
-
 
1559
Parameters:
-
 
1560
  * eax = 26 - function number
-
 
1561
  * ebx = 1 - subfunction number
-
 
1562
Returned value:
-
 
1563
  * eax = port number
-
 
1564
Parameters:
-
 
1565
  * To set base port use subfunction 1 of function 21.
-
 
1566
 
-
 
1567
---------------------- Constants for registers: ----------------------
-
 
1568
  eax - SF_SYSTEM_GET (26)
-
 
1569
  ebx - SSF_MPU_MIDI_BASE (1)
-
 
1570
======================================================================
-
 
1571
========== Function 26, subfunction 2 - get keyboard layout. =========
1507
========== Function 26, subfunction 2 - get keyboard layout. =========
1572
======================================================================
1508
======================================================================
1573
The keyboard layout is used to convert keyboard scancodes to
1509
The keyboard layout is used to convert keyboard scancodes to
1574
ASCII-codes for function 2.
1510
ASCII-codes for function 2.
1575
Parameters:
1511
Parameters:
1576
  * eax = 26 - function number
1512
  * eax = 26 - function number
1577
  * ebx = 2 - subfunction number
1513
  * ebx = 2 - subfunction number
1578
  * ecx = what layout to get:
1514
  * ecx = what layout to get:
1579
    * 1 = normal layout
1515
    * 1 = normal layout
1580
    * 2 = layout with pressed Shift
1516
    * 2 = layout with pressed Shift
1581
    * 3 = layout with pressed Alt
1517
    * 3 = layout with pressed Alt
1582
  * edx = pointer to the 128-bytes buffer, where the layout will be
1518
  * edx = pointer to the 128-bytes buffer, where the layout will be
1583
    copied
1519
    copied
1584
Returned value:
1520
Returned value:
1585
  * function does not return value
1521
  * function does not return value
1586
    but if pointer in edx is illegal, for example,
1522
    but if pointer in edx is illegal, for example,
1587
    [edx, edx + 128) region intersects with kernel memory,
1523
    [edx, edx + 128) region intersects with kernel memory,
1588
    then function returns -1
1524
    then function returns -1
1589
Or:
1525
Or:
1590
  * eax = 26 - function number
1526
  * eax = 26 - function number
1591
  * ebx = 2 - subfunction number
1527
  * ebx = 2 - subfunction number
1592
  * ecx = 9
1528
  * ecx = 9
1593
Returned value:
1529
Returned value:
1594
  * eax = language id: 1=en, 2=fi, 3=ge, 4=ru, 5=fr, 6=et, 7=ua, 8=it,
1530
  * eax = language id: 1=en, 2=fi, 3=ge, 4=ru, 5=fr, 6=et, 7=ua, 8=it,
1595
                       9=be, 10=sp, 11=ca
1531
                       9=be, 10=sp, 11=ca
1596
Remarks:
1532
Remarks:
1597
  * If Alt is pressed, the layout with Alt is used;
1533
  * If Alt is pressed, the layout with Alt is used;
1598
    if Alt is not pressed, but Shift is pressed,
1534
    if Alt is not pressed, but Shift is pressed,
1599
    the layout with Shift is used;
1535
    the layout with Shift is used;
1600
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1536
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1601
    layout is used and then from the code is subtracted 0x60;
1537
    layout is used and then from the code is subtracted 0x60;
1602
    if no control key is pressed, the normal layout is used.
1538
    if no control key is pressed, the normal layout is used.
1603
  * To set layout and country identifier use
1539
  * To set layout and country identifier use
1604
    subfunction 2 of function 21.
1540
    subfunction 2 of function 21.
1605
  * Country identifier is global system variable, which is not used
1541
  * Country identifier is global system variable, which is not used
1606
    by the kernel itself; however the application '@taskbar' displays
1542
    by the kernel itself; however the application '@taskbar' displays
1607
    the corresponding icon (using this function).
1543
    the corresponding icon (using this function).
1608
  * The application @taskbar switches layouts on user request.
1544
  * The application @taskbar switches layouts on user request.
1609
 
1545
 
1610
---------------------- Constants for registers: ----------------------
1546
---------------------- Constants for registers: ----------------------
1611
  eax - SF_SYSTEM_GET (26)
1547
  eax - SF_SYSTEM_GET (26)
1612
  ebx - SSF_KEYBOARD_LAYOUT (2)
1548
  ebx - SSF_KEYBOARD_LAYOUT (2)
1613
======================================================================
1549
======================================================================
1614
========== Function 26, subfunction 5 - get system language. =========
1550
========== Function 26, subfunction 5 - get system language. =========
1615
======================================================================
1551
======================================================================
1616
Parameters:
1552
Parameters:
1617
  * eax = 26 - function number
1553
  * eax = 26 - function number
1618
  * ebx = 5 - subfunction number
1554
  * ebx = 5 - subfunction number
1619
Returned value:
1555
Returned value:
1620
  * eax = language id: 1=en, 2=fi, 3=ge, 4=ru, 5=fr, 6=et, 7=ua, 8=it,
1556
  * eax = language id: 1=en, 2=fi, 3=ge, 4=ru, 5=fr, 6=et, 7=ua, 8=it,
1621
                       9=be, 10=sp, 11=ca
1557
                       9=be, 10=sp, 11=ca
1622
Remarks:
1558
Remarks:
1623
  * System language is global system variable and is not used
1559
  * System language is global system variable and is not used
1624
    by the kernel itself, however application @taskbar draws the
1560
    by the kernel itself, however application @taskbar draws the
1625
    appropriate icon (using this function).
1561
    appropriate icon (using this function).
1626
  * To set system language use subfunction 5 of function 21.
1562
  * To set system language use subfunction 5 of function 21.
1627
 
1563
 
1628
---------------------- Constants for registers: ----------------------
1564
---------------------- Constants for registers: ----------------------
1629
  eax - SF_SYSTEM_GET (26)
1565
  eax - SF_SYSTEM_GET (26)
1630
  ebx - SSF_SYS_LANG (5)
1566
  ebx - SSF_SYS_LANG (5)
1631
======================================================================
1567
======================================================================
1632
=== Function 26, subfunction 9 - get the value of the time counter. ==
1568
=== Function 26, subfunction 9 - get the value of the time counter. ==
1633
======================================================================
1569
======================================================================
1634
Parameters:
1570
Parameters:
1635
  * eax = 26 - function number
1571
  * eax = 26 - function number
1636
  * ebx = 9 - subfunction number
1572
  * ebx = 9 - subfunction number
1637
Returned value:
1573
Returned value:
1638
  * eax = number of 1/100s of second, past from the system boot time
1574
  * eax = number of 1/100s of second, past from the system boot time
1639
Remarks:
1575
Remarks:
1640
  * Counter takes modulo 2^32, that correspond to a little more
1576
  * Counter takes modulo 2^32, that correspond to a little more
1641
    than 497 days.
1577
    than 497 days.
1642
  * To get system time use function 3.
1578
  * To get system time use function 3.
1643
 
1579
 
1644
---------------------- Constants for registers: ----------------------
1580
---------------------- Constants for registers: ----------------------
1645
  eax - SF_SYSTEM_GET (26)
1581
  eax - SF_SYSTEM_GET (26)
1646
  ebx - SSF_TIME_COUNT (9)
1582
  ebx - SSF_TIME_COUNT (9)
1647
======================================================================
1583
======================================================================
1648
===================== Function 26, subfunction 10 ====================
1584
===================== Function 26, subfunction 10 ====================
1649
========== Get the value of the high precision time counter. =========
1585
========== Get the value of the high precision time counter. =========
1650
======================================================================
1586
======================================================================
1651
Parameters:
1587
Parameters:
1652
  * eax = 26 - function number
1588
  * eax = 26 - function number
1653
  * ebx = 10 - subfunction number
1589
  * ebx = 10 - subfunction number
1654
Returned value:
1590
Returned value:
1655
  * eax = number of nanoseconds since system boot time (lower DWORD)
1591
  * eax = number of nanoseconds since system boot time (lower DWORD)
1656
  * edx = number of nanoseconds since system boot time (high DWORD)
1592
  * edx = number of nanoseconds since system boot time (high DWORD)
1657
Remarks:
1593
Remarks:
1658
  * The counter is based on HPET, if HPET is not available, resolution
1594
  * The counter is based on HPET, if HPET is not available, resolution
1659
    will be reduced to 10 000 000 nanoseconds.
1595
    will be reduced to 10 000 000 nanoseconds.
1660
 
1596
 
1661
---------------------- Constants for registers: ----------------------
1597
---------------------- Constants for registers: ----------------------
1662
  eax - SF_SYSTEM_GET (26)
1598
  eax - SF_SYSTEM_GET (26)
1663
  ebx - SSF_TIME_COUNT_PRO (10)
1599
  ebx - SSF_TIME_COUNT_PRO (10)
1664
======================================================================
1600
======================================================================
1665
===================== Function 26, subfunction 11 ====================
1601
===================== Function 26, subfunction 11 ====================
1666
========== Find out whether low-level HD access is enabled. ==========
1602
========== Find out whether low-level HD access is enabled. ==========
1667
======================================================================
1603
======================================================================
1668
Parameters:
1604
Parameters:
1669
  * eax = 26 - function number
1605
  * eax = 26 - function number
1670
  * ebx = 11 - subfunction number
1606
  * ebx = 11 - subfunction number
1671
Returned value:
1607
Returned value:
1672
  * eax = 0/1 - disabled/enabled
1608
  * eax = 0/1 - disabled/enabled
1673
Remarks:
1609
Remarks:
1674
  * Is used in LBA read (subfunction 8 of function 58).
1610
  * Is used in LBA read (subfunction 8 of function 58).
1675
  * To set current state use subfunction 11 of function 21.
1611
  * To set current state use subfunction 11 of function 21.
1676
 
1612
 
1677
---------------------- Constants for registers: ----------------------
1613
---------------------- Constants for registers: ----------------------
1678
  eax - SF_SYSTEM_GET (26)
1614
  eax - SF_SYSTEM_GET (26)
1679
  ebx - SSF_ACCESS_HD_LBA (11)
1615
  ebx - SSF_ACCESS_HD_LBA (11)
1680
======================================================================
1616
======================================================================
1681
===================== Function 26, subfunction 12 ====================
1617
===================== Function 26, subfunction 12 ====================
1682
========== Find out whether low-level PCI access is enabled. =========
1618
========== Find out whether low-level PCI access is enabled. =========
1683
======================================================================
1619
======================================================================
1684
Parameters:
1620
Parameters:
1685
  * eax = 26 - function number
1621
  * eax = 26 - function number
1686
  * ebx = 12 - subfunction number
1622
  * ebx = 12 - subfunction number
1687
Returned value:
1623
Returned value:
1688
  * eax = 0/1 - disabled/enabled
1624
  * eax = 0/1 - disabled/enabled
1689
Remarks:
1625
Remarks:
1690
  * Is used by operations with PCI bus (function 62).
1626
  * Is used by operations with PCI bus (function 62).
1691
  * The current implementation uses only low bit of ecx.
1627
  * The current implementation uses only low bit of ecx.
1692
  * To set the current state use subfunction 12 of function 21.
1628
  * To set the current state use subfunction 12 of function 21.
1693
 
1629
 
1694
---------------------- Constants for registers: ----------------------
1630
---------------------- Constants for registers: ----------------------
1695
  eax - SF_SYSTEM_GET (26)
1631
  eax - SF_SYSTEM_GET (26)
1696
  ebx - SSF_ACCESS_PCI (12)
1632
  ebx - SSF_ACCESS_PCI (12)
1697
======================================================================
1633
======================================================================
1698
=================== Function 29 - get system date. ===================
1634
=================== Function 29 - get system date. ===================
1699
======================================================================
1635
======================================================================
1700
Parameters:
1636
Parameters:
1701
  * eax = 29 - function number
1637
  * eax = 29 - function number
1702
Returned value:
1638
Returned value:
1703
  * eax = 0x00DDMMYY, where
1639
  * eax = 0x00DDMMYY, where
1704
    (binary-decimal coding, BCD, is used)
1640
    (binary-decimal coding, BCD, is used)
1705
  * YY = two low digits of year (00..99)
1641
  * YY = two low digits of year (00..99)
1706
  * MM = month (01..12)
1642
  * MM = month (01..12)
1707
  * DD = day (01..31)
1643
  * DD = day (01..31)
1708
Remarks:
1644
Remarks:
1709
  * To set system date use function 22.
1645
  * To set system date use function 22.
1710
 
1646
 
1711
---------------------- Constants for registers: ----------------------
1647
---------------------- Constants for registers: ----------------------
1712
  eax - SF_GET_SYS_DATE (29)
1648
  eax - SF_GET_SYS_DATE (29)
1713
======================================================================
1649
======================================================================
1714
============= Function 30 - work with the current folder. ============
1650
============= Function 30 - work with the current folder. ============
1715
======================================================================
1651
======================================================================
1716
--------- Subfunction 1 - set current folder for the thread. ---------
1652
--------- Subfunction 1 - set current folder for the thread. ---------
1717
Parameters:
1653
Parameters:
1718
  * eax = 30 - function number
1654
  * eax = 30 - function number
1719
  * ebx = 1 - subfunction number
1655
  * ebx = 1 - subfunction number
1720
  * ecx = pointer to string with the path to new current folder,
1656
  * ecx = pointer to string with the path to new current folder,
1721
    rules of path forming can be found in function 70 description.
1657
    rules of path forming can be found in function 70 description.
1722
Returned value:
1658
Returned value:
1723
  * function does not return value
1659
  * function does not return value
1724
----------------------------------------------------------------------
1660
----------------------------------------------------------------------
1725
--------- Subfunction 2 - get current folder for the thread. ---------
1661
--------- Subfunction 2 - get current folder for the thread. ---------
1726
Parameters:
1662
Parameters:
1727
  * eax = 30 - function number
1663
  * eax = 30 - function number
1728
  * ebx = 2 - subfunction number
1664
  * ebx = 2 - subfunction number
1729
  * ecx = pointer to buffer
1665
  * ecx = pointer to buffer
1730
  * edx = size of buffer
1666
  * edx = size of buffer
1731
Returned value:
1667
Returned value:
1732
  * eax = size of the string (including terminating 0)
1668
  * eax = size of the string (including terminating 0)
1733
Remarks:
1669
Remarks:
1734
  * If the buffer is too small to hold all path, only part of the string
1670
  * If the buffer is too small to hold all path, only part of the string
1735
    will be copied and terminated with 0.
1671
    will be copied and terminated with 0.
1736
  * By default, current folder for the thread is "/sys".
1672
  * By default, current folder for the thread is "/sys".
1737
  * At process/thread creation the current folder will be inherited
1673
  * At process/thread creation the current folder will be inherited
1738
    from the parent.
1674
    from the parent.
1739
----------------------------------------------------------------------
1675
----------------------------------------------------------------------
1740
--- Subfunction 3 - install the add.system directory for the kernel --
1676
--- Subfunction 3 - install the add.system directory for the kernel --
1741
Parameters:
1677
Parameters:
1742
  * eax = 30 - function number
1678
  * eax = 30 - function number
1743
  * ebx = 3 - subfunction number
1679
  * ebx = 3 - subfunction number
1744
  * ecx = pointer to a block of data:
1680
  * ecx = pointer to a block of data:
1745
key     rb  64
1681
key     rb  64
1746
path    rb  64
1682
path    rb  64
1747
    Example:
1683
    Example:
1748
align 64
1684
align 64
1749
key     db  'kolibrios',0   ; key must be in lower case
1685
key     db  'kolibrios',0   ; key must be in lower case
1750
align 64
1686
align 64
1751
path    db  'HD0/1',0
1687
path    db  'HD0/1',0
1752
 
1688
 
1753
Returned value:
1689
Returned value:
1754
  * function does not return value
1690
  * function does not return value
1755
Remarks:
1691
Remarks:
1756
  * The function can be called only 1 time for 1 session of the OS.
1692
  * The function can be called only 1 time for 1 session of the OS.
1757
  * On input the symbolic key is not changing by encoding.
1693
  * On input the symbolic key is not changing by encoding.
1758
----------------------------------------------------------------------
1694
----------------------------------------------------------------------
1759
---- Subfunction 4 - set current folder, specifying the encoding. ----
1695
---- Subfunction 4 - set current folder, specifying the encoding. ----
1760
Parameters:
1696
Parameters:
1761
  * eax = 30 - function number
1697
  * eax = 30 - function number
1762
  * ebx = 4 - subfunction number
1698
  * ebx = 4 - subfunction number
1763
  * ecx = pointer to string with the path to new current folder
1699
  * ecx = pointer to string with the path to new current folder
1764
  * edx = string encoding, details can be found in function 80 description.
1700
  * edx = string encoding, details can be found in function 80 description.
1765
Returned value:
1701
Returned value:
1766
  * function does not return value
1702
  * function does not return value
1767
----------------------------------------------------------------------
1703
----------------------------------------------------------------------
1768
---- Subfunction 5 - get current folder, specifying the encoding. ----
1704
---- Subfunction 5 - get current folder, specifying the encoding. ----
1769
Parameters:
1705
Parameters:
1770
  * eax = 30 - function number
1706
  * eax = 30 - function number
1771
  * ebx = 5 - subfunction number
1707
  * ebx = 5 - subfunction number
1772
  * ecx = pointer to buffer
1708
  * ecx = pointer to buffer
1773
  * edx = size of buffer
1709
  * edx = size of buffer
1774
  * esi = string encoding
1710
  * esi = string encoding
1775
Returned value:
1711
Returned value:
1776
  * eax = size of the string in bytes (including terminating 0)
1712
  * eax = size of the string in bytes (including terminating 0)
1777
Remarks:
1713
Remarks:
1778
  * If the buffer is too small to hold all path, only part of the string
1714
  * If the buffer is too small to hold all path, only part of the string
1779
    will be copied and terminated with 0.
1715
    will be copied and terminated with 0.
1780
  * By default, current folder for the thread is "/sys".
1716
  * By default, current folder for the thread is "/sys".
1781
  * At process/thread creation the current folder will be inherited
1717
  * At process/thread creation the current folder will be inherited
1782
    from the parent.
1718
    from the parent.
1783
 
1719
 
1784
---------------------- Constants for registers: ----------------------
1720
---------------------- Constants for registers: ----------------------
1785
  eax - SF_CURRENT_FOLDER (30)
1721
  eax - SF_CURRENT_FOLDER (30)
1786
  ebx - SSF_SET_CF (1), SSF_GET_CF (2), SSF_ADD_SYS_FOLDER (3)
1722
  ebx - SSF_SET_CF (1), SSF_GET_CF (2), SSF_ADD_SYS_FOLDER (3)
1787
======================================================================
1723
======================================================================
1788
========= Function 34 - who owner the pixel on the screen. ===========
1724
========= Function 34 - who owner the pixel on the screen. ===========
1789
======================================================================
1725
======================================================================
1790
Parameters:
1726
Parameters:
1791
  * eax = 34 - function number
1727
  * eax = 34 - function number
1792
  * ebx = x-coordinate (relative to the display)
1728
  * ebx = x-coordinate (relative to the display)
1793
  * ecx = y-coordinate (relative to the display)
1729
  * ecx = y-coordinate (relative to the display)
1794
 
1730
 
1795
Returned value:
1731
Returned value:
1796
  * eax = 0x000000XX - owner of pixel the slot window N
1732
  * eax = 0x000000XX - owner of pixel the slot window N
1797
    If incorrect values ebx and ecx then function returns 0
1733
    If incorrect values ebx and ecx then function returns 0
1798
  * The function takes the value from the area [_WinMapAddress]
1734
  * The function takes the value from the area [_WinMapAddress]
1799
 
1735
 
1800
---------------------- Constants for registers: ----------------------
1736
---------------------- Constants for registers: ----------------------
1801
  eax - SF_GET_PIXEL_OWNER (34)
1737
  eax - SF_GET_PIXEL_OWNER (34)
1802
======================================================================
1738
======================================================================
1803
======= Function 35 - read the color of a pixel on the screen. =======
1739
======= Function 35 - read the color of a pixel on the screen. =======
1804
======================================================================
1740
======================================================================
1805
Parameters:
1741
Parameters:
1806
  * eax = 35
1742
  * eax = 35
1807
  * ebx = y*xsize+x, where
1743
  * ebx = y*xsize+x, where
1808
  * (x,y) = coordinates of a pixel (beginning from 0)
1744
  * (x,y) = coordinates of a pixel (beginning from 0)
1809
  * xsize = horizontal screen size
1745
  * xsize = horizontal screen size
1810
Returned value:
1746
Returned value:
1811
  * eax = color 0x00RRGGBB
1747
  * eax = color 0x00RRGGBB
1812
Remarks:
1748
Remarks:
1813
  * To get screen sizes use function 14. Pay attention,
1749
  * To get screen sizes use function 14. Pay attention,
1814
    that it subtracts 1 from both sizes.
1750
    that it subtracts 1 from both sizes.
1815
  * There is also direct access (without any system calls)
1751
  * There is also direct access (without any system calls)
1816
    to videomemory through the selector gs. To get parameters of
1752
    to videomemory through the selector gs. To get parameters of
1817
    the current videomode, use function 61.
1753
    the current videomode, use function 61.
1818
 
1754
 
1819
---------------------- Constants for registers: ----------------------
1755
---------------------- Constants for registers: ----------------------
1820
  eax - SF_GET_PIXEL (35)
1756
  eax - SF_GET_PIXEL (35)
1821
======================================================================
1757
======================================================================
1822
=================== Function 36 - read screen area. ==================
1758
=================== Function 36 - read screen area. ==================
1823
======================================================================
1759
======================================================================
1824
Paramters:
1760
Paramters:
1825
  * eax = 36 - function number
1761
  * eax = 36 - function number
1826
  * ebx = pointer to the previously allocated memory area,
1762
  * ebx = pointer to the previously allocated memory area,
1827
        where will be placed the image in the format BBGGRRBBGGRR...
1763
        where will be placed the image in the format BBGGRRBBGGRR...
1828
  * ecx = [size on axis x]*65536 + [size on axis y]
1764
  * ecx = [size on axis x]*65536 + [size on axis y]
1829
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1765
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1830
Returned value:
1766
Returned value:
1831
  * function does not return value
1767
  * function does not return value
1832
Remarks:
1768
Remarks:
1833
  * Coordinates of the image are coordinates of the upper left corner
1769
  * Coordinates of the image are coordinates of the upper left corner
1834
    of the image relative to the screen.
1770
    of the image relative to the screen.
1835
  * Size of the image in bytes is 3*xsize*ysize.
1771
  * Size of the image in bytes is 3*xsize*ysize.
1836
 
1772
 
1837
---------------------- Constants for registers: ----------------------
1773
---------------------- Constants for registers: ----------------------
1838
  eax - SF_GET_IMAGE (36)
1774
  eax - SF_GET_IMAGE (36)
1839
======================================================================
1775
======================================================================
1840
=================== Function 37 - work with mouse. ===================
1776
=================== Function 37 - work with mouse. ===================
1841
======================================================================
1777
======================================================================
1842
 
1778
 
1843
-------- Subfunction 0 - get screen coordinates of the mouse ---------
1779
-------- Subfunction 0 - get screen coordinates of the mouse ---------
1844
Parameters:
1780
Parameters:
1845
  * eax = 37 - function number
1781
  * eax = 37 - function number
1846
  * ebx = 0 - subfunction number
1782
  * ebx = 0 - subfunction number
1847
Returned value:
1783
Returned value:
1848
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1784
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1849
    (beginning from 0)
1785
    (beginning from 0)
1850
 
1786
 
1851
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1787
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1852
Parameters:
1788
Parameters:
1853
  * eax = 37 - function number
1789
  * eax = 37 - function number
1854
  * ebx = 1 - subfunction number
1790
  * ebx = 1 - subfunction number
1855
Returned value:
1791
Returned value:
1856
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1792
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1857
    relative to the application window (beginning from 0)
1793
    relative to the application window (beginning from 0)
1858
Remarks:
1794
Remarks:
1859
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1795
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1860
    If y>=ywnd, the low word is non-negative and contains
1796
    If y>=ywnd, the low word is non-negative and contains
1861
    relative y-coordinate, and the high word - relative x-coordinate
1797
    relative y-coordinate, and the high word - relative x-coordinate
1862
    (with correct sign). Otherwise the low word is negative and still
1798
    (with correct sign). Otherwise the low word is negative and still
1863
    contains relative y-coordinate, and to the high word
1799
    contains relative y-coordinate, and to the high word
1864
    1 should be added.
1800
    1 should be added.
1865
 
1801
 
1866
----------- Subfunction 2 - get states of the mouse buttons ----------
1802
----------- Subfunction 2 - get states of the mouse buttons ----------
1867
Parameters:
1803
Parameters:
1868
  * eax = 37 - function number
1804
  * eax = 37 - function number
1869
  * ebx = 2 - subfunction number
1805
  * ebx = 2 - subfunction number
1870
Returned value:
1806
Returned value:
1871
  * eax = bits 0-4 equal to subfunction 3
1807
  * eax = bits 0-4 equal to subfunction 3
1872
 
1808
 
1873
----- Subfunction 3 - get states and events of the mouse buttons -----
1809
----- Subfunction 3 - get states and events of the mouse buttons -----
1874
Parameters:
1810
Parameters:
1875
  * eax = 37 - function number
1811
  * eax = 37 - function number
1876
  * ebx = 3 - subfunction number
1812
  * ebx = 3 - subfunction number
1877
Returned value:
1813
Returned value:
1878
  * eax contains next information:
1814
  * eax contains next information:
1879
 
1815
 
1880
states:
1816
states:
1881
  * bit 0 is set = left button is held
1817
  * bit 0 is set = left button is held
1882
  * bit 1 is set = right button is held
1818
  * bit 1 is set = right button is held
1883
  * bit 2 is set = middle button is held
1819
  * bit 2 is set = middle button is held
1884
  * bit 3 is set = 4th button is held
1820
  * bit 3 is set = 4th button is held
1885
  * bit 4 is set = 5th button is held
1821
  * bit 4 is set = 5th button is held
1886
 
1822
 
1887
events:
1823
events:
1888
  * bit 8 is set = left button is pressed
1824
  * bit 8 is set = left button is pressed
1889
  * bit 9 is set = right button is pressed
1825
  * bit 9 is set = right button is pressed
1890
  * bit 10 is set = middle button is pressed
1826
  * bit 10 is set = middle button is pressed
1891
 
1827
 
1892
  * bit 15 is set = vertical scroll is used
1828
  * bit 15 is set = vertical scroll is used
1893
 
1829
 
1894
  * bit 16 is set = left button is released
1830
  * bit 16 is set = left button is released
1895
  * bit 17 is set = right button is released
1831
  * bit 17 is set = right button is released
1896
  * bit 18 is set = middle button is released
1832
  * bit 18 is set = middle button is released
1897
 
1833
 
1898
  * bit 23 is set = horizontal scroll is used
1834
  * bit 23 is set = horizontal scroll is used
1899
 
1835
 
1900
  * bit 24 is set = doubleclick by left button
1836
  * bit 24 is set = doubleclick by left button
1901
 
1837
 
1902
-------------------- Subfunction 4 - load cursor ---------------------
1838
-------------------- Subfunction 4 - load cursor ---------------------
1903
Parameters:
1839
Parameters:
1904
  * eax = 37 - function number
1840
  * eax = 37 - function number
1905
  * ebx = 4 - subfunction number
1841
  * ebx = 4 - subfunction number
1906
  * dx = data source:
1842
  * dx = data source:
1907
  * dx = LOAD_FROM_FILE = 0 - data in a file
1843
  * dx = LOAD_FROM_FILE = 0 - data in a file
1908
    * ecx = pointer to full path to the cursor file
1844
    * ecx = pointer to full path to the cursor file
1909
    * the file must be in the format .cur, which is standard for
1845
    * the file must be in the format .cur, which is standard for
1910
      MS Windows, at that of the size 32*32 pixels
1846
      MS Windows, at that of the size 32*32 pixels
1911
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1847
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1912
    * ecx = pointer to data of the cursor file
1848
    * ecx = pointer to data of the cursor file
1913
    * the data format is the same as in the previous case
1849
    * the data format is the same as in the previous case
1914
  * dx = LOAD_INDIRECT = 2 - data in memory
1850
  * dx = LOAD_INDIRECT = 2 - data in memory
1915
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1851
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1916
    * edx = 0xXXYY0002, where
1852
    * edx = 0xXXYY0002, where
1917
      * XX = x-coordinate of cursor hotspot
1853
      * XX = x-coordinate of cursor hotspot
1918
      * YY = y-coordinate
1854
      * YY = y-coordinate
1919
      * 0 <= XX, YY <= 31
1855
      * 0 <= XX, YY <= 31
1920
Returned value:
1856
Returned value:
1921
  * eax = 0 - failed
1857
  * eax = 0 - failed
1922
  * otherwise eax = cursor handle
1858
  * otherwise eax = cursor handle
1923
 
1859
 
1924
--------------------- Subfunction 5 - set cursor ---------------------
1860
--------------------- Subfunction 5 - set cursor ---------------------
1925
Sets new cursor for the window of the current thread.
1861
Sets new cursor for the window of the current thread.
1926
Parameters:
1862
Parameters:
1927
  * eax = 37 - function number
1863
  * eax = 37 - function number
1928
  * ebx = 5 - subfunction number
1864
  * ebx = 5 - subfunction number
1929
  * ecx = cursor handle
1865
  * ecx = cursor handle
1930
Returned value:
1866
Returned value:
1931
  * eax = handle of previous cursor
1867
  * eax = handle of previous cursor
1932
Remarks:
1868
Remarks:
1933
  * If the handle is incorrect, the function restores the default
1869
  * If the handle is incorrect, the function restores the default
1934
    cursor (standard arrow). In particular, ecx=0 restores it.
1870
    cursor (standard arrow). In particular, ecx=0 restores it.
1935
 
1871
 
1936
------------------- Subfunction 6 - delete cursor --------------------
1872
------------------- Subfunction 6 - delete cursor --------------------
1937
Parameters:
1873
Parameters:
1938
  * eax = 37 - function number
1874
  * eax = 37 - function number
1939
  * ebx = 6 - subfunction number
1875
  * ebx = 6 - subfunction number
1940
  * ecx = cursor handle
1876
  * ecx = cursor handle
1941
Returned value:
1877
Returned value:
1942
  * eax destroyed
1878
  * eax destroyed
1943
Remarks:
1879
Remarks:
1944
  * The cursor must be loaded previously by the current thread
1880
  * The cursor must be loaded previously by the current thread
1945
    (with the call to subfunction 4). The function does not delete
1881
    (with the call to subfunction 4). The function does not delete
1946
    system cursors and cursors, loaded by another applications.
1882
    system cursors and cursors, loaded by another applications.
1947
  * If the active cursor (set by subfunction 5) is deleted,
1883
  * If the active cursor (set by subfunction 5) is deleted,
1948
    the system restores the default cursor (standard arrow).
1884
    the system restores the default cursor (standard arrow).
1949
 
1885
 
1950
------------------ Subfunction 7 - get scroll data -------------------
1886
------------------ Subfunction 7 - get scroll data -------------------
1951
Parameters:
1887
Parameters:
1952
  * eax = 37 - function number
1888
  * eax = 37 - function number
1953
  * ebx = 7 - subfunction number
1889
  * ebx = 7 - subfunction number
1954
Returned value:
1890
Returned value:
1955
  * eax = [horizontal offset]*65536 + [vertical offset]
1891
  * eax = [horizontal offset]*65536 + [vertical offset]
1956
Remarks:
1892
Remarks:
1957
  * Scroll data is available for active window only.
1893
  * Scroll data is available for active window only.
1958
  * Values are zeroed after reading.
1894
  * Values are zeroed after reading.
1959
  * Values are signed.
1895
  * Values are signed.
1960
 
1896
 
1961
-------- Subfunction 8 - load cursor, specifying the encoding --------
1897
-------- Subfunction 8 - load cursor, specifying the encoding --------
1962
Parameters:
1898
Parameters:
1963
  * eax = 37 - function number
1899
  * eax = 37 - function number
1964
  * ebx = 8 - subfunction number
1900
  * ebx = 8 - subfunction number
1965
  * ecx = pointer to the cursor file path string
1901
  * ecx = pointer to the cursor file path string
1966
  * edx = string encoding, details can be found in function 80
1902
  * edx = string encoding, details can be found in function 80
1967
          description.
1903
          description.
1968
Returned value:
1904
Returned value:
1969
  * eax = cursor handle, 0 - failed
1905
  * eax = cursor handle, 0 - failed
1970
 
1906
 
1971
---------------------- Constants for registers: ----------------------
1907
---------------------- Constants for registers: ----------------------
1972
  eax - SF_MOUSE_GET (37)
1908
  eax - SF_MOUSE_GET (37)
1973
  ebx - SSF_SCREEN_POSITION (0), SSF_WINDOW_POSITION (1),
1909
  ebx - SSF_SCREEN_POSITION (0), SSF_WINDOW_POSITION (1),
1974
    SSF_BUTTON (2), SSF_BUTTON_EXT (3), SSF_LOAD_CURSOR (4),
1910
    SSF_BUTTON (2), SSF_BUTTON_EXT (3), SSF_LOAD_CURSOR (4),
1975
    SSF_SET_CURSOR (5), SSF_DEL_CURSOR (6), SSF_SCROLL_DATA (7)
1911
    SSF_SET_CURSOR (5), SSF_DEL_CURSOR (6), SSF_SCROLL_DATA (7)
1976
======================================================================
1912
======================================================================
1977
====================== Function 38 - draw line. ======================
1913
====================== Function 38 - draw line. ======================
1978
======================================================================
1914
======================================================================
1979
Parameters:
1915
Parameters:
1980
  * eax = 38 - function number
1916
  * eax = 38 - function number
1981
  * ebx = [start coordinate on axis x]*65536 +
1917
  * ebx = [start coordinate on axis x]*65536 +
1982
              [end coordinate on axis x]
1918
              [end coordinate on axis x]
1983
  * ecx = [start coordinate on axis y]*65536 +
1919
  * ecx = [start coordinate on axis y]*65536 +
1984
              [end coordinate on axis y]
1920
              [end coordinate on axis y]
1985
  * edx = 0x00RRGGBB - color
1921
  * edx = 0x00RRGGBB - color
1986
    edx = 0x01xxxxxx - draw inversed line
1922
    edx = 0x01xxxxxx - draw inversed line
1987
          (low 24 bits are ignored)
1923
          (low 24 bits are ignored)
1988
Returned value:
1924
Returned value:
1989
  * function does not return value
1925
  * function does not return value
1990
Remarks:
1926
Remarks:
1991
  * Coordinates are relative to the window.
1927
  * Coordinates are relative to the window.
1992
  * End point is also drawn.
1928
  * End point is also drawn.
1993
 
1929
 
1994
---------------------- Constants for registers: ----------------------
1930
---------------------- Constants for registers: ----------------------
1995
  eax - SF_DRAW_LINE (38)
1931
  eax - SF_DRAW_LINE (38)
1996
======================================================================
1932
======================================================================
1997
== Function 39, subfunction 1 - get a size of the background image. ==
1933
== Function 39, subfunction 1 - get a size of the background image. ==
1998
======================================================================
1934
======================================================================
1999
Parameters:
1935
Parameters:
2000
  * eax = 39 - function number
1936
  * eax = 39 - function number
2001
  * ebx = 1 - subfunction number
1937
  * ebx = 1 - subfunction number
2002
Returned value:
1938
Returned value:
2003
  * eax = [width]*65536 + [height]
1939
  * eax = [width]*65536 + [height]
2004
Remarks:
1940
Remarks:
2005
  * There is a pair function to set sizes of background image -
1941
  * There is a pair function to set sizes of background image -
2006
    subfunction 1 of function 15. After which it is necessary,
1942
    subfunction 1 of function 15. After which it is necessary,
2007
    of course, anew to define image.
1943
    of course, anew to define image.
2008
 
1944
 
2009
---------------------- Constants for registers: ----------------------
1945
---------------------- Constants for registers: ----------------------
2010
  eax - SF_BACKGROUND_GET (39)
1946
  eax - SF_BACKGROUND_GET (39)
2011
======================================================================
1947
======================================================================
2012
== Function 39, subfunction 2 - get pixel from the background image. =
1948
== Function 39, subfunction 2 - get pixel from the background image. =
2013
======================================================================
1949
======================================================================
2014
Parameters:
1950
Parameters:
2015
  * eax = 39 - function number
1951
  * eax = 39 - function number
2016
  * ebx = 2 - subfunction number
1952
  * ebx = 2 - subfunction number
2017
  * ecx = offset
1953
  * ecx = offset
2018
Returned value:
1954
Returned value:
2019
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1955
  * eax = 0x00RRGGBB - pixel color, if offset is valid
2020
    (less than 0x160000-16)
1956
    (less than 0x160000-16)
2021
  * eax = 2 otherwise
1957
  * eax = 2 otherwise
2022
Remarks:
1958
Remarks:
2023
  * Do not rely on returned value for invalid offsets, it may be
1959
  * Do not rely on returned value for invalid offsets, it may be
2024
    changed in future kernel versions.
1960
    changed in future kernel versions.
2025
  * Offset for pixel with coordinates (x,y)
1961
  * Offset for pixel with coordinates (x,y)
2026
    is calculated as (x+y*xsize)*3.
1962
    is calculated as (x+y*xsize)*3.
2027
  * There is a pair function to set pixel on the background image -
1963
  * There is a pair function to set pixel on the background image -
2028
    subfunction 2 of function 15.
1964
    subfunction 2 of function 15.
2029
 
1965
 
2030
---------------------- Constants for registers: ----------------------
1966
---------------------- Constants for registers: ----------------------
2031
  eax - SF_BACKGROUND_GET_RECT (39)
1967
  eax - SF_BACKGROUND_GET_RECT (39)
2032
======================================================================
1968
======================================================================
2033
== Function 39, subfunction 3 - get rect from the background image.  =
1969
== Function 39, subfunction 3 - get rect from the background image.  =
2034
======================================================================
1970
======================================================================
2035
Parameters:
1971
Parameters:
2036
  * eax = 39 - function number
1972
  * eax = 39 - function number
2037
  * ebx = 3 - subfunction number
1973
  * ebx = 3 - subfunction number
2038
  * ecx = [x]*65536 + [y]
1974
  * ecx = [x]*65536 + [y]
2039
  * edx = [width]*65536 + [height]
1975
  * edx = [width]*65536 + [height]
2040
  * esi = buffer address
1976
  * esi = buffer address
2041
Returned value:
1977
Returned value:
2042
  * eax = 0 - success
1978
  * eax = 0 - success
2043
  * eax = -1 - error
1979
  * eax = -1 - error
2044
Remarks:
1980
Remarks:
2045
  * Function copies specified rectangle of background image to buffer
1981
  * Function copies specified rectangle of background image to buffer
2046
    in 0x00RRGGBB format
1982
    in 0x00RRGGBB format
2047
 
1983
 
2048
---------------------- Constants for registers: ----------------------
1984
---------------------- Constants for registers: ----------------------
2049
  eax - SF_BACKGROUND_GET (39)
1985
  eax - SF_BACKGROUND_GET (39)
2050
======================================================================
1986
======================================================================
2051
== Function 39, subfunction 4 - get drawing mode for the background. =
1987
== Function 39, subfunction 4 - get drawing mode for the background. =
2052
======================================================================
1988
======================================================================
2053
Parameters:
1989
Parameters:
2054
  * eax = 39 - function number
1990
  * eax = 39 - function number
2055
  * ebx = 4 - subfunction number
1991
  * ebx = 4 - subfunction number
2056
Returned value:
1992
Returned value:
2057
  * eax = 1 - tile
1993
  * eax = 1 - tile
2058
  * eax = 2 - stretch
1994
  * eax = 2 - stretch
2059
Remarks:
1995
Remarks:
2060
  * There is a pair function to set drawing mode -
1996
  * There is a pair function to set drawing mode -
2061
    subfunction 4 of function 15.
1997
    subfunction 4 of function 15.
2062
 
1998
 
2063
---------------------- Constants for registers: ----------------------
1999
---------------------- Constants for registers: ----------------------
2064
  eax - SF_BACKGROUND_GET (39)
2000
  eax - SF_BACKGROUND_GET (39)
2065
======================================================================
2001
======================================================================
2066
=========== Function 40 - set the mask for expected events. ==========
2002
=========== Function 40 - set the mask for expected events. ==========
2067
======================================================================
2003
======================================================================
2068
The mask for expected events affects function working with events
2004
The mask for expected events affects function working with events
2069
10, 11, 23 - they notify only about events allowed by this mask.
2005
10, 11, 23 - they notify only about events allowed by this mask.
2070
Parameters:
2006
Parameters:
2071
  * eax = 40 - function number
2007
  * eax = 40 - function number
2072
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
2008
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
2073
    (set bit permits notice on event)
2009
    (set bit permits notice on event)
2074
    bit 31: mouse active/inactive filter
2010
    bit 31: mouse active/inactive filter
2075
    bit 31 = 0 - inactive window receive mouse events
2011
    bit 31 = 0 - inactive window receive mouse events
2076
    bit 31 = 1 - inactive window does not receive mouse events
2012
    bit 31 = 1 - inactive window does not receive mouse events
2077
    bit 30: cursor position filter
2013
    bit 30: cursor position filter
2078
    bit 30 = 0 = the window receive mouse events if cursor
2014
    bit 30 = 0 = the window receive mouse events if cursor
2079
                 outside window
2015
                 outside window
2080
    bit 30 = 1 - the window does not receive mouse events if cursor
2016
    bit 30 = 1 - the window does not receive mouse events if cursor
2081
                 outside window
2017
                 outside window
2082
Returned value:
2018
Returned value:
2083
  * eax = previous value of mask
2019
  * eax = previous value of mask
2084
Remarks:
2020
Remarks:
2085
  * Default mask (7=111b) enables notices about redraw,
2021
  * Default mask (7=111b) enables notices about redraw,
2086
    keys and buttons. This is enough for many applications.
2022
    keys and buttons. This is enough for many applications.
2087
  * Events prohibited in the mask are saved anyway, when come;
2023
  * Events prohibited in the mask are saved anyway, when come;
2088
    they are simply not informed with event functions.
2024
    they are simply not informed with event functions.
2089
  * Event functions take into account the mask on moment of
2025
  * Event functions take into account the mask on moment of
2090
    function call, not on moment of event arrival.
2026
    function call, not on moment of event arrival.
2091
 
2027
 
2092
---------------------- Constants for registers: ----------------------
2028
---------------------- Constants for registers: ----------------------
2093
  eax - SF_SET_EVENTS_MASK (40)
2029
  eax - SF_SET_EVENTS_MASK (40)
2094
======================================================================
2030
======================================================================
2095
====== Function 46 - reserve/free a group of input/output ports. =====
2031
====== Function 46 - reserve/free a group of input/output ports. =====
2096
======================================================================
2032
======================================================================
2097
To work with reserved ports an application can access directly by
2033
To work with reserved ports an application can access directly by
2098
commands in/out .
2034
commands in/out .
2099
Parameters:
2035
Parameters:
2100
  * eax = 46 - function number
2036
  * eax = 46 - function number
2101
  * ebx = 0 - reserve, 1 - free
2037
  * ebx = 0 - reserve, 1 - free
2102
  * ecx = start port number
2038
  * ecx = start port number
2103
  * edx = end port number (inclusive)
2039
  * edx = end port number (inclusive)
2104
Returned value:
2040
Returned value:
2105
  * eax = 0 - success
2041
  * eax = 0 - success
2106
  * eax = 1 - error
2042
  * eax = 1 - error
2107
Remarks:
2043
Remarks:
2108
  * For ports reservation: an error occurs if and only if
2044
  * For ports reservation: an error occurs if and only if
2109
    one from the following condition satisfies:
2045
    one from the following condition satisfies:
2110
    * start port is more than end port;
2046
    * start port is more than end port;
2111
    * the selected range contains incorrect port number
2047
    * the selected range contains incorrect port number
2112
      (correct are from 0 to 0xFFFF);
2048
      (correct are from 0 to 0xFFFF);
2113
    * limit for the total number of reserved areas is exceeded
2049
    * limit for the total number of reserved areas is exceeded
2114
      (maximum 255 are allowed);
2050
      (maximum 255 are allowed);
2115
    * the selected range intersects with any of earlier reserved
2051
    * the selected range intersects with any of earlier reserved
2116
  * For ports free: an error is an attempt to free range,
2052
  * For ports free: an error is an attempt to free range,
2117
    that was not earlier reserved by this function
2053
    that was not earlier reserved by this function
2118
    (with same ecx,edx).
2054
    (with same ecx,edx).
2119
  * If an error occurs (for both cases) function performs no action.
2055
  * If an error occurs (for both cases) function performs no action.
2120
  * At booting the system reserves for itself ports
2056
  * At booting the system reserves for itself ports
2121
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2057
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2122
  * When a thread terminates, all reserved by it ports
2058
  * When a thread terminates, all reserved by it ports
2123
    are freed automatically.
2059
    are freed automatically.
2124
 
2060
 
2125
---------------------- Constants for registers: ----------------------
2061
---------------------- Constants for registers: ----------------------
2126
  eax - SF_SET_PORTS (46)
2062
  eax - SF_SET_PORTS (46)
2127
======================================================================
2063
======================================================================
2128
============= Function 47 - draw a number in the window. =============
2064
============= Function 47 - draw a number in the window. =============
2129
======================================================================
2065
======================================================================
2130
Parameters:
2066
Parameters:
2131
  * eax = 47 - function number
2067
  * eax = 47 - function number
2132
  * ebx = parameters of conversion number to text:
2068
  * ebx = parameters of conversion number to text:
2133
    * bl = 0 - ecx contains number
2069
    * bl = 0 - ecx contains number
2134
    * bl = 1 - ecx contains pointer to dword/qword-number
2070
    * bl = 1 - ecx contains pointer to dword/qword-number
2135
    * bh = 0 - display in decimal number system
2071
    * bh = 0 - display in decimal number system
2136
    * bh = 1 - display in hexadecimal system
2072
    * bh = 1 - display in hexadecimal system
2137
    * bh = 2 - display in binary system
2073
    * bh = 2 - display in binary system
2138
    * bits 16-21 = how many digits to display
2074
    * bits 16-21 = how many digits to display
2139
    * bits 22-29 reserved and must be set to 0
2075
    * bits 22-29 reserved and must be set to 0
2140
    * bit 30 set = display qword (64-bit) number (must be bl=1)
2076
    * bit 30 set = display qword (64-bit) number (must be bl=1)
2141
    * bit 31 set = do not display leading zeroes of the number
2077
    * bit 31 set = do not display leading zeroes of the number
2142
  * ecx = number (if bl=0) or pointer (if bl=1)
2078
  * ecx = number (if bl=0) or pointer (if bl=1)
2143
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2079
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2144
  * esi = 0xXXRRGGBB, where
2080
  * esi = 0xXXRRGGBB, where
2145
    * RR, GG, BB specify text color
2081
    * RR, GG, BB specify text color
2146
    * XX = 0B0FCSSS (bits):
2082
    * XX = 0B0FCSSS (bits):
2147
      * B=1 - fill background (color = edi)
2083
      * B=1 - fill background (color = edi)
2148
      * F specifies the font:
2084
      * F specifies the font:
2149
        0 = 6x9
2085
        0 = 6x9
2150
        1 = 8x16
2086
        1 = 8x16
2151
      * C=0 - draw to the window,
2087
      * C=0 - draw to the window,
2152
        C=1 - draw to the user buffer (edi)
2088
        C=1 - draw to the user buffer (edi)
2153
      * SSS = (size multiplier)-1, so 0 = x1, 7 = x8
2089
      * SSS = (size multiplier)-1, so 0 = x1, 7 = x8
2154
Returned value:
2090
Returned value:
2155
  * function does not return value
2091
  * function does not return value
2156
Remarks:
2092
Remarks:
2157
  * The given length must not exceed 60.
2093
  * The given length must not exceed 60.
2158
  * The exactly given amount of digits is output. If number is small
2094
  * The exactly given amount of digits is output. If number is small
2159
    and can be written by smaller amount of digits, it is supplemented
2095
    and can be written by smaller amount of digits, it is supplemented
2160
    by leading zeroes; if the number is big and can not be written by
2096
    by leading zeroes; if the number is big and can not be written by
2161
    given amount of digits, extra digits are not drawn.
2097
    given amount of digits, extra digits are not drawn.
2162
 
2098
 
2163
---------------------- Constants for registers: ----------------------
2099
---------------------- Constants for registers: ----------------------
2164
  eax - SF_DRAW_NUMBER (47)
2100
  eax - SF_DRAW_NUMBER (47)
2165
======================================================================
2101
======================================================================
2166
========= Function 48, subfunction 0 - apply screen settings. ========
2102
========= Function 48, subfunction 0 - apply screen settings. ========
2167
======================================================================
2103
======================================================================
2168
Parameters:
2104
Parameters:
2169
  * eax = 48 - function number
2105
  * eax = 48 - function number
2170
  * ebx = 0 - subfunction number
2106
  * ebx = 0 - subfunction number
2171
  * ecx = 0 - reserved
2107
  * ecx = 0 - reserved
2172
Returned value:
2108
Returned value:
2173
  * function does not return value
2109
  * function does not return value
2174
Remarks:
2110
Remarks:
2175
  * Function redraws the screen after parameters change by
2111
  * Function redraws the screen after parameters change by
2176
    subfunctions 1 and 2.
2112
    subfunctions 1 and 2.
2177
  * Function call without prior call to one of indicated subfunctions
2113
  * Function call without prior call to one of indicated subfunctions
2178
    is ignored.
2114
    is ignored.
2179
  * Function call with nonzero ecx is ignored.
2115
  * Function call with nonzero ecx is ignored.
2180
 
2116
 
2181
---------------------- Constants for registers: ----------------------
2117
---------------------- Constants for registers: ----------------------
2182
  eax - SF_STYLE_SETTINGS (48)
2118
  eax - SF_STYLE_SETTINGS (48)
2183
  ebx - SSF_APPLY (0)
2119
  ebx - SSF_APPLY (0)
2184
======================================================================
2120
======================================================================
2185
=========== Function 48, subfunction 1 - set button style. ===========
2121
=========== Function 48, subfunction 1 - set button style. ===========
2186
======================================================================
2122
======================================================================
2187
Parameters:
2123
Parameters:
2188
  * eax = 48 - function number
2124
  * eax = 48 - function number
2189
  * ebx = 1 - subfunction number
2125
  * ebx = 1 - subfunction number
2190
  * ecx = button style:
2126
  * ecx = button style:
2191
    * 0 = flat
2127
    * 0 = flat
2192
    * 1 = 3d
2128
    * 1 = 3d
2193
Returned value:
2129
Returned value:
2194
  * function does not return value
2130
  * function does not return value
2195
Remarks:
2131
Remarks:
2196
  * After call to this function one should redraw the screen by
2132
  * After call to this function one should redraw the screen by
2197
    subfunction 0.
2133
    subfunction 0.
2198
  * Button style influences only to their draw of function 8.
2134
  * Button style influences only to their draw of function 8.
2199
 
2135
 
2200
---------------------- Constants for registers: ----------------------
2136
---------------------- Constants for registers: ----------------------
2201
  eax - SF_STYLE_SETTINGS (48)
2137
  eax - SF_STYLE_SETTINGS (48)
2202
  ebx - SSF_SET_BUTTON_STYLE (1)
2138
  ebx - SSF_SET_BUTTON_STYLE (1)
2203
======================================================================
2139
======================================================================
2204
====== Function 48, subfunction 2 - set standard window colors. ======
2140
====== Function 48, subfunction 2 - set standard window colors. ======
2205
======================================================================
2141
======================================================================
2206
Parameters:
2142
Parameters:
2207
  * eax = 48 - function number
2143
  * eax = 48 - function number
2208
  * ebx = 2 - subfunction number
2144
  * ebx = 2 - subfunction number
2209
  * ecx = pointer to the color table
2145
  * ecx = pointer to the color table
2210
  * edx = size of the color table
2146
  * edx = size of the color table
2211
    (must be 40 bytes for future compatibility)
2147
    (must be 40 bytes for future compatibility)
2212
Format of the color table is shown in description of subfunction 3.
2148
Format of the color table is shown in description of subfunction 3.
2213
Returned value:
2149
Returned value:
2214
  * function does not return value
2150
  * function does not return value
2215
Remarks:
2151
Remarks:
2216
  * After call to this function one should redraw the screen by
2152
  * After call to this function one should redraw the screen by
2217
    subfunction 0.
2153
    subfunction 0.
2218
  * Table of standard colors influences only to applications,
2154
  * Table of standard colors influences only to applications,
2219
    which receive this table obviously (by subfunction 3)
2155
    which receive this table obviously (by subfunction 3)
2220
    and use it (specifying colors from it to drawing functions).
2156
    and use it (specifying colors from it to drawing functions).
2221
  * Table of standard colors is included in skin and is installed
2157
  * Table of standard colors is included in skin and is installed
2222
    anew with skin installation (by subfunction 8).
2158
    anew with skin installation (by subfunction 8).
2223
  * Color table can be viewed/changed interactively with
2159
  * Color table can be viewed/changed interactively with
2224
    the application 'desktop'.
2160
    the application 'desktop'.
2225
 
2161
 
2226
---------------------- Constants for registers: ----------------------
2162
---------------------- Constants for registers: ----------------------
2227
  eax - SF_STYLE_SETTINGS (48)
2163
  eax - SF_STYLE_SETTINGS (48)
2228
  ebx - SSF_SET_COLORS (2)
2164
  ebx - SSF_SET_COLORS (2)
2229
======================================================================
2165
======================================================================
2230
====== Function 48, subfunction 3 - get standard window colors. ======
2166
====== Function 48, subfunction 3 - get standard window colors. ======
2231
======================================================================
2167
======================================================================
2232
Parameters:
2168
Parameters:
2233
  * eax = 48 - function number
2169
  * eax = 48 - function number
2234
  * ebx = 3 - subfunction number
2170
  * ebx = 3 - subfunction number
2235
  * ecx = pointer to the buffer with size edx bytes,
2171
  * ecx = pointer to the buffer with size edx bytes,
2236
    where table will be written
2172
    where table will be written
2237
  * edx = size of color table
2173
  * edx = size of color table
2238
    (must be 40 bytes for future compatibility)
2174
    (must be 40 bytes for future compatibility)
2239
Returned value:
2175
Returned value:
2240
  * function does not return value
2176
  * function does not return value
2241
Format of the color table:
2177
Format of the color table:
2242
each item is dword-value for color 0x00RRGGBB
2178
each item is dword-value for color 0x00RRGGBB
2243
  * +0: dword: none - reserved
2179
  * +0: dword: none - reserved
2244
  * +4: dword: none - reserved
2180
  * +4: dword: none - reserved
2245
  * +8: dword: work_dark - dark color of working area 
2181
  * +8: dword: work_dark - dark color of working area 
2246
    used to give a user 3D-like feelings about interface elements
2182
    used to give a user 3D-like feelings about interface elements
2247
  * +12 = +0xC: dword: work_light - light color of working area 
2183
  * +12 = +0xC: dword: work_light - light color of working area 
2248
    used to give a user 3D-like feelings about interface elements
2184
    used to give a user 3D-like feelings about interface elements
2249
  * +16 = +0x10: dword: grab_text - color of text on header
2185
  * +16 = +0x10: dword: grab_text - color of text on header
2250
  * +20 = +0x14: dword: work - color of working area
2186
  * +20 = +0x14: dword: work - color of working area
2251
  * +24 = +0x18: dword: button - color of button in working area
2187
  * +24 = +0x18: dword: button - color of button in working area
2252
  * +28 = +0x1C: dword: button_text - color of text on button
2188
  * +28 = +0x1C: dword: button_text - color of text on button
2253
    in working area
2189
    in working area
2254
  * +32 = +0x20: dword: work_text - color of text in working area
2190
  * +32 = +0x20: dword: work_text - color of text in working area
2255
  * +36 = +0x24: dword: graph - color of graphics in working area
2191
  * +36 = +0x24: dword: graph - color of graphics in working area
2256
Remarks:
2192
Remarks:
2257
  * Structure of the color table is described in the standard
2193
  * Structure of the color table is described in the standard
2258
    include file 'macros.inc' as 'system_colors'; for example,
2194
    include file 'macros.inc' as 'system_colors'; for example,
2259
    it is possible to write:
2195
    it is possible to write:
2260
        sc      system_colors           ; variable declaration
2196
        sc      system_colors           ; variable declaration
2261
        ...                             ; somewhere one must call
2197
        ...                             ; somewhere one must call
2262
                                        ; this function with ecx=sc
2198
                                        ; this function with ecx=sc
2263
        mov     ecx, [sc.work_button_text]      ; read text color on
2199
        mov     ecx, [sc.work_button_text]      ; read text color on
2264
                                        ; button in working area
2200
                                        ; button in working area
2265
  * A program itself decides to use or not to use color table.
2201
  * A program itself decides to use or not to use color table.
2266
    For usage program must simply at calls to drawing functions select
2202
    For usage program must simply at calls to drawing functions select
2267
    color taken from the table.
2203
    color taken from the table.
2268
  * At change of the table of standard colors (by subfunction 2 with
2204
  * At change of the table of standard colors (by subfunction 2 with
2269
    the subsequent application of changes by subfunction 0 or
2205
    the subsequent application of changes by subfunction 0 or
2270
    at skin set by subfunction 8) the system sends to all windows
2206
    at skin set by subfunction 8) the system sends to all windows
2271
    redraw message (the event with code 1).
2207
    redraw message (the event with code 1).
2272
  * Color table can be viewed/changed interactively with
2208
  * Color table can be viewed/changed interactively with
2273
    the application 'desktop'.
2209
    the application 'desktop'.
2274
 
2210
 
2275
---------------------- Constants for registers: ----------------------
2211
---------------------- Constants for registers: ----------------------
2276
  eax - SF_STYLE_SETTINGS (48)
2212
  eax - SF_STYLE_SETTINGS (48)
2277
  ebx - SSF_GET_COLORS (3)
2213
  ebx - SSF_GET_COLORS (3)
2278
======================================================================
2214
======================================================================
2279
============ Function 48, subfunction 4 - get skin height. ===========
2215
============ Function 48, subfunction 4 - get skin height. ===========
2280
======================================================================
2216
======================================================================
2281
Parameters:
2217
Parameters:
2282
  * eax = 48 - function number
2218
  * eax = 48 - function number
2283
  * ebx = 4 - subfunction number
2219
  * ebx = 4 - subfunction number
2284
Returned value:
2220
Returned value:
2285
  * eax = skin height
2221
  * eax = skin height
2286
Remarks:
2222
Remarks:
2287
  * Skin height is defined as the height of a header
2223
  * Skin height is defined as the height of a header
2288
    of skinned windows.
2224
    of skinned windows.
2289
  * See also general structure of window in the description
2225
  * See also general structure of window in the description
2290
    of function 0.
2226
    of function 0.
2291
 
2227
 
2292
---------------------- Constants for registers: ----------------------
2228
---------------------- Constants for registers: ----------------------
2293
  eax - SF_STYLE_SETTINGS (48)
2229
  eax - SF_STYLE_SETTINGS (48)
2294
  ebx - SSF_GET_SKIN_HEIGHT (4)
2230
  ebx - SSF_GET_SKIN_HEIGHT (4)
2295
======================================================================
2231
======================================================================
2296
======== Function 48, subfunction 5 - get screen working area. =======
2232
======== Function 48, subfunction 5 - get screen working area. =======
2297
======================================================================
2233
======================================================================
2298
Parameters:
2234
Parameters:
2299
  * eax = 48 - function number
2235
  * eax = 48 - function number
2300
  * ebx = 5 - subfunction number
2236
  * ebx = 5 - subfunction number
2301
Returned value:
2237
Returned value:
2302
  * eax = [left]*65536 + [right]
2238
  * eax = [left]*65536 + [right]
2303
  * ebx = [top]*65536 + [bottom]
2239
  * ebx = [top]*65536 + [bottom]
2304
Remarks:
2240
Remarks:
2305
  * The screen working area defines position and coordinates of
2241
  * The screen working area defines position and coordinates of
2306
    a maximized window.
2242
    a maximized window.
2307
  * The screen working area in view of normal work is all screen
2243
  * The screen working area in view of normal work is all screen
2308
    without taskbar ('@taskbar' application).
2244
    without taskbar ('@taskbar' application).
2309
  * (left,top) are coordinates of the left upper corner,
2245
  * (left,top) are coordinates of the left upper corner,
2310
    (right,bottom) are coordinates of the right lower one.
2246
    (right,bottom) are coordinates of the right lower one.
2311
    Thus the size of working area on x axis can be calculated by
2247
    Thus the size of working area on x axis can be calculated by
2312
    formula right-left+1, on y axis - by formula bottom-top+1.
2248
    formula right-left+1, on y axis - by formula bottom-top+1.
2313
  * See also function 14,
2249
  * See also function 14,
2314
    to get sizes of all screen.
2250
    to get sizes of all screen.
2315
  * There is a pair function to set working area - subfunction 6.
2251
  * There is a pair function to set working area - subfunction 6.
2316
 
2252
 
2317
---------------------- Constants for registers: ----------------------
2253
---------------------- Constants for registers: ----------------------
2318
  eax - SF_STYLE_SETTINGS (48)
2254
  eax - SF_STYLE_SETTINGS (48)
2319
  ebx - SSF_GET_SCREEN_AREA (5)
2255
  ebx - SSF_GET_SCREEN_AREA (5)
2320
======================================================================
2256
======================================================================
2321
======== Function 48, subfunction 6 - set screen working area. =======
2257
======== Function 48, subfunction 6 - set screen working area. =======
2322
======================================================================
2258
======================================================================
2323
Parameters:
2259
Parameters:
2324
  * eax = 48 - function number
2260
  * eax = 48 - function number
2325
  * ebx = 6 - subfunction number
2261
  * ebx = 6 - subfunction number
2326
  * ecx = [left]*65536 + [right]
2262
  * ecx = [left]*65536 + [right]
2327
  * edx = [top]*65536 + [bottom]
2263
  * edx = [top]*65536 + [bottom]
2328
Returned value:
2264
Returned value:
2329
  * function does not return value
2265
  * function does not return value
2330
Remarks:
2266
Remarks:
2331
  * The screen working area defines position and coordinates of
2267
  * The screen working area defines position and coordinates of
2332
    a maximized window.
2268
    a maximized window.
2333
  * This function is used only by the application '@taskbar',
2269
  * This function is used only by the application '@taskbar',
2334
    which set working area to all screen without taskbar.
2270
    which set working area to all screen without taskbar.
2335
  * (left,top) are coordinates of the left upper corner,
2271
  * (left,top) are coordinates of the left upper corner,
2336
    (right,bottom) are coordinates of the right lower one.
2272
    (right,bottom) are coordinates of the right lower one.
2337
    Thus the size of working area on x axis can be calculated by
2273
    Thus the size of working area on x axis can be calculated by
2338
    formula right-left+1, on y axis - by formula bottom-right+1.
2274
    formula right-left+1, on y axis - by formula bottom-right+1.
2339
  * If 'left'>='right', x-coordinate of working area is not changed.
2275
  * If 'left'>='right', x-coordinate of working area is not changed.
2340
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2276
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2341
    equal to screen width, 'right' will not be set.
2277
    equal to screen width, 'right' will not be set.
2342
    Similarly on y axis.
2278
    Similarly on y axis.
2343
  * See also function 14,
2279
  * See also function 14,
2344
    to get sizes of all screen.
2280
    to get sizes of all screen.
2345
  * There is a pair function to get working area - subfunction 5.
2281
  * There is a pair function to get working area - subfunction 5.
2346
  * This function redraws the screen automatically,
2282
  * This function redraws the screen automatically,
2347
    updating coordinates and sizes of maximized windows.
2283
    updating coordinates and sizes of maximized windows.
2348
    The system sends to all windows redraw message (the event 1).
2284
    The system sends to all windows redraw message (the event 1).
2349
 
2285
 
2350
---------------------- Constants for registers: ----------------------
2286
---------------------- Constants for registers: ----------------------
2351
  eax - SF_STYLE_SETTINGS (48)
2287
  eax - SF_STYLE_SETTINGS (48)
2352
  ebx - SSF_SET_SCREEN_AREA (6)
2288
  ebx - SSF_SET_SCREEN_AREA (6)
2353
======================================================================
2289
======================================================================
2354
=========== Function 48, subfunction 7 - get skin margins. ===========
2290
=========== Function 48, subfunction 7 - get skin margins. ===========
2355
======================================================================
2291
======================================================================
2356
Returns the area of a header of a skinned window, intended for
2292
Returns the area of a header of a skinned window, intended for
2357
a text of a header.
2293
a text of a header.
2358
Parameters:
2294
Parameters:
2359
  * eax = 48 - function number
2295
  * eax = 48 - function number
2360
  * ebx = 7 - subfunction number
2296
  * ebx = 7 - subfunction number
2361
Returned value:
2297
Returned value:
2362
  * eax = [left]*65536 + [right]
2298
  * eax = [left]*65536 + [right]
2363
  * ebx = [top]*65536 + [bottom]
2299
  * ebx = [top]*65536 + [bottom]
2364
Remarks:
2300
Remarks:
2365
  * An application decides itself to use or not to use this function.
2301
  * An application decides itself to use or not to use this function.
2366
  * It is recommended to take into account returned value
2302
  * It is recommended to take into account returned value
2367
    of this function for choice of a place for drawing header text
2303
    of this function for choice of a place for drawing header text
2368
    (by function 4) or a substitute of header text
2304
    (by function 4) or a substitute of header text
2369
    (at the discretion of an application).
2305
    (at the discretion of an application).
2370
 
2306
 
2371
---------------------- Constants for registers: ----------------------
2307
---------------------- Constants for registers: ----------------------
2372
  eax - SF_STYLE_SETTINGS (48)
2308
  eax - SF_STYLE_SETTINGS (48)
2373
  ebx - SSF_GET_SKIN_MARGINS (7)
2309
  ebx - SSF_GET_SKIN_MARGINS (7)
2374
======================================================================
2310
======================================================================
2375
============= Function 48, subfunction 8 - set used skin. ============
2311
============= Function 48, subfunction 8 - set used skin. ============
2376
======================================================================
2312
======================================================================
2377
Parameters:
2313
Parameters:
2378
  * eax = 48 - function number
2314
  * eax = 48 - function number
2379
  * ebx = 8 - subfunction number
2315
  * ebx = 8 - subfunction number
2380
  * ecx = pointer to filename of the skin
2316
  * ecx = pointer to filename of the skin
2381
Returned value:
2317
Returned value:
2382
  * eax = 0 - success
2318
  * eax = 0 - success
2383
  * otherwise eax = file system error code; if file does not
2319
  * otherwise eax = file system error code; if file does not
2384
    contain valid skin, function returns error 3
2320
    contain valid skin, function returns error 3
2385
    (unknown file system).
2321
    (unknown file system).
2386
Remarks:
2322
Remarks:
2387
  * After successful skin loading the system sends to all windows
2323
  * After successful skin loading the system sends to all windows
2388
    redraw message (the event 1).
2324
    redraw message (the event 1).
2389
  * At booting the system reads skin from file 'default.skn'
2325
  * At booting the system reads skin from file 'default.skn'
2390
    on ramdisk.
2326
    on ramdisk.
2391
  * User can change the skin statically by creating hisself
2327
  * User can change the skin statically by creating hisself
2392
    'default.skn' or dynamically with the application 'desktop'.
2328
    'default.skn' or dynamically with the application 'desktop'.
2393
 
2329
 
2394
---------------------- Constants for registers: ----------------------
2330
---------------------- Constants for registers: ----------------------
2395
  eax - SF_STYLE_SETTINGS (48)
2331
  eax - SF_STYLE_SETTINGS (48)
2396
  ebx - SSF_SET_SKIN (8)
2332
  ebx - SSF_SET_SKIN (8)
2397
======================================================================
2333
======================================================================
2398
====== Function 48, subfunction 9 - get font smoothing setting. ======
2334
====== Function 48, subfunction 9 - get font smoothing setting. ======
2399
======================================================================
2335
======================================================================
2400
Parameters:
2336
Parameters:
2401
  * eax = 48 - function number
2337
  * eax = 48 - function number
2402
  * ebx = 9 - subfunction number
2338
  * ebx = 9 - subfunction number
2403
Returned value:
2339
Returned value:
2404
  * eax = 2 - subpixel, 1 - anti-aliasing, 0 - off
2340
  * eax = 2 - subpixel, 1 - anti-aliasing, 0 - off
2405
 
2341
 
2406
---------------------- Constants for registers: ----------------------
2342
---------------------- Constants for registers: ----------------------
2407
  eax - SF_STYLE_SETTINGS (48)
2343
  eax - SF_STYLE_SETTINGS (48)
2408
  ebx - SSF_GET_FONT_SMOOTH (9)
2344
  ebx - SSF_GET_FONT_SMOOTH (9)
2409
======================================================================
2345
======================================================================
2410
========== Function 48, subfunction 10 - set font smoothing. =========
2346
========== Function 48, subfunction 10 - set font smoothing. =========
2411
======================================================================
2347
======================================================================
2412
Parameters:
2348
Parameters:
2413
  * eax = 48 - function number
2349
  * eax = 48 - function number
2414
  * ebx = 10 - subfunction number
2350
  * ebx = 10 - subfunction number
2415
  * cl  = 2 - subpixel, 1 - anti-aliasing, 0 - off
2351
  * cl  = 2 - subpixel, 1 - anti-aliasing, 0 - off
2416
 
2352
 
2417
---------------------- Constants for registers: ----------------------
2353
---------------------- Constants for registers: ----------------------
2418
  eax - SF_STYLE_SETTINGS (48)
2354
  eax - SF_STYLE_SETTINGS (48)
2419
  ebx - SSF_SET_FONT_SMOOTH (10)
2355
  ebx - SSF_SET_FONT_SMOOTH (10)
2420
======================================================================
2356
======================================================================
2421
============ Function 48, subfunction 11 - get font size. ============
2357
============ Function 48, subfunction 11 - get font size. ============
2422
======================================================================
2358
======================================================================
2423
Parameters:
2359
Parameters:
2424
  * eax = 48 - function number
2360
  * eax = 48 - function number
2425
  * ebx = 11 - subfunction number
2361
  * ebx = 11 - subfunction number
2426
Returned value:
2362
Returned value:
2427
  * eax = current font height in pixels
2363
  * eax = current font height in pixels
2428
 
2364
 
2429
---------------------- Constants for registers: ----------------------
2365
---------------------- Constants for registers: ----------------------
2430
  eax - SF_STYLE_SETTINGS (48)
2366
  eax - SF_STYLE_SETTINGS (48)
2431
  ebx - SSF_GET_FONT_SIZE (11)
2367
  ebx - SSF_GET_FONT_SIZE (11)
2432
======================================================================
2368
======================================================================
2433
============ Function 48, subfunction 12 - set font size. ============
2369
============ Function 48, subfunction 12 - set font size. ============
2434
======================================================================
2370
======================================================================
2435
Parameters:
2371
Parameters:
2436
  * eax = 48 - function number
2372
  * eax = 48 - function number
2437
  * ebx = 12 - subfunction number
2373
  * ebx = 12 - subfunction number
2438
  * cl  = new font height in pixels
2374
  * cl  = new font height in pixels
2439
 
2375
 
2440
---------------------- Constants for registers: ----------------------
2376
---------------------- Constants for registers: ----------------------
2441
  eax - SF_STYLE_SETTINGS (48)
2377
  eax - SF_STYLE_SETTINGS (48)
2442
  ebx - SSF_SET_FONT_SIZE (12)
2378
  ebx - SSF_SET_FONT_SIZE (12)
2443
======================================================================
2379
======================================================================
2444
== Function 48, subfunction 13 - set skin, specifying the encoding. ==
2380
== Function 48, subfunction 13 - set skin, specifying the encoding. ==
2445
======================================================================
2381
======================================================================
2446
Parameters:
2382
Parameters:
2447
  * eax = 48 - function number
2383
  * eax = 48 - function number
2448
  * ebx = 13 - subfunction number
2384
  * ebx = 13 - subfunction number
2449
  * ecx = pointer to the skin file path string
2385
  * ecx = pointer to the skin file path string
2450
  * edx = string encoding, details can be found in function 80 description.
2386
  * edx = string encoding, details can be found in function 80 description.
2451
Returned value:
2387
Returned value:
2452
  * eax = 0 - success
2388
  * eax = 0 - success
2453
  * otherwise eax = file system error code; if file does not
2389
  * otherwise eax = file system error code; if file does not
2454
    contain valid skin, function returns error 3
2390
    contain valid skin, function returns error 3
2455
    (unknown file system).
2391
    (unknown file system).
2456
Remarks:
2392
Remarks:
2457
  * After successful skin loading the system sends to all windows
2393
  * After successful skin loading the system sends to all windows
2458
    redraw message (the event 1).
2394
    redraw message (the event 1).
2459
  * At booting the system reads skin from file 'default.skn'
2395
  * At booting the system reads skin from file 'default.skn'
2460
    on ramdisk.
2396
    on ramdisk.
2461
  * User can change the skin statically by creating hisself
2397
  * User can change the skin statically by creating hisself
2462
    'default.skn' or dynamically with the application 'desktop'.
2398
    'default.skn' or dynamically with the application 'desktop'.
2463
 
2399
 
2464
======================================================================
2400
======================================================================
2465
=========== Function 49 - Advanced Power Management (APM). ===========
2401
=========== Function 49 - Advanced Power Management (APM). ===========
2466
======================================================================
2402
======================================================================
2467
Parameters:
2403
Parameters:
2468
  * eax = 49 - function number
2404
  * eax = 49 - function number
2469
  * dx = number of the APM function
2405
  * dx = number of the APM function
2470
    (analogue of ax in APM specification)
2406
    (analogue of ax in APM specification)
2471
  * bx, cx = parameters of the APM function
2407
  * bx, cx = parameters of the APM function
2472
Returned value:
2408
Returned value:
2473
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2409
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2474
    are set according to the APM specification
2410
    are set according to the APM specification
2475
  * high halves of 32-bit registers eax, ebx, ecx,
2411
  * high halves of 32-bit registers eax, ebx, ecx,
2476
    edx, esi, edi are destroyed
2412
    edx, esi, edi are destroyed
2477
Remarks:
2413
Remarks:
2478
  * APM 1.2 specification is described in the document
2414
  * APM 1.2 specification is described in the document
2479
    "Advanced Power Management (APM) BIOS Specification"
2415
    "Advanced Power Management (APM) BIOS Specification"
2480
    (Revision 1.2), available at
2416
    (Revision 1.2), available at
2481
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2417
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2482
    besides it is included in famous Interrupt List by Ralf Brown
2418
    besides it is included in famous Interrupt List by Ralf Brown
2483
    (http://www.pobox.com/~ralf/files.html,
2419
    (http://www.pobox.com/~ralf/files.html,
2484
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2420
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2485
 
2421
 
2486
---------------------- Constants for registers: ----------------------
2422
---------------------- Constants for registers: ----------------------
2487
  eax - SF_APM (49)
2423
  eax - SF_APM (49)
2488
======================================================================
2424
======================================================================
2489
=================== Function 50 - set window shape. ==================
2425
=================== Function 50 - set window shape. ==================
2490
======================================================================
2426
======================================================================
2491
Normal windows have rectangular shape. This function can give to
2427
Normal windows have rectangular shape. This function can give to
2492
a window any shape. The shape is given by a set of points inside
2428
a window any shape. The shape is given by a set of points inside
2493
the base rectangle belonging to a window. Position and coordinates
2429
the base rectangle belonging to a window. Position and coordinates
2494
of the base rectangle are set by function 0
2430
of the base rectangle are set by function 0
2495
and changed by function 67.
2431
and changed by function 67.
2496
 
2432
 
2497
--------------------------- Set shape data ---------------------------
2433
--------------------------- Set shape data ---------------------------
2498
Parameters:
2434
Parameters:
2499
  * eax = 50 - function number
2435
  * eax = 50 - function number
2500
  * ebx = 0 - subfunction number
2436
  * ebx = 0 - subfunction number
2501
  * ecx = pointer to shape data (array of bytes 0/1)
2437
  * ecx = pointer to shape data (array of bytes 0/1)
2502
Returned value:
2438
Returned value:
2503
  * function does not return value
2439
  * function does not return value
2504
 
2440
 
2505
-------------------------- Set shape scale ---------------------------
2441
-------------------------- Set shape scale ---------------------------
2506
Parameters:
2442
Parameters:
2507
  * eax = 50 - function number
2443
  * eax = 50 - function number
2508
  * ebx = 1 - subfunction number
2444
  * ebx = 1 - subfunction number
2509
  * ecx sets a scale: each byte of data defines
2445
  * ecx sets a scale: each byte of data defines
2510
    (2^scale)*(2^scale) pixels
2446
    (2^scale)*(2^scale) pixels
2511
Returned value:
2447
Returned value:
2512
  * function does not return value
2448
  * function does not return value
2513
Remarks:
2449
Remarks:
2514
  * Default scale is 0 (scale factor is 1). If in the shape data
2450
  * Default scale is 0 (scale factor is 1). If in the shape data
2515
    one byte corresponds to one pixel, there is no necessity
2451
    one byte corresponds to one pixel, there is no necessity
2516
    to set scale.
2452
    to set scale.
2517
  * Let's designate xsize = window width (in pixels), ysize = height;
2453
  * Let's designate xsize = window width (in pixels), ysize = height;
2518
    pay attention, that they are one pixel more than defined by
2454
    pay attention, that they are one pixel more than defined by
2519
    functions 0, 67.
2455
    functions 0, 67.
2520
  * On definition of scale xsize and ysize must be divisible
2456
  * On definition of scale xsize and ysize must be divisible
2521
    on 2^scale.
2457
    on 2^scale.
2522
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2458
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2523
    to a window of square with the side 2^scale (if scale=0,
2459
    to a window of square with the side 2^scale (if scale=0,
2524
    this is one pixel) and coordinates of the left upper corner
2460
    this is one pixel) and coordinates of the left upper corner
2525
    (a mod (xsize shr scale), a div (xsize shr scale))
2461
    (a mod (xsize shr scale), a div (xsize shr scale))
2526
  * Data size: (xsize shr scale)*(ysize shr scale).
2462
  * Data size: (xsize shr scale)*(ysize shr scale).
2527
  * Data must be presented in the memory and not change
2463
  * Data must be presented in the memory and not change
2528
    after set of shape.
2464
    after set of shape.
2529
  * The system views the shape data at every window redraw by
2465
  * The system views the shape data at every window redraw by
2530
    function 0.
2466
    function 0.
2531
  * The call of subfunction 0 with NULL pointer results in return
2467
  * The call of subfunction 0 with NULL pointer results in return
2532
    to the rectangular shape.
2468
    to the rectangular shape.
2533
 
2469
 
2534
---------------------- Constants for registers: ----------------------
2470
---------------------- Constants for registers: ----------------------
2535
  eax - SF_SET_WINDOW_SHAPE (50)
2471
  eax - SF_SET_WINDOW_SHAPE (50)
2536
======================================================================
2472
======================================================================
2537
==================== Function 51 - create thread. ====================
2473
==================== Function 51 - create thread. ====================
2538
======================================================================
2474
======================================================================
2539
Parameters:
2475
Parameters:
2540
  * eax = 51 - function number
2476
  * eax = 51 - function number
2541
  * ebx = 1 - unique subfunction
2477
  * ebx = 1 - unique subfunction
2542
  * ecx = address of thread entry point (starting eip)
2478
  * ecx = address of thread entry point (starting eip)
2543
  * edx = pointer to thread stack (starting esp)
2479
  * edx = pointer to thread stack (starting esp)
2544
Returned value:
2480
Returned value:
2545
  * eax = -1 - error (there is too many threads)
2481
  * eax = -1 - error (there is too many threads)
2546
  * otherwise eax = TID - thread identifier
2482
  * otherwise eax = TID - thread identifier
2547
 
2483
 
2548
---------------------- Constants for registers: ----------------------
2484
---------------------- Constants for registers: ----------------------
2549
  eax - SF_CREATE_THREAD (51)
2485
  eax - SF_CREATE_THREAD (51)
2550
======================================================================
2486
======================================================================
2551
==================== Function 54, subfunction 0 ======================
2487
==================== Function 54, subfunction 0 ======================
2552
============== Get the number of slots in the clipboard. =============
2488
============== Get the number of slots in the clipboard. =============
2553
======================================================================
2489
======================================================================
2554
Parameters:
2490
Parameters:
2555
  * eax = 54 - function number
2491
  * eax = 54 - function number
2556
  * ebx = 0 - subfunction number
2492
  * ebx = 0 - subfunction number
2557
Returned value:
2493
Returned value:
2558
  * eax = slots in the clipboard
2494
  * eax = slots in the clipboard
2559
  * eax = -1 - main list area not found
2495
  * eax = -1 - main list area not found
2560
 
2496
 
2561
---------------------- Constants for registers: ----------------------
2497
---------------------- Constants for registers: ----------------------
2562
  eax - SF_CLIPBOARD (54)
2498
  eax - SF_CLIPBOARD (54)
2563
  ebx - SSF_GET_SLOT_COUNT (0)
2499
  ebx - SSF_GET_SLOT_COUNT (0)
2564
======================================================================
2500
======================================================================
2565
==================== Function 54, subfunction 1 ======================
2501
==================== Function 54, subfunction 1 ======================
2566
================= Read the data from the clipboard. ==================
2502
================= Read the data from the clipboard. ==================
2567
======================================================================
2503
======================================================================
2568
Parameters:
2504
Parameters:
2569
  * eax = 54 - function number
2505
  * eax = 54 - function number
2570
  * ebx = 1 - subfunction number
2506
  * ebx = 1 - subfunction number
2571
  * eсx = slot number
2507
  * eсx = slot number
2572
Returned value:
2508
Returned value:
2573
  * eax = if successful - pointer to a memory with data
2509
  * eax = if successful - pointer to a memory with data
2574
  * eax = 1 - error
2510
  * eax = 1 - error
2575
  * eax = -1 - main list area not found
2511
  * eax = -1 - main list area not found
2576
Remarks:
2512
Remarks:
2577
  * The function must be used in conjunction with 68.11. The
2513
  * The function must be used in conjunction with 68.11. The
2578
    application must pre-initialize the local heap by calling 68.11.
2514
    application must pre-initialize the local heap by calling 68.11.
2579
 
2515
 
2580
---------------------- Constants for registers: ----------------------
2516
---------------------- Constants for registers: ----------------------
2581
  eax - SF_CLIPBOARD (54)
2517
  eax - SF_CLIPBOARD (54)
2582
  ebx - SSF_READ_CB (1)
2518
  ebx - SSF_READ_CB (1)
2583
======================================================================
2519
======================================================================
2584
==================== Function 54, subfunction 2 ======================
2520
==================== Function 54, subfunction 2 ======================
2585
================= Write the data to the clipboard. ===================
2521
================= Write the data to the clipboard. ===================
2586
======================================================================
2522
======================================================================
2587
Parameters:
2523
Parameters:
2588
  * eax = 54 - function number
2524
  * eax = 54 - function number
2589
  * ebx = 2 - subfunction number
2525
  * ebx = 2 - subfunction number
2590
  * eсx = the number of bytes to be copied
2526
  * eсx = the number of bytes to be copied
2591
  * edx = a pointer to a buffer for data to be copied
2527
  * edx = a pointer to a buffer for data to be copied
2592
Returned value:
2528
Returned value:
2593
  * eax = 0 - success
2529
  * eax = 0 - success
2594
  * eax = 1 - error
2530
  * eax = 1 - error
2595
  * eax = -1 - main list area not found
2531
  * eax = -1 - main list area not found
2596
 
2532
 
2597
---------------------- Constants for registers: ----------------------
2533
---------------------- Constants for registers: ----------------------
2598
  eax - SF_CLIPBOARD (54)
2534
  eax - SF_CLIPBOARD (54)
2599
  ebx - SSF_WRITE_CB (2)
2535
  ebx - SSF_WRITE_CB (2)
2600
======================================================================
2536
======================================================================
2601
===================== Function 54, subfunction 3 =====================
2537
===================== Function 54, subfunction 3 =====================
2602
================ Delete the last slot in the clipboard ===============
2538
================ Delete the last slot in the clipboard ===============
2603
======================================================================
2539
======================================================================
2604
Parameters:
2540
Parameters:
2605
  * eax = 54 - function number
2541
  * eax = 54 - function number
2606
  * ebx = 3 - subfunction number
2542
  * ebx = 3 - subfunction number
2607
Returned value:
2543
Returned value:
2608
  * eax = 0 - success
2544
  * eax = 0 - success
2609
  * eax = 1 - error
2545
  * eax = 1 - error
2610
  * eax = -1 - main list area not found
2546
  * eax = -1 - main list area not found
2611
 
2547
 
2612
---------------------- Constants for registers: ----------------------
2548
---------------------- Constants for registers: ----------------------
2613
  eax - SF_CLIPBOARD (54)
2549
  eax - SF_CLIPBOARD (54)
2614
  ebx - SSF_DEL_SLOT (3)
2550
  ebx - SSF_DEL_SLOT (3)
2615
======================================================================
2551
======================================================================
2616
===================== Function 54, subfunction 4 =====================
2552
===================== Function 54, subfunction 4 =====================
2617
===================== Alarm reset the lock buffer ====================
2553
===================== Alarm reset the lock buffer ====================
2618
======================================================================
2554
======================================================================
2619
Parameters:
2555
Parameters:
2620
  * eax = 54 - function number
2556
  * eax = 54 - function number
2621
  * ebx = 4 - subfunction number
2557
  * ebx = 4 - subfunction number
2622
Returned value:
2558
Returned value:
2623
  * eax = 0 - success
2559
  * eax = 0 - success
2624
  * eax = -1 - main list area not found or no blocking
2560
  * eax = -1 - main list area not found or no blocking
2625
Remarks:
2561
Remarks:
2626
  * Used in exceptional cases, where no responsible or killed
2562
  * Used in exceptional cases, where no responsible or killed
2627
    application blocked the clipboard operations.
2563
    application blocked the clipboard operations.
2628
 
2564
 
2629
---------------------- Constants for registers: ----------------------
2565
---------------------- Constants for registers: ----------------------
2630
  eax - SF_CLIPBOARD (54)
2566
  eax - SF_CLIPBOARD (54)
2631
  ebx - SSF_UNLOCK_BUFFER (4)
2567
  ebx - SSF_UNLOCK_BUFFER (4)
2632
======================================================================
2568
======================================================================
2633
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2569
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2634
======================================================================
2570
======================================================================
2635
Parameters:
2571
Parameters:
2636
  * eax = 55 - function number
2572
  * eax = 55 - function number
2637
  * ebx = 55 - subfunction number
2573
  * ebx = 55 - subfunction number
2638
  * esi = pointer to data
2574
  * esi = pointer to data
2639
Returned value:
2575
Returned value:
2640
  * eax = 0 - success
2576
  * eax = 0 - success
2641
  * eax = 55 - error (speaker is off or busy)
2577
  * eax = 55 - error (speaker is off or busy)
2642
Data is an array of items with variable length.
2578
Data is an array of items with variable length.
2643
Format of each item is defined by first byte:
2579
Format of each item is defined by first byte:
2644
  * 0 = end of data
2580
  * 0 = end of data
2645
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2581
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2646
    is defined by immediate value of frequency
2582
    is defined by immediate value of frequency
2647
    * following word (2 bytes) contains frequency divider;
2583
    * following word (2 bytes) contains frequency divider;
2648
      frequency is defined as 1193180/divider
2584
      frequency is defined as 1193180/divider
2649
  * 0x81 = invalid
2585
  * 0x81 = invalid
2650
  * 0x82..0xFF = note is defined by octave and number:
2586
  * 0x82..0xFF = note is defined by octave and number:
2651
    * duration in 1/100 of second = (first byte)-0x81
2587
    * duration in 1/100 of second = (first byte)-0x81
2652
    * there is one more byte;
2588
    * there is one more byte;
2653
    * (second byte)=0xFF - delay
2589
    * (second byte)=0xFF - delay
2654
    * otherwise it looks like a*0x10+b, where b=number of the note in
2590
    * otherwise it looks like a*0x10+b, where b=number of the note in
2655
      an octave from 1 to 12, a=number of octave (beginning from 0)
2591
      an octave from 1 to 12, a=number of octave (beginning from 0)
2656
Remarks:
2592
Remarks:
2657
  * Speaker play can be disabled/enabled by
2593
  * Speaker play can be disabled/enabled by
2658
    subfunction 8 of function 18.
2594
    subfunction 8 of function 18.
2659
  * Function returns control, having informed the system
2595
  * Function returns control, having informed the system
2660
    an information on request. Play itself goes independently from
2596
    an information on request. Play itself goes independently from
2661
    the program.
2597
    the program.
2662
  * The data must be kept in the memory at least up to the end
2598
  * The data must be kept in the memory at least up to the end
2663
    of play.
2599
    of play.
2664
 
2600
 
2665
---------------------- Constants for registers: ----------------------
2601
---------------------- Constants for registers: ----------------------
2666
  eax - SF_SPEAKER_PLAY (55)
2602
  eax - SF_SPEAKER_PLAY (55)
2667
======================================================================
2603
======================================================================
2668
======================= Function 57 - PCI BIOS. ======================
2604
======================= Function 57 - PCI BIOS. ======================
2669
======================================================================
2605
======================================================================
2670
Parameters:
2606
Parameters:
2671
  * eax = 57 - function number
2607
  * eax = 57 - function number
2672
  * ebp corresponds to al in PCI BIOS specification
2608
  * ebp corresponds to al in PCI BIOS specification
2673
  * other registers are set according to PCI BIOS specification
2609
  * other registers are set according to PCI BIOS specification
2674
Returned value:
2610
Returned value:
2675
  * CF is undefined
2611
  * CF is undefined
2676
  * other registers are set according to PCI BIOS specification
2612
  * other registers are set according to PCI BIOS specification
2677
Remarks:
2613
Remarks:
2678
  * Many effects of this function can be also achieved with
2614
  * Many effects of this function can be also achieved with
2679
    corresponding subfunctions of function 62.
2615
    corresponding subfunctions of function 62.
2680
  * The function calls PCI32 BIOS extension, documented e.g. in
2616
  * The function calls PCI32 BIOS extension, documented e.g. in
2681
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2617
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2682
  * If BIOS does not support this extension, its behavior is emulated
2618
  * If BIOS does not support this extension, its behavior is emulated
2683
    (through kernel-mode analogues of subfunctions of function 62).
2619
    (through kernel-mode analogues of subfunctions of function 62).
2684
 
2620
 
2685
---------------------- Constants for registers: ----------------------
2621
---------------------- Constants for registers: ----------------------
2686
  eax - SF_PCI_BIOS (57)
2622
  eax - SF_PCI_BIOS (57)
2687
======================================================================
2623
======================================================================
2688
========== Function 60 - Inter Process Communication (IPC). ==========
2624
========== Function 60 - Inter Process Communication (IPC). ==========
2689
======================================================================
2625
======================================================================
2690
IPC is used for message dispatching from one process/thread to
2626
IPC is used for message dispatching from one process/thread to
2691
another. Previously it is necessary to agree how to interpret
2627
another. Previously it is necessary to agree how to interpret
2692
the concrete message.
2628
the concrete message.
2693
 
2629
 
2694
----------- Subfunction 1 - set the area for IPC receiving -----------
2630
----------- Subfunction 1 - set the area for IPC receiving -----------
2695
Is called by process-receiver.
2631
Is called by process-receiver.
2696
Parameters:
2632
Parameters:
2697
  * eax = 60 - function number
2633
  * eax = 60 - function number
2698
  * ebx = 1 - subfunction number
2634
  * ebx = 1 - subfunction number
2699
  * ecx = pointer to the buffer
2635
  * ecx = pointer to the buffer
2700
  * edx = size of the buffer
2636
  * edx = size of the buffer
2701
Returned value:
2637
Returned value:
2702
  * eax = 0 - always success
2638
  * eax = 0 - always success
2703
Format of IPC-buffer:
2639
Format of IPC-buffer:
2704
  * +0: dword: if nonzero, buffer is considered locked;
2640
  * +0: dword: if nonzero, buffer is considered locked;
2705
    lock/unlock the buffer, when you work with it and need that
2641
    lock/unlock the buffer, when you work with it and need that
2706
    buffer data are not changed from outside (no new messages)
2642
    buffer data are not changed from outside (no new messages)
2707
  * +4: dword: occupied place in the buffer (in bytes)
2643
  * +4: dword: occupied place in the buffer (in bytes)
2708
  * +8: first message
2644
  * +8: first message
2709
  * +8+n: second message
2645
  * +8+n: second message
2710
  * ...
2646
  * ...
2711
Format of a message:
2647
Format of a message:
2712
  * +0: dword: PID of sender
2648
  * +0: dword: PID of sender
2713
  * +4: dword: message length (not including this header)
2649
  * +4: dword: message length (not including this header)
2714
  * +8: n*byte: message data
2650
  * +8: n*byte: message data
2715
 
2651
 
2716
------------------ Subfunction 2 - send IPC message ------------------
2652
------------------ Subfunction 2 - send IPC message ------------------
2717
Is called by process-sender.
2653
Is called by process-sender.
2718
Parameters:
2654
Parameters:
2719
  * eax = 60 - function number
2655
  * eax = 60 - function number
2720
  * ebx = 2 - subfunction number
2656
  * ebx = 2 - subfunction number
2721
  * ecx = PID of receiver
2657
  * ecx = PID of receiver
2722
  * edx = pointer to the message data
2658
  * edx = pointer to the message data
2723
  * esi = message length (in bytes)
2659
  * esi = message length (in bytes)
2724
Returned value:
2660
Returned value:
2725
  * eax = 0 - success
2661
  * eax = 0 - success
2726
  * eax = 1 - the receiver has not defined buffer for IPC messages
2662
  * eax = 1 - the receiver has not defined buffer for IPC messages
2727
    (can be, still have no time,
2663
    (can be, still have no time,
2728
    and can be, this is not right process)
2664
    and can be, this is not right process)
2729
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2665
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2730
  * eax = 3 - overflow of IPC-buffer of the receiver
2666
  * eax = 3 - overflow of IPC-buffer of the receiver
2731
  * eax = 4 - process/thread with such PID does not exist
2667
  * eax = 4 - process/thread with such PID does not exist
2732
Remarks:
2668
Remarks:
2733
  * Immediately after writing of IPC-message to the buffer the system
2669
  * Immediately after writing of IPC-message to the buffer the system
2734
    sends to the receiver the event with code 7 (see event codes).
2670
    sends to the receiver the event with code 7 (see event codes).
2735
 
2671
 
2736
---------------------- Constants for registers: ----------------------
2672
---------------------- Constants for registers: ----------------------
2737
  eax - SF_IPC (60)
2673
  eax - SF_IPC (60)
2738
  ebx - SSF_SET_AREA (1), SSF_SEND_MESSAGE (2)
2674
  ebx - SSF_SET_AREA (1), SSF_SEND_MESSAGE (2)
2739
======================================================================
2675
======================================================================
2740
==== Function 61 - get parameters for the direct graphics access. ====
2676
==== Function 61 - get parameters for the direct graphics access. ====
2741
======================================================================
2677
======================================================================
2742
The data of the graphics screen (the memory area which displays
2678
The data of the graphics screen (the memory area which displays
2743
screen contents) are accessible to a program directly, without
2679
screen contents) are accessible to a program directly, without
2744
any system calls, through the selector gs:
2680
any system calls, through the selector gs:
2745
        mov     eax, [gs:0]
2681
        mov     eax, [gs:0]
2746
places in eax the first dword of the buffer, which contains
2682
places in eax the first dword of the buffer, which contains
2747
information on color of the left upper point (and, possibly, colors
2683
information on color of the left upper point (and, possibly, colors
2748
of several following).
2684
of several following).
2749
        mov     [gs:0], eax
2685
        mov     [gs:0], eax
2750
by work in VESA modes with LFB sets color of the left upper point
2686
by work in VESA modes with LFB sets color of the left upper point
2751
(and, possibly, colors of several following).
2687
(and, possibly, colors of several following).
2752
To interpret the data of graphics screen program needs to know
2688
To interpret the data of graphics screen program needs to know
2753
some parameters, returning by this function.
2689
some parameters, returning by this function.
2754
Remarks:
2690
Remarks:
2755
  * Graphics parameters changes very seldom at work.
2691
  * Graphics parameters changes very seldom at work.
2756
  * At videomode change the system redraws all windows (event
2692
  * At videomode change the system redraws all windows (event
2757
    with code 1) and redraws the background (event 5).
2693
    with code 1) and redraws the background (event 5).
2758
    Same events occur in other cases too, which meet much more often,
2694
    Same events occur in other cases too, which meet much more often,
2759
    than videomode change.
2695
    than videomode change.
2760
  * By operation in videomodes with LFB the selector gs points to
2696
  * By operation in videomodes with LFB the selector gs points to
2761
    LFB itself, so reading/writing on gs result directly in
2697
    LFB itself, so reading/writing on gs result directly in
2762
    change of screen contents. By operation in videomodes without
2698
    change of screen contents. By operation in videomodes without
2763
    LFB gs points to some data area in the kernel, and all functions
2699
    LFB gs points to some data area in the kernel, and all functions
2764
    of screen output fulfil honesty double operation on writing
2700
    of screen output fulfil honesty double operation on writing
2765
    directly to the screen and writing to this buffer. In result
2701
    directly to the screen and writing to this buffer. In result
2766
    at reading contents of this buffer the results correspond to
2702
    at reading contents of this buffer the results correspond to
2767
    screen contents (with, generally speaking, large color
2703
    screen contents (with, generally speaking, large color
2768
    resolution), and writing is ignored.
2704
    resolution), and writing is ignored.
2769
    One exception is the mode 320*200, for which main loop of the
2705
    One exception is the mode 320*200, for which main loop of the
2770
    system thread updates the screen according to mouse movements.
2706
    system thread updates the screen according to mouse movements.
2771
 
2707
 
2772
------------------------- Screen resolution --------------------------
2708
------------------------- Screen resolution --------------------------
2773
Parameters:
2709
Parameters:
2774
  * eax = 61 - function number
2710
  * eax = 61 - function number
2775
  * ebx = 1 - subfunction number
2711
  * ebx = 1 - subfunction number
2776
Returned value:
2712
Returned value:
2777
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
2713
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
2778
Remarks:
2714
Remarks:
2779
  * One can use function 14 paying attention that
2715
  * One can use function 14 paying attention that
2780
    it returns sizes on 1 pixel less. It is fully equivalent way.
2716
    it returns sizes on 1 pixel less. It is fully equivalent way.
2781
 
2717
 
2782
---------------------- Number of bits per pixel ----------------------
2718
---------------------- Number of bits per pixel ----------------------
2783
Parameters:
2719
Parameters:
2784
  * eax = 61 - function number
2720
  * eax = 61 - function number
2785
  * ebx = 2 - subfunction number
2721
  * ebx = 2 - subfunction number
2786
Returned value:
2722
Returned value:
2787
  * eax = number of bits per pixel (24 or 32)
2723
  * eax = number of bits per pixel (24 or 32)
2788
 
2724
 
2789
-------------------- Number of bytes per scanline --------------------
2725
-------------------- Number of bytes per scanline --------------------
2790
Parameters:
2726
Parameters:
2791
  * eax = 61 - function number
2727
  * eax = 61 - function number
2792
  * ebx = 3 - subfunction number
2728
  * ebx = 3 - subfunction number
2793
Returned value:
2729
Returned value:
2794
  * eax = number of bytes occupied by one scanline
2730
  * eax = number of bytes occupied by one scanline
2795
    (horizontal line on the screen)
2731
    (horizontal line on the screen)
2796
 
2732
 
2797
---------------------- Constants for registers: ----------------------
2733
---------------------- Constants for registers: ----------------------
2798
  eax - SF_GET_GRAPHICAL_PARAMS (61)
2734
  eax - SF_GET_GRAPHICAL_PARAMS (61)
2799
  ebx - SSF_SCREEN_SIZE (1), SSF_BITS_PER_PIXEL (2),
2735
  ebx - SSF_SCREEN_SIZE (1), SSF_BITS_PER_PIXEL (2),
2800
    SSF_BYTES_PER_LINE (3)
2736
    SSF_BYTES_PER_LINE (3)
2801
======================================================================
2737
======================================================================
2802
===== Function 62, subfunction 0 - get version of PCI-interface. =====
2738
===== Function 62, subfunction 0 - get version of PCI-interface. =====
2803
======================================================================
2739
======================================================================
2804
Parameters:
2740
Parameters:
2805
  * eax = 62 - function number
2741
  * eax = 62 - function number
2806
  * bl = 0 - subfunction number
2742
  * bl = 0 - subfunction number
2807
Returned value:
2743
Returned value:
2808
  * eax = -1 - PCI access is disabled; otherwise
2744
  * eax = -1 - PCI access is disabled; otherwise
2809
  * ah.al = version of PCI-interface (ah=version, al=subversion)
2745
  * ah.al = version of PCI-interface (ah=version, al=subversion)
2810
  * high word of eax is zeroed
2746
  * high word of eax is zeroed
2811
Remarks:
2747
Remarks:
2812
  * Previously low-level access to PCI for applications must be
2748
  * Previously low-level access to PCI for applications must be
2813
    enabled by subfunction 12 of function 21.
2749
    enabled by subfunction 12 of function 21.
2814
  * If PCI BIOS is not supported, the value of ax is undefined.
2750
  * If PCI BIOS is not supported, the value of ax is undefined.
2815
 
2751
 
2816
---------------------- Constants for registers: ----------------------
2752
---------------------- Constants for registers: ----------------------
2817
  eax - SF_PCI (62)
2753
  eax - SF_PCI (62)
2818
  ebx - SSF_GET_VERSION (0)
2754
  ebx - SSF_GET_VERSION (0)
2819
======================================================================
2755
======================================================================
2820
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
2756
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
2821
======================================================================
2757
======================================================================
2822
Parameters:
2758
Parameters:
2823
  * eax = 62 - function number
2759
  * eax = 62 - function number
2824
  * bl = 1 - subfunction number
2760
  * bl = 1 - subfunction number
2825
Returned value:
2761
Returned value:
2826
  * eax = -1 - access to PCI is disabled; otherwise
2762
  * eax = -1 - access to PCI is disabled; otherwise
2827
  * al = number of the last PCI-bus; other bytes of eax are destroyed
2763
  * al = number of the last PCI-bus; other bytes of eax are destroyed
2828
Remarks:
2764
Remarks:
2829
  * Previously low-level access to PCI for applications must be
2765
  * Previously low-level access to PCI for applications must be
2830
    enabled by subfunction 12 of function 21.
2766
    enabled by subfunction 12 of function 21.
2831
  * If PCI BIOS is not supported, the value of ax is undefined.
2767
  * If PCI BIOS is not supported, the value of ax is undefined.
2832
 
2768
 
2833
---------------------- Constants for registers: ----------------------
2769
---------------------- Constants for registers: ----------------------
2834
  eax - SF_PCI (62)
2770
  eax - SF_PCI (62)
2835
  ebx - SSF_GET_LAST_BUS (1)
2771
  ebx - SSF_GET_LAST_BUS (1)
2836
======================================================================
2772
======================================================================
2837
===================== Function 62, subfunction 2 =====================
2773
===================== Function 62, subfunction 2 =====================
2838
===== Get mechanism of addressing to the PCI configuration space. ====
2774
===== Get mechanism of addressing to the PCI configuration space. ====
2839
======================================================================
2775
======================================================================
2840
Parameters:
2776
Parameters:
2841
  * eax = 62 - function number
2777
  * eax = 62 - function number
2842
  * bl = 2 - subfunction number
2778
  * bl = 2 - subfunction number
2843
Returned value:
2779
Returned value:
2844
  * eax = -1 - access to PCI is disabled; otherwise
2780
  * eax = -1 - access to PCI is disabled; otherwise
2845
  * al = mechanism (1 or 2); other bytes of eax are destroyed
2781
  * al = mechanism (1 or 2); other bytes of eax are destroyed
2846
Remarks:
2782
Remarks:
2847
  * Previously low-level access to PCI for applications must be
2783
  * Previously low-level access to PCI for applications must be
2848
    enabled by subfunction 12 of function 21.
2784
    enabled by subfunction 12 of function 21.
2849
  * Addressing mechanism is selected depending on
2785
  * Addressing mechanism is selected depending on
2850
    equipment characteristics.
2786
    equipment characteristics.
2851
  * Subfunctions of read and write work automatically
2787
  * Subfunctions of read and write work automatically
2852
    with the selected mechanism.
2788
    with the selected mechanism.
2853
 
2789
 
2854
---------------------- Constants for registers: ----------------------
2790
---------------------- Constants for registers: ----------------------
2855
  eax - SF_PCI (62)
2791
  eax - SF_PCI (62)
2856
  ebx - SSF_GET_ADRR_MODE (2)
2792
  ebx - SSF_GET_ADRR_MODE (2)
2857
======================================================================
2793
======================================================================
2858
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
2794
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
2859
======================================================================
2795
======================================================================
2860
Parameters:
2796
Parameters:
2861
  * eax = 62 - function number
2797
  * eax = 62 - function number
2862
  * bl = 4 - read byte
2798
  * bl = 4 - read byte
2863
  * bl = 5 - read word
2799
  * bl = 5 - read word
2864
  * bl = 6 - read dword
2800
  * bl = 6 - read dword
2865
  * bh = number of PCI-bus
2801
  * bh = number of PCI-bus
2866
  * ch = dddddfff, where ddddd = number of the device on the bus,
2802
  * ch = dddddfff, where ddddd = number of the device on the bus,
2867
    fff = function number of device
2803
    fff = function number of device
2868
  * cl = number of register (must be even for bl=5,
2804
  * cl = number of register (must be even for bl=5,
2869
    divisible by 4 for bl=6)
2805
    divisible by 4 for bl=6)
2870
Returned value:
2806
Returned value:
2871
  * eax = -1 - error (access to PCI is disabled or parameters
2807
  * eax = -1 - error (access to PCI is disabled or parameters
2872
    are not supported); otherwise
2808
    are not supported); otherwise
2873
  * al/ax/eax (depending on requested size) contains the data;
2809
  * al/ax/eax (depending on requested size) contains the data;
2874
    the other part of register eax is destroyed
2810
    the other part of register eax is destroyed
2875
Remarks:
2811
Remarks:
2876
  * Previously low-level access to PCI for applications must be
2812
  * Previously low-level access to PCI for applications must be
2877
    enabled by subfunction 12 of function 21.
2813
    enabled by subfunction 12 of function 21.
2878
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2814
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2879
    function number. To get access mechanism use subfunction 2.
2815
    function number. To get access mechanism use subfunction 2.
2880
  * Some registers are standard and exist for all devices, some are
2816
  * Some registers are standard and exist for all devices, some are
2881
    defined by the concrete device. The list of registers of the
2817
    defined by the concrete device. The list of registers of the
2882
    first type can be found e.g. in famous
2818
    first type can be found e.g. in famous
2883
    Interrupt List by Ralf Brown
2819
    Interrupt List by Ralf Brown
2884
    (http://www.pobox.com/~ralf/files.html,
2820
    (http://www.pobox.com/~ralf/files.html,
2885
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
2821
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
2886
    registers of the second type must be listed
2822
    registers of the second type must be listed
2887
    in the device documentation.
2823
    in the device documentation.
2888
 
2824
 
2889
---------------------- Constants for registers: ----------------------
2825
---------------------- Constants for registers: ----------------------
2890
  eax - SF_PCI (62)
2826
  eax - SF_PCI (62)
2891
  ebx - SSF_READ_BYTE (4), SSF_READ_WORD (5), SSF_READ_DWORD (6)
2827
  ebx - SSF_READ_BYTE (4), SSF_READ_WORD (5), SSF_READ_DWORD (6)
2892
======================================================================
2828
======================================================================
2893
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
2829
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
2894
======================================================================
2830
======================================================================
2895
Parameters:
2831
Parameters:
2896
  * eax = 62 - function number
2832
  * eax = 62 - function number
2897
  * bl = 8 - write byte
2833
  * bl = 8 - write byte
2898
  * bl = 9 - write word
2834
  * bl = 9 - write word
2899
  * bl = 10 - write dword
2835
  * bl = 10 - write dword
2900
  * bh = number of PCI-bus
2836
  * bh = number of PCI-bus
2901
  * ch = dddddfff, where ddddd = number of the device on the bus,
2837
  * ch = dddddfff, where ddddd = number of the device on the bus,
2902
    fff = function number of device
2838
    fff = function number of device
2903
  * cl = number of register (must be even for bl=9,
2839
  * cl = number of register (must be even for bl=9,
2904
    divisible by 4 for bl=10)
2840
    divisible by 4 for bl=10)
2905
  * dl/dx/edx (depending on requested size) contains
2841
  * dl/dx/edx (depending on requested size) contains
2906
    the data to write
2842
    the data to write
2907
Returned value:
2843
Returned value:
2908
  * eax = -1 - error (access to PCI is disabled or parameters
2844
  * eax = -1 - error (access to PCI is disabled or parameters
2909
    are not supported)
2845
    are not supported)
2910
  * eax = 0 - success
2846
  * eax = 0 - success
2911
Remarks:
2847
Remarks:
2912
  * Previously low-level access to PCI for applications must be
2848
  * Previously low-level access to PCI for applications must be
2913
    enabled by subfunction 12 of function 21.
2849
    enabled by subfunction 12 of function 21.
2914
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2850
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2915
    function number. To get access mechanism use subfunction 2.
2851
    function number. To get access mechanism use subfunction 2.
2916
  * Some registers are standard and exist for all devices, some are
2852
  * Some registers are standard and exist for all devices, some are
2917
    defined by the concrete device. The list of registers of the
2853
    defined by the concrete device. The list of registers of the
2918
    first type can be found e.g. in famous Interrupt List by
2854
    first type can be found e.g. in famous Interrupt List by
2919
    Ralf Brown; registers of the second type must be listed
2855
    Ralf Brown; registers of the second type must be listed
2920
    in the device documentation.
2856
    in the device documentation.
2921
 
2857
 
2922
---------------------- Constants for registers: ----------------------
2858
---------------------- Constants for registers: ----------------------
2923
  eax - SF_PCI (62)
2859
  eax - SF_PCI (62)
2924
  ebx - SSF_WRITE_BYTE (8), SSF_WRITE_WORD (9), SSF_WRITE_DWORD (10)
2860
  ebx - SSF_WRITE_BYTE (8), SSF_WRITE_WORD (9), SSF_WRITE_DWORD (10)
2925
======================================================================
2861
======================================================================
2926
============== Function 63 - work with the debug board. ==============
2862
============== Function 63 - work with the debug board. ==============
2927
======================================================================
2863
======================================================================
2928
The debug board is the global system buffer (with the size
2864
The debug board is the global system buffer (with the size
2929
1024 bytes), to which any program can write (generally speaking,
2865
1024 bytes), to which any program can write (generally speaking,
2930
arbitrary) data and from which other program can read these data.
2866
arbitrary) data and from which other program can read these data.
2931
By the agreement written data are text strings interpreted as
2867
By the agreement written data are text strings interpreted as
2932
debug messages on a course of program execution. The kernel in
2868
debug messages on a course of program execution. The kernel in
2933
some situations also writes to the debug board information on
2869
some situations also writes to the debug board information on
2934
execution of some functions; by the agreement kernel messages
2870
execution of some functions; by the agreement kernel messages
2935
begins from the prefix "K : ".
2871
begins from the prefix "K : ".
2936
For view of the debug board the application 'board' was created,
2872
For view of the debug board the application 'board' was created,
2937
which reads data from the buffer and displays them in its window.
2873
which reads data from the buffer and displays them in its window.
2938
'board' interpretes the sequence of codes 13,10 as newline.
2874
'board' interpretes the sequence of codes 13,10 as newline.
2939
A character with null code in an end of line is not necessary,
2875
A character with null code in an end of line is not necessary,
2940
but also does not prevent.
2876
but also does not prevent.
2941
Because debugger has been written, the value of the debug board
2877
Because debugger has been written, the value of the debug board
2942
has decreased, as debugger allows to inspect completely a course of
2878
has decreased, as debugger allows to inspect completely a course of
2943
program execution without any efforts from the direction of program
2879
program execution without any efforts from the direction of program
2944
itself. Nevertheless in some cases the debug board is still useful.
2880
itself. Nevertheless in some cases the debug board is still useful.
2945
 
2881
 
2946
----------------------------- Write byte -----------------------------
2882
----------------------------- Write byte -----------------------------
2947
Parameters:
2883
Parameters:
2948
  * eax = 63 - function number
2884
  * eax = 63 - function number
2949
  * ebx = 1 - subfunction number
2885
  * ebx = 1 - subfunction number
2950
  * cl = data byte
2886
  * cl = data byte
2951
Returned value:
2887
Returned value:
2952
  * function does not return value
2888
  * function does not return value
2953
Remarks:
2889
Remarks:
2954
  * Byte is written to the buffer. Buffer size is 512 bytes.
2890
  * Byte is written to the buffer. Buffer size is 512 bytes.
2955
    At buffer overflow all obtained data are lost.
2891
    At buffer overflow all obtained data are lost.
2956
  * For output to the debug board of more complicated objects
2892
  * For output to the debug board of more complicated objects
2957
    (strings, numbers) it is enough to call this function in cycle.
2893
    (strings, numbers) it is enough to call this function in cycle.
2958
    It is possible not to write the appropriate code manually and use
2894
    It is possible not to write the appropriate code manually and use
2959
    file 'debug.inc', which is included into the distributive.
2895
    file 'debug.inc', which is included into the distributive.
2960
 
2896
 
2961
----------------------------- Read byte ------------------------------
2897
----------------------------- Read byte ------------------------------
2962
Takes away byte from the buffer.
2898
Takes away byte from the buffer.
2963
Parameters:
2899
Parameters:
2964
  * eax = 63 - function number
2900
  * eax = 63 - function number
2965
  * ebx = 2 - subfunction number
2901
  * ebx = 2 - subfunction number
2966
Returned value:
2902
Returned value:
2967
  * eax = ebx = 0 - the buffer is empty
2903
  * eax = ebx = 0 - the buffer is empty
2968
  * eax = byte, ebx = 1 - byte was successfully read
2904
  * eax = byte, ebx = 1 - byte was successfully read
2969
 
2905
 
2970
---------------------- Constants for registers: ----------------------
2906
---------------------- Constants for registers: ----------------------
2971
  eax - SF_BOARD (63)
2907
  eax - SF_BOARD (63)
2972
  ebx - SSF_DEBUG_WRITE (1), SSF_DEBUG_READ (2)
2908
  ebx - SSF_DEBUG_WRITE (1), SSF_DEBUG_READ (2)
2973
======================================================================
2909
======================================================================
2974
============== Function 64 - resize application memory. ==============
2910
============== Function 64 - resize application memory. ==============
2975
======================================================================
2911
======================================================================
2976
 
2912
 
2977
!!! WARNING. This interface is outdated and should not be used !!!
2913
!!! WARNING. This interface is outdated and should not be used !!!
2978
 
2914
 
2979
Parameters:
2915
Parameters:
2980
  * eax = 64 - function number
2916
  * eax = 64 - function number
2981
  * ebx = 1 - unique subfunction
2917
  * ebx = 1 - unique subfunction
2982
  * ecx = new memory size
2918
  * ecx = new memory size
2983
Returned value:
2919
Returned value:
2984
  * eax = 0 - success
2920
  * eax = 0 - success
2985
  * eax = 1 - not enough memory
2921
  * eax = 1 - not enough memory
2986
Remarks:
2922
Remarks:
2987
  * There is another way to dynamically allocate/free memory -
2923
  * There is another way to dynamically allocate/free memory -
2988
    subfunctions 12, 13 and 20 of function 68, but after creation
2924
    subfunctions 12, 13 and 20 of function 68, but after creation
2989
    of the process heap 64 function call will be ignored.
2925
    of the process heap 64 function call will be ignored.
2990
  * The function cannot be used together with 68.11, 68.12, 68.13.
2926
  * The function cannot be used together with 68.11, 68.12, 68.13.
2991
    The function call will be ignored after creation of process heap
2927
    The function call will be ignored after creation of process heap
2992
    with function 68.11.
2928
    with function 68.11.
2993
        
2929
        
2994
---------------------- Constants for registers: ----------------------
2930
---------------------- Constants for registers: ----------------------
2995
  eax - SF_MEMORY_RESIZE (64)
2931
  eax - SF_MEMORY_RESIZE (64)
2996
======================================================================
2932
======================================================================
2997
======== Function 65 - draw image with palette in the window. ========
2933
======== Function 65 - draw image with palette in the window. ========
2998
======================================================================
2934
======================================================================
2999
Parameters:
2935
Parameters:
3000
  * eax = 65 - function number
2936
  * eax = 65 - function number
3001
  * ebx = pointer to the image
2937
  * ebx = pointer to the image
3002
  * ecx = [size on axis x]*65536 + [size on axis y]
2938
  * ecx = [size on axis x]*65536 + [size on axis y]
3003
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2939
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
3004
  * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
2940
  * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
3005
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
2941
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
3006
          ignored when esi > 8
2942
          ignored when esi > 8
3007
  * ebp = offset of next row data relative to previous row data
2943
  * ebp = offset of next row data relative to previous row data
3008
Returned value:
2944
Returned value:
3009
  * function does not return value
2945
  * function does not return value
3010
Remarks:
2946
Remarks:
3011
  * Coordinates of the image are coordinates of the upper left corner
2947
  * Coordinates of the image are coordinates of the upper left corner
3012
    of the image relative to the window.
2948
    of the image relative to the window.
3013
  * Format of image with 1 bit per pixel: each byte of image
2949
  * Format of image with 1 bit per pixel: each byte of image
3014
    (possibly excluding last bytes in rows), contains information on
2950
    (possibly excluding last bytes in rows), contains information on
3015
    the color of 8 pixels, MSB corresponds to first pixel.
2951
    the color of 8 pixels, MSB corresponds to first pixel.
3016
  * Format of image with 2 bits per pixel: each byte of image
2952
  * Format of image with 2 bits per pixel: each byte of image
3017
    (possibly excluding last bytes in rows), contains information on
2953
    (possibly excluding last bytes in rows), contains information on
3018
    the color of 4 pixels, two MSBs correspond to first pixel.
2954
    the color of 4 pixels, two MSBs correspond to first pixel.
3019
  * Format of image with 4 bits per pixel: each byte of image
2955
  * Format of image with 4 bits per pixel: each byte of image
3020
    excluding last bytes in rows (if width is odd) contains
2956
    excluding last bytes in rows (if width is odd) contains
3021
    information on the color of 2 pixels, high-order tetrad
2957
    information on the color of 2 pixels, high-order tetrad
3022
    corresponds to first pixel.
2958
    corresponds to first pixel.
3023
  * Format of image with 8 bits per pixel: each byte of image is
2959
  * Format of image with 8 bits per pixel: each byte of image is
3024
    index in the palette.
2960
    index in the palette.
3025
  * Format of image with 9 bits per pixel: array of one byte values;
2961
  * Format of image with 9 bits per pixel: array of one byte values;
3026
    each byte (8 bit) represents the intensity of gray for one pixel;
2962
    each byte (8 bit) represents the intensity of gray for one pixel;
3027
    this format is equal to 8bpp without palette.
2963
    this format is equal to 8bpp without palette.
3028
  * Format of image with 15 bits per pixel: the color of each pixel
2964
  * Format of image with 15 bits per pixel: the color of each pixel
3029
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
2965
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
3030
    each color.
2966
    each color.
3031
  * Format of image with 16 bits per pixel: the color of each pixel
2967
  * Format of image with 16 bits per pixel: the color of each pixel
3032
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
2968
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
3033
  * Format of image with 24 bits per pixel: the color of each pixel
2969
  * Format of image with 24 bits per pixel: the color of each pixel
3034
    is coded as 3 bytes - sequentially blue, green, red components.
2970
    is coded as 3 bytes - sequentially blue, green, red components.
3035
  * Format of image with 32 bits per pixel: similar to 24, but
2971
  * Format of image with 32 bits per pixel: similar to 24, but
3036
    one additional ignored byte is present. It's format is BGRX,
2972
    one additional ignored byte is present. It's format is BGRX,
3037
    where X is the ignored byte.
2973
    where X is the ignored byte.
3038
  * The call to function 7 is equivalent to call to this function
2974
  * The call to function 7 is equivalent to call to this function
3039
    with esi=24, ebp=0.
2975
    with esi=24, ebp=0.
3040
 
2976
 
3041
---------------------- Constants for registers: ----------------------
2977
---------------------- Constants for registers: ----------------------
3042
  eax - SF_PUT_IMAGE_EXT (65)
2978
  eax - SF_PUT_IMAGE_EXT (65)
3043
======================================================================
2979
======================================================================
3044
================== Function 66 - work with keyboard. =================
2980
================== Function 66 - work with keyboard. =================
3045
======================================================================
2981
======================================================================
3046
The input mode influences results of reading keys by function 2.
2982
The input mode influences results of reading keys by function 2.
3047
When a program loads, ASCII input mode is set for it.
2983
When a program loads, ASCII input mode is set for it.
3048
 
2984
 
3049
-------------- Subfunction 1 - set keyboard input mode. --------------
2985
-------------- Subfunction 1 - set keyboard input mode. --------------
3050
Parameters:
2986
Parameters:
3051
  * eax = 66 - function number
2987
  * eax = 66 - function number
3052
  * ebx = 1 - subfunction number
2988
  * ebx = 1 - subfunction number
3053
  * ecx = mode:
2989
  * ecx = mode:
3054
    * 0 = normal (ASCII-characters)
2990
    * 0 = normal (ASCII-characters)
3055
    * 1 = scancodes
2991
    * 1 = scancodes
3056
Returned value:
2992
Returned value:
3057
  * function does not return value
2993
  * function does not return value
3058
 
2994
 
3059
-------------- Subfunction 2 - get keyboard input mode. --------------
2995
-------------- Subfunction 2 - get keyboard input mode. --------------
3060
Parameters:
2996
Parameters:
3061
  * eax = 66 - function number
2997
  * eax = 66 - function number
3062
  * ebx = 2 - subfunction number
2998
  * ebx = 2 - subfunction number
3063
Returned value:
2999
Returned value:
3064
  * eax = current mode
3000
  * eax = current mode
3065
 
3001
 
3066
------------ Subfunction 3 - get status of control keys. -------------
3002
------------ Subfunction 3 - get status of control keys. -------------
3067
Parameters:
3003
Parameters:
3068
  * eax = 66 - function number
3004
  * eax = 66 - function number
3069
  * ebx = 3 - subfunction number
3005
  * ebx = 3 - subfunction number
3070
Returned value:
3006
Returned value:
3071
  * eax = bit mask:
3007
  * eax = bit mask:
3072
  * bit 0  (mask 1): left Shift is pressed
3008
  * bit 0  (mask 1): left Shift is pressed
3073
  * bit 1  (mask 2): right Shift is pressed
3009
  * bit 1  (mask 2): right Shift is pressed
3074
  * bit 2  (mask 4): left Ctrl is pressed
3010
  * bit 2  (mask 4): left Ctrl is pressed
3075
  * bit 3  (mask 8): right Ctrl is pressed
3011
  * bit 3  (mask 8): right Ctrl is pressed
3076
  * bit 4  (mask 0x10): left Alt is pressed
3012
  * bit 4  (mask 0x10): left Alt is pressed
3077
  * bit 5  (mask 0x20): right Alt is pressed
3013
  * bit 5  (mask 0x20): right Alt is pressed
3078
  * bit 6  (mask 0x40): CapsLock is on
3014
  * bit 6  (mask 0x40): CapsLock is on
3079
  * bit 7  (mask 0x80): NumLock is on
3015
  * bit 7  (mask 0x80): NumLock is on
3080
  * bit 8  (mask 0x100): ScrollLock is on
3016
  * bit 8  (mask 0x100): ScrollLock is on
3081
  * bit 9  (mask 0x200): left Win is pressed
3017
  * bit 9  (mask 0x200): left Win is pressed
3082
  * bit 10 (mask 0x400): right Win is pressed
3018
  * bit 10 (mask 0x400): right Win is pressed
3083
  * other bits are cleared
3019
  * other bits are cleared
3084
 
3020
 
3085
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3021
-------------- Subfunction 4 - set system-wide hotkey. ---------------
3086
When hotkey is pressed, the system notifies only those applications,
3022
When hotkey is pressed, the system notifies only those applications,
3087
which have installed it; the active application (which receives
3023
which have installed it; the active application (which receives
3088
all normal input) does not receive such keys.
3024
all normal input) does not receive such keys.
3089
The notification consists in sending event with the code 2.
3025
The notification consists in sending event with the code 2.
3090
Reading hotkey is the same as reading normal key - by function 2.
3026
Reading hotkey is the same as reading normal key - by function 2.
3091
Parameters:
3027
Parameters:
3092
  * eax = 66 - function number
3028
  * eax = 66 - function number
3093
  * ebx = 4 - subfunction number
3029
  * ebx = 4 - subfunction number
3094
  * cl determines key scancode;
3030
  * cl determines key scancode;
3095
    use cl=0 to give combinations such as Ctrl+Shift
3031
    use cl=0 to give combinations such as Ctrl+Shift
3096
  * edx = 0xXYZ determines possible states of control keys:
3032
  * edx = 0xXYZ determines possible states of control keys:
3097
    * Z (low 4 bits) determines state of LShift and RShift:
3033
    * Z (low 4 bits) determines state of LShift and RShift:
3098
      * 0 = no key must be pressed;
3034
      * 0 = no key must be pressed;
3099
      * 1 = exactly one key must be pressed;
3035
      * 1 = exactly one key must be pressed;
3100
      * 2 = both keys must be pressed;
3036
      * 2 = both keys must be pressed;
3101
      * 3 = must be pressed LShift, but not RShift;
3037
      * 3 = must be pressed LShift, but not RShift;
3102
      * 4 = must be pressed RShift, but not LShift
3038
      * 4 = must be pressed RShift, but not LShift
3103
    * Y - similar for LCtrl and RCtrl;
3039
    * Y - similar for LCtrl and RCtrl;
3104
    * X - similar for LAlt and RAlt
3040
    * X - similar for LAlt and RAlt
3105
Returned value:
3041
Returned value:
3106
  * eax=0 - success
3042
  * eax=0 - success
3107
  * eax=1 - too many hotkeys (maximum 256 are allowed)
3043
  * eax=1 - too many hotkeys (maximum 256 are allowed)
3108
Remarks:
3044
Remarks:
3109
  * Hotkey can work either at pressing or at release. Release
3045
  * Hotkey can work either at pressing or at release. Release
3110
    scancode of a key is more on 128 than pressing scancode
3046
    scancode of a key is more on 128 than pressing scancode
3111
    (i.e. high bit is set).
3047
    (i.e. high bit is set).
3112
  * Several applications can set the same combination;
3048
  * Several applications can set the same combination;
3113
    all such applications will be informed on pressing
3049
    all such applications will be informed on pressing
3114
    such combination.
3050
    such combination.
3115
 
3051
 
3116
-------------- Subfunction 5 - delete installed hotkey. --------------
3052
-------------- Subfunction 5 - delete installed hotkey. --------------
3117
Parameters:
3053
Parameters:
3118
  * eax = 66 - function number
3054
  * eax = 66 - function number
3119
  * ebx = 5 - subfunction number
3055
  * ebx = 5 - subfunction number
3120
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3056
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3121
Returned value:
3057
Returned value:
3122
  * eax = 0 - success
3058
  * eax = 0 - success
3123
  * eax = 1 - there is no such hotkey
3059
  * eax = 1 - there is no such hotkey
3124
Remarks:
3060
Remarks:
3125
  * When a process/thread terminates, all hotkey installed by it are
3061
  * When a process/thread terminates, all hotkey installed by it are
3126
    deleted.
3062
    deleted.
3127
  * The call to this subfunction does not affect other applications.
3063
  * The call to this subfunction does not affect other applications.
3128
    If other application has defined the same combination, it will
3064
    If other application has defined the same combination, it will
3129
    still receive notices.
3065
    still receive notices.
3130
 
3066
 
3131
--------------- Subfunction 6 - block the normal input. --------------
3067
--------------- Subfunction 6 - block the normal input. --------------
3132
Parameters:
3068
Parameters:
3133
  * eax = 66 - function number
3069
  * eax = 66 - function number
3134
  * ebx = 6 - subfunction number
3070
  * ebx = 6 - subfunction number
3135
Returned value:
3071
Returned value:
3136
  * function does not return value
3072
  * function does not return value
3137
Remarks:
3073
Remarks:
3138
  * Blocking the normal keyboard input for installed hotkeys
3074
  * Blocking the normal keyboard input for installed hotkeys
3139
  * To emulate a mouse via the keyboard, the application MOUSEMUL
3075
  * To emulate a mouse via the keyboard, the application MOUSEMUL
3140
 
3076
 
3141
------------ Subfunction 7 - unlock the normal input. ----------------
3077
------------ Subfunction 7 - unlock the normal input. ----------------
3142
Parameters:
3078
Parameters:
3143
  * eax = 66 - function number
3079
  * eax = 66 - function number
3144
  * ebx = 7 - subfunction number
3080
  * ebx = 7 - subfunction number
3145
Returned value:
3081
Returned value:
3146
  * function does not return value
3082
  * function does not return value
3147
Remarks:
3083
Remarks:
3148
  * Unlocking the results of the f. 66.6
3084
  * Unlocking the results of the f. 66.6
3149
  * To emulate a mouse via the keyboard, the application MOUSEMUL
3085
  * To emulate a mouse via the keyboard, the application MOUSEMUL
3150
 
3086
 
3151
---------------------- Constants for registers: ----------------------
3087
---------------------- Constants for registers: ----------------------
3152
  eax - SF_KEYBOARD (66)
3088
  eax - SF_KEYBOARD (66)
3153
  ebx - SSF_SET_INPUT_MODE (1), SSF_GET_INPUT_MODE (2),
3089
  ebx - SSF_SET_INPUT_MODE (1), SSF_GET_INPUT_MODE (2),
3154
    SSF_GET_CONTROL_KEYS (3), SSF_SET_SYS_HOTKEY (4),
3090
    SSF_GET_CONTROL_KEYS (3), SSF_SET_SYS_HOTKEY (4),
3155
    SSF_DEL_SYS_HOTKEY (5),  SSF_LOCK_INPUT (6), SSF_UNLOCK_INPUT (7)
3091
    SSF_DEL_SYS_HOTKEY (5),  SSF_LOCK_INPUT (6), SSF_UNLOCK_INPUT (7)
3156
======================================================================
3092
======================================================================
3157
========= Function 67 - change position/sizes of the window. =========
3093
========= Function 67 - change position/sizes of the window. =========
3158
======================================================================
3094
======================================================================
3159
Parameters:
3095
Parameters:
3160
  * eax = 67 - function number
3096
  * eax = 67 - function number
3161
  * ebx = new x-coordinate of the window
3097
  * ebx = new x-coordinate of the window
3162
  * ecx = new y-coordinate of the window
3098
  * ecx = new y-coordinate of the window
3163
  * edx = new x-size of the window
3099
  * edx = new x-size of the window
3164
  * esi = new y-size of the window
3100
  * esi = new y-size of the window
3165
Returned value:
3101
Returned value:
3166
  * function does not return value
3102
  * function does not return value
3167
Remarks:
3103
Remarks:
3168
  * The value -1 for a parameter means "do not change"; e.g. to move
3104
  * The value -1 for a parameter means "do not change"; e.g. to move
3169
    the window without resizing it is possible to specify edx=esi=-1.
3105
    the window without resizing it is possible to specify edx=esi=-1.
3170
  * Previously the window must be defined by function 0.
3106
  * Previously the window must be defined by function 0.
3171
    It sets initial coordinates and sizes of the window.
3107
    It sets initial coordinates and sizes of the window.
3172
  * Sizes of the window are understood in sense of function 0,
3108
  * Sizes of the window are understood in sense of function 0,
3173
    that is one pixel less than real sizes.
3109
    that is one pixel less than real sizes.
3174
  * The function call for maximized windows is simply ignored.
3110
  * The function call for maximized windows is simply ignored.
3175
  * For windows of appropriate styles position and/or sizes can be
3111
  * For windows of appropriate styles position and/or sizes can be
3176
    changed by user; current position and sizes can be obtained by
3112
    changed by user; current position and sizes can be obtained by
3177
    call to function 9.
3113
    call to function 9.
3178
  * The function sends to the window redraw event (with the code 1).
3114
  * The function sends to the window redraw event (with the code 1).
3179
 
3115
 
3180
---------------------- Constants for registers: ----------------------
3116
---------------------- Constants for registers: ----------------------
3181
  eax - SF_CHANGE_WINDOW (67)
3117
  eax - SF_CHANGE_WINDOW (67)
3182
======================================================================
3118
======================================================================
3183
====== Function 68, subfunction 0 - get the task switch counter. =====
3119
====== Function 68, subfunction 0 - get the task switch counter. =====
3184
======================================================================
3120
======================================================================
3185
Parameters:
3121
Parameters:
3186
  * eax = 68 - function number
3122
  * eax = 68 - function number
3187
  * ebx = 0 - subfunction number
3123
  * ebx = 0 - subfunction number
3188
Returned value:
3124
Returned value:
3189
  * eax = number of task switches from the system booting
3125
  * eax = number of task switches from the system booting
3190
    (modulo 2^32)
3126
    (modulo 2^32)
3191
 
3127
 
3192
---------------------- Constants for registers: ----------------------
3128
---------------------- Constants for registers: ----------------------
3193
  eax - SF_SYS_MISC (68)
3129
  eax - SF_SYS_MISC (68)
3194
  ebx - SSF_GET_TASK_SWITCH_COUNT (0)
3130
  ebx - SSF_GET_TASK_SWITCH_COUNT (0)
3195
======================================================================
3131
======================================================================
3196
======= Function 68, subfunction 1 - switch to the next thread. ======
3132
======= Function 68, subfunction 1 - switch to the next thread. ======
3197
======================================================================
3133
======================================================================
3198
The function completes the current time slice allocated to the
3134
The function completes the current time slice allocated to the
3199
thread and switches to the next. (Which thread in which process
3135
thread and switches to the next. (Which thread in which process
3200
will be next, is unpredictable). Later, when execution queue
3136
will be next, is unpredictable). Later, when execution queue
3201
will reach the current thread, execution will be continued.
3137
will reach the current thread, execution will be continued.
3202
Parameters:
3138
Parameters:
3203
  * eax = 68 - function number
3139
  * eax = 68 - function number
3204
  * ebx = 1 - subfunction number
3140
  * ebx = 1 - subfunction number
3205
Returned value:
3141
Returned value:
3206
  * function does not return value
3142
  * function does not return value
3207
 
3143
 
3208
---------------------- Constants for registers: ----------------------
3144
---------------------- Constants for registers: ----------------------
3209
  eax - SF_SYS_MISC (68)
3145
  eax - SF_SYS_MISC (68)
3210
  ebx - SSF_SWITCH_TASK (1)
3146
  ebx - SSF_SWITCH_TASK (1)
3211
======================================================================
3147
======================================================================
3212
============= Function 68, subfunction 2 - cache + rdpmc. ============
3148
============= Function 68, subfunction 2 - cache + rdpmc. ============
3213
======================================================================
3149
======================================================================
3214
Parameters:
3150
Parameters:
3215
  * eax = 68 - function number
3151
  * eax = 68 - function number
3216
  * ebx = 2 - subfunction number
3152
  * ebx = 2 - subfunction number
3217
  * ecx = required action:
3153
  * ecx = required action:
3218
    * ecx = 0 - enable instruction 'rdpmc'
3154
    * ecx = 0 - enable instruction 'rdpmc'
3219
      (ReaD Performance-Monitoring Counters) for applications
3155
      (ReaD Performance-Monitoring Counters) for applications
3220
    * ecx = 1 - find out whether cache is disabled/enabled
3156
    * ecx = 1 - find out whether cache is disabled/enabled
3221
    * ecx = 2 - enable cache
3157
    * ecx = 2 - enable cache
3222
    * ecx = 3 - disable cache
3158
    * ecx = 3 - disable cache
3223
Returned value:
3159
Returned value:
3224
  * for ecx=0:
3160
  * for ecx=0:
3225
    * eax = the value of cr4
3161
    * eax = the value of cr4
3226
  * for ecx=1:
3162
  * for ecx=1:
3227
    * eax = (cr0 and 0x60000000):
3163
    * eax = (cr0 and 0x60000000):
3228
    * eax = 0 - cache is on
3164
    * eax = 0 - cache is on
3229
    * eax <> 0 - cache is off
3165
    * eax <> 0 - cache is off
3230
  * for ecx=2 and ecx=3:
3166
  * for ecx=2 and ecx=3:
3231
    * function does not return value
3167
    * function does not return value
3232
 
3168
 
3233
---------------------- Constants for registers: ----------------------
3169
---------------------- Constants for registers: ----------------------
3234
  eax - SF_SYS_MISC (68)
3170
  eax - SF_SYS_MISC (68)
3235
  ebx - SSF_PERFORMANCE (2)
3171
  ebx - SSF_PERFORMANCE (2)
3236
  ecx - SSSF_ALLOW_RDPMC (0), SSSF_CACHE_STATUS (1),
3172
  ecx - SSSF_ALLOW_RDPMC (0), SSSF_CACHE_STATUS (1),
3237
    SSSF_CACHE_ON (2), SSSF_CACHE_OFF (3)
3173
    SSSF_CACHE_ON (2), SSSF_CACHE_OFF (3)
3238
======================================================================
3174
======================================================================
3239
=========== Function 68, subfunction 3 - read MSR-register. ==========
3175
=========== Function 68, subfunction 3 - read MSR-register. ==========
3240
======================================================================
3176
======================================================================
3241
MSR = Model Specific Register; the complete list of MSR-registers
3177
MSR = Model Specific Register; the complete list of MSR-registers
3242
of a processor is included to the documentation on it (for example,
3178
of a processor is included to the documentation on it (for example,
3243
IA-32 Intel Architecture Software Developer's Manual,
3179
IA-32 Intel Architecture Software Developer's Manual,
3244
Volume 3, Appendix B); each processor family has its own subset
3180
Volume 3, Appendix B); each processor family has its own subset
3245
of the MSR-registers.
3181
of the MSR-registers.
3246
Parameters:
3182
Parameters:
3247
  * eax = 68 - function number
3183
  * eax = 68 - function number
3248
  * ebx = 3 - subfunction number
3184
  * ebx = 3 - subfunction number
3249
  * ecx is ignored
3185
  * ecx is ignored
3250
  * edx = MSR address
3186
  * edx = MSR address
3251
Returned value:
3187
Returned value:
3252
  * ebx:eax = high:low dword of the result
3188
  * ebx:eax = high:low dword of the result
3253
Remarks:
3189
Remarks:
3254
  * If ecx contains nonexistent or not implemented for this processor
3190
  * If ecx contains nonexistent or not implemented for this processor
3255
    MSR, processor will generate an exception in the kernel, which
3191
    MSR, processor will generate an exception in the kernel, which
3256
    will kill the thread.
3192
    will kill the thread.
3257
  * Previously it is necessary to check, whether MSRs are supported
3193
  * Previously it is necessary to check, whether MSRs are supported
3258
    as a whole, with the instruction 'cpuid'. Otherwise processor
3194
    as a whole, with the instruction 'cpuid'. Otherwise processor
3259
    will generate other exception in the kernel, which will anyway
3195
    will generate other exception in the kernel, which will anyway
3260
    kill the thread.
3196
    kill the thread.
3261
 
3197
 
3262
---------------------- Constants for registers: ----------------------
3198
---------------------- Constants for registers: ----------------------
3263
  eax - SF_SYS_MISC (68)
3199
  eax - SF_SYS_MISC (68)
3264
  ebx - SSF_READ_MSR (3)
3200
  ebx - SSF_READ_MSR (3)
3265
======================================================================
3201
======================================================================
3266
========= Function 68, subfunction 4 - write to MSR-register. ========
3202
========= Function 68, subfunction 4 - write to MSR-register. ========
3267
======================================================================
3203
======================================================================
3268
MSR = Model Specific Register; the complete list of MSR-registers
3204
MSR = Model Specific Register; the complete list of MSR-registers
3269
of a processor is included to the documentation on it (for example,
3205
of a processor is included to the documentation on it (for example,
3270
IA-32 Intel Architecture Software Developer's Manual,
3206
IA-32 Intel Architecture Software Developer's Manual,
3271
Volume 3, Appendix B); each processor family has its own subset
3207
Volume 3, Appendix B); each processor family has its own subset
3272
of the MSR-registers.
3208
of the MSR-registers.
3273
Parameters:
3209
Parameters:
3274
  * eax = 68 - function number
3210
  * eax = 68 - function number
3275
  * ebx = 4 - subfunction number
3211
  * ebx = 4 - subfunction number
3276
  * ecx is ignored
3212
  * ecx is ignored
3277
  * edx = MSR address
3213
  * edx = MSR address
3278
  * esi:edi = high:low dword
3214
  * esi:edi = high:low dword
3279
Returned value:
3215
Returned value:
3280
  * function does not return value
3216
  * function does not return value
3281
Remarks:
3217
Remarks:
3282
  * If ecx contains nonexistent or not implemented for this processor
3218
  * If ecx contains nonexistent or not implemented for this processor
3283
    MSR, processor will generate an exception in the kernel, which
3219
    MSR, processor will generate an exception in the kernel, which
3284
    will kill the thread.
3220
    will kill the thread.
3285
  * Previously it is necessary to check, whether MSRs are supported
3221
  * Previously it is necessary to check, whether MSRs are supported
3286
    as a whole, with the instruction 'cpuid'. Otherwise processor
3222
    as a whole, with the instruction 'cpuid'. Otherwise processor
3287
    will generate other exception in the kernel, which will anyway
3223
    will generate other exception in the kernel, which will anyway
3288
    kill the thread.
3224
    kill the thread.
3289
 
3225
 
3290
---------------------- Constants for registers: ----------------------
3226
---------------------- Constants for registers: ----------------------
3291
  eax - SF_SYS_MISC (68)
3227
  eax - SF_SYS_MISC (68)
3292
  ebx - SSF_WRITE_MSR (4)
3228
  ebx - SSF_WRITE_MSR (4)
3293
======================================================================
3229
======================================================================
3294
=== Function 68, subfunction 11 - initialize process heap ============
3230
=== Function 68, subfunction 11 - initialize process heap ============
3295
======================================================================
3231
======================================================================
3296
Parameters:
3232
Parameters:
3297
  * eax = 68 - function number
3233
  * eax = 68 - function number
3298
  * ebx = 11 - subfunction number
3234
  * ebx = 11 - subfunction number
3299
Returned value:
3235
Returned value:
3300
  * eax = 0 - failed
3236
  * eax = 0 - failed
3301
  * otherwise size of created heap
3237
  * otherwise size of created heap
3302
Remarks:
3238
Remarks:
3303
  * The function call initializes heap for subfunctions 12, 13 and 20.
3239
  * The function call initializes heap for subfunctions 12, 13 and 20.
3304
  * If the process heap is already created, this function will return
3240
  * If the process heap is already created, this function will return
3305
    the size of the existing heap.
3241
    the size of the existing heap.
3306
    Heap size is equal to total amount of free application memory.
3242
    Heap size is equal to total amount of free application memory.
3307
  * After creation of the heap calls to function 64 will be ignored.
3243
  * After creation of the heap calls to function 64 will be ignored.
3308
 
3244
 
3309
---------------------- Constants for registers: ----------------------
3245
---------------------- Constants for registers: ----------------------
3310
  eax - SF_SYS_MISC (68)
3246
  eax - SF_SYS_MISC (68)
3311
  ebx - SSF_HEAP_INIT (11)
3247
  ebx - SSF_HEAP_INIT (11)
3312
======================================================================
3248
======================================================================
3313
======== Function 68, subfunction 12 - allocate memory block. ========
3249
======== Function 68, subfunction 12 - allocate memory block. ========
3314
======================================================================
3250
======================================================================
3315
Parameters:
3251
Parameters:
3316
  * eax = 68 - function number
3252
  * eax = 68 - function number
3317
  * ebx = 12 - subfunction number
3253
  * ebx = 12 - subfunction number
3318
  * ecx = required size in bytes
3254
  * ecx = required size in bytes
3319
Returned value:
3255
Returned value:
3320
  * eax = pointer to the allocated block
3256
  * eax = pointer to the allocated block
3321
Remarks:
3257
Remarks:
3322
  * The function allocates an integer number of pages (4 Kb) in such
3258
  * The function allocates an integer number of pages (4 Kb) in such
3323
    way that the real size of allocated block is more than or equal to
3259
    way that the real size of allocated block is more than or equal to
3324
    requested size.
3260
    requested size.
3325
 
3261
 
3326
---------------------- Constants for registers: ----------------------
3262
---------------------- Constants for registers: ----------------------
3327
  eax - SF_SYS_MISC (68)
3263
  eax - SF_SYS_MISC (68)
3328
  ebx - SSF_MEM_ALLOC (12)
3264
  ebx - SSF_MEM_ALLOC (12)
3329
======================================================================
3265
======================================================================
3330
========== Function 68, subfunction 13 - free memory block. ==========
3266
========== Function 68, subfunction 13 - free memory block. ==========
3331
======================================================================
3267
======================================================================
3332
Parameters:
3268
Parameters:
3333
  * eax = 68 - function number
3269
  * eax = 68 - function number
3334
  * ebx = 13 - subfunction number
3270
  * ebx = 13 - subfunction number
3335
  * ecx = pointer to the memory block
3271
  * ecx = pointer to the memory block
3336
Returned value:
3272
Returned value:
3337
  * eax = 1 - success
3273
  * eax = 1 - success
3338
  * eax = 0 - failed
3274
  * eax = 0 - failed
3339
Remarks:
3275
Remarks:
3340
  * The memory block must have been allocated by subfunction 12
3276
  * The memory block must have been allocated by subfunction 12
3341
    or subfunction 20.
3277
    or subfunction 20.
3342
 
3278
 
3343
---------------------- Constants for registers: ----------------------
3279
---------------------- Constants for registers: ----------------------
3344
  eax - SF_SYS_MISC (68)
3280
  eax - SF_SYS_MISC (68)
3345
  ebx - SSF_MEM_FREE (13)
3281
  ebx - SSF_MEM_FREE (13)
3346
======================================================================
3282
======================================================================
3347
===================== Function 68, subfunction 14 ====================
3283
===================== Function 68, subfunction 14 ====================
3348
============ Wait for signal from another program/driver. ============
3284
============ Wait for signal from another program/driver. ============
3349
======================================================================
3285
======================================================================
3350
Parameters:
3286
Parameters:
3351
  * eax = 68 - function number
3287
  * eax = 68 - function number
3352
  * ebx = 14 - subfunction number
3288
  * ebx = 14 - subfunction number
3353
  * ecx = pointer to the buffer for information (24 bytes)
3289
  * ecx = pointer to the buffer for information (24 bytes)
3354
Returned value:
3290
Returned value:
3355
  * buffer pointed to by ecx contains the following information:
3291
  * buffer pointed to by ecx contains the following information:
3356
    * +0: dword: identifier for following data of signal
3292
    * +0: dword: identifier for following data of signal
3357
    * +4: dword: data of signal (20 bytes), format of which is defined
3293
    * +4: dword: data of signal (20 bytes), format of which is defined
3358
          by the first dword
3294
          by the first dword
3359
 
3295
 
3360
---------------------- Constants for registers: ----------------------
3296
---------------------- Constants for registers: ----------------------
3361
  eax - SF_SYS_MISC (68)
3297
  eax - SF_SYS_MISC (68)
3362
  ebx - SSF_WAIT_SIGNAL (14)
3298
  ebx - SSF_WAIT_SIGNAL (14)
3363
======================================================================
3299
======================================================================
3364
============= Function 68, subfunction 16 - load driver. =============
3300
============= Function 68, subfunction 16 - load driver. =============
3365
======================================================================
3301
======================================================================
3366
Parameters:
3302
Parameters:
3367
  * eax = 68 - function number
3303
  * eax = 68 - function number
3368
  * ebx = 16 - subfunction number
3304
  * ebx = 16 - subfunction number
3369
  * ecx = pointer to ASCIIZ-string with driver name
3305
  * ecx = pointer to ASCIIZ-string with driver name
3370
Returned value:
3306
Returned value:
3371
  * eax = 0 - failed
3307
  * eax = 0 - failed
3372
  * otherwise eax = driver handle
3308
  * otherwise eax = driver handle
3373
Remarks:
3309
Remarks:
3374
  * If the driver was not loaded yet, it is loaded;
3310
  * If the driver was not loaded yet, it is loaded;
3375
    if the driver was loaded yet, nothing happens.
3311
    if the driver was loaded yet, nothing happens.
3376
  * Driver name is case-sensitive.
3312
  * Driver name is case-sensitive.
3377
    Maximum length of the name is 16 characters, including
3313
    Maximum length of the name is 16 characters, including
3378
    terminating null character, the rest is ignored.
3314
    terminating null character, the rest is ignored.
3379
  * Driver ABC is loaded from file /sys/drivers/ABC.sys.
3315
  * Driver ABC is loaded from file /sys/drivers/ABC.sys.
3380
 
3316
 
3381
---------------------- Constants for registers: ----------------------
3317
---------------------- Constants for registers: ----------------------
3382
  eax - SF_SYS_MISC (68)
3318
  eax - SF_SYS_MISC (68)
3383
  ebx - SSF_LOAD_DRIVER (16)
3319
  ebx - SSF_LOAD_DRIVER (16)
3384
======================================================================
3320
======================================================================
3385
============ Function 68, subfunction 17 - driver control. ===========
3321
============ Function 68, subfunction 17 - driver control. ===========
3386
======================================================================
3322
======================================================================
3387
Parameters:
3323
Parameters:
3388
  * eax = 68 - function number
3324
  * eax = 68 - function number
3389
  * ebx = 17 - subfunction number
3325
  * ebx = 17 - subfunction number
3390
  * ecx = pointer to the control structure:
3326
  * ecx = pointer to the control structure:
3391
    * +0: dword: handle of driver
3327
    * +0: dword: handle of driver
3392
    * +4: dword: code of driver function
3328
    * +4: dword: code of driver function
3393
    * +8: dword: pointer to input data
3329
    * +8: dword: pointer to input data
3394
    * +12 = +0xC: dword: size of input data
3330
    * +12 = +0xC: dword: size of input data
3395
    * +16 = +0x10: dword: pointer to output data
3331
    * +16 = +0x10: dword: pointer to output data
3396
    * +20 = +0x14: dword: size of output data
3332
    * +20 = +0x14: dword: size of output data
3397
Returned value:
3333
Returned value:
3398
  * eax = determined by driver
3334
  * eax = determined by driver
3399
Remarks:
3335
Remarks:
3400
  * Function codes and the structure of input/output data
3336
  * Function codes and the structure of input/output data
3401
    are defined by driver.
3337
    are defined by driver.
3402
  * Previously one must obtain driver handle by subfunction 16.
3338
  * Previously one must obtain driver handle by subfunction 16.
3403
 
3339
 
3404
---------------------- Constants for registers: ----------------------
3340
---------------------- Constants for registers: ----------------------
3405
  eax - SF_SYS_MISC (68)
3341
  eax - SF_SYS_MISC (68)
3406
  ebx - SSF_CONTROL_DRIVER (17)
3342
  ebx - SSF_CONTROL_DRIVER (17)
3407
======================================================================
3343
======================================================================
3408
== Function 68, subfunction 18 - load DLL, specifying the encoding. ==
3344
== Function 68, subfunction 18 - load DLL, specifying the encoding. ==
3409
======================================================================
3345
======================================================================
3410
Parameters:
3346
Parameters:
3411
  * eax = 68 - function number
3347
  * eax = 68 - function number
3412
  * ebx = 18 - subfunction number
3348
  * ebx = 18 - subfunction number
3413
  * ecx = pointer to the string with path to DLL
3349
  * ecx = pointer to the string with path to DLL
3414
  * edx = string encoding, details can be found in function 80 description.
3350
  * edx = string encoding, details can be found in function 80 description.
3415
Returned value:
3351
Returned value:
3416
  * eax = 0 - failed
3352
  * eax = 0 - failed
3417
  * otherwise eax = pointer to DLL export table
3353
  * otherwise eax = pointer to DLL export table
3418
Remarks:
3354
Remarks:
3419
  * Export table is an array of structures of 2 dword's, terminated
3355
  * Export table is an array of structures of 2 dword's, terminated
3420
    by zero. The first dword in structure points to function name,
3356
    by zero. The first dword in structure points to function name,
3421
    the second dword contains address of function.
3357
    the second dword contains address of function.
3422
 
3358
 
3423
======================================================================
3359
======================================================================
3424
=============== Function 68, subfunction 19 - load DLL. ==============
3360
=============== Function 68, subfunction 19 - load DLL. ==============
3425
======================================================================
3361
======================================================================
3426
Parameters:
3362
Parameters:
3427
  * eax = 68 - function number
3363
  * eax = 68 - function number
3428
  * ebx = 19 - subfunction number
3364
  * ebx = 19 - subfunction number
3429
  * ecx = pointer to the string with path to DLL,
3365
  * ecx = pointer to the string with path to DLL,
3430
    rules of path forming can be found in function 70 description.
3366
    rules of path forming can be found in function 70 description.
3431
Returned value:
3367
Returned value:
3432
  * eax = 0 - failed
3368
  * eax = 0 - failed
3433
  * otherwise eax = pointer to DLL export table
3369
  * otherwise eax = pointer to DLL export table
3434
 
3370
 
3435
---------------------- Constants for registers: ----------------------
3371
---------------------- Constants for registers: ----------------------
3436
  eax - SF_SYS_MISC (68)
3372
  eax - SF_SYS_MISC (68)
3437
  ebx - SSF_LOAD_DLL (19)
3373
  ebx - SSF_LOAD_DLL (19)
3438
======================================================================
3374
======================================================================
3439
======= Function 68, subfunction 20 - reallocate memory block. =======
3375
======= Function 68, subfunction 20 - reallocate memory block. =======
3440
======================================================================
3376
======================================================================
3441
Parameters:
3377
Parameters:
3442
  * eax = 68 - function number
3378
  * eax = 68 - function number
3443
  * ebx = 20 - subfunction number
3379
  * ebx = 20 - subfunction number
3444
  * ecx = new size in bytes
3380
  * ecx = new size in bytes
3445
  * edx = pointer to already allocated block
3381
  * edx = pointer to already allocated block
3446
Returned value:
3382
Returned value:
3447
  * eax = pointer to the reallocated block, 0 = error
3383
  * eax = pointer to the reallocated block, 0 = error
3448
Remarks:
3384
Remarks:
3449
  * Before this call one must initialize process heap by call to
3385
  * Before this call one must initialize process heap by call to
3450
    subfunction 11.
3386
    subfunction 11.
3451
  * The function allocates an integer number of pages (4 Kb) in such
3387
  * The function allocates an integer number of pages (4 Kb) in such
3452
    way that the real size of allocated block is more than or equal to
3388
    way that the real size of allocated block is more than or equal to
3453
    requested size.
3389
    requested size.
3454
  * If edx=0, the function call is equivalent to memory allocation
3390
  * If edx=0, the function call is equivalent to memory allocation
3455
    with subfunction 12. Otherwise the block at edx
3391
    with subfunction 12. Otherwise the block at edx
3456
    must be allocated earlier with subfunction 12 or this subfunction.
3392
    must be allocated earlier with subfunction 12 or this subfunction.
3457
  * If ecx=0, the function frees memory block at edx and returns 0.
3393
  * If ecx=0, the function frees memory block at edx and returns 0.
3458
  * The contents of the block are unchanged up to the shorter of
3394
  * The contents of the block are unchanged up to the shorter of
3459
    the new and old sizes.
3395
    the new and old sizes.
3460
 
3396
 
3461
---------------------- Constants for registers: ----------------------
3397
---------------------- Constants for registers: ----------------------
3462
  eax - SF_SYS_MISC (68)
3398
  eax - SF_SYS_MISC (68)
3463
  ebx - SSF_MEM_REALLOC (20)
3399
  ebx - SSF_MEM_REALLOC (20)
3464
======================================================================
3400
======================================================================
3465
=========== Function 68, subfunction 21 - load driver PE. ============
3401
=========== Function 68, subfunction 21 - load driver PE. ============
3466
======================================================================
3402
======================================================================
3467
Parameters:
3403
Parameters:
3468
  * eax = 68 - function number
3404
  * eax = 68 - function number
3469
  * ebx = 21 - subfunction number
3405
  * ebx = 21 - subfunction number
3470
  * ecx = pointer to ASCIIZ-string with driver name
3406
  * ecx = pointer to ASCIIZ-string with driver name
3471
  * edx = pointer to command line
3407
  * edx = pointer to command line
3472
Returned value:
3408
Returned value:
3473
  * eax = 0 - failed
3409
  * eax = 0 - failed
3474
  * otherwise eax = driver handle
3410
  * otherwise eax = driver handle
3475
Remarks:
3411
Remarks:
3476
  * If the driver was not loaded yet, it is loaded;
3412
  * If the driver was not loaded yet, it is loaded;
3477
    if the driver was loaded yet, nothing happens.
3413
    if the driver was loaded yet, nothing happens.
3478
 
3414
 
3479
---------------------- Constants for registers: ----------------------
3415
---------------------- Constants for registers: ----------------------
3480
  eax - SF_SYS_MISC (68)
3416
  eax - SF_SYS_MISC (68)
3481
  ebx - SSF_LOAD_DRIVER_PE (21)
3417
  ebx - SSF_LOAD_DRIVER_PE (21)
3482
======================================================================
3418
======================================================================
3483
======== Function 68, subfunction 22 - open named memory area. =======
3419
======== Function 68, subfunction 22 - open named memory area. =======
3484
======================================================================
3420
======================================================================
3485
Parameters:
3421
Parameters:
3486
  * eax = 68 - function number
3422
  * eax = 68 - function number
3487
  * ebx = 22 - subfunction number
3423
  * ebx = 22 - subfunction number
3488
  * ecx = area name. Maximum of 31 characters with terminating zero
3424
  * ecx = area name. Maximum of 31 characters with terminating zero
3489
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3425
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3490
  * esi = flags for open and access:
3426
  * esi = flags for open and access:
3491
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3427
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3492
                          with such name does not exist, the function
3428
                          with such name does not exist, the function
3493
                          will return error code 5.
3429
                          will return error code 5.
3494
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3430
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3495
                          memory area.
3431
                          memory area.
3496
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3432
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3497
                          with such name already exists, the function
3433
                          with such name already exists, the function
3498
                          will return error code 10.
3434
                          will return error code 10.
3499
    * SHM_READ        = 0x00 - only read access
3435
    * SHM_READ        = 0x00 - only read access
3500
    * SHM_WRITE       = 0x01 - read and write access
3436
    * SHM_WRITE       = 0x01 - read and write access
3501
Returned value:
3437
Returned value:
3502
  * eax = pointer to memory area, 0 if error has occurred
3438
  * eax = pointer to memory area, 0 if error has occurred
3503
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3439
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3504
    edx = 0 - success, otherwise - error code
3440
    edx = 0 - success, otherwise - error code
3505
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3441
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3506
    edx = error code (if eax=0) or area size in bytes
3442
    edx = error code (if eax=0) or area size in bytes
3507
Error codes:
3443
Error codes:
3508
  * E_NOTFOUND = 5
3444
  * E_NOTFOUND = 5
3509
  * E_ACCESS = 10
3445
  * E_ACCESS = 10
3510
  * E_NOMEM = 30
3446
  * E_NOMEM = 30
3511
  * E_PARAM = 33
3447
  * E_PARAM = 33
3512
Remarks:
3448
Remarks:
3513
  * Before this call one must initialize process heap by call to
3449
  * Before this call one must initialize process heap by call to
3514
    subfunction 11.
3450
    subfunction 11.
3515
  * If a new area is created, access flags set maximal rights
3451
  * If a new area is created, access flags set maximal rights
3516
    for other processes. An attempt from other process to open
3452
    for other processes. An attempt from other process to open
3517
    with denied rights will fail with error code E_ACCESS.
3453
    with denied rights will fail with error code E_ACCESS.
3518
  * The process which has created an area always has write access.
3454
  * The process which has created an area always has write access.
3519
 
3455
 
3520
---------------------- Constants for registers: ----------------------
3456
---------------------- Constants for registers: ----------------------
3521
  eax - SF_SYS_MISC (68)
3457
  eax - SF_SYS_MISC (68)
3522
  ebx - SSF_MEM_OPEN (22)
3458
  ebx - SSF_MEM_OPEN (22)
3523
======================================================================
3459
======================================================================
3524
======= Function 68, subfunction 23 - close named memory area. =======
3460
======= Function 68, subfunction 23 - close named memory area. =======
3525
======================================================================
3461
======================================================================
3526
Parameters:
3462
Parameters:
3527
  * eax = 68 - function number
3463
  * eax = 68 - function number
3528
  * ebx = 23 - subfunction number
3464
  * ebx = 23 - subfunction number
3529
  * ecx = area name. Maximum of 31 characters with terminating zero
3465
  * ecx = area name. Maximum of 31 characters with terminating zero
3530
Returned value:
3466
Returned value:
3531
  * eax destroyed
3467
  * eax destroyed
3532
Remarks:
3468
Remarks:
3533
  * A memory area is physically freed (with deleting all data and
3469
  * A memory area is physically freed (with deleting all data and
3534
    freeing physical memory), when all threads which have opened
3470
    freeing physical memory), when all threads which have opened
3535
    this area will close it.
3471
    this area will close it.
3536
  * When thread is terminating, all opened by it areas are closed.
3472
  * When thread is terminating, all opened by it areas are closed.
3537
 
3473
 
3538
---------------------- Constants for registers: ----------------------
3474
---------------------- Constants for registers: ----------------------
3539
  eax - SF_SYS_MISC (68)
3475
  eax - SF_SYS_MISC (68)
3540
  ebx - SSF_MEM_CLOSE (23)
3476
  ebx - SSF_MEM_CLOSE (23)
3541
======================================================================
3477
======================================================================
3542
======== Function 68, subfunction 24 - set exception handler. ========
3478
======== Function 68, subfunction 24 - set exception handler. ========
3543
======================================================================
3479
======================================================================
3544
Parameters:
3480
Parameters:
3545
  * eax = 68 - function number
3481
  * eax = 68 - function number
3546
  * ebx = 24 - subfunction number
3482
  * ebx = 24 - subfunction number
3547
  * ecx = address of the new exception handler
3483
  * ecx = address of the new exception handler
3548
  * edx = the mask of handled exceptions
3484
  * edx = the mask of handled exceptions
3549
Returned value:
3485
Returned value:
3550
  * eax = address of the old exception handler (0, if it was not set)
3486
  * eax = address of the old exception handler (0, if it was not set)
3551
  * ebx = the old mask of handled exceptions
3487
  * ebx = the old mask of handled exceptions
3552
Remarks:
3488
Remarks:
3553
  * Bit number in mask of exceptions corresponds to exception number
3489
  * Bit number in mask of exceptions corresponds to exception number
3554
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3490
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3555
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3491
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3556
  * The current implementation ignores the inquiry for hook of 7
3492
  * The current implementation ignores the inquiry for hook of 7
3557
    exception - the system handles #NM by its own.
3493
    exception - the system handles #NM by its own.
3558
  * The exception handler is called with exception number as first
3494
  * The exception handler is called with exception number as first
3559
    (and only) stack parameter. So, correct exit from the handler is
3495
    (and only) stack parameter. So, correct exit from the handler is
3560
    RET 4. It returns to the instruction, that caused the exception,
3496
    RET 4. It returns to the instruction, that caused the exception,
3561
    for faults, and to the next instruction for traps (see
3497
    for faults, and to the next instruction for traps (see
3562
    classification of exceptions in CPU specification).
3498
    classification of exceptions in CPU specification).
3563
  * When user handler receives control, the corresponding bit in
3499
  * When user handler receives control, the corresponding bit in
3564
    the exception mask is cleared. Raising this exception
3500
    the exception mask is cleared. Raising this exception
3565
    in consequence leads to default handling, that is,
3501
    in consequence leads to default handling, that is,
3566
    terminating the application in absence of debugger or
3502
    terminating the application in absence of debugger or
3567
    suspend with notification of debugger otherwise.
3503
    suspend with notification of debugger otherwise.
3568
  * After user handler completes critical operations, it can set
3504
  * After user handler completes critical operations, it can set
3569
    the corresponding bit in the exception mask with subfunction 25.
3505
    the corresponding bit in the exception mask with subfunction 25.
3570
    Also user handler is responsible for clearing exceptions flags in
3506
    Also user handler is responsible for clearing exceptions flags in
3571
    FPU and/or SSE.
3507
    FPU and/or SSE.
3572
 
3508
 
3573
---------------------- Constants for registers: ----------------------
3509
---------------------- Constants for registers: ----------------------
3574
  eax - SF_SYS_MISC (68)
3510
  eax - SF_SYS_MISC (68)
3575
  ebx - SSF_SET_EXCEPTION_HANDLER (24)
3511
  ebx - SSF_SET_EXCEPTION_HANDLER (24)
3576
======================================================================
3512
======================================================================
3577
======== Function 68, subfunction 25 - set exception activity ========
3513
======== Function 68, subfunction 25 - set exception activity ========
3578
======================================================================
3514
======================================================================
3579
Parameters:
3515
Parameters:
3580
  * eax = 68 - function number
3516
  * eax = 68 - function number
3581
  * ebx = 25 - subfunction number
3517
  * ebx = 25 - subfunction number
3582
  * ecx = signal number
3518
  * ecx = signal number
3583
  * edx = value of activity (0/1)
3519
  * edx = value of activity (0/1)
3584
Returned value:
3520
Returned value:
3585
  * eax = -1 - invalid signal number
3521
  * eax = -1 - invalid signal number
3586
  * otherwise eax = old value of activity for this signal (0/1)
3522
  * otherwise eax = old value of activity for this signal (0/1)
3587
Remarks:
3523
Remarks:
3588
  * In current implementation only mask for user exception handler,
3524
  * In current implementation only mask for user exception handler,
3589
    which has been previously set by subfunction 24,
3525
    which has been previously set by subfunction 24,
3590
    is changed. Signal number corresponds to exception number.
3526
    is changed. Signal number corresponds to exception number.
3591
 
3527
 
3592
---------------------- Constants for registers: ----------------------
3528
---------------------- Constants for registers: ----------------------
3593
  eax - SF_SYS_MISC (68)
3529
  eax - SF_SYS_MISC (68)
3594
  ebx - SSF_SET_EXCEPTION_STATE (25)
3530
  ebx - SSF_SET_EXCEPTION_STATE (25)
3595
======================================================================
3531
======================================================================
3596
====== Function 68, subfunction 26 - release memory pages ============
3532
====== Function 68, subfunction 26 - release memory pages ============
3597
======================================================================
3533
======================================================================
3598
Parameters:
3534
Parameters:
3599
  * eax = 68 - function number
3535
  * eax = 68 - function number
3600
  * ebx = 26 - subfunction number
3536
  * ebx = 26 - subfunction number
3601
  * ecx = pointer to the memory block, allocated by subfunction 12
3537
  * ecx = pointer to the memory block, allocated by subfunction 12
3602
  * edx = offset from the block beginnings
3538
  * edx = offset from the block beginnings
3603
  * esi = the size of the region of memory to release, in bytes
3539
  * esi = the size of the region of memory to release, in bytes
3604
Remarks:
3540
Remarks:
3605
  * function release range of pages from ecx+edx to ecx+edx+esi
3541
  * function release range of pages from ecx+edx to ecx+edx+esi
3606
    and set virtual memory into reserved state.
3542
    and set virtual memory into reserved state.
3607
 
3543
 
3608
---------------------- Constants for registers: ----------------------
3544
---------------------- Constants for registers: ----------------------
3609
  eax - SF_SYS_MISC (68)
3545
  eax - SF_SYS_MISC (68)
3610
  ebx - SSF_MEM_FREE_EXT (26)
3546
  ebx - SSF_MEM_FREE_EXT (26)
3611
======================================================================
3547
======================================================================
3612
========== Function 68, subfunction 27 - load file ===================
3548
========== Function 68, subfunction 27 - load file ===================
3613
======================================================================
3549
======================================================================
3614
Parameters:
3550
Parameters:
3615
  * eax = 68 - function number
3551
  * eax = 68 - function number
3616
  * ebx = 27 - subfunction number
3552
  * ebx = 27 - subfunction number
3617
  * ecx = pointer to the string with path to file,
3553
  * ecx = pointer to the string with path to file,
3618
    rules of path forming can be found in function 70 description.
3554
    rules of path forming can be found in function 70 description.
3619
Returned value:
3555
Returned value:
3620
  * eax = pointer to the loaded file, or zero
3556
  * eax = pointer to the loaded file, or zero
3621
  * edx = size of the loaded file, or zero
3557
  * edx = size of the loaded file, or zero
3622
Remarks:
3558
Remarks:
3623
  * function loads file and unpacks, if necessary
3559
  * function loads file and unpacks, if necessary
3624
  * Before this call one must initialize process heap by call to
3560
  * Before this call one must initialize process heap by call to
3625
    subfunction 11.  
3561
    subfunction 11.  
3626
 
3562
 
3627
---------------------- Constants for registers: ----------------------
3563
---------------------- Constants for registers: ----------------------
3628
  eax - SF_SYS_MISC (68)
3564
  eax - SF_SYS_MISC (68)
3629
  ebx - SSF_LOAD_FILE (27)
3565
  ebx - SSF_LOAD_FILE (27)
3630
======================================================================
3566
======================================================================
3631
== Function 68, subfunction 28 - load file, specifying the encoding ==
3567
== Function 68, subfunction 28 - load file, specifying the encoding ==
3632
======================================================================
3568
======================================================================
3633
Parameters:
3569
Parameters:
3634
  * eax = 68 - function number
3570
  * eax = 68 - function number
3635
  * ebx = 28 - subfunction number
3571
  * ebx = 28 - subfunction number
3636
  * ecx = pointer to the string with path to file
3572
  * ecx = pointer to the string with path to file
3637
  * edx = string encoding, details can be found in function 80 description.
3573
  * edx = string encoding, details can be found in function 80 description.
3638
Returned value:
3574
Returned value:
3639
  * eax = pointer to the loaded file, or zero
3575
  * eax = pointer to the loaded file, or zero
3640
  * edx = size of the loaded file, or zero
3576
  * edx = size of the loaded file, or zero
3641
Remarks:
3577
Remarks:
3642
  * function loads file and unpacks, if necessary
3578
  * function loads file and unpacks, if necessary
3643
======================================================================
3579
======================================================================
3644
======== Function 68, subfunction 29 - allocate ring memory. =========
3580
======== Function 68, subfunction 29 - allocate ring memory. =========
3645
======================================================================
3581
======================================================================
3646
Parameters:
3582
Parameters:
3647
  * eax = 68 - function number
3583
  * eax = 68 - function number
3648
  * ebx = 29 - subfunction number
3584
  * ebx = 29 - subfunction number
3649
  * ecx = required size in bytes
3585
  * ecx = required size in bytes
3650
Returned value:
3586
Returned value:
3651
  * eax = 0 - failed
3587
  * eax = 0 - failed
3652
  * eax = pointer to the allocated ring
3588
  * eax = pointer to the allocated ring
3653
Remarks:
3589
Remarks:
3654
  * The requested size must be an exact multiple of pagesize (4 Kb)
3590
  * The requested size must be an exact multiple of pagesize (4 Kb)
3655
  * The function allocates memory in such a way that you can read and
3591
  * The function allocates memory in such a way that you can read and
3656
    write beyond the size of the allocated memory and will reach the 
3592
    write beyond the size of the allocated memory and will reach the 
3657
    beginning of the buffer again.
3593
    beginning of the buffer again.
3658
 
3594
 
3659
---------------------- Constants for registers: ----------------------
3595
---------------------- Constants for registers: ----------------------
3660
  eax - SF_SYS_MISC (68)
3596
  eax - SF_SYS_MISC (68)
3661
  ebx - SSF_MEM_ALLOC_RING (29)  
3597
  ebx - SSF_MEM_ALLOC_RING (29)  
3662
 
3598
 
3663
======================================================================
3599
======================================================================
3664
=========== Function 68, subfunction 31 - get driver data. ===========
3600
=========== Function 68, subfunction 31 - get driver data. ===========
3665
======================================================================
3601
======================================================================
3666
Driver structures are organized into a doubly linked list. Its head is
3602
Driver structures are organized into a doubly linked list. Its head is
3667
a dummy structure with the forward and backward pointers only. Other
3603
a dummy structure with the forward and backward pointers only. Other
3668
structures, if any, are as follows:
3604
structures, if any, are as follows:
3669
  * +0: 16*byte: driver name, ASCIIZ
3605
  * +0: 16*byte: driver name, ASCIIZ
3670
  * +16 = +0x10: dword: pointer to the next driver structure
3606
  * +16 = +0x10: dword: pointer to the next driver structure
3671
  * +20 = +0x14: dword: pointer to the previous driver structure
3607
  * +20 = +0x14: dword: pointer to the previous driver structure
3672
  * +24 = +0x18: dword: driver's base address
3608
  * +24 = +0x18: dword: driver's base address
3673
  * +28 = +0x1C: dword: driver's entry point address
3609
  * +28 = +0x1C: dword: driver's entry point address
3674
  * +32 = +0x20: dword: driver's service handler address
3610
  * +32 = +0x20: dword: driver's service handler address
3675
 
3611
 
3676
-------------- Subsubfunction 1 - get driver list head. --------------
3612
-------------- Subsubfunction 1 - get driver list head. --------------
3677
Parameters:
3613
Parameters:
3678
  * eax = 68 - function number
3614
  * eax = 68 - function number
3679
  * ebx = 31 - subfunction number
3615
  * ebx = 31 - subfunction number
3680
  * ecx = 1 - subsubfunction number
3616
  * ecx = 1 - subsubfunction number
3681
Returned value:
3617
Returned value:
3682
  * ebx = pointer to the next driver structure
3618
  * ebx = pointer to the next driver structure
3683
  * ecx = pointer to the previous driver structure
3619
  * ecx = pointer to the previous driver structure
3684
 
3620
 
3685
--------- Subsubfunction 2 - get driver list item by pointer. --------
3621
--------- Subsubfunction 2 - get driver list item by pointer. --------
3686
Parameters:
3622
Parameters:
3687
  * eax = 68 - function number
3623
  * eax = 68 - function number
3688
  * ebx = 31 - subfunction number
3624
  * ebx = 31 - subfunction number
3689
  * ecx = 2 - subsubfunction number
3625
  * ecx = 2 - subsubfunction number
3690
  * edx = pointer to the list item
3626
  * edx = pointer to the list item
3691
  * edi = pointer to memory for driver data
3627
  * edi = pointer to memory for driver data
3692
Returned value:
3628
Returned value:
3693
  * eax = 0 (ok), -1 (error)
3629
  * eax = 0 (ok), -1 (error)
3694
 
3630
 
3695
======================================================================
3631
======================================================================
3696
====================== Function 69 - debugging. ======================
3632
====================== Function 69 - debugging. ======================
3697
======================================================================
3633
======================================================================
3698
A process can load other process as debugged by set of corresponding
3634
A process can load other process as debugged by set of corresponding
3699
bit by call to subfunction 7 of function 70.
3635
bit by call to subfunction 7 of function 70.
3700
A process can have only one debugger; one process can debug some
3636
A process can have only one debugger; one process can debug some
3701
others. The system notifies debugger on events occurring with
3637
others. The system notifies debugger on events occurring with
3702
debugged process. Messages are written to the buffer defined by
3638
debugged process. Messages are written to the buffer defined by
3703
subfunction 0.
3639
subfunction 0.
3704
Format of a message:
3640
Format of a message:
3705
  * +0: dword: message code
3641
  * +0: dword: message code
3706
  * +4: dword: PID of debugged process
3642
  * +4: dword: PID of debugged process
3707
  * +8: there can be additional data depending on message code
3643
  * +8: there can be additional data depending on message code
3708
Message codes:
3644
Message codes:
3709
  * 1 = exception
3645
  * 1 = exception
3710
    * in addition dword-number of the exception is given
3646
    * in addition dword-number of the exception is given
3711
    * process is suspended
3647
    * process is suspended
3712
  * 2 = process has terminated
3648
  * 2 = process has terminated
3713
    * comes at any termination: both through the system function -1,
3649
    * comes at any termination: both through the system function -1,
3714
      and at "murder" by any other process (including debugger itself)
3650
      and at "murder" by any other process (including debugger itself)
3715
  * 3 = debug exception int 1 = #DB
3651
  * 3 = debug exception int 1 = #DB
3716
    * in addition dword-image of the register DR6 is given:
3652
    * in addition dword-image of the register DR6 is given:
3717
      * bits 0-3: condition of the corresponding breakpoint (set by
3653
      * bits 0-3: condition of the corresponding breakpoint (set by
3718
        subfunction 9) is satisfied
3654
        subfunction 9) is satisfied
3719
      * bit 14: exception has occurred because of the trace mode
3655
      * bit 14: exception has occurred because of the trace mode
3720
        (flag TF is set TF)
3656
        (flag TF is set TF)
3721
    * process is suspended
3657
    * process is suspended
3722
When debugger terminates, all debugged processes are killed.
3658
When debugger terminates, all debugged processes are killed.
3723
If debugger does not want this, it must previously detach by
3659
If debugger does not want this, it must previously detach by
3724
subfunction 3.
3660
subfunction 3.
3725
 
3661
 
3726
All subfunctions are applicable only to processes/threads started
3662
All subfunctions are applicable only to processes/threads started
3727
from the current by function 70 with set debugging flag.
3663
from the current by function 70 with set debugging flag.
3728
Debugging of multithreaded programs is not supported yet.
3664
Debugging of multithreaded programs is not supported yet.
3729
The full list of subfunctions:
3665
The full list of subfunctions:
3730
  * subfunction 0 - define data area for debug messages
3666
  * subfunction 0 - define data area for debug messages
3731
  * subfunction 1 - get contents of registers of debugged thread
3667
  * subfunction 1 - get contents of registers of debugged thread
3732
  * subfunction 2 - set contents of registers of debugged thread
3668
  * subfunction 2 - set contents of registers of debugged thread
3733
  * subfunction 3 - detach from debugged process
3669
  * subfunction 3 - detach from debugged process
3734
  * subfunction 4 - suspend debugged thread
3670
  * subfunction 4 - suspend debugged thread
3735
  * subfunction 5 - resume debugged thread
3671
  * subfunction 5 - resume debugged thread
3736
  * subfunction 6 - read from the memory of debugged process
3672
  * subfunction 6 - read from the memory of debugged process
3737
  * subfunction 7 - write to the memory of debugged process
3673
  * subfunction 7 - write to the memory of debugged process
3738
  * subfunction 8 - terminate debugged thread
3674
  * subfunction 8 - terminate debugged thread
3739
  * subfunction 9 - set/clear hardware breakpoint
3675
  * subfunction 9 - set/clear hardware breakpoint
3740
 
3676
 
3741
---------------------- Constants for registers: ----------------------
3677
---------------------- Constants for registers: ----------------------
3742
  eax - SF_DEBUG (69)
3678
  eax - SF_DEBUG (69)
3743
  ebx - SSF_SET_MESSAGE_AREA (0), SSF_GET_REGISTERS (1),
3679
  ebx - SSF_SET_MESSAGE_AREA (0), SSF_GET_REGISTERS (1),
3744
    SSF_SET_REGISTERS (2), SSF_DETACH (3), SSF_SUSPEND (4),
3680
    SSF_SET_REGISTERS (2), SSF_DETACH (3), SSF_SUSPEND (4),
3745
    SSF_RESUME (5), SSF_READ_MEMORY (6), SSF_WRITE_MEMORY (7),
3681
    SSF_RESUME (5), SSF_READ_MEMORY (6), SSF_WRITE_MEMORY (7),
3746
    SSF_TERMINATE (8), SSF_DEFINE_BREAKPOINT (9)
3682
    SSF_TERMINATE (8), SSF_DEFINE_BREAKPOINT (9)
3747
======================================================================
3683
======================================================================
3748
= Function 69, subfunction 0 - define data area for debug messages. ==
3684
= Function 69, subfunction 0 - define data area for debug messages. ==
3749
======================================================================
3685
======================================================================
3750
Parameters:
3686
Parameters:
3751
  * eax = 69 - function number
3687
  * eax = 69 - function number
3752
  * ebx = 0 - subfunction number
3688
  * ebx = 0 - subfunction number
3753
  * ecx = pointer
3689
  * ecx = pointer
3754
Format of data area:
3690
Format of data area:
3755
  * +0: dword: N = buffer size (not including this header)
3691
  * +0: dword: N = buffer size (not including this header)
3756
  * +4: dword: occupied place
3692
  * +4: dword: occupied place
3757
  * +8: N*byte: buffer
3693
  * +8: N*byte: buffer
3758
Returned value:
3694
Returned value:
3759
  * function does not return value
3695
  * function does not return value
3760
Remarks:
3696
Remarks:
3761
  * If the size field is negative, the buffer is considered locked
3697
  * If the size field is negative, the buffer is considered locked
3762
    and at arrival of new message the system will wait.
3698
    and at arrival of new message the system will wait.
3763
    For synchronization frame all work with the buffer by operations
3699
    For synchronization frame all work with the buffer by operations
3764
    lock/unlock
3700
    lock/unlock
3765
        neg     [bufsize]
3701
        neg     [bufsize]
3766
  * Data in the buffer are considered as array of items with variable
3702
  * Data in the buffer are considered as array of items with variable
3767
    length - messages. Format of a message is explained in
3703
    length - messages. Format of a message is explained in
3768
    general description.
3704
    general description.
3769
 
3705
 
3770
---------------------- Constants for registers: ----------------------
3706
---------------------- Constants for registers: ----------------------
3771
  eax - SF_DEBUG (69)
3707
  eax - SF_DEBUG (69)
3772
  ebx - SSF_SET_MESSAGE_AREA (0)
3708
  ebx - SSF_SET_MESSAGE_AREA (0)
3773
======================================================================
3709
======================================================================
3774
===================== Function 69, subfunction 1 =====================
3710
===================== Function 69, subfunction 1 =====================
3775
============ Get contents of registers of debugged thread. ===========
3711
============ Get contents of registers of debugged thread. ===========
3776
======================================================================
3712
======================================================================
3777
Parameters:
3713
Parameters:
3778
  * eax = 69 - function number
3714
  * eax = 69 - function number
3779
  * ebx = 1 - subfunction number
3715
  * ebx = 1 - subfunction number
3780
  * ecx = thread identifier
3716
  * ecx = thread identifier
3781
  * edx = size of context structure, must be 0x28=40 bytes
3717
  * edx = size of context structure, must be 0x28=40 bytes
3782
  * esi = pointer to context structure
3718
  * esi = pointer to context structure
3783
Returned value:
3719
Returned value:
3784
  * function does not return value
3720
  * function does not return value
3785
Format of context structure: (FPU is not supported yet)
3721
Format of context structure: (FPU is not supported yet)
3786
  * +0: dword: eip
3722
  * +0: dword: eip
3787
  * +4: dword: eflags
3723
  * +4: dword: eflags
3788
  * +8: dword: eax
3724
  * +8: dword: eax
3789
  * +12 = +0xC: dword: ecx
3725
  * +12 = +0xC: dword: ecx
3790
  * +16 = +0x10: dword: edx
3726
  * +16 = +0x10: dword: edx
3791
  * +20 = +0x14: dword: ebx
3727
  * +20 = +0x14: dword: ebx
3792
  * +24 = +0x18: dword: esp
3728
  * +24 = +0x18: dword: esp
3793
  * +28 = +0x1C: dword: ebp
3729
  * +28 = +0x1C: dword: ebp
3794
  * +32 = +0x20: dword: esi
3730
  * +32 = +0x20: dword: esi
3795
  * +36 = +0x24: dword: edi
3731
  * +36 = +0x24: dword: edi
3796
Remarks:
3732
Remarks:
3797
  * If the thread executes code of ring-0, the function returns
3733
  * If the thread executes code of ring-0, the function returns
3798
    contents of registers of ring-3.
3734
    contents of registers of ring-3.
3799
  * Process must be loaded for debugging (as is shown in
3735
  * Process must be loaded for debugging (as is shown in
3800
    general description).
3736
    general description).
3801
 
3737
 
3802
---------------------- Constants for registers: ----------------------
3738
---------------------- Constants for registers: ----------------------
3803
  eax - SF_DEBUG (69)
3739
  eax - SF_DEBUG (69)
3804
  ebx - SSF_GET_REGISTERS (1)
3740
  ebx - SSF_GET_REGISTERS (1)
3805
======================================================================
3741
======================================================================
3806
===================== Function 69, subfunction 2 =====================
3742
===================== Function 69, subfunction 2 =====================
3807
============ Set contents of registers of debugged thread. ===========
3743
============ Set contents of registers of debugged thread. ===========
3808
======================================================================
3744
======================================================================
3809
Parameters:
3745
Parameters:
3810
  * eax = 69 - function number
3746
  * eax = 69 - function number
3811
  * ebx = 2 - subfunction number
3747
  * ebx = 2 - subfunction number
3812
  * ecx = thread identifier
3748
  * ecx = thread identifier
3813
  * edx = size of context structure, must be 0x28=40 bytes
3749
  * edx = size of context structure, must be 0x28=40 bytes
3814
  * esi -> context structure
3750
  * esi -> context structure
3815
Returned value:
3751
Returned value:
3816
  * function does not return value
3752
  * function does not return value
3817
Format of context structure is shown in the description of
3753
Format of context structure is shown in the description of
3818
subfunction 1.
3754
subfunction 1.
3819
Remarks:
3755
Remarks:
3820
  * If the thread executes code of ring-0, the function returns
3756
  * If the thread executes code of ring-0, the function returns
3821
    contents of registers of ring-3.
3757
    contents of registers of ring-3.
3822
  * Process must be loaded for debugging (as is shown in
3758
  * Process must be loaded for debugging (as is shown in
3823
    general description).
3759
    general description).
3824
 
3760
 
3825
---------------------- Constants for registers: ----------------------
3761
---------------------- Constants for registers: ----------------------
3826
  eax - SF_DEBUG (69)
3762
  eax - SF_DEBUG (69)
3827
  ebx - SSF_SET_REGISTERS (2)
3763
  ebx - SSF_SET_REGISTERS (2)
3828
======================================================================
3764
======================================================================
3829
===== Function 69, subfunction 3 - detach from debugged process. =====
3765
===== Function 69, subfunction 3 - detach from debugged process. =====
3830
======================================================================
3766
======================================================================
3831
Parameters:
3767
Parameters:
3832
  * eax = 69 - function number
3768
  * eax = 69 - function number
3833
  * ebx = 3 - subfunction number
3769
  * ebx = 3 - subfunction number
3834
  * ecx = identifier
3770
  * ecx = identifier
3835
Returned value:
3771
Returned value:
3836
  * function does not return value
3772
  * function does not return value
3837
Remarks:
3773
Remarks:
3838
  * If the process was suspended, it resumes execution.
3774
  * If the process was suspended, it resumes execution.
3839
 
3775
 
3840
---------------------- Constants for registers: ----------------------
3776
---------------------- Constants for registers: ----------------------
3841
  eax - SF_DEBUG (69)
3777
  eax - SF_DEBUG (69)
3842
  ebx - SSF_DETACH (3)
3778
  ebx - SSF_DETACH (3)
3843
======================================================================
3779
======================================================================
3844
======== Function 69, subfunction 4 - suspend debugged thread. =======
3780
======== Function 69, subfunction 4 - suspend debugged thread. =======
3845
======================================================================
3781
======================================================================
3846
Parameters:
3782
Parameters:
3847
  * eax = 69 - function number
3783
  * eax = 69 - function number
3848
  * ebx = 4 - subfunction number
3784
  * ebx = 4 - subfunction number
3849
  * ecx = thread identifier
3785
  * ecx = thread identifier
3850
Returned value:
3786
Returned value:
3851
  * function does not return value
3787
  * function does not return value
3852
Remarks:
3788
Remarks:
3853
  * Process must be loaded for debugging (as is shown in
3789
  * Process must be loaded for debugging (as is shown in
3854
    general description).
3790
    general description).
3855
 
3791
 
3856
---------------------- Constants for registers: ----------------------
3792
---------------------- Constants for registers: ----------------------
3857
  eax - SF_DEBUG (69)
3793
  eax - SF_DEBUG (69)
3858
  ebx - SSF_SUSPEND (4)
3794
  ebx - SSF_SUSPEND (4)
3859
======================================================================
3795
======================================================================
3860
======== Function 69, subfunction 5 - resume debugged thread. ========
3796
======== Function 69, subfunction 5 - resume debugged thread. ========
3861
======================================================================
3797
======================================================================
3862
Parameters:
3798
Parameters:
3863
  * eax = 69 - function number
3799
  * eax = 69 - function number
3864
  * ebx = 5 - subfunction number
3800
  * ebx = 5 - subfunction number
3865
  * ecx = thread identifier
3801
  * ecx = thread identifier
3866
Returned value:
3802
Returned value:
3867
  * function does not return value
3803
  * function does not return value
3868
Remarks:
3804
Remarks:
3869
  * Process must be loaded for debugging (as is shown in
3805
  * Process must be loaded for debugging (as is shown in
3870
    general description).
3806
    general description).
3871
 
3807
 
3872
---------------------- Constants for registers: ----------------------
3808
---------------------- Constants for registers: ----------------------
3873
  eax - SF_DEBUG (69)
3809
  eax - SF_DEBUG (69)
3874
  ebx - SSF_RESUME (5)
3810
  ebx - SSF_RESUME (5)
3875
======================================================================
3811
======================================================================
3876
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3812
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3877
======================================================================
3813
======================================================================
3878
Parameters:
3814
Parameters:
3879
  * eax = 69 - function number
3815
  * eax = 69 - function number
3880
  * ebx = 6 - subfunction number
3816
  * ebx = 6 - subfunction number
3881
  * ecx = identifier
3817
  * ecx = identifier
3882
  * edx = number of bytes to read
3818
  * edx = number of bytes to read
3883
  * esi = address in the memory of debugged process
3819
  * esi = address in the memory of debugged process
3884
  * edi = pointer to buffer for data
3820
  * edi = pointer to buffer for data
3885
Returned value:
3821
Returned value:
3886
  * eax = -1 at an error (invalid PID or buffer)
3822
  * eax = -1 at an error (invalid PID or buffer)
3887
  * otherwise eax = number of read bytes (possibly, 0,
3823
  * otherwise eax = number of read bytes (possibly, 0,
3888
    if esi is too large)
3824
    if esi is too large)
3889
Remarks:
3825
Remarks:
3890
  * Process must be loaded for debugging (as is shown in
3826
  * Process must be loaded for debugging (as is shown in
3891
    general description).
3827
    general description).
3892
 
3828
 
3893
---------------------- Constants for registers: ----------------------
3829
---------------------- Constants for registers: ----------------------
3894
  eax - SF_DEBUG (69)
3830
  eax - SF_DEBUG (69)
3895
  ebx - SSF_READ_MEMORY (6)
3831
  ebx - SSF_READ_MEMORY (6)
3896
======================================================================
3832
======================================================================
3897
== Function 69, subfunction 7 - write to memory of debugged process. =
3833
== Function 69, subfunction 7 - write to memory of debugged process. =
3898
======================================================================
3834
======================================================================
3899
Parameters:
3835
Parameters:
3900
  * eax = 69 - function number
3836
  * eax = 69 - function number
3901
  * ebx = 7 - subfunction number
3837
  * ebx = 7 - subfunction number
3902
  * ecx = identifier
3838
  * ecx = identifier
3903
  * edx = number of bytes to write
3839
  * edx = number of bytes to write
3904
  * esi = address of memory in debugged process
3840
  * esi = address of memory in debugged process
3905
  * edi = pointer to data
3841
  * edi = pointer to data
3906
Returned value:
3842
Returned value:
3907
  * eax = -1 at an error (invalid PID or buffer)
3843
  * eax = -1 at an error (invalid PID or buffer)
3908
  * otherwise eax = number of written bytes (possibly, 0,
3844
  * otherwise eax = number of written bytes (possibly, 0,
3909
    if esi is too large)
3845
    if esi is too large)
3910
Remarks:
3846
Remarks:
3911
  * Process must be loaded for debugging (as is shown in
3847
  * Process must be loaded for debugging (as is shown in
3912
    general description).
3848
    general description).
3913
 
3849
 
3914
---------------------- Constants for registers: ----------------------
3850
---------------------- Constants for registers: ----------------------
3915
  eax - SF_DEBUG (69)
3851
  eax - SF_DEBUG (69)
3916
  ebx - SSF_WRITE_MEMORY (7)
3852
  ebx - SSF_WRITE_MEMORY (7)
3917
======================================================================
3853
======================================================================
3918
======= Function 69, subfunction 8 - terminate debugged thread. ======
3854
======= Function 69, subfunction 8 - terminate debugged thread. ======
3919
======================================================================
3855
======================================================================
3920
Parameters:
3856
Parameters:
3921
  * eax = 69 - function number
3857
  * eax = 69 - function number
3922
  * ebx = 8 - subfunction number
3858
  * ebx = 8 - subfunction number
3923
  * ecx = identifier
3859
  * ecx = identifier
3924
Returned value:
3860
Returned value:
3925
  * function does not return value
3861
  * function does not return value
3926
Remarks:
3862
Remarks:
3927
  * Process must be loaded for debugging (as is shown in
3863
  * Process must be loaded for debugging (as is shown in
3928
    general description).
3864
    general description).
3929
  * The function is similar to subfunction 2 of function 18
3865
  * The function is similar to subfunction 2 of function 18
3930
    with two differences: it requires first remark and
3866
    with two differences: it requires first remark and
3931
    accepts PID rather than slot number.
3867
    accepts PID rather than slot number.
3932
 
3868
 
3933
---------------------- Constants for registers: ----------------------
3869
---------------------- Constants for registers: ----------------------
3934
  eax - SF_DEBUG (69)
3870
  eax - SF_DEBUG (69)
3935
  ebx - SSF_TERMINATE (8)
3871
  ebx - SSF_TERMINATE (8)
3936
======================================================================
3872
======================================================================
3937
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3873
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3938
======================================================================
3874
======================================================================
3939
Parameters:
3875
Parameters:
3940
  * eax = 69 - function number
3876
  * eax = 69 - function number
3941
  * ebx = 9 - subfunction number
3877
  * ebx = 9 - subfunction number
3942
  * ecx = thread identifier
3878
  * ecx = thread identifier
3943
  * dl = index of breakpoint, from 0 to 3 inclusively
3879
  * dl = index of breakpoint, from 0 to 3 inclusively
3944
  * dh = flags:
3880
  * dh = flags:
3945
    * if high bit is cleared - set breakpoint:
3881
    * if high bit is cleared - set breakpoint:
3946
      * bits 0-1 - condition:
3882
      * bits 0-1 - condition:
3947
        * 00 = breakpoint on execution
3883
        * 00 = breakpoint on execution
3948
        * 01 = breakpoint on read
3884
        * 01 = breakpoint on read
3949
        * 11 = breakpoint on read/write
3885
        * 11 = breakpoint on read/write
3950
      * bits 2-3 - length; for breakpoints on exception it must be
3886
      * bits 2-3 - length; for breakpoints on exception it must be
3951
        00, otherwise one of
3887
        00, otherwise one of
3952
        * 00 = byte
3888
        * 00 = byte
3953
        * 01 = word
3889
        * 01 = word
3954
        * 11 = dword
3890
        * 11 = dword
3955
      * esi = breakpoint address; must be aligned according to
3891
      * esi = breakpoint address; must be aligned according to
3956
        the length (i.e. must be even for word breakpoints,
3892
        the length (i.e. must be even for word breakpoints,
3957
        divisible by 4 for dword)
3893
        divisible by 4 for dword)
3958
    * if high bit is set - clear breakpoint
3894
    * if high bit is set - clear breakpoint
3959
Returned value:
3895
Returned value:
3960
  * eax = 0 - success
3896
  * eax = 0 - success
3961
  * eax = 1 - error in the input data
3897
  * eax = 1 - error in the input data
3962
  * eax = 2 - (reserved, is never returned in the current
3898
  * eax = 2 - (reserved, is never returned in the current
3963
    implementation) a global breakpoint with that index is already set
3899
    implementation) a global breakpoint with that index is already set
3964
Remarks:
3900
Remarks:
3965
  * Process must be loaded for debugging (as is shown in
3901
  * Process must be loaded for debugging (as is shown in
3966
    general description).
3902
    general description).
3967
  * Hardware breakpoints are implemented through DRx-registers of
3903
  * Hardware breakpoints are implemented through DRx-registers of
3968
    the processor, all limitations results from this.
3904
    the processor, all limitations results from this.
3969
  * The function can reinstall the breakpoint, previously set
3905
  * The function can reinstall the breakpoint, previously set
3970
    by it (and it does not inform on this).
3906
    by it (and it does not inform on this).
3971
    Carry on the list of set breakpoints in the debugger.
3907
    Carry on the list of set breakpoints in the debugger.
3972
  * Breakpoints generate debug exception #DB, on which the system
3908
  * Breakpoints generate debug exception #DB, on which the system
3973
    notifies debugger.
3909
    notifies debugger.
3974
  * Breakpoints on write and read/write act after
3910
  * Breakpoints on write and read/write act after
3975
    execution of the caused it instruction.
3911
    execution of the caused it instruction.
3976
 
3912
 
3977
---------------------- Constants for registers: ----------------------
3913
---------------------- Constants for registers: ----------------------
3978
  eax - SF_DEBUG (69)
3914
  eax - SF_DEBUG (69)
3979
  ebx - SSF_DEFINE_BREAKPOINT (9)
3915
  ebx - SSF_DEFINE_BREAKPOINT (9)
3980
======================================================================
3916
======================================================================
3981
==== Function 70 - work with file system with long names support. ====
3917
==== Function 70 - work with file system with long names support. ====
3982
======================================================================
3918
======================================================================
3983
Parameters:
3919
Parameters:
3984
  * eax = 70
3920
  * eax = 70
3985
  * ebx = pointer to the information structure
3921
  * ebx = pointer to the information structure
3986
Returned value:
3922
Returned value:
3987
  * eax = 0 - success; otherwise file system error code
3923
  * eax = 0 - success; otherwise file system error code
3988
  * some subfunctions return value in other registers too
3924
  * some subfunctions return value in other registers too
3989
General format of the information structure:
3925
General format of the information structure:
3990
  * +0: dword: subfunction number
3926
  * +0: dword: subfunction number
3991
  * +4: dword: offset in file or folder
3927
  * +4: dword: offset in file or folder
3992
  * +8: dword: higher part of offset or flags
3928
  * +8: dword: higher part of offset or flags
3993
  * +12 = +0xC: dword: size of data
3929
  * +12 = +0xC: dword: size of data
3994
  * +16 = +0x10: dword: pointer to data
3930
  * +16 = +0x10: dword: pointer to data
3995
  * +20 = +0x14: ?: path - zero terminated string
3931
  * +20 = +0x14: ?: path - zero terminated string
3996
  or
3932
  or
3997
  * +20 = +0x14: byte: 0
3933
  * +20 = +0x14: byte: 0
3998
  * +21 = +0x15: dword: pointer to string
3934
  * +21 = +0x15: dword: pointer to string
3999
Case sensitivity depends on filesystem.
3935
Case sensitivity depends on filesystem.
4000
If a path not begins with '/', it is considered a relative.
3936
If a path not begins with '/', it is considered a relative.
4001
To get or set the current folder, use the sysfunction 30.
3937
To get or set the current folder, use the sysfunction 30.
4002
'../' in the path means a lift by one folder relatively current folder.
3938
'../' in the path means a lift by one folder relatively current folder.
4003
To set the encoding, put at the start of the string a byte with next values:
3939
To set the encoding, put at the start of the string a byte with next values:
4004
  * 1 = cp866
3940
  * 1 = cp866
4005
  * 2 = UTF-16LE
3941
  * 2 = UTF-16LE
4006
  * 3 = UTF-8
3942
  * 3 = UTF-8
4007
  otherwise will be used cp866. In an absolute path
3943
  otherwise will be used cp866. In an absolute path
4008
  you may put this byte after the '/' or put an additional '/' before it.
3944
  you may put this byte after the '/' or put an additional '/' before it.
4009
  Also, you may use the sysfunction 80.
3945
  Also, you may use the sysfunction 80.
4010
Format of an absolute path:
3946
Format of an absolute path:
4011
  /base/number/dir1/dir2/.../dirn/file,
3947
  /base/number/dir1/dir2/.../dirn/file,
4012
where base/number identifies device, on which file is located:
3948
where base/number identifies device, on which file is located:
4013
  * RD/1 = ramdisk
3949
  * RD/1 = ramdisk
4014
  * FD/1 = first floppy drive,
3950
  * FD/1 = first floppy drive,
4015
    FD/2 = second floppy drive
3951
    FD/2 = second floppy drive
4016
  * HD0/x, HD1/x, HD2/x, HD3/x = hard drives accordingly on
3952
  * HD0/x, HD1/x, HD2/x, HD3/x = hard drives accordingly on
4017
    IDE0 (Primary Master), IDE1 (Primary Slave),
3953
    IDE0 (Primary Master), IDE1 (Primary Slave),
4018
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3954
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
4019
    x - partition number on the selected hard drive, starts from 1
3955
    x - partition number on the selected hard drive, starts from 1
4020
  * CD0/1, CD1/1, CD2/1, CD3/1 = same for cd
3956
  * CD0/1, CD1/1, CD2/1, CD3/1 = same for cd
4021
  * SYS = system folder (encoding inaffected key),
3957
  * SYS = system folder (encoding inaffected key),
4022
    second key may be set by sysfunction 30.3.
3958
    second key may be set by sysfunction 30.3.
4023
Examples:
3959
Examples:
4024
  * '/sys/example.asm',0
3960
  * '/sys/example.asm',0
4025
  * '/rd/1/example.asm',0
3961
  * '/rd/1/example.asm',0
4026
  * '/HD0/1/folder/file.txt',0
3962
  * '/HD0/1/folder/file.txt',0
4027
  * '/hd2/2/pics/tanzania.bmp',0
3963
  * '/hd2/2/pics/tanzania.bmp',0
4028
  * 2,'/',0,'sys','/',0,'F',0,'I',0,'L',0,'E',0,0,0
3964
  * 2,'/',0,'sys','/',0,'F',0,'I',0,'L',0,'E',0,0,0
4029
 
3965
 
4030
Available subfunctions:
3966
Available subfunctions:
4031
  * subfunction 0 - read file
3967
  * subfunction 0 - read file
4032
  * subfunction 1 - read folder
3968
  * subfunction 1 - read folder
4033
  * subfunction 2 - create/rewrite file
3969
  * subfunction 2 - create/rewrite file
4034
  * subfunction 3 - write to existing file
3970
  * subfunction 3 - write to existing file
4035
  * subfunction 4 - set file size
3971
  * subfunction 4 - set file size
4036
  * subfunction 5 - get attributes of file/folder
3972
  * subfunction 5 - get attributes of file/folder
4037
  * subfunction 6 - set attributes of file/folder
3973
  * subfunction 6 - set attributes of file/folder
4038
  * subfunction 7 - start application
3974
  * subfunction 7 - start application
4039
  * subfunction 8 - delete file/folder
3975
  * subfunction 8 - delete file/folder
4040
  * subfunction 9 - create folder
3976
  * subfunction 9 - create folder
4041
For CD-drives due to hardware limitations only subfunctions
3977
For CD-drives due to hardware limitations only subfunctions
4042
0,1,5 and 7 are available, other subfunctions return error
3978
0,1,5 and 7 are available, other subfunctions return error
4043
with code 2.
3979
with code 2.
4044
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3980
At the first call of subfunctions 0,1,5,7 to ATAPI devices
4045
(CD and DVD) the manual control of tray is locked due to caching
3981
(CD and DVD) the manual control of tray is locked due to caching
4046
drive data. Unlocking is made when subfunction 4 of function 24
3982
drive data. Unlocking is made when subfunction 4 of function 24
4047
is called for corresponding device.
3983
is called for corresponding device.
4048
 
3984
 
4049
---------------------- Constants for registers: ----------------------
3985
---------------------- Constants for registers: ----------------------
4050
  eax - SF_FILE (70)
3986
  eax - SF_FILE (70)
4051
 [ebx] - SSF_READ_FILE (0), SSF_READ_FOLDER (1), SSF_CREATE_FILE (2),
3987
 [ebx] - SSF_READ_FILE (0), SSF_READ_FOLDER (1), SSF_CREATE_FILE (2),
4052
    SSF_WRITE_FILE (3), SSF_SET_END (4), SSF_GET_INFO (5),
3988
    SSF_WRITE_FILE (3), SSF_SET_END (4), SSF_GET_INFO (5),
4053
    SSF_SET_INFO (6), SSF_START_APP (7), SSF_DELETE (8),
3989
    SSF_SET_INFO (6), SSF_START_APP (7), SSF_DELETE (8),
4054
    SSF_CREATE_FOLDER (9)
3990
    SSF_CREATE_FOLDER (9)
4055
======================================================================
3991
======================================================================
4056
=== Function 70, subfunction 0 - read file with long names support. ==
3992
=== Function 70, subfunction 0 - read file with long names support. ==
4057
======================================================================
3993
======================================================================
4058
Parameters:
3994
Parameters:
4059
  * eax = 70 - function number
3995
  * eax = 70 - function number
4060
  * ebx = pointer to the information structure
3996
  * ebx = pointer to the information structure
4061
Format of the information structure:
3997
Format of the information structure:
4062
  * +0: dword: 0 = subfunction number
3998
  * +0: dword: 0 = subfunction number
4063
  * +4: dword: file offset (in bytes)
3999
  * +4: dword: file offset (in bytes)
4064
  * +8: dword: 0 (reserved for high dword of offset)
4000
  * +8: dword: 0 (reserved for high dword of offset)
4065
  * +12 = +0xC: dword: number of bytes to read
4001
  * +12 = +0xC: dword: number of bytes to read
4066
  * +16 = +0x10: dword: pointer to buffer for data
4002
  * +16 = +0x10: dword: pointer to buffer for data
4067
  * +20 = +0x14: path, general rules of names forming
4003
  * +20 = +0x14: path, general rules of names forming
4068
Returned value:
4004
Returned value:
4069
  * eax = 0 - success, otherwise file system error code
4005
  * eax = 0 - success, otherwise file system error code
4070
  * ebx = number of bytes read
4006
  * ebx = number of bytes read
4071
Remarks:
4007
Remarks:
4072
  * If file was ended before last requested block was read,
4008
  * If file was ended before last requested block was read,
4073
    the function will read as many as it can, and after that return
4009
    the function will read as many as it can, and after that return
4074
    eax=6 (EOF).
4010
    eax=6 (EOF).
4075
  * The function does not allow to read folder (returns eax=10,
4011
  * The function does not allow to read folder (returns eax=10,
4076
    access denied).
4012
    access denied).
4077
 
4013
 
4078
---------------------- Constants for registers: ----------------------
4014
---------------------- Constants for registers: ----------------------
4079
  eax - SF_FILE (70)
4015
  eax - SF_FILE (70)
4080
 [ebx] - SSF_READ_FILE (0)
4016
 [ebx] - SSF_READ_FILE (0)
4081
======================================================================
4017
======================================================================
4082
== Function 70, subfunction 1 - read folder with long names support. =
4018
== Function 70, subfunction 1 - read folder with long names support. =
4083
======================================================================
4019
======================================================================
4084
Parameters:
4020
Parameters:
4085
  * eax = 70 - function number
4021
  * eax = 70 - function number
4086
  * ebx = pointer to the information structure
4022
  * ebx = pointer to the information structure
4087
Format of the information structure:
4023
Format of the information structure:
4088
  * +0: dword: 1 = subfunction number
4024
  * +0: dword: 1 = subfunction number
4089
  * +4: dword: index of starting block (beginning from 0)
4025
  * +4: dword: index of starting block (beginning from 0)
4090
  * +8: dword: names encoding:
4026
  * +8: dword: names encoding:
4091
    0 = default
4027
    0 = default
4092
    1 = cp866
4028
    1 = cp866
4093
    2 = UTF-16LE
4029
    2 = UTF-16LE
4094
    3 = UTF-8
4030
    3 = UTF-8
4095
  * +12 = +0xC: dword: number of blocks to read
4031
  * +12 = +0xC: dword: number of blocks to read
4096
  * +16 = +0x10: dword: pointer to buffer for data
4032
  * +16 = +0x10: dword: pointer to buffer for data
4097
  * +20 = +0x14: path, general rules of names forming
4033
  * +20 = +0x14: path, general rules of names forming
4098
Returned value:
4034
Returned value:
4099
  * eax = 0 - success, otherwise file system error code
4035
  * eax = 0 - success, otherwise file system error code
4100
  * ebx = number of file information blocks, written to the buffer
4036
  * ebx = number of file information blocks, written to the buffer
4101
Structure of the buffer:
4037
Structure of the buffer:
4102
  * header (32 bytes)
4038
  * header (32 bytes)
4103
  * block with information on file 1
4039
  * block with information on file 1
4104
  * block with information on file 2
4040
  * block with information on file 2
4105
  * ...
4041
  * ...
4106
Structure of header:
4042
Structure of header:
4107
  * +0: dword: version of structure (current is 1)
4043
  * +0: dword: version of structure (current is 1)
4108
  * +4: dword: number of placed blocks; is not greater than requested
4044
  * +4: dword: number of placed blocks; is not greater than requested
4109
    in the field +12 of information structure; can be less, if
4045
    in the field +12 of information structure; can be less, if
4110
    there are no more files in folder (the same as in ebx)
4046
    there are no more files in folder (the same as in ebx)
4111
  * +8: dword: total number of files in folder
4047
  * +8: dword: total number of files in folder
4112
  * +12 = +0xC: 20*byte: reserved (zeroed)
4048
  * +12 = +0xC: 20*byte: reserved (zeroed)
4113
Structure of block of data for folder entry (BDFE):
4049
Structure of block of data for folder entry (BDFE):
4114
  * +0: dword: attributes of file:
4050
  * +0: dword: attributes of file:
4115
    * bit 0 (mask 1): file is read-only
4051
    * bit 0 (mask 1): file is read-only
4116
    * bit 1 (mask 2): file is hidden
4052
    * bit 1 (mask 2): file is hidden
4117
    * bit 2 (mask 4): file is system
4053
    * bit 2 (mask 4): file is system
4118
    * bit 3 (mask 8): this is the volume label (using by subfunction 5)
4054
    * bit 3 (mask 8): this is the volume label (using by subfunction 5)
4119
    * bit 4 (mask 0x10): this is a folder
4055
    * bit 4 (mask 0x10): this is a folder
4120
    * bit 5 (mask 0x20): file was not archived - many archivation
4056
    * bit 5 (mask 0x20): file was not archived - many archivation
4121
      programs have an option to archive only files with this bit set,
4057
      programs have an option to archive only files with this bit set,
4122
      and after archiving this bit is cleared - it can be useful
4058
      and after archiving this bit is cleared - it can be useful
4123
      for automatically creating of backup-archives as at writing
4059
      for automatically creating of backup-archives as at writing
4124
      this bit is usually set
4060
      this bit is usually set
4125
  * +4: dword: encoding, equals to field +8 in the information structure
4061
  * +4: dword: encoding, equals to field +8 in the information structure
4126
  * +8: 4*byte: time of file creation
4062
  * +8: 4*byte: time of file creation
4127
  * +12 = +0xC: 4*byte: date of file creation
4063
  * +12 = +0xC: 4*byte: date of file creation
4128
  * +16 = +0x10: 4*byte: time of last access (read or write)
4064
  * +16 = +0x10: 4*byte: time of last access (read or write)
4129
  * +20 = +0x14: 4*byte: date of last access
4065
  * +20 = +0x14: 4*byte: date of last access
4130
  * +24 = +0x18: 4*byte: time of last modification
4066
  * +24 = +0x18: 4*byte: time of last modification
4131
  * +28 = +0x1C: 4*byte: date of last modification
4067
  * +28 = +0x1C: 4*byte: date of last modification
4132
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4068
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
4133
  * +40 = +0x28: name, 264 bytes in cp866, otherwise - 520 bytes.
4069
  * +40 = +0x28: name, 264 bytes in cp866, otherwise - 520 bytes.
4134
Time format:
4070
Time format:
4135
  * +0: byte: seconds
4071
  * +0: byte: seconds
4136
  * +1: byte: minutes
4072
  * +1: byte: minutes
4137
  * +2: byte: hours
4073
  * +2: byte: hours
4138
  * +3: byte: reserved (0)
4074
  * +3: byte: reserved (0)
4139
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4075
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
4140
Date format:
4076
Date format:
4141
  * +0: byte: day
4077
  * +0: byte: day
4142
  * +1: byte: month
4078
  * +1: byte: month
4143
  * +2: word: year
4079
  * +2: word: year
4144
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4080
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
4145
    Some file systems start the date from 01.01.1980,
4081
    Some file systems start the date from 01.01.1980,
4146
    for example: FAT12/16/32 and exFAT
4082
    for example: FAT12/16/32 and exFAT
4147
Remarks:
4083
Remarks:
4148
  * If BDFE contains cp866 name, the length of BDFE is 304 bytes,
4084
  * If BDFE contains cp866 name, the length of BDFE is 304 bytes,
4149
    otherwise - 560 bytes.
4085
    otherwise - 560 bytes.
4150
  * Name string is zero terminated, further data contain garbage.
4086
  * Name string is zero terminated, further data contain garbage.
4151
  * If files in folder were ended before requested number was read,
4087
  * If files in folder were ended before requested number was read,
4152
    the function will read as many as it can, and after that return
4088
    the function will read as many as it can, and after that return
4153
    eax=6 (EOF).
4089
    eax=6 (EOF).
4154
  * Any folder on the disk, except for root, contains two special
4090
  * Any folder on the disk, except for root, contains two special
4155
    entries "." and "..", identifying accordingly the folder itself
4091
    entries "." and "..", identifying accordingly the folder itself
4156
    and the parent folder.
4092
    and the parent folder.
4157
  * The function allows also to read virtual folders "/", "/rd",
4093
  * The function allows also to read virtual folders "/", "/rd",
4158
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4094
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4159
    and times and dates are zeroed. An alternative way to get the
4095
    and times and dates are zeroed. An alternative way to get the
4160
    equipment information - subfunction 11 of function 18.
4096
    equipment information - subfunction 11 of function 18.
4161
 
4097
 
4162
---------------------- Constants for registers: ----------------------
4098
---------------------- Constants for registers: ----------------------
4163
  eax - SF_FILE (70)
4099
  eax - SF_FILE (70)
4164
 [ebx] - SSF_READ_FOLDER (1)
4100
 [ebx] - SSF_READ_FOLDER (1)
4165
======================================================================
4101
======================================================================
4166
===================== Function 70, subfunction 2 =====================
4102
===================== Function 70, subfunction 2 =====================
4167
============ Create/rewrite file with long names support. ============
4103
============ Create/rewrite file with long names support. ============
4168
======================================================================
4104
======================================================================
4169
Parameters:
4105
Parameters:
4170
  * eax = 70 - function number
4106
  * eax = 70 - function number
4171
  * ebx = pointer to the information structure
4107
  * ebx = pointer to the information structure
4172
Format of the information structure:
4108
Format of the information structure:
4173
  * +0: dword: 2 = subfunction number
4109
  * +0: dword: 2 = subfunction number
4174
  * +4: dword: 0 (reserved)
4110
  * +4: dword: 0 (reserved)
4175
  * +8: dword: 0 (reserved)
4111
  * +8: dword: 0 (reserved)
4176
  * +12 = +0xC: dword: number of bytes to write
4112
  * +12 = +0xC: dword: number of bytes to write
4177
  * +16 = +0x10: dword: pointer to data
4113
  * +16 = +0x10: dword: pointer to data
4178
  * +20 = +0x14: path, general rules of names forming
4114
  * +20 = +0x14: path, general rules of names forming
4179
Returned value:
4115
Returned value:
4180
  * eax = 0 - success, otherwise file system error code
4116
  * eax = 0 - success, otherwise file system error code
4181
  * ebx = number of written bytes (possibly 0)
4117
  * ebx = number of written bytes (possibly 0)
4182
Remarks:
4118
Remarks:
4183
  * If a file with given name did not exist, it is created;
4119
  * If a file with given name did not exist, it is created;
4184
    if it existed, it is rewritten.
4120
    if it existed, it is rewritten.
4185
  * If there is not enough free space on disk, the function will
4121
  * If there is not enough free space on disk, the function will
4186
    write as many as can and then return error code 8.
4122
    write as many as can and then return error code 8.
4187
  * The function is not supported for CD (returns error code 2).
4123
  * The function is not supported for CD (returns error code 2).
4188
 
4124
 
4189
---------------------- Constants for registers: ----------------------
4125
---------------------- Constants for registers: ----------------------
4190
  eax - SF_FILE (70)
4126
  eax - SF_FILE (70)
4191
 [ebx] - SSF_CREATE_FILE (2)
4127
 [ebx] - SSF_CREATE_FILE (2)
4192
======================================================================
4128
======================================================================
4193
===================== Function 70, subfunction 3 =====================
4129
===================== Function 70, subfunction 3 =====================
4194
=========== Write to existing file with long names support. ==========
4130
=========== Write to existing file with long names support. ==========
4195
======================================================================
4131
======================================================================
4196
Parameters:
4132
Parameters:
4197
  * eax = 70 - function number
4133
  * eax = 70 - function number
4198
  * ebx = pointer to the information structure
4134
  * ebx = pointer to the information structure
4199
Format of the information structure:
4135
Format of the information structure:
4200
  * +0: dword: 3 = subfunction number
4136
  * +0: dword: 3 = subfunction number
4201
  * +4: dword: file offset (in bytes)
4137
  * +4: dword: file offset (in bytes)
4202
  * +8: dword: high dword of offset (must be 0 for FAT)
4138
  * +8: dword: high dword of offset (must be 0 for FAT)
4203
  * +12 = +0xC: dword: number of bytes to write
4139
  * +12 = +0xC: dword: number of bytes to write
4204
  * +16 = +0x10: dword: pointer to data
4140
  * +16 = +0x10: dword: pointer to data
4205
  * +20 = +0x14: path, general rules of names forming
4141
  * +20 = +0x14: path, general rules of names forming
4206
Returned value:
4142
Returned value:
4207
  * eax = 0 - success, otherwise file system error code
4143
  * eax = 0 - success, otherwise file system error code
4208
  * ebx = number of written bytes (possibly 0)
4144
  * ebx = number of written bytes (possibly 0)
4209
Remarks:
4145
Remarks:
4210
  * The file must already exist, otherwise function returns eax=5.
4146
  * The file must already exist, otherwise function returns eax=5.
4211
  * The only result of write 0 bytes is update in the file attributes
4147
  * The only result of write 0 bytes is update in the file attributes
4212
    date/time of modification and access to the current date/time.
4148
    date/time of modification and access to the current date/time.
4213
  * If beginning and/or ending position is greater than file size
4149
  * If beginning and/or ending position is greater than file size
4214
    (except for the previous case), the file is expanded to needed
4150
    (except for the previous case), the file is expanded to needed
4215
    size with zero characters.
4151
    size with zero characters.
4216
  * The function is not supported for CD (returns error code 2).
4152
  * The function is not supported for CD (returns error code 2).
4217
 
4153
 
4218
---------------------- Constants for registers: ----------------------
4154
---------------------- Constants for registers: ----------------------
4219
  eax - SF_FILE (70)
4155
  eax - SF_FILE (70)
4220
 [ebx] - SSF_WRITE_FILE (3)
4156
 [ebx] - SSF_WRITE_FILE (3)
4221
======================================================================
4157
======================================================================
4222
============ Function 70, subfunction 4 - set end of file. ===========
4158
============ Function 70, subfunction 4 - set end of file. ===========
4223
======================================================================
4159
======================================================================
4224
Parameters:
4160
Parameters:
4225
  * eax = 70 - function number
4161
  * eax = 70 - function number
4226
  * ebx = pointer to the information structure
4162
  * ebx = pointer to the information structure
4227
Format of the information structure:
4163
Format of the information structure:
4228
  * +0: dword: 4 = subfunction number
4164
  * +0: dword: 4 = subfunction number
4229
  * +4: dword: low dword of new file size
4165
  * +4: dword: low dword of new file size
4230
  * +8: dword: high dword of new file size (must be 0 for FAT)
4166
  * +8: dword: high dword of new file size (must be 0 for FAT)
4231
  * +12 = +0xC: dword: 0 (reserved)
4167
  * +12 = +0xC: dword: 0 (reserved)
4232
  * +16 = +0x10: dword: 0 (reserved)
4168
  * +16 = +0x10: dword: 0 (reserved)
4233
  * +20 = +0x14: path, general rules of names forming
4169
  * +20 = +0x14: path, general rules of names forming
4234
Returned value:
4170
Returned value:
4235
  * eax = 0 - success, otherwise file system error code
4171
  * eax = 0 - success, otherwise file system error code
4236
  * ebx destroyed
4172
  * ebx destroyed
4237
Remarks:
4173
Remarks:
4238
  * If new file size is less than old one, file will be truncated.
4174
  * If new file size is less than old one, file will be truncated.
4239
    If new size is greater than old one, file will be expanded, and if
4175
    If new size is greater than old one, file will be expanded, and if
4240
    size difference is up to 16 MB, new space will be cleared with 0.
4176
    size difference is up to 16 MB, new space will be cleared with 0.
4241
  * If there is not enough free space on disk for expansion, the
4177
  * If there is not enough free space on disk for expansion, the
4242
    function will expand to maximum possible size and then return
4178
    function will expand to maximum possible size and then return
4243
    error code 8.
4179
    error code 8.
4244
  * The function is not supported for CD (returns error code 2).
4180
  * The function is not supported for CD (returns error code 2).
4245
 
4181
 
4246
---------------------- Constants for registers: ----------------------
4182
---------------------- Constants for registers: ----------------------
4247
  eax - SF_FILE (70)
4183
  eax - SF_FILE (70)
4248
 [ebx] - SSF_SET_END (4)
4184
 [ebx] - SSF_SET_END (4)
4249
======================================================================
4185
======================================================================
4250
==== Function 70, subfunction 5 - get information on file/folder. ====
4186
==== Function 70, subfunction 5 - get information on file/folder. ====
4251
======================================================================
4187
======================================================================
4252
Parameters:
4188
Parameters:
4253
  * eax = 70 - function number
4189
  * eax = 70 - function number
4254
  * ebx = pointer to the information structure
4190
  * ebx = pointer to the information structure
4255
Format of the information structure:
4191
Format of the information structure:
4256
  * +0: dword: 5 = subfunction number
4192
  * +0: dword: 5 = subfunction number
4257
  * +4: dword: 0 (reserved)
4193
  * +4: dword: 0 (reserved)
4258
  * +8: dword: 0 or flags (for the root folder)
4194
  * +8: dword: 0 or flags (for the root folder)
4259
  * +12 = +0xC: dword: 0 (reserved)
4195
  * +12 = +0xC: dword: 0 (reserved)
4260
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4196
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4261
  * +20 = +0x14: path, general rules of names forming
4197
  * +20 = +0x14: path, general rules of names forming
4262
Returned value:
4198
Returned value:
4263
  * eax = 0 - success, otherwise file system error code
4199
  * eax = 0 - success, otherwise file system error code
4264
  * ebx destroyed
4200
  * ebx destroyed
4265
Information on file is returned in the BDFE format (block of data
4201
Information on file is returned in the BDFE format (block of data
4266
for folder entry), explained in the description of subfunction 1,
4202
for folder entry), explained in the description of subfunction 1,
4267
but without filename, except the root folder.
4203
but without filename, except the root folder.
4268
Remarks:
4204
Remarks:
4269
  * For the root folder returns the partition size,
4205
  * For the root folder returns the partition size,
4270
    and if encoding byte is non-zero, the volume label.
4206
    and if encoding byte is non-zero, the volume label.
4271
  * For the device returns only the size.
4207
  * For the device returns only the size.
4272
 
4208
 
4273
---------------------- Constants for registers: ----------------------
4209
---------------------- Constants for registers: ----------------------
4274
  eax - SF_FILE (70)
4210
  eax - SF_FILE (70)
4275
 [ebx] - SSF_GET_INFO (5)
4211
 [ebx] - SSF_GET_INFO (5)
4276
======================================================================
4212
======================================================================
4277
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4213
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4278
======================================================================
4214
======================================================================
4279
Parameters:
4215
Parameters:
4280
  * eax = 70 - function number
4216
  * eax = 70 - function number
4281
  * ebx = pointer to the information structure
4217
  * ebx = pointer to the information structure
4282
Format of the information structure:
4218
Format of the information structure:
4283
  * +0: dword: 6 = subfunction number
4219
  * +0: dword: 6 = subfunction number
4284
  * +4: dword: 0 (reserved)
4220
  * +4: dword: 0 (reserved)
4285
  * +8: dword: 0 (reserved)
4221
  * +8: dword: 0 (reserved)
4286
  * +12 = +0xC: dword: 0 (reserved)
4222
  * +12 = +0xC: dword: 0 (reserved)
4287
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4223
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4288
  * +20 = +0x14: path, general rules of names forming
4224
  * +20 = +0x14: path, general rules of names forming
4289
Returned value:
4225
Returned value:
4290
  * eax = 0 - success, otherwise file system error code
4226
  * eax = 0 - success, otherwise file system error code
4291
  * ebx destroyed
4227
  * ebx destroyed
4292
File attributes are first 32 bytes in BDFE (block of data
4228
File attributes are first 32 bytes in BDFE (block of data
4293
for folder entry), explained in the description of subfunction 1
4229
for folder entry), explained in the description of subfunction 1
4294
(that is, without name and size of file). Attribute
4230
(that is, without name and size of file). Attribute
4295
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4231
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4296
Byte +4 (name format) is ignored.
4232
Byte +4 (name format) is ignored.
4297
Remarks:
4233
Remarks:
4298
  * The function does not support virtual folders such as /, /rd and
4234
  * The function does not support virtual folders such as /, /rd and
4299
    root folders like /rd/1.
4235
    root folders like /rd/1.
4300
  * The function is not supported for CD (returns error code 2).
4236
  * The function is not supported for CD (returns error code 2).
4301
 
4237
 
4302
---------------------- Constants for registers: ----------------------
4238
---------------------- Constants for registers: ----------------------
4303
  eax - SF_FILE (70)
4239
  eax - SF_FILE (70)
4304
 [ebx] - SSF_SET_INFO (6)
4240
 [ebx] - SSF_SET_INFO (6)
4305
======================================================================
4241
======================================================================
4306
=========== Function 70, subfunction 7 - start application. ==========
4242
=========== Function 70, subfunction 7 - start application. ==========
4307
======================================================================
4243
======================================================================
4308
Parameters:
4244
Parameters:
4309
  * eax = 70 - function number
4245
  * eax = 70 - function number
4310
  * ebx = pointer to the information structure
4246
  * ebx = pointer to the information structure
4311
Format of the information structure:
4247
Format of the information structure:
4312
  * +0: dword: 7 = subfunction number
4248
  * +0: dword: 7 = subfunction number
4313
  * +4: dword: flags field:
4249
  * +4: dword: flags field:
4314
    * bit 0: start process as debugged
4250
    * bit 0: start process as debugged
4315
    * other bits are reserved and must be set to 0
4251
    * other bits are reserved and must be set to 0
4316
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4252
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4317
  * +12 = +0xC: dword: 0 (reserved)
4253
  * +12 = +0xC: dword: 0 (reserved)
4318
  * +16 = +0x10: dword: 0 (reserved)
4254
  * +16 = +0x10: dword: 0 (reserved)
4319
  * +20 = +0x14: path, general rules of names forming
4255
  * +20 = +0x14: path, general rules of names forming
4320
Returned value:
4256
Returned value:
4321
  * eax > 0 - program is loaded, eax contains PID
4257
  * eax > 0 - program is loaded, eax contains PID
4322
  * eax < 0 - an error has occurred, -eax contains
4258
  * eax < 0 - an error has occurred, -eax contains
4323
    file system error code
4259
    file system error code
4324
  * ebx destroyed
4260
  * ebx destroyed
4325
Remarks:
4261
Remarks:
4326
  * Command line must be terminated by the character with the code 0
4262
  * Command line must be terminated by the character with the code 0
4327
    (ASCIIZ-string); function takes into account either all characters
4263
    (ASCIIZ-string); function takes into account either all characters
4328
    up to terminating zero inclusively or first 256 character
4264
    up to terminating zero inclusively or first 256 character
4329
    regarding what is less.
4265
    regarding what is less.
4330
  * If the process is started as debugged, it is created in
4266
  * If the process is started as debugged, it is created in
4331
    the suspended state; to run use subfunction 5 of function 69.
4267
    the suspended state; to run use subfunction 5 of function 69.
4332
 
4268
 
4333
---------------------- Constants for registers: ----------------------
4269
---------------------- Constants for registers: ----------------------
4334
  eax - SF_FILE (70)
4270
  eax - SF_FILE (70)
4335
 [ebx] - SSF_START_APP (7)
4271
 [ebx] - SSF_START_APP (7)
4336
======================================================================
4272
======================================================================
4337
========== Function 70, subfunction 8 - delete file/folder. ==========
4273
========== Function 70, subfunction 8 - delete file/folder. ==========
4338
======================================================================
4274
======================================================================
4339
Parameters:
4275
Parameters:
4340
  * eax = 70 - function number
4276
  * eax = 70 - function number
4341
  * ebx = pointer to the information structure
4277
  * ebx = pointer to the information structure
4342
Format of the information structure:
4278
Format of the information structure:
4343
  * +0: dword: 8 = subfunction number
4279
  * +0: dword: 8 = subfunction number
4344
  * +4: dword: 0 (reserved)
4280
  * +4: dword: 0 (reserved)
4345
  * +8: dword: 0 (reserved)
4281
  * +8: dword: 0 (reserved)
4346
  * +12 = +0xC: dword: 0 (reserved)
4282
  * +12 = +0xC: dword: 0 (reserved)
4347
  * +16 = +0x10: dword: 0 (reserved)
4283
  * +16 = +0x10: dword: 0 (reserved)
4348
  * +20 = +0x14: path, general rules of names forming
4284
  * +20 = +0x14: path, general rules of names forming
4349
Returned value:
4285
Returned value:
4350
  * eax = 0 - success, otherwise file system error code
4286
  * eax = 0 - success, otherwise file system error code
4351
  * ebx destroyed
4287
  * ebx destroyed
4352
Remarks:
4288
Remarks:
4353
  * The function is not supported for CD (returns error code 2).
4289
  * The function is not supported for CD (returns error code 2).
4354
  * The function can delete only empty folders (attempt to delete
4290
  * The function can delete only empty folders (attempt to delete
4355
    nonempty folder results in error with code 10, "access denied").
4291
    nonempty folder results in error with code 10, "access denied").
4356
 
4292
 
4357
---------------------- Constants for registers: ----------------------
4293
---------------------- Constants for registers: ----------------------
4358
  eax - SF_FILE (70)
4294
  eax - SF_FILE (70)
4359
 [ebx] - SSF_DELETE (8)
4295
 [ebx] - SSF_DELETE (8)
4360
======================================================================
4296
======================================================================
4361
============= Function 70, subfunction 9 - create folder. ============
4297
============= Function 70, subfunction 9 - create folder. ============
4362
======================================================================
4298
======================================================================
4363
Parameters:
4299
Parameters:
4364
  * eax = 70 - function number
4300
  * eax = 70 - function number
4365
  * ebx = pointer to the information structure
4301
  * ebx = pointer to the information structure
4366
Format of the information structure:
4302
Format of the information structure:
4367
  * +0: dword: 9 = subfunction number
4303
  * +0: dword: 9 = subfunction number
4368
  * +4: dword: 0 (reserved)
4304
  * +4: dword: 0 (reserved)
4369
  * +8: dword: 0 (reserved)
4305
  * +8: dword: 0 (reserved)
4370
  * +12 = +0xC: dword: 0 (reserved)
4306
  * +12 = +0xC: dword: 0 (reserved)
4371
  * +16 = +0x10: dword: 0 (reserved)
4307
  * +16 = +0x10: dword: 0 (reserved)
4372
  * +20 = +0x14: path, general rules of names forming
4308
  * +20 = +0x14: path, general rules of names forming
4373
Returned value:
4309
Returned value:
4374
  * eax = 0 - success, otherwise file system error code
4310
  * eax = 0 - success, otherwise file system error code
4375
  * ebx destroyed
4311
  * ebx destroyed
4376
Remarks:
4312
Remarks:
4377
  * The function is not supported for CD (returns error code 2).
4313
  * The function is not supported for CD (returns error code 2).
4378
  * The parent folder must already exist.
4314
  * The parent folder must already exist.
4379
  * If target folder already exists, function returns success (eax=0).
4315
  * If target folder already exists, function returns success (eax=0).
4380
 
4316
 
4381
---------------------- Constants for registers: ----------------------
4317
---------------------- Constants for registers: ----------------------
4382
  eax - SF_FILE (70)
4318
  eax - SF_FILE (70)
4383
 [ebx] - SSF_CREATE_FOLDER (9)
4319
 [ebx] - SSF_CREATE_FOLDER (9)
4384
======================================================================
4320
======================================================================
4385
============= Function 70, subfunction 10 - rename/move. =============
4321
============= Function 70, subfunction 10 - rename/move. =============
4386
======================================================================
4322
======================================================================
4387
Parameters:
4323
Parameters:
4388
  * eax = 70 - function number
4324
  * eax = 70 - function number
4389
  * ebx = pointer to the information structure
4325
  * ebx = pointer to the information structure
4390
Format of the information structure:
4326
Format of the information structure:
4391
  * +0: dword: 10 = subfunction number
4327
  * +0: dword: 10 = subfunction number
4392
  * +4: dword: 0 (reserved)
4328
  * +4: dword: 0 (reserved)
4393
  * +8: dword: 0 (reserved)
4329
  * +8: dword: 0 (reserved)
4394
  * +12 = +0xC: dword: 0 (reserved)
4330
  * +12 = +0xC: dword: 0 (reserved)
4395
  * +16 = +0x10: dword: pointer to the new name/path string
4331
  * +16 = +0x10: dword: pointer to the new name/path string
4396
  * +20 = +0x14: path, general rules of names forming
4332
  * +20 = +0x14: path, general rules of names forming
4397
Returned value:
4333
Returned value:
4398
  * eax = 0 - success, otherwise file system error code
4334
  * eax = 0 - success, otherwise file system error code
4399
  * ebx destroyed
4335
  * ebx destroyed
4400
Remarks:
4336
Remarks:
4401
  * New path forming differs from general rules:
4337
  * New path forming differs from general rules:
4402
    relative path relates to the target's parent folder,
4338
    relative path relates to the target's parent folder,
4403
    absolute path relates to the partition's root folder.
4339
    absolute path relates to the partition's root folder.
4404
======================================================================
4340
======================================================================
4405
================== Function 71 - set window caption ==================
4341
================== Function 71 - set window caption ==================
4406
======================================================================
4342
======================================================================
4407
Parameters:
4343
Parameters:
4408
  * eax = 71 - function number
4344
  * eax = 71 - function number
4409
  * ebx = 1
4345
  * ebx = 1
4410
  * ecx = pointer to zero terminated string,
4346
  * ecx = pointer to zero terminated string,
4411
    the string may start with an encoding byte:
4347
    the string may start with an encoding byte:
4412
    1 = cp866
4348
    1 = cp866
4413
    2 = UTF-16LE
4349
    2 = UTF-16LE
4414
    3 = UTF-8
4350
    3 = UTF-8
4415
  or:
4351
  or:
4416
  * ebx = 2
4352
  * ebx = 2
4417
  * ecx = pointer to zero terminated string
4353
  * ecx = pointer to zero terminated string
4418
  * dl  = string encoding
4354
  * dl  = string encoding
4419
Returned value:
4355
Returned value:
4420
  * function does not return value
4356
  * function does not return value
4421
Remarks:
4357
Remarks:
4422
  * Pass NULL in ecx to remove caption.
4358
  * Pass NULL in ecx to remove caption.
4423
 
4359
 
4424
---------------------- Constants for registers: ----------------------
4360
---------------------- Constants for registers: ----------------------
4425
  eax - SF_SET_CAPTION (71)
4361
  eax - SF_SET_CAPTION (71)
4426
======================================================================
4362
======================================================================
4427
=============== Function 72 - send message to a window. ==============
4363
=============== Function 72 - send message to a window. ==============
4428
======================================================================
4364
======================================================================
4429
 
4365
 
4430
- Subfunction 1 - send message with parameter to the active window. --
4366
- Subfunction 1 - send message with parameter to the active window. --
4431
Parameters:
4367
Parameters:
4432
  * eax = 72 - function number
4368
  * eax = 72 - function number
4433
  * ebx = 1 - subfunction number
4369
  * ebx = 1 - subfunction number
4434
  * ecx = event code: 2 or 3
4370
  * ecx = event code: 2 or 3
4435
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
4371
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
4436
Returned value:
4372
Returned value:
4437
  * eax = 0 - success
4373
  * eax = 0 - success
4438
  * eax = 1 - buffer is full
4374
  * eax = 1 - buffer is full
4439
 
4375
 
4440
---------------------- Constants for registers: ----------------------
4376
---------------------- Constants for registers: ----------------------
4441
  eax - SF_SEND_MESSAGE (72)
4377
  eax - SF_SEND_MESSAGE (72)
4442
======================================================================
4378
======================================================================
4443
===================== Function 73 - blit bitmap  =====================
4379
===================== Function 73 - blit bitmap  =====================
4444
======================================================================
4380
======================================================================
4445
 
4381
 
4446
Parameters:
4382
Parameters:
4447
  * eax = 73 - function number
4383
  * eax = 73 - function number
4448
 
4384
 
4449
  * ebx = ROP and optional flags
4385
  * ebx = ROP and optional flags
4450
     31      30 29 28       6 5  4 3   0
4386
     31      30 29 28       6 5  4 3   0
4451
     [reserved][CR][reserved][T][B][ROP]
4387
     [reserved][CR][reserved][T][B][ROP]
4452
     ROP - raster operation code
4388
     ROP - raster operation code
4453
        0: Copy
4389
        0: Copy
4454
     1-15: reserved
4390
     1-15: reserved
4455
     B   - blit into the background surface
4391
     B   - blit into the background surface
4456
     T   - transparent blit
4392
     T   - transparent blit
4457
     CR  - blit client relative
4393
     CR  - blit client relative
4458
 
4394
 
4459
  * ecx = pointer to the function parameters
4395
  * ecx = pointer to the function parameters
4460
        destination offset and clipping
4396
        destination offset and clipping
4461
     +0 signed dword: destination rectangle X offset from the window
4397
     +0 signed dword: destination rectangle X offset from the window
4462
                      top-left corner
4398
                      top-left corner
4463
     +4 signed dword: destination rectangle Y offset from the window
4399
     +4 signed dword: destination rectangle Y offset from the window
4464
                      top-left corner
4400
                      top-left corner
4465
     +8 dword:        destination rectangle width
4401
     +8 dword:        destination rectangle width
4466
    +12 dword:        destination rectangle height
4402
    +12 dword:        destination rectangle height
4467
 
4403
 
4468
        source offset and clipping
4404
        source offset and clipping
4469
    +16 signed dword: source rectangle X offset from the bitmap
4405
    +16 signed dword: source rectangle X offset from the bitmap
4470
                      top-left corner
4406
                      top-left corner
4471
    +20 signed dword: source rectangle Y offset from the bitmap
4407
    +20 signed dword: source rectangle Y offset from the bitmap
4472
                      top-left corner
4408
                      top-left corner
4473
    +24 dword:        source rectangle width
4409
    +24 dword:        source rectangle width
4474
    +28 dword:        source rectangle height
4410
    +28 dword:        source rectangle height
4475
 
4411
 
4476
    +32: dword: bitmap data - must be 32bpp
4412
    +32: dword: bitmap data - must be 32bpp
4477
    +36: dword: size of the bitmap row in bytes
4413
    +36: dword: size of the bitmap row in bytes
4478
 
4414
 
4479
Returned value:
4415
Returned value:
4480
  * function does not return value
4416
  * function does not return value
4481
 
4417
 
4482
---------------------- Constants for registers: ----------------------
4418
---------------------- Constants for registers: ----------------------
4483
  eax - SF_BLITTER (73)
4419
  eax - SF_BLITTER (73)
4484
======================================================================
4420
======================================================================
4485
= Function 74, Subfunction 255, Get number of active network devices. =
4421
= Function 74, Subfunction 255, Get number of active network devices. =
4486
======================================================================
4422
======================================================================
4487
Parameters:
4423
Parameters:
4488
  * eax = 74 - function number
4424
  * eax = 74 - function number
4489
  * bl = 255 - subfunction number
4425
  * bl = 255 - subfunction number
4490
Returned value:
4426
Returned value:
4491
  * eax = number of active network devices
4427
  * eax = number of active network devices
4492
 
4428
 
4493
---------------------- Constants for registers: ----------------------
4429
---------------------- Constants for registers: ----------------------
4494
  eax - SF_NETWORK_GET (74)
4430
  eax - SF_NETWORK_GET (74)
4495
   bl - SSF_DEVICE_COUNT (255)
4431
   bl - SSF_DEVICE_COUNT (255)
4496
======================================================================
4432
======================================================================
4497
======== Function 74, Subfunction 0, Get network device type. ========
4433
======== Function 74, Subfunction 0, Get network device type. ========
4498
======================================================================
4434
======================================================================
4499
Parameters:
4435
Parameters:
4500
  * eax = 74 - function number
4436
  * eax = 74 - function number
4501
  * bl = 0 - subfunction number
4437
  * bl = 0 - subfunction number
4502
  * bh = device number
4438
  * bh = device number
4503
Returned value:
4439
Returned value:
4504
  * eax = device type number, -1 on error
4440
  * eax = device type number, -1 on error
4505
 
4441
 
4506
---------------------- Constants for registers: ----------------------
4442
---------------------- Constants for registers: ----------------------
4507
  eax - SF_NETWORK_GET (74)
4443
  eax - SF_NETWORK_GET (74)
4508
   bl - SSF_DEVICE_TYPE (0)
4444
   bl - SSF_DEVICE_TYPE (0)
4509
======================================================================
4445
======================================================================
4510
======== Function 74, Subfunction 1, Get network device name. ========
4446
======== Function 74, Subfunction 1, Get network device name. ========
4511
======================================================================
4447
======================================================================
4512
Parameters:
4448
Parameters:
4513
  * eax = 74 - function number
4449
  * eax = 74 - function number
4514
  * bl = 1 - subfunction number
4450
  * bl = 1 - subfunction number
4515
  * bh = device number
4451
  * bh = device number
4516
  * ecx = pointer to 64 byte buffer
4452
  * ecx = pointer to 64 byte buffer
4517
Returned value:
4453
Returned value:
4518
  * eax = -1 on error
4454
  * eax = -1 on error
4519
  * The network device name is written into the buffer, on success
4455
  * The network device name is written into the buffer, on success
4520
 
4456
 
4521
---------------------- Constants for registers: ----------------------
4457
---------------------- Constants for registers: ----------------------
4522
  eax - SF_NETWORK_GET (74)
4458
  eax - SF_NETWORK_GET (74)
4523
   bl - SSF_DEVICE_NAME (1)
4459
   bl - SSF_DEVICE_NAME (1)
4524
======================================================================
4460
======================================================================
4525
========= Function 74, Subfunction 2, Reset network device. ==========
4461
========= Function 74, Subfunction 2, Reset network device. ==========
4526
======================================================================
4462
======================================================================
4527
Parameters:
4463
Parameters:
4528
  * eax = 74 - function number
4464
  * eax = 74 - function number
4529
  * bl = 2 - subfunction number
4465
  * bl = 2 - subfunction number
4530
  * bh = device number
4466
  * bh = device number
4531
Returned value:
4467
Returned value:
4532
  * eax = -1 on error
4468
  * eax = -1 on error
4533
 
4469
 
4534
---------------------- Constants for registers: ----------------------
4470
---------------------- Constants for registers: ----------------------
4535
  eax - SF_NETWORK_GET (74)
4471
  eax - SF_NETWORK_GET (74)
4536
   bl - SSF_RESET_DEVICE (2)
4472
   bl - SSF_RESET_DEVICE (2)
4537
======================================================================
4473
======================================================================
4538
========== Function 74, Subfunction 3, Stop network device. ==========
4474
========== Function 74, Subfunction 3, Stop network device. ==========
4539
======================================================================
4475
======================================================================
4540
Parameters:
4476
Parameters:
4541
  * eax = 74 - function number
4477
  * eax = 74 - function number
4542
  * bl = 3 - subfunction number
4478
  * bl = 3 - subfunction number
4543
  * bh = device number
4479
  * bh = device number
4544
Returned value:
4480
Returned value:
4545
  * eax = -1 on error
4481
  * eax = -1 on error
4546
 
4482
 
4547
---------------------- Constants for registers: ----------------------
4483
---------------------- Constants for registers: ----------------------
4548
  eax - SF_NETWORK_GET (74)
4484
  eax - SF_NETWORK_GET (74)
4549
   bl - SSF_STOP_DEVICE (3)
4485
   bl - SSF_STOP_DEVICE (3)
4550
======================================================================
4486
======================================================================
4551
=========== Function 74, Subfunction 4, Get device pointer. ==========
4487
=========== Function 74, Subfunction 4, Get device pointer. ==========
4552
======================================================================
4488
======================================================================
4553
Parameters:
4489
Parameters:
4554
  * eax = 74 - function number
4490
  * eax = 74 - function number
4555
  * bl = 4 - subfunction number
4491
  * bl = 4 - subfunction number
4556
  * bh = device number
4492
  * bh = device number
4557
Returned value:
4493
Returned value:
4558
  * eax = device pointer, -1 on error
4494
  * eax = device pointer, -1 on error
4559
 
4495
 
4560
---------------------- Constants for registers: ----------------------
4496
---------------------- Constants for registers: ----------------------
4561
  eax - SF_NETWORK_GET (74)
4497
  eax - SF_NETWORK_GET (74)
4562
   bl - SSF_DEVICE_POINTER (4)
4498
   bl - SSF_DEVICE_POINTER (4)
4563
======================================================================
4499
======================================================================
4564
========= Function 74, Subfunction 6, Get packet TX counter. =========
4500
========= Function 74, Subfunction 6, Get packet TX counter. =========
4565
======================================================================
4501
======================================================================
4566
Parameters:
4502
Parameters:
4567
  * eax = 74 - function number
4503
  * eax = 74 - function number
4568
  * bl = 6 - subfunction number
4504
  * bl = 6 - subfunction number
4569
  * bh = device number
4505
  * bh = device number
4570
Returned value:
4506
Returned value:
4571
  * eax = Number of packets sent since device start, -1 on error
4507
  * eax = Number of packets sent since device start, -1 on error
4572
 
4508
 
4573
---------------------- Constants for registers: ----------------------
4509
---------------------- Constants for registers: ----------------------
4574
  eax - SF_NETWORK_GET (74)
4510
  eax - SF_NETWORK_GET (74)
4575
   bl - SSF_TX_PACKET_COUNT (6)
4511
   bl - SSF_TX_PACKET_COUNT (6)
4576
======================================================================
4512
======================================================================
4577
========= Function 74, Subfunction 7, Get packet RX counter. =========
4513
========= Function 74, Subfunction 7, Get packet RX counter. =========
4578
======================================================================
4514
======================================================================
4579
Parameters:
4515
Parameters:
4580
  * eax = 74 - function number
4516
  * eax = 74 - function number
4581
  * bl = 7 - subfunction number
4517
  * bl = 7 - subfunction number
4582
  * bh = device number
4518
  * bh = device number
4583
Returned value:
4519
Returned value:
4584
  * eax = Number of packets received since device start, -1 on error
4520
  * eax = Number of packets received since device start, -1 on error
4585
 
4521
 
4586
---------------------- Constants for registers: ----------------------
4522
---------------------- Constants for registers: ----------------------
4587
  eax - SF_NETWORK_GET (74)
4523
  eax - SF_NETWORK_GET (74)
4588
   bl - SSF_RX_PACKET_COUNT (7)
4524
   bl - SSF_RX_PACKET_COUNT (7)
4589
======================================================================
4525
======================================================================
4590
========== Function 74, Subfunction 8, Get TX byte counter. ==========
4526
========== Function 74, Subfunction 8, Get TX byte counter. ==========
4591
======================================================================
4527
======================================================================
4592
Parameters:
4528
Parameters:
4593
  * eax = 74 - function number
4529
  * eax = 74 - function number
4594
  * bl = 8 - subfunction number
4530
  * bl = 8 - subfunction number
4595
  * bh = device number
4531
  * bh = device number
4596
Returned value:
4532
Returned value:
4597
  * eax = Number of bytes sent since device start (lower dword)
4533
  * eax = Number of bytes sent since device start (lower dword)
4598
          -1 on error
4534
          -1 on error
4599
  * ebx = Number of bytes sent since device start (higher dword)
4535
  * ebx = Number of bytes sent since device start (higher dword)
4600
 
4536
 
4601
---------------------- Constants for registers: ----------------------
4537
---------------------- Constants for registers: ----------------------
4602
  eax - SF_NETWORK_GET (74)
4538
  eax - SF_NETWORK_GET (74)
4603
   bl - SSF_TX_BYTE_COUNT (8)
4539
   bl - SSF_TX_BYTE_COUNT (8)
4604
======================================================================
4540
======================================================================
4605
========== Function 74, Subfunction 9, Get RX byte counter. ==========
4541
========== Function 74, Subfunction 9, Get RX byte counter. ==========
4606
======================================================================
4542
======================================================================
4607
Parameters:
4543
Parameters:
4608
  * eax = 74 - function number
4544
  * eax = 74 - function number
4609
  * bl = 9 - subfunction number
4545
  * bl = 9 - subfunction number
4610
  * bh = device number
4546
  * bh = device number
4611
Returned value:
4547
Returned value:
4612
  * eax = Number of bytes received since device start (lower dword)
4548
  * eax = Number of bytes received since device start (lower dword)
4613
          -1 on error
4549
          -1 on error
4614
  * ebx = Number of bytes received since device start (higher dword)
4550
  * ebx = Number of bytes received since device start (higher dword)
4615
 
4551
 
4616
---------------------- Constants for registers: ----------------------
4552
---------------------- Constants for registers: ----------------------
4617
  eax - SF_NETWORK_GET (74)
4553
  eax - SF_NETWORK_GET (74)
4618
   bl - SSF_RX_BYTE_COUNT (9)
4554
   bl - SSF_RX_BYTE_COUNT (9)
4619
======================================================================
4555
======================================================================
4620
========== Function 74, Subfunction 10, Get link status. =============
4556
========== Function 74, Subfunction 10, Get link status. =============
4621
======================================================================
4557
======================================================================
4622
Parameters:
4558
Parameters:
4623
  * eax = 74 - function number
4559
  * eax = 74 - function number
4624
  * bl = 10 - subfunction number
4560
  * bl = 10 - subfunction number
4625
  * bh = device number
4561
  * bh = device number
4626
Returned value:
4562
Returned value:
4627
  * eax = link status, -1 on error
4563
  * eax = link status, -1 on error
4628
 
4564
 
4629
  Link status:
4565
  Link status:
4630
    ETH_LINK_DOWN   =    0b         ; Link is down
4566
    ETH_LINK_DOWN   =    0b         ; Link is down
4631
    ETH_LINK_UNKNOWN=    1b         ; There could be an active link
4567
    ETH_LINK_UNKNOWN=    1b         ; There could be an active link
4632
    ETH_LINK_FD     =   10b         ; full duplex flag
4568
    ETH_LINK_FD     =   10b         ; full duplex flag
4633
    ETH_LINK_10M    =  100b         ; 10 mbit
4569
    ETH_LINK_10M    =  100b         ; 10 mbit
4634
    ETH_LINK_100M   = 1000b         ; 100 mbit
4570
    ETH_LINK_100M   = 1000b         ; 100 mbit
4635
    ETH_LINK_1G     = 1100b         ; gigabit
4571
    ETH_LINK_1G     = 1100b         ; gigabit
4636
 
4572
 
4637
---------------------- Constants for registers: ----------------------
4573
---------------------- Constants for registers: ----------------------
4638
  eax - SF_NETWORK_GET (74)
4574
  eax - SF_NETWORK_GET (74)
4639
   bl - SSF_LINK_STATUS (10)
4575
   bl - SSF_LINK_STATUS (10)
4640
======================================================================
4576
======================================================================
4641
==== Function 74, Subfunction 11, Get TX error packets counter. ======
4577
==== Function 74, Subfunction 11, Get TX error packets counter. ======
4642
======================================================================
4578
======================================================================
4643
Parameters:
4579
Parameters:
4644
  * eax = 74 - function number
4580
  * eax = 74 - function number
4645
  * bl = 11 - subfunction number
4581
  * bl = 11 - subfunction number
4646
  * bh = device number
4582
  * bh = device number
4647
Returned value:
4583
Returned value:
4648
  * eax = Number of erroneous packets received since device start, -1 on error
4584
  * eax = Number of erroneous packets received since device start, -1 on error
4649
 
4585
 
4650
---------------------- Constants for registers: ----------------------
4586
---------------------- Constants for registers: ----------------------
4651
  eax - SF_NETWORK_GET (74)
4587
  eax - SF_NETWORK_GET (74)
4652
   bl - SSF_TX_PACKET_ERROR_COUNT (11)   
4588
   bl - SSF_TX_PACKET_ERROR_COUNT (11)   
4653
======================================================================
4589
======================================================================
4654
=== Function 74, Subfunction 12, Get TX dropped packets counter. =====
4590
=== Function 74, Subfunction 12, Get TX dropped packets counter. =====
4655
======================================================================
4591
======================================================================
4656
Parameters:
4592
Parameters:
4657
  * eax = 74 - function number
4593
  * eax = 74 - function number
4658
  * bl = 12 - subfunction number
4594
  * bl = 12 - subfunction number
4659
  * bh = device number
4595
  * bh = device number
4660
Returned value:
4596
Returned value:
4661
  * eax = Number of dropped packets since device start, -1 on error
4597
  * eax = Number of dropped packets since device start, -1 on error
4662
 
4598
 
4663
---------------------- Constants for registers: ----------------------
4599
---------------------- Constants for registers: ----------------------
4664
  eax - SF_NETWORK_GET (74)
4600
  eax - SF_NETWORK_GET (74)
4665
   bl - SSF_TX_PACKET_DROP_COUNT (12)    
4601
   bl - SSF_TX_PACKET_DROP_COUNT (12)    
4666
======================================================================
4602
======================================================================
4667
==== Function 74, Subfunction 13, Get TX missed packets counter. =====
4603
==== Function 74, Subfunction 13, Get TX missed packets counter. =====
4668
======================================================================
4604
======================================================================
4669
Parameters:
4605
Parameters:
4670
  * eax = 74 - function number
4606
  * eax = 74 - function number
4671
  * bl = 13 - subfunction number
4607
  * bl = 13 - subfunction number
4672
  * bh = device number
4608
  * bh = device number
4673
Returned value:
4609
Returned value:
4674
  * eax = Number of missed packets since device start, -1 on error
4610
  * eax = Number of missed packets since device start, -1 on error
4675
 
4611
 
4676
---------------------- Constants for registers: ----------------------
4612
---------------------- Constants for registers: ----------------------
4677
  eax - SF_NETWORK_GET (74)
4613
  eax - SF_NETWORK_GET (74)
4678
   bl - SSF_TX_PACKET_MISS_COUNT (13)    
4614
   bl - SSF_TX_PACKET_MISS_COUNT (13)    
4679
   ======================================================================
4615
   ======================================================================
4680
==== Function 74, Subfunction 14, Get RX error packets counter. ======
4616
==== Function 74, Subfunction 14, Get RX error packets counter. ======
4681
======================================================================
4617
======================================================================
4682
Parameters:
4618
Parameters:
4683
  * eax = 74 - function number
4619
  * eax = 74 - function number
4684
  * bl = 14 - subfunction number
4620
  * bl = 14 - subfunction number
4685
  * bh = device number
4621
  * bh = device number
4686
Returned value:
4622
Returned value:
4687
  * eax = Number of erroneous packets received since device start, -1 on error
4623
  * eax = Number of erroneous packets received since device start, -1 on error
4688
 
4624
 
4689
---------------------- Constants for registers: ----------------------
4625
---------------------- Constants for registers: ----------------------
4690
  eax - SF_NETWORK_GET (74)
4626
  eax - SF_NETWORK_GET (74)
4691
   bl - SSF_RX_PACKET_ERROR_COUNT (14)   
4627
   bl - SSF_RX_PACKET_ERROR_COUNT (14)   
4692
======================================================================
4628
======================================================================
4693
=== Function 74, Subfunction 15, Get RX dropped packets counter. =====
4629
=== Function 74, Subfunction 15, Get RX dropped packets counter. =====
4694
======================================================================
4630
======================================================================
4695
Parameters:
4631
Parameters:
4696
  * eax = 74 - function number
4632
  * eax = 74 - function number
4697
  * bl = 15 - subfunction number
4633
  * bl = 15 - subfunction number
4698
  * bh = device number
4634
  * bh = device number
4699
Returned value:
4635
Returned value:
4700
  * eax = Number of dropped packets since device start, -1 on error
4636
  * eax = Number of dropped packets since device start, -1 on error
4701
 
4637
 
4702
---------------------- Constants for registers: ----------------------
4638
---------------------- Constants for registers: ----------------------
4703
  eax - SF_NETWORK_GET (74)
4639
  eax - SF_NETWORK_GET (74)
4704
   bl - SSF_RX_PACKET_DROP_COUNT (12)    
4640
   bl - SSF_RX_PACKET_DROP_COUNT (12)    
4705
======================================================================
4641
======================================================================
4706
==== Function 74, Subfunction 16, Get RX missed packets counter. =====
4642
==== Function 74, Subfunction 16, Get RX missed packets counter. =====
4707
======================================================================
4643
======================================================================
4708
Parameters:
4644
Parameters:
4709
  * eax = 74 - function number
4645
  * eax = 74 - function number
4710
  * bl = 16 - subfunction number
4646
  * bl = 16 - subfunction number
4711
  * bh = device number
4647
  * bh = device number
4712
Returned value:
4648
Returned value:
4713
  * eax = Number of missed packets since device start, -1 on error
4649
  * eax = Number of missed packets since device start, -1 on error
4714
 
4650
 
4715
---------------------- Constants for registers: ----------------------
4651
---------------------- Constants for registers: ----------------------
4716
  eax - SF_NETWORK_GET (74)
4652
  eax - SF_NETWORK_GET (74)
4717
   bl - SSF_RX_PACKET_MISS_COUNT (16)  
4653
   bl - SSF_RX_PACKET_MISS_COUNT (16)  
4718
======================================================================
4654
======================================================================
4719
============== Function 75, Subfunction 0, Open socket. ==============
4655
============== Function 75, Subfunction 0, Open socket. ==============
4720
======================================================================
4656
======================================================================
4721
Parameters:
4657
Parameters:
4722
  * eax = 75 - function number
4658
  * eax = 75 - function number
4723
  * bl = 0 - subfunction number
4659
  * bl = 0 - subfunction number
4724
  * ecx = domain
4660
  * ecx = domain
4725
  * edx = type
4661
  * edx = type
4726
  * esi = protocol
4662
  * esi = protocol
4727
Returned value:
4663
Returned value:
4728
  * eax = socket number, -1 on error
4664
  * eax = socket number, -1 on error
4729
  * ebx = errorcode
4665
  * ebx = errorcode
4730
 
4666
 
4731
---------------------- Constants for registers: ----------------------
4667
---------------------- Constants for registers: ----------------------
4732
  eax - SF_NETWORK_SOCKET (75)
4668
  eax - SF_NETWORK_SOCKET (75)
4733
   bl - SSF_OPEN (0)
4669
   bl - SSF_OPEN (0)
4734
======================================================================
4670
======================================================================
4735
============= Function 75, Subfunction 1, Close socket. ==============
4671
============= Function 75, Subfunction 1, Close socket. ==============
4736
======================================================================
4672
======================================================================
4737
Parameters:
4673
Parameters:
4738
  * eax = 75 - function number
4674
  * eax = 75 - function number
4739
  * bl = 1 - subfunction number
4675
  * bl = 1 - subfunction number
4740
  * ecx = socket number
4676
  * ecx = socket number
4741
Returned value:
4677
Returned value:
4742
  * eax = -1 on error
4678
  * eax = -1 on error
4743
  * ebx = errorcode
4679
  * ebx = errorcode
4744
 
4680
 
4745
---------------------- Constants for registers: ----------------------
4681
---------------------- Constants for registers: ----------------------
4746
  eax - SF_NETWORK_SOCKET (75)
4682
  eax - SF_NETWORK_SOCKET (75)
4747
   bl - SSF_CLOSE (1)
4683
   bl - SSF_CLOSE (1)
4748
======================================================================
4684
======================================================================
4749
================== Function 75, Subfunction 2, Bind. =================
4685
================== Function 75, Subfunction 2, Bind. =================
4750
======================================================================
4686
======================================================================
4751
Parameters:
4687
Parameters:
4752
  * eax = 75 - function number
4688
  * eax = 75 - function number
4753
  * bl = 2 - subfunction number
4689
  * bl = 2 - subfunction number
4754
  * ecx = socket number
4690
  * ecx = socket number
4755
  * edx = pointer to sockaddr structure
4691
  * edx = pointer to sockaddr structure
4756
  * esi = length of sockaddr structure
4692
  * esi = length of sockaddr structure
4757
Format of SockAddr structure:
4693
Format of SockAddr structure:
4758
  * +0: Word: Family
4694
  * +0: Word: Family
4759
  * +2: 14*Byte: Data
4695
  * +2: 14*Byte: Data
4760
Returned value:
4696
Returned value:
4761
  * eax = -1 on error
4697
  * eax = -1 on error
4762
  * ebx = errorcode
4698
  * ebx = errorcode
4763
 
4699
 
4764
---------------------- Constants for registers: ----------------------
4700
---------------------- Constants for registers: ----------------------
4765
  eax - SF_NETWORK_SOCKET (75)
4701
  eax - SF_NETWORK_SOCKET (75)
4766
   bl - SSF_BIND (2)
4702
   bl - SSF_BIND (2)
4767
======================================================================
4703
======================================================================
4768
================= Function 75, Subfunction 3, Listen. ================
4704
================= Function 75, Subfunction 3, Listen. ================
4769
======================================================================
4705
======================================================================
4770
Parameters:
4706
Parameters:
4771
  * eax = 75 - function number
4707
  * eax = 75 - function number
4772
  * bl = 3 - subfunction number
4708
  * bl = 3 - subfunction number
4773
  * ecx = socket number
4709
  * ecx = socket number
4774
  * edx = backlog
4710
  * edx = backlog
4775
Returned value:
4711
Returned value:
4776
  * eax = -1 on error
4712
  * eax = -1 on error
4777
  * ebx = errorcode
4713
  * ebx = errorcode
4778
 
4714
 
4779
---------------------- Constants for registers: ----------------------
4715
---------------------- Constants for registers: ----------------------
4780
  eax - SF_NETWORK_SOCKET (75)
4716
  eax - SF_NETWORK_SOCKET (75)
4781
   bl - SSF_LISTEN (3)
4717
   bl - SSF_LISTEN (3)
4782
======================================================================
4718
======================================================================
4783
================ Function 75, Subfunction 4, Connect. ================
4719
================ Function 75, Subfunction 4, Connect. ================
4784
======================================================================
4720
======================================================================
4785
Parameters:
4721
Parameters:
4786
  * eax = 75 - function number
4722
  * eax = 75 - function number
4787
  * bl = 4 - subfunction number
4723
  * bl = 4 - subfunction number
4788
  * ecx = socket number
4724
  * ecx = socket number
4789
  * edx = pointer to sockaddr structure
4725
  * edx = pointer to sockaddr structure
4790
  * esi = length of sockaddr structure
4726
  * esi = length of sockaddr structure
4791
Format of SockAddr structure:
4727
Format of SockAddr structure:
4792
  * +0: Word: Family
4728
  * +0: Word: Family
4793
  * +2: 14*Byte: Data
4729
  * +2: 14*Byte: Data
4794
Returned value:
4730
Returned value:
4795
  * eax = -1 on error
4731
  * eax = -1 on error
4796
  * ebx = errorcode
4732
  * ebx = errorcode
4797
 
4733
 
4798
---------------------- Constants for registers: ----------------------
4734
---------------------- Constants for registers: ----------------------
4799
  eax - SF_NETWORK_SOCKET (75)
4735
  eax - SF_NETWORK_SOCKET (75)
4800
   bl - SSF_CONNECT (4)
4736
   bl - SSF_CONNECT (4)
4801
======================================================================
4737
======================================================================
4802
================= Function 75, Subfunction 5, Accept. ================
4738
================= Function 75, Subfunction 5, Accept. ================
4803
======================================================================
4739
======================================================================
4804
Parameters:
4740
Parameters:
4805
  * eax = 75 - function number
4741
  * eax = 75 - function number
4806
  * bl = 5 - subfunction number
4742
  * bl = 5 - subfunction number
4807
  * ecx = socket number
4743
  * ecx = socket number
4808
  * edx = pointer to sockaddr structure
4744
  * edx = pointer to sockaddr structure
4809
  * esi = length of sockaddr structure
4745
  * esi = length of sockaddr structure
4810
Format of SockAddr structure:
4746
Format of SockAddr structure:
4811
  * +0: Word: Family
4747
  * +0: Word: Family
4812
  * +2: 14*Byte: Data
4748
  * +2: 14*Byte: Data
4813
Returned value:
4749
Returned value:
4814
  * eax = socket number of accepted socket, -1 on error
4750
  * eax = socket number of accepted socket, -1 on error
4815
  * ebx = errorcode
4751
  * ebx = errorcode
4816
 
4752
 
4817
---------------------- Constants for registers: ----------------------
4753
---------------------- Constants for registers: ----------------------
4818
  eax - SF_NETWORK_SOCKET (75)
4754
  eax - SF_NETWORK_SOCKET (75)
4819
   bl - SSF_ACCEPT (5)
4755
   bl - SSF_ACCEPT (5)
4820
======================================================================
4756
======================================================================
4821
================== Function 75, Subfunction 6, Send. =================
4757
================== Function 75, Subfunction 6, Send. =================
4822
======================================================================
4758
======================================================================
4823
Parameters:
4759
Parameters:
4824
  * eax = 75 - function number
4760
  * eax = 75 - function number
4825
  * bl = 6 - subfunction number
4761
  * bl = 6 - subfunction number
4826
  * ecx = socket number
4762
  * ecx = socket number
4827
  * edx = pointer to buffer
4763
  * edx = pointer to buffer
4828
  * esi = length of buffer
4764
  * esi = length of buffer
4829
  * edi = flags
4765
  * edi = flags
4830
Returned value:
4766
Returned value:
4831
  * eax = number of bytes copied, -1 on error
4767
  * eax = number of bytes copied, -1 on error
4832
  * ebx = errorcode
4768
  * ebx = errorcode
4833
 
4769
 
4834
---------------------- Constants for registers: ----------------------
4770
---------------------- Constants for registers: ----------------------
4835
  eax - SF_NETWORK_SOCKET (75)
4771
  eax - SF_NETWORK_SOCKET (75)
4836
   bl - SSF_SEND (6)
4772
   bl - SSF_SEND (6)
4837
======================================================================
4773
======================================================================
4838
================ Function 75, Subfunction 7, Receive. ================
4774
================ Function 75, Subfunction 7, Receive. ================
4839
======================================================================
4775
======================================================================
4840
Parameters:
4776
Parameters:
4841
  * eax = 75 - function number
4777
  * eax = 75 - function number
4842
  * bl = 7 - subfunction number
4778
  * bl = 7 - subfunction number
4843
  * ecx = socket number
4779
  * ecx = socket number
4844
  * edx = pointer to buffer
4780
  * edx = pointer to buffer
4845
  * esi = length of buffer
4781
  * esi = length of buffer
4846
  * edi = flags
4782
  * edi = flags
4847
Returned value:
4783
Returned value:
4848
  * eax = number of bytes copied, -1 on error
4784
  * eax = number of bytes copied, -1 on error
4849
  * ebx = errorcode
4785
  * ebx = errorcode
4850
 
4786
 
4851
---------------------- Constants for registers: ----------------------
4787
---------------------- Constants for registers: ----------------------
4852
  eax - SF_NETWORK_SOCKET (75)
4788
  eax - SF_NETWORK_SOCKET (75)
4853
   bl - SSF_RECEIVE (7)
4789
   bl - SSF_RECEIVE (7)
4854
======================================================================
4790
======================================================================
4855
=========== Function 75, Subfunction 8, Set socket options. ==========
4791
=========== Function 75, Subfunction 8, Set socket options. ==========
4856
======================================================================
4792
======================================================================
4857
Parameters:
4793
Parameters:
4858
  * eax = 75 - function number
4794
  * eax = 75 - function number
4859
  * bl = 8 - subfunction number
4795
  * bl = 8 - subfunction number
4860
  * ecx = socket number
4796
  * ecx = socket number
4861
  * edx = pointer to optstruct
4797
  * edx = pointer to optstruct
4862
Returned value:
4798
Returned value:
4863
  * eax = -1 on error
4799
  * eax = -1 on error
4864
  * ebx = errorcode
4800
  * ebx = errorcode
4865
Remarks:
4801
Remarks:
4866
 
4802
 
4867
  Optstruct:
4803
  Optstruct:
4868
    dd level
4804
    dd level
4869
    dd optionname
4805
    dd optionname
4870
    dd optlength
4806
    dd optlength
4871
    db options...
4807
    db options...
4872
 
4808
 
4873
---------------------- Constants for registers: ----------------------
4809
---------------------- Constants for registers: ----------------------
4874
  eax - SF_NETWORK_SOCKET (75)
4810
  eax - SF_NETWORK_SOCKET (75)
4875
   bl - SSF_SET_OPTIONS (8)
4811
   bl - SSF_SET_OPTIONS (8)
4876
======================================================================
4812
======================================================================
4877
=========== Function 75, Subfunction 9, Get socket options. ==========
4813
=========== Function 75, Subfunction 9, Get socket options. ==========
4878
======================================================================
4814
======================================================================
4879
Parameters:
4815
Parameters:
4880
  * eax = 75 - function number
4816
  * eax = 75 - function number
4881
  * bl = 9 - subfunction number
4817
  * bl = 9 - subfunction number
4882
  * ecx = socket number
4818
  * ecx = socket number
4883
  * edx = pointer to optstruct
4819
  * edx = pointer to optstruct
4884
Returned value:
4820
Returned value:
4885
  * eax = -1 on error
4821
  * eax = -1 on error
4886
  * ebx = errorcode
4822
  * ebx = errorcode
4887
Remarks:
4823
Remarks:
4888
 
4824
 
4889
  Optstruct:
4825
  Optstruct:
4890
    dd level
4826
    dd level
4891
    dd optionname
4827
    dd optionname
4892
    dd optlength
4828
    dd optlength
4893
    db options...
4829
    db options...
4894
 
4830
 
4895
---------------------- Constants for registers: ----------------------
4831
---------------------- Constants for registers: ----------------------
4896
  eax - SF_NETWORK_SOCKET (75)
4832
  eax - SF_NETWORK_SOCKET (75)
4897
   bl - SSF_GET_OPTIONS (9)
4833
   bl - SSF_GET_OPTIONS (9)
4898
======================================================================
4834
======================================================================
4899
============ Function 75, Subfunction 10, Get socketpair. ============
4835
============ Function 75, Subfunction 10, Get socketpair. ============
4900
======================================================================
4836
======================================================================
4901
Parameters:
4837
Parameters:
4902
  * eax = 75 - function number
4838
  * eax = 75 - function number
4903
  * bl = 10 - subfunction number
4839
  * bl = 10 - subfunction number
4904
Returned value:
4840
Returned value:
4905
  * eax = socketnum1, -1 on error
4841
  * eax = socketnum1, -1 on error
4906
  * ebx = socketnum2, errorcode on error
4842
  * ebx = socketnum2, errorcode on error
4907
 
4843
 
4908
---------------------- Constants for registers: ----------------------
4844
---------------------- Constants for registers: ----------------------
4909
  eax - SF_NETWORK_SOCKET (75)
4845
  eax - SF_NETWORK_SOCKET (75)
4910
   bl - SSF_GET_PAIR (10)
4846
   bl - SSF_GET_PAIR (10)
4911
======================================================================
4847
======================================================================
4912
============ Function 76, Network options and statistics. ============
4848
============ Function 76, Network options and statistics. ============
4913
======================================================================
4849
======================================================================
4914
Parameters:
4850
Parameters:
4915
  * eax = 76 - function number
4851
  * eax = 76 - function number
4916
  * high half of ebx = protocol number
4852
  * high half of ebx = protocol number
4917
  * bh = device number
4853
  * bh = device number
4918
  * bl = subfunction number
4854
  * bl = subfunction number
4919
 
4855
 
4920
======================================================================
4856
======================================================================
4921
==== Function 76, Protocol 0 - Ethernet, Subfunction 0, Read MAC. ====
4857
==== Function 76, Protocol 0 - Ethernet, Subfunction 0, Read MAC. ====
4922
======================================================================
4858
======================================================================
4923
Parameters:
4859
Parameters:
4924
  * eax = 76 - function number
4860
  * eax = 76 - function number
4925
  * high half of ebx = 0 (Ethernet)
4861
  * high half of ebx = 0 (Ethernet)
4926
  * bh = device number
4862
  * bh = device number
4927
  * bl = 0 (Read MAC)
4863
  * bl = 0 (Read MAC)
4928
Returned value:
4864
Returned value:
4929
  * eax = -1 on error, otherwise lower bits of MAC
4865
  * eax = -1 on error, otherwise lower bits of MAC
4930
  * bx = upper bits of MAC
4866
  * bx = upper bits of MAC
4931
 
4867
 
4932
======================================================================
4868
======================================================================
4933
= Function 76, Protocol 1 - IPv4, Subfunction 0, Read # Packets sent =
4869
= Function 76, Protocol 1 - IPv4, Subfunction 0, Read # Packets sent =
4934
======================================================================
4870
======================================================================
4935
Parameters:
4871
Parameters:
4936
  * eax = 76 - function number
4872
  * eax = 76 - function number
4937
  * high half of ebx = 1 (IPv4)
4873
  * high half of ebx = 1 (IPv4)
4938
  * bh = device number
4874
  * bh = device number
4939
  * bl = 0 (Read # packets sent)
4875
  * bl = 0 (Read # packets sent)
4940
Returned value:
4876
Returned value:
4941
  * eax = number of packets sent (-1 on error)
4877
  * eax = number of packets sent (-1 on error)
4942
 
4878
 
4943
======================================================================
4879
======================================================================
4944
= Function 76, Protocol 1 - IPv4, Subfunction 1, Read # Packets rcvd =
4880
= Function 76, Protocol 1 - IPv4, Subfunction 1, Read # Packets rcvd =
4945
======================================================================
4881
======================================================================
4946
Parameters:
4882
Parameters:
4947
  * eax = 76 - function number
4883
  * eax = 76 - function number
4948
  * high half of ebx = 1 (IPv4)
4884
  * high half of ebx = 1 (IPv4)
4949
  * bh = device number
4885
  * bh = device number
4950
  * bl = 1 (Read # packets received)
4886
  * bl = 1 (Read # packets received)
4951
Returned value:
4887
Returned value:
4952
  * eax = number of packets received (-1 on error)
4888
  * eax = number of packets received (-1 on error)
4953
 
4889
 
4954
======================================================================
4890
======================================================================
4955
=== Function 76, Protocol 1 - IPv4, Subfunction 2, Read IP address ===
4891
=== Function 76, Protocol 1 - IPv4, Subfunction 2, Read IP address ===
4956
======================================================================
4892
======================================================================
4957
Parameters:
4893
Parameters:
4958
  * eax = 76 - function number
4894
  * eax = 76 - function number
4959
  * high half of ebx = 1 (IPv4)
4895
  * high half of ebx = 1 (IPv4)
4960
  * bh = device number
4896
  * bh = device number
4961
  * bl = 2 (Read IP address)
4897
  * bl = 2 (Read IP address)
4962
Returned value:
4898
Returned value:
4963
  * eax = IP address (-1 on error)
4899
  * eax = IP address (-1 on error)
4964
 
4900
 
4965
======================================================================
4901
======================================================================
4966
=== Function 76, Protocol 1 - IPv4, Subfunction 3, Set IP address ====
4902
=== Function 76, Protocol 1 - IPv4, Subfunction 3, Set IP address ====
4967
======================================================================
4903
======================================================================
4968
Parameters:
4904
Parameters:
4969
  * eax = 76 - function number
4905
  * eax = 76 - function number
4970
  * high half of ebx = 1 (IPv4)
4906
  * high half of ebx = 1 (IPv4)
4971
  * bh = device number
4907
  * bh = device number
4972
  * bl = 3 (Set IP address)
4908
  * bl = 3 (Set IP address)
4973
  * ecx = IP address
4909
  * ecx = IP address
4974
Returned value:
4910
Returned value:
4975
  * eax = -1 on error
4911
  * eax = -1 on error
4976
 
4912
 
4977
======================================================================
4913
======================================================================
4978
== Function 76, Protocol 1 - IPv4, Subfunction 4, Read DNS address ===
4914
== Function 76, Protocol 1 - IPv4, Subfunction 4, Read DNS address ===
4979
======================================================================
4915
======================================================================
4980
Parameters:
4916
Parameters:
4981
  * eax = 76 - function number
4917
  * eax = 76 - function number
4982
  * high half of ebx = 1 (IPv4)
4918
  * high half of ebx = 1 (IPv4)
4983
  * bh = device number
4919
  * bh = device number
4984
  * bl = 4 (Read DNS server IP address)
4920
  * bl = 4 (Read DNS server IP address)
4985
Returned value:
4921
Returned value:
4986
  * eax = DNS server IP address (-1 on error)
4922
  * eax = DNS server IP address (-1 on error)
4987
 
4923
 
4988
======================================================================
4924
======================================================================
4989
=== Function 76, Protocol 1 - IPv4, Subfunction 5, Set DNS address ===
4925
=== Function 76, Protocol 1 - IPv4, Subfunction 5, Set DNS address ===
4990
======================================================================
4926
======================================================================
4991
Parameters:
4927
Parameters:
4992
  * eax = 76 - function number
4928
  * eax = 76 - function number
4993
  * high half of ebx = 1 (IPv4)
4929
  * high half of ebx = 1 (IPv4)
4994
  * bh = device number
4930
  * bh = device number
4995
  * bl = 5 (Set DNS address)
4931
  * bl = 5 (Set DNS address)
4996
  * ecx = DNS server IP address
4932
  * ecx = DNS server IP address
4997
Returned value:
4933
Returned value:
4998
  * eax = -1 on error
4934
  * eax = -1 on error
4999
 
4935
 
5000
======================================================================
4936
======================================================================
5001
== Function 76, Protocol 1 - IPv4, Subfunction 6, Read subnet mask ===
4937
== Function 76, Protocol 1 - IPv4, Subfunction 6, Read subnet mask ===
5002
======================================================================
4938
======================================================================
5003
Parameters:
4939
Parameters:
5004
  * eax = 76 - function number
4940
  * eax = 76 - function number
5005
  * high half of ebx = 1 (IPv4)
4941
  * high half of ebx = 1 (IPv4)
5006
  * bh = device number
4942
  * bh = device number
5007
  * bl = 6 (Read subnet mask)
4943
  * bl = 6 (Read subnet mask)
5008
Returned value:
4944
Returned value:
5009
  * eax = subnet mask (-1 on error)
4945
  * eax = subnet mask (-1 on error)
5010
 
4946
 
5011
======================================================================
4947
======================================================================
5012
=== Function 76, Protocol 1 - IPv4, Subfunction 7, Set subnet mask ===
4948
=== Function 76, Protocol 1 - IPv4, Subfunction 7, Set subnet mask ===
5013
======================================================================
4949
======================================================================
5014
Parameters:
4950
Parameters:
5015
  * eax = 76 - function number
4951
  * eax = 76 - function number
5016
  * high half of ebx = 1 (IPv4)
4952
  * high half of ebx = 1 (IPv4)
5017
  * bh = device number
4953
  * bh = device number
5018
  * bl = 7 (Set subnet mask)
4954
  * bl = 7 (Set subnet mask)
5019
  * ecx = subnet mask
4955
  * ecx = subnet mask
5020
Returned value:
4956
Returned value:
5021
  * eax = -1 on error
4957
  * eax = -1 on error
5022
 
4958
 
5023
======================================================================
4959
======================================================================
5024
===== Function 76, Protocol 1 - IPv4, Subfunction 8, Read gateway ====
4960
===== Function 76, Protocol 1 - IPv4, Subfunction 8, Read gateway ====
5025
======================================================================
4961
======================================================================
5026
Parameters:
4962
Parameters:
5027
  * eax = 76 - function number
4963
  * eax = 76 - function number
5028
  * high half of ebx = 1 (IPv4)
4964
  * high half of ebx = 1 (IPv4)
5029
  * bh = device number
4965
  * bh = device number
5030
  * bl = 8 (Read gateway IP address)
4966
  * bl = 8 (Read gateway IP address)
5031
Returned value:
4967
Returned value:
5032
  * eax = gateway IP address (-1 on error)
4968
  * eax = gateway IP address (-1 on error)
5033
 
4969
 
5034
======================================================================
4970
======================================================================
5035
===== Function 76, Protocol 1 - IPv4, Subfunction 9, Set gateway =====
4971
===== Function 76, Protocol 1 - IPv4, Subfunction 9, Set gateway =====
5036
======================================================================
4972
======================================================================
5037
Parameters:
4973
Parameters:
5038
  * eax = 76 - function number
4974
  * eax = 76 - function number
5039
  * high half of ebx = 1 (IPv4)
4975
  * high half of ebx = 1 (IPv4)
5040
  * bh = device number
4976
  * bh = device number
5041
  * bl = 9 (Set getway address)
4977
  * bl = 9 (Set getway address)
5042
  * ecx = gateway IP address
4978
  * ecx = gateway IP address
5043
Returned value:
4979
Returned value:
5044
  * eax = -1 on error
4980
  * eax = -1 on error
5045
 
4981
 
5046
======================================================================
4982
======================================================================
5047
= Function 76, Protocol 2 - ICMP, Subfunction 0, Read # Packets sent =
4983
= Function 76, Protocol 2 - ICMP, Subfunction 0, Read # Packets sent =
5048
======================================================================
4984
======================================================================
5049
Parameters:
4985
Parameters:
5050
  * eax = 76 - function number
4986
  * eax = 76 - function number
5051
  * high half of ebx = 2 (ICMP)
4987
  * high half of ebx = 2 (ICMP)
5052
  * bh = device number
4988
  * bh = device number
5053
  * bl = 0 (Read # packets sent)
4989
  * bl = 0 (Read # packets sent)
5054
Returned value:
4990
Returned value:
5055
  * eax = number of packets sent (-1 on error)
4991
  * eax = number of packets sent (-1 on error)
5056
 
4992
 
5057
======================================================================
4993
======================================================================
5058
= Function 76, Protocol 2 - ICMP, Subfunction 1, Read # Packets rcvd =
4994
= Function 76, Protocol 2 - ICMP, Subfunction 1, Read # Packets rcvd =
5059
======================================================================
4995
======================================================================
5060
Parameters:
4996
Parameters:
5061
  * eax = 76 - function number
4997
  * eax = 76 - function number
5062
  * high half of ebx = 2 (ICMP)
4998
  * high half of ebx = 2 (ICMP)
5063
  * bh = device number
4999
  * bh = device number
5064
  * bl = 1 (Read # packets received)
5000
  * bl = 1 (Read # packets received)
5065
Returned value:
5001
Returned value:
5066
  * eax = number of packets received (-1 on error)
5002
  * eax = number of packets received (-1 on error)
5067
 
5003
 
5068
======================================================================
5004
======================================================================
5069
= Function 76, Protocol 3 - UDP, Subfunction 0, Read # Packets sent ==
5005
= Function 76, Protocol 3 - UDP, Subfunction 0, Read # Packets sent ==
5070
======================================================================
5006
======================================================================
5071
Parameters:
5007
Parameters:
5072
  * eax = 76 - function number
5008
  * eax = 76 - function number
5073
  * high half of ebx = 3 (UDP)
5009
  * high half of ebx = 3 (UDP)
5074
  * bh = device number
5010
  * bh = device number
5075
  * bl = 0 (Read # packets sent)
5011
  * bl = 0 (Read # packets sent)
5076
Returned value:
5012
Returned value:
5077
  * eax = number of packets sent (-1 on error)
5013
  * eax = number of packets sent (-1 on error)
5078
 
5014
 
5079
======================================================================
5015
======================================================================
5080
= Function 76, Protocol 3 - UDP, Subfunction 1, Read # Packets rcvd ==
5016
= Function 76, Protocol 3 - UDP, Subfunction 1, Read # Packets rcvd ==
5081
======================================================================
5017
======================================================================
5082
Parameters:
5018
Parameters:
5083
  * eax = 76 - function number
5019
  * eax = 76 - function number
5084
  * high half of ebx = 3 (UDP)
5020
  * high half of ebx = 3 (UDP)
5085
  * bh = device number
5021
  * bh = device number
5086
  * bl = 1 (Read # packets received)
5022
  * bl = 1 (Read # packets received)
5087
Returned value:
5023
Returned value:
5088
  * eax = number of packets received (-1 on error)
5024
  * eax = number of packets received (-1 on error)
5089
 
5025
 
5090
======================================================================
5026
======================================================================
5091
= Function 76, Protocol 4 - TCP, Subfunction 0, Read # Packets sent ==
5027
= Function 76, Protocol 4 - TCP, Subfunction 0, Read # Packets sent ==
5092
======================================================================
5028
======================================================================
5093
Parameters:
5029
Parameters:
5094
  * eax = 76 - function number
5030
  * eax = 76 - function number
5095
  * high half of ebx = 4 (TCP)
5031
  * high half of ebx = 4 (TCP)
5096
  * bh = device number
5032
  * bh = device number
5097
  * bl = 0 (Read # packets sent)
5033
  * bl = 0 (Read # packets sent)
5098
Returned value:
5034
Returned value:
5099
  * eax = number of packets sent (-1 on error)
5035
  * eax = number of packets sent (-1 on error)
5100
 
5036
 
5101
======================================================================
5037
======================================================================
5102
= Function 76, Protocol 4 - TCP, Subfunction 1, Read # Packets rcvd ==
5038
= Function 76, Protocol 4 - TCP, Subfunction 1, Read # Packets rcvd ==
5103
======================================================================
5039
======================================================================
5104
Parameters:
5040
Parameters:
5105
  * eax = 76 - function number
5041
  * eax = 76 - function number
5106
  * high half of ebx = 4 (TCP)
5042
  * high half of ebx = 4 (TCP)
5107
  * bh = device number
5043
  * bh = device number
5108
  * bl = 1 (Read # packets received)
5044
  * bl = 1 (Read # packets received)
5109
Returned value:
5045
Returned value:
5110
  * eax = number of packets received (-1 on error)
5046
  * eax = number of packets received (-1 on error)
5111
 
5047
 
5112
======================================================================
5048
======================================================================
5113
= Function 76, Protocol 5 - ARP, Subfunction 0, Read # Packets sent ==
5049
= Function 76, Protocol 5 - ARP, Subfunction 0, Read # Packets sent ==
5114
======================================================================
5050
======================================================================
5115
Parameters:
5051
Parameters:
5116
  * eax = 76 - function number
5052
  * eax = 76 - function number
5117
  * high half of ebx = 5 (ARP)
5053
  * high half of ebx = 5 (ARP)
5118
  * bh = device number
5054
  * bh = device number
5119
  * bl = 0 (Read # packets sent)
5055
  * bl = 0 (Read # packets sent)
5120
Returned value:
5056
Returned value:
5121
  * eax = number of packets sent (-1 on error)
5057
  * eax = number of packets sent (-1 on error)
5122
 
5058
 
5123
======================================================================
5059
======================================================================
5124
= Function 76, Protocol 5 - ARP, Subfunction 1, Read # Packets rcvd ==
5060
= Function 76, Protocol 5 - ARP, Subfunction 1, Read # Packets rcvd ==
5125
======================================================================
5061
======================================================================
5126
Parameters:
5062
Parameters:
5127
  * eax = 76 - function number
5063
  * eax = 76 - function number
5128
  * high half of ebx = 5 (ARP)
5064
  * high half of ebx = 5 (ARP)
5129
  * bh = device number
5065
  * bh = device number
5130
  * bl = 1 (Read # packets received)
5066
  * bl = 1 (Read # packets received)
5131
Returned value:
5067
Returned value:
5132
  * eax = number of packets received (-1 on error)
5068
  * eax = number of packets received (-1 on error)
5133
 
5069
 
5134
======================================================================
5070
======================================================================
5135
== Function 76, Protocol 5 - ARP, Subfunction 2, Read # ARP entries ==
5071
== Function 76, Protocol 5 - ARP, Subfunction 2, Read # ARP entries ==
5136
======================================================================
5072
======================================================================
5137
Parameters:
5073
Parameters:
5138
  * eax = 76 - function number
5074
  * eax = 76 - function number
5139
  * high half of ebx = 5 (ARP)
5075
  * high half of ebx = 5 (ARP)
5140
  * bh = device number
5076
  * bh = device number
5141
  * bl = 2 (Read # current entries in the ARP table)
5077
  * bl = 2 (Read # current entries in the ARP table)
5142
Returned value:
5078
Returned value:
5143
  * eax = number of entries (-1 on error)
5079
  * eax = number of entries (-1 on error)
5144
 
5080
 
5145
======================================================================
5081
======================================================================
5146
==== Function 76, Protocol 5 - ARP, Subfunction 3, Read ARP entry ====
5082
==== Function 76, Protocol 5 - ARP, Subfunction 3, Read ARP entry ====
5147
======================================================================
5083
======================================================================
5148
Parameters:
5084
Parameters:
5149
  * eax = 76 - function number
5085
  * eax = 76 - function number
5150
  * high half of ebx = 5 (ARP)
5086
  * high half of ebx = 5 (ARP)
5151
  * bh = device number
5087
  * bh = device number
5152
  * bl = 3 (Read ARP entry)
5088
  * bl = 3 (Read ARP entry)
5153
  * ecx = ARP entry number (0 based)
5089
  * ecx = ARP entry number (0 based)
5154
  * edi = ptr to buffer where ARP entry will be written
5090
  * edi = ptr to buffer where ARP entry will be written
5155
Returned value:
5091
Returned value:
5156
  * eax = -1 on error
5092
  * eax = -1 on error
5157
Remarks:
5093
Remarks:
5158
  * ARP_entry struct is defined in ARP.inc in kernel and currently
5094
  * ARP_entry struct is defined in ARP.inc in kernel and currently
5159
    looks like this:
5095
    looks like this:
5160
struct  ARP_entry
5096
struct  ARP_entry
5161
        IP              dd ?
5097
        IP              dd ?
5162
        MAC             dp ?
5098
        MAC             dp ?
5163
        Status          dw ?
5099
        Status          dw ?
5164
        TTL             dw ?
5100
        TTL             dw ?
5165
ends
5101
ends
5166
 
5102
 
5167
======================================================================
5103
======================================================================
5168
===== Function 76, Protocol 5 - ARP, Subfunction 4, Add ARP entry ====
5104
===== Function 76, Protocol 5 - ARP, Subfunction 4, Add ARP entry ====
5169
======================================================================
5105
======================================================================
5170
Parameters:
5106
Parameters:
5171
  * eax = 76 - function number
5107
  * eax = 76 - function number
5172
  * high half of ebx = 5 (ARP)
5108
  * high half of ebx = 5 (ARP)
5173
  * bh = device number
5109
  * bh = device number
5174
  * bl = 4 (Add ARP entry)
5110
  * bl = 4 (Add ARP entry)
5175
  * esi = ptr to buffer holding ARP entry
5111
  * esi = ptr to buffer holding ARP entry
5176
Returned value:
5112
Returned value:
5177
  * eax = -1 on error
5113
  * eax = -1 on error
5178
Remarks:
5114
Remarks:
5179
  * See previous function for details on ARP entry.
5115
  * See previous function for details on ARP entry.
5180
 
5116
 
5181
======================================================================
5117
======================================================================
5182
=== Function 76, Protocol 5 - ARP, Subfunction 5, Remove ARP entry ===
5118
=== Function 76, Protocol 5 - ARP, Subfunction 5, Remove ARP entry ===
5183
======================================================================
5119
======================================================================
5184
Parameters:
5120
Parameters:
5185
  * eax = 76 - function number
5121
  * eax = 76 - function number
5186
  * high half of ebx = 5 (ARP)
5122
  * high half of ebx = 5 (ARP)
5187
  * bh = device number
5123
  * bh = device number
5188
  * bl = 5 (Remove ARP entry)
5124
  * bl = 5 (Remove ARP entry)
5189
  * ecx = ARP entry number (0 based), use -1 to clear whole ARP table.
5125
  * ecx = ARP entry number (0 based), use -1 to clear whole ARP table.
5190
Returned value:
5126
Returned value:
5191
  * eax = -1 on error
5127
  * eax = -1 on error
5192
 
5128
 
5193
======================================================================
5129
======================================================================
5194
=== Function 76, Protocol 5 - ARP, Subfunction 6, Send ARP announce ==
5130
=== Function 76, Protocol 5 - ARP, Subfunction 6, Send ARP announce ==
5195
======================================================================
5131
======================================================================
5196
Parameters:
5132
Parameters:
5197
  * eax = 76 - function number
5133
  * eax = 76 - function number
5198
  * high half of ebx = 5 (ARP)
5134
  * high half of ebx = 5 (ARP)
5199
  * bh = device number
5135
  * bh = device number
5200
  * bl = 6 (Send ARP announce)
5136
  * bl = 6 (Send ARP announce)
5201
Returned value:
5137
Returned value:
5202
  * eax = -1 on error
5138
  * eax = -1 on error
5203
 
5139
 
5204
======================================================================
5140
======================================================================
5205
=== Function 76, Protocol 5 - ARP, Subfunction 7, Read # conflicts ===
5141
=== Function 76, Protocol 5 - ARP, Subfunction 7, Read # conflicts ===
5206
======================================================================
5142
======================================================================
5207
Parameters:
5143
Parameters:
5208
  * eax = 76 - function number
5144
  * eax = 76 - function number
5209
  * high half of ebx = 5 (ARP)
5145
  * high half of ebx = 5 (ARP)
5210
  * bh = device number
5146
  * bh = device number
5211
  * bl = 7 (Read # IP address conflicts that have occured)
5147
  * bl = 7 (Read # IP address conflicts that have occured)
5212
Returned value:
5148
Returned value:
5213
  * eax = # IP address conflicts (-1 on error)
5149
  * eax = # IP address conflicts (-1 on error)
5214
 
5150
 
5215
---------------------- Constants for registers: ----------------------
5151
---------------------- Constants for registers: ----------------------
5216
  eax - SF_NETWORK_PROTOCOL (76)
5152
  eax - SF_NETWORK_PROTOCOL (76)
5217
======================================================================
5153
======================================================================
5218
========== Function 77, Subfunction 0, Create futex object ===========
5154
========== Function 77, Subfunction 0, Create futex object ===========
5219
======================================================================
5155
======================================================================
5220
Parameters:
5156
Parameters:
5221
  * eax = 77 - function number
5157
  * eax = 77 - function number
5222
  * ebx = 0 - subfunction number
5158
  * ebx = 0 - subfunction number
5223
  * ecx = pointer to futex dword
5159
  * ecx = pointer to futex dword
5224
Returned value:
5160
Returned value:
5225
  * eax = futex handle, 0 on error
5161
  * eax = futex handle, 0 on error
5226
Remarks:
5162
Remarks:
5227
  * Use subfunction 1 to destroy the futex.
5163
  * Use subfunction 1 to destroy the futex.
5228
    The kernel destroys the futexes automatically when the process
5164
    The kernel destroys the futexes automatically when the process
5229
    terminates.
5165
    terminates.
5230
 
5166
 
5231
---------------------- Constants for registers: ----------------------
5167
---------------------- Constants for registers: ----------------------
5232
  eax - SF_FUTEX (77)
5168
  eax - SF_FUTEX (77)
5233
  ebx - SSF_CREATE (0)
5169
  ebx - SSF_CREATE (0)
5234
======================================================================
5170
======================================================================
5235
========= Function 77, Subfunction 1, Destroy futex object ===========
5171
========= Function 77, Subfunction 1, Destroy futex object ===========
5236
======================================================================
5172
======================================================================
5237
Parameters:
5173
Parameters:
5238
  * eax = 77 - function number
5174
  * eax = 77 - function number
5239
  * ebx = 1 - subfunction number
5175
  * ebx = 1 - subfunction number
5240
  * ecx = futex handle
5176
  * ecx = futex handle
5241
Returned value:
5177
Returned value:
5242
  * eax = 0 - successfull, -1 on error
5178
  * eax = 0 - successfull, -1 on error
5243
Remarks:
5179
Remarks:
5244
  * The futex handle must have been created by subfunction 0
5180
  * The futex handle must have been created by subfunction 0
5245
 
5181
 
5246
---------------------- Constants for registers: ----------------------
5182
---------------------- Constants for registers: ----------------------
5247
  eax - SF_FUTEX (77)
5183
  eax - SF_FUTEX (77)
5248
  ebx - SSF_DESTROY (1)
5184
  ebx - SSF_DESTROY (1)
5249
======================================================================
5185
======================================================================
5250
=============== Function 77, Subfunction 2, Futex wait ===============
5186
=============== Function 77, Subfunction 2, Futex wait ===============
5251
======================================================================
5187
======================================================================
5252
Parameters:
5188
Parameters:
5253
  * eax = 77 - function number
5189
  * eax = 77 - function number
5254
  * ebx = 2 - subfunction number
5190
  * ebx = 2 - subfunction number
5255
  * ecx = futex handle
5191
  * ecx = futex handle
5256
  * edx = control value
5192
  * edx = control value
5257
  * esi = timeout in system ticks or 0 for infinity
5193
  * esi = timeout in system ticks or 0 for infinity
5258
Returned value:
5194
Returned value:
5259
  * eax = 0 - successfull
5195
  * eax = 0 - successfull
5260
	 -1 - timeout
5196
	 -1 - timeout
5261
	 -2 - futex dword does not have the same value as edx
5197
	 -2 - futex dword does not have the same value as edx
5262
Remarks:
5198
Remarks:
5263
  * This functionn tests that the value at the futex dword still
5199
  * This functionn tests that the value at the futex dword still
5264
    contains the expected control value, and if so, then sleeps
5200
    contains the expected control value, and if so, then sleeps
5265
    waiting for a wake operation on the futex.
5201
    waiting for a wake operation on the futex.
5266
  * The futex handle must have been created by subfunction 0
5202
  * The futex handle must have been created by subfunction 0
5267
 
5203
 
5268
---------------------- Constants for registers: ----------------------
5204
---------------------- Constants for registers: ----------------------
5269
  eax - SF_FUTEX (77)
5205
  eax - SF_FUTEX (77)
5270
  ebx - SSF_WAIT (2)
5206
  ebx - SSF_WAIT (2)
5271
======================================================================
5207
======================================================================
5272
=============== Function 77, Subfunction 3, Futex wake ===============
5208
=============== Function 77, Subfunction 3, Futex wake ===============
5273
======================================================================
5209
======================================================================
5274
Parameters:
5210
Parameters:
5275
  * eax = 77 - function number
5211
  * eax = 77 - function number
5276
  * ebx = 3 - subfunction number
5212
  * ebx = 3 - subfunction number
5277
  * ecx = futex handle
5213
  * ecx = futex handle
5278
  * edx = number of waiters to wake
5214
  * edx = number of waiters to wake
5279
Returned value:
5215
Returned value:
5280
  * eax = number of waiters that were woken up
5216
  * eax = number of waiters that were woken up
5281
 
5217
 
5282
Remarks:
5218
Remarks:
5283
  * This function wakes at most edx of the waiters that are
5219
  * This function wakes at most edx of the waiters that are
5284
    waiting (e.g., inside futex wait) on the futex dword
5220
    waiting (e.g., inside futex wait) on the futex dword
5285
  * The futex handle must have been created by subfunction 0
5221
  * The futex handle must have been created by subfunction 0
5286
 
5222
 
5287
---------------------- Constants for registers: ----------------------
5223
---------------------- Constants for registers: ----------------------
5288
  eax - SF_FUTEX (77)
5224
  eax - SF_FUTEX (77)
5289
  ebx - SSF_WAKE (3)
5225
  ebx - SSF_WAKE (3)
5290
======================================================================
5226
======================================================================
5291
=== Function 80 - file system interface with parameter of encoding ===
5227
=== Function 80 - file system interface with parameter of encoding ===
5292
======================================================================
5228
======================================================================
5293
Parameters:
5229
Parameters:
5294
  * eax = 80
5230
  * eax = 80
5295
  * ebx = pointer to the information structure
5231
  * ebx = pointer to the information structure
5296
Returned value:
5232
Returned value:
5297
  * eax = 0 - success; otherwise file system error code
5233
  * eax = 0 - success; otherwise file system error code
5298
  * some subfunctions return value in other registers too
5234
  * some subfunctions return value in other registers too
5299
General format of the information structure:
5235
General format of the information structure:
5300
  * +0: dword: subfunction number
5236
  * +0: dword: subfunction number
5301
  * +4: dword: offset in file or folder
5237
  * +4: dword: offset in file or folder
5302
  * +8: dword: higher part of offset or flags
5238
  * +8: dword: higher part of offset or flags
5303
  * +12 = +0xC: dword: size of data
5239
  * +12 = +0xC: dword: size of data
5304
  * +16 = +0x10: dword: pointer to data
5240
  * +16 = +0x10: dword: pointer to data
5305
  * +20 = +0x14: dword: string encoding:
5241
  * +20 = +0x14: dword: string encoding:
5306
    1 = cp866
5242
    1 = cp866
5307
    2 = UTF-16LE
5243
    2 = UTF-16LE
5308
    3 = UTF-8
5244
    3 = UTF-8
5309
    0 = default (supports encoding byte at the start of the string)
5245
    0 = default (supports encoding byte at the start of the string)
5310
  * +24 = +0x18: dword: pointer to zero terminated string with path
5246
  * +24 = +0x18: dword: pointer to zero terminated string with path
5311
 
5247
 
5312
The rest is similar to sysfunction 70.
5248
The rest is similar to sysfunction 70.
5313
 
5249
 
5314
======================================================================
5250
======================================================================
5315
=============== Function -1 - terminate thread/process ===============
5251
=============== Function -1 - terminate thread/process ===============
5316
======================================================================
5252
======================================================================
5317
Parameters:
5253
Parameters:
5318
  * eax = -1 - function number
5254
  * eax = -1 - function number
5319
Returned value:
5255
Returned value:
5320
  * function does not return neither value nor control
5256
  * function does not return neither value nor control
5321
Remarks:
5257
Remarks:
5322
  * If the process did not create threads obviously, it has only
5258
  * If the process did not create threads obviously, it has only
5323
    one thread, which termination results in process termination.
5259
    one thread, which termination results in process termination.
5324
  * If the current thread is last in the process, its termination
5260
  * If the current thread is last in the process, its termination
5325
    also results in process terminates.
5261
    also results in process terminates.
5326
  * This function terminates the current thread. Other thread can be
5262
  * This function terminates the current thread. Other thread can be
5327
    killed by call to subfunction 2 of function 18.
5263
    killed by call to subfunction 2 of function 18.
5328
 
5264
 
5329
---------------------- Constants for registers: ----------------------
5265
---------------------- Constants for registers: ----------------------
5330
  eax - SF_TERMINATE_PROCESS (-1)
5266
  eax - SF_TERMINATE_PROCESS (-1)
5331
======================================================================
5267
======================================================================
5332
=========================== List of events ===========================
5268
=========================== List of events ===========================
5333
======================================================================
5269
======================================================================
5334
Next event can be retrieved by the call of one from functions 10
5270
Next event can be retrieved by the call of one from functions 10
5335
(to wait for event), 11 (to check without waiting), 23
5271
(to wait for event), 11 (to check without waiting), 23
5336
(to wait during the given time).
5272
(to wait during the given time).
5337
These functions return only those events, which enter into a mask set
5273
These functions return only those events, which enter into a mask set
5338
by function 40. By default it is first three,
5274
by function 40. By default it is first three,
5339
there is enough for most applications.
5275
there is enough for most applications.
5340
Codes of events:
5276
Codes of events:
5341
  * 1 = redraw event (is reset by call to function 0)
5277
  * 1 = redraw event (is reset by call to function 0)
5342
  * 2 = key on keyboard is pressed (acts, only when the window is
5278
  * 2 = key on keyboard is pressed (acts, only when the window is
5343
    active) or hotkey is pressed; is reset, when all keys from
5279
    active) or hotkey is pressed; is reset, when all keys from
5344
    the buffer are read out by function 2
5280
    the buffer are read out by function 2
5345
  * 3 = button is pressed, defined earlier by function 8
5281
  * 3 = button is pressed, defined earlier by function 8
5346
    (or close button, created implicitly by function 0;
5282
    (or close button, created implicitly by function 0;
5347
    minimize button is handled by the system and sends no message;
5283
    minimize button is handled by the system and sends no message;
5348
    acts, only when the window is active;
5284
    acts, only when the window is active;
5349
    is reset when all buttons from the buffer
5285
    is reset when all buttons from the buffer
5350
    are read out by function 17)
5286
    are read out by function 17)
5351
  * 4 = reserved (in current implementation never comes even after
5287
  * 4 = reserved (in current implementation never comes even after
5352
    unmasking by function 40)
5288
    unmasking by function 40)
5353
  * 5 = kernel finished redrawing of the desktop background
5289
  * 5 = kernel finished redrawing of the desktop background
5354
  * 6 = mouse event (something happened - button pressing or moving;
5290
  * 6 = mouse event (something happened - button pressing or moving;
5355
    is reset at reading)
5291
    is reset at reading)
5356
  * 7 = IPC event (see function 60 -
5292
  * 7 = IPC event (see function 60 -
5357
    Inter Process Communication; is reset at reading)
5293
    Inter Process Communication; is reset at reading)
5358
  * 8 = network event (is reset at reading)
5294
  * 8 = network event (is reset at reading)
5359
  * 9 = debug event (is reset at reading; see
5295
  * 9 = debug event (is reset at reading; see
5360
    debug subsystem)
5296
    debug subsystem)
5361
  * 16..31 = event with appropriate IRQ
5297
  * 16..31 = event with appropriate IRQ
5362
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
5298
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
5363
 
5299
 
5364
======================================================================
5300
======================================================================
5365
=================== Error codes of the file system ===================
5301
=================== Error codes of the file system ===================
5366
======================================================================
5302
======================================================================
5367
  * 0 = success
5303
  * 0 = success
5368
  * 2 = function is not supported for the given file system
5304
  * 2 = function is not supported for the given file system
5369
  * 3 = unknown file system
5305
  * 3 = unknown file system
5370
  * 5 = file not found
5306
  * 5 = file not found
5371
  * 6 = end of file, EOF
5307
  * 6 = end of file, EOF
5372
  * 7 = pointer lies outside of application memory
5308
  * 7 = pointer lies outside of application memory
5373
  * 8 = disk is full
5309
  * 8 = disk is full
5374
  * 9 = file system error
5310
  * 9 = file system error
5375
  * 10 = access denied
5311
  * 10 = access denied
5376
  * 11 = device error
5312
  * 11 = device error
5377
  * 12 = file system requires more memory
5313
  * 12 = file system requires more memory
5378
 
5314
 
5379
Application start functions can return also following errors:
5315
Application start functions can return also following errors:
5380
  * 30 = 0x1E = not enough memory
5316
  * 30 = 0x1E = not enough memory
5381
  * 31 = 0x1F = file is not executable
5317
  * 31 = 0x1F = file is not executable
5382
  * 32 = 0x20 = too many processes
5318
  * 32 = 0x20 = too many processes
5383
>
-
 
5384
>
-