Rev 6893 | Rev 6917 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6893 | Rev 6901 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2016. 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_FREQUENCY (5) |
759 | ebx - SSF_GET_CPU_FREQUENCY (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 speed divider |
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 divider |
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 divider = 4 |
1055 | Remark: recommended speed divider = 4 |
1056 | 1056 | ||
1057 | -------------- Subsubfunction 2 - get mouse sensitivity -------------- |
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 = current sensitivity |
1063 | * eax = current sensitivity |
1064 | 1064 | ||
1065 | -------------- Subsubfunction 3 - set mouse sensitivity -------------- |
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 = new value for sensitivity |
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 | 1073 | ||
1074 | Remark: recommended sensitivity = 3 |
1074 | Remark: recommended sensitivity = 3 |
1075 | 1075 | ||
1076 | ----------- Subsubfunction 4 - set mouse pointer position. ----------- |
1076 | ----------- Subsubfunction 4 - set mouse pointer position. ----------- |
1077 | Parameters: |
1077 | Parameters: |
1078 | * eax = 18 - function number |
1078 | * eax = 18 - function number |
1079 | * ebx = 19 - subfunction number |
1079 | * ebx = 19 - subfunction number |
1080 | * ecx = 4 - subsubfunction number |
1080 | * ecx = 4 - subsubfunction number |
1081 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
1081 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
1082 | Returned value: |
1082 | Returned value: |
1083 | * function does not return value |
1083 | * function does not return value |
1084 | 1084 | ||
1085 | -------- Subsubfunction 5 - simulate state of mouse buttons. --------- |
1085 | -------- Subsubfunction 5 - simulate state of mouse buttons. --------- |
1086 | Parameters: |
1086 | Parameters: |
1087 | * eax = 18 - function number |
1087 | * eax = 18 - function number |
1088 | * ebx = 19 - subfunction number |
1088 | * ebx = 19 - subfunction number |
1089 | * ecx = 5 - subsubfunction number |
1089 | * ecx = 5 - subsubfunction number |
1090 | * edx = information about emulated state of mouse buttons: |
1090 | * edx = information about emulated state of mouse buttons: |
1091 | (same as return value in subfunction 2 of function 37) |
1091 | (same as return value in subfunction 2 of function 37) |
1092 | * bit 0 is set = left button is pressed |
1092 | * bit 0 is set = left button is pressed |
1093 | * bit 1 is set = right button is pressed |
1093 | * bit 1 is set = right button is pressed |
1094 | * bit 2 is set = middle button is pressed |
1094 | * bit 2 is set = middle button is pressed |
1095 | * bit 3 is set = 4th button is pressed |
1095 | * bit 3 is set = 4th button is pressed |
1096 | * bit 4 is set = 5th button is pressed |
1096 | * bit 4 is set = 5th button is pressed |
1097 | Returned value: |
1097 | Returned value: |
1098 | * function does not return value |
1098 | * function does not return value |
1099 | 1099 | ||
1100 | -------------- Subsubfunction 6 - get doubleclick delay. ------------- |
1100 | -------------- Subsubfunction 6 - get doubleclick delay. ------------- |
1101 | Parameters: |
1101 | Parameters: |
1102 | * eax = 18 - function number |
1102 | * eax = 18 - function number |
1103 | * ebx = 19 - subfunction number |
1103 | * ebx = 19 - subfunction number |
1104 | * ecx = 6 - subsubfunction number |
1104 | * ecx = 6 - subsubfunction number |
1105 | Returned value: |
1105 | Returned value: |
1106 | * eax = current doubleclick delay (100 = 1 second) |
1106 | * eax = current doubleclick delay (100 = 1 second) |
1107 | 1107 | ||
1108 | -------------- Subsubfunction 7 - set doubleclick delay. ------------- |
1108 | -------------- Subsubfunction 7 - set doubleclick delay. ------------- |
1109 | Parameters: |
1109 | Parameters: |
1110 | * eax = 18 - function number |
1110 | * eax = 18 - function number |
1111 | * ebx = 19 - subfunction number |
1111 | * ebx = 19 - subfunction number |
1112 | * ecx = 7 - subsubfunction number |
1112 | * ecx = 7 - subsubfunction number |
1113 | * dl = new value for doubleclick delay (100 = 1 second) |
1113 | * dl = new value for doubleclick delay (100 = 1 second) |
1114 | Returned value: |
1114 | Returned value: |
1115 | * function does not return value |
1115 | * function does not return value |
1116 | 1116 | ||
1117 | Remark: mouse settings can be modified in the application mouse_cfg. |
1117 | Remark: mouse settings can be modified in the application mouse_cfg. |
1118 | 1118 | ||
1119 | ---------------------- Constants for registers: ---------------------- |
1119 | ---------------------- Constants for registers: ---------------------- |
1120 | eax - SF_SYSTEM (18) |
1120 | eax - SF_SYSTEM (18) |
1121 | ebx - SSF_MOUSE_SETTINGS (19) |
1121 | ebx - SSF_MOUSE_SETTINGS (19) |
1122 | 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), |
1123 | 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), |
1124 | 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) |
1125 | ====================================================================== |
1125 | ====================================================================== |
1126 | ======== Function 18, subfunction 20 - get information on RAM. ======= |
1126 | ======== Function 18, subfunction 20 - get information on RAM. ======= |
1127 | ====================================================================== |
1127 | ====================================================================== |
1128 | Parameters: |
1128 | Parameters: |
1129 | * eax = 18 - function number |
1129 | * eax = 18 - function number |
1130 | * ebx = 20 - subfunction number |
1130 | * ebx = 20 - subfunction number |
1131 | * ecx = pointer to the buffer for information (36 bytes) |
1131 | * ecx = pointer to the buffer for information (36 bytes) |
1132 | Returned value: |
1132 | Returned value: |
1133 | * eax = total size of existing RAM in pages |
1133 | * eax = total size of existing RAM in pages |
1134 | or -1 if error has occured |
1134 | or -1 if error has occured |
1135 | * buffer pointed to by ecx contains the following information: |
1135 | * buffer pointed to by ecx contains the following information: |
1136 | * +0: dword: total size of existing RAM in pages |
1136 | * +0: dword: total size of existing RAM in pages |
1137 | * +4: dword: size of free RAM in pages |
1137 | * +4: dword: size of free RAM in pages |
1138 | * +8: dword: number of page faults (exceptions #PF) |
1138 | * +8: dword: number of page faults (exceptions #PF) |
1139 | in applications |
1139 | in applications |
1140 | * +12: dword: size of kernel heap in bytes |
1140 | * +12: dword: size of kernel heap in bytes |
1141 | * +16: dword: free in kernel heap in bytes |
1141 | * +16: dword: free in kernel heap in bytes |
1142 | * +20: dword: total number of memory blocks in kernel heap |
1142 | * +20: dword: total number of memory blocks in kernel heap |
1143 | * +24: dword: number of free memory blocks in kernel heap |
1143 | * +24: dword: number of free memory blocks in kernel heap |
1144 | * +28: dword: size of maximum free block in kernel heap |
1144 | * +28: dword: size of maximum free block in kernel heap |
1145 | (reserved) |
1145 | (reserved) |
1146 | * +32: dword: size of maximum allocated block in kernel heap |
1146 | * +32: dword: size of maximum allocated block in kernel heap |
1147 | (reserved) |
1147 | (reserved) |
1148 | 1148 | ||
1149 | ---------------------- Constants for registers: ---------------------- |
1149 | ---------------------- Constants for registers: ---------------------- |
1150 | eax - SF_SYSTEM (18) |
1150 | eax - SF_SYSTEM (18) |
1151 | ebx - SSF_GET_RAM_INFO (20) |
1151 | ebx - SSF_GET_RAM_INFO (20) |
1152 | ====================================================================== |
1152 | ====================================================================== |
1153 | ===================== Function 18, subfunction 21 ==================== |
1153 | ===================== Function 18, subfunction 21 ==================== |
1154 | ======== Get slot number of process/thread by the identifier. ======== |
1154 | ======== Get slot number of process/thread by the identifier. ======== |
1155 | ====================================================================== |
1155 | ====================================================================== |
1156 | Parameters: |
1156 | Parameters: |
1157 | * eax = 18 - function number |
1157 | * eax = 18 - function number |
1158 | * ebx = 21 - subfunction number |
1158 | * ebx = 21 - subfunction number |
1159 | * ecx = identifer of process/thread (PID/TID) |
1159 | * ecx = identifer of process/thread (PID/TID) |
1160 | Returned value: |
1160 | Returned value: |
1161 | * eax = 0 - error (invalid identifier) |
1161 | * eax = 0 - error (invalid identifier) |
1162 | * otherwise eax = slot number |
1162 | * otherwise eax = slot number |
1163 | 1163 | ||
1164 | ---------------------- Constants for registers: ---------------------- |
1164 | ---------------------- Constants for registers: ---------------------- |
1165 | eax - SF_SYSTEM (18) |
1165 | eax - SF_SYSTEM (18) |
1166 | ebx - SSF_GET_THREAD_SLOT (21) |
1166 | ebx - SSF_GET_THREAD_SLOT (21) |
1167 | ====================================================================== |
1167 | ====================================================================== |
1168 | ===================== Function 18, subfunction 22 ==================== |
1168 | ===================== Function 18, subfunction 22 ==================== |
1169 | ============== Operations with window of another thread. ============= |
1169 | ============== Operations with window of another thread. ============= |
1170 | ====================================================================== |
1170 | ====================================================================== |
1171 | Parameters: |
1171 | Parameters: |
1172 | * eax = 18 - function number |
1172 | * eax = 18 - function number |
1173 | * ebx = 22 - subfunction number |
1173 | * ebx = 22 - subfunction number |
1174 | * ecx = operation type: |
1174 | * ecx = operation type: |
1175 | * 0 = minimize window of the thread with given slot number |
1175 | * 0 = minimize window of the thread with given slot number |
1176 | * 1 = minimize window of the thread with given identifier |
1176 | * 1 = minimize window of the thread with given identifier |
1177 | * 2 = restore window of the thread with given slot number |
1177 | * 2 = restore window of the thread with given slot number |
1178 | * 3 = restore window of the thread with given identifier |
1178 | * 3 = restore window of the thread with given identifier |
1179 | * edx = parameter (slot number or PID/TID) |
1179 | * edx = parameter (slot number or PID/TID) |
1180 | Returned value: |
1180 | Returned value: |
1181 | * eax = 0 - success |
1181 | * eax = 0 - success |
1182 | * eax = -1 - error (invalid identifier) |
1182 | * eax = -1 - error (invalid identifier) |
1183 | Remarks: |
1183 | Remarks: |
1184 | * The thread can minimize its window with subfunction 10. |
1184 | * The thread can minimize its window with subfunction 10. |
1185 | * One can restore and activate window simultaneously with |
1185 | * One can restore and activate window simultaneously with |
1186 | subfunction 3 (which requires slot number). |
1186 | subfunction 3 (which requires slot number). |
1187 | 1187 | ||
1188 | ---------------------- Constants for registers: ---------------------- |
1188 | ---------------------- Constants for registers: ---------------------- |
1189 | eax - SF_SYSTEM (18) |
1189 | eax - SF_SYSTEM (18) |
1190 | ebx - SSF_FOREIGN_WINDOW (22) |
1190 | ebx - SSF_FOREIGN_WINDOW (22) |
1191 | ecx - SSSF_MINIMIZE (0), SSSF_MINIMIZE_ID (1), SSSF_RESTORE (2), |
1191 | ecx - SSSF_MINIMIZE (0), SSSF_MINIMIZE_ID (1), SSSF_RESTORE (2), |
1192 | SSSF_RESTORE_ID (3) |
1192 | SSSF_RESTORE_ID (3) |
1193 | ====================================================================== |
1193 | ====================================================================== |
1194 | ======== Function 18, subfunction 23 - minimize all windows. ========== |
1194 | ======== Function 18, subfunction 23 - minimize all windows. ========== |
1195 | ====================================================================== |
1195 | ====================================================================== |
1196 | Parameters: |
1196 | Parameters: |
1197 | * eax = 18 - function number |
1197 | * eax = 18 - function number |
1198 | * ebx = 23 - subfunction number |
1198 | * ebx = 23 - subfunction number |
1199 | Returned value: |
1199 | Returned value: |
1200 | * eax = 0 - all windows have been minimized before a function call |
1200 | * eax = 0 - all windows have been minimized before a function call |
1201 | * eax = N - number of windows minimized from function |
1201 | * eax = N - number of windows minimized from function |
1202 | Remarks: |
1202 | Remarks: |
1203 | * Window of special thread (name begin to symbol @) is not minimize. |
1203 | * Window of special thread (name begin to symbol @) is not minimize. |
1204 | 1204 | ||
1205 | ---------------------- Constants for registers: ---------------------- |
1205 | ---------------------- Constants for registers: ---------------------- |
1206 | eax - SF_SYSTEM (18) |
1206 | eax - SF_SYSTEM (18) |
1207 | ebx - SSF_MINIMIZE_ALL (23) |
1207 | ebx - SSF_MINIMIZE_ALL (23) |
1208 | ====================================================================== |
1208 | ====================================================================== |
1209 | ======= Function 18, subfunction 24 - set limits of screen. ========== |
1209 | ======= Function 18, subfunction 24 - set limits of screen. ========== |
1210 | ====================================================================== |
1210 | ====================================================================== |
1211 | Parameters: |
1211 | Parameters: |
1212 | * eax = 18 - function number |
1212 | * eax = 18 - function number |
1213 | * ebx = 24 - subfunction number |
1213 | * ebx = 24 - subfunction number |
1214 | * ecx = new X size |
1214 | * ecx = new X size |
1215 | * edx = new Y size |
1215 | * edx = new Y size |
1216 | Returned value: |
1216 | Returned value: |
1217 | * function does not return value |
1217 | * function does not return value |
1218 | Remarks: |
1218 | Remarks: |
1219 | * 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. |
1220 | It is designed for non-standard displays which display the image |
1220 | It is designed for non-standard displays which display the image |
1221 | partially. |
1221 | partially. |
1222 | * The sizes specified in the function should not exceed the sizes |
1222 | * The sizes specified in the function should not exceed the sizes |
1223 | of the current video mode, otherwise the function will not change |
1223 | of the current video mode, otherwise the function will not change |
1224 | anything. |
1224 | anything. |
1225 | 1225 | ||
1226 | ---------------------- Constants for registers: ---------------------- |
1226 | ---------------------- Constants for registers: ---------------------- |
1227 | eax - SF_SYSTEM (18) |
1227 | eax - SF_SYSTEM (18) |
1228 | ebx - SSF_SET_SCREEN_LIMITS (24) |
1228 | ebx - SSF_SET_SCREEN_LIMITS (24) |
1229 | ====================================================================== |
1229 | ====================================================================== |
1230 | ===================== Function 18, subfunction 25 ==================== |
1230 | ===================== Function 18, subfunction 25 ==================== |
1231 | ===== Control position of the window relative to other windows. ====== |
1231 | ===== Control position of the window relative to other windows. ====== |
1232 | ====================================================================== |
1232 | ====================================================================== |
1233 | 1233 | ||
1234 | ------------- Subsubfunction 1 - get position ----------------------- |
1234 | ------------- Subsubfunction 1 - get position ----------------------- |
1235 | Parameters: |
1235 | Parameters: |
1236 | * eax = 18 - function number |
1236 | * eax = 18 - function number |
1237 | * ebx = 25 - subfunction number |
1237 | * ebx = 25 - subfunction number |
1238 | * ecx = 1 - subsubfunction number |
1238 | * ecx = 1 - subsubfunction number |
1239 | * edx = -1(for current window) or PID application |
1239 | * edx = -1(for current window) or PID application |
1240 | Returned value: |
1240 | Returned value: |
1241 | * eax = one of the constants window position |
1241 | * eax = one of the constants window position |
1242 | 1242 | ||
1243 | ------------- Subsubfunction 2 - set position ----------------------- |
1243 | ------------- Subsubfunction 2 - set position ----------------------- |
1244 | Parameters: |
1244 | Parameters: |
1245 | * eax = 18 - function number |
1245 | * eax = 18 - function number |
1246 | * ebx = 25 - subfunction number |
1246 | * ebx = 25 - subfunction number |
1247 | * ecx = 2 - subsubfunction number |
1247 | * ecx = 2 - subsubfunction number |
1248 | * edx = -1(for current window) or PID application |
1248 | * edx = -1(for current window) or PID application |
1249 | * esi = new window position (one of the constants below) |
1249 | * esi = new window position (one of the constants below) |
1250 | Returned value: |
1250 | Returned value: |
1251 | * eax = 0 - error |
1251 | * eax = 0 - error |
1252 | * eax = 1 - success |
1252 | * eax = 1 - success |
1253 | 1253 | ||
1254 | Constant position of the window relative to other windows: |
1254 | Constant position of the window relative to other windows: |
1255 | ZPOS_DESKTOP = -2 - on the background |
1255 | ZPOS_DESKTOP = -2 - on the background |
1256 | ZPOS_ALWAYS_BACK = -1 - behind all the windows |
1256 | ZPOS_ALWAYS_BACK = -1 - behind all the windows |
1257 | ZPOS_NORMAL = 0 - normal |
1257 | ZPOS_NORMAL = 0 - normal |
1258 | ZPOS_ALWAYS_TOP = 1 - on top of all windows |
1258 | ZPOS_ALWAYS_TOP = 1 - on top of all windows |
1259 | 1259 | ||
1260 | ---------------------- Constants for registers: ---------------------- |
1260 | ---------------------- Constants for registers: ---------------------- |
1261 | eax - SF_SYSTEM (18) |
1261 | eax - SF_SYSTEM (18) |
1262 | ebx - SSF_WINDOW_BEHAVIOR (25) |
1262 | ebx - SSF_WINDOW_BEHAVIOR (25) |
1263 | ecx - SSSF_GET_WB (1), SSSF_SET_WB (2) |
1263 | ecx - SSSF_GET_WB (1), SSSF_SET_WB (2) |
1264 | ====================================================================== |
1264 | ====================================================================== |
1265 | ==================== Function 20 - MIDI interface. =================== |
1265 | ==================== Function 20 - MIDI interface. =================== |
1266 | ====================================================================== |
1266 | ====================================================================== |
1267 | 1267 | ||
1268 | ----------------------- Subfunction 1 - reset ------------------------ |
1268 | ----------------------- Subfunction 1 - reset ------------------------ |
1269 | Parameters: |
1269 | Parameters: |
1270 | * eax = 20 - function number |
1270 | * eax = 20 - function number |
1271 | * ebx = 1 - subfunction number |
1271 | * ebx = 1 - subfunction number |
1272 | 1272 | ||
1273 | -------------------- Subfunction 2 - output byte --------------------- |
1273 | -------------------- Subfunction 2 - output byte --------------------- |
1274 | Parameters: |
1274 | Parameters: |
1275 | * eax = 20 - function number |
1275 | * eax = 20 - function number |
1276 | * ebx = 2 - subfunction number |
1276 | * ebx = 2 - subfunction number |
1277 | * cl = byte for output |
1277 | * cl = byte for output |
1278 | Returned value (is the same for both subfunctions): |
1278 | Returned value (is the same for both subfunctions): |
1279 | * eax = 0 - success |
1279 | * eax = 0 - success |
1280 | * eax = 1 - base port is not defined |
1280 | * eax = 1 - base port is not defined |
1281 | Remarks: |
1281 | Remarks: |
1282 | * Previously the base port must be defined by |
1282 | * Previously the base port must be defined by |
1283 | subfunction 1 of function 21. |
1283 | subfunction 1 of function 21. |
1284 | 1284 | ||
1285 | ---------------------- Constants for registers: ---------------------- |
1285 | ---------------------- Constants for registers: ---------------------- |
1286 | eax - SF_MIDI (20) |
1286 | eax - SF_MIDI (20) |
1287 | ebx - SSF_RESET (1), SSF_OUTPUT (2) |
1287 | ebx - SSF_RESET (1), SSF_OUTPUT (2) |
1288 | ====================================================================== |
1288 | ====================================================================== |
1289 | ======== Function 21, subfunction 1 - set MPU MIDI base port. ======== |
1289 | ======== Function 21, subfunction 1 - set MPU MIDI base port. ======== |
1290 | ====================================================================== |
1290 | ====================================================================== |
1291 | Parameters: |
1291 | Parameters: |
1292 | * eax = 21 - function number |
1292 | * eax = 21 - function number |
1293 | * ebx = 1 - subfunction number |
1293 | * ebx = 1 - subfunction number |
1294 | * ecx = number of base port |
1294 | * ecx = number of base port |
1295 | Returned value |
1295 | Returned value |
1296 | * eax = 0 - success |
1296 | * eax = 0 - success |
1297 | * eax = -1 - erratic number of a port |
1297 | * eax = -1 - erratic number of a port |
1298 | Remarks: |
1298 | Remarks: |
1299 | * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF. |
1299 | * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF. |
1300 | * The installation of base is necessary for function 20. |
1300 | * The installation of base is necessary for function 20. |
1301 | * To get base port use subfunction 1 of function 26. |
1301 | * To get base port use subfunction 1 of function 26. |
1302 | 1302 | ||
1303 | ---------------------- Constants for registers: ---------------------- |
1303 | ---------------------- Constants for registers: ---------------------- |
1304 | eax - SF_SYSTEM_SET (21) |
1304 | eax - SF_SYSTEM_SET (21) |
1305 | ebx - SSF_MPU_MIDI_BASE (1) |
1305 | ebx - SSF_MPU_MIDI_BASE (1) |
1306 | ====================================================================== |
1306 | ====================================================================== |
1307 | ========== Function 21, subfunction 2 - set keyboard layout. ========= |
1307 | ========== Function 21, subfunction 2 - set keyboard layout. ========= |
1308 | ====================================================================== |
1308 | ====================================================================== |
1309 | Keyboard layout is used to convert keyboard scancodes to ASCII-codes, |
1309 | Keyboard layout is used to convert keyboard scancodes to ASCII-codes, |
1310 | which will be read by function 2. |
1310 | which will be read by function 2. |
1311 | Parameters: |
1311 | Parameters: |
1312 | * eax = 21 - function number |
1312 | * eax = 21 - function number |
1313 | * ebx = 2 - subfunction number |
1313 | * ebx = 2 - subfunction number |
1314 | * ecx = which layout to set: |
1314 | * ecx = which layout to set: |
1315 | * 1 = normal layout |
1315 | * 1 = normal layout |
1316 | * 2 = layout at pressed Shift |
1316 | * 2 = layout at pressed Shift |
1317 | * 3 = layout at pressed Alt |
1317 | * 3 = layout at pressed Alt |
1318 | * edx = pointer to layout - table of length 128 bytes |
1318 | * edx = pointer to layout - table of length 128 bytes |
1319 | Or: |
1319 | Or: |
1320 | * ecx = 9 |
1320 | * ecx = 9 |
1321 | * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus) |
1321 | * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus) |
1322 | Returned value: |
1322 | Returned value: |
1323 | * eax = 0 - success |
1323 | * eax = 0 - success |
1324 | * eax = 1 - incorrect parameter |
1324 | * eax = 1 - incorrect parameter |
1325 | Remarks: |
1325 | Remarks: |
1326 | * If Alt is pressed, the layout with Alt is used; |
1326 | * If Alt is pressed, the layout with Alt is used; |
1327 | if Alt is not pressed, but Shift is pressed, |
1327 | if Alt is not pressed, but Shift is pressed, |
1328 | the layout with Shift is used; |
1328 | the layout with Shift is used; |
1329 | 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 |
1330 | layout is used and then from the code is subtracted 0x60; |
1330 | layout is used and then from the code is subtracted 0x60; |
1331 | if no control key is pressed, the normal layout is used. |
1331 | if no control key is pressed, the normal layout is used. |
1332 | * To get layout and country identifier use |
1332 | * To get layout and country identifier use |
1333 | subfunction 2 of function 26. |
1333 | subfunction 2 of function 26. |
1334 | * Country identifier is global system variable, which is not used |
1334 | * Country identifier is global system variable, which is not used |
1335 | by the kernel itself; however the application '@taskbar' displays |
1335 | by the kernel itself; however the application '@taskbar' displays |
1336 | the corresponding icon. |
1336 | the corresponding icon. |
1337 | * The application @taskbar switches layouts on user request. |
1337 | * The application @taskbar switches layouts on user request. |
1338 | 1338 | ||
1339 | ---------------------- Constants for registers: ---------------------- |
1339 | ---------------------- Constants for registers: ---------------------- |
1340 | eax - SF_SYSTEM_SET (21) |
1340 | eax - SF_SYSTEM_SET (21) |
1341 | ebx - SSF_KEYBOARD_LAYOUT (2) |
1341 | ebx - SSF_KEYBOARD_LAYOUT (2) |
1342 | ====================================================================== |
1342 | ====================================================================== |
1343 | ========== Function 21, subfunction 5 - set system language. ========= |
1343 | ========== Function 21, subfunction 5 - set system language. ========= |
1344 | ====================================================================== |
1344 | ====================================================================== |
1345 | Parameters: |
1345 | Parameters: |
1346 | * eax = 21 - function number |
1346 | * eax = 21 - function number |
1347 | * ebx = 5 - subfunction number |
1347 | * ebx = 5 - subfunction number |
1348 | * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus) |
1348 | * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus) |
1349 | Returned value: |
1349 | Returned value: |
1350 | * eax = 0 |
1350 | * eax = 0 |
1351 | Remarks: |
1351 | Remarks: |
1352 | * System language is global system variable and is not used |
1352 | * System language is global system variable and is not used |
1353 | by the kernel itself, however application @taskbar draws the |
1353 | by the kernel itself, however application @taskbar draws the |
1354 | appropriate icon. |
1354 | appropriate icon. |
1355 | * Function does not check for correctness, as the kernel does not |
1355 | * Function does not check for correctness, as the kernel does not |
1356 | use this variable. |
1356 | use this variable. |
1357 | * To get system language use subfunction 5 of function 26. |
1357 | * To get system language use subfunction 5 of function 26. |
1358 | 1358 | ||
1359 | ---------------------- Constants for registers: ---------------------- |
1359 | ---------------------- Constants for registers: ---------------------- |
1360 | eax - SF_SYSTEM_SET (21) |
1360 | eax - SF_SYSTEM_SET (21) |
1361 | ebx - SSF_SYS_LANG (5) |
1361 | ebx - SSF_SYS_LANG (5) |
1362 | ====================================================================== |
1362 | ====================================================================== |
1363 | Function 21, subfunction 11 - enable/disable low-level access to HD. |
1363 | Function 21, subfunction 11 - enable/disable low-level access to HD. |
1364 | ====================================================================== |
1364 | ====================================================================== |
1365 | Parameters: |
1365 | Parameters: |
1366 | * eax = 21 - function number |
1366 | * eax = 21 - function number |
1367 | * ebx = 11 - subfunction number |
1367 | * ebx = 11 - subfunction number |
1368 | * ecx = 0/1 - disable/enable |
1368 | * ecx = 0/1 - disable/enable |
1369 | Returned value: |
1369 | Returned value: |
1370 | * eax = 0 |
1370 | * eax = 0 |
1371 | Remarks: |
1371 | Remarks: |
1372 | * Is used in LBA-read (subfunction 8 of function 58). |
1372 | * Is used in LBA-read (subfunction 8 of function 58). |
1373 | * The current implementation uses only low bit of ecx. |
1373 | * The current implementation uses only low bit of ecx. |
1374 | * To get current status use subfunction 11 of function 26. |
1374 | * To get current status use subfunction 11 of function 26. |
1375 | 1375 | ||
1376 | ---------------------- Constants for registers: ---------------------- |
1376 | ---------------------- Constants for registers: ---------------------- |
1377 | eax - SF_SYSTEM_SET (21) |
1377 | eax - SF_SYSTEM_SET (21) |
1378 | ebx - SSF_ACCESS_HD_LBA (11) |
1378 | ebx - SSF_ACCESS_HD_LBA (11) |
1379 | ====================================================================== |
1379 | ====================================================================== |
1380 | Function 21, subfunction 12 - enable/disable low-level access to PCI. |
1380 | Function 21, subfunction 12 - enable/disable low-level access to PCI. |
1381 | ====================================================================== |
1381 | ====================================================================== |
1382 | Parameters: |
1382 | Parameters: |
1383 | * eax = 21 - function number |
1383 | * eax = 21 - function number |
1384 | * ebx = 12 - subfunction number |
1384 | * ebx = 12 - subfunction number |
1385 | * ecx = 0/1 - disable/enable |
1385 | * ecx = 0/1 - disable/enable |
1386 | Returned value: |
1386 | Returned value: |
1387 | * eax = 0 |
1387 | * eax = 0 |
1388 | Remarks: |
1388 | Remarks: |
1389 | * Is used in operations with PCI bus (function 62). |
1389 | * Is used in operations with PCI bus (function 62). |
1390 | * The current implementation uses only low bit of ecx. |
1390 | * The current implementation uses only low bit of ecx. |
1391 | * To get current status use subfunction 12 of function 26. |
1391 | * To get current status use subfunction 12 of function 26. |
1392 | 1392 | ||
1393 | ---------------------- Constants for registers: ---------------------- |
1393 | ---------------------- Constants for registers: ---------------------- |
1394 | eax - SF_SYSTEM_SET (21) |
1394 | eax - SF_SYSTEM_SET (21) |
1395 | ebx - SSF_ACCESS_PCI (12) |
1395 | ebx - SSF_ACCESS_PCI (12) |
1396 | ====================================================================== |
1396 | ====================================================================== |
1397 | ================= Function 22 - set system date/time. ================ |
1397 | ================= Function 22 - set system date/time. ================ |
1398 | ====================================================================== |
1398 | ====================================================================== |
1399 | Parameters: |
1399 | Parameters: |
1400 | * eax = 22 - function number |
1400 | * eax = 22 - function number |
1401 | * ebx = 0 - set time |
1401 | * ebx = 0 - set time |
1402 | * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD): |
1402 | * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD): |
1403 | * HH=hour 00..23 |
1403 | * HH=hour 00..23 |
1404 | * MM=minute 00..59 |
1404 | * MM=minute 00..59 |
1405 | * SS=second 00..59 |
1405 | * SS=second 00..59 |
1406 | * ebx = 1 - set date |
1406 | * ebx = 1 - set date |
1407 | * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD): |
1407 | * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD): |
1408 | * DD=day 01..31 |
1408 | * DD=day 01..31 |
1409 | * MM=month 01..12 |
1409 | * MM=month 01..12 |
1410 | * YY=year 00..99 |
1410 | * YY=year 00..99 |
1411 | * ebx = 2 - set day of week |
1411 | * ebx = 2 - set day of week |
1412 | * ecx = 1 for Sunday, ..., 7 for Saturday |
1412 | * ecx = 1 for Sunday, ..., 7 for Saturday |
1413 | * ebx = 3 - set alarm clock |
1413 | * ebx = 3 - set alarm clock |
1414 | * ecx = 0x00SSMMHH |
1414 | * ecx = 0x00SSMMHH |
1415 | Returned value: |
1415 | Returned value: |
1416 | * eax = 0 - success |
1416 | * eax = 0 - success |
1417 | * eax = 1 - incorrect parameter |
1417 | * eax = 1 - incorrect parameter |
1418 | * eax = 2 - CMOS-battery was unloaded |
1418 | * eax = 2 - CMOS-battery was unloaded |
1419 | Remarks: |
1419 | Remarks: |
1420 | * Value of installation of day of week seems to be doubtful, |
1420 | * Value of installation of day of week seems to be doubtful, |
1421 | as it a little where is used |
1421 | as it a little where is used |
1422 | (day of week can be calculated by date). |
1422 | (day of week can be calculated by date). |
1423 | * 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. |
1424 | But there is no existing system function to disable it. |
1424 | But there is no existing system function to disable it. |
1425 | * Operation of alarm clock consists in generation IRQ8. |
1425 | * Operation of alarm clock consists in generation IRQ8. |
1426 | * Generally CMOS supports for alarm clock set of value 0xFF |
1426 | * Generally CMOS supports for alarm clock set of value 0xFF |
1427 | as one of parameters and it means that the appropriate parameter |
1427 | as one of parameters and it means that the appropriate parameter |
1428 | is ignored. But current implementation does not allow this |
1428 | is ignored. But current implementation does not allow this |
1429 | (will return 1). |
1429 | (will return 1). |
1430 | * Alarm clock is a global system resource; the set of |
1430 | * Alarm clock is a global system resource; the set of |
1431 | an alarm clock cancels automatically the previous set. |
1431 | an alarm clock cancels automatically the previous set. |
1432 | However, at moment no program uses it. |
1432 | However, at moment no program uses it. |
1433 | 1433 | ||
1434 | ---------------------- Constants for registers: ---------------------- |
1434 | ---------------------- Constants for registers: ---------------------- |
1435 | eax - SF_SET_TIME_DATE (22) |
1435 | eax - SF_SET_TIME_DATE (22) |
1436 | ====================================================================== |
1436 | ====================================================================== |
1437 | ============= Function 23 - wait for event with timeout. ============= |
1437 | ============= Function 23 - wait for event with timeout. ============= |
1438 | ====================================================================== |
1438 | ====================================================================== |
1439 | 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, |
1440 | 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. |
1441 | 1441 | ||
1442 | Parameters: |
1442 | Parameters: |
1443 | * eax = 23 - function number |
1443 | * eax = 23 - function number |
1444 | * ebx = timeout (in 1/100 of second) |
1444 | * ebx = timeout (in 1/100 of second) |
1445 | Returned value: |
1445 | Returned value: |
1446 | * eax = 0 - the message queue is empty |
1446 | * eax = 0 - the message queue is empty |
1447 | * otherwise eax = event (see the list of events) |
1447 | * otherwise eax = event (see the list of events) |
1448 | Remarks: |
1448 | Remarks: |
1449 | * Only those events are taken into account, which enter into |
1449 | * Only those events are taken into account, which enter into |
1450 | the mask set by function 40. By default it is |
1450 | the mask set by function 40. By default it is |
1451 | redraw, key and button events. |
1451 | redraw, key and button events. |
1452 | * 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. |
1453 | To wait without timeout use function 10. |
1453 | To wait without timeout use function 10. |
1454 | * Transmission ebx=0 results in immediate returning eax=0. |
1454 | * Transmission ebx=0 results in immediate returning eax=0. |
1455 | * Current implementation returns immediately with eax=0, |
1455 | * Current implementation returns immediately with eax=0, |
1456 | 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 |
1457 | makes 32-bit overflow. |
1457 | makes 32-bit overflow. |
1458 | 1458 | ||
1459 | ---------------------- Constants for registers: ---------------------- |
1459 | ---------------------- Constants for registers: ---------------------- |
1460 | eax - SF_WAIT_EVENT_TIMEOUT (23) |
1460 | eax - SF_WAIT_EVENT_TIMEOUT (23) |
1461 | ====================================================================== |
1461 | ====================================================================== |
1462 | ======= Function 24, subfunction 4 - eject tray of disk drive. ======= |
1462 | ======= Function 24, subfunction 4 - eject tray of disk drive. ======= |
1463 | ====================================================================== |
1463 | ====================================================================== |
1464 | Parameters: |
1464 | Parameters: |
1465 | * eax = 24 - function number |
1465 | * eax = 24 - function number |
1466 | * ebx = 4 - subfunction number |
1466 | * ebx = 4 - subfunction number |
1467 | * ecx = position of CD/DVD-drive |
1467 | * ecx = position of CD/DVD-drive |
1468 | 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. |
1469 | 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. |
1470 | 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. |
1471 | Returned value: |
1471 | Returned value: |
1472 | * function does not return value |
1472 | * function does not return value |
1473 | Remarks: |
1473 | Remarks: |
1474 | * The function is supported only for ATAPI devices (CD and DVD). |
1474 | * The function is supported only for ATAPI devices (CD and DVD). |
1475 | * When the tray is being ejected, |
1475 | * When the tray is being ejected, |
1476 | manual control of tray is unlocked. |
1476 | manual control of tray is unlocked. |
1477 | * 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 |
1478 | corresponding device. |
1478 | corresponding device. |
1479 | * 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. |
1480 | 1480 | ||
1481 | ---------------------- Constants for registers: ---------------------- |
1481 | ---------------------- Constants for registers: ---------------------- |
1482 | eax - SF_CD (24) |
1482 | eax - SF_CD (24) |
1483 | ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5) |
1483 | ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5) |
1484 | ====================================================================== |
1484 | ====================================================================== |
1485 | ======== Function 24, subfunction 5 - load tray of disk drive. ======= |
1485 | ======== Function 24, subfunction 5 - load tray of disk drive. ======= |
1486 | ====================================================================== |
1486 | ====================================================================== |
1487 | Parameters: |
1487 | Parameters: |
1488 | * eax = 24 - function number |
1488 | * eax = 24 - function number |
1489 | * ebx = 5 - subfunction number |
1489 | * ebx = 5 - subfunction number |
1490 | * ecx = position of CD/DVD-drive |
1490 | * ecx = position of CD/DVD-drive |
1491 | 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. |
1492 | 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. |
1493 | 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. |
1494 | Returned value: |
1494 | Returned value: |
1495 | * function does not return value |
1495 | * function does not return value |
1496 | Remarks: |
1496 | Remarks: |
1497 | * The function is supported only for ATAPI devices (CD and DVD). |
1497 | * The function is supported only for ATAPI devices (CD and DVD). |
1498 | * 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. |
1499 | 1499 | ||
1500 | ---------------------- Constants for registers: ---------------------- |
1500 | ---------------------- Constants for registers: ---------------------- |
1501 | eax - SF_CD (24) |
1501 | eax - SF_CD (24) |
1502 | ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5) |
1502 | ebx - SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5) |
1503 | ====================================================================== |
1503 | ====================================================================== |
1504 | ======= Function 25 - put image area on the background layer. ======== |
1504 | ======= Function 25 - put image area on the background layer. ======== |
1505 | ====================================================================== |
1505 | ====================================================================== |
1506 | Paramters: |
1506 | Paramters: |
1507 | * eax = 25 - function number |
1507 | * eax = 25 - function number |
1508 | * ebx = pointer to the previously allocated memory area, |
1508 | * ebx = pointer to the previously allocated memory area, |
1509 | where placed the source images in a format BBGGRRTTBBGGRRTT... |
1509 | where placed the source images in a format BBGGRRTTBBGGRRTT... |
1510 | * ecx = [size on axis x]*65536 + [size on axis y] |
1510 | * ecx = [size on axis x]*65536 + [size on axis y] |
1511 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
1511 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
1512 | Returned value: |
1512 | Returned value: |
1513 | * function does not return value |
1513 | * function does not return value |
1514 | Remarks: |
1514 | Remarks: |
1515 | * Coordinates of the image are coordinates of the upper left corner |
1515 | * Coordinates of the image are coordinates of the upper left corner |
1516 | of the image relative to the screen. |
1516 | of the image relative to the screen. |
1517 | * Size of the image in bytes is 4*xsize*ysize |
1517 | * Size of the image in bytes is 4*xsize*ysize |
1518 | * TT - byte pointer of transparency, at current version: |
1518 | * TT - byte pointer of transparency, at current version: |
1519 | 1 to FF - opaque, 0 - transparent. |
1519 | 1 to FF - opaque, 0 - transparent. |
1520 | * 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 |
1521 | 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. |
1522 | 1522 | ||
1523 | ---------------------- Constants for registers: ---------------------- |
1523 | ---------------------- Constants for registers: ---------------------- |
1524 | eax - SF_SCREEN_PUT_IMAGE (25) |
1524 | eax - SF_SCREEN_PUT_IMAGE (25) |
1525 | ====================================================================== |
1525 | ====================================================================== |
1526 | ======== Function 26, subfunction 1 - get MPU MIDI base port. ======== |
1526 | ======== Function 26, subfunction 1 - get MPU MIDI base port. ======== |
1527 | ====================================================================== |
1527 | ====================================================================== |
1528 | Parameters: |
1528 | Parameters: |
1529 | * eax = 26 - function number |
1529 | * eax = 26 - function number |
1530 | * ebx = 1 - subfunction number |
1530 | * ebx = 1 - subfunction number |
1531 | Returned value: |
1531 | Returned value: |
1532 | * eax = port number |
1532 | * eax = port number |
1533 | Parameters: |
1533 | Parameters: |
1534 | * To set base port use subfunction 1 of function 21. |
1534 | * To set base port use subfunction 1 of function 21. |
1535 | 1535 | ||
1536 | ---------------------- Constants for registers: ---------------------- |
1536 | ---------------------- Constants for registers: ---------------------- |
1537 | eax - SF_SYSTEM_GET (26) |
1537 | eax - SF_SYSTEM_GET (26) |
1538 | ebx - SSF_MPU_MIDI_BASE (1) |
1538 | ebx - SSF_MPU_MIDI_BASE (1) |
1539 | ====================================================================== |
1539 | ====================================================================== |
1540 | ========== Function 26, subfunction 2 - get keyboard layout. ========= |
1540 | ========== Function 26, subfunction 2 - get keyboard layout. ========= |
1541 | ====================================================================== |
1541 | ====================================================================== |
1542 | The keyboard layout is used to convert keyboard scancodes to |
1542 | The keyboard layout is used to convert keyboard scancodes to |
1543 | ASCII-codes for function 2. |
1543 | ASCII-codes for function 2. |
1544 | Parameters: |
1544 | Parameters: |
1545 | * eax = 26 - function number |
1545 | * eax = 26 - function number |
1546 | * ebx = 2 - subfunction number |
1546 | * ebx = 2 - subfunction number |
1547 | * ecx = what layout to get: |
1547 | * ecx = what layout to get: |
1548 | * 1 = normal layout |
1548 | * 1 = normal layout |
1549 | * 2 = layout with pressed Shift |
1549 | * 2 = layout with pressed Shift |
1550 | * 3 = layout with pressed Alt |
1550 | * 3 = layout with pressed Alt |
1551 | * 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 |
1552 | copied |
1552 | copied |
1553 | Returned value: |
1553 | Returned value: |
1554 | * function does not return value |
1554 | * function does not return value |
1555 | Or: |
1555 | Or: |
1556 | * eax = 26 - function number |
1556 | * eax = 26 - function number |
1557 | * ebx = 2 - subfunction number |
1557 | * ebx = 2 - subfunction number |
1558 | * ecx = 9 |
1558 | * ecx = 9 |
1559 | Returned value: |
1559 | Returned value: |
1560 | * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus) |
1560 | * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus) |
1561 | Remarks: |
1561 | Remarks: |
1562 | * If Alt is pressed, the layout with Alt is used; |
1562 | * If Alt is pressed, the layout with Alt is used; |
1563 | if Alt is not pressed, but Shift is pressed, |
1563 | if Alt is not pressed, but Shift is pressed, |
1564 | the layout with Shift is used; |
1564 | the layout with Shift is used; |
1565 | 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 |
1566 | layout is used and then from the code is subtracted 0x60; |
1566 | layout is used and then from the code is subtracted 0x60; |
1567 | if no control key is pressed, the normal layout is used. |
1567 | if no control key is pressed, the normal layout is used. |
1568 | * To set layout and country identifier use |
1568 | * To set layout and country identifier use |
1569 | subfunction 2 of function 21. |
1569 | subfunction 2 of function 21. |
1570 | * Country identifier is global system variable, which is not used |
1570 | * Country identifier is global system variable, which is not used |
1571 | by the kernel itself; however the application '@taskbar' displays |
1571 | by the kernel itself; however the application '@taskbar' displays |
1572 | the corresponding icon (using this function). |
1572 | the corresponding icon (using this function). |
1573 | * The application @taskbar switches layouts on user request. |
1573 | * The application @taskbar switches layouts on user request. |
1574 | 1574 | ||
1575 | ---------------------- Constants for registers: ---------------------- |
1575 | ---------------------- Constants for registers: ---------------------- |
1576 | eax - SF_SYSTEM_GET (26) |
1576 | eax - SF_SYSTEM_GET (26) |
1577 | ebx - SSF_KEYBOARD_LAYOUT (2) |
1577 | ebx - SSF_KEYBOARD_LAYOUT (2) |
1578 | ====================================================================== |
1578 | ====================================================================== |
1579 | ========== Function 26, subfunction 5 - get system language. ========= |
1579 | ========== Function 26, subfunction 5 - get system language. ========= |
1580 | ====================================================================== |
1580 | ====================================================================== |
1581 | Parameters: |
1581 | Parameters: |
1582 | * eax = 26 - function number |
1582 | * eax = 26 - function number |
1583 | * ebx = 5 - subfunction number |
1583 | * ebx = 5 - subfunction number |
1584 | Returned value: |
1584 | Returned value: |
1585 | * eax = system language (1=eng, 2=fi, 3=ger, 4=rus) |
1585 | * eax = system language (1=eng, 2=fi, 3=ger, 4=rus) |
1586 | Remarks: |
1586 | Remarks: |
1587 | * System language is global system variable and is not used |
1587 | * System language is global system variable and is not used |
1588 | by the kernel itself, however application @taskbar draws the |
1588 | by the kernel itself, however application @taskbar draws the |
1589 | appropriate icon (using this function). |
1589 | appropriate icon (using this function). |
1590 | * To set system language use subfunction 5 of function 21. |
1590 | * To set system language use subfunction 5 of function 21. |
1591 | 1591 | ||
1592 | ---------------------- Constants for registers: ---------------------- |
1592 | ---------------------- Constants for registers: ---------------------- |
1593 | eax - SF_SYSTEM_GET (26) |
1593 | eax - SF_SYSTEM_GET (26) |
1594 | ebx - SSF_SYS_LANG (5) |
1594 | ebx - SSF_SYS_LANG (5) |
1595 | ====================================================================== |
1595 | ====================================================================== |
1596 | === Function 26, subfunction 9 - get the value of the time counter. == |
1596 | === Function 26, subfunction 9 - get the value of the time counter. == |
1597 | ====================================================================== |
1597 | ====================================================================== |
1598 | Parameters: |
1598 | Parameters: |
1599 | * eax = 26 - function number |
1599 | * eax = 26 - function number |
1600 | * ebx = 9 - subfunction number |
1600 | * ebx = 9 - subfunction number |
1601 | Returned value: |
1601 | Returned value: |
1602 | * 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 |
1603 | Remarks: |
1603 | Remarks: |
1604 | * Counter takes modulo 2^32, that correspond to a little more |
1604 | * Counter takes modulo 2^32, that correspond to a little more |
1605 | than 497 days. |
1605 | than 497 days. |
1606 | * To get system time use function 3. |
1606 | * To get system time use function 3. |
1607 | 1607 | ||
1608 | ---------------------- Constants for registers: ---------------------- |
1608 | ---------------------- Constants for registers: ---------------------- |
1609 | eax - SF_SYSTEM_GET (26) |
1609 | eax - SF_SYSTEM_GET (26) |
1610 | ebx - SSF_TIME_COUNT (9) |
1610 | ebx - SSF_TIME_COUNT (9) |
1611 | ====================================================================== |
1611 | ====================================================================== |
1612 | ===================== Function 26, subfunction 10 ==================== |
1612 | ===================== Function 26, subfunction 10 ==================== |
1613 | ========== Get the value of the high precision time counter. ========= |
1613 | ========== Get the value of the high precision time counter. ========= |
1614 | ====================================================================== |
1614 | ====================================================================== |
1615 | Parameters: |
1615 | Parameters: |
1616 | * eax = 26 - function number |
1616 | * eax = 26 - function number |
1617 | * ebx = 10 - subfunction number |
1617 | * ebx = 10 - subfunction number |
1618 | Returned value: |
1618 | Returned value: |
1619 | * eax = number of nanoseconds since system boot time (lower DWORD) |
1619 | * eax = number of nanoseconds since system boot time (lower DWORD) |
1620 | * edx = number of nanoseconds since system boot time (high DWORD) |
1620 | * edx = number of nanoseconds since system boot time (high DWORD) |
1621 | Remarks: |
1621 | Remarks: |
1622 | * 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 |
1623 | will be reduced to 10 000 000 nanoseconds. |
1623 | will be reduced to 10 000 000 nanoseconds. |
1624 | 1624 | ||
1625 | ---------------------- Constants for registers: ---------------------- |
1625 | ---------------------- Constants for registers: ---------------------- |
1626 | eax - SF_SYSTEM_GET (26) |
1626 | eax - SF_SYSTEM_GET (26) |
1627 | ebx - SSF_TIME_COUNT_PRO (10) |
1627 | ebx - SSF_TIME_COUNT_PRO (10) |
1628 | ====================================================================== |
1628 | ====================================================================== |
1629 | ===================== Function 26, subfunction 11 ==================== |
1629 | ===================== Function 26, subfunction 11 ==================== |
1630 | ========== Find out whether low-level HD access is enabled. ========== |
1630 | ========== Find out whether low-level HD access is enabled. ========== |
1631 | ====================================================================== |
1631 | ====================================================================== |
1632 | Parameters: |
1632 | Parameters: |
1633 | * eax = 26 - function number |
1633 | * eax = 26 - function number |
1634 | * ebx = 11 - subfunction number |
1634 | * ebx = 11 - subfunction number |
1635 | Returned value: |
1635 | Returned value: |
1636 | * eax = 0/1 - disabled/enabled |
1636 | * eax = 0/1 - disabled/enabled |
1637 | Remarks: |
1637 | Remarks: |
1638 | * Is used in LBA read (subfunction 8 of function 58). |
1638 | * Is used in LBA read (subfunction 8 of function 58). |
1639 | * To set current state use subfunction 11 of function 21. |
1639 | * To set current state use subfunction 11 of function 21. |
1640 | 1640 | ||
1641 | ---------------------- Constants for registers: ---------------------- |
1641 | ---------------------- Constants for registers: ---------------------- |
1642 | eax - SF_SYSTEM_GET (26) |
1642 | eax - SF_SYSTEM_GET (26) |
1643 | ebx - SSF_ACCESS_HD_LBA (11) |
1643 | ebx - SSF_ACCESS_HD_LBA (11) |
1644 | ====================================================================== |
1644 | ====================================================================== |
1645 | ===================== Function 26, subfunction 12 ==================== |
1645 | ===================== Function 26, subfunction 12 ==================== |
1646 | ========== Find out whether low-level PCI access is enabled. ========= |
1646 | ========== Find out whether low-level PCI access is enabled. ========= |
1647 | ====================================================================== |
1647 | ====================================================================== |
1648 | Parameters: |
1648 | Parameters: |
1649 | * eax = 26 - function number |
1649 | * eax = 26 - function number |
1650 | * ebx = 12 - subfunction number |
1650 | * ebx = 12 - subfunction number |
1651 | Returned value: |
1651 | Returned value: |
1652 | * eax = 0/1 - disabled/enabled |
1652 | * eax = 0/1 - disabled/enabled |
1653 | Remarks: |
1653 | Remarks: |
1654 | * Is used by operations with PCI bus (function 62). |
1654 | * Is used by operations with PCI bus (function 62). |
1655 | * The current implementation uses only low bit of ecx. |
1655 | * The current implementation uses only low bit of ecx. |
1656 | * To set the current state use subfunction 12 of function 21. |
1656 | * To set the current state use subfunction 12 of function 21. |
1657 | 1657 | ||
1658 | ---------------------- Constants for registers: ---------------------- |
1658 | ---------------------- Constants for registers: ---------------------- |
1659 | eax - SF_SYSTEM_GET (26) |
1659 | eax - SF_SYSTEM_GET (26) |
1660 | ebx - SSF_ACCESS_PCI (12) |
1660 | ebx - SSF_ACCESS_PCI (12) |
1661 | ====================================================================== |
1661 | ====================================================================== |
1662 | =================== Function 29 - get system date. =================== |
1662 | =================== Function 29 - get system date. =================== |
1663 | ====================================================================== |
1663 | ====================================================================== |
1664 | Parameters: |
1664 | Parameters: |
1665 | * eax = 29 - function number |
1665 | * eax = 29 - function number |
1666 | Returned value: |
1666 | Returned value: |
1667 | * eax = 0x00DDMMYY, where |
1667 | * eax = 0x00DDMMYY, where |
1668 | (binary-decimal coding, BCD, is used) |
1668 | (binary-decimal coding, BCD, is used) |
1669 | * YY = two low digits of year (00..99) |
1669 | * YY = two low digits of year (00..99) |
1670 | * MM = month (01..12) |
1670 | * MM = month (01..12) |
1671 | * DD = day (01..31) |
1671 | * DD = day (01..31) |
1672 | Remarks: |
1672 | Remarks: |
1673 | * To set system date use function 22. |
1673 | * To set system date use function 22. |
1674 | 1674 | ||
1675 | ---------------------- Constants for registers: ---------------------- |
1675 | ---------------------- Constants for registers: ---------------------- |
1676 | eax - SF_GET_SYS_DATE (29) |
1676 | eax - SF_GET_SYS_DATE (29) |
1677 | ====================================================================== |
1677 | ====================================================================== |
1678 | ============= Function 30 - work with the current folder. ============ |
1678 | ============= Function 30 - work with the current folder. ============ |
1679 | ====================================================================== |
1679 | ====================================================================== |
1680 | --------- Subfunction 1 - set current folder for the thread. --------- |
1680 | --------- Subfunction 1 - set current folder for the thread. --------- |
1681 | Parameters: |
1681 | Parameters: |
1682 | * eax = 30 - function number |
1682 | * eax = 30 - function number |
1683 | * ebx = 1 - subfunction number |
1683 | * ebx = 1 - subfunction number |
1684 | * ecx = pointer to string with the path to new current folder, |
1684 | * ecx = pointer to string with the path to new current folder, |
1685 | rules of path forming can be found in function 70 description. |
1685 | rules of path forming can be found in function 70 description. |
1686 | Returned value: |
1686 | Returned value: |
1687 | * function does not return value |
1687 | * function does not return value |
1688 | ---------------------------------------------------------------------- |
1688 | ---------------------------------------------------------------------- |
1689 | --------- Subfunction 2 - get current folder for the thread. --------- |
1689 | --------- Subfunction 2 - get current folder for the thread. --------- |
1690 | Parameters: |
1690 | Parameters: |
1691 | * eax = 30 - function number |
1691 | * eax = 30 - function number |
1692 | * ebx = 2 - subfunction number |
1692 | * ebx = 2 - subfunction number |
1693 | * ecx = pointer to buffer |
1693 | * ecx = pointer to buffer |
1694 | * edx = size of buffer |
1694 | * edx = size of buffer |
1695 | Returned value: |
1695 | Returned value: |
1696 | * eax = size of the string (including terminating 0) |
1696 | * eax = size of the string (including terminating 0) |
1697 | Remarks: |
1697 | Remarks: |
1698 | * If the buffer is too small to hold all path, only part of the string |
1698 | * If the buffer is too small to hold all path, only part of the string |
1699 | will be copied and terminated with 0. |
1699 | will be copied and terminated with 0. |
1700 | * By default, current folder for the thread is "/rd/1". |
1700 | * By default, current folder for the thread is "/rd/1". |
1701 | * At process/thread creation the current folder will be inherited |
1701 | * At process/thread creation the current folder will be inherited |
1702 | from the parent. |
1702 | from the parent. |
1703 | ---------------------------------------------------------------------- |
1703 | ---------------------------------------------------------------------- |
1704 | --- Subfunction 3 - install the add.system directory for the kernel -- |
1704 | --- Subfunction 3 - install the add.system directory for the kernel -- |
1705 | Parameters: |
1705 | Parameters: |
1706 | * eax = 30 - function number |
1706 | * eax = 30 - function number |
1707 | * ebx = 3 - subfunction number |
1707 | * ebx = 3 - subfunction number |
1708 | * ecx = pointer to a block of data: |
1708 | * ecx = pointer to a block of data: |
1709 | key rb 64 |
1709 | key rb 64 |
1710 | path rb 64 |
1710 | path rb 64 |
1711 | Example: |
1711 | Example: |
1712 | align 64 |
1712 | align 64 |
1713 | key db 'kolibrios',0 ; key must be in lower case |
1713 | key db 'kolibrios',0 ; key must be in lower case |
1714 | align 64 |
1714 | align 64 |
1715 | path db 'HD0/1',0 |
1715 | path db 'HD0/1',0 |
1716 | 1716 | ||
1717 | Returned value: |
1717 | Returned value: |
1718 | * function does not return value |
1718 | * function does not return value |
1719 | Remarks: |
1719 | Remarks: |
1720 | * The function can be called only 1 time for 1 session of the OS. |
1720 | * The function can be called only 1 time for 1 session of the OS. |
1721 | * On input the symbolic key is not changing by encoding. |
1721 | * On input the symbolic key is not changing by encoding. |
1722 | ---------------------------------------------------------------------- |
1722 | ---------------------------------------------------------------------- |
1723 | ---- Subfunction 4 - set current folder, specifying the encoding. ---- |
1723 | ---- Subfunction 4 - set current folder, specifying the encoding. ---- |
1724 | Parameters: |
1724 | Parameters: |
1725 | * eax = 30 - function number |
1725 | * eax = 30 - function number |
1726 | * ebx = 4 - subfunction number |
1726 | * ebx = 4 - subfunction number |
1727 | * ecx = pointer to string with the path to new current folder |
1727 | * ecx = pointer to string with the path to new current folder |
1728 | * edx = string encoding, details can be found in function 80 description. |
1728 | * edx = string encoding, details can be found in function 80 description. |
1729 | Returned value: |
1729 | Returned value: |
1730 | * function does not return value |
1730 | * function does not return value |
1731 | ---------------------------------------------------------------------- |
1731 | ---------------------------------------------------------------------- |
1732 | ---- Subfunction 5 - get current folder, specifying the encoding. ---- |
1732 | ---- Subfunction 5 - get current folder, specifying the encoding. ---- |
1733 | Parameters: |
1733 | Parameters: |
1734 | * eax = 30 - function number |
1734 | * eax = 30 - function number |
1735 | * ebx = 5 - subfunction number |
1735 | * ebx = 5 - subfunction number |
1736 | * ecx = pointer to buffer |
1736 | * ecx = pointer to buffer |
1737 | * edx = size of buffer |
1737 | * edx = size of buffer |
1738 | * esi = string encoding |
1738 | * esi = string encoding |
1739 | Returned value: |
1739 | Returned value: |
1740 | * eax = size of the string in bytes (including terminating 0) |
1740 | * eax = size of the string in bytes (including terminating 0) |
1741 | Remarks: |
1741 | Remarks: |
1742 | * If the buffer is too small to hold all path, only part of the string |
1742 | * If the buffer is too small to hold all path, only part of the string |
1743 | will be copied and terminated with 0. |
1743 | will be copied and terminated with 0. |
1744 | * By default, current folder for the thread is "/rd/1". |
1744 | * By default, current folder for the thread is "/rd/1". |
1745 | * At process/thread creation the current folder will be inherited |
1745 | * At process/thread creation the current folder will be inherited |
1746 | from the parent. |
1746 | from the parent. |
1747 | 1747 | ||
1748 | ---------------------- Constants for registers: ---------------------- |
1748 | ---------------------- Constants for registers: ---------------------- |
1749 | eax - SF_CURRENT_FOLDER (30) |
1749 | eax - SF_CURRENT_FOLDER (30) |
1750 | ebx - SSF_SET_CF (1), SSF_GET_CF (2), SSF_ADD_SYS_FOLDER (3) |
1750 | ebx - SSF_SET_CF (1), SSF_GET_CF (2), SSF_ADD_SYS_FOLDER (3) |
1751 | ====================================================================== |
1751 | ====================================================================== |
1752 | ========= Function 34 - who owner the pixel on the screen. =========== |
1752 | ========= Function 34 - who owner the pixel on the screen. =========== |
1753 | ====================================================================== |
1753 | ====================================================================== |
1754 | Parameters: |
1754 | Parameters: |
1755 | * eax = 34 - function number |
1755 | * eax = 34 - function number |
1756 | * ebx = x-coordinate (relative to the display) |
1756 | * ebx = x-coordinate (relative to the display) |
1757 | * ecx = y-coordinate (relative to the display) |
1757 | * ecx = y-coordinate (relative to the display) |
1758 | 1758 | ||
1759 | Returned value: |
1759 | Returned value: |
1760 | * eax = 0x000000XX - owner of pixel the slot window N |
1760 | * eax = 0x000000XX - owner of pixel the slot window N |
1761 | If incorrect values ebx and ecx then function returns 0 |
1761 | If incorrect values ebx and ecx then function returns 0 |
1762 | * The function takes the value from the area [_WinMapAddress] |
1762 | * The function takes the value from the area [_WinMapAddress] |
1763 | 1763 | ||
1764 | ---------------------- Constants for registers: ---------------------- |
1764 | ---------------------- Constants for registers: ---------------------- |
1765 | eax - SF_GET_PIXEL_OWNER (34) |
1765 | eax - SF_GET_PIXEL_OWNER (34) |
1766 | ====================================================================== |
1766 | ====================================================================== |
1767 | ======= Function 35 - read the color of a pixel on the screen. ======= |
1767 | ======= Function 35 - read the color of a pixel on the screen. ======= |
1768 | ====================================================================== |
1768 | ====================================================================== |
1769 | Parameters: |
1769 | Parameters: |
1770 | * eax = 35 |
1770 | * eax = 35 |
1771 | * ebx = y*xsize+x, where |
1771 | * ebx = y*xsize+x, where |
1772 | * (x,y) = coordinates of a pixel (beginning from 0) |
1772 | * (x,y) = coordinates of a pixel (beginning from 0) |
1773 | * xsize = horizontal screen size |
1773 | * xsize = horizontal screen size |
1774 | Returned value: |
1774 | Returned value: |
1775 | * eax = color 0x00RRGGBB |
1775 | * eax = color 0x00RRGGBB |
1776 | Remarks: |
1776 | Remarks: |
1777 | * To get screen sizes use function 14. Pay attention, |
1777 | * To get screen sizes use function 14. Pay attention, |
1778 | that it subtracts 1 from both sizes. |
1778 | that it subtracts 1 from both sizes. |
1779 | * There is also direct access (without any system calls) |
1779 | * There is also direct access (without any system calls) |
1780 | to videomemory through the selector gs. To get parameters of |
1780 | to videomemory through the selector gs. To get parameters of |
1781 | the current videomode, use function 61. |
1781 | the current videomode, use function 61. |
1782 | 1782 | ||
1783 | ---------------------- Constants for registers: ---------------------- |
1783 | ---------------------- Constants for registers: ---------------------- |
1784 | eax - SF_GET_PIXEL (35) |
1784 | eax - SF_GET_PIXEL (35) |
1785 | ====================================================================== |
1785 | ====================================================================== |
1786 | =================== Function 36 - read screen area. ================== |
1786 | =================== Function 36 - read screen area. ================== |
1787 | ====================================================================== |
1787 | ====================================================================== |
1788 | Paramters: |
1788 | Paramters: |
1789 | * eax = 36 - function number |
1789 | * eax = 36 - function number |
1790 | * ebx = pointer to the previously allocated memory area, |
1790 | * ebx = pointer to the previously allocated memory area, |
1791 | where will be placed the image in the format BBGGRRBBGGRR... |
1791 | where will be placed the image in the format BBGGRRBBGGRR... |
1792 | * ecx = [size on axis x]*65536 + [size on axis y] |
1792 | * ecx = [size on axis x]*65536 + [size on axis y] |
1793 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
1793 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
1794 | Returned value: |
1794 | Returned value: |
1795 | * function does not return value |
1795 | * function does not return value |
1796 | Remarks: |
1796 | Remarks: |
1797 | * Coordinates of the image are coordinates of the upper left corner |
1797 | * Coordinates of the image are coordinates of the upper left corner |
1798 | of the image relative to the screen. |
1798 | of the image relative to the screen. |
1799 | * Size of the image in bytes is 3*xsize*ysize. |
1799 | * Size of the image in bytes is 3*xsize*ysize. |
1800 | 1800 | ||
1801 | ---------------------- Constants for registers: ---------------------- |
1801 | ---------------------- Constants for registers: ---------------------- |
1802 | eax - SF_GET_IMAGE (36) |
1802 | eax - SF_GET_IMAGE (36) |
1803 | ====================================================================== |
1803 | ====================================================================== |
1804 | =================== Function 37 - work with mouse. =================== |
1804 | =================== Function 37 - work with mouse. =================== |
1805 | ====================================================================== |
1805 | ====================================================================== |
1806 | 1806 | ||
1807 | ---------- Subfunction 0 - screen coordinates of the mouse ----------- |
1807 | ---------- Subfunction 0 - screen coordinates of the mouse ----------- |
1808 | Parameters: |
1808 | Parameters: |
1809 | * eax = 37 - function number |
1809 | * eax = 37 - function number |
1810 | * ebx = 0 - subfunction number |
1810 | * ebx = 0 - subfunction number |
1811 | Returned value: |
1811 | Returned value: |
1812 | * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer |
1812 | * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer |
1813 | (beginning from 0) |
1813 | (beginning from 0) |
1814 | 1814 | ||
1815 | -- Subfunction 1 - coordinates of the mouse relative to the window --- |
1815 | -- Subfunction 1 - coordinates of the mouse relative to the window --- |
1816 | Parameters: |
1816 | Parameters: |
1817 | * eax = 37 - function number |
1817 | * eax = 37 - function number |
1818 | * ebx = 1 - subfunction number |
1818 | * ebx = 1 - subfunction number |
1819 | Returned value: |
1819 | Returned value: |
1820 | * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer |
1820 | * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer |
1821 | relative to the application window (beginning from 0) |
1821 | relative to the application window (beginning from 0) |
1822 | Remarks: |
1822 | Remarks: |
1823 | * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd). |
1823 | * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd). |
1824 | If y>=ywnd, the low word is non-negative and contains |
1824 | If y>=ywnd, the low word is non-negative and contains |
1825 | relative y-coordinate, and the high word - relative x-coordinate |
1825 | relative y-coordinate, and the high word - relative x-coordinate |
1826 | (with correct sign). Otherwise the low word is negative and still |
1826 | (with correct sign). Otherwise the low word is negative and still |
1827 | contains relative y-coordinate, and to the high word |
1827 | contains relative y-coordinate, and to the high word |
1828 | 1 should be added. |
1828 | 1 should be added. |
1829 | 1829 | ||
1830 | ------------- Subfunction 2 - states of the mouse buttons ------------ |
1830 | ------------- Subfunction 2 - states of the mouse buttons ------------ |
1831 | Parameters: |
1831 | Parameters: |
1832 | * eax = 37 - function number |
1832 | * eax = 37 - function number |
1833 | * ebx = 2 - subfunction number |
1833 | * ebx = 2 - subfunction number |
1834 | Returned value: |
1834 | Returned value: |
1835 | * eax = bits 0-4 equal to subfunction 3 |
1835 | * eax = bits 0-4 equal to subfunction 3 |
1836 | 1836 | ||
1837 | ------- Subfunction 3 - states and events of the mouse buttons ------- |
1837 | ------- Subfunction 3 - states and events of the mouse buttons ------- |
1838 | Parameters: |
1838 | Parameters: |
1839 | * eax = 37 - function number |
1839 | * eax = 37 - function number |
1840 | * ebx = 3 - subfunction number |
1840 | * ebx = 3 - subfunction number |
1841 | Returned value: |
1841 | Returned value: |
1842 | * eax contains next information: |
1842 | * eax contains next information: |
1843 | 1843 | ||
1844 | states: |
1844 | states: |
1845 | * bit 0 is set = left button is held |
1845 | * bit 0 is set = left button is held |
1846 | * bit 1 is set = right button is held |
1846 | * bit 1 is set = right button is held |
1847 | * bit 2 is set = middle button is held |
1847 | * bit 2 is set = middle button is held |
1848 | * bit 3 is set = 4th button is held |
1848 | * bit 3 is set = 4th button is held |
1849 | * bit 4 is set = 5th button is held |
1849 | * bit 4 is set = 5th button is held |
1850 | 1850 | ||
1851 | events: |
1851 | events: |
1852 | * bit 8 is set = left button is pressed |
1852 | * bit 8 is set = left button is pressed |
1853 | * bit 9 is set = right button is pressed |
1853 | * bit 9 is set = right button is pressed |
1854 | * bit 10 is set = middle button is pressed |
1854 | * bit 10 is set = middle button is pressed |
1855 | 1855 | ||
1856 | * bit 15 is set = vertical scroll is used |
1856 | * bit 15 is set = vertical scroll is used |
1857 | 1857 | ||
1858 | * bit 16 is set = left button is released |
1858 | * bit 16 is set = left button is released |
1859 | * bit 17 is set = right button is released |
1859 | * bit 17 is set = right button is released |
1860 | * bit 18 is set = middle button is released |
1860 | * bit 18 is set = middle button is released |
1861 | 1861 | ||
1862 | * bit 23 is set = horisontal scroll is used |
1862 | * bit 23 is set = horisontal scroll is used |
1863 | 1863 | ||
1864 | * bit 24 is set = doubleclick by left button |
1864 | * bit 24 is set = doubleclick by left button |
1865 | 1865 | ||
1866 | -------------------- Subfunction 4 - load cursor --------------------- |
1866 | -------------------- Subfunction 4 - load cursor --------------------- |
1867 | Parameters: |
1867 | Parameters: |
1868 | * eax = 37 - function number |
1868 | * eax = 37 - function number |
1869 | * ebx = 4 - subfunction number |
1869 | * ebx = 4 - subfunction number |
1870 | * dx = data source: |
1870 | * dx = data source: |
1871 | * dx = LOAD_FROM_FILE = 0 - data in a file |
1871 | * dx = LOAD_FROM_FILE = 0 - data in a file |
1872 | * ecx = pointer to full path to the cursor file |
1872 | * ecx = pointer to full path to the cursor file |
1873 | * the file must be in the format .cur, which is standard for |
1873 | * the file must be in the format .cur, which is standard for |
1874 | MS Windows, at that of the size 32*32 pixels |
1874 | MS Windows, at that of the size 32*32 pixels |
1875 | * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory |
1875 | * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory |
1876 | * ecx = pointer to data of the cursor file |
1876 | * ecx = pointer to data of the cursor file |
1877 | * the data format is the same as in the previous case |
1877 | * the data format is the same as in the previous case |
1878 | * dx = LOAD_INDIRECT = 2 - data in memory |
1878 | * dx = LOAD_INDIRECT = 2 - data in memory |
1879 | * ecx = pointer to cursor image in the format ARGB 32*32 pixels |
1879 | * ecx = pointer to cursor image in the format ARGB 32*32 pixels |
1880 | * edx = 0xXXYY0002, where |
1880 | * edx = 0xXXYY0002, where |
1881 | * XX = x-coordinate of cursor hotspot |
1881 | * XX = x-coordinate of cursor hotspot |
1882 | * YY = y-coordinate |
1882 | * YY = y-coordinate |
1883 | * 0 <= XX, YY <= 31 |
1883 | * 0 <= XX, YY <= 31 |
1884 | Returned value: |
1884 | Returned value: |
1885 | * eax = 0 - failed |
1885 | * eax = 0 - failed |
1886 | * otherwise eax = cursor handle |
1886 | * otherwise eax = cursor handle |
1887 | 1887 | ||
1888 | --------------------- Subfunction 5 - set cursor --------------------- |
1888 | --------------------- Subfunction 5 - set cursor --------------------- |
1889 | Sets new cursor for the window of the current thread. |
1889 | Sets new cursor for the window of the current thread. |
1890 | Parameters: |
1890 | Parameters: |
1891 | * eax = 37 - function number |
1891 | * eax = 37 - function number |
1892 | * ebx = 5 - subfunction number |
1892 | * ebx = 5 - subfunction number |
1893 | * ecx = cursor handle |
1893 | * ecx = cursor handle |
1894 | Returned value: |
1894 | Returned value: |
1895 | * eax = handle of previous cursor |
1895 | * eax = handle of previous cursor |
1896 | Remarks: |
1896 | Remarks: |
1897 | * If the handle is incorrect, the function restores the default |
1897 | * If the handle is incorrect, the function restores the default |
1898 | cursor (standard arrow). In particular, ecx=0 restores it. |
1898 | cursor (standard arrow). In particular, ecx=0 restores it. |
1899 | 1899 | ||
1900 | ------------------- Subfunction 6 - delete cursor -------------------- |
1900 | ------------------- Subfunction 6 - delete cursor -------------------- |
1901 | Parameters: |
1901 | Parameters: |
1902 | * eax = 37 - function number |
1902 | * eax = 37 - function number |
1903 | * ebx = 6 - subfunction number |
1903 | * ebx = 6 - subfunction number |
1904 | * ecx = cursor handle |
1904 | * ecx = cursor handle |
1905 | Returned value: |
1905 | Returned value: |
1906 | * eax destroyed |
1906 | * eax destroyed |
1907 | Remarks: |
1907 | Remarks: |
1908 | * The cursor must be loaded previously by the current thread |
1908 | * The cursor must be loaded previously by the current thread |
1909 | (with the call to subfunction 4). The function does not delete |
1909 | (with the call to subfunction 4). The function does not delete |
1910 | system cursors and cursors, loaded by another applications. |
1910 | system cursors and cursors, loaded by another applications. |
1911 | * If the active cursor (set by subfunction 5) is deleted, |
1911 | * If the active cursor (set by subfunction 5) is deleted, |
1912 | the system restores the default cursor (standard arrow). |
1912 | the system restores the default cursor (standard arrow). |
1913 | 1913 | ||
1914 | ------------------ Subfunction 7 - get scroll data ------------------- |
1914 | ------------------ Subfunction 7 - get scroll data ------------------- |
1915 | Parameters: |
1915 | Parameters: |
1916 | * eax = 37 - function number |
1916 | * eax = 37 - function number |
1917 | * ebx = 7 - subfunction number |
1917 | * ebx = 7 - subfunction number |
1918 | Returned value: |
1918 | Returned value: |
1919 | * eax = [horizontal offset]*65536 + [vertical offset] |
1919 | * eax = [horizontal offset]*65536 + [vertical offset] |
1920 | Remarks: |
1920 | Remarks: |
1921 | * Scroll data is available for active window only. |
1921 | * Scroll data is available for active window only. |
1922 | * Values are zeroed after reading. |
1922 | * Values are zeroed after reading. |
1923 | * Values are signed. |
1923 | * Values are signed. |
1924 | 1924 | ||
1925 | -------- Subfunction 8 - load cursor, specifying the encoding -------- |
1925 | -------- Subfunction 8 - load cursor, specifying the encoding -------- |
1926 | Parameters: |
1926 | Parameters: |
1927 | * eax = 37 - function number |
1927 | * eax = 37 - function number |
1928 | * ebx = 8 - subfunction number |
1928 | * ebx = 8 - subfunction number |
1929 | * ecx = pointer to the cursor file path string |
1929 | * ecx = pointer to the cursor file path string |
1930 | * edx = string encoding, details can be found in function 80 description. |
1930 | * edx = string encoding, details can be found in function 80 description. |
1931 | Returned value: |
1931 | Returned value: |
1932 | * eax = cursor handle, 0 - failed |
1932 | * eax = cursor handle, 0 - failed |
1933 | 1933 | ||
1934 | ---------------------- Constants for registers: ---------------------- |
1934 | ---------------------- Constants for registers: ---------------------- |
1935 | eax - SF_MOUSE_GET (37) |
1935 | eax - SF_MOUSE_GET (37) |
1936 | ebx - SSF_SCREEN_POSITION (0), SSF_WINDOW_POSITION (1), |
1936 | ebx - SSF_SCREEN_POSITION (0), SSF_WINDOW_POSITION (1), |
1937 | SSF_BUTTON (2), SSF_BUTTON_EXT (3), SSF_LOAD_CURSOR (4), |
1937 | SSF_BUTTON (2), SSF_BUTTON_EXT (3), SSF_LOAD_CURSOR (4), |
1938 | SSF_SET_CURSOR (5), SSF_DEL_CURSOR (6), SSF_SCROLL_DATA (7) |
1938 | SSF_SET_CURSOR (5), SSF_DEL_CURSOR (6), SSF_SCROLL_DATA (7) |
1939 | ====================================================================== |
1939 | ====================================================================== |
1940 | ====================== Function 38 - draw line. ====================== |
1940 | ====================== Function 38 - draw line. ====================== |
1941 | ====================================================================== |
1941 | ====================================================================== |
1942 | Parameters: |
1942 | Parameters: |
1943 | * eax = 38 - function number |
1943 | * eax = 38 - function number |
1944 | * ebx = [start coordinate on axis x]*65536 + |
1944 | * ebx = [start coordinate on axis x]*65536 + |
1945 | [end coordinate on axis x] |
1945 | [end coordinate on axis x] |
1946 | * ecx = [start coordinate on axis y]*65536 + |
1946 | * ecx = [start coordinate on axis y]*65536 + |
1947 | [end coordinate on axis y] |
1947 | [end coordinate on axis y] |
1948 | * edx = 0x00RRGGBB - color |
1948 | * edx = 0x00RRGGBB - color |
1949 | edx = 0x01xxxxxx - draw inversed line |
1949 | edx = 0x01xxxxxx - draw inversed line |
1950 | (low 24 bits are ignored) |
1950 | (low 24 bits are ignored) |
1951 | Returned value: |
1951 | Returned value: |
1952 | * function does not return value |
1952 | * function does not return value |
1953 | Remarks: |
1953 | Remarks: |
1954 | * Coordinates are relative to the window. |
1954 | * Coordinates are relative to the window. |
1955 | * End point is also drawn. |
1955 | * End point is also drawn. |
1956 | 1956 | ||
1957 | ---------------------- Constants for registers: ---------------------- |
1957 | ---------------------- Constants for registers: ---------------------- |
1958 | eax - SF_DRAW_LINE (38) |
1958 | eax - SF_DRAW_LINE (38) |
1959 | ====================================================================== |
1959 | ====================================================================== |
1960 | == Function 39, subfunction 1 - get a size of the background image. == |
1960 | == Function 39, subfunction 1 - get a size of the background image. == |
1961 | ====================================================================== |
1961 | ====================================================================== |
1962 | Parameters: |
1962 | Parameters: |
1963 | * eax = 39 - function number |
1963 | * eax = 39 - function number |
1964 | * ebx = 1 - subfunction number |
1964 | * ebx = 1 - subfunction number |
1965 | Returned value: |
1965 | Returned value: |
1966 | * eax = [width]*65536 + [height] |
1966 | * eax = [width]*65536 + [height] |
1967 | Remarks: |
1967 | Remarks: |
1968 | * There is a pair function to set sizes of background image - |
1968 | * There is a pair function to set sizes of background image - |
1969 | subfunction 1 of function 15. After which it is necessary, |
1969 | subfunction 1 of function 15. After which it is necessary, |
1970 | of course, anew to define image. |
1970 | of course, anew to define image. |
1971 | 1971 | ||
1972 | ---------------------- Constants for registers: ---------------------- |
1972 | ---------------------- Constants for registers: ---------------------- |
1973 | eax - SF_BACKGROUND_GET (39) |
1973 | eax - SF_BACKGROUND_GET (39) |
1974 | ====================================================================== |
1974 | ====================================================================== |
1975 | == Function 39, subfunction 2 - get pixel from the background image. = |
1975 | == Function 39, subfunction 2 - get pixel from the background image. = |
1976 | ====================================================================== |
1976 | ====================================================================== |
1977 | Parameters: |
1977 | Parameters: |
1978 | * eax = 39 - function number |
1978 | * eax = 39 - function number |
1979 | * ebx = 2 - subfunction number |
1979 | * ebx = 2 - subfunction number |
1980 | * ecx = offset |
1980 | * ecx = offset |
1981 | Returned value: |
1981 | Returned value: |
1982 | * eax = 0x00RRGGBB - pixel color, if offset is valid |
1982 | * eax = 0x00RRGGBB - pixel color, if offset is valid |
1983 | (less than 0x160000-16) |
1983 | (less than 0x160000-16) |
1984 | * eax = 2 otherwise |
1984 | * eax = 2 otherwise |
1985 | Remarks: |
1985 | Remarks: |
1986 | * Do not rely on returned value for invalid offsets, it may be |
1986 | * Do not rely on returned value for invalid offsets, it may be |
1987 | changed in future kernel versions. |
1987 | changed in future kernel versions. |
1988 | * Offset for pixel with coordinates (x,y) |
1988 | * Offset for pixel with coordinates (x,y) |
1989 | is calculated as (x+y*xsize)*3. |
1989 | is calculated as (x+y*xsize)*3. |
1990 | * There is a pair function to set pixel on the background image - |
1990 | * There is a pair function to set pixel on the background image - |
1991 | subfunction 2 of function 15. |
1991 | subfunction 2 of function 15. |
1992 | 1992 | ||
1993 | ---------------------- Constants for registers: ---------------------- |
1993 | ---------------------- Constants for registers: ---------------------- |
1994 | eax - SF_BACKGROUND_GET (39) |
1994 | eax - SF_BACKGROUND_GET (39) |
1995 | ====================================================================== |
1995 | ====================================================================== |
1996 | == Function 39, subfunction 4 - get drawing mode for the background. = |
1996 | == Function 39, subfunction 4 - get drawing mode for the background. = |
1997 | ====================================================================== |
1997 | ====================================================================== |
1998 | Parameters: |
1998 | Parameters: |
1999 | * eax = 39 - function number |
1999 | * eax = 39 - function number |
2000 | * ebx = 4 - subfunction number |
2000 | * ebx = 4 - subfunction number |
2001 | Returned value: |
2001 | Returned value: |
2002 | * eax = 1 - tile |
2002 | * eax = 1 - tile |
2003 | * eax = 2 - stretch |
2003 | * eax = 2 - stretch |
2004 | Remarks: |
2004 | Remarks: |
2005 | * There is a pair function to set drawing mode - |
2005 | * There is a pair function to set drawing mode - |
2006 | subfunction 4 of function 15. |
2006 | subfunction 4 of function 15. |
2007 | 2007 | ||
2008 | ---------------------- Constants for registers: ---------------------- |
2008 | ---------------------- Constants for registers: ---------------------- |
2009 | eax - SF_BACKGROUND_GET (39) |
2009 | eax - SF_BACKGROUND_GET (39) |
2010 | ====================================================================== |
2010 | ====================================================================== |
2011 | =========== Function 40 - set the mask for expected events. ========== |
2011 | =========== Function 40 - set the mask for expected events. ========== |
2012 | ====================================================================== |
2012 | ====================================================================== |
2013 | The mask for expected events affects function working with events |
2013 | The mask for expected events affects function working with events |
2014 | 10, 11, 23 - they notify only about events allowed by this mask. |
2014 | 10, 11, 23 - they notify only about events allowed by this mask. |
2015 | Parameters: |
2015 | Parameters: |
2016 | * eax = 40 - function number |
2016 | * eax = 40 - function number |
2017 | * ebx = mask: bit i corresponds to event i+1 (see list of events) |
2017 | * ebx = mask: bit i corresponds to event i+1 (see list of events) |
2018 | (set bit permits notice on event) |
2018 | (set bit permits notice on event) |
2019 | bit 31: mouse active/inactive filter |
2019 | bit 31: mouse active/inactive filter |
2020 | bit 31 = 0 - inactive window receive mouse events |
2020 | bit 31 = 0 - inactive window receive mouse events |
2021 | bit 31 = 1 - inactive window does not receive mouse events |
2021 | bit 31 = 1 - inactive window does not receive mouse events |
2022 | bit 30: cursor position filter |
2022 | bit 30: cursor position filter |
2023 | bit 30 = 0 = the window receive mouse events if cursor |
2023 | bit 30 = 0 = the window receive mouse events if cursor |
2024 | outside window |
2024 | outside window |
2025 | bit 30 = 1 - the window does not receive mouse events if cursor |
2025 | bit 30 = 1 - the window does not receive mouse events if cursor |
2026 | outside window |
2026 | outside window |
2027 | Returned value: |
2027 | Returned value: |
2028 | * eax = previous value of mask |
2028 | * eax = previous value of mask |
2029 | Remarks: |
2029 | Remarks: |
2030 | * Default mask (7=111b) enables nofices about redraw, |
2030 | * Default mask (7=111b) enables nofices about redraw, |
2031 | keys and buttons. This is enough for many applications. |
2031 | keys and buttons. This is enough for many applications. |
2032 | * Events prohibited in the mask are saved anyway, when come; |
2032 | * Events prohibited in the mask are saved anyway, when come; |
2033 | they are simply not informed with event functions. |
2033 | they are simply not informed with event functions. |
2034 | * Event functions take into account the mask on moment of |
2034 | * Event functions take into account the mask on moment of |
2035 | function call, not on moment of event arrival. |
2035 | function call, not on moment of event arrival. |
2036 | 2036 | ||
2037 | ---------------------- Constants for registers: ---------------------- |
2037 | ---------------------- Constants for registers: ---------------------- |
2038 | eax - SF_SET_EVENTS_MASK (40) |
2038 | eax - SF_SET_EVENTS_MASK (40) |
2039 | ====================================================================== |
2039 | ====================================================================== |
2040 | ================ Function 43 - input/output to a port. =============== |
2040 | ================ Function 43 - input/output to a port. =============== |
2041 | ====================================================================== |
2041 | ====================================================================== |
2042 | 2042 | ||
2043 | ------------------------ Output data to port ------------------------- |
2043 | ------------------------ Output data to port ------------------------- |
2044 | Parameters: |
2044 | Parameters: |
2045 | * eax = 43 - function number |
2045 | * eax = 43 - function number |
2046 | * bl = byte for output |
2046 | * bl = byte for output |
2047 | * ecx = port number 0xnnnn (from 0 to 0xFFFF) |
2047 | * ecx = port number 0xnnnn (from 0 to 0xFFFF) |
2048 | Returned value: |
2048 | Returned value: |
2049 | * eax = 0 - success |
2049 | * eax = 0 - success |
2050 | * eax = 1 - the thread has not reserved the selected port |
2050 | * eax = 1 - the thread has not reserved the selected port |
2051 | 2051 | ||
2052 | ------------------------ Input data from port ------------------------ |
2052 | ------------------------ Input data from port ------------------------ |
2053 | Parameters: |
2053 | Parameters: |
2054 | * eax = 43 - function number |
2054 | * eax = 43 - function number |
2055 | * ebx is ignored |
2055 | * ebx is ignored |
2056 | * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF) |
2056 | * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF) |
2057 | Returned value: |
2057 | Returned value: |
2058 | * eax = 0 - success, thus ebx = entered byte |
2058 | * eax = 0 - success, thus ebx = entered byte |
2059 | * eax = 1 - the thread has not reserved the selected port |
2059 | * eax = 1 - the thread has not reserved the selected port |
2060 | Remarks: |
2060 | Remarks: |
2061 | * Previously the thread must reserve the selected port |
2061 | * Previously the thread must reserve the selected port |
2062 | for itself by function 46. |
2062 | for itself by function 46. |
2063 | * Instead of call to this function it is better to use |
2063 | * Instead of call to this function it is better to use |
2064 | processor instructions in/out - this is much |
2064 | processor instructions in/out - this is much |
2065 | faster and a bit shorter and easier. |
2065 | faster and a bit shorter and easier. |
2066 | 2066 | ||
2067 | ---------------------- Constants for registers: ---------------------- |
2067 | ---------------------- Constants for registers: ---------------------- |
2068 | eax - SF_PORT_IN_OUT (43) |
2068 | eax - SF_PORT_IN_OUT (43) |
2069 | ====================================================================== |
2069 | ====================================================================== |
2070 | ====== Function 46 - reserve/free a group of input/output ports. ===== |
2070 | ====== Function 46 - reserve/free a group of input/output ports. ===== |
2071 | ====================================================================== |
2071 | ====================================================================== |
2072 | To work with reserved ports an application can access directly by |
2072 | To work with reserved ports an application can access directly by |
2073 | commands in/out (recommended way) and can use function 43 |
2073 | commands in/out (recommended way) and can use function 43 |
2074 | (not recommended way). |
2074 | (not recommended way). |
2075 | Parameters: |
2075 | Parameters: |
2076 | * eax = 46 - function number |
2076 | * eax = 46 - function number |
2077 | * ebx = 0 - reserve, 1 - free |
2077 | * ebx = 0 - reserve, 1 - free |
2078 | * ecx = start port number |
2078 | * ecx = start port number |
2079 | * edx = end port number (inclusive) |
2079 | * edx = end port number (inclusive) |
2080 | Returned value: |
2080 | Returned value: |
2081 | * eax = 0 - success |
2081 | * eax = 0 - success |
2082 | * eax = 1 - error |
2082 | * eax = 1 - error |
2083 | Remarks: |
2083 | Remarks: |
2084 | * For ports reservation: an error occurs if and only if |
2084 | * For ports reservation: an error occurs if and only if |
2085 | one from the following condition satisfies: |
2085 | one from the following condition satisfies: |
2086 | * start port is more than end port; |
2086 | * start port is more than end port; |
2087 | * the selected range contains incorrect port number |
2087 | * the selected range contains incorrect port number |
2088 | (correct are from 0 to 0xFFFF); |
2088 | (correct are from 0 to 0xFFFF); |
2089 | * limit for the total number of reserved areas is exceeded |
2089 | * limit for the total number of reserved areas is exceeded |
2090 | (maximum 255 are allowed); |
2090 | (maximum 255 are allowed); |
2091 | * the selected range intersects with any of earlier reserved |
2091 | * the selected range intersects with any of earlier reserved |
2092 | * For ports free: an error is an attempt to free range, |
2092 | * For ports free: an error is an attempt to free range, |
2093 | that was not earlier reserved by this function |
2093 | that was not earlier reserved by this function |
2094 | (with same ecx,edx). |
2094 | (with same ecx,edx). |
2095 | * If an error occurs (for both cases) function performs no action. |
2095 | * If an error occurs (for both cases) function performs no action. |
2096 | * At booting the system reserves for itself ports |
2096 | * At booting the system reserves for itself ports |
2097 | 0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively). |
2097 | 0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively). |
2098 | * When a thread terminates, all reserved by it ports |
2098 | * When a thread terminates, all reserved by it ports |
2099 | are freed automatically. |
2099 | are freed automatically. |
2100 | 2100 | ||
2101 | ---------------------- Constants for registers: ---------------------- |
2101 | ---------------------- Constants for registers: ---------------------- |
2102 | eax - SF_SET_PORTS (46) |
2102 | eax - SF_SET_PORTS (46) |
2103 | ====================================================================== |
2103 | ====================================================================== |
2104 | ============= Function 47 - draw a number in the window. ============= |
2104 | ============= Function 47 - draw a number in the window. ============= |
2105 | ====================================================================== |
2105 | ====================================================================== |
2106 | Parameters: |
2106 | Parameters: |
2107 | * eax = 47 - function number |
2107 | * eax = 47 - function number |
2108 | * ebx = parameters of conversion number to text: |
2108 | * ebx = parameters of conversion number to text: |
2109 | * bl = 0 - ecx contains number |
2109 | * bl = 0 - ecx contains number |
2110 | * bl = 1 - ecx contains pointer to dword/qword-number |
2110 | * bl = 1 - ecx contains pointer to dword/qword-number |
2111 | * bh = 0 - display in decimal number system |
2111 | * bh = 0 - display in decimal number system |
2112 | * bh = 1 - display in hexadecimal system |
2112 | * bh = 1 - display in hexadecimal system |
2113 | * bh = 2 - display in binary system |
2113 | * bh = 2 - display in binary system |
2114 | * bits 16-21 = how many digits to display |
2114 | * bits 16-21 = how many digits to display |
2115 | * bits 22-29 reserved and must be set to 0 |
2115 | * bits 22-29 reserved and must be set to 0 |
2116 | * bit 30 set = display qword (64-bit) number (must be bl=1) |
2116 | * bit 30 set = display qword (64-bit) number (must be bl=1) |
2117 | * bit 31 set = do not display leading zeroes of the number |
2117 | * bit 31 set = do not display leading zeroes of the number |
2118 | * ecx = number (if bl=0) or pointer (if bl=1) |
2118 | * ecx = number (if bl=0) or pointer (if bl=1) |
2119 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
2119 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
2120 | * esi = 0xXXRRGGBB, where |
2120 | * esi = 0xXXRRGGBB, where |
2121 | * RR, GG, BB specify text color |
2121 | * RR, GG, BB specify text color |
2122 | * XX = 0B0FCSSS (bits): |
2122 | * XX = 0B0FCSSS (bits): |
2123 | * B=1 - fill background (color = edi) |
2123 | * B=1 - fill background (color = edi) |
2124 | * F specifies the font: |
2124 | * F specifies the font: |
2125 | 0 = 6x9 |
2125 | 0 = 6x9 |
2126 | 1 = 8x16 |
2126 | 1 = 8x16 |
2127 | * C=0 - draw to the window, |
2127 | * C=0 - draw to the window, |
2128 | C=1 - draw to the user buffer (edi) |
2128 | C=1 - draw to the user buffer (edi) |
2129 | * SSS = (size multiplier)-1, so 0 = x1, 7 = x8 |
2129 | * SSS = (size multiplier)-1, so 0 = x1, 7 = x8 |
2130 | Returned value: |
2130 | Returned value: |
2131 | * function does not return value |
2131 | * function does not return value |
2132 | Remarks: |
2132 | Remarks: |
2133 | * The given length must not exceed 60. |
2133 | * The given length must not exceed 60. |
2134 | * The exactly given amount of digits is output. If number is small |
2134 | * The exactly given amount of digits is output. If number is small |
2135 | and can be written by smaller amount of digits, it is supplemented |
2135 | and can be written by smaller amount of digits, it is supplemented |
2136 | by leading zeroes; if the number is big and can not be written by |
2136 | by leading zeroes; if the number is big and can not be written by |
2137 | given amount of digits, extra digits are not drawn. |
2137 | given amount of digits, extra digits are not drawn. |
2138 | 2138 | ||
2139 | ---------------------- Constants for registers: ---------------------- |
2139 | ---------------------- Constants for registers: ---------------------- |
2140 | eax - SF_DRAW_NUMBER (47) |
2140 | eax - SF_DRAW_NUMBER (47) |
2141 | ====================================================================== |
2141 | ====================================================================== |
2142 | ========= Function 48, subfunction 0 - apply screen settings. ======== |
2142 | ========= Function 48, subfunction 0 - apply screen settings. ======== |
2143 | ====================================================================== |
2143 | ====================================================================== |
2144 | Parameters: |
2144 | Parameters: |
2145 | * eax = 48 - function number |
2145 | * eax = 48 - function number |
2146 | * ebx = 0 - subfunction number |
2146 | * ebx = 0 - subfunction number |
2147 | * ecx = 0 - reserved |
2147 | * ecx = 0 - reserved |
2148 | Returned value: |
2148 | Returned value: |
2149 | * function does not return value |
2149 | * function does not return value |
2150 | Remarks: |
2150 | Remarks: |
2151 | * Function redraws the screen after parameters change by |
2151 | * Function redraws the screen after parameters change by |
2152 | subfunctions 1 and 2. |
2152 | subfunctions 1 and 2. |
2153 | * Function call without prior call to one of indicated subfunctions |
2153 | * Function call without prior call to one of indicated subfunctions |
2154 | is ignored. |
2154 | is ignored. |
2155 | * Function call with nonzero ecx is ignored. |
2155 | * Function call with nonzero ecx is ignored. |
2156 | 2156 | ||
2157 | ---------------------- Constants for registers: ---------------------- |
2157 | ---------------------- Constants for registers: ---------------------- |
2158 | eax - SF_STYLE_SETTINGS (48) |
2158 | eax - SF_STYLE_SETTINGS (48) |
2159 | ebx - SSF_APPLY (0) |
2159 | ebx - SSF_APPLY (0) |
2160 | ====================================================================== |
2160 | ====================================================================== |
2161 | =========== Function 48, subfunction 1 - set button style. =========== |
2161 | =========== Function 48, subfunction 1 - set button style. =========== |
2162 | ====================================================================== |
2162 | ====================================================================== |
2163 | Parameters: |
2163 | Parameters: |
2164 | * eax = 48 - function number |
2164 | * eax = 48 - function number |
2165 | * ebx = 1 - subfunction number |
2165 | * ebx = 1 - subfunction number |
2166 | * ecx = button style: |
2166 | * ecx = button style: |
2167 | * 0 = flat |
2167 | * 0 = flat |
2168 | * 1 = 3d |
2168 | * 1 = 3d |
2169 | Returned value: |
2169 | Returned value: |
2170 | * function does not return value |
2170 | * function does not return value |
2171 | Remarks: |
2171 | Remarks: |
2172 | * After call to this function one should redraw the screen by |
2172 | * After call to this function one should redraw the screen by |
2173 | subfunction 0. |
2173 | subfunction 0. |
2174 | * Button style influences only to their draw of function 8. |
2174 | * Button style influences only to their draw of function 8. |
2175 | 2175 | ||
2176 | ---------------------- Constants for registers: ---------------------- |
2176 | ---------------------- Constants for registers: ---------------------- |
2177 | eax - SF_STYLE_SETTINGS (48) |
2177 | eax - SF_STYLE_SETTINGS (48) |
2178 | ebx - SSF_SET_BUTTON_STYLE (1) |
2178 | ebx - SSF_SET_BUTTON_STYLE (1) |
2179 | ====================================================================== |
2179 | ====================================================================== |
2180 | ====== Function 48, subfunction 2 - set standard window colors. ====== |
2180 | ====== Function 48, subfunction 2 - set standard window colors. ====== |
2181 | ====================================================================== |
2181 | ====================================================================== |
2182 | Parameters: |
2182 | Parameters: |
2183 | * eax = 48 - function number |
2183 | * eax = 48 - function number |
2184 | * ebx = 2 - subfunction number |
2184 | * ebx = 2 - subfunction number |
2185 | * ecx = pointer to the color table |
2185 | * ecx = pointer to the color table |
2186 | * edx = size of the color table |
2186 | * edx = size of the color table |
2187 | (must be 40 bytes for future compatibility) |
2187 | (must be 40 bytes for future compatibility) |
2188 | Format of the color table is shown in description of subfunction 3. |
2188 | Format of the color table is shown in description of subfunction 3. |
2189 | Returned value: |
2189 | Returned value: |
2190 | * function does not return value |
2190 | * function does not return value |
2191 | Remarks: |
2191 | Remarks: |
2192 | * After call to this function one should redraw the screen by |
2192 | * After call to this function one should redraw the screen by |
2193 | subfunction 0. |
2193 | subfunction 0. |
2194 | * Table of standard colors influences only to applications, |
2194 | * Table of standard colors influences only to applications, |
2195 | which receive this table obviously (by subfunction 3) |
2195 | which receive this table obviously (by subfunction 3) |
2196 | and use it (specifying colors from it to drawing functions). |
2196 | and use it (specifying colors from it to drawing functions). |
2197 | * Table of standard colors is included in skin and is installed |
2197 | * Table of standard colors is included in skin and is installed |
2198 | anew with skin installation (by subfunction 8). |
2198 | anew with skin installation (by subfunction 8). |
2199 | * Color table can be viewed/changed interactively with |
2199 | * Color table can be viewed/changed interactively with |
2200 | the application 'desktop'. |
2200 | the application 'desktop'. |
2201 | 2201 | ||
2202 | ---------------------- Constants for registers: ---------------------- |
2202 | ---------------------- Constants for registers: ---------------------- |
2203 | eax - SF_STYLE_SETTINGS (48) |
2203 | eax - SF_STYLE_SETTINGS (48) |
2204 | ebx - SSF_SET_COLORS (2) |
2204 | ebx - SSF_SET_COLORS (2) |
2205 | ====================================================================== |
2205 | ====================================================================== |
2206 | ====== Function 48, subfunction 3 - get standard window colors. ====== |
2206 | ====== Function 48, subfunction 3 - get standard window colors. ====== |
2207 | ====================================================================== |
2207 | ====================================================================== |
2208 | Parameters: |
2208 | Parameters: |
2209 | * eax = 48 - function number |
2209 | * eax = 48 - function number |
2210 | * ebx = 3 - subfunction number |
2210 | * ebx = 3 - subfunction number |
2211 | * ecx = pointer to the buffer with size edx bytes, |
2211 | * ecx = pointer to the buffer with size edx bytes, |
2212 | where table will be written |
2212 | where table will be written |
2213 | * edx = size of color table |
2213 | * edx = size of color table |
2214 | (must be 40 bytes for future compatibility) |
2214 | (must be 40 bytes for future compatibility) |
2215 | Returned value: |
2215 | Returned value: |
2216 | * function does not return value |
2216 | * function does not return value |
2217 | Format of the color table: |
2217 | Format of the color table: |
2218 | each item is dword-value for color 0x00RRGGBB |
2218 | each item is dword-value for color 0x00RRGGBB |
2219 | * +0: dword: frames - color of frame |
2219 | * +0: dword: frames - color of frame |
2220 | * +4: dword: grab - color of header |
2220 | * +4: dword: grab - color of header |
2221 | * +8: dword: grab_button - color of button on header bar |
2221 | * +8: dword: grab_button - color of button on header bar |
2222 | * +12 = +0xC: dword: grab_button_text - color of text on button |
2222 | * +12 = +0xC: dword: grab_button_text - color of text on button |
2223 | on header bar |
2223 | on header bar |
2224 | * +16 = +0x10: dword: grab_text - color of text on header |
2224 | * +16 = +0x10: dword: grab_text - color of text on header |
2225 | * +20 = +0x14: dword: work - color of working area |
2225 | * +20 = +0x14: dword: work - color of working area |
2226 | * +24 = +0x18: dword: work_button - color of button in working area |
2226 | * +24 = +0x18: dword: work_button - color of button in working area |
2227 | * +28 = +0x1C: dword: work_button_text - color of text on button |
2227 | * +28 = +0x1C: dword: work_button_text - color of text on button |
2228 | in working area |
2228 | in working area |
2229 | * +32 = +0x20: dword: work_text - color of text in working area |
2229 | * +32 = +0x20: dword: work_text - color of text in working area |
2230 | * +36 = +0x24: dword: work_graph - color of graphics in working area |
2230 | * +36 = +0x24: dword: work_graph - color of graphics in working area |
2231 | Remarks: |
2231 | Remarks: |
2232 | * Structure of the color table is described in the standard |
2232 | * Structure of the color table is described in the standard |
2233 | include file 'macros.inc' as 'system_colors'; for example, |
2233 | include file 'macros.inc' as 'system_colors'; for example, |
2234 | it is possible to write: |
2234 | it is possible to write: |
2235 | sc system_colors ; variable declaration |
2235 | sc system_colors ; variable declaration |
2236 | ... ; somewhere one must call |
2236 | ... ; somewhere one must call |
2237 | ; this function with ecx=sc |
2237 | ; this function with ecx=sc |
2238 | mov ecx, [sc.work_button_text] ; read text color on |
2238 | mov ecx, [sc.work_button_text] ; read text color on |
2239 | ; buttin in working area |
2239 | ; buttin in working area |
2240 | * A program itself desides to use or not to use color table. |
2240 | * A program itself desides to use or not to use color table. |
2241 | For usage program must simply at calls to drawing functions select |
2241 | For usage program must simply at calls to drawing functions select |
2242 | color taken from the table. |
2242 | color taken from the table. |
2243 | * At change of the table of standard colors (by subfunction 2 with |
2243 | * At change of the table of standard colors (by subfunction 2 with |
2244 | the subsequent application of changes by subfunction 0 or |
2244 | the subsequent application of changes by subfunction 0 or |
2245 | at skin set by subfunction 8) the system sends to all windows |
2245 | at skin set by subfunction 8) the system sends to all windows |
2246 | redraw message (the event with code 1). |
2246 | redraw message (the event with code 1). |
2247 | * Color table can be viewed/changed interactively with |
2247 | * Color table can be viewed/changed interactively with |
2248 | the application 'desktop'. |
2248 | the application 'desktop'. |
2249 | 2249 | ||
2250 | ---------------------- Constants for registers: ---------------------- |
2250 | ---------------------- Constants for registers: ---------------------- |
2251 | eax - SF_STYLE_SETTINGS (48) |
2251 | eax - SF_STYLE_SETTINGS (48) |
2252 | ebx - SSF_GET_COLORS (3) |
2252 | ebx - SSF_GET_COLORS (3) |
2253 | ====================================================================== |
2253 | ====================================================================== |
2254 | ============ Function 48, subfunction 4 - get skin height. =========== |
2254 | ============ Function 48, subfunction 4 - get skin height. =========== |
2255 | ====================================================================== |
2255 | ====================================================================== |
2256 | Parameters: |
2256 | Parameters: |
2257 | * eax = 48 - function number |
2257 | * eax = 48 - function number |
2258 | * ebx = 4 - subfunction number |
2258 | * ebx = 4 - subfunction number |
2259 | Returned value: |
2259 | Returned value: |
2260 | * eax = skin height |
2260 | * eax = skin height |
2261 | Remarks: |
2261 | Remarks: |
2262 | * Skin height is defined as the height of a header |
2262 | * Skin height is defined as the height of a header |
2263 | of skinned windows. |
2263 | of skinned windows. |
2264 | * See also general structure of window in the description |
2264 | * See also general structure of window in the description |
2265 | of function 0. |
2265 | of function 0. |
2266 | 2266 | ||
2267 | ---------------------- Constants for registers: ---------------------- |
2267 | ---------------------- Constants for registers: ---------------------- |
2268 | eax - SF_STYLE_SETTINGS (48) |
2268 | eax - SF_STYLE_SETTINGS (48) |
2269 | ebx - SSF_GET_SKIN_HEIGHT (4) |
2269 | ebx - SSF_GET_SKIN_HEIGHT (4) |
2270 | ====================================================================== |
2270 | ====================================================================== |
2271 | ======== Function 48, subfunction 5 - get screen working area. ======= |
2271 | ======== Function 48, subfunction 5 - get screen working area. ======= |
2272 | ====================================================================== |
2272 | ====================================================================== |
2273 | Parameters: |
2273 | Parameters: |
2274 | * eax = 48 - function number |
2274 | * eax = 48 - function number |
2275 | * ebx = 5 - subfunction number |
2275 | * ebx = 5 - subfunction number |
2276 | Returned value: |
2276 | Returned value: |
2277 | * eax = [left]*65536 + [right] |
2277 | * eax = [left]*65536 + [right] |
2278 | * ebx = [top]*65536 + [bottom] |
2278 | * ebx = [top]*65536 + [bottom] |
2279 | Remarks: |
2279 | Remarks: |
2280 | * The screen working area defines position and coordinates of |
2280 | * The screen working area defines position and coordinates of |
2281 | a maximized window. |
2281 | a maximized window. |
2282 | * The screen working area in view of normal work is all screen |
2282 | * The screen working area in view of normal work is all screen |
2283 | without taskbar ('@taskbar' application). |
2283 | without taskbar ('@taskbar' application). |
2284 | * (left,top) are coordinates of the left upper corner, |
2284 | * (left,top) are coordinates of the left upper corner, |
2285 | (right,bottom) are coordinates of the right lower one. |
2285 | (right,bottom) are coordinates of the right lower one. |
2286 | Thus the size of working area on x axis can be calculated by |
2286 | Thus the size of working area on x axis can be calculated by |
2287 | formula right-left+1, on y axis - by formula bottom-right+1. |
2287 | formula right-left+1, on y axis - by formula bottom-right+1. |
2288 | * See also function 14, |
2288 | * See also function 14, |
2289 | to get sizes of all screen. |
2289 | to get sizes of all screen. |
2290 | * There is a pair function to set working area - subfunction 6. |
2290 | * There is a pair function to set working area - subfunction 6. |
2291 | 2291 | ||
2292 | ---------------------- Constants for registers: ---------------------- |
2292 | ---------------------- Constants for registers: ---------------------- |
2293 | eax - SF_STYLE_SETTINGS (48) |
2293 | eax - SF_STYLE_SETTINGS (48) |
2294 | ebx - SSF_GET_SCREEN_AREA (5) |
2294 | ebx - SSF_GET_SCREEN_AREA (5) |
2295 | ====================================================================== |
2295 | ====================================================================== |
2296 | ======== Function 48, subfunction 6 - set screen working area. ======= |
2296 | ======== Function 48, subfunction 6 - set screen working area. ======= |
2297 | ====================================================================== |
2297 | ====================================================================== |
2298 | Parameters: |
2298 | Parameters: |
2299 | * eax = 48 - function number |
2299 | * eax = 48 - function number |
2300 | * ebx = 6 - subfunction number |
2300 | * ebx = 6 - subfunction number |
2301 | * ecx = [left]*65536 + [right] |
2301 | * ecx = [left]*65536 + [right] |
2302 | * edx = [top]*65536 + [bottom] |
2302 | * edx = [top]*65536 + [bottom] |
2303 | Returned value: |
2303 | Returned value: |
2304 | * function does not return value |
2304 | * function does not return value |
2305 | Remarks: |
2305 | Remarks: |
2306 | * The screen working area defines position and coordinates of |
2306 | * The screen working area defines position and coordinates of |
2307 | a maximized window. |
2307 | a maximized window. |
2308 | * This function is used only by the application '@taskbar', |
2308 | * This function is used only by the application '@taskbar', |
2309 | which set working area to all screen without taskbar. |
2309 | which set working area to all screen without taskbar. |
2310 | * (left,top) are coordinates of the left upper corner, |
2310 | * (left,top) are coordinates of the left upper corner, |
2311 | (right,bottom) are coordinates of the right lower one. |
2311 | (right,bottom) are coordinates of the right lower one. |
2312 | Thus the size of working area on x axis can be calculated by |
2312 | Thus the size of working area on x axis can be calculated by |
2313 | formula right-left+1, on y axis - by formula bottom-right+1. |
2313 | formula right-left+1, on y axis - by formula bottom-right+1. |
2314 | * If 'left'>='right', x-coordinate of working area is not changed. |
2314 | * If 'left'>='right', x-coordinate of working area is not changed. |
2315 | If 'left'<0, 'left' will not be set. If 'right' is greater than or |
2315 | If 'left'<0, 'left' will not be set. If 'right' is greater than or |
2316 | equal to screen width, 'right' will not be set. |
2316 | equal to screen width, 'right' will not be set. |
2317 | Similarly on y axis. |
2317 | Similarly on y axis. |
2318 | * See also function 14, |
2318 | * See also function 14, |
2319 | to get sizes of all screen. |
2319 | to get sizes of all screen. |
2320 | * There is a pair function to get working area - subfunction 5. |
2320 | * There is a pair function to get working area - subfunction 5. |
2321 | * This function redraws the screen automatically, |
2321 | * This function redraws the screen automatically, |
2322 | updating coordinates and sizes of maximized windows. |
2322 | updating coordinates and sizes of maximized windows. |
2323 | The system sends to all windows redraw message (the event 1). |
2323 | The system sends to all windows redraw message (the event 1). |
2324 | 2324 | ||
2325 | ---------------------- Constants for registers: ---------------------- |
2325 | ---------------------- Constants for registers: ---------------------- |
2326 | eax - SF_STYLE_SETTINGS (48) |
2326 | eax - SF_STYLE_SETTINGS (48) |
2327 | ebx - SSF_SET_SCREEN_AREA (6) |
2327 | ebx - SSF_SET_SCREEN_AREA (6) |
2328 | ====================================================================== |
2328 | ====================================================================== |
2329 | =========== Function 48, subfunction 7 - get skin margins. =========== |
2329 | =========== Function 48, subfunction 7 - get skin margins. =========== |
2330 | ====================================================================== |
2330 | ====================================================================== |
2331 | Returns the area of a header of a skinned window, intended for |
2331 | Returns the area of a header of a skinned window, intended for |
2332 | a text of a header. |
2332 | a text of a header. |
2333 | Parameters: |
2333 | Parameters: |
2334 | * eax = 48 - function number |
2334 | * eax = 48 - function number |
2335 | * ebx = 7 - subfunction number |
2335 | * ebx = 7 - subfunction number |
2336 | Returned value: |
2336 | Returned value: |
2337 | * eax = [left]*65536 + [right] |
2337 | * eax = [left]*65536 + [right] |
2338 | * ebx = [top]*65536 + [bottom] |
2338 | * ebx = [top]*65536 + [bottom] |
2339 | Remarks: |
2339 | Remarks: |
2340 | * An application decides itself to use or not to use this function. |
2340 | * An application decides itself to use or not to use this function. |
2341 | * It is recommended to take into account returned value |
2341 | * It is recommended to take into account returned value |
2342 | of this function for choice of a place for drawing header text |
2342 | of this function for choice of a place for drawing header text |
2343 | (by function 4) or a substitute of header text |
2343 | (by function 4) or a substitute of header text |
2344 | (at the discretion of an application). |
2344 | (at the discretion of an application). |
2345 | 2345 | ||
2346 | ---------------------- Constants for registers: ---------------------- |
2346 | ---------------------- Constants for registers: ---------------------- |
2347 | eax - SF_STYLE_SETTINGS (48) |
2347 | eax - SF_STYLE_SETTINGS (48) |
2348 | ebx - SSF_GET_SKIN_MARGINS (7) |
2348 | ebx - SSF_GET_SKIN_MARGINS (7) |
2349 | ====================================================================== |
2349 | ====================================================================== |
2350 | ============= Function 48, subfunction 8 - set used skin. ============ |
2350 | ============= Function 48, subfunction 8 - set used skin. ============ |
2351 | ====================================================================== |
2351 | ====================================================================== |
2352 | Parameters: |
2352 | Parameters: |
2353 | * eax = 48 - function number |
2353 | * eax = 48 - function number |
2354 | * ebx = 8 - subfunction number |
2354 | * ebx = 8 - subfunction number |
2355 | * ecx = pointer to filename of the skin |
2355 | * ecx = pointer to filename of the skin |
2356 | Returned value: |
2356 | Returned value: |
2357 | * eax = 0 - success |
2357 | * eax = 0 - success |
2358 | * otherwise eax = file system error code; if file does not |
2358 | * otherwise eax = file system error code; if file does not |
2359 | contain valid skin, function returns error 3 |
2359 | contain valid skin, function returns error 3 |
2360 | (unknown file system). |
2360 | (unknown file system). |
2361 | Remarks: |
2361 | Remarks: |
2362 | * After successful skin loading the system sends to all windows |
2362 | * After successful skin loading the system sends to all windows |
2363 | redraw message (the event 1). |
2363 | redraw message (the event 1). |
2364 | * At booting the system reads skin from file 'default.skn' |
2364 | * At booting the system reads skin from file 'default.skn' |
2365 | on ramdisk. |
2365 | on ramdisk. |
2366 | * User can change the skin statically by creating hisself |
2366 | * User can change the skin statically by creating hisself |
2367 | 'default.skn' or dynamically with the application 'desktop'. |
2367 | 'default.skn' or dynamically with the application 'desktop'. |
2368 | 2368 | ||
2369 | ---------------------- Constants for registers: ---------------------- |
2369 | ---------------------- Constants for registers: ---------------------- |
2370 | eax - SF_STYLE_SETTINGS (48) |
2370 | eax - SF_STYLE_SETTINGS (48) |
2371 | ebx - SSF_SET_SKIN (8) |
2371 | ebx - SSF_SET_SKIN (8) |
2372 | ====================================================================== |
2372 | ====================================================================== |
2373 | ====== Function 48, subfunction 9 - get font smoothing setting. ====== |
2373 | ====== Function 48, subfunction 9 - get font smoothing setting. ====== |
2374 | ====================================================================== |
2374 | ====================================================================== |
2375 | Parameters: |
2375 | Parameters: |
2376 | * eax = 48 - function number |
2376 | * eax = 48 - function number |
2377 | * ebx = 9 - subfunction number |
2377 | * ebx = 9 - subfunction number |
2378 | Returned value: |
2378 | Returned value: |
2379 | * eax = 2 - subpixel, 1 - anti-aliasing, 0 - off |
2379 | * eax = 2 - subpixel, 1 - anti-aliasing, 0 - off |
2380 | 2380 | ||
2381 | ---------------------- Constants for registers: ---------------------- |
2381 | ---------------------- Constants for registers: ---------------------- |
2382 | eax - SF_STYLE_SETTINGS (48) |
2382 | eax - SF_STYLE_SETTINGS (48) |
2383 | ebx - SSF_GET_FONT_SMOOTH (9) |
2383 | ebx - SSF_GET_FONT_SMOOTH (9) |
2384 | ====================================================================== |
2384 | ====================================================================== |
2385 | ========== Function 48, subfunction 10 - set font smoothing. ========= |
2385 | ========== Function 48, subfunction 10 - set font smoothing. ========= |
2386 | ====================================================================== |
2386 | ====================================================================== |
2387 | Parameters: |
2387 | Parameters: |
2388 | * eax = 48 - function number |
2388 | * eax = 48 - function number |
2389 | * ebx = 10 - subfunction number |
2389 | * ebx = 10 - subfunction number |
2390 | * cl = 2 - subpixel, 1 - anti-aliasing, 0 - off |
2390 | * cl = 2 - subpixel, 1 - anti-aliasing, 0 - off |
2391 | 2391 | ||
2392 | ---------------------- Constants for registers: ---------------------- |
2392 | ---------------------- Constants for registers: ---------------------- |
2393 | eax - SF_STYLE_SETTINGS (48) |
2393 | eax - SF_STYLE_SETTINGS (48) |
2394 | ebx - SSF_SET_FONT_SMOOTH (10) |
2394 | ebx - SSF_SET_FONT_SMOOTH (10) |
2395 | ====================================================================== |
2395 | ====================================================================== |
2396 | ============ Function 48, subfunction 11 - get font size. ============ |
2396 | ============ Function 48, subfunction 11 - get font size. ============ |
2397 | ====================================================================== |
2397 | ====================================================================== |
2398 | Parameters: |
2398 | Parameters: |
2399 | * eax = 48 - function number |
2399 | * eax = 48 - function number |
2400 | * ebx = 9 - subfunction number |
2400 | * ebx = 9 - subfunction number |
2401 | Returned value: |
2401 | Returned value: |
2402 | * eax = current font height in pixels |
2402 | * eax = current font height in pixels |
2403 | 2403 | ||
2404 | ---------------------- Constants for registers: ---------------------- |
2404 | ---------------------- Constants for registers: ---------------------- |
2405 | eax - SF_STYLE_SETTINGS (48) |
2405 | eax - SF_STYLE_SETTINGS (48) |
2406 | ebx - SSF_GET_FONT_SIZE (11) |
2406 | ebx - SSF_GET_FONT_SIZE (11) |
2407 | ====================================================================== |
2407 | ====================================================================== |
2408 | ============ Function 48, subfunction 12 - set font size. ============ |
2408 | ============ Function 48, subfunction 12 - set font size. ============ |
2409 | ====================================================================== |
2409 | ====================================================================== |
2410 | Parameters: |
2410 | Parameters: |
2411 | * eax = 48 - function number |
2411 | * eax = 48 - function number |
2412 | * ebx = 10 - subfunction number |
2412 | * ebx = 10 - subfunction number |
2413 | * cl = new font height in pixels |
2413 | * cl = new font height in pixels |
2414 | 2414 | ||
2415 | ---------------------- Constants for registers: ---------------------- |
2415 | ---------------------- Constants for registers: ---------------------- |
2416 | eax - SF_STYLE_SETTINGS (48) |
2416 | eax - SF_STYLE_SETTINGS (48) |
2417 | ebx - SSF_SET_FONT_SIZE (12) |
2417 | ebx - SSF_SET_FONT_SIZE (12) |
2418 | ====================================================================== |
2418 | ====================================================================== |
2419 | == Function 48, subfunction 13 - set skin, specifying the encoding. == |
2419 | == Function 48, subfunction 13 - set skin, specifying the encoding. == |
2420 | ====================================================================== |
2420 | ====================================================================== |
2421 | Parameters: |
2421 | Parameters: |
2422 | * eax = 48 - function number |
2422 | * eax = 48 - function number |
2423 | * ebx = 13 - subfunction number |
2423 | * ebx = 13 - subfunction number |
2424 | * ecx = pointer to the skin file path string |
2424 | * ecx = pointer to the skin file path string |
2425 | * edx = string encoding, details can be found in function 80 description. |
2425 | * edx = string encoding, details can be found in function 80 description. |
2426 | Returned value: |
2426 | Returned value: |
2427 | * eax = 0 - success |
2427 | * eax = 0 - success |
2428 | * otherwise eax = file system error code; if file does not |
2428 | * otherwise eax = file system error code; if file does not |
2429 | contain valid skin, function returns error 3 |
2429 | contain valid skin, function returns error 3 |
2430 | (unknown file system). |
2430 | (unknown file system). |
2431 | Remarks: |
2431 | Remarks: |
2432 | * After successful skin loading the system sends to all windows |
2432 | * After successful skin loading the system sends to all windows |
2433 | redraw message (the event 1). |
2433 | redraw message (the event 1). |
2434 | * At booting the system reads skin from file 'default.skn' |
2434 | * At booting the system reads skin from file 'default.skn' |
2435 | on ramdisk. |
2435 | on ramdisk. |
2436 | * User can change the skin statically by creating hisself |
2436 | * User can change the skin statically by creating hisself |
2437 | 'default.skn' or dynamically with the application 'desktop'. |
2437 | 'default.skn' or dynamically with the application 'desktop'. |
2438 | 2438 | ||
2439 | ====================================================================== |
2439 | ====================================================================== |
2440 | =========== Function 49 - Advanced Power Management (APM). =========== |
2440 | =========== Function 49 - Advanced Power Management (APM). =========== |
2441 | ====================================================================== |
2441 | ====================================================================== |
2442 | Parameters: |
2442 | Parameters: |
2443 | * eax = 49 - function number |
2443 | * eax = 49 - function number |
2444 | * dx = number of the APM function |
2444 | * dx = number of the APM function |
2445 | (analogue of ax in APM specification) |
2445 | (analogue of ax in APM specification) |
2446 | * bx, cx = parameters of the APM function |
2446 | * bx, cx = parameters of the APM function |
2447 | Returned value: |
2447 | Returned value: |
2448 | * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF |
2448 | * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF |
2449 | are set according to the APM specification |
2449 | are set according to the APM specification |
2450 | * high halves of 32-bit registers eax, ebx, ecx, |
2450 | * high halves of 32-bit registers eax, ebx, ecx, |
2451 | edx, esi, edi are destroyed |
2451 | edx, esi, edi are destroyed |
2452 | Remarks: |
2452 | Remarks: |
2453 | * APM 1.2 specification is described in the document |
2453 | * APM 1.2 specification is described in the document |
2454 | "Advanced Power Management (APM) BIOS Specification" |
2454 | "Advanced Power Management (APM) BIOS Specification" |
2455 | (Revision 1.2), available at |
2455 | (Revision 1.2), available at |
2456 | http://www.microsoft.com/whdc/archive/amp_12.mspx; |
2456 | http://www.microsoft.com/whdc/archive/amp_12.mspx; |
2457 | besides it is included in famous Interrupt List by Ralf Brown |
2457 | besides it is included in famous Interrupt List by Ralf Brown |
2458 | (http://www.pobox.com/~ralf/files.html, |
2458 | (http://www.pobox.com/~ralf/files.html, |
2459 | ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/). |
2459 | ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/). |
2460 | 2460 | ||
2461 | ---------------------- Constants for registers: ---------------------- |
2461 | ---------------------- Constants for registers: ---------------------- |
2462 | eax - SF_APM (49) |
2462 | eax - SF_APM (49) |
2463 | ====================================================================== |
2463 | ====================================================================== |
2464 | =================== Function 50 - set window shape. ================== |
2464 | =================== Function 50 - set window shape. ================== |
2465 | ====================================================================== |
2465 | ====================================================================== |
2466 | Normal windows have rectangular shape. This function can give to |
2466 | Normal windows have rectangular shape. This function can give to |
2467 | a window any shape. The shape is given by a set of points inside |
2467 | a window any shape. The shape is given by a set of points inside |
2468 | the base rectangle belonging to a window. Position and coordinates |
2468 | the base rectangle belonging to a window. Position and coordinates |
2469 | of the base rectangle are set by function 0 |
2469 | of the base rectangle are set by function 0 |
2470 | and changed by function 67. |
2470 | and changed by function 67. |
2471 | 2471 | ||
2472 | --------------------------- Set shape data --------------------------- |
2472 | --------------------------- Set shape data --------------------------- |
2473 | Parameters: |
2473 | Parameters: |
2474 | * eax = 50 - function number |
2474 | * eax = 50 - function number |
2475 | * ebx = 0 - subfunction number |
2475 | * ebx = 0 - subfunction number |
2476 | * ecx = pointer to shape data (array of bytes 0/1) |
2476 | * ecx = pointer to shape data (array of bytes 0/1) |
2477 | Returned value: |
2477 | Returned value: |
2478 | * function does not return value |
2478 | * function does not return value |
2479 | 2479 | ||
2480 | -------------------------- Set shape scale --------------------------- |
2480 | -------------------------- Set shape scale --------------------------- |
2481 | Parameters: |
2481 | Parameters: |
2482 | * eax = 50 - function number |
2482 | * eax = 50 - function number |
2483 | * ebx = 1 - subfunction number |
2483 | * ebx = 1 - subfunction number |
2484 | * ecx sets a scale: each byte of data defines |
2484 | * ecx sets a scale: each byte of data defines |
2485 | (2^scale)*(2^scale) pixels |
2485 | (2^scale)*(2^scale) pixels |
2486 | Returned value: |
2486 | Returned value: |
2487 | * function does not return value |
2487 | * function does not return value |
2488 | Remarks: |
2488 | Remarks: |
2489 | * Default scale is 0 (scale factor is 1). If in the shape data |
2489 | * Default scale is 0 (scale factor is 1). If in the shape data |
2490 | one byte corresponds to one pixel, there is no necessity |
2490 | one byte corresponds to one pixel, there is no necessity |
2491 | to set scale. |
2491 | to set scale. |
2492 | * Let's designate xsize = window width (in pixels), ysize = height; |
2492 | * Let's designate xsize = window width (in pixels), ysize = height; |
2493 | pay attention, that they are one pixel more than defined by |
2493 | pay attention, that they are one pixel more than defined by |
2494 | functions 0, 67. |
2494 | functions 0, 67. |
2495 | * On definition of scale xsize and ysize must be divisible |
2495 | * On definition of scale xsize and ysize must be divisible |
2496 | on 2^scale. |
2496 | on 2^scale. |
2497 | * Byte of data on offset 'a' must be 0/1 and defines belonging |
2497 | * Byte of data on offset 'a' must be 0/1 and defines belonging |
2498 | to a window of square with the side 2^scale (if scale=0, |
2498 | to a window of square with the side 2^scale (if scale=0, |
2499 | this is one pixel) and coordinates of the left upper corner |
2499 | this is one pixel) and coordinates of the left upper corner |
2500 | (a mod (xsize shr scale), a div (xsize shr scale)) |
2500 | (a mod (xsize shr scale), a div (xsize shr scale)) |
2501 | * Data size: (xsize shr scale)*(ysize shr scale). |
2501 | * Data size: (xsize shr scale)*(ysize shr scale). |
2502 | * Data must be presented in the memory and not change |
2502 | * Data must be presented in the memory and not change |
2503 | after set of shape. |
2503 | after set of shape. |
2504 | * The system views the shape data at every window redraw by |
2504 | * The system views the shape data at every window redraw by |
2505 | function 0. |
2505 | function 0. |
2506 | * The call of subfunction 0 with NULL pointer results in return |
2506 | * The call of subfunction 0 with NULL pointer results in return |
2507 | to the rectangular shape. |
2507 | to the rectangular shape. |
2508 | 2508 | ||
2509 | ---------------------- Constants for registers: ---------------------- |
2509 | ---------------------- Constants for registers: ---------------------- |
2510 | eax - SF_SET_WINDOW_SHAPE (50) |
2510 | eax - SF_SET_WINDOW_SHAPE (50) |
2511 | ====================================================================== |
2511 | ====================================================================== |
2512 | ==================== Function 51 - create thread. ==================== |
2512 | ==================== Function 51 - create thread. ==================== |
2513 | ====================================================================== |
2513 | ====================================================================== |
2514 | Parameters: |
2514 | Parameters: |
2515 | * eax = 51 - function number |
2515 | * eax = 51 - function number |
2516 | * ebx = 1 - unique subfunction |
2516 | * ebx = 1 - unique subfunction |
2517 | * ecx = address of thread entry point (starting eip) |
2517 | * ecx = address of thread entry point (starting eip) |
2518 | * edx = pointer to thread stack (starting esp) |
2518 | * edx = pointer to thread stack (starting esp) |
2519 | Returned value: |
2519 | Returned value: |
2520 | * eax = -1 - error (there is too many threads) |
2520 | * eax = -1 - error (there is too many threads) |
2521 | * otherwise eax = TID - thread identifier |
2521 | * otherwise eax = TID - thread identifier |
2522 | 2522 | ||
2523 | ---------------------- Constants for registers: ---------------------- |
2523 | ---------------------- Constants for registers: ---------------------- |
2524 | eax - SF_CREATE_THREAD (51) |
2524 | eax - SF_CREATE_THREAD (51) |
2525 | ====================================================================== |
2525 | ====================================================================== |
2526 | ==================== Function 54, subfunction 0 ====================== |
2526 | ==================== Function 54, subfunction 0 ====================== |
2527 | ============== Get the number of slots in the clipboard. ============= |
2527 | ============== Get the number of slots in the clipboard. ============= |
2528 | ====================================================================== |
2528 | ====================================================================== |
2529 | Parameters: |
2529 | Parameters: |
2530 | * eax = 54 - function number |
2530 | * eax = 54 - function number |
2531 | * ebx = 0 - subfunction number |
2531 | * ebx = 0 - subfunction number |
2532 | Returned value: |
2532 | Returned value: |
2533 | * eax = slots in the clipboard |
2533 | * eax = slots in the clipboard |
2534 | * eax = -1 - main list area not found |
2534 | * eax = -1 - main list area not found |
2535 | 2535 | ||
2536 | ---------------------- Constants for registers: ---------------------- |
2536 | ---------------------- Constants for registers: ---------------------- |
2537 | eax - SF_CLIPBOARD (54) |
2537 | eax - SF_CLIPBOARD (54) |
2538 | ebx - SSF_GET_SLOT_COUNT (0) |
2538 | ebx - SSF_GET_SLOT_COUNT (0) |
2539 | ====================================================================== |
2539 | ====================================================================== |
2540 | ==================== Function 54, subfunction 1 ====================== |
2540 | ==================== Function 54, subfunction 1 ====================== |
2541 | ================= Read the data from the clipboard. ================== |
2541 | ================= Read the data from the clipboard. ================== |
2542 | ====================================================================== |
2542 | ====================================================================== |
2543 | Parameters: |
2543 | Parameters: |
2544 | * eax = 54 - function number |
2544 | * eax = 54 - function number |
2545 | * ebx = 1 - subfunction number |
2545 | * ebx = 1 - subfunction number |
2546 | * eсx = slot number |
2546 | * eсx = slot number |
2547 | Returned value: |
2547 | Returned value: |
2548 | * eax = if successful - pointer to a memory with data |
2548 | * eax = if successful - pointer to a memory with data |
2549 | * eax = 1 - error |
2549 | * eax = 1 - error |
2550 | * eax = -1 - main list area not found |
2550 | * eax = -1 - main list area not found |
2551 | 2551 | ||
2552 | ---------------------- Constants for registers: ---------------------- |
2552 | ---------------------- Constants for registers: ---------------------- |
2553 | eax - SF_CLIPBOARD (54) |
2553 | eax - SF_CLIPBOARD (54) |
2554 | ebx - SSF_READ_CB (1) |
2554 | ebx - SSF_READ_CB (1) |
2555 | ====================================================================== |
2555 | ====================================================================== |
2556 | ==================== Function 54, subfunction 2 ====================== |
2556 | ==================== Function 54, subfunction 2 ====================== |
2557 | ================= Write the data to the clipboard. =================== |
2557 | ================= Write the data to the clipboard. =================== |
2558 | ====================================================================== |
2558 | ====================================================================== |
2559 | Parameters: |
2559 | Parameters: |
2560 | * eax = 54 - function number |
2560 | * eax = 54 - function number |
2561 | * ebx = 2 - subfunction number |
2561 | * ebx = 2 - subfunction number |
2562 | * eсx = the number of bytes to be copied |
2562 | * eсx = the number of bytes to be copied |
2563 | * edx = a pointer to a buffer for data to be copied |
2563 | * edx = a pointer to a buffer for data to be copied |
2564 | Returned value: |
2564 | Returned value: |
2565 | * eax = 0 - success |
2565 | * eax = 0 - success |
2566 | * eax = 1 - error |
2566 | * eax = 1 - error |
2567 | * eax = -1 - main list area not found |
2567 | * eax = -1 - main list area not found |
2568 | 2568 | ||
2569 | ---------------------- Constants for registers: ---------------------- |
2569 | ---------------------- Constants for registers: ---------------------- |
2570 | eax - SF_CLIPBOARD (54) |
2570 | eax - SF_CLIPBOARD (54) |
2571 | ebx - SSF_WRITE_CB (2) |
2571 | ebx - SSF_WRITE_CB (2) |
2572 | ====================================================================== |
2572 | ====================================================================== |
2573 | ===================== Function 54, subfunction 3 ===================== |
2573 | ===================== Function 54, subfunction 3 ===================== |
2574 | ================ Delete the last slot in the clipboard =============== |
2574 | ================ Delete the last slot in the clipboard =============== |
2575 | ====================================================================== |
2575 | ====================================================================== |
2576 | Parameters: |
2576 | Parameters: |
2577 | * eax = 54 - function number |
2577 | * eax = 54 - function number |
2578 | * ebx = 3 - subfunction number |
2578 | * ebx = 3 - subfunction number |
2579 | Returned value: |
2579 | Returned value: |
2580 | * eax = 0 - success |
2580 | * eax = 0 - success |
2581 | * eax = 1 - error |
2581 | * eax = 1 - error |
2582 | * eax = -1 - main list area not found |
2582 | * eax = -1 - main list area not found |
2583 | 2583 | ||
2584 | ---------------------- Constants for registers: ---------------------- |
2584 | ---------------------- Constants for registers: ---------------------- |
2585 | eax - SF_CLIPBOARD (54) |
2585 | eax - SF_CLIPBOARD (54) |
2586 | ebx - SSF_DEL_SLOT (3) |
2586 | ebx - SSF_DEL_SLOT (3) |
2587 | ====================================================================== |
2587 | ====================================================================== |
2588 | ===================== Function 54, subfunction 4 ===================== |
2588 | ===================== Function 54, subfunction 4 ===================== |
2589 | ===================== Alarm reset the lock buffer ==================== |
2589 | ===================== Alarm reset the lock buffer ==================== |
2590 | ====================================================================== |
2590 | ====================================================================== |
2591 | Parameters: |
2591 | Parameters: |
2592 | * eax = 54 - function number |
2592 | * eax = 54 - function number |
2593 | * ebx = 4 - subfunction number |
2593 | * ebx = 4 - subfunction number |
2594 | Returned value: |
2594 | Returned value: |
2595 | * eax = 0 - success |
2595 | * eax = 0 - success |
2596 | * eax = -1 - main list area not found or no blocking |
2596 | * eax = -1 - main list area not found or no blocking |
2597 | Remarks: |
2597 | Remarks: |
2598 | * Used in exceptional cases, where no responsible or killed |
2598 | * Used in exceptional cases, where no responsible or killed |
2599 | application blocked the clipboard operations. |
2599 | application blocked the clipboard operations. |
2600 | 2600 | ||
2601 | ---------------------- Constants for registers: ---------------------- |
2601 | ---------------------- Constants for registers: ---------------------- |
2602 | eax - SF_CLIPBOARD (54) |
2602 | eax - SF_CLIPBOARD (54) |
2603 | ebx - SSF_UNLOCK_BUFFER (4) |
2603 | ebx - SSF_UNLOCK_BUFFER (4) |
2604 | ====================================================================== |
2604 | ====================================================================== |
2605 | Function 55, subfunction 55 - begin to play data on built-in speaker. |
2605 | Function 55, subfunction 55 - begin to play data on built-in speaker. |
2606 | ====================================================================== |
2606 | ====================================================================== |
2607 | Parameters: |
2607 | Parameters: |
2608 | * eax = 55 - function number |
2608 | * eax = 55 - function number |
2609 | * ebx = 55 - subfunction number |
2609 | * ebx = 55 - subfunction number |
2610 | * esi = pointer to data |
2610 | * esi = pointer to data |
2611 | Returned value: |
2611 | Returned value: |
2612 | * eax = 0 - success |
2612 | * eax = 0 - success |
2613 | * eax = 55 - error (speaker is off or busy) |
2613 | * eax = 55 - error (speaker is off or busy) |
2614 | Data is an array of items with variable length. |
2614 | Data is an array of items with variable length. |
2615 | Format of each item is defined by first byte: |
2615 | Format of each item is defined by first byte: |
2616 | * 0 = end of data |
2616 | * 0 = end of data |
2617 | * 1..0x80 = sets sound duration on 1/100 of second; sound note |
2617 | * 1..0x80 = sets sound duration on 1/100 of second; sound note |
2618 | is defined by immediate value of frequency |
2618 | is defined by immediate value of frequency |
2619 | * following word (2 bytes) contains frequency divider; |
2619 | * following word (2 bytes) contains frequency divider; |
2620 | frequency is defined as 1193180/divider |
2620 | frequency is defined as 1193180/divider |
2621 | * 0x81 = invalid |
2621 | * 0x81 = invalid |
2622 | * 0x82..0xFF = note is defined by octave and number: |
2622 | * 0x82..0xFF = note is defined by octave and number: |
2623 | * duration in 1/100 of second = (first byte)-0x81 |
2623 | * duration in 1/100 of second = (first byte)-0x81 |
2624 | * there is one more byte; |
2624 | * there is one more byte; |
2625 | * (second byte)=0xFF - delay |
2625 | * (second byte)=0xFF - delay |
2626 | * otherwise it looks like a*0x10+b, where b=number of the note in |
2626 | * otherwise it looks like a*0x10+b, where b=number of the note in |
2627 | an octave from 1 to 12, a=number of octave (beginning from 0) |
2627 | an octave from 1 to 12, a=number of octave (beginning from 0) |
2628 | Remarks: |
2628 | Remarks: |
2629 | * Speaker play can be disabled/enabled by |
2629 | * Speaker play can be disabled/enabled by |
2630 | subfunction 8 of function 18. |
2630 | subfunction 8 of function 18. |
2631 | * Function returns control, having informed the system |
2631 | * Function returns control, having informed the system |
2632 | an information on request. Play itself goes independently from |
2632 | an information on request. Play itself goes independently from |
2633 | the program. |
2633 | the program. |
2634 | * The data must be kept in the memory at least up to the end |
2634 | * The data must be kept in the memory at least up to the end |
2635 | of play. |
2635 | of play. |
2636 | 2636 | ||
2637 | ---------------------- Constants for registers: ---------------------- |
2637 | ---------------------- Constants for registers: ---------------------- |
2638 | eax - SF_SPEAKER_PLAY (55) |
2638 | eax - SF_SPEAKER_PLAY (55) |
2639 | ====================================================================== |
2639 | ====================================================================== |
2640 | ======================= Function 57 - PCI BIOS. ====================== |
2640 | ======================= Function 57 - PCI BIOS. ====================== |
2641 | ====================================================================== |
2641 | ====================================================================== |
2642 | Parameters: |
2642 | Parameters: |
2643 | * eax = 57 - function number |
2643 | * eax = 57 - function number |
2644 | * ebp corresponds to al in PCI BIOS specification |
2644 | * ebp corresponds to al in PCI BIOS specification |
2645 | * other registers are set according to PCI BIOS specification |
2645 | * other registers are set according to PCI BIOS specification |
2646 | Returned value: |
2646 | Returned value: |
2647 | * CF is undefined |
2647 | * CF is undefined |
2648 | * other registers are set according to PCI BIOS specification |
2648 | * other registers are set according to PCI BIOS specification |
2649 | Remarks: |
2649 | Remarks: |
2650 | * Many effects of this function can be also achieved with |
2650 | * Many effects of this function can be also achieved with |
2651 | corresponding subfunctions of function 62. |
2651 | corresponding subfunctions of function 62. |
2652 | * The function calls PCI32 BIOS extension, documented e.g. in |
2652 | * The function calls PCI32 BIOS extension, documented e.g. in |
2653 | http://alpha1.dyns.net/files/PCI/bios21.pdf. |
2653 | http://alpha1.dyns.net/files/PCI/bios21.pdf. |
2654 | * If BIOS does not support this extension, its behavior is emulated |
2654 | * If BIOS does not support this extension, its behavior is emulated |
2655 | (through kernel-mode analogues of subfunctions of function 62). |
2655 | (through kernel-mode analogues of subfunctions of function 62). |
2656 | 2656 | ||
2657 | ---------------------- Constants for registers: ---------------------- |
2657 | ---------------------- Constants for registers: ---------------------- |
2658 | eax - SF_PCI_BIOS (57) |
2658 | eax - SF_PCI_BIOS (57) |
2659 | ====================================================================== |
2659 | ====================================================================== |
2660 | ========== Function 60 - Inter Process Communication (IPC). ========== |
2660 | ========== Function 60 - Inter Process Communication (IPC). ========== |
2661 | ====================================================================== |
2661 | ====================================================================== |
2662 | IPC is used for message dispatching from one process/thread to |
2662 | IPC is used for message dispatching from one process/thread to |
2663 | another. Previously it is necessary to agree how to interpret |
2663 | another. Previously it is necessary to agree how to interpret |
2664 | the concrete message. |
2664 | the concrete message. |
2665 | 2665 | ||
2666 | ----------- Subfunction 1 - set the area for IPC receiving ----------- |
2666 | ----------- Subfunction 1 - set the area for IPC receiving ----------- |
2667 | Is called by process-receiver. |
2667 | Is called by process-receiver. |
2668 | Parameters: |
2668 | Parameters: |
2669 | * eax = 60 - function number |
2669 | * eax = 60 - function number |
2670 | * ebx = 1 - subfunction number |
2670 | * ebx = 1 - subfunction number |
2671 | * ecx = pointer to the buffer |
2671 | * ecx = pointer to the buffer |
2672 | * edx = size of the buffer |
2672 | * edx = size of the buffer |
2673 | Returned value: |
2673 | Returned value: |
2674 | * eax = 0 - always success |
2674 | * eax = 0 - always success |
2675 | Format of IPC-buffer: |
2675 | Format of IPC-buffer: |
2676 | * +0: dword: if nonzero, buffer is considered locked; |
2676 | * +0: dword: if nonzero, buffer is considered locked; |
2677 | lock/unlock the buffer, when you work with it and need that |
2677 | lock/unlock the buffer, when you work with it and need that |
2678 | buffer data are not changed from outside (no new messages) |
2678 | buffer data are not changed from outside (no new messages) |
2679 | * +4: dword: occupied place in the buffer (in bytes) |
2679 | * +4: dword: occupied place in the buffer (in bytes) |
2680 | * +8: first message |
2680 | * +8: first message |
2681 | * +8+n: second message |
2681 | * +8+n: second message |
2682 | * ... |
2682 | * ... |
2683 | Format of a message: |
2683 | Format of a message: |
2684 | * +0: dword: PID of sender |
2684 | * +0: dword: PID of sender |
2685 | * +4: dword: message length (not including this header) |
2685 | * +4: dword: message length (not including this header) |
2686 | * +8: n*byte: message data |
2686 | * +8: n*byte: message data |
2687 | 2687 | ||
2688 | ------------------ Subfunction 2 - send IPC message ------------------ |
2688 | ------------------ Subfunction 2 - send IPC message ------------------ |
2689 | Is called by process-sender. |
2689 | Is called by process-sender. |
2690 | Parameters: |
2690 | Parameters: |
2691 | * eax = 60 - function number |
2691 | * eax = 60 - function number |
2692 | * ebx = 2 - subfunction number |
2692 | * ebx = 2 - subfunction number |
2693 | * ecx = PID of receiver |
2693 | * ecx = PID of receiver |
2694 | * edx = pointer to the message data |
2694 | * edx = pointer to the message data |
2695 | * esi = message length (in bytes) |
2695 | * esi = message length (in bytes) |
2696 | Returned value: |
2696 | Returned value: |
2697 | * eax = 0 - success |
2697 | * eax = 0 - success |
2698 | * eax = 1 - the receiver has not defined buffer for IPC messages |
2698 | * eax = 1 - the receiver has not defined buffer for IPC messages |
2699 | (can be, still have no time, |
2699 | (can be, still have no time, |
2700 | and can be, this is not right process) |
2700 | and can be, this is not right process) |
2701 | * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit |
2701 | * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit |
2702 | * eax = 3 - overflow of IPC-buffer of the receiver |
2702 | * eax = 3 - overflow of IPC-buffer of the receiver |
2703 | * eax = 4 - process/thread with such PID does not exist |
2703 | * eax = 4 - process/thread with such PID does not exist |
2704 | Remarks: |
2704 | Remarks: |
2705 | * Immediately after writing of IPC-message to the buffer the system |
2705 | * Immediately after writing of IPC-message to the buffer the system |
2706 | sends to the receiver the event with code 7 (see event codes). |
2706 | sends to the receiver the event with code 7 (see event codes). |
2707 | 2707 | ||
2708 | ---------------------- Constants for registers: ---------------------- |
2708 | ---------------------- Constants for registers: ---------------------- |
2709 | eax - SF_IPC (60) |
2709 | eax - SF_IPC (60) |
2710 | ebx - SSF_SET_AREA (1), SSF_SEND_MESSAGE (2) |
2710 | ebx - SSF_SET_AREA (1), SSF_SEND_MESSAGE (2) |
2711 | ====================================================================== |
2711 | ====================================================================== |
2712 | ==== Function 61 - get parameters for the direct graphics access. ==== |
2712 | ==== Function 61 - get parameters for the direct graphics access. ==== |
2713 | ====================================================================== |
2713 | ====================================================================== |
2714 | The data of the graphics screen (the memory area which displays |
2714 | The data of the graphics screen (the memory area which displays |
2715 | screen contents) are accessible to a program directly, without |
2715 | screen contents) are accessible to a program directly, without |
2716 | any system calls, through the selector gs: |
2716 | any system calls, through the selector gs: |
2717 | mov eax, [gs:0] |
2717 | mov eax, [gs:0] |
2718 | places in eax the first dword of the buffer, which contains |
2718 | places in eax the first dword of the buffer, which contains |
2719 | information on color of the left upper point (and, possibly, colors |
2719 | information on color of the left upper point (and, possibly, colors |
2720 | of several following). |
2720 | of several following). |
2721 | mov [gs:0], eax |
2721 | mov [gs:0], eax |
2722 | by work in VESA modes with LFB sets color of the left upper point |
2722 | by work in VESA modes with LFB sets color of the left upper point |
2723 | (and, possibly, colors of several following). |
2723 | (and, possibly, colors of several following). |
2724 | To interpret the data of graphics screen program needs to know |
2724 | To interpret the data of graphics screen program needs to know |
2725 | some parameters, returning by this function. |
2725 | some parameters, returning by this function. |
2726 | Remarks: |
2726 | Remarks: |
2727 | * Graphics parameters changes very seldom at work, |
2727 | * Graphics parameters changes very seldom at work, |
2728 | namely, only in cases, when user works with the application VRR. |
2728 | namely, only in cases, when user works with the application VRR. |
2729 | * At videomode change the system redraws all windows (event |
2729 | * At videomode change the system redraws all windows (event |
2730 | with code 1) and redraws the background (event 5). |
2730 | with code 1) and redraws the background (event 5). |
2731 | Same events occur in other cases too, which meet much more often, |
2731 | Same events occur in other cases too, which meet much more often, |
2732 | than videomode change. |
2732 | than videomode change. |
2733 | * By operation in videomodes with LFB the selector gs points to |
2733 | * By operation in videomodes with LFB the selector gs points to |
2734 | LFB itself, so reading/writing on gs result directly in |
2734 | LFB itself, so reading/writing on gs result directly in |
2735 | change of screen contents. By operation in videomodes without |
2735 | change of screen contents. By operation in videomodes without |
2736 | LFB gs points to some data area in the kernel, and all functions |
2736 | LFB gs points to some data area in the kernel, and all functions |
2737 | of screen output fulfil honesty double operation on writing |
2737 | of screen output fulfil honesty double operation on writing |
2738 | directly to the screen and writing to this buffer. In result |
2738 | directly to the screen and writing to this buffer. In result |
2739 | at reading contents of this buffer the results correspond to |
2739 | at reading contents of this buffer the results correspond to |
2740 | screen contents (with, generally speaking, large color |
2740 | screen contents (with, generally speaking, large color |
2741 | resolution), and writing is ignored. |
2741 | resolution), and writing is ignored. |
2742 | One exception is the mode 320*200, for which main loop of the |
2742 | One exception is the mode 320*200, for which main loop of the |
2743 | system thread updates the screen according to mouse movements. |
2743 | system thread updates the screen according to mouse movements. |
2744 | 2744 | ||
2745 | ------------------------- Screen resolution -------------------------- |
2745 | ------------------------- Screen resolution -------------------------- |
2746 | Parameters: |
2746 | Parameters: |
2747 | * eax = 61 - function number |
2747 | * eax = 61 - function number |
2748 | * ebx = 1 - subfunction number |
2748 | * ebx = 1 - subfunction number |
2749 | Returned value: |
2749 | Returned value: |
2750 | * eax = [resolution on x axis]*65536 + [resolution on y axis] |
2750 | * eax = [resolution on x axis]*65536 + [resolution on y axis] |
2751 | Remarks: |
2751 | Remarks: |
2752 | * One can use function 14 paying attention that |
2752 | * One can use function 14 paying attention that |
2753 | it returns sizes on 1 pixel less. It is fully equivalent way. |
2753 | it returns sizes on 1 pixel less. It is fully equivalent way. |
2754 | 2754 | ||
2755 | ---------------------- Number of bits per pixel ---------------------- |
2755 | ---------------------- Number of bits per pixel ---------------------- |
2756 | Parameters: |
2756 | Parameters: |
2757 | * eax = 61 - function number |
2757 | * eax = 61 - function number |
2758 | * ebx = 2 - subfunction number |
2758 | * ebx = 2 - subfunction number |
2759 | Returned value: |
2759 | Returned value: |
2760 | * eax = number of bits per pixel (24 or 32) |
2760 | * eax = number of bits per pixel (24 or 32) |
2761 | 2761 | ||
2762 | -------------------- Number of bytes per scanline -------------------- |
2762 | -------------------- Number of bytes per scanline -------------------- |
2763 | Parameters: |
2763 | Parameters: |
2764 | * eax = 61 - function number |
2764 | * eax = 61 - function number |
2765 | * ebx = 3 - subfunction number |
2765 | * ebx = 3 - subfunction number |
2766 | Returned value: |
2766 | Returned value: |
2767 | * eax = number of bytes occupied by one scanline |
2767 | * eax = number of bytes occupied by one scanline |
2768 | (horizontal line on the screen) |
2768 | (horizontal line on the screen) |
2769 | 2769 | ||
2770 | ---------------------- Constants for registers: ---------------------- |
2770 | ---------------------- Constants for registers: ---------------------- |
2771 | eax - SF_GET_GRAPHICAL_PARAMS (61) |
2771 | eax - SF_GET_GRAPHICAL_PARAMS (61) |
2772 | ebx - SSF_SCREEN_SIZE (1), SSF_BITS_PER_PIXEL (2), |
2772 | ebx - SSF_SCREEN_SIZE (1), SSF_BITS_PER_PIXEL (2), |
2773 | SSF_BYTES_PER_LINE (3) |
2773 | SSF_BYTES_PER_LINE (3) |
2774 | ====================================================================== |
2774 | ====================================================================== |
2775 | ===== Function 62, subfunction 0 - get version of PCI-interface. ===== |
2775 | ===== Function 62, subfunction 0 - get version of PCI-interface. ===== |
2776 | ====================================================================== |
2776 | ====================================================================== |
2777 | Parameters: |
2777 | Parameters: |
2778 | * eax = 62 - function number |
2778 | * eax = 62 - function number |
2779 | * bl = 0 - subfunction number |
2779 | * bl = 0 - subfunction number |
2780 | Returned value: |
2780 | Returned value: |
2781 | * eax = -1 - PCI access is disabled; otherwise |
2781 | * eax = -1 - PCI access is disabled; otherwise |
2782 | * ah.al = version of PCI-interface (ah=version, al=subversion) |
2782 | * ah.al = version of PCI-interface (ah=version, al=subversion) |
2783 | * high word of eax is zeroed |
2783 | * high word of eax is zeroed |
2784 | Remarks: |
2784 | Remarks: |
2785 | * Previously low-level access to PCI for applications must be |
2785 | * Previously low-level access to PCI for applications must be |
2786 | enabled by subfunction 12 of function 21. |
2786 | enabled by subfunction 12 of function 21. |
2787 | * If PCI BIOS is not supported, the value of ax is undefined. |
2787 | * If PCI BIOS is not supported, the value of ax is undefined. |
2788 | 2788 | ||
2789 | ---------------------- Constants for registers: ---------------------- |
2789 | ---------------------- Constants for registers: ---------------------- |
2790 | eax - SF_PCI (62) |
2790 | eax - SF_PCI (62) |
2791 | ebx - SSF_GET_VERSION (0) |
2791 | ebx - SSF_GET_VERSION (0) |
2792 | ====================================================================== |
2792 | ====================================================================== |
2793 | ==== Function 62, subfunction 1 - get number of the last PCI-bus. ==== |
2793 | ==== Function 62, subfunction 1 - get number of the last PCI-bus. ==== |
2794 | ====================================================================== |
2794 | ====================================================================== |
2795 | Parameters: |
2795 | Parameters: |
2796 | * eax = 62 - function number |
2796 | * eax = 62 - function number |
2797 | * bl = 1 - subfunction number |
2797 | * bl = 1 - subfunction number |
2798 | Returned value: |
2798 | Returned value: |
2799 | * eax = -1 - access to PCI is disabled; otherwise |
2799 | * eax = -1 - access to PCI is disabled; otherwise |
2800 | * al = number of the last PCI-bus; other bytes of eax are destroyed |
2800 | * al = number of the last PCI-bus; other bytes of eax are destroyed |
2801 | Remarks: |
2801 | Remarks: |
2802 | * Previously low-level access to PCI for applications must be |
2802 | * Previously low-level access to PCI for applications must be |
2803 | enabled by subfunction 12 of function 21. |
2803 | enabled by subfunction 12 of function 21. |
2804 | * If PCI BIOS is not supported, the value of ax is undefined. |
2804 | * If PCI BIOS is not supported, the value of ax is undefined. |
2805 | 2805 | ||
2806 | ---------------------- Constants for registers: ---------------------- |
2806 | ---------------------- Constants for registers: ---------------------- |
2807 | eax - SF_PCI (62) |
2807 | eax - SF_PCI (62) |
2808 | ebx - SSF_GET_LAST_BUS (1) |
2808 | ebx - SSF_GET_LAST_BUS (1) |
2809 | ====================================================================== |
2809 | ====================================================================== |
2810 | ===================== Function 62, subfunction 2 ===================== |
2810 | ===================== Function 62, subfunction 2 ===================== |
2811 | ===== Get mechanism of addressing to the PCI configuration space. ==== |
2811 | ===== Get mechanism of addressing to the PCI configuration space. ==== |
2812 | ====================================================================== |
2812 | ====================================================================== |
2813 | Parameters: |
2813 | Parameters: |
2814 | * eax = 62 - function number |
2814 | * eax = 62 - function number |
2815 | * bl = 2 - subfunction number |
2815 | * bl = 2 - subfunction number |
2816 | Returned value: |
2816 | Returned value: |
2817 | * eax = -1 - access to PCI is disabled; otherwise |
2817 | * eax = -1 - access to PCI is disabled; otherwise |
2818 | * al = mechanism (1 or 2); other bytes of eax are destroyed |
2818 | * al = mechanism (1 or 2); other bytes of eax are destroyed |
2819 | Remarks: |
2819 | Remarks: |
2820 | * Previously low-level access to PCI for applications must be |
2820 | * Previously low-level access to PCI for applications must be |
2821 | enabled by subfunction 12 of function 21. |
2821 | enabled by subfunction 12 of function 21. |
2822 | * Addressing mechanism is selected depending on |
2822 | * Addressing mechanism is selected depending on |
2823 | equipment characteristics. |
2823 | equipment characteristics. |
2824 | * Subfunctions of read and write work automatically |
2824 | * Subfunctions of read and write work automatically |
2825 | with the selected mechanism. |
2825 | with the selected mechanism. |
2826 | 2826 | ||
2827 | ---------------------- Constants for registers: ---------------------- |
2827 | ---------------------- Constants for registers: ---------------------- |
2828 | eax - SF_PCI (62) |
2828 | eax - SF_PCI (62) |
2829 | ebx - SSF_GET_ADRR_MODE (2) |
2829 | ebx - SSF_GET_ADRR_MODE (2) |
2830 | ====================================================================== |
2830 | ====================================================================== |
2831 | ======== Function 62, subfunctions 4,5,6 - read PCI-register. ======== |
2831 | ======== Function 62, subfunctions 4,5,6 - read PCI-register. ======== |
2832 | ====================================================================== |
2832 | ====================================================================== |
2833 | Parameters: |
2833 | Parameters: |
2834 | * eax = 62 - function number |
2834 | * eax = 62 - function number |
2835 | * bl = 4 - read byte |
2835 | * bl = 4 - read byte |
2836 | * bl = 5 - read word |
2836 | * bl = 5 - read word |
2837 | * bl = 6 - read dword |
2837 | * bl = 6 - read dword |
2838 | * bh = number of PCI-bus |
2838 | * bh = number of PCI-bus |
2839 | * ch = dddddfff, where ddddd = number of the device on the bus, |
2839 | * ch = dddddfff, where ddddd = number of the device on the bus, |
2840 | fff = function number of device |
2840 | fff = function number of device |
2841 | * cl = number of register (must be even for bl=5, |
2841 | * cl = number of register (must be even for bl=5, |
2842 | divisible by 4 for bl=6) |
2842 | divisible by 4 for bl=6) |
2843 | Returned value: |
2843 | Returned value: |
2844 | * eax = -1 - error (access to PCI is disabled or parameters |
2844 | * eax = -1 - error (access to PCI is disabled or parameters |
2845 | are not supported); otherwise |
2845 | are not supported); otherwise |
2846 | * al/ax/eax (depending on requested size) contains the data; |
2846 | * al/ax/eax (depending on requested size) contains the data; |
2847 | the other part of register eax is destroyed |
2847 | the other part of register eax is destroyed |
2848 | Remarks: |
2848 | Remarks: |
2849 | * Previously low-level access to PCI for applications must be |
2849 | * Previously low-level access to PCI for applications must be |
2850 | enabled by subfunction 12 of function 21. |
2850 | enabled by subfunction 12 of function 21. |
2851 | * Access mechanism 2 supports only 16 devices on a bus and ignores |
2851 | * Access mechanism 2 supports only 16 devices on a bus and ignores |
2852 | function number. To get access mechanism use subfunction 2. |
2852 | function number. To get access mechanism use subfunction 2. |
2853 | * Some registers are standard and exist for all devices, some are |
2853 | * Some registers are standard and exist for all devices, some are |
2854 | defined by the concrete device. The list of registers of the |
2854 | defined by the concrete device. The list of registers of the |
2855 | first type can be found e.g. in famous |
2855 | first type can be found e.g. in famous |
2856 | Interrupt List by Ralf Brown |
2856 | Interrupt List by Ralf Brown |
2857 | (http://www.pobox.com/~ralf/files.html, |
2857 | (http://www.pobox.com/~ralf/files.html, |
2858 | ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/); |
2858 | ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/); |
2859 | registers of the second type must be listed |
2859 | registers of the second type must be listed |
2860 | in the device documentation. |
2860 | in the device documentation. |
2861 | 2861 | ||
2862 | ---------------------- Constants for registers: ---------------------- |
2862 | ---------------------- Constants for registers: ---------------------- |
2863 | eax - SF_PCI (62) |
2863 | eax - SF_PCI (62) |
2864 | ebx - SSF_READ_BYTE (4), SSF_READ_WORD (5), SSF_READ_DWORD (6) |
2864 | ebx - SSF_READ_BYTE (4), SSF_READ_WORD (5), SSF_READ_DWORD (6) |
2865 | ====================================================================== |
2865 | ====================================================================== |
2866 | ====== Function 62, subfunctions 8,9,10 - write to PCI-register. ===== |
2866 | ====== Function 62, subfunctions 8,9,10 - write to PCI-register. ===== |
2867 | ====================================================================== |
2867 | ====================================================================== |
2868 | Parameters: |
2868 | Parameters: |
2869 | * eax = 62 - function number |
2869 | * eax = 62 - function number |
2870 | * bl = 8 - write byte |
2870 | * bl = 8 - write byte |
2871 | * bl = 9 - write word |
2871 | * bl = 9 - write word |
2872 | * bl = 10 - write dword |
2872 | * bl = 10 - write dword |
2873 | * bh = number of PCI-bus |
2873 | * bh = number of PCI-bus |
2874 | * ch = dddddfff, where ddddd = number of the device on the bus, |
2874 | * ch = dddddfff, where ddddd = number of the device on the bus, |
2875 | fff = function number of device |
2875 | fff = function number of device |
2876 | * cl = number of register (must be even for bl=9, |
2876 | * cl = number of register (must be even for bl=9, |
2877 | divisible by 4 for bl=10) |
2877 | divisible by 4 for bl=10) |
2878 | * dl/dx/edx (depending on requested size) contatins |
2878 | * dl/dx/edx (depending on requested size) contatins |
2879 | the data to write |
2879 | the data to write |
2880 | Returned value: |
2880 | Returned value: |
2881 | * eax = -1 - error (access to PCI is disabled or parameters |
2881 | * eax = -1 - error (access to PCI is disabled or parameters |
2882 | are not supported) |
2882 | are not supported) |
2883 | * eax = 0 - success |
2883 | * eax = 0 - success |
2884 | Remarks: |
2884 | Remarks: |
2885 | * Previously low-level access to PCI for applications must be |
2885 | * Previously low-level access to PCI for applications must be |
2886 | enabled by subfunction 12 of function 21. |
2886 | enabled by subfunction 12 of function 21. |
2887 | * Access mechanism 2 supports only 16 devices on a bus and ignores |
2887 | * Access mechanism 2 supports only 16 devices on a bus and ignores |
2888 | function number. To get access mechanism use subfunction 2. |
2888 | function number. To get access mechanism use subfunction 2. |
2889 | * Some registers are standard and exist for all devices, some are |
2889 | * Some registers are standard and exist for all devices, some are |
2890 | defined by the concrete device. The list of registers of the |
2890 | defined by the concrete device. The list of registers of the |
2891 | first type can be found e.g. in famous Interrupt List by |
2891 | first type can be found e.g. in famous Interrupt List by |
2892 | Ralf Brown; registers of the second type must be listed |
2892 | Ralf Brown; registers of the second type must be listed |
2893 | in the device documentation. |
2893 | in the device documentation. |
2894 | 2894 | ||
2895 | ---------------------- Constants for registers: ---------------------- |
2895 | ---------------------- Constants for registers: ---------------------- |
2896 | eax - SF_PCI (62) |
2896 | eax - SF_PCI (62) |
2897 | ebx - SSF_WRITE_BYTE (8), SSF_WRITE_WORD (9), SSF_WRITE_DWORD (10) |
2897 | ebx - SSF_WRITE_BYTE (8), SSF_WRITE_WORD (9), SSF_WRITE_DWORD (10) |
2898 | ====================================================================== |
2898 | ====================================================================== |
2899 | ============== Function 63 - work with the debug board. ============== |
2899 | ============== Function 63 - work with the debug board. ============== |
2900 | ====================================================================== |
2900 | ====================================================================== |
2901 | The debug board is the global system buffer (with the size |
2901 | The debug board is the global system buffer (with the size |
2902 | 1024 bytes), to which any program can write (generally speaking, |
2902 | 1024 bytes), to which any program can write (generally speaking, |
2903 | arbitrary) data and from which other program can read these data. |
2903 | arbitrary) data and from which other program can read these data. |
2904 | By the agreement written data are text strings interpreted as |
2904 | By the agreement written data are text strings interpreted as |
2905 | debug messages on a course of program execution. The kernel in |
2905 | debug messages on a course of program execution. The kernel in |
2906 | some situations also writes to the debug board information on |
2906 | some situations also writes to the debug board information on |
2907 | execution of some functions; by the agreement kernel messages |
2907 | execution of some functions; by the agreement kernel messages |
2908 | begins from the prefix "K : ". |
2908 | begins from the prefix "K : ". |
2909 | For view of the debug board the application 'board' was created, |
2909 | For view of the debug board the application 'board' was created, |
2910 | which reads data from the buffer and displays them in its window. |
2910 | which reads data from the buffer and displays them in its window. |
2911 | 'board' interpretes the sequence of codes 13,10 as newline. |
2911 | 'board' interpretes the sequence of codes 13,10 as newline. |
2912 | A character with null code in an end of line is not necessary, |
2912 | A character with null code in an end of line is not necessary, |
2913 | but also does not prevent. |
2913 | but also does not prevent. |
2914 | Because debugger has been written, the value of the debug board |
2914 | Because debugger has been written, the value of the debug board |
2915 | has decreased, as debugger allows to inspect completely a course of |
2915 | has decreased, as debugger allows to inspect completely a course of |
2916 | program execution without any efforts from the direction of program |
2916 | program execution without any efforts from the direction of program |
2917 | itself. Nevertheless in some cases the debug board is still useful. |
2917 | itself. Nevertheless in some cases the debug board is still useful. |
2918 | 2918 | ||
2919 | ----------------------------- Write byte ----------------------------- |
2919 | ----------------------------- Write byte ----------------------------- |
2920 | Parameters: |
2920 | Parameters: |
2921 | * eax = 63 - function number |
2921 | * eax = 63 - function number |
2922 | * ebx = 1 - subfunction number |
2922 | * ebx = 1 - subfunction number |
2923 | * cl = data byte |
2923 | * cl = data byte |
2924 | Returned value: |
2924 | Returned value: |
2925 | * function does not return value |
2925 | * function does not return value |
2926 | Remarks: |
2926 | Remarks: |
2927 | * Byte is written to the buffer. Buffer size is 512 bytes. |
2927 | * Byte is written to the buffer. Buffer size is 512 bytes. |
2928 | At buffer overflow all obtained data are lost. |
2928 | At buffer overflow all obtained data are lost. |
2929 | * For output to the debug board of more complicated objects |
2929 | * For output to the debug board of more complicated objects |
2930 | (strings, numbers) it is enough to call this function in cycle. |
2930 | (strings, numbers) it is enough to call this function in cycle. |
2931 | It is possible not to write the appropriate code manually and use |
2931 | It is possible not to write the appropriate code manually and use |
2932 | file 'debug.inc', which is included into the distributive. |
2932 | file 'debug.inc', which is included into the distributive. |
2933 | 2933 | ||
2934 | ----------------------------- Read byte ------------------------------ |
2934 | ----------------------------- Read byte ------------------------------ |
2935 | Takes away byte from the buffer. |
2935 | Takes away byte from the buffer. |
2936 | Parameters: |
2936 | Parameters: |
2937 | * eax = 63 - function number |
2937 | * eax = 63 - function number |
2938 | * ebx = 2 - subfunction number |
2938 | * ebx = 2 - subfunction number |
2939 | Returned value: |
2939 | Returned value: |
2940 | * eax = ebx = 0 - the buffer is empty |
2940 | * eax = ebx = 0 - the buffer is empty |
2941 | * eax = byte, ebx = 1 - byte was successfully read |
2941 | * eax = byte, ebx = 1 - byte was successfully read |
2942 | 2942 | ||
2943 | ---------------------- Constants for registers: ---------------------- |
2943 | ---------------------- Constants for registers: ---------------------- |
2944 | eax - SF_BOARD (63) |
2944 | eax - SF_BOARD (63) |
2945 | ebx - SSF_DEBUG_WRITE (1), SSF_DEBUG_READ (2) |
2945 | ebx - SSF_DEBUG_WRITE (1), SSF_DEBUG_READ (2) |
2946 | ====================================================================== |
2946 | ====================================================================== |
2947 | ============== Function 64 - resize application memory. ============== |
2947 | ============== Function 64 - resize application memory. ============== |
2948 | ====================================================================== |
2948 | ====================================================================== |
2949 | Parameters: |
2949 | Parameters: |
2950 | * eax = 64 - function number |
2950 | * eax = 64 - function number |
2951 | * ebx = 1 - unique subfunction |
2951 | * ebx = 1 - unique subfunction |
2952 | * ecx = new memory size |
2952 | * ecx = new memory size |
2953 | Returned value: |
2953 | Returned value: |
2954 | * eax = 0 - success |
2954 | * eax = 0 - success |
2955 | * eax = 1 - not enough memory |
2955 | * eax = 1 - not enough memory |
2956 | Remarks: |
2956 | Remarks: |
2957 | * There is another way to dynamically allocate/free memory - |
2957 | * There is another way to dynamically allocate/free memory - |
2958 | subfunctions 12, 13 and 20 of function 68, but after creation |
2958 | subfunctions 12, 13 and 20 of function 68, but after creation |
2959 | of the process heap 64 function call will be ignored. |
2959 | of the process heap 64 function call will be ignored. |
2960 | 2960 | ||
2961 | ---------------------- Constants for registers: ---------------------- |
2961 | ---------------------- Constants for registers: ---------------------- |
2962 | eax - SF_MEMORY_RESIZE (64) |
2962 | eax - SF_MEMORY_RESIZE (64) |
2963 | ====================================================================== |
2963 | ====================================================================== |
2964 | ======== Function 65 - draw image with palette in the window. ======== |
2964 | ======== Function 65 - draw image with palette in the window. ======== |
2965 | ====================================================================== |
2965 | ====================================================================== |
2966 | Parameters: |
2966 | Parameters: |
2967 | * eax = 65 - function number |
2967 | * eax = 65 - function number |
2968 | * ebx = pointer to the image |
2968 | * ebx = pointer to the image |
2969 | * ecx = [size on axis x]*65536 + [size on axis y] |
2969 | * ecx = [size on axis x]*65536 + [size on axis y] |
2970 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
2970 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
2971 | * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32; |
2971 | * esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32; |
2972 | * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB); |
2972 | * edi = pointer to palette (2 to the power esi colors 0x00RRGGBB); |
2973 | ignored when esi > 8 |
2973 | ignored when esi > 8 |
2974 | * ebp = offset of next row data relative to previous row data |
2974 | * ebp = offset of next row data relative to previous row data |
2975 | Returned value: |
2975 | Returned value: |
2976 | * function does not return value |
2976 | * function does not return value |
2977 | Remarks: |
2977 | Remarks: |
2978 | * Coordinates of the image are coordinates of the upper left corner |
2978 | * Coordinates of the image are coordinates of the upper left corner |
2979 | of the image relative to the window. |
2979 | of the image relative to the window. |
2980 | * Format of image with 1 bit per pixel: each byte of image |
2980 | * Format of image with 1 bit per pixel: each byte of image |
2981 | (possibly excluding last bytes in rows), contains information on |
2981 | (possibly excluding last bytes in rows), contains information on |
2982 | the color of 8 pixels, MSB corresponds to first pixel. |
2982 | the color of 8 pixels, MSB corresponds to first pixel. |
2983 | * Format of image with 2 bits per pixel: each byte of image |
2983 | * Format of image with 2 bits per pixel: each byte of image |
2984 | (possibly excluding last bytes in rows), contains information on |
2984 | (possibly excluding last bytes in rows), contains information on |
2985 | the color of 4 pixels, two MSBs correspond to first pixel. |
2985 | the color of 4 pixels, two MSBs correspond to first pixel. |
2986 | * Format of image with 4 bits per pixel: each byte of image |
2986 | * Format of image with 4 bits per pixel: each byte of image |
2987 | excluding last bytes in rows (if width is odd) contains |
2987 | excluding last bytes in rows (if width is odd) contains |
2988 | information on the color of 2 pixels, high-order tetrad |
2988 | information on the color of 2 pixels, high-order tetrad |
2989 | corresponds to first pixel. |
2989 | corresponds to first pixel. |
2990 | * Format of image with 8 bits per pixel: each byte of image is |
2990 | * Format of image with 8 bits per pixel: each byte of image is |
2991 | index in the palette. |
2991 | index in the palette. |
2992 | * Format of image with 9 bits per pixel: array of one byte values; |
2992 | * Format of image with 9 bits per pixel: array of one byte values; |
2993 | each byte (8 bit) represents the intensity of gray for one pixel; |
2993 | each byte (8 bit) represents the intensity of gray for one pixel; |
2994 | this format is equal to 8bpp without palette. |
2994 | this format is equal to 8bpp without palette. |
2995 | * Format of image with 15 bits per pixel: the color of each pixel |
2995 | * Format of image with 15 bits per pixel: the color of each pixel |
2996 | is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per |
2996 | is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per |
2997 | each color. |
2997 | each color. |
2998 | * Format of image with 16 bits per pixel: the color of each pixel |
2998 | * Format of image with 16 bits per pixel: the color of each pixel |
2999 | is coded as RRRRRGGGGGGBBBBB (5+6+5). |
2999 | is coded as RRRRRGGGGGGBBBBB (5+6+5). |
3000 | * Format of image with 24 bits per pixel: the color of each pixel |
3000 | * Format of image with 24 bits per pixel: the color of each pixel |
3001 | is coded as 3 bytes - sequentially blue, green, red components. |
3001 | is coded as 3 bytes - sequentially blue, green, red components. |
3002 | * Format of image with 32 bits per pixel: similar to 24, but |
3002 | * Format of image with 32 bits per pixel: similar to 24, but |
3003 | one additional ignored byte is present. It's format is BGRX, |
3003 | one additional ignored byte is present. It's format is BGRX, |
3004 | where X is the ignored byte. |
3004 | where X is the ignored byte. |
3005 | * The call to function 7 is equivalent to call to this function |
3005 | * The call to function 7 is equivalent to call to this function |
3006 | with esi=24, ebp=0. |
3006 | with esi=24, ebp=0. |
3007 | 3007 | ||
3008 | ---------------------- Constants for registers: ---------------------- |
3008 | ---------------------- Constants for registers: ---------------------- |
3009 | eax - SF_PUT_IMAGE_EXT (65) |
3009 | eax - SF_PUT_IMAGE_EXT (65) |
3010 | ====================================================================== |
3010 | ====================================================================== |
3011 | ================== Function 66 - work with keyboard. ================= |
3011 | ================== Function 66 - work with keyboard. ================= |
3012 | ====================================================================== |
3012 | ====================================================================== |
3013 | The input mode influences results of reading keys by function 2. |
3013 | The input mode influences results of reading keys by function 2. |
3014 | When a program loads, ASCII input mode is set for it. |
3014 | When a program loads, ASCII input mode is set for it. |
3015 | 3015 | ||
3016 | -------------- Subfunction 1 - set keyboard input mode. -------------- |
3016 | -------------- Subfunction 1 - set keyboard input mode. -------------- |
3017 | Parameters: |
3017 | Parameters: |
3018 | * eax = 66 - function number |
3018 | * eax = 66 - function number |
3019 | * ebx = 1 - subfunction number |
3019 | * ebx = 1 - subfunction number |
3020 | * ecx = mode: |
3020 | * ecx = mode: |
3021 | * 0 = normal (ASCII-characters) |
3021 | * 0 = normal (ASCII-characters) |
3022 | * 1 = scancodes |
3022 | * 1 = scancodes |
3023 | Returned value: |
3023 | Returned value: |
3024 | * function does not return value |
3024 | * function does not return value |
3025 | 3025 | ||
3026 | -------------- Subfunction 2 - get keyboard input mode. -------------- |
3026 | -------------- Subfunction 2 - get keyboard input mode. -------------- |
3027 | Parameters: |
3027 | Parameters: |
3028 | * eax = 66 - function number |
3028 | * eax = 66 - function number |
3029 | * ebx = 2 - subfunction number |
3029 | * ebx = 2 - subfunction number |
3030 | Returned value: |
3030 | Returned value: |
3031 | * eax = current mode |
3031 | * eax = current mode |
3032 | 3032 | ||
3033 | ------------ Subfunction 3 - get status of control keys. ------------- |
3033 | ------------ Subfunction 3 - get status of control keys. ------------- |
3034 | Parameters: |
3034 | Parameters: |
3035 | * eax = 66 - function number |
3035 | * eax = 66 - function number |
3036 | * ebx = 3 - subfunction number |
3036 | * ebx = 3 - subfunction number |
3037 | Returned value: |
3037 | Returned value: |
3038 | * eax = bit mask: |
3038 | * eax = bit mask: |
3039 | * bit 0 (mask 1): left Shift is pressed |
3039 | * bit 0 (mask 1): left Shift is pressed |
3040 | * bit 1 (mask 2): right Shift is pressed |
3040 | * bit 1 (mask 2): right Shift is pressed |
3041 | * bit 2 (mask 4): left Ctrl is pressed |
3041 | * bit 2 (mask 4): left Ctrl is pressed |
3042 | * bit 3 (mask 8): right Ctrl is pressed |
3042 | * bit 3 (mask 8): right Ctrl is pressed |
3043 | * bit 4 (mask 0x10): left Alt is pressed |
3043 | * bit 4 (mask 0x10): left Alt is pressed |
3044 | * bit 5 (mask 0x20): right Alt is pressed |
3044 | * bit 5 (mask 0x20): right Alt is pressed |
3045 | * bit 6 (mask 0x40): CapsLock is on |
3045 | * bit 6 (mask 0x40): CapsLock is on |
3046 | * bit 7 (mask 0x80): NumLock is on |
3046 | * bit 7 (mask 0x80): NumLock is on |
3047 | * bit 8 (mask 0x100): ScrollLock is on |
3047 | * bit 8 (mask 0x100): ScrollLock is on |
3048 | * bit 9 (mask 0x200): left Win is pressed |
3048 | * bit 9 (mask 0x200): left Win is pressed |
3049 | * bit 10 (mask 0x400): right Win is pressed |
3049 | * bit 10 (mask 0x400): right Win is pressed |
3050 | * other bits are cleared |
3050 | * other bits are cleared |
3051 | 3051 | ||
3052 | -------------- Subfunction 4 - set system-wide hotkey. --------------- |
3052 | -------------- Subfunction 4 - set system-wide hotkey. --------------- |
3053 | When hotkey is pressed, the system notifies only those applications, |
3053 | When hotkey is pressed, the system notifies only those applications, |
3054 | which have installed it; the active application (which receives |
3054 | which have installed it; the active application (which receives |
3055 | all normal input) does not receive such keys. |
3055 | all normal input) does not receive such keys. |
3056 | The notification consists in sending event with the code 2. |
3056 | The notification consists in sending event with the code 2. |
3057 | Reading hotkey is the same as reading normal key - by function 2. |
3057 | Reading hotkey is the same as reading normal key - by function 2. |
3058 | Parameters: |
3058 | Parameters: |
3059 | * eax = 66 - function number |
3059 | * eax = 66 - function number |
3060 | * ebx = 4 - subfunction number |
3060 | * ebx = 4 - subfunction number |
3061 | * cl determines key scancode; |
3061 | * cl determines key scancode; |
3062 | use cl=0 to give combinations such as Ctrl+Shift |
3062 | use cl=0 to give combinations such as Ctrl+Shift |
3063 | * edx = 0xXYZ determines possible states of control keys: |
3063 | * edx = 0xXYZ determines possible states of control keys: |
3064 | * Z (low 4 bits) determines state of LShift and RShift: |
3064 | * Z (low 4 bits) determines state of LShift and RShift: |
3065 | * 0 = no key must be pressed; |
3065 | * 0 = no key must be pressed; |
3066 | * 1 = exactly one key must be pressed; |
3066 | * 1 = exactly one key must be pressed; |
3067 | * 2 = both keys must be pressed; |
3067 | * 2 = both keys must be pressed; |
3068 | * 3 = must be pressed LShift, but not RShift; |
3068 | * 3 = must be pressed LShift, but not RShift; |
3069 | * 4 = must be pressed RShift, but not LShift |
3069 | * 4 = must be pressed RShift, but not LShift |
3070 | * Y - similar for LCtrl and RCtrl; |
3070 | * Y - similar for LCtrl and RCtrl; |
3071 | * X - similar for LAlt and RAlt |
3071 | * X - similar for LAlt and RAlt |
3072 | Returned value: |
3072 | Returned value: |
3073 | * eax=0 - success |
3073 | * eax=0 - success |
3074 | * eax=1 - too mant hotkeys (maximum 256 are allowed) |
3074 | * eax=1 - too mant hotkeys (maximum 256 are allowed) |
3075 | Remarks: |
3075 | Remarks: |
3076 | * Hotkey can work either at pressing or at release. Release |
3076 | * Hotkey can work either at pressing or at release. Release |
3077 | scancode of a key is more on 128 than pressing scancode |
3077 | scancode of a key is more on 128 than pressing scancode |
3078 | (i.e. high bit is set). |
3078 | (i.e. high bit is set). |
3079 | * Several applications can set the same combination; |
3079 | * Several applications can set the same combination; |
3080 | all such applications will be informed on pressing |
3080 | all such applications will be informed on pressing |
3081 | such combination. |
3081 | such combination. |
3082 | 3082 | ||
3083 | -------------- Subfunction 5 - delete installed hotkey. -------------- |
3083 | -------------- Subfunction 5 - delete installed hotkey. -------------- |
3084 | Parameters: |
3084 | Parameters: |
3085 | * eax = 66 - function number |
3085 | * eax = 66 - function number |
3086 | * ebx = 5 - subfunction number |
3086 | * ebx = 5 - subfunction number |
3087 | * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4 |
3087 | * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4 |
3088 | Returned value: |
3088 | Returned value: |
3089 | * eax = 0 - success |
3089 | * eax = 0 - success |
3090 | * eax = 1 - there is no such hotkey |
3090 | * eax = 1 - there is no such hotkey |
3091 | Remarks: |
3091 | Remarks: |
3092 | * When a process/thread terminates, all hotkey installed by it are |
3092 | * When a process/thread terminates, all hotkey installed by it are |
3093 | deleted. |
3093 | deleted. |
3094 | * The call to this subfunction does not affect other applications. |
3094 | * The call to this subfunction does not affect other applications. |
3095 | If other application has defined the same combination, it will |
3095 | If other application has defined the same combination, it will |
3096 | still receive notices. |
3096 | still receive notices. |
3097 | 3097 | ||
3098 | --------------- Subfunction 6 - block the normal input. -------------- |
3098 | --------------- Subfunction 6 - block the normal input. -------------- |
3099 | Parameters: |
3099 | Parameters: |
3100 | * eax = 66 - function number |
3100 | * eax = 66 - function number |
3101 | * ebx = 6 - subfunction number |
3101 | * ebx = 6 - subfunction number |
3102 | Returned value: |
3102 | Returned value: |
3103 | * function does not return value |
3103 | * function does not return value |
3104 | Remarks: |
3104 | Remarks: |
3105 | * Blocking the normal keyboard input for installed hotkeys |
3105 | * Blocking the normal keyboard input for installed hotkeys |
3106 | * To emulate a mouse via the keyboard, the application MOUSEMUL |
3106 | * To emulate a mouse via the keyboard, the application MOUSEMUL |
3107 | 3107 | ||
3108 | ------------ Subfunction 7 - unlock the normal input. ---------------- |
3108 | ------------ Subfunction 7 - unlock the normal input. ---------------- |
3109 | Parameters: |
3109 | Parameters: |
3110 | * eax = 66 - function number |
3110 | * eax = 66 - function number |
3111 | * ebx = 7 - subfunction number |
3111 | * ebx = 7 - subfunction number |
3112 | Returned value: |
3112 | Returned value: |
3113 | * function does not return value |
3113 | * function does not return value |
3114 | Remarks: |
3114 | Remarks: |
3115 | * Unlocking the results of the f. 66.6 |
3115 | * Unlocking the results of the f. 66.6 |
3116 | * To emulate a mouse via the keyboard, the application MOUSEMUL |
3116 | * To emulate a mouse via the keyboard, the application MOUSEMUL |
3117 | 3117 | ||
3118 | ---------------------- Constants for registers: ---------------------- |
3118 | ---------------------- Constants for registers: ---------------------- |
3119 | eax - SF_KEYBOARD (66) |
3119 | eax - SF_KEYBOARD (66) |
3120 | ebx - SSF_SET_INPUT_MODE (1), SSF_GET_INPUT_MODE (2), |
3120 | ebx - SSF_SET_INPUT_MODE (1), SSF_GET_INPUT_MODE (2), |
3121 | SSF_GET_CONTROL_KEYS (3), SSF_SET_SYS_HOTKEY (4), |
3121 | SSF_GET_CONTROL_KEYS (3), SSF_SET_SYS_HOTKEY (4), |
3122 | SSF_DEL_SYS_HOTKEY (5), SSF_LOCK_INPUT (6), SSF_UNLOCK_INPUT (7) |
3122 | SSF_DEL_SYS_HOTKEY (5), SSF_LOCK_INPUT (6), SSF_UNLOCK_INPUT (7) |
3123 | ====================================================================== |
3123 | ====================================================================== |
3124 | ========= Function 67 - change position/sizes of the window. ========= |
3124 | ========= Function 67 - change position/sizes of the window. ========= |
3125 | ====================================================================== |
3125 | ====================================================================== |
3126 | Parameters: |
3126 | Parameters: |
3127 | * eax = 67 - function number |
3127 | * eax = 67 - function number |
3128 | * ebx = new x-coordinate of the window |
3128 | * ebx = new x-coordinate of the window |
3129 | * ecx = new y-coordinate of the window |
3129 | * ecx = new y-coordinate of the window |
3130 | * edx = new x-size of the window |
3130 | * edx = new x-size of the window |
3131 | * esi = new y-size of the window |
3131 | * esi = new y-size of the window |
3132 | Returned value: |
3132 | Returned value: |
3133 | * function does not return value |
3133 | * function does not return value |
3134 | Remarks: |
3134 | Remarks: |
3135 | * The value -1 for a parameter means "do not change"; e.g. to move |
3135 | * The value -1 for a parameter means "do not change"; e.g. to move |
3136 | the window without resizing it is possible to specify edx=esi=-1. |
3136 | the window without resizing it is possible to specify edx=esi=-1. |
3137 | * Previously the window must be defined by function 0. |
3137 | * Previously the window must be defined by function 0. |
3138 | It sets initial coordinates and sizes of the window. |
3138 | It sets initial coordinates and sizes of the window. |
3139 | * Sizes of the window are understood in sense of function 0, |
3139 | * Sizes of the window are understood in sense of function 0, |
3140 | that is one pixel less than real sizes. |
3140 | that is one pixel less than real sizes. |
3141 | * The function call for maximized windows is simply ignored. |
3141 | * The function call for maximized windows is simply ignored. |
3142 | * For windows of appropriate styles position and/or sizes can be |
3142 | * For windows of appropriate styles position and/or sizes can be |
3143 | changed by user; current position and sizes can be obtained by |
3143 | changed by user; current position and sizes can be obtained by |
3144 | call to function 9. |
3144 | call to function 9. |
3145 | * The function sends to the window redraw event (with the code 1). |
3145 | * The function sends to the window redraw event (with the code 1). |
3146 | 3146 | ||
3147 | ---------------------- Constants for registers: ---------------------- |
3147 | ---------------------- Constants for registers: ---------------------- |
3148 | eax - SF_CHANGE_WINDOW (67) |
3148 | eax - SF_CHANGE_WINDOW (67) |
3149 | ====================================================================== |
3149 | ====================================================================== |
3150 | ====== Function 68, subfunction 0 - get the task switch counter. ===== |
3150 | ====== Function 68, subfunction 0 - get the task switch counter. ===== |
3151 | ====================================================================== |
3151 | ====================================================================== |
3152 | Parameters: |
3152 | Parameters: |
3153 | * eax = 68 - function number |
3153 | * eax = 68 - function number |
3154 | * ebx = 0 - subfunction number |
3154 | * ebx = 0 - subfunction number |
3155 | Returned value: |
3155 | Returned value: |
3156 | * eax = number of task switches from the system booting |
3156 | * eax = number of task switches from the system booting |
3157 | (modulo 2^32) |
3157 | (modulo 2^32) |
3158 | 3158 | ||
3159 | ---------------------- Constants for registers: ---------------------- |
3159 | ---------------------- Constants for registers: ---------------------- |
3160 | eax - SF_SYS_MISC (68) |
3160 | eax - SF_SYS_MISC (68) |
3161 | ebx - SSF_GET_TASK_SWITCH_COUNT (0) |
3161 | ebx - SSF_GET_TASK_SWITCH_COUNT (0) |
3162 | ====================================================================== |
3162 | ====================================================================== |
3163 | ======= Function 68, subfunction 1 - switch to the next thread. ====== |
3163 | ======= Function 68, subfunction 1 - switch to the next thread. ====== |
3164 | ====================================================================== |
3164 | ====================================================================== |
3165 | The function completes the current time slice allocated to the |
3165 | The function completes the current time slice allocated to the |
3166 | thread and switches to the next. (Which thread in which process |
3166 | thread and switches to the next. (Which thread in which process |
3167 | will be next, is unpredictable). Later, when execution queue |
3167 | will be next, is unpredictable). Later, when execution queue |
3168 | will reach the current thread, execution will be continued. |
3168 | will reach the current thread, execution will be continued. |
3169 | Parameters: |
3169 | Parameters: |
3170 | * eax = 68 - function number |
3170 | * eax = 68 - function number |
3171 | * ebx = 1 - subfunction number |
3171 | * ebx = 1 - subfunction number |
3172 | Returned value: |
3172 | Returned value: |
3173 | * function does not return value |
3173 | * function does not return value |
3174 | 3174 | ||
3175 | ---------------------- Constants for registers: ---------------------- |
3175 | ---------------------- Constants for registers: ---------------------- |
3176 | eax - SF_SYS_MISC (68) |
3176 | eax - SF_SYS_MISC (68) |
3177 | ebx - SSF_SWITCH_TASK (1) |
3177 | ebx - SSF_SWITCH_TASK (1) |
3178 | ====================================================================== |
3178 | ====================================================================== |
3179 | ============= Function 68, subfunction 2 - cache + rdpmc. ============ |
3179 | ============= Function 68, subfunction 2 - cache + rdpmc. ============ |
3180 | ====================================================================== |
3180 | ====================================================================== |
3181 | Parameters: |
3181 | Parameters: |
3182 | * eax = 68 - function number |
3182 | * eax = 68 - function number |
3183 | * ebx = 2 - subfunction number |
3183 | * ebx = 2 - subfunction number |
3184 | * ecx = required action: |
3184 | * ecx = required action: |
3185 | * ecx = 0 - enable instruction 'rdpmc' |
3185 | * ecx = 0 - enable instruction 'rdpmc' |
3186 | (ReaD Performance-Monitoring Counters) for applications |
3186 | (ReaD Performance-Monitoring Counters) for applications |
3187 | * ecx = 1 - find out whether cache is disabled/enabled |
3187 | * ecx = 1 - find out whether cache is disabled/enabled |
3188 | * ecx = 2 - enable cache |
3188 | * ecx = 2 - enable cache |
3189 | * ecx = 3 - disable cache |
3189 | * ecx = 3 - disable cache |
3190 | Returned value: |
3190 | Returned value: |
3191 | * for ecx=0: |
3191 | * for ecx=0: |
3192 | * eax = the value of cr4 |
3192 | * eax = the value of cr4 |
3193 | * for ecx=1: |
3193 | * for ecx=1: |
3194 | * eax = (cr0 and 0x60000000): |
3194 | * eax = (cr0 and 0x60000000): |
3195 | * eax = 0 - cache is on |
3195 | * eax = 0 - cache is on |
3196 | * eax <> 0 - cache is off |
3196 | * eax <> 0 - cache is off |
3197 | * for ecx=2 and ecx=3: |
3197 | * for ecx=2 and ecx=3: |
3198 | * function does not return value |
3198 | * function does not return value |
3199 | 3199 | ||
3200 | ---------------------- Constants for registers: ---------------------- |
3200 | ---------------------- Constants for registers: ---------------------- |
3201 | eax - SF_SYS_MISC (68) |
3201 | eax - SF_SYS_MISC (68) |
3202 | ebx - SSF_PERFORMANCE (2) |
3202 | ebx - SSF_PERFORMANCE (2) |
3203 | ecx - SSSF_ALLOW_RDPMC (0), SSSF_CACHE_STATUS (1), |
3203 | ecx - SSSF_ALLOW_RDPMC (0), SSSF_CACHE_STATUS (1), |
3204 | SSSF_CACHE_ON (2), SSSF_CACHE_OFF (3) |
3204 | SSSF_CACHE_ON (2), SSSF_CACHE_OFF (3) |
3205 | ====================================================================== |
3205 | ====================================================================== |
3206 | =========== Function 68, subfunction 3 - read MSR-register. ========== |
3206 | =========== Function 68, subfunction 3 - read MSR-register. ========== |
3207 | ====================================================================== |
3207 | ====================================================================== |
3208 | MSR = Model Specific Register; the complete list of MSR-registers |
3208 | MSR = Model Specific Register; the complete list of MSR-registers |
3209 | of a processor is included to the documentation on it (for example, |
3209 | of a processor is included to the documentation on it (for example, |
3210 | IA-32 Intel Architecture Software Developer's Manual, |
3210 | IA-32 Intel Architecture Software Developer's Manual, |
3211 | Volume 3, Appendix B); each processor family has its own subset |
3211 | Volume 3, Appendix B); each processor family has its own subset |
3212 | of the MSR-registers. |
3212 | of the MSR-registers. |
3213 | Parameters: |
3213 | Parameters: |
3214 | * eax = 68 - function number |
3214 | * eax = 68 - function number |
3215 | * ebx = 3 - subfunction number |
3215 | * ebx = 3 - subfunction number |
3216 | * ecx is ignored |
3216 | * ecx is ignored |
3217 | * edx = MSR address |
3217 | * edx = MSR address |
3218 | Returned value: |
3218 | Returned value: |
3219 | * ebx:eax = high:low dword of the result |
3219 | * ebx:eax = high:low dword of the result |
3220 | Remarks: |
3220 | Remarks: |
3221 | * If ecx contains nonexistent or not implemented for this processor |
3221 | * If ecx contains nonexistent or not implemented for this processor |
3222 | MSR, processor will generate an exception in the kernel, which |
3222 | MSR, processor will generate an exception in the kernel, which |
3223 | will kill the thread. |
3223 | will kill the thread. |
3224 | * Previously it is necessary to check, whether MSRs are supported |
3224 | * Previously it is necessary to check, whether MSRs are supported |
3225 | as a whole, with the instruction 'cpuid'. Otherwise processor |
3225 | as a whole, with the instruction 'cpuid'. Otherwise processor |
3226 | will generate other exception in the kernel, which will anyway |
3226 | will generate other exception in the kernel, which will anyway |
3227 | kill the thread. |
3227 | kill the thread. |
3228 | 3228 | ||
3229 | ---------------------- Constants for registers: ---------------------- |
3229 | ---------------------- Constants for registers: ---------------------- |
3230 | eax - SF_SYS_MISC (68) |
3230 | eax - SF_SYS_MISC (68) |
3231 | ebx - SSF_READ_MSR (3) |
3231 | ebx - SSF_READ_MSR (3) |
3232 | ====================================================================== |
3232 | ====================================================================== |
3233 | ========= Function 68, subfunction 4 - write to MSR-register. ======== |
3233 | ========= Function 68, subfunction 4 - write to MSR-register. ======== |
3234 | ====================================================================== |
3234 | ====================================================================== |
3235 | MSR = Model Specific Register; the complete list of MSR-registers |
3235 | MSR = Model Specific Register; the complete list of MSR-registers |
3236 | of a processor is included to the documentation on it (for example, |
3236 | of a processor is included to the documentation on it (for example, |
3237 | IA-32 Intel Architecture Software Developer's Manual, |
3237 | IA-32 Intel Architecture Software Developer's Manual, |
3238 | Volume 3, Appendix B); each processor family has its own subset |
3238 | Volume 3, Appendix B); each processor family has its own subset |
3239 | of the MSR-registers. |
3239 | of the MSR-registers. |
3240 | Parameters: |
3240 | Parameters: |
3241 | * eax = 68 - function number |
3241 | * eax = 68 - function number |
3242 | * ebx = 4 - subfunction number |
3242 | * ebx = 4 - subfunction number |
3243 | * ecx is ignored |
3243 | * ecx is ignored |
3244 | * edx = MSR address |
3244 | * edx = MSR address |
3245 | * esi:edi = high:low dword |
3245 | * esi:edi = high:low dword |
3246 | Returned value: |
3246 | Returned value: |
3247 | * function does not return value |
3247 | * function does not return value |
3248 | Remarks: |
3248 | Remarks: |
3249 | * If ecx contains nonexistent or not implemented for this processor |
3249 | * If ecx contains nonexistent or not implemented for this processor |
3250 | MSR, processor will generate an exception in the kernel, which |
3250 | MSR, processor will generate an exception in the kernel, which |
3251 | will kill the thread. |
3251 | will kill the thread. |
3252 | * Previously it is necessary to check, whether MSRs are supported |
3252 | * Previously it is necessary to check, whether MSRs are supported |
3253 | as a whole, with the instruction 'cpuid'. Otherwise processor |
3253 | as a whole, with the instruction 'cpuid'. Otherwise processor |
3254 | will generate other exception in the kernel, which will anyway |
3254 | will generate other exception in the kernel, which will anyway |
3255 | kill the thread. |
3255 | kill the thread. |
3256 | 3256 | ||
3257 | ---------------------- Constants for registers: ---------------------- |
3257 | ---------------------- Constants for registers: ---------------------- |
3258 | eax - SF_SYS_MISC (68) |
3258 | eax - SF_SYS_MISC (68) |
3259 | ebx - SSF_WRITE_MSR (4) |
3259 | ebx - SSF_WRITE_MSR (4) |
3260 | ====================================================================== |
3260 | ====================================================================== |
3261 | === Function 68, subfunction 11 - manually initialize process heap === |
3261 | === Function 68, subfunction 11 - manually initialize process heap === |
3262 | ====================================================================== |
3262 | ====================================================================== |
3263 | Parameters: |
3263 | Parameters: |
3264 | * eax = 68 - function number |
3264 | * eax = 68 - function number |
3265 | * ebx = 11 - subfunction number |
3265 | * ebx = 11 - subfunction number |
3266 | Returned value: |
3266 | Returned value: |
3267 | * eax = 0 - failed |
3267 | * eax = 0 - failed |
3268 | * otherwise size of created heap |
3268 | * otherwise size of created heap |
3269 | Remarks: |
3269 | Remarks: |
3270 | * The function call initializes heap for subfunctions 12, 13 and 20. |
3270 | * The function call initializes heap for subfunctions 12, 13 and 20. |
3271 | * If the process heap is already created, this function will return |
3271 | * If the process heap is already created, this function will return |
3272 | the size of the existing heap. |
3272 | the size of the existing heap. |
3273 | Heap size is equal to total amount of free application memory. |
3273 | Heap size is equal to total amount of free application memory. |
3274 | * After creation of the heap calls to function 64 will be ignored. |
3274 | * After creation of the heap calls to function 64 will be ignored. |
3275 | 3275 | ||
3276 | ---------------------- Constants for registers: ---------------------- |
3276 | ---------------------- Constants for registers: ---------------------- |
3277 | eax - SF_SYS_MISC (68) |
3277 | eax - SF_SYS_MISC (68) |
3278 | ebx - SSF_HEAP_INIT (11) |
3278 | ebx - SSF_HEAP_INIT (11) |
3279 | ====================================================================== |
3279 | ====================================================================== |
3280 | ======== Function 68, subfunction 12 - allocate memory block. ======== |
3280 | ======== Function 68, subfunction 12 - allocate memory block. ======== |
3281 | ====================================================================== |
3281 | ====================================================================== |
3282 | Parameters: |
3282 | Parameters: |
3283 | * eax = 68 - function number |
3283 | * eax = 68 - function number |
3284 | * ebx = 12 - subfunction number |
3284 | * ebx = 12 - subfunction number |
3285 | * ecx = required size in bytes |
3285 | * ecx = required size in bytes |
3286 | Returned value: |
3286 | Returned value: |
3287 | * eax = pointer to the allocated block |
3287 | * eax = pointer to the allocated block |
3288 | Remarks: |
3288 | Remarks: |
3289 | * The function allocates an integer number of pages (4 Kb) in such |
3289 | * The function allocates an integer number of pages (4 Kb) in such |
3290 | way that the real size of allocated block is more than or equal to |
3290 | way that the real size of allocated block is more than or equal to |
3291 | requested size. |
3291 | requested size. |
3292 | 3292 | ||
3293 | ---------------------- Constants for registers: ---------------------- |
3293 | ---------------------- Constants for registers: ---------------------- |
3294 | eax - SF_SYS_MISC (68) |
3294 | eax - SF_SYS_MISC (68) |
3295 | ebx - SSF_MEM_ALLOC (12) |
3295 | ebx - SSF_MEM_ALLOC (12) |
3296 | ====================================================================== |
3296 | ====================================================================== |
3297 | ========== Function 68, subfunction 13 - free memory block. ========== |
3297 | ========== Function 68, subfunction 13 - free memory block. ========== |
3298 | ====================================================================== |
3298 | ====================================================================== |
3299 | Parameters: |
3299 | Parameters: |
3300 | * eax = 68 - function number |
3300 | * eax = 68 - function number |
3301 | * ebx = 13 - subfunction number |
3301 | * ebx = 13 - subfunction number |
3302 | * ecx = pointer to the memory block |
3302 | * ecx = pointer to the memory block |
3303 | Returned value: |
3303 | Returned value: |
3304 | * eax = 1 - success |
3304 | * eax = 1 - success |
3305 | * eax = 0 - failed |
3305 | * eax = 0 - failed |
3306 | Remarks: |
3306 | Remarks: |
3307 | * The memory block must have been allocated by subfunction 12 |
3307 | * The memory block must have been allocated by subfunction 12 |
3308 | or subfunction 20. |
3308 | or subfunction 20. |
3309 | 3309 | ||
3310 | ---------------------- Constants for registers: ---------------------- |
3310 | ---------------------- Constants for registers: ---------------------- |
3311 | eax - SF_SYS_MISC (68) |
3311 | eax - SF_SYS_MISC (68) |
3312 | ebx - SSF_MEM_FREE (13) |
3312 | ebx - SSF_MEM_FREE (13) |
3313 | ====================================================================== |
3313 | ====================================================================== |
3314 | ===================== Function 68, subfunction 14 ==================== |
3314 | ===================== Function 68, subfunction 14 ==================== |
3315 | ============ Wait for signal from another program/driver. ============ |
3315 | ============ Wait for signal from another program/driver. ============ |
3316 | ====================================================================== |
3316 | ====================================================================== |
3317 | Parameters: |
3317 | Parameters: |
3318 | * eax = 68 - function number |
3318 | * eax = 68 - function number |
3319 | * ebx = 14 - subfunction number |
3319 | * ebx = 14 - subfunction number |
3320 | * ecx = pointer to the buffer for information (24 bytes) |
3320 | * ecx = pointer to the buffer for information (24 bytes) |
3321 | Returned value: |
3321 | Returned value: |
3322 | * buffer pointed to by ecx contains the following information: |
3322 | * buffer pointed to by ecx contains the following information: |
3323 | * +0: dword: identifier for following data of signal |
3323 | * +0: dword: identifier for following data of signal |
3324 | * +4: dword: data of signal (20 bytes), format of which is defined |
3324 | * +4: dword: data of signal (20 bytes), format of which is defined |
3325 | by the first dword |
3325 | by the first dword |
3326 | 3326 | ||
3327 | ---------------------- Constants for registers: ---------------------- |
3327 | ---------------------- Constants for registers: ---------------------- |
3328 | eax - SF_SYS_MISC (68) |
3328 | eax - SF_SYS_MISC (68) |
3329 | ebx - SSF_WAIT_SIGNAL (14) |
3329 | ebx - SSF_WAIT_SIGNAL (14) |
3330 | ====================================================================== |
3330 | ====================================================================== |
3331 | ============= Function 68, subfunction 16 - load driver. ============= |
3331 | ============= Function 68, subfunction 16 - load driver. ============= |
3332 | ====================================================================== |
3332 | ====================================================================== |
3333 | Parameters: |
3333 | Parameters: |
3334 | * eax = 68 - function number |
3334 | * eax = 68 - function number |
3335 | * ebx = 16 - subfunction number |
3335 | * ebx = 16 - subfunction number |
3336 | * ecx = pointer to ASCIIZ-string with driver name |
3336 | * ecx = pointer to ASCIIZ-string with driver name |
3337 | Returned value: |
3337 | Returned value: |
3338 | * eax = 0 - failed |
3338 | * eax = 0 - failed |
3339 | * otherwise eax = driver handle |
3339 | * otherwise eax = driver handle |
3340 | Remarks: |
3340 | Remarks: |
3341 | * If the driver was not loaded yet, it is loaded; |
3341 | * If the driver was not loaded yet, it is loaded; |
3342 | if the driver was loaded yet, nothing happens. |
3342 | if the driver was loaded yet, nothing happens. |
3343 | * Driver name is case-sensitive. |
3343 | * Driver name is case-sensitive. |
3344 | Maximum length of the name is 16 characters, including |
3344 | Maximum length of the name is 16 characters, including |
3345 | terminating null character, the rest is ignored. |
3345 | terminating null character, the rest is ignored. |
3346 | * Driver ABC is loaded from file /rd/1/drivers/ABC.obj. |
3346 | * Driver ABC is loaded from file /rd/1/drivers/ABC.obj. |
3347 | 3347 | ||
3348 | ---------------------- Constants for registers: ---------------------- |
3348 | ---------------------- Constants for registers: ---------------------- |
3349 | eax - SF_SYS_MISC (68) |
3349 | eax - SF_SYS_MISC (68) |
3350 | ebx - SSF_LOAD_DRIVER (16) |
3350 | ebx - SSF_LOAD_DRIVER (16) |
3351 | ====================================================================== |
3351 | ====================================================================== |
3352 | ============ Function 68, subfunction 17 - driver control. =========== |
3352 | ============ Function 68, subfunction 17 - driver control. =========== |
3353 | ====================================================================== |
3353 | ====================================================================== |
3354 | Parameters: |
3354 | Parameters: |
3355 | * eax = 68 - function number |
3355 | * eax = 68 - function number |
3356 | * ebx = 17 - subfunction number |
3356 | * ebx = 17 - subfunction number |
3357 | * ecx = pointer to the control structure: |
3357 | * ecx = pointer to the control structure: |
3358 | * +0: dword: handle of driver |
3358 | * +0: dword: handle of driver |
3359 | * +4: dword: code of driver function |
3359 | * +4: dword: code of driver function |
3360 | * +8: dword: pointer to input data |
3360 | * +8: dword: pointer to input data |
3361 | * +12 = +0xC: dword: size of input data |
3361 | * +12 = +0xC: dword: size of input data |
3362 | * +16 = +0x10: dword: pointer to output data |
3362 | * +16 = +0x10: dword: pointer to output data |
3363 | * +20 = +0x14: dword: size of output data |
3363 | * +20 = +0x14: dword: size of output data |
3364 | Returned value: |
3364 | Returned value: |
3365 | * eax = determined by driver |
3365 | * eax = determined by driver |
3366 | Remarks: |
3366 | Remarks: |
3367 | * Function codes and the structure of input/output data |
3367 | * Function codes and the structure of input/output data |
3368 | are defined by driver. |
3368 | are defined by driver. |
3369 | * Previously one must obtain driver handle by subfunction 16. |
3369 | * Previously one must obtain driver handle by subfunction 16. |
3370 | 3370 | ||
3371 | ---------------------- Constants for registers: ---------------------- |
3371 | ---------------------- Constants for registers: ---------------------- |
3372 | eax - SF_SYS_MISC (68) |
3372 | eax - SF_SYS_MISC (68) |
3373 | ebx - SSF_CONTROL_DRIVER (17) |
3373 | ebx - SSF_CONTROL_DRIVER (17) |
3374 | ====================================================================== |
3374 | ====================================================================== |
3375 | == Function 68, subfunction 18 - load DLL, specifying the encoding. == |
3375 | == Function 68, subfunction 18 - load DLL, specifying the encoding. == |
3376 | ====================================================================== |
3376 | ====================================================================== |
3377 | Parameters: |
3377 | Parameters: |
3378 | * eax = 68 - function number |
3378 | * eax = 68 - function number |
3379 | * ebx = 18 - subfunction number |
3379 | * ebx = 18 - subfunction number |
3380 | * ecx = pointer to the string with path to DLL |
3380 | * ecx = pointer to the string with path to DLL |
3381 | * edx = string encoding, details can be found in function 80 description. |
3381 | * edx = string encoding, details can be found in function 80 description. |
3382 | Returned value: |
3382 | Returned value: |
3383 | * eax = 0 - failed |
3383 | * eax = 0 - failed |
3384 | * otherwise eax = pointer to DLL export table |
3384 | * otherwise eax = pointer to DLL export table |
3385 | Remarks: |
3385 | Remarks: |
3386 | * Export table is an array of structures of 2 dword's, terminated |
3386 | * Export table is an array of structures of 2 dword's, terminated |
3387 | by zero. The first dword in structure points to function name, |
3387 | by zero. The first dword in structure points to function name, |
3388 | the second dword contains address of function. |
3388 | the second dword contains address of function. |
3389 | 3389 | ||
3390 | ====================================================================== |
3390 | ====================================================================== |
3391 | =============== Function 68, subfunction 19 - load DLL. ============== |
3391 | =============== Function 68, subfunction 19 - load DLL. ============== |
3392 | ====================================================================== |
3392 | ====================================================================== |
3393 | Parameters: |
3393 | Parameters: |
3394 | * eax = 68 - function number |
3394 | * eax = 68 - function number |
3395 | * ebx = 19 - subfunction number |
3395 | * ebx = 19 - subfunction number |
3396 | * ecx = pointer to the string with path to DLL, |
3396 | * ecx = pointer to the string with path to DLL, |
3397 | rules of path forming can be found in function 70 description. |
3397 | rules of path forming can be found in function 70 description. |
3398 | Returned value: |
3398 | Returned value: |
3399 | * eax = 0 - failed |
3399 | * eax = 0 - failed |
3400 | * otherwise eax = pointer to DLL export table |
3400 | * otherwise eax = pointer to DLL export table |
3401 | 3401 | ||
3402 | ---------------------- Constants for registers: ---------------------- |
3402 | ---------------------- Constants for registers: ---------------------- |
3403 | eax - SF_SYS_MISC (68) |
3403 | eax - SF_SYS_MISC (68) |
3404 | ebx - SSF_LOAD_DLL (19) |
3404 | ebx - SSF_LOAD_DLL (19) |
3405 | ====================================================================== |
3405 | ====================================================================== |
3406 | ======= Function 68, subfunction 20 - reallocate memory block. ======= |
3406 | ======= Function 68, subfunction 20 - reallocate memory block. ======= |
3407 | ====================================================================== |
3407 | ====================================================================== |
3408 | Parameters: |
3408 | Parameters: |
3409 | * eax = 68 - function number |
3409 | * eax = 68 - function number |
3410 | * ebx = 20 - subfunction number |
3410 | * ebx = 20 - subfunction number |
3411 | * ecx = new size in bytes |
3411 | * ecx = new size in bytes |
3412 | * edx = pointer to already allocated block |
3412 | * edx = pointer to already allocated block |
3413 | Returned value: |
3413 | Returned value: |
3414 | * eax = pointer to the reallocated block, 0 = error |
3414 | * eax = pointer to the reallocated block, 0 = error |
3415 | Remarks: |
3415 | Remarks: |
3416 | * The function allocates an integer number of pages (4 Kb) in such |
3416 | * The function allocates an integer number of pages (4 Kb) in such |
3417 | way that the real size of allocated block is more than or equal to |
3417 | way that the real size of allocated block is more than or equal to |
3418 | requested size. |
3418 | requested size. |
3419 | * If edx=0, the function call is equivalent to memory allocation |
3419 | * If edx=0, the function call is equivalent to memory allocation |
3420 | with subfunction 12. Otherwise the block at edx |
3420 | with subfunction 12. Otherwise the block at edx |
3421 | must be allocated earlier with subfunction 12 or this subfunction. |
3421 | must be allocated earlier with subfunction 12 or this subfunction. |
3422 | * If ecx=0, the function frees memory block at edx and returns 0. |
3422 | * If ecx=0, the function frees memory block at edx and returns 0. |
3423 | * The contents of the block are unchanged up to the shorter of |
3423 | * The contents of the block are unchanged up to the shorter of |
3424 | the new and old sizes. |
3424 | the new and old sizes. |
3425 | 3425 | ||
3426 | ---------------------- Constants for registers: ---------------------- |
3426 | ---------------------- Constants for registers: ---------------------- |
3427 | eax - SF_SYS_MISC (68) |
3427 | eax - SF_SYS_MISC (68) |
3428 | ebx - SSF_MEM_REALLOC (20) |
3428 | ebx - SSF_MEM_REALLOC (20) |
3429 | ====================================================================== |
3429 | ====================================================================== |
3430 | =========== Function 68, subfunction 21 - load driver PE. ============ |
3430 | =========== Function 68, subfunction 21 - load driver PE. ============ |
3431 | ====================================================================== |
3431 | ====================================================================== |
3432 | Parameters: |
3432 | Parameters: |
3433 | * eax = 68 - function number |
3433 | * eax = 68 - function number |
3434 | * ebx = 21 - subfunction number |
3434 | * ebx = 21 - subfunction number |
3435 | * ecx = pointer to ASCIIZ-string with driver name |
3435 | * ecx = pointer to ASCIIZ-string with driver name |
3436 | * edx = pointer to command line |
3436 | * edx = pointer to command line |
3437 | Returned value: |
3437 | Returned value: |
3438 | * eax = 0 - failed |
3438 | * eax = 0 - failed |
3439 | * otherwise eax = driver handle |
3439 | * otherwise eax = driver handle |
3440 | Remarks: |
3440 | Remarks: |
3441 | * If the driver was not loaded yet, it is loaded; |
3441 | * If the driver was not loaded yet, it is loaded; |
3442 | if the driver was loaded yet, nothing happens. |
3442 | if the driver was loaded yet, nothing happens. |
3443 | 3443 | ||
3444 | ---------------------- Constants for registers: ---------------------- |
3444 | ---------------------- Constants for registers: ---------------------- |
3445 | eax - SF_SYS_MISC (68) |
3445 | eax - SF_SYS_MISC (68) |
3446 | ebx - SSF_LOAD_DRIVER_PE (21) |
3446 | ebx - SSF_LOAD_DRIVER_PE (21) |
3447 | ====================================================================== |
3447 | ====================================================================== |
3448 | ======== Function 68, subfunction 22 - open named memory area. ======= |
3448 | ======== Function 68, subfunction 22 - open named memory area. ======= |
3449 | ====================================================================== |
3449 | ====================================================================== |
3450 | Parameters: |
3450 | Parameters: |
3451 | * eax = 68 - function number |
3451 | * eax = 68 - function number |
3452 | * ebx = 22 - subfunction number |
3452 | * ebx = 22 - subfunction number |
3453 | * ecx = area name. Maximum of 31 characters with terminating zero |
3453 | * ecx = area name. Maximum of 31 characters with terminating zero |
3454 | * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS |
3454 | * edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS |
3455 | * esi = flags for open and access: |
3455 | * esi = flags for open and access: |
3456 | * SHM_OPEN = 0x00 - open existing memory area. If an area |
3456 | * SHM_OPEN = 0x00 - open existing memory area. If an area |
3457 | with such name does not exist, the function |
3457 | with such name does not exist, the function |
3458 | will return error code 5. |
3458 | will return error code 5. |
3459 | * SHM_OPEN_ALWAYS = 0x04 - open existing or create new |
3459 | * SHM_OPEN_ALWAYS = 0x04 - open existing or create new |
3460 | memory area. |
3460 | memory area. |
3461 | * SHM_CREATE = 0x08 - create new memory area. If an area |
3461 | * SHM_CREATE = 0x08 - create new memory area. If an area |
3462 | with such name already exists, the function |
3462 | with such name already exists, the function |
3463 | will return error code 10. |
3463 | will return error code 10. |
3464 | * SHM_READ = 0x00 - only read access |
3464 | * SHM_READ = 0x00 - only read access |
3465 | * SHM_WRITE = 0x01 - read and write access |
3465 | * SHM_WRITE = 0x01 - read and write access |
3466 | Returned value: |
3466 | Returned value: |
3467 | * eax = pointer to memory area, 0 if error has occured |
3467 | * eax = pointer to memory area, 0 if error has occured |
3468 | * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS): |
3468 | * if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS): |
3469 | edx = 0 - success, otherwise - error code |
3469 | edx = 0 - success, otherwise - error code |
3470 | * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS): |
3470 | * if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS): |
3471 | edx = error code (if eax=0) or area size in bytes |
3471 | edx = error code (if eax=0) or area size in bytes |
3472 | Error codes: |
3472 | Error codes: |
3473 | * E_NOTFOUND = 5 |
3473 | * E_NOTFOUND = 5 |
3474 | * E_ACCESS = 10 |
3474 | * E_ACCESS = 10 |
3475 | * E_NOMEM = 30 |
3475 | * E_NOMEM = 30 |
3476 | * E_PARAM = 33 |
3476 | * E_PARAM = 33 |
3477 | Remarks: |
3477 | Remarks: |
3478 | * If a new area is created, access flags set maximal rights |
3478 | * If a new area is created, access flags set maximal rights |
3479 | for other processes. An attempt from other process to open |
3479 | for other processes. An attempt from other process to open |
3480 | with denied rights will fail with error code E_ACCESS. |
3480 | with denied rights will fail with error code E_ACCESS. |
3481 | * The process which has created an area always has write access. |
3481 | * The process which has created an area always has write access. |
3482 | 3482 | ||
3483 | ---------------------- Constants for registers: ---------------------- |
3483 | ---------------------- Constants for registers: ---------------------- |
3484 | eax - SF_SYS_MISC (68) |
3484 | eax - SF_SYS_MISC (68) |
3485 | ebx - SSF_MEM_OPEN (22) |
3485 | ebx - SSF_MEM_OPEN (22) |
3486 | ====================================================================== |
3486 | ====================================================================== |
3487 | ======= Function 68, subfunction 23 - close named memory area. ======= |
3487 | ======= Function 68, subfunction 23 - close named memory area. ======= |
3488 | ====================================================================== |
3488 | ====================================================================== |
3489 | Parameters: |
3489 | Parameters: |
3490 | * eax = 68 - function number |
3490 | * eax = 68 - function number |
3491 | * ebx = 23 - subfunction number |
3491 | * ebx = 23 - subfunction number |
3492 | * ecx = area name. Maximum of 31 characters with terminating zero |
3492 | * ecx = area name. Maximum of 31 characters with terminating zero |
3493 | Returned value: |
3493 | Returned value: |
3494 | * eax destroyed |
3494 | * eax destroyed |
3495 | Remarks: |
3495 | Remarks: |
3496 | * A memory area is physically freed (with deleting all data and |
3496 | * A memory area is physically freed (with deleting all data and |
3497 | freeing physical memory), when all threads which have opened |
3497 | freeing physical memory), when all threads which have opened |
3498 | this area will close it. |
3498 | this area will close it. |
3499 | * When thread is terminating, all opened by it areas are closed. |
3499 | * When thread is terminating, all opened by it areas are closed. |
3500 | 3500 | ||
3501 | ---------------------- Constants for registers: ---------------------- |
3501 | ---------------------- Constants for registers: ---------------------- |
3502 | eax - SF_SYS_MISC (68) |
3502 | eax - SF_SYS_MISC (68) |
3503 | ebx - SSF_MEM_CLOSE (23) |
3503 | ebx - SSF_MEM_CLOSE (23) |
3504 | ====================================================================== |
3504 | ====================================================================== |
3505 | ======== Function 68, subfunction 24 - set exception handler. ======== |
3505 | ======== Function 68, subfunction 24 - set exception handler. ======== |
3506 | ====================================================================== |
3506 | ====================================================================== |
3507 | Parameters: |
3507 | Parameters: |
3508 | * eax = 68 - function number |
3508 | * eax = 68 - function number |
3509 | * ebx = 24 - subfunction number |
3509 | * ebx = 24 - subfunction number |
3510 | * ecx = address of the new exception handler |
3510 | * ecx = address of the new exception handler |
3511 | * edx = the mask of handled exceptions |
3511 | * edx = the mask of handled exceptions |
3512 | Returned value: |
3512 | Returned value: |
3513 | * eax = address of the old exception handler (0, if it was not set) |
3513 | * eax = address of the old exception handler (0, if it was not set) |
3514 | * ebx = the old mask of handled exceptions |
3514 | * ebx = the old mask of handled exceptions |
3515 | Remarks: |
3515 | Remarks: |
3516 | * Bit number in mask of exceptions corresponds to exception number |
3516 | * Bit number in mask of exceptions corresponds to exception number |
3517 | in CPU-specification (Intel-PC). For example, FPU exceptions have |
3517 | in CPU-specification (Intel-PC). For example, FPU exceptions have |
3518 | number 16 (#MF), and SSE exceptions - 19 (#XF). |
3518 | number 16 (#MF), and SSE exceptions - 19 (#XF). |
3519 | * The current implementation ignores the inquiry for hook of 7 |
3519 | * The current implementation ignores the inquiry for hook of 7 |
3520 | exception - the system handles #NM by its own. |
3520 | exception - the system handles #NM by its own. |
3521 | * The exception handler is called with exception number as first |
3521 | * The exception handler is called with exception number as first |
3522 | (and only) stack parameter. So, correct exit from the handler is |
3522 | (and only) stack parameter. So, correct exit from the handler is |
3523 | RET 4. It returns to the instruction, that caused the exception, |
3523 | RET 4. It returns to the instruction, that caused the exception, |
3524 | for faults, and to the next instruction for traps (see |
3524 | for faults, and to the next instruction for traps (see |
3525 | classification of exceptions in CPU specification). |
3525 | classification of exceptions in CPU specification). |
3526 | * When user handler receives control, the corresponding bit in |
3526 | * When user handler receives control, the corresponding bit in |
3527 | the exception mask is cleared. Raising this exception |
3527 | the exception mask is cleared. Raising this exception |
3528 | in consequence leads to default handling, that is, |
3528 | in consequence leads to default handling, that is, |
3529 | terminating the application in absence of debugger or |
3529 | terminating the application in absence of debugger or |
3530 | suspend with notification of debugger otherwise. |
3530 | suspend with notification of debugger otherwise. |
3531 | * After user handler completes critical operations, it can set |
3531 | * After user handler completes critical operations, it can set |
3532 | the corresponding bit in the exception mask with subfunction 25. |
3532 | the corresponding bit in the exception mask with subfunction 25. |
3533 | Also user handler is responsible for clearing exceptions flags in |
3533 | Also user handler is responsible for clearing exceptions flags in |
3534 | FPU and/or SSE. |
3534 | FPU and/or SSE. |
3535 | 3535 | ||
3536 | ---------------------- Constants for registers: ---------------------- |
3536 | ---------------------- Constants for registers: ---------------------- |
3537 | eax - SF_SYS_MISC (68) |
3537 | eax - SF_SYS_MISC (68) |
3538 | ebx - SSF_SET_EXCEPTION_HANDLER (24) |
3538 | ebx - SSF_SET_EXCEPTION_HANDLER (24) |
3539 | ====================================================================== |
3539 | ====================================================================== |
3540 | ======== Function 68, subfunction 25 - set exception activity ======== |
3540 | ======== Function 68, subfunction 25 - set exception activity ======== |
3541 | ====================================================================== |
3541 | ====================================================================== |
3542 | Parameters: |
3542 | Parameters: |
3543 | * eax = 68 - function number |
3543 | * eax = 68 - function number |
3544 | * ebx = 25 - subfunction number |
3544 | * ebx = 25 - subfunction number |
3545 | * ecx = signal number |
3545 | * ecx = signal number |
3546 | * edx = value of activity (0/1) |
3546 | * edx = value of activity (0/1) |
3547 | Returned value: |
3547 | Returned value: |
3548 | * eax = -1 - invalid signal number |
3548 | * eax = -1 - invalid signal number |
3549 | * otherwise eax = old value of activity for this signal (0/1) |
3549 | * otherwise eax = old value of activity for this signal (0/1) |
3550 | Remarks: |
3550 | Remarks: |
3551 | * In current implementation only mask for user excepton handler, |
3551 | * In current implementation only mask for user excepton handler, |
3552 | which has been previously set by subfunction 24, |
3552 | which has been previously set by subfunction 24, |
3553 | is changed. Signal number corresponds to exception number. |
3553 | is changed. Signal number corresponds to exception number. |
3554 | 3554 | ||
3555 | ---------------------- Constants for registers: ---------------------- |
3555 | ---------------------- Constants for registers: ---------------------- |
3556 | eax - SF_SYS_MISC (68) |
3556 | eax - SF_SYS_MISC (68) |
3557 | ebx - SSF_SET_EXCEPTION_STATE (25) |
3557 | ebx - SSF_SET_EXCEPTION_STATE (25) |
3558 | ====================================================================== |
3558 | ====================================================================== |
3559 | ====== Function 68, subfunction 26 - release memory pages ============ |
3559 | ====== Function 68, subfunction 26 - release memory pages ============ |
3560 | ====================================================================== |
3560 | ====================================================================== |
3561 | Parameters: |
3561 | Parameters: |
3562 | * eax = 68 - function number |
3562 | * eax = 68 - function number |
3563 | * ebx = 26 - subfunction number |
3563 | * ebx = 26 - subfunction number |
3564 | * ecx = pointer to the memory block, allocated by subfunction 12 |
3564 | * ecx = pointer to the memory block, allocated by subfunction 12 |
3565 | * edx = offset from the block beginnings |
3565 | * edx = offset from the block beginnings |
3566 | * esi = the size of the region of memory to release, in bytes |
3566 | * esi = the size of the region of memory to release, in bytes |
3567 | Remarks: |
3567 | Remarks: |
3568 | * function release range of pages from ecx+edx to ecx+edx+esi |
3568 | * function release range of pages from ecx+edx to ecx+edx+esi |
3569 | and set virtual memory into reserved state. |
3569 | and set virtual memory into reserved state. |
3570 | 3570 | ||
3571 | ---------------------- Constants for registers: ---------------------- |
3571 | ---------------------- Constants for registers: ---------------------- |
3572 | eax - SF_SYS_MISC (68) |
3572 | eax - SF_SYS_MISC (68) |
3573 | ebx - SSF_MEM_FREE_EXT (26) |
3573 | ebx - SSF_MEM_FREE_EXT (26) |
3574 | ====================================================================== |
3574 | ====================================================================== |
3575 | ========== Function 68, subfunction 27 - load file =================== |
3575 | ========== Function 68, subfunction 27 - load file =================== |
3576 | ====================================================================== |
3576 | ====================================================================== |
3577 | Parameters: |
3577 | Parameters: |
3578 | * eax = 68 - function number |
3578 | * eax = 68 - function number |
3579 | * ebx = 27 - subfunction number |
3579 | * ebx = 27 - subfunction number |
3580 | * ecx = pointer to the string with path to file, |
3580 | * ecx = pointer to the string with path to file, |
3581 | rules of path forming can be found in function 70 description. |
3581 | rules of path forming can be found in function 70 description. |
3582 | Returned value: |
3582 | Returned value: |
3583 | * eax = pointer to the loaded file, or zero |
3583 | * eax = pointer to the loaded file, or zero |
3584 | * edx = size of the loaded file, or zero |
3584 | * edx = size of the loaded file, or zero |
3585 | Remarks: |
3585 | Remarks: |
3586 | * function loads file and unpacks, if necessary |
3586 | * function loads file and unpacks, if necessary |
3587 | 3587 | ||
3588 | ---------------------- Constants for registers: ---------------------- |
3588 | ---------------------- Constants for registers: ---------------------- |
3589 | eax - SF_SYS_MISC (68) |
3589 | eax - SF_SYS_MISC (68) |
3590 | ebx - SSF_LOAD_FILE (27) |
3590 | ebx - SSF_LOAD_FILE (27) |
3591 | ====================================================================== |
3591 | ====================================================================== |
3592 | == Function 68, subfunction 28 - load file, specifying the encoding == |
3592 | == Function 68, subfunction 28 - load file, specifying the encoding == |
3593 | ====================================================================== |
3593 | ====================================================================== |
3594 | Parameters: |
3594 | Parameters: |
3595 | * eax = 68 - function number |
3595 | * eax = 68 - function number |
3596 | * ebx = 28 - subfunction number |
3596 | * ebx = 28 - subfunction number |
3597 | * ecx = pointer to the string with path to file |
3597 | * ecx = pointer to the string with path to file |
3598 | * edx = string encoding, details can be found in function 80 description. |
3598 | * edx = string encoding, details can be found in function 80 description. |
3599 | Returned value: |
3599 | Returned value: |
3600 | * eax = pointer to the loaded file, or zero |
3600 | * eax = pointer to the loaded file, or zero |
3601 | * edx = size of the loaded file, or zero |
3601 | * edx = size of the loaded file, or zero |
3602 | Remarks: |
3602 | Remarks: |
3603 | * function loads file and unpacks, if necessary |
3603 | * function loads file and unpacks, if necessary |
3604 | 3604 | ||
3605 | ====================================================================== |
3605 | ====================================================================== |
3606 | ====================== Function 69 - debugging. ====================== |
3606 | ====================== Function 69 - debugging. ====================== |
3607 | ====================================================================== |
3607 | ====================================================================== |
3608 | A process can load other process as debugged by set of corresponding |
3608 | A process can load other process as debugged by set of corresponding |
3609 | bit by call to subfunction 7 of function 70. |
3609 | bit by call to subfunction 7 of function 70. |
3610 | A process can have only one debugger; one process can debug some |
3610 | A process can have only one debugger; one process can debug some |
3611 | others. The system notifies debugger on events occuring with |
3611 | others. The system notifies debugger on events occuring with |
3612 | debugged process. Messages are written to the buffer defined by |
3612 | debugged process. Messages are written to the buffer defined by |
3613 | subfunction 0. |
3613 | subfunction 0. |
3614 | Format of a message: |
3614 | Format of a message: |
3615 | * +0: dword: message code |
3615 | * +0: dword: message code |
3616 | * +4: dword: PID of debugged process |
3616 | * +4: dword: PID of debugged process |
3617 | * +8: there can be additional data depending on message code |
3617 | * +8: there can be additional data depending on message code |
3618 | Message codes: |
3618 | Message codes: |
3619 | * 1 = exception |
3619 | * 1 = exception |
3620 | * in addition dword-number of the exception is given |
3620 | * in addition dword-number of the exception is given |
3621 | * process is suspended |
3621 | * process is suspended |
3622 | * 2 = process has terminated |
3622 | * 2 = process has terminated |
3623 | * comes at any termination: both through the system function -1, |
3623 | * comes at any termination: both through the system function -1, |
3624 | and at "murder" by any other process (including debugger itself) |
3624 | and at "murder" by any other process (including debugger itself) |
3625 | * 3 = debug exception int 1 = #DB |
3625 | * 3 = debug exception int 1 = #DB |
3626 | * in addition dword-image of the register DR6 is given: |
3626 | * in addition dword-image of the register DR6 is given: |
3627 | * bits 0-3: condition of the corresponding breakpoint (set by |
3627 | * bits 0-3: condition of the corresponding breakpoint (set by |
3628 | subfunction 9) is satisfied |
3628 | subfunction 9) is satisfied |
3629 | * bit 14: exception has occured because of the trace mode |
3629 | * bit 14: exception has occured because of the trace mode |
3630 | (flag TF is set TF) |
3630 | (flag TF is set TF) |
3631 | * process is suspended |
3631 | * process is suspended |
3632 | When debugger terminates, all debugged processes are killed. |
3632 | When debugger terminates, all debugged processes are killed. |
3633 | If debugger does not want this, it must previously detach by |
3633 | If debugger does not want this, it must previously detach by |
3634 | subfunction 3. |
3634 | subfunction 3. |
3635 | 3635 | ||
3636 | All subfunctions are applicable only to processes/threads started |
3636 | All subfunctions are applicable only to processes/threads started |
3637 | from the current by function 70 with set debugging flag. |
3637 | from the current by function 70 with set debugging flag. |
3638 | Debugging of multithreaded programs is not supported yet. |
3638 | Debugging of multithreaded programs is not supported yet. |
3639 | The full list of subfunctions: |
3639 | The full list of subfunctions: |
3640 | * subfunction 0 - define data area for debug messages |
3640 | * subfunction 0 - define data area for debug messages |
3641 | * subfunction 1 - get contents of registers of debugged thread |
3641 | * subfunction 1 - get contents of registers of debugged thread |
3642 | * subfunction 2 - set contents of registers of debugged thread |
3642 | * subfunction 2 - set contents of registers of debugged thread |
3643 | * subfunction 3 - detach from debugged process |
3643 | * subfunction 3 - detach from debugged process |
3644 | * subfunction 4 - suspend debugged thread |
3644 | * subfunction 4 - suspend debugged thread |
3645 | * subfunction 5 - resume debugged thread |
3645 | * subfunction 5 - resume debugged thread |
3646 | * subfunction 6 - read from the memory of debugged process |
3646 | * subfunction 6 - read from the memory of debugged process |
3647 | * subfunction 7 - write to the memory of debugged process |
3647 | * subfunction 7 - write to the memory of debugged process |
3648 | * subfunction 8 - terminate debugged thread |
3648 | * subfunction 8 - terminate debugged thread |
3649 | * subfunction 9 - set/clear hardware breakpoint |
3649 | * subfunction 9 - set/clear hardware breakpoint |
3650 | 3650 | ||
3651 | ---------------------- Constants for registers: ---------------------- |
3651 | ---------------------- Constants for registers: ---------------------- |
3652 | eax - SF_DEBUG (69) |
3652 | eax - SF_DEBUG (69) |
3653 | ebx - SSF_SET_MESSAGE_AREA (0), SSF_GET_REGISTERS (1), |
3653 | ebx - SSF_SET_MESSAGE_AREA (0), SSF_GET_REGISTERS (1), |
3654 | SSF_SET_REGISTERS (2), SSF_DETACH (3), SSF_SUSPEND (4), |
3654 | SSF_SET_REGISTERS (2), SSF_DETACH (3), SSF_SUSPEND (4), |
3655 | SSF_RESUME (5), SSF_READ_MEMORY (6), SSF_WRITE_MEMORY (7), |
3655 | SSF_RESUME (5), SSF_READ_MEMORY (6), SSF_WRITE_MEMORY (7), |
3656 | SSF_TERMINATE (8), SSF_DEFINE_BREAKPOINT (9) |
3656 | SSF_TERMINATE (8), SSF_DEFINE_BREAKPOINT (9) |
3657 | ====================================================================== |
3657 | ====================================================================== |
3658 | = Function 69, subfunction 0 - define data area fror debug messages. = |
3658 | = Function 69, subfunction 0 - define data area fror debug messages. = |
3659 | ====================================================================== |
3659 | ====================================================================== |
3660 | Parameters: |
3660 | Parameters: |
3661 | * eax = 69 - function number |
3661 | * eax = 69 - function number |
3662 | * ebx = 0 - subfunction number |
3662 | * ebx = 0 - subfunction number |
3663 | * ecx = pointer |
3663 | * ecx = pointer |
3664 | Format of data area: |
3664 | Format of data area: |
3665 | * +0: dword: N = buffer size (not including this header) |
3665 | * +0: dword: N = buffer size (not including this header) |
3666 | * +4: dword: occupied place |
3666 | * +4: dword: occupied place |
3667 | * +8: N*byte: buffer |
3667 | * +8: N*byte: buffer |
3668 | Returned value: |
3668 | Returned value: |
3669 | * function does not return value |
3669 | * function does not return value |
3670 | Remarks: |
3670 | Remarks: |
3671 | * If the size field is negative, the buffer is considered locked |
3671 | * If the size field is negative, the buffer is considered locked |
3672 | and at arrival of new message the system will wait. |
3672 | and at arrival of new message the system will wait. |
3673 | For synchronization frame all work with the buffer by operations |
3673 | For synchronization frame all work with the buffer by operations |
3674 | lock/unlock |
3674 | lock/unlock |
3675 | neg [bufsize] |
3675 | neg [bufsize] |
3676 | * Data in the buffer are considered as array of items with variable |
3676 | * Data in the buffer are considered as array of items with variable |
3677 | length - messages. Format of a message is explained in |
3677 | length - messages. Format of a message is explained in |
3678 | general description. |
3678 | general description. |
3679 | 3679 | ||
3680 | ---------------------- Constants for registers: ---------------------- |
3680 | ---------------------- Constants for registers: ---------------------- |
3681 | eax - SF_DEBUG (69) |
3681 | eax - SF_DEBUG (69) |
3682 | ebx - SSF_SET_MESSAGE_AREA (0) |
3682 | ebx - SSF_SET_MESSAGE_AREA (0) |
3683 | ====================================================================== |
3683 | ====================================================================== |
3684 | ===================== Function 69, subfunction 1 ===================== |
3684 | ===================== Function 69, subfunction 1 ===================== |
3685 | ============ Get contents of registers of debugged thread. =========== |
3685 | ============ Get contents of registers of debugged thread. =========== |
3686 | ====================================================================== |
3686 | ====================================================================== |
3687 | Parameters: |
3687 | Parameters: |
3688 | * eax = 69 - function number |
3688 | * eax = 69 - function number |
3689 | * ebx = 1 - subfunction number |
3689 | * ebx = 1 - subfunction number |
3690 | * ecx = thread identifier |
3690 | * ecx = thread identifier |
3691 | * edx = size of context structure, must be 0x28=40 bytes |
3691 | * edx = size of context structure, must be 0x28=40 bytes |
3692 | * esi = pointer to context structure |
3692 | * esi = pointer to context structure |
3693 | Returned value: |
3693 | Returned value: |
3694 | * function does not return value |
3694 | * function does not return value |
3695 | Format of context structure: (FPU is not supported yet) |
3695 | Format of context structure: (FPU is not supported yet) |
3696 | * +0: dword: eip |
3696 | * +0: dword: eip |
3697 | * +4: dword: eflags |
3697 | * +4: dword: eflags |
3698 | * +8: dword: eax |
3698 | * +8: dword: eax |
3699 | * +12 = +0xC: dword: ecx |
3699 | * +12 = +0xC: dword: ecx |
3700 | * +16 = +0x10: dword: edx |
3700 | * +16 = +0x10: dword: edx |
3701 | * +20 = +0x14: dword: ebx |
3701 | * +20 = +0x14: dword: ebx |
3702 | * +24 = +0x18: dword: esp |
3702 | * +24 = +0x18: dword: esp |
3703 | * +28 = +0x1C: dword: ebp |
3703 | * +28 = +0x1C: dword: ebp |
3704 | * +32 = +0x20: dword: esi |
3704 | * +32 = +0x20: dword: esi |
3705 | * +36 = +0x24: dword: edi |
3705 | * +36 = +0x24: dword: edi |
3706 | Remarks: |
3706 | Remarks: |
3707 | * If the thread executes code of ring-0, the function returns |
3707 | * If the thread executes code of ring-0, the function returns |
3708 | contents of registers of ring-3. |
3708 | contents of registers of ring-3. |
3709 | * Process must be loaded for debugging (as is shown in |
3709 | * Process must be loaded for debugging (as is shown in |
3710 | general description). |
3710 | general description). |
3711 | 3711 | ||
3712 | ---------------------- Constants for registers: ---------------------- |
3712 | ---------------------- Constants for registers: ---------------------- |
3713 | eax - SF_DEBUG (69) |
3713 | eax - SF_DEBUG (69) |
3714 | ebx - SSF_GET_REGISTERS (1) |
3714 | ebx - SSF_GET_REGISTERS (1) |
3715 | ====================================================================== |
3715 | ====================================================================== |
3716 | ===================== Function 69, subfunction 2 ===================== |
3716 | ===================== Function 69, subfunction 2 ===================== |
3717 | ============ Set contents of registers of debugged thread. =========== |
3717 | ============ Set contents of registers of debugged thread. =========== |
3718 | ====================================================================== |
3718 | ====================================================================== |
3719 | Parameters: |
3719 | Parameters: |
3720 | * eax = 69 - function number |
3720 | * eax = 69 - function number |
3721 | * ebx = 2 - subfunction number |
3721 | * ebx = 2 - subfunction number |
3722 | * ecx = thread identifier |
3722 | * ecx = thread identifier |
3723 | * edx = size of context structure, must be 0x28=40 bytes |
3723 | * edx = size of context structure, must be 0x28=40 bytes |
3724 | * esi -> context structure |
3724 | * esi -> context structure |
3725 | Returned value: |
3725 | Returned value: |
3726 | * function does not return value |
3726 | * function does not return value |
3727 | Format of context structure is shown in the description of |
3727 | Format of context structure is shown in the description of |
3728 | subfunction 1. |
3728 | subfunction 1. |
3729 | Remarks: |
3729 | Remarks: |
3730 | * If the thread executes code of ring-0, the function returns |
3730 | * If the thread executes code of ring-0, the function returns |
3731 | contents of registers of ring-3. |
3731 | contents of registers of ring-3. |
3732 | * Process must be loaded for debugging (as is shown in |
3732 | * Process must be loaded for debugging (as is shown in |
3733 | general description). |
3733 | general description). |
3734 | 3734 | ||
3735 | ---------------------- Constants for registers: ---------------------- |
3735 | ---------------------- Constants for registers: ---------------------- |
3736 | eax - SF_DEBUG (69) |
3736 | eax - SF_DEBUG (69) |
3737 | ebx - SSF_SET_REGISTERS (2) |
3737 | ebx - SSF_SET_REGISTERS (2) |
3738 | ====================================================================== |
3738 | ====================================================================== |
3739 | ===== Function 69, subfunction 3 - detach from debugged process. ===== |
3739 | ===== Function 69, subfunction 3 - detach from debugged process. ===== |
3740 | ====================================================================== |
3740 | ====================================================================== |
3741 | Parameters: |
3741 | Parameters: |
3742 | * eax = 69 - function number |
3742 | * eax = 69 - function number |
3743 | * ebx = 3 - subfunction number |
3743 | * ebx = 3 - subfunction number |
3744 | * ecx = identifier |
3744 | * ecx = identifier |
3745 | Returned value: |
3745 | Returned value: |
3746 | * function does not return value |
3746 | * function does not return value |
3747 | Remarks: |
3747 | Remarks: |
3748 | * If the process was suspended, it resumes execution. |
3748 | * If the process was suspended, it resumes execution. |
3749 | 3749 | ||
3750 | ---------------------- Constants for registers: ---------------------- |
3750 | ---------------------- Constants for registers: ---------------------- |
3751 | eax - SF_DEBUG (69) |
3751 | eax - SF_DEBUG (69) |
3752 | ebx - SSF_DETACH (3) |
3752 | ebx - SSF_DETACH (3) |
3753 | ====================================================================== |
3753 | ====================================================================== |
3754 | ======== Function 69, subfunction 4 - suspend debugged thread. ======= |
3754 | ======== Function 69, subfunction 4 - suspend debugged thread. ======= |
3755 | ====================================================================== |
3755 | ====================================================================== |
3756 | Parameters: |
3756 | Parameters: |
3757 | * eax = 69 - function number |
3757 | * eax = 69 - function number |
3758 | * ebx = 4 - subfunction number |
3758 | * ebx = 4 - subfunction number |
3759 | * ecx = thread identifier |
3759 | * ecx = thread identifier |
3760 | Returned value: |
3760 | Returned value: |
3761 | * function does not return value |
3761 | * function does not return value |
3762 | Remarks: |
3762 | Remarks: |
3763 | * Process must be loaded for debugging (as is shown in |
3763 | * Process must be loaded for debugging (as is shown in |
3764 | general description). |
3764 | general description). |
3765 | 3765 | ||
3766 | ---------------------- Constants for registers: ---------------------- |
3766 | ---------------------- Constants for registers: ---------------------- |
3767 | eax - SF_DEBUG (69) |
3767 | eax - SF_DEBUG (69) |
3768 | ebx - SSF_SUSPEND (4) |
3768 | ebx - SSF_SUSPEND (4) |
3769 | ====================================================================== |
3769 | ====================================================================== |
3770 | ======== Function 69, subfunction 5 - resume debugged thread. ======== |
3770 | ======== Function 69, subfunction 5 - resume debugged thread. ======== |
3771 | ====================================================================== |
3771 | ====================================================================== |
3772 | Parameters: |
3772 | Parameters: |
3773 | * eax = 69 - function number |
3773 | * eax = 69 - function number |
3774 | * ebx = 5 - subfunction number |
3774 | * ebx = 5 - subfunction number |
3775 | * ecx = thread identifier |
3775 | * ecx = thread identifier |
3776 | Returned value: |
3776 | Returned value: |
3777 | * function does not return value |
3777 | * function does not return value |
3778 | Remarks: |
3778 | Remarks: |
3779 | * Process must be loaded for debugging (as is shown in |
3779 | * Process must be loaded for debugging (as is shown in |
3780 | general description). |
3780 | general description). |
3781 | 3781 | ||
3782 | ---------------------- Constants for registers: ---------------------- |
3782 | ---------------------- Constants for registers: ---------------------- |
3783 | eax - SF_DEBUG (69) |
3783 | eax - SF_DEBUG (69) |
3784 | ebx - SSF_RESUME (5) |
3784 | ebx - SSF_RESUME (5) |
3785 | ====================================================================== |
3785 | ====================================================================== |
3786 | = Fucntion 69, subfunction 6 - read from memory of debugged process. = |
3786 | = Fucntion 69, subfunction 6 - read from memory of debugged process. = |
3787 | ====================================================================== |
3787 | ====================================================================== |
3788 | Parameters: |
3788 | Parameters: |
3789 | * eax = 69 - function number |
3789 | * eax = 69 - function number |
3790 | * ebx = 6 - subfunction number |
3790 | * ebx = 6 - subfunction number |
3791 | * ecx = identifier |
3791 | * ecx = identifier |
3792 | * edx = number of bytes to read |
3792 | * edx = number of bytes to read |
3793 | * esi = address in the memory of debugged process |
3793 | * esi = address in the memory of debugged process |
3794 | * edi = pointer to buffer for data |
3794 | * edi = pointer to buffer for data |
3795 | Returned value: |
3795 | Returned value: |
3796 | * eax = -1 at an error (invalid PID or buffer) |
3796 | * eax = -1 at an error (invalid PID or buffer) |
3797 | * otherwise eax = number of read bytes (possibly, 0, |
3797 | * otherwise eax = number of read bytes (possibly, 0, |
3798 | if esi is too large) |
3798 | if esi is too large) |
3799 | Remarks: |
3799 | Remarks: |
3800 | * Process must be loaded for debugging (as is shown in |
3800 | * Process must be loaded for debugging (as is shown in |
3801 | general description). |
3801 | general description). |
3802 | 3802 | ||
3803 | ---------------------- Constants for registers: ---------------------- |
3803 | ---------------------- Constants for registers: ---------------------- |
3804 | eax - SF_DEBUG (69) |
3804 | eax - SF_DEBUG (69) |
3805 | ebx - SSF_READ_MEMORY (6) |
3805 | ebx - SSF_READ_MEMORY (6) |
3806 | ====================================================================== |
3806 | ====================================================================== |
3807 | == Function 69, subfunction 7 - write to memory of debugged process. = |
3807 | == Function 69, subfunction 7 - write to memory of debugged process. = |
3808 | ====================================================================== |
3808 | ====================================================================== |
3809 | Parameters: |
3809 | Parameters: |
3810 | * eax = 69 - function number |
3810 | * eax = 69 - function number |
3811 | * ebx = 7 - subfunction number |
3811 | * ebx = 7 - subfunction number |
3812 | * ecx = identifier |
3812 | * ecx = identifier |
3813 | * edx = number of bytes to write |
3813 | * edx = number of bytes to write |
3814 | * esi = address of memory in debugged process |
3814 | * esi = address of memory in debugged process |
3815 | * edi = pointer to data |
3815 | * edi = pointer to data |
3816 | Returned value: |
3816 | Returned value: |
3817 | * eax = -1 at an error (invalid PID or buffer) |
3817 | * eax = -1 at an error (invalid PID or buffer) |
3818 | * otherwise eax = number of written bytes (possibly, 0, |
3818 | * otherwise eax = number of written bytes (possibly, 0, |
3819 | if esi is too large) |
3819 | if esi is too large) |
3820 | Remarks: |
3820 | Remarks: |
3821 | * Process must be loaded for debugging (as is shown in |
3821 | * Process must be loaded for debugging (as is shown in |
3822 | general description). |
3822 | general description). |
3823 | 3823 | ||
3824 | ---------------------- Constants for registers: ---------------------- |
3824 | ---------------------- Constants for registers: ---------------------- |
3825 | eax - SF_DEBUG (69) |
3825 | eax - SF_DEBUG (69) |
3826 | ebx - SSF_WRITE_MEMORY (7) |
3826 | ebx - SSF_WRITE_MEMORY (7) |
3827 | ====================================================================== |
3827 | ====================================================================== |
3828 | ======= Function 69, subfunction 8 - terminate debugged thread. ====== |
3828 | ======= Function 69, subfunction 8 - terminate debugged thread. ====== |
3829 | ====================================================================== |
3829 | ====================================================================== |
3830 | Parameters: |
3830 | Parameters: |
3831 | * eax = 69 - function number |
3831 | * eax = 69 - function number |
3832 | * ebx = 8 - subfunction number |
3832 | * ebx = 8 - subfunction number |
3833 | * ecx = identifier |
3833 | * ecx = identifier |
3834 | Returned value: |
3834 | Returned value: |
3835 | * function does not return value |
3835 | * function does not return value |
3836 | Remarks: |
3836 | Remarks: |
3837 | * Process must be loaded for debugging (as is shown in |
3837 | * Process must be loaded for debugging (as is shown in |
3838 | general description). |
3838 | general description). |
3839 | * The function is similar to subfunction 2 of function 18 |
3839 | * The function is similar to subfunction 2 of function 18 |
3840 | with two differences: it requires first remark and |
3840 | with two differences: it requires first remark and |
3841 | accepts PID rather than slot number. |
3841 | accepts PID rather than slot number. |
3842 | 3842 | ||
3843 | ---------------------- Constants for registers: ---------------------- |
3843 | ---------------------- Constants for registers: ---------------------- |
3844 | eax - SF_DEBUG (69) |
3844 | eax - SF_DEBUG (69) |
3845 | ebx - SSF_TERMINATE (8) |
3845 | ebx - SSF_TERMINATE (8) |
3846 | ====================================================================== |
3846 | ====================================================================== |
3847 | ===== Function 69, subfunction 9 - set/clear hardware breakpoint. ==== |
3847 | ===== Function 69, subfunction 9 - set/clear hardware breakpoint. ==== |
3848 | ====================================================================== |
3848 | ====================================================================== |
3849 | Parameters: |
3849 | Parameters: |
3850 | * eax = 69 - function number |
3850 | * eax = 69 - function number |
3851 | * ebx = 9 - subfunction number |
3851 | * ebx = 9 - subfunction number |
3852 | * ecx = thread identifier |
3852 | * ecx = thread identifier |
3853 | * dl = index of breakpoint, from 0 to 3 inclusively |
3853 | * dl = index of breakpoint, from 0 to 3 inclusively |
3854 | * dh = flags: |
3854 | * dh = flags: |
3855 | * if high bit is cleared - set breakpoint: |
3855 | * if high bit is cleared - set breakpoint: |
3856 | * bits 0-1 - condition: |
3856 | * bits 0-1 - condition: |
3857 | * 00 = breakpoint on execution |
3857 | * 00 = breakpoint on execution |
3858 | * 01 = breakpoint on read |
3858 | * 01 = breakpoint on read |
3859 | * 11 = breakpoint on read/write |
3859 | * 11 = breakpoint on read/write |
3860 | * bits 2-3 - length; for breakpoints on exception it must be |
3860 | * bits 2-3 - length; for breakpoints on exception it must be |
3861 | 00, otherwise one of |
3861 | 00, otherwise one of |
3862 | * 00 = byte |
3862 | * 00 = byte |
3863 | * 01 = word |
3863 | * 01 = word |
3864 | * 11 = dword |
3864 | * 11 = dword |
3865 | * esi = breakpoint address; must be aligned according to |
3865 | * esi = breakpoint address; must be aligned according to |
3866 | the length (i.e. must be even for word breakpoints, |
3866 | the length (i.e. must be even for word breakpoints, |
3867 | divisible by 4 for dword) |
3867 | divisible by 4 for dword) |
3868 | * if high bit is set - clear breakpoint |
3868 | * if high bit is set - clear breakpoint |
3869 | Returned value: |
3869 | Returned value: |
3870 | * eax = 0 - success |
3870 | * eax = 0 - success |
3871 | * eax = 1 - error in the input data |
3871 | * eax = 1 - error in the input data |
3872 | * eax = 2 - (reserved, is never returned in the current |
3872 | * eax = 2 - (reserved, is never returned in the current |
3873 | implementation) a global breakpoint with that index is already set |
3873 | implementation) a global breakpoint with that index is already set |
3874 | Remarks: |
3874 | Remarks: |
3875 | * Process must be loaded for debugging (as is shown in |
3875 | * Process must be loaded for debugging (as is shown in |
3876 | general description). |
3876 | general description). |
3877 | * Hardware breakpoints are implemented through DRx-registers of |
3877 | * Hardware breakpoints are implemented through DRx-registers of |
3878 | the processor, all limitations results from this. |
3878 | the processor, all limitations results from this. |
3879 | * The function can reinstall the breakpoint, previously set |
3879 | * The function can reinstall the breakpoint, previously set |
3880 | by it (and it does not inform on this). |
3880 | by it (and it does not inform on this). |
3881 | Carry on the list of set breakpoints in the debugger. |
3881 | Carry on the list of set breakpoints in the debugger. |
3882 | * Breakpoints generate debug exception #DB, on which the system |
3882 | * Breakpoints generate debug exception #DB, on which the system |
3883 | notifies debugger. |
3883 | notifies debugger. |
3884 | * Breakpoints on write and read/write act after |
3884 | * Breakpoints on write and read/write act after |
3885 | execution of the caused it instruction. |
3885 | execution of the caused it instruction. |
3886 | 3886 | ||
3887 | ---------------------- Constants for registers: ---------------------- |
3887 | ---------------------- Constants for registers: ---------------------- |
3888 | eax - SF_DEBUG (69) |
3888 | eax - SF_DEBUG (69) |
3889 | ebx - SSF_DEFINE_BREAKPOINT (9) |
3889 | ebx - SSF_DEFINE_BREAKPOINT (9) |
3890 | ====================================================================== |
3890 | ====================================================================== |
3891 | ==== Function 70 - work with file system with long names support. ==== |
3891 | ==== Function 70 - work with file system with long names support. ==== |
3892 | ====================================================================== |
3892 | ====================================================================== |
3893 | Parameters: |
3893 | Parameters: |
3894 | * eax = 70 |
3894 | * eax = 70 |
3895 | * ebx = pointer to the information structure |
3895 | * ebx = pointer to the information structure |
3896 | Returned value: |
3896 | Returned value: |
3897 | * eax = 0 - success; otherwise file system error code |
3897 | * eax = 0 - success; otherwise file system error code |
3898 | * some subfunctions return value in other registers too |
3898 | * some subfunctions return value in other registers too |
3899 | General format of the information structure: |
3899 | General format of the information structure: |
3900 | * +0: dword: subfunction number |
3900 | * +0: dword: subfunction number |
3901 | * +4: dword: offset in file or folder |
3901 | * +4: dword: offset in file or folder |
3902 | * +8: dword: higher part of offset or flags |
3902 | * +8: dword: higher part of offset or flags |
3903 | * +12 = +0xC: dword: size of data |
3903 | * +12 = +0xC: dword: size of data |
3904 | * +16 = +0x10: dword: pointer to data |
3904 | * +16 = +0x10: dword: pointer to data |
3905 | * +20 = +0x14: ?: path - zero terminated string |
3905 | * +20 = +0x14: ?: path - zero terminated string |
3906 | or |
3906 | or |
3907 | * +20 = +0x14: byte: 0 |
3907 | * +20 = +0x14: byte: 0 |
3908 | * +21 = +0x15: dword: pointer to string |
3908 | * +21 = +0x15: dword: pointer to string |
3909 | Case sensitivity depends on filesystem. |
3909 | Case sensitivity depends on filesystem. |
3910 | If a path not begins with '/', it is considered a relative. |
3910 | If a path not begins with '/', it is considered a relative. |
3911 | To get or set the current folder, use the sysfunction 30. |
3911 | To get or set the current folder, use the sysfunction 30. |
3912 | '../' in the path means a lift by one folder relatively current folder. |
3912 | '../' in the path means a lift by one folder relatively current folder. |
3913 | To set the encoding, put at the start of the string a byte with next values: |
3913 | To set the encoding, put at the start of the string a byte with next values: |
3914 | * 1 = cp866 |
3914 | * 1 = cp866 |
3915 | * 2 = UTF-16LE |
3915 | * 2 = UTF-16LE |
3916 | * 3 = UTF-8 |
3916 | * 3 = UTF-8 |
3917 | otherwise will be used cp866. In an absolute path |
3917 | otherwise will be used cp866. In an absolute path |
3918 | you may put this byte after the '/' or put an additional '/' before it. |
3918 | you may put this byte after the '/' or put an additional '/' before it. |
3919 | Also, you may use the sysfunction 80. |
3919 | Also, you may use the sysfunction 80. |
3920 | Format of an absolute path: |
3920 | Format of an absolute path: |
3921 | /base/number/dir1/dir2/.../dirn/file, |
3921 | /base/number/dir1/dir2/.../dirn/file, |
3922 | where base/number identifies device, on which file is located: |
3922 | where base/number identifies device, on which file is located: |
3923 | * RD/1 = ramdisk |
3923 | * RD/1 = ramdisk |
3924 | * FD/1 = first floppy drive, |
3924 | * FD/1 = first floppy drive, |
3925 | FD/2 = second floppy drive |
3925 | FD/2 = second floppy drive |
3926 | * HD0/x, HD1/x, HD2/x, HD3/x = hard drives accordingly on |
3926 | * HD0/x, HD1/x, HD2/x, HD3/x = hard drives accordingly on |
3927 | IDE0 (Primary Master), IDE1 (Primary Slave), |
3927 | IDE0 (Primary Master), IDE1 (Primary Slave), |
3928 | IDE2 (Secondary Master), IDE3 (Secondary Slave); |
3928 | IDE2 (Secondary Master), IDE3 (Secondary Slave); |
3929 | x - partition number on the selected hard drive, starts from 1 |
3929 | x - partition number on the selected hard drive, starts from 1 |
3930 | * CD0/1, CD1/1, CD2/1, CD3/1 = same for cd |
3930 | * CD0/1, CD1/1, CD2/1, CD3/1 = same for cd |
3931 | * SYS = system folder (encoding inaffected key), |
3931 | * SYS = system folder (encoding inaffected key), |
3932 | second key may be set by sysfunction 30.3. |
3932 | second key may be set by sysfunction 30.3. |
3933 | Examples: |
3933 | Examples: |
3934 | * '/sys/example.asm',0 |
3934 | * '/sys/example.asm',0 |
3935 | * '/rd/1/example.asm',0 |
3935 | * '/rd/1/example.asm',0 |
3936 | * '/HD0/1/folder/file.txt',0 |
3936 | * '/HD0/1/folder/file.txt',0 |
3937 | * '/hd2/2/pics/tanzania.bmp',0 |
3937 | * '/hd2/2/pics/tanzania.bmp',0 |
3938 | * 2,'/',0,'sys','/',0,'F',0,'I',0,'L',0,'E',0,0,0 |
3938 | * 2,'/',0,'sys','/',0,'F',0,'I',0,'L',0,'E',0,0,0 |
3939 | 3939 | ||
3940 | Available subfunctions: |
3940 | Available subfunctions: |
3941 | * subfunction 0 - read file |
3941 | * subfunction 0 - read file |
3942 | * subfunction 1 - read folder |
3942 | * subfunction 1 - read folder |
3943 | * subfunction 2 - create/rewrite file |
3943 | * subfunction 2 - create/rewrite file |
3944 | * subfunction 3 - write to existing file |
3944 | * subfunction 3 - write to existing file |
3945 | * subfunction 4 - set file size |
3945 | * subfunction 4 - set file size |
3946 | * subfunction 5 - get attributes of file/folder |
3946 | * subfunction 5 - get attributes of file/folder |
3947 | * subfunction 6 - set attributes of file/folder |
3947 | * subfunction 6 - set attributes of file/folder |
3948 | * subfunction 7 - start application |
3948 | * subfunction 7 - start application |
3949 | * subfunction 8 - delete file/folder |
3949 | * subfunction 8 - delete file/folder |
3950 | * subfunction 9 - create folder |
3950 | * subfunction 9 - create folder |
3951 | For CD-drives due to hardware limitations only subfunctions |
3951 | For CD-drives due to hardware limitations only subfunctions |
3952 | 0,1,5 and 7 are available, other subfunctions return error |
3952 | 0,1,5 and 7 are available, other subfunctions return error |
3953 | with code 2. |
3953 | with code 2. |
3954 | At the first call of subfunctions 0,1,5,7 to ATAPI devices |
3954 | At the first call of subfunctions 0,1,5,7 to ATAPI devices |
3955 | (CD and DVD) the manual control of tray is locked due to caching |
3955 | (CD and DVD) the manual control of tray is locked due to caching |
3956 | drive data. Unlocking is made when subfunction 4 of function 24 |
3956 | drive data. Unlocking is made when subfunction 4 of function 24 |
3957 | is called for corresponding device. |
3957 | is called for corresponding device. |
3958 | 3958 | ||
3959 | ---------------------- Constants for registers: ---------------------- |
3959 | ---------------------- Constants for registers: ---------------------- |
3960 | eax - SF_FILE (70) |
3960 | eax - SF_FILE (70) |
3961 | [ebx] - SSF_READ_FILE (0), SSF_READ_FOLDER (1), SSF_CREATE_FILE (2), |
3961 | [ebx] - SSF_READ_FILE (0), SSF_READ_FOLDER (1), SSF_CREATE_FILE (2), |
3962 | SSF_WRITE_FILE (3), SSF_SET_END (4), SSF_GET_INFO (5), |
3962 | SSF_WRITE_FILE (3), SSF_SET_END (4), SSF_GET_INFO (5), |
3963 | SSF_SET_INFO (6), SSF_START_APP (7), SSF_DELETE (8), |
3963 | SSF_SET_INFO (6), SSF_START_APP (7), SSF_DELETE (8), |
3964 | SSF_CREATE_FOLDER (9) |
3964 | SSF_CREATE_FOLDER (9) |
3965 | ====================================================================== |
3965 | ====================================================================== |
3966 | === Function 70, subfunction 0 - read file with long names support. == |
3966 | === Function 70, subfunction 0 - read file with long names support. == |
3967 | ====================================================================== |
3967 | ====================================================================== |
3968 | Parameters: |
3968 | Parameters: |
3969 | * eax = 70 - function number |
3969 | * eax = 70 - function number |
3970 | * ebx = pointer to the information structure |
3970 | * ebx = pointer to the information structure |
3971 | Format of the information structure: |
3971 | Format of the information structure: |
3972 | * +0: dword: 0 = subfunction number |
3972 | * +0: dword: 0 = subfunction number |
3973 | * +4: dword: file offset (in bytes) |
3973 | * +4: dword: file offset (in bytes) |
3974 | * +8: dword: 0 (reserved for high dword of offset) |
3974 | * +8: dword: 0 (reserved for high dword of offset) |
3975 | * +12 = +0xC: dword: number of bytes to read |
3975 | * +12 = +0xC: dword: number of bytes to read |
3976 | * +16 = +0x10: dword: pointer to buffer for data |
3976 | * +16 = +0x10: dword: pointer to buffer for data |
3977 | * +20 = +0x14: path, general rules of names forming |
3977 | * +20 = +0x14: path, general rules of names forming |
3978 | Returned value: |
3978 | Returned value: |
3979 | * eax = 0 - success, otherwise file system error code |
3979 | * eax = 0 - success, otherwise file system error code |
3980 | * ebx = number of bytes read |
3980 | * ebx = number of bytes read |
3981 | Remarks: |
3981 | Remarks: |
3982 | * If file was ended before last requested block was read, |
3982 | * If file was ended before last requested block was read, |
3983 | the function will read as many as it can, and after that return |
3983 | the function will read as many as it can, and after that return |
3984 | eax=6 (EOF). |
3984 | eax=6 (EOF). |
3985 | * The function does not allow to read folder (returns eax=10, |
3985 | * The function does not allow to read folder (returns eax=10, |
3986 | access denied). |
3986 | access denied). |
3987 | 3987 | ||
3988 | ---------------------- Constants for registers: ---------------------- |
3988 | ---------------------- Constants for registers: ---------------------- |
3989 | eax - SF_FILE (70) |
3989 | eax - SF_FILE (70) |
3990 | [ebx] - SSF_READ_FILE (0) |
3990 | [ebx] - SSF_READ_FILE (0) |
3991 | ====================================================================== |
3991 | ====================================================================== |
3992 | == Function 70, subfunction 1 - read folder with long names support. = |
3992 | == Function 70, subfunction 1 - read folder with long names support. = |
3993 | ====================================================================== |
3993 | ====================================================================== |
3994 | Parameters: |
3994 | Parameters: |
3995 | * eax = 70 - function number |
3995 | * eax = 70 - function number |
3996 | * ebx = pointer to the information structure |
3996 | * ebx = pointer to the information structure |
3997 | Format of the information structure: |
3997 | Format of the information structure: |
3998 | * +0: dword: 1 = subfunction number |
3998 | * +0: dword: 1 = subfunction number |
3999 | * +4: dword: index of starting block (beginning from 0) |
3999 | * +4: dword: index of starting block (beginning from 0) |
4000 | * +8: dword: names encoding: |
4000 | * +8: dword: names encoding: |
4001 | 0 = default |
4001 | 0 = default |
4002 | 1 = cp866 |
4002 | 1 = cp866 |
4003 | 2 = UTF-16LE |
4003 | 2 = UTF-16LE |
4004 | 3 = UTF-8 |
4004 | 3 = UTF-8 |
4005 | * +12 = +0xC: dword: number of blocks to read |
4005 | * +12 = +0xC: dword: number of blocks to read |
4006 | * +16 = +0x10: dword: pointer to buffer for data |
4006 | * +16 = +0x10: dword: pointer to buffer for data |
4007 | * +20 = +0x14: path, general rules of names forming |
4007 | * +20 = +0x14: path, general rules of names forming |
4008 | Returned value: |
4008 | Returned value: |
4009 | * eax = 0 - success, otherwise file system error code |
4009 | * eax = 0 - success, otherwise file system error code |
4010 | * ebx = number of file information blocks, written to the buffer |
4010 | * ebx = number of file information blocks, written to the buffer |
4011 | Structure of the buffer: |
4011 | Structure of the buffer: |
4012 | * header (32 bytes) |
4012 | * header (32 bytes) |
4013 | * block with information on file 1 |
4013 | * block with information on file 1 |
4014 | * block with information on file 2 |
4014 | * block with information on file 2 |
4015 | * ... |
4015 | * ... |
4016 | Structure of header: |
4016 | Structure of header: |
4017 | * +0: dword: version of structure (current is 1) |
4017 | * +0: dword: version of structure (current is 1) |
4018 | * +4: dword: number of placed blocks; is not greater than requested |
4018 | * +4: dword: number of placed blocks; is not greater than requested |
4019 | in the field +12 of information structure; can be less, if |
4019 | in the field +12 of information structure; can be less, if |
4020 | there are no more files in folder (the same as in ebx) |
4020 | there are no more files in folder (the same as in ebx) |
4021 | * +8: dword: total number of files in folder |
4021 | * +8: dword: total number of files in folder |
4022 | * +12 = +0xC: 20*byte: reserved (zeroed) |
4022 | * +12 = +0xC: 20*byte: reserved (zeroed) |
4023 | Structure of block of data for folder entry (BDFE): |
4023 | Structure of block of data for folder entry (BDFE): |
4024 | * +0: dword: attributes of file: |
4024 | * +0: dword: attributes of file: |
4025 | * bit 0 (mask 1): file is read-only |
4025 | * bit 0 (mask 1): file is read-only |
4026 | * bit 1 (mask 2): file is hidden |
4026 | * bit 1 (mask 2): file is hidden |
4027 | * bit 2 (mask 4): file is system |
4027 | * bit 2 (mask 4): file is system |
4028 | * bit 3 (mask 8): this is not a file but volume label |
4028 | * bit 3 (mask 8): this is the volume label (using by subfunction 5) |
4029 | (for one partition meets no more than once and |
- | |
4030 | only in root folder) |
- | |
4031 | * bit 4 (mask 0x10): this is a folder |
4029 | * bit 4 (mask 0x10): this is a folder |
4032 | * bit 5 (mask 0x20): file was not archived - many archivation |
4030 | * bit 5 (mask 0x20): file was not archived - many archivation |
4033 | programs have an option to archive only files with this bit set, |
4031 | programs have an option to archive only files with this bit set, |
4034 | and after archiving this bit is cleared - it can be useful |
4032 | and after archiving this bit is cleared - it can be useful |
4035 | for automatically creating of backup-archives as at writing |
4033 | for automatically creating of backup-archives as at writing |
4036 | this bit is usually set |
4034 | this bit is usually set |
4037 | * +4: dword: encoding, equals to field +8 in the information structure |
4035 | * +4: dword: encoding, equals to field +8 in the information structure |
4038 | * +8: 4*byte: time of file creation |
4036 | * +8: 4*byte: time of file creation |
4039 | * +12 = +0xC: 4*byte: date of file creation |
4037 | * +12 = +0xC: 4*byte: date of file creation |
4040 | * +16 = +0x10: 4*byte: time of last access (read or write) |
4038 | * +16 = +0x10: 4*byte: time of last access (read or write) |
4041 | * +20 = +0x14: 4*byte: date of last access |
4039 | * +20 = +0x14: 4*byte: date of last access |
4042 | * +24 = +0x18: 4*byte: time of last modification |
4040 | * +24 = +0x18: 4*byte: time of last modification |
4043 | * +28 = +0x1C: 4*byte: date of last modification |
4041 | * +28 = +0x1C: 4*byte: date of last modification |
4044 | * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb) |
4042 | * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb) |
4045 | * +40 = +0x28: name, 264 bytes in cp866, otherwise - 520 bytes. |
4043 | * +40 = +0x28: name, 264 bytes in cp866, otherwise - 520 bytes. |
4046 | Time format: |
4044 | Time format: |
4047 | * +0: byte: seconds |
4045 | * +0: byte: seconds |
4048 | * +1: byte: minutes |
4046 | * +1: byte: minutes |
4049 | * +2: byte: hours |
4047 | * +2: byte: hours |
4050 | * +3: byte: reserved (0) |
4048 | * +3: byte: reserved (0) |
4051 | * for example, 23.59.59 is written as (in hex) 3B 3B 17 00 |
4049 | * for example, 23.59.59 is written as (in hex) 3B 3B 17 00 |
4052 | Date format: |
4050 | Date format: |
4053 | * +0: byte: day |
4051 | * +0: byte: day |
4054 | * +1: byte: month |
4052 | * +1: byte: month |
4055 | * +2: word: year |
4053 | * +2: word: year |
4056 | * for example, 25.11.1979 is written as (in hex) 19 0B BB 07 |
4054 | * for example, 25.11.1979 is written as (in hex) 19 0B BB 07 |
4057 | Remarks: |
4055 | Remarks: |
4058 | * If BDFE contains cp866 name, the length of BDFE is 304 bytes, |
4056 | * If BDFE contains cp866 name, the length of BDFE is 304 bytes, |
4059 | otherwise - 560 bytes. |
4057 | otherwise - 560 bytes. |
4060 | * Name string is zero terminated, further data contain garbage. |
4058 | * Name string is zero terminated, further data contain garbage. |
4061 | * If files in folder were ended before requested number was read, |
4059 | * If files in folder were ended before requested number was read, |
4062 | the function will read as many as it can, and after that return |
4060 | the function will read as many as it can, and after that return |
4063 | eax=6 (EOF). |
4061 | eax=6 (EOF). |
4064 | * Any folder on the disk, except for root, contains two special |
4062 | * Any folder on the disk, except for root, contains two special |
4065 | entries "." and "..", identifying accordingly the folder itself |
4063 | entries "." and "..", identifying accordingly the folder itself |
4066 | and the parent folder. |
4064 | and the parent folder. |
4067 | * The function allows also to read virtual folders "/", "/rd", |
4065 | * The function allows also to read virtual folders "/", "/rd", |
4068 | "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10, |
4066 | "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10, |
4069 | and times and dates are zeroed. An alternative way to get the |
4067 | and times and dates are zeroed. An alternative way to get the |
4070 | equipment information - subfunction 11 of function 18. |
4068 | equipment information - subfunction 11 of function 18. |
4071 | 4069 | ||
4072 | ---------------------- Constants for registers: ---------------------- |
4070 | ---------------------- Constants for registers: ---------------------- |
4073 | eax - SF_FILE (70) |
4071 | eax - SF_FILE (70) |
4074 | [ebx] - SSF_READ_FOLDER (1) |
4072 | [ebx] - SSF_READ_FOLDER (1) |
4075 | ====================================================================== |
4073 | ====================================================================== |
4076 | ===================== Function 70, subfunction 2 ===================== |
4074 | ===================== Function 70, subfunction 2 ===================== |
4077 | ============ Create/rewrite file with long names support. ============ |
4075 | ============ Create/rewrite file with long names support. ============ |
4078 | ====================================================================== |
4076 | ====================================================================== |
4079 | Parameters: |
4077 | Parameters: |
4080 | * eax = 70 - function number |
4078 | * eax = 70 - function number |
4081 | * ebx = pointer to the information structure |
4079 | * ebx = pointer to the information structure |
4082 | Format of the information structure: |
4080 | Format of the information structure: |
4083 | * +0: dword: 2 = subfunction number |
4081 | * +0: dword: 2 = subfunction number |
4084 | * +4: dword: 0 (reserved) |
4082 | * +4: dword: 0 (reserved) |
4085 | * +8: dword: 0 (reserved) |
4083 | * +8: dword: 0 (reserved) |
4086 | * +12 = +0xC: dword: number of bytes to write |
4084 | * +12 = +0xC: dword: number of bytes to write |
4087 | * +16 = +0x10: dword: pointer to data |
4085 | * +16 = +0x10: dword: pointer to data |
4088 | * +20 = +0x14: path, general rules of names forming |
4086 | * +20 = +0x14: path, general rules of names forming |
4089 | Returned value: |
4087 | Returned value: |
4090 | * eax = 0 - success, otherwise file system error code |
4088 | * eax = 0 - success, otherwise file system error code |
4091 | * ebx = number of written bytes (possibly 0) |
4089 | * ebx = number of written bytes (possibly 0) |
4092 | Remarks: |
4090 | Remarks: |
4093 | * If a file with given name did not exist, it is created; |
4091 | * If a file with given name did not exist, it is created; |
4094 | if it existed, it is rewritten. |
4092 | if it existed, it is rewritten. |
4095 | * If there is not enough free space on disk, the function will |
4093 | * If there is not enough free space on disk, the function will |
4096 | write as many as can and then return error code 8. |
4094 | write as many as can and then return error code 8. |
4097 | * The function is not supported for CD (returns error code 2). |
4095 | * The function is not supported for CD (returns error code 2). |
4098 | 4096 | ||
4099 | ---------------------- Constants for registers: ---------------------- |
4097 | ---------------------- Constants for registers: ---------------------- |
4100 | eax - SF_FILE (70) |
4098 | eax - SF_FILE (70) |
4101 | [ebx] - SSF_CREATE_FILE (2) |
4099 | [ebx] - SSF_CREATE_FILE (2) |
4102 | ====================================================================== |
4100 | ====================================================================== |
4103 | ===================== Function 70, subfunction 3 ===================== |
4101 | ===================== Function 70, subfunction 3 ===================== |
4104 | =========== Write to existing file with long names support. ========== |
4102 | =========== Write to existing file with long names support. ========== |
4105 | ====================================================================== |
4103 | ====================================================================== |
4106 | Parameters: |
4104 | Parameters: |
4107 | * eax = 70 - function number |
4105 | * eax = 70 - function number |
4108 | * ebx = pointer to the information structure |
4106 | * ebx = pointer to the information structure |
4109 | Format of the information structure: |
4107 | Format of the information structure: |
4110 | * +0: dword: 3 = subfunction number |
4108 | * +0: dword: 3 = subfunction number |
4111 | * +4: dword: file offset (in bytes) |
4109 | * +4: dword: file offset (in bytes) |
4112 | * +8: dword: high dword of offset (must be 0 for FAT) |
4110 | * +8: dword: high dword of offset (must be 0 for FAT) |
4113 | * +12 = +0xC: dword: number of bytes to write |
4111 | * +12 = +0xC: dword: number of bytes to write |
4114 | * +16 = +0x10: dword: pointer to data |
4112 | * +16 = +0x10: dword: pointer to data |
4115 | * +20 = +0x14: path, general rules of names forming |
4113 | * +20 = +0x14: path, general rules of names forming |
4116 | Returned value: |
4114 | Returned value: |
4117 | * eax = 0 - success, otherwise file system error code |
4115 | * eax = 0 - success, otherwise file system error code |
4118 | * ebx = number of written bytes (possibly 0) |
4116 | * ebx = number of written bytes (possibly 0) |
4119 | Remarks: |
4117 | Remarks: |
4120 | * The file must already exist, otherwise function returns eax=5. |
4118 | * The file must already exist, otherwise function returns eax=5. |
4121 | * The only result of write 0 bytes is update in the file attributes |
4119 | * The only result of write 0 bytes is update in the file attributes |
4122 | date/time of modification and access to the current date/time. |
4120 | date/time of modification and access to the current date/time. |
4123 | * If beginning and/or ending position is greater than file size |
4121 | * If beginning and/or ending position is greater than file size |
4124 | (except for the previous case), the file is expanded to needed |
4122 | (except for the previous case), the file is expanded to needed |
4125 | size with zero characters. |
4123 | size with zero characters. |
4126 | * The function is not supported for CD (returns error code 2). |
4124 | * The function is not supported for CD (returns error code 2). |
4127 | 4125 | ||
4128 | ---------------------- Constants for registers: ---------------------- |
4126 | ---------------------- Constants for registers: ---------------------- |
4129 | eax - SF_FILE (70) |
4127 | eax - SF_FILE (70) |
4130 | [ebx] - SSF_WRITE_FILE (3) |
4128 | [ebx] - SSF_WRITE_FILE (3) |
4131 | ====================================================================== |
4129 | ====================================================================== |
4132 | ============ Function 70, subfunction 4 - set end of file. =========== |
4130 | ============ Function 70, subfunction 4 - set end of file. =========== |
4133 | ====================================================================== |
4131 | ====================================================================== |
4134 | Parameters: |
4132 | Parameters: |
4135 | * eax = 70 - function number |
4133 | * eax = 70 - function number |
4136 | * ebx = pointer to the information structure |
4134 | * ebx = pointer to the information structure |
4137 | Format of the information structure: |
4135 | Format of the information structure: |
4138 | * +0: dword: 4 = subfunction number |
4136 | * +0: dword: 4 = subfunction number |
4139 | * +4: dword: low dword of new file size |
4137 | * +4: dword: low dword of new file size |
4140 | * +8: dword: high dword of new file size (must be 0 for FAT) |
4138 | * +8: dword: high dword of new file size (must be 0 for FAT) |
4141 | * +12 = +0xC: dword: 0 (reserved) |
4139 | * +12 = +0xC: dword: 0 (reserved) |
4142 | * +16 = +0x10: dword: 0 (reserved) |
4140 | * +16 = +0x10: dword: 0 (reserved) |
4143 | * +20 = +0x14: path, general rules of names forming |
4141 | * +20 = +0x14: path, general rules of names forming |
4144 | Returned value: |
4142 | Returned value: |
4145 | * eax = 0 - success, otherwise file system error code |
4143 | * eax = 0 - success, otherwise file system error code |
4146 | * ebx destroyed |
4144 | * ebx destroyed |
4147 | Remarks: |
4145 | Remarks: |
4148 | * If new file size is less than old one, file will be truncated. |
4146 | * If new file size is less than old one, file will be truncated. |
4149 | If new size is greater than old one, file will be expanded, and if |
4147 | If new size is greater than old one, file will be expanded, and if |
4150 | size difference is up to 16 MB, new space will be cleared with 0. |
4148 | size difference is up to 16 MB, new space will be cleared with 0. |
4151 | * If there is not enough free space on disk for expansion, the |
4149 | * If there is not enough free space on disk for expansion, the |
4152 | function will expand to maximum possible size and then return |
4150 | function will expand to maximum possible size and then return |
4153 | error code 8. |
4151 | error code 8. |
4154 | * The function is not supported for CD (returns error code 2). |
4152 | * The function is not supported for CD (returns error code 2). |
4155 | 4153 | ||
4156 | ---------------------- Constants for registers: ---------------------- |
4154 | ---------------------- Constants for registers: ---------------------- |
4157 | eax - SF_FILE (70) |
4155 | eax - SF_FILE (70) |
4158 | [ebx] - SSF_SET_END (4) |
4156 | [ebx] - SSF_SET_END (4) |
4159 | ====================================================================== |
4157 | ====================================================================== |
4160 | ==== Function 70, subfunction 5 - get information on file/folder. ==== |
4158 | ==== Function 70, subfunction 5 - get information on file/folder. ==== |
4161 | ====================================================================== |
4159 | ====================================================================== |
4162 | Parameters: |
4160 | Parameters: |
4163 | * eax = 70 - function number |
4161 | * eax = 70 - function number |
4164 | * ebx = pointer to the information structure |
4162 | * ebx = pointer to the information structure |
4165 | Format of the information structure: |
4163 | Format of the information structure: |
4166 | * +0: dword: 5 = subfunction number |
4164 | * +0: dword: 5 = subfunction number |
4167 | * +4: dword: 0 (reserved) |
4165 | * +4: dword: 0 (reserved) |
4168 | * +8: dword: 0 or flags (for the root folder) |
4166 | * +8: dword: 0 or flags (for the root folder) |
4169 | * +12 = +0xC: dword: 0 (reserved) |
4167 | * +12 = +0xC: dword: 0 (reserved) |
4170 | * +16 = +0x10: dword: pointer to buffer for data (40 bytes) |
4168 | * +16 = +0x10: dword: pointer to buffer for data (40 bytes) |
4171 | * +20 = +0x14: path, general rules of names forming |
4169 | * +20 = +0x14: path, general rules of names forming |
4172 | Returned value: |
4170 | Returned value: |
4173 | * eax = 0 - success, otherwise file system error code |
4171 | * eax = 0 - success, otherwise file system error code |
4174 | * ebx destroyed |
4172 | * ebx destroyed |
4175 | Information on file is returned in the BDFE format (block of data |
4173 | Information on file is returned in the BDFE format (block of data |
4176 | for folder entry), explained in the description of subfunction 1, |
4174 | for folder entry), explained in the description of subfunction 1, |
4177 | but without filename, except the root folder. |
4175 | but without filename, except the root folder. |
4178 | Remarks: |
4176 | Remarks: |
4179 | * For the root folder returns the partition size, |
4177 | * For the root folder returns the partition size, |
4180 | and if encoding byte is non-zero, the volume label. |
4178 | and if encoding byte is non-zero, the volume label. |
4181 | * For the device returns only the size. |
4179 | * For the device returns only the size. |
4182 | 4180 | ||
4183 | ---------------------- Constants for registers: ---------------------- |
4181 | ---------------------- Constants for registers: ---------------------- |
4184 | eax - SF_FILE (70) |
4182 | eax - SF_FILE (70) |
4185 | [ebx] - SSF_GET_INFO (5) |
4183 | [ebx] - SSF_GET_INFO (5) |
4186 | ====================================================================== |
4184 | ====================================================================== |
4187 | ===== Function 70, subfunction 6 - set attributes of file/folder. ==== |
4185 | ===== Function 70, subfunction 6 - set attributes of file/folder. ==== |
4188 | ====================================================================== |
4186 | ====================================================================== |
4189 | Parameters: |
4187 | Parameters: |
4190 | * eax = 70 - function number |
4188 | * eax = 70 - function number |
4191 | * ebx = pointer to the information structure |
4189 | * ebx = pointer to the information structure |
4192 | Format of the information structure: |
4190 | Format of the information structure: |
4193 | * +0: dword: 6 = subfunction number |
4191 | * +0: dword: 6 = subfunction number |
4194 | * +4: dword: 0 (reserved) |
4192 | * +4: dword: 0 (reserved) |
4195 | * +8: dword: 0 (reserved) |
4193 | * +8: dword: 0 (reserved) |
4196 | * +12 = +0xC: dword: 0 (reserved) |
4194 | * +12 = +0xC: dword: 0 (reserved) |
4197 | * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes) |
4195 | * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes) |
4198 | * +20 = +0x14: path, general rules of names forming |
4196 | * +20 = +0x14: path, general rules of names forming |
4199 | Returned value: |
4197 | Returned value: |
4200 | * eax = 0 - success, otherwise file system error code |
4198 | * eax = 0 - success, otherwise file system error code |
4201 | * ebx destroyed |
4199 | * ebx destroyed |
4202 | File attributes are first 32 bytes in BDFE (block of data |
4200 | File attributes are first 32 bytes in BDFE (block of data |
4203 | for folder entry), explained in the description of subfunction 1 |
4201 | for folder entry), explained in the description of subfunction 1 |
4204 | (that is, without name and size of file). Attribute |
4202 | (that is, without name and size of file). Attribute |
4205 | file/folder/volume label (bits 3,4 in dword +0) is not changed. |
4203 | file/folder/volume label (bits 3,4 in dword +0) is not changed. |
4206 | Byte +4 (name format) is ignored. |
4204 | Byte +4 (name format) is ignored. |
4207 | Remarks: |
4205 | Remarks: |
4208 | * The function does not support virtual folders such as /, /rd and |
4206 | * The function does not support virtual folders such as /, /rd and |
4209 | root folders like /rd/1. |
4207 | root folders like /rd/1. |
4210 | * The function is not supported for CD (returns error code 2). |
4208 | * The function is not supported for CD (returns error code 2). |
4211 | 4209 | ||
4212 | ---------------------- Constants for registers: ---------------------- |
4210 | ---------------------- Constants for registers: ---------------------- |
4213 | eax - SF_FILE (70) |
4211 | eax - SF_FILE (70) |
4214 | [ebx] - SSF_SET_INFO (6) |
4212 | [ebx] - SSF_SET_INFO (6) |
4215 | ====================================================================== |
4213 | ====================================================================== |
4216 | =========== Function 70, subfunction 7 - start application. ========== |
4214 | =========== Function 70, subfunction 7 - start application. ========== |
4217 | ====================================================================== |
4215 | ====================================================================== |
4218 | Parameters: |
4216 | Parameters: |
4219 | * eax = 70 - function number |
4217 | * eax = 70 - function number |
4220 | * ebx = pointer to the information structure |
4218 | * ebx = pointer to the information structure |
4221 | Format of the information structure: |
4219 | Format of the information structure: |
4222 | * +0: dword: 7 = subfunction number |
4220 | * +0: dword: 7 = subfunction number |
4223 | * +4: dword: flags field: |
4221 | * +4: dword: flags field: |
4224 | * bit 0: start process as debugged |
4222 | * bit 0: start process as debugged |
4225 | * other bits are reserved and must be set to 0 |
4223 | * other bits are reserved and must be set to 0 |
4226 | * +8: dword: 0 or pointer to ASCIIZ-string with parameters |
4224 | * +8: dword: 0 or pointer to ASCIIZ-string with parameters |
4227 | * +12 = +0xC: dword: 0 (reserved) |
4225 | * +12 = +0xC: dword: 0 (reserved) |
4228 | * +16 = +0x10: dword: 0 (reserved) |
4226 | * +16 = +0x10: dword: 0 (reserved) |
4229 | * +20 = +0x14: path, general rules of names forming |
4227 | * +20 = +0x14: path, general rules of names forming |
4230 | Returned value: |
4228 | Returned value: |
4231 | * eax > 0 - program is loaded, eax contains PID |
4229 | * eax > 0 - program is loaded, eax contains PID |
4232 | * eax < 0 - an error has occured, -eax contains |
4230 | * eax < 0 - an error has occured, -eax contains |
4233 | file system error code |
4231 | file system error code |
4234 | * ebx destroyed |
4232 | * ebx destroyed |
4235 | Remarks: |
4233 | Remarks: |
4236 | * Command line must be terminated by the character with the code 0 |
4234 | * Command line must be terminated by the character with the code 0 |
4237 | (ASCIIZ-string); function takes into account either all characters |
4235 | (ASCIIZ-string); function takes into account either all characters |
4238 | up to terminating zero inclusively or first 256 character |
4236 | up to terminating zero inclusively or first 256 character |
4239 | regarding what is less. |
4237 | regarding what is less. |
4240 | * If the process is started as debugged, it is created in |
4238 | * If the process is started as debugged, it is created in |
4241 | the suspended state; to run use subfunction 5 of function 69. |
4239 | the suspended state; to run use subfunction 5 of function 69. |
4242 | 4240 | ||
4243 | ---------------------- Constants for registers: ---------------------- |
4241 | ---------------------- Constants for registers: ---------------------- |
4244 | eax - SF_FILE (70) |
4242 | eax - SF_FILE (70) |
4245 | [ebx] - SSF_START_APP (7) |
4243 | [ebx] - SSF_START_APP (7) |
4246 | ====================================================================== |
4244 | ====================================================================== |
4247 | ========== Function 70, subfunction 8 - delete file/folder. ========== |
4245 | ========== Function 70, subfunction 8 - delete file/folder. ========== |
4248 | ====================================================================== |
4246 | ====================================================================== |
4249 | Parameters: |
4247 | Parameters: |
4250 | * eax = 70 - function number |
4248 | * eax = 70 - function number |
4251 | * ebx = pointer to the information structure |
4249 | * ebx = pointer to the information structure |
4252 | Format of the information structure: |
4250 | Format of the information structure: |
4253 | * +0: dword: 8 = subfunction number |
4251 | * +0: dword: 8 = subfunction number |
4254 | * +4: dword: 0 (reserved) |
4252 | * +4: dword: 0 (reserved) |
4255 | * +8: dword: 0 (reserved) |
4253 | * +8: dword: 0 (reserved) |
4256 | * +12 = +0xC: dword: 0 (reserved) |
4254 | * +12 = +0xC: dword: 0 (reserved) |
4257 | * +16 = +0x10: dword: 0 (reserved) |
4255 | * +16 = +0x10: dword: 0 (reserved) |
4258 | * +20 = +0x14: path, general rules of names forming |
4256 | * +20 = +0x14: path, general rules of names forming |
4259 | Returned value: |
4257 | Returned value: |
4260 | * eax = 0 - success, otherwise file system error code |
4258 | * eax = 0 - success, otherwise file system error code |
4261 | * ebx destroyed |
4259 | * ebx destroyed |
4262 | Remarks: |
4260 | Remarks: |
4263 | * The function is not supported for CD (returns error code 2). |
4261 | * The function is not supported for CD (returns error code 2). |
4264 | * The function can delete only empty folders (attempt to delete |
4262 | * The function can delete only empty folders (attempt to delete |
4265 | nonempty folder results in error with code 10, "access denied"). |
4263 | nonempty folder results in error with code 10, "access denied"). |
4266 | 4264 | ||
4267 | ---------------------- Constants for registers: ---------------------- |
4265 | ---------------------- Constants for registers: ---------------------- |
4268 | eax - SF_FILE (70) |
4266 | eax - SF_FILE (70) |
4269 | [ebx] - SSF_DELETE (8) |
4267 | [ebx] - SSF_DELETE (8) |
4270 | ====================================================================== |
4268 | ====================================================================== |
4271 | ============= Function 70, subfunction 9 - create folder. ============ |
4269 | ============= Function 70, subfunction 9 - create folder. ============ |
4272 | ====================================================================== |
4270 | ====================================================================== |
4273 | Parameters: |
4271 | Parameters: |
4274 | * eax = 70 - function number |
4272 | * eax = 70 - function number |
4275 | * ebx = pointer to the information structure |
4273 | * ebx = pointer to the information structure |
4276 | Format of the information structure: |
4274 | Format of the information structure: |
4277 | * +0: dword: 9 = subfunction number |
4275 | * +0: dword: 9 = subfunction number |
4278 | * +4: dword: 0 (reserved) |
4276 | * +4: dword: 0 (reserved) |
4279 | * +8: dword: 0 (reserved) |
4277 | * +8: dword: 0 (reserved) |
4280 | * +12 = +0xC: dword: 0 (reserved) |
4278 | * +12 = +0xC: dword: 0 (reserved) |
4281 | * +16 = +0x10: dword: 0 (reserved) |
4279 | * +16 = +0x10: dword: 0 (reserved) |
4282 | * +20 = +0x14: path, general rules of names forming |
4280 | * +20 = +0x14: path, general rules of names forming |
4283 | Returned value: |
4281 | Returned value: |
4284 | * eax = 0 - success, otherwise file system error code |
4282 | * eax = 0 - success, otherwise file system error code |
4285 | * ebx destroyed |
4283 | * ebx destroyed |
4286 | Remarks: |
4284 | Remarks: |
4287 | * The function is not supported for CD (returns error code 2). |
4285 | * The function is not supported for CD (returns error code 2). |
4288 | * The parent folder must already exist. |
4286 | * The parent folder must already exist. |
4289 | * If target folder already exists, function returns success (eax=0). |
4287 | * If target folder already exists, function returns success (eax=0). |
4290 | 4288 | ||
4291 | ---------------------- Constants for registers: ---------------------- |
4289 | ---------------------- Constants for registers: ---------------------- |
4292 | eax - SF_FILE (70) |
4290 | eax - SF_FILE (70) |
4293 | [ebx] - SSF_CREATE_FOLDER (9) |
4291 | [ebx] - SSF_CREATE_FOLDER (9) |
4294 | ====================================================================== |
4292 | ====================================================================== |
4295 | ================== Function 71 - set window caption ================== |
4293 | ================== Function 71 - set window caption ================== |
4296 | ====================================================================== |
4294 | ====================================================================== |
4297 | Parameters: |
4295 | Parameters: |
4298 | * eax = 71 - function number |
4296 | * eax = 71 - function number |
4299 | * ebx = 1 |
4297 | * ebx = 1 |
4300 | * ecx = pointer to zero terminated string, |
4298 | * ecx = pointer to zero terminated string, |
4301 | the string may start with an encoding byte: |
4299 | the string may start with an encoding byte: |
4302 | 1 = cp866 |
4300 | 1 = cp866 |
4303 | 2 = UTF-16LE |
4301 | 2 = UTF-16LE |
4304 | 3 = UTF-8 |
4302 | 3 = UTF-8 |
4305 | or: |
4303 | or: |
4306 | * ebx = 2 |
4304 | * ebx = 2 |
4307 | * ecx = pointer to zero terminated string |
4305 | * ecx = pointer to zero terminated string |
4308 | * dl = string encoding |
4306 | * dl = string encoding |
4309 | Returned value: |
4307 | Returned value: |
4310 | * function does not return value |
4308 | * function does not return value |
4311 | Remarks: |
4309 | Remarks: |
4312 | * Pass NULL in ecx to remove caption. |
4310 | * Pass NULL in ecx to remove caption. |
4313 | 4311 | ||
4314 | ---------------------- Constants for registers: ---------------------- |
4312 | ---------------------- Constants for registers: ---------------------- |
4315 | eax - SF_SET_CAPTION (71) |
4313 | eax - SF_SET_CAPTION (71) |
4316 | ====================================================================== |
4314 | ====================================================================== |
4317 | =============== Function 72 - send message to a window. ============== |
4315 | =============== Function 72 - send message to a window. ============== |
4318 | ====================================================================== |
4316 | ====================================================================== |
4319 | 4317 | ||
4320 | - Subfunction 1 - send message with parameter to the active window. -- |
4318 | - Subfunction 1 - send message with parameter to the active window. -- |
4321 | Parameters: |
4319 | Parameters: |
4322 | * eax = 72 - function number |
4320 | * eax = 72 - function number |
4323 | * ebx = 1 - subfunction number |
4321 | * ebx = 1 - subfunction number |
4324 | * ecx = event code: 2 or 3 |
4322 | * ecx = event code: 2 or 3 |
4325 | * edx = parameter: key code for ecx=2, button identifier for ecx=3 |
4323 | * edx = parameter: key code for ecx=2, button identifier for ecx=3 |
4326 | Returned value: |
4324 | Returned value: |
4327 | * eax = 0 - success |
4325 | * eax = 0 - success |
4328 | * eax = 1 - buffer is full |
4326 | * eax = 1 - buffer is full |
4329 | 4327 | ||
4330 | ---------------------- Constants for registers: ---------------------- |
4328 | ---------------------- Constants for registers: ---------------------- |
4331 | eax - SF_SEND_MESSAGE (72) |
4329 | eax - SF_SEND_MESSAGE (72) |
4332 | ====================================================================== |
4330 | ====================================================================== |
4333 | ===================== Function 73 - blit bitmap ===================== |
4331 | ===================== Function 73 - blit bitmap ===================== |
4334 | ====================================================================== |
4332 | ====================================================================== |
4335 | 4333 | ||
4336 | Parameters: |
4334 | Parameters: |
4337 | * eax = 73 - function number |
4335 | * eax = 73 - function number |
4338 | 4336 | ||
4339 | * ebx = ROP and optional flags |
4337 | * ebx = ROP and optional flags |
4340 | 31 30 29 28 6 5 4 3 0 |
4338 | 31 30 29 28 6 5 4 3 0 |
4341 | [reserved][CR][reserved][T][B][ROP] |
4339 | [reserved][CR][reserved][T][B][ROP] |
4342 | ROP - raster operation code |
4340 | ROP - raster operation code |
4343 | 0: Copy |
4341 | 0: Copy |
4344 | 1-15: reserved |
4342 | 1-15: reserved |
4345 | B - blit into the background surface |
4343 | B - blit into the background surface |
4346 | T - transparent blit |
4344 | T - transparent blit |
4347 | CR - blit client relative |
4345 | CR - blit client relative |
4348 | 4346 | ||
4349 | * ecx = pointer to the function parameters |
4347 | * ecx = pointer to the function parameters |
4350 | destination offset and clipping |
4348 | destination offset and clipping |
4351 | +0 signed dword: destination rectangle X offset from the window |
4349 | +0 signed dword: destination rectangle X offset from the window |
4352 | top-left corner |
4350 | top-left corner |
4353 | +4 signed dword: destination rectangle Y offset from the window |
4351 | +4 signed dword: destination rectangle Y offset from the window |
4354 | top-left corner |
4352 | top-left corner |
4355 | +8 dword: destination rectangle width |
4353 | +8 dword: destination rectangle width |
4356 | +12 dword: destination rectangle height |
4354 | +12 dword: destination rectangle height |
4357 | 4355 | ||
4358 | source offset and clipping |
4356 | source offset and clipping |
4359 | +16 signed dword: source rectangle X offset from the bitmap |
4357 | +16 signed dword: source rectangle X offset from the bitmap |
4360 | top-left corner |
4358 | top-left corner |
4361 | +20 signed dword: source rectangle Y offset from the bitmap |
4359 | +20 signed dword: source rectangle Y offset from the bitmap |
4362 | top-left corner |
4360 | top-left corner |
4363 | +24 dword: source rectangle width |
4361 | +24 dword: source rectangle width |
4364 | +28 dword: source rectangle height |
4362 | +28 dword: source rectangle height |
4365 | 4363 | ||
4366 | +32: dword: bitmap data - must be 32bpp |
4364 | +32: dword: bitmap data - must be 32bpp |
4367 | +36: dword: size of the bitmap row in bytes |
4365 | +36: dword: size of the bitmap row in bytes |
4368 | 4366 | ||
4369 | Returned value: |
4367 | Returned value: |
4370 | * function does not return value |
4368 | * function does not return value |
4371 | 4369 | ||
4372 | ---------------------- Constants for registers: ---------------------- |
4370 | ---------------------- Constants for registers: ---------------------- |
4373 | eax - SF_BLITTER (73) |
4371 | eax - SF_BLITTER (73) |
4374 | ====================================================================== |
4372 | ====================================================================== |
4375 | = Function 74, Subfunction 255, Get number of active network devices. = |
4373 | = Function 74, Subfunction 255, Get number of active network devices. = |
4376 | ====================================================================== |
4374 | ====================================================================== |
4377 | Parameters: |
4375 | Parameters: |
4378 | * eax = 74 - function number |
4376 | * eax = 74 - function number |
4379 | * bl = 255 - subfunction number |
4377 | * bl = 255 - subfunction number |
4380 | Returned value: |
4378 | Returned value: |
4381 | * eax = number of active network devices |
4379 | * eax = number of active network devices |
4382 | 4380 | ||
4383 | ---------------------- Constants for registers: ---------------------- |
4381 | ---------------------- Constants for registers: ---------------------- |
4384 | eax - SF_NETWORK_GET (74) |
4382 | eax - SF_NETWORK_GET (74) |
4385 | bl - SSF_DEVICE_COUNT (255) |
4383 | bl - SSF_DEVICE_COUNT (255) |
4386 | ====================================================================== |
4384 | ====================================================================== |
4387 | ======== Function 74, Subfunction 0, Get network device type. ======== |
4385 | ======== Function 74, Subfunction 0, Get network device type. ======== |
4388 | ====================================================================== |
4386 | ====================================================================== |
4389 | Parameters: |
4387 | Parameters: |
4390 | * eax = 74 - function number |
4388 | * eax = 74 - function number |
4391 | * bl = 0 - subfunction number |
4389 | * bl = 0 - subfunction number |
4392 | * bh = device number |
4390 | * bh = device number |
4393 | Returned value: |
4391 | Returned value: |
4394 | * eax = device type number |
4392 | * eax = device type number |
4395 | 4393 | ||
4396 | ---------------------- Constants for registers: ---------------------- |
4394 | ---------------------- Constants for registers: ---------------------- |
4397 | eax - SF_NETWORK_GET (74) |
4395 | eax - SF_NETWORK_GET (74) |
4398 | bl - SSF_DEVICE_TYPE (0) |
4396 | bl - SSF_DEVICE_TYPE (0) |
4399 | ====================================================================== |
4397 | ====================================================================== |
4400 | ======== Function 74, Subfunction 1, Get network device name. ======== |
4398 | ======== Function 74, Subfunction 1, Get network device name. ======== |
4401 | ====================================================================== |
4399 | ====================================================================== |
4402 | Parameters: |
4400 | Parameters: |
4403 | * eax = 74 - function number |
4401 | * eax = 74 - function number |
4404 | * bl = 1 - subfunction number |
4402 | * bl = 1 - subfunction number |
4405 | * bh = device number |
4403 | * bh = device number |
4406 | * ecx = pointer to 64 byte buffer |
4404 | * ecx = pointer to 64 byte buffer |
4407 | Returned value: |
4405 | Returned value: |
4408 | * eax = -1 on error |
4406 | * eax = -1 on error |
4409 | * The network device name is written into the buffer, on success |
4407 | * The network device name is written into the buffer, on success |
4410 | 4408 | ||
4411 | ---------------------- Constants for registers: ---------------------- |
4409 | ---------------------- Constants for registers: ---------------------- |
4412 | eax - SF_NETWORK_GET (74) |
4410 | eax - SF_NETWORK_GET (74) |
4413 | bl - SSF_DEVICE_NAME (1) |
4411 | bl - SSF_DEVICE_NAME (1) |
4414 | ====================================================================== |
4412 | ====================================================================== |
4415 | ========= Function 74, Subfunction 2, Reset network device. ========== |
4413 | ========= Function 74, Subfunction 2, Reset network device. ========== |
4416 | ====================================================================== |
4414 | ====================================================================== |
4417 | Parameters: |
4415 | Parameters: |
4418 | * eax = 74 - function number |
4416 | * eax = 74 - function number |
4419 | * bl = 2 - subfunction number |
4417 | * bl = 2 - subfunction number |
4420 | * bh = device number |
4418 | * bh = device number |
4421 | Returned value: |
4419 | Returned value: |
4422 | * eax = -1 on error |
4420 | * eax = -1 on error |
4423 | 4421 | ||
4424 | ---------------------- Constants for registers: ---------------------- |
4422 | ---------------------- Constants for registers: ---------------------- |
4425 | eax - SF_NETWORK_GET (74) |
4423 | eax - SF_NETWORK_GET (74) |
4426 | bl - SSF_RESET_DEVICE (2) |
4424 | bl - SSF_RESET_DEVICE (2) |
4427 | ====================================================================== |
4425 | ====================================================================== |
4428 | ========== Function 74, Subfunction 3, Stop network device. ========== |
4426 | ========== Function 74, Subfunction 3, Stop network device. ========== |
4429 | ====================================================================== |
4427 | ====================================================================== |
4430 | Parameters: |
4428 | Parameters: |
4431 | * eax = 74 - function number |
4429 | * eax = 74 - function number |
4432 | * bl = 3 - subfunction number |
4430 | * bl = 3 - subfunction number |
4433 | * bh = device number |
4431 | * bh = device number |
4434 | Returned value: |
4432 | Returned value: |
4435 | * eax = -1 on error |
4433 | * eax = -1 on error |
4436 | 4434 | ||
4437 | ---------------------- Constants for registers: ---------------------- |
4435 | ---------------------- Constants for registers: ---------------------- |
4438 | eax - SF_NETWORK_GET (74) |
4436 | eax - SF_NETWORK_GET (74) |
4439 | bl - SSF_STOP_DEVICE (3) |
4437 | bl - SSF_STOP_DEVICE (3) |
4440 | ====================================================================== |
4438 | ====================================================================== |
4441 | =========== Function 74, Subfunction 4, Get device pointer. ========== |
4439 | =========== Function 74, Subfunction 4, Get device pointer. ========== |
4442 | ====================================================================== |
4440 | ====================================================================== |
4443 | Parameters: |
4441 | Parameters: |
4444 | * eax = 74 - function number |
4442 | * eax = 74 - function number |
4445 | * bl = 4 - subfunction number |
4443 | * bl = 4 - subfunction number |
4446 | * bh = device number |
4444 | * bh = device number |
4447 | Returned value: |
4445 | Returned value: |
4448 | * eax = device pointer, -1 on error |
4446 | * eax = device pointer, -1 on error |
4449 | 4447 | ||
4450 | ---------------------- Constants for registers: ---------------------- |
4448 | ---------------------- Constants for registers: ---------------------- |
4451 | eax - SF_NETWORK_GET (74) |
4449 | eax - SF_NETWORK_GET (74) |
4452 | bl - SSF_DEVICE_POINER (4) |
4450 | bl - SSF_DEVICE_POINER (4) |
4453 | ====================================================================== |
4451 | ====================================================================== |
4454 | ========= Function 74, Subfunction 6, Get packet TX counter. ========= |
4452 | ========= Function 74, Subfunction 6, Get packet TX counter. ========= |
4455 | ====================================================================== |
4453 | ====================================================================== |
4456 | Parameters: |
4454 | Parameters: |
4457 | * eax = 74 - function number |
4455 | * eax = 74 - function number |
4458 | * bl = 6 - subfunction number |
4456 | * bl = 6 - subfunction number |
4459 | * bh = device number |
4457 | * bh = device number |
4460 | Returned value: |
4458 | Returned value: |
4461 | * eax = Number of packets sent since device start, -1 on error |
4459 | * eax = Number of packets sent since device start, -1 on error |
4462 | 4460 | ||
4463 | ---------------------- Constants for registers: ---------------------- |
4461 | ---------------------- Constants for registers: ---------------------- |
4464 | eax - SF_NETWORK_GET (74) |
4462 | eax - SF_NETWORK_GET (74) |
4465 | bl - SSF_TX_PACKET_COUNT (6) |
4463 | bl - SSF_TX_PACKET_COUNT (6) |
4466 | ====================================================================== |
4464 | ====================================================================== |
4467 | ========= Function 74, Subfunction 7, Get packet RX counter. ========= |
4465 | ========= Function 74, Subfunction 7, Get packet RX counter. ========= |
4468 | ====================================================================== |
4466 | ====================================================================== |
4469 | Parameters: |
4467 | Parameters: |
4470 | * eax = 74 - function number |
4468 | * eax = 74 - function number |
4471 | * bl = 7 - subfunction number |
4469 | * bl = 7 - subfunction number |
4472 | * bh = device number |
4470 | * bh = device number |
4473 | Returned value: |
4471 | Returned value: |
4474 | * eax = Number of packets received since device start, -1 on error |
4472 | * eax = Number of packets received since device start, -1 on error |
4475 | 4473 | ||
4476 | ---------------------- Constants for registers: ---------------------- |
4474 | ---------------------- Constants for registers: ---------------------- |
4477 | eax - SF_NETWORK_GET (74) |
4475 | eax - SF_NETWORK_GET (74) |
4478 | bl - SSF_RX_PACKET_COUNT (7) |
4476 | bl - SSF_RX_PACKET_COUNT (7) |
4479 | ====================================================================== |
4477 | ====================================================================== |
4480 | ========== Function 74, Subfunction 8, Get TX byte counter. ========== |
4478 | ========== Function 74, Subfunction 8, Get TX byte counter. ========== |
4481 | ====================================================================== |
4479 | ====================================================================== |
4482 | Parameters: |
4480 | Parameters: |
4483 | * eax = 74 - function number |
4481 | * eax = 74 - function number |
4484 | * bl = 8 - subfunction number |
4482 | * bl = 8 - subfunction number |
4485 | * bh = device number |
4483 | * bh = device number |
4486 | Returned value: |
4484 | Returned value: |
4487 | * eax = Number of bytes sent since device start (lower dword) |
4485 | * eax = Number of bytes sent since device start (lower dword) |
4488 | -1 on error |
4486 | -1 on error |
4489 | * ebx = Number of bytes sent since device start (higher dword) |
4487 | * ebx = Number of bytes sent since device start (higher dword) |
4490 | 4488 | ||
4491 | ---------------------- Constants for registers: ---------------------- |
4489 | ---------------------- Constants for registers: ---------------------- |
4492 | eax - SF_NETWORK_GET (74) |
4490 | eax - SF_NETWORK_GET (74) |
4493 | bl - SSF_TX_BYTE_COUNT (8) |
4491 | bl - SSF_TX_BYTE_COUNT (8) |
4494 | ====================================================================== |
4492 | ====================================================================== |
4495 | ========== Function 74, Subfunction 9, Get RX byte counter. ========== |
4493 | ========== Function 74, Subfunction 9, Get RX byte counter. ========== |
4496 | ====================================================================== |
4494 | ====================================================================== |
4497 | Parameters: |
4495 | Parameters: |
4498 | * eax = 74 - function number |
4496 | * eax = 74 - function number |
4499 | * bl = 9 - subfunction number |
4497 | * bl = 9 - subfunction number |
4500 | * bh = device number |
4498 | * bh = device number |
4501 | Returned value: |
4499 | Returned value: |
4502 | * eax = Number of bytes received since device start (lower dword) |
4500 | * eax = Number of bytes received since device start (lower dword) |
4503 | -1 on error |
4501 | -1 on error |
4504 | * ebx = Number of bytes received since device start (higher dword) |
4502 | * ebx = Number of bytes received since device start (higher dword) |
4505 | 4503 | ||
4506 | ---------------------- Constants for registers: ---------------------- |
4504 | ---------------------- Constants for registers: ---------------------- |
4507 | eax - SF_NETWORK_GET (74) |
4505 | eax - SF_NETWORK_GET (74) |
4508 | bl - SSF_RX_BYTE_COUNT (9) |
4506 | bl - SSF_RX_BYTE_COUNT (9) |
4509 | ====================================================================== |
4507 | ====================================================================== |
4510 | ========== Function 74, Subfunction 10, Get link status. ============= |
4508 | ========== Function 74, Subfunction 10, Get link status. ============= |
4511 | ====================================================================== |
4509 | ====================================================================== |
4512 | Parameters: |
4510 | Parameters: |
4513 | * eax = 74 - function number |
4511 | * eax = 74 - function number |
4514 | * bl = 10 - subfunction number |
4512 | * bl = 10 - subfunction number |
4515 | * bh = device number |
4513 | * bh = device number |
4516 | Returned value: |
4514 | Returned value: |
4517 | * eax = link status, -1 on error |
4515 | * eax = link status, -1 on error |
4518 | 4516 | ||
4519 | Link status: |
4517 | Link status: |
4520 | ETH_LINK_DOWN = 0b ; Link is down |
4518 | ETH_LINK_DOWN = 0b ; Link is down |
4521 | ETH_LINK_UNKNOWN= 1b ; There could be an active link |
4519 | ETH_LINK_UNKNOWN= 1b ; There could be an active link |
4522 | ETH_LINK_FD = 10b ; full duplex flag |
4520 | ETH_LINK_FD = 10b ; full duplex flag |
4523 | ETH_LINK_10M = 100b ; 10 mbit |
4521 | ETH_LINK_10M = 100b ; 10 mbit |
4524 | ETH_LINK_100M = 1000b ; 100 mbit |
4522 | ETH_LINK_100M = 1000b ; 100 mbit |
4525 | ETH_LINK_1G = 1100b ; gigabit |
4523 | ETH_LINK_1G = 1100b ; gigabit |
4526 | 4524 | ||
4527 | ---------------------- Constants for registers: ---------------------- |
4525 | ---------------------- Constants for registers: ---------------------- |
4528 | eax - SF_NETWORK_GET (74) |
4526 | eax - SF_NETWORK_GET (74) |
4529 | bl - SSF_LINK_STATUS (10) |
4527 | bl - SSF_LINK_STATUS (10) |
4530 | ====================================================================== |
4528 | ====================================================================== |
4531 | ============== Function 75, Subfunction 0, Open socket. ============== |
4529 | ============== Function 75, Subfunction 0, Open socket. ============== |
4532 | ====================================================================== |
4530 | ====================================================================== |
4533 | Parameters: |
4531 | Parameters: |
4534 | * eax = 75 - function number |
4532 | * eax = 75 - function number |
4535 | * bl = 0 - subfunction number |
4533 | * bl = 0 - subfunction number |
4536 | * ecx = domain |
4534 | * ecx = domain |
4537 | * edx = type |
4535 | * edx = type |
4538 | * esi = protocol |
4536 | * esi = protocol |
4539 | Returned value: |
4537 | Returned value: |
4540 | * eax = socket number, -1 on error |
4538 | * eax = socket number, -1 on error |
4541 | * ebx = errorcode |
4539 | * ebx = errorcode |
4542 | 4540 | ||
4543 | ---------------------- Constants for registers: ---------------------- |
4541 | ---------------------- Constants for registers: ---------------------- |
4544 | eax - SF_NETWORK_SOCKET (75) |
4542 | eax - SF_NETWORK_SOCKET (75) |
4545 | bl - SSF_OPEN (0) |
4543 | bl - SSF_OPEN (0) |
4546 | ====================================================================== |
4544 | ====================================================================== |
4547 | ============= Function 75, Subfunction 1, Close socket. ============== |
4545 | ============= Function 75, Subfunction 1, Close socket. ============== |
4548 | ====================================================================== |
4546 | ====================================================================== |
4549 | Parameters: |
4547 | Parameters: |
4550 | * eax = 75 - function number |
4548 | * eax = 75 - function number |
4551 | * bl = 1 - subfunction number |
4549 | * bl = 1 - subfunction number |
4552 | * ecx = socket number |
4550 | * ecx = socket number |
4553 | Returned value: |
4551 | Returned value: |
4554 | * eax = -1 on error |
4552 | * eax = -1 on error |
4555 | * ebx = errorcode |
4553 | * ebx = errorcode |
4556 | 4554 | ||
4557 | ---------------------- Constants for registers: ---------------------- |
4555 | ---------------------- Constants for registers: ---------------------- |
4558 | eax - SF_NETWORK_SOCKET (75) |
4556 | eax - SF_NETWORK_SOCKET (75) |
4559 | bl - SSF_CLOSE (1) |
4557 | bl - SSF_CLOSE (1) |
4560 | ====================================================================== |
4558 | ====================================================================== |
4561 | ================== Function 75, Subfunction 2, Bind. ================= |
4559 | ================== Function 75, Subfunction 2, Bind. ================= |
4562 | ====================================================================== |
4560 | ====================================================================== |
4563 | Parameters: |
4561 | Parameters: |
4564 | * eax = 75 - function number |
4562 | * eax = 75 - function number |
4565 | * bl = 2 - subfunction number |
4563 | * bl = 2 - subfunction number |
4566 | * ecx = socket number |
4564 | * ecx = socket number |
4567 | * edx = pointer to sockaddr structure |
4565 | * edx = pointer to sockaddr structure |
4568 | * esi = length of sockaddr structure |
4566 | * esi = length of sockaddr structure |
4569 | Format of SockAddr structure: |
4567 | Format of SockAddr structure: |
4570 | * +0: Word: Family |
4568 | * +0: Word: Family |
4571 | * +2: 14*Byte: Data |
4569 | * +2: 14*Byte: Data |
4572 | Returned value: |
4570 | Returned value: |
4573 | * eax = -1 on error |
4571 | * eax = -1 on error |
4574 | * ebx = errorcode |
4572 | * ebx = errorcode |
4575 | 4573 | ||
4576 | ---------------------- Constants for registers: ---------------------- |
4574 | ---------------------- Constants for registers: ---------------------- |
4577 | eax - SF_NETWORK_SOCKET (75) |
4575 | eax - SF_NETWORK_SOCKET (75) |
4578 | bl - SSF_BIND (2) |
4576 | bl - SSF_BIND (2) |
4579 | ====================================================================== |
4577 | ====================================================================== |
4580 | ================= Function 75, Subfunction 3, Listen. ================ |
4578 | ================= Function 75, Subfunction 3, Listen. ================ |
4581 | ====================================================================== |
4579 | ====================================================================== |
4582 | Parameters: |
4580 | Parameters: |
4583 | * eax = 75 - function number |
4581 | * eax = 75 - function number |
4584 | * bl = 3 - subfunction number |
4582 | * bl = 3 - subfunction number |
4585 | * ecx = socket number |
4583 | * ecx = socket number |
4586 | * edx = backlog |
4584 | * edx = backlog |
4587 | Returned value: |
4585 | Returned value: |
4588 | * eax = -1 on error |
4586 | * eax = -1 on error |
4589 | * ebx = errorcode |
4587 | * ebx = errorcode |
4590 | 4588 | ||
4591 | ---------------------- Constants for registers: ---------------------- |
4589 | ---------------------- Constants for registers: ---------------------- |
4592 | eax - SF_NETWORK_SOCKET (75) |
4590 | eax - SF_NETWORK_SOCKET (75) |
4593 | bl - SSF_LISTEN (3) |
4591 | bl - SSF_LISTEN (3) |
4594 | ====================================================================== |
4592 | ====================================================================== |
4595 | ================ Function 75, Subfunction 4, Connect. ================ |
4593 | ================ Function 75, Subfunction 4, Connect. ================ |
4596 | ====================================================================== |
4594 | ====================================================================== |
4597 | Parameters: |
4595 | Parameters: |
4598 | * eax = 75 - function number |
4596 | * eax = 75 - function number |
4599 | * bl = 4 - subfunction number |
4597 | * bl = 4 - subfunction number |
4600 | * ecx = socket number |
4598 | * ecx = socket number |
4601 | * edx = pointer to sockaddr structure |
4599 | * edx = pointer to sockaddr structure |
4602 | * esi = length of sockaddr structure |
4600 | * esi = length of sockaddr structure |
4603 | Format of SockAddr structure: |
4601 | Format of SockAddr structure: |
4604 | * +0: Word: Family |
4602 | * +0: Word: Family |
4605 | * +2: 14*Byte: Data |
4603 | * +2: 14*Byte: Data |
4606 | Returned value: |
4604 | Returned value: |
4607 | * eax = -1 on error |
4605 | * eax = -1 on error |
4608 | * ebx = errorcode |
4606 | * ebx = errorcode |
4609 | 4607 | ||
4610 | ---------------------- Constants for registers: ---------------------- |
4608 | ---------------------- Constants for registers: ---------------------- |
4611 | eax - SF_NETWORK_SOCKET (75) |
4609 | eax - SF_NETWORK_SOCKET (75) |
4612 | bl - SSF_CONNECT (4) |
4610 | bl - SSF_CONNECT (4) |
4613 | ====================================================================== |
4611 | ====================================================================== |
4614 | ================= Function 75, Subfunction 5, Accept. ================ |
4612 | ================= Function 75, Subfunction 5, Accept. ================ |
4615 | ====================================================================== |
4613 | ====================================================================== |
4616 | Parameters: |
4614 | Parameters: |
4617 | * eax = 75 - function number |
4615 | * eax = 75 - function number |
4618 | * bl = 5 - subfunction number |
4616 | * bl = 5 - subfunction number |
4619 | * ecx = socket number |
4617 | * ecx = socket number |
4620 | * edx = pointer to sockaddr structure |
4618 | * edx = pointer to sockaddr structure |
4621 | * esi = length of sockaddr structure |
4619 | * esi = length of sockaddr structure |
4622 | Format of SockAddr structure: |
4620 | Format of SockAddr structure: |
4623 | * +0: Word: Family |
4621 | * +0: Word: Family |
4624 | * +2: 14*Byte: Data |
4622 | * +2: 14*Byte: Data |
4625 | Returned value: |
4623 | Returned value: |
4626 | * eax = socket number of accepted socket, -1 on error |
4624 | * eax = socket number of accepted socket, -1 on error |
4627 | * ebx = errorcode |
4625 | * ebx = errorcode |
4628 | 4626 | ||
4629 | ---------------------- Constants for registers: ---------------------- |
4627 | ---------------------- Constants for registers: ---------------------- |
4630 | eax - SF_NETWORK_SOCKET (75) |
4628 | eax - SF_NETWORK_SOCKET (75) |
4631 | bl - SSF_ACCEPT (5) |
4629 | bl - SSF_ACCEPT (5) |
4632 | ====================================================================== |
4630 | ====================================================================== |
4633 | ================== Function 75, Subfunction 6, Send. ================= |
4631 | ================== Function 75, Subfunction 6, Send. ================= |
4634 | ====================================================================== |
4632 | ====================================================================== |
4635 | Parameters: |
4633 | Parameters: |
4636 | * eax = 75 - function number |
4634 | * eax = 75 - function number |
4637 | * bl = 6 - subfunction number |
4635 | * bl = 6 - subfunction number |
4638 | * ecx = socket number |
4636 | * ecx = socket number |
4639 | * edx = pointer to buffer |
4637 | * edx = pointer to buffer |
4640 | * esi = length of buffer |
4638 | * esi = length of buffer |
4641 | * edi = flags |
4639 | * edi = flags |
4642 | Returned value: |
4640 | Returned value: |
4643 | * eax = number of bytes copied, -1 on error |
4641 | * eax = number of bytes copied, -1 on error |
4644 | * ebx = errorcode |
4642 | * ebx = errorcode |
4645 | 4643 | ||
4646 | ---------------------- Constants for registers: ---------------------- |
4644 | ---------------------- Constants for registers: ---------------------- |
4647 | eax - SF_NETWORK_SOCKET (75) |
4645 | eax - SF_NETWORK_SOCKET (75) |
4648 | bl - SSF_SEND (6) |
4646 | bl - SSF_SEND (6) |
4649 | ====================================================================== |
4647 | ====================================================================== |
4650 | ================ Function 75, Subfunction 7, Receive. ================ |
4648 | ================ Function 75, Subfunction 7, Receive. ================ |
4651 | ====================================================================== |
4649 | ====================================================================== |
4652 | Parameters: |
4650 | Parameters: |
4653 | * eax = 75 - function number |
4651 | * eax = 75 - function number |
4654 | * bl = 7 - subfunction number |
4652 | * bl = 7 - subfunction number |
4655 | * ecx = socket number |
4653 | * ecx = socket number |
4656 | * edx = pointer to buffer |
4654 | * edx = pointer to buffer |
4657 | * esi = length of buffer |
4655 | * esi = length of buffer |
4658 | * edi = flags |
4656 | * edi = flags |
4659 | Returned value: |
4657 | Returned value: |
4660 | * eax = number of bytes copied, -1 on error |
4658 | * eax = number of bytes copied, -1 on error |
4661 | * ebx = errorcode |
4659 | * ebx = errorcode |
4662 | 4660 | ||
4663 | ---------------------- Constants for registers: ---------------------- |
4661 | ---------------------- Constants for registers: ---------------------- |
4664 | eax - SF_NETWORK_SOCKET (75) |
4662 | eax - SF_NETWORK_SOCKET (75) |
4665 | bl - SSF_RECEIVE (7) |
4663 | bl - SSF_RECEIVE (7) |
4666 | ====================================================================== |
4664 | ====================================================================== |
4667 | =========== Function 75, Subfunction 8, Set socket options. ========== |
4665 | =========== Function 75, Subfunction 8, Set socket options. ========== |
4668 | ====================================================================== |
4666 | ====================================================================== |
4669 | Parameters: |
4667 | Parameters: |
4670 | * eax = 75 - function number |
4668 | * eax = 75 - function number |
4671 | * bl = 8 - subfunction number |
4669 | * bl = 8 - subfunction number |
4672 | * ecx = socket number |
4670 | * ecx = socket number |
4673 | * edx = pointer to optstruct |
4671 | * edx = pointer to optstruct |
4674 | Returned value: |
4672 | Returned value: |
4675 | * eax = -1 on error |
4673 | * eax = -1 on error |
4676 | * ebx = errorcode |
4674 | * ebx = errorcode |
4677 | Remarks: |
4675 | Remarks: |
4678 | 4676 | ||
4679 | Optstruct: |
4677 | Optstruct: |
4680 | dd level |
4678 | dd level |
4681 | dd optionname |
4679 | dd optionname |
4682 | dd optlength |
4680 | dd optlength |
4683 | db options... |
4681 | db options... |
4684 | 4682 | ||
4685 | ---------------------- Constants for registers: ---------------------- |
4683 | ---------------------- Constants for registers: ---------------------- |
4686 | eax - SF_NETWORK_SOCKET (75) |
4684 | eax - SF_NETWORK_SOCKET (75) |
4687 | bl - SSF_SET_OPTIONS (8) |
4685 | bl - SSF_SET_OPTIONS (8) |
4688 | ====================================================================== |
4686 | ====================================================================== |
4689 | =========== Function 75, Subfunction 9, Get socket options. ========== |
4687 | =========== Function 75, Subfunction 9, Get socket options. ========== |
4690 | ====================================================================== |
4688 | ====================================================================== |
4691 | Parameters: |
4689 | Parameters: |
4692 | * eax = 75 - function number |
4690 | * eax = 75 - function number |
4693 | * bl = 9 - subfunction number |
4691 | * bl = 9 - subfunction number |
4694 | * ecx = socket number |
4692 | * ecx = socket number |
4695 | * edx = pointer to optstruct |
4693 | * edx = pointer to optstruct |
4696 | Returned value: |
4694 | Returned value: |
4697 | * eax = -1 on error |
4695 | * eax = -1 on error |
4698 | * ebx = errorcode |
4696 | * ebx = errorcode |
4699 | Remarks: |
4697 | Remarks: |
4700 | 4698 | ||
4701 | Optstruct: |
4699 | Optstruct: |
4702 | dd level |
4700 | dd level |
4703 | dd optionname |
4701 | dd optionname |
4704 | dd optlength |
4702 | dd optlength |
4705 | db options... |
4703 | db options... |
4706 | 4704 | ||
4707 | ---------------------- Constants for registers: ---------------------- |
4705 | ---------------------- Constants for registers: ---------------------- |
4708 | eax - SF_NETWORK_SOCKET (75) |
4706 | eax - SF_NETWORK_SOCKET (75) |
4709 | bl - SSF_GET_OPTIONS (9) |
4707 | bl - SSF_GET_OPTIONS (9) |
4710 | ====================================================================== |
4708 | ====================================================================== |
4711 | ============ Function 75, Subfunction 10, Get socketpair. ============ |
4709 | ============ Function 75, Subfunction 10, Get socketpair. ============ |
4712 | ====================================================================== |
4710 | ====================================================================== |
4713 | Parameters: |
4711 | Parameters: |
4714 | * eax = 75 - function number |
4712 | * eax = 75 - function number |
4715 | * bl = 10 - subfunction number |
4713 | * bl = 10 - subfunction number |
4716 | Returned value: |
4714 | Returned value: |
4717 | * eax = socketnum1, -1 on error |
4715 | * eax = socketnum1, -1 on error |
4718 | * ebx = socketnum2, errorcode on error |
4716 | * ebx = socketnum2, errorcode on error |
4719 | 4717 | ||
4720 | ---------------------- Constants for registers: ---------------------- |
4718 | ---------------------- Constants for registers: ---------------------- |
4721 | eax - SF_NETWORK_SOCKET (75) |
4719 | eax - SF_NETWORK_SOCKET (75) |
4722 | bl - SSF_GET_PAIR (10) |
4720 | bl - SSF_GET_PAIR (10) |
4723 | ====================================================================== |
4721 | ====================================================================== |
4724 | ============ Function 76, Network options and statistics. ============ |
4722 | ============ Function 76, Network options and statistics. ============ |
4725 | ====================================================================== |
4723 | ====================================================================== |
4726 | Parameters: |
4724 | Parameters: |
4727 | * eax = 76 - function number |
4725 | * eax = 76 - function number |
4728 | * high half of ebx = protocol number |
4726 | * high half of ebx = protocol number |
4729 | * bh = device number |
4727 | * bh = device number |
4730 | * bl = subfunction number |
4728 | * bl = subfunction number |
4731 | 4729 | ||
4732 | ====================================================================== |
4730 | ====================================================================== |
4733 | ==== Function 76, Protocol 0 - Ethernet, Subfunction 0, Read MAC. ==== |
4731 | ==== Function 76, Protocol 0 - Ethernet, Subfunction 0, Read MAC. ==== |
4734 | ====================================================================== |
4732 | ====================================================================== |
4735 | Parameters: |
4733 | Parameters: |
4736 | * eax = 76 - function number |
4734 | * eax = 76 - function number |
4737 | * high half of ebx = 0 (Ethernet) |
4735 | * high half of ebx = 0 (Ethernet) |
4738 | * bh = device number |
4736 | * bh = device number |
4739 | * bl = 0 (Read MAC) |
4737 | * bl = 0 (Read MAC) |
4740 | Returned value: |
4738 | Returned value: |
4741 | * eax = -1 on error, otherwise lower bits of MAC |
4739 | * eax = -1 on error, otherwise lower bits of MAC |
4742 | * bx = upper bits of MAC |
4740 | * bx = upper bits of MAC |
4743 | 4741 | ||
4744 | ====================================================================== |
4742 | ====================================================================== |
4745 | = Function 76, Protocol 1 - IPv4, Subfunction 0, Read # Packets sent = |
4743 | = Function 76, Protocol 1 - IPv4, Subfunction 0, Read # Packets sent = |
4746 | ====================================================================== |
4744 | ====================================================================== |
4747 | Parameters: |
4745 | Parameters: |
4748 | * eax = 76 - function number |
4746 | * eax = 76 - function number |
4749 | * high half of ebx = 1 (IPv4) |
4747 | * high half of ebx = 1 (IPv4) |
4750 | * bh = device number |
4748 | * bh = device number |
4751 | * bl = 0 (Read # packets sent) |
4749 | * bl = 0 (Read # packets sent) |
4752 | Returned value: |
4750 | Returned value: |
4753 | * eax = number of packets sent (-1 on error) |
4751 | * eax = number of packets sent (-1 on error) |
4754 | 4752 | ||
4755 | ====================================================================== |
4753 | ====================================================================== |
4756 | = Function 76, Protocol 1 - IPv4, Subfunction 1, Read # Packets rcvd = |
4754 | = Function 76, Protocol 1 - IPv4, Subfunction 1, Read # Packets rcvd = |
4757 | ====================================================================== |
4755 | ====================================================================== |
4758 | Parameters: |
4756 | Parameters: |
4759 | * eax = 76 - function number |
4757 | * eax = 76 - function number |
4760 | * high half of ebx = 1 (IPv4) |
4758 | * high half of ebx = 1 (IPv4) |
4761 | * bh = device number |
4759 | * bh = device number |
4762 | * bl = 1 (Read # packets received) |
4760 | * bl = 1 (Read # packets received) |
4763 | Returned value: |
4761 | Returned value: |
4764 | * eax = number of packets received (-1 on error) |
4762 | * eax = number of packets received (-1 on error) |
4765 | 4763 | ||
4766 | ====================================================================== |
4764 | ====================================================================== |
4767 | === Function 76, Protocol 1 - IPv4, Subfunction 2, Read IP address === |
4765 | === Function 76, Protocol 1 - IPv4, Subfunction 2, Read IP address === |
4768 | ====================================================================== |
4766 | ====================================================================== |
4769 | Parameters: |
4767 | Parameters: |
4770 | * eax = 76 - function number |
4768 | * eax = 76 - function number |
4771 | * high half of ebx = 1 (IPv4) |
4769 | * high half of ebx = 1 (IPv4) |
4772 | * bh = device number |
4770 | * bh = device number |
4773 | * bl = 2 (Read IP address) |
4771 | * bl = 2 (Read IP address) |
4774 | Returned value: |
4772 | Returned value: |
4775 | * eax = IP address (-1 on error) |
4773 | * eax = IP address (-1 on error) |
4776 | 4774 | ||
4777 | ====================================================================== |
4775 | ====================================================================== |
4778 | === Function 76, Protocol 1 - IPv4, Subfunction 3, Set IP address ==== |
4776 | === Function 76, Protocol 1 - IPv4, Subfunction 3, Set IP address ==== |
4779 | ====================================================================== |
4777 | ====================================================================== |
4780 | Parameters: |
4778 | Parameters: |
4781 | * eax = 76 - function number |
4779 | * eax = 76 - function number |
4782 | * high half of ebx = 1 (IPv4) |
4780 | * high half of ebx = 1 (IPv4) |
4783 | * bh = device number |
4781 | * bh = device number |
4784 | * bl = 3 (Set IP address) |
4782 | * bl = 3 (Set IP address) |
4785 | * ecx = IP address |
4783 | * ecx = IP address |
4786 | Returned value: |
4784 | Returned value: |
4787 | * eax = -1 on error |
4785 | * eax = -1 on error |
4788 | 4786 | ||
4789 | ====================================================================== |
4787 | ====================================================================== |
4790 | == Function 76, Protocol 1 - IPv4, Subfunction 4, Read DNS address === |
4788 | == Function 76, Protocol 1 - IPv4, Subfunction 4, Read DNS address === |
4791 | ====================================================================== |
4789 | ====================================================================== |
4792 | Parameters: |
4790 | Parameters: |
4793 | * eax = 76 - function number |
4791 | * eax = 76 - function number |
4794 | * high half of ebx = 1 (IPv4) |
4792 | * high half of ebx = 1 (IPv4) |
4795 | * bh = device number |
4793 | * bh = device number |
4796 | * bl = 4 (Read DNS server IP address) |
4794 | * bl = 4 (Read DNS server IP address) |
4797 | Returned value: |
4795 | Returned value: |
4798 | * eax = DNS server IP address (-1 on error) |
4796 | * eax = DNS server IP address (-1 on error) |
4799 | 4797 | ||
4800 | ====================================================================== |
4798 | ====================================================================== |
4801 | === Function 76, Protocol 1 - IPv4, Subfunction 5, Set DNS address === |
4799 | === Function 76, Protocol 1 - IPv4, Subfunction 5, Set DNS address === |
4802 | ====================================================================== |
4800 | ====================================================================== |
4803 | Parameters: |
4801 | Parameters: |
4804 | * eax = 76 - function number |
4802 | * eax = 76 - function number |
4805 | * high half of ebx = 1 (IPv4) |
4803 | * high half of ebx = 1 (IPv4) |
4806 | * bh = device number |
4804 | * bh = device number |
4807 | * bl = 5 (Set DNS address) |
4805 | * bl = 5 (Set DNS address) |
4808 | * ecx = DNS server IP address |
4806 | * ecx = DNS server IP address |
4809 | Returned value: |
4807 | Returned value: |
4810 | * eax = -1 on error |
4808 | * eax = -1 on error |
4811 | 4809 | ||
4812 | ====================================================================== |
4810 | ====================================================================== |
4813 | == Function 76, Protocol 1 - IPv4, Subfunction 6, Read subnet mask === |
4811 | == Function 76, Protocol 1 - IPv4, Subfunction 6, Read subnet mask === |
4814 | ====================================================================== |
4812 | ====================================================================== |
4815 | Parameters: |
4813 | Parameters: |
4816 | * eax = 76 - function number |
4814 | * eax = 76 - function number |
4817 | * high half of ebx = 1 (IPv4) |
4815 | * high half of ebx = 1 (IPv4) |
4818 | * bh = device number |
4816 | * bh = device number |
4819 | * bl = 6 (Read subnet mask) |
4817 | * bl = 6 (Read subnet mask) |
4820 | Returned value: |
4818 | Returned value: |
4821 | * eax = subnet mask (-1 on error) |
4819 | * eax = subnet mask (-1 on error) |
4822 | 4820 | ||
4823 | ====================================================================== |
4821 | ====================================================================== |
4824 | === Function 76, Protocol 1 - IPv4, Subfunction 7, Set subnet mask === |
4822 | === Function 76, Protocol 1 - IPv4, Subfunction 7, Set subnet mask === |
4825 | ====================================================================== |
4823 | ====================================================================== |
4826 | Parameters: |
4824 | Parameters: |
4827 | * eax = 76 - function number |
4825 | * eax = 76 - function number |
4828 | * high half of ebx = 1 (IPv4) |
4826 | * high half of ebx = 1 (IPv4) |
4829 | * bh = device number |
4827 | * bh = device number |
4830 | * bl = 7 (Set DNS address) |
4828 | * bl = 7 (Set DNS address) |
4831 | * ecx = subnet mask |
4829 | * ecx = subnet mask |
4832 | Returned value: |
4830 | Returned value: |
4833 | * eax = -1 on error |
4831 | * eax = -1 on error |
4834 | 4832 | ||
4835 | ====================================================================== |
4833 | ====================================================================== |
4836 | ===== Function 76, Protocol 1 - IPv4, Subfunction 8, Read gateway ==== |
4834 | ===== Function 76, Protocol 1 - IPv4, Subfunction 8, Read gateway ==== |
4837 | ====================================================================== |
4835 | ====================================================================== |
4838 | Parameters: |
4836 | Parameters: |
4839 | * eax = 76 - function number |
4837 | * eax = 76 - function number |
4840 | * high half of ebx = 1 (IPv4) |
4838 | * high half of ebx = 1 (IPv4) |
4841 | * bh = device number |
4839 | * bh = device number |
4842 | * bl = 8 (Read gateway IP address) |
4840 | * bl = 8 (Read gateway IP address) |
4843 | Returned value: |
4841 | Returned value: |
4844 | * eax = gateway IP address (-1 on error) |
4842 | * eax = gateway IP address (-1 on error) |
4845 | 4843 | ||
4846 | ====================================================================== |
4844 | ====================================================================== |
4847 | ===== Function 76, Protocol 1 - IPv4, Subfunction 9, Set gateway ===== |
4845 | ===== Function 76, Protocol 1 - IPv4, Subfunction 9, Set gateway ===== |
4848 | ====================================================================== |
4846 | ====================================================================== |
4849 | Parameters: |
4847 | Parameters: |
4850 | * eax = 76 - function number |
4848 | * eax = 76 - function number |
4851 | * high half of ebx = 1 (IPv4) |
4849 | * high half of ebx = 1 (IPv4) |
4852 | * bh = device number |
4850 | * bh = device number |
4853 | * bl = 9 (Set getway address) |
4851 | * bl = 9 (Set getway address) |
4854 | * ecx = gateway IP address |
4852 | * ecx = gateway IP address |
4855 | Returned value: |
4853 | Returned value: |
4856 | * eax = -1 on error |
4854 | * eax = -1 on error |
4857 | 4855 | ||
4858 | ====================================================================== |
4856 | ====================================================================== |
4859 | = Function 76, Protocol 2 - ICMP, Subfunction 0, Read # Packets sent = |
4857 | = Function 76, Protocol 2 - ICMP, Subfunction 0, Read # Packets sent = |
4860 | ====================================================================== |
4858 | ====================================================================== |
4861 | Parameters: |
4859 | Parameters: |
4862 | * eax = 76 - function number |
4860 | * eax = 76 - function number |
4863 | * high half of ebx = 2 (ICMP) |
4861 | * high half of ebx = 2 (ICMP) |
4864 | * bh = device number |
4862 | * bh = device number |
4865 | * bl = 0 (Read # packets sent) |
4863 | * bl = 0 (Read # packets sent) |
4866 | Returned value: |
4864 | Returned value: |
4867 | * eax = number of packets sent (-1 on error) |
4865 | * eax = number of packets sent (-1 on error) |
4868 | 4866 | ||
4869 | ====================================================================== |
4867 | ====================================================================== |
4870 | = Function 76, Protocol 2 - ICMP, Subfunction 1, Read # Packets rcvd = |
4868 | = Function 76, Protocol 2 - ICMP, Subfunction 1, Read # Packets rcvd = |
4871 | ====================================================================== |
4869 | ====================================================================== |
4872 | Parameters: |
4870 | Parameters: |
4873 | * eax = 76 - function number |
4871 | * eax = 76 - function number |
4874 | * high half of ebx = 2 (ICMP) |
4872 | * high half of ebx = 2 (ICMP) |
4875 | * bh = device number |
4873 | * bh = device number |
4876 | * bl = 1 (Read # packets received) |
4874 | * bl = 1 (Read # packets received) |
4877 | Returned value: |
4875 | Returned value: |
4878 | * eax = number of packets received (-1 on error) |
4876 | * eax = number of packets received (-1 on error) |
4879 | 4877 | ||
4880 | ====================================================================== |
4878 | ====================================================================== |
4881 | = Function 76, Protocol 3 - UDP, Subfunction 0, Read # Packets sent == |
4879 | = Function 76, Protocol 3 - UDP, Subfunction 0, Read # Packets sent == |
4882 | ====================================================================== |
4880 | ====================================================================== |
4883 | Parameters: |
4881 | Parameters: |
4884 | * eax = 76 - function number |
4882 | * eax = 76 - function number |
4885 | * high half of ebx = 3 (UDP) |
4883 | * high half of ebx = 3 (UDP) |
4886 | * bh = device number |
4884 | * bh = device number |
4887 | * bl = 0 (Read # packets sent) |
4885 | * bl = 0 (Read # packets sent) |
4888 | Returned value: |
4886 | Returned value: |
4889 | * eax = number of packets sent (-1 on error) |
4887 | * eax = number of packets sent (-1 on error) |
4890 | 4888 | ||
4891 | ====================================================================== |
4889 | ====================================================================== |
4892 | = Function 76, Protocol 3 - UDP, Subfunction 1, Read # Packets rcvd == |
4890 | = Function 76, Protocol 3 - UDP, Subfunction 1, Read # Packets rcvd == |
4893 | ====================================================================== |
4891 | ====================================================================== |
4894 | Parameters: |
4892 | Parameters: |
4895 | * eax = 76 - function number |
4893 | * eax = 76 - function number |
4896 | * high half of ebx = 3 (UDP) |
4894 | * high half of ebx = 3 (UDP) |
4897 | * bh = device number |
4895 | * bh = device number |
4898 | * bl = 1 (Read # packets received) |
4896 | * bl = 1 (Read # packets received) |
4899 | Returned value: |
4897 | Returned value: |
4900 | * eax = number of packets received (-1 on error) |
4898 | * eax = number of packets received (-1 on error) |
4901 | 4899 | ||
4902 | ====================================================================== |
4900 | ====================================================================== |
4903 | = Function 76, Protocol 4 - TCP, Subfunction 0, Read # Packets sent == |
4901 | = Function 76, Protocol 4 - TCP, Subfunction 0, Read # Packets sent == |
4904 | ====================================================================== |
4902 | ====================================================================== |
4905 | Parameters: |
4903 | Parameters: |
4906 | * eax = 76 - function number |
4904 | * eax = 76 - function number |
4907 | * high half of ebx = 4 (TCP) |
4905 | * high half of ebx = 4 (TCP) |
4908 | * bh = device number |
4906 | * bh = device number |
4909 | * bl = 0 (Read # packets sent) |
4907 | * bl = 0 (Read # packets sent) |
4910 | Returned value: |
4908 | Returned value: |
4911 | * eax = number of packets sent (-1 on error) |
4909 | * eax = number of packets sent (-1 on error) |
4912 | 4910 | ||
4913 | ====================================================================== |
4911 | ====================================================================== |
4914 | = Function 76, Protocol 4 - TCP, Subfunction 1, Read # Packets rcvd == |
4912 | = Function 76, Protocol 4 - TCP, Subfunction 1, Read # Packets rcvd == |
4915 | ====================================================================== |
4913 | ====================================================================== |
4916 | Parameters: |
4914 | Parameters: |
4917 | * eax = 76 - function number |
4915 | * eax = 76 - function number |
4918 | * high half of ebx = 4 (TCP) |
4916 | * high half of ebx = 4 (TCP) |
4919 | * bh = device number |
4917 | * bh = device number |
4920 | * bl = 1 (Read # packets received) |
4918 | * bl = 1 (Read # packets received) |
4921 | Returned value: |
4919 | Returned value: |
4922 | * eax = number of packets received (-1 on error) |
4920 | * eax = number of packets received (-1 on error) |
4923 | 4921 | ||
4924 | ====================================================================== |
4922 | ====================================================================== |
4925 | = Function 76, Protocol 5 - ARP, Subfunction 0, Read # Packets sent == |
4923 | = Function 76, Protocol 5 - ARP, Subfunction 0, Read # Packets sent == |
4926 | ====================================================================== |
4924 | ====================================================================== |
4927 | Parameters: |
4925 | Parameters: |
4928 | * eax = 76 - function number |
4926 | * eax = 76 - function number |
4929 | * high half of ebx = 5 (ARP) |
4927 | * high half of ebx = 5 (ARP) |
4930 | * bh = device number |
4928 | * bh = device number |
4931 | * bl = 0 (Read # packets sent) |
4929 | * bl = 0 (Read # packets sent) |
4932 | Returned value: |
4930 | Returned value: |
4933 | * eax = number of packets sent (-1 on error) |
4931 | * eax = number of packets sent (-1 on error) |
4934 | 4932 | ||
4935 | ====================================================================== |
4933 | ====================================================================== |
4936 | = Function 76, Protocol 5 - ARP, Subfunction 1, Read # Packets rcvd == |
4934 | = Function 76, Protocol 5 - ARP, Subfunction 1, Read # Packets rcvd == |
4937 | ====================================================================== |
4935 | ====================================================================== |
4938 | Parameters: |
4936 | Parameters: |
4939 | * eax = 76 - function number |
4937 | * eax = 76 - function number |
4940 | * high half of ebx = 5 (ARP) |
4938 | * high half of ebx = 5 (ARP) |
4941 | * bh = device number |
4939 | * bh = device number |
4942 | * bl = 1 (Read # packets received) |
4940 | * bl = 1 (Read # packets received) |
4943 | Returned value: |
4941 | Returned value: |
4944 | * eax = number of packets received (-1 on error) |
4942 | * eax = number of packets received (-1 on error) |
4945 | 4943 | ||
4946 | ====================================================================== |
4944 | ====================================================================== |
4947 | == Function 76, Protocol 5 - ARP, Subfunction 2, Read # ARP entries == |
4945 | == Function 76, Protocol 5 - ARP, Subfunction 2, Read # ARP entries == |
4948 | ====================================================================== |
4946 | ====================================================================== |
4949 | Parameters: |
4947 | Parameters: |
4950 | * eax = 76 - function number |
4948 | * eax = 76 - function number |
4951 | * high half of ebx = 5 (ARP) |
4949 | * high half of ebx = 5 (ARP) |
4952 | * bh = device number |
4950 | * bh = device number |
4953 | * bl = 2 (Read # current entries in the ARP table) |
4951 | * bl = 2 (Read # current entries in the ARP table) |
4954 | Returned value: |
4952 | Returned value: |
4955 | * eax = number of entries (-1 on error) |
4953 | * eax = number of entries (-1 on error) |
4956 | 4954 | ||
4957 | ====================================================================== |
4955 | ====================================================================== |
4958 | ==== Function 76, Protocol 5 - ARP, Subfunction 3, Read ARP entry ==== |
4956 | ==== Function 76, Protocol 5 - ARP, Subfunction 3, Read ARP entry ==== |
4959 | ====================================================================== |
4957 | ====================================================================== |
4960 | Parameters: |
4958 | Parameters: |
4961 | * eax = 76 - function number |
4959 | * eax = 76 - function number |
4962 | * high half of ebx = 5 (ARP) |
4960 | * high half of ebx = 5 (ARP) |
4963 | * bh = device number |
4961 | * bh = device number |
4964 | * bl = 3 (Read ARP entry) |
4962 | * bl = 3 (Read ARP entry) |
4965 | * ecx = ARP entry number (0 based) |
4963 | * ecx = ARP entry number (0 based) |
4966 | * edi = ptr to buffer where ARP entry will be written |
4964 | * edi = ptr to buffer where ARP entry will be written |
4967 | Returned value: |
4965 | Returned value: |
4968 | * eax = -1 on error |
4966 | * eax = -1 on error |
4969 | Remarks: |
4967 | Remarks: |
4970 | ARP_entry struct is defined in ARP.inc in kernel and currently looks like this: |
4968 | ARP_entry struct is defined in ARP.inc in kernel and currently looks like this: |
4971 | struct ARP_entry |
4969 | struct ARP_entry |
4972 | IP dd ? |
4970 | IP dd ? |
4973 | MAC dp ? |
4971 | MAC dp ? |
4974 | Status dw ? |
4972 | Status dw ? |
4975 | TTL dw ? |
4973 | TTL dw ? |
4976 | ends |
4974 | ends |
4977 | 4975 | ||
4978 | ====================================================================== |
4976 | ====================================================================== |
4979 | ==== Function 76, Protocol 5 - ARP, Subfunction 4, Add ARP entry ==== |
4977 | ==== Function 76, Protocol 5 - ARP, Subfunction 4, Add ARP entry ==== |
4980 | ====================================================================== |
4978 | ====================================================================== |
4981 | Parameters: |
4979 | Parameters: |
4982 | * eax = 76 - function number |
4980 | * eax = 76 - function number |
4983 | * high half of ebx = 5 (ARP) |
4981 | * high half of ebx = 5 (ARP) |
4984 | * bh = device number |
4982 | * bh = device number |
4985 | * bl = 4 (Add ARP entry) |
4983 | * bl = 4 (Add ARP entry) |
4986 | * esi = ptr to buffer holding ARP entry |
4984 | * esi = ptr to buffer holding ARP entry |
4987 | Returned value: |
4985 | Returned value: |
4988 | * eax = -1 on error |
4986 | * eax = -1 on error |
4989 | Remarks: |
4987 | Remarks: |
4990 | See previous function for details on ARP entry. |
4988 | See previous function for details on ARP entry. |
4991 | 4989 | ||
4992 | ====================================================================== |
4990 | ====================================================================== |
4993 | === Function 76, Protocol 5 - ARP, Subfunction 5, Remove ARP entry ==== |
4991 | === Function 76, Protocol 5 - ARP, Subfunction 5, Remove ARP entry ==== |
4994 | ====================================================================== |
4992 | ====================================================================== |
4995 | Parameters: |
4993 | Parameters: |
4996 | * eax = 76 - function number |
4994 | * eax = 76 - function number |
4997 | * high half of ebx = 5 (ARP) |
4995 | * high half of ebx = 5 (ARP) |
4998 | * bh = device number |
4996 | * bh = device number |
4999 | * bl = 3 (Read ARP entry) |
4997 | * bl = 3 (Read ARP entry) |
5000 | * ecx = ARP entry number (0 based), use -1 to clear whole ARP table. |
4998 | * ecx = ARP entry number (0 based), use -1 to clear whole ARP table. |
5001 | Returned value: |
4999 | Returned value: |
5002 | * eax = -1 on error |
5000 | * eax = -1 on error |
5003 | 5001 | ||
5004 | ====================================================================== |
5002 | ====================================================================== |
5005 | === Function 76, Protocol 5 - ARP, Subfunction 6, Send ARP announce == |
5003 | === Function 76, Protocol 5 - ARP, Subfunction 6, Send ARP announce == |
5006 | ====================================================================== |
5004 | ====================================================================== |
5007 | Parameters: |
5005 | Parameters: |
5008 | * eax = 76 - function number |
5006 | * eax = 76 - function number |
5009 | * high half of ebx = 5 (ARP) |
5007 | * high half of ebx = 5 (ARP) |
5010 | * bh = device number |
5008 | * bh = device number |
5011 | * bl = 6 (Send ARP announce) |
5009 | * bl = 6 (Send ARP announce) |
5012 | Returned value: |
5010 | Returned value: |
5013 | * eax = -1 on error |
5011 | * eax = -1 on error |
5014 | 5012 | ||
5015 | ====================================================================== |
5013 | ====================================================================== |
5016 | === Function 76, Protocol 5 - ARP, Subfunction 7, Read # conflicts === |
5014 | === Function 76, Protocol 5 - ARP, Subfunction 7, Read # conflicts === |
5017 | ====================================================================== |
5015 | ====================================================================== |
5018 | Parameters: |
5016 | Parameters: |
5019 | * eax = 76 - function number |
5017 | * eax = 76 - function number |
5020 | * high half of ebx = 5 (ARP) |
5018 | * high half of ebx = 5 (ARP) |
5021 | * bh = device number |
5019 | * bh = device number |
5022 | * bl = 7 (Read # IP address conflicts that have occured) |
5020 | * bl = 7 (Read # IP address conflicts that have occured) |
5023 | Returned value: |
5021 | Returned value: |
5024 | * eax = # IP address conflicts (-1 on error) |
5022 | * eax = # IP address conflicts (-1 on error) |
5025 | 5023 | ||
5026 | ---------------------- Constants for registers: ---------------------- |
5024 | ---------------------- Constants for registers: ---------------------- |
5027 | eax - SF_NETWORK_PROTOCOL (76) |
5025 | eax - SF_NETWORK_PROTOCOL (76) |
5028 | ====================================================================== |
5026 | ====================================================================== |
5029 | ========== Function 77, Subfunction 0, Create futex object =========== |
5027 | ========== Function 77, Subfunction 0, Create futex object =========== |
5030 | ====================================================================== |
5028 | ====================================================================== |
5031 | Parameters: |
5029 | Parameters: |
5032 | * eax = 77 - function number |
5030 | * eax = 77 - function number |
5033 | * ebx = 0 - subfunction number |
5031 | * ebx = 0 - subfunction number |
5034 | * ecx = pointer to futex dword |
5032 | * ecx = pointer to futex dword |
5035 | Returned value: |
5033 | Returned value: |
5036 | * eax = futex handle, 0 on error |
5034 | * eax = futex handle, 0 on error |
5037 | Remarks: |
5035 | Remarks: |
5038 | * Use subfunction 1 to destroy the futex. |
5036 | * Use subfunction 1 to destroy the futex. |
5039 | The kernel destroys the futexes automatically when the process |
5037 | The kernel destroys the futexes automatically when the process |
5040 | terminates. |
5038 | terminates. |
5041 | 5039 | ||
5042 | ---------------------- Constants for registers: ---------------------- |
5040 | ---------------------- Constants for registers: ---------------------- |
5043 | eax - SF_FUTEX (77) |
5041 | eax - SF_FUTEX (77) |
5044 | ebx - SSF_CREATE (0) |
5042 | ebx - SSF_CREATE (0) |
5045 | ====================================================================== |
5043 | ====================================================================== |
5046 | ========= Function 77, Subfunction 1, Destroy futex object =========== |
5044 | ========= Function 77, Subfunction 1, Destroy futex object =========== |
5047 | ====================================================================== |
5045 | ====================================================================== |
5048 | Parameters: |
5046 | Parameters: |
5049 | * eax = 77 - function number |
5047 | * eax = 77 - function number |
5050 | * ebx = 1 - subfunction number |
5048 | * ebx = 1 - subfunction number |
5051 | * ecx = futex handle |
5049 | * ecx = futex handle |
5052 | Returned value: |
5050 | Returned value: |
5053 | * eax = 0 - successfull, -1 on error |
5051 | * eax = 0 - successfull, -1 on error |
5054 | Remarks: |
5052 | Remarks: |
5055 | * The futex handle must have been created by subfunction 0 |
5053 | * The futex handle must have been created by subfunction 0 |
5056 | 5054 | ||
5057 | ---------------------- Constants for registers: ---------------------- |
5055 | ---------------------- Constants for registers: ---------------------- |
5058 | eax - SF_FUTEX (77) |
5056 | eax - SF_FUTEX (77) |
5059 | ebx - SSF_DESTROY (1) |
5057 | ebx - SSF_DESTROY (1) |
5060 | ====================================================================== |
5058 | ====================================================================== |
5061 | =============== Function 77, Subfunction 2, Futex wait =============== |
5059 | =============== Function 77, Subfunction 2, Futex wait =============== |
5062 | ====================================================================== |
5060 | ====================================================================== |
5063 | Parameters: |
5061 | Parameters: |
5064 | * eax = 77 - function number |
5062 | * eax = 77 - function number |
5065 | * ebx = 2 - subfunction number |
5063 | * ebx = 2 - subfunction number |
5066 | * ecx = futex handle |
5064 | * ecx = futex handle |
5067 | * edx = control value |
5065 | * edx = control value |
5068 | * esi = timeout in system ticks or 0 for infinity |
5066 | * esi = timeout in system ticks or 0 for infinity |
5069 | Returned value: |
5067 | Returned value: |
5070 | * eax = 0 - successfull |
5068 | * eax = 0 - successfull |
5071 | -1 - timeout |
5069 | -1 - timeout |
5072 | -2 - futex dword does not have the same value as edx |
5070 | -2 - futex dword does not have the same value as edx |
5073 | Remarks: |
5071 | Remarks: |
5074 | * This functionn tests that the value at the futex dword still |
5072 | * This functionn tests that the value at the futex dword still |
5075 | contains the expected control value, and if so, then sleeps |
5073 | contains the expected control value, and if so, then sleeps |
5076 | waiting for a wake operation on the futex. |
5074 | waiting for a wake operation on the futex. |
5077 | * The futex handle must have been created by subfunction 0 |
5075 | * The futex handle must have been created by subfunction 0 |
5078 | 5076 | ||
5079 | ---------------------- Constants for registers: ---------------------- |
5077 | ---------------------- Constants for registers: ---------------------- |
5080 | eax - SF_FUTEX (77) |
5078 | eax - SF_FUTEX (77) |
5081 | ebx - SSF_WAIT (2) |
5079 | ebx - SSF_WAIT (2) |
5082 | ====================================================================== |
5080 | ====================================================================== |
5083 | =============== Function 77, Subfunction 3, Futex wake =============== |
5081 | =============== Function 77, Subfunction 3, Futex wake =============== |
5084 | ====================================================================== |
5082 | ====================================================================== |
5085 | Parameters: |
5083 | Parameters: |
5086 | * eax = 77 - function number |
5084 | * eax = 77 - function number |
5087 | * ebx = 3 - subfunction number |
5085 | * ebx = 3 - subfunction number |
5088 | * ecx = futex handle |
5086 | * ecx = futex handle |
5089 | * edx = number of waiters to wake |
5087 | * edx = number of waiters to wake |
5090 | Returned value: |
5088 | Returned value: |
5091 | * eax = number of waiters that were woken up |
5089 | * eax = number of waiters that were woken up |
5092 | 5090 | ||
5093 | Remarks: |
5091 | Remarks: |
5094 | * This function wakes at most edx of the waiters that are |
5092 | * This function wakes at most edx of the waiters that are |
5095 | waiting (e.g., inside futex wait) on the futex dword |
5093 | waiting (e.g., inside futex wait) on the futex dword |
5096 | * The futex handle must have been created by subfunction 0 |
5094 | * The futex handle must have been created by subfunction 0 |
5097 | 5095 | ||
5098 | ---------------------- Constants for registers: ---------------------- |
5096 | ---------------------- Constants for registers: ---------------------- |
5099 | eax - SF_FUTEX (77) |
5097 | eax - SF_FUTEX (77) |
5100 | ebx - SSF_WAKE (3) |
5098 | ebx - SSF_WAKE (3) |
5101 | ====================================================================== |
5099 | ====================================================================== |
5102 | === Function 80 - file system interface with parameter of encoding === |
5100 | === Function 80 - file system interface with parameter of encoding === |
5103 | ====================================================================== |
5101 | ====================================================================== |
5104 | Parameters: |
5102 | Parameters: |
5105 | * eax = 80 |
5103 | * eax = 80 |
5106 | * ebx = pointer to the information structure |
5104 | * ebx = pointer to the information structure |
5107 | Returned value: |
5105 | Returned value: |
5108 | * eax = 0 - success; otherwise file system error code |
5106 | * eax = 0 - success; otherwise file system error code |
5109 | * some subfunctions return value in other registers too |
5107 | * some subfunctions return value in other registers too |
5110 | General format of the information structure: |
5108 | General format of the information structure: |
5111 | * +0: dword: subfunction number |
5109 | * +0: dword: subfunction number |
5112 | * +4: dword: offset in file or folder |
5110 | * +4: dword: offset in file or folder |
5113 | * +8: dword: higher part of offset or flags |
5111 | * +8: dword: higher part of offset or flags |
5114 | * +12 = +0xC: dword: size of data |
5112 | * +12 = +0xC: dword: size of data |
5115 | * +16 = +0x10: dword: pointer to data |
5113 | * +16 = +0x10: dword: pointer to data |
5116 | * +20 = +0x14: dword: string encoding: |
5114 | * +20 = +0x14: dword: string encoding: |
5117 | 1 = cp866 |
5115 | 1 = cp866 |
5118 | 2 = UTF-16LE |
5116 | 2 = UTF-16LE |
5119 | 3 = UTF-8 |
5117 | 3 = UTF-8 |
5120 | 0 = default (supports encoding byte at the start of the string) |
5118 | 0 = default (supports encoding byte at the start of the string) |
5121 | * +24 = +0x18: dword: pointer to zero terminated string with path |
5119 | * +24 = +0x18: dword: pointer to zero terminated string with path |
5122 | 5120 | ||
5123 | The rest is similar to sysfunction 70. |
5121 | The rest is similar to sysfunction 70. |
5124 | 5122 | ||
5125 | ====================================================================== |
5123 | ====================================================================== |
5126 | =============== Function -1 - terminate thread/process =============== |
5124 | =============== Function -1 - terminate thread/process =============== |
5127 | ====================================================================== |
5125 | ====================================================================== |
5128 | Parameters: |
5126 | Parameters: |
5129 | * eax = -1 - function number |
5127 | * eax = -1 - function number |
5130 | Returned value: |
5128 | Returned value: |
5131 | * function does not return neither value nor control |
5129 | * function does not return neither value nor control |
5132 | Remarks: |
5130 | Remarks: |
5133 | * If the process did not create threads obviously, it has only |
5131 | * If the process did not create threads obviously, it has only |
5134 | one thread, which termination results in process termination. |
5132 | one thread, which termination results in process termination. |
5135 | * If the current thread is last in the process, its termination |
5133 | * If the current thread is last in the process, its termination |
5136 | also results in process terminates. |
5134 | also results in process terminates. |
5137 | * This function terminates the current thread. Other thread can be |
5135 | * This function terminates the current thread. Other thread can be |
5138 | killed by call to subfunction 2 of function 18. |
5136 | killed by call to subfunction 2 of function 18. |
5139 | 5137 | ||
5140 | ---------------------- Constants for registers: ---------------------- |
5138 | ---------------------- Constants for registers: ---------------------- |
5141 | eax - SF_TERMINATE_PROCESS (-1) |
5139 | eax - SF_TERMINATE_PROCESS (-1) |
5142 | ====================================================================== |
5140 | ====================================================================== |
5143 | =========================== List of events =========================== |
5141 | =========================== List of events =========================== |
5144 | ====================================================================== |
5142 | ====================================================================== |
5145 | Next event can be retrieved by the call of one from functions 10 |
5143 | Next event can be retrieved by the call of one from functions 10 |
5146 | (to wait for event), 11 (to check without waiting), 23 |
5144 | (to wait for event), 11 (to check without waiting), 23 |
5147 | (to wait during the given time). |
5145 | (to wait during the given time). |
5148 | These functions return only those events, which enter into a mask set |
5146 | These functions return only those events, which enter into a mask set |
5149 | by function 40. By default it is first three, |
5147 | by function 40. By default it is first three, |
5150 | there is enough for most applications. |
5148 | there is enough for most applications. |
5151 | Codes of events: |
5149 | Codes of events: |
5152 | * 1 = redraw event (is reset by call to function 0) |
5150 | * 1 = redraw event (is reset by call to function 0) |
5153 | * 2 = key on keyboard is pressed (acts, only when the window is |
5151 | * 2 = key on keyboard is pressed (acts, only when the window is |
5154 | active) or hotkey is pressed; is reset, when all keys from |
5152 | active) or hotkey is pressed; is reset, when all keys from |
5155 | the buffer are read out by function 2 |
5153 | the buffer are read out by function 2 |
5156 | * 3 = button is pressed, defined earlier by function 8 |
5154 | * 3 = button is pressed, defined earlier by function 8 |
5157 | (or close button, created implicitly by function 0; |
5155 | (or close button, created implicitly by function 0; |
5158 | minimize button is handled by the system and sends no message; |
5156 | minimize button is handled by the system and sends no message; |
5159 | acts, only when the window is active; |
5157 | acts, only when the window is active; |
5160 | is reset when all buttons from the buffer |
5158 | is reset when all buttons from the buffer |
5161 | are read out by function 17) |
5159 | are read out by function 17) |
5162 | * 4 = reserved (in current implementation never comes even after |
5160 | * 4 = reserved (in current implementation never comes even after |
5163 | unmasking by function 40) |
5161 | unmasking by function 40) |
5164 | * 5 = kernel finished redrawing of the desktop background |
5162 | * 5 = kernel finished redrawing of the desktop background |
5165 | * 6 = mouse event (something happened - button pressing or moving; |
5163 | * 6 = mouse event (something happened - button pressing or moving; |
5166 | is reset at reading) |
5164 | is reset at reading) |
5167 | * 7 = IPC event (see function 60 - |
5165 | * 7 = IPC event (see function 60 - |
5168 | Inter Process Communication; is reset at reading) |
5166 | Inter Process Communication; is reset at reading) |
5169 | * 8 = network event (is reset at reading) |
5167 | * 8 = network event (is reset at reading) |
5170 | * 9 = debug event (is reset at reading; see |
5168 | * 9 = debug event (is reset at reading; see |
5171 | debug subsystem) |
5169 | debug subsystem) |
5172 | * 16..31 = event with appropriate IRQ |
5170 | * 16..31 = event with appropriate IRQ |
5173 | (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data) |
5171 | (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data) |
5174 | 5172 | ||
5175 | ====================================================================== |
5173 | ====================================================================== |
5176 | =================== Error codes of the file system =================== |
5174 | =================== Error codes of the file system =================== |
5177 | ====================================================================== |
5175 | ====================================================================== |
5178 | * 0 = success |
5176 | * 0 = success |
5179 | * 2 = function is not supported for the given file system |
5177 | * 2 = function is not supported for the given file system |
5180 | * 3 = unknown file system |
5178 | * 3 = unknown file system |
5181 | * 5 = file not found |
5179 | * 5 = file not found |
5182 | * 6 = end of file, EOF |
5180 | * 6 = end of file, EOF |
5183 | * 7 = pointer lies outside of application memory |
5181 | * 7 = pointer lies outside of application memory |
5184 | * 8 = disk is full |
5182 | * 8 = disk is full |
5185 | * 9 = file system error |
5183 | * 9 = file system error |
5186 | * 10 = access denied |
5184 | * 10 = access denied |
5187 | * 11 = device error |
5185 | * 11 = device error |
5188 | * 12 = file system requires more memory |
5186 | * 12 = file system requires more memory |
5189 | 5187 | ||
5190 | Application start functions can return also following errors: |
5188 | Application start functions can return also following errors: |
5191 | * 30 = 0x1E = not enough memory |
5189 | * 30 = 0x1E = not enough memory |
5192 | * 31 = 0x1F = file is not executable |
5190 | * 31 = 0x1F = file is not executable |
5193 | * 32 = 0x20 = too many processes>>0,>=>=>=0xFFFF. |
5191 | * 32 = 0x20 = too many processes>>0,>=>=>=0xFFFF. |
5194 | >=ecx<=0xFFFF. |
5192 | >=ecx<=0xFFFF. |
5195 | > |
5193 | > |