Subversion Repositories Kolibri OS

Rev

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

Rev 6171 Rev 6235
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
 
7
 
8
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
8
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
9
 
9
 
10
Number of the function is located in the register eax.
10
Number of the function is located in the register eax.
11
The call of the system function is executed by "int 0x40" command.
11
The call of the system function is executed by "int 0x40" command.
12
All registers except explicitly declared in the returned value,
12
All registers except explicitly declared in the returned value,
13
    including eflags, are preserved.
13
    including eflags, are preserved.
14
 
14
 
15
 
15
 
16
======================================================================
16
======================================================================
17
============== Function 0 - define and draw the window. ==============
17
============== Function 0 - define and draw the window. ==============
18
======================================================================
18
======================================================================
19
Defines an application window. Draws a frame of the window, header and
19
Defines an application window. Draws a frame of the window, header and
20
working area. For skinned windows defines standard close and minimize
20
working area. For skinned windows defines standard close and minimize
21
buttons.
21
buttons.
22
Parameters:
22
Parameters:
23
  * eax = 0 - function number
23
  * eax = 0 - function number
24
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
24
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
25
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
25
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
26
  * edx = 0xXYRRGGBB, where:
26
  * edx = 0xXYRRGGBB, where:
27
    * Y = style of the window:
27
    * Y = style of the window:
28
      * Y=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 sence of coordinates
74
  * The sizes of the window are understood in sence 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 (rus/en) as opposed to scancodes.
149
    keyboard layout (rus/en) 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
  * buffer pointed to by ebx contains the following information:
286
  * buffer pointed to by ebx contains the following information:
287
    * +0: dword: usage of the processor (how many time units
287
    * +0: dword: usage of the processor (how many time units
288
      per second leaves on execution of this thread)
288
      per second leaves on execution of this thread)
289
    * +4: word: position of the window of thread in the window stack
289
    * +4: word: position of the window of thread in the window stack
290
    * +6: word: (has no relation to the specified thread)
290
    * +6: word: (has no relation to the specified thread)
291
      number of the thread slot, which window has in the window stack
291
      number of the thread slot, which window has in the window stack
292
      position ecx
292
      position ecx
293
    * +8: word: reserved
293
    * +8: word: reserved
294
    * +10 = +0xA: 11 bytes: name of the process
294
    * +10 = +0xA: 11 bytes: name of the process
295
      (name of the started file - executable file without extension)
295
      (name of the started file - executable file without extension)
296
    * +21 = +0x15: byte: reserved, this byte is not changed
296
    * +21 = +0x15: byte: reserved, this byte is not changed
297
    * +22 = +0x16: dword: address of the process in memory
297
    * +22 = +0x16: dword: address of the process in memory
298
    * +26 = +0x1A: dword: size of used memory - 1
298
    * +26 = +0x1A: dword: size of used memory - 1
299
    * +30 = +0x1E: dword: identifier (PID/TID)
299
    * +30 = +0x1E: dword: identifier (PID/TID)
300
    * +34 = +0x22: dword: coordinate of the thread window on axis x
300
    * +34 = +0x22: dword: coordinate of the thread window on axis x
301
    * +38 = +0x26: dword: coordinate of the thread window on axis y
301
    * +38 = +0x26: dword: coordinate of the thread window on axis y
302
    * +42 = +0x2A: dword: size of the thread window on axis x
302
    * +42 = +0x2A: dword: size of the thread window on axis x
303
    * +46 = +0x2E: dword: size of the thread window on axis y
303
    * +46 = +0x2E: dword: size of the thread window on axis y
304
    * +50 = +0x32: word: status of the thread slot:
304
    * +50 = +0x32: word: status of the thread slot:
305
      * 0 = thread is running
305
      * 0 = thread is running
306
      * 1 = thread is suspended
306
      * 1 = thread is suspended
307
      * 2 = thread is suspended while waiting for event
307
      * 2 = thread is suspended while waiting for event
308
      * 3 = thread is terminating as a result of call to function -1
308
      * 3 = thread is terminating as a result of call to function -1
309
        or under duress as a result of call to subfunction 2
309
        or under duress as a result of call to subfunction 2
310
        of function 18 or termination of the system
310
        of function 18 or termination of the system
311
      * 4 = thread is terminating as a result of exception
311
      * 4 = thread is terminating as a result of exception
312
      * 5 = thread waits for event
312
      * 5 = thread waits for event
313
      * 9 = requested slot is free, all other information on the slot
313
      * 9 = requested slot is free, all other information on the slot
314
        is not meaningful
314
        is not meaningful
315
    * +52 = +0x34: word: reserved, this word is not changed
315
    * +52 = +0x34: word: reserved, this word is not changed
316
    * +54 = +0x36: dword: coordinate of the client area on axis x
316
    * +54 = +0x36: dword: coordinate of the client area on axis x
317
    * +58 = +0x3A: dword: coordinate of the client area on axis y
317
    * +58 = +0x3A: dword: coordinate of the client area on axis y
318
    * +62 = +0x3E: dword: width of the client area
318
    * +62 = +0x3E: dword: width of the client area
319
    * +66 = +0x42: dword: height of the client area
319
    * +66 = +0x42: dword: height of the client area
320
    * +70 = +0x46: byte: state of the window - bitfield
320
    * +70 = +0x46: byte: state of the window - bitfield
321
      * bit 0 (mask 1): window is maximized
321
      * bit 0 (mask 1): window is maximized
322
      * bit 1 (mask 2): window is minimized to panel
322
      * bit 1 (mask 2): window is minimized to panel
323
      * bit 2 (mask 4): window is rolled up
323
      * bit 2 (mask 4): window is rolled up
324
    * +71 = +0x47: dword: event mask
324
    * +71 = +0x47: dword: event mask
325
    * +75 = +0x4B: byte: keyboard mode(ASCII = 0; SCAN = 1)
325
    * +75 = +0x4B: byte: keyboard mode(ASCII = 0; SCAN = 1)
326
Remarks:
326
Remarks:
327
  * Slots are numbered starting from 1.
327
  * Slots are numbered starting from 1.
328
  * Returned value is not a total number of threads, because there
328
  * Returned value is not a total number of threads, because there
329
    can be free slots.
329
    can be free slots.
330
  * When process is starting, system automatically creates
330
  * When process is starting, system automatically creates
331
    execution thread.
331
    execution thread.
332
  * Function gives information on the thread. Each process has
332
  * Function gives information on the thread. Each process has
333
    at least one thread. One process can create many threads,
333
    at least one thread. One process can create many threads,
334
    in this case each thread has its own slot and the fields
334
    in this case each thread has its own slot and the fields
335
    +10, +22, +26 in these slots coincide.
335
    +10, +22, +26 in these slots coincide.
336
    Applications have no common way to define whether two threads
336
    Applications have no common way to define whether two threads
337
    belong to one process.
337
    belong to one process.
338
  * The active window - window on top of the window stack -
338
  * The active window - window on top of the window stack -
339
    receives the messages on a keyboard input. For such window
339
    receives the messages on a keyboard input. For such window
340
    the position in the window stack coincides with returned value.
340
    the position in the window stack coincides with returned value.
341
  * Slot 1 corresponds to special system thread, for which:
341
  * Slot 1 corresponds to special system thread, for which:
342
    * the window is in the bottom of the window stack, the fields
342
    * the window is in the bottom of the window stack, the fields
343
      +4 and +6 contain value 1
343
      +4 and +6 contain value 1
344
    * name of the process - "OS/IDLE" (supplemented by spaces)
344
    * name of the process - "OS/IDLE" (supplemented by spaces)
345
    * address of the process in memory is 0, size of used memory is
345
    * address of the process in memory is 0, size of used memory is
346
      16 Mb (0x1000000)
346
      16 Mb (0x1000000)
347
    * PID=1
347
    * PID=1
348
    * coordinates and sizes of the window and the client area are by
348
    * coordinates and sizes of the window and the client area are by
349
      convention set to 0
349
      convention set to 0
350
    * status of the slot is always 0 (running)
350
    * status of the slot is always 0 (running)
351
    * the execution time adds of time leaving on operations itself
351
    * the execution time adds of time leaving on operations itself
352
      and idle time in waiting for interrupt (which can be got by call
352
      and idle time in waiting for interrupt (which can be got by call
353
      to subfunction 4 of function 18).
353
      to subfunction 4 of function 18).
354
  * Beginning from slot 2, the normal applications are placed.
354
  * Beginning from slot 2, the normal applications are placed.
355
  * The normal applications are placed in memory at the address
355
  * The normal applications are placed in memory at the address
356
    0 (kernel constant 'std_application_base_address').
356
    0 (kernel constant 'std_application_base_address').
357
    There is no intersection, as each process has its own page table.
357
    There is no intersection, as each process has its own page table.
358
  * At creation of the thread it is assigned the slot
358
  * At creation of the thread it is assigned the slot
359
    in the system table and identifier (Process/Thread IDentifier =
359
    in the system table and identifier (Process/Thread IDentifier =
360
    PID/TID), which do not vary with time for given thread.
360
    PID/TID), which do not vary with time for given thread.
361
    After completion of the thread its slot can be anew used
361
    After completion of the thread its slot can be anew used
362
    for another thread. The thread identifier can not be assigned
362
    for another thread. The thread identifier can not be assigned
363
    to other thread even after completion of this thread.
363
    to other thread even after completion of this thread.
364
    Identifiers, assigned to new threads, grow monotonously.
364
    Identifiers, assigned to new threads, grow monotonously.
365
  * If the thread has not yet defined the window by call to
365
  * If the thread has not yet defined the window by call to
366
    function 0, the position and the sizes
366
    function 0, the position and the sizes
367
    of its window are considered to be zero.
367
    of its window are considered to be zero.
368
  * Coordinates of the client area are relative to the window.
368
  * Coordinates of the client area are relative to the window.
369
  * At the moment only the part of the buffer by a size
369
  * At the moment only the part of the buffer by a size
370
    76 = 0x4C bytes is used. Nevertheless it is recommended to use
370
    76 = 0x4C bytes is used. Nevertheless it is recommended to use
371
    1-Kb buffer for the future compatibility, in the future
371
    1-Kb buffer for the future compatibility, in the future
372
    some fields can be added.
372
    some fields can be added.
373
 
373
 
374
---------------------- Constants for registers: ----------------------
374
---------------------- Constants for registers: ----------------------
375
  eax - SF_THREAD_INFO (9)
375
  eax - SF_THREAD_INFO (9)
376
======================================================================
376
======================================================================
377
==================== Function 10 - wait for event. ===================
377
==================== Function 10 - wait for event. ===================
378
======================================================================
378
======================================================================
379
If the message queue is empty, waits for appearance of the message
379
If the message queue is empty, waits for appearance of the message
380
in queue. In this state thread does not consume CPU time.
380
in queue. In this state thread does not consume CPU time.
381
Then reads out the message from queue.
381
Then reads out the message from queue.
382
 
382
 
383
Parameters:
383
Parameters:
384
  * eax = 10 - function number
384
  * eax = 10 - function number
385
Returned value:
385
Returned value:
386
  * eax = event (see the list of events)
386
  * eax = event (see the list of events)
387
Remarks:
387
Remarks:
388
  * Those events are taken into account only which enter into
388
  * Those events are taken into account only which enter into
389
    a mask set by function 40. By default it is
389
    a mask set by function 40. By default it is
390
    redraw, key and button events.
390
    redraw, key and button events.
391
  * To check, whether there is a message in queue, use function 11.
391
  * To check, whether there is a message in queue, use function 11.
392
    To wait for no more than given time, use function 23.
392
    To wait for no more than given time, use function 23.
393
 
393
 
394
---------------------- Constants for registers: ----------------------
394
---------------------- Constants for registers: ----------------------
395
  eax - SF_WAIT_EVENT (10)
395
  eax - SF_WAIT_EVENT (10)
396
======================================================================
396
======================================================================
397
=============== Function 11 - check for event, no wait. ==============
397
=============== Function 11 - check for event, no wait. ==============
398
======================================================================
398
======================================================================
399
If the message queue contains event, function reads out
399
If the message queue contains event, function reads out
400
and return it. If the queue is empty, function returns 0.
400
and return it. If the queue is empty, function returns 0.
401
Parameters:
401
Parameters:
402
  * eax = 11 - function number
402
  * eax = 11 - function number
403
Returned value:
403
Returned value:
404
  * eax = 0 - message queue is empty
404
  * eax = 0 - message queue is empty
405
  * else eax = event (see the list of events)
405
  * else eax = event (see the list of events)
406
Remarks:
406
Remarks:
407
  * Those events are taken into account only, which enter into
407
  * Those events are taken into account only, which enter into
408
    a mask set by function 40. By default it is
408
    a mask set by function 40. By default it is
409
    redraw, key and button events.
409
    redraw, key and button events.
410
  * To wait for event, use function 10.
410
  * To wait for event, use function 10.
411
    To wait for no more than given time, use function 23.
411
    To wait for no more than given time, use function 23.
412
 
412
 
413
---------------------- Constants for registers: ----------------------
413
---------------------- Constants for registers: ----------------------
414
  eax - SF_CHECK_EVENT (11)
414
  eax - SF_CHECK_EVENT (11)
415
======================================================================
415
======================================================================
416
=============== Function 12 - begin/end window redraw. ===============
416
=============== Function 12 - begin/end window redraw. ===============
417
======================================================================
417
======================================================================
418
 
418
 
419
---------------- Subfunction 1 - begin window redraw. ----------------
419
---------------- Subfunction 1 - begin window redraw. ----------------
420
Parameters:
420
Parameters:
421
  * eax = 12 - function number
421
  * eax = 12 - function number
422
  * ebx = 1 - subfunction number
422
  * ebx = 1 - subfunction number
423
Returned value:
423
Returned value:
424
  * function does not return value
424
  * function does not return value
425
 
425
 
426
----------------- Subfunction 2 - end window redraw. -----------------
426
----------------- Subfunction 2 - end window redraw. -----------------
427
Parameters:
427
Parameters:
428
  * eax = 12 - function number
428
  * eax = 12 - function number
429
  * ebx = 2 - subfunction number
429
  * ebx = 2 - subfunction number
430
Returned value:
430
Returned value:
431
  * function does not return value
431
  * function does not return value
432
Remarks:
432
Remarks:
433
  * Subfunction 1 deletes all buttons defined with
433
  * Subfunction 1 deletes all buttons defined with
434
    function 8, they must be defined again.
434
    function 8, they must be defined again.
435
 
435
 
436
---------------------- Constants for registers: ----------------------
436
---------------------- Constants for registers: ----------------------
437
  eax - SF_REDRAW (12)
437
  eax - SF_REDRAW (12)
438
  ebx - SSF_BEGIN_DRAW (1), SSF_END_DRAW (2)
438
  ebx - SSF_BEGIN_DRAW (1), SSF_END_DRAW (2)
439
======================================================================
439
======================================================================
440
============ Function 13 - draw a rectangle in the window. ===========
440
============ Function 13 - draw a rectangle in the window. ===========
441
======================================================================
441
======================================================================
442
Parameters:
442
Parameters:
443
  * eax = 13 - function number
443
  * eax = 13 - function number
444
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
444
  * ebx = [coordinate on axis x]*65536 + [size on axis x]
445
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
445
  * ecx = [coordinate on axis y]*65536 + [size on axis y]
446
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
446
  * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
447
Returned value:
447
Returned value:
448
  * function does not return value
448
  * function does not return value
449
Remarks:
449
Remarks:
450
  * Coordinates are understood as coordinates of the left upper corner
450
  * Coordinates are understood as coordinates of the left upper corner
451
    of a rectangle relative to the window.
451
    of a rectangle relative to the window.
452
 
452
 
453
---------------------- Constants for registers: ----------------------
453
---------------------- Constants for registers: ----------------------
454
  eax - SF_DRAW_RECT (13)
454
  eax - SF_DRAW_RECT (13)
455
======================================================================
455
======================================================================
456
=================== Function 14 - get screen size. ===================
456
=================== Function 14 - get screen size. ===================
457
======================================================================
457
======================================================================
458
Parameters:
458
Parameters:
459
  * eax = 14 - function number
459
  * eax = 14 - function number
460
Returned value:
460
Returned value:
461
  * eax = [xsize]*65536 + [ysize], where
461
  * eax = [xsize]*65536 + [ysize], where
462
  * xsize = x-coordinate of the right lower corner of the screen =
462
  * xsize = x-coordinate of the right lower corner of the screen =
463
            horizontal size - 1
463
            horizontal size - 1
464
  * ysize = y-coordinate of the right lower corner of the screen =
464
  * ysize = y-coordinate of the right lower corner of the screen =
465
            vertical size - 1
465
            vertical size - 1
466
Remarks:
466
Remarks:
467
  * See also subfunction 5 of function 48 - get sizes of
467
  * See also subfunction 5 of function 48 - get sizes of
468
    working area of the screen.
468
    working area of the screen.
469
 
469
 
470
---------------------- Constants for registers: ----------------------
470
---------------------- Constants for registers: ----------------------
471
  eax - SF_GET_SCREEN_SIZE (14)
471
  eax - SF_GET_SCREEN_SIZE (14)
472
======================================================================
472
======================================================================
473
== Function 15, subfunction 1 - set a size of the background image. ==
473
== Function 15, subfunction 1 - set a size of the background image. ==
474
======================================================================
474
======================================================================
475
Parameters:
475
Parameters:
476
  * eax = 15 - function number
476
  * eax = 15 - function number
477
  * ebx = 1 - subfunction number
477
  * ebx = 1 - subfunction number
478
  * ecx = width of the image
478
  * ecx = width of the image
479
  * edx = height of the image
479
  * edx = height of the image
480
Returned value:
480
Returned value:
481
  * function does not return value
481
  * function does not return value
482
Remarks:
482
Remarks:
483
  * Before calling subfunctions 2 and 5 you should call this function
483
  * Before calling subfunctions 2 and 5 you should call this function
484
    to set image size!
484
    to set image size!
485
  * For update of the screen (after completion of a series of commands
485
  * For update of the screen (after completion of a series of commands
486
    working with a background) call subfunction 3.
486
    working with a background) call subfunction 3.
487
  * There is a pair function for get size of the background image -
487
  * There is a pair function for get size of the background image -
488
    subfunction 1 of function 39.
488
    subfunction 1 of function 39.
489
 
489
 
490
---------------------- Constants for registers: ----------------------
490
---------------------- Constants for registers: ----------------------
491
  eax - SF_BACKGROUND_SET (15)
491
  eax - SF_BACKGROUND_SET (15)
492
  ebx - SSF_SIZE_BG (1)
492
  ebx - SSF_SIZE_BG (1)
493
======================================================================
493
======================================================================
494
=== Function 15, subfunction 2 - put pixel on the background image. ==
494
=== Function 15, subfunction 2 - put pixel on the background image. ==
495
======================================================================
495
======================================================================
496
Parameters:
496
Parameters:
497
  * eax = 15 - function number
497
  * eax = 15 - function number
498
  * ebx = 2 - subfunction number
498
  * ebx = 2 - subfunction number
499
  * ecx = offset
499
  * ecx = offset
500
  * edx = color of a pixel 0xRRGGBB
500
  * edx = color of a pixel 0xRRGGBB
501
Returned value:
501
Returned value:
502
  * function does not return value
502
  * function does not return value
503
Remarks:
503
Remarks:
504
  * Offset for a pixel with coordinates (x,y) is calculated as
504
  * Offset for a pixel with coordinates (x,y) is calculated as
505
    (x+y*xsize)*3.
505
    (x+y*xsize)*3.
506
  * If the given offset exceeds size set by subfunction 1,
506
  * If the given offset exceeds size set by subfunction 1,
507
    the call is ignored.
507
    the call is ignored.
508
  * For update of the screen (after completion of a series of commands
508
  * For update of the screen (after completion of a series of commands
509
    working with a background) call subfunction 3.
509
    working with a background) call subfunction 3.
510
  * There is a pair function for get pixel on the background image -
510
  * There is a pair function for get pixel on the background image -
511
    subfunction 2 of function 39.
511
    subfunction 2 of function 39.
512
 
512
 
513
---------------------- Constants for registers: ----------------------
513
---------------------- Constants for registers: ----------------------
514
  eax - SF_BACKGROUND_SET (15)
514
  eax - SF_BACKGROUND_SET (15)
515
  ebx - SSF_PIXEL_BG (2)
515
  ebx - SSF_PIXEL_BG (2)
516
======================================================================
516
======================================================================
517
=========== Function 15, subfunction 3 - redraw background. ==========
517
=========== Function 15, subfunction 3 - redraw background. ==========
518
======================================================================
518
======================================================================
519
Parameters:
519
Parameters:
520
  * eax = 15 - function number
520
  * eax = 15 - function number
521
  * ebx = 3 - subfunction number
521
  * ebx = 3 - subfunction number
522
Returned value:
522
Returned value:
523
  * function does not return value
523
  * function does not return value
524
 
524
 
525
---------------------- Constants for registers: ----------------------
525
---------------------- Constants for registers: ----------------------
526
  eax - SF_BACKGROUND_SET (15)
526
  eax - SF_BACKGROUND_SET (15)
527
  ebx - SSF_REDRAW_BG (3)
527
  ebx - SSF_REDRAW_BG (3)
528
======================================================================
528
======================================================================
529
== Function 15, subfunction 4 - set drawing mode for the background. =
529
== Function 15, subfunction 4 - set drawing mode for the background. =
530
======================================================================
530
======================================================================
531
Parameters:
531
Parameters:
532
  * eax = 15 - function number
532
  * eax = 15 - function number
533
  * ebx = 4 - subfunction number
533
  * ebx = 4 - subfunction number
534
  * ecx = drawing mode:
534
  * ecx = drawing mode:
535
    * 1 = tile
535
    * 1 = tile
536
    * 2 = stretch
536
    * 2 = stretch
537
Returned value:
537
Returned value:
538
  * function does not return value
538
  * function does not return value
539
Remarks:
539
Remarks:
540
  * For update of the screen (after completion of a series of commands
540
  * For update of the screen (after completion of a series of commands
541
    working with a background) call subfunction 3.
541
    working with a background) call subfunction 3.
542
  * There is a pair function for get drawing mode of the background -
542
  * There is a pair function for get drawing mode of the background -
543
    subfunction 4 of function 39.
543
    subfunction 4 of function 39.
544
 
544
 
545
---------------------- Constants for registers: ----------------------
545
---------------------- Constants for registers: ----------------------
546
  eax - SF_BACKGROUND_SET (15)
546
  eax - SF_BACKGROUND_SET (15)
547
  ebx - SSF_MODE_BG (4)
547
  ebx - SSF_MODE_BG (4)
548
======================================================================
548
======================================================================
549
===================== Function 15, subfunction 5 =====================
549
===================== Function 15, subfunction 5 =====================
550
============ Put block of pixels on the background image. ============
550
============ Put block of pixels on the background image. ============
551
======================================================================
551
======================================================================
552
Parameters:
552
Parameters:
553
  * eax = 15 - function number
553
  * eax = 15 - function number
554
  * ebx = 5 - subfunction number
554
  * ebx = 5 - subfunction number
555
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
555
  * ecx = pointer to the data in the format BBGGRRBBGGRR...
556
  * edx = offset in data of the background image
556
  * edx = offset in data of the background image
557
  * esi = size of data in bytes = 3 * number of pixels
557
  * esi = size of data in bytes = 3 * number of pixels
558
Returned value:
558
Returned value:
559
  * function does not return value
559
  * function does not return value
560
Remarks:
560
Remarks:
561
  * Offset and size are not checked for correctness.
561
  * Offset and size are not checked for correctness.
562
  * Color of each pixel is stored as 3-bytes value BBGGRR.
562
  * Color of each pixel is stored as 3-bytes value BBGGRR.
563
  * Pixels of the background image are written sequentially
563
  * Pixels of the background image are written sequentially
564
    from left to right, from up to down.
564
    from left to right, from up to down.
565
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
565
  * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
566
  * For update of the screen (after completion of a series of commands
566
  * For update of the screen (after completion of a series of commands
567
    working with a background) call subfunction 3.
567
    working with a background) call subfunction 3.
568
 
568
 
569
---------------------- Constants for registers: ----------------------
569
---------------------- Constants for registers: ----------------------
570
  eax - SF_BACKGROUND_SET (15)
570
  eax - SF_BACKGROUND_SET (15)
571
  ebx - SSF_IMAGE_BG (5)
571
  ebx - SSF_IMAGE_BG (5)
572
======================================================================
572
======================================================================
573
===================== Function 15, subfunction 6 =====================
573
===================== Function 15, subfunction 6 =====================
574
======== Map background data to the address space of process. ========
574
======== Map background data to the address space of process. ========
575
======================================================================
575
======================================================================
576
Parameters:
576
Parameters:
577
  * eax = 15 - function number
577
  * eax = 15 - function number
578
  * ebx = 6 - subfunction number
578
  * ebx = 6 - subfunction number
579
Returned value:
579
Returned value:
580
  * eax = pointer to background data, 0 if error
580
  * eax = pointer to background data, 0 if error
581
Remarks:
581
Remarks:
582
  * Mapped data are available for read and write.
582
  * Mapped data are available for read and write.
583
  * Size of background data is 3*xsize*ysize. The system blocks
583
  * Size of background data is 3*xsize*ysize. The system blocks
584
    changes of background sizes while process works with mapped data.
584
    changes of background sizes while process works with mapped data.
585
  * Color of each pixel is stored as 3-bytes value BBGGRR.
585
  * Color of each pixel is stored as 3-bytes value BBGGRR.
586
  * Pixels of the background image are written sequentially
586
  * Pixels of the background image are written sequentially
587
    from left to right, from up to down.
587
    from left to right, from up to down.
588
 
588
 
589
---------------------- Constants for registers: ----------------------
589
---------------------- Constants for registers: ----------------------
590
  eax - SF_BACKGROUND_SET (15)
590
  eax - SF_BACKGROUND_SET (15)
591
  ebx - SSF_MAP_BG (6)
591
  ebx - SSF_MAP_BG (6)
592
======================================================================
592
======================================================================
593
===== Function 15, subfunction 7 - close mapped background data. =====
593
===== Function 15, subfunction 7 - close mapped background data. =====
594
======================================================================
594
======================================================================
595
Parameters:
595
Parameters:
596
  * eax = 15 - function number
596
  * eax = 15 - function number
597
  * ebx = 7 - subfunction number
597
  * ebx = 7 - subfunction number
598
  * ecx = pointer to mapped data
598
  * ecx = pointer to mapped data
599
Returned value:
599
Returned value:
600
  * eax = 1 - success, 0 - error
600
  * eax = 1 - success, 0 - error
601
 
601
 
602
---------------------- Constants for registers: ----------------------
602
---------------------- Constants for registers: ----------------------
603
  eax - SF_BACKGROUND_SET (15)
603
  eax - SF_BACKGROUND_SET (15)
604
  ebx - SSF_UNMAP_BG (7)
604
  ebx - SSF_UNMAP_BG (7)
605
======================================================================
605
======================================================================
606
===================== Function 15, subfunction 8 =====================
606
===================== Function 15, subfunction 8 =====================
607
============= Get coordinates of last draw the background ============
607
============= Get coordinates of last draw the background ============
608
======================================================================
608
======================================================================
609
Parameters:
609
Parameters:
610
  * eax = 15 - function number
610
  * eax = 15 - function number
611
  * ebx = 8 - subfunction number
611
  * ebx = 8 - subfunction number
612
Returned value:
612
Returned value:
613
  * eax = [left]*65536 + [right]
613
  * eax = [left]*65536 + [right]
614
  * ebx = [top]*65536 + [bottom]
614
  * ebx = [top]*65536 + [bottom]
615
Remarks:
615
Remarks:
616
  * (left,top) are coordinates of the left upper corner,
616
  * (left,top) are coordinates of the left upper corner,
617
    (right,bottom) are coordinates of the right lower one.
617
    (right,bottom) are coordinates of the right lower one.
618
  * For receiving more reliable information, call the function
618
  * For receiving more reliable information, call the function
619
    immediately after the event:
619
    immediately after the event:
620
             5 = kernel finished redrawing of the desktop background
620
             5 = kernel finished redrawing of the desktop background
621
 
621
 
622
---------------------- Constants for registers: ----------------------
622
---------------------- Constants for registers: ----------------------
623
  eax - SF_BACKGROUND_SET (15)
623
  eax - SF_BACKGROUND_SET (15)
624
  ebx - SSF_LAST_DRAW (8)
624
  ebx - SSF_LAST_DRAW (8)
625
======================================================================
625
======================================================================
626
===================== Function 15, subfunction 9 =====================
626
===================== Function 15, subfunction 9 =====================
627
============= Redraws a rectangular part of the background ===========
627
============= Redraws a rectangular part of the background ===========
628
======================================================================
628
======================================================================
629
Parameters:
629
Parameters:
630
  * eax = 15 - function number
630
  * eax = 15 - function number
631
  * ebx = 9 - subfunction number
631
  * ebx = 9 - subfunction number
632
  * ecx = [left]*65536 + [right]
632
  * ecx = [left]*65536 + [right]
633
  * edx = [top]*65536 + [bottom]
633
  * edx = [top]*65536 + [bottom]
634
Returned value:
634
Returned value:
635
  * function does not return value
635
  * function does not return value
636
Remarks:
636
Remarks:
637
  * (left,top) are coordinates of the left upper corner,
637
  * (left,top) are coordinates of the left upper corner,
638
    (right,bottom) are coordinates of the right lower one.
638
    (right,bottom) are coordinates of the right lower one.
639
  * If parameters are set incorrectly then background is not redrawn.
639
  * If parameters are set incorrectly then background is not redrawn.
640
 
640
 
641
---------------------- Constants for registers: ----------------------
641
---------------------- Constants for registers: ----------------------
642
  eax - SF_BACKGROUND_SET (15)
642
  eax - SF_BACKGROUND_SET (15)
643
  ebx - SSF_REDRAW_RECT (9)
643
  ebx - SSF_REDRAW_RECT (9)
644
======================================================================
644
======================================================================
645
=============== Function 16 - save ramdisk on a floppy. ==============
645
=============== Function 16 - save ramdisk on a floppy. ==============
646
======================================================================
646
======================================================================
647
Parameters:
647
Parameters:
648
  * eax = 16 - function number
648
  * eax = 16 - function number
649
  * ebx = 1 or ebx = 2 - on which floppy save
649
  * ebx = 1 or ebx = 2 - on which floppy save
650
Returned value:
650
Returned value:
651
  * eax = 0 - success
651
  * eax = 0 - success
652
  * eax = 1 - error
652
  * eax = 1 - error
653
 
653
 
654
---------------------- Constants for registers: ----------------------
654
---------------------- Constants for registers: ----------------------
655
  eax - SF_RD_TO_FLOPPY (16)
655
  eax - SF_RD_TO_FLOPPY (16)
656
======================================================================
656
======================================================================
657
======= Function 17 - get the identifier of the pressed button. ======
657
======= Function 17 - get the identifier of the pressed button. ======
658
======================================================================
658
======================================================================
659
Takes away the code of the pressed button from the buffer.
659
Takes away the code of the pressed button from the buffer.
660
Parameters:
660
Parameters:
661
  * eax = 17 - function number
661
  * eax = 17 - function number
662
Returned value:
662
Returned value:
663
  * if the buffer is empty, function returns eax=1
663
  * if the buffer is empty, function returns eax=1
664
  * if the buffer is not empty:
664
  * if the buffer is not empty:
665
    * high 24 bits of eax contain button identifier (in particular,
665
    * high 24 bits of eax contain button identifier (in particular,
666
      ah contains low byte of the identifier; if all buttons have
666
      ah contains low byte of the identifier; if all buttons have
667
      the identifier less than 256, ah is enough to distinguish)
667
      the identifier less than 256, ah is enough to distinguish)
668
    * al = 0 - the button was pressed with left mouse button
668
    * al = 0 - the button was pressed with left mouse button
669
    * al = bit corresponding to used mouse button otherwise
669
    * al = bit corresponding to used mouse button otherwise
670
Remarks:
670
Remarks:
671
  * "Buffer" keeps only one button, at pressing the new button the
671
  * "Buffer" keeps only one button, at pressing the new button the
672
    information about old is lost.
672
    information about old is lost.
673
  * The call of this function by an application with inactive window
673
  * The call of this function by an application with inactive window
674
    will return answer "buffer is empty".
674
    will return answer "buffer is empty".
675
  * Returned value for al corresponds to the state of mouse buttons
675
  * Returned value for al corresponds to the state of mouse buttons
676
    as in subfunction 2 of function 37 at the beginning
676
    as in subfunction 2 of function 37 at the beginning
677
    of button press, excluding lower bit, which is cleared.
677
    of button press, excluding lower bit, which is cleared.
678
 
678
 
679
---------------------- Constants for registers: ----------------------
679
---------------------- Constants for registers: ----------------------
680
  eax - SF_GET_BUTTON (17)
680
  eax - SF_GET_BUTTON (17)
681
======================================================================
681
======================================================================
682
===================== Function 18, subfunction 1 =====================
682
===================== Function 18, subfunction 1 =====================
683
============= Make deactive the window of the given thread. ==========
683
============= Make deactive the window of the given thread. ==========
684
======================================================================
684
======================================================================
685
Parameters:
685
Parameters:
686
  * eax = 18 - function number
686
  * eax = 18 - function number
687
  * ebx = 1 - subfunction number
687
  * ebx = 1 - subfunction number
688
  * ecx = number of the thread slot
688
  * ecx = number of the thread slot
689
Returned value:
689
Returned value:
690
  * function does not return value
690
  * function does not return value
691
 
691
 
692
---------------------- Constants for registers: ----------------------
692
---------------------- Constants for registers: ----------------------
693
  eax - SF_SYSTEM (18)
693
  eax - SF_SYSTEM (18)
694
  ebx - SSF_UNFOCUS_WINDOW (1)
694
  ebx - SSF_UNFOCUS_WINDOW (1)
695
======================================================================
695
======================================================================
696
= Function 18, subfunction 2 - terminate process/thread by the slot. =
696
= Function 18, subfunction 2 - terminate process/thread by the slot. =
697
======================================================================
697
======================================================================
698
Parameters:
698
Parameters:
699
  * eax = 18 - function number
699
  * eax = 18 - function number
700
  * ebx = 2 - subfunction number
700
  * ebx = 2 - subfunction number
701
  * ecx = number of the slot of process/thread
701
  * ecx = number of the slot of process/thread
702
Returned value:
702
Returned value:
703
  * function does not return value
703
  * function does not return value
704
Remarks:
704
Remarks:
705
  * It is impossible to terminate system thread OS/IDLE (with
705
  * It is impossible to terminate system thread OS/IDLE (with
706
    number of the slot 1),
706
    number of the slot 1),
707
    it is possible to terminate any normal process/thread.
707
    it is possible to terminate any normal process/thread.
708
  * See also subfunction 18 - terminate
708
  * See also subfunction 18 - terminate
709
    process/thread by the identifier.
709
    process/thread by the identifier.
710
 
710
 
711
---------------------- Constants for registers: ----------------------
711
---------------------- Constants for registers: ----------------------
712
  eax - SF_SYSTEM (18)
712
  eax - SF_SYSTEM (18)
713
  ebx - SSF_TERMINATE_THREAD (2)
713
  ebx - SSF_TERMINATE_THREAD (2)
714
======================================================================
714
======================================================================
715
===================== Function 18, subfunction 3 =====================
715
===================== Function 18, subfunction 3 =====================
716
============= Make active the window of the given thread. ============
716
============= Make active the window of the given thread. ============
717
======================================================================
717
======================================================================
718
Parameters:
718
Parameters:
719
  * eax = 18 - function number
719
  * eax = 18 - function number
720
  * ebx = 3 - subfunction number
720
  * ebx = 3 - subfunction number
721
  * ecx = number of the thread slot
721
  * ecx = number of the thread slot
722
Returned value:
722
Returned value:
723
  * function does not return value
723
  * function does not return value
724
Remarks:
724
Remarks:
725
  * If correct, but nonexistent slot is given,
725
  * If correct, but nonexistent slot is given,
726
    some window is made active.
726
    some window is made active.
727
  * To find out, which window is active, use subfunction 7.
727
  * To find out, which window is active, use subfunction 7.
728
 
728
 
729
---------------------- Constants for registers: ----------------------
729
---------------------- Constants for registers: ----------------------
730
  eax - SF_SYSTEM (18)
730
  eax - SF_SYSTEM (18)
731
  ebx - SSF_FOCUS_WINDOW (3)
731
  ebx - SSF_FOCUS_WINDOW (3)
732
======================================================================
732
======================================================================
733
===================== Function 18, subfunction 4 =====================
733
===================== Function 18, subfunction 4 =====================
734
=========== Get counter of idle time units per one second. ===========
734
=========== Get counter of idle time units per one second. ===========
735
======================================================================
735
======================================================================
736
Idle time units are units, in which the processor stands idle
736
Idle time units are units, in which the processor stands idle
737
in waiting for interrupt (in the command 'hlt').
737
in waiting for interrupt (in the command 'hlt').
738
 
738
 
739
Parameters:
739
Parameters:
740
  * eax = 18 - function number
740
  * eax = 18 - function number
741
  * ebx = 4 - subfunction number
741
  * ebx = 4 - subfunction number
742
Returned value:
742
Returned value:
743
  * eax = value of the counter of idle time units per one second
743
  * eax = value of the counter of idle time units per one second
744
 
744
 
745
---------------------- Constants for registers: ----------------------
745
---------------------- Constants for registers: ----------------------
746
  eax - SF_SYSTEM (18)
746
  eax - SF_SYSTEM (18)
747
  ebx - SSF_GET_IDLE_COUNT (4)
747
  ebx - SSF_GET_IDLE_COUNT (4)
748
======================================================================
748
======================================================================
749
========== Function 18, subfunction 5 - get CPU clock rate. ==========
749
========== Function 18, subfunction 5 - get CPU clock rate. ==========
750
======================================================================
750
======================================================================
751
Parameters:
751
Parameters:
752
  * eax = 18 - function number
752
  * eax = 18 - function number
753
  * ebx = 5 - subfunction number
753
  * ebx = 5 - subfunction number
754
Returned value:
754
Returned value:
755
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
755
  * eax = clock rate (modulo 2^32 clock ticks = 4GHz)
756
 
756
 
757
---------------------- Constants for registers: ----------------------
757
---------------------- Constants for registers: ----------------------
758
  eax - SF_SYSTEM (18)
758
  eax - SF_SYSTEM (18)
759
  ebx - SSF_GET_CPU_REQUENCY (5)
759
  ebx - SSF_GET_CPU_REQUENCY (5)
760
======================================================================
760
======================================================================
761
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
761
 Function 18, subfunction 6 - save ramdisk to the file on hard drive.
762
======================================================================
762
======================================================================
763
Parameters:
763
Parameters:
764
  * eax = 18 - function number
764
  * eax = 18 - function number
765
  * ebx = 6 - subfunction number
765
  * ebx = 6 - subfunction number
766
  * ecx = pointer to the full path to file
766
  * ecx = pointer to the full path to file
767
    (for example, "/hd0/1/kolibri/kolibri.img")
767
    (for example, "/hd0/1/kolibri/kolibri.img")
768
Returned value:
768
Returned value:
769
  * eax = 0 - success
769
  * eax = 0 - success
770
  * else eax = error code of the file system
770
  * else eax = error code of the file system
771
Remarks:
771
Remarks:
772
  * All folders in the given path must exist, otherwise function
772
  * All folders in the given path must exist, otherwise function
773
    returns value 5, "file not found".
773
    returns value 5, "file not found".
774
 
774
 
775
---------------------- Constants for registers: ----------------------
775
---------------------- Constants for registers: ----------------------
776
  eax - SF_SYSTEM (18)
776
  eax - SF_SYSTEM (18)
777
  ebx - SSF_RD_TO_HDD (6)
777
  ebx - SSF_RD_TO_HDD (6)
778
======================================================================
778
======================================================================
779
=========== Function 18, subfunction 7 - get active window. ==========
779
=========== Function 18, subfunction 7 - get active window. ==========
780
======================================================================
780
======================================================================
781
Parameters:
781
Parameters:
782
  * eax = 18 - function number
782
  * eax = 18 - function number
783
  * ebx = 7 - subfunction number
783
  * ebx = 7 - subfunction number
784
Returned value:
784
Returned value:
785
  * eax = number of the active window
785
  * eax = number of the active window
786
    (number of the slot of the thread with active window)
786
    (number of the slot of the thread with active window)
787
Remarks:
787
Remarks:
788
  * Active window is at the top of the window stack and receives
788
  * Active window is at the top of the window stack and receives
789
    messages on all keyboard input.
789
    messages on all keyboard input.
790
  * To make a window active, use subfunction 3.
790
  * To make a window active, use subfunction 3.
791
 
791
 
792
---------------------- Constants for registers: ----------------------
792
---------------------- Constants for registers: ----------------------
793
  eax - SF_SYSTEM (18)
793
  eax - SF_SYSTEM (18)
794
  ebx - SSF_GET_ACTIVE_WINDOW (7)
794
  ebx - SSF_GET_ACTIVE_WINDOW (7)
795
======================================================================
795
======================================================================
796
== Function 18, subfunction 8 - disable/enable the internal speaker. =
796
== Function 18, subfunction 8 - disable/enable the internal speaker. =
797
======================================================================
797
======================================================================
798
If speaker sound is disabled, all calls to subfunction 55 of
798
If speaker sound is disabled, all calls to subfunction 55 of
799
function 55 are ignored. If speaker sound is enabled,
799
function 55 are ignored. If speaker sound is enabled,
800
they are routed on builtin speaker.
800
they are routed on builtin speaker.
801
 
801
 
802
------------------- Subsubfunction 1 - get status. -------------------
802
------------------- Subsubfunction 1 - get status. -------------------
803
Parameters:
803
Parameters:
804
  * eax = 18 - function number
804
  * eax = 18 - function number
805
  * ebx = 8 - subfunction number
805
  * ebx = 8 - subfunction number
806
  * ecx = 1 - number of the subsubfunction
806
  * ecx = 1 - number of the subsubfunction
807
Returned value:
807
Returned value:
808
  * eax = 0 - speaker sound is enabled; 1 - disabled
808
  * eax = 0 - speaker sound is enabled; 1 - disabled
809
 
809
 
810
----------------- Subsubfunction 2 - toggle status. ------------------
810
----------------- Subsubfunction 2 - toggle status. ------------------
811
Toggles states of disable/enable.
811
Toggles states of disable/enable.
812
Parameters:
812
Parameters:
813
  * eax = 18 - function number
813
  * eax = 18 - function number
814
  * ebx = 8 - subfunction number
814
  * ebx = 8 - subfunction number
815
  * ecx = 2 - number of the subsubfunction
815
  * ecx = 2 - number of the subsubfunction
816
Returned value:
816
Returned value:
817
  * function does not return value
817
  * function does not return value
818
 
818
 
819
---------------------- Constants for registers: ----------------------
819
---------------------- Constants for registers: ----------------------
820
  eax - SF_SYSTEM (18)
820
  eax - SF_SYSTEM (18)
821
  ebx - SSF_SPEAKER (8)
821
  ebx - SSF_SPEAKER (8)
822
  ecx - SSSF_GET_STATE (1), SSSF_TOGGLE (2)
822
  ecx - SSSF_GET_STATE (1), SSSF_TOGGLE (2)
823
======================================================================
823
======================================================================
824
== Function 18, subfunction 9 - system shutdown with the parameter. ==
824
== Function 18, subfunction 9 - system shutdown with the parameter. ==
825
======================================================================
825
======================================================================
826
Parameters:
826
Parameters:
827
  * eax = 18 - function number
827
  * eax = 18 - function number
828
  * ebx = 9 - subfunction number
828
  * ebx = 9 - subfunction number
829
  * ecx = parameter:
829
  * ecx = parameter:
830
    * 2 = turn off computer
830
    * 2 = turn off computer
831
    * 3 = reboot computer
831
    * 3 = reboot computer
832
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
832
    * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
833
Returned value:
833
Returned value:
834
  * at incorrect ecx the registers do not change (i.e. eax=18)
834
  * at incorrect ecx the registers do not change (i.e. eax=18)
835
  * by correct call function always returns eax=0
835
  * by correct call function always returns eax=0
836
    as the tag of success
836
    as the tag of success
837
Remarks:
837
Remarks:
838
  * Do not rely on returned value by incorrect call, it can be
838
  * Do not rely on returned value by incorrect call, it can be
839
    changed in future versions of the kernel.
839
    changed in future versions of the kernel.
840
 
840
 
841
---------------------- Constants for registers: ----------------------
841
---------------------- Constants for registers: ----------------------
842
  eax - SF_SYSTEM (18)
842
  eax - SF_SYSTEM (18)
843
  ebx - SSF_SHUTDOWN (9)
843
  ebx - SSF_SHUTDOWN (9)
844
======================================================================
844
======================================================================
845
======= Function 18, subfunction 10 - minimize topmost window. =======
845
======= Function 18, subfunction 10 - minimize topmost window. =======
846
======================================================================
846
======================================================================
847
Minimizes the topmost (active) window.
847
Minimizes the topmost (active) window.
848
Parameters:
848
Parameters:
849
  * eax = 18 - function number
849
  * eax = 18 - function number
850
  * ebx = 10 - subfunction number
850
  * ebx = 10 - subfunction number
851
Returned value:
851
Returned value:
852
  * function does not return value
852
  * function does not return value
853
Remarks:
853
Remarks:
854
  * The minimized window from the point of view of function 9
854
  * The minimized window from the point of view of function 9
855
    keeps position and sizes.
855
    keeps position and sizes.
856
  * Restoring of an application window occurs at its activation by
856
  * Restoring of an application window occurs at its activation by
857
    subfunction 3.
857
    subfunction 3.
858
  * Usually there is no necessity to minimize/restore a window
858
  * Usually there is no necessity to minimize/restore a window
859
    explicitly: minimization of a window is carried out by the system
859
    explicitly: minimization of a window is carried out by the system
860
    at pressing the minimization button (for skinned windows
860
    at pressing the minimization button (for skinned windows
861
    it is defined automatically by function 0,
861
    it is defined automatically by function 0,
862
    for other windows it can be defined manually by function 8),
862
    for other windows it can be defined manually by function 8),
863
    restore of a window is done by the application '@taskbar'.
863
    restore of a window is done by the application '@taskbar'.
864
 
864
 
865
---------------------- Constants for registers: ----------------------
865
---------------------- Constants for registers: ----------------------
866
  eax - SF_SYSTEM (18)
866
  eax - SF_SYSTEM (18)
867
  ebx - SSF_MINIMIZE_WINDOW (10)
867
  ebx - SSF_MINIMIZE_WINDOW (10)
868
======================================================================
868
======================================================================
869
 Function 18, subfunction 11 - get information on the disk subsystem.
869
 Function 18, subfunction 11 - get information on the disk subsystem.
870
======================================================================
870
======================================================================
871
Parameters:
871
Parameters:
872
  * eax = 18 - function number
872
  * eax = 18 - function number
873
  * ebx = 11 - subfunction number
873
  * ebx = 11 - subfunction number
874
  * ecx = type of the table:
874
  * ecx = type of the table:
875
    * 1 = short version, 16 bytes
875
    * 1 = short version, 16 bytes
876
  * edx = pointer to the buffer (in the application) for the table
876
  * edx = pointer to the buffer (in the application) for the table
877
Returned value:
877
Returned value:
878
  * function does not return value
878
  * function does not return value
879
Format of the table: short version:
879
Format of the table: short version:
880
  * +0: byte: information about FDD's (drives for floppies),
880
  * +0: byte: information about FDD's (drives for floppies),
881
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
881
    AAAABBBB, where AAAA gives type of the first drive, BBBB -
882
    of the second regarding to the following list:
882
    of the second regarding to the following list:
883
    * 0 = there is no drive
883
    * 0 = there is no drive
884
    * 1 = 360Kb, 5.25''
884
    * 1 = 360Kb, 5.25''
885
    * 2 = 1.2Mb, 5.25''
885
    * 2 = 1.2Mb, 5.25''
886
    * 3 = 720Kb, 3.5''
886
    * 3 = 720Kb, 3.5''
887
    * 4 = 1.44Mb, 3.5''
887
    * 4 = 1.44Mb, 3.5''
888
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
888
    * 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
889
    For example, for the standard configuration from one 1.44-drive
889
    For example, for the standard configuration from one 1.44-drive
890
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
890
    here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
891
    the value is 24h.
891
    the value is 24h.
892
 
892
 
893
  First IDE controller:
893
  First IDE controller:
894
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
894
  * +1: byte: information about hard disks and CD-drives, AABBCCDD,
895
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
895
    where AA corresponds to the controller IDE0, ..., DD - IDE3:
896
    * 0 = device not found
896
    * 0 = device not found
897
    * 1 = hard drive
897
    * 1 = hard drive
898
    * 2 = CD-drive
898
    * 2 = CD-drive
899
    For example, in the case HD on IDE0 and CD on IDE2
899
    For example, in the case HD on IDE0 and CD on IDE2
900
    this field contains 48h.
900
    this field contains 48h.
901
  * +2: 4 db: number of the retrieved partitions on hard disks
901
  * +2: 4 db: number of the retrieved partitions on hard disks
902
    at accordingly IDE0,...,IDE3.
902
    at accordingly IDE0,...,IDE3.
903
 
903
 
904
  Second IDE controller:
904
  Second IDE controller:
905
  * +6: byte: information about hard disks and CD-drives, AABBCCDD,
905
  * +6: byte: information about hard disks and CD-drives, AABBCCDD,
906
    where AA corresponds to the controller IDE4, ..., DD - IDE7:
906
    where AA corresponds to the controller IDE4, ..., DD - IDE7:
907
    * 0 = device not found
907
    * 0 = device not found
908
    * 1 = hard drive
908
    * 1 = hard drive
909
    * 2 = CD-drive
909
    * 2 = CD-drive
910
    For example, in the case HD on IDE4 and CD on IDE6
910
    For example, in the case HD on IDE4 and CD on IDE6
911
    this field contains 48h.
911
    this field contains 48h.
912
  * +7: 4 db: number of the retrieved partitions on hard disks
912
  * +7: 4 db: number of the retrieved partitions on hard disks
913
    at accordingly IDE4,...,IDE7.
913
    at accordingly IDE4,...,IDE7.
914
 
914
 
915
  Third IDE controller:
915
  Third IDE controller:
916
  * +11: byte: information about hard disks and CD-drives, AABBCCDD,
916
  * +11: byte: information about hard disks and CD-drives, AABBCCDD,
917
    where AA corresponds to the controller IDE8, ..., DD - IDE11:
917
    where AA corresponds to the controller IDE8, ..., DD - IDE11:
918
    * 0 = device not found
918
    * 0 = device not found
919
    * 1 = hard drive
919
    * 1 = hard drive
920
    * 2 = CD-drive
920
    * 2 = CD-drive
921
    For example, in the case HD on IDE8 and CD on IDE10
921
    For example, in the case HD on IDE8 and CD on IDE10
922
    this field contains 48h.
922
    this field contains 48h.
923
  * +12: 4 db: number of the retrieved partitions on hard disks
923
  * +12: 4 db: number of the retrieved partitions on hard disks
924
    at accordingly IDE8,...,IDE11.
924
    at accordingly IDE8,...,IDE11.
925
 
925
 
926
    If the hard disk on IDEx is absent, appropriate byte is zero,
926
    If the hard disk on IDEx is absent, appropriate byte is zero,
927
    otherwise it shows number of the recognized partitions, which
927
    otherwise it shows number of the recognized partitions, which
928
    can be not presented (if the drive is not formatted or if
928
    can be not presented (if the drive is not formatted or if
929
    the file system is not supported). Current version of the kernel
929
    the file system is not supported). Current version of the kernel
930
    supports only FAT12/16/32, NTFS, ext2/3/4 and XFS for hard disks.
930
    supports only FAT12/16/32, NTFS, ext2/3/4 and XFS for hard disks.
931
 
931
 
932
Remarks:
932
Remarks:
933
  * The table can be used for obtaining the information about
933
  * The table can be used for obtaining the information about
934
    available devices.
934
    available devices.
935
 
935
 
936
---------------------- Constants for registers: ----------------------
936
---------------------- Constants for registers: ----------------------
937
  eax - SF_SYSTEM (18)
937
  eax - SF_SYSTEM (18)
938
  ebx - SSF_INFO_DISC_SYS (11)
938
  ebx - SSF_INFO_DISC_SYS (11)
939
======================================================================
939
======================================================================
940
========== Function 18, subfunction 13 - get kernel version. =========
940
========== Function 18, subfunction 13 - get kernel version. =========
941
======================================================================
941
======================================================================
942
Parameters:
942
Parameters:
943
  * eax = 18 - function number
943
  * eax = 18 - function number
944
  * ebx = 13 - subfunction number
944
  * ebx = 13 - subfunction number
945
  * ecx = pointer to the buffer (not less than 16 bytes), where
945
  * ecx = pointer to the buffer (not less than 16 bytes), where
946
    the information will be placed
946
    the information will be placed
947
Returned value:
947
Returned value:
948
  * function does not return value
948
  * function does not return value
949
Structure of the buffer:
949
Structure of the buffer:
950
db a,b,c,d for version a.b.c.d
950
db a,b,c,d for version a.b.c.d
951
db 0: reserved
951
db 0: reserved
952
dd REV - kernel SVN revision number
952
dd REV - kernel SVN revision number
953
For Kolibri 0.7.7.0+ kernel:
953
For Kolibri 0.7.7.0+ kernel:
954
db 0,7,7,0
954
db 0,7,7,0
955
db 0
955
db 0
956
dd 1675
956
dd 1675
957
 
957
 
958
---------------------- Constants for registers: ----------------------
958
---------------------- Constants for registers: ----------------------
959
  eax - SF_SYSTEM (18)
959
  eax - SF_SYSTEM (18)
960
  ebx - SSF_KERNEL_VERSION (13)
960
  ebx - SSF_KERNEL_VERSION (13)
961
======================================================================
961
======================================================================
962
======= Function 18, subfunction 14 - wait for screen retrace. =======
962
======= Function 18, subfunction 14 - wait for screen retrace. =======
963
======================================================================
963
======================================================================
964
Waits for the beginning of retrace of the scanning ray of the screen
964
Waits for the beginning of retrace of the scanning ray of the screen
965
monitor.
965
monitor.
966
Parameters:
966
Parameters:
967
  * eax = 18 - function number
967
  * eax = 18 - function number
968
  * ebx = 14 - subfunction number
968
  * ebx = 14 - subfunction number
969
Returned value:
969
Returned value:
970
  * eax = 0 as the tag of success
970
  * eax = 0 as the tag of success
971
Remarks:
971
Remarks:
972
  * Function is intended only for active high-efficiency graphics
972
  * Function is intended only for active high-efficiency graphics
973
    applications; is used for smooth output of a graphics.
973
    applications; is used for smooth output of a graphics.
974
 
974
 
975
---------------------- Constants for registers: ----------------------
975
---------------------- Constants for registers: ----------------------
976
  eax - SF_SYSTEM (18)
976
  eax - SF_SYSTEM (18)
977
  ebx - SSF_WAIT_RETRACE (14)
977
  ebx - SSF_WAIT_RETRACE (14)
978
======================================================================
978
======================================================================
979
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
979
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
980
======================================================================
980
======================================================================
981
Parameters:
981
Parameters:
982
  * eax = 18 - function number
982
  * eax = 18 - function number
983
  * ebx = 15 - subfunction number
983
  * ebx = 15 - 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
 
986
 
987
---------------------- Constants for registers: ----------------------
987
---------------------- Constants for registers: ----------------------
988
  eax - SF_SYSTEM (18)
988
  eax - SF_SYSTEM (18)
989
  ebx - SSF_CURSOR_CENTER (15)
989
  ebx - SSF_CURSOR_CENTER (15)
990
======================================================================
990
======================================================================
991
========= Function 18, subfunction 16 - get size of free RAM. ========
991
========= Function 18, subfunction 16 - get size of free RAM. ========
992
======================================================================
992
======================================================================
993
Parameters:
993
Parameters:
994
  * eax = 18 - function number
994
  * eax = 18 - function number
995
  * ebx = 16 - subfunction number
995
  * ebx = 16 - subfunction number
996
Returned value:
996
Returned value:
997
  * eax = size of free memory in kilobytes
997
  * eax = size of free memory in kilobytes
998
 
998
 
999
---------------------- Constants for registers: ----------------------
999
---------------------- Constants for registers: ----------------------
1000
  eax - SF_SYSTEM (18)
1000
  eax - SF_SYSTEM (18)
1001
  ebx - SSF_GET_FREE_RAM (16)
1001
  ebx - SSF_GET_FREE_RAM (16)
1002
======================================================================
1002
======================================================================
1003
======== Function 18, subfunction 17 - get full amount of RAM. =======
1003
======== Function 18, subfunction 17 - get full amount of RAM. =======
1004
======================================================================
1004
======================================================================
1005
Parameters:
1005
Parameters:
1006
  * eax = 18 - function number
1006
  * eax = 18 - function number
1007
  * ebx = 17 - subfunction number
1007
  * ebx = 17 - subfunction number
1008
Returned value:
1008
Returned value:
1009
  * eax = total size of existing memory in kilobytes
1009
  * eax = total size of existing memory in kilobytes
1010
 
1010
 
1011
---------------------- Constants for registers: ----------------------
1011
---------------------- Constants for registers: ----------------------
1012
  eax - SF_SYSTEM (18)
1012
  eax - SF_SYSTEM (18)
1013
  ebx - SSF_GET_TOTAL_RAM (17)
1013
  ebx - SSF_GET_TOTAL_RAM (17)
1014
======================================================================
1014
======================================================================
1015
===================== Function 18, subfunction 18 ====================
1015
===================== Function 18, subfunction 18 ====================
1016
============= Terminate process/thread by the identifier. ============
1016
============= Terminate process/thread by the identifier. ============
1017
======================================================================
1017
======================================================================
1018
Parameters:
1018
Parameters:
1019
  * eax = 18 - function number
1019
  * eax = 18 - function number
1020
  * ebx = 18 - subfunction number
1020
  * ebx = 18 - subfunction number
1021
  * ecx = identifer of process/thread (PID/TID)
1021
  * ecx = identifer of process/thread (PID/TID)
1022
Returned value:
1022
Returned value:
1023
  * eax = 0 - success
1023
  * eax = 0 - success
1024
  * eax = -1 - error (process is not found or is system)
1024
  * eax = -1 - error (process is not found or is system)
1025
Remarks:
1025
Remarks:
1026
  * It is impossible to terminate system thread OS/IDLE (identifier
1026
  * It is impossible to terminate system thread OS/IDLE (identifier
1027
    1), it is possible to terminate any normal process/thread.
1027
    1), it is possible to terminate any normal process/thread.
1028
  * See also subfunction 2 - terminate
1028
  * See also subfunction 2 - terminate
1029
    process/thread by given slot.
1029
    process/thread by given slot.
1030
 
1030
 
1031
---------------------- Constants for registers: ----------------------
1031
---------------------- Constants for registers: ----------------------
1032
  eax - SF_SYSTEM (18)
1032
  eax - SF_SYSTEM (18)
1033
  ebx - SSF_TERMINATE_THREAD_ID (18)
1033
  ebx - SSF_TERMINATE_THREAD_ID (18)
1034
======================================================================
1034
======================================================================
1035
======== Function 18, subfunction 19 - get/set mouse features. =======
1035
======== Function 18, subfunction 19 - get/set mouse features. =======
1036
======================================================================
1036
======================================================================
1037
 
1037
 
1038
---------------- Subsubfunction 0 - get mouse speed. -----------------
1038
---------------- Subsubfunction 0 - get mouse speed. -----------------
1039
Parameters:
1039
Parameters:
1040
  * eax = 18 - function number
1040
  * eax = 18 - function number
1041
  * ebx = 19 - subfunction number
1041
  * ebx = 19 - subfunction number
1042
  * ecx = 0 - subsubfunction number
1042
  * ecx = 0 - subsubfunction number
1043
Returned value:
1043
Returned value:
1044
  * eax = current mouse speed
1044
  * eax = current speed divider
1045
 
1045
 
1046
---------------- Subsubfunction 1 - set mouse speed. -----------------
1046
---------------- Subsubfunction 1 - set mouse speed. -----------------
1047
Parameters:
1047
Parameters:
1048
  * eax = 18 - function number
1048
  * eax = 18 - function number
1049
  * ebx = 19 - subfunction number
1049
  * ebx = 19 - subfunction number
1050
  * ecx = 1 - subsubfunction number
1050
  * ecx = 1 - subsubfunction number
1051
  * edx = new value for speed
1051
  * edx = new value for speed divider
1052
Returned value:
1052
Returned value:
1053
  * function does not return value
1053
  * function does not return value
1054
 
1054
 
1055
Remark: recommended speed = 1, 0 = lock the cursor.
1055
Remark: recommended speed divider = 4
1056
 
1056
 
1057
------------- Subsubfunction 2 - get mouse acceleration. -------------
1057
-------------- Subsubfunction 2 - get mouse sensitivity --------------
1058
Parameters:
1058
Parameters:
1059
  * eax = 18 - function number
1059
  * eax = 18 - function number
1060
  * ebx = 19 - subfunction number
1060
  * ebx = 19 - subfunction number
1061
  * ecx = 2 - subsubfunction number
1061
  * ecx = 2 - subsubfunction number
1062
Returned value:
1062
Returned value:
1063
  * eax = 0 - off, 1 - slight, 2 - medium, 3 - intense
1063
  * eax = current sensitivity
1064
 
1064
 
1065
------------- Subsubfunction 3 - set mouse acceleration. -------------
1065
-------------- Subsubfunction 3 - set mouse sensitivity --------------
1066
Parameters:
1066
Parameters:
1067
  * eax = 18 - function number
1067
  * eax = 18 - function number
1068
  * ebx = 19 - subfunction number
1068
  * ebx = 19 - subfunction number
1069
  * ecx = 3 - subsubfunction number
1069
  * ecx = 3 - subsubfunction number
1070
  * edx = 0 - off, 1 - slight, 2 - medium, 3 - intense
1070
  * edx = new value for sensitivity
1071
Returned value:
1071
Returned value:
1072
  * function does not return value
1072
  * function does not return value
-
 
1073
 
-
 
1074
Remark: recommended sensitivity = 3
1073
 
1075
 
1074
----------- Subsubfunction 4 - set mouse pointer position. -----------
1076
----------- Subsubfunction 4 - set mouse pointer position. -----------
1075
Parameters:
1077
Parameters:
1076
  * eax = 18 - function number
1078
  * eax = 18 - function number
1077
  * ebx = 19 - subfunction number
1079
  * ebx = 19 - subfunction number
1078
  * ecx = 4 - subsubfunction number
1080
  * ecx = 4 - subsubfunction number
1079
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1081
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1080
Returned value:
1082
Returned value:
1081
  * function does not return value
1083
  * function does not return value
1082
 
1084
 
1083
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
1085
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
1084
Parameters:
1086
Parameters:
1085
  * eax = 18 - function number
1087
  * eax = 18 - function number
1086
  * ebx = 19 - subfunction number
1088
  * ebx = 19 - subfunction number
1087
  * ecx = 5 - subsubfunction number
1089
  * ecx = 5 - subsubfunction number
1088
  * edx = information about emulated state of mouse buttons:
1090
  * edx = information about emulated state of mouse buttons:
1089
    (same as return value in subfunction 2 of function 37)
1091
    (same as return value in subfunction 2 of function 37)
1090
    * bit 0 is set = left button is pressed
1092
    * bit 0 is set = left button is pressed
1091
    * bit 1 is set = right button is pressed
1093
    * bit 1 is set = right button is pressed
1092
    * bit 2 is set = middle button is pressed
1094
    * bit 2 is set = middle button is pressed
1093
    * bit 3 is set = 4th button is pressed
1095
    * bit 3 is set = 4th button is pressed
1094
    * bit 4 is set = 5th button is pressed
1096
    * bit 4 is set = 5th button is pressed
1095
Returned value:
1097
Returned value:
1096
  * function does not return value
1098
  * function does not return value
1097
 
1099
 
1098
-------------- Subsubfunction 6 - get doubleclick delay. -------------
1100
-------------- Subsubfunction 6 - get doubleclick delay. -------------
1099
Parameters:
1101
Parameters:
1100
  * eax = 18 - function number
1102
  * eax = 18 - function number
1101
  * ebx = 19 - subfunction number
1103
  * ebx = 19 - subfunction number
1102
  * ecx = 6 - subsubfunction number
1104
  * ecx = 6 - subsubfunction number
1103
Returned value:
1105
Returned value:
1104
  * eax = current doubleclick delay (100 = 1 second)
1106
  * eax = current doubleclick delay (100 = 1 second)
1105
 
1107
 
1106
-------------- Subsubfunction 7 - set doubleclick delay. -------------
1108
-------------- Subsubfunction 7 - set doubleclick delay. -------------
1107
Parameters:
1109
Parameters:
1108
  * eax = 18 - function number
1110
  * eax = 18 - function number
1109
  * ebx = 19 - subfunction number
1111
  * ebx = 19 - subfunction number
1110
  * ecx = 7 - subsubfunction number
1112
  * ecx = 7 - subsubfunction number
1111
  * dl  = new value for doubleclick delay (100 = 1 second)
1113
  * dl  = new value for doubleclick delay (100 = 1 second)
1112
Returned value:
1114
Returned value:
1113
  * function does not return value
1115
  * function does not return value
1114
 
1116
 
1115
Remark: mouse settings can be modified in the application mouse_cfg.
1117
Remark: mouse settings can be modified in the application mouse_cfg.
1116
 
1118
 
1117
---------------------- Constants for registers: ----------------------
1119
---------------------- Constants for registers: ----------------------
1118
  eax - SF_SYSTEM (18)
1120
  eax - SF_SYSTEM (18)
1119
  ebx - SSF_MOUSE_SETTINGS (19)
1121
  ebx - SSF_MOUSE_SETTINGS (19)
1120
  ecx - SSSF_GET_SPEED (0), SSSF_SET_SPEED (1), SSSF_GET_SPEEDUP (2),
1122
  ecx - SSSF_GET_SPEED (0), SSSF_SET_SPEED (1), SSSF_GET_SPEEDUP (2),
1121
    SSSF_SET_SPEEDUP (3), SSSF_SET_POS (4), SSSF_SET_BUTTON (5),
1123
    SSSF_SET_SPEEDUP (3), SSSF_SET_POS (4), SSSF_SET_BUTTON (5),
1122
    SSSF_GET_DOUBLE_CLICK_DELAY (6), SSSF_SET_DOUBLE_CLICK_DELAY (7)
1124
    SSSF_GET_DOUBLE_CLICK_DELAY (6), SSSF_SET_DOUBLE_CLICK_DELAY (7)
1123
======================================================================
1125
======================================================================
1124
======== Function 18, subfunction 20 - get information on RAM. =======
1126
======== Function 18, subfunction 20 - get information on RAM. =======
1125
======================================================================
1127
======================================================================
1126
Parameters:
1128
Parameters:
1127
  * eax = 18 - function number
1129
  * eax = 18 - function number
1128
  * ebx = 20 - subfunction number
1130
  * ebx = 20 - subfunction number
1129
  * ecx = pointer to the buffer for information (36 bytes)
1131
  * ecx = pointer to the buffer for information (36 bytes)
1130
Returned value:
1132
Returned value:
1131
  * eax = total size of existing RAM in pages
1133
  * eax = total size of existing RAM in pages
1132
    or -1 if error has occured
1134
    or -1 if error has occured
1133
  * buffer pointed to by ecx contains the following information:
1135
  * buffer pointed to by ecx contains the following information:
1134
    * +0:  dword: total size of existing RAM in pages
1136
    * +0:  dword: total size of existing RAM in pages
1135
    * +4:  dword: size of free RAM in pages
1137
    * +4:  dword: size of free RAM in pages
1136
    * +8:  dword: number of page faults (exceptions #PF)
1138
    * +8:  dword: number of page faults (exceptions #PF)
1137
                 in applications
1139
                 in applications
1138
    * +12: dword: size of kernel heap in bytes
1140
    * +12: dword: size of kernel heap in bytes
1139
    * +16: dword: free in kernel heap in bytes
1141
    * +16: dword: free in kernel heap in bytes
1140
    * +20: dword: total number of memory blocks in kernel heap
1142
    * +20: dword: total number of memory blocks in kernel heap
1141
    * +24: dword: number of free memory blocks in kernel heap
1143
    * +24: dword: number of free memory blocks in kernel heap
1142
    * +28: dword: size of maximum free block in kernel heap
1144
    * +28: dword: size of maximum free block in kernel heap
1143
                 (reserved)
1145
                 (reserved)
1144
    * +32: dword: size of maximum allocated block in kernel heap
1146
    * +32: dword: size of maximum allocated block in kernel heap
1145
                 (reserved)
1147
                 (reserved)
1146
 
1148
 
1147
---------------------- Constants for registers: ----------------------
1149
---------------------- Constants for registers: ----------------------
1148
  eax - SF_SYSTEM (18)
1150
  eax - SF_SYSTEM (18)
1149
  ebx - SSF_GET_RAM_INFO (20)
1151
  ebx - SSF_GET_RAM_INFO (20)
1150
======================================================================
1152
======================================================================
1151
===================== Function 18, subfunction 21 ====================
1153
===================== Function 18, subfunction 21 ====================
1152
======== Get slot number of process/thread by the identifier. ========
1154
======== Get slot number of process/thread by the identifier. ========
1153
======================================================================
1155
======================================================================
1154
Parameters:
1156
Parameters:
1155
  * eax = 18 - function number
1157
  * eax = 18 - function number
1156
  * ebx = 21 - subfunction number
1158
  * ebx = 21 - subfunction number
1157
  * ecx = identifer of process/thread (PID/TID)
1159
  * ecx = identifer of process/thread (PID/TID)
1158
Returned value:
1160
Returned value:
1159
  * eax = 0 - error (invalid identifier)
1161
  * eax = 0 - error (invalid identifier)
1160
  * otherwise eax = slot number
1162
  * otherwise eax = slot number
1161
 
1163
 
1162
---------------------- Constants for registers: ----------------------
1164
---------------------- Constants for registers: ----------------------
1163
  eax - SF_SYSTEM (18)
1165
  eax - SF_SYSTEM (18)
1164
  ebx - SSF_GET_THREAD_SLOT (21)
1166
  ebx - SSF_GET_THREAD_SLOT (21)
1165
======================================================================
1167
======================================================================
1166
===================== Function 18, subfunction 22 ====================
1168
===================== Function 18, subfunction 22 ====================
1167
============== Operations with window of another thread. =============
1169
============== Operations with window of another thread. =============
1168
======================================================================
1170
======================================================================
1169
Parameters:
1171
Parameters:
1170
  * eax = 18 - function number
1172
  * eax = 18 - function number
1171
  * ebx = 22 - subfunction number
1173
  * ebx = 22 - subfunction number
1172
  * ecx = operation type:
1174
  * ecx = operation type:
1173
    * 0 = minimize window of the thread with given slot number
1175
    * 0 = minimize window of the thread with given slot number
1174
    * 1 = minimize window of the thread with given identifier
1176
    * 1 = minimize window of the thread with given identifier
1175
    * 2 = restore window of the thread with given slot number
1177
    * 2 = restore window of the thread with given slot number
1176
    * 3 = restore window of the thread with given identifier
1178
    * 3 = restore window of the thread with given identifier
1177
  * edx = parameter (slot number or PID/TID)
1179
  * edx = parameter (slot number or PID/TID)
1178
Returned value:
1180
Returned value:
1179
  * eax = 0 - success
1181
  * eax = 0 - success
1180
  * eax = -1 - error (invalid identifier)
1182
  * eax = -1 - error (invalid identifier)
1181
Remarks:
1183
Remarks:
1182
  * The thread can minimize its window with subfunction 10.
1184
  * The thread can minimize its window with subfunction 10.
1183
  * One can restore and activate window simultaneously with
1185
  * One can restore and activate window simultaneously with
1184
    subfunction 3 (which requires slot number).
1186
    subfunction 3 (which requires slot number).
1185
 
1187
 
1186
---------------------- Constants for registers: ----------------------
1188
---------------------- Constants for registers: ----------------------
1187
  eax - SF_SYSTEM (18)
1189
  eax - SF_SYSTEM (18)
1188
  ebx - SSF_FOREIGN_WINDOW (22)
1190
  ebx - SSF_FOREIGN_WINDOW (22)
1189
  ecx - SSSF_MINIMIZE (0), SSSF_MINIMIZE_ID (1), SSSF_RESTORE (2),
1191
  ecx - SSSF_MINIMIZE (0), SSSF_MINIMIZE_ID (1), SSSF_RESTORE (2),
1190
    SSSF_RESTORE_ID (3)
1192
    SSSF_RESTORE_ID (3)
1191
======================================================================
1193
======================================================================
1192
======== Function 18, subfunction 23 - minimize all windows. ==========
1194
======== Function 18, subfunction 23 - minimize all windows. ==========
1193
======================================================================
1195
======================================================================
1194
Parameters:
1196
Parameters:
1195
  * eax = 18 - function number
1197
  * eax = 18 - function number
1196
  * ebx = 23 - subfunction number
1198
  * ebx = 23 - subfunction number
1197
Returned value:
1199
Returned value:
1198
  * eax = 0 - all windows have been minimized before a function call
1200
  * eax = 0 - all windows have been minimized before a function call
1199
  * eax = N - number of windows minimized from function
1201
  * eax = N - number of windows minimized from function
1200
Remarks:
1202
Remarks:
1201
  * Window of special thread (name begin to symbol @) is not minimize.
1203
  * Window of special thread (name begin to symbol @) is not minimize.
1202
 
1204
 
1203
---------------------- Constants for registers: ----------------------
1205
---------------------- Constants for registers: ----------------------
1204
  eax - SF_SYSTEM (18)
1206
  eax - SF_SYSTEM (18)
1205
  ebx - SSF_MINIMIZE_ALL (23)
1207
  ebx - SSF_MINIMIZE_ALL (23)
1206
======================================================================
1208
======================================================================
1207
======= Function 18, subfunction 24 - set limits of screen. ==========
1209
======= Function 18, subfunction 24 - set limits of screen. ==========
1208
======================================================================
1210
======================================================================
1209
Parameters:
1211
Parameters:
1210
  * eax = 18 - function number
1212
  * eax = 18 - function number
1211
  * ebx = 24 - subfunction number
1213
  * ebx = 24 - subfunction number
1212
  * ecx = new X size
1214
  * ecx = new X size
1213
  * edx = new Y size
1215
  * edx = new Y size
1214
Returned value:
1216
Returned value:
1215
  * function does not return value
1217
  * function does not return value
1216
Remarks:
1218
Remarks:
1217
  * The function does not change the physical size of the video mode.
1219
  * The function does not change the physical size of the video mode.
1218
    It is designed for non-standard displays which display the image
1220
    It is designed for non-standard displays which display the image
1219
    partially.
1221
    partially.
1220
  * The sizes specified in the function should not exceed the sizes
1222
  * The sizes specified in the function should not exceed the sizes
1221
    of the current video mode, otherwise the function will not change
1223
    of the current video mode, otherwise the function will not change
1222
    anything.
1224
    anything.
1223
 
1225
 
1224
---------------------- Constants for registers: ----------------------
1226
---------------------- Constants for registers: ----------------------
1225
  eax - SF_SYSTEM (18)
1227
  eax - SF_SYSTEM (18)
1226
  ebx - SSF_SET_SCREEN_LIMITS (24)
1228
  ebx - SSF_SET_SCREEN_LIMITS (24)
1227
======================================================================
1229
======================================================================
1228
===================== Function 18, subfunction 25 ====================
1230
===================== Function 18, subfunction 25 ====================
1229
===== Control position of the window relative to other windows. ======
1231
===== Control position of the window relative to other windows. ======
1230
======================================================================
1232
======================================================================
1231
 
1233
 
1232
------------- Subsubfunction 1 - get position  -----------------------
1234
------------- Subsubfunction 1 - get position  -----------------------
1233
Parameters:
1235
Parameters:
1234
  * eax = 18 - function number
1236
  * eax = 18 - function number
1235
  * ebx = 25 - subfunction number
1237
  * ebx = 25 - subfunction number
1236
  * ecx = 1 - subsubfunction number
1238
  * ecx = 1 - subsubfunction number
1237
  * edx = -1(for current window) or PID application
1239
  * edx = -1(for current window) or PID application
1238
Returned value:
1240
Returned value:
1239
  * eax = one of the constants window position
1241
  * eax = one of the constants window position
1240
 
1242
 
1241
------------- Subsubfunction 2 - set position  -----------------------
1243
------------- Subsubfunction 2 - set position  -----------------------
1242
Parameters:
1244
Parameters:
1243
  * eax = 18 - function number
1245
  * eax = 18 - function number
1244
  * ebx = 25 - subfunction number
1246
  * ebx = 25 - subfunction number
1245
  * ecx = 2 - subsubfunction number
1247
  * ecx = 2 - subsubfunction number
1246
  * edx = -1(for current window) or PID application
1248
  * edx = -1(for current window) or PID application
1247
  * esi = new window position (one of the constants below)
1249
  * esi = new window position (one of the constants below)
1248
Returned value:
1250
Returned value:
1249
  * eax = 0 - error
1251
  * eax = 0 - error
1250
  * eax = 1 - success
1252
  * eax = 1 - success
1251
 
1253
 
1252
Constant position of the window relative to other windows:
1254
Constant position of the window relative to other windows:
1253
 ZPOS_DESKTOP     = -2 - on the background
1255
 ZPOS_DESKTOP     = -2 - on the background
1254
 ZPOS_ALWAYS_BACK = -1 - behind all the windows
1256
 ZPOS_ALWAYS_BACK = -1 - behind all the windows
1255
 ZPOS_NORMAL      = 0  - normal
1257
 ZPOS_NORMAL      = 0  - normal
1256
 ZPOS_ALWAYS_TOP  = 1  - on top of all windows
1258
 ZPOS_ALWAYS_TOP  = 1  - on top of all windows
1257
 
1259
 
1258
---------------------- Constants for registers: ----------------------
1260
---------------------- Constants for registers: ----------------------
1259
  eax - SF_SYSTEM (18)
1261
  eax - SF_SYSTEM (18)
1260
  ebx - SSF_WINDOW_BEHAVIOR (25)
1262
  ebx - SSF_WINDOW_BEHAVIOR (25)
1261
  ecx - SSSF_GET_WB (1), SSSF_SET_WB (2)
1263
  ecx - SSSF_GET_WB (1), SSSF_SET_WB (2)
1262
======================================================================
1264
======================================================================
1263
==================== Function 20 - MIDI interface. ===================
1265
==================== Function 20 - MIDI interface. ===================
1264
======================================================================
1266
======================================================================
1265
 
1267
 
1266
----------------------- Subfunction 1 - reset ------------------------
1268
----------------------- Subfunction 1 - reset ------------------------
1267
Parameters:
1269
Parameters:
1268
  * eax = 20 - function number
1270
  * eax = 20 - function number
1269
  * ebx = 1 - subfunction number
1271
  * ebx = 1 - subfunction number
1270
 
1272
 
1271
-------------------- Subfunction 2 - output byte ---------------------
1273
-------------------- Subfunction 2 - output byte ---------------------
1272
Parameters:
1274
Parameters:
1273
  * eax = 20 - function number
1275
  * eax = 20 - function number
1274
  * ebx = 2 - subfunction number
1276
  * ebx = 2 - subfunction number
1275
  * cl = byte for output
1277
  * cl = byte for output
1276
Returned value (is the same for both subfunctions):
1278
Returned value (is the same for both subfunctions):
1277
  * eax = 0 - success
1279
  * eax = 0 - success
1278
  * eax = 1 - base port is not defined
1280
  * eax = 1 - base port is not defined
1279
Remarks:
1281
Remarks:
1280
  * Previously the base port must be defined by
1282
  * Previously the base port must be defined by
1281
    subfunction 1 of function 21.
1283
    subfunction 1 of function 21.
1282
 
1284
 
1283
---------------------- Constants for registers: ----------------------
1285
---------------------- Constants for registers: ----------------------
1284
  eax - SF_MIDI (20)
1286
  eax - SF_MIDI (20)
1285
  ebx - SSF_RESET (1), SSF_OUTPUT (2)
1287
  ebx - SSF_RESET (1), SSF_OUTPUT (2)
1286
======================================================================
1288
======================================================================
1287
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1289
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
1288
======================================================================
1290
======================================================================
1289
Parameters:
1291
Parameters:
1290
  * eax = 21 - function number
1292
  * eax = 21 - function number
1291
  * ebx = 1 - subfunction number
1293
  * ebx = 1 - subfunction number
1292
  * ecx = number of base port
1294
  * ecx = number of base port
1293
Returned value
1295
Returned value
1294
  * eax = 0 - success
1296
  * eax = 0 - success
1295
  * eax = -1 - erratic number of a port
1297
  * eax = -1 - erratic number of a port
1296
Remarks:
1298
Remarks:
1297
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1299
  * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
1298
  * The installation of base is necessary for function 20.
1300
  * The installation of base is necessary for function 20.
1299
  * To get base port use subfunction 1 of function 26.
1301
  * To get base port use subfunction 1 of function 26.
1300
 
1302
 
1301
---------------------- Constants for registers: ----------------------
1303
---------------------- Constants for registers: ----------------------
1302
  eax - SF_SYSTEM_SET (21)
1304
  eax - SF_SYSTEM_SET (21)
1303
  ebx - SSF_MPU_MIDI_BASE (1)
1305
  ebx - SSF_MPU_MIDI_BASE (1)
1304
======================================================================
1306
======================================================================
1305
========== Function 21, subfunction 2 - set keyboard layout. =========
1307
========== Function 21, subfunction 2 - set keyboard layout. =========
1306
======================================================================
1308
======================================================================
1307
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1309
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
1308
which will be read by function 2.
1310
which will be read by function 2.
1309
Parameters:
1311
Parameters:
1310
  * eax = 21 - function number
1312
  * eax = 21 - function number
1311
  * ebx = 2 - subfunction number
1313
  * ebx = 2 - subfunction number
1312
  * ecx = which layout to set:
1314
  * ecx = which layout to set:
1313
    * 1 = normal layout
1315
    * 1 = normal layout
1314
    * 2 = layout at pressed Shift
1316
    * 2 = layout at pressed Shift
1315
    * 3 = layout at pressed Alt
1317
    * 3 = layout at pressed Alt
1316
  * edx = pointer to layout - table of length 128 bytes
1318
  * edx = pointer to layout - table of length 128 bytes
1317
Or:
1319
Or:
1318
  * ecx = 9
1320
  * ecx = 9
1319
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1321
  * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1320
Returned value:
1322
Returned value:
1321
  * eax = 0 - success
1323
  * eax = 0 - success
1322
  * eax = 1 - incorrect parameter
1324
  * eax = 1 - incorrect parameter
1323
Remarks:
1325
Remarks:
1324
  * If Alt is pressed, the layout with Alt is used;
1326
  * If Alt is pressed, the layout with Alt is used;
1325
    if Alt is not pressed, but Shift is pressed,
1327
    if Alt is not pressed, but Shift is pressed,
1326
    the layout with Shift is used;
1328
    the layout with Shift is used;
1327
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1329
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1328
    layout is used and then from the code is subtracted 0x60;
1330
    layout is used and then from the code is subtracted 0x60;
1329
    if no control key is pressed, the normal layout is used.
1331
    if no control key is pressed, the normal layout is used.
1330
  * To get layout and country identifier use
1332
  * To get layout and country identifier use
1331
    subfunction 2 of function 26.
1333
    subfunction 2 of function 26.
1332
  * Country identifier is global system variable, which is not used
1334
  * Country identifier is global system variable, which is not used
1333
    by the kernel itself; however the application '@taskbar' displays
1335
    by the kernel itself; however the application '@taskbar' displays
1334
    the corresponding icon.
1336
    the corresponding icon.
1335
  * The application @taskbar switches layouts on user request.
1337
  * The application @taskbar switches layouts on user request.
1336
 
1338
 
1337
---------------------- Constants for registers: ----------------------
1339
---------------------- Constants for registers: ----------------------
1338
  eax - SF_SYSTEM_SET (21)
1340
  eax - SF_SYSTEM_SET (21)
1339
  ebx - SSF_KEYBOARD_LAYOUT (2)
1341
  ebx - SSF_KEYBOARD_LAYOUT (2)
1340
======================================================================
1342
======================================================================
1341
========== Function 21, subfunction 5 - set system language. =========
1343
========== Function 21, subfunction 5 - set system language. =========
1342
======================================================================
1344
======================================================================
1343
Parameters:
1345
Parameters:
1344
  * eax = 21 - function number
1346
  * eax = 21 - function number
1345
  * ebx = 5 - subfunction number
1347
  * ebx = 5 - subfunction number
1346
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1348
  * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
1347
Returned value:
1349
Returned value:
1348
  * eax = 0
1350
  * eax = 0
1349
Remarks:
1351
Remarks:
1350
  * System language is global system variable and is not used
1352
  * System language is global system variable and is not used
1351
    by the kernel itself, however application @taskbar draws the
1353
    by the kernel itself, however application @taskbar draws the
1352
    appropriate icon.
1354
    appropriate icon.
1353
  * Function does not check for correctness, as the kernel does not
1355
  * Function does not check for correctness, as the kernel does not
1354
    use this variable.
1356
    use this variable.
1355
  * To get system language use subfunction 5 of function 26.
1357
  * To get system language use subfunction 5 of function 26.
1356
 
1358
 
1357
---------------------- Constants for registers: ----------------------
1359
---------------------- Constants for registers: ----------------------
1358
  eax - SF_SYSTEM_SET (21)
1360
  eax - SF_SYSTEM_SET (21)
1359
  ebx - SSF_SYS_LANG (5)
1361
  ebx - SSF_SYS_LANG (5)
1360
======================================================================
1362
======================================================================
1361
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1363
 Function 21, subfunction 11 - enable/disable low-level access to HD.
1362
======================================================================
1364
======================================================================
1363
Parameters:
1365
Parameters:
1364
  * eax = 21 - function number
1366
  * eax = 21 - function number
1365
  * ebx = 11 - subfunction number
1367
  * ebx = 11 - subfunction number
1366
  * ecx = 0/1 - disable/enable
1368
  * ecx = 0/1 - disable/enable
1367
Returned value:
1369
Returned value:
1368
  * eax = 0
1370
  * eax = 0
1369
Remarks:
1371
Remarks:
1370
  * Is used in LBA-read (subfunction 8 of function 58).
1372
  * Is used in LBA-read (subfunction 8 of function 58).
1371
  * The current implementation uses only low bit of ecx.
1373
  * The current implementation uses only low bit of ecx.
1372
  * To get current status use subfunction 11 of function 26.
1374
  * To get current status use subfunction 11 of function 26.
1373
 
1375
 
1374
---------------------- Constants for registers: ----------------------
1376
---------------------- Constants for registers: ----------------------
1375
  eax - SF_SYSTEM_SET (21)
1377
  eax - SF_SYSTEM_SET (21)
1376
  ebx - SSF_ACCESS_HD_LBA (11)
1378
  ebx - SSF_ACCESS_HD_LBA (11)
1377
======================================================================
1379
======================================================================
1378
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1380
 Function 21, subfunction 12 - enable/disable low-level access to PCI.
1379
======================================================================
1381
======================================================================
1380
Parameters:
1382
Parameters:
1381
  * eax = 21 - function number
1383
  * eax = 21 - function number
1382
  * ebx = 12 - subfunction number
1384
  * ebx = 12 - subfunction number
1383
  * ecx = 0/1 - disable/enable
1385
  * ecx = 0/1 - disable/enable
1384
Returned value:
1386
Returned value:
1385
  * eax = 0
1387
  * eax = 0
1386
Remarks:
1388
Remarks:
1387
  * Is used in operations with PCI bus (function 62).
1389
  * Is used in operations with PCI bus (function 62).
1388
  * The current implementation uses only low bit of ecx.
1390
  * The current implementation uses only low bit of ecx.
1389
  * To get current status use subfunction 12 of function 26.
1391
  * To get current status use subfunction 12 of function 26.
1390
 
1392
 
1391
---------------------- Constants for registers: ----------------------
1393
---------------------- Constants for registers: ----------------------
1392
  eax - SF_SYSTEM_SET (21)
1394
  eax - SF_SYSTEM_SET (21)
1393
  ebx - SSF_ACCESS_PCI (12)
1395
  ebx - SSF_ACCESS_PCI (12)
1394
======================================================================
1396
======================================================================
1395
================= Function 22 - set system date/time. ================
1397
================= Function 22 - set system date/time. ================
1396
======================================================================
1398
======================================================================
1397
Parameters:
1399
Parameters:
1398
  * eax = 22 - function number
1400
  * eax = 22 - function number
1399
  * ebx = 0 - set time
1401
  * ebx = 0 - set time
1400
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1402
    * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
1401
    * HH=hour 00..23
1403
    * HH=hour 00..23
1402
    * MM=minute 00..59
1404
    * MM=minute 00..59
1403
    * SS=second 00..59
1405
    * SS=second 00..59
1404
  * ebx = 1 - set date
1406
  * ebx = 1 - set date
1405
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1407
    * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
1406
    * DD=day 01..31
1408
    * DD=day 01..31
1407
    * MM=month 01..12
1409
    * MM=month 01..12
1408
    * YY=year 00..99
1410
    * YY=year 00..99
1409
  * ebx = 2 - set day of week
1411
  * ebx = 2 - set day of week
1410
    * ecx = 1 for Sunday, ..., 7 for Saturday
1412
    * ecx = 1 for Sunday, ..., 7 for Saturday
1411
  * ebx = 3 - set alarm clock
1413
  * ebx = 3 - set alarm clock
1412
    * ecx = 0x00SSMMHH
1414
    * ecx = 0x00SSMMHH
1413
Returned value:
1415
Returned value:
1414
  * eax = 0 - success
1416
  * eax = 0 - success
1415
  * eax = 1 - incorrect parameter
1417
  * eax = 1 - incorrect parameter
1416
  * eax = 2 - CMOS-battery was unloaded
1418
  * eax = 2 - CMOS-battery was unloaded
1417
Remarks:
1419
Remarks:
1418
  * Value of installation of day of week seems to be doubtful,
1420
  * Value of installation of day of week seems to be doubtful,
1419
    as it a little where is used
1421
    as it a little where is used
1420
    (day of week can be calculated by date).
1422
    (day of week can be calculated by date).
1421
  * Alarm clock can be set on operation in the given time every day.
1423
  * Alarm clock can be set on operation in the given time every day.
1422
    But there is no existing system function to disable it.
1424
    But there is no existing system function to disable it.
1423
  * Operation of alarm clock consists in generation IRQ8.
1425
  * Operation of alarm clock consists in generation IRQ8.
1424
  * Generally CMOS supports for alarm clock set of value 0xFF
1426
  * Generally CMOS supports for alarm clock set of value 0xFF
1425
    as one of parameters and it means that the appropriate parameter
1427
    as one of parameters and it means that the appropriate parameter
1426
    is ignored. But current implementation does not allow this
1428
    is ignored. But current implementation does not allow this
1427
    (will return 1).
1429
    (will return 1).
1428
  * Alarm clock is a global system resource; the set of
1430
  * Alarm clock is a global system resource; the set of
1429
    an alarm clock cancels automatically the previous set.
1431
    an alarm clock cancels automatically the previous set.
1430
    However, at moment no program uses it.
1432
    However, at moment no program uses it.
1431
 
1433
 
1432
---------------------- Constants for registers: ----------------------
1434
---------------------- Constants for registers: ----------------------
1433
  eax - SF_SET_TIME_DATE (22)
1435
  eax - SF_SET_TIME_DATE (22)
1434
======================================================================
1436
======================================================================
1435
============= Function 23 - wait for event with timeout. =============
1437
============= Function 23 - wait for event with timeout. =============
1436
======================================================================
1438
======================================================================
1437
If the message queue is empty, waits for new message in the queue,
1439
If the message queue is empty, waits for new message in the queue,
1438
but no more than given time. Then reads out a message from the queue.
1440
but no more than given time. Then reads out a message from the queue.
1439
 
1441
 
1440
Parameters:
1442
Parameters:
1441
  * eax = 23 - function number
1443
  * eax = 23 - function number
1442
  * ebx = timeout (in 1/100 of second)
1444
  * ebx = timeout (in 1/100 of second)
1443
Returned value:
1445
Returned value:
1444
  * eax = 0 - the message queue is empty
1446
  * eax = 0 - the message queue is empty
1445
  * otherwise eax = event (see the list of events)
1447
  * otherwise eax = event (see the list of events)
1446
Remarks:
1448
Remarks:
1447
  * Only those events are taken into account, which enter into
1449
  * Only those events are taken into account, which enter into
1448
    the mask set by function 40. By default it is
1450
    the mask set by function 40. By default it is
1449
    redraw, key and button events.
1451
    redraw, key and button events.
1450
  * To check for presence of a message in the queue use function 11.
1452
  * To check for presence of a message in the queue use function 11.
1451
    To wait without timeout use function 10.
1453
    To wait without timeout use function 10.
1452
  * Transmission ebx=0 results in immediate returning eax=0.
1454
  * Transmission ebx=0 results in immediate returning eax=0.
1453
  * Current implementation returns immediately with eax=0,
1455
  * Current implementation returns immediately with eax=0,
1454
    if the addition of ebx with the current value of time counter
1456
    if the addition of ebx with the current value of time counter
1455
    makes 32-bit overflow.
1457
    makes 32-bit overflow.
1456
 
1458
 
1457
---------------------- Constants for registers: ----------------------
1459
---------------------- Constants for registers: ----------------------
1458
  eax - SF_WAIT_EVENT_TIMEOUT (23)
1460
  eax - SF_WAIT_EVENT_TIMEOUT (23)
1459
======================================================================
1461
======================================================================
1460
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1462
======= Function 24, subfunction 4 - eject tray of disk drive. =======
1461
======================================================================
1463
======================================================================
1462
Parameters:
1464
Parameters:
1463
  * eax = 24 - function number
1465
  * eax = 24 - function number
1464
  * ebx = 4 - subfunction number
1466
  * ebx = 4 - subfunction number
1465
  * ecx = position of CD/DVD-drive
1467
  * ecx = position of CD/DVD-drive
1466
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1468
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1467
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1469
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1468
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1470
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1469
Returned value:
1471
Returned value:
1470
  * function does not return value
1472
  * function does not return value
1471
Remarks:
1473
Remarks:
1472
  * The function is supported only for ATAPI devices (CD and DVD).
1474
  * The function is supported only for ATAPI devices (CD and DVD).
1473
  * When the tray is being ejected,
1475
  * When the tray is being ejected,
1474
    manual control of tray is unlocked.
1476
    manual control of tray is unlocked.
1475
  * When the tray is being ejected, the code clears the cache for
1477
  * When the tray is being ejected, the code clears the cache for
1476
    corresponding device.
1478
    corresponding device.
1477
  * 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.
1478
 
1480
 
1479
---------------------- Constants for registers: ----------------------
1481
---------------------- Constants for registers: ----------------------
1480
  eax - SF_CD (24)
1482
  eax - SF_CD (24)
1481
  ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
1483
  ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
1482
======================================================================
1484
======================================================================
1483
======== Function 24, subfunction 5 - load tray of disk drive. =======
1485
======== Function 24, subfunction 5 - load tray of disk drive. =======
1484
======================================================================
1486
======================================================================
1485
Parameters:
1487
Parameters:
1486
  * eax = 24 - function number
1488
  * eax = 24 - function number
1487
  * ebx = 5 - subfunction number
1489
  * ebx = 5 - subfunction number
1488
  * ecx = position of CD/DVD-drive
1490
  * ecx = position of CD/DVD-drive
1489
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1491
    from 0=Primary Master to 3=Secondary Slave for first IDE contr.
1490
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1492
    from 4=Primary Master to 7=Secondary Slave for second IDE contr.
1491
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1493
    from 8=Primary Master to 11=Secondary Slave for third IDE contr.
1492
Returned value:
1494
Returned value:
1493
  * function does not return value
1495
  * function does not return value
1494
Remarks:
1496
Remarks:
1495
  * The function is supported only for ATAPI devices (CD and DVD).
1497
  * The function is supported only for ATAPI devices (CD and DVD).
1496
  * An example of usage of the function is the application CD_tray.
1498
  * An example of usage of the function is the application CD_tray.
1497
 
1499
 
1498
---------------------- Constants for registers: ----------------------
1500
---------------------- Constants for registers: ----------------------
1499
  eax - SF_CD (24)
1501
  eax - SF_CD (24)
1500
  ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
1502
  ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
1501
======================================================================
1503
======================================================================
1502
======= Function 25 - put image area on the background layer. ========
1504
======= Function 25 - put image area on the background layer. ========
1503
======================================================================
1505
======================================================================
1504
Paramters:
1506
Paramters:
1505
  * eax = 25 - function number
1507
  * eax = 25 - function number
1506
  * ebx = pointer to the previously allocated memory area,
1508
  * ebx = pointer to the previously allocated memory area,
1507
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1509
        where placed the source images in a format BBGGRRTTBBGGRRTT...
1508
  * ecx = [size on axis x]*65536 + [size on axis y]
1510
  * ecx = [size on axis x]*65536 + [size on axis y]
1509
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1511
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1510
Returned value:
1512
Returned value:
1511
  * function does not return value
1513
  * function does not return value
1512
Remarks:
1514
Remarks:
1513
  * Coordinates of the image are coordinates of the upper left corner
1515
  * Coordinates of the image are coordinates of the upper left corner
1514
    of the image relative to the screen.
1516
    of the image relative to the screen.
1515
  * Size of the image in bytes is 4*xsize*ysize
1517
  * Size of the image in bytes is 4*xsize*ysize
1516
  * TT - byte pointer of transparency, at current version:
1518
  * TT - byte pointer of transparency, at current version:
1517
         1 to FF - opaque, 0 - transparent.
1519
         1 to FF - opaque, 0 - transparent.
1518
  * The function places the image directly to LFB. It is not for
1520
  * The function places the image directly to LFB. It is not for
1519
    background image f.15. Options f.15 to f.25 does not make sense.
1521
    background image f.15. Options f.15 to f.25 does not make sense.
1520
 
1522
 
1521
---------------------- Constants for registers: ----------------------
1523
---------------------- Constants for registers: ----------------------
1522
  eax - SF_SCREEN_PUT_IMAGE (25)
1524
  eax - SF_SCREEN_PUT_IMAGE (25)
1523
======================================================================
1525
======================================================================
1524
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1526
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
1525
======================================================================
1527
======================================================================
1526
Parameters:
1528
Parameters:
1527
  * eax = 26 - function number
1529
  * eax = 26 - function number
1528
  * ebx = 1 - subfunction number
1530
  * ebx = 1 - subfunction number
1529
Returned value:
1531
Returned value:
1530
  * eax = port number
1532
  * eax = port number
1531
Parameters:
1533
Parameters:
1532
  * To set base port use subfunction 1 of function 21.
1534
  * To set base port use subfunction 1 of function 21.
1533
 
1535
 
1534
---------------------- Constants for registers: ----------------------
1536
---------------------- Constants for registers: ----------------------
1535
  eax - SF_SYSTEM_GET (26)
1537
  eax - SF_SYSTEM_GET (26)
1536
  ebx - SSF_MPU_MIDI_BASE (1)
1538
  ebx - SSF_MPU_MIDI_BASE (1)
1537
======================================================================
1539
======================================================================
1538
========== Function 26, subfunction 2 - get keyboard layout. =========
1540
========== Function 26, subfunction 2 - get keyboard layout. =========
1539
======================================================================
1541
======================================================================
1540
The keyboard layout is used to convert keyboard scancodes to
1542
The keyboard layout is used to convert keyboard scancodes to
1541
ASCII-codes for function 2.
1543
ASCII-codes for function 2.
1542
Parameters:
1544
Parameters:
1543
  * eax = 26 - function number
1545
  * eax = 26 - function number
1544
  * ebx = 2 - subfunction number
1546
  * ebx = 2 - subfunction number
1545
  * ecx = what layout to get:
1547
  * ecx = what layout to get:
1546
    * 1 = normal layout
1548
    * 1 = normal layout
1547
    * 2 = layout with pressed Shift
1549
    * 2 = layout with pressed Shift
1548
    * 3 = layout with pressed Alt
1550
    * 3 = layout with pressed Alt
1549
  * edx = pointer to the 128-bytes buffer, where the layout will be
1551
  * edx = pointer to the 128-bytes buffer, where the layout will be
1550
    copied
1552
    copied
1551
Returned value:
1553
Returned value:
1552
  * function does not return value
1554
  * function does not return value
1553
Or:
1555
Or:
1554
  * eax = 26 - function number
1556
  * eax = 26 - function number
1555
  * ebx = 2 - subfunction number
1557
  * ebx = 2 - subfunction number
1556
  * ecx = 9
1558
  * ecx = 9
1557
Returned value:
1559
Returned value:
1558
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1560
  * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
1559
Remarks:
1561
Remarks:
1560
  * If Alt is pressed, the layout with Alt is used;
1562
  * If Alt is pressed, the layout with Alt is used;
1561
    if Alt is not pressed, but Shift is pressed,
1563
    if Alt is not pressed, but Shift is pressed,
1562
    the layout with Shift is used;
1564
    the layout with Shift is used;
1563
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1565
    if Alt and Shift are not pressed, but Ctrl is pressed, the normal
1564
    layout is used and then from the code is subtracted 0x60;
1566
    layout is used and then from the code is subtracted 0x60;
1565
    if no control key is pressed, the normal layout is used.
1567
    if no control key is pressed, the normal layout is used.
1566
  * To set layout and country identifier use
1568
  * To set layout and country identifier use
1567
    subfunction 2 of function 21.
1569
    subfunction 2 of function 21.
1568
  * Country identifier is global system variable, which is not used
1570
  * Country identifier is global system variable, which is not used
1569
    by the kernel itself; however the application '@taskbar' displays
1571
    by the kernel itself; however the application '@taskbar' displays
1570
    the corresponding icon (using this function).
1572
    the corresponding icon (using this function).
1571
  * The application @taskbar switches layouts on user request.
1573
  * The application @taskbar switches layouts on user request.
1572
 
1574
 
1573
---------------------- Constants for registers: ----------------------
1575
---------------------- Constants for registers: ----------------------
1574
  eax - SF_SYSTEM_GET (26)
1576
  eax - SF_SYSTEM_GET (26)
1575
  ebx - SSF_KEYBOARD_LAYOUT (2)
1577
  ebx - SSF_KEYBOARD_LAYOUT (2)
1576
======================================================================
1578
======================================================================
1577
========== Function 26, subfunction 5 - get system language. =========
1579
========== Function 26, subfunction 5 - get system language. =========
1578
======================================================================
1580
======================================================================
1579
Parameters:
1581
Parameters:
1580
  * eax = 26 - function number
1582
  * eax = 26 - function number
1581
  * ebx = 5 - subfunction number
1583
  * ebx = 5 - subfunction number
1582
Returned value:
1584
Returned value:
1583
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1585
  * eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
1584
Remarks:
1586
Remarks:
1585
  * System language is global system variable and is not used
1587
  * System language is global system variable and is not used
1586
    by the kernel itself, however application @taskbar draws the
1588
    by the kernel itself, however application @taskbar draws the
1587
    appropriate icon (using this function).
1589
    appropriate icon (using this function).
1588
  * To set system language use subfunction 5 of function 21.
1590
  * To set system language use subfunction 5 of function 21.
1589
 
1591
 
1590
---------------------- Constants for registers: ----------------------
1592
---------------------- Constants for registers: ----------------------
1591
  eax - SF_SYSTEM_GET (26)
1593
  eax - SF_SYSTEM_GET (26)
1592
  ebx - SSF_SYS_LANG (5)
1594
  ebx - SSF_SYS_LANG (5)
1593
======================================================================
1595
======================================================================
1594
=== Function 26, subfunction 9 - get the value of the time counter. ==
1596
=== Function 26, subfunction 9 - get the value of the time counter. ==
1595
======================================================================
1597
======================================================================
1596
Parameters:
1598
Parameters:
1597
  * eax = 26 - function number
1599
  * eax = 26 - function number
1598
  * ebx = 9 - subfunction number
1600
  * ebx = 9 - subfunction number
1599
Returned value:
1601
Returned value:
1600
  * eax = number of 1/100s of second, past from the system boot time
1602
  * eax = number of 1/100s of second, past from the system boot time
1601
Remarks:
1603
Remarks:
1602
  * Counter takes modulo 2^32, that correspond to a little more
1604
  * Counter takes modulo 2^32, that correspond to a little more
1603
    than 497 days.
1605
    than 497 days.
1604
  * To get system time use function 3.
1606
  * To get system time use function 3.
1605
 
1607
 
1606
---------------------- Constants for registers: ----------------------
1608
---------------------- Constants for registers: ----------------------
1607
  eax - SF_SYSTEM_GET (26)
1609
  eax - SF_SYSTEM_GET (26)
1608
  ebx - SSF_TIME_COUNT (9)
1610
  ebx - SSF_TIME_COUNT (9)
1609
======================================================================
1611
======================================================================
1610
===================== Function 26, subfunction 10 ====================
1612
===================== Function 26, subfunction 10 ====================
1611
========== Get the value of the high precision time counter. =========
1613
========== Get the value of the high precision time counter. =========
1612
======================================================================
1614
======================================================================
1613
Parameters:
1615
Parameters:
1614
  * eax = 26 - function number
1616
  * eax = 26 - function number
1615
  * ebx = 10 - subfunction number
1617
  * ebx = 10 - subfunction number
1616
Returned value:
1618
Returned value:
1617
  * eax = number of nanoseconds since system boot time (lower DWORD)
1619
  * eax = number of nanoseconds since system boot time (lower DWORD)
1618
  * edx = number of nanoseconds since system boot time (high DWORD)
1620
  * edx = number of nanoseconds since system boot time (high DWORD)
1619
Remarks:
1621
Remarks:
1620
  * The counter is based on HPET, if HPET is not available, resolution
1622
  * The counter is based on HPET, if HPET is not available, resolution
1621
    will be reduced to 10 000 000 nanoseconds.
1623
    will be reduced to 10 000 000 nanoseconds.
1622
 
1624
 
1623
---------------------- Constants for registers: ----------------------
1625
---------------------- Constants for registers: ----------------------
1624
  eax - SF_SYSTEM_GET (26)
1626
  eax - SF_SYSTEM_GET (26)
1625
  ebx - SSF_TIME_COUNT_PRO (10)
1627
  ebx - SSF_TIME_COUNT_PRO (10)
1626
======================================================================
1628
======================================================================
1627
===================== Function 26, subfunction 11 ====================
1629
===================== Function 26, subfunction 11 ====================
1628
========== Find out whether low-level HD access is enabled. ==========
1630
========== Find out whether low-level HD access is enabled. ==========
1629
======================================================================
1631
======================================================================
1630
Parameters:
1632
Parameters:
1631
  * eax = 26 - function number
1633
  * eax = 26 - function number
1632
  * ebx = 11 - subfunction number
1634
  * ebx = 11 - subfunction number
1633
Returned value:
1635
Returned value:
1634
  * eax = 0/1 - disabled/enabled
1636
  * eax = 0/1 - disabled/enabled
1635
Remarks:
1637
Remarks:
1636
  * Is used in LBA read (subfunction 8 of function 58).
1638
  * Is used in LBA read (subfunction 8 of function 58).
1637
  * To set current state use subfunction 11 of function 21.
1639
  * To set current state use subfunction 11 of function 21.
1638
 
1640
 
1639
---------------------- Constants for registers: ----------------------
1641
---------------------- Constants for registers: ----------------------
1640
  eax - SF_SYSTEM_GET (26)
1642
  eax - SF_SYSTEM_GET (26)
1641
  ebx - SSF_ACCESS_HD_LBA (11)
1643
  ebx - SSF_ACCESS_HD_LBA (11)
1642
======================================================================
1644
======================================================================
1643
===================== Function 26, subfunction 12 ====================
1645
===================== Function 26, subfunction 12 ====================
1644
========== Find out whether low-level PCI access is enabled. =========
1646
========== Find out whether low-level PCI access is enabled. =========
1645
======================================================================
1647
======================================================================
1646
Parameters:
1648
Parameters:
1647
  * eax = 26 - function number
1649
  * eax = 26 - function number
1648
  * ebx = 12 - subfunction number
1650
  * ebx = 12 - subfunction number
1649
Returned value:
1651
Returned value:
1650
  * eax = 0/1 - disabled/enabled
1652
  * eax = 0/1 - disabled/enabled
1651
Remarks:
1653
Remarks:
1652
  * Is used by operations with PCI bus (function 62).
1654
  * Is used by operations with PCI bus (function 62).
1653
  * The current implementation uses only low bit of ecx.
1655
  * The current implementation uses only low bit of ecx.
1654
  * To set the current state use subfunction 12 of function 21.
1656
  * To set the current state use subfunction 12 of function 21.
1655
 
1657
 
1656
---------------------- Constants for registers: ----------------------
1658
---------------------- Constants for registers: ----------------------
1657
  eax - SF_SYSTEM_GET (26)
1659
  eax - SF_SYSTEM_GET (26)
1658
  ebx - SSF_ACCESS_PCI (12)
1660
  ebx - SSF_ACCESS_PCI (12)
1659
======================================================================
1661
======================================================================
1660
=================== Function 29 - get system date. ===================
1662
=================== Function 29 - get system date. ===================
1661
======================================================================
1663
======================================================================
1662
Parameters:
1664
Parameters:
1663
  * eax = 29 - function number
1665
  * eax = 29 - function number
1664
Returned value:
1666
Returned value:
1665
  * eax = 0x00DDMMYY, where
1667
  * eax = 0x00DDMMYY, where
1666
    (binary-decimal coding, BCD, is used)
1668
    (binary-decimal coding, BCD, is used)
1667
  * YY = two low digits of year (00..99)
1669
  * YY = two low digits of year (00..99)
1668
  * MM = month (01..12)
1670
  * MM = month (01..12)
1669
  * DD = day (01..31)
1671
  * DD = day (01..31)
1670
Remarks:
1672
Remarks:
1671
  * To set system date use function 22.
1673
  * To set system date use function 22.
1672
 
1674
 
1673
---------------------- Constants for registers: ----------------------
1675
---------------------- Constants for registers: ----------------------
1674
  eax - SF_GET_SYS_DATE (29)
1676
  eax - SF_GET_SYS_DATE (29)
1675
======================================================================
1677
======================================================================
1676
============= Function 30 - work with the current folder. ============
1678
============= Function 30 - work with the current folder. ============
1677
======================================================================
1679
======================================================================
1678
 
1680
 
1679
--------- Subfunction 1 - set current folder for the thread. ---------
1681
--------- Subfunction 1 - set current folder for the thread. ---------
1680
Parameters:
1682
Parameters:
1681
  * eax = 30 - function number
1683
  * eax = 30 - function number
1682
  * ebx = 1 - subfunction number
1684
  * ebx = 1 - subfunction number
1683
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1685
  * ecx = pointer to ASCIIZ-string with the path to new current folder
1684
Returned value:
1686
Returned value:
1685
  * function does not return value
1687
  * function does not return value
1686
 
1688
 
1687
--------- Subfunction 2 - get current folder for the thread. ---------
1689
--------- Subfunction 2 - get current folder for the thread. ---------
1688
Parameters:
1690
Parameters:
1689
  * eax = 30 - function number
1691
  * eax = 30 - function number
1690
  * ebx = 2 - subfunction number
1692
  * ebx = 2 - subfunction number
1691
  * ecx = pointer to buffer
1693
  * ecx = pointer to buffer
1692
  * edx = size of buffer
1694
  * edx = size of buffer
1693
Returned value:
1695
Returned value:
1694
  * eax = size of the current folder's name (including terminating 0)
1696
  * eax = size of the current folder's name (including terminating 0)
1695
Remarks:
1697
Remarks:
1696
  * If the buffer is too small to hold all data, only first (edx-1)
1698
  * If the buffer is too small to hold all data, only first (edx-1)
1697
    bytes are copied and than terminating 0 is inserted.
1699
    bytes are copied and than terminating 0 is inserted.
1698
  * By default, current folder for the thread is "/rd/1".
1700
  * By default, current folder for the thread is "/rd/1".
1699
  * At process/thread creation the current folder will be inherited
1701
  * At process/thread creation the current folder will be inherited
1700
    from the parent.
1702
    from the parent.
1701
 
1703
 
1702
--- Subfunction 3 - install the add.system directory for the kernel --
1704
--- Subfunction 3 - install the add.system directory for the kernel --
1703
Parameters:
1705
Parameters:
1704
  * eax = 30 - function number
1706
  * eax = 30 - function number
1705
  * ebx = 3 - subfunction number
1707
  * ebx = 3 - subfunction number
1706
  * ecx = pointer to a block of data:
1708
  * ecx = pointer to a block of data:
1707
          sysdir_name     rb 64
1709
          sysdir_name     rb 64
1708
          sysdir_path     rb 64
1710
          sysdir_path     rb 64
1709
For example:
1711
For example:
1710
dir_name1       db 'KolibriOS',0
1712
dir_name1       db 'KolibriOS',0
1711
                rb 64-10
1713
                rb 64-10
1712
dir_path1       db 'HD0/1',0
1714
dir_path1       db 'HD0/1',0
1713
                rb 64-6
1715
                rb 64-6
1714
Returned value:
1716
Returned value:
1715
  * function does not return value
1717
  * function does not return value
1716
Remarks:
1718
Remarks:
1717
  * The function can be called only 1 time for 1 session of the OS.
1719
  * The function can be called only 1 time for 1 session of the OS.
1718
 
1720
 
1719
---------------------- Constants for registers: ----------------------
1721
---------------------- Constants for registers: ----------------------
1720
  eax - SF_CURRENT_FOLDER (30)
1722
  eax - SF_CURRENT_FOLDER (30)
1721
  ebx - SSF_SET_CF (1), SSF_GET_CF (2), SSF_ADD_SYS_FOLDER (3)
1723
  ebx - SSF_SET_CF (1), SSF_GET_CF (2), SSF_ADD_SYS_FOLDER (3)
1722
======================================================================
1724
======================================================================
1723
========= Function 34 - who owner the pixel on the screen. ===========
1725
========= Function 34 - who owner the pixel on the screen. ===========
1724
======================================================================
1726
======================================================================
1725
Parameters:
1727
Parameters:
1726
  * eax = 34 - function number
1728
  * eax = 34 - function number
1727
  * ebx = x-coordinate (relative to the display)
1729
  * ebx = x-coordinate (relative to the display)
1728
  * ecx = y-coordinate (relative to the display)
1730
  * ecx = y-coordinate (relative to the display)
1729
 
1731
 
1730
Returned value:
1732
Returned value:
1731
  * eax = 0x000000XX - owner of pixel the slot window N
1733
  * eax = 0x000000XX - owner of pixel the slot window N
1732
    If incorrect values ebx and ecx then function returns 0
1734
    If incorrect values ebx and ecx then function returns 0
1733
  * The function takes the value from the area [_WinMapAddress]
1735
  * The function takes the value from the area [_WinMapAddress]
1734
 
1736
 
1735
---------------------- Constants for registers: ----------------------
1737
---------------------- Constants for registers: ----------------------
1736
  eax - SF_GET_PIXEL_OWNER (34)
1738
  eax - SF_GET_PIXEL_OWNER (34)
1737
======================================================================
1739
======================================================================
1738
======= Function 35 - read the color of a pixel on the screen. =======
1740
======= Function 35 - read the color of a pixel on the screen. =======
1739
======================================================================
1741
======================================================================
1740
Parameters:
1742
Parameters:
1741
  * eax = 35
1743
  * eax = 35
1742
  * ebx = y*xsize+x, where
1744
  * ebx = y*xsize+x, where
1743
  * (x,y) = coordinates of a pixel (beginning from 0)
1745
  * (x,y) = coordinates of a pixel (beginning from 0)
1744
  * xsize = horizontal screen size
1746
  * xsize = horizontal screen size
1745
Returned value:
1747
Returned value:
1746
  * eax = color 0x00RRGGBB
1748
  * eax = color 0x00RRGGBB
1747
Remarks:
1749
Remarks:
1748
  * To get screen sizes use function 14. Pay attention,
1750
  * To get screen sizes use function 14. Pay attention,
1749
    that it subtracts 1 from both sizes.
1751
    that it subtracts 1 from both sizes.
1750
  * There is also direct access (without any system calls)
1752
  * There is also direct access (without any system calls)
1751
    to videomemory through the selector gs. To get parameters of
1753
    to videomemory through the selector gs. To get parameters of
1752
    the current videomode, use function 61.
1754
    the current videomode, use function 61.
1753
 
1755
 
1754
---------------------- Constants for registers: ----------------------
1756
---------------------- Constants for registers: ----------------------
1755
  eax - SF_GET_PIXEL (35)
1757
  eax - SF_GET_PIXEL (35)
1756
======================================================================
1758
======================================================================
1757
=================== Function 36 - read screen area. ==================
1759
=================== Function 36 - read screen area. ==================
1758
======================================================================
1760
======================================================================
1759
Paramters:
1761
Paramters:
1760
  * eax = 36 - function number
1762
  * eax = 36 - function number
1761
  * ebx = pointer to the previously allocated memory area,
1763
  * ebx = pointer to the previously allocated memory area,
1762
        where will be placed the image in the format BBGGRRBBGGRR...
1764
        where will be placed the image in the format BBGGRRBBGGRR...
1763
  * ecx = [size on axis x]*65536 + [size on axis y]
1765
  * ecx = [size on axis x]*65536 + [size on axis y]
1764
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1766
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
1765
Returned value:
1767
Returned value:
1766
  * function does not return value
1768
  * function does not return value
1767
Remarks:
1769
Remarks:
1768
  * Coordinates of the image are coordinates of the upper left corner
1770
  * Coordinates of the image are coordinates of the upper left corner
1769
    of the image relative to the screen.
1771
    of the image relative to the screen.
1770
  * Size of the image in bytes is 3*xsize*ysize.
1772
  * Size of the image in bytes is 3*xsize*ysize.
1771
 
1773
 
1772
---------------------- Constants for registers: ----------------------
1774
---------------------- Constants for registers: ----------------------
1773
  eax - SF_GET_IMAGE (36)
1775
  eax - SF_GET_IMAGE (36)
1774
======================================================================
1776
======================================================================
1775
=================== Function 37 - work with mouse. ===================
1777
=================== Function 37 - work with mouse. ===================
1776
======================================================================
1778
======================================================================
1777
 
1779
 
1778
---------- Subfunction 0 - screen coordinates of the mouse -----------
1780
---------- Subfunction 0 - screen coordinates of the mouse -----------
1779
Parameters:
1781
Parameters:
1780
  * eax = 37 - function number
1782
  * eax = 37 - function number
1781
  * ebx = 0 - subfunction number
1783
  * ebx = 0 - subfunction number
1782
Returned value:
1784
Returned value:
1783
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1785
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1784
    (beginning from 0)
1786
    (beginning from 0)
1785
 
1787
 
1786
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1788
-- Subfunction 1 - coordinates of the mouse relative to the window ---
1787
Parameters:
1789
Parameters:
1788
  * eax = 37 - function number
1790
  * eax = 37 - function number
1789
  * ebx = 1 - subfunction number
1791
  * ebx = 1 - subfunction number
1790
Returned value:
1792
Returned value:
1791
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1793
  * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
1792
    relative to the application window (beginning from 0)
1794
    relative to the application window (beginning from 0)
1793
Remarks:
1795
Remarks:
1794
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1796
  * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
1795
    If y>=ywnd, the low word is non-negative and contains
1797
    If y>=ywnd, the low word is non-negative and contains
1796
    relative y-coordinate, and the high word - relative x-coordinate
1798
    relative y-coordinate, and the high word - relative x-coordinate
1797
    (with correct sign). Otherwise the low word is negative and still
1799
    (with correct sign). Otherwise the low word is negative and still
1798
    contains relative y-coordinate, and to the high word
1800
    contains relative y-coordinate, and to the high word
1799
    1 should be added.
1801
    1 should be added.
1800
 
1802
 
1801
------------- Subfunction 2 - states of the mouse buttons ------------
1803
------------- Subfunction 2 - states of the mouse buttons ------------
1802
Parameters:
1804
Parameters:
1803
  * eax = 37 - function number
1805
  * eax = 37 - function number
1804
  * ebx = 2 - subfunction number
1806
  * ebx = 2 - subfunction number
1805
Returned value:
1807
Returned value:
1806
  * eax = bits 0-4 equal to subfunction 3
1808
  * eax = bits 0-4 equal to subfunction 3
1807
 
1809
 
1808
------- Subfunction 3 - states and events of the mouse buttons -------
1810
------- Subfunction 3 - states and events of the mouse buttons -------
1809
Parameters:
1811
Parameters:
1810
  * eax = 37 - function number
1812
  * eax = 37 - function number
1811
  * ebx = 3 - subfunction number
1813
  * ebx = 3 - subfunction number
1812
Returned value:
1814
Returned value:
1813
  * eax contains next information:
1815
  * eax contains next information:
1814
 
1816
 
1815
states:
1817
states:
1816
  * bit 0 is set = left button is held
1818
  * bit 0 is set = left button is held
1817
  * bit 1 is set = right button is held
1819
  * bit 1 is set = right button is held
1818
  * bit 2 is set = middle button is held
1820
  * bit 2 is set = middle button is held
1819
  * bit 3 is set = 4th button is held
1821
  * bit 3 is set = 4th button is held
1820
  * bit 4 is set = 5th button is held
1822
  * bit 4 is set = 5th button is held
1821
 
1823
 
1822
events:
1824
events:
1823
  * bit 8 is set = left button is pressed
1825
  * bit 8 is set = left button is pressed
1824
  * bit 9 is set = right button is pressed
1826
  * bit 9 is set = right button is pressed
1825
  * bit 10 is set = middle button is pressed
1827
  * bit 10 is set = middle button is pressed
1826
 
1828
 
1827
  * bit 15 is set = vertical scroll is used
1829
  * bit 15 is set = vertical scroll is used
1828
 
1830
 
1829
  * bit 16 is set = left button is released
1831
  * bit 16 is set = left button is released
1830
  * bit 17 is set = right button is released
1832
  * bit 17 is set = right button is released
1831
  * bit 18 is set = middle button is released
1833
  * bit 18 is set = middle button is released
1832
 
1834
 
1833
  * bit 23 is set = horisontal scroll is used
1835
  * bit 23 is set = horisontal scroll is used
1834
 
1836
 
1835
  * bit 24 is set = doubleclick by left button
1837
  * bit 24 is set = doubleclick by left button
1836
 
1838
 
1837
-------------------- Subfunction 4 - load cursor ---------------------
1839
-------------------- Subfunction 4 - load cursor ---------------------
1838
Parameters:
1840
Parameters:
1839
  * eax = 37 - function number
1841
  * eax = 37 - function number
1840
  * ebx = 4 - subfunction number
1842
  * ebx = 4 - subfunction number
1841
  * dx = data source:
1843
  * dx = data source:
1842
  * dx = LOAD_FROM_FILE = 0 - data in a file
1844
  * dx = LOAD_FROM_FILE = 0 - data in a file
1843
    * ecx = pointer to full path to the cursor file
1845
    * ecx = pointer to full path to the cursor file
1844
    * the file must be in the format .cur, which is standard for
1846
    * the file must be in the format .cur, which is standard for
1845
      MS Windows, at that of the size 32*32 pixels
1847
      MS Windows, at that of the size 32*32 pixels
1846
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1848
  * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
1847
    * ecx = pointer to data of the cursor file
1849
    * ecx = pointer to data of the cursor file
1848
    * the data format is the same as in the previous case
1850
    * the data format is the same as in the previous case
1849
  * dx = LOAD_INDIRECT = 2 - data in memory
1851
  * dx = LOAD_INDIRECT = 2 - data in memory
1850
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1852
    * ecx = pointer to cursor image in the format ARGB 32*32 pixels
1851
    * edx = 0xXXYY0002, where
1853
    * edx = 0xXXYY0002, where
1852
      * XX = x-coordinate of cursor hotspot
1854
      * XX = x-coordinate of cursor hotspot
1853
      * YY = y-coordinate
1855
      * YY = y-coordinate
1854
      * 0 <= XX, YY <= 31
1856
      * 0 <= XX, YY <= 31
1855
Returned value:
1857
Returned value:
1856
  * eax = 0 - failed
1858
  * eax = 0 - failed
1857
  * otherwise eax = cursor handle
1859
  * otherwise eax = cursor handle
1858
 
1860
 
1859
--------------------- Subfunction 5 - set cursor ---------------------
1861
--------------------- Subfunction 5 - set cursor ---------------------
1860
Sets new cursor for the window of the current thread.
1862
Sets new cursor for the window of the current thread.
1861
Parameters:
1863
Parameters:
1862
  * eax = 37 - function number
1864
  * eax = 37 - function number
1863
  * ebx = 5 - subfunction number
1865
  * ebx = 5 - subfunction number
1864
  * ecx = cursor handle
1866
  * ecx = cursor handle
1865
Returned value:
1867
Returned value:
1866
  * eax = handle of previous cursor
1868
  * eax = handle of previous cursor
1867
Remarks:
1869
Remarks:
1868
  * If the handle is incorrect, the function restores the default
1870
  * If the handle is incorrect, the function restores the default
1869
    cursor (standard arrow). In particular, ecx=0 restores it.
1871
    cursor (standard arrow). In particular, ecx=0 restores it.
1870
 
1872
 
1871
------------------- Subfunction 6 - delete cursor --------------------
1873
------------------- Subfunction 6 - delete cursor --------------------
1872
Parameters:
1874
Parameters:
1873
  * eax = 37 - function number
1875
  * eax = 37 - function number
1874
  * ebx = 6 - subfunction number
1876
  * ebx = 6 - subfunction number
1875
  * ecx = cursor handle
1877
  * ecx = cursor handle
1876
Returned value:
1878
Returned value:
1877
  * eax destroyed
1879
  * eax destroyed
1878
Remarks:
1880
Remarks:
1879
  * The cursor must be loaded previously by the current thread
1881
  * The cursor must be loaded previously by the current thread
1880
    (with the call to subfunction 4). The function does not delete
1882
    (with the call to subfunction 4). The function does not delete
1881
    system cursors and cursors, loaded by another applications.
1883
    system cursors and cursors, loaded by another applications.
1882
  * If the active cursor (set by subfunction 5) is deleted,
1884
  * If the active cursor (set by subfunction 5) is deleted,
1883
    the system restores the default cursor (standard arrow).
1885
    the system restores the default cursor (standard arrow).
1884
 
1886
 
1885
------------------ Subfunction 7 - get scroll data -------------------
1887
------------------ Subfunction 7 - get scroll data -------------------
1886
Parameters:
1888
Parameters:
1887
  * eax = 37 - function number
1889
  * eax = 37 - function number
1888
  * ebx = 7 - subfunction number
1890
  * ebx = 7 - subfunction number
1889
Returned value:
1891
Returned value:
1890
  * eax = [horizontal offset]*65536 + [vertical offset]
1892
  * eax = [horizontal offset]*65536 + [vertical offset]
1891
Remarks:
1893
Remarks:
1892
  * Scroll data is available for active window only.
1894
  * Scroll data is available for active window only.
1893
  * Values are zeroed after reading.
1895
  * Values are zeroed after reading.
1894
  * Values are signed.
1896
  * Values are signed.
1895
 
1897
 
1896
---------------------- Constants for registers: ----------------------
1898
---------------------- Constants for registers: ----------------------
1897
  eax - SF_MOUSE_GET (37)
1899
  eax - SF_MOUSE_GET (37)
1898
  ebx - SSF_SCREEN_POSITION (0), SSF_WINDOW_POSITION (1),
1900
  ebx - SSF_SCREEN_POSITION (0), SSF_WINDOW_POSITION (1),
1899
    SSF_BUTTON (2), SSF_BUTTON_EXT (3), SSF_LOAD_CURSOR (4),
1901
    SSF_BUTTON (2), SSF_BUTTON_EXT (3), SSF_LOAD_CURSOR (4),
1900
    SSF_SET_CURSOR (5), SSF_DEL_CURSOR (6), SSF_SCROLL_DATA (7)
1902
    SSF_SET_CURSOR (5), SSF_DEL_CURSOR (6), SSF_SCROLL_DATA (7)
1901
======================================================================
1903
======================================================================
1902
====================== Function 38 - draw line. ======================
1904
====================== Function 38 - draw line. ======================
1903
======================================================================
1905
======================================================================
1904
Parameters:
1906
Parameters:
1905
  * eax = 38 - function number
1907
  * eax = 38 - function number
1906
  * ebx = [start coordinate on axis x]*65536 +
1908
  * ebx = [start coordinate on axis x]*65536 +
1907
              [end coordinate on axis x]
1909
              [end coordinate on axis x]
1908
  * ecx = [start coordinate on axis y]*65536 +
1910
  * ecx = [start coordinate on axis y]*65536 +
1909
              [end coordinate on axis y]
1911
              [end coordinate on axis y]
1910
  * edx = 0x00RRGGBB - color
1912
  * edx = 0x00RRGGBB - color
1911
    edx = 0x01xxxxxx - draw inversed line
1913
    edx = 0x01xxxxxx - draw inversed line
1912
          (low 24 bits are ignored)
1914
          (low 24 bits are ignored)
1913
Returned value:
1915
Returned value:
1914
  * function does not return value
1916
  * function does not return value
1915
Remarks:
1917
Remarks:
1916
  * Coordinates are relative to the window.
1918
  * Coordinates are relative to the window.
1917
  * End point is also drawn.
1919
  * End point is also drawn.
1918
 
1920
 
1919
---------------------- Constants for registers: ----------------------
1921
---------------------- Constants for registers: ----------------------
1920
  eax - SF_DRAW_LINE (38)
1922
  eax - SF_DRAW_LINE (38)
1921
======================================================================
1923
======================================================================
1922
== Function 39, subfunction 1 - get a size of the background image. ==
1924
== Function 39, subfunction 1 - get a size of the background image. ==
1923
======================================================================
1925
======================================================================
1924
Parameters:
1926
Parameters:
1925
  * eax = 39 - function number
1927
  * eax = 39 - function number
1926
  * ebx = 1 - subfunction number
1928
  * ebx = 1 - subfunction number
1927
Returned value:
1929
Returned value:
1928
  * eax = [width]*65536 + [height]
1930
  * eax = [width]*65536 + [height]
1929
Remarks:
1931
Remarks:
1930
  * There is a pair function to set sizes of background image -
1932
  * There is a pair function to set sizes of background image -
1931
    subfunction 1 of function 15. After which it is necessary,
1933
    subfunction 1 of function 15. After which it is necessary,
1932
    of course, anew to define image.
1934
    of course, anew to define image.
1933
 
1935
 
1934
---------------------- Constants for registers: ----------------------
1936
---------------------- Constants for registers: ----------------------
1935
  eax - SF_BACKGROUND_GET (39)
1937
  eax - SF_BACKGROUND_GET (39)
1936
======================================================================
1938
======================================================================
1937
== Function 39, subfunction 2 - get pixel from the background image. =
1939
== Function 39, subfunction 2 - get pixel from the background image. =
1938
======================================================================
1940
======================================================================
1939
Parameters:
1941
Parameters:
1940
  * eax = 39 - function number
1942
  * eax = 39 - function number
1941
  * ebx = 2 - subfunction number
1943
  * ebx = 2 - subfunction number
1942
  * ecx = offset
1944
  * ecx = offset
1943
Returned value:
1945
Returned value:
1944
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1946
  * eax = 0x00RRGGBB - pixel color, if offset is valid
1945
    (less than 0x160000-16)
1947
    (less than 0x160000-16)
1946
  * eax = 2 otherwise
1948
  * eax = 2 otherwise
1947
Remarks:
1949
Remarks:
1948
  * Do not rely on returned value for invalid offsets, it may be
1950
  * Do not rely on returned value for invalid offsets, it may be
1949
    changed in future kernel versions.
1951
    changed in future kernel versions.
1950
  * Offset for pixel with coordinates (x,y)
1952
  * Offset for pixel with coordinates (x,y)
1951
    is calculated as (x+y*xsize)*3.
1953
    is calculated as (x+y*xsize)*3.
1952
  * There is a pair function to set pixel on the background image -
1954
  * There is a pair function to set pixel on the background image -
1953
    subfunction 2 of function 15.
1955
    subfunction 2 of function 15.
1954
 
1956
 
1955
---------------------- Constants for registers: ----------------------
1957
---------------------- Constants for registers: ----------------------
1956
  eax - SF_BACKGROUND_GET (39)
1958
  eax - SF_BACKGROUND_GET (39)
1957
======================================================================
1959
======================================================================
1958
== Function 39, subfunction 4 - get drawing mode for the background. =
1960
== Function 39, subfunction 4 - get drawing mode for the background. =
1959
======================================================================
1961
======================================================================
1960
Parameters:
1962
Parameters:
1961
  * eax = 39 - function number
1963
  * eax = 39 - function number
1962
  * ebx = 4 - subfunction number
1964
  * ebx = 4 - subfunction number
1963
Returned value:
1965
Returned value:
1964
  * eax = 1 - tile
1966
  * eax = 1 - tile
1965
  * eax = 2 - stretch
1967
  * eax = 2 - stretch
1966
Remarks:
1968
Remarks:
1967
  * There is a pair function to set drawing mode -
1969
  * There is a pair function to set drawing mode -
1968
    subfunction 4 of function 15.
1970
    subfunction 4 of function 15.
1969
 
1971
 
1970
---------------------- Constants for registers: ----------------------
1972
---------------------- Constants for registers: ----------------------
1971
  eax - SF_BACKGROUND_GET (39)
1973
  eax - SF_BACKGROUND_GET (39)
1972
======================================================================
1974
======================================================================
1973
=========== Function 40 - set the mask for expected events. ==========
1975
=========== Function 40 - set the mask for expected events. ==========
1974
======================================================================
1976
======================================================================
1975
The mask for expected events affects function working with events
1977
The mask for expected events affects function working with events
1976
10, 11, 23 - they notify only about events allowed by this mask.
1978
10, 11, 23 - they notify only about events allowed by this mask.
1977
Parameters:
1979
Parameters:
1978
  * eax = 40 - function number
1980
  * eax = 40 - function number
1979
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1981
  * ebx = mask: bit i corresponds to event i+1 (see list of events)
1980
    (set bit permits notice on event)
1982
    (set bit permits notice on event)
1981
    bit 31: mouse active/inactive filter
1983
    bit 31: mouse active/inactive filter
1982
    bit 31 = 0 - inactive window receive mouse events
1984
    bit 31 = 0 - inactive window receive mouse events
1983
    bit 31 = 1 - inactive window does not receive mouse events
1985
    bit 31 = 1 - inactive window does not receive mouse events
1984
    bit 30: cursor position filter
1986
    bit 30: cursor position filter
1985
    bit 30 = 0 = the window receive mouse events if cursor
1987
    bit 30 = 0 = the window receive mouse events if cursor
1986
                 outside window
1988
                 outside window
1987
    bit 30 = 1 - the window does not receive mouse events if cursor
1989
    bit 30 = 1 - the window does not receive mouse events if cursor
1988
                 outside window
1990
                 outside window
1989
Returned value:
1991
Returned value:
1990
  * eax = previous value of mask
1992
  * eax = previous value of mask
1991
Remarks:
1993
Remarks:
1992
  * Default mask (7=111b) enables nofices about redraw,
1994
  * Default mask (7=111b) enables nofices about redraw,
1993
    keys and buttons. This is enough for many applications.
1995
    keys and buttons. This is enough for many applications.
1994
  * Events prohibited in the mask are saved anyway, when come;
1996
  * Events prohibited in the mask are saved anyway, when come;
1995
    they are simply not informed with event functions.
1997
    they are simply not informed with event functions.
1996
  * Event functions take into account the mask on moment of
1998
  * Event functions take into account the mask on moment of
1997
    function call, not on moment of event arrival.
1999
    function call, not on moment of event arrival.
1998
 
2000
 
1999
---------------------- Constants for registers: ----------------------
2001
---------------------- Constants for registers: ----------------------
2000
  eax - SF_SET_EVENTS_MASK (40)
2002
  eax - SF_SET_EVENTS_MASK (40)
2001
======================================================================
2003
======================================================================
2002
================ Function 43 - input/output to a port. ===============
2004
================ Function 43 - input/output to a port. ===============
2003
======================================================================
2005
======================================================================
2004
 
2006
 
2005
------------------------ Output data to port -------------------------
2007
------------------------ Output data to port -------------------------
2006
Parameters:
2008
Parameters:
2007
  * eax = 43 - function number
2009
  * eax = 43 - function number
2008
  * bl = byte for output
2010
  * bl = byte for output
2009
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
2011
  * ecx = port number 0xnnnn (from 0 to 0xFFFF)
2010
Returned value:
2012
Returned value:
2011
  * eax = 0 - success
2013
  * eax = 0 - success
2012
  * eax = 1 - the thread has not reserved the selected port
2014
  * eax = 1 - the thread has not reserved the selected port
2013
 
2015
 
2014
------------------------ Input data from port ------------------------
2016
------------------------ Input data from port ------------------------
2015
Parameters:
2017
Parameters:
2016
  * eax = 43 - function number
2018
  * eax = 43 - function number
2017
  * ebx is ignored
2019
  * ebx is ignored
2018
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
2020
  * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
2019
Returned value:
2021
Returned value:
2020
  * eax = 0 - success, thus ebx = entered byte
2022
  * eax = 0 - success, thus ebx = entered byte
2021
  * eax = 1 - the thread has not reserved the selected port
2023
  * eax = 1 - the thread has not reserved the selected port
2022
Remarks:
2024
Remarks:
2023
  * Previously the thread must reserve the selected port
2025
  * Previously the thread must reserve the selected port
2024
    for itself by function 46.
2026
    for itself by function 46.
2025
  * Instead of call to this function it is better to use
2027
  * Instead of call to this function it is better to use
2026
    processor instructions in/out - this is much
2028
    processor instructions in/out - this is much
2027
    faster and a bit shorter and easier.
2029
    faster and a bit shorter and easier.
2028
 
2030
 
2029
---------------------- Constants for registers: ----------------------
2031
---------------------- Constants for registers: ----------------------
2030
  eax - SF_PORT_IN_OUT (43)
2032
  eax - SF_PORT_IN_OUT (43)
2031
======================================================================
2033
======================================================================
2032
====== Function 46 - reserve/free a group of input/output ports. =====
2034
====== Function 46 - reserve/free a group of input/output ports. =====
2033
======================================================================
2035
======================================================================
2034
To work with reserved ports an application can access directly by
2036
To work with reserved ports an application can access directly by
2035
commands in/out (recommended way) and can use function 43
2037
commands in/out (recommended way) and can use function 43
2036
(not recommended way).
2038
(not recommended way).
2037
Parameters:
2039
Parameters:
2038
  * eax = 46 - function number
2040
  * eax = 46 - function number
2039
  * ebx = 0 - reserve, 1 - free
2041
  * ebx = 0 - reserve, 1 - free
2040
  * ecx = start port number
2042
  * ecx = start port number
2041
  * edx = end port number (inclusive)
2043
  * edx = end port number (inclusive)
2042
Returned value:
2044
Returned value:
2043
  * eax = 0 - success
2045
  * eax = 0 - success
2044
  * eax = 1 - error
2046
  * eax = 1 - error
2045
Remarks:
2047
Remarks:
2046
  * For ports reservation: an error occurs if and only if
2048
  * For ports reservation: an error occurs if and only if
2047
    one from the following condition satisfies:
2049
    one from the following condition satisfies:
2048
    * start port is more than end port;
2050
    * start port is more than end port;
2049
    * the selected range contains incorrect port number
2051
    * the selected range contains incorrect port number
2050
      (correct are from 0 to 0xFFFF);
2052
      (correct are from 0 to 0xFFFF);
2051
    * limit for the total number of reserved areas is exceeded
2053
    * limit for the total number of reserved areas is exceeded
2052
      (maximum 255 are allowed);
2054
      (maximum 255 are allowed);
2053
    * the selected range intersects with any of earlier reserved
2055
    * the selected range intersects with any of earlier reserved
2054
  * For ports free: an error is an attempt to free range,
2056
  * For ports free: an error is an attempt to free range,
2055
    that was not earlier reserved by this function
2057
    that was not earlier reserved by this function
2056
    (with same ecx,edx).
2058
    (with same ecx,edx).
2057
  * If an error occurs (for both cases) function performs no action.
2059
  * If an error occurs (for both cases) function performs no action.
2058
  * At booting the system reserves for itself ports
2060
  * At booting the system reserves for itself ports
2059
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2061
    0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
2060
  * When a thread terminates, all reserved by it ports
2062
  * When a thread terminates, all reserved by it ports
2061
    are freed automatically.
2063
    are freed automatically.
2062
 
2064
 
2063
---------------------- Constants for registers: ----------------------
2065
---------------------- Constants for registers: ----------------------
2064
  eax - SF_SET_PORTS (46)
2066
  eax - SF_SET_PORTS (46)
2065
======================================================================
2067
======================================================================
2066
============= Function 47 - draw a number in the window. =============
2068
============= Function 47 - draw a number in the window. =============
2067
======================================================================
2069
======================================================================
2068
Parameters:
2070
Parameters:
2069
  * eax = 47 - function number
2071
  * eax = 47 - function number
2070
  * ebx = parameters of conversion number to text:
2072
  * ebx = parameters of conversion number to text:
2071
    * bl = 0 - ecx contains number
2073
    * bl = 0 - ecx contains number
2072
    * bl = 1 - ecx contains pointer to dword/qword-number
2074
    * bl = 1 - ecx contains pointer to dword/qword-number
2073
    * bh = 0 - display in decimal number system
2075
    * bh = 0 - display in decimal number system
2074
    * bh = 1 - display in hexadecimal system
2076
    * bh = 1 - display in hexadecimal system
2075
    * bh = 2 - display in binary system
2077
    * bh = 2 - display in binary system
2076
    * bits 16-21 = how many digits to display
2078
    * bits 16-21 = how many digits to display
2077
    * bits 22-29 reserved and must be set to 0
2079
    * bits 22-29 reserved and must be set to 0
2078
    * bit 30 set = display qword (64-bit) number (must be bl=1)
2080
    * bit 30 set = display qword (64-bit) number (must be bl=1)
2079
    * bit 31 set = do not display leading zeroes of the number
2081
    * bit 31 set = do not display leading zeroes of the number
2080
  * ecx = number (if bl=0) or pointer (if bl=1)
2082
  * ecx = number (if bl=0) or pointer (if bl=1)
2081
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2083
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2082
  * esi = 0xX0RRGGBB:
2084
  * esi = 0xX0RRGGBB:
2083
    * RR, GG, BB specify the color
2085
    * RR, GG, BB specify the color
2084
    * X = ABnn (bits)
2086
    * X = ABnn (bits)
2085
    * nn = font (0/1)
2087
    * nn = font (0/1)
2086
    * A is ignored
2088
    * A is ignored
2087
    * B=1 - fill background with the color edi
2089
    * B=1 - fill background with the color edi
2088
Returned value:
2090
Returned value:
2089
  * function does not return value
2091
  * function does not return value
2090
Remarks:
2092
Remarks:
2091
  * The given length must not exceed 60.
2093
  * The given length must not exceed 60.
2092
  * 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
2093
    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
2094
    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
2095
    given amount of digits, extra digits are not drawn.
2097
    given amount of digits, extra digits are not drawn.
2096
  * Parameters of fonts are shown in the description of function 4
2098
  * Parameters of fonts are shown in the description of function 4
2097
    (text output).
2099
    (text output).
2098
 
2100
 
2099
---------------------- Constants for registers: ----------------------
2101
---------------------- Constants for registers: ----------------------
2100
  eax - SF_DRAW_NUMBER (47)
2102
  eax - SF_DRAW_NUMBER (47)
2101
======================================================================
2103
======================================================================
2102
========= Function 48, subfunction 0 - apply screen settings. ========
2104
========= Function 48, subfunction 0 - apply screen settings. ========
2103
======================================================================
2105
======================================================================
2104
Parameters:
2106
Parameters:
2105
  * eax = 48 - function number
2107
  * eax = 48 - function number
2106
  * ebx = 0 - subfunction number
2108
  * ebx = 0 - subfunction number
2107
  * ecx = 0 - reserved
2109
  * ecx = 0 - reserved
2108
Returned value:
2110
Returned value:
2109
  * function does not return value
2111
  * function does not return value
2110
Remarks:
2112
Remarks:
2111
  * Function redraws the screen after parameters change by
2113
  * Function redraws the screen after parameters change by
2112
    subfunctions 1 and 2.
2114
    subfunctions 1 and 2.
2113
  * Function call without prior call to one of indicated subfunctions
2115
  * Function call without prior call to one of indicated subfunctions
2114
    is ignored.
2116
    is ignored.
2115
  * Function call with nonzero ecx is ignored.
2117
  * Function call with nonzero ecx is ignored.
2116
 
2118
 
2117
---------------------- Constants for registers: ----------------------
2119
---------------------- Constants for registers: ----------------------
2118
  eax - SF_STYLE_SETTINGS (48)
2120
  eax - SF_STYLE_SETTINGS (48)
2119
  ebx - SSF_APPLY (0)
2121
  ebx - SSF_APPLY (0)
2120
======================================================================
2122
======================================================================
2121
=========== Function 48, subfunction 1 - set button style. ===========
2123
=========== Function 48, subfunction 1 - set button style. ===========
2122
======================================================================
2124
======================================================================
2123
Parameters:
2125
Parameters:
2124
  * eax = 48 - function number
2126
  * eax = 48 - function number
2125
  * ebx = 1 - subfunction number
2127
  * ebx = 1 - subfunction number
2126
  * ecx = button style:
2128
  * ecx = button style:
2127
    * 0 = flat
2129
    * 0 = flat
2128
    * 1 = 3d
2130
    * 1 = 3d
2129
Returned value:
2131
Returned value:
2130
  * function does not return value
2132
  * function does not return value
2131
Remarks:
2133
Remarks:
2132
  * After call to this function one should redraw the screen by
2134
  * After call to this function one should redraw the screen by
2133
    subfunction 0.
2135
    subfunction 0.
2134
  * Button style influences only to their draw of function 8.
2136
  * Button style influences only to their draw of function 8.
2135
 
2137
 
2136
---------------------- Constants for registers: ----------------------
2138
---------------------- Constants for registers: ----------------------
2137
  eax - SF_STYLE_SETTINGS (48)
2139
  eax - SF_STYLE_SETTINGS (48)
2138
  ebx - SSF_SET_BUTTON_STYLE (1)
2140
  ebx - SSF_SET_BUTTON_STYLE (1)
2139
======================================================================
2141
======================================================================
2140
====== Function 48, subfunction 2 - set standard window colors. ======
2142
====== Function 48, subfunction 2 - set standard window colors. ======
2141
======================================================================
2143
======================================================================
2142
Parameters:
2144
Parameters:
2143
  * eax = 48 - function number
2145
  * eax = 48 - function number
2144
  * ebx = 2 - subfunction number
2146
  * ebx = 2 - subfunction number
2145
  * ecx = pointer to the color table
2147
  * ecx = pointer to the color table
2146
  * edx = size of the color table
2148
  * edx = size of the color table
2147
    (must be 40 bytes for future compatibility)
2149
    (must be 40 bytes for future compatibility)
2148
Format of the color table is shown in description of subfunction 3.
2150
Format of the color table is shown in description of subfunction 3.
2149
Returned value:
2151
Returned value:
2150
  * function does not return value
2152
  * function does not return value
2151
Remarks:
2153
Remarks:
2152
  * After call to this function one should redraw the screen by
2154
  * After call to this function one should redraw the screen by
2153
    subfunction 0.
2155
    subfunction 0.
2154
  * Table of standard colors influences only to applications,
2156
  * Table of standard colors influences only to applications,
2155
    which receive this table obviously (by subfunction 3)
2157
    which receive this table obviously (by subfunction 3)
2156
    and use it (specifying colors from it to drawing functions).
2158
    and use it (specifying colors from it to drawing functions).
2157
  * Table of standard colors is included in skin and is installed
2159
  * Table of standard colors is included in skin and is installed
2158
    anew with skin installation (by subfunction 8).
2160
    anew with skin installation (by subfunction 8).
2159
  * Color table can be viewed/changed interactively with
2161
  * Color table can be viewed/changed interactively with
2160
    the application 'desktop'.
2162
    the application 'desktop'.
2161
 
2163
 
2162
---------------------- Constants for registers: ----------------------
2164
---------------------- Constants for registers: ----------------------
2163
  eax - SF_STYLE_SETTINGS (48)
2165
  eax - SF_STYLE_SETTINGS (48)
2164
  ebx - SSF_SET_COLORS (2)
2166
  ebx - SSF_SET_COLORS (2)
2165
======================================================================
2167
======================================================================
2166
====== Function 48, subfunction 3 - get standard window colors. ======
2168
====== Function 48, subfunction 3 - get standard window colors. ======
2167
======================================================================
2169
======================================================================
2168
Parameters:
2170
Parameters:
2169
  * eax = 48 - function number
2171
  * eax = 48 - function number
2170
  * ebx = 3 - subfunction number
2172
  * ebx = 3 - subfunction number
2171
  * ecx = pointer to the buffer with size edx bytes,
2173
  * ecx = pointer to the buffer with size edx bytes,
2172
    where table will be written
2174
    where table will be written
2173
  * edx = size of color table
2175
  * edx = size of color table
2174
    (must be 40 bytes for future compatibility)
2176
    (must be 40 bytes for future compatibility)
2175
Returned value:
2177
Returned value:
2176
  * function does not return value
2178
  * function does not return value
2177
Format of the color table:
2179
Format of the color table:
2178
each item is dword-value for color 0x00RRGGBB
2180
each item is dword-value for color 0x00RRGGBB
2179
  * +0: dword: frames - color of frame
2181
  * +0: dword: frames - color of frame
2180
  * +4: dword: grab - color of header
2182
  * +4: dword: grab - color of header
2181
  * +8: dword: grab_button - color of button on header bar
2183
  * +8: dword: grab_button - color of button on header bar
2182
  * +12 = +0xC: dword: grab_button_text - color of text on button
2184
  * +12 = +0xC: dword: grab_button_text - color of text on button
2183
    on header bar
2185
    on header bar
2184
  * +16 = +0x10: dword: grab_text - color of text on header
2186
  * +16 = +0x10: dword: grab_text - color of text on header
2185
  * +20 = +0x14: dword: work - color of working area
2187
  * +20 = +0x14: dword: work - color of working area
2186
  * +24 = +0x18: dword: work_button - color of button in working area
2188
  * +24 = +0x18: dword: work_button - color of button in working area
2187
  * +28 = +0x1C: dword: work_button_text - color of text on button
2189
  * +28 = +0x1C: dword: work_button_text - color of text on button
2188
    in working area
2190
    in working area
2189
  * +32 = +0x20: dword: work_text - color of text in working area
2191
  * +32 = +0x20: dword: work_text - color of text in working area
2190
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2192
  * +36 = +0x24: dword: work_graph - color of graphics in working area
2191
Remarks:
2193
Remarks:
2192
  * Structure of the color table is described in the standard
2194
  * Structure of the color table is described in the standard
2193
    include file 'macros.inc' as 'system_colors'; for example,
2195
    include file 'macros.inc' as 'system_colors'; for example,
2194
    it is possible to write:
2196
    it is possible to write:
2195
        sc      system_colors           ; variable declaration
2197
        sc      system_colors           ; variable declaration
2196
        ...                             ; somewhere one must call
2198
        ...                             ; somewhere one must call
2197
                                        ; this function with ecx=sc
2199
                                        ; this function with ecx=sc
2198
        mov     ecx, [sc.work_button_text]      ; read text color on
2200
        mov     ecx, [sc.work_button_text]      ; read text color on
2199
                                        ; buttin in working area
2201
                                        ; buttin in working area
2200
  * A program itself desides to use or not to use color table.
2202
  * A program itself desides to use or not to use color table.
2201
    For usage program must simply at calls to drawing functions select
2203
    For usage program must simply at calls to drawing functions select
2202
    color taken from the table.
2204
    color taken from the table.
2203
  * At change of the table of standard colors (by subfunction 2 with
2205
  * At change of the table of standard colors (by subfunction 2 with
2204
    the subsequent application of changes by subfunction 0 or
2206
    the subsequent application of changes by subfunction 0 or
2205
    at skin set by subfunction 8) the system sends to all windows
2207
    at skin set by subfunction 8) the system sends to all windows
2206
    redraw message (the event with code 1).
2208
    redraw message (the event with code 1).
2207
  * Color table can be viewed/changed interactively with
2209
  * Color table can be viewed/changed interactively with
2208
    the application 'desktop'.
2210
    the application 'desktop'.
2209
 
2211
 
2210
---------------------- Constants for registers: ----------------------
2212
---------------------- Constants for registers: ----------------------
2211
  eax - SF_STYLE_SETTINGS (48)
2213
  eax - SF_STYLE_SETTINGS (48)
2212
  ebx - SSF_GET_COLORS (3)
2214
  ebx - SSF_GET_COLORS (3)
2213
======================================================================
2215
======================================================================
2214
============ Function 48, subfunction 4 - get skin height. ===========
2216
============ Function 48, subfunction 4 - get skin height. ===========
2215
======================================================================
2217
======================================================================
2216
Parameters:
2218
Parameters:
2217
  * eax = 48 - function number
2219
  * eax = 48 - function number
2218
  * ebx = 4 - subfunction number
2220
  * ebx = 4 - subfunction number
2219
Returned value:
2221
Returned value:
2220
  * eax = skin height
2222
  * eax = skin height
2221
Remarks:
2223
Remarks:
2222
  * Skin height is defined as the height of a header
2224
  * Skin height is defined as the height of a header
2223
    of skinned windows.
2225
    of skinned windows.
2224
  * See also general structure of window in the description
2226
  * See also general structure of window in the description
2225
    of function 0.
2227
    of function 0.
2226
 
2228
 
2227
---------------------- Constants for registers: ----------------------
2229
---------------------- Constants for registers: ----------------------
2228
  eax - SF_STYLE_SETTINGS (48)
2230
  eax - SF_STYLE_SETTINGS (48)
2229
  ebx - SSF_GET_SKIN_HEIGHT (4)
2231
  ebx - SSF_GET_SKIN_HEIGHT (4)
2230
======================================================================
2232
======================================================================
2231
======== Function 48, subfunction 5 - get screen working area. =======
2233
======== Function 48, subfunction 5 - get screen working area. =======
2232
======================================================================
2234
======================================================================
2233
Parameters:
2235
Parameters:
2234
  * eax = 48 - function number
2236
  * eax = 48 - function number
2235
  * ebx = 5 - subfunction number
2237
  * ebx = 5 - subfunction number
2236
Returned value:
2238
Returned value:
2237
  * eax = [left]*65536 + [right]
2239
  * eax = [left]*65536 + [right]
2238
  * ebx = [top]*65536 + [bottom]
2240
  * ebx = [top]*65536 + [bottom]
2239
Remarks:
2241
Remarks:
2240
  * The screen working area defines position and coordinates of
2242
  * The screen working area defines position and coordinates of
2241
    a maximized window.
2243
    a maximized window.
2242
  * The screen working area in view of normal work is all screen
2244
  * The screen working area in view of normal work is all screen
2243
    without taskbar ('@taskbar' application).
2245
    without taskbar ('@taskbar' application).
2244
  * (left,top) are coordinates of the left upper corner,
2246
  * (left,top) are coordinates of the left upper corner,
2245
    (right,bottom) are coordinates of the right lower one.
2247
    (right,bottom) are coordinates of the right lower one.
2246
    Thus the size of working area on x axis can be calculated by
2248
    Thus the size of working area on x axis can be calculated by
2247
    formula right-left+1, on y axis - by formula bottom-right+1.
2249
    formula right-left+1, on y axis - by formula bottom-right+1.
2248
  * See also function 14,
2250
  * See also function 14,
2249
    to get sizes of all screen.
2251
    to get sizes of all screen.
2250
  * There is a pair function to set working area - subfunction 6.
2252
  * There is a pair function to set working area - subfunction 6.
2251
 
2253
 
2252
---------------------- Constants for registers: ----------------------
2254
---------------------- Constants for registers: ----------------------
2253
  eax - SF_STYLE_SETTINGS (48)
2255
  eax - SF_STYLE_SETTINGS (48)
2254
  ebx - SSF_GET_SCREEN_AREA (5)
2256
  ebx - SSF_GET_SCREEN_AREA (5)
2255
======================================================================
2257
======================================================================
2256
======== Function 48, subfunction 6 - set screen working area. =======
2258
======== Function 48, subfunction 6 - set screen working area. =======
2257
======================================================================
2259
======================================================================
2258
Parameters:
2260
Parameters:
2259
  * eax = 48 - function number
2261
  * eax = 48 - function number
2260
  * ebx = 6 - subfunction number
2262
  * ebx = 6 - subfunction number
2261
  * ecx = [left]*65536 + [right]
2263
  * ecx = [left]*65536 + [right]
2262
  * edx = [top]*65536 + [bottom]
2264
  * edx = [top]*65536 + [bottom]
2263
Returned value:
2265
Returned value:
2264
  * function does not return value
2266
  * function does not return value
2265
Remarks:
2267
Remarks:
2266
  * The screen working area defines position and coordinates of
2268
  * The screen working area defines position and coordinates of
2267
    a maximized window.
2269
    a maximized window.
2268
  * This function is used only by the application '@taskbar',
2270
  * This function is used only by the application '@taskbar',
2269
    which set working area to all screen without taskbar.
2271
    which set working area to all screen without taskbar.
2270
  * (left,top) are coordinates of the left upper corner,
2272
  * (left,top) are coordinates of the left upper corner,
2271
    (right,bottom) are coordinates of the right lower one.
2273
    (right,bottom) are coordinates of the right lower one.
2272
    Thus the size of working area on x axis can be calculated by
2274
    Thus the size of working area on x axis can be calculated by
2273
    formula right-left+1, on y axis - by formula bottom-right+1.
2275
    formula right-left+1, on y axis - by formula bottom-right+1.
2274
  * If 'left'>='right', x-coordinate of working area is not changed.
2276
  * If 'left'>='right', x-coordinate of working area is not changed.
2275
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2277
    If 'left'<0, 'left' will not be set. If 'right' is greater than or
2276
    equal to screen width, 'right' will not be set.
2278
    equal to screen width, 'right' will not be set.
2277
    Similarly on y axis.
2279
    Similarly on y axis.
2278
  * See also function 14,
2280
  * See also function 14,
2279
    to get sizes of all screen.
2281
    to get sizes of all screen.
2280
  * There is a pair function to get working area - subfunction 5.
2282
  * There is a pair function to get working area - subfunction 5.
2281
  * This function redraws the screen automatically,
2283
  * This function redraws the screen automatically,
2282
    updating coordinates and sizes of maximized windows.
2284
    updating coordinates and sizes of maximized windows.
2283
    The system sends to all windows redraw message (the event 1).
2285
    The system sends to all windows redraw message (the event 1).
2284
 
2286
 
2285
---------------------- Constants for registers: ----------------------
2287
---------------------- Constants for registers: ----------------------
2286
  eax - SF_STYLE_SETTINGS (48)
2288
  eax - SF_STYLE_SETTINGS (48)
2287
  ebx - SSF_SET_SCREEN_AREA (6)
2289
  ebx - SSF_SET_SCREEN_AREA (6)
2288
======================================================================
2290
======================================================================
2289
=========== Function 48, subfunction 7 - get skin margins. ===========
2291
=========== Function 48, subfunction 7 - get skin margins. ===========
2290
======================================================================
2292
======================================================================
2291
Returns the area of a header of a skinned window, intended for
2293
Returns the area of a header of a skinned window, intended for
2292
a text of a header.
2294
a text of a header.
2293
Parameters:
2295
Parameters:
2294
  * eax = 48 - function number
2296
  * eax = 48 - function number
2295
  * ebx = 7 - subfunction number
2297
  * ebx = 7 - subfunction number
2296
Returned value:
2298
Returned value:
2297
  * eax = [left]*65536 + [right]
2299
  * eax = [left]*65536 + [right]
2298
  * ebx = [top]*65536 + [bottom]
2300
  * ebx = [top]*65536 + [bottom]
2299
Remarks:
2301
Remarks:
2300
  * An application decides itself to use or not to use this function.
2302
  * An application decides itself to use or not to use this function.
2301
  * It is recommended to take into account returned value
2303
  * It is recommended to take into account returned value
2302
    of this function for choice of a place for drawing header text
2304
    of this function for choice of a place for drawing header text
2303
    (by function 4) or a substitute of header text
2305
    (by function 4) or a substitute of header text
2304
    (at the discretion of an application).
2306
    (at the discretion of an application).
2305
 
2307
 
2306
---------------------- Constants for registers: ----------------------
2308
---------------------- Constants for registers: ----------------------
2307
  eax - SF_STYLE_SETTINGS (48)
2309
  eax - SF_STYLE_SETTINGS (48)
2308
  ebx - SSF_GET_SKIN_MARGINS (7)
2310
  ebx - SSF_GET_SKIN_MARGINS (7)
2309
======================================================================
2311
======================================================================
2310
============= Function 48, subfunction 8 - set used skin. ============
2312
============= Function 48, subfunction 8 - set used skin. ============
2311
======================================================================
2313
======================================================================
2312
Parameters:
2314
Parameters:
2313
  * eax = 48 - function number
2315
  * eax = 48 - function number
2314
  * ebx = 8 - subfunction number
2316
  * ebx = 8 - subfunction number
2315
  * ecx = pointer to filename of the skin
2317
  * ecx = pointer to filename of the skin
2316
Returned value:
2318
Returned value:
2317
  * eax = 0 - success
2319
  * eax = 0 - success
2318
  * otherwise eax = file system error code; if file does not
2320
  * otherwise eax = file system error code; if file does not
2319
    contain valid skin, function returns error 3
2321
    contain valid skin, function returns error 3
2320
    (unknown file system).
2322
    (unknown file system).
2321
Remarks:
2323
Remarks:
2322
  * After successful skin loading the system sends to all windows
2324
  * After successful skin loading the system sends to all windows
2323
    redraw message (the event 1).
2325
    redraw message (the event 1).
2324
  * At booting the system reads skin from file 'default.skn'
2326
  * At booting the system reads skin from file 'default.skn'
2325
    on ramdisk.
2327
    on ramdisk.
2326
  * User can change the skin statically by creating hisself
2328
  * User can change the skin statically by creating hisself
2327
    'default.skn' or dynamically with the application 'desktop'.
2329
    'default.skn' or dynamically with the application 'desktop'.
2328
 
2330
 
2329
---------------------- Constants for registers: ----------------------
2331
---------------------- Constants for registers: ----------------------
2330
  eax - SF_STYLE_SETTINGS (48)
2332
  eax - SF_STYLE_SETTINGS (48)
2331
  ebx - SSF_SET_SKIN (8)
2333
  ebx - SSF_SET_SKIN (8)
2332
======================================================================
2334
======================================================================
2333
====== Function 48, subfunction 9 - get font smoothing setting. ======
2335
====== Function 48, subfunction 9 - get font smoothing setting. ======
2334
======================================================================
2336
======================================================================
2335
Parameters:
2337
Parameters:
2336
  * eax = 48 - function number
2338
  * eax = 48 - function number
2337
  * ebx = 9 - subfunction number
2339
  * ebx = 9 - subfunction number
2338
Returned value:
2340
Returned value:
2339
  * eax = 2 - subpixel, 1 - anti-aliasing, 0 - off
2341
  * eax = 2 - subpixel, 1 - anti-aliasing, 0 - off
2340
 
2342
 
2341
---------------------- Constants for registers: ----------------------
2343
---------------------- Constants for registers: ----------------------
2342
  eax - SF_STYLE_SETTINGS (48)
2344
  eax - SF_STYLE_SETTINGS (48)
2343
  ebx - SSF_GET_FONT_SMOOTH (9)
2345
  ebx - SSF_GET_FONT_SMOOTH (9)
2344
======================================================================
2346
======================================================================
2345
========== Function 48, subfunction 10 - set font smoothing. =========
2347
========== Function 48, subfunction 10 - set font smoothing. =========
2346
======================================================================
2348
======================================================================
2347
Parameters:
2349
Parameters:
2348
  * eax = 48 - function number
2350
  * eax = 48 - function number
2349
  * ebx = 10 - subfunction number
2351
  * ebx = 10 - subfunction number
2350
  * cl  = 2 - subpixel, 1 - anti-aliasing, 0 - off
2352
  * cl  = 2 - subpixel, 1 - anti-aliasing, 0 - off
2351
 
2353
 
2352
---------------------- Constants for registers: ----------------------
2354
---------------------- Constants for registers: ----------------------
2353
  eax - SF_STYLE_SETTINGS (48)
2355
  eax - SF_STYLE_SETTINGS (48)
2354
  ebx - SSF_SET_FONT_SMOOTH (10)
2356
  ebx - SSF_SET_FONT_SMOOTH (10)
2355
======================================================================
2357
======================================================================
2356
============ Function 48, subfunction 11 - get font size. ============
2358
============ Function 48, subfunction 11 - get font size. ============
2357
======================================================================
2359
======================================================================
2358
Parameters:
2360
Parameters:
2359
  * eax = 48 - function number
2361
  * eax = 48 - function number
2360
  * ebx = 9 - subfunction number
2362
  * ebx = 9 - subfunction number
2361
Returned value:
2363
Returned value:
2362
  * eax = current font height in pixels
2364
  * eax = current font height in pixels
2363
 
2365
 
2364
---------------------- Constants for registers: ----------------------
2366
---------------------- Constants for registers: ----------------------
2365
  eax - SF_STYLE_SETTINGS (48)
2367
  eax - SF_STYLE_SETTINGS (48)
2366
  ebx - SSF_GET_FONT_SIZE (11)
2368
  ebx - SSF_GET_FONT_SIZE (11)
2367
======================================================================
2369
======================================================================
2368
============ Function 48, subfunction 12 - set font size. ============
2370
============ Function 48, subfunction 12 - set font size. ============
2369
======================================================================
2371
======================================================================
2370
Parameters:
2372
Parameters:
2371
  * eax = 48 - function number
2373
  * eax = 48 - function number
2372
  * ebx = 10 - subfunction number
2374
  * ebx = 10 - subfunction number
2373
  * cl  = new font height in pixels
2375
  * cl  = new font height in pixels
2374
 
2376
 
2375
---------------------- Constants for registers: ----------------------
2377
---------------------- Constants for registers: ----------------------
2376
  eax - SF_STYLE_SETTINGS (48)
2378
  eax - SF_STYLE_SETTINGS (48)
2377
  ebx - SSF_SET_FONT_SIZE (12)
2379
  ebx - SSF_SET_FONT_SIZE (12)
2378
======================================================================
2380
======================================================================
2379
=========== Function 49 - Advanced Power Management (APM). ===========
2381
=========== Function 49 - Advanced Power Management (APM). ===========
2380
======================================================================
2382
======================================================================
2381
Parameters:
2383
Parameters:
2382
  * eax = 49 - function number
2384
  * eax = 49 - function number
2383
  * dx = number of the APM function
2385
  * dx = number of the APM function
2384
    (analogue of ax in APM specification)
2386
    (analogue of ax in APM specification)
2385
  * bx, cx = parameters of the APM function
2387
  * bx, cx = parameters of the APM function
2386
Returned value:
2388
Returned value:
2387
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2389
  * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
2388
    are set according to the APM specification
2390
    are set according to the APM specification
2389
  * high halves of 32-bit registers eax, ebx, ecx,
2391
  * high halves of 32-bit registers eax, ebx, ecx,
2390
    edx, esi, edi are destroyed
2392
    edx, esi, edi are destroyed
2391
Remarks:
2393
Remarks:
2392
  * APM 1.2 specification is described in the document
2394
  * APM 1.2 specification is described in the document
2393
    "Advanced Power Management (APM) BIOS Specification"
2395
    "Advanced Power Management (APM) BIOS Specification"
2394
    (Revision 1.2), available at
2396
    (Revision 1.2), available at
2395
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2397
    http://www.microsoft.com/whdc/archive/amp_12.mspx;
2396
    besides it is included in famous Interrupt List by Ralf Brown
2398
    besides it is included in famous Interrupt List by Ralf Brown
2397
    (http://www.pobox.com/~ralf/files.html,
2399
    (http://www.pobox.com/~ralf/files.html,
2398
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2400
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
2399
 
2401
 
2400
---------------------- Constants for registers: ----------------------
2402
---------------------- Constants for registers: ----------------------
2401
  eax - SF_APM (49)
2403
  eax - SF_APM (49)
2402
======================================================================
2404
======================================================================
2403
=================== Function 50 - set window shape. ==================
2405
=================== Function 50 - set window shape. ==================
2404
======================================================================
2406
======================================================================
2405
Normal windows have rectangular shape. This function can give to
2407
Normal windows have rectangular shape. This function can give to
2406
a window any shape. The shape is given by a set of points inside
2408
a window any shape. The shape is given by a set of points inside
2407
the base rectangle belonging to a window. Position and coordinates
2409
the base rectangle belonging to a window. Position and coordinates
2408
of the base rectangle are set by function 0
2410
of the base rectangle are set by function 0
2409
and changed by function 67.
2411
and changed by function 67.
2410
 
2412
 
2411
--------------------------- Set shape data ---------------------------
2413
--------------------------- Set shape data ---------------------------
2412
Parameters:
2414
Parameters:
2413
  * eax = 50 - function number
2415
  * eax = 50 - function number
2414
  * ebx = 0 - subfunction number
2416
  * ebx = 0 - subfunction number
2415
  * ecx = pointer to shape data (array of bytes 0/1)
2417
  * ecx = pointer to shape data (array of bytes 0/1)
2416
Returned value:
2418
Returned value:
2417
  * function does not return value
2419
  * function does not return value
2418
 
2420
 
2419
-------------------------- Set shape scale ---------------------------
2421
-------------------------- Set shape scale ---------------------------
2420
Parameters:
2422
Parameters:
2421
  * eax = 50 - function number
2423
  * eax = 50 - function number
2422
  * ebx = 1 - subfunction number
2424
  * ebx = 1 - subfunction number
2423
  * ecx sets a scale: each byte of data defines
2425
  * ecx sets a scale: each byte of data defines
2424
    (2^scale)*(2^scale) pixels
2426
    (2^scale)*(2^scale) pixels
2425
Returned value:
2427
Returned value:
2426
  * function does not return value
2428
  * function does not return value
2427
Remarks:
2429
Remarks:
2428
  * Default scale is 0 (scale factor is 1). If in the shape data
2430
  * Default scale is 0 (scale factor is 1). If in the shape data
2429
    one byte corresponds to one pixel, there is no necessity
2431
    one byte corresponds to one pixel, there is no necessity
2430
    to set scale.
2432
    to set scale.
2431
  * Let's designate xsize = window width (in pixels), ysize = height;
2433
  * Let's designate xsize = window width (in pixels), ysize = height;
2432
    pay attention, that they are one pixel more than defined by
2434
    pay attention, that they are one pixel more than defined by
2433
    functions 0, 67.
2435
    functions 0, 67.
2434
  * On definition of scale xsize and ysize must be divisible
2436
  * On definition of scale xsize and ysize must be divisible
2435
    on 2^scale.
2437
    on 2^scale.
2436
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2438
  * Byte of data on offset 'a' must be 0/1 and defines belonging
2437
    to a window of square with the side 2^scale (if scale=0,
2439
    to a window of square with the side 2^scale (if scale=0,
2438
    this is one pixel) and coordinates of the left upper corner
2440
    this is one pixel) and coordinates of the left upper corner
2439
    (a mod (xsize shr scale), a div (xsize shr scale))
2441
    (a mod (xsize shr scale), a div (xsize shr scale))
2440
  * Data size: (xsize shr scale)*(ysize shr scale).
2442
  * Data size: (xsize shr scale)*(ysize shr scale).
2441
  * Data must be presented in the memory and not change
2443
  * Data must be presented in the memory and not change
2442
    after set of shape.
2444
    after set of shape.
2443
  * The system views the shape data at every window redraw by
2445
  * The system views the shape data at every window redraw by
2444
    function 0.
2446
    function 0.
2445
  * The call of subfunction 0 with NULL pointer results in return
2447
  * The call of subfunction 0 with NULL pointer results in return
2446
    to the rectangular shape.
2448
    to the rectangular shape.
2447
 
2449
 
2448
---------------------- Constants for registers: ----------------------
2450
---------------------- Constants for registers: ----------------------
2449
  eax - SF_SET_WINDOW_SHAPE (50)
2451
  eax - SF_SET_WINDOW_SHAPE (50)
2450
======================================================================
2452
======================================================================
2451
==================== Function 51 - create thread. ====================
2453
==================== Function 51 - create thread. ====================
2452
======================================================================
2454
======================================================================
2453
Parameters:
2455
Parameters:
2454
  * eax = 51 - function number
2456
  * eax = 51 - function number
2455
  * ebx = 1 - unique subfunction
2457
  * ebx = 1 - unique subfunction
2456
  * ecx = address of thread entry point (starting eip)
2458
  * ecx = address of thread entry point (starting eip)
2457
  * edx = pointer to thread stack (starting esp)
2459
  * edx = pointer to thread stack (starting esp)
2458
Returned value:
2460
Returned value:
2459
  * eax = -1 - error (there is too many threads)
2461
  * eax = -1 - error (there is too many threads)
2460
  * otherwise eax = TID - thread identifier
2462
  * otherwise eax = TID - thread identifier
2461
 
2463
 
2462
---------------------- Constants for registers: ----------------------
2464
---------------------- Constants for registers: ----------------------
2463
  eax - SF_CREATE_THREAD (51)
2465
  eax - SF_CREATE_THREAD (51)
2464
======================================================================
2466
======================================================================
2465
==================== Function 54, subfunction 0 ======================
2467
==================== Function 54, subfunction 0 ======================
2466
============== Get the number of slots in the clipboard. =============
2468
============== Get the number of slots in the clipboard. =============
2467
======================================================================
2469
======================================================================
2468
Parameters:
2470
Parameters:
2469
  * eax = 54 - function number
2471
  * eax = 54 - function number
2470
  * ebx = 0 - subfunction number
2472
  * ebx = 0 - subfunction number
2471
Returned value:
2473
Returned value:
2472
  * eax = slots in the clipboard
2474
  * eax = slots in the clipboard
2473
  * eax = -1 - main list area not found
2475
  * eax = -1 - main list area not found
2474
 
2476
 
2475
---------------------- Constants for registers: ----------------------
2477
---------------------- Constants for registers: ----------------------
2476
  eax - SF_CLIPBOARD (54)
2478
  eax - SF_CLIPBOARD (54)
2477
  ebx - SSF_GET_SLOT_COUNT (0)
2479
  ebx - SSF_GET_SLOT_COUNT (0)
2478
======================================================================
2480
======================================================================
2479
==================== Function 54, subfunction 1 ======================
2481
==================== Function 54, subfunction 1 ======================
2480
================= Read the data from the clipboard. ==================
2482
================= Read the data from the clipboard. ==================
2481
======================================================================
2483
======================================================================
2482
Parameters:
2484
Parameters:
2483
  * eax = 54 - function number
2485
  * eax = 54 - function number
2484
  * ebx = 1 - subfunction number
2486
  * ebx = 1 - subfunction number
2485
  * eсx = slot number
2487
  * eсx = slot number
2486
Returned value:
2488
Returned value:
2487
  * eax = if successful - pointer to a memory with data
2489
  * eax = if successful - pointer to a memory with data
2488
  * eax = 1 - error
2490
  * eax = 1 - error
2489
  * eax = -1 - main list area not found
2491
  * eax = -1 - main list area not found
2490
 
2492
 
2491
---------------------- Constants for registers: ----------------------
2493
---------------------- Constants for registers: ----------------------
2492
  eax - SF_CLIPBOARD (54)
2494
  eax - SF_CLIPBOARD (54)
2493
  ebx - SSF_READ_CB (1)
2495
  ebx - SSF_READ_CB (1)
2494
======================================================================
2496
======================================================================
2495
==================== Function 54, subfunction 2 ======================
2497
==================== Function 54, subfunction 2 ======================
2496
================= Write the data to the clipboard. ===================
2498
================= Write the data to the clipboard. ===================
2497
======================================================================
2499
======================================================================
2498
Parameters:
2500
Parameters:
2499
  * eax = 54 - function number
2501
  * eax = 54 - function number
2500
  * ebx = 2 - subfunction number
2502
  * ebx = 2 - subfunction number
2501
  * eсx = the number of bytes to be copied
2503
  * eсx = the number of bytes to be copied
2502
  * edx = a pointer to a buffer for data to be copied
2504
  * edx = a pointer to a buffer for data to be copied
2503
Returned value:
2505
Returned value:
2504
  * eax = 0 - success
2506
  * eax = 0 - success
2505
  * eax = 1 - error
2507
  * eax = 1 - error
2506
  * eax = -1 - main list area not found
2508
  * eax = -1 - main list area not found
2507
 
2509
 
2508
---------------------- Constants for registers: ----------------------
2510
---------------------- Constants for registers: ----------------------
2509
  eax - SF_CLIPBOARD (54)
2511
  eax - SF_CLIPBOARD (54)
2510
  ebx - SSF_WRITE_CB (2)
2512
  ebx - SSF_WRITE_CB (2)
2511
======================================================================
2513
======================================================================
2512
===================== Function 54, subfunction 3 =====================
2514
===================== Function 54, subfunction 3 =====================
2513
================ Delete the last slot in the clipboard ===============
2515
================ Delete the last slot in the clipboard ===============
2514
======================================================================
2516
======================================================================
2515
Parameters:
2517
Parameters:
2516
  * eax = 54 - function number
2518
  * eax = 54 - function number
2517
  * ebx = 3 - subfunction number
2519
  * ebx = 3 - subfunction number
2518
Returned value:
2520
Returned value:
2519
  * eax = 0 - success
2521
  * eax = 0 - success
2520
  * eax = 1 - error
2522
  * eax = 1 - error
2521
  * eax = -1 - main list area not found
2523
  * eax = -1 - main list area not found
2522
 
2524
 
2523
---------------------- Constants for registers: ----------------------
2525
---------------------- Constants for registers: ----------------------
2524
  eax - SF_CLIPBOARD (54)
2526
  eax - SF_CLIPBOARD (54)
2525
  ebx - SSF_DEL_SLOT (3)
2527
  ebx - SSF_DEL_SLOT (3)
2526
======================================================================
2528
======================================================================
2527
===================== Function 54, subfunction 4 =====================
2529
===================== Function 54, subfunction 4 =====================
2528
===================== Alarm reset the lock buffer ====================
2530
===================== Alarm reset the lock buffer ====================
2529
======================================================================
2531
======================================================================
2530
Parameters:
2532
Parameters:
2531
  * eax = 54 - function number
2533
  * eax = 54 - function number
2532
  * ebx = 4 - subfunction number
2534
  * ebx = 4 - subfunction number
2533
Returned value:
2535
Returned value:
2534
  * eax = 0 - success
2536
  * eax = 0 - success
2535
  * eax = -1 - main list area not found or no blocking
2537
  * eax = -1 - main list area not found or no blocking
2536
Remarks:
2538
Remarks:
2537
  * Used in exceptional cases, where no responsible or killed
2539
  * Used in exceptional cases, where no responsible or killed
2538
    application blocked the clipboard operations.
2540
    application blocked the clipboard operations.
2539
 
2541
 
2540
---------------------- Constants for registers: ----------------------
2542
---------------------- Constants for registers: ----------------------
2541
  eax - SF_CLIPBOARD (54)
2543
  eax - SF_CLIPBOARD (54)
2542
  ebx - SSF_UNLOCK_BUFFER (4)
2544
  ebx - SSF_UNLOCK_BUFFER (4)
2543
======================================================================
2545
======================================================================
2544
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2546
 Function 55, subfunction 55 - begin to play data on built-in speaker.
2545
======================================================================
2547
======================================================================
2546
Parameters:
2548
Parameters:
2547
  * eax = 55 - function number
2549
  * eax = 55 - function number
2548
  * ebx = 55 - subfunction number
2550
  * ebx = 55 - subfunction number
2549
  * esi = pointer to data
2551
  * esi = pointer to data
2550
Returned value:
2552
Returned value:
2551
  * eax = 0 - success
2553
  * eax = 0 - success
2552
  * eax = 55 - error (speaker is off or busy)
2554
  * eax = 55 - error (speaker is off or busy)
2553
Data is an array of items with variable length.
2555
Data is an array of items with variable length.
2554
Format of each item is defined by first byte:
2556
Format of each item is defined by first byte:
2555
  * 0 = end of data
2557
  * 0 = end of data
2556
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2558
  * 1..0x80 = sets sound duration on 1/100 of second; sound note
2557
    is defined by immediate value of frequency
2559
    is defined by immediate value of frequency
2558
    * following word (2 bytes) contains frequency divider;
2560
    * following word (2 bytes) contains frequency divider;
2559
      frequency is defined as 1193180/divider
2561
      frequency is defined as 1193180/divider
2560
  * 0x81 = invalid
2562
  * 0x81 = invalid
2561
  * 0x82..0xFF = note is defined by octave and number:
2563
  * 0x82..0xFF = note is defined by octave and number:
2562
    * duration in 1/100 of second = (first byte)-0x81
2564
    * duration in 1/100 of second = (first byte)-0x81
2563
    * there is one more byte;
2565
    * there is one more byte;
2564
    * (second byte)=0xFF - delay
2566
    * (second byte)=0xFF - delay
2565
    * otherwise it looks like a*0x10+b, where b=number of the note in
2567
    * otherwise it looks like a*0x10+b, where b=number of the note in
2566
      an octave from 1 to 12, a=number of octave (beginning from 0)
2568
      an octave from 1 to 12, a=number of octave (beginning from 0)
2567
Remarks:
2569
Remarks:
2568
  * Speaker play can be disabled/enabled by
2570
  * Speaker play can be disabled/enabled by
2569
    subfunction 8 of function 18.
2571
    subfunction 8 of function 18.
2570
  * Function returns control, having informed the system
2572
  * Function returns control, having informed the system
2571
    an information on request. Play itself goes independently from
2573
    an information on request. Play itself goes independently from
2572
    the program.
2574
    the program.
2573
  * The data must be kept in the memory at least up to the end
2575
  * The data must be kept in the memory at least up to the end
2574
    of play.
2576
    of play.
2575
 
2577
 
2576
---------------------- Constants for registers: ----------------------
2578
---------------------- Constants for registers: ----------------------
2577
  eax - SF_SPEAKER_PLAY (55)
2579
  eax - SF_SPEAKER_PLAY (55)
2578
======================================================================
2580
======================================================================
2579
======================= Function 57 - PCI BIOS. ======================
2581
======================= Function 57 - PCI BIOS. ======================
2580
======================================================================
2582
======================================================================
2581
Parameters:
2583
Parameters:
2582
  * eax = 57 - function number
2584
  * eax = 57 - function number
2583
  * ebp corresponds to al in PCI BIOS specification
2585
  * ebp corresponds to al in PCI BIOS specification
2584
  * other registers are set according to PCI BIOS specification
2586
  * other registers are set according to PCI BIOS specification
2585
Returned value:
2587
Returned value:
2586
  * CF is undefined
2588
  * CF is undefined
2587
  * other registers are set according to PCI BIOS specification
2589
  * other registers are set according to PCI BIOS specification
2588
Remarks:
2590
Remarks:
2589
  * Many effects of this function can be also achieved with
2591
  * Many effects of this function can be also achieved with
2590
    corresponding subfunctions of function 62.
2592
    corresponding subfunctions of function 62.
2591
  * The function calls PCI32 BIOS extension, documented e.g. in
2593
  * The function calls PCI32 BIOS extension, documented e.g. in
2592
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2594
    http://alpha1.dyns.net/files/PCI/bios21.pdf.
2593
  * If BIOS does not support this extension, its behavior is emulated
2595
  * If BIOS does not support this extension, its behavior is emulated
2594
    (through kernel-mode analogues of subfunctions of function 62).
2596
    (through kernel-mode analogues of subfunctions of function 62).
2595
 
2597
 
2596
---------------------- Constants for registers: ----------------------
2598
---------------------- Constants for registers: ----------------------
2597
  eax - SF_PCI_BIOS (57)
2599
  eax - SF_PCI_BIOS (57)
2598
======================================================================
2600
======================================================================
2599
========== Function 60 - Inter Process Communication (IPC). ==========
2601
========== Function 60 - Inter Process Communication (IPC). ==========
2600
======================================================================
2602
======================================================================
2601
IPC is used for message dispatching from one process/thread to
2603
IPC is used for message dispatching from one process/thread to
2602
another. Previously it is necessary to agree how to interpret
2604
another. Previously it is necessary to agree how to interpret
2603
the concrete message.
2605
the concrete message.
2604
 
2606
 
2605
----------- Subfunction 1 - set the area for IPC receiving -----------
2607
----------- Subfunction 1 - set the area for IPC receiving -----------
2606
Is called by process-receiver.
2608
Is called by process-receiver.
2607
Parameters:
2609
Parameters:
2608
  * eax = 60 - function number
2610
  * eax = 60 - function number
2609
  * ebx = 1 - subfunction number
2611
  * ebx = 1 - subfunction number
2610
  * ecx = pointer to the buffer
2612
  * ecx = pointer to the buffer
2611
  * edx = size of the buffer
2613
  * edx = size of the buffer
2612
Returned value:
2614
Returned value:
2613
  * eax = 0 - always success
2615
  * eax = 0 - always success
2614
Format of IPC-buffer:
2616
Format of IPC-buffer:
2615
  * +0: dword: if nonzero, buffer is considered locked;
2617
  * +0: dword: if nonzero, buffer is considered locked;
2616
    lock/unlock the buffer, when you work with it and need that
2618
    lock/unlock the buffer, when you work with it and need that
2617
    buffer data are not changed from outside (no new messages)
2619
    buffer data are not changed from outside (no new messages)
2618
  * +4: dword: occupied place in the buffer (in bytes)
2620
  * +4: dword: occupied place in the buffer (in bytes)
2619
  * +8: first message
2621
  * +8: first message
2620
  * +8+n: second message
2622
  * +8+n: second message
2621
  * ...
2623
  * ...
2622
Format of a message:
2624
Format of a message:
2623
  * +0: dword: PID of sender
2625
  * +0: dword: PID of sender
2624
  * +4: dword: message length (not including this header)
2626
  * +4: dword: message length (not including this header)
2625
  * +8: n*byte: message data
2627
  * +8: n*byte: message data
2626
 
2628
 
2627
------------------ Subfunction 2 - send IPC message ------------------
2629
------------------ Subfunction 2 - send IPC message ------------------
2628
Is called by process-sender.
2630
Is called by process-sender.
2629
Parameters:
2631
Parameters:
2630
  * eax = 60 - function number
2632
  * eax = 60 - function number
2631
  * ebx = 2 - subfunction number
2633
  * ebx = 2 - subfunction number
2632
  * ecx = PID of receiver
2634
  * ecx = PID of receiver
2633
  * edx = pointer to the message data
2635
  * edx = pointer to the message data
2634
  * esi = message length (in bytes)
2636
  * esi = message length (in bytes)
2635
Returned value:
2637
Returned value:
2636
  * eax = 0 - success
2638
  * eax = 0 - success
2637
  * eax = 1 - the receiver has not defined buffer for IPC messages
2639
  * eax = 1 - the receiver has not defined buffer for IPC messages
2638
    (can be, still have no time,
2640
    (can be, still have no time,
2639
    and can be, this is not right process)
2641
    and can be, this is not right process)
2640
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2642
  * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
2641
  * eax = 3 - overflow of IPC-buffer of the receiver
2643
  * eax = 3 - overflow of IPC-buffer of the receiver
2642
  * eax = 4 - process/thread with such PID does not exist
2644
  * eax = 4 - process/thread with such PID does not exist
2643
Remarks:
2645
Remarks:
2644
  * Immediately after writing of IPC-message to the buffer the system
2646
  * Immediately after writing of IPC-message to the buffer the system
2645
    sends to the receiver the event with code 7 (see event codes).
2647
    sends to the receiver the event with code 7 (see event codes).
2646
 
2648
 
2647
---------------------- Constants for registers: ----------------------
2649
---------------------- Constants for registers: ----------------------
2648
  eax - SF_IPC (60)
2650
  eax - SF_IPC (60)
2649
  ebx - SSF_SET_AREA (1), SSF_SEND_MESSAGE (2)
2651
  ebx - SSF_SET_AREA (1), SSF_SEND_MESSAGE (2)
2650
======================================================================
2652
======================================================================
2651
==== Function 61 - get parameters for the direct graphics access. ====
2653
==== Function 61 - get parameters for the direct graphics access. ====
2652
======================================================================
2654
======================================================================
2653
The data of the graphics screen (the memory area which displays
2655
The data of the graphics screen (the memory area which displays
2654
screen contents) are accessible to a program directly, without
2656
screen contents) are accessible to a program directly, without
2655
any system calls, through the selector gs:
2657
any system calls, through the selector gs:
2656
        mov     eax, [gs:0]
2658
        mov     eax, [gs:0]
2657
places in eax the first dword of the buffer, which contains
2659
places in eax the first dword of the buffer, which contains
2658
information on color of the left upper point (and, possibly, colors
2660
information on color of the left upper point (and, possibly, colors
2659
of several following).
2661
of several following).
2660
        mov     [gs:0], eax
2662
        mov     [gs:0], eax
2661
by work in VESA modes with LFB sets color of the left upper point
2663
by work in VESA modes with LFB sets color of the left upper point
2662
(and, possibly, colors of several following).
2664
(and, possibly, colors of several following).
2663
To interpret the data of graphics screen program needs to know
2665
To interpret the data of graphics screen program needs to know
2664
some parameters, returning by this function.
2666
some parameters, returning by this function.
2665
Remarks:
2667
Remarks:
2666
  * Graphics parameters changes very seldom at work,
2668
  * Graphics parameters changes very seldom at work,
2667
    namely, only in cases, when user works with the application VRR.
2669
    namely, only in cases, when user works with the application VRR.
2668
  * At videomode change the system redraws all windows (event
2670
  * At videomode change the system redraws all windows (event
2669
    with code 1) and redraws the background (event 5).
2671
    with code 1) and redraws the background (event 5).
2670
    Same events occur in other cases too, which meet much more often,
2672
    Same events occur in other cases too, which meet much more often,
2671
    than videomode change.
2673
    than videomode change.
2672
  * By operation in videomodes with LFB the selector gs points to
2674
  * By operation in videomodes with LFB the selector gs points to
2673
    LFB itself, so reading/writing on gs result directly in
2675
    LFB itself, so reading/writing on gs result directly in
2674
    change of screen contents. By operation in videomodes without
2676
    change of screen contents. By operation in videomodes without
2675
    LFB gs points to some data area in the kernel, and all functions
2677
    LFB gs points to some data area in the kernel, and all functions
2676
    of screen output fulfil honesty double operation on writing
2678
    of screen output fulfil honesty double operation on writing
2677
    directly to the screen and writing to this buffer. In result
2679
    directly to the screen and writing to this buffer. In result
2678
    at reading contents of this buffer the results correspond to
2680
    at reading contents of this buffer the results correspond to
2679
    screen contents (with, generally speaking, large color
2681
    screen contents (with, generally speaking, large color
2680
    resolution), and writing is ignored.
2682
    resolution), and writing is ignored.
2681
    One exception is the mode 320*200, for which main loop of the
2683
    One exception is the mode 320*200, for which main loop of the
2682
    system thread updates the screen according to mouse movements.
2684
    system thread updates the screen according to mouse movements.
2683
 
2685
 
2684
------------------------- Screen resolution --------------------------
2686
------------------------- Screen resolution --------------------------
2685
Parameters:
2687
Parameters:
2686
  * eax = 61 - function number
2688
  * eax = 61 - function number
2687
  * ebx = 1 - subfunction number
2689
  * ebx = 1 - subfunction number
2688
Returned value:
2690
Returned value:
2689
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
2691
  * eax = [resolution on x axis]*65536 + [resolution on y axis]
2690
Remarks:
2692
Remarks:
2691
  * One can use function 14 paying attention that
2693
  * One can use function 14 paying attention that
2692
    it returns sizes on 1 pixel less. It is fully equivalent way.
2694
    it returns sizes on 1 pixel less. It is fully equivalent way.
2693
 
2695
 
2694
---------------------- Number of bits per pixel ----------------------
2696
---------------------- Number of bits per pixel ----------------------
2695
Parameters:
2697
Parameters:
2696
  * eax = 61 - function number
2698
  * eax = 61 - function number
2697
  * ebx = 2 - subfunction number
2699
  * ebx = 2 - subfunction number
2698
Returned value:
2700
Returned value:
2699
  * eax = number of bits per pixel (24 or 32)
2701
  * eax = number of bits per pixel (24 or 32)
2700
 
2702
 
2701
-------------------- Number of bytes per scanline --------------------
2703
-------------------- Number of bytes per scanline --------------------
2702
Parameters:
2704
Parameters:
2703
  * eax = 61 - function number
2705
  * eax = 61 - function number
2704
  * ebx = 3 - subfunction number
2706
  * ebx = 3 - subfunction number
2705
Returned value:
2707
Returned value:
2706
  * eax = number of bytes occupied by one scanline
2708
  * eax = number of bytes occupied by one scanline
2707
    (horizontal line on the screen)
2709
    (horizontal line on the screen)
2708
 
2710
 
2709
---------------------- Constants for registers: ----------------------
2711
---------------------- Constants for registers: ----------------------
2710
  eax - SF_GET_GRAPHICAL_PARAMS (61)
2712
  eax - SF_GET_GRAPHICAL_PARAMS (61)
2711
  ebx - SSF_SCREEN_SIZE (1), SSF_BITS_PER_PIXEL (2),
2713
  ebx - SSF_SCREEN_SIZE (1), SSF_BITS_PER_PIXEL (2),
2712
    SSF_BYTES_PER_LINE (3)
2714
    SSF_BYTES_PER_LINE (3)
2713
======================================================================
2715
======================================================================
2714
===== Function 62, subfunction 0 - get version of PCI-interface. =====
2716
===== Function 62, subfunction 0 - get version of PCI-interface. =====
2715
======================================================================
2717
======================================================================
2716
Parameters:
2718
Parameters:
2717
  * eax = 62 - function number
2719
  * eax = 62 - function number
2718
  * bl = 0 - subfunction number
2720
  * bl = 0 - subfunction number
2719
Returned value:
2721
Returned value:
2720
  * eax = -1 - PCI access is disabled; otherwise
2722
  * eax = -1 - PCI access is disabled; otherwise
2721
  * ah.al = version of PCI-interface (ah=version, al=subversion)
2723
  * ah.al = version of PCI-interface (ah=version, al=subversion)
2722
  * high word of eax is zeroed
2724
  * high word of eax is zeroed
2723
Remarks:
2725
Remarks:
2724
  * Previously low-level access to PCI for applications must be
2726
  * Previously low-level access to PCI for applications must be
2725
    enabled by subfunction 12 of function 21.
2727
    enabled by subfunction 12 of function 21.
2726
  * If PCI BIOS is not supported, the value of ax is undefined.
2728
  * If PCI BIOS is not supported, the value of ax is undefined.
2727
 
2729
 
2728
---------------------- Constants for registers: ----------------------
2730
---------------------- Constants for registers: ----------------------
2729
  eax - SF_PCI (62)
2731
  eax - SF_PCI (62)
2730
  ebx - SSF_GET_VERSION (0)
2732
  ebx - SSF_GET_VERSION (0)
2731
======================================================================
2733
======================================================================
2732
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
2734
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
2733
======================================================================
2735
======================================================================
2734
Parameters:
2736
Parameters:
2735
  * eax = 62 - function number
2737
  * eax = 62 - function number
2736
  * bl = 1 - subfunction number
2738
  * bl = 1 - subfunction number
2737
Returned value:
2739
Returned value:
2738
  * eax = -1 - access to PCI is disabled; otherwise
2740
  * eax = -1 - access to PCI is disabled; otherwise
2739
  * al = number of the last PCI-bus; other bytes of eax are destroyed
2741
  * al = number of the last PCI-bus; other bytes of eax are destroyed
2740
Remarks:
2742
Remarks:
2741
  * Previously low-level access to PCI for applications must be
2743
  * Previously low-level access to PCI for applications must be
2742
    enabled by subfunction 12 of function 21.
2744
    enabled by subfunction 12 of function 21.
2743
  * If PCI BIOS is not supported, the value of ax is undefined.
2745
  * If PCI BIOS is not supported, the value of ax is undefined.
2744
 
2746
 
2745
---------------------- Constants for registers: ----------------------
2747
---------------------- Constants for registers: ----------------------
2746
  eax - SF_PCI (62)
2748
  eax - SF_PCI (62)
2747
  ebx - SSF_GET_LAST_BUS (1)
2749
  ebx - SSF_GET_LAST_BUS (1)
2748
======================================================================
2750
======================================================================
2749
===================== Function 62, subfunction 2 =====================
2751
===================== Function 62, subfunction 2 =====================
2750
===== Get mechanism of addressing to the PCI configuration space. ====
2752
===== Get mechanism of addressing to the PCI configuration space. ====
2751
======================================================================
2753
======================================================================
2752
Parameters:
2754
Parameters:
2753
  * eax = 62 - function number
2755
  * eax = 62 - function number
2754
  * bl = 2 - subfunction number
2756
  * bl = 2 - subfunction number
2755
Returned value:
2757
Returned value:
2756
  * eax = -1 - access to PCI is disabled; otherwise
2758
  * eax = -1 - access to PCI is disabled; otherwise
2757
  * al = mechanism (1 or 2); other bytes of eax are destroyed
2759
  * al = mechanism (1 or 2); other bytes of eax are destroyed
2758
Remarks:
2760
Remarks:
2759
  * Previously low-level access to PCI for applications must be
2761
  * Previously low-level access to PCI for applications must be
2760
    enabled by subfunction 12 of function 21.
2762
    enabled by subfunction 12 of function 21.
2761
  * Addressing mechanism is selected depending on
2763
  * Addressing mechanism is selected depending on
2762
    equipment characteristics.
2764
    equipment characteristics.
2763
  * Subfunctions of read and write work automatically
2765
  * Subfunctions of read and write work automatically
2764
    with the selected mechanism.
2766
    with the selected mechanism.
2765
 
2767
 
2766
---------------------- Constants for registers: ----------------------
2768
---------------------- Constants for registers: ----------------------
2767
  eax - SF_PCI (62)
2769
  eax - SF_PCI (62)
2768
  ebx - SSF_GET_ADRR_MODE (2)
2770
  ebx - SSF_GET_ADRR_MODE (2)
2769
======================================================================
2771
======================================================================
2770
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
2772
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
2771
======================================================================
2773
======================================================================
2772
Parameters:
2774
Parameters:
2773
  * eax = 62 - function number
2775
  * eax = 62 - function number
2774
  * bl = 4 - read byte
2776
  * bl = 4 - read byte
2775
  * bl = 5 - read word
2777
  * bl = 5 - read word
2776
  * bl = 6 - read dword
2778
  * bl = 6 - read dword
2777
  * bh = number of PCI-bus
2779
  * bh = number of PCI-bus
2778
  * ch = dddddfff, where ddddd = number of the device on the bus,
2780
  * ch = dddddfff, where ddddd = number of the device on the bus,
2779
    fff = function number of device
2781
    fff = function number of device
2780
  * cl = number of register (must be even for bl=5,
2782
  * cl = number of register (must be even for bl=5,
2781
    divisible by 4 for bl=6)
2783
    divisible by 4 for bl=6)
2782
Returned value:
2784
Returned value:
2783
  * eax = -1 - error (access to PCI is disabled or parameters
2785
  * eax = -1 - error (access to PCI is disabled or parameters
2784
    are not supported); otherwise
2786
    are not supported); otherwise
2785
  * al/ax/eax (depending on requested size) contains the data;
2787
  * al/ax/eax (depending on requested size) contains the data;
2786
    the other part of register eax is destroyed
2788
    the other part of register eax is destroyed
2787
Remarks:
2789
Remarks:
2788
  * Previously low-level access to PCI for applications must be
2790
  * Previously low-level access to PCI for applications must be
2789
    enabled by subfunction 12 of function 21.
2791
    enabled by subfunction 12 of function 21.
2790
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2792
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2791
    function number. To get access mechanism use subfunction 2.
2793
    function number. To get access mechanism use subfunction 2.
2792
  * Some registers are standard and exist for all devices, some are
2794
  * Some registers are standard and exist for all devices, some are
2793
    defined by the concrete device. The list of registers of the
2795
    defined by the concrete device. The list of registers of the
2794
    first type can be found e.g. in famous
2796
    first type can be found e.g. in famous
2795
    Interrupt List by Ralf Brown
2797
    Interrupt List by Ralf Brown
2796
    (http://www.pobox.com/~ralf/files.html,
2798
    (http://www.pobox.com/~ralf/files.html,
2797
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
2799
    ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
2798
    registers of the second type must be listed
2800
    registers of the second type must be listed
2799
    in the device documentation.
2801
    in the device documentation.
2800
 
2802
 
2801
---------------------- Constants for registers: ----------------------
2803
---------------------- Constants for registers: ----------------------
2802
  eax - SF_PCI (62)
2804
  eax - SF_PCI (62)
2803
  ebx - SSF_READ_BYTE (4), SSF_READ_WORD (5), SSF_READ_DWORD (6)
2805
  ebx - SSF_READ_BYTE (4), SSF_READ_WORD (5), SSF_READ_DWORD (6)
2804
======================================================================
2806
======================================================================
2805
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
2807
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
2806
======================================================================
2808
======================================================================
2807
Parameters:
2809
Parameters:
2808
  * eax = 62 - function number
2810
  * eax = 62 - function number
2809
  * bl = 8 - write byte
2811
  * bl = 8 - write byte
2810
  * bl = 9 - write word
2812
  * bl = 9 - write word
2811
  * bl = 10 - write dword
2813
  * bl = 10 - write dword
2812
  * bh = number of PCI-bus
2814
  * bh = number of PCI-bus
2813
  * ch = dddddfff, where ddddd = number of the device on the bus,
2815
  * ch = dddddfff, where ddddd = number of the device on the bus,
2814
    fff = function number of device
2816
    fff = function number of device
2815
  * cl = number of register (must be even for bl=9,
2817
  * cl = number of register (must be even for bl=9,
2816
    divisible by 4 for bl=10)
2818
    divisible by 4 for bl=10)
2817
  * dl/dx/edx (depending on requested size) contatins
2819
  * dl/dx/edx (depending on requested size) contatins
2818
    the data to write
2820
    the data to write
2819
Returned value:
2821
Returned value:
2820
  * eax = -1 - error (access to PCI is disabled or parameters
2822
  * eax = -1 - error (access to PCI is disabled or parameters
2821
    are not supported)
2823
    are not supported)
2822
  * eax = 0 - success
2824
  * eax = 0 - success
2823
Remarks:
2825
Remarks:
2824
  * Previously low-level access to PCI for applications must be
2826
  * Previously low-level access to PCI for applications must be
2825
    enabled by subfunction 12 of function 21.
2827
    enabled by subfunction 12 of function 21.
2826
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2828
  * Access mechanism 2 supports only 16 devices on a bus and ignores
2827
    function number. To get access mechanism use subfunction 2.
2829
    function number. To get access mechanism use subfunction 2.
2828
  * Some registers are standard and exist for all devices, some are
2830
  * Some registers are standard and exist for all devices, some are
2829
    defined by the concrete device. The list of registers of the
2831
    defined by the concrete device. The list of registers of the
2830
    first type can be found e.g. in famous Interrupt List by
2832
    first type can be found e.g. in famous Interrupt List by
2831
    Ralf Brown; registers of the second type must be listed
2833
    Ralf Brown; registers of the second type must be listed
2832
    in the device documentation.
2834
    in the device documentation.
2833
 
2835
 
2834
---------------------- Constants for registers: ----------------------
2836
---------------------- Constants for registers: ----------------------
2835
  eax - SF_PCI (62)
2837
  eax - SF_PCI (62)
2836
  ebx - SSF_WRITE_BYTE (8), SSF_WRITE_WORD (9), SSF_WRITE_DWORD (10)
2838
  ebx - SSF_WRITE_BYTE (8), SSF_WRITE_WORD (9), SSF_WRITE_DWORD (10)
2837
======================================================================
2839
======================================================================
2838
============== Function 63 - work with the debug board. ==============
2840
============== Function 63 - work with the debug board. ==============
2839
======================================================================
2841
======================================================================
2840
The debug board is the global system buffer (with the size
2842
The debug board is the global system buffer (with the size
2841
1024 bytes), to which any program can write (generally speaking,
2843
1024 bytes), to which any program can write (generally speaking,
2842
arbitrary) data and from which other program can read these data.
2844
arbitrary) data and from which other program can read these data.
2843
By the agreement written data are text strings interpreted as
2845
By the agreement written data are text strings interpreted as
2844
debug messages on a course of program execution. The kernel in
2846
debug messages on a course of program execution. The kernel in
2845
some situations also writes to the debug board information on
2847
some situations also writes to the debug board information on
2846
execution of some functions; by the agreement kernel messages
2848
execution of some functions; by the agreement kernel messages
2847
begins from the prefix "K : ".
2849
begins from the prefix "K : ".
2848
For view of the debug board the application 'board' was created,
2850
For view of the debug board the application 'board' was created,
2849
which reads data from the buffer and displays them in its window.
2851
which reads data from the buffer and displays them in its window.
2850
'board' interpretes the sequence of codes 13,10 as newline.
2852
'board' interpretes the sequence of codes 13,10 as newline.
2851
A character with null code in an end of line is not necessary,
2853
A character with null code in an end of line is not necessary,
2852
but also does not prevent.
2854
but also does not prevent.
2853
Because debugger has been written, the value of the debug board
2855
Because debugger has been written, the value of the debug board
2854
has decreased, as debugger allows to inspect completely a course of
2856
has decreased, as debugger allows to inspect completely a course of
2855
program execution without any efforts from the direction of program
2857
program execution without any efforts from the direction of program
2856
itself. Nevertheless in some cases the debug board is still useful.
2858
itself. Nevertheless in some cases the debug board is still useful.
2857
 
2859
 
2858
----------------------------- Write byte -----------------------------
2860
----------------------------- Write byte -----------------------------
2859
Parameters:
2861
Parameters:
2860
  * eax = 63 - function number
2862
  * eax = 63 - function number
2861
  * ebx = 1 - subfunction number
2863
  * ebx = 1 - subfunction number
2862
  * cl = data byte
2864
  * cl = data byte
2863
Returned value:
2865
Returned value:
2864
  * function does not return value
2866
  * function does not return value
2865
Remarks:
2867
Remarks:
2866
  * Byte is written to the buffer. Buffer size is 512 bytes.
2868
  * Byte is written to the buffer. Buffer size is 512 bytes.
2867
    At buffer overflow all obtained data are lost.
2869
    At buffer overflow all obtained data are lost.
2868
  * For output to the debug board of more complicated objects
2870
  * For output to the debug board of more complicated objects
2869
    (strings, numbers) it is enough to call this function in cycle.
2871
    (strings, numbers) it is enough to call this function in cycle.
2870
    It is possible not to write the appropriate code manually and use
2872
    It is possible not to write the appropriate code manually and use
2871
    file 'debug.inc', which is included into the distributive.
2873
    file 'debug.inc', which is included into the distributive.
2872
 
2874
 
2873
----------------------------- Read byte ------------------------------
2875
----------------------------- Read byte ------------------------------
2874
Takes away byte from the buffer.
2876
Takes away byte from the buffer.
2875
Parameters:
2877
Parameters:
2876
  * eax = 63 - function number
2878
  * eax = 63 - function number
2877
  * ebx = 2 - subfunction number
2879
  * ebx = 2 - subfunction number
2878
Returned value:
2880
Returned value:
2879
  * eax = ebx = 0 - the buffer is empty
2881
  * eax = ebx = 0 - the buffer is empty
2880
  * eax = byte, ebx = 1 - byte was successfully read
2882
  * eax = byte, ebx = 1 - byte was successfully read
2881
 
2883
 
2882
---------------------- Constants for registers: ----------------------
2884
---------------------- Constants for registers: ----------------------
2883
  eax - SF_BOARD (63)
2885
  eax - SF_BOARD (63)
2884
  ebx - SSF_DEBUG_WRITE (1), SSF_DEBUG_READ (2)
2886
  ebx - SSF_DEBUG_WRITE (1), SSF_DEBUG_READ (2)
2885
======================================================================
2887
======================================================================
2886
============== Function 64 - resize application memory. ==============
2888
============== Function 64 - resize application memory. ==============
2887
======================================================================
2889
======================================================================
2888
Parameters:
2890
Parameters:
2889
  * eax = 64 - function number
2891
  * eax = 64 - function number
2890
  * ebx = 1 - unique subfunction
2892
  * ebx = 1 - unique subfunction
2891
  * ecx = new memory size
2893
  * ecx = new memory size
2892
Returned value:
2894
Returned value:
2893
  * eax = 0 - success
2895
  * eax = 0 - success
2894
  * eax = 1 - not enough memory
2896
  * eax = 1 - not enough memory
2895
Remarks:
2897
Remarks:
2896
  * There is another way to dynamically allocate/free memory -
2898
  * There is another way to dynamically allocate/free memory -
2897
    subfunctions 11, 12, 13 of function 68.
2899
    subfunctions 11, 12, 13 of function 68.
2898
  * The function cannot be used together with 68.11, 68.12, 68.13.
2900
  * The function cannot be used together with 68.11, 68.12, 68.13.
2899
    The function call will be ignored after creation of process heap
2901
    The function call will be ignored after creation of process heap
2900
    with function 68.11.
2902
    with function 68.11.
2901
 
2903
 
2902
---------------------- Constants for registers: ----------------------
2904
---------------------- Constants for registers: ----------------------
2903
  eax - SF_MEMORY_RESIZE (64)
2905
  eax - SF_MEMORY_RESIZE (64)
2904
======================================================================
2906
======================================================================
2905
======== Function 65 - draw image with palette in the window. ========
2907
======== Function 65 - draw image with palette in the window. ========
2906
======================================================================
2908
======================================================================
2907
Parameters:
2909
Parameters:
2908
  * eax = 65 - function number
2910
  * eax = 65 - function number
2909
  * ebx = pointer to the image
2911
  * ebx = pointer to the image
2910
  * ecx = [size on axis x]*65536 + [size on axis y]
2912
  * ecx = [size on axis x]*65536 + [size on axis y]
2911
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2913
  * edx = [coordinate on axis x]*65536 + [coordinate on axis y]
2912
  * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
2914
  * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
2913
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
2915
  * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
2914
          ignored when esi > 8
2916
          ignored when esi > 8
2915
  * ebp = offset of next row data relative to previous row data
2917
  * ebp = offset of next row data relative to previous row data
2916
Returned value:
2918
Returned value:
2917
  * function does not return value
2919
  * function does not return value
2918
Remarks:
2920
Remarks:
2919
  * Coordinates of the image are coordinates of the upper left corner
2921
  * Coordinates of the image are coordinates of the upper left corner
2920
    of the image relative to the window.
2922
    of the image relative to the window.
2921
  * Format of image with 1 bit per pixel: each byte of image
2923
  * Format of image with 1 bit per pixel: each byte of image
2922
    (possibly excluding last bytes in rows), contains information on
2924
    (possibly excluding last bytes in rows), contains information on
2923
    the color of 8 pixels, MSB corresponds to first pixel.
2925
    the color of 8 pixels, MSB corresponds to first pixel.
2924
  * Format of image with 2 bits per pixel: each byte of image
2926
  * Format of image with 2 bits per pixel: each byte of image
2925
    (possibly excluding last bytes in rows), contains information on
2927
    (possibly excluding last bytes in rows), contains information on
2926
    the color of 4 pixels, two MSBs correspond to first pixel.
2928
    the color of 4 pixels, two MSBs correspond to first pixel.
2927
  * Format of image with 4 bits per pixel: each byte of image
2929
  * Format of image with 4 bits per pixel: each byte of image
2928
    excluding last bytes in rows (if width is odd) contains
2930
    excluding last bytes in rows (if width is odd) contains
2929
    information on the color of 2 pixels, high-order tetrad
2931
    information on the color of 2 pixels, high-order tetrad
2930
    corresponds to first pixel.
2932
    corresponds to first pixel.
2931
  * Format of image with 8 bits per pixel: each byte of image is
2933
  * Format of image with 8 bits per pixel: each byte of image is
2932
    index in the palette.
2934
    index in the palette.
2933
  * Format of image with 9 bits per pixel: array of one byte values;
2935
  * Format of image with 9 bits per pixel: array of one byte values;
2934
    each byte (8 bit) represents the intensity of gray for one pixel;
2936
    each byte (8 bit) represents the intensity of gray for one pixel;
2935
    this format is equal to 8bpp without palette.
2937
    this format is equal to 8bpp without palette.
2936
  * Format of image with 15 bits per pixel: the color of each pixel
2938
  * Format of image with 15 bits per pixel: the color of each pixel
2937
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
2939
    is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
2938
    each color.
2940
    each color.
2939
  * Format of image with 16 bits per pixel: the color of each pixel
2941
  * Format of image with 16 bits per pixel: the color of each pixel
2940
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
2942
    is coded as RRRRRGGGGGGBBBBB (5+6+5).
2941
  * Format of image with 24 bits per pixel: the color of each pixel
2943
  * Format of image with 24 bits per pixel: the color of each pixel
2942
    is coded as 3 bytes - sequentially blue, green, red components.
2944
    is coded as 3 bytes - sequentially blue, green, red components.
2943
  * Format of image with 32 bits per pixel: similar to 24, but
2945
  * Format of image with 32 bits per pixel: similar to 24, but
2944
    one additional ignored byte is present.
2946
    one additional ignored byte is present.
2945
  * The call to function 7 is equivalent to call to this function
2947
  * The call to function 7 is equivalent to call to this function
2946
    with esi=24, ebp=0.
2948
    with esi=24, ebp=0.
2947
 
2949
 
2948
---------------------- Constants for registers: ----------------------
2950
---------------------- Constants for registers: ----------------------
2949
  eax - SF_PUT_IMAGE_EXT (65)
2951
  eax - SF_PUT_IMAGE_EXT (65)
2950
======================================================================
2952
======================================================================
2951
================== Function 66 - work with keyboard. =================
2953
================== Function 66 - work with keyboard. =================
2952
======================================================================
2954
======================================================================
2953
The input mode influences results of reading keys by function 2.
2955
The input mode influences results of reading keys by function 2.
2954
When a program loads, ASCII input mode is set for it.
2956
When a program loads, ASCII input mode is set for it.
2955
 
2957
 
2956
-------------- Subfunction 1 - set keyboard input mode. --------------
2958
-------------- Subfunction 1 - set keyboard input mode. --------------
2957
Parameters:
2959
Parameters:
2958
  * eax = 66 - function number
2960
  * eax = 66 - function number
2959
  * ebx = 1 - subfunction number
2961
  * ebx = 1 - subfunction number
2960
  * ecx = mode:
2962
  * ecx = mode:
2961
    * 0 = normal (ASCII-characters)
2963
    * 0 = normal (ASCII-characters)
2962
    * 1 = scancodes
2964
    * 1 = scancodes
2963
Returned value:
2965
Returned value:
2964
  * function does not return value
2966
  * function does not return value
2965
 
2967
 
2966
-------------- Subfunction 2 - get keyboard input mode. --------------
2968
-------------- Subfunction 2 - get keyboard input mode. --------------
2967
Parameters:
2969
Parameters:
2968
  * eax = 66 - function number
2970
  * eax = 66 - function number
2969
  * ebx = 2 - subfunction number
2971
  * ebx = 2 - subfunction number
2970
Returned value:
2972
Returned value:
2971
  * eax = current mode
2973
  * eax = current mode
2972
 
2974
 
2973
------------ Subfunction 3 - get status of control keys. -------------
2975
------------ Subfunction 3 - get status of control keys. -------------
2974
Parameters:
2976
Parameters:
2975
  * eax = 66 - function number
2977
  * eax = 66 - function number
2976
  * ebx = 3 - subfunction number
2978
  * ebx = 3 - subfunction number
2977
Returned value:
2979
Returned value:
2978
  * eax = bit mask:
2980
  * eax = bit mask:
2979
  * bit 0  (mask 1): left Shift is pressed
2981
  * bit 0  (mask 1): left Shift is pressed
2980
  * bit 1  (mask 2): right Shift is pressed
2982
  * bit 1  (mask 2): right Shift is pressed
2981
  * bit 2  (mask 4): left Ctrl is pressed
2983
  * bit 2  (mask 4): left Ctrl is pressed
2982
  * bit 3  (mask 8): right Ctrl is pressed
2984
  * bit 3  (mask 8): right Ctrl is pressed
2983
  * bit 4  (mask 0x10): left Alt is pressed
2985
  * bit 4  (mask 0x10): left Alt is pressed
2984
  * bit 5  (mask 0x20): right Alt is pressed
2986
  * bit 5  (mask 0x20): right Alt is pressed
2985
  * bit 6  (mask 0x40): CapsLock is on
2987
  * bit 6  (mask 0x40): CapsLock is on
2986
  * bit 7  (mask 0x80): NumLock is on
2988
  * bit 7  (mask 0x80): NumLock is on
2987
  * bit 8  (mask 0x100): ScrollLock is on
2989
  * bit 8  (mask 0x100): ScrollLock is on
2988
  * bit 9  (mask 0x200): left Win is pressed
2990
  * bit 9  (mask 0x200): left Win is pressed
2989
  * bit 10 (mask 0x400): right Win is pressed
2991
  * bit 10 (mask 0x400): right Win is pressed
2990
  * other bits are cleared
2992
  * other bits are cleared
2991
 
2993
 
2992
-------------- Subfunction 4 - set system-wide hotkey. ---------------
2994
-------------- Subfunction 4 - set system-wide hotkey. ---------------
2993
When hotkey is pressed, the system notifies only those applications,
2995
When hotkey is pressed, the system notifies only those applications,
2994
which have installed it; the active application (which receives
2996
which have installed it; the active application (which receives
2995
all normal input) does not receive such keys.
2997
all normal input) does not receive such keys.
2996
The notification consists in sending event with the code 2.
2998
The notification consists in sending event with the code 2.
2997
Reading hotkey is the same as reading normal key - by function 2.
2999
Reading hotkey is the same as reading normal key - by function 2.
2998
Parameters:
3000
Parameters:
2999
  * eax = 66 - function number
3001
  * eax = 66 - function number
3000
  * ebx = 4 - subfunction number
3002
  * ebx = 4 - subfunction number
3001
  * cl determines key scancode;
3003
  * cl determines key scancode;
3002
    use cl=0 to give combinations such as Ctrl+Shift
3004
    use cl=0 to give combinations such as Ctrl+Shift
3003
  * edx = 0xXYZ determines possible states of control keys:
3005
  * edx = 0xXYZ determines possible states of control keys:
3004
    * Z (low 4 bits) determines state of LShift and RShift:
3006
    * Z (low 4 bits) determines state of LShift and RShift:
3005
      * 0 = no key must be pressed;
3007
      * 0 = no key must be pressed;
3006
      * 1 = exactly one key must be pressed;
3008
      * 1 = exactly one key must be pressed;
3007
      * 2 = both keys must be pressed;
3009
      * 2 = both keys must be pressed;
3008
      * 3 = must be pressed LShift, but not RShift;
3010
      * 3 = must be pressed LShift, but not RShift;
3009
      * 4 = must be pressed RShift, but not LShift
3011
      * 4 = must be pressed RShift, but not LShift
3010
    * Y - similar for LCtrl and RCtrl;
3012
    * Y - similar for LCtrl and RCtrl;
3011
    * X - similar for LAlt and RAlt
3013
    * X - similar for LAlt and RAlt
3012
Returned value:
3014
Returned value:
3013
  * eax=0 - success
3015
  * eax=0 - success
3014
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3016
  * eax=1 - too mant hotkeys (maximum 256 are allowed)
3015
Remarks:
3017
Remarks:
3016
  * Hotkey can work either at pressing or at release. Release
3018
  * Hotkey can work either at pressing or at release. Release
3017
    scancode of a key is more on 128 than pressing scancode
3019
    scancode of a key is more on 128 than pressing scancode
3018
    (i.e. high bit is set).
3020
    (i.e. high bit is set).
3019
  * Several applications can set the same combination;
3021
  * Several applications can set the same combination;
3020
    all such applications will be informed on pressing
3022
    all such applications will be informed on pressing
3021
    such combination.
3023
    such combination.
3022
 
3024
 
3023
-------------- Subfunction 5 - delete installed hotkey. --------------
3025
-------------- Subfunction 5 - delete installed hotkey. --------------
3024
Parameters:
3026
Parameters:
3025
  * eax = 66 - function number
3027
  * eax = 66 - function number
3026
  * ebx = 5 - subfunction number
3028
  * ebx = 5 - subfunction number
3027
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3029
  * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
3028
Returned value:
3030
Returned value:
3029
  * eax = 0 - success
3031
  * eax = 0 - success
3030
  * eax = 1 - there is no such hotkey
3032
  * eax = 1 - there is no such hotkey
3031
Remarks:
3033
Remarks:
3032
  * When a process/thread terminates, all hotkey installed by it are
3034
  * When a process/thread terminates, all hotkey installed by it are
3033
    deleted.
3035
    deleted.
3034
  * The call to this subfunction does not affect other applications.
3036
  * The call to this subfunction does not affect other applications.
3035
    If other application has defined the same combination, it will
3037
    If other application has defined the same combination, it will
3036
    still receive notices.
3038
    still receive notices.
3037
 
3039
 
3038
--------------- Subfunction 6 - block the normal input. --------------
3040
--------------- Subfunction 6 - block the normal input. --------------
3039
Parameters:
3041
Parameters:
3040
  * eax = 66 - function number
3042
  * eax = 66 - function number
3041
  * ebx = 6 - subfunction number
3043
  * ebx = 6 - subfunction number
3042
Returned value:
3044
Returned value:
3043
  * function does not return value
3045
  * function does not return value
3044
Remarks:
3046
Remarks:
3045
  * Blocking the normal keyboard input for installed hotkeys
3047
  * Blocking the normal keyboard input for installed hotkeys
3046
  * To emulate a mouse via the keyboard, the application MOUSEMUL
3048
  * To emulate a mouse via the keyboard, the application MOUSEMUL
3047
 
3049
 
3048
------------ Subfunction 7 - unlock the normal input. ----------------
3050
------------ Subfunction 7 - unlock the normal input. ----------------
3049
Parameters:
3051
Parameters:
3050
  * eax = 66 - function number
3052
  * eax = 66 - function number
3051
  * ebx = 7 - subfunction number
3053
  * ebx = 7 - subfunction number
3052
Returned value:
3054
Returned value:
3053
  * function does not return value
3055
  * function does not return value
3054
Remarks:
3056
Remarks:
3055
  * Unlocking the results of the f. 66.6
3057
  * Unlocking the results of the f. 66.6
3056
  * To emulate a mouse via the keyboard, the application MOUSEMUL
3058
  * To emulate a mouse via the keyboard, the application MOUSEMUL
3057
 
3059
 
3058
---------------------- Constants for registers: ----------------------
3060
---------------------- Constants for registers: ----------------------
3059
  eax - SF_KEYBOARD (66)
3061
  eax - SF_KEYBOARD (66)
3060
  ebx - SSF_SET_INPUT_MODE (1), SSF_GET_INPUT_MODE (2),
3062
  ebx - SSF_SET_INPUT_MODE (1), SSF_GET_INPUT_MODE (2),
3061
    SSF_GET_CONTROL_KEYS (3), SSF_SET_SYS_HOTKEY (4),
3063
    SSF_GET_CONTROL_KEYS (3), SSF_SET_SYS_HOTKEY (4),
3062
    SSF_DEL_SYS_HOTKEY (5),  SSF_LOCK_INPUT (6), SSF_UNLOCK_INPUT (7)
3064
    SSF_DEL_SYS_HOTKEY (5),  SSF_LOCK_INPUT (6), SSF_UNLOCK_INPUT (7)
3063
======================================================================
3065
======================================================================
3064
========= Function 67 - change position/sizes of the window. =========
3066
========= Function 67 - change position/sizes of the window. =========
3065
======================================================================
3067
======================================================================
3066
Parameters:
3068
Parameters:
3067
  * eax = 67 - function number
3069
  * eax = 67 - function number
3068
  * ebx = new x-coordinate of the window
3070
  * ebx = new x-coordinate of the window
3069
  * ecx = new y-coordinate of the window
3071
  * ecx = new y-coordinate of the window
3070
  * edx = new x-size of the window
3072
  * edx = new x-size of the window
3071
  * esi = new y-size of the window
3073
  * esi = new y-size of the window
3072
Returned value:
3074
Returned value:
3073
  * function does not return value
3075
  * function does not return value
3074
Remarks:
3076
Remarks:
3075
  * The value -1 for a parameter means "do not change"; e.g. to move
3077
  * The value -1 for a parameter means "do not change"; e.g. to move
3076
    the window without resizing it is possible to specify edx=esi=-1.
3078
    the window without resizing it is possible to specify edx=esi=-1.
3077
  * Previously the window must be defined by function 0.
3079
  * Previously the window must be defined by function 0.
3078
    It sets initial coordinates and sizes of the window.
3080
    It sets initial coordinates and sizes of the window.
3079
  * Sizes of the window are understood in sense of function 0,
3081
  * Sizes of the window are understood in sense of function 0,
3080
    that is one pixel less than real sizes.
3082
    that is one pixel less than real sizes.
3081
  * The function call for maximized windows is simply ignored.
3083
  * The function call for maximized windows is simply ignored.
3082
  * For windows of appropriate styles position and/or sizes can be
3084
  * For windows of appropriate styles position and/or sizes can be
3083
    changed by user; current position and sizes can be obtained by
3085
    changed by user; current position and sizes can be obtained by
3084
    call to function 9.
3086
    call to function 9.
3085
  * The function sends to the window redraw event (with the code 1).
3087
  * The function sends to the window redraw event (with the code 1).
3086
 
3088
 
3087
---------------------- Constants for registers: ----------------------
3089
---------------------- Constants for registers: ----------------------
3088
  eax - SF_CHANGE_WINDOW (67)
3090
  eax - SF_CHANGE_WINDOW (67)
3089
======================================================================
3091
======================================================================
3090
====== Function 68, subfunction 0 - get the task switch counter. =====
3092
====== Function 68, subfunction 0 - get the task switch counter. =====
3091
======================================================================
3093
======================================================================
3092
Parameters:
3094
Parameters:
3093
  * eax = 68 - function number
3095
  * eax = 68 - function number
3094
  * ebx = 0 - subfunction number
3096
  * ebx = 0 - subfunction number
3095
Returned value:
3097
Returned value:
3096
  * eax = number of task switches from the system booting
3098
  * eax = number of task switches from the system booting
3097
    (modulo 2^32)
3099
    (modulo 2^32)
3098
 
3100
 
3099
---------------------- Constants for registers: ----------------------
3101
---------------------- Constants for registers: ----------------------
3100
  eax - SF_SYS_MISC (68)
3102
  eax - SF_SYS_MISC (68)
3101
  ebx - SSF_GET_TASK_SWITCH_COUNT (0)
3103
  ebx - SSF_GET_TASK_SWITCH_COUNT (0)
3102
======================================================================
3104
======================================================================
3103
======= Function 68, subfunction 1 - switch to the next thread. ======
3105
======= Function 68, subfunction 1 - switch to the next thread. ======
3104
======================================================================
3106
======================================================================
3105
The function completes the current time slice allocated to the
3107
The function completes the current time slice allocated to the
3106
thread and switches to the next. (Which thread in which process
3108
thread and switches to the next. (Which thread in which process
3107
will be next, is unpredictable). Later, when execution queue
3109
will be next, is unpredictable). Later, when execution queue
3108
will reach the current thread, execution will be continued.
3110
will reach the current thread, execution will be continued.
3109
Parameters:
3111
Parameters:
3110
  * eax = 68 - function number
3112
  * eax = 68 - function number
3111
  * ebx = 1 - subfunction number
3113
  * ebx = 1 - subfunction number
3112
Returned value:
3114
Returned value:
3113
  * function does not return value
3115
  * function does not return value
3114
 
3116
 
3115
---------------------- Constants for registers: ----------------------
3117
---------------------- Constants for registers: ----------------------
3116
  eax - SF_SYS_MISC (68)
3118
  eax - SF_SYS_MISC (68)
3117
  ebx - SSF_SWITCH_TASK (1)
3119
  ebx - SSF_SWITCH_TASK (1)
3118
======================================================================
3120
======================================================================
3119
============= Function 68, subfunction 2 - cache + rdpmc. ============
3121
============= Function 68, subfunction 2 - cache + rdpmc. ============
3120
======================================================================
3122
======================================================================
3121
Parameters:
3123
Parameters:
3122
  * eax = 68 - function number
3124
  * eax = 68 - function number
3123
  * ebx = 2 - subfunction number
3125
  * ebx = 2 - subfunction number
3124
  * ecx = required action:
3126
  * ecx = required action:
3125
    * ecx = 0 - enable instruction 'rdpmc'
3127
    * ecx = 0 - enable instruction 'rdpmc'
3126
      (ReaD Performance-Monitoring Counters) for applications
3128
      (ReaD Performance-Monitoring Counters) for applications
3127
    * ecx = 1 - find out whether cache is disabled/enabled
3129
    * ecx = 1 - find out whether cache is disabled/enabled
3128
    * ecx = 2 - enable cache
3130
    * ecx = 2 - enable cache
3129
    * ecx = 3 - disable cache
3131
    * ecx = 3 - disable cache
3130
Returned value:
3132
Returned value:
3131
  * for ecx=0:
3133
  * for ecx=0:
3132
    * eax = the value of cr4
3134
    * eax = the value of cr4
3133
  * for ecx=1:
3135
  * for ecx=1:
3134
    * eax = (cr0 and 0x60000000):
3136
    * eax = (cr0 and 0x60000000):
3135
    * eax = 0 - cache is on
3137
    * eax = 0 - cache is on
3136
    * eax <> 0 - cache is off
3138
    * eax <> 0 - cache is off
3137
  * for ecx=2 and ecx=3:
3139
  * for ecx=2 and ecx=3:
3138
    * function does not return value
3140
    * function does not return value
3139
 
3141
 
3140
---------------------- Constants for registers: ----------------------
3142
---------------------- Constants for registers: ----------------------
3141
  eax - SF_SYS_MISC (68)
3143
  eax - SF_SYS_MISC (68)
3142
  ebx - SSF_PERFORMANCE (2)
3144
  ebx - SSF_PERFORMANCE (2)
3143
  ecx - SSSF_ALLOW_RDPMC (0), SSSF_CACHE_STATUS (1),
3145
  ecx - SSSF_ALLOW_RDPMC (0), SSSF_CACHE_STATUS (1),
3144
    SSSF_CACHE_ON (2), SSSF_CACHE_OFF (3)
3146
    SSSF_CACHE_ON (2), SSSF_CACHE_OFF (3)
3145
======================================================================
3147
======================================================================
3146
=========== Function 68, subfunction 3 - read MSR-register. ==========
3148
=========== Function 68, subfunction 3 - read MSR-register. ==========
3147
======================================================================
3149
======================================================================
3148
MSR = Model Specific Register; the complete list of MSR-registers
3150
MSR = Model Specific Register; the complete list of MSR-registers
3149
of a processor is included to the documentation on it (for example,
3151
of a processor is included to the documentation on it (for example,
3150
IA-32 Intel Architecture Software Developer's Manual,
3152
IA-32 Intel Architecture Software Developer's Manual,
3151
Volume 3, Appendix B); each processor family has its own subset
3153
Volume 3, Appendix B); each processor family has its own subset
3152
of the MSR-registers.
3154
of the MSR-registers.
3153
Parameters:
3155
Parameters:
3154
  * eax = 68 - function number
3156
  * eax = 68 - function number
3155
  * ebx = 3 - subfunction number
3157
  * ebx = 3 - subfunction number
3156
  * ecx is ignored
3158
  * ecx is ignored
3157
  * edx = MSR address
3159
  * edx = MSR address
3158
Returned value:
3160
Returned value:
3159
  * ebx:eax = high:low dword of the result
3161
  * ebx:eax = high:low dword of the result
3160
Remarks:
3162
Remarks:
3161
  * If ecx contains nonexistent or not implemented for this processor
3163
  * If ecx contains nonexistent or not implemented for this processor
3162
    MSR, processor will generate an exception in the kernel, which
3164
    MSR, processor will generate an exception in the kernel, which
3163
    will kill the thread.
3165
    will kill the thread.
3164
  * Previously it is necessary to check, whether MSRs are supported
3166
  * Previously it is necessary to check, whether MSRs are supported
3165
    as a whole, with the instruction 'cpuid'. Otherwise processor
3167
    as a whole, with the instruction 'cpuid'. Otherwise processor
3166
    will generate other exception in the kernel, which will anyway
3168
    will generate other exception in the kernel, which will anyway
3167
    kill the thread.
3169
    kill the thread.
3168
 
3170
 
3169
---------------------- Constants for registers: ----------------------
3171
---------------------- Constants for registers: ----------------------
3170
  eax - SF_SYS_MISC (68)
3172
  eax - SF_SYS_MISC (68)
3171
  ebx - SSF_READ_MSR (3)
3173
  ebx - SSF_READ_MSR (3)
3172
======================================================================
3174
======================================================================
3173
========= Function 68, subfunction 4 - write to MSR-register. ========
3175
========= Function 68, subfunction 4 - write to MSR-register. ========
3174
======================================================================
3176
======================================================================
3175
MSR = Model Specific Register; the complete list of MSR-registers
3177
MSR = Model Specific Register; the complete list of MSR-registers
3176
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,
3177
IA-32 Intel Architecture Software Developer's Manual,
3179
IA-32 Intel Architecture Software Developer's Manual,
3178
Volume 3, Appendix B); each processor family has its own subset
3180
Volume 3, Appendix B); each processor family has its own subset
3179
of the MSR-registers.
3181
of the MSR-registers.
3180
Parameters:
3182
Parameters:
3181
  * eax = 68 - function number
3183
  * eax = 68 - function number
3182
  * ebx = 4 - subfunction number
3184
  * ebx = 4 - subfunction number
3183
  * ecx is ignored
3185
  * ecx is ignored
3184
  * edx = MSR address
3186
  * edx = MSR address
3185
  * esi:edi = high:low dword
3187
  * esi:edi = high:low dword
3186
Returned value:
3188
Returned value:
3187
  * function does not return value
3189
  * function does not return value
3188
Remarks:
3190
Remarks:
3189
  * If ecx contains nonexistent or not implemented for this processor
3191
  * If ecx contains nonexistent or not implemented for this processor
3190
    MSR, processor will generate an exception in the kernel, which
3192
    MSR, processor will generate an exception in the kernel, which
3191
    will kill the thread.
3193
    will kill the thread.
3192
  * Previously it is necessary to check, whether MSRs are supported
3194
  * Previously it is necessary to check, whether MSRs are supported
3193
    as a whole, with the instruction 'cpuid'. Otherwise processor
3195
    as a whole, with the instruction 'cpuid'. Otherwise processor
3194
    will generate other exception in the kernel, which will anyway
3196
    will generate other exception in the kernel, which will anyway
3195
    kill the thread.
3197
    kill the thread.
3196
 
3198
 
3197
---------------------- Constants for registers: ----------------------
3199
---------------------- Constants for registers: ----------------------
3198
  eax - SF_SYS_MISC (68)
3200
  eax - SF_SYS_MISC (68)
3199
  ebx - SSF_WRITE_MSR (4)
3201
  ebx - SSF_WRITE_MSR (4)
3200
======================================================================
3202
======================================================================
3201
======= Function 68, subfunction 11 - initialize process heap. =======
3203
======= Function 68, subfunction 11 - initialize process heap. =======
3202
======================================================================
3204
======================================================================
3203
Parameters:
3205
Parameters:
3204
  * eax = 68 - function number
3206
  * eax = 68 - function number
3205
  * ebx = 11 - subfunction number
3207
  * ebx = 11 - subfunction number
3206
Returned value:
3208
Returned value:
3207
  * eax = 0 - failed
3209
  * eax = 0 - failed
3208
  * otherwise size of created heap
3210
  * otherwise size of created heap
3209
Remarks:
3211
Remarks:
3210
  * The function call initializes heap, from which one can in future
3212
  * The function call initializes heap, from which one can in future
3211
    allocate and free memory blocks with subfunctions 12 and 13.
3213
    allocate and free memory blocks with subfunctions 12 and 13.
3212
    Heap size is equal to total amount of free application memory.
3214
    Heap size is equal to total amount of free application memory.
3213
  * The second function call from the same process results in
3215
  * The second function call from the same process results in
3214
    returning the size of the existing heap.
3216
    returning the size of the existing heap.
3215
  * After creation of the heap calls to function 64 will be ignored.
3217
  * After creation of the heap calls to function 64 will be ignored.
3216
 
3218
 
3217
---------------------- Constants for registers: ----------------------
3219
---------------------- Constants for registers: ----------------------
3218
  eax - SF_SYS_MISC (68)
3220
  eax - SF_SYS_MISC (68)
3219
  ebx - SSF_HEAP_INIT (11)
3221
  ebx - SSF_HEAP_INIT (11)
3220
======================================================================
3222
======================================================================
3221
======== Function 68, subfunction 12 - allocate memory block. ========
3223
======== Function 68, subfunction 12 - allocate memory block. ========
3222
======================================================================
3224
======================================================================
3223
Parameters:
3225
Parameters:
3224
  * eax = 68 - function number
3226
  * eax = 68 - function number
3225
  * ebx = 12 - subfunction number
3227
  * ebx = 12 - subfunction number
3226
  * ecx = required size in bytes
3228
  * ecx = required size in bytes
3227
Returned value:
3229
Returned value:
3228
  * eax = pointer to the allocated block
3230
  * eax = pointer to the allocated block
3229
Remarks:
3231
Remarks:
3230
  * Before this call one must initialize process heap by call to
3232
  * Before this call one must initialize process heap by call to
3231
    subfunction 11.
3233
    subfunction 11.
3232
  * The function allocates an integer number of pages (4 Kb) in such
3234
  * The function allocates an integer number of pages (4 Kb) in such
3233
    way that the real size of allocated block is more than or equal to
3235
    way that the real size of allocated block is more than or equal to
3234
    requested size.
3236
    requested size.
3235
 
3237
 
3236
---------------------- Constants for registers: ----------------------
3238
---------------------- Constants for registers: ----------------------
3237
  eax - SF_SYS_MISC (68)
3239
  eax - SF_SYS_MISC (68)
3238
  ebx - SSF_MEM_ALLOC (12)
3240
  ebx - SSF_MEM_ALLOC (12)
3239
======================================================================
3241
======================================================================
3240
========== Function 68, subfunction 13 - free memory block. ==========
3242
========== Function 68, subfunction 13 - free memory block. ==========
3241
======================================================================
3243
======================================================================
3242
Parameters:
3244
Parameters:
3243
  * eax = 68 - function number
3245
  * eax = 68 - function number
3244
  * ebx = 13 - subfunction number
3246
  * ebx = 13 - subfunction number
3245
  * ecx = pointer to the memory block
3247
  * ecx = pointer to the memory block
3246
Returned value:
3248
Returned value:
3247
  * eax = 1 - success
3249
  * eax = 1 - success
3248
  * eax = 0 - failed
3250
  * eax = 0 - failed
3249
Remarks:
3251
Remarks:
3250
  * The memory block must have been allocated by subfunction 12
3252
  * The memory block must have been allocated by subfunction 12
3251
    or subfunction 20.
3253
    or subfunction 20.
3252
 
3254
 
3253
---------------------- Constants for registers: ----------------------
3255
---------------------- Constants for registers: ----------------------
3254
  eax - SF_SYS_MISC (68)
3256
  eax - SF_SYS_MISC (68)
3255
  ebx - SSF_MEM_FREE (13)
3257
  ebx - SSF_MEM_FREE (13)
3256
======================================================================
3258
======================================================================
3257
===================== Function 68, subfunction 14 ====================
3259
===================== Function 68, subfunction 14 ====================
3258
============ Wait for signal from another program/driver. ============
3260
============ Wait for signal from another program/driver. ============
3259
======================================================================
3261
======================================================================
3260
Parameters:
3262
Parameters:
3261
  * eax = 68 - function number
3263
  * eax = 68 - function number
3262
  * ebx = 14 - subfunction number
3264
  * ebx = 14 - subfunction number
3263
  * ecx = pointer to the buffer for information (24 bytes)
3265
  * ecx = pointer to the buffer for information (24 bytes)
3264
Returned value:
3266
Returned value:
3265
  * buffer pointed to by ecx contains the following information:
3267
  * buffer pointed to by ecx contains the following information:
3266
    * +0: dword: identifier for following data of signal
3268
    * +0: dword: identifier for following data of signal
3267
    * +4: dword: data of signal (20 bytes), format of which is defined
3269
    * +4: dword: data of signal (20 bytes), format of which is defined
3268
          by the first dword
3270
          by the first dword
3269
 
3271
 
3270
---------------------- Constants for registers: ----------------------
3272
---------------------- Constants for registers: ----------------------
3271
  eax - SF_SYS_MISC (68)
3273
  eax - SF_SYS_MISC (68)
3272
  ebx - SSF_WAIT_SIGNAL (14)
3274
  ebx - SSF_WAIT_SIGNAL (14)
3273
======================================================================
3275
======================================================================
3274
============= Function 68, subfunction 16 - load driver. =============
3276
============= Function 68, subfunction 16 - load driver. =============
3275
======================================================================
3277
======================================================================
3276
Parameters:
3278
Parameters:
3277
  * eax = 68 - function number
3279
  * eax = 68 - function number
3278
  * ebx = 16 - subfunction number
3280
  * ebx = 16 - subfunction number
3279
  * ecx = pointer to ASCIIZ-string with driver name
3281
  * ecx = pointer to ASCIIZ-string with driver name
3280
Returned value:
3282
Returned value:
3281
  * eax = 0 - failed
3283
  * eax = 0 - failed
3282
  * otherwise eax = driver handle
3284
  * otherwise eax = driver handle
3283
Remarks:
3285
Remarks:
3284
  * If the driver was not loaded yet, it is loaded;
3286
  * If the driver was not loaded yet, it is loaded;
3285
    if the driver was loaded yet, nothing happens.
3287
    if the driver was loaded yet, nothing happens.
3286
  * Driver name is case-sensitive.
3288
  * Driver name is case-sensitive.
3287
    Maximum length of the name is 16 characters, including
3289
    Maximum length of the name is 16 characters, including
3288
    terminating null character, the rest is ignored.
3290
    terminating null character, the rest is ignored.
3289
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3291
  * Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
3290
 
3292
 
3291
---------------------- Constants for registers: ----------------------
3293
---------------------- Constants for registers: ----------------------
3292
  eax - SF_SYS_MISC (68)
3294
  eax - SF_SYS_MISC (68)
3293
  ebx - SSF_LOAD_DRIVER (16)
3295
  ebx - SSF_LOAD_DRIVER (16)
3294
======================================================================
3296
======================================================================
3295
============ Function 68, subfunction 17 - driver control. ===========
3297
============ Function 68, subfunction 17 - driver control. ===========
3296
======================================================================
3298
======================================================================
3297
Parameters:
3299
Parameters:
3298
  * eax = 68 - function number
3300
  * eax = 68 - function number
3299
  * ebx = 17 - subfunction number
3301
  * ebx = 17 - subfunction number
3300
  * ecx = pointer to the control structure:
3302
  * ecx = pointer to the control structure:
3301
    * +0: dword: handle of driver
3303
    * +0: dword: handle of driver
3302
    * +4: dword: code of driver function
3304
    * +4: dword: code of driver function
3303
    * +8: dword: pointer to input data
3305
    * +8: dword: pointer to input data
3304
    * +12 = +0xC: dword: size of input data
3306
    * +12 = +0xC: dword: size of input data
3305
    * +16 = +0x10: dword: pointer to output data
3307
    * +16 = +0x10: dword: pointer to output data
3306
    * +20 = +0x14: dword: size of output data
3308
    * +20 = +0x14: dword: size of output data
3307
Returned value:
3309
Returned value:
3308
  * eax = determined by driver
3310
  * eax = determined by driver
3309
Remarks:
3311
Remarks:
3310
  * Function codes and the structure of input/output data
3312
  * Function codes and the structure of input/output data
3311
    are defined by driver.
3313
    are defined by driver.
3312
  * Previously one must obtain driver handle by subfunction 16.
3314
  * Previously one must obtain driver handle by subfunction 16.
3313
 
3315
 
3314
---------------------- Constants for registers: ----------------------
3316
---------------------- Constants for registers: ----------------------
3315
  eax - SF_SYS_MISC (68)
3317
  eax - SF_SYS_MISC (68)
3316
  ebx - SSF_CONTROL_DRIVER (17)
3318
  ebx - SSF_CONTROL_DRIVER (17)
3317
======================================================================
3319
======================================================================
3318
=============== Function 68, subfunction 19 - load DLL. ==============
3320
=============== Function 68, subfunction 19 - load DLL. ==============
3319
======================================================================
3321
======================================================================
3320
Parameters:
3322
Parameters:
3321
  * eax = 68 - function number
3323
  * eax = 68 - function number
3322
  * ebx = 19 - subfunction number
3324
  * ebx = 19 - subfunction number
3323
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3325
  * ecx = pointer to ASCIIZ-string with the full path to DLL
3324
Returned value:
3326
Returned value:
3325
  * eax = 0 - failed
3327
  * eax = 0 - failed
3326
  * otherwise eax = pointer to DLL export table
3328
  * otherwise eax = pointer to DLL export table
3327
Remarks:
3329
Remarks:
3328
  * Export table is an array of structures of 2 dword's, terminated
3330
  * Export table is an array of structures of 2 dword's, terminated
3329
    by zero. The first dword in structure points to function name,
3331
    by zero. The first dword in structure points to function name,
3330
    the second dword contains address of function.
3332
    the second dword contains address of function.
3331
 
3333
 
3332
---------------------- Constants for registers: ----------------------
3334
---------------------- Constants for registers: ----------------------
3333
  eax - SF_SYS_MISC (68)
3335
  eax - SF_SYS_MISC (68)
3334
  ebx - SSF_LOAD_DLL (19)
3336
  ebx - SSF_LOAD_DLL (19)
3335
======================================================================
3337
======================================================================
3336
======= Function 68, subfunction 20 - reallocate memory block. =======
3338
======= Function 68, subfunction 20 - reallocate memory block. =======
3337
======================================================================
3339
======================================================================
3338
Parameters:
3340
Parameters:
3339
  * eax = 68 - function number
3341
  * eax = 68 - function number
3340
  * ebx = 20 - subfunction number
3342
  * ebx = 20 - subfunction number
3341
  * ecx = new size in bytes
3343
  * ecx = new size in bytes
3342
  * edx = pointer to already allocated block
3344
  * edx = pointer to already allocated block
3343
Returned value:
3345
Returned value:
3344
  * eax = pointer to the reallocated block, 0 = error
3346
  * eax = pointer to the reallocated block, 0 = error
3345
Remarks:
3347
Remarks:
3346
  * Before this call one must initialize process heap by call to
3348
  * Before this call one must initialize process heap by call to
3347
    subfunction 11.
3349
    subfunction 11.
3348
  * The function allocates an integer number of pages (4 Kb) in such
3350
  * The function allocates an integer number of pages (4 Kb) in such
3349
    way that the real size of allocated block is more than or equal to
3351
    way that the real size of allocated block is more than or equal to
3350
    requested size.
3352
    requested size.
3351
  * If edx=0, the function call is equivalent to memory allocation
3353
  * If edx=0, the function call is equivalent to memory allocation
3352
    with subfunction 12. Otherwise the block at edx
3354
    with subfunction 12. Otherwise the block at edx
3353
    must be allocated earlier with subfunction 12 or this subfunction.
3355
    must be allocated earlier with subfunction 12 or this subfunction.
3354
  * If ecx=0, the function frees memory block at edx and returns 0.
3356
  * If ecx=0, the function frees memory block at edx and returns 0.
3355
  * The contents of the block are unchanged up to the shorter of
3357
  * The contents of the block are unchanged up to the shorter of
3356
    the new and old sizes.
3358
    the new and old sizes.
3357
 
3359
 
3358
---------------------- Constants for registers: ----------------------
3360
---------------------- Constants for registers: ----------------------
3359
  eax - SF_SYS_MISC (68)
3361
  eax - SF_SYS_MISC (68)
3360
  ebx - SSF_MEM_REALLOC (20)
3362
  ebx - SSF_MEM_REALLOC (20)
3361
======================================================================
3363
======================================================================
3362
=========== Function 68, subfunction 21 - load driver PE. ============
3364
=========== Function 68, subfunction 21 - load driver PE. ============
3363
======================================================================
3365
======================================================================
3364
Parameters:
3366
Parameters:
3365
  * eax = 68 - function number
3367
  * eax = 68 - function number
3366
  * ebx = 21 - subfunction number
3368
  * ebx = 21 - subfunction number
3367
  * ecx = pointer to ASCIIZ-string with driver name
3369
  * ecx = pointer to ASCIIZ-string with driver name
3368
  * edx = pointer to command line
3370
  * edx = pointer to command line
3369
Returned value:
3371
Returned value:
3370
  * eax = 0 - failed
3372
  * eax = 0 - failed
3371
  * otherwise eax = driver handle
3373
  * otherwise eax = driver handle
3372
Remarks:
3374
Remarks:
3373
  * If the driver was not loaded yet, it is loaded;
3375
  * If the driver was not loaded yet, it is loaded;
3374
    if the driver was loaded yet, nothing happens.
3376
    if the driver was loaded yet, nothing happens.
3375
 
3377
 
3376
---------------------- Constants for registers: ----------------------
3378
---------------------- Constants for registers: ----------------------
3377
  eax - SF_SYS_MISC (68)
3379
  eax - SF_SYS_MISC (68)
3378
  ebx - SSF_LOAD_DRIVER_PE (21)
3380
  ebx - SSF_LOAD_DRIVER_PE (21)
3379
======================================================================
3381
======================================================================
3380
======== Function 68, subfunction 22 - open named memory area. =======
3382
======== Function 68, subfunction 22 - open named memory area. =======
3381
======================================================================
3383
======================================================================
3382
Parameters:
3384
Parameters:
3383
  * eax = 68 - function number
3385
  * eax = 68 - function number
3384
  * ebx = 22 - subfunction number
3386
  * ebx = 22 - subfunction number
3385
  * ecx = area name. Maximum of 31 characters with terminating zero
3387
  * ecx = area name. Maximum of 31 characters with terminating zero
3386
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3388
  * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
3387
  * esi = flags for open and access:
3389
  * esi = flags for open and access:
3388
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3390
    * SHM_OPEN        = 0x00 - open existing memory area. If an area
3389
                          with such name does not exist, the function
3391
                          with such name does not exist, the function
3390
                          will return error code 5.
3392
                          will return error code 5.
3391
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3393
    * SHM_OPEN_ALWAYS = 0x04 - open existing or create new
3392
                          memory area.
3394
                          memory area.
3393
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3395
    * SHM_CREATE      = 0x08 - create new memory area. If an area
3394
                          with such name already exists, the function
3396
                          with such name already exists, the function
3395
                          will return error code 10.
3397
                          will return error code 10.
3396
    * SHM_READ        = 0x00 - only read access
3398
    * SHM_READ        = 0x00 - only read access
3397
    * SHM_WRITE       = 0x01 - read and write access
3399
    * SHM_WRITE       = 0x01 - read and write access
3398
Returned value:
3400
Returned value:
3399
  * eax = pointer to memory area, 0 if error has occured
3401
  * eax = pointer to memory area, 0 if error has occured
3400
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3402
  * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
3401
    edx = 0 - success, otherwise - error code
3403
    edx = 0 - success, otherwise - error code
3402
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3404
  * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
3403
    edx = error code (if eax=0) or area size in bytes
3405
    edx = error code (if eax=0) or area size in bytes
3404
Error codes:
3406
Error codes:
3405
  * E_NOTFOUND = 5
3407
  * E_NOTFOUND = 5
3406
  * E_ACCESS = 10
3408
  * E_ACCESS = 10
3407
  * E_NOMEM = 30
3409
  * E_NOMEM = 30
3408
  * E_PARAM = 33
3410
  * E_PARAM = 33
3409
Remarks:
3411
Remarks:
3410
  * Before this call one must initialize process heap by call to
3412
  * Before this call one must initialize process heap by call to
3411
    subfunction 11.
3413
    subfunction 11.
3412
  * If a new area is created, access flags set maximal rights
3414
  * If a new area is created, access flags set maximal rights
3413
    for other processes. An attempt from other process to open
3415
    for other processes. An attempt from other process to open
3414
    with denied rights will fail with error code E_ACCESS.
3416
    with denied rights will fail with error code E_ACCESS.
3415
  * The process which has created an area always has write access.
3417
  * The process which has created an area always has write access.
3416
 
3418
 
3417
---------------------- Constants for registers: ----------------------
3419
---------------------- Constants for registers: ----------------------
3418
  eax - SF_SYS_MISC (68)
3420
  eax - SF_SYS_MISC (68)
3419
  ebx - SSF_MEM_OPEN (22)
3421
  ebx - SSF_MEM_OPEN (22)
3420
======================================================================
3422
======================================================================
3421
======= Function 68, subfunction 23 - close named memory area. =======
3423
======= Function 68, subfunction 23 - close named memory area. =======
3422
======================================================================
3424
======================================================================
3423
Parameters:
3425
Parameters:
3424
  * eax = 68 - function number
3426
  * eax = 68 - function number
3425
  * ebx = 23 - subfunction number
3427
  * ebx = 23 - subfunction number
3426
  * ecx = area name. Maximum of 31 characters with terminating zero
3428
  * ecx = area name. Maximum of 31 characters with terminating zero
3427
Returned value:
3429
Returned value:
3428
  * eax destroyed
3430
  * eax destroyed
3429
Remarks:
3431
Remarks:
3430
  * A memory area is physically freed (with deleting all data and
3432
  * A memory area is physically freed (with deleting all data and
3431
    freeing physical memory), when all threads which have opened
3433
    freeing physical memory), when all threads which have opened
3432
    this area will close it.
3434
    this area will close it.
3433
  * When thread is terminating, all opened by it areas are closed.
3435
  * When thread is terminating, all opened by it areas are closed.
3434
 
3436
 
3435
---------------------- Constants for registers: ----------------------
3437
---------------------- Constants for registers: ----------------------
3436
  eax - SF_SYS_MISC (68)
3438
  eax - SF_SYS_MISC (68)
3437
  ebx - SSF_MEM_CLOSE (23)
3439
  ebx - SSF_MEM_CLOSE (23)
3438
======================================================================
3440
======================================================================
3439
======== Function 68, subfunction 24 - set exception handler. ========
3441
======== Function 68, subfunction 24 - set exception handler. ========
3440
======================================================================
3442
======================================================================
3441
Parameters:
3443
Parameters:
3442
  * eax = 68 - function number
3444
  * eax = 68 - function number
3443
  * ebx = 24 - subfunction number
3445
  * ebx = 24 - subfunction number
3444
  * ecx = address of the new exception handler
3446
  * ecx = address of the new exception handler
3445
  * edx = the mask of handled exceptions
3447
  * edx = the mask of handled exceptions
3446
Returned value:
3448
Returned value:
3447
  * eax = address of the old exception handler (0, if it was not set)
3449
  * eax = address of the old exception handler (0, if it was not set)
3448
  * ebx = the old mask of handled exceptions
3450
  * ebx = the old mask of handled exceptions
3449
Remarks:
3451
Remarks:
3450
  * Bit number in mask of exceptions corresponds to exception number
3452
  * Bit number in mask of exceptions corresponds to exception number
3451
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3453
    in CPU-specification (Intel-PC). For example, FPU exceptions have
3452
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3454
    number 16 (#MF), and SSE exceptions - 19 (#XF).
3453
  * The current implementation ignores the inquiry for hook of 7
3455
  * The current implementation ignores the inquiry for hook of 7
3454
    exception - the system handles #NM by its own.
3456
    exception - the system handles #NM by its own.
3455
  * The exception handler is called with exception number as first
3457
  * The exception handler is called with exception number as first
3456
    (and only) stack parameter. So, correct exit from the handler is
3458
    (and only) stack parameter. So, correct exit from the handler is
3457
    RET 4. It returns to the instruction, that caused the exception,
3459
    RET 4. It returns to the instruction, that caused the exception,
3458
    for faults, and to the next instruction for traps (see
3460
    for faults, and to the next instruction for traps (see
3459
    classification of exceptions in CPU specification).
3461
    classification of exceptions in CPU specification).
3460
  * When user handler receives control, the corresponding bit in
3462
  * When user handler receives control, the corresponding bit in
3461
    the exception mask is cleared. Raising this exception
3463
    the exception mask is cleared. Raising this exception
3462
    in consequence leads to default handling, that is,
3464
    in consequence leads to default handling, that is,
3463
    terminating the application in absence of debugger or
3465
    terminating the application in absence of debugger or
3464
    suspend with notification of debugger otherwise.
3466
    suspend with notification of debugger otherwise.
3465
  * After user handler completes critical operations, it can set
3467
  * After user handler completes critical operations, it can set
3466
    the corresponding bit in the exception mask with subfunction 25.
3468
    the corresponding bit in the exception mask with subfunction 25.
3467
    Also user handler is responsible for clearing exceptions flags in
3469
    Also user handler is responsible for clearing exceptions flags in
3468
    FPU and/or SSE.
3470
    FPU and/or SSE.
3469
 
3471
 
3470
---------------------- Constants for registers: ----------------------
3472
---------------------- Constants for registers: ----------------------
3471
  eax - SF_SYS_MISC (68)
3473
  eax - SF_SYS_MISC (68)
3472
  ebx - SSF_SET_EXCEPTION_HANDLER (24)
3474
  ebx - SSF_SET_EXCEPTION_HANDLER (24)
3473
======================================================================
3475
======================================================================
3474
======== Function 68, subfunction 25 - set exception activity ========
3476
======== Function 68, subfunction 25 - set exception activity ========
3475
======================================================================
3477
======================================================================
3476
Parameters:
3478
Parameters:
3477
  * eax = 68 - function number
3479
  * eax = 68 - function number
3478
  * ebx = 25 - subfunction number
3480
  * ebx = 25 - subfunction number
3479
  * ecx = signal number
3481
  * ecx = signal number
3480
  * edx = value of activity (0/1)
3482
  * edx = value of activity (0/1)
3481
Returned value:
3483
Returned value:
3482
  * eax = -1 - invalid signal number
3484
  * eax = -1 - invalid signal number
3483
  * otherwise eax = old value of activity for this signal (0/1)
3485
  * otherwise eax = old value of activity for this signal (0/1)
3484
Remarks:
3486
Remarks:
3485
  * In current implementation only mask for user excepton handler,
3487
  * In current implementation only mask for user excepton handler,
3486
    which has been previously set by subfunction 24,
3488
    which has been previously set by subfunction 24,
3487
    is changed. Signal number corresponds to exception number.
3489
    is changed. Signal number corresponds to exception number.
3488
 
3490
 
3489
---------------------- Constants for registers: ----------------------
3491
---------------------- Constants for registers: ----------------------
3490
  eax - SF_SYS_MISC (68)
3492
  eax - SF_SYS_MISC (68)
3491
  ebx - SSF_SET_EXCEPTION_STATE (25)
3493
  ebx - SSF_SET_EXCEPTION_STATE (25)
3492
======================================================================
3494
======================================================================
3493
====== Function 68, subfunction 26 - release memory pages ============
3495
====== Function 68, subfunction 26 - release memory pages ============
3494
======================================================================
3496
======================================================================
3495
Parameters:
3497
Parameters:
3496
  * eax = 68 - function number
3498
  * eax = 68 - function number
3497
  * ebx = 26 - subfunction number
3499
  * ebx = 26 - subfunction number
3498
  * ecx = pointer to the memory block, allocated by subfunction 12
3500
  * ecx = pointer to the memory block, allocated by subfunction 12
3499
  * edx = offset from the block beginnings
3501
  * edx = offset from the block beginnings
3500
  * esi = the size of the region of memory to release, in bytes
3502
  * esi = the size of the region of memory to release, in bytes
3501
Remarks:
3503
Remarks:
3502
  * function release range of pages from ecx+edx to ecx+edx+esi
3504
  * function release range of pages from ecx+edx to ecx+edx+esi
3503
    and set virtual memory into reserved state.
3505
    and set virtual memory into reserved state.
3504
 
3506
 
3505
---------------------- Constants for registers: ----------------------
3507
---------------------- Constants for registers: ----------------------
3506
  eax - SF_SYS_MISC (68)
3508
  eax - SF_SYS_MISC (68)
3507
  ebx - SSF_MEM_FREE_EXT (26)
3509
  ebx - SSF_MEM_FREE_EXT (26)
3508
======================================================================
3510
======================================================================
3509
========== Function 68, subfunction 27 - load file ===================
3511
========== Function 68, subfunction 27 - load file ===================
3510
======================================================================
3512
======================================================================
3511
Parameters:
3513
Parameters:
3512
  * eax = 68 - function number
3514
  * eax = 68 - function number
3513
  * ebx = 27 - subfunction number
3515
  * ebx = 27 - subfunction number
3514
  * ecx = pointer to ASCIIZ-string with the filename
3516
  * ecx = pointer to ASCIIZ-string with the filename
3515
Returned value:
3517
Returned value:
3516
  * eax = pointer to the loaded file, or zero
3518
  * eax = pointer to the loaded file, or zero
3517
  * edx = size of the loaded file, or zero
3519
  * edx = size of the loaded file, or zero
3518
Remarks:
3520
Remarks:
3519
  * function loads file and unpacks, if necessary
3521
  * function loads file and unpacks, if necessary
3520
 
3522
 
3521
---------------------- Constants for registers: ----------------------
3523
---------------------- Constants for registers: ----------------------
3522
  eax - SF_SYS_MISC (68)
3524
  eax - SF_SYS_MISC (68)
3523
  ebx - SSF_LOAD_FILE (27)
3525
  ebx - SSF_LOAD_FILE (27)
3524
======================================================================
3526
======================================================================
3525
====================== Function 69 - debugging. ======================
3527
====================== Function 69 - debugging. ======================
3526
======================================================================
3528
======================================================================
3527
A process can load other process as debugged by set of corresponding
3529
A process can load other process as debugged by set of corresponding
3528
bit by call to subfunction 7 of function 70.
3530
bit by call to subfunction 7 of function 70.
3529
A process can have only one debugger; one process can debug some
3531
A process can have only one debugger; one process can debug some
3530
others. The system notifies debugger on events occuring with
3532
others. The system notifies debugger on events occuring with
3531
debugged process. Messages are written to the buffer defined by
3533
debugged process. Messages are written to the buffer defined by
3532
subfunction 0.
3534
subfunction 0.
3533
Format of a message:
3535
Format of a message:
3534
  * +0: dword: message code
3536
  * +0: dword: message code
3535
  * +4: dword: PID of debugged process
3537
  * +4: dword: PID of debugged process
3536
  * +8: there can be additional data depending on message code
3538
  * +8: there can be additional data depending on message code
3537
Message codes:
3539
Message codes:
3538
  * 1 = exception
3540
  * 1 = exception
3539
    * in addition dword-number of the exception is given
3541
    * in addition dword-number of the exception is given
3540
    * process is suspended
3542
    * process is suspended
3541
  * 2 = process has terminated
3543
  * 2 = process has terminated
3542
    * comes at any termination: both through the system function -1,
3544
    * comes at any termination: both through the system function -1,
3543
      and at "murder" by any other process (including debugger itself)
3545
      and at "murder" by any other process (including debugger itself)
3544
  * 3 = debug exception int 1 = #DB
3546
  * 3 = debug exception int 1 = #DB
3545
    * in addition dword-image of the register DR6 is given:
3547
    * in addition dword-image of the register DR6 is given:
3546
      * bits 0-3: condition of the corresponding breakpoint (set by
3548
      * bits 0-3: condition of the corresponding breakpoint (set by
3547
        subfunction 9) is satisfied
3549
        subfunction 9) is satisfied
3548
      * bit 14: exception has occured because of the trace mode
3550
      * bit 14: exception has occured because of the trace mode
3549
        (flag TF is set TF)
3551
        (flag TF is set TF)
3550
    * process is suspended
3552
    * process is suspended
3551
When debugger terminates, all debugged processes are killed.
3553
When debugger terminates, all debugged processes are killed.
3552
If debugger does not want this, it must previously detach by
3554
If debugger does not want this, it must previously detach by
3553
subfunction 3.
3555
subfunction 3.
3554
 
3556
 
3555
All subfunctions are applicable only to processes/threads started
3557
All subfunctions are applicable only to processes/threads started
3556
from the current by function 70 with set debugging flag.
3558
from the current by function 70 with set debugging flag.
3557
Debugging of multithreaded programs is not supported yet.
3559
Debugging of multithreaded programs is not supported yet.
3558
The full list of subfunctions:
3560
The full list of subfunctions:
3559
  * subfunction 0 - define data area for debug messages
3561
  * subfunction 0 - define data area for debug messages
3560
  * subfunction 1 - get contents of registers of debugged thread
3562
  * subfunction 1 - get contents of registers of debugged thread
3561
  * subfunction 2 - set contents of registers of debugged thread
3563
  * subfunction 2 - set contents of registers of debugged thread
3562
  * subfunction 3 - detach from debugged process
3564
  * subfunction 3 - detach from debugged process
3563
  * subfunction 4 - suspend debugged thread
3565
  * subfunction 4 - suspend debugged thread
3564
  * subfunction 5 - resume debugged thread
3566
  * subfunction 5 - resume debugged thread
3565
  * subfunction 6 - read from the memory of debugged process
3567
  * subfunction 6 - read from the memory of debugged process
3566
  * subfunction 7 - write to the memory of debugged process
3568
  * subfunction 7 - write to the memory of debugged process
3567
  * subfunction 8 - terminate debugged thread
3569
  * subfunction 8 - terminate debugged thread
3568
  * subfunction 9 - set/clear hardware breakpoint
3570
  * subfunction 9 - set/clear hardware breakpoint
3569
 
3571
 
3570
---------------------- Constants for registers: ----------------------
3572
---------------------- Constants for registers: ----------------------
3571
  eax - SF_DEBUG (69)
3573
  eax - SF_DEBUG (69)
3572
  ebx - SSF_SET_MESSAGE_AREA (0), SSF_GET_REGISTERS (1),
3574
  ebx - SSF_SET_MESSAGE_AREA (0), SSF_GET_REGISTERS (1),
3573
    SSF_SET_REGISTERS (2), SSF_DETACH (3), SSF_SUSPEND (4),
3575
    SSF_SET_REGISTERS (2), SSF_DETACH (3), SSF_SUSPEND (4),
3574
    SSF_RESUME (5), SSF_READ_MEMORY (6), SSF_WRITE_MEMORY (7),
3576
    SSF_RESUME (5), SSF_READ_MEMORY (6), SSF_WRITE_MEMORY (7),
3575
    SSF_TERMINATE (8), SSF_DEFINE_BREAKPOINT (9)
3577
    SSF_TERMINATE (8), SSF_DEFINE_BREAKPOINT (9)
3576
======================================================================
3578
======================================================================
3577
= Function 69, subfunction 0 - define data area fror debug messages. =
3579
= Function 69, subfunction 0 - define data area fror debug messages. =
3578
======================================================================
3580
======================================================================
3579
Parameters:
3581
Parameters:
3580
  * eax = 69 - function number
3582
  * eax = 69 - function number
3581
  * ebx = 0 - subfunction number
3583
  * ebx = 0 - subfunction number
3582
  * ecx = pointer
3584
  * ecx = pointer
3583
Format of data area:
3585
Format of data area:
3584
  * +0: dword: N = buffer size (not including this header)
3586
  * +0: dword: N = buffer size (not including this header)
3585
  * +4: dword: occupied place
3587
  * +4: dword: occupied place
3586
  * +8: N*byte: buffer
3588
  * +8: N*byte: buffer
3587
Returned value:
3589
Returned value:
3588
  * function does not return value
3590
  * function does not return value
3589
Remarks:
3591
Remarks:
3590
  * If the size field is negative, the buffer is considered locked
3592
  * If the size field is negative, the buffer is considered locked
3591
    and at arrival of new message the system will wait.
3593
    and at arrival of new message the system will wait.
3592
    For synchronization frame all work with the buffer by operations
3594
    For synchronization frame all work with the buffer by operations
3593
    lock/unlock
3595
    lock/unlock
3594
        neg     [bufsize]
3596
        neg     [bufsize]
3595
  * Data in the buffer are considered as array of items with variable
3597
  * Data in the buffer are considered as array of items with variable
3596
    length - messages. Format of a message is explained in
3598
    length - messages. Format of a message is explained in
3597
    general description.
3599
    general description.
3598
 
3600
 
3599
---------------------- Constants for registers: ----------------------
3601
---------------------- Constants for registers: ----------------------
3600
  eax - SF_DEBUG (69)
3602
  eax - SF_DEBUG (69)
3601
  ebx - SSF_SET_MESSAGE_AREA (0)
3603
  ebx - SSF_SET_MESSAGE_AREA (0)
3602
======================================================================
3604
======================================================================
3603
===================== Function 69, subfunction 1 =====================
3605
===================== Function 69, subfunction 1 =====================
3604
============ Get contents of registers of debugged thread. ===========
3606
============ Get contents of registers of debugged thread. ===========
3605
======================================================================
3607
======================================================================
3606
Parameters:
3608
Parameters:
3607
  * eax = 69 - function number
3609
  * eax = 69 - function number
3608
  * ebx = 1 - subfunction number
3610
  * ebx = 1 - subfunction number
3609
  * ecx = thread identifier
3611
  * ecx = thread identifier
3610
  * edx = size of context structure, must be 0x28=40 bytes
3612
  * edx = size of context structure, must be 0x28=40 bytes
3611
  * esi = pointer to context structure
3613
  * esi = pointer to context structure
3612
Returned value:
3614
Returned value:
3613
  * function does not return value
3615
  * function does not return value
3614
Format of context structure: (FPU is not supported yet)
3616
Format of context structure: (FPU is not supported yet)
3615
  * +0: dword: eip
3617
  * +0: dword: eip
3616
  * +4: dword: eflags
3618
  * +4: dword: eflags
3617
  * +8: dword: eax
3619
  * +8: dword: eax
3618
  * +12 = +0xC: dword: ecx
3620
  * +12 = +0xC: dword: ecx
3619
  * +16 = +0x10: dword: edx
3621
  * +16 = +0x10: dword: edx
3620
  * +20 = +0x14: dword: ebx
3622
  * +20 = +0x14: dword: ebx
3621
  * +24 = +0x18: dword: esp
3623
  * +24 = +0x18: dword: esp
3622
  * +28 = +0x1C: dword: ebp
3624
  * +28 = +0x1C: dword: ebp
3623
  * +32 = +0x20: dword: esi
3625
  * +32 = +0x20: dword: esi
3624
  * +36 = +0x24: dword: edi
3626
  * +36 = +0x24: dword: edi
3625
Remarks:
3627
Remarks:
3626
  * If the thread executes code of ring-0, the function returns
3628
  * If the thread executes code of ring-0, the function returns
3627
    contents of registers of ring-3.
3629
    contents of registers of ring-3.
3628
  * Process must be loaded for debugging (as is shown in
3630
  * Process must be loaded for debugging (as is shown in
3629
    general description).
3631
    general description).
3630
 
3632
 
3631
---------------------- Constants for registers: ----------------------
3633
---------------------- Constants for registers: ----------------------
3632
  eax - SF_DEBUG (69)
3634
  eax - SF_DEBUG (69)
3633
  ebx - SSF_GET_REGISTERS (1)
3635
  ebx - SSF_GET_REGISTERS (1)
3634
======================================================================
3636
======================================================================
3635
===================== Function 69, subfunction 2 =====================
3637
===================== Function 69, subfunction 2 =====================
3636
============ Set contents of registers of debugged thread. ===========
3638
============ Set contents of registers of debugged thread. ===========
3637
======================================================================
3639
======================================================================
3638
Parameters:
3640
Parameters:
3639
  * eax = 69 - function number
3641
  * eax = 69 - function number
3640
  * ebx = 2 - subfunction number
3642
  * ebx = 2 - subfunction number
3641
  * ecx = thread identifier
3643
  * ecx = thread identifier
3642
  * edx = size of context structure, must be 0x28=40 bytes
3644
  * edx = size of context structure, must be 0x28=40 bytes
3643
Returned value:
3645
Returned value:
3644
  * function does not return value
3646
  * function does not return value
3645
Format of context structure is shown in the description of
3647
Format of context structure is shown in the description of
3646
subfunction 1.
3648
subfunction 1.
3647
Remarks:
3649
Remarks:
3648
  * If the thread executes code of ring-0, the function returns
3650
  * If the thread executes code of ring-0, the function returns
3649
    contents of registers of ring-3.
3651
    contents of registers of ring-3.
3650
  * Process must be loaded for debugging (as is shown in
3652
  * Process must be loaded for debugging (as is shown in
3651
    general description).
3653
    general description).
3652
 
3654
 
3653
---------------------- Constants for registers: ----------------------
3655
---------------------- Constants for registers: ----------------------
3654
  eax - SF_DEBUG (69)
3656
  eax - SF_DEBUG (69)
3655
  ebx - SSF_SET_REGISTERS (2)
3657
  ebx - SSF_SET_REGISTERS (2)
3656
======================================================================
3658
======================================================================
3657
===== Function 69, subfunction 3 - detach from debugged process. =====
3659
===== Function 69, subfunction 3 - detach from debugged process. =====
3658
======================================================================
3660
======================================================================
3659
Parameters:
3661
Parameters:
3660
  * eax = 69 - function number
3662
  * eax = 69 - function number
3661
  * ebx = 3 - subfunction number
3663
  * ebx = 3 - subfunction number
3662
  * ecx = identifier
3664
  * ecx = identifier
3663
Returned value:
3665
Returned value:
3664
  * function does not return value
3666
  * function does not return value
3665
Remarks:
3667
Remarks:
3666
  * If the process was suspended, it resumes execution.
3668
  * If the process was suspended, it resumes execution.
3667
 
3669
 
3668
---------------------- Constants for registers: ----------------------
3670
---------------------- Constants for registers: ----------------------
3669
  eax - SF_DEBUG (69)
3671
  eax - SF_DEBUG (69)
3670
  ebx - SSF_DETACH (3)
3672
  ebx - SSF_DETACH (3)
3671
======================================================================
3673
======================================================================
3672
======== Function 69, subfunction 4 - suspend debugged thread. =======
3674
======== Function 69, subfunction 4 - suspend debugged thread. =======
3673
======================================================================
3675
======================================================================
3674
Parameters:
3676
Parameters:
3675
  * eax = 69 - function number
3677
  * eax = 69 - function number
3676
  * ebx = 4 - subfunction number
3678
  * ebx = 4 - subfunction number
3677
  * ecx = thread identifier
3679
  * ecx = thread identifier
3678
Returned value:
3680
Returned value:
3679
  * function does not return value
3681
  * function does not return value
3680
Remarks:
3682
Remarks:
3681
  * Process must be loaded for debugging (as is shown in
3683
  * Process must be loaded for debugging (as is shown in
3682
    general description).
3684
    general description).
3683
 
3685
 
3684
---------------------- Constants for registers: ----------------------
3686
---------------------- Constants for registers: ----------------------
3685
  eax - SF_DEBUG (69)
3687
  eax - SF_DEBUG (69)
3686
  ebx - SSF_SUSPEND (4)
3688
  ebx - SSF_SUSPEND (4)
3687
======================================================================
3689
======================================================================
3688
======== Function 69, subfunction 5 - resume debugged thread. ========
3690
======== Function 69, subfunction 5 - resume debugged thread. ========
3689
======================================================================
3691
======================================================================
3690
Parameters:
3692
Parameters:
3691
  * eax = 69 - function number
3693
  * eax = 69 - function number
3692
  * ebx = 5 - subfunction number
3694
  * ebx = 5 - subfunction number
3693
  * ecx = thread identifier
3695
  * ecx = thread identifier
3694
Returned value:
3696
Returned value:
3695
  * function does not return value
3697
  * function does not return value
3696
Remarks:
3698
Remarks:
3697
  * Process must be loaded for debugging (as is shown in
3699
  * Process must be loaded for debugging (as is shown in
3698
    general description).
3700
    general description).
3699
 
3701
 
3700
---------------------- Constants for registers: ----------------------
3702
---------------------- Constants for registers: ----------------------
3701
  eax - SF_DEBUG (69)
3703
  eax - SF_DEBUG (69)
3702
  ebx - SSF_RESUME (5)
3704
  ebx - SSF_RESUME (5)
3703
======================================================================
3705
======================================================================
3704
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3706
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
3705
======================================================================
3707
======================================================================
3706
Parameters:
3708
Parameters:
3707
  * eax = 69 - function number
3709
  * eax = 69 - function number
3708
  * ebx = 6 - subfunction number
3710
  * ebx = 6 - subfunction number
3709
  * ecx = identifier
3711
  * ecx = identifier
3710
  * edx = number of bytes to read
3712
  * edx = number of bytes to read
3711
  * esi = address in the memory of debugged process
3713
  * esi = address in the memory of debugged process
3712
  * edi = pointer to buffer for data
3714
  * edi = pointer to buffer for data
3713
Returned value:
3715
Returned value:
3714
  * eax = -1 at an error (invalid PID or buffer)
3716
  * eax = -1 at an error (invalid PID or buffer)
3715
  * otherwise eax = number of read bytes (possibly, 0,
3717
  * otherwise eax = number of read bytes (possibly, 0,
3716
    if esi is too large)
3718
    if esi is too large)
3717
Remarks:
3719
Remarks:
3718
  * Process must be loaded for debugging (as is shown in
3720
  * Process must be loaded for debugging (as is shown in
3719
    general description).
3721
    general description).
3720
 
3722
 
3721
---------------------- Constants for registers: ----------------------
3723
---------------------- Constants for registers: ----------------------
3722
  eax - SF_DEBUG (69)
3724
  eax - SF_DEBUG (69)
3723
  ebx - SSF_READ_MEMORY (6)
3725
  ebx - SSF_READ_MEMORY (6)
3724
======================================================================
3726
======================================================================
3725
== Function 69, subfunction 7 - write to memory of debugged process. =
3727
== Function 69, subfunction 7 - write to memory of debugged process. =
3726
======================================================================
3728
======================================================================
3727
Parameters:
3729
Parameters:
3728
  * eax = 69 - function number
3730
  * eax = 69 - function number
3729
  * ebx = 7 - subfunction number
3731
  * ebx = 7 - subfunction number
3730
  * ecx = identifier
3732
  * ecx = identifier
3731
  * edx = number of bytes to write
3733
  * edx = number of bytes to write
3732
  * esi = address of memory in debugged process
3734
  * esi = address of memory in debugged process
3733
  * edi = pointer to data
3735
  * edi = pointer to data
3734
Returned value:
3736
Returned value:
3735
  * eax = -1 at an error (invalid PID or buffer)
3737
  * eax = -1 at an error (invalid PID or buffer)
3736
  * otherwise eax = number of written bytes (possibly, 0,
3738
  * otherwise eax = number of written bytes (possibly, 0,
3737
    if esi is too large)
3739
    if esi is too large)
3738
Remarks:
3740
Remarks:
3739
  * Process must be loaded for debugging (as is shown in
3741
  * Process must be loaded for debugging (as is shown in
3740
    general description).
3742
    general description).
3741
 
3743
 
3742
---------------------- Constants for registers: ----------------------
3744
---------------------- Constants for registers: ----------------------
3743
  eax - SF_DEBUG (69)
3745
  eax - SF_DEBUG (69)
3744
  ebx - SSF_WRITE_MEMORY (7)
3746
  ebx - SSF_WRITE_MEMORY (7)
3745
======================================================================
3747
======================================================================
3746
======= Function 69, subfunction 8 - terminate debugged thread. ======
3748
======= Function 69, subfunction 8 - terminate debugged thread. ======
3747
======================================================================
3749
======================================================================
3748
Parameters:
3750
Parameters:
3749
  * eax = 69 - function number
3751
  * eax = 69 - function number
3750
  * ebx = 8 - subfunction number
3752
  * ebx = 8 - subfunction number
3751
  * ecx = identifier
3753
  * ecx = identifier
3752
Returned value:
3754
Returned value:
3753
  * function does not return value
3755
  * function does not return value
3754
Remarks:
3756
Remarks:
3755
  * Process must be loaded for debugging (as is shown in
3757
  * Process must be loaded for debugging (as is shown in
3756
    general description).
3758
    general description).
3757
  * The function is similar to subfunction 2 of function 18
3759
  * The function is similar to subfunction 2 of function 18
3758
    with two differences: it requires first remark and
3760
    with two differences: it requires first remark and
3759
    accepts PID rather than slot number.
3761
    accepts PID rather than slot number.
3760
 
3762
 
3761
---------------------- Constants for registers: ----------------------
3763
---------------------- Constants for registers: ----------------------
3762
  eax - SF_DEBUG (69)
3764
  eax - SF_DEBUG (69)
3763
  ebx - SSF_TERMINATE (8)
3765
  ebx - SSF_TERMINATE (8)
3764
======================================================================
3766
======================================================================
3765
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3767
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
3766
======================================================================
3768
======================================================================
3767
Parameters:
3769
Parameters:
3768
  * eax = 69 - function number
3770
  * eax = 69 - function number
3769
  * ebx = 9 - subfunction number
3771
  * ebx = 9 - subfunction number
3770
  * ecx = thread identifier
3772
  * ecx = thread identifier
3771
  * dl = index of breakpoint, from 0 to 3 inclusively
3773
  * dl = index of breakpoint, from 0 to 3 inclusively
3772
  * dh = flags:
3774
  * dh = flags:
3773
    * if high bit is cleared - set breakpoint:
3775
    * if high bit is cleared - set breakpoint:
3774
      * bits 0-1 - condition:
3776
      * bits 0-1 - condition:
3775
        * 00 = breakpoint on execution
3777
        * 00 = breakpoint on execution
3776
        * 01 = breakpoint on read
3778
        * 01 = breakpoint on read
3777
        * 11 = breakpoint on read/write
3779
        * 11 = breakpoint on read/write
3778
      * bits 2-3 - length; for breakpoints on exception it must be
3780
      * bits 2-3 - length; for breakpoints on exception it must be
3779
        00, otherwise one of
3781
        00, otherwise one of
3780
        * 00 = byte
3782
        * 00 = byte
3781
        * 01 = word
3783
        * 01 = word
3782
        * 11 = dword
3784
        * 11 = dword
3783
      * esi = breakpoint address; must be aligned according to
3785
      * esi = breakpoint address; must be aligned according to
3784
        the length (i.e. must be even for word breakpoints,
3786
        the length (i.e. must be even for word breakpoints,
3785
        divisible by 4 for dword)
3787
        divisible by 4 for dword)
3786
    * if high bit is set - clear breakpoint
3788
    * if high bit is set - clear breakpoint
3787
Returned value:
3789
Returned value:
3788
  * eax = 0 - success
3790
  * eax = 0 - success
3789
  * eax = 1 - error in the input data
3791
  * eax = 1 - error in the input data
3790
  * eax = 2 - (reserved, is never returned in the current
3792
  * eax = 2 - (reserved, is never returned in the current
3791
    implementation) a global breakpoint with that index is already set
3793
    implementation) a global breakpoint with that index is already set
3792
Remarks:
3794
Remarks:
3793
  * Process must be loaded for debugging (as is shown in
3795
  * Process must be loaded for debugging (as is shown in
3794
    general description).
3796
    general description).
3795
  * Hardware breakpoints are implemented through DRx-registers of
3797
  * Hardware breakpoints are implemented through DRx-registers of
3796
    the processor, all limitations results from this.
3798
    the processor, all limitations results from this.
3797
  * The function can reinstall the breakpoint, previously set
3799
  * The function can reinstall the breakpoint, previously set
3798
    by it (and it does not inform on this).
3800
    by it (and it does not inform on this).
3799
    Carry on the list of set breakpoints in the debugger.
3801
    Carry on the list of set breakpoints in the debugger.
3800
  * Breakpoints generate debug exception #DB, on which the system
3802
  * Breakpoints generate debug exception #DB, on which the system
3801
    notifies debugger.
3803
    notifies debugger.
3802
  * Breakpoints on write and read/write act after
3804
  * Breakpoints on write and read/write act after
3803
    execution of the caused it instruction.
3805
    execution of the caused it instruction.
3804
 
3806
 
3805
---------------------- Constants for registers: ----------------------
3807
---------------------- Constants for registers: ----------------------
3806
  eax - SF_DEBUG (69)
3808
  eax - SF_DEBUG (69)
3807
  ebx - SSF_DEFINE_BREAKPOINT (9)
3809
  ebx - SSF_DEFINE_BREAKPOINT (9)
3808
======================================================================
3810
======================================================================
3809
==== Function 70 - work with file system with long names support. ====
3811
==== Function 70 - work with file system with long names support. ====
3810
======================================================================
3812
======================================================================
3811
Parameters:
3813
Parameters:
3812
  * eax = 70
3814
  * eax = 70
3813
  * ebx = pointer to the information structure
3815
  * ebx = pointer to the information structure
3814
Returned value:
3816
Returned value:
3815
  * eax = 0 - success; otherwise file system error code
3817
  * eax = 0 - success; otherwise file system error code
3816
  * some subfunctions return value in other registers too
3818
  * some subfunctions return value in other registers too
3817
General format of the information structure:
3819
General format of the information structure:
3818
  * +0: dword: subfunction number
3820
  * +0: dword: subfunction number
3819
  * +4: dword: file offset
3821
  * +4: dword: file offset
3820
  * +8: dword: high dword of offset (must be 0) or flags field
3822
  * +8: dword: high dword of offset (must be 0) or flags field
3821
  * +12 = +0xC: dword: size
3823
  * +12 = +0xC: dword: size
3822
  * +16 = +0x10: dword: pointer to data
3824
  * +16 = +0x10: dword: pointer to data
3823
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3825
  * +20 = +0x14: n db: ASCIIZ-string with the filename
3824
    or
3826
    or
3825
  * +20 = +0x14: db 0
3827
  * +20 = +0x14: db 0
3826
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3828
  * +21 = +0x15: dd pointer to ASCIIZ-string with the filename
3827
Specifications - in documentation on the appropriate subfunction.
3829
Specifications - in documentation on the appropriate subfunction.
3828
Filename is case-insensitive. Russian letters must be written in
3830
Filename is case-insensitive. Russian letters must be written in
3829
the encoding cp866 (DOS).
3831
the encoding cp866 (DOS).
3830
Format of filename:
3832
Format of filename:
3831
/base/number/dir1/dir2/.../dirn/file,
3833
/base/number/dir1/dir2/.../dirn/file,
3832
where /base/number identifies device, on which file is located:
3834
where /base/number identifies device, on which file is located:
3833
one of
3835
one of
3834
  * /RD/1 = /RAMDISK/1 to access ramdisk
3836
  * /RD/1 = /RAMDISK/1 to access ramdisk
3835
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3837
  * /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
3836
    /FD/2 = /FLOPPYDISK/2 to access second one
3838
    /FD/2 = /FLOPPYDISK/2 to access second one
3837
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3839
  * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
3838
    IDE0 (Primary Master), IDE1 (Primary Slave),
3840
    IDE0 (Primary Master), IDE1 (Primary Slave),
3839
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3841
    IDE2 (Secondary Master), IDE3 (Secondary Slave);
3840
    x - partition number on the selected hard drive, varies from 1
3842
    x - partition number on the selected hard drive, varies from 1
3841
    to 255 (on each hard drive the indexing starts from 1)
3843
    to 255 (on each hard drive the indexing starts from 1)
3842
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3844
  * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
3843
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3845
    CD on IDE0 (Primary Master), IDE1 (Primary Slave),
3844
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3846
    IDE2 (Secondary Master), IDE3 (Secondary Slave)
3845
  * /SYS means system folder; with the usual boot (from floppy)
3847
  * /SYS means system folder; with the usual boot (from floppy)
3846
    is equivalent to /RD/1
3848
    is equivalent to /RD/1
3847
Examples:
3849
Examples:
3848
  * '/rd/1/kernel.asm',0
3850
  * '/rd/1/kernel.asm',0
3849
  * '/HD0/1/kernel.asm',0
3851
  * '/HD0/1/kernel.asm',0
3850
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3852
  * '/hd0/2/menuet/pics/tanzania.bmp',0
3851
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3853
  * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
3852
  * '/sys/MySuperApp.ini',0
3854
  * '/sys/MySuperApp.ini',0
3853
Also function supports relative names.  If the path begins not
3855
Also function supports relative names.  If the path begins not
3854
with '/', it is considered relative to a current folder. To get or
3856
with '/', it is considered relative to a current folder. To get or
3855
set a current folder, use the function 30.
3857
set a current folder, use the function 30.
3856
 
3858
 
3857
Available subfunctions:
3859
Available subfunctions:
3858
  * subfunction 0 - read file
3860
  * subfunction 0 - read file
3859
  * subfunction 1 - read folder
3861
  * subfunction 1 - read folder
3860
  * subfunction 2 - create/rewrite file
3862
  * subfunction 2 - create/rewrite file
3861
  * subfunction 3 - write to existing file
3863
  * subfunction 3 - write to existing file
3862
  * subfunction 4 - set file size
3864
  * subfunction 4 - set file size
3863
  * subfunction 5 - get attributes of file/folder
3865
  * subfunction 5 - get attributes of file/folder
3864
  * subfunction 6 - set attributes of file/folder
3866
  * subfunction 6 - set attributes of file/folder
3865
  * subfunction 7 - start application
3867
  * subfunction 7 - start application
3866
  * subfunction 8 - delete file/folder
3868
  * subfunction 8 - delete file/folder
3867
  * subfunction 9 - create folder
3869
  * subfunction 9 - create folder
3868
For CD-drives due to hardware limitations only subfunctions
3870
For CD-drives due to hardware limitations only subfunctions
3869
0,1,5 and 7 are available, other subfunctions return error
3871
0,1,5 and 7 are available, other subfunctions return error
3870
with code 2.
3872
with code 2.
3871
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3873
At the first call of subfunctions 0,1,5,7 to ATAPI devices
3872
(CD and DVD) the manual control of tray is locked due to caching
3874
(CD and DVD) the manual control of tray is locked due to caching
3873
drive data. Unlocking is made when subfunction 4 of function 24
3875
drive data. Unlocking is made when subfunction 4 of function 24
3874
is called for corresponding device.
3876
is called for corresponding device.
3875
 
3877
 
3876
---------------------- Constants for registers: ----------------------
3878
---------------------- Constants for registers: ----------------------
3877
  eax - SF_FILE (70)
3879
  eax - SF_FILE (70)
3878
 [ebx] - SSF_READ_FILE (0), SSF_READ_FOLDER (1), SSF_CREATE_FILE (2),
3880
 [ebx] - SSF_READ_FILE (0), SSF_READ_FOLDER (1), SSF_CREATE_FILE (2),
3879
    SSF_WRITE_FILE (3), SSF_SET_END (4), SSF_GET_INFO (5),
3881
    SSF_WRITE_FILE (3), SSF_SET_END (4), SSF_GET_INFO (5),
3880
    SSF_SET_INFO (6), SSF_START_APP (7), SSF_DELETE (8),
3882
    SSF_SET_INFO (6), SSF_START_APP (7), SSF_DELETE (8),
3881
    SSF_CREATE_FOLDER (9)
3883
    SSF_CREATE_FOLDER (9)
3882
======================================================================
3884
======================================================================
3883
=== Function 70, subfunction 0 - read file with long names support. ==
3885
=== Function 70, subfunction 0 - read file with long names support. ==
3884
======================================================================
3886
======================================================================
3885
Parameters:
3887
Parameters:
3886
  * eax = 70 - function number
3888
  * eax = 70 - function number
3887
  * ebx = pointer to the information structure
3889
  * ebx = pointer to the information structure
3888
Format of the information structure:
3890
Format of the information structure:
3889
  * +0: dword: 0 = subfunction number
3891
  * +0: dword: 0 = subfunction number
3890
  * +4: dword: file offset (in bytes)
3892
  * +4: dword: file offset (in bytes)
3891
  * +8: dword: 0 (reserved for high dword of offset)
3893
  * +8: dword: 0 (reserved for high dword of offset)
3892
  * +12 = +0xC: dword: number of bytes to read
3894
  * +12 = +0xC: dword: number of bytes to read
3893
  * +16 = +0x10: dword: pointer to buffer for data
3895
  * +16 = +0x10: dword: pointer to buffer for data
3894
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3896
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
3895
    given in the general description
3897
    given in the general description
3896
    or
3898
    or
3897
  * +20 = +0x14: db 0
3899
  * +20 = +0x14: db 0
3898
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3900
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3899
Returned value:
3901
Returned value:
3900
  * eax = 0 - success, otherwise file system error code
3902
  * eax = 0 - success, otherwise file system error code
3901
  * ebx = number of read bytes or -1=0xffffffff if file was not found
3903
  * ebx = number of read bytes or -1=0xffffffff if file was not found
3902
Remarks:
3904
Remarks:
3903
  * If file was ended before last requested block was read,
3905
  * If file was ended before last requested block was read,
3904
    the function will read as many as it can, and after that return
3906
    the function will read as many as it can, and after that return
3905
    eax=6 (EOF).
3907
    eax=6 (EOF).
3906
  * The function does not allow to read folder (returns eax=10,
3908
  * The function does not allow to read folder (returns eax=10,
3907
    access denied).
3909
    access denied).
3908
 
3910
 
3909
---------------------- Constants for registers: ----------------------
3911
---------------------- Constants for registers: ----------------------
3910
  eax - SF_FILE (70)
3912
  eax - SF_FILE (70)
3911
 [ebx] - SSF_READ_FILE (0)
3913
 [ebx] - SSF_READ_FILE (0)
3912
======================================================================
3914
======================================================================
3913
== Function 70, subfunction 1 - read folder with long names support. =
3915
== Function 70, subfunction 1 - read folder with long names support. =
3914
======================================================================
3916
======================================================================
3915
Parameters:
3917
Parameters:
3916
  * eax = 70 - function number
3918
  * eax = 70 - function number
3917
  * ebx = pointer to the information structure
3919
  * ebx = pointer to the information structure
3918
Format of the information structure:
3920
Format of the information structure:
3919
  * +0: dword: 1 = subfunction number
3921
  * +0: dword: 1 = subfunction number
3920
  * +4: dword: index of starting block (beginning from 0)
3922
  * +4: dword: index of starting block (beginning from 0)
3921
  * +8: dword: flags field:
3923
  * +8: dword: flags field:
3922
    * bit 0 (mask 1): in what format to return names,
3924
    * bit 0 (mask 1): in what format to return names,
3923
      0=ANSI, 1=UNICODE
3925
      0=ANSI, 1=UNICODE
3924
    * other bits are reserved and must be set to 0 for the future
3926
    * other bits are reserved and must be set to 0 for the future
3925
      compatibility
3927
      compatibility
3926
  * +12 = +0xC: dword: number of blocks to read
3928
  * +12 = +0xC: dword: number of blocks to read
3927
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
3929
  * +16 = +0x10: dword: pointer to buffer for data, buffer size
3928
    must be not less than 32 + [+12]*560 bytes
3930
    must be not less than 32 + [+12]*560 bytes
3929
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3931
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
3930
    given in the general description
3932
    given in the general description
3931
    or
3933
    or
3932
  * +20 = +0x14: db 0
3934
  * +20 = +0x14: db 0
3933
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3935
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
3934
Returned value:
3936
Returned value:
3935
  * eax = 0 - success, otherwise file system error code
3937
  * eax = 0 - success, otherwise file system error code
3936
  * ebx = number of files, information on which was written to
3938
  * ebx = number of files, information on which was written to
3937
    the buffer, or -1=0xffffffff, if folder was not found
3939
    the buffer, or -1=0xffffffff, if folder was not found
3938
Structure of the buffer:
3940
Structure of the buffer:
3939
  * +0: 32*byte: header
3941
  * +0: 32*byte: header
3940
  * +32 = +0x20: n1*byte: block with information on file 1
3942
  * +32 = +0x20: n1*byte: block with information on file 1
3941
  * +32+n1: n2*byte: block with information on file 2
3943
  * +32+n1: n2*byte: block with information on file 2
3942
  * ...
3944
  * ...
3943
Structure of header:
3945
Structure of header:
3944
  * +0: dword: version of structure (current is 1)
3946
  * +0: dword: version of structure (current is 1)
3945
  * +4: dword: number of placed blocks; is not greater than requested
3947
  * +4: dword: number of placed blocks; is not greater than requested
3946
    in the field +12 of information structure; can be less, if
3948
    in the field +12 of information structure; can be less, if
3947
    there are no more files in folder (the same as in ebx)
3949
    there are no more files in folder (the same as in ebx)
3948
  * +8: dword: total number of files in folder
3950
  * +8: dword: total number of files in folder
3949
  * +12 = +0xC: 20*byte: reserved (zeroed)
3951
  * +12 = +0xC: 20*byte: reserved (zeroed)
3950
Structure of block of data for folder entry (BDFE):
3952
Structure of block of data for folder entry (BDFE):
3951
  * +0: dword: attributes of file:
3953
  * +0: dword: attributes of file:
3952
    * bit 0 (mask 1): file is read-only
3954
    * bit 0 (mask 1): file is read-only
3953
    * bit 1 (mask 2): file is hidden
3955
    * bit 1 (mask 2): file is hidden
3954
    * bit 2 (mask 4): file is system
3956
    * bit 2 (mask 4): file is system
3955
    * bit 3 (mask 8): this is not a file but volume label
3957
    * bit 3 (mask 8): this is not a file but volume label
3956
      (for one partition meets no more than once and
3958
      (for one partition meets no more than once and
3957
      only in root folder)
3959
      only in root folder)
3958
    * bit 4 (mask 0x10): this is a folder
3960
    * bit 4 (mask 0x10): this is a folder
3959
    * bit 5 (mask 0x20): file was not archived - many archivation
3961
    * bit 5 (mask 0x20): file was not archived - many archivation
3960
      programs have an option to archive only files with this bit set,
3962
      programs have an option to archive only files with this bit set,
3961
      and after archiving this bit is cleared - it can be useful
3963
      and after archiving this bit is cleared - it can be useful
3962
      for automatically creating of backup-archives as at writing
3964
      for automatically creating of backup-archives as at writing
3963
      this bit is usually set
3965
      this bit is usually set
3964
  * +4: byte: type of name data:
3966
  * +4: byte: type of name data:
3965
    (coincides with bit 0 of flags in the information structure)
3967
    (coincides with bit 0 of flags in the information structure)
3966
    * 0 = ASCII = 1-byte representation of each character
3968
    * 0 = ASCII = 1-byte representation of each character
3967
    * 1 = UNICODE = 2-byte representation of each character
3969
    * 1 = UNICODE = 2-byte representation of each character
3968
  * +5: 3*byte: reserved (zero)
3970
  * +5: 3*byte: reserved (zero)
3969
  * +8: 4*byte: time of file creation
3971
  * +8: 4*byte: time of file creation
3970
  * +12 = +0xC: 4*byte: date of file creation
3972
  * +12 = +0xC: 4*byte: date of file creation
3971
  * +16 = +0x10: 4*byte: time of last access (read or write)
3973
  * +16 = +0x10: 4*byte: time of last access (read or write)
3972
  * +20 = +0x14: 4*byte: date of last access
3974
  * +20 = +0x14: 4*byte: date of last access
3973
  * +24 = +0x18: 4*byte: time of last modification
3975
  * +24 = +0x18: 4*byte: time of last modification
3974
  * +28 = +0x1C: 4*byte: date of last modification
3976
  * +28 = +0x1C: 4*byte: date of last modification
3975
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
3977
  * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
3976
  * +40 = +0x28: name
3978
  * +40 = +0x28: name
3977
    * for ASCII format: maximum length is 263 characters
3979
    * for ASCII format: maximum length is 263 characters
3978
      (263 bytes), byte after the name has value 0
3980
      (263 bytes), byte after the name has value 0
3979
    * for UNICODE format: maximum length is 259 characters
3981
    * for UNICODE format: maximum length is 259 characters
3980
      (518 bytes), 2 bytes after the name have value 0
3982
      (518 bytes), 2 bytes after the name have value 0
3981
Time format:
3983
Time format:
3982
  * +0: byte: seconds
3984
  * +0: byte: seconds
3983
  * +1: byte: minutes
3985
  * +1: byte: minutes
3984
  * +2: byte: hours
3986
  * +2: byte: hours
3985
  * +3: byte: reserved (0)
3987
  * +3: byte: reserved (0)
3986
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
3988
  * for example, 23.59.59 is written as (in hex) 3B 3B 17 00
3987
Date format:
3989
Date format:
3988
  * +0: byte: day
3990
  * +0: byte: day
3989
  * +1: byte: month
3991
  * +1: byte: month
3990
  * +2: word: year
3992
  * +2: word: year
3991
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
3993
  * for example, 25.11.1979 is written as (in hex) 19 0B BB 07
3992
Remarks:
3994
Remarks:
3993
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
3995
  * If BDFE contains ASCII name, the length of BDFE is 304 bytes,
3994
    if UNICODE name - 560 bytes. Value of length is aligned
3996
    if UNICODE name - 560 bytes. Value of length is aligned
3995
    on 16-byte bound (to accelerate processing in CPU cache).
3997
    on 16-byte bound (to accelerate processing in CPU cache).
3996
  * First character after a name is zero (ASCIIZ-string). The further
3998
  * First character after a name is zero (ASCIIZ-string). The further
3997
    data contain garbage.
3999
    data contain garbage.
3998
  * If files in folder were ended before requested number was read,
4000
  * If files in folder were ended before requested number was read,
3999
    the function will read as many as it can, and after that return
4001
    the function will read as many as it can, and after that return
4000
    eax=6 (EOF).
4002
    eax=6 (EOF).
4001
  * Any folder on the disk, except for root, contains two special
4003
  * Any folder on the disk, except for root, contains two special
4002
    entries "." and "..", identifying accordingly the folder itself
4004
    entries "." and "..", identifying accordingly the folder itself
4003
    and the parent folder.
4005
    and the parent folder.
4004
  * The function allows also to read virtual folders "/", "/rd",
4006
  * The function allows also to read virtual folders "/", "/rd",
4005
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4007
    "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
4006
    and times and dates are zeroed. An alternative way to get the
4008
    and times and dates are zeroed. An alternative way to get the
4007
    equipment information - subfunction 11 of function 18.
4009
    equipment information - subfunction 11 of function 18.
4008
 
4010
 
4009
---------------------- Constants for registers: ----------------------
4011
---------------------- Constants for registers: ----------------------
4010
  eax - SF_FILE (70)
4012
  eax - SF_FILE (70)
4011
 [ebx] - SSF_READ_FOLDER (1)
4013
 [ebx] - SSF_READ_FOLDER (1)
4012
======================================================================
4014
======================================================================
4013
===================== Function 70, subfunction 2 =====================
4015
===================== Function 70, subfunction 2 =====================
4014
============ Create/rewrite file with long names support. ============
4016
============ Create/rewrite file with long names support. ============
4015
======================================================================
4017
======================================================================
4016
Parameters:
4018
Parameters:
4017
  * eax = 70 - function number
4019
  * eax = 70 - function number
4018
  * ebx = pointer to the information structure
4020
  * ebx = pointer to the information structure
4019
Format of the information structure:
4021
Format of the information structure:
4020
  * +0: dword: 2 = subfunction number
4022
  * +0: dword: 2 = subfunction number
4021
  * +4: dword: 0 (reserved)
4023
  * +4: dword: 0 (reserved)
4022
  * +8: dword: 0 (reserved)
4024
  * +8: dword: 0 (reserved)
4023
  * +12 = +0xC: dword: number of bytes to write
4025
  * +12 = +0xC: dword: number of bytes to write
4024
  * +16 = +0x10: dword: pointer to data
4026
  * +16 = +0x10: dword: pointer to data
4025
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4027
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4026
    given in the general description
4028
    given in the general description
4027
    or
4029
    or
4028
  * +20 = +0x14: db 0
4030
  * +20 = +0x14: db 0
4029
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4031
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4030
Returned value:
4032
Returned value:
4031
  * eax = 0 - success, otherwise file system error code
4033
  * eax = 0 - success, otherwise file system error code
4032
  * ebx = number of written bytes (possibly 0)
4034
  * ebx = number of written bytes (possibly 0)
4033
Remarks:
4035
Remarks:
4034
  * If a file with given name did not exist, it is created;
4036
  * If a file with given name did not exist, it is created;
4035
    if it existed, it is rewritten.
4037
    if it existed, it is rewritten.
4036
  * If there is not enough free space on disk, the function will
4038
  * If there is not enough free space on disk, the function will
4037
    write as many as can and then return error code 8.
4039
    write as many as can and then return error code 8.
4038
  * The function is not supported for CD (returns error code 2).
4040
  * The function is not supported for CD (returns error code 2).
4039
 
4041
 
4040
---------------------- Constants for registers: ----------------------
4042
---------------------- Constants for registers: ----------------------
4041
  eax - SF_FILE (70)
4043
  eax - SF_FILE (70)
4042
 [ebx] - SSF_CREATE_FILE (2)
4044
 [ebx] - SSF_CREATE_FILE (2)
4043
======================================================================
4045
======================================================================
4044
===================== Function 70, subfunction 3 =====================
4046
===================== Function 70, subfunction 3 =====================
4045
=========== Write to existing file with long names support. ==========
4047
=========== Write to existing file with long names support. ==========
4046
======================================================================
4048
======================================================================
4047
Parameters:
4049
Parameters:
4048
  * eax = 70 - function number
4050
  * eax = 70 - function number
4049
  * ebx = pointer to the information structure
4051
  * ebx = pointer to the information structure
4050
Format of the information structure:
4052
Format of the information structure:
4051
  * +0: dword: 3 = subfunction number
4053
  * +0: dword: 3 = subfunction number
4052
  * +4: dword: file offset (in bytes)
4054
  * +4: dword: file offset (in bytes)
4053
  * +8: dword: high dword of offset (must be 0 for FAT)
4055
  * +8: dword: high dword of offset (must be 0 for FAT)
4054
  * +12 = +0xC: dword: number of bytes to write
4056
  * +12 = +0xC: dword: number of bytes to write
4055
  * +16 = +0x10: dword: pointer to data
4057
  * +16 = +0x10: dword: pointer to data
4056
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4058
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4057
    given in the general description
4059
    given in the general description
4058
    or
4060
    or
4059
  * +20 = +0x14: db 0
4061
  * +20 = +0x14: db 0
4060
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4062
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4061
Returned value:
4063
Returned value:
4062
  * eax = 0 - success, otherwise file system error code
4064
  * eax = 0 - success, otherwise file system error code
4063
  * ebx = number of written bytes (possibly 0)
4065
  * ebx = number of written bytes (possibly 0)
4064
Remarks:
4066
Remarks:
4065
  * The file must already exist, otherwise function returns eax=5.
4067
  * The file must already exist, otherwise function returns eax=5.
4066
  * The only result of write 0 bytes is update in the file attributes
4068
  * The only result of write 0 bytes is update in the file attributes
4067
    date/time of modification and access to the current date/time.
4069
    date/time of modification and access to the current date/time.
4068
  * If beginning and/or ending position is greater than file size
4070
  * If beginning and/or ending position is greater than file size
4069
    (except for the previous case), the file is expanded to needed
4071
    (except for the previous case), the file is expanded to needed
4070
    size with zero characters.
4072
    size with zero characters.
4071
  * The function is not supported for CD (returns error code 2).
4073
  * The function is not supported for CD (returns error code 2).
4072
 
4074
 
4073
---------------------- Constants for registers: ----------------------
4075
---------------------- Constants for registers: ----------------------
4074
  eax - SF_FILE (70)
4076
  eax - SF_FILE (70)
4075
 [ebx] - SSF_WRITE_FILE (3)
4077
 [ebx] - SSF_WRITE_FILE (3)
4076
======================================================================
4078
======================================================================
4077
============ Function 70, subfunction 4 - set end of file. ===========
4079
============ Function 70, subfunction 4 - set end of file. ===========
4078
======================================================================
4080
======================================================================
4079
Parameters:
4081
Parameters:
4080
  * eax = 70 - function number
4082
  * eax = 70 - function number
4081
  * ebx = pointer to the information structure
4083
  * ebx = pointer to the information structure
4082
Format of the information structure:
4084
Format of the information structure:
4083
  * +0: dword: 4 = subfunction number
4085
  * +0: dword: 4 = subfunction number
4084
  * +4: dword: low dword of new file size
4086
  * +4: dword: low dword of new file size
4085
  * +8: dword: high dword of new file size (must be 0 for FAT)
4087
  * +8: dword: high dword of new file size (must be 0 for FAT)
4086
  * +12 = +0xC: dword: 0 (reserved)
4088
  * +12 = +0xC: dword: 0 (reserved)
4087
  * +16 = +0x10: dword: 0 (reserved)
4089
  * +16 = +0x10: dword: 0 (reserved)
4088
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4090
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4089
    given in the general description
4091
    given in the general description
4090
    or
4092
    or
4091
  * +20 = +0x14: db 0
4093
  * +20 = +0x14: db 0
4092
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4094
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4093
Returned value:
4095
Returned value:
4094
  * eax = 0 - success, otherwise file system error code
4096
  * eax = 0 - success, otherwise file system error code
4095
  * ebx destroyed
4097
  * ebx destroyed
4096
Remarks:
4098
Remarks:
4097
  * If the new file size is less than old one, file is truncated.
4099
  * If the new file size is less than old one, file is truncated.
4098
    If the new size is greater than old one, file is expanded with
4100
    If the new size is greater than old one, file is expanded with
4099
    characters with code 0. If the new size is equal to old one,
4101
    characters with code 0. If the new size is equal to old one,
4100
    the only result of call is set date/time of modification and
4102
    the only result of call is set date/time of modification and
4101
    access to the current date/time.
4103
    access to the current date/time.
4102
  * If there is not enough free space on disk for expansion, the
4104
  * If there is not enough free space on disk for expansion, the
4103
    function will expand to maximum possible size and then return
4105
    function will expand to maximum possible size and then return
4104
    error code 8.
4106
    error code 8.
4105
  * The function is not supported for CD (returns error code 2).
4107
  * The function is not supported for CD (returns error code 2).
4106
 
4108
 
4107
---------------------- Constants for registers: ----------------------
4109
---------------------- Constants for registers: ----------------------
4108
  eax - SF_FILE (70)
4110
  eax - SF_FILE (70)
4109
 [ebx] - SSF_SET_END (4)
4111
 [ebx] - SSF_SET_END (4)
4110
======================================================================
4112
======================================================================
4111
==== Function 70, subfunction 5 - get information on file/folder. ====
4113
==== Function 70, subfunction 5 - get information on file/folder. ====
4112
======================================================================
4114
======================================================================
4113
Parameters:
4115
Parameters:
4114
  * eax = 70 - function number
4116
  * eax = 70 - function number
4115
  * ebx = pointer to the information structure
4117
  * ebx = pointer to the information structure
4116
Format of the information structure:
4118
Format of the information structure:
4117
  * +0: dword: 5 = subfunction number
4119
  * +0: dword: 5 = subfunction number
4118
  * +4: dword: 0 (reserved)
4120
  * +4: dword: 0 (reserved)
4119
  * +8: dword: 0 (reserved)
4121
  * +8: dword: 0 (reserved)
4120
  * +12 = +0xC: dword: 0 (reserved)
4122
  * +12 = +0xC: dword: 0 (reserved)
4121
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4123
  * +16 = +0x10: dword: pointer to buffer for data (40 bytes)
4122
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4124
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4123
    given in the general description
4125
    given in the general description
4124
    or
4126
    or
4125
  * +20 = +0x14: db 0
4127
  * +20 = +0x14: db 0
4126
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4128
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4127
Returned value:
4129
Returned value:
4128
  * eax = 0 - success, otherwise file system error code
4130
  * eax = 0 - success, otherwise file system error code
4129
  * ebx destroyed
4131
  * ebx destroyed
4130
Information on file is returned in the BDFE format (block of data
4132
Information on file is returned in the BDFE format (block of data
4131
for folder entry), explained in the description of
4133
for folder entry), explained in the description of
4132
subfunction 1, but without filename
4134
subfunction 1, but without filename
4133
(i.e. only first 40 = 0x28 bytes).
4135
(i.e. only first 40 = 0x28 bytes).
4134
Remarks:
4136
Remarks:
4135
  * The function does not support virtual folders such as /, /rd and
4137
  * The function does not support virtual folders such as /, /rd and
4136
    root folders like /rd/1.
4138
    root folders like /rd/1.
4137
 
4139
 
4138
---------------------- Constants for registers: ----------------------
4140
---------------------- Constants for registers: ----------------------
4139
  eax - SF_FILE (70)
4141
  eax - SF_FILE (70)
4140
 [ebx] - SSF_GET_INFO (5)
4142
 [ebx] - SSF_GET_INFO (5)
4141
======================================================================
4143
======================================================================
4142
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4144
===== Function 70, subfunction 6 - set attributes of file/folder. ====
4143
======================================================================
4145
======================================================================
4144
Parameters:
4146
Parameters:
4145
  * eax = 70 - function number
4147
  * eax = 70 - function number
4146
  * ebx = pointer to the information structure
4148
  * ebx = pointer to the information structure
4147
Format of the information structure:
4149
Format of the information structure:
4148
  * +0: dword: 6 = subfunction number
4150
  * +0: dword: 6 = subfunction number
4149
  * +4: dword: 0 (reserved)
4151
  * +4: dword: 0 (reserved)
4150
  * +8: dword: 0 (reserved)
4152
  * +8: dword: 0 (reserved)
4151
  * +12 = +0xC: dword: 0 (reserved)
4153
  * +12 = +0xC: dword: 0 (reserved)
4152
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4154
  * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
4153
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4155
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4154
    given in the general description
4156
    given in the general description
4155
    or
4157
    or
4156
  * +20 = +0x14: db 0
4158
  * +20 = +0x14: db 0
4157
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4159
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4158
Returned value:
4160
Returned value:
4159
  * eax = 0 - success, otherwise file system error code
4161
  * eax = 0 - success, otherwise file system error code
4160
  * ebx destroyed
4162
  * ebx destroyed
4161
File attributes are first 32 bytes in BDFE (block of data
4163
File attributes are first 32 bytes in BDFE (block of data
4162
for folder entry), explained in the description of subfunction 1
4164
for folder entry), explained in the description of subfunction 1
4163
(that is, without name and size of file). Attribute
4165
(that is, without name and size of file). Attribute
4164
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4166
file/folder/volume label (bits 3,4 in dword +0) is not changed.
4165
Byte +4 (name format) is ignored.
4167
Byte +4 (name format) is ignored.
4166
Remarks:
4168
Remarks:
4167
  * The function does not support virtual folders such as /, /rd and
4169
  * The function does not support virtual folders such as /, /rd and
4168
    root folders like /rd/1.
4170
    root folders like /rd/1.
4169
  * The function is not supported for CD (returns error code 2).
4171
  * The function is not supported for CD (returns error code 2).
4170
 
4172
 
4171
---------------------- Constants for registers: ----------------------
4173
---------------------- Constants for registers: ----------------------
4172
  eax - SF_FILE (70)
4174
  eax - SF_FILE (70)
4173
 [ebx] - SSF_SET_INFO (6)
4175
 [ebx] - SSF_SET_INFO (6)
4174
======================================================================
4176
======================================================================
4175
=========== Function 70, subfunction 7 - start application. ==========
4177
=========== Function 70, subfunction 7 - start application. ==========
4176
======================================================================
4178
======================================================================
4177
Parameters:
4179
Parameters:
4178
  * eax = 70 - function number
4180
  * eax = 70 - function number
4179
  * ebx = pointer to the information structure
4181
  * ebx = pointer to the information structure
4180
Format of the information structure:
4182
Format of the information structure:
4181
  * +0: dword: 7 = subfunction number
4183
  * +0: dword: 7 = subfunction number
4182
  * +4: dword: flags field:
4184
  * +4: dword: flags field:
4183
    * bit 0: start process as debugged
4185
    * bit 0: start process as debugged
4184
    * other bits are reserved and must be set to 0
4186
    * other bits are reserved and must be set to 0
4185
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4187
  * +8: dword: 0 or pointer to ASCIIZ-string with parameters
4186
  * +12 = +0xC: dword: 0 (reserved)
4188
  * +12 = +0xC: dword: 0 (reserved)
4187
  * +16 = +0x10: dword: 0 (reserved)
4189
  * +16 = +0x10: dword: 0 (reserved)
4188
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4190
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4189
    given in the general description
4191
    given in the general description
4190
    or
4192
    or
4191
  * +20 = +0x14: db 0
4193
  * +20 = +0x14: db 0
4192
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4194
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4193
Returned value:
4195
Returned value:
4194
  * eax > 0 - program is loaded, eax contains PID
4196
  * eax > 0 - program is loaded, eax contains PID
4195
  * eax < 0 - an error has occured, -eax contains
4197
  * eax < 0 - an error has occured, -eax contains
4196
    file system error code
4198
    file system error code
4197
  * ebx destroyed
4199
  * ebx destroyed
4198
Remarks:
4200
Remarks:
4199
  * Command line must be terminated by the character with the code 0
4201
  * Command line must be terminated by the character with the code 0
4200
    (ASCIIZ-string); function takes into account either all characters
4202
    (ASCIIZ-string); function takes into account either all characters
4201
    up to terminating zero inclusively or first 256 character
4203
    up to terminating zero inclusively or first 256 character
4202
    regarding what is less.
4204
    regarding what is less.
4203
  * If the process is started as debugged, it is created in
4205
  * If the process is started as debugged, it is created in
4204
    the suspended state; to run use subfunction 5 of function 69.
4206
    the suspended state; to run use subfunction 5 of function 69.
4205
 
4207
 
4206
---------------------- Constants for registers: ----------------------
4208
---------------------- Constants for registers: ----------------------
4207
  eax - SF_FILE (70)
4209
  eax - SF_FILE (70)
4208
 [ebx] - SSF_START_APP (7)
4210
 [ebx] - SSF_START_APP (7)
4209
======================================================================
4211
======================================================================
4210
========== Function 70, subfunction 8 - delete file/folder. ==========
4212
========== Function 70, subfunction 8 - delete file/folder. ==========
4211
======================================================================
4213
======================================================================
4212
Parameters:
4214
Parameters:
4213
  * eax = 70 - function number
4215
  * eax = 70 - function number
4214
  * ebx = pointer to the information structure
4216
  * ebx = pointer to the information structure
4215
Format of the information structure:
4217
Format of the information structure:
4216
  * +0: dword: 8 = subfunction number
4218
  * +0: dword: 8 = subfunction number
4217
  * +4: dword: 0 (reserved)
4219
  * +4: dword: 0 (reserved)
4218
  * +8: dword: 0 (reserved)
4220
  * +8: dword: 0 (reserved)
4219
  * +12 = +0xC: dword: 0 (reserved)
4221
  * +12 = +0xC: dword: 0 (reserved)
4220
  * +16 = +0x10: dword: 0 (reserved)
4222
  * +16 = +0x10: dword: 0 (reserved)
4221
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4223
  * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
4222
    given in the general description
4224
    given in the general description
4223
    or
4225
    or
4224
  * +20 = +0x14: db 0
4226
  * +20 = +0x14: db 0
4225
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4227
  * +21 = +0x15: dd pointer to ASCIIZ-string with file name
4226
Returned value:
4228
Returned value:
4227
  * eax = 0 - success, otherwise file system error code
4229
  * eax = 0 - success, otherwise file system error code
4228
  * ebx destroyed
4230
  * ebx destroyed
4229
Remarks:
4231
Remarks:
4230
  * The function is not supported for CD (returns error code 2).
4232
  * The function is not supported for CD (returns error code 2).
4231
  * The function can delete only empty folders (attempt to delete
4233
  * The function can delete only empty folders (attempt to delete
4232
    nonempty folder results in error with code 10, "access denied").
4234
    nonempty folder results in error with code 10, "access denied").
4233
 
4235
 
4234
---------------------- Constants for registers: ----------------------
4236
---------------------- Constants for registers: ----------------------
4235
  eax - SF_FILE (70)
4237
  eax - SF_FILE (70)
4236
 [ebx] - SSF_DELETE (8)
4238
 [ebx] - SSF_DELETE (8)
4237
======================================================================
4239
======================================================================
4238
============= Function 70, subfunction 9 - create folder. ============
4240
============= Function 70, subfunction 9 - create folder. ============
4239
======================================================================
4241
======================================================================
4240
Parameters:
4242
Parameters:
4241
  * eax = 70 - function number
4243
  * eax = 70 - function number
4242
  * ebx = pointer to the information structure
4244
  * ebx = pointer to the information structure
4243
Format of the information structure:
4245
Format of the information structure:
4244
  * +0: dword: 9 = subfunction number
4246
  * +0: dword: 9 = subfunction number
4245
  * +4: dword: 0 (reserved)
4247
  * +4: dword: 0 (reserved)
4246
  * +8: dword: 0 (reserved)
4248
  * +8: dword: 0 (reserved)
4247
  * +12 = +0xC: dword: 0 (reserved)
4249
  * +12 = +0xC: dword: 0 (reserved)
4248
  * +16 = +0x10: dword: 0 (reserved)
4250
  * +16 = +0x10: dword: 0 (reserved)
4249
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4251
  * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
4250
    given in the general description
4252
    given in the general description
4251
    or
4253
    or
4252
  * +20 = +0x14: db 0
4254
  * +20 = +0x14: db 0
4253
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
4255
  * +21 = +0x15: dd pointer to ASCIIZ-string with folder name
4254
Returned value:
4256
Returned value:
4255
  * eax = 0 - success, otherwise file system error code
4257
  * eax = 0 - success, otherwise file system error code
4256
  * ebx destroyed
4258
  * ebx destroyed
4257
Remarks:
4259
Remarks:
4258
  * The function is not supported for CD (returns error code 2).
4260
  * The function is not supported for CD (returns error code 2).
4259
  * The parent folder must already exist.
4261
  * The parent folder must already exist.
4260
  * If target folder already exists, function returns success (eax=0).
4262
  * If target folder already exists, function returns success (eax=0).
4261
 
4263
 
4262
---------------------- Constants for registers: ----------------------
4264
---------------------- Constants for registers: ----------------------
4263
  eax - SF_FILE (70)
4265
  eax - SF_FILE (70)
4264
 [ebx] - SSF_CREATE_FOLDER (9)
4266
 [ebx] - SSF_CREATE_FOLDER (9)
4265
======================================================================
4267
======================================================================
4266
========== Function 71, subfunction 1 - set window caption. ==========
4268
========== Function 71, subfunction 1 - set window caption. ==========
4267
======================================================================
4269
======================================================================
4268
Parameters:
4270
Parameters:
4269
  * eax = 71 - function number
4271
  * eax = 71 - function number
4270
  * ebx = 1 - subfunction number
4272
  * ebx = 1 - subfunction number
4271
  * ecx = pointer to zero terminated string
4273
  * ecx = pointer to zero terminated string
4272
Returned value:
4274
Returned value:
4273
  * function does not return value
4275
  * function does not return value
4274
Remarks:
4276
Remarks:
4275
  * You may set the caption string encoding by putting
4277
  * You may set the caption string encoding by putting
4276
    at the start of the string a byte with next values:
4278
    at the start of the string a byte with next values:
4277
    1 = cp866
4279
    1 = cp866
4278
    2 = UTF-16LE
4280
    2 = UTF-16LE
4279
    3 = UTF-8
4281
    3 = UTF-8
4280
    otherwise will be used cp866.
4282
    otherwise will be used cp866.
4281
  * Pass NULL in ecx to remove caption.
4283
  * Pass NULL in ecx to remove caption.
4282
 
4284
 
4283
---------------------- Constants for registers: ----------------------
4285
---------------------- Constants for registers: ----------------------
4284
  eax - SF_SET_CAPTION (71)
4286
  eax - SF_SET_CAPTION (71)
4285
======================================================================
4287
======================================================================
4286
=============== Function 72 - send message to a window. ==============
4288
=============== Function 72 - send message to a window. ==============
4287
======================================================================
4289
======================================================================
4288
 
4290
 
4289
- Subfunction 1 - send message with parameter to the active window. --
4291
- Subfunction 1 - send message with parameter to the active window. --
4290
Parameters:
4292
Parameters:
4291
  * eax = 72 - function number
4293
  * eax = 72 - function number
4292
  * ebx = 1 - subfunction number
4294
  * ebx = 1 - subfunction number
4293
  * ecx = event code: 2 or 3
4295
  * ecx = event code: 2 or 3
4294
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
4296
  * edx = parameter: key code for ecx=2, button identifier for ecx=3
4295
Returned value:
4297
Returned value:
4296
  * eax = 0 - success
4298
  * eax = 0 - success
4297
  * eax = 1 - buffer is full
4299
  * eax = 1 - buffer is full
4298
 
4300
 
4299
---------------------- Constants for registers: ----------------------
4301
---------------------- Constants for registers: ----------------------
4300
  eax - SF_SEND_MESSAGE (72)
4302
  eax - SF_SEND_MESSAGE (72)
4301
======================================================================
4303
======================================================================
4302
===================== Function 73 - blit bitmap  =====================
4304
===================== Function 73 - blit bitmap  =====================
4303
======================================================================
4305
======================================================================
4304
 
4306
 
4305
Parameters:
4307
Parameters:
4306
  * eax = 73 - function number
4308
  * eax = 73 - function number
4307
 
4309
 
4308
  * ebx = ROP and optional flags
4310
  * ebx = ROP and optional flags
4309
     31           6 5  4 3   0
4311
     31           6 5  4 3   0
4310
     [  reserved  ][T][B][ROP]
4312
     [  reserved  ][T][B][ROP]
4311
     ROP - raster operation code
4313
     ROP - raster operation code
4312
        0: Copy
4314
        0: Copy
4313
     1-15: reserved
4315
     1-15: reserved
4314
     B   - blit into the background surface
4316
     B   - blit into the background surface
4315
     T   - transparent blit
4317
     T   - transparent blit
4316
 
4318
 
4317
  * ecx = pointer to the function parameters
4319
  * ecx = pointer to the function parameters
4318
        destination offset and clipping
4320
        destination offset and clipping
4319
     +0 signed dword: destination rectangle X offset from the window
4321
     +0 signed dword: destination rectangle X offset from the window
4320
                      top-left corner
4322
                      top-left corner
4321
     +4 signed dword: destination rectangle Y offset from the window
4323
     +4 signed dword: destination rectangle Y offset from the window
4322
                      top-left corner
4324
                      top-left corner
4323
     +8 dword:        destination rectangle width
4325
     +8 dword:        destination rectangle width
4324
    +12 dword:        destination rectangle height
4326
    +12 dword:        destination rectangle height
4325
 
4327
 
4326
        source offset and clipping
4328
        source offset and clipping
4327
    +16 signed dword: source rectangle X offset from the bitmap
4329
    +16 signed dword: source rectangle X offset from the bitmap
4328
                      top-left corner
4330
                      top-left corner
4329
    +20 signed dword: source rectangle Y offset from the bitmap
4331
    +20 signed dword: source rectangle Y offset from the bitmap
4330
                      top-left corner
4332
                      top-left corner
4331
    +24 dword:        source rectangle width
4333
    +24 dword:        source rectangle width
4332
    +28 dword:        source rectangle height
4334
    +28 dword:        source rectangle height
4333
 
4335
 
4334
    +32: dword: bitmap data - must be 32bpp
4336
    +32: dword: bitmap data - must be 32bpp
4335
    +36: dword: size of the bitmap row in bytes
4337
    +36: dword: size of the bitmap row in bytes
4336
 
4338
 
4337
Returned value:
4339
Returned value:
4338
  * function does not return value
4340
  * function does not return value
4339
 
4341
 
4340
---------------------- Constants for registers: ----------------------
4342
---------------------- Constants for registers: ----------------------
4341
  eax - SF_BLITTER (73)
4343
  eax - SF_BLITTER (73)
4342
======================================================================
4344
======================================================================
4343
= Function 74, Subfunction 255, Get number of active network devices. =
4345
= Function 74, Subfunction 255, Get number of active network devices. =
4344
======================================================================
4346
======================================================================
4345
Parameters:
4347
Parameters:
4346
  * eax = 74 - function number
4348
  * eax = 74 - function number
4347
  * bl = 255 - subfunction number
4349
  * bl = 255 - subfunction number
4348
Returned value:
4350
Returned value:
4349
  * eax = number of active network devices
4351
  * eax = number of active network devices
4350
 
4352
 
4351
---------------------- Constants for registers: ----------------------
4353
---------------------- Constants for registers: ----------------------
4352
  eax - SF_NETWORK_GET (74)
4354
  eax - SF_NETWORK_GET (74)
4353
   bl - SSF_DEVICE_COUNT (255)
4355
   bl - SSF_DEVICE_COUNT (255)
4354
======================================================================
4356
======================================================================
4355
======== Function 74, Subfunction 0, Get network device type. ========
4357
======== Function 74, Subfunction 0, Get network device type. ========
4356
======================================================================
4358
======================================================================
4357
Parameters:
4359
Parameters:
4358
  * eax = 74 - function number
4360
  * eax = 74 - function number
4359
  * bl = 0 - subfunction number
4361
  * bl = 0 - subfunction number
4360
  * bh = device number
4362
  * bh = device number
4361
Returned value:
4363
Returned value:
4362
  * eax = device type number
4364
  * eax = device type number
4363
 
4365
 
4364
---------------------- Constants for registers: ----------------------
4366
---------------------- Constants for registers: ----------------------
4365
  eax - SF_NETWORK_GET (74)
4367
  eax - SF_NETWORK_GET (74)
4366
   bl - SSF_DEVICE_TYPE (0)
4368
   bl - SSF_DEVICE_TYPE (0)
4367
======================================================================
4369
======================================================================
4368
======== Function 74, Subfunction 1, Get network device name. ========
4370
======== Function 74, Subfunction 1, Get network device name. ========
4369
======================================================================
4371
======================================================================
4370
Parameters:
4372
Parameters:
4371
  * eax = 74 - function number
4373
  * eax = 74 - function number
4372
  * bl = 1 - subfunction number
4374
  * bl = 1 - subfunction number
4373
  * bh = device number
4375
  * bh = device number
4374
  * ecx = pointer to 64 byte buffer
4376
  * ecx = pointer to 64 byte buffer
4375
Returned value:
4377
Returned value:
4376
  * eax = -1 on error
4378
  * eax = -1 on error
4377
  * The network device name is written into the buffer, on success
4379
  * The network device name is written into the buffer, on success
4378
 
4380
 
4379
---------------------- Constants for registers: ----------------------
4381
---------------------- Constants for registers: ----------------------
4380
  eax - SF_NETWORK_GET (74)
4382
  eax - SF_NETWORK_GET (74)
4381
   bl - SSF_DEVICE_NAME (1)
4383
   bl - SSF_DEVICE_NAME (1)
4382
======================================================================
4384
======================================================================
4383
========= Function 74, Subfunction 2, Reset network device. ==========
4385
========= Function 74, Subfunction 2, Reset network device. ==========
4384
======================================================================
4386
======================================================================
4385
Parameters:
4387
Parameters:
4386
  * eax = 74 - function number
4388
  * eax = 74 - function number
4387
  * bl = 2 - subfunction number
4389
  * bl = 2 - subfunction number
4388
  * bh = device number
4390
  * bh = device number
4389
Returned value:
4391
Returned value:
4390
  * eax = -1 on error
4392
  * eax = -1 on error
4391
 
4393
 
4392
---------------------- Constants for registers: ----------------------
4394
---------------------- Constants for registers: ----------------------
4393
  eax - SF_NETWORK_GET (74)
4395
  eax - SF_NETWORK_GET (74)
4394
   bl - SSF_RESET_DEVICE (2)
4396
   bl - SSF_RESET_DEVICE (2)
4395
======================================================================
4397
======================================================================
4396
========== Function 74, Subfunction 3, Stop network device. ==========
4398
========== Function 74, Subfunction 3, Stop network device. ==========
4397
======================================================================
4399
======================================================================
4398
Parameters:
4400
Parameters:
4399
  * eax = 74 - function number
4401
  * eax = 74 - function number
4400
  * bl = 3 - subfunction number
4402
  * bl = 3 - subfunction number
4401
  * bh = device number
4403
  * bh = device number
4402
Returned value:
4404
Returned value:
4403
  * eax = -1 on error
4405
  * eax = -1 on error
4404
 
4406
 
4405
---------------------- Constants for registers: ----------------------
4407
---------------------- Constants for registers: ----------------------
4406
  eax - SF_NETWORK_GET (74)
4408
  eax - SF_NETWORK_GET (74)
4407
   bl - SSF_STOP_DEVICE (3)
4409
   bl - SSF_STOP_DEVICE (3)
4408
======================================================================
4410
======================================================================
4409
=========== Function 74, Subfunction 4, Get device pointer. ==========
4411
=========== Function 74, Subfunction 4, Get device pointer. ==========
4410
======================================================================
4412
======================================================================
4411
Parameters:
4413
Parameters:
4412
  * eax = 74 - function number
4414
  * eax = 74 - function number
4413
  * bl = 4 - subfunction number
4415
  * bl = 4 - subfunction number
4414
  * bh = device number
4416
  * bh = device number
4415
Returned value:
4417
Returned value:
4416
  * eax = device pointer, -1 on error
4418
  * eax = device pointer, -1 on error
4417
 
4419
 
4418
---------------------- Constants for registers: ----------------------
4420
---------------------- Constants for registers: ----------------------
4419
  eax - SF_NETWORK_GET (74)
4421
  eax - SF_NETWORK_GET (74)
4420
   bl - SSF_DEVICE_POINER (4)
4422
   bl - SSF_DEVICE_POINER (4)
4421
======================================================================
4423
======================================================================
4422
========= Function 74, Subfunction 6, Get packet TX counter. =========
4424
========= Function 74, Subfunction 6, Get packet TX counter. =========
4423
======================================================================
4425
======================================================================
4424
Parameters:
4426
Parameters:
4425
  * eax = 74 - function number
4427
  * eax = 74 - function number
4426
  * bl = 6 - subfunction number
4428
  * bl = 6 - subfunction number
4427
  * bh = device number
4429
  * bh = device number
4428
Returned value:
4430
Returned value:
4429
  * eax = Number of packets sent since device start, -1 on error
4431
  * eax = Number of packets sent since device start, -1 on error
4430
 
4432
 
4431
---------------------- Constants for registers: ----------------------
4433
---------------------- Constants for registers: ----------------------
4432
  eax - SF_NETWORK_GET (74)
4434
  eax - SF_NETWORK_GET (74)
4433
   bl - SSF_TX_PACKET_COUNT (6)
4435
   bl - SSF_TX_PACKET_COUNT (6)
4434
======================================================================
4436
======================================================================
4435
========= Function 74, Subfunction 7, Get packet RX counter. =========
4437
========= Function 74, Subfunction 7, Get packet RX counter. =========
4436
======================================================================
4438
======================================================================
4437
Parameters:
4439
Parameters:
4438
  * eax = 74 - function number
4440
  * eax = 74 - function number
4439
  * bl = 7 - subfunction number
4441
  * bl = 7 - subfunction number
4440
  * bh = device number
4442
  * bh = device number
4441
Returned value:
4443
Returned value:
4442
  * eax = Number of packets received since device start, -1 on error
4444
  * eax = Number of packets received since device start, -1 on error
4443
 
4445
 
4444
---------------------- Constants for registers: ----------------------
4446
---------------------- Constants for registers: ----------------------
4445
  eax - SF_NETWORK_GET (74)
4447
  eax - SF_NETWORK_GET (74)
4446
   bl - SSF_RX_PACKET_COUNT (7)
4448
   bl - SSF_RX_PACKET_COUNT (7)
4447
======================================================================
4449
======================================================================
4448
========== Function 74, Subfunction 8, Get TX byte counter. ==========
4450
========== Function 74, Subfunction 8, Get TX byte counter. ==========
4449
======================================================================
4451
======================================================================
4450
Parameters:
4452
Parameters:
4451
  * eax = 74 - function number
4453
  * eax = 74 - function number
4452
  * bl = 8 - subfunction number
4454
  * bl = 8 - subfunction number
4453
  * bh = device number
4455
  * bh = device number
4454
Returned value:
4456
Returned value:
4455
  * eax = Number of bytes sent since device start (lower dword)
4457
  * eax = Number of bytes sent since device start (lower dword)
4456
                  -1 on error
4458
                  -1 on error
4457
  * ebx = Number of bytes sent since device start (higher dword)
4459
  * ebx = Number of bytes sent since device start (higher dword)
4458
 
4460
 
4459
---------------------- Constants for registers: ----------------------
4461
---------------------- Constants for registers: ----------------------
4460
  eax - SF_NETWORK_GET (74)
4462
  eax - SF_NETWORK_GET (74)
4461
   bl - SSF_TX_BYTE_COUNT (8)
4463
   bl - SSF_TX_BYTE_COUNT (8)
4462
======================================================================
4464
======================================================================
4463
========== Function 74, Subfunction 9, Get RX byte counter. ==========
4465
========== Function 74, Subfunction 9, Get RX byte counter. ==========
4464
======================================================================
4466
======================================================================
4465
Parameters:
4467
Parameters:
4466
  * eax = 74 - function number
4468
  * eax = 74 - function number
4467
  * bl = 9 - subfunction number
4469
  * bl = 9 - subfunction number
4468
  * bh = device number
4470
  * bh = device number
4469
Returned value:
4471
Returned value:
4470
  * eax = Number of bytes received since device start (lower dword)
4472
  * eax = Number of bytes received since device start (lower dword)
4471
                  -1 on error
4473
                  -1 on error
4472
  * ebx = Number of bytes received since device start (higher dword)
4474
  * ebx = Number of bytes received since device start (higher dword)
4473
 
4475
 
4474
---------------------- Constants for registers: ----------------------
4476
---------------------- Constants for registers: ----------------------
4475
  eax - SF_NETWORK_GET (74)
4477
  eax - SF_NETWORK_GET (74)
4476
   bl - SSF_RX_BYTE_COUNT (9)
4478
   bl - SSF_RX_BYTE_COUNT (9)
4477
======================================================================
4479
======================================================================
4478
========== Function 74, Subfunction 10, Get link status. =============
4480
========== Function 74, Subfunction 10, Get link status. =============
4479
======================================================================
4481
======================================================================
4480
Parameters:
4482
Parameters:
4481
  * eax = 74 - function number
4483
  * eax = 74 - function number
4482
  * bl = 10 - subfunction number
4484
  * bl = 10 - subfunction number
4483
  * bh = device number
4485
  * bh = device number
4484
Returned value:
4486
Returned value:
4485
  * eax = link status, -1 on error
4487
  * eax = link status, -1 on error
4486
 
4488
 
4487
  Link status:
4489
  Link status:
4488
    ETH_LINK_DOWN   =    0b         ; Link is down
4490
    ETH_LINK_DOWN   =    0b         ; Link is down
4489
    ETH_LINK_UNKNOWN=    1b         ; There could be an active link
4491
    ETH_LINK_UNKNOWN=    1b         ; There could be an active link
4490
    ETH_LINK_FD     =   10b         ; full duplex flag
4492
    ETH_LINK_FD     =   10b         ; full duplex flag
4491
    ETH_LINK_10M    =  100b         ; 10 mbit
4493
    ETH_LINK_10M    =  100b         ; 10 mbit
4492
    ETH_LINK_100M   = 1000b         ; 100 mbit
4494
    ETH_LINK_100M   = 1000b         ; 100 mbit
4493
    ETH_LINK_1G     = 1100b         ; gigabit
4495
    ETH_LINK_1G     = 1100b         ; gigabit
4494
 
4496
 
4495
---------------------- Constants for registers: ----------------------
4497
---------------------- Constants for registers: ----------------------
4496
  eax - SF_NETWORK_GET (74)
4498
  eax - SF_NETWORK_GET (74)
4497
   bl - SSF_LINK_STATUS (10)
4499
   bl - SSF_LINK_STATUS (10)
4498
======================================================================
4500
======================================================================
4499
============== Function 75, Subfunction 0, Open socket. ==============
4501
============== Function 75, Subfunction 0, Open socket. ==============
4500
======================================================================
4502
======================================================================
4501
Parameters:
4503
Parameters:
4502
  * eax = 75 - function number
4504
  * eax = 75 - function number
4503
  * bl = 0 - subfunction number
4505
  * bl = 0 - subfunction number
4504
  * ecx = domain
4506
  * ecx = domain
4505
  * edx = type
4507
  * edx = type
4506
  * esi = protocol
4508
  * esi = protocol
4507
Returned value:
4509
Returned value:
4508
  * eax = socket number, -1 on error
4510
  * eax = socket number, -1 on error
4509
  * ebx = errorcode
4511
  * ebx = errorcode
4510
 
4512
 
4511
---------------------- Constants for registers: ----------------------
4513
---------------------- Constants for registers: ----------------------
4512
  eax - SF_NETWORK_SOCKET (75)
4514
  eax - SF_NETWORK_SOCKET (75)
4513
   bl - SSF_OPEN (0)
4515
   bl - SSF_OPEN (0)
4514
======================================================================
4516
======================================================================
4515
============= Function 75, Subfunction 1, Close socket. ==============
4517
============= Function 75, Subfunction 1, Close socket. ==============
4516
======================================================================
4518
======================================================================
4517
Parameters:
4519
Parameters:
4518
  * eax = 75 - function number
4520
  * eax = 75 - function number
4519
  * bl = 1 - subfunction number
4521
  * bl = 1 - subfunction number
4520
  * ecx = socket number
4522
  * ecx = socket number
4521
Returned value:
4523
Returned value:
4522
  * eax = -1 on error
4524
  * eax = -1 on error
4523
  * ebx = errorcode
4525
  * ebx = errorcode
4524
 
4526
 
4525
---------------------- Constants for registers: ----------------------
4527
---------------------- Constants for registers: ----------------------
4526
  eax - SF_NETWORK_SOCKET (75)
4528
  eax - SF_NETWORK_SOCKET (75)
4527
   bl - SSF_CLOSE (1)
4529
   bl - SSF_CLOSE (1)
4528
======================================================================
4530
======================================================================
4529
================== Function 75, Subfunction 2, Bind. =================
4531
================== Function 75, Subfunction 2, Bind. =================
4530
======================================================================
4532
======================================================================
4531
Parameters:
4533
Parameters:
4532
  * eax = 75 - function number
4534
  * eax = 75 - function number
4533
  * bl = 2 - subfunction number
4535
  * bl = 2 - subfunction number
4534
  * ecx = socket number
4536
  * ecx = socket number
4535
  * edx = pointer to sockaddr structure
4537
  * edx = pointer to sockaddr structure
4536
  * esi = length of sockaddr structure
4538
  * esi = length of sockaddr structure
4537
Returned value:
4539
Returned value:
4538
  * eax = -1 on error
4540
  * eax = -1 on error
4539
  * ebx = errorcode
4541
  * ebx = errorcode
4540
 
4542
 
4541
---------------------- Constants for registers: ----------------------
4543
---------------------- Constants for registers: ----------------------
4542
  eax - SF_NETWORK_SOCKET (75)
4544
  eax - SF_NETWORK_SOCKET (75)
4543
   bl - SSF_BIND (2)
4545
   bl - SSF_BIND (2)
4544
======================================================================
4546
======================================================================
4545
================= Function 75, Subfunction 3, Listen. ================
4547
================= Function 75, Subfunction 3, Listen. ================
4546
======================================================================
4548
======================================================================
4547
Parameters:
4549
Parameters:
4548
  * eax = 75 - function number
4550
  * eax = 75 - function number
4549
  * bl = 3 - subfunction number
4551
  * bl = 3 - subfunction number
4550
  * ecx = socket number
4552
  * ecx = socket number
4551
  * edx = backlog
4553
  * edx = backlog
4552
Returned value:
4554
Returned value:
4553
  * eax = -1 on error
4555
  * eax = -1 on error
4554
  * ebx = errorcode
4556
  * ebx = errorcode
4555
 
4557
 
4556
---------------------- Constants for registers: ----------------------
4558
---------------------- Constants for registers: ----------------------
4557
  eax - SF_NETWORK_SOCKET (75)
4559
  eax - SF_NETWORK_SOCKET (75)
4558
   bl - SSF_LISTEN (3)
4560
   bl - SSF_LISTEN (3)
4559
======================================================================
4561
======================================================================
4560
================ Function 75, Subfunction 4, Connect. ================
4562
================ Function 75, Subfunction 4, Connect. ================
4561
======================================================================
4563
======================================================================
4562
Parameters:
4564
Parameters:
4563
  * eax = 75 - function number
4565
  * eax = 75 - function number
4564
  * bl = 4 - subfunction number
4566
  * bl = 4 - subfunction number
4565
  * ecx = socket number
4567
  * ecx = socket number
4566
  * edx = pointer to sockaddr structure
4568
  * edx = pointer to sockaddr structure
4567
  * esi = length of sockaddr structure
4569
  * esi = length of sockaddr structure
4568
Returned value:
4570
Returned value:
4569
  * eax = -1 on error
4571
  * eax = -1 on error
4570
  * ebx = errorcode
4572
  * ebx = errorcode
4571
 
4573
 
4572
---------------------- Constants for registers: ----------------------
4574
---------------------- Constants for registers: ----------------------
4573
  eax - SF_NETWORK_SOCKET (75)
4575
  eax - SF_NETWORK_SOCKET (75)
4574
   bl - SSF_CONNECT (4)
4576
   bl - SSF_CONNECT (4)
4575
======================================================================
4577
======================================================================
4576
================= Function 75, Subfunction 5, Accept. ================
4578
================= Function 75, Subfunction 5, Accept. ================
4577
======================================================================
4579
======================================================================
4578
Parameters:
4580
Parameters:
4579
  * eax = 75 - function number
4581
  * eax = 75 - function number
4580
  * bl = 5 - subfunction number
4582
  * bl = 5 - subfunction number
4581
  * ecx = socket number
4583
  * ecx = socket number
4582
  * edx = pointer to sockaddr structure
4584
  * edx = pointer to sockaddr structure
4583
  * esi = length of sockaddr structure
4585
  * esi = length of sockaddr structure
4584
Returned value:
4586
Returned value:
4585
  * eax = socket number of accepted socket, -1 on error
4587
  * eax = socket number of accepted socket, -1 on error
4586
  * ebx = errorcode
4588
  * ebx = errorcode
4587
 
4589
 
4588
---------------------- Constants for registers: ----------------------
4590
---------------------- Constants for registers: ----------------------
4589
  eax - SF_NETWORK_SOCKET (75)
4591
  eax - SF_NETWORK_SOCKET (75)
4590
   bl - SSF_ACCEPT (5)
4592
   bl - SSF_ACCEPT (5)
4591
======================================================================
4593
======================================================================
4592
================== Function 75, Subfunction 6, Send. =================
4594
================== Function 75, Subfunction 6, Send. =================
4593
======================================================================
4595
======================================================================
4594
Parameters:
4596
Parameters:
4595
  * eax = 75 - function number
4597
  * eax = 75 - function number
4596
  * bl = 6 - subfunction number
4598
  * bl = 6 - subfunction number
4597
  * ecx = socket number
4599
  * ecx = socket number
4598
  * edx = pointer to buffer
4600
  * edx = pointer to buffer
4599
  * esi = length of buffer
4601
  * esi = length of buffer
4600
  * edi = flags
4602
  * edi = flags
4601
Returned value:
4603
Returned value:
4602
  * eax = number of bytes copied, -1 on error
4604
  * eax = number of bytes copied, -1 on error
4603
  * ebx = errorcode
4605
  * ebx = errorcode
4604
 
4606
 
4605
---------------------- Constants for registers: ----------------------
4607
---------------------- Constants for registers: ----------------------
4606
  eax - SF_NETWORK_SOCKET (75)
4608
  eax - SF_NETWORK_SOCKET (75)
4607
   bl - SSF_SEND (6)
4609
   bl - SSF_SEND (6)
4608
======================================================================
4610
======================================================================
4609
================ Function 75, Subfunction 7, Receive. ================
4611
================ Function 75, Subfunction 7, Receive. ================
4610
======================================================================
4612
======================================================================
4611
Parameters:
4613
Parameters:
4612
  * eax = 75 - function number
4614
  * eax = 75 - function number
4613
  * bl = 7 - subfunction number
4615
  * bl = 7 - subfunction number
4614
  * ecx = socket number
4616
  * ecx = socket number
4615
  * edx = pointer to buffer
4617
  * edx = pointer to buffer
4616
  * esi = length of buffer
4618
  * esi = length of buffer
4617
  * edi = flags
4619
  * edi = flags
4618
Returned value:
4620
Returned value:
4619
  * eax = number of bytes copied, -1 on error
4621
  * eax = number of bytes copied, -1 on error
4620
  * ebx = errorcode
4622
  * ebx = errorcode
4621
 
4623
 
4622
---------------------- Constants for registers: ----------------------
4624
---------------------- Constants for registers: ----------------------
4623
  eax - SF_NETWORK_SOCKET (75)
4625
  eax - SF_NETWORK_SOCKET (75)
4624
   bl - SSF_RECEIVE (7)
4626
   bl - SSF_RECEIVE (7)
4625
======================================================================
4627
======================================================================
4626
=========== Function 75, Subfunction 8, Set socket options. ==========
4628
=========== Function 75, Subfunction 8, Set socket options. ==========
4627
======================================================================
4629
======================================================================
4628
Parameters:
4630
Parameters:
4629
  * eax = 75 - function number
4631
  * eax = 75 - function number
4630
  * bl = 8 - subfunction number
4632
  * bl = 8 - subfunction number
4631
  * ecx = socket number
4633
  * ecx = socket number
4632
  * edx = pointer to optstruct
4634
  * edx = pointer to optstruct
4633
Returned value:
4635
Returned value:
4634
  * eax = -1 on error
4636
  * eax = -1 on error
4635
  * ebx = errorcode
4637
  * ebx = errorcode
4636
Remarks:
4638
Remarks:
4637
 
4639
 
4638
  Optstruct:
4640
  Optstruct:
4639
    dd level
4641
    dd level
4640
    dd optionname
4642
    dd optionname
4641
    dd optlength
4643
    dd optlength
4642
    db options...
4644
    db options...
4643
 
4645
 
4644
---------------------- Constants for registers: ----------------------
4646
---------------------- Constants for registers: ----------------------
4645
  eax - SF_NETWORK_SOCKET (75)
4647
  eax - SF_NETWORK_SOCKET (75)
4646
   bl - SSF_SET_OPTIONS (8)
4648
   bl - SSF_SET_OPTIONS (8)
4647
======================================================================
4649
======================================================================
4648
=========== Function 75, Subfunction 9, Get socket options. ==========
4650
=========== Function 75, Subfunction 9, Get socket options. ==========
4649
======================================================================
4651
======================================================================
4650
Parameters:
4652
Parameters:
4651
  * eax = 75 - function number
4653
  * eax = 75 - function number
4652
  * bl = 9 - subfunction number
4654
  * bl = 9 - subfunction number
4653
  * ecx = socket number
4655
  * ecx = socket number
4654
  * edx = pointer to optstruct
4656
  * edx = pointer to optstruct
4655
Returned value:
4657
Returned value:
4656
  * eax = -1 on error
4658
  * eax = -1 on error
4657
  * ebx = errorcode
4659
  * ebx = errorcode
4658
Remarks:
4660
Remarks:
4659
 
4661
 
4660
  Optstruct:
4662
  Optstruct:
4661
    dd level
4663
    dd level
4662
    dd optionname
4664
    dd optionname
4663
    dd optlength
4665
    dd optlength
4664
    db options...
4666
    db options...
4665
 
4667
 
4666
---------------------- Constants for registers: ----------------------
4668
---------------------- Constants for registers: ----------------------
4667
  eax - SF_NETWORK_SOCKET (75)
4669
  eax - SF_NETWORK_SOCKET (75)
4668
   bl - SSF_GET_OPTIONS (9)
4670
   bl - SSF_GET_OPTIONS (9)
4669
======================================================================
4671
======================================================================
4670
============ Function 75, Subfunction 10, Get socketpair. ===========
4672
============ Function 75, Subfunction 10, Get socketpair. ============
4671
======================================================================
4673
======================================================================
4672
Parameters:
4674
Parameters:
4673
  * eax = 75 - function number
4675
  * eax = 75 - function number
4674
  * bl = 10 - subfunction number
4676
  * bl = 10 - subfunction number
4675
Returned value:
4677
Returned value:
4676
  * eax = socketnum1, -1 on error
4678
  * eax = socketnum1, -1 on error
4677
  * ebx = socketnum2, errorcode on error
4679
  * ebx = socketnum2, errorcode on error
4678
 
4680
 
4679
---------------------- Constants for registers: ----------------------
4681
---------------------- Constants for registers: ----------------------
4680
  eax - SF_NETWORK_SOCKET (75)
4682
  eax - SF_NETWORK_SOCKET (75)
4681
   bl - SSF_GET_PAIR (10)
4683
   bl - SSF_GET_PAIR (10)
4682
======================================================================
4684
======================================================================
4683
============ Function 76, Network options and statistics. ============
4685
============ Function 76, Network options and statistics. ============
4684
======================================================================
4686
======================================================================
4685
Parameters:
4687
Parameters:
4686
  * eax = 76 - function number
4688
  * eax = 76 - function number
4687
  * high half of ebx = protocol number
4689
  * high half of ebx = protocol number
4688
  * bh = device number
4690
  * bh = device number
4689
  * bl = subfunction number
4691
  * bl = subfunction number
-
 
4692
 
-
 
4693
Protocols and subfunctions:
4690
 
4694
 
4691
Ethernet (0)
4695
0 - Ethernet:
4692
        0 - Read MAC
4696
        0 - Read MAC
4693
 
4697
 
4694
IPv4 (1)
4698
    common subfunctions:
-
 
4699
        0 - Read # packets sent
-
 
4700
        1 - Read # packets received
4695
        0 - Read # IP packets sent
4701
 
4696
        1 - Read # IP packets received
4702
1 - IPv4:
4697
        2 - Read IP
4703
        2 - Read IP
4698
        3 - Write IP
4704
        3 - Write IP
4699
        4 - Read DNS
4705
        4 - Read DNS
4700
        5 - Write DNS
4706
        5 - Write DNS
4701
        6 - Read subnet
4707
        6 - Read subnet
4702
        7 - Write subnet
4708
        7 - Write subnet
4703
        8 - Read gateway
4709
        8 - Read gateway
4704
        9 - Write gateway
4710
        9 - Write gateway
4705
 
4711
 
4706
ICMP (2)
-
 
4707
        0 - Read # ICMP packets sent
-
 
4708
        1 - Read # ICMP packets received
4712
2 - ICMP:
4709
        3 - enable/disable ICMP echo reply
4713
        3 - enable/disable ICMP echo reply
4710
 
-
 
4711
UDP (3)
-
 
4712
        0 - Read # UDP packets sent
-
 
4713
        1 - Read # UDP packets received
4714
 
4714
 
-
 
4715
TCP (4)
-
 
4716
        0 - Read # TCP packets sent
4715
3 - UDP
4717
        1 - Read # TCP packets received
4716
4 - TCP
4718
 
-
 
4719
ARP (5)
-
 
4720
        0 - Read # ARP packets sent
4717
 
4721
        1 - Read # ARP packets received
4718
5 - ARP:
4722
        2 - Read # ARP entry's
4719
        2 - Read # ARP entry's
4723
        3 - Read ARP entry
4720
        3 - Read ARP entry
4724
        4 - Add static ARP entry
4721
        4 - Add static ARP entry
4725
        5 - Remove ARP entry (-1 = remove all)
4722
        5 - Remove ARP entry (-1 = remove all)
4726
        6 - Send ARP announce on specified interface
4723
        6 - Send ARP announce on specified interface
4727
        7 - Read # ARP conflicts (IP address conflicts)
4724
        7 - Read # ARP conflicts (IP address conflicts)
4728
 
4725
 
4729
---------------------- Constants for registers: ----------------------
4726
---------------------- Constants for registers: ----------------------
4730
  eax - SF_NETWORK_PROTOCOL (76)
4727
  eax - SF_NETWORK_PROTOCOL (76)
4731
 
-
 
4732
======================================================================
4728
======================================================================
4733
========== Function 77, Subfunction 0, Create futex object ===========
4729
========== Function 77, Subfunction 0, Create futex object ===========
4734
======================================================================
4730
======================================================================
4735
Parameters:
4731
Parameters:
4736
  * eax = 77 - function number
4732
  * eax = 77 - function number
4737
  * ebx = 0 - subfunction number
4733
  * ebx = 0 - subfunction number
4738
  * ecx = pointer to futex dword
4734
  * ecx = pointer to futex dword
4739
Returned value:
4735
Returned value:
4740
  * eax = futex handle, 0 on error
4736
  * eax = futex handle, 0 on error
4741
Remarks:
4737
Remarks:
4742
  * Use subfunction 1 to destroy the futex.
4738
  * Use subfunction 1 to destroy the futex.
4743
    The kernel destroys the futexes automatically when the process
4739
    The kernel destroys the futexes automatically when the process
4744
    terminates.
4740
    terminates.
-
 
4741
 
-
 
4742
---------------------- Constants for registers: ----------------------
-
 
4743
  eax - SF_FUTEX (77)
-
 
4744
  ebx - SSF_CREATE (0)
4745
======================================================================
4745
======================================================================
4746
========= Function 77, Subfunction 1, Destroy futex object ===========
4746
========= Function 77, Subfunction 1, Destroy futex object ===========
4747
======================================================================
4747
======================================================================
4748
Parameters:
4748
Parameters:
4749
  * eax = 77 - function number
4749
  * eax = 77 - function number
4750
  * ebx = 1 - subfunction number
4750
  * ebx = 1 - subfunction number
4751
  * ecx = futex handle
4751
  * ecx = futex handle
4752
Returned value:
4752
Returned value:
4753
  * eax = 0 - successfull, -1 on error
4753
  * eax = 0 - successfull, -1 on error
4754
Remarks:
4754
Remarks:
4755
  * The futex handle must have been created by subfunction 0
4755
  * The futex handle must have been created by subfunction 0
-
 
4756
 
-
 
4757
---------------------- Constants for registers: ----------------------
-
 
4758
  eax - SF_FUTEX (77)
4756
 
4759
  ebx - SSF_DESTROY (1)
4757
======================================================================
4760
======================================================================
4758
=============== Function 77, Subfunction 2, Futex wait ===============
4761
=============== Function 77, Subfunction 2, Futex wait ===============
4759
======================================================================
4762
======================================================================
4760
Parameters:
4763
Parameters:
4761
  * eax = 77 - function number
4764
  * eax = 77 - function number
4762
  * ebx = 2 - subfunction number
4765
  * ebx = 2 - subfunction number
4763
  * ecx = futex handle
4766
  * ecx = futex handle
4764
  * edx = control value
4767
  * edx = control value
4765
  * esi = timeout in system ticks or 0 for infinity
4768
  * esi = timeout in system ticks or 0 for infinity
4766
Returned value:
4769
Returned value:
4767
  * eax = 0 - successfull
4770
  * eax = 0 - successfull
4768
	 -1 - timeout
4771
	 -1 - timeout
4769
	 -2 - futex dword does not have the same value as edx
4772
	 -2 - futex dword does not have the same value as edx
4770
Remarks:
4773
Remarks:
4771
  * This functionn tests that the value at the futex dword still
4774
  * This functionn tests that the value at the futex dword still
4772
    contains the expected control value, and if so, then sleeps
4775
    contains the expected control value, and if so, then sleeps
4773
    waiting for a wake operation on the futex.
4776
    waiting for a wake operation on the futex.
4774
  * The futex handle must have been created by subfunction 0
4777
  * The futex handle must have been created by subfunction 0
-
 
4778
 
-
 
4779
---------------------- Constants for registers: ----------------------
-
 
4780
  eax - SF_FUTEX (77)
4775
 
4781
  ebx - SSF_WAIT (2)
4776
======================================================================
4782
======================================================================
4777
=============== Function 77, Subfunction 3, Futex wake ===============
4783
=============== Function 77, Subfunction 3, Futex wake ===============
4778
======================================================================
4784
======================================================================
4779
Parameters:
4785
Parameters:
4780
  * eax = 77 - function number
4786
  * eax = 77 - function number
4781
  * ebx = 3 - subfunction number
4787
  * ebx = 3 - subfunction number
4782
  * ecx = futex handle
4788
  * ecx = futex handle
4783
  * edx = number of waiters to wake
4789
  * edx = number of waiters to wake
4784
Returned value:
4790
Returned value:
4785
  * eax = number of waiters that were woken up
4791
  * eax = number of waiters that were woken up
4786
 
4792
 
4787
Remarks:
4793
Remarks:
4788
  * This function wakes at most edx of the waiters that are
4794
  * This function wakes at most edx of the waiters that are
4789
    waiting (e.g., inside futex wait) on the futex dword
4795
    waiting (e.g., inside futex wait) on the futex dword
4790
  * The futex handle must have been created by subfunction 0
4796
  * The futex handle must have been created by subfunction 0
-
 
4797
 
-
 
4798
---------------------- Constants for registers: ----------------------
-
 
4799
  eax - SF_FUTEX (77)
4791
 
4800
  ebx - SSF_WAKE (3)
4792
======================================================================
4801
======================================================================
4793
=============== Function -1 - terminate thread/process ===============
4802
=============== Function -1 - terminate thread/process ===============
4794
======================================================================
4803
======================================================================
4795
Parameters:
4804
Parameters:
4796
  * eax = -1 - function number
4805
  * eax = -1 - function number
4797
Returned value:
4806
Returned value:
4798
  * function does not return neither value nor control
4807
  * function does not return neither value nor control
4799
Remarks:
4808
Remarks:
4800
  * If the process did not create threads obviously, it has only
4809
  * If the process did not create threads obviously, it has only
4801
    one thread, which termination results in process termination.
4810
    one thread, which termination results in process termination.
4802
  * If the current thread is last in the process, its termination
4811
  * If the current thread is last in the process, its termination
4803
    also results in process terminates.
4812
    also results in process terminates.
4804
  * This function terminates the current thread. Other thread can be
4813
  * This function terminates the current thread. Other thread can be
4805
    killed by call to subfunction 2 of function 18.
4814
    killed by call to subfunction 2 of function 18.
-
 
4815
 
-
 
4816
---------------------- Constants for registers: ----------------------
4806
 
4817
  eax - SF_TERMINATE_PROCESS (-1)
4807
======================================================================
4818
======================================================================
4808
=========================== List of events ===========================
4819
=========================== List of events ===========================
4809
======================================================================
4820
======================================================================
4810
Next event can be retrieved by the call of one from functions 10
4821
Next event can be retrieved by the call of one from functions 10
4811
(to wait for event), 11 (to check without waiting), 23
4822
(to wait for event), 11 (to check without waiting), 23
4812
(to wait during the given time).
4823
(to wait during the given time).
4813
These functions return only those events, which enter into a mask set
4824
These functions return only those events, which enter into a mask set
4814
by function 40. By default it is first three,
4825
by function 40. By default it is first three,
4815
there is enough for most applications.
4826
there is enough for most applications.
4816
Codes of events:
4827
Codes of events:
4817
  * 1 = redraw event (is reset by call to function 0)
4828
  * 1 = redraw event (is reset by call to function 0)
4818
  * 2 = key on keyboard is pressed (acts, only when the window is
4829
  * 2 = key on keyboard is pressed (acts, only when the window is
4819
    active) or hotkey is pressed; is reset, when all keys from
4830
    active) or hotkey is pressed; is reset, when all keys from
4820
    the buffer are read out by function 2
4831
    the buffer are read out by function 2
4821
  * 3 = button is pressed, defined earlier by function 8
4832
  * 3 = button is pressed, defined earlier by function 8
4822
    (or close button, created implicitly by function 0;
4833
    (or close button, created implicitly by function 0;
4823
    minimize button is handled by the system and sends no message;
4834
    minimize button is handled by the system and sends no message;
4824
    acts, only when the window is active;
4835
    acts, only when the window is active;
4825
    is reset when all buttons from the buffer
4836
    is reset when all buttons from the buffer
4826
    are read out by function 17)
4837
    are read out by function 17)
4827
  * 4 = reserved (in current implementation never comes even after
4838
  * 4 = reserved (in current implementation never comes even after
4828
    unmasking by function 40)
4839
    unmasking by function 40)
4829
  * 5 = kernel finished redrawing of the desktop background
4840
  * 5 = kernel finished redrawing of the desktop background
4830
  * 6 = mouse event (something happened - button pressing or moving;
4841
  * 6 = mouse event (something happened - button pressing or moving;
4831
    is reset at reading)
4842
    is reset at reading)
4832
  * 7 = IPC event (see function 60 -
4843
  * 7 = IPC event (see function 60 -
4833
    Inter Process Communication; is reset at reading)
4844
    Inter Process Communication; is reset at reading)
4834
  * 8 = network event (is reset at reading)
4845
  * 8 = network event (is reset at reading)
4835
  * 9 = debug event (is reset at reading; see
4846
  * 9 = debug event (is reset at reading; see
4836
    debug subsystem)
4847
    debug subsystem)
4837
  * 16..31 = event with appropriate IRQ
4848
  * 16..31 = event with appropriate IRQ
4838
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4849
    (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
4839
 
4850
 
4840
======================================================================
4851
======================================================================
4841
=================== Error codes of the file system ===================
4852
=================== Error codes of the file system ===================
4842
======================================================================
4853
======================================================================
4843
  * 0 = success
4854
  * 0 = success
4844
  * 1 = base and/or partition of a hard disk is not defined
-
 
4845
    (by subfunctions 7, 8 of function 21)
-
 
4846
  * 2 = function is not supported for the given file system
4855
  * 2 = function is not supported for the given file system
4847
  * 3 = unknown file system
4856
  * 3 = unknown file system
4848
  * 4 = reserved, is never returned in the current implementation
-
 
4849
  * 5 = file not found
4857
  * 5 = file not found
4850
  * 6 = end of file, EOF
4858
  * 6 = end of file, EOF
4851
  * 7 = pointer lies outside of application memory
4859
  * 7 = pointer lies outside of application memory
4852
  * 8 = disk is full
4860
  * 8 = disk is full
4853
  * 9 = FAT table is destroyed
4861
  * 9 = file system error
4854
  * 10 = access denied
4862
  * 10 = access denied
4855
  * 11 = device error
4863
  * 11 = device error
-
 
4864
  * 12 = file system requires more memory
-
 
4865
 
4856
Application start functions can return also following errors:
4866
Application start functions can return also following errors:
4857
  * 30 = 0x1E = not enough memory
4867
  * 30 = 0x1E = not enough memory
4858
  * 31 = 0x1F = file is not executable
4868
  * 31 = 0x1F = file is not executable
4859
  * 32 = 0x20 = too many processes
4869
  * 32 = 0x20 = too many processes
4860
>
4870
>
4861
>
4871
>