Rev 485 | Rev 499 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
346 | diamond | 1 | SYSTEM FUNCTIONS of OS Kolibri 0.6.5.0 |
114 | mikedld | 2 | |
3 | Number of the function is located in the register eax. |
||
118 | diamond | 4 | The call of the system function is executed by "int 0x40" command. |
5 | All registers except explicitly declared in the returned value, |
||
6 | including eflags, are preserved. |
||
114 | mikedld | 7 | |
8 | |||
9 | ====================================================================== |
||
10 | ============== Function 0 - define and draw the window. ============== |
||
11 | ====================================================================== |
||
12 | Defines an application window. Draws a frame of the window, header and |
||
133 | diamond | 13 | working area. For skinned windows defines standard close and minimize |
14 | buttons. |
||
114 | mikedld | 15 | Parameters: |
118 | diamond | 16 | * eax = 0 - function number |
114 | mikedld | 17 | * ebx = [coordinate on axis x]*65536 + [size on axis x] |
18 | * ecx = [coordinate on axis y]*65536 + [size on axis y] |
||
19 | * edx = 0xXYRRGGBB, where: |
||
20 | * Y = style of the window: |
||
131 | diamond | 21 | * Y=0 - type I - fixed-size window |
118 | diamond | 22 | * Y=1 - only define window area, draw nothing |
131 | diamond | 23 | * Y=2 - type II - variable-size window |
24 | * Y=3 - skinned window |
||
118 | diamond | 25 | * other possible values (from 4 up to 15) are reserved, |
114 | mikedld | 26 | function call with such Y is ignored |
118 | diamond | 27 | * RR, GG, BB = accordingly red, green, blue components of a color |
28 | of the working area of the window (are ignored for style Y=2) |
||
114 | mikedld | 29 | * X = DCBA (bits) |
118 | diamond | 30 | * A = 1 - window has caption; for style Y=3 caption string |
31 | must be passed in edi, for other styles use |
||
32 | subfunction 1 of function 71 |
||
33 | * B = 1 - coordinates of all graphics primitives are relative to |
||
34 | window client area |
||
303 | mikedld | 35 | * C = 1 - don't fill working area on window draw |
118 | diamond | 36 | * D = 0 - normal filling of the working area, 1 - gradient |
37 | The following parameters are intended for windows |
||
38 | of a type I and II, and ignored for styles Y=1,3: |
||
39 | * esi = 0xXYRRGGBB - color of the header |
||
40 | * RR, GG, BB define color |
||
114 | mikedld | 41 | * Y=0 - usual window, Y=1 - unmovable window |
118 | diamond | 42 | * X defines a gradient of header: X=0 - no gradient, |
114 | mikedld | 43 | X=8 - usual gradient, |
44 | for windows of a type II X=4 - negative gradient |
||
118 | diamond | 45 | * other values of X and Y are reserved |
46 | * edi = 0x00RRGGBB - color of the frame |
||
114 | mikedld | 47 | Returned value: |
48 | * function does not return value |
||
49 | Remarks: |
||
118 | diamond | 50 | * Position and sizes of the window are installed by the first |
51 | call of this function and are ignored at subsequent; to change |
||
52 | position and/or sizes of already created window use function 67. |
||
53 | * For windows with style Y=3 and caption (A=1) caption string is set |
||
54 | by the first call of this function and is ignored at subsequent |
||
55 | (strictly speaking, is ignored after a call to subfunction 2 |
||
56 | of function 12 - end redraw); to change caption of already created |
||
57 | window use subfunction 1 of function 71. |
||
58 | * If the window has appropriate styles, position and/or sizes can be |
||
59 | changed by user. Current position and sizes can be obtained |
||
60 | by function 9. |
||
61 | * The window must fit on the screen. If the transferred |
||
62 | coordinates and sizes do not satisfy to this condition, |
||
63 | appropriate coordinate (or, probably, both) is considered as zero, |
||
131 | diamond | 64 | and if it does not help too, the appropriate size |
118 | diamond | 65 | (or, probably, both) is installed in a size of the screen. |
114 | mikedld | 66 | |
131 | diamond | 67 | Further let us designate xpos,ypos,xsize,ysize - values passed |
68 | in ebx,ecx. The coordinates are resulted concerning |
||
118 | diamond | 69 | the left upper corner of the window, which, thus, is set as (0,0), |
70 | coordinates of the right lower corner essence (xsize,ysize). |
||
71 | * The sizes of the window are understood in sence of coordinates |
||
72 | of the right lower corner. This concerns all other functions too. |
||
73 | It means, that the real sizes are on 1 pixel more. |
||
74 | * The window of type I looks as follows: |
||
75 | * draw external frame of color indicated in edi, 1 pixel in width |
||
76 | * draw header - rectangle with the left upper corner (1,1) and |
||
77 | right lower (xsize-1,min(25,ysize)) color indicated in esi |
||
78 | (taking a gradient into account) |
||
79 | * if ysize>=26, fill the working area of the window - |
||
80 | rectangle with the left upper corner (1,21) and right lower |
||
81 | (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color |
||
82 | indicated in edx (taking a gradient into account) |
||
83 | * if A=1 and caption has been already set by subfunction 1 |
||
84 | of function 71, it is drawn in the corresponding place of header |
||
85 | * The window of style Y=1 looks as follows: |
||
114 | mikedld | 86 | * completely defined by the application |
118 | diamond | 87 | * The window of type II looks as follows: |
88 | * draw external frame of width 1 pixel with the "shaded" color |
||
89 | edi (all components of the color decrease twice) |
||
90 | * draw intermediate frame of width 3 pixels with color edi |
||
91 | * draw internal frame of width 1 pixel with the "shaded" color edi |
||
114 | mikedld | 92 | * draw header - rectangle with the left upper corner (4,4) |
118 | diamond | 93 | and right lower (xsize-4,min(20,ysize)) color, indicated in esi |
94 | (taking a gradient into account) |
||
95 | * if ysize>=26, fill the working area of the window - |
||
114 | mikedld | 96 | rectangle with the left upper corner (5,20) and right lower |
118 | diamond | 97 | (xsize-5,ysize-5) with color indicated in edx |
98 | (taking a gradient into account) |
||
99 | * if A=1 and caption has been already set by subfunction 1 |
||
100 | of function 71, it is drawn in the corresponding place of header |
||
101 | * The skinned window looks as follows: |
||
114 | mikedld | 102 | * draw external frame of width 1 pixel |
118 | diamond | 103 | with color 'outer' from the skin |
104 | * draw intermediate frame of width 3 pixel |
||
105 | with color 'frame' from the skin |
||
106 | * draw internal frame of width 1 pixel |
||
107 | with color 'inner' from the skin |
||
108 | * draw header (on bitmaps from the skin) in a rectangle |
||
114 | mikedld | 109 | (0,0) - (xsize,_skinh-1) |
118 | diamond | 110 | * if ysize>=26, fill the working area of the window - |
111 | rectangle with the left upper corner (5,_skinh) and right lower |
||
112 | (xsize-5,ysize-5) with color indicated in edx |
||
113 | (taking a gradient into account) |
||
133 | diamond | 114 | * define two standard buttons: close and minimize |
114 | mikedld | 115 | (see function 8) |
118 | diamond | 116 | * if A=1 and edi contains (nonzero) pointer to caption string, |
117 | it is drawn in place in header defined in the skin |
||
118 | * value _skinh is accessible as the result of call |
||
119 | subfunction 4 of function 48 |
||
114 | mikedld | 120 | |
121 | ====================================================================== |
||
118 | diamond | 122 | ================ Function 1 - put pixel in the window. =============== |
114 | mikedld | 123 | ====================================================================== |
124 | Parameters: |
||
118 | diamond | 125 | * eax = 1 - function number |
126 | * ebx = x-coordinate (relative to the window) |
||
127 | * ecx = y-coordinate (relative to the window) |
||
128 | * edx = 0x00RRGGBB - color of a pixel |
||
129 | edx = 0x01xxxxxx - invert color of a pixel |
||
130 | (low 24 bits are ignored) |
||
114 | mikedld | 131 | Returned value: |
132 | * function does not return value |
||
133 | |||
134 | ====================================================================== |
||
118 | diamond | 135 | ============ Function 2 - get the code of the pressed key. =========== |
114 | mikedld | 136 | ====================================================================== |
137 | Takes away the code of the pressed key from the buffer. |
||
138 | Parameters: |
||
118 | diamond | 139 | * eax = 2 - function number |
114 | mikedld | 140 | Returned value: |
118 | diamond | 141 | * if the buffer is empty, function returns eax=1 |
142 | * if the buffer is not empty, function returns al=0, |
||
143 | ah=code of the pressed key, high word of eax is zero |
||
144 | * if there is "hotkey", function returns al=2, |
||
145 | ah=scancode of the pressed key (0 for control keys), |
||
146 | high word of eax contains a status of control keys at the moment |
||
147 | of pressing a hotkey |
||
114 | mikedld | 148 | Remarks: |
118 | diamond | 149 | * There is a common system buffer of the pressed keys |
150 | by a size of 120 bytes, organized as queue. |
||
151 | * There is one more common system buffer on 120 "hotkeys". |
||
152 | * If the application with the inactive window calls this function, |
||
153 | the buffer of the pressed keys is considered to be empty. |
||
154 | * By default this function returns ASCII-codes; to switch |
||
155 | to the scancodes mode (and back) use function 66. |
||
156 | However, hotkeys are always notificated as scancodes. |
||
157 | * To find out, what keys correspond to what codes, start |
||
158 | the application keyascii and scancode. |
||
159 | * Scancodes come directly from keyboard and are fixed; |
||
160 | ASCII-codes turn out with usage of the conversion tables, |
||
161 | which can be set by subfunction 2 of function 21 |
||
162 | and get by subfunction 2 of function 26. |
||
163 | * As a consequence, ASCII-codes take into account current |
||
164 | keyboard layout (rus/en) as opposed to scancodes. |
||
165 | * This function notifies only about those hotkeys, which were |
||
166 | defined by this thread by subfunction 4 of function 66. |
||
114 | mikedld | 167 | |
168 | ====================================================================== |
||
118 | diamond | 169 | ==================== Function 3 - get system time. =================== |
114 | mikedld | 170 | ====================================================================== |
171 | Parameters: |
||
118 | diamond | 172 | * eax = 3 - function number |
114 | mikedld | 173 | Returned value: |
174 | * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds |
||
118 | diamond | 175 | * each item is BCD-number, for example, |
176 | for time 23:59:59 function returns 0x00595923 |
||
114 | mikedld | 177 | Remarks: |
118 | diamond | 178 | * See also subfunction 9 of function 26 - get time from |
179 | the moment of start of the system; it is more convenient, because |
||
180 | returns simply DWORD-value of the time counter. |
||
181 | * System time can be set by function 22. |
||
114 | mikedld | 182 | |
183 | ====================================================================== |
||
118 | diamond | 184 | ============ Function 4 - draw text string in the window. ============ |
114 | mikedld | 185 | ====================================================================== |
186 | Parameters: |
||
118 | diamond | 187 | * eax = 4 - function number |
114 | mikedld | 188 | * ebx = [coordinate on axis x]*65536 + [coordinate on axis y] |
189 | * ecx = 0xX0RRGGBB, where |
||
118 | diamond | 190 | * RR, GG, BB specify text color |
139 | diamond | 191 | * X=ABnn (bits): |
185 | heavyiron | 192 | * nn specifies the used font: 0=system monospaced, |
193 | 1=system font of variable width |
||
139 | diamond | 194 | * A=0 - output esi characters, A=1 - output ASCIIZ-string |
195 | * B=1 - fill background with the color edi |
||
118 | diamond | 196 | * edx = pointer to the beginning of the string |
139 | diamond | 197 | * esi = for A=0 length of the string, must not exceed 255; |
198 | for A=1 is ignored |
||
114 | mikedld | 199 | Returned value: |
200 | * function does not return value |
||
201 | Remarks: |
||
118 | diamond | 202 | * First system font is read out at loading from the file char.mt, |
203 | second - from char2.mt. |
||
204 | * Both fonts have height 9 pixels, width of the monospaced font |
||
205 | is equal to 6 pixels. |
||
114 | mikedld | 206 | |
207 | ====================================================================== |
||
118 | diamond | 208 | ========================= Function 5 - delay. ======================== |
114 | mikedld | 209 | ====================================================================== |
210 | Delays execution of the program on the given time. |
||
211 | Parameters: |
||
118 | diamond | 212 | * eax = 5 - function number |
114 | mikedld | 213 | * ebx = time in the 1/100 of second |
214 | Returned value: |
||
215 | * function does not return value |
||
216 | Remarks: |
||
118 | diamond | 217 | * Passing ebx=0 does not transfer control to the next process |
218 | and does not make any operations at all. If it is really required |
||
219 | to transfer control to the next process (to complete a current |
||
220 | time slice), use subfunction 1 of function 68. |
||
221 | * At current implementation there will be an immediate return from |
||
222 | the function, if the addition of ebx with current value of |
||
223 | time counter will call 32-bit overflow. |
||
114 | mikedld | 224 | |
225 | ====================================================================== |
||
118 | diamond | 226 | ============== Function 6 - read the file from ramdisk. ============== |
114 | mikedld | 227 | ====================================================================== |
228 | Parameters: |
||
118 | diamond | 229 | * eax = 6 - function number |
230 | * ebx = pointer to the filename |
||
231 | * ecx = number of start block, beginning from 1; |
||
232 | ecx=0 - read from the beginning of the file (same as ecx=1) |
||
233 | * edx = number of blocks to read; |
||
234 | edx=0 - read one block (same as edx=1) |
||
235 | * esi = pointer to memory area for the data |
||
114 | mikedld | 236 | Returned value: |
118 | diamond | 237 | * eax = file size in bytes, if the file was successfully read |
238 | * eax = -1, if the file was not found |
||
114 | mikedld | 239 | Remarks: |
118 | diamond | 240 | * This function is out-of-date; function 70 allows |
241 | to fulfil the same operations with the extended possibilities. |
||
114 | mikedld | 242 | * Block = 512 bytes. |
118 | diamond | 243 | * For reading all file you can specify the certainly large value |
244 | in edx, for example, edx = -1; but in this case be ready that |
||
245 | the program will "fall", if the file will appear too large and can |
||
246 | not be placed in the program memory. |
||
247 | * The filename must be either in the format 8+3 characters |
||
248 | (first 8 characters - name itself, last 3 - extension, |
||
249 | the short names and extensions are supplemented with spaces), |
||
250 | or in the format 8.3 characters "FILE.EXT"/"FILE.EX " |
||
251 | (name no more than 8 characters, dot, extension 3 characters |
||
252 | supplemented if necessary by spaces). |
||
253 | The filename must be written with capital letters. The terminating |
||
254 | character with code 0 is not necessary (not ASCIIZ-string). |
||
255 | * This function does not support folders on the ramdisk. |
||
114 | mikedld | 256 | |
257 | ====================================================================== |
||
258 | =============== Function 7 - draw image in the window. =============== |
||
259 | ====================================================================== |
||
118 | diamond | 260 | Paramters: |
261 | * eax = 7 - function number |
||
262 | * ebx = pointer to the image in the format BBGGRRBBGGRR... |
||
114 | mikedld | 263 | * ecx = [size on axis x]*65536 + [size on axis y] |
264 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
||
265 | Returned value: |
||
266 | * function does not return value |
||
267 | Remarks: |
||
118 | diamond | 268 | * Coordinates of the image are coordinates of the upper left corner |
269 | of the image relative to the window. |
||
114 | mikedld | 270 | * Size of the image in bytes is 3*xsize*ysize. |
271 | |||
272 | ====================================================================== |
||
273 | =============== Function 8 - define/delete the button. =============== |
||
274 | ====================================================================== |
||
118 | diamond | 275 | Parameters for button definition: |
276 | * eax = 8 - function number |
||
114 | mikedld | 277 | * ebx = [coordinate on axis x]*65536 + [size on axis x] |
278 | * ecx = [coordinate on axis y]*65536 + [size on axis y] |
||
279 | * edx = 0xXYnnnnnn, where: |
||
280 | * nnnnnn = identifier of the button |
||
118 | diamond | 281 | * high (31st) bit of edx is cleared |
282 | * if 30th bit of edx is set - do not draw the button |
||
283 | * if 29th bit of edx is set - do not draw a frame |
||
114 | mikedld | 284 | at pressing the button |
118 | diamond | 285 | * esi = 0x00RRGGBB - color of the button |
286 | Parameters for button deleting: |
||
287 | * eax = 8 - function number |
||
114 | mikedld | 288 | * edx = 0x80nnnnnn, where nnnnnn - identifier of the button |
289 | Returned value: |
||
290 | * function does not return value |
||
291 | Remarks: |
||
118 | diamond | 292 | * Sizes of the button must be more than 0 and less than 0x8000. |
131 | diamond | 293 | * For skinned windows definition of the window |
118 | diamond | 294 | (call of 0th function) creates two standard buttons - |
295 | for close of the window with identifier 1 and |
||
296 | for minimize of the window with identifier 0xffff. |
||
297 | * The creation of two buttons with same identifiers is admitted. |
||
298 | * The button with the identifier 0xffff at pressing is interpreted |
||
299 | by the system as the button of minimization, the system handles |
||
300 | such pressing independently, not accessing to the application. |
||
301 | In rest it is usual button. |
||
302 | * Total number of buttons for all applications is limited to 4095. |
||
114 | mikedld | 303 | |
304 | ====================================================================== |
||
118 | diamond | 305 | ============ Function 9 - information on execution thread. =========== |
114 | mikedld | 306 | ====================================================================== |
307 | Parameters: |
||
118 | diamond | 308 | * eax = 9 - function number |
309 | * ebx = pointer to 1-Kb buffer |
||
310 | * ecx = number of the slot of the thread |
||
311 | ecx = -1 - get information on the current thread |
||
114 | mikedld | 312 | Returned value: |
118 | diamond | 313 | * eax = maximum number of the slot of a thread |
314 | * buffer pointed to by ebx contains the following information: |
||
315 | * +0: dword: usage of the processor (how many time units |
||
316 | per second leaves on execution of this thread) |
||
114 | mikedld | 317 | * +4: word: position of the window of thread in the window stack |
118 | diamond | 318 | * +6: word: (has no relation to the specified thread) |
319 | number of the thread slot, which window has in the window stack |
||
320 | position ecx |
||
114 | mikedld | 321 | * +8: word: reserved |
322 | * +10 = +0xA: 11 bytes: name of the process |
||
118 | diamond | 323 | (name of corresponding executable file in the format 8+3) |
142 | diamond | 324 | * +21 = +0x15: byte: reserved, this byte is not changed |
114 | mikedld | 325 | * +22 = +0x16: dword: address of the process in memory |
326 | * +26 = +0x1A: dword: size of used memory - 1 |
||
327 | * +30 = +0x1E: dword: identifier (PID/TID) |
||
118 | diamond | 328 | * +34 = +0x22: dword: coordinate of the thread window on axis x |
329 | * +38 = +0x26: dword: coordinate of the thread window on axis y |
||
330 | * +42 = +0x2A: dword: size of the thread window on axis x |
||
331 | * +46 = +0x2E: dword: size of the thread window on axis y |
||
332 | * +50 = +0x32: word: status of the thread slot: |
||
333 | * 0 = thread is running |
||
334 | * 1 = thread is suspended |
||
335 | * 2 = thread is suspended while waiting for event |
||
336 | * 3 = thread is terminating as a result of call to function -1 |
||
337 | or under duress as a result of call to subfunction 2 |
||
338 | of function 18 or termination of the system |
||
339 | * 4 = thread is terminating as a result of exception |
||
340 | * 5 = thread waits for event |
||
341 | * 9 = requested slot is free, all other information on the slot |
||
342 | is not meaningful |
||
142 | diamond | 343 | * +52 = +0x34: word: reserved, this word is not changed |
344 | * +54 = +0x36: dword: coordinate of the client area on axis x |
||
345 | * +58 = +0x3A: dword: coordinate of the client area on axis y |
||
346 | * +62 = +0x3E: dword: width of the client area |
||
347 | * +66 = +0x42: dword: height of the client area |
||
348 | * +70 = +0x46: byte: state of the window - bitfield |
||
349 | * bit 0 (mask 1): window is maximized |
||
350 | * bit 1 (mask 2): window is minimized to panel |
||
351 | * bit 2 (mask 4): window is rolled up |
||
114 | mikedld | 352 | Remarks: |
118 | diamond | 353 | * Slots are numbered starting from 1. |
354 | * Returned value is not a total number of threads, because there |
||
355 | can be free slots. |
||
356 | * When process is starting, system automatically creates |
||
357 | execution thread. |
||
358 | * Function gives information on the thread. Each process has |
||
359 | at least one thread. One process can create many threads, |
||
360 | in this case each thread has its own slot and the fields |
||
361 | +10, +22, +26 in these slots coincide. |
||
362 | Applications have no common way to define whether two threads |
||
114 | mikedld | 363 | belong to one process. |
118 | diamond | 364 | * The active window - window on top of the window stack - |
365 | receives the messages on a keyboard input. For such window |
||
366 | the position in the window stack coincides with returned value. |
||
367 | * Slot 1 corresponds to special system thread, for which: |
||
368 | * the window is in the bottom of the window stack, the fields |
||
369 | +4 and +6 contain value 1 |
||
370 | * name of the process - "OS/IDLE" (supplemented by spaces) |
||
371 | * address of the process in memory is 0, size of used memory is |
||
114 | mikedld | 372 | 16 Mb (0x1000000) |
373 | * PID=1 |
||
142 | diamond | 374 | * coordinates and sizes of the window and the client area are by |
375 | convention set to 0 |
||
118 | diamond | 376 | * status of the slot is always 0 (running) |
377 | * the execution time adds of time leaving on operations itself |
||
378 | and idle time in waiting for interrupt (which can be got by call |
||
379 | to subfunction 4 of function 18). |
||
380 | * Beginning from slot 2, the normal applications are placed. |
||
381 | * The normal applications are placed in memory at the address |
||
193 | diamond | 382 | 0x60400000 (kernel constant 'std_application_base_address'). |
118 | diamond | 383 | There is no intersection, as each process has its own page table. |
384 | * At creation of the thread it is assigned the slot |
||
385 | in the system table and identifier (Process/Thread IDentifier = |
||
386 | PID/TID), which do not vary with time for given thread. |
||
387 | After completion of the thread its slot can be anew used |
||
388 | for another thread. The thread identifier can not be assigned |
||
389 | to other thread even after completion of this thread. |
||
390 | Identifiers, assigned to new threads, grow monotonously. |
||
391 | * If the thread has not yet defined the window by call to |
||
392 | function 0, the position and the sizes |
||
393 | of its window are considered to be zero. |
||
142 | diamond | 394 | * Coordinates of the client area are relative to the window. |
118 | diamond | 395 | * At the moment only the part of the buffer by a size |
142 | diamond | 396 | 71 = 0x37 bytes is used. Nevertheless it is recommended to use |
118 | diamond | 397 | 1-Kb buffer for the future compatibility, in the future |
398 | some fields can be added. |
||
114 | mikedld | 399 | |
400 | ====================================================================== |
||
118 | diamond | 401 | ==================== Function 10 - wait for event. =================== |
114 | mikedld | 402 | ====================================================================== |
118 | diamond | 403 | If the message queue is empty, waits for appearance of the message |
404 | in queue. In this state thread does not consume CPU time. |
||
114 | mikedld | 405 | Then reads out the message from queue. |
406 | |||
407 | Parameters: |
||
118 | diamond | 408 | * eax = 10 - function number |
114 | mikedld | 409 | Returned value: |
118 | diamond | 410 | * eax = event (see the list of events) |
114 | mikedld | 411 | Remarks: |
118 | diamond | 412 | * Those events are taken into account only which enter into |
413 | a mask set by function 40. By default it is |
||
414 | redraw, key and button events. |
||
415 | * To check, whether there is a message in queue, use function 11. |
||
416 | To wait for no more than given time, use function 23. |
||
114 | mikedld | 417 | |
118 | diamond | 418 | ====================================================================== |
419 | =============== Function 11 - check for event, no wait. ============== |
||
420 | ====================================================================== |
||
421 | If the message queue contains event, function reads out |
||
422 | and return it. If the queue is empty, function returns 0. |
||
114 | mikedld | 423 | Parameters: |
118 | diamond | 424 | * eax = 11 - function number |
114 | mikedld | 425 | Returned value: |
426 | * eax = 0 - message queue is empty |
||
118 | diamond | 427 | * else eax = event (see the list of events) |
114 | mikedld | 428 | Remarks: |
118 | diamond | 429 | * Those events are taken into account only, which enter into |
430 | a mask set by function 40. By default it is |
||
431 | redraw, key and button events. |
||
432 | * To wait for event, use function 10. |
||
433 | To wait for no more than given time, use function 23. |
||
114 | mikedld | 434 | |
435 | ====================================================================== |
||
118 | diamond | 436 | =============== Function 12 - begin/end window redraw. =============== |
114 | mikedld | 437 | ====================================================================== |
438 | |||
139 | diamond | 439 | ---------------- Subfunction 1 - begin window redraw. ---------------- |
114 | mikedld | 440 | Parameters: |
118 | diamond | 441 | * eax = 12 - function number |
442 | * ebx = 1 - subfunction number |
||
114 | mikedld | 443 | Returned value: |
444 | * function does not return value |
||
445 | |||
139 | diamond | 446 | ----------------- Subfunction 2 - end window redraw. ----------------- |
114 | mikedld | 447 | Parameters: |
118 | diamond | 448 | * eax = 12 - function number |
449 | * ebx = 2 - subfunction number |
||
114 | mikedld | 450 | Returned value: |
451 | * function does not return value |
||
452 | Remarks: |
||
118 | diamond | 453 | * Subfunction 1 deletes all buttons defined with |
454 | function 8, they must be defined again. |
||
114 | mikedld | 455 | |
456 | ====================================================================== |
||
457 | ============ Function 13 - draw a rectangle in the window. =========== |
||
458 | ====================================================================== |
||
459 | Parameters: |
||
118 | diamond | 460 | * eax = 13 - function number |
114 | mikedld | 461 | * ebx = [coordinate on axis x]*65536 + [size on axis x] |
462 | * ecx = [coordinate on axis y]*65536 + [size on axis y] |
||
118 | diamond | 463 | * edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill |
114 | mikedld | 464 | Returned value: |
465 | * function does not return value |
||
466 | Remarks: |
||
467 | * Coordinates are understood as coordinates of the left upper corner |
||
118 | diamond | 468 | of a rectangle relative to the window. |
114 | mikedld | 469 | |
470 | ====================================================================== |
||
118 | diamond | 471 | =================== Function 14 - get screen size. =================== |
114 | mikedld | 472 | ====================================================================== |
473 | Parameters: |
||
118 | diamond | 474 | * eax = 14 - function number |
114 | mikedld | 475 | Returned value: |
476 | * eax = [xsize]*65536 + [ysize], where |
||
477 | * xsize = x-coordinate of the right lower corner of the screen = |
||
118 | diamond | 478 | horizontal size - 1 |
114 | mikedld | 479 | * ysize = y-coordinate of the right lower corner of the screen = |
118 | diamond | 480 | vertical size - 1 |
114 | mikedld | 481 | Remarks: |
118 | diamond | 482 | * See also subfunction 5 of function 48 - get sizes of |
483 | working area of the screen. |
||
114 | mikedld | 484 | |
118 | diamond | 485 | ====================================================================== |
486 | == Function 15, subfunction 1 - set a size of the background image. == |
||
487 | ====================================================================== |
||
114 | mikedld | 488 | Parameters: |
118 | diamond | 489 | * eax = 15 - function number |
490 | * ebx = 1 - subfunction number |
||
114 | mikedld | 491 | * ecx = width of the image |
492 | * edx = height of the image |
||
493 | Returned value: |
||
494 | * function does not return value |
||
495 | Remarks: |
||
485 | heavyiron | 496 | * Before calling functions 15.2 and 15.5 you should call this function |
497 | to set image size! |
||
118 | diamond | 498 | * For update of the screen (after completion of a series of commands |
499 | working with a background) call subfunction 3. |
||
500 | * There is a pair function for get size of the background image - |
||
501 | subfunction 1 of function 39. |
||
114 | mikedld | 502 | |
503 | ====================================================================== |
||
118 | diamond | 504 | === Function 15, subfunction 2 - put pixel on the background image. == |
114 | mikedld | 505 | ====================================================================== |
506 | Parameters: |
||
118 | diamond | 507 | * eax = 15 - function number |
508 | * ebx = 2 - subfunction number |
||
114 | mikedld | 509 | * ecx = offset |
118 | diamond | 510 | * edx = color of a pixel 0xRRGGBB |
114 | mikedld | 511 | Returned value: |
512 | * function does not return value |
||
513 | Remarks: |
||
118 | diamond | 514 | * Offset for a pixel with coordinates (x,y) is calculated as |
114 | mikedld | 515 | (x+y*xsize)*3. |
485 | heavyiron | 516 | * If the given offset exceeds size sets by function 15.1, |
118 | diamond | 517 | the call is ignored. |
518 | * For update of the screen (after completion of a series of commands |
||
519 | working with a background) call subfunction 3. |
||
520 | * There is a pair function for get pixel on the background image - |
||
521 | subfunction 2 of function 39. |
||
114 | mikedld | 522 | |
523 | ====================================================================== |
||
524 | =========== Function 15, subfunction 3 - redraw background. ========== |
||
525 | ====================================================================== |
||
526 | Parameters: |
||
118 | diamond | 527 | * eax = 15 - function number |
528 | * ebx = 3 - subfunction number |
||
114 | mikedld | 529 | Returned value: |
530 | * function does not return value |
||
531 | |||
118 | diamond | 532 | ====================================================================== |
533 | == Function 15, subfunction 4 - set drawing mode for the background. = |
||
534 | ====================================================================== |
||
114 | mikedld | 535 | Parameters: |
118 | diamond | 536 | * eax = 15 - function number |
537 | * ebx = 4 - subfunction number |
||
538 | * ecx = drawing mode: |
||
114 | mikedld | 539 | * 1 = tile |
540 | * 2 = stretch |
||
541 | Returned value: |
||
542 | * function does not return value |
||
543 | Remarks: |
||
118 | diamond | 544 | * For update of the screen (after completion of a series of commands |
545 | working with a background) call subfunction 3. |
||
546 | * There is a pair function for get drawing mode of the background - |
||
547 | subfunction 4 of function 39. |
||
114 | mikedld | 548 | |
118 | diamond | 549 | ====================================================================== |
550 | ===================== Function 15, subfunction 5 ===================== |
||
551 | ============ Put block of pixels on the background image. ============ |
||
552 | ====================================================================== |
||
114 | mikedld | 553 | Parameters: |
118 | diamond | 554 | * eax = 15 - function number |
555 | * ebx = 5 - subfunction number |
||
556 | * ecx = pointer to the data in the format BBGGRRBBGGRR... |
||
114 | mikedld | 557 | * edx = offset in data of the background image |
118 | diamond | 558 | * esi = size of data in bytes = 3 * number of pixels |
114 | mikedld | 559 | Returned value: |
560 | * function does not return value |
||
561 | Remarks: |
||
485 | heavyiron | 562 | * If the block gets out abroad size sets by function 15.1, |
114 | mikedld | 563 | the call is ignored. |
118 | diamond | 564 | * Color of each pixel is stored as 3-bytes value BBGGRR. |
565 | * Pixels of the background image are written sequentially |
||
566 | from left to right, from up to down. |
||
567 | * Offset of pixel with coordinates (x,y) is (x+y*xsize)*3. |
||
568 | * For update of the screen (after completion of a series of commands |
||
569 | working with a background) call subfunction 3. |
||
114 | mikedld | 570 | |
571 | ====================================================================== |
||
118 | diamond | 572 | =============== Function 16 - save ramdisk on a floppy. ============== |
114 | mikedld | 573 | ====================================================================== |
574 | Parameters: |
||
118 | diamond | 575 | * eax = 16 - function number |
576 | * ebx = 1 or ebx = 2 - on which floppy save |
||
114 | mikedld | 577 | Returned value: |
118 | diamond | 578 | * eax = 0 - success |
114 | mikedld | 579 | * eax = 1 - error |
580 | |||
581 | ====================================================================== |
||
118 | diamond | 582 | ======= Function 17 - get the identifier of the pressed button. ====== |
114 | mikedld | 583 | ====================================================================== |
584 | Takes away the code of the pressed button from the buffer. |
||
585 | Parameters: |
||
118 | diamond | 586 | * eax = 17 - function number |
114 | mikedld | 587 | Returned value: |
118 | diamond | 588 | * if the buffer is empty, function returns eax=1 |
589 | * if the buffer is not empty, function returns al=0, |
||
590 | high 24 bits of eax contain button identifier (in particular, ah |
||
591 | contains low byte of the identifier; if all buttons have |
||
592 | the identifier less than 256, ah is enough to distinguish). |
||
114 | mikedld | 593 | Remarks: |
118 | diamond | 594 | * "Buffer" keeps only one button, at pressing the new button the |
595 | information about old is lost. |
||
596 | * The call of this function by an application with inactive window |
||
597 | will return answer "buffer is empty". |
||
114 | mikedld | 598 | |
599 | ====================================================================== |
||
118 | diamond | 600 | ============ Function 18, subfunction 1 - system shutdown. =========== |
114 | mikedld | 601 | ====================================================================== |
602 | Parameters: |
||
118 | diamond | 603 | * eax = 18 - function number |
604 | * ebx = 1 - subfunction number |
||
114 | mikedld | 605 | Returned value: |
118 | diamond | 606 | * function always return eax = 0 as tag of success |
114 | mikedld | 607 | Remarks: |
118 | diamond | 608 | * On the last step menu of exit from the system appears and waits |
609 | response of the user. |
||
610 | * See also subfunction 9, system shutdown with |
||
611 | the parameter to force the choice in the exit menu. |
||
114 | mikedld | 612 | |
613 | ====================================================================== |
||
118 | diamond | 614 | = Function 18, subfunction 2 - terminate process/thread by the slot. = |
114 | mikedld | 615 | ====================================================================== |
616 | Parameters: |
||
118 | diamond | 617 | * eax = 18 - function number |
618 | * ebx = 2 - subfunction number |
||
114 | mikedld | 619 | * ecx = number of the slot of process/thread |
620 | Returned value: |
||
621 | * function does not return value |
||
622 | Remarks: |
||
118 | diamond | 623 | * It is impossible to terminate system thread OS/IDLE (with |
624 | number of the slot 1), |
||
625 | it is possible to terminate any normal process/thread. |
||
626 | * See also subfunction 18 - terminate |
||
627 | process/thread by the identifier. |
||
114 | mikedld | 628 | |
118 | diamond | 629 | ====================================================================== |
630 | ===================== Function 18, subfunction 3 ===================== |
||
631 | ============= Make active the window of the given thread. ============ |
||
632 | ====================================================================== |
||
114 | mikedld | 633 | Parameters: |
118 | diamond | 634 | * eax = 18 - function number |
635 | * ebx = 3 - subfunction number |
||
636 | * ecx = number of the thread slot |
||
114 | mikedld | 637 | Returned value: |
638 | * function does not return value |
||
639 | Remarks: |
||
118 | diamond | 640 | * If correct, but nonexistent slot is given, |
641 | some window is made active. |
||
642 | * To find out, which window is active, use subfunction 7. |
||
114 | mikedld | 643 | |
118 | diamond | 644 | ====================================================================== |
645 | ===================== Function 18, subfunction 4 ===================== |
||
646 | =========== Get counter of idle time units per one second. =========== |
||
647 | ====================================================================== |
||
648 | Idle time units are units, in which the processor stands idle |
||
649 | in waiting for interrupt (in the command 'hlt'). |
||
114 | mikedld | 650 | |
651 | Parameters: |
||
118 | diamond | 652 | * eax = 18 - function number |
653 | * ebx = 4 - subfunction number |
||
114 | mikedld | 654 | Returned value: |
118 | diamond | 655 | * eax = value of the counter of idle time units per one second |
114 | mikedld | 656 | |
657 | ====================================================================== |
||
118 | diamond | 658 | ========== Function 18, subfunction 5 - get CPU clock rate. ========== |
114 | mikedld | 659 | ====================================================================== |
660 | Parameters: |
||
118 | diamond | 661 | * eax = 18 - function number |
662 | * ebx = 5 - subfunction number |
||
114 | mikedld | 663 | Returned value: |
118 | diamond | 664 | * eax = clock rate (modulo 2^32 clock ticks = 4GHz) |
114 | mikedld | 665 | |
118 | diamond | 666 | ====================================================================== |
667 | Function 18, subfunction 6 - save ramdisk to the file on hard drive. |
||
668 | ====================================================================== |
||
114 | mikedld | 669 | Parameters: |
118 | diamond | 670 | * eax = 18 - function number |
671 | * ebx = 6 - subfunction number |
||
341 | heavyiron | 672 | * ecx = pointer to the full path to file |
673 | (for example, "/hd0/1/kolibri/kolibri.img") |
||
114 | mikedld | 674 | Returned value: |
118 | diamond | 675 | * eax = 0 - success |
676 | * else eax = error code of the file system |
||
486 | kastigar | 677 | іамечания: |
118 | diamond | 678 | * All folders in the given path must exist, otherwise function |
679 | returns value 5, "file not found". |
||
114 | mikedld | 680 | |
681 | ====================================================================== |
||
118 | diamond | 682 | =========== Function 18, subfunction 7 - get active window. ========== |
114 | mikedld | 683 | ====================================================================== |
684 | Parameters: |
||
118 | diamond | 685 | * eax = 18 - function number |
686 | * ebx = 7 - subfunction number |
||
114 | mikedld | 687 | Returned value: |
118 | diamond | 688 | * eax = number of the active window |
689 | (number of the slot of the thread with active window) |
||
114 | mikedld | 690 | Remarks: |
118 | diamond | 691 | * Active window is at the top of the window stack and receives |
692 | messages on all keyboard input. |
||
693 | * To make a window active, use subfunction 3. |
||
114 | mikedld | 694 | |
118 | diamond | 695 | ====================================================================== |
696 | == Function 18, subfunction 8 - disable/enable the internal speaker. = |
||
697 | ====================================================================== |
||
698 | If speaker sound is disabled, all calls to subfunction 55 of |
||
699 | function 55 are ignored. If speaker sound is enabled, |
||
700 | they are routed on builtin speaker. |
||
114 | mikedld | 701 | |
118 | diamond | 702 | ------------------- Subsubfunction 1 - get status. ------------------- |
114 | mikedld | 703 | Parameters: |
118 | diamond | 704 | * eax = 18 - function number |
705 | * ebx = 8 - subfunction number |
||
706 | * ecx = 1 - number of the subsubfunction |
||
114 | mikedld | 707 | Returned value: |
118 | diamond | 708 | * eax = 0 - speaker sound is enabled; 1 - disabled |
114 | mikedld | 709 | |
118 | diamond | 710 | ----------------- Subsubfunction 2 - toggle status. ------------------ |
711 | Toggles states of disable/enable. |
||
114 | mikedld | 712 | Parameters: |
118 | diamond | 713 | * eax = 18 - function number |
714 | * ebx = 8 - subfunction number |
||
715 | * ecx = 2 - number of the subsubfunction |
||
114 | mikedld | 716 | Returned value: |
717 | * function does not return value |
||
718 | |||
118 | diamond | 719 | ====================================================================== |
720 | == Function 18, subfunction 9 - system shutdown with the parameter. == |
||
721 | ====================================================================== |
||
114 | mikedld | 722 | Parameters: |
118 | diamond | 723 | * eax = 18 - function number |
724 | * ebx = 9 - subfunction number |
||
114 | mikedld | 725 | * ecx = parameter: |
118 | diamond | 726 | * 1 = on the last step of shutdown save ramdisk on a floppy and |
727 | then show the exit menu and request further operations |
||
728 | from the user |
||
729 | * 2 = turn off computer |
||
730 | * 3 = reboot computer |
||
731 | * 4 = restart the kernel from the file 'kernel.mnt' on ramdisk |
||
114 | mikedld | 732 | Returned value: |
118 | diamond | 733 | * at incorrect ecx the registers do not change (i.e. eax=18) |
734 | * by correct call function always returns eax=0 |
||
735 | as the tag of success |
||
114 | mikedld | 736 | Remarks: |
118 | diamond | 737 | * Do not rely on returned value by incorrect call, it can be |
738 | changed in future versions of the kernel. |
||
739 | * It is possible to use subfunction 1, that on the last step |
||
740 | the user makes choice himself. |
||
741 | * It is not recommended to use value ecx=1 (to not irritate the user |
||
742 | with excessive questions); to save ramdisk on a floppy use |
||
743 | function 16 (which admits specification, on which floppy to |
||
744 | write), and to shutdown with the exit menu use already mentioned |
||
745 | subfunction 1. |
||
114 | mikedld | 746 | |
118 | diamond | 747 | ====================================================================== |
748 | ===== Function 18, subfunction 10 - minimize application window. ===== |
||
749 | ====================================================================== |
||
750 | Minimizes the own window. |
||
114 | mikedld | 751 | Parameters: |
118 | diamond | 752 | * eax = 18 - function number |
753 | * ebx = 10 - subfunction number |
||
114 | mikedld | 754 | Returned value: |
755 | * function does not return value |
||
756 | Remarks: |
||
118 | diamond | 757 | * The minimized window from the point of view of function 9 |
758 | keeps position and sizes. |
||
759 | * Restoring of an application window occurs at its activation by |
||
760 | subfunction 3. |
||
761 | * Usually there is no necessity to minimize/restire a window |
||
762 | obviously: minimization of a window is carried out by the system |
||
763 | at pressing the minimization button (for skinned windows |
||
764 | it is defined automatically by function 0, |
||
765 | for other windows it can be defined manually by function 8), |
||
766 | restore of a window is done by the application '@panel'. |
||
114 | mikedld | 767 | |
768 | ====================================================================== |
||
118 | diamond | 769 | Function 18, subfunction 11 - get information on the disk subsystem. |
114 | mikedld | 770 | ====================================================================== |
771 | Parameters: |
||
118 | diamond | 772 | * eax = 18 - function number |
773 | * ebx = 11 - subfunction number |
||
114 | mikedld | 774 | * ecx = type of the table: |
775 | * 1 = short version, 10 bytes |
||
776 | * 2 = full version, 65536 bytes |
||
118 | diamond | 777 | * edx = pointer to the buffer (in the application) for the table |
114 | mikedld | 778 | Returned value: |
779 | * function does not return value |
||
118 | diamond | 780 | Format of the table: short version: |
781 | * +0: byte: information about FDD's (drives for floppies), |
||
782 | AAAABBBB, where AAAA gives type of the first drive, BBBB - |
||
783 | of the second regarding to the following list: |
||
114 | mikedld | 784 | * 0 = there is no drive |
785 | * 1 = 360Kb, 5.25'' |
||
786 | * 2 = 1.2Mb, 5.25'' |
||
787 | * 3 = 720Kb, 3.5'' |
||
788 | * 4 = 1.44Mb, 3.5'' |
||
118 | diamond | 789 | * 5 = 2.88Mb, 3.5'' (such drives are not used anymore) |
790 | For example, for the standard configuration from one 1.44-drive |
||
791 | here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B: |
||
792 | the value is 24h. |
||
793 | * +1: byte: information about hard disks and CD-drives, AABBCCDD, |
||
114 | mikedld | 794 | where AA corresponds to the controller IDE0, ..., DD - IDE3: |
795 | * 0 = device is absent |
||
118 | diamond | 796 | * 1 = hard drive |
797 | * 2 = CD-drive |
||
798 | For example, in the case HD on IDE0 and CD on IDE2 |
||
799 | this field contains 48h. |
||
800 | * +2: 4 db: number of the retrieved partitions on hard disks |
||
801 | at accordingly IDE0,...,IDE3. |
||
802 | If the hard disk on IDEx is absent, appropriate byte is zero, |
||
803 | otherwise it shows number of the recognized partitions, which |
||
804 | can be not presented (if the drive is not formatted or if |
||
805 | the file system is not supported). Current version of the kernel |
||
277 | diamond | 806 | supports only FAT16, FAT32 and NTFS for hard disks. |
114 | mikedld | 807 | * +6: 4 db: reserved |
118 | diamond | 808 | Format of the table: full version: |
809 | * +0: 10 db: same as for the short version |
||
114 | mikedld | 810 | * +10: 100 db: data for the first partition |
811 | * +110: 100 db: data for the second partition |
||
812 | * ... |
||
813 | * +10+100*(n-1): 100 db: data for the last partition |
||
118 | diamond | 814 | The partitions are located as follows: at first sequentially all |
815 | recoginzed partitions on HD on IDE0 (if present), |
||
816 | then on HD on IDE1 (if present) and so on up to IDE3. |
||
817 | Format of the information about partition |
||
818 | (at moment only FAT is supported): |
||
114 | mikedld | 819 | * +0: dword: first physical sector of the partition |
820 | * +4: dword: last physical sector of the partition |
||
118 | diamond | 821 | (belongs to the partition) |
277 | diamond | 822 | * +8: byte: file system type: |
823 | 16=FAT16, 32=FAT32, 1=NTFS |
||
824 | * other data are dependent on file system, are modified with |
||
825 | kernel modifications and therefore are not described |
||
114 | mikedld | 826 | Remarks: |
118 | diamond | 827 | * The short table can be used for obtaining the information about |
828 | available devices. |
||
114 | mikedld | 829 | |
830 | ====================================================================== |
||
118 | diamond | 831 | ========== Function 18, subfunction 13 - get kernel version. ========= |
114 | mikedld | 832 | ====================================================================== |
833 | Parameters: |
||
118 | diamond | 834 | * eax = 18 - function number |
835 | * ebx = 13 - subfunction number |
||
836 | * ecx = pointer to the buffer (not less than 16 bytes), where |
||
837 | the information will be placed |
||
114 | mikedld | 838 | Returned value: |
839 | * function does not return value |
||
840 | Structure of the buffer: |
||
841 | db a,b,c,d for version a.b.c.d |
||
842 | db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2 |
||
118 | diamond | 843 | db 'name',0 - ASCIIZ-string with the name |
346 | diamond | 844 | For Kolibri 0.6.5.0 kernel: |
845 | db 0,6,5,0 |
||
114 | mikedld | 846 | db 2 |
847 | db 'Kolibri',0 |
||
848 | |||
118 | diamond | 849 | ====================================================================== |
850 | ======= Function 18, subfunction 14 - wait for screen retrace. ======= |
||
851 | ====================================================================== |
||
852 | Waits for the beginning of retrace of the scanning ray of the screen |
||
853 | monitor. |
||
114 | mikedld | 854 | Parameters: |
118 | diamond | 855 | * eax = 18 - function number |
856 | * ebx = 14 - subfunction number |
||
114 | mikedld | 857 | Returned value: |
118 | diamond | 858 | * eax = 0 as the tag of success |
114 | mikedld | 859 | Remarks: |
118 | diamond | 860 | * Function is intended only for active high-efficiency graphics |
114 | mikedld | 861 | applications; is used for smooth output of a graphics. |
862 | |||
118 | diamond | 863 | ====================================================================== |
864 | == Function 18, subfunction 15 - center mouse cursor on the screen. == |
||
865 | ====================================================================== |
||
114 | mikedld | 866 | Parameters: |
118 | diamond | 867 | * eax = 18 - function number |
868 | * ebx = 15 - subfunction number |
||
114 | mikedld | 869 | Returned value: |
118 | diamond | 870 | * eax = 0 as the tag of success |
114 | mikedld | 871 | |
872 | ====================================================================== |
||
118 | diamond | 873 | ========= Function 18, subfunction 16 - get size of free RAM. ======== |
114 | mikedld | 874 | ====================================================================== |
875 | Parameters: |
||
118 | diamond | 876 | * eax = 18 - function number |
877 | * ebx = 16 - subfunction number |
||
114 | mikedld | 878 | Returned value: |
879 | * eax = size of free memory in kilobytes |
||
880 | |||
881 | ====================================================================== |
||
118 | diamond | 882 | ======== Function 18, subfunction 17 - get full amount of RAM. ======= |
114 | mikedld | 883 | ====================================================================== |
884 | Parameters: |
||
118 | diamond | 885 | * eax = 18 - function number |
886 | * ebx = 17 - subfunction number |
||
114 | mikedld | 887 | Returned value: |
118 | diamond | 888 | * eax = total size of existing memory in kilobytes |
114 | mikedld | 889 | |
890 | ====================================================================== |
||
118 | diamond | 891 | ===================== Function 18, subfunction 18 ==================== |
892 | ============= Terminate process/thread by the identifier. ============ |
||
114 | mikedld | 893 | ====================================================================== |
894 | Parameters: |
||
118 | diamond | 895 | * eax = 18 - function number |
896 | * ebx = 18 - subfunction number |
||
897 | * ecx = identifer of process/thread (PID/TID) |
||
114 | mikedld | 898 | Returned value: |
118 | diamond | 899 | * eax = 0 - success |
900 | * eax = -1 - error (process is not found or is system) |
||
114 | mikedld | 901 | Remarks: |
118 | diamond | 902 | * It is impossible to terminate system thread OS/IDLE (identifier |
903 | 1), it is possible to terminate any normal process/thread. |
||
904 | * See also subfunction 2 - terminate |
||
905 | process/thread by given slot. |
||
114 | mikedld | 906 | |
907 | ====================================================================== |
||
131 | diamond | 908 | ======== Function 18, subfunction 19 - get/set mouse features. ======= |
120 | mario79 | 909 | ====================================================================== |
131 | diamond | 910 | |
911 | ---------------- Subsubfunction 0 - get mouse speed. ----------------- |
||
120 | mario79 | 912 | Parameters: |
913 | * eax = 18 - function number |
||
914 | * ebx = 19 - subfunction number |
||
131 | diamond | 915 | * ecx = 0 - subsubfunction number |
916 | Returned value: |
||
917 | * eax = current mouse speed |
||
120 | mario79 | 918 | |
131 | diamond | 919 | ---------------- Subsubfunction 1 - set mouse speed. ----------------- |
920 | Parameters: |
||
921 | * eax = 18 - function number |
||
922 | * ebx = 19 - subfunction number |
||
923 | * ecx = 1 - subsubfunction number |
||
924 | * edx = new value for speed |
||
925 | Returned value: |
||
926 | * function does not return value |
||
120 | mario79 | 927 | |
131 | diamond | 928 | ---------------- Subsubfunction 2 - get mouse delay. ----------------- |
929 | Parameters: |
||
930 | * eax = 18 - function number |
||
931 | * ebx = 19 - subfunction number |
||
932 | * ecx = 2 - subsubfunction number |
||
933 | Returned value: |
||
934 | * eax = current mouse delay |
||
120 | mario79 | 935 | |
131 | diamond | 936 | ---------------- Subsubfunction 3 - set mouse delay. ----------------- |
937 | Parameters: |
||
938 | * eax = 18 - function number |
||
939 | * ebx = 19 - subfunction number |
||
940 | * ecx = 3 - subsubfunction number |
||
941 | * edx = new value for mouse delay |
||
942 | Returned value: |
||
943 | * function does not return value |
||
120 | mario79 | 944 | |
131 | diamond | 945 | ----------- Subsubfunction 4 - set mouse pointer position. ----------- |
946 | Parameters: |
||
947 | * eax = 18 - function number |
||
948 | * ebx = 19 - subfunction number |
||
949 | * ecx = 4 - subsubfunction number |
||
950 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
||
951 | Returned value: |
||
952 | * function does not return value |
||
120 | mario79 | 953 | Remarks: |
131 | diamond | 954 | * It is recommended to set speed of the mouse (in subsubfunction 1) |
955 | from 1 up to 9. The installed value is not inspected by the kernel |
||
956 | code, so set it carefully, at incorrect value the cursor |
||
957 | can "freeze". Speed of the mouse can be regulated through the |
||
958 | application SETUP. |
||
959 | * Recommended delay of the mouse (in subsubfunction 3) = 10. Lower |
||
960 | value is not handled by COM mice. At the very large values the |
||
961 | movement of the mouse on 1 pixel is impossible and the cursor will |
||
962 | jump on the value of installed speed (subsubfunction 1). The |
||
963 | installed value is not inspected by the kernel code. |
||
133 | diamond | 964 | Mouse delay can be regulated through the application SETUP. |
131 | diamond | 965 | * The subsubfunction 4 does not check the passed value. Before |
966 | its call find out current screen resolution (with function 14) |
||
967 | and check that the value of position is inside the limits of the |
||
968 | screen. |
||
120 | mario79 | 969 | |
970 | ====================================================================== |
||
193 | diamond | 971 | ======== Function 18, subfunction 20 - get information on RAM. ======= |
972 | ====================================================================== |
||
973 | Parameters: |
||
974 | * eax = 18 - function number |
||
975 | * ebx = 20 - subfunction number |
||
976 | * ecx = pointer to the buffer for information (36 bytes) |
||
977 | Returned value: |
||
978 | * eax = total size of existing RAM in pages |
||
979 | or -1 if error has occured |
||
980 | * buffer pointed to by ecx contains the following information: |
||
981 | * +0: dword: total size of existing RAM in pages |
||
982 | * +4: dword: size of free RAM in pages |
||
983 | * +8: dword: number of page faults (exceptions #PF) |
||
984 | in applications |
||
985 | * +12: dword: size of kernel heap in bytes |
||
986 | * +16: dword: free in kernel heap in bytes |
||
987 | * +20: dword: total number of memory blocks in kernel heap |
||
988 | * +24: dword: number of free memory blocks in kernel heap |
||
989 | * +28: dword: size of maximum free block in kernel heap |
||
990 | (reserved) |
||
991 | * +32: dword: size of maximum allocated block in kernel heap |
||
992 | (reserved) |
||
993 | |||
994 | ====================================================================== |
||
118 | diamond | 995 | ==================== Function 20 - MIDI interface. =================== |
114 | mikedld | 996 | ====================================================================== |
997 | |||
118 | diamond | 998 | ----------------------- Subfunction 1 - reset ------------------------ |
114 | mikedld | 999 | Parameters: |
118 | diamond | 1000 | * eax = 20 - function number |
1001 | * ebx = 1 - subfunction number |
||
114 | mikedld | 1002 | |
1003 | -------------------- Subfunction 2 - output byte --------------------- |
||
1004 | Parameters: |
||
118 | diamond | 1005 | * eax = 20 - function number |
1006 | * ebx = 2 - subfunction number |
||
114 | mikedld | 1007 | * cl = byte for output |
118 | diamond | 1008 | Returned value (is the same for both subfunctions): |
1009 | * eax = 0 - success |
||
114 | mikedld | 1010 | * eax = 1 - base port is not defined |
1011 | Remarks: |
||
118 | diamond | 1012 | * Previously the base port must be defined by |
1013 | subfunction 1 of function 21. |
||
114 | mikedld | 1014 | |
1015 | ====================================================================== |
||
118 | diamond | 1016 | ======== Function 21, subfunction 1 - set MPU MIDI base port. ======== |
114 | mikedld | 1017 | ====================================================================== |
1018 | Parameters: |
||
118 | diamond | 1019 | * eax = 21 - function number |
1020 | * ebx = 1 - subfunction number |
||
1021 | * ecx = number of base port |
||
1022 | Returned value |
||
1023 | * eax = 0 - success |
||
114 | mikedld | 1024 | * eax = -1 - erratic number of a port |
1025 | Remarks: |
||
118 | diamond | 1026 | * Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF. |
1027 | * The installation of base is necessary for function 20. |
||
1028 | * To get base port use subfunction 1 of function 26. |
||
114 | mikedld | 1029 | |
1030 | ====================================================================== |
||
118 | diamond | 1031 | ========== Function 21, subfunction 2 - set keyboard layout. ========= |
114 | mikedld | 1032 | ====================================================================== |
118 | diamond | 1033 | Keyboard layout is used to convert keyboard scancodes to ASCII-codes, |
1034 | which will be read by function 2. |
||
114 | mikedld | 1035 | Parameters: |
118 | diamond | 1036 | * eax = 21 - function number |
1037 | * ebx = 2 - subfunction number |
||
1038 | * ecx = which layout to set: |
||
114 | mikedld | 1039 | * 1 = normal layout |
1040 | * 2 = layout at pressed Shift |
||
1041 | * 3 = layout at pressed Alt |
||
118 | diamond | 1042 | * edx = pointer to layout - table of length 128 bytes |
114 | mikedld | 1043 | Or: |
1044 | * ecx = 9 |
||
118 | diamond | 1045 | * dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus) |
114 | mikedld | 1046 | Returned value: |
118 | diamond | 1047 | * eax = 0 - success |
1048 | * eax = 1 - incorrect parameter |
||
114 | mikedld | 1049 | Remarks: |
118 | diamond | 1050 | * If Alt is pressed, the layout with Alt is used; |
1051 | if Alt is not pressed, but Shift is pressed, |
||
1052 | the layout with Shift is used; |
||
1053 | if Alt and Shift are not pressed, but Ctrl is pressed, the normal |
||
1054 | layout is used and then from the code is subtracted 0x60; |
||
1055 | if no control key is pressed, the normal layout is used. |
||
1056 | * To get layout and country identifier use |
||
1057 | subfunction 2 of function 26. |
||
1058 | * Country identifier is global system variable, which is not used |
||
1059 | by the kernel itself; however the application '@panel' displays |
||
1060 | the corresponding icon. |
||
1061 | * The application @panel switches layouts on user request. |
||
114 | mikedld | 1062 | |
1063 | ====================================================================== |
||
118 | diamond | 1064 | ============== Function 21, subfunction 3 - set CD base. ============= |
114 | mikedld | 1065 | ====================================================================== |
1066 | Parameters: |
||
118 | diamond | 1067 | * eax = 21 - function number |
1068 | * ebx = 3 - subfunction number |
||
1069 | * ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3 |
||
114 | mikedld | 1070 | Returned value: |
1071 | * eax = 0 |
||
1072 | Remarks: |
||
118 | diamond | 1073 | * CD base is used by function 24. |
1074 | * To get CD base use subfunction 3 of function 26. |
||
114 | mikedld | 1075 | |
1076 | ====================================================================== |
||
118 | diamond | 1077 | ====== Function 21, subfunction 4 - set Sound Blaster base port. ===== |
114 | mikedld | 1078 | ====================================================================== |
1079 | Parameters: |
||
118 | diamond | 1080 | * eax = 21 - function number |
1081 | * ebx = 4 - subfunction number |
||
1082 | * ecx = number of the base port |
||
114 | mikedld | 1083 | Returned value: |
118 | diamond | 1084 | * eax = 0 - success |
1085 | * eax = -1 - erratic port number |
||
114 | mikedld | 1086 | Remarks: |
118 | diamond | 1087 | * Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF. |
1088 | * The installation of the base is necessary for |
||
1089 | functions 25, 28, 55. |
||
1090 | * To get base port use subfunction 4 of function 26. |
||
114 | mikedld | 1091 | |
1092 | ====================================================================== |
||
118 | diamond | 1093 | ========== Function 21, subfunction 5 - set system language. ========= |
114 | mikedld | 1094 | ====================================================================== |
1095 | Parameters: |
||
118 | diamond | 1096 | * eax = 21 - function number |
1097 | * ebx = 5 - subfunction number |
||
1098 | * ecx = system language (1=eng, 2=fi, 3=ger, 4=rus) |
||
114 | mikedld | 1099 | Returned value: |
1100 | * eax = 0 |
||
1101 | Remarks: |
||
118 | diamond | 1102 | * System language is global system variable and is not used |
1103 | by the kernel itself, however application @panel draws the |
||
1104 | appropriate icon. |
||
1105 | * Function does not check for correctness, as the kernel does not |
||
1106 | use this variable. |
||
1107 | * To get system language use subfunction 5 of function 26. |
||
114 | mikedld | 1108 | |
1109 | ====================================================================== |
||
118 | diamond | 1110 | ============== Function 21, subfunction 7 - set HD base. ============= |
114 | mikedld | 1111 | ====================================================================== |
118 | diamond | 1112 | The HD base defines hard disk to write with usage of obsolete |
346 | diamond | 1113 | syntax /HD in obsolete function 58; at usage of modern syntax |
1114 | /HD0,/HD1,/HD2,/HD3 base is set automatically. |
||
114 | mikedld | 1115 | Parameters: |
118 | diamond | 1116 | * eax = 21 - function number |
1117 | * ebx = 7 - subfunction number |
||
1118 | * ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3 |
||
114 | mikedld | 1119 | Returned value: |
1120 | * eax = 0 |
||
1121 | Remarks: |
||
118 | diamond | 1122 | * Any application at any time can change the base. |
1123 | * Do not change base, when any application works with hard disk. |
||
1124 | If you do not want system bugs. |
||
1125 | * To get HD base use subfunction 7 of function 26. |
||
1126 | * It is also necessary to define used partition of hard disk by |
||
1127 | subfunction 8. |
||
114 | mikedld | 1128 | |
1129 | ====================================================================== |
||
118 | diamond | 1130 | ========= Function 21, subfunction 8 - set used HD partition. ======== |
114 | mikedld | 1131 | ====================================================================== |
118 | diamond | 1132 | The HD partition defines partition of the hard disk to write with |
346 | diamond | 1133 | usage of obsolete syntax /HD and obsolete function 58; |
118 | diamond | 1134 | at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3 |
346 | diamond | 1135 | base and partition are set automatically. |
114 | mikedld | 1136 | Parameters: |
118 | diamond | 1137 | * eax = 21 - function number |
1138 | * ebx = 8 - subfunction number |
||
1139 | * ecx = HD partition (beginning from 1) |
||
1140 | Return value: |
||
114 | mikedld | 1141 | * eax = 0 |
1142 | Remarks: |
||
118 | diamond | 1143 | * Any application at any time can change partition. |
1144 | * Do not change partition when any application works with hard disk. |
||
1145 | If you do not want system bugs. |
||
1146 | * To get used partition use subfunction 8 of function 26. |
||
1147 | * There is no correctness checks. |
||
1148 | * To get the number of partitions of a hard disk use |
||
1149 | subfunction 11 of function 18. |
||
1150 | * It is also necessary to define used HD base by subfunction 7. |
||
114 | mikedld | 1151 | |
1152 | ====================================================================== |
||
118 | diamond | 1153 | ======== Function 21, subfunction 10 - set sound DMA channel. ======== |
114 | mikedld | 1154 | ====================================================================== |
1155 | Parameters: |
||
118 | diamond | 1156 | * eax = 21 - function number |
1157 | * ebx = 10 - subfunction number |
||
114 | mikedld | 1158 | * ecx = number of channel (from 0 up to 3 inclusively) |
1159 | Returned value: |
||
118 | diamond | 1160 | * eax = 0 - success |
1161 | * eax = -1 - incorrect channel number |
||
114 | mikedld | 1162 | Remarks: |
118 | diamond | 1163 | * Number of DMA channel is used in subfunction 1 of function 55. |
1164 | * To get sound DMA channel use subfunction 10 of function 26. |
||
114 | mikedld | 1165 | |
1166 | ====================================================================== |
||
118 | diamond | 1167 | Function 21, subfunction 11 - enable/disable low-level access to HD. |
114 | mikedld | 1168 | ====================================================================== |
1169 | Parameters: |
||
118 | diamond | 1170 | * eax = 21 - function number |
1171 | * ebx = 11 - subfunction number |
||
1172 | * ecx = 0/1 - disable/enable |
||
114 | mikedld | 1173 | Returned value: |
1174 | * eax = 0 |
||
1175 | Remarks: |
||
118 | diamond | 1176 | * Is used in LBA-read (subfunction 8 of function 58). |
1177 | * The current implementation uses only low bit of ecx. |
||
1178 | * To get current status use subfunction 11 of function 26. |
||
114 | mikedld | 1179 | |
1180 | ====================================================================== |
||
118 | diamond | 1181 | Function 21, subfunction 12 - enable/disable low-level access to PCI. |
114 | mikedld | 1182 | ====================================================================== |
1183 | Parameters: |
||
118 | diamond | 1184 | * eax = 21 - function number |
1185 | * ebx = 12 - subfunction number |
||
1186 | * ecx = 0/1 - disable/enable |
||
114 | mikedld | 1187 | Returned value: |
1188 | * eax = 0 |
||
1189 | Remarks: |
||
118 | diamond | 1190 | * Is used in operations with PCI bus (function 62). |
1191 | * The current implementation uses only low bit of ecx. |
||
1192 | * To get current status use subfunction 12 of function 26. |
||
114 | mikedld | 1193 | |
1194 | ====================================================================== |
||
118 | diamond | 1195 | ============ Function 21, subfunction 13, subsubfunction 1 =========== |
1196 | ======== Initialize + get information on the driver vmode.mdr. ======= |
||
114 | mikedld | 1197 | ====================================================================== |
1198 | Parameters: |
||
118 | diamond | 1199 | * eax = 21 - function number |
1200 | * ebx = 13 - subfunction number |
||
1201 | * ecx = 1 - number of the driver function |
||
1202 | * edx = pointer to 512-bytes buffer |
||
114 | mikedld | 1203 | Returned value: |
118 | diamond | 1204 | * if driver is not loaded |
1205 | (never happens in the current implementation): |
||
114 | mikedld | 1206 | * eax = -1 |
118 | diamond | 1207 | * ebx, ecx destroyed |
1208 | * if driver is loaded: |
||
1209 | * eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high) |
||
1210 | - signature |
||
1211 | * ebx = current frequency of the scanning (in Hz) |
||
1212 | * ecx destroyed |
||
1213 | * buffer pointed to by edx is filled |
||
114 | mikedld | 1214 | Format of the buffer: |
118 | diamond | 1215 | * +0: 32*byte: driver name, "Trans VideoDriver" |
1216 | (without quotes, supplemented by spaces) |
||
1217 | * +32 = +0x20: dword: driver version (version x.y is encoded as |
||
1218 | y*65536+x), for the current implementation is 1 (1.0) |
||
1219 | * +36 = +0x24: 7*dword: reserved (0 in the current implementation) |
||
1220 | * +64 = +0x40: 32*word: list of supported videomodes (each word |
||
1221 | is number of a videomode, after list itself there are zeroes) |
||
1222 | * +128 = +0x80: 32*(5*word): list of supported frequences of the |
||
1223 | scannings for videomodes: for each videomode listed in the |
||
1224 | previous field up to 5 supported frequences are given |
||
1225 | (unused positions contain zeroes) |
||
114 | mikedld | 1226 | Remarks: |
118 | diamond | 1227 | * Function initializes the driver (if it is not initialized yet) |
1228 | and must be called first, before others (otherwise they will do |
||
1229 | nothing and return -1). |
||
1230 | * The current implementation supports only one frequency |
||
1231 | of the scanning on videomode. |
||
114 | mikedld | 1232 | |
1233 | ====================================================================== |
||
118 | diamond | 1234 | ============ Function 21, subfunction 13, subsubfunction 2 =========== |
1235 | ================ Get information on current videomode. =============== |
||
114 | mikedld | 1236 | ====================================================================== |
1237 | Parameters: |
||
118 | diamond | 1238 | * eax = 21 - function number |
1239 | * ebx = 13 - subfunction number |
||
1240 | * ecx = 2 - number of the driver function |
||
114 | mikedld | 1241 | Returned value: |
118 | diamond | 1242 | * eax = -1 - driver is not loaded or not initialized; |
1243 | ebx,ecx are destroyed |
||
114 | mikedld | 1244 | * eax = [width]*65536 + [height] |
118 | diamond | 1245 | * ebx = frequency of the vertical scanning (in Hz) |
114 | mikedld | 1246 | * ecx = number of current videomode |
1247 | Remarks: |
||
118 | diamond | 1248 | * Driver must be initialized by call to |
1249 | driver function 1. |
||
1250 | * If only screen sizes are required, it is more expedient to use |
||
1251 | function 14 taking into account that it |
||
1252 | returns sizes on 1 less. |
||
114 | mikedld | 1253 | |
1254 | ====================================================================== |
||
118 | diamond | 1255 | === Function 21, subfunction 13, subsubfunction 3 - set videomode. === |
114 | mikedld | 1256 | ====================================================================== |
1257 | Parameters: |
||
118 | diamond | 1258 | * eax = 21 - function number |
1259 | * ebx = 13 - subfunction number |
||
1260 | * ecx = 3 - number of the driver function |
||
1261 | * edx = [scanning frequency]*65536 + [videomode number] |
||
114 | mikedld | 1262 | Returned value: |
118 | diamond | 1263 | * eax = -1 - driver is not loaded, not initialized or |
1264 | an error has occured |
||
1265 | * eax = 0 - success |
||
1266 | * ebx, ecx destroyed |
||
114 | mikedld | 1267 | Remarks: |
118 | diamond | 1268 | * Driver must be initialized by driver function 1. |
1269 | * The videomode number and frequency must be in the table |
||
1270 | returned by driver function 1. |
||
114 | mikedld | 1271 | |
1272 | ====================================================================== |
||
118 | diamond | 1273 | ============ Function 21, subfunction 13, subsubfunction 4 =========== |
1274 | ================== Return to the initial videomode. ================== |
||
114 | mikedld | 1275 | ====================================================================== |
118 | diamond | 1276 | Returns the screen to the videomode set at system boot. |
114 | mikedld | 1277 | Parameters: |
118 | diamond | 1278 | * eax = 21 - function number |
1279 | * ebx = 13 - subfunction number |
||
1280 | * ecx = 4 - number of the driver function |
||
114 | mikedld | 1281 | Returned value: |
118 | diamond | 1282 | * eax = -1 - driver is not loaded or not initialized |
1283 | * eax = 0 - success |
||
1284 | * ebx, ecx destroyed |
||
114 | mikedld | 1285 | Remarks: |
118 | diamond | 1286 | * Driver must be initialized by call to driver function 1. |
114 | mikedld | 1287 | |
118 | diamond | 1288 | ====================================================================== |
1289 | ============ Function 21, subfunction 13, subsubfunction 5 =========== |
||
1290 | ===== Increase/decrease the size of the visible area of monitor. ===== |
||
1291 | ====================================================================== |
||
114 | mikedld | 1292 | Parameters: |
118 | diamond | 1293 | * eax = 21 - function number |
1294 | * ebx = 13 - subfunction number |
||
1295 | * ecx = 5 - number of the driver function |
||
1296 | * edx = 0/1 - decrease/increase horizontal size on 1 position |
||
1297 | * edx = 2/3 - is not supported in the current implementation; |
||
1298 | is planned as decrease/increase vertical size on 1 position |
||
114 | mikedld | 1299 | Returned value: |
118 | diamond | 1300 | * eax = -1 - driver is not loaded or not initialized |
1301 | * eax = 0 - success |
||
1302 | * ebx, ecx destroyed |
||
114 | mikedld | 1303 | Remarks: |
118 | diamond | 1304 | * Driver must be initialized by call to driver function 1. |
1305 | * Function influences only the physical size of the screen image; |
||
1306 | the logical size (number of pixels) does not change. |
||
114 | mikedld | 1307 | |
1308 | ====================================================================== |
||
118 | diamond | 1309 | ================= Function 22 - set system date/time. ================ |
114 | mikedld | 1310 | ====================================================================== |
1311 | Parameters: |
||
118 | diamond | 1312 | * eax = 22 - function number |
1313 | * ebx = 0 - set time |
||
1314 | * ecx = 0x00SSMMHH - time in the binary-decimal code (BCD): |
||
114 | mikedld | 1315 | * HH=hour 00..23 |
1316 | * MM=minute 00..59 |
||
1317 | * SS=second 00..59 |
||
118 | diamond | 1318 | * ebx = 1 - set date |
1319 | * ecx = 0x00DDMMYY - date in the binary-decimal code (BCD): |
||
114 | mikedld | 1320 | * DD=day 01..31 |
1321 | * MM=month 01..12 |
||
1322 | * YY=year 00..99 |
||
118 | diamond | 1323 | * ebx = 2 - set day of week |
114 | mikedld | 1324 | * ecx = 1 for Sunday, ..., 7 for Saturday |
118 | diamond | 1325 | * ebx = 3 - set alarm clock |
114 | mikedld | 1326 | * ecx = 0x00SSMMHH |
1327 | Returned value: |
||
118 | diamond | 1328 | * eax = 0 - success |
1329 | * eax = 1 - incorrect parameter |
||
114 | mikedld | 1330 | * eax = 2 - CMOS-battery was unloaded |
1331 | Remarks: |
||
118 | diamond | 1332 | * Value of installation of day of week seems to be doubtful, |
1333 | as it a little where is used |
||
1334 | (day of week can be calculated by date). |
||
1335 | * Alarm clock can be set on operation in the given time every day. |
||
1336 | But there is no existing system function to disable it. |
||
1337 | * Operation of alarm clock consists in generation IRQ8. |
||
1338 | * Generally CMOS supports for alarm clock set of value 0xFF |
||
1339 | as one of parameters and it means that the appropriate parameter |
||
1340 | is ignored. But current implementation does not allow this |
||
1341 | (will return 1). |
||
1342 | * Alarm clock is a global system resource; the set of |
||
1343 | an alarm clock cancels automatically the previous set. |
||
1344 | However, at moment no program uses it. |
||
114 | mikedld | 1345 | |
1346 | ====================================================================== |
||
118 | diamond | 1347 | ============= Function 23 - wait for event with timeout. ============= |
114 | mikedld | 1348 | ====================================================================== |
118 | diamond | 1349 | If the message queue is empty, waits for new message in the queue, |
1350 | but no more than given time. Then reads out a message from the queue. |
||
114 | mikedld | 1351 | |
1352 | Parameters: |
||
118 | diamond | 1353 | * eax = 23 - function number |
114 | mikedld | 1354 | * ebx = timeout (in 1/100 of second) |
1355 | Returned value: |
||
118 | diamond | 1356 | * eax = 0 - the message queue is empty |
1357 | * otherwise eax = event (see the list of events) |
||
114 | mikedld | 1358 | Remarks: |
118 | diamond | 1359 | * Only those events are taken into account, which enter into |
1360 | the mask set by function 40. By default it is |
||
1361 | redraw, key and button events. |
||
1362 | * To check for presence of a message in the queue use function 11. |
||
1363 | To wait without timeout use function 10. |
||
1364 | * Transmission ebx=0 results in immediate returning eax=0. |
||
1365 | * Current implementation returns immediately with eax=0, |
||
1366 | if the addition of ebx with the current value of time counter |
||
1367 | makes 32-bit overflow. |
||
114 | mikedld | 1368 | |
1369 | ====================================================================== |
||
118 | diamond | 1370 | ======== Function 24, subfunction 1 - begin to play CD-audio. ======== |
114 | mikedld | 1371 | ====================================================================== |
1372 | Parameters: |
||
118 | diamond | 1373 | * eax = 24 - function number |
1374 | * ebx = 1 - subfunction number |
||
114 | mikedld | 1375 | * ecx = 0x00FRSSMM, where |
118 | diamond | 1376 | * MM = starting minute |
1377 | * SS = starting second |
||
1378 | * FR = starting frame |
||
114 | mikedld | 1379 | Returned value: |
118 | diamond | 1380 | * eax = 0 - success |
1381 | * eax = 1 - CD base is not defined |
||
114 | mikedld | 1382 | Remarks: |
118 | diamond | 1383 | * Previously CD base must be defined by the call to |
1384 | subfunction 3 of function 21. |
||
1385 | * One second includes 75 frames, one minute includes 60 seconds. |
||
1386 | * The function is asynchronous (returns control, when play begins). |
||
114 | mikedld | 1387 | |
1388 | ====================================================================== |
||
118 | diamond | 1389 | ======= Function 24, subfunction 2 - get information on tracks. ====== |
114 | mikedld | 1390 | ====================================================================== |
1391 | Parameters: |
||
118 | diamond | 1392 | * eax = 24 - function number |
1393 | * ebx = 2 - subfunction number |
||
1394 | * ecx = pointer to the buffer for the table |
||
1395 | (maximum 8*64h+4 bytes=100 tracks) |
||
114 | mikedld | 1396 | Returned value: |
118 | diamond | 1397 | * eax = 0 - success |
1398 | * eax = 1 - CD base is not defined |
||
114 | mikedld | 1399 | Remarks: |
118 | diamond | 1400 | * The format of the table with tracks information is the same as |
1401 | for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h). |
||
1402 | Function returns addresses in MSF. |
||
1403 | * Previously CD base port must be set by call to |
||
1404 | subfunction 3 of function 21. |
||
1405 | * Function returns information only about no more than 100 |
||
1406 | first tracks. In most cases it is enough. |
||
114 | mikedld | 1407 | |
1408 | ====================================================================== |
||
118 | diamond | 1409 | ========== Function 24, subfunction 3 - stop play CD-audio. ========== |
114 | mikedld | 1410 | ====================================================================== |
1411 | Parameters: |
||
118 | diamond | 1412 | * eax = 24 - function number |
1413 | * ebx = 1 - subfunction number |
||
114 | mikedld | 1414 | Returned value: |
118 | diamond | 1415 | * eax = 0 - success |
1416 | * eax = 1 - CD base is not defined |
||
486 | kastigar | 1417 | іамечания: |
118 | diamond | 1418 | * Previously CD base port must be defined by call to |
1419 | subfunction 3 of function 21. |
||
114 | mikedld | 1420 | |
1421 | ====================================================================== |
||
118 | diamond | 1422 | =================== Function 25 - set SBPro volume. ================== |
114 | mikedld | 1423 | ====================================================================== |
1424 | Parameters: |
||
118 | diamond | 1425 | * eax = 25 - function number |
1426 | * ebx = what to set: |
||
1427 | * 1 - set common volume |
||
1428 | * 2 - set CD-audio volume |
||
1429 | * cl = volume level: high 4 bits for the left column, |
||
1430 | low 4 bits for the right one |
||
114 | mikedld | 1431 | Returned value: |
118 | diamond | 1432 | * eax = 0 - success |
1433 | * eax = 1 - SB base is not defined |
||
114 | mikedld | 1434 | * eax = 2 - incorrect subfunction |
1435 | Remarks: |
||
118 | diamond | 1436 | * Previously SB base port must be defined by |
1437 | subfunction 4 of function 21. |
||
1438 | * See also function 28 which sets |
||
1439 | volume for the later standard SB16. |
||
114 | mikedld | 1440 | |
1441 | ====================================================================== |
||
118 | diamond | 1442 | ======== Function 26, subfunction 1 - get MPU MIDI base port. ======== |
114 | mikedld | 1443 | ====================================================================== |
1444 | Parameters: |
||
118 | diamond | 1445 | * eax = 26 - function number |
1446 | * ebx = 1 - subfunction number |
||
114 | mikedld | 1447 | Returned value: |
118 | diamond | 1448 | * eax = port number |
1449 | Parameters: |
||
1450 | * To set base port use subfunction 1 of function 21. |
||
114 | mikedld | 1451 | |
1452 | ====================================================================== |
||
1453 | ========== Function 26, subfunction 2 - get keyboard layout. ========= |
||
1454 | ====================================================================== |
||
118 | diamond | 1455 | The keyboard layout is used to convert keyboard scancodes to |
1456 | ASCII-codes for function 2. |
||
114 | mikedld | 1457 | Parameters: |
118 | diamond | 1458 | * eax = 26 - function number |
1459 | * ebx = 2 - subfunction number |
||
114 | mikedld | 1460 | * ecx = what layout to get: |
1461 | * 1 = normal layout |
||
118 | diamond | 1462 | * 2 = layout with pressed Shift |
1463 | * 3 = layout with pressed Alt |
||
1464 | * edx = pointer to the 128-bytes buffer, where the layout will be |
||
1465 | copied |
||
114 | mikedld | 1466 | Returned value: |
1467 | * function does not return value |
||
118 | diamond | 1468 | Or: |
1469 | * eax = 26 - function number |
||
1470 | * ebx = 2 - subfunction number |
||
114 | mikedld | 1471 | * ecx = 9 |
1472 | Returned value: |
||
118 | diamond | 1473 | * eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus) |
114 | mikedld | 1474 | Remarks: |
118 | diamond | 1475 | * If Alt is pressed, the layout with Alt is used; |
1476 | if Alt is not pressed, but Shift is pressed, |
||
1477 | the layout with Shift is used; |
||
1478 | if Alt and Shift are not pressed, but Ctrl is pressed, the normal |
||
1479 | layout is used and then from the code is subtracted 0x60; |
||
1480 | if no control key is pressed, the normal layout is used. |
||
1481 | * To set layout and country identifier use |
||
1482 | subfunction 2 of function 21. |
||
1483 | * Country identifier is global system variable, which is not used |
||
1484 | by the kernel itself; however the application '@panel' displays |
||
1485 | the corresponding icon (using this function). |
||
1486 | * The application @panel switches layouts on user request. |
||
114 | mikedld | 1487 | |
1488 | ====================================================================== |
||
118 | diamond | 1489 | ============== Function 26, subfunction 3 - get CD base. ============= |
114 | mikedld | 1490 | ====================================================================== |
1491 | Parameters: |
||
118 | diamond | 1492 | * eax = 26 - function number |
1493 | * ebx = 3 - subfunction number |
||
114 | mikedld | 1494 | Returned value: |
118 | diamond | 1495 | * eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3 |
114 | mikedld | 1496 | Remarks: |
118 | diamond | 1497 | * CD base is used by function 24. |
1498 | * To set CD base use subfunction 3 of function 21. |
||
114 | mikedld | 1499 | |
1500 | ====================================================================== |
||
118 | diamond | 1501 | ====== Function 26, subfunction 4 - get Sound Blaster base port. ===== |
114 | mikedld | 1502 | ====================================================================== |
1503 | Parameters: |
||
118 | diamond | 1504 | * eax = 26 - function number |
1505 | * ebx = 4 - subfunction number |
||
114 | mikedld | 1506 | Returned value: |
118 | diamond | 1507 | * eax = base port number |
114 | mikedld | 1508 | Remarks: |
118 | diamond | 1509 | * Bae port is used by functions 25, 55. |
1510 | * To set base port use subfunction 4 of function 21. |
||
114 | mikedld | 1511 | |
1512 | ====================================================================== |
||
118 | diamond | 1513 | ========== Function 26, subfunction 5 - get system language. ========= |
114 | mikedld | 1514 | ====================================================================== |
1515 | Parameters: |
||
118 | diamond | 1516 | * eax = 26 - function number |
1517 | * ebx = 5 - subfunction number |
||
114 | mikedld | 1518 | Returned value: |
118 | diamond | 1519 | * eax = system language (1=eng, 2=fi, 3=ger, 4=rus) |
114 | mikedld | 1520 | Remarks: |
118 | diamond | 1521 | * System language is global system variable and is not used |
1522 | by the kernel itself, however application @panel draws the |
||
1523 | appropriate icon (using this function). |
||
1524 | * To set system language use subfunction 5 of function 21. |
||
114 | mikedld | 1525 | |
1526 | ====================================================================== |
||
118 | diamond | 1527 | ============== Function 26, subfunction 7 - get HD base. ============= |
114 | mikedld | 1528 | ====================================================================== |
118 | diamond | 1529 | The HD base defines hard disk to write with usage of obsolete |
346 | diamond | 1530 | syntax /HD in obsolete function 58; at usage of modern syntax |
1531 | /HD0,/HD1,/HD2,/HD3 base is set automatically. |
||
114 | mikedld | 1532 | Parameters: |
118 | diamond | 1533 | * eax = 26 - function number |
1534 | * ebx = 7 - subfunction number |
||
114 | mikedld | 1535 | Returned value: |
118 | diamond | 1536 | * eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3 |
114 | mikedld | 1537 | Remarks: |
118 | diamond | 1538 | * Any application in any time can change HD base. |
1539 | * To set base use subfunction 7 of function 21. |
||
1540 | * To get used partition of hard disk use subfunction 8. |
||
114 | mikedld | 1541 | |
1542 | ====================================================================== |
||
118 | diamond | 1543 | ========= Function 26, subfunction 8 - get used HD partition. ======== |
114 | mikedld | 1544 | ====================================================================== |
118 | diamond | 1545 | The HD partition defines partition of the hard disk to write with |
346 | diamond | 1546 | usage of obsolete syntax /HD in obsolete function 58; |
118 | diamond | 1547 | at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3 |
346 | diamond | 1548 | base and partition are set automatically. |
114 | mikedld | 1549 | Parameters: |
118 | diamond | 1550 | * eax = 26 - function number |
1551 | * ebx = 8 - subfunction number |
||
114 | mikedld | 1552 | Returned value: |
118 | diamond | 1553 | * eax = HD partition (beginning from 1) |
114 | mikedld | 1554 | Remarks: |
118 | diamond | 1555 | * Any application in any time can change partition. |
1556 | * To set partition use subfunction 8 of function 21. |
||
1557 | * To get number of partitions on a hard disk use |
||
1558 | subfunction 11 of function 18. |
||
1559 | * To get base of used hard disk, use subfunction 7. |
||
114 | mikedld | 1560 | |
1561 | ====================================================================== |
||
118 | diamond | 1562 | === Function 26, subfunction 9 - get the value of the time counter. == |
114 | mikedld | 1563 | ====================================================================== |
1564 | Parameters: |
||
118 | diamond | 1565 | * eax = 26 - function number |
1566 | * ebx = 9 - subfunction number |
||
114 | mikedld | 1567 | Returned value: |
118 | diamond | 1568 | * eax = number of 1/100s of second, past from the system boot time |
114 | mikedld | 1569 | Remarks: |
118 | diamond | 1570 | * Counter takes modulo 2^32, that correspond to a little more |
1571 | than 497 days. |
||
1572 | * To get system time use function 3. |
||
114 | mikedld | 1573 | |
1574 | ====================================================================== |
||
118 | diamond | 1575 | ======== Function 26, subfunction 10 - get sound DMA channel. ======== |
114 | mikedld | 1576 | ====================================================================== |
1577 | Parameters: |
||
118 | diamond | 1578 | * eax = 26 - function number |
1579 | * ebx = 10 - subfunction number |
||
114 | mikedld | 1580 | Returned value: |
118 | diamond | 1581 | * eax = number of the channel (from 0 to 3 inclusive) |
114 | mikedld | 1582 | Remarks: |
118 | diamond | 1583 | * Number of the DMA channel is used by subfunction 1 of function 55. |
1584 | * To set the sound DMA channel use subfunction 10 of function 21. |
||
114 | mikedld | 1585 | |
1586 | ====================================================================== |
||
118 | diamond | 1587 | ===================== Function 26, subfunction 11 ==================== |
1588 | ========== Find out whether low-level HD access is enabled. ========== |
||
114 | mikedld | 1589 | ====================================================================== |
1590 | Parameters: |
||
118 | diamond | 1591 | * eax = 26 - function number |
1592 | * ebx = 11 - subfunction number |
||
114 | mikedld | 1593 | Returned value: |
118 | diamond | 1594 | * eax = 0/1 - disabled/enabled |
114 | mikedld | 1595 | Remarks: |
118 | diamond | 1596 | * Is used in LBA read (subfunction 8 of function 58). |
1597 | * To set current state use subfunction 11 of function 21. |
||
114 | mikedld | 1598 | |
1599 | ====================================================================== |
||
118 | diamond | 1600 | ===================== Function 26, subfunction 12 ==================== |
1601 | ========== Find out whether low-level PCI access is enabled. ========= |
||
114 | mikedld | 1602 | ====================================================================== |
1603 | Parameters: |
||
118 | diamond | 1604 | * eax = 26 - function number |
1605 | * ebx = 12 - subfunction number |
||
114 | mikedld | 1606 | Returned value: |
118 | diamond | 1607 | * eax = 0/1 - disabled/enabled |
114 | mikedld | 1608 | Remarks: |
118 | diamond | 1609 | * Is used by operations with PCI bus (function 62). |
1610 | * The current implementation uses only low bit of ecx. |
||
1611 | * To set the current state use subfunction 12 of function 21. |
||
114 | mikedld | 1612 | |
1613 | ====================================================================== |
||
118 | diamond | 1614 | =================== Function 28 - set SB16 volume. =================== |
114 | mikedld | 1615 | ====================================================================== |
1616 | Parameters: |
||
118 | diamond | 1617 | * eax = 28 - function number |
114 | mikedld | 1618 | * ebx = what to install: |
1619 | * 1 - install common volume |
||
118 | diamond | 1620 | * 2 - install CD-audio volume |
1621 | * cl = volume level (0=off, 0xFF=max) |
||
114 | mikedld | 1622 | Returned value: |
118 | diamond | 1623 | * eax = 0 - success |
1624 | * eax = 1 - SB base is not defined |
||
114 | mikedld | 1625 | * eax = 2 - incorrect subfunction |
1626 | Remarks: |
||
118 | diamond | 1627 | * Previously SB base port must be defined by |
1628 | subfunction 4 of function 21. |
||
1629 | * This function gives more variants for volume, that function 25. |
||
114 | mikedld | 1630 | |
1631 | ====================================================================== |
||
118 | diamond | 1632 | =================== Function 29 - get system date. =================== |
114 | mikedld | 1633 | ====================================================================== |
1634 | Parameters: |
||
118 | diamond | 1635 | * eax = 29 - function number |
114 | mikedld | 1636 | Returned value: |
1637 | * eax = 0x00DDMMYY, where |
||
118 | diamond | 1638 | (binary-decimal coding, BCD, is used) |
1639 | * YY = two low digits of year (00..99) |
||
1640 | * MM = month (01..12) |
||
1641 | * DD = day (01..31) |
||
114 | mikedld | 1642 | Remarks: |
118 | diamond | 1643 | * To set system date use function 22. |
114 | mikedld | 1644 | |
1645 | ====================================================================== |
||
118 | diamond | 1646 | =============== Function 32 - delete file from ramdisk. ============== |
114 | mikedld | 1647 | ====================================================================== |
1648 | Parameters: |
||
118 | diamond | 1649 | * eax = 32 - function number |
1650 | * ebx = pointer to the filename |
||
114 | mikedld | 1651 | Returned value: |
118 | diamond | 1652 | * eax = 0 - success; otherwise file system error code |
114 | mikedld | 1653 | Remarks: |
118 | diamond | 1654 | * This function is obsolete; function 58 allows to fulfill |
1655 | the same operations with the extended possibilities. |
||
1656 | * The current implementation returns only values 0(success) and |
||
1657 | 5(file not found). |
||
1658 | * The filename must be either in the format 8+3 characters |
||
1659 | (first 8 characters - name itself, last 3 - extension, |
||
1660 | the short names and extensions are supplemented with spaces), |
||
1661 | or in the format 8.3 characters "FILE.EXT"/"FILE.EX " |
||
1662 | (name no more than 8 characters, dot, extension 3 characters |
||
1663 | supplemented if necessary by spaces). |
||
1664 | The filename must be written with capital letters. The terminating |
||
1665 | character with code 0 is not necessary (not ASCIIZ-string). |
||
1666 | * This function does not support folders on the ramdisk. |
||
114 | mikedld | 1667 | |
1668 | ====================================================================== |
||
118 | diamond | 1669 | ================ Function 33 - write file to ramdisk. ================ |
114 | mikedld | 1670 | ====================================================================== |
1671 | Parameters: |
||
118 | diamond | 1672 | * eax = 33 - function number |
1673 | * ebx = pointer to the filename |
||
1674 | * ecx = pointer to data for writing |
||
1675 | * edx = number of bytes for writing |
||
1676 | * should be set esi=0 |
||
114 | mikedld | 1677 | Returned value: |
118 | diamond | 1678 | * eax = 0 - success, otherwise file system error code |
114 | mikedld | 1679 | Remarks: |
118 | diamond | 1680 | * This function is obsolete; function 70 allows to fulfil |
1681 | the same operations with extended possibilities. |
||
1682 | * If esi contains non-zero value and selected file already exists, |
||
1683 | one more file with the same name will be created. |
||
1684 | * Otherwise file will be overwritten. |
||
1685 | * The filename must be either in the format 8+3 characters |
||
1686 | (first 8 characters - name itself, last 3 - extension, |
||
1687 | the short names and extensions are supplemented with spaces), |
||
1688 | or in the format 8.3 characters "FILE.EXT"/"FILE.EX " |
||
1689 | (name no more than 8 characters, dot, extension 3 characters |
||
1690 | supplemented if necessary by spaces). |
||
1691 | The filename must be written with capital letters. The terminating |
||
1692 | character with code 0 is not necessary (not ASCIIZ-string). |
||
1693 | * This function does not support folders on the ramdisk. |
||
114 | mikedld | 1694 | |
1695 | ====================================================================== |
||
118 | diamond | 1696 | ======= Function 35 - read the color of a pixel on the screen. ======= |
114 | mikedld | 1697 | ====================================================================== |
1698 | Parameters: |
||
1699 | * eax = 35 |
||
1700 | * ebx = y*xsize+x, where |
||
118 | diamond | 1701 | * (x,y) = coordinates of a pixel (beginning from 0) |
1702 | * xsize = horizontal screen size |
||
114 | mikedld | 1703 | Returned value: |
118 | diamond | 1704 | * eax = color 0x00RRGGBB |
114 | mikedld | 1705 | Remarks: |
118 | diamond | 1706 | * To get screen sizes use function 14. Pay attention, |
1707 | that it subtracts 1 from both sizes. |
||
1708 | * There is also direct access (without any system calls) |
||
1709 | to videomemory through the selector gs. To get parameters of |
||
1710 | the current videomode, use function 61. |
||
114 | mikedld | 1711 | |
1712 | ====================================================================== |
||
277 | diamond | 1713 | =================== Function 37 - work with mouse. =================== |
114 | mikedld | 1714 | ====================================================================== |
1715 | |||
118 | diamond | 1716 | ---------- Subfunction 0 - screen coordinates of the mouse ----------- |
114 | mikedld | 1717 | Parameters: |
118 | diamond | 1718 | * eax = 37 - function number |
1719 | * ebx = 0 - subfunction number |
||
114 | mikedld | 1720 | Returned value: |
118 | diamond | 1721 | * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer |
1722 | (beginning from 0) |
||
114 | mikedld | 1723 | |
118 | diamond | 1724 | -- Subfunction 1 - coordinates of the mouse relative to the window --- |
114 | mikedld | 1725 | Parameters: |
118 | diamond | 1726 | * eax = 37 - function number |
1727 | * ebx = 1 - subfunction number |
||
114 | mikedld | 1728 | Returned value: |
118 | diamond | 1729 | * eax = x*65536 + y, (x,y)=coordinates of the mouse pointer |
1730 | relative to the application window (beginning from 0) |
||
114 | mikedld | 1731 | Remarks: |
118 | diamond | 1732 | * The value is calculated by formula (x-xwnd)*65536 + (y-ywnd). |
1733 | If y>=ywnd, the low word is non-negative and contains |
||
1734 | relative y-coordinate, and the high word - relative x-coordinate |
||
1735 | (with correct sign). Otherwise the low word is negative and still |
||
1736 | contains relative y-coordinate, and to the high word |
||
1737 | 1 should be added. |
||
114 | mikedld | 1738 | |
118 | diamond | 1739 | ------------ Subfunction 2 - pressed buttons of the mouse ------------ |
114 | mikedld | 1740 | Parameters: |
118 | diamond | 1741 | * eax = 37 - function number |
1742 | * ebx = 2 - subfunction number |
||
114 | mikedld | 1743 | Returned value: |
118 | diamond | 1744 | * eax contains information on the pressed mouse buttons: |
1745 | * bit 0 is set = left button is pressed |
||
1746 | * bit 1 is set = right button is pressed |
||
486 | kastigar | 1747 | * bit 2 is set = middle button is pressed |
1748 | * bit 3 is set = 4th button is pressed |
||
1749 | * bit 4 is set = 5th button is pressed |
||
118 | diamond | 1750 | * other bits are cleared |
114 | mikedld | 1751 | |
277 | diamond | 1752 | -------------------- Subfunction 4 - load cursor --------------------- |
1753 | Parameters: |
||
1754 | * eax = 37 - function number |
||
1755 | * ebx = 4 - subfunction number |
||
1756 | * dx = data source: |
||
1757 | * dx = LOAD_FROM_FILE = 0 - data in a file |
||
1758 | * ecx = pointer to full path to the cursor file |
||
1759 | * the file must be in the format .cur, which is standard for |
||
1760 | MS Windows, at that of the size 32*32 pixels |
||
1761 | * dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory |
||
1762 | * ecx = pointer to data of the cursor file |
||
1763 | * the data format is the same as in the previous case |
||
1764 | * dx = LOAD_INDIRECT = 2 - data in memory |
||
1765 | * ecx = pointer to cursor image in the format ARGB 32*32 pixels |
||
1766 | * edx = 0xXXYY0002, where |
||
1767 | * XX = x-coordinate of cursor hotspot |
||
1768 | * YY = y-coordinate |
||
1769 | * 0 <= XX, YY <= 31 |
||
1770 | Returned value: |
||
1771 | * eax = 0 - failed |
||
1772 | * otherwise eax = cursor handle |
||
1773 | |||
1774 | --------------------- Subfunction 5 - set cursor --------------------- |
||
1775 | Sets new cursor for the window of the current thread. |
||
1776 | Parameters: |
||
1777 | * eax = 37 - function number |
||
1778 | * ebx = 5 - subfunction number |
||
1779 | * ecx = cursor handle |
||
1780 | Returned value: |
||
1781 | * eax = handle of previous cursor |
||
1782 | Remarks: |
||
1783 | * If the handle is incorrect, the function restores the default |
||
1784 | cursor (standard arrow). In particular, ecx=0 restores it. |
||
1785 | |||
1786 | ------------------- Subfunction 6 - delete cursor -------------------- |
||
1787 | Parameters: |
||
1788 | * eax = 37 - function number |
||
1789 | * ebx = 6 - subfunction number |
||
1790 | * ecx = cursor handle |
||
1791 | Returned value: |
||
1792 | * eax destroyed |
||
1793 | Remarks: |
||
1794 | * The cursor must be loaded previously by the current thread |
||
1795 | (with the call to subfunction 4). The function does not delete |
||
1796 | system cursors and cursors, loaded by another applications. |
||
1797 | * If the active cursor (set by subfunction 5) is deleted, |
||
1798 | the system restores the default cursor (standard arrow). |
||
1799 | |||
486 | kastigar | 1800 | ------------------- Subfunction 7 - get scroll data -------------------- |
1801 | Parameters: |
||
1802 | * eax = 37 - function number |
||
1803 | * ebx = 7 - subfunction number |
||
1804 | Returned value: |
||
1805 | * eax = horizontal_offset*65536 + vertical_offset |
||
1806 | Remarks: |
||
1807 | * Scroll data is available for active window only |
||
1808 | * Values are zeroized after reading |
||
1809 | * Values ara signed |
||
1810 | |||
114 | mikedld | 1811 | ====================================================================== |
1812 | ====================== Function 38 - draw line. ====================== |
||
1813 | ====================================================================== |
||
1814 | Parameters: |
||
118 | diamond | 1815 | * eax = 38 - function number |
1816 | * ebx = [start coordinate on axis x]*65536 + |
||
1817 | [end coordinate on axis x] |
||
1818 | * ecx = [start coordinate on axis y]*65536 + |
||
1819 | [end coordinate on axis y] |
||
1820 | * edx = 0x00RRGGBB - color |
||
133 | diamond | 1821 | edx = 0x01xxxxxx - draw inversed line |
1822 | (low 24 bits are ignored) |
||
114 | mikedld | 1823 | Returned value: |
1824 | * function does not return value |
||
1825 | Remarks: |
||
118 | diamond | 1826 | * Coordinates are relative to the window. |
1827 | * End point is also drawn. |
||
114 | mikedld | 1828 | |
1829 | ====================================================================== |
||
118 | diamond | 1830 | == Function 39, subfunction 1 - get a size of the background image. == |
114 | mikedld | 1831 | ====================================================================== |
1832 | Parameters: |
||
118 | diamond | 1833 | * eax = 39 - function number |
1834 | * ebx = 1 - subfunction number |
||
114 | mikedld | 1835 | Returned value: |
1836 | * eax = [width]*65536 + [height] |
||
1837 | Remarks: |
||
118 | diamond | 1838 | * There is a pair function to set sizes of background image - |
1839 | subfunction 1 of function 15. After which it is necessary, |
||
1840 | of course, anew to define image. |
||
114 | mikedld | 1841 | |
1842 | ====================================================================== |
||
118 | diamond | 1843 | == Function 39, subfunction 2 - get pixel from the background image. = |
114 | mikedld | 1844 | ====================================================================== |
1845 | Parameters: |
||
118 | diamond | 1846 | * eax = 39 - function number |
1847 | * ebx = 2 - subfunction number |
||
114 | mikedld | 1848 | * ecx = offset |
1849 | Returned value: |
||
118 | diamond | 1850 | * eax = 0x00RRGGBB - pixel color, if offset is valid |
1851 | (less than 0x160000-16) |
||
1852 | * eax = 2 otherwise |
||
114 | mikedld | 1853 | Remarks: |
118 | diamond | 1854 | * Do not rely on returned value for invalid offsets, it may be |
1855 | changed in future kernel versions. |
||
1856 | * Offset for pixel with coordinates (x,y) |
||
1857 | is calculated as (x+y*xsize)*3. |
||
1858 | * There is a pair function to set pixel on the background image - |
||
1859 | subfunction 2 of function 15. |
||
114 | mikedld | 1860 | |
1861 | ====================================================================== |
||
118 | diamond | 1862 | == Function 39, subfunction 4 - get drawing mode for the background. = |
114 | mikedld | 1863 | ====================================================================== |
1864 | Parameters: |
||
118 | diamond | 1865 | * eax = 39 - function number |
1866 | * ebx = 4 - subfunction number |
||
114 | mikedld | 1867 | Returned value: |
118 | diamond | 1868 | * eax = 1 - tile |
1869 | * eax = 2 - stretch |
||
114 | mikedld | 1870 | Remarks: |
118 | diamond | 1871 | * There is a pair function to set drawing mode - |
1872 | subfunction 4 of function 15. |
||
114 | mikedld | 1873 | |
1874 | ====================================================================== |
||
118 | diamond | 1875 | =========== Function 40 - set the mask for expected events. ========== |
114 | mikedld | 1876 | ====================================================================== |
118 | diamond | 1877 | The mask for expected events affects function working with events |
1878 | 10, 11, 23 - they notify only about events allowed by this mask. |
||
114 | mikedld | 1879 | Parameters: |
118 | diamond | 1880 | * eax = 40 - function number |
114 | mikedld | 1881 | * ebx = mask: bit i corresponds to event i+1 (see list of events) |
118 | diamond | 1882 | (set bit permits notice on event) |
114 | mikedld | 1883 | Returned value: |
1884 | * function does not return value |
||
1885 | Remarks: |
||
118 | diamond | 1886 | * Default mask (7=111b) enables nofices about redraw, |
1887 | keys and buttons. This is enough for many applications. |
||
1888 | * Events prohibited in the mask are saved anyway, when come; |
||
1889 | they are simply not informed with event functions. |
||
1890 | * Event functions take into account the mask on moment of |
||
1891 | function call, not on moment of event arrival. |
||
114 | mikedld | 1892 | |
1893 | ====================================================================== |
||
118 | diamond | 1894 | ==================== Function 41 - get IRQ owner. ==================== |
114 | mikedld | 1895 | ====================================================================== |
1896 | Parameters: |
||
118 | diamond | 1897 | * eax = 41 - function number |
1898 | * ebx = IRQ number, 0..15 |
||
114 | mikedld | 1899 | Returned value: |
118 | diamond | 1900 | * eax = owner PID |
1901 | * eax = 0, if there is no owner |
||
114 | mikedld | 1902 | * eax = -1 for incorrect ebx |
1903 | |||
1904 | ====================================================================== |
||
118 | diamond | 1905 | ==================== Function 42 - read IRQ data. ==================== |
114 | mikedld | 1906 | ====================================================================== |
118 | diamond | 1907 | When an IRQ occurs, the system reads data from ports indicated |
1908 | earlier by function 44 and writes this data to |
||
1909 | internal buffer. This function reads out data from that buffer |
||
1910 | bytewise. |
||
114 | mikedld | 1911 | Parameters: |
118 | diamond | 1912 | * eax = 42 - function number |
1913 | * ebx = IRQ number, 0..15 |
||
1914 | Returned value: (use value of ecx to distinguish) |
||
1915 | * if the thread is not IRQ owner (or IRQ number is incorrect): |
||
114 | mikedld | 1916 | * ecx = 2 |
118 | diamond | 1917 | * if there is no data: |
114 | mikedld | 1918 | * eax = 0 |
1919 | * ecx = 1 |
||
118 | diamond | 1920 | * ebx destroyed |
1921 | * if all is ok: |
||
1922 | * eax = byte size of data, not yet read from buffer |
||
114 | mikedld | 1923 | * ecx = 0 |
1924 | * ebx = current byte |
||
1925 | Remarks: |
||
118 | diamond | 1926 | * Previously the thread must reserve indicated IRQ for itself |
1927 | by function 45. |
||
1928 | * The size of data buffer is 4000 bytes, on overflow |
||
1929 | "fresh" data cease to be written in the buffer. |
||
114 | mikedld | 1930 | |
1931 | ====================================================================== |
||
118 | diamond | 1932 | ================ Function 43 - input/output to a port. =============== |
114 | mikedld | 1933 | ====================================================================== |
1934 | |||
118 | diamond | 1935 | ------------------------ Output data to port ------------------------- |
114 | mikedld | 1936 | Parameters: |
118 | diamond | 1937 | * eax = 43 - function number |
114 | mikedld | 1938 | * bl = byte for output |
118 | diamond | 1939 | * ecx = port number 0xnnnn (from 0 to 0xFFFF) |
114 | mikedld | 1940 | Returned value: |
118 | diamond | 1941 | * eax = 0 - success |
1942 | * eax = 1 - the thread has not reserved the selected port |
||
114 | mikedld | 1943 | |
118 | diamond | 1944 | ------------------------ Input data from port ------------------------ |
114 | mikedld | 1945 | Parameters: |
118 | diamond | 1946 | * eax = 43 - function number |
1947 | * ebx is ignored |
||
1948 | * ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF) |
||
114 | mikedld | 1949 | Returned value: |
118 | diamond | 1950 | * eax = 0 - success, thus ebx = entered byte |
1951 | * eax = 1 - the thread has not reserved the selected port |
||
114 | mikedld | 1952 | Remarks: |
118 | diamond | 1953 | * Previously the thread must reserve the selected port |
1954 | for itself by function 46. |
||
1955 | * Instead of call to this function it is better to use |
||
1956 | processor instructions in/out - this is much |
||
1957 | faster and a bit shorter and easier. |
||
114 | mikedld | 1958 | |
1959 | ====================================================================== |
||
118 | diamond | 1960 | =========== Function 44 - define operations at IRQ arrival. ========== |
114 | mikedld | 1961 | ====================================================================== |
118 | diamond | 1962 | At IRQ arrival the system can read the data from ports defined |
1963 | by this function and write these data to internal buffer, whence |
||
1964 | they can be read by функцией 42. |
||
114 | mikedld | 1965 | Parameters: |
118 | diamond | 1966 | * eax = 44 - function number |
1967 | * ebx = pointer to the array of structures each describing one port: |
||
1968 | * +0: word: 0 means end of array, otherwise port number |
||
114 | mikedld | 1969 | * +2: byte: reserved (ignored) |
118 | diamond | 1970 | * +3: byte: 1=read byte from this port, 2=read word |
1971 | * ecx = IRQ number, 0..15 |
||
114 | mikedld | 1972 | Returned value: |
118 | diamond | 1973 | * eax = 0 - success |
1974 | * eax = 1 - the thread is not owner of selected IRQ |
||
114 | mikedld | 1975 | Remarks: |
118 | diamond | 1976 | * Previously the thread must reserve for itself selected IRQ |
1977 | by function 45. |
||
114 | mikedld | 1978 | * First 16 ports are considered only. |
118 | diamond | 1979 | * The current implementation considers incorrect value of field +3 |
1980 | as a signal to terminate IRQ processing. |
||
114 | mikedld | 1981 | |
1982 | ====================================================================== |
||
118 | diamond | 1983 | =================== Function 45 - reserve/free IRQ. ================== |
114 | mikedld | 1984 | ====================================================================== |
1985 | Parameters: |
||
118 | diamond | 1986 | * eax = 45 - function number |
114 | mikedld | 1987 | * ebx = 0 - reserve, 1 = free |
118 | diamond | 1988 | * ecx = IRQ number, 0..15 |
114 | mikedld | 1989 | Returned value: |
118 | diamond | 1990 | * eax = 0 - success |
1991 | * eax = 1 - error (invalid IRQ number |
||
1992 | or attempt to reserve not free IRQ |
||
1993 | or to free IRQ, not reserved by this thread) |
||
114 | mikedld | 1994 | Remarks: |
118 | diamond | 1995 | * IRQ reservation is required for functions 42 and 44. |
1996 | * Only one thread can reserve the specific IRQ. |
||
1997 | * IRQs, handled by the system itself, are reserved by the system |
||
1998 | (thread 1) at booting. |
||
1999 | * When a thread terminates, all reserved by it IRQs |
||
2000 | are freed automatically. |
||
114 | mikedld | 2001 | |
2002 | ====================================================================== |
||
118 | diamond | 2003 | ====== Function 46 - reserve/free a group of input/output ports. ===== |
114 | mikedld | 2004 | ====================================================================== |
118 | diamond | 2005 | To work with reserved ports an application can access directly by |
2006 | commands in/out (recommended way) and can use function 43 |
||
2007 | (not recommended way). |
||
114 | mikedld | 2008 | Parameters: |
118 | diamond | 2009 | * eax = 46 - function number |
114 | mikedld | 2010 | * ebx = 0 - reserve, 1 - free |
118 | diamond | 2011 | * ecx = start port number |
2012 | * edx = end port number (inclusive) |
||
114 | mikedld | 2013 | Returned value: |
118 | diamond | 2014 | * eax = 0 - success |
114 | mikedld | 2015 | * eax = 1 - error |
2016 | Remarks: |
||
118 | diamond | 2017 | * For ports reservation: an error occurs if and only if |
2018 | one from the following condition satisfies: |
||
2019 | * start port is more than end port; |
||
2020 | * the selected range contains incorrect port number |
||
2021 | (correct are from 0 to 0xFFFF); |
||
2022 | * limit for the total number of reserved areas is exceeded |
||
2023 | (maximum 255 are allowed); |
||
2024 | * the selected range intersects with any of earlier reserved |
||
2025 | * For ports free: an error is an attempt to free range, |
||
2026 | that was not earlier reserved by this function |
||
2027 | (with same ecx,edx). |
||
2028 | * If an error occurs (for both cases) function performs no action. |
||
277 | diamond | 2029 | * At booting the system reserves for itself ports |
2030 | 0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively). |
||
118 | diamond | 2031 | * When a thread terminates, all reserved by it ports |
2032 | are freed automatically. |
||
114 | mikedld | 2033 | |
2034 | ====================================================================== |
||
118 | diamond | 2035 | ============= Function 47 - draw a number in the window. ============= |
114 | mikedld | 2036 | ====================================================================== |
2037 | Parameters: |
||
118 | diamond | 2038 | * eax = 47 - function number |
2039 | * ebx = parameters of conversion number to text: |
||
114 | mikedld | 2040 | * bl = 0 - ecx contains number |
118 | diamond | 2041 | * bl = 1 - ecx contains pointer to dword-number |
2042 | * bh = 0 - display in decimal number system |
||
2043 | * bh = 1 - display in hexadecimal system |
||
2044 | * bh = 2 - display in binary system |
||
486 | kastigar | 2045 | * битv 16-21 = how many digits to display |
2046 | * битv 22-31 reserved and must be set to 0 |
||
118 | diamond | 2047 | * ecx = number (if bl=0) or pointer (if bl=1) |
114 | mikedld | 2048 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
139 | diamond | 2049 | * esi = 0xX0RRGGBB: |
2050 | * RR, GG, BB specify the color |
||
2051 | * X = ABnn (bits) |
||
2052 | * nn = font (0/1) |
||
2053 | * A is ignored |
||
2054 | * B=1 - fill background with the color edi |
||
114 | mikedld | 2055 | Returned value: |
2056 | * function does not return value |
||
2057 | Remarks: |
||
118 | diamond | 2058 | * The given length must not exceed 60. |
2059 | * The exactly given amount of digits is output. If number is small |
||
2060 | and can be written by smaller amount of digits, it is supplemented |
||
2061 | by leading zeroes; if the number is big and can not be written by |
||
2062 | given amount of digits, extra digits are not drawn. |
||
2063 | * Parameters of fonts are shown in the description of function 4 |
||
2064 | (text output). |
||
114 | mikedld | 2065 | |
2066 | ====================================================================== |
||
118 | diamond | 2067 | ========= Function 48, subfunction 0 - apply screen settings. ======== |
114 | mikedld | 2068 | ====================================================================== |
2069 | Parameters: |
||
118 | diamond | 2070 | * eax = 48 - function number |
2071 | * ebx = 0 - subfunction number |
||
114 | mikedld | 2072 | * ecx = 0 - reserved |
2073 | Returned value: |
||
2074 | * function does not return value |
||
2075 | Remarks: |
||
118 | diamond | 2076 | * Function redraws the screen after parameters change by |
114 | mikedld | 2077 | subfunctions 1 and 2. |
118 | diamond | 2078 | * Function call without prior call to one of indicated subfunctions |
2079 | is ignored. |
||
2080 | * Function call with nonzero ecx is ignored. |
||
114 | mikedld | 2081 | |
2082 | ====================================================================== |
||
118 | diamond | 2083 | =========== Function 48, subfunction 1 - set button style. =========== |
114 | mikedld | 2084 | ====================================================================== |
2085 | Parameters: |
||
118 | diamond | 2086 | * eax = 48 - function number |
2087 | * ebx = 1 - subfunction number |
||
2088 | * ecx = button style: |
||
2089 | * 0 = flat |
||
2090 | * 1 = 3d |
||
114 | mikedld | 2091 | Returned value: |
2092 | * function does not return value |
||
2093 | Remarks: |
||
118 | diamond | 2094 | * After call to this function one should redraw the screen by |
2095 | subfunction 0. |
||
2096 | * Button style influences only to their draw of function 8. |
||
114 | mikedld | 2097 | |
118 | diamond | 2098 | ====================================================================== |
2099 | ====== Function 48, subfunction 2 - set standard window colors. ====== |
||
2100 | ====================================================================== |
||
114 | mikedld | 2101 | Parameters: |
118 | diamond | 2102 | * eax = 48 - function number |
2103 | * ebx = 2 - subfunction number |
||
2104 | * ecx = pointer to the color table |
||
114 | mikedld | 2105 | * edx = size of the color table |
118 | diamond | 2106 | (must be 40 bytes for future compatibility) |
2107 | Format of the color table is shown in description of subfunction 3. |
||
114 | mikedld | 2108 | Returned value: |
2109 | * function does not return value |
||
2110 | Remarks: |
||
118 | diamond | 2111 | * After call to this function one should redraw the screen by |
2112 | subfunction 0. |
||
2113 | * Table of standard colors influences only to applications, |
||
2114 | which receive this table obviously (by subfunction 3) |
||
2115 | and use it (specifying colors from it to drawing functions). |
||
2116 | * Table of standard colors is included in skin and is installed |
||
2117 | anew with skin installation (by subfunction 8). |
||
2118 | * Color table can be viewed/changed interactively with |
||
2119 | the application 'desktop'. |
||
114 | mikedld | 2120 | |
2121 | ====================================================================== |
||
118 | diamond | 2122 | ====== Function 48, subfunction 3 - get standard window colors. ====== |
114 | mikedld | 2123 | ====================================================================== |
2124 | Parameters: |
||
118 | diamond | 2125 | * eax = 48 - function number |
2126 | * ebx = 3 - subfunction number |
||
2127 | * ecx = pointer to the buffer with size edx bytes, |
||
2128 | where table will be written |
||
2129 | * edx = size of color table |
||
2130 | (must be 40 bytes for future compatibility) |
||
114 | mikedld | 2131 | Returned value: |
2132 | * function does not return value |
||
118 | diamond | 2133 | Format of the color table: |
2134 | each item is dword-value for color 0x00RRGGBB |
||
2135 | * +0: dword: frames - color of frame |
||
2136 | * +4: dword: grab - color of header |
||
2137 | * +8: dword: grab_button - color of button on header bar |
||
2138 | * +12 = +0xC: dword: grab_button_text - color of text on button |
||
2139 | on header bar |
||
2140 | * +16 = +0x10: dword: grab_text - color of text on header |
||
2141 | * +20 = +0x14: dword: work - color of working area |
||
2142 | * +24 = +0x18: dword: work_button - color of button in working area |
||
2143 | * +28 = +0x1C: dword: work_button_text - color of text on button |
||
2144 | in working area |
||
2145 | * +32 = +0x20: dword: work_text - color of text in working area |
||
2146 | * +36 = +0x24: dword: work_graph - color of graphics in working area |
||
114 | mikedld | 2147 | Remarks: |
118 | diamond | 2148 | * Structure of the color table is described in the standard |
2149 | include file 'macros.inc' as 'system_colors'; for example, |
||
2150 | it is possible to write: |
||
131 | diamond | 2151 | sc system_colors ; variable declaration |
2152 | ... ; somewhere one must call |
||
2153 | ; this function with ecx=sc |
||
2154 | mov ecx, [sc.work_button_text] ; read text color on |
||
2155 | ; buttin in working area |
||
118 | diamond | 2156 | * A program itself desides to use or not to use color table. |
2157 | For usage program must simply at calls to drawing functions select |
||
2158 | color taken from the table. |
||
2159 | * At change of the table of standard colors (by subfunction 2 with |
||
2160 | the subsequent application of changes by subfunction 0 or |
||
2161 | at skin set by subfunction 8) the system sends to all windows |
||
2162 | redraw message (the event with code 1). |
||
2163 | * Color table can be viewed/changed interactively with |
||
2164 | the application 'desktop'. |
||
114 | mikedld | 2165 | |
2166 | ====================================================================== |
||
118 | diamond | 2167 | ============ Function 48, subfunction 4 - get skin height. =========== |
114 | mikedld | 2168 | ====================================================================== |
2169 | Parameters: |
||
118 | diamond | 2170 | * eax = 48 - function number |
2171 | * ebx = 4 - subfunction number |
||
114 | mikedld | 2172 | Returned value: |
118 | diamond | 2173 | * eax = skin height |
114 | mikedld | 2174 | Remarks: |
118 | diamond | 2175 | * Skin height is defined as the height of a header |
2176 | of skinned windows. |
||
2177 | * See also general structure of window in the description |
||
2178 | of function 0. |
||
114 | mikedld | 2179 | |
2180 | ====================================================================== |
||
118 | diamond | 2181 | ======== Function 48, subfunction 5 - get screen working area. ======= |
114 | mikedld | 2182 | ====================================================================== |
2183 | Parameters: |
||
118 | diamond | 2184 | * eax = 48 - function number |
2185 | * ebx = 5 - subfunction number |
||
114 | mikedld | 2186 | Returned value: |
2187 | * eax = [left]*65536 + [right] |
||
2188 | * ebx = [top]*65536 + [bottom] |
||
2189 | Remarks: |
||
118 | diamond | 2190 | * The screen working area defines position and coordinates of |
2191 | a maximized window. |
||
2192 | * The screen working area in view of normal work is all screen |
||
2193 | without system panel (the application '@panel'). |
||
2194 | * (left,top) are coordinates of the left upper corner, |
||
2195 | (right,bottom) are coordinates of the right lower one. |
||
2196 | Thus the size of working area on x axis can be calculated by |
||
2197 | formula right-left+1, on y axis - by formula bottom-right+1. |
||
2198 | * See also function 14, |
||
2199 | to get sizes of all screen. |
||
2200 | * There is a pair function to set working area - subfunction 6. |
||
114 | mikedld | 2201 | |
2202 | ====================================================================== |
||
118 | diamond | 2203 | ======== Function 48, subfunction 6 - set screen working area. ======= |
114 | mikedld | 2204 | ====================================================================== |
2205 | Parameters: |
||
118 | diamond | 2206 | * eax = 48 - function number |
2207 | * ebx = 6 - subfunction number |
||
114 | mikedld | 2208 | * ecx = [left]*65536 + [right] |
2209 | * edx = [top]*65536 + [bottom] |
||
2210 | Returned value: |
||
2211 | * function does not return value |
||
2212 | Remarks: |
||
118 | diamond | 2213 | * The screen working area defines position and coordinates of |
2214 | a maximized window. |
||
2215 | * This function is used only by the application '@panel', |
||
2216 | which set working area to all screen without system panel. |
||
2217 | * (left,top) are coordinates of the left upper corner, |
||
2218 | (right,bottom) are coordinates of the right lower one. |
||
2219 | Thus the size of working area on x axis can be calculated by |
||
2220 | formula right-left+1, on y axis - by formula bottom-right+1. |
||
2221 | * If 'left'>='right', x-coordinate of working area is not changed. |
||
2222 | If 'left'<0, 'left' will not be set. If 'right' is greater than or |
||
2223 | equal to screen width, 'right' will not be set. |
||
2224 | Similarly on y axis. |
||
2225 | * See also function 14, |
||
2226 | to get sizes of all screen. |
||
2227 | * There is a pair function to get working area - subfunction 5. |
||
2228 | * This function redraws the screen automatically, |
||
2229 | updating coordinates and sizes of maximized windows. |
||
2230 | The system sends to all windows redraw message (the event 1). |
||
114 | mikedld | 2231 | |
2232 | ====================================================================== |
||
118 | diamond | 2233 | =========== Function 48, subfunction 7 - get skin margins. =========== |
114 | mikedld | 2234 | ====================================================================== |
118 | diamond | 2235 | Returns the area of a header of a skinned window, intended for |
2236 | a text of a header. |
||
114 | mikedld | 2237 | Parameters: |
118 | diamond | 2238 | * eax = 48 - function number |
2239 | * ebx = 7 - subfunction number |
||
114 | mikedld | 2240 | Returned value: |
2241 | * eax = [left]*65536 + [right] |
||
2242 | * ebx = [top]*65536 + [bottom] |
||
2243 | Remarks: |
||
118 | diamond | 2244 | * An application decides itself to use or not to use this function. |
2245 | * It is recommended to take into account returned value |
||
2246 | of this function for choice of a place for drawing header text |
||
2247 | (by function 4) or a substitute of header text |
||
2248 | (at the discretion of an application). |
||
114 | mikedld | 2249 | |
2250 | ====================================================================== |
||
118 | diamond | 2251 | ============= Function 48, subfunction 8 - set used skin. ============ |
114 | mikedld | 2252 | ====================================================================== |
2253 | Parameters: |
||
118 | diamond | 2254 | * eax = 48 - function number |
2255 | * ebx = 8 - subfunction number |
||
2256 | * ecx = pointer to a block for function 58, in |
||
2257 | which the fields of intermediate buffer and file name are filled |
||
114 | mikedld | 2258 | Returned value: |
118 | diamond | 2259 | * eax = 0 - success |
2260 | * otherwise eax = file system error code; if file does not |
||
2261 | contain valid skin, function returns error 3 |
||
2262 | (unknown file system). |
||
114 | mikedld | 2263 | Remarks: |
118 | diamond | 2264 | * After successful skin loading the system sends to all windows |
2265 | redraw message (the event 1). |
||
2266 | * At booting the system reads skin from file 'default.skn' |
||
2267 | on ramdisk. |
||
2268 | * User can change the skin statically by creating hisself |
||
2269 | 'default.skn' or dynamically with the application 'desktop'. |
||
114 | mikedld | 2270 | |
2271 | ====================================================================== |
||
118 | diamond | 2272 | =========== Function 49 - Advanced Power Management (APM). =========== |
114 | mikedld | 2273 | ====================================================================== |
2274 | Parameters: |
||
118 | diamond | 2275 | * eax = 49 - function number |
2276 | * dx = number of the APM function |
||
2277 | (analogue of ax in APM specification) |
||
2278 | * bx, cx = parameters of the APM function |
||
114 | mikedld | 2279 | Returned value: |
118 | diamond | 2280 | * 16-bit registers ax, bx, cx, dx, si, di and carry flag CF |
2281 | are set according to the APM specification |
||
2282 | * high halves of 32-bit registers eax, ebx, ecx, |
||
2283 | edx, esi, edi are destroyed |
||
114 | mikedld | 2284 | Remarks: |
118 | diamond | 2285 | * APM 1.2 specification is described in the document |
2286 | "Advanced Power Management (APM) BIOS Specification" |
||
2287 | (Revision 1.2), available at |
||
114 | mikedld | 2288 | http://www.microsoft.com/whdc/archive/amp_12.mspx; |
118 | diamond | 2289 | besides it is included in famous Interrupt List by Ralf Brown |
114 | mikedld | 2290 | (http://www.pobox.com/~ralf/files.html, |
2291 | ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/). |
||
2292 | |||
2293 | ====================================================================== |
||
118 | diamond | 2294 | =================== Function 50 - set window shape. ================== |
114 | mikedld | 2295 | ====================================================================== |
118 | diamond | 2296 | Normal windows have rectangular shape. This function can give to |
2297 | a window any shape. The shape is given by a set of points inside |
||
2298 | the base rectangle belonging to a window. Position and coordinates |
||
2299 | of the base rectangle are set by function 0 |
||
2300 | and changed by function 67. |
||
114 | mikedld | 2301 | |
118 | diamond | 2302 | --------------------------- Set shape data --------------------------- |
114 | mikedld | 2303 | Parameters: |
118 | diamond | 2304 | * eax = 50 - function number |
2305 | * ebx = 0 - subfunction number |
||
2306 | * ecx = pointer to shape data (array of bytes 0/1) |
||
114 | mikedld | 2307 | Returned value: |
2308 | * function does not return value |
||
2309 | |||
118 | diamond | 2310 | -------------------------- Set shape scale --------------------------- |
114 | mikedld | 2311 | Parameters: |
118 | diamond | 2312 | * eax = 50 - function number |
2313 | * ebx = 1 - subfunction number |
||
2314 | * ecx sets a scale: each byte of data defines |
||
2315 | (2^scale)*(2^scale) pixels |
||
114 | mikedld | 2316 | Returned value: |
2317 | * function does not return value |
||
2318 | Remarks: |
||
118 | diamond | 2319 | * Default scale is 0 (scale factor is 1). If in the shape data |
2320 | one byte corresponds to one pixel, there is no necessity |
||
2321 | to set scale. |
||
2322 | * Let's designate xsize = window width (in pixels), ysize = height; |
||
2323 | pay attention, that they are one pixel more than defined by |
||
114 | mikedld | 2324 | functions 0, 67. |
118 | diamond | 2325 | * On definition of scale xsize and ysize must be divisible |
2326 | on 2^scale. |
||
2327 | * Byte of data on offset 'a' must be 0/1 and defines belonging |
||
2328 | to a window of square with the side 2^scale (if scale=0, |
||
2329 | this is one pixel) and coordinates of the left upper corner |
||
114 | mikedld | 2330 | (a mod (xsize shr scale), a div (xsize shr scale)) |
118 | diamond | 2331 | * Data size: (xsize shr scale)*(ysize shr scale). |
2332 | * Data must be presented in the memory and not change |
||
2333 | after set of shape. |
||
2334 | * The system views the shape data at every window redraw by |
||
2335 | function 0. |
||
2336 | * The call of subfunction 0 with NULL pointer results in return |
||
2337 | to the rectangular shape. |
||
114 | mikedld | 2338 | |
2339 | ====================================================================== |
||
2340 | ==================== Function 51 - create thread. ==================== |
||
2341 | ====================================================================== |
||
2342 | Parameters: |
||
118 | diamond | 2343 | * eax = 51 - function number |
2344 | * ebx = 1 - unique subfunction |
||
2345 | * ecx = address of thread entry point (starting eip) |
||
2346 | * edx = pointer to thread stack (starting esp) |
||
114 | mikedld | 2347 | Returned value: |
118 | diamond | 2348 | * eax = -1 - error (there is too many threads) |
2349 | * otherwise eax = TID - thread identifier |
||
2350 | |||
114 | mikedld | 2351 | |
2352 | ====================================================================== |
||
118 | diamond | 2353 | === Function 52, subfunction 0 - get network driver configuration. === |
114 | mikedld | 2354 | ====================================================================== |
2355 | Parameters: |
||
118 | diamond | 2356 | * eax = 52 - function number |
2357 | * ebx = 0 - subfunction number |
||
114 | mikedld | 2358 | Returned value: |
118 | diamond | 2359 | * eax = configuration dword |
114 | mikedld | 2360 | Remarks: |
118 | diamond | 2361 | * Configuration dword can be set by subfunction 2. |
2362 | * The kernel does not use this variable. The value of this |
||
2363 | variable and working with it subfunctions 0 and 2 is represented |
||
2364 | doubtful. |
||
114 | mikedld | 2365 | |
2366 | ====================================================================== |
||
118 | diamond | 2367 | ========= Function 52, subfunction 1 - get local IP-address. ========= |
114 | mikedld | 2368 | ====================================================================== |
2369 | Parameters: |
||
118 | diamond | 2370 | * eax = 52 - function number |
2371 | * ebx = 1 - subfunction number |
||
114 | mikedld | 2372 | Returned value: |
2373 | * eax = IP-address (4 bytes) |
||
2374 | Remarks: |
||
118 | diamond | 2375 | * Local IP-address is set by subfunction 3. |
114 | mikedld | 2376 | |
2377 | ====================================================================== |
||
118 | diamond | 2378 | === Function 52, subfunction 2 - set network driver configuration. === |
114 | mikedld | 2379 | ====================================================================== |
2380 | Parameters: |
||
118 | diamond | 2381 | * eax = 52 - function number |
2382 | * ebx = 2 - subfunction number |
||
2383 | * ecx = configuration dword; if low 7 bits derivate the number 3, |
||
2384 | function [re-]initializes Ethernet-card, otherwise |
||
2385 | Ethernet turns off |
||
114 | mikedld | 2386 | Returned value: |
118 | diamond | 2387 | * if Ethernet-interface is not requested, function returns eax=2, |
2388 | but this can be changed in future kernel versions |
||
2389 | * if Ethernet-interface is requested, eax=0 means error |
||
2390 | (absence of Ethernet-card), and nonzero value - success |
||
114 | mikedld | 2391 | Remarks: |
118 | diamond | 2392 | * Configuration dword can be read by subfunction 0. |
2393 | * The kernel does not use this variable. The value of this |
||
2394 | variable, subfunction 0 and part of subfunction 2, which set it, |
||
114 | mikedld | 2395 | is represented doubtful. |
2396 | |||
2397 | ====================================================================== |
||
2398 | ========= Function 52, subfunction 3 - set local IP-address. ========= |
||
2399 | ====================================================================== |
||
2400 | Parameters: |
||
118 | diamond | 2401 | * eax = 52 - function number |
2402 | * ebx = 3 - subfunction number |
||
114 | mikedld | 2403 | * ecx = IP-address (4 bytes) |
2404 | Returned value: |
||
118 | diamond | 2405 | * the current implementation returns eax=3, but this can be changed |
2406 | in future versions |
||
114 | mikedld | 2407 | Remarks: |
118 | diamond | 2408 | * Local IP-address can be get by subfunction 1. |
114 | mikedld | 2409 | |
2410 | ====================================================================== |
||
118 | diamond | 2411 | = Function 52, subfunction 6 - add data to the stack of input queue. = |
114 | mikedld | 2412 | ====================================================================== |
2413 | Parameters: |
||
118 | diamond | 2414 | * eax = 52 - function number |
2415 | * ebx = 6 - subfunction number |
||
2416 | * edx = data size |
||
2417 | * esi = data pointer |
||
114 | mikedld | 2418 | Returned value: |
2419 | * eax = -1 - error |
||
118 | diamond | 2420 | * eax = 0 - success |
114 | mikedld | 2421 | Remarks: |
118 | diamond | 2422 | * This function is intended only for slow network drivers |
2423 | (PPP, SLIP). |
||
2424 | * Data size must not exceed 1500 bytes, though function |
||
2425 | performs no checks on correctness. |
||
114 | mikedld | 2426 | |
2427 | ====================================================================== |
||
118 | diamond | 2428 | Function 52, subfunction 8 - read data from the network output queue. |
114 | mikedld | 2429 | ====================================================================== |
2430 | Parameters: |
||
118 | diamond | 2431 | * eax = 52 - function number |
2432 | * ebx = 8 - subfunction number |
||
2433 | * esi = pointer to 1500-byte buffer |
||
114 | mikedld | 2434 | Returned value: |
118 | diamond | 2435 | * eax = number of read bytes (in the current implementation |
2436 | either 0 = no data or 1500) |
||
2437 | * data was copied in buffer |
||
114 | mikedld | 2438 | Remarks: |
118 | diamond | 2439 | * This function is intended only for slow network drivers |
2440 | (PPP, SLIP). |
||
114 | mikedld | 2441 | |
2442 | ====================================================================== |
||
118 | diamond | 2443 | ============ Function 52, subfunction 9 - get gateway IP. ============ |
114 | mikedld | 2444 | ====================================================================== |
2445 | Parameters: |
||
118 | diamond | 2446 | * eax = 52 - function number |
2447 | * ebx = 9 - subfunction number |
||
114 | mikedld | 2448 | Returned value: |
2449 | * eax = gateway IP (4 bytes) |
||
2450 | |||
2451 | ====================================================================== |
||
118 | diamond | 2452 | =========== Function 52, subfunction 10 - get subnet mask. =========== |
114 | mikedld | 2453 | ====================================================================== |
2454 | Parameters: |
||
118 | diamond | 2455 | * eax = 52 - function number |
2456 | * ebx = 10 - subfunction number |
||
114 | mikedld | 2457 | Returned value: |
118 | diamond | 2458 | * eax = subnet mask |
114 | mikedld | 2459 | |
2460 | ====================================================================== |
||
118 | diamond | 2461 | ============ Function 52, subfunction 11 - set gateway IP. =========== |
114 | mikedld | 2462 | ====================================================================== |
2463 | Parameters: |
||
118 | diamond | 2464 | * eax = 52 - function number |
2465 | * ebx = 11 - subfunction number |
||
114 | mikedld | 2466 | * ecx = gateway IP (4 bytes) |
2467 | Returned value: |
||
118 | diamond | 2468 | * the current implementation returns eax=11, but this can be changed |
2469 | in future versions |
||
114 | mikedld | 2470 | |
2471 | ====================================================================== |
||
118 | diamond | 2472 | =========== Function 52, subfunction 12 - set subnet mask. =========== |
114 | mikedld | 2473 | ====================================================================== |
2474 | Parameters: |
||
118 | diamond | 2475 | * eax = 52 - function number |
2476 | * ebx = 12 - subfunction number |
||
2477 | * ecx = subnet mask |
||
114 | mikedld | 2478 | Returned value: |
118 | diamond | 2479 | * the current implementation returns eax=12, but this can be changed |
2480 | in future versions |
||
114 | mikedld | 2481 | |
2482 | ====================================================================== |
||
118 | diamond | 2483 | ============== Function 52, subfunction 13 - get DNS IP. ============= |
114 | mikedld | 2484 | ====================================================================== |
2485 | Parameters: |
||
118 | diamond | 2486 | * eax = 52 - function number |
2487 | * ebx = 13 - subfunction number |
||
114 | mikedld | 2488 | Returned value: |
2489 | * eax = DNS IP (4 bytes) |
||
2490 | |||
2491 | ====================================================================== |
||
118 | diamond | 2492 | ============== Function 52, subfunction 14 - set DNS IP. ============= |
114 | mikedld | 2493 | ====================================================================== |
2494 | Parameters: |
||
118 | diamond | 2495 | * eax = 52 - function number |
2496 | * ebx = 14 - subfunction number |
||
114 | mikedld | 2497 | * ecx = DNS IP (4 bytes) |
2498 | Returned value: |
||
118 | diamond | 2499 | * the current implementation returns eax=14, but this can be changed |
2500 | in future versions |
||
114 | mikedld | 2501 | |
2502 | ====================================================================== |
||
277 | diamond | 2503 | ======== Function 52, subfunction 15 - get local MAC address. ======== |
2504 | ====================================================================== |
||
2505 | Parameters: |
||
2506 | * eax = 52 - function number |
||
2507 | * ebx = 15 - subfunction number |
||
2508 | * ecx = 0 - read first 4 bytes, |
||
2509 | ecx = 4 - read last 2 bytes |
||
2510 | Returned value: |
||
2511 | * for ecx=0: eax = first 4 bytes of MAC address |
||
2512 | * for ecx=4: ax = last 2 bytes of MAC address, |
||
2513 | high half of eax is destroyed |
||
2514 | * for other ecx: eax = -1 indicates an error |
||
2515 | |||
2516 | ====================================================================== |
||
118 | diamond | 2517 | ============ Function 53, subfunction 0 - open UDP-socket. =========== |
114 | mikedld | 2518 | ====================================================================== |
2519 | Parameters: |
||
118 | diamond | 2520 | * eax = 53 - function number |
2521 | * ebx = 0 - subfunction number |
||
2522 | * ecx = local port (only low word is taken into account) |
||
2523 | * edx = remote port (only low word is taken into account) |
||
114 | mikedld | 2524 | * esi = remote IP |
2525 | Returned value: |
||
118 | diamond | 2526 | * eax = -1 = 0xFFFFFFFF - error; ebx destroyed |
2527 | * eax = socket handle (some number which unambiguously identifies |
||
2528 | socket and have sense only for the system) - success; |
||
2529 | ebx destroyed |
||
114 | mikedld | 2530 | |
2531 | ====================================================================== |
||
118 | diamond | 2532 | =========== Function 53, subfunction 1 - close UDP-socket. =========== |
114 | mikedld | 2533 | ====================================================================== |
2534 | Parameters: |
||
118 | diamond | 2535 | * eax = 53 - function number |
2536 | * ebx = 1 - subfunction number |
||
2537 | * ecx = socket handle |
||
114 | mikedld | 2538 | Returned value: |
118 | diamond | 2539 | * eax = -1 - incorrect handle |
2540 | * eax = 0 - success |
||
2541 | * ebx destroyed |
||
114 | mikedld | 2542 | Remarks: |
118 | diamond | 2543 | * The current implementation does not close automatically all |
2544 | sockets of a thread at termination. In particular, one should not |
||
2545 | kill a thread with many opened sockets - there will be an outflow |
||
2546 | of resources. |
||
2547 | * The current implementation does no checks on correctness |
||
2548 | (function returns error only if thread tries to close not opened |
||
2549 | socket with correct handle). |
||
114 | mikedld | 2550 | |
2551 | ====================================================================== |
||
2552 | ============== Function 53, subfunction 2 - poll socket. ============= |
||
2553 | ====================================================================== |
||
2554 | Parameters: |
||
118 | diamond | 2555 | * eax = 53 - function number |
2556 | * ebx = 2 - subfunction number |
||
2557 | * ecx = socket handle |
||
114 | mikedld | 2558 | Returned value: |
118 | diamond | 2559 | * eax = number of read bytes |
2560 | * ebx destroyed |
||
114 | mikedld | 2561 | Remarks: |
118 | diamond | 2562 | * There is no checks for correctness. |
114 | mikedld | 2563 | |
2564 | ====================================================================== |
||
118 | diamond | 2565 | ========= Function 53, subfunction 3 - read byte from socket. ======== |
114 | mikedld | 2566 | ====================================================================== |
2567 | Parameters: |
||
118 | diamond | 2568 | * eax = 53 - function number |
2569 | * ebx = 3 - subfunction number |
||
2570 | * ecx = socket handle |
||
114 | mikedld | 2571 | Returned value: |
118 | diamond | 2572 | * if there is no read data: eax=0, bl=0, |
2573 | other bytes of ebx are destroyed |
||
2574 | * if there are read data: eax=number of rest bytes |
||
2575 | (possibly 0), bl=read byte, other bytes of ebx are destroyed |
||
114 | mikedld | 2576 | Remarks: |
118 | diamond | 2577 | * There is no checks for correctness. |
114 | mikedld | 2578 | |
2579 | ====================================================================== |
||
118 | diamond | 2580 | ========== Function 53, subfunction 4 - write to UDP-socket. ========= |
114 | mikedld | 2581 | ====================================================================== |
2582 | Parameters: |
||
118 | diamond | 2583 | * eax = 53 - function number |
2584 | * ebx = 4 - subfunction number |
||
2585 | * ecx = socket handle |
||
2586 | * edx = number of bytes to write |
||
2587 | * esi = pointer to data to write |
||
114 | mikedld | 2588 | Returned value: |
118 | diamond | 2589 | * eax = 0xffffffff - invalid handle |
2590 | * eax = 0xffff - not enough memory |
||
2591 | * eax = 0 - success |
||
2592 | * ebx destroyed |
||
114 | mikedld | 2593 | Remarks: |
118 | diamond | 2594 | * Check on validity of handle is minimal - only not very incorrect |
2595 | not opened handles are eliminated. |
||
2596 | * Number of bytes to write must not exceed 1500-28, though |
||
2597 | the appropriate check is not made. |
||
114 | mikedld | 2598 | |
2599 | ====================================================================== |
||
2600 | ============ Function 53, subfunction 5 - open TCP-socket. =========== |
||
2601 | ====================================================================== |
||
2602 | Parameters: |
||
118 | diamond | 2603 | * eax = 53 - function number |
2604 | * ebx = 5 - subfunction number |
||
2605 | * ecx = local port (only low word is taken into account) |
||
2606 | * edx = remote port (only low word is taken into account) |
||
114 | mikedld | 2607 | * esi = remote IP |
118 | diamond | 2608 | * edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1 |
114 | mikedld | 2609 | Returned value: |
118 | diamond | 2610 | * eax = -1 = 0xFFFFFFFF - error; ebx destroys |
2611 | * eax = socket handle (some number which unambiguously identifies |
||
2612 | socket and have sense only for the system) - success; |
||
2613 | ebx destroyed |
||
114 | mikedld | 2614 | |
2615 | ====================================================================== |
||
118 | diamond | 2616 | ========= Function 53, subfunction 6 - get TCP-socket status. ======== |
114 | mikedld | 2617 | ====================================================================== |
2618 | Parameters: |
||
118 | diamond | 2619 | * eax = 53 - function number |
2620 | * ebx = 6 - subfunction number |
||
2621 | * ecx = socket handle |
||
114 | mikedld | 2622 | Returned value: |
118 | diamond | 2623 | * eax = socket status: one of |
114 | mikedld | 2624 | * TCB_LISTEN = 1 |
2625 | * TCB_SYN_SENT = 2 |
||
2626 | * TCB_SYN_RECEIVED = 3 |
||
2627 | * TCB_ESTABLISHED = 4 |
||
2628 | * TCB_FIN_WAIT_1 = 5 |
||
2629 | * TCB_FIN_WAIT_2 = 6 |
||
2630 | * TCB_CLOSE_WAIT = 7 |
||
2631 | * TCB_CLOSING = 8 |
||
2632 | * TCB_LAST_ASK = 9 |
||
2633 | * TCB_TIME_WAIT = 10 |
||
2634 | * TCB_CLOSED = 11 |
||
118 | diamond | 2635 | * ebx destroys |
114 | mikedld | 2636 | Remarks: |
118 | diamond | 2637 | * There is no checks for correctness. |
114 | mikedld | 2638 | |
2639 | ====================================================================== |
||
118 | diamond | 2640 | ========== Function 53, subfunction 7 - write to TCP-socket. ========= |
114 | mikedld | 2641 | ====================================================================== |
2642 | Parameters: |
||
118 | diamond | 2643 | * eax = 53 - function number |
2644 | * ebx = 7 - subfunction number |
||
2645 | * ecx = socket handle |
||
2646 | * edx = number of bytes to write |
||
2647 | * esi = pointer to data to write |
||
114 | mikedld | 2648 | Returned value: |
2649 | * eax = 0xffffffff - error |
||
118 | diamond | 2650 | * eax = 0xffff - not enough memory |
2651 | * eax = 0 - success |
||
2652 | * ebx destroyed |
||
114 | mikedld | 2653 | Remarks: |
118 | diamond | 2654 | * Check on validity of handle is minimal - only not very incorrect |
2655 | not opened handles are eliminated. |
||
2656 | * Number of bytes to write must not exceed 1500-40, though |
||
2657 | the appropriate check is not made. |
||
114 | mikedld | 2658 | |
2659 | ====================================================================== |
||
118 | diamond | 2660 | =========== Function 53, subfunction 8 - close TCP-socket. =========== |
114 | mikedld | 2661 | ====================================================================== |
2662 | Parameters: |
||
118 | diamond | 2663 | * eax = 53 - function number |
2664 | * ebx = 8 - subfunction number |
||
2665 | * ecx = socket handle |
||
114 | mikedld | 2666 | Returned value: |
118 | diamond | 2667 | * eax = -1 - invalid handle |
2668 | * eax = 0xffff - not enough memory for socket close packet |
||
2669 | * eax = 0 - success |
||
2670 | * in many cases eax is destroyed (the result of function 'queue' |
||
2671 | is returned) - probably this is bug, which will be corrected |
||
2672 | * ebx destroyed |
||
114 | mikedld | 2673 | Remarks: |
118 | diamond | 2674 | * The current implementation does not close automatically all |
2675 | sockets of a thread at termination. In particular, one should not |
||
2676 | kill a thread with many opened sockets - there will be an outflow |
||
2677 | of resources. |
||
2678 | * The current implementation does no checks on correctness |
||
2679 | (function returns error only if thread tries to close not opened |
||
2680 | socket with correct handle). |
||
114 | mikedld | 2681 | |
2682 | ====================================================================== |
||
118 | diamond | 2683 | === Function 53, subfunction 9 - check whether local port is free. === |
114 | mikedld | 2684 | ====================================================================== |
2685 | Parameters: |
||
118 | diamond | 2686 | * eax = 53 - function number |
2687 | * ebx = 9 - subfunction number |
||
2688 | * ecx = local port number (low 16 bits are used only) |
||
114 | mikedld | 2689 | Returned value: |
2690 | * eax = 0 - port is used |
||
2691 | * eax = 1 - port is free |
||
118 | diamond | 2692 | * ebx destroyed |
114 | mikedld | 2693 | |
2694 | ====================================================================== |
||
314 | diamond | 2695 | ===== Function 53, subfunction 10 - query Ethernet cable status. ===== |
2696 | ====================================================================== |
||
2697 | Parameters: |
||
2698 | * eax = 53 - function number |
||
2699 | * ebx = 10 - subfunction number |
||
2700 | Returned value: |
||
2701 | * al = -1 - a network driver is not loaded or |
||
2702 | does not support this function |
||
2703 | * al = 0 - Ethernet cable is unplugged |
||
2704 | * al = 1 - Ethernet cable is plugged |
||
346 | diamond | 2705 | * ebx destroyed |
314 | diamond | 2706 | Remarks: |
2707 | * The current kernel implementation supports this function |
||
2708 | only for RTL8139 network cards. |
||
2709 | |||
2710 | ====================================================================== |
||
346 | diamond | 2711 | ======= Function 53, subfunction 11 - read network stack data. ======= |
340 | heavyiron | 2712 | ====================================================================== |
346 | diamond | 2713 | Paramters: |
2714 | * eax = 53 - function number |
||
2715 | * ebx = 11 - subfunction number |
||
2716 | * ecx = socket handle |
||
2717 | * edx = pointer to buffer |
||
2718 | * esi = number of bytes to read; |
||
2719 | * esi = 0 - read all data (maximum 4096 bytes) |
||
2720 | Returned value: |
||
2721 | * eax = number of bytes read |
||
2722 | * ebx destroyed |
||
2723 | Remakrs: |
||
2724 | * There is no check on handle correctness. |
||
340 | heavyiron | 2725 | |
2726 | ====================================================================== |
||
118 | diamond | 2727 | = Function 53, subfunction 255 - debug information of network driver. |
114 | mikedld | 2728 | ====================================================================== |
2729 | Parameters: |
||
118 | diamond | 2730 | * eax = 53 - function number |
2731 | * ebx = 255 - subfunction number |
||
114 | mikedld | 2732 | * ecx = type of requested information (see below) |
2733 | Returned value: |
||
2734 | * eax = requested information |
||
118 | diamond | 2735 | * ebx destroyed |
2736 | Possible values for ecx: |
||
114 | mikedld | 2737 | * 100: length of queue 0 (empty queue) |
2738 | * 101: length of queue 1 (ip-out queue) |
||
2739 | * 102: length of queue 2 (ip-in queue) |
||
2740 | * 103: length of queue 3 (net1out queue) |
||
118 | diamond | 2741 | * 200: number of items in the ARP table |
2742 | * 201: size of the ARP table (in items) (20 for current version) |
||
2743 | * 202: read item at edx of the ARP table to the temporary buffer, |
||
2744 | whence 5 following types take information; |
||
114 | mikedld | 2745 | in this case eax is not defined |
118 | diamond | 2746 | * 203: IP-address saved by type 202 |
2747 | * 204: high dword of MAC-address saved by type 202 |
||
2748 | * 205: low word of MAC-address saved by type 202 |
||
2749 | * 206: status word saved by type 202 |
||
2750 | * 207: ttl word saved by type 202 |
||
2751 | * 2: total number of received IP-packets |
||
2752 | * 3: total number of transferred IP-packets |
||
2753 | * 4: total number of dumped received packets |
||
2754 | * 5: total number of received ARP-packets |
||
2755 | * 6: status of packet driver, 0=inactive, nonzero=active |
||
114 | mikedld | 2756 | |
2757 | ====================================================================== |
||
2758 | ========== Function 55, subfunction 0 - load data for SB16. ========== |
||
2759 | ====================================================================== |
||
2760 | Parameters: |
||
118 | diamond | 2761 | * eax = 55 - function number |
2762 | * ebx = 0 - subfunction number |
||
2763 | * ecx = pointer to data (is copied 64 kilobytes, is used as much as |
||
2764 | set by subfunction 2) |
||
114 | mikedld | 2765 | Returned value: |
2766 | * function does not return value |
||
2767 | Remarks: |
||
118 | diamond | 2768 | * Format and size of data are set by subfunction 2. |
114 | mikedld | 2769 | |
2770 | ====================================================================== |
||
118 | diamond | 2771 | ======== Function 55, subfunction 1 - begin play data on SB16. ======= |
114 | mikedld | 2772 | ====================================================================== |
2773 | Parameters: |
||
118 | diamond | 2774 | * eax = 55 - function number |
2775 | * ebx = 1 - subfunction number |
||
114 | mikedld | 2776 | Returned value: |
2777 | * function does not return value |
||
2778 | Remarks: |
||
118 | diamond | 2779 | * Previously data must be loaded by subfunction 0 and |
2780 | their format must be defined by subfunction 2. |
||
2781 | * Function returns control, when playing of data began; after that |
||
2782 | play goes independently from application (and does not use |
||
2783 | processor time at all). |
||
2784 | * Previously must be defined SB16 base port |
||
2785 | (by subfunction 4 of function 21) and DMA channel |
||
2786 | (by subfunction 10 of function 21). |
||
114 | mikedld | 2787 | |
2788 | ====================================================================== |
||
118 | diamond | 2789 | ======== Function 55, subfunction 2 - set format of SB16 data. ======= |
114 | mikedld | 2790 | ====================================================================== |
2791 | Parameters: |
||
118 | diamond | 2792 | * eax = 55 - function number |
2793 | * ebx = 2 - subfunction number |
||
2794 | * ecx = 0 - set digit capacity |
||
2795 | * edx = 1 - 8bit mono |
||
2796 | * edx = 2 - 8bit stereo |
||
2797 | * ecx = 1 - set data size |
||
114 | mikedld | 2798 | * edx = size in bytes |
118 | diamond | 2799 | * ecx = 2 - set play frequency |
114 | mikedld | 2800 | * edx = frequency |
2801 | Returned value: |
||
2802 | * function does not return value |
||
2803 | Remarks: |
||
118 | diamond | 2804 | * When the system boots, it sets following default parameters: |
2805 | digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz. |
||
2806 | Nevertheless it is recommended to set necessary values obviously |
||
2807 | as they could be reset by some application. |
||
114 | mikedld | 2808 | |
2809 | ====================================================================== |
||
118 | diamond | 2810 | Function 55, subfunction 55 - begin to play data on built-in speaker. |
114 | mikedld | 2811 | ====================================================================== |
2812 | Parameters: |
||
118 | diamond | 2813 | * eax = 55 - function number |
2814 | * ebx = 55 - subfunction number |
||
2815 | * esi = pointer to data |
||
114 | mikedld | 2816 | Returned value: |
118 | diamond | 2817 | * eax = 0 - success |
2818 | * eax = 55 - error (speaker is off or busy) |
||
2819 | Data is an array of items with variable length. |
||
2820 | Format of each item is defined by first byte: |
||
114 | mikedld | 2821 | * 0 = end of data |
118 | diamond | 2822 | * 1..0x80 = sets sound duration on 1/100 of second; sound note |
2823 | is defined by immediate value of frequency |
||
2824 | * following word (2 bytes) contains frequency divider; |
||
2825 | frequency is defined as 1193180/divider |
||
114 | mikedld | 2826 | * 0x81 = invalid |
118 | diamond | 2827 | * 0x82..0xFF = note is defined by octave and number: |
2828 | * duration in 1/100 of second = (first byte)-0x81 |
||
114 | mikedld | 2829 | * there is one more byte; |
118 | diamond | 2830 | * (second byte)=0xFF - delay |
2831 | * otherwise it looks like a*0x10+b, where b=number of the note in |
||
2832 | an octave from 1 to 12, a=number of octave (beginning from 0) |
||
114 | mikedld | 2833 | Remarks: |
118 | diamond | 2834 | * Speaker play can be disabled/enabled by |
2835 | subfunction 8 of function 18. |
||
2836 | * Function returns control, having informed the system |
||
2837 | an information on request. Play itself goes independently from |
||
2838 | the program. |
||
2839 | * The data must be kept in the memory at least up to the end |
||
2840 | of play. |
||
114 | mikedld | 2841 | |
2842 | ====================================================================== |
||
118 | diamond | 2843 | ================ Function 58 - work with file system. ================ |
114 | mikedld | 2844 | ====================================================================== |
2845 | Parameters: |
||
2846 | * eax = 58 |
||
118 | diamond | 2847 | * ebx = pointer to the information structure |
114 | mikedld | 2848 | Returned value: |
118 | diamond | 2849 | * eax = 0 - success; otherwise file system error code |
2850 | * some subfunctions return value in other registers too |
||
2851 | General format of the information structure: |
||
2852 | * +0: dword: subfunction number |
||
114 | mikedld | 2853 | * +4: dword: number of block |
2854 | * +8: dword: size |
||
118 | diamond | 2855 | * +12 = +0xC: dword: pointer to data |
2856 | * +16 = +0x10: dword: pointer to a memory for system operations |
||
114 | mikedld | 2857 | (4096 bytes) |
118 | diamond | 2858 | * +20 = +0x14: n db: ASCIIZ-string with the file name |
2859 | Specifications - in documentation on the appropriate subfunction. |
||
2860 | Filename is case-insensitive for latin letters, russian letters |
||
2861 | must be capital. |
||
2862 | Format of filename: |
||
114 | mikedld | 2863 | /base/number/dir1/dir2/.../dirn/file, |
118 | diamond | 2864 | where /base/number identifies device, on which file is located: |
114 | mikedld | 2865 | one of |
118 | diamond | 2866 | * /RD/1 = /RAMDISK/1 to access ramdisk |
2867 | * /FD/1 = /FLOPPYDISK/1 to access first floppy drive, |
||
2868 | /FD/2 = /FLOPPYDISK/2 to access second one |
||
2869 | * /HD/x = /HARDDISK/x - obsolete variant of access to hard disk |
||
2870 | (in this case base is defined by subfunction 7 of function 21), |
||
2871 | x - partition number (beginning from 1) |
||
2872 | * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices |
||
2873 | IDE0 (Primary Master), IDE1 (Primary Slave), |
||
114 | mikedld | 2874 | IDE2 (Secondary Master), IDE3 (Secondary Slave); |
118 | diamond | 2875 | x - partition number on the selected hard drive, varies from 1 |
2876 | to 255 (on each hard drive the indexing starts from 1) |
||
114 | mikedld | 2877 | Remarks: |
118 | diamond | 2878 | * In the first two cases it is also possible to use FIRST |
2879 | instead of 1, SECOND instead of 2, but it is not recommended |
||
2880 | for convenience of transition to the future extensions. |
||
2881 | * Limitation n<=39 is imposed. |
||
2882 | * Names of folders and file dir1,...,dirn,file must have the |
||
2883 | format 8.3: name no more than 8 characters, dot, extension no |
||
2884 | more than 3 characters. Trailing spaces are ignored, no other |
||
2885 | spaces is allowed. If name occupies equally 8 characters, |
||
2886 | dot may be omitted (though it is not recommended to use this |
||
2887 | feature for convenience of transition to the future extensions). |
||
2888 | * This function does not support folders on ramdisk. |
||
114 | mikedld | 2889 | Examples: |
2890 | * '/RAMDISK/FIRST/KERNEL.ASM',0 |
||
2891 | '/rd/1/kernel.asm',0 |
||
2892 | * '/HD0/1/kernel.asm',0 |
||
2893 | * '/hd0/1/menuet/pics/tanzania.bmp',0 |
||
118 | diamond | 2894 | Existing subfunctions: |
2895 | * subfunction 0 - read file/folder |
||
2896 | * subfunction 1 - rewrite file |
||
2897 | * subfunction 8 - LBA-read from device |
||
2898 | * subfunction 15 - get file system information |
||
114 | mikedld | 2899 | |
2900 | ====================================================================== |
||
118 | diamond | 2901 | =========== Function 58, subfunction 0 - read file/folder. =========== |
114 | mikedld | 2902 | ====================================================================== |
2903 | Parameters: |
||
2904 | * eax = 58 |
||
118 | diamond | 2905 | * ebx = pointer to the information structure |
2906 | Format of the information structure: |
||
2907 | * +0: dword: 0 = subfunction number |
||
2908 | * +4: dword: first block to read (beginning from 0) |
||
2909 | * +8: dword: amount of blocks to read |
||
2910 | * +12 = +0xC: dword: pointer to buffer for data |
||
2911 | * +16 = +0x10: dword: pointer to buffer for system operations |
||
114 | mikedld | 2912 | (4096 bytes) |
118 | diamond | 2913 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
2914 | given in the general description |
||
114 | mikedld | 2915 | Returned value: |
118 | diamond | 2916 | * eax = 0 - success, otherwise file system error code |
2917 | * ebx = file size (in bytes) or -1=0xffffffff, if file was not found |
||
114 | mikedld | 2918 | Remarks: |
118 | diamond | 2919 | * Block size is 512 bytes. |
114 | mikedld | 2920 | * This function is obsolete, for reading files use subfunction 0 |
118 | diamond | 2921 | of function 70, for reading folders - subfunction 1 of |
2922 | function 70. |
||
2923 | * Function can read contents of a folder. Only FAT file system is |
||
2924 | supported. The format of FAT-folder is described |
||
2925 | in any FAT documentation. |
||
2926 | * Size of a folder is determined by size of FAT clusters chain. |
||
2927 | * If file was ended before last requested block was read, |
||
2928 | the function will read as many as it can, and after that return |
||
2929 | eax=6 (EOF). |
||
2930 | * Function can read root folders /rd/1,/fd/x,/hd[n]/x, but |
||
2931 | in the first two cases the current implementation does not follow |
||
2932 | to the declared rules: |
||
114 | mikedld | 2933 | for /rd/1: |
118 | diamond | 2934 | * if one want to read 0 blocks, function considers, |
2935 | that he requested 1; |
||
2936 | * if one requests more than 14 blocks or starting block is |
||
2937 | not less than 14, function returns eax=5 (not found) и ebx=-1; |
||
2938 | * size of ramdisk root folder is 14 blocks, |
||
2939 | 0x1C00=7168 байт; but function returns ebx=0 |
||
2940 | (except of the case of previous item); |
||
2941 | * strangely enough, it is possible to read 14th block (which |
||
2942 | generally contains a garbage - I remind, the indexing begins |
||
2943 | from 0); |
||
2944 | * if some block with the number not less than 14 was requested, |
||
2945 | function returns eax=6(EOF); otherwise eax=0. |
||
2946 | For /fd/x: |
||
2947 | * if the start block is not less than 14, function returns |
||
2948 | eax=5 (not found) and ebx=0; |
||
2949 | * note that format of FAT12 allows floppies with the root size |
||
2950 | more or less than 14 blocks; |
||
2951 | * check for length is not performed; |
||
2952 | * if data was successful read, function returns |
||
2953 | eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1. |
||
2954 | * The function handles reading of special folders /,/rd,/fd,/hd[n]; |
||
2955 | but the result does not correspond to expected (on operations with |
||
2956 | normal files/folders), does not follow the declared rules, |
||
2957 | may be changed in future versions of the kernel and consequently |
||
2958 | is not described. To obtain the information about the equipment |
||
2959 | use subfunction 11 of function 18 or |
||
2960 | read corresponding folder with subfunction 1 of function 70. |
||
114 | mikedld | 2961 | |
2962 | ====================================================================== |
||
118 | diamond | 2963 | ============= Function 58, subfunction 1 - rewrite file. ============= |
114 | mikedld | 2964 | ====================================================================== |
118 | diamond | 2965 | If the file does not exist, it is created. |
114 | mikedld | 2966 | If the file exists, it is rewritten. |
2967 | Parameters: |
||
118 | diamond | 2968 | * eax = 58 - function number |
2969 | * ebx = pointer to the information structure |
||
2970 | Format of the information structure: |
||
2971 | * +0: dword: 1 = subfunction number |
||
2972 | * +4: dword: ignored (set to 0) |
||
2973 | * +8: dword: number of bytes to write |
||
2974 | * +12 = +0xC: dword: pointer to data to write |
||
2975 | * +16 = +0x10: dword: pointer to buffer for system operations |
||
114 | mikedld | 2976 | (4096 bytes) |
118 | diamond | 2977 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
2978 | given in the general description |
||
114 | mikedld | 2979 | Returned value: |
118 | diamond | 2980 | * eax = 0 - success, otherwise file system error code |
2981 | * ebx destroyed |
||
114 | mikedld | 2982 | Remarks: |
118 | diamond | 2983 | * This function is obsolete, use subfunction 2 of function 70. |
114 | mikedld | 2984 | |
2985 | ====================================================================== |
||
118 | diamond | 2986 | ========= Function 58, subfunction 8 - LBA-read from device. ========= |
114 | mikedld | 2987 | ====================================================================== |
2988 | Parameters: |
||
118 | diamond | 2989 | * eax = 58 - function number |
2990 | * ebx = pointer to the information structure |
||
2991 | Format of the information structure: |
||
2992 | * +0: dword: 8 = subfunction number |
||
2993 | * +4: dword: number of block to read (beginning from 0) |
||
2994 | * +8: dword: ignored (set to 1) |
||
2995 | * +12 = +0xC: dword: pointer to buffer for data (512 bytes) |
||
2996 | * +16 = +0x10: dword: pointer to buffer for system operations |
||
114 | mikedld | 2997 | (4096 bytes) |
118 | diamond | 2998 | * +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of |
2999 | /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n, |
||
114 | mikedld | 3000 | 1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3. |
118 | diamond | 3001 | Instead of digits it is allowed, though not recommended for |
3002 | convenience of transition to future extensions, to use |
||
3003 | 'first','second','third','fourth'. |
||
114 | mikedld | 3004 | Returned value: |
118 | diamond | 3005 | * for device name /hd/xxx, where xxx is not in the list above: |
114 | mikedld | 3006 | * eax = ebx = 1 |
118 | diamond | 3007 | * for invalid device name (except for the previous case): |
114 | mikedld | 3008 | * eax = 5 |
118 | diamond | 3009 | * ebx does not change |
3010 | * if LBA-access is disabled by subfunction 11 of function 21: |
||
114 | mikedld | 3011 | * eax = 2 |
118 | diamond | 3012 | * ebx destroyed |
3013 | * for ramdisk: attempt to read block outside ramdisk |
||
3014 | (18*2*80 blocks) results in |
||
114 | mikedld | 3015 | * eax = 3 |
3016 | * ebx = 0 |
||
118 | diamond | 3017 | * for successful read: |
114 | mikedld | 3018 | * eax = ebx = 0 |
3019 | Remarks: |
||
118 | diamond | 3020 | * Block size is 512 bytes; function reads one block. |
3021 | * Do not depend on returned value, it can be changed |
||
3022 | in future versions. |
||
3023 | * Function requires that LBA-access to devices is enabled by |
||
3024 | subfunction 11 of function 21. To check this one can use |
||
3025 | subfunction 11 of function 26. |
||
3026 | * LBA-read of floppy is not supported. |
||
3027 | * Function reads data on physical hard drive; if for any reason |
||
3028 | data of the concrete partition are required, application must |
||
3029 | define starting sector of this partition (either directly |
||
3030 | through MBR, or from the full structure returned by |
||
3031 | подфункцией 11 функции 18). |
||
3032 | * Function does not check error code of hard disk, so request of |
||
3033 | nonexisting sector reads something (most probably it will be |
||
3034 | zeroes, but this is defined by device) and this is considered |
||
3035 | as success (eax=0). |
||
114 | mikedld | 3036 | |
118 | diamond | 3037 | ====================================================================== |
3038 | ==== Function 58, subfunction 15 - get information on file system. === |
||
3039 | ====================================================================== |
||
114 | mikedld | 3040 | Parameters: |
118 | diamond | 3041 | * eax = 58 - function number |
3042 | * ebx = pointer to the information structure |
||
3043 | Format of the information structure: |
||
3044 | * +0: dword: 15 = subfunction number |
||
114 | mikedld | 3045 | * +4: dword: ignored |
3046 | * +8: dword: ignored |
||
3047 | * +12 = +0xC: dword: ignored |
||
3048 | * +16 = +0x10: dword: ignored |
||
118 | diamond | 3049 | * +20 = +0x14: (only second character is checked) |
114 | mikedld | 3050 | /rd=/RAMDISK or /hd=/HARDDISK |
3051 | Returned value: |
||
118 | diamond | 3052 | * if the second character does not belong to set {'r','R','h','H'}: |
114 | mikedld | 3053 | * eax = 3 |
3054 | * ebx = ecx = dword [fileinfo] = 0 |
||
3055 | * for ramdisk: |
||
3056 | * eax = 0 (success) |
||
3057 | * ebx = total number of clusters = 2847 |
||
3058 | * ecx = number of free clusters |
||
3059 | * dword [fileinfo] = cluster size = 512 |
||
118 | diamond | 3060 | * for hard disk: base and partition are defined by subfunctions |
3061 | 7 and 8 of function 21: |
||
114 | mikedld | 3062 | * eax = 0 (success) |
3063 | * ebx = total number of clusters |
||
3064 | * ecx = number of free clusters |
||
3065 | * dword [fileinfo] = cluster size (in bytes) |
||
3066 | Remarks: |
||
118 | diamond | 3067 | * Be not surprised to strange layout of 4th returned parameter |
3068 | - when this code was writing, at system calls application got |
||
3069 | only registers eax,ebx,ecx (from pushad-structure transmitted |
||
3070 | as argument to the system function). Now it is corrected, so, |
||
3071 | probably, it is meaningful to return cluster size in edx, while |
||
3072 | this function is not used yet. |
||
3073 | * There exists also subfunction 11 of function 18, |
||
3074 | which returns information on file system. From the full table |
||
3075 | of disk subsystem it is possible to deduce cluster size (there |
||
3076 | it is stored in sectors) and total number of clusters |
||
3077 | for hard disks. |
||
114 | mikedld | 3078 | |
3079 | ====================================================================== |
||
118 | diamond | 3080 | ========== Function 60 - Inter Process Communication (IPC). ========== |
114 | mikedld | 3081 | ====================================================================== |
118 | diamond | 3082 | IPC is used for message dispatching from one process/thread to |
3083 | another. Previously it is necessary to agree how to interpret |
||
114 | mikedld | 3084 | the concrete message. |
3085 | |||
118 | diamond | 3086 | ----------- Subfunction 1 - set the area for IPC receiving ----------- |
3087 | Is called by process-receiver. |
||
114 | mikedld | 3088 | Parameters: |
118 | diamond | 3089 | * eax = 60 - function number |
3090 | * ebx = 1 - subfunction number |
||
3091 | * ecx = pointer to the buffer |
||
3092 | * edx = size of the buffer |
||
114 | mikedld | 3093 | Returned value: |
118 | diamond | 3094 | * eax = 0 - always success |
3095 | Format of IPC-buffer: |
||
3096 | * +0: dword: if nonzero, buffer is considered locked; |
||
3097 | lock/unlock the buffer, when you work with it and need that |
||
3098 | buffer data are not changed from outside (no new messages) |
||
114 | mikedld | 3099 | * +4: dword: occupied place in the buffer (in bytes) |
3100 | * +8: first message |
||
3101 | * +8+n: second message |
||
3102 | * ... |
||
118 | diamond | 3103 | Format of a message: |
3104 | * +0: dword: PID of sender |
||
3105 | * +4: dword: message length (not including this header) |
||
3106 | * +8: n*byte: message data |
||
114 | mikedld | 3107 | |
118 | diamond | 3108 | ------------------ Subfunction 2 - send IPC message ------------------ |
3109 | Is called by process-sender. |
||
114 | mikedld | 3110 | Parameters: |
118 | diamond | 3111 | * eax = 60 - function number |
3112 | * ebx = 2 - subfunction number |
||
114 | mikedld | 3113 | * ecx = PID of receiver |
118 | diamond | 3114 | * edx = pointer to the message data |
3115 | * esi = message length (in bytes) |
||
114 | mikedld | 3116 | Returned value: |
118 | diamond | 3117 | * eax = 0 - success |
3118 | * eax = 1 - the receiver has not defined buffer for IPC messages |
||
3119 | (can be, still have no time, |
||
3120 | and can be, this is not right process) |
||
3121 | * eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit |
||
3122 | * eax = 3 - overflow of IPC-buffer of the receiver |
||
114 | mikedld | 3123 | * eax = 4 - process/thread with such PID does not exist |
3124 | Remarks: |
||
118 | diamond | 3125 | * Immediately after writing of IPC-message to the buffer the system |
3126 | sends to the receiver the event with code 7 (see event codes). |
||
114 | mikedld | 3127 | |
3128 | ====================================================================== |
||
118 | diamond | 3129 | ==== Function 61 - get parameters for the direct graphics access. ==== |
114 | mikedld | 3130 | ====================================================================== |
118 | diamond | 3131 | The data of the graphics screen (the memory area which displays |
3132 | screen contents) are accessible to a program directly, without |
||
3133 | any system calls, through the selector gs: |
||
131 | diamond | 3134 | mov eax, [gs:0] |
118 | diamond | 3135 | places in eax the first dword of the buffer, which contains |
3136 | information on color of the left upper point (and, possibly, colors |
||
3137 | of several following). |
||
131 | diamond | 3138 | mov [gs:0], eax |
118 | diamond | 3139 | by work in VESA modes with LFB sets color of the left upper point |
3140 | (and, possibly, colors of several following). |
||
3141 | To interpret the data of graphics screen program needs to know |
||
3142 | some parameters, returning by this function. |
||
114 | mikedld | 3143 | Remarks: |
118 | diamond | 3144 | * Graphics parameters changes very seldom at work, |
3145 | namely, only in cases, when user works with the application VRR. |
||
3146 | * At videomode change the system redraws all windows (event |
||
3147 | with code 1) and redraws the background (event 5). |
||
3148 | Same events occur in other cases too, which meet much more often, |
||
3149 | than videomode change. |
||
3150 | * By operation in videomodes with LFB the selector gs points to |
||
3151 | LFB itself, so reading/writing on gs result directly in |
||
3152 | change of screen contents. By operation in videomodes without |
||
3153 | LFB gs points to some data area in the kernel, and all functions |
||
3154 | of screen output fulfil honesty double operation on writing |
||
3155 | directly to the screen and writing to this buffer. In result |
||
3156 | at reading contents of this buffer the results correspond to |
||
3157 | screen contents (with, generally speaking, large color |
||
3158 | resolution), and writing is ignored. |
||
3159 | One exception is the mode 320*200, for which main loop of the |
||
3160 | system thread updates the screen according to mouse movements. |
||
114 | mikedld | 3161 | |
3162 | ------------------------- Screen resolution -------------------------- |
||
3163 | Parameters: |
||
118 | diamond | 3164 | * eax = 61 - function number |
3165 | * ebx = 1 - subfunction number |
||
114 | mikedld | 3166 | Returned value: |
118 | diamond | 3167 | * eax = [resolution on x axis]*65536 + [resolution on y axis] |
114 | mikedld | 3168 | Remarks: |
118 | diamond | 3169 | * One can use function 14 paying attention that |
3170 | it returns sizes on 1 pixel less. It is fully equivalent way. |
||
114 | mikedld | 3171 | |
118 | diamond | 3172 | ---------------------- Number of bits per pixel ---------------------- |
114 | mikedld | 3173 | Parameters: |
118 | diamond | 3174 | * eax = 61 - function number |
3175 | * ebx = 2 - subfunction number |
||
114 | mikedld | 3176 | Returned value: |
118 | diamond | 3177 | * eax = number of bits per pixel (24 or 32) |
114 | mikedld | 3178 | |
118 | diamond | 3179 | -------------------- Number of bytes per scanline -------------------- |
114 | mikedld | 3180 | Parameters: |
118 | diamond | 3181 | * eax = 61 - function number |
3182 | * ebx = 3 - subfunction number |
||
114 | mikedld | 3183 | Returned value: |
118 | diamond | 3184 | * eax = number of bytes occupied by one scanline |
114 | mikedld | 3185 | (horizontal line on the screen) |
3186 | |||
3187 | ====================================================================== |
||
118 | diamond | 3188 | ===== Function 62, subfunction 0 - get version of PCI-interface. ===== |
114 | mikedld | 3189 | ====================================================================== |
3190 | Parameters: |
||
118 | diamond | 3191 | * eax = 62 - function number |
3192 | * bl = 0 - subfunction number |
||
114 | mikedld | 3193 | Returned value: |
118 | diamond | 3194 | * eax = -1 - PCI access is disabled; otherwise |
3195 | * ah.al = version of PCI-interface (ah=version, al=subversion) |
||
3196 | * high word of eax is zeroed |
||
114 | mikedld | 3197 | Remarks: |
118 | diamond | 3198 | * Previously low-level access to PCI for applications must be |
3199 | enabled by subfunction 12 of function 21. |
||
3200 | * If PCI BIOS is not supported, the value of ax is undefined. |
||
114 | mikedld | 3201 | |
3202 | ====================================================================== |
||
118 | diamond | 3203 | ==== Function 62, subfunction 1 - get number of the last PCI-bus. ==== |
114 | mikedld | 3204 | ====================================================================== |
3205 | Parameters: |
||
118 | diamond | 3206 | * eax = 62 - function number |
3207 | * bl = 1 - subfunction number |
||
114 | mikedld | 3208 | Returned value: |
118 | diamond | 3209 | * eax = -1 - access to PCI is disabled; otherwise |
3210 | * al = number of the last PCI-bus; other bytes of eax are destroyed |
||
114 | mikedld | 3211 | Remarks: |
118 | diamond | 3212 | * Previously low-level access to PCI for applications must be |
3213 | enabled by subfunction 12 of function 21. |
||
3214 | * If PCI BIOS is not supported, the value of ax is undefined. |
||
114 | mikedld | 3215 | |
3216 | ====================================================================== |
||
118 | diamond | 3217 | ===================== Function 62, subfunction 2 ===================== |
3218 | ===== Get mechanism of addressing to the PCI configuration space. ==== |
||
114 | mikedld | 3219 | ====================================================================== |
3220 | Parameters: |
||
118 | diamond | 3221 | * eax = 62 - function number |
3222 | * bl = 2 - subfunction number |
||
114 | mikedld | 3223 | Returned value: |
118 | diamond | 3224 | * eax = -1 - access to PCI is disabled; otherwise |
3225 | * al = mechanism (1 or 2); other bytes of eax are destroyed |
||
114 | mikedld | 3226 | Remarks: |
118 | diamond | 3227 | * Previously low-level access to PCI for applications must be |
3228 | enabled by subfunction 12 of function 21. |
||
3229 | * Addressing mechanism is selected depending on |
||
3230 | equipment characteristics. |
||
3231 | * Subfunctions of read and write work automatically |
||
3232 | with the selected mechanism. |
||
114 | mikedld | 3233 | |
3234 | ====================================================================== |
||
118 | diamond | 3235 | ======== Function 62, subfunctions 4,5,6 - read PCI-register. ======== |
114 | mikedld | 3236 | ====================================================================== |
3237 | Parameters: |
||
118 | diamond | 3238 | * eax = 62 - function number |
3239 | * bl = 4 - read byte |
||
3240 | * bl = 5 - read word |
||
3241 | * bl = 6 - read dword |
||
114 | mikedld | 3242 | * bh = number of PCI-bus |
118 | diamond | 3243 | * ch = dddddfff, where ddddd = number of the device on the bus, |
3244 | fff = function number of device |
||
3245 | * cl = number of register (must be even for bl=5, |
||
3246 | divisible by 4 for bl=6) |
||
114 | mikedld | 3247 | Returned value: |
118 | diamond | 3248 | * eax = -1 - error (access to PCI is disabled or parameters |
3249 | are not supported); otherwise |
||
3250 | * al/ax/eax (depending on requested size) contains the data; |
||
3251 | the other part of register eax is destroyed |
||
114 | mikedld | 3252 | Remarks: |
118 | diamond | 3253 | * Previously low-level access to PCI for applications must be |
3254 | enabled by subfunction 12 of function 21. |
||
3255 | * Access mechanism 2 supports only 16 devices on a bus and ignores |
||
3256 | function number. To get access mechanism use subfunction 2. |
||
3257 | * Some registers are standard and exist for all devices, some are |
||
3258 | defined by the concrete device. The list of registers of the |
||
3259 | first type can be found e.g. in famous |
||
114 | mikedld | 3260 | Interrupt List by Ralf Brown |
3261 | (http://www.pobox.com/~ralf/files.html, |
||
3262 | ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/); |
||
118 | diamond | 3263 | registers of the second type must be listed |
3264 | in the device documentation. |
||
114 | mikedld | 3265 | |
3266 | ====================================================================== |
||
118 | diamond | 3267 | ====== Function 62, subfunctions 8,9,10 - write to PCI-register. ===== |
114 | mikedld | 3268 | ====================================================================== |
3269 | Parameters: |
||
118 | diamond | 3270 | * eax = 62 - function number |
3271 | * bl = 8 - write byte |
||
3272 | * bl = 9 - write word |
||
3273 | * bl = 10 - write dword |
||
114 | mikedld | 3274 | * bh = number of PCI-bus |
118 | diamond | 3275 | * ch = dddddfff, where ddddd = number of the device on the bus, |
3276 | fff = function number of device |
||
3277 | * cl = number of register (must be even for bl=9, |
||
3278 | divisible by 4 for bl=10) |
||
3279 | * dl/dx/edx (depending on requested size) contatins |
||
3280 | the data to write |
||
114 | mikedld | 3281 | Returned value: |
118 | diamond | 3282 | * eax = -1 - error (access to PCI is disabled or parameters |
3283 | are not supported) |
||
3284 | * eax = 0 - success |
||
114 | mikedld | 3285 | Remarks: |
118 | diamond | 3286 | * Previously low-level access to PCI for applications must be |
3287 | enabled by subfunction 12 of function 21. |
||
3288 | * Access mechanism 2 supports only 16 devices on a bus and ignores |
||
3289 | function number. To get access mechanism use subfunction 2. |
||
3290 | * Some registers are standard and exist for all devices, some are |
||
3291 | defined by the concrete device. The list of registers of the |
||
3292 | first type can be found e.g. in famous Interrupt List by |
||
3293 | Ralf Brown; registers of the second type must be listed |
||
3294 | in the device documentation. |
||
114 | mikedld | 3295 | |
3296 | ====================================================================== |
||
118 | diamond | 3297 | ============== Function 63 - work with the debug board. ============== |
114 | mikedld | 3298 | ====================================================================== |
118 | diamond | 3299 | The debug board is the global system buffer (with the size |
448 | diamond | 3300 | 4096 bytes), to which any program can write (generally speaking, |
118 | diamond | 3301 | arbitrary) data and from which other program can read these data. |
3302 | By the agreement written data are text strings interpreted as |
||
3303 | debug messages on a course of program execution. The kernel in |
||
3304 | some situations also writes to the debug board information on |
||
3305 | execution of some functions; by the agreement kernel messages |
||
3306 | begins from the prefix "K : ". |
||
3307 | For view of the debug board the application 'board' was created, |
||
3308 | which reads data from the buffer and displays them in its window. |
||
3309 | 'board' interpretes the sequence of codes 13,10 as newline. |
||
3310 | A character with null code in an end of line is not necessary, |
||
114 | mikedld | 3311 | but also does not prevent. |
118 | diamond | 3312 | Because debugger has been written, the value of the debug board |
3313 | has decreased, as debugger allows to inspect completely a course of |
||
3314 | program execution without any efforts from the direction of program |
||
3315 | itself. Nevertheless in some cases the debug board is still useful. |
||
114 | mikedld | 3316 | |
118 | diamond | 3317 | ----------------------------- Write byte ----------------------------- |
114 | mikedld | 3318 | Parameters: |
118 | diamond | 3319 | * eax = 63 - function number |
3320 | * ebx = 1 - subfunction number |
||
3321 | * cl = data byte |
||
114 | mikedld | 3322 | Returned value: |
3323 | * function does not return value |
||
3324 | Remarks: |
||
118 | diamond | 3325 | * Byte is written to the buffer. Buffer size is 512 bytes. |
3326 | At buffer overflow all obtained data are lost. |
||
3327 | * For output to the debug board of more complicated objects |
||
3328 | (strings, numbers) it is enough to call this function in cycle. |
||
3329 | It is possible not to write the appropriate code manually and use |
||
3330 | file 'debug.inc', which is included into the distributive. |
||
114 | mikedld | 3331 | |
118 | diamond | 3332 | ----------------------------- Read byte ------------------------------ |
3333 | Takes away byte from the buffer. |
||
114 | mikedld | 3334 | Parameters: |
118 | diamond | 3335 | * eax = 63 - function number |
3336 | * ebx = 2 - subfunction number |
||
114 | mikedld | 3337 | Returned value: |
118 | diamond | 3338 | * eax = ebx = 0 - the buffer is empty |
3339 | * eax = byte, ebx = 1 - byte was successfully read |
||
114 | mikedld | 3340 | |
3341 | ====================================================================== |
||
118 | diamond | 3342 | ============== Function 64 - resize application memory. ============== |
114 | mikedld | 3343 | ====================================================================== |
3344 | Parameters: |
||
118 | diamond | 3345 | * eax = 64 - function number |
3346 | * ebx = 1 - unique subfunction |
||
3347 | * ecx = new memory size |
||
114 | mikedld | 3348 | Returned value: |
118 | diamond | 3349 | * eax = 0 - success |
3350 | * eax = 1 - not enough memory |
||
114 | mikedld | 3351 | Remarks: |
193 | diamond | 3352 | * There is another way to dynamically allocate/free memory - |
3353 | subfunctions 11, 12, 13 of function 68. |
||
3354 | * The function cannot be used together with 68.11, 68.12, 68.13. |
||
3355 | The function call will be ignored after creation of process heap |
||
3356 | with function 68.11. |
||
114 | mikedld | 3357 | |
3358 | ====================================================================== |
||
283 | diamond | 3359 | ======== Function 65 - draw image with palette in the window. ======== |
3360 | ====================================================================== |
||
3361 | Parameters: |
||
3362 | * eax = 65 - function number |
||
3363 | * ebx = pointer to the image |
||
3364 | * ecx = [size on axis x]*65536 + [size on axis y] |
||
3365 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
||
314 | diamond | 3366 | * esi = number of bits per pixel, must be 8, 24 or 32 |
3367 | * edi = pointer to palette (256 colors 0x00RRGGBB); |
||
3368 | ignored when esi = 24 and 32 |
||
3369 | * ebp = offset of next row data relative to previous row data |
||
283 | diamond | 3370 | Returned value: |
3371 | * function does not return value |
||
3372 | Remarks: |
||
3373 | * Coordinates of the image are coordinates of the upper left corner |
||
3374 | of the image relative to the window. |
||
3375 | * Size of the image in bytes is xsize*ysize. |
||
3376 | * Each byte of image is index in the palette. |
||
3377 | * If the image uses less than 256 colors, palette size may be |
||
3378 | less than 256 too. |
||
314 | diamond | 3379 | * The call to function 7 is equivalent to call to this function |
3380 | with esi=24, ebp=0. |
||
283 | diamond | 3381 | |
3382 | ====================================================================== |
||
118 | diamond | 3383 | ================== Function 66 - work with keyboard. ================= |
114 | mikedld | 3384 | ====================================================================== |
118 | diamond | 3385 | The input mode influences results of reading keys by function 2. |
3386 | When a program loads, ASCII input mode is set for it. |
||
114 | mikedld | 3387 | |
118 | diamond | 3388 | -------------- Subfunction 1 - set keyboard input mode. -------------- |
114 | mikedld | 3389 | Parameters: |
118 | diamond | 3390 | * eax = 66 - function number |
3391 | * ebx = 1 - subfunction number |
||
114 | mikedld | 3392 | * ecx = mode: |
3393 | * 0 = normal (ASCII-characters) |
||
3394 | * 1 = scancodes |
||
3395 | Returned value: |
||
3396 | * function does not return value |
||
3397 | |||
118 | diamond | 3398 | -------------- Subfunction 2 - get keyboard input mode. -------------- |
114 | mikedld | 3399 | Parameters: |
118 | diamond | 3400 | * eax = 66 - function number |
3401 | * ebx = 2 - subfunction number |
||
114 | mikedld | 3402 | Returned value: |
3403 | * eax = current mode |
||
3404 | |||
118 | diamond | 3405 | ------------ Subfunction 3 - get status of control keys. ------------- |
114 | mikedld | 3406 | Parameters: |
118 | diamond | 3407 | * eax = 66 - function number |
3408 | * ebx = 3 - subfunction number |
||
114 | mikedld | 3409 | Returned value: |
3410 | * eax = bit mask: |
||
118 | diamond | 3411 | * bit 0 (mask 1): left Shift is pressed |
3412 | * bit 1 (mask 2): right Shift is pressed |
||
3413 | * bit 2 (mask 4): left Ctrl is pressed |
||
3414 | * bit 3 (mask 8): right Ctrl is pressed |
||
3415 | * bit 4 (mask 0x10): left Alt is pressed |
||
3416 | * bit 5 (mask 0x20): right Alt is pressed |
||
3417 | * bit 6 (mask 0x40): CapsLock is on |
||
3418 | * bit 7 (mask 0x80): NumLock is on |
||
3419 | * bit 8 (mask 0x100): ScrollLock is on |
||
3420 | * other bits are cleared |
||
114 | mikedld | 3421 | |
118 | diamond | 3422 | -------------- Subfunction 4 - set system-wide hotkey. --------------- |
3423 | When hotkey is pressed, the system notifies only those applications, |
||
3424 | which have installed it; the active application (which receives |
||
3425 | all normal input) does not receive such keys. |
||
3426 | The notification consists in sending event with the code 2. |
||
3427 | Reading hotkey is the same as reading normal key - by function 2. |
||
114 | mikedld | 3428 | Parameters: |
118 | diamond | 3429 | * eax = 66 - function number |
3430 | * ebx = 4 - subfunction number |
||
3431 | * cl determines key scancode; |
||
3432 | use cl=0 to give combinations such as Ctrl+Shift |
||
3433 | * edx = 0xXYZ determines possible states of control keys: |
||
3434 | * Z (low 4 bits) determines state of LShift and RShift: |
||
3435 | * 0 = no key must be pressed; |
||
3436 | * 1 = exactly one key must be pressed; |
||
3437 | * 2 = both keys must be pressed; |
||
3438 | * 3 = must be pressed LShift, but not RShift; |
||
3439 | * 4 = must be pressed RShift, but not LShift |
||
3440 | * Y - similar for LCtrl and RCtrl; |
||
3441 | * X - similar for LAlt and RAlt |
||
114 | mikedld | 3442 | Returned value: |
118 | diamond | 3443 | * eax=0 - success |
3444 | * eax=1 - too mant hotkeys (maximum 256 are allowed) |
||
114 | mikedld | 3445 | Remarks: |
118 | diamond | 3446 | * Hotkey can work either at pressing or at release. Release |
3447 | scancode of a key is more on 128 than pressing scancode |
||
3448 | (i.e. high bit is set). |
||
3449 | * Several applications can set the same combination; |
||
3450 | all such applications will be informed on pressing |
||
3451 | such combination. |
||
114 | mikedld | 3452 | |
118 | diamond | 3453 | -------------- Subfunction 5 - delete installed hotkey. -------------- |
114 | mikedld | 3454 | Parameters: |
118 | diamond | 3455 | * eax = 66 - function number |
3456 | * ebx = 5 - subfunction number |
||
3457 | * cl = scancode of key and edx = 0xXYZ the same as in subfunction 4 |
||
114 | mikedld | 3458 | Returned value: |
118 | diamond | 3459 | * eax = 0 - success |
114 | mikedld | 3460 | * eax = 1 - there is no such hotkey |
3461 | Remarks: |
||
118 | diamond | 3462 | * When a process/thread terminates, all hotkey installed by it are |
3463 | deleted. |
||
3464 | * The call to this subfunction does not affect other applications. |
||
3465 | If other application has defined the same combination, it will |
||
3466 | still receive notices. |
||
114 | mikedld | 3467 | |
3468 | ====================================================================== |
||
118 | diamond | 3469 | ========= Function 67 - change position/sizes of the window. ========= |
114 | mikedld | 3470 | ====================================================================== |
3471 | Parameters: |
||
118 | diamond | 3472 | * eax = 67 - function number |
114 | mikedld | 3473 | * ebx = new x-coordinate of the window |
3474 | * ecx = new y-coordinate of the window |
||
3475 | * edx = new x-size of the window |
||
3476 | * esi = new y-size of the window |
||
3477 | Returned value: |
||
3478 | * function does not return value |
||
3479 | Remarks: |
||
118 | diamond | 3480 | * The value -1 for a parameter means "do not change"; e.g. to move |
3481 | the window without resizing it is possible to specify edx=esi=-1. |
||
3482 | * Previously the window must be defined by function 0. |
||
114 | mikedld | 3483 | It sets initial coordinates and sizes of the window. |
118 | diamond | 3484 | * Sizes of the window are understood in sense of function 0, |
3485 | that is one pixel less than real sizes. |
||
3486 | * The function call for maximized windows is simply ignored. |
||
3487 | * For windows of appropriate styles position and/or sizes can be |
||
3488 | changed by user; current position and sizes can be obtained by |
||
3489 | call to function 9. |
||
3490 | * The function sends to the window redraw event (with the code 1). |
||
114 | mikedld | 3491 | |
3492 | ====================================================================== |
||
118 | diamond | 3493 | ====== Function 68, subfunction 0 - get the task switch counter. ===== |
114 | mikedld | 3494 | ====================================================================== |
3495 | Parameters: |
||
118 | diamond | 3496 | * eax = 68 - function number |
3497 | * ebx = 0 - subfunction number |
||
114 | mikedld | 3498 | Returned value: |
118 | diamond | 3499 | * eax = number of task switches from the system booting |
3500 | (modulo 2^32) |
||
114 | mikedld | 3501 | |
3502 | ====================================================================== |
||
118 | diamond | 3503 | ======= Function 68, subfunction 1 - switch to the next thread. ====== |
114 | mikedld | 3504 | ====================================================================== |
118 | diamond | 3505 | The function completes the current time slice allocated to the |
3506 | thread and switches to the next. (Which thread in which process |
||
3507 | will be next, is unpredictable). Later, when execution queue |
||
3508 | will reach the current thread, execution will be continued. |
||
114 | mikedld | 3509 | Parameters: |
118 | diamond | 3510 | * eax = 68 - function number |
3511 | * ebx = 1 - subfunction number |
||
114 | mikedld | 3512 | Returned value: |
3513 | * function does not return value |
||
3514 | |||
3515 | ====================================================================== |
||
118 | diamond | 3516 | ============= Function 68, subfunction 2 - cache + rdpmc. ============ |
114 | mikedld | 3517 | ====================================================================== |
3518 | Parameters: |
||
118 | diamond | 3519 | * eax = 68 - function number |
3520 | * ebx = 2 - subfunction number |
||
3521 | * ecx = required action: |
||
3522 | * ecx = 0 - enable instruction 'rdpmc' |
||
3523 | (ReaD Performance-Monitoring Counters) for applications |
||
3524 | * ecx = 1 - find out whether cache is disabled/enabled |
||
3525 | * ecx = 2 - enable cache |
||
3526 | * ecx = 3 - disable cache |
||
114 | mikedld | 3527 | Returned value: |
3528 | * for ecx=0: |
||
118 | diamond | 3529 | * eax = the value of cr4 |
114 | mikedld | 3530 | * for ecx=1: |
3531 | * eax = (cr0 and 0x60000000): |
||
118 | diamond | 3532 | * eax = 0 - cache is on |
3533 | * eax <> 0 - cache is off |
||
114 | mikedld | 3534 | * for ecx=2 and ecx=3: |
3535 | * function does not return value |
||
3536 | |||
3537 | ====================================================================== |
||
3538 | =========== Function 68, subfunction 3 - read MSR-register. ========== |
||
3539 | ====================================================================== |
||
118 | diamond | 3540 | MSR = Model Specific Register; the complete list of MSR-registers |
3541 | of a processor is included to the documentation on it (for example, |
||
3542 | IA-32 Intel Architecture Software Developer's Manual, |
||
3543 | Volume 3, Appendix B); each processor family has its own subset |
||
3544 | of the MSR-registers. |
||
114 | mikedld | 3545 | Parameters: |
118 | diamond | 3546 | * eax = 68 - function number |
3547 | * ebx = 3 - subfunction number |
||
3548 | * ecx is ignored |
||
3549 | * edx = MSR address |
||
114 | mikedld | 3550 | Returned value: |
118 | diamond | 3551 | * ebx:eax = high:low dword of the result |
114 | mikedld | 3552 | Remarks: |
118 | diamond | 3553 | * If ecx contains nonexistent or not implemented for this processor |
3554 | MSR, processor will generate an exception in the kernel, which |
||
3555 | will kill the thread. |
||
3556 | * Previously it is necessary to check, whether MSRs are supported |
||
3557 | as a whole, with the instruction 'cpuid'. Otherwise processor |
||
3558 | will generate other exception in the kernel, which will anyway |
||
3559 | kill the thread. |
||
114 | mikedld | 3560 | |
3561 | ====================================================================== |
||
118 | diamond | 3562 | ========= Function 68, subfunction 4 - write to MSR-register. ======== |
114 | mikedld | 3563 | ====================================================================== |
118 | diamond | 3564 | MSR = Model Specific Register; the complete list of MSR-registers |
3565 | of a processor is included to the documentation on it (for example, |
||
3566 | IA-32 Intel Architecture Software Developer's Manual, |
||
3567 | Volume 3, Appendix B); each processor family has its own subset |
||
3568 | of the MSR-registers. |
||
114 | mikedld | 3569 | Parameters: |
118 | diamond | 3570 | * eax = 68 - function number |
3571 | * ebx = 4 - subfunction number |
||
3572 | * ecx is ignored |
||
3573 | * edx = MSR address |
||
3574 | * esi:edi = high:low dword |
||
114 | mikedld | 3575 | Returned value: |
118 | diamond | 3576 | * ebx:eax = copy of esi:edi |
486 | kastigar | 3577 | іамечания: |
118 | diamond | 3578 | * If ecx contains nonexistent or not implemented for this processor |
3579 | MSR, processor will generate an exception in the kernel, which |
||
3580 | will kill the thread. |
||
3581 | * Previously it is necessary to check, whether MSRs are supported |
||
3582 | as a whole, with the instruction 'cpuid'. Otherwise processor |
||
3583 | will generate other exception in the kernel, which will anyway |
||
3584 | kill the thread. |
||
114 | mikedld | 3585 | |
3586 | ====================================================================== |
||
193 | diamond | 3587 | ======= Function 68, subfunction 11 - initialize process heap. ======= |
114 | mikedld | 3588 | ====================================================================== |
3589 | Parameters: |
||
118 | diamond | 3590 | * eax = 68 - function number |
193 | diamond | 3591 | * ebx = 11 - subfunction number |
114 | mikedld | 3592 | Returned value: |
193 | diamond | 3593 | * eax = 0 - failed |
3594 | * otherwise size of created heap |
||
114 | mikedld | 3595 | Remarks: |
193 | diamond | 3596 | * The function call initializes heap, from which one can in future |
3597 | allocate and free memory blocks with subfunctions 12 and 13. |
||
3598 | Heap size is equal to total amount of free application memory. |
||
3599 | * The second function call from the same process results in |
||
3600 | returning the size of the existing heap. |
||
3601 | * After creation of the heap calls to function 64 will be ignored. |
||
114 | mikedld | 3602 | |
3603 | ====================================================================== |
||
193 | diamond | 3604 | ======== Function 68, subfunction 12 - allocate memory block. ======== |
114 | mikedld | 3605 | ====================================================================== |
3606 | Parameters: |
||
118 | diamond | 3607 | * eax = 68 - function number |
193 | diamond | 3608 | * ebx = 12 - subfunction number |
3609 | * ecx = required size in bytes |
||
114 | mikedld | 3610 | Returned value: |
193 | diamond | 3611 | * eax = pointer to the allocated block |
114 | mikedld | 3612 | Remarks: |
193 | diamond | 3613 | * Before this call one must initialize process heap by call to |
3614 | subfunction 11. |
||
3615 | * The function allocates an integer number of pages (4 Kb) in such |
||
3616 | way that the real size of allocated block is more than or equal to |
||
3617 | requested size. |
||
114 | mikedld | 3618 | |
3619 | ====================================================================== |
||
193 | diamond | 3620 | ========== Function 68, subfunction 13 - free memory block. ========== |
114 | mikedld | 3621 | ====================================================================== |
3622 | Parameters: |
||
118 | diamond | 3623 | * eax = 68 - function number |
193 | diamond | 3624 | * ebx = 13 - subfunction number |
3625 | * ecx = pointer to the memory block |
||
114 | mikedld | 3626 | Returned value: |
193 | diamond | 3627 | * eax = 1 - success |
3628 | * eax = 0 - failed |
||
114 | mikedld | 3629 | Remarks: |
448 | diamond | 3630 | * The memory block must have been allocated by subfunction 12 |
3631 | or subfunction 20. |
||
114 | mikedld | 3632 | |
3633 | ====================================================================== |
||
193 | diamond | 3634 | ======== Function 68, subfunction 14 - wait for driver notify. ======= |
114 | mikedld | 3635 | ====================================================================== |
3636 | Parameters: |
||
118 | diamond | 3637 | * eax = 68 - function number |
193 | diamond | 3638 | * ebx = 14 - subfunction number |
3639 | * ecx = pointer to the buffer for information (8 bytes) |
||
114 | mikedld | 3640 | Returned value: |
193 | diamond | 3641 | * buffer pointed to by ecx contains the following information: |
3642 | * +0: dword: constant EV_INTR = 1 |
||
3643 | * +4: dword: driver data |
||
114 | mikedld | 3644 | Remarks: |
193 | diamond | 3645 | * The current implementation at wait time uses "heavy" operations |
3646 | of task switch. |
||
114 | mikedld | 3647 | |
3648 | ====================================================================== |
||
193 | diamond | 3649 | ====== Function 68, subfunction 15 - set FPU exception handler. ====== |
3650 | ====================================================================== |
||
3651 | Parameters: |
||
3652 | * eax = 68 - function number |
||
3653 | * ebx = 15 - subfunction number |
||
3654 | * ecx = address of the new exception handler |
||
3655 | Returned value: |
||
3656 | * eax = address of the old exception handler (0, if it was not set) |
||
3657 | |||
3658 | ====================================================================== |
||
3659 | ============= Function 68, subfunction 16 - load driver. ============= |
||
3660 | ====================================================================== |
||
3661 | Parameters: |
||
3662 | * eax = 68 - function number |
||
3663 | * ebx = 16 - subfunction number |
||
3664 | * ecx = pointer to ASCIIZ-string with driver name |
||
3665 | Returned value: |
||
3666 | * eax = 0 - failed |
||
3667 | * otherwise eax = driver handle |
||
3668 | Remarks: |
||
3669 | * If the driver was not loaded yet, it is loaded; |
||
3670 | if the driver was loaded yet, nothing happens. |
||
3671 | * Driver name is case-sensitive. |
||
3672 | Maximum length of the name is 16 characters, including |
||
3673 | terminating null character, the rest is ignored. |
||
346 | diamond | 3674 | * Driver ABC is loaded from file /rd/1/drivers/ABC.obj. |
193 | diamond | 3675 | |
3676 | ====================================================================== |
||
3677 | ============ Function 68, subfunction 17 - driver control. =========== |
||
3678 | ====================================================================== |
||
3679 | Parameters: |
||
3680 | * eax = 68 - function number |
||
3681 | * ebx = 17 - subfunction number |
||
3682 | * ecx = pointer to the control structure: |
||
3683 | * +0: dword: handle of driver |
||
3684 | * +4: dword: code of driver function |
||
3685 | * +8: dword: pointer to input data |
||
3686 | * +12 = +0xC: dword: size of input data |
||
3687 | * +16 = +0x10: dword: pointer to output data |
||
3688 | * +20 = +0x14: dword: size of output data |
||
3689 | Returned value: |
||
3690 | * eax = determined by driver |
||
3691 | Remarks: |
||
3692 | * Function codes and the structure of input/output data |
||
3693 | are defined by driver. |
||
3694 | * Previously one must obtain driver handle by subfunction 16. |
||
3695 | |||
3696 | ====================================================================== |
||
3697 | ====== Function 68, subfunction 18 - set SSE exception handler. ====== |
||
3698 | ====================================================================== |
||
3699 | Parameters: |
||
3700 | * eax = 68 - function number |
||
3701 | * ebx = 15 - subfunction number |
||
3702 | * ecx = address of the new exception handler |
||
3703 | Returned value: |
||
3704 | * eax = address of the old exception handler (0, if it was not set) |
||
3705 | |||
3706 | ====================================================================== |
||
277 | diamond | 3707 | =============== Function 68, subfunction 19 - load DLL. ============== |
3708 | ====================================================================== |
||
3709 | Parameters: |
||
3710 | * eax = 68 - function number |
||
3711 | * ebx = 19 - subfunction number |
||
3712 | * ecx = pointer to ASCIIZ-string with the full path to DLL |
||
3713 | Returned value: |
||
3714 | * eax = 0 - failed |
||
3715 | * otherwise eax = pointer to DLL export table |
||
3716 | Remarks: |
||
3717 | * Export table is an array of structures of 2 dword's, terminated |
||
3718 | by zero. The first dword in structure points to function name, |
||
3719 | the second dword contains address of function. |
||
3720 | |||
3721 | ====================================================================== |
||
448 | diamond | 3722 | ======= Function 68, subfunction 20 - reallocate memory block. ======= |
3723 | ====================================================================== |
||
3724 | Parameters: |
||
3725 | * eax = 68 - function number |
||
3726 | * ebx = 20 - subfunction number |
||
3727 | * ecx = new size in bytes |
||
3728 | * edx = pointer to already allocated block |
||
3729 | Returned value: |
||
3730 | * eax = pointer to the reallocated block, 0 = error |
||
3731 | Remarks: |
||
3732 | * Before this call one must initialize process heap by call to |
||
3733 | subfunction 11. |
||
3734 | * The function allocates an integer number of pages (4 Kb) in such |
||
3735 | way that the real size of allocated block is more than or equal to |
||
3736 | requested size. |
||
3737 | * If edx=0, the function call is equivalent to memory allocation |
||
3738 | with subfunction 12. Otherwise the block at edx |
||
3739 | must be allocated earlier with subfunction 12 or this subfunction. |
||
3740 | * If ecx=0, the function frees memory block at edx and returns 0. |
||
3741 | * The contents of the block are unchanged up to the shorter of |
||
3742 | the new and old sizes. |
||
3743 | |||
3744 | ====================================================================== |
||
118 | diamond | 3745 | ====================== Fucntion 69 - debugging. ====================== |
114 | mikedld | 3746 | ====================================================================== |
118 | diamond | 3747 | A process can load other process as debugged by set of corresponding |
193 | diamond | 3748 | bit by call to subfunction 7 of function 70. |
118 | diamond | 3749 | A process can have only one debugger; one process can debug some |
3750 | others. The system notifies debugger on events occuring with |
||
3751 | debugged process. Messages are written to the buffer defined by |
||
114 | mikedld | 3752 | subfunction 0. |
118 | diamond | 3753 | Format of a message: |
3754 | * +0: dword: message code |
||
3755 | * +4: dword: PID of debugged process |
||
3756 | * +8: there can be additional data depending on message code |
||
3757 | Message codes: |
||
114 | mikedld | 3758 | * 1 = exception |
118 | diamond | 3759 | * in addition dword-number of the exception is given |
3760 | * process is suspended |
||
3761 | * 2 = process has terminated |
||
3762 | * comes at any termination: both through the system function -1, |
||
3763 | and at "murder" by any other process (including debugger itself) |
||
114 | mikedld | 3764 | * 3 = debug exception int 1 = #DB |
118 | diamond | 3765 | * in addition dword-image of the register DR6 is given: |
3766 | * bits 0-3: condition of the corresponding breakpoint (set by |
||
3767 | subfunction 9) is satisfied |
||
3768 | * бит 14: exception has occured because of the trace mode |
||
3769 | (flag TF is set TF) |
||
3770 | * process is suspended |
||
3771 | When debugger terminates, all debugged processes are killed. |
||
3772 | If debugger does not want this, it must previously detach by |
||
114 | mikedld | 3773 | subfunction 3. |
3774 | |||
118 | diamond | 3775 | All subfunctions are applicable only to processes/threads started |
3776 | from the current by function 58 or 70 with set debugging flag. |
||
3777 | Debugging of multithreaded programs is not supported yet. |
||
3778 | The full list of subfunctions: |
||
3779 | * subfunction 0 - define data area for debug messages |
||
3780 | * subfunction 1 - get contents of registers of debugged thread |
||
3781 | * subfunction 2 - set contents of registers of debugged thread |
||
3782 | * subfunction 3 - detach from debugged process |
||
3783 | * subfunction 4 - suspend debugged thread |
||
3784 | * subfunction 5 - resume debugged thread |
||
3785 | * subfunction 6 - read from the memory of debugged process |
||
3786 | * subfunction 7 - write to the memory of debugged process |
||
3787 | * subfunction 8 - terminate debugged thread |
||
3788 | * subfunction 9 - set/clear hardware breakpoint |
||
114 | mikedld | 3789 | |
3790 | ====================================================================== |
||
118 | diamond | 3791 | = Function 69, subfunction 0 - define data area fror debug messages. = |
114 | mikedld | 3792 | ====================================================================== |
3793 | Parameters: |
||
118 | diamond | 3794 | * eax = 69 - function number |
3795 | * ebx = 0 - subfunction number |
||
114 | mikedld | 3796 | * ecx = pointer |
3797 | Format of data area: |
||
118 | diamond | 3798 | * +0: dword: N = buffer size (not including this header) |
3799 | * +4: dword: occupied place |
||
114 | mikedld | 3800 | * +8: N*byte: buffer |
3801 | Returned value: |
||
3802 | * function does not return value |
||
3803 | Remarks: |
||
118 | diamond | 3804 | * If the size field is negative, the buffer is considered locked |
3805 | and at arrival of new message the system will wait. |
||
3806 | For synchronization frame all work with the buffer by operations |
||
3807 | lock/unlock |
||
131 | diamond | 3808 | neg [bufsize] |
118 | diamond | 3809 | * Data in the buffer are considered as array of items with variable |
3810 | length - messages. Format of a message is explained in |
||
3811 | general description. |
||
114 | mikedld | 3812 | |
3813 | ====================================================================== |
||
118 | diamond | 3814 | ===================== Function 69, subfunction 1 ===================== |
3815 | ============ Get contents of registers of debugged thread. =========== |
||
114 | mikedld | 3816 | ====================================================================== |
3817 | Parameters: |
||
118 | diamond | 3818 | * eax = 69 - function number |
3819 | * ebx = 1 - subfunction number |
||
114 | mikedld | 3820 | * ecx = thread identifier |
118 | diamond | 3821 | * edx = size of context structure, must be 0x28=40 bytes |
3822 | * esi = pointer to context structure |
||
114 | mikedld | 3823 | Returned value: |
3824 | * function does not return value |
||
118 | diamond | 3825 | Format of context structure: (FPU is not supported yet) |
114 | mikedld | 3826 | * +0: dword: eip |
3827 | * +4: dword: eflags |
||
3828 | * +8: dword: eax |
||
3829 | * +12 = +0xC: dword: ecx |
||
3830 | * +16 = +0x10: dword: edx |
||
3831 | * +20 = +0x14: dword: ebx |
||
3832 | * +24 = +0x18: dword: esp |
||
3833 | * +28 = +0x1C: dword: ebp |
||
3834 | * +32 = +0x20: dword: esi |
||
3835 | * +36 = +0x24: dword: edi |
||
3836 | Remarks: |
||
118 | diamond | 3837 | * If the thread executes code of ring-0, the function returns |
3838 | contents of registers of ring-3. |
||
3839 | * Process must be loaded for debugging (as is shown in |
||
3840 | general description). |
||
114 | mikedld | 3841 | |
3842 | ====================================================================== |
||
118 | diamond | 3843 | ===================== Function 69, subfunction 2 ===================== |
3844 | ============ Set contents of registers of debugged thread. =========== |
||
114 | mikedld | 3845 | ====================================================================== |
3846 | Parameters: |
||
118 | diamond | 3847 | * eax = 69 - function number |
3848 | * ebx = 2 - subfunction number |
||
114 | mikedld | 3849 | * ecx = thread identifier |
118 | diamond | 3850 | * edx = size of context structure, must be 0x28=40 bytes |
114 | mikedld | 3851 | Returned value: |
3852 | * function does not return value |
||
118 | diamond | 3853 | Format of context structure is shown in the description of |
3854 | subfunction 1. |
||
114 | mikedld | 3855 | Remarks: |
118 | diamond | 3856 | * If the thread executes code of ring-0, the function returns |
3857 | contents of registers of ring-3. |
||
3858 | * Process must be loaded for debugging (as is shown in |
||
3859 | general description). |
||
114 | mikedld | 3860 | |
3861 | ====================================================================== |
||
118 | diamond | 3862 | ===== Function 69, subfunction 3 - detach from debugged process. ===== |
114 | mikedld | 3863 | ====================================================================== |
3864 | Parameters: |
||
118 | diamond | 3865 | * eax = 69 - function number |
3866 | * ebx = 3 - subfunction number |
||
114 | mikedld | 3867 | * ecx = identifier |
3868 | Returned value: |
||
3869 | * function does not return value |
||
3870 | Remarks: |
||
118 | diamond | 3871 | * If the process was suspended, it resumes execution. |
114 | mikedld | 3872 | |
3873 | ====================================================================== |
||
118 | diamond | 3874 | ======== Function 69, subfunction 4 - suspend debugged thread. ======= |
114 | mikedld | 3875 | ====================================================================== |
3876 | Parameters: |
||
118 | diamond | 3877 | * eax = 69 - function number |
3878 | * ebx = 4 - subfunction number |
||
3879 | * ecx = thread identifier |
||
114 | mikedld | 3880 | Returned value: |
3881 | * function does not return value |
||
3882 | Remarks: |
||
118 | diamond | 3883 | * Process must be loaded for debugging (as is shown in |
3884 | general description). |
||
114 | mikedld | 3885 | |
3886 | ====================================================================== |
||
118 | diamond | 3887 | ======== Function 69, subfunction 5 - resume debugged thread. ======== |
114 | mikedld | 3888 | ====================================================================== |
3889 | Parameters: |
||
118 | diamond | 3890 | * eax = 69 - function number |
3891 | * ebx = 5 - subfunction number |
||
3892 | * ecx = thread identifier |
||
114 | mikedld | 3893 | Returned value: |
3894 | * function does not return value |
||
3895 | Remarks: |
||
118 | diamond | 3896 | * Process must be loaded for debugging (as is shown in |
3897 | general description). |
||
114 | mikedld | 3898 | |
3899 | ====================================================================== |
||
118 | diamond | 3900 | = Fucntion 69, subfunction 6 - read from memory of debugged process. = |
114 | mikedld | 3901 | ====================================================================== |
3902 | Parameters: |
||
118 | diamond | 3903 | * eax = 69 - function number |
3904 | * ebx = 6 - subfunction number |
||
114 | mikedld | 3905 | * ecx = identifier |
118 | diamond | 3906 | * edx = number of bytes to read |
3907 | * esi = address in the memory of debugged process |
||
3908 | * edi = pointer to buffer for data |
||
114 | mikedld | 3909 | Returned value: |
118 | diamond | 3910 | * eax = -1 at an error (invalid PID or buffer) |
3911 | * otherwise eax = number of read bytes (possibly, 0, |
||
3912 | if esi is too large) |
||
114 | mikedld | 3913 | Remarks: |
118 | diamond | 3914 | * Process must be loaded for debugging (as is shown in |
3915 | general description). |
||
114 | mikedld | 3916 | |
3917 | ====================================================================== |
||
118 | diamond | 3918 | == Function 69, subfunction 7 - write to memory of debugged process. = |
114 | mikedld | 3919 | ====================================================================== |
3920 | Parameters: |
||
118 | diamond | 3921 | * eax = 69 - function number |
3922 | * ebx = 7 - subfunction number |
||
114 | mikedld | 3923 | * ecx = identifier |
118 | diamond | 3924 | * edx = number of bytes to write |
3925 | * esi = address of memory in debugged process |
||
3926 | * edi = pointer to data |
||
114 | mikedld | 3927 | Returned value: |
118 | diamond | 3928 | * eax = -1 at an error (invalid PID or buffer) |
3929 | * otherwise eax = number of written bytes (possibly, 0, |
||
3930 | if esi is too large) |
||
114 | mikedld | 3931 | Remarks: |
118 | diamond | 3932 | * Process must be loaded for debugging (as is shown in |
3933 | general description). |
||
114 | mikedld | 3934 | |
3935 | ====================================================================== |
||
118 | diamond | 3936 | ======= Function 69, subfunction 8 - terminate debugged thread. ====== |
114 | mikedld | 3937 | ====================================================================== |
3938 | Parameters: |
||
118 | diamond | 3939 | * eax = 69 - function number |
3940 | * ebx = 8 - subfunction number |
||
114 | mikedld | 3941 | * ecx = identifier |
3942 | Returned value: |
||
3943 | * function does not return value |
||
3944 | Remarks: |
||
118 | diamond | 3945 | * Process must be loaded for debugging (as is shown in |
3946 | general description). |
||
3947 | * The function is similar to subfunction 2 of function 18 |
||
3948 | with two differences: it requires first remark and |
||
3949 | accepts PID rather than slot number. |
||
114 | mikedld | 3950 | |
3951 | ====================================================================== |
||
118 | diamond | 3952 | ===== Function 69, subfunction 9 - set/clear hardware breakpoint. ==== |
114 | mikedld | 3953 | ====================================================================== |
3954 | Parameters: |
||
118 | diamond | 3955 | * eax = 69 - function number |
3956 | * ebx = 9 - subfunction number |
||
114 | mikedld | 3957 | * ecx = thread identifier |
118 | diamond | 3958 | * dl = index of breakpoint, from 0 to 3 inclusively |
114 | mikedld | 3959 | * dh = flags: |
118 | diamond | 3960 | * if high bit is cleared - set breakpoint: |
114 | mikedld | 3961 | * bits 0-1 - condition: |
3962 | * 00 = breakpoint on execution |
||
118 | diamond | 3963 | * 01 = breakpoint on read |
3964 | * 11 = breakpoint on read/write |
||
3965 | * bits 2-3 - length; for breakpoints on exception it must be |
||
3966 | 00, otherwise one of |
||
3967 | * 00 = byte |
||
114 | mikedld | 3968 | * 01 = word |
118 | diamond | 3969 | * 11 = dword |
3970 | * esi = breakpoint address; must be aligned according to |
||
3971 | the length (i.e. must be even for word breakpoints, |
||
3972 | divisible by 4 for dword) |
||
3973 | * if high bit is set - clear breakpoint |
||
114 | mikedld | 3974 | Returned value: |
118 | diamond | 3975 | * eax = 0 - success |
114 | mikedld | 3976 | * eax = 1 - error in the input data |
118 | diamond | 3977 | * eax = 2 - (reserved, is never returned in the current |
3978 | implementation) a global breakpoint with that index is already set |
||
114 | mikedld | 3979 | Remarks: |
118 | diamond | 3980 | * Process must be loaded for debugging (as is shown in |
3981 | general description). |
||
3982 | * Hardware breakpoints are implemented through DRx-registers of |
||
3983 | the processor, all limitations results from this. |
||
3984 | * The function can reinstall the breakpoint, previously set |
||
3985 | by it (and it does not inform on this). |
||
3986 | Carry on the list of set breakpoints in the debugger. |
||
3987 | * Breakpoints generate debug exception #DB, on which the system |
||
3988 | notifies debugger. |
||
3989 | * Breakpoints on write and read/write act after |
||
3990 | execution of the caused it instruction. |
||
114 | mikedld | 3991 | |
3992 | ====================================================================== |
||
118 | diamond | 3993 | ==== Function 70 - work with file system with long names support. ==== |
114 | mikedld | 3994 | ====================================================================== |
3995 | Parameters: |
||
3996 | * eax = 70 |
||
118 | diamond | 3997 | * ebx = pointer to the information structure |
114 | mikedld | 3998 | Returned value: |
118 | diamond | 3999 | * eax = 0 - success; otherwise file system error code |
4000 | * some subfunctions return value in other registers too |
||
4001 | General format of the information structure: |
||
4002 | * +0: dword: subfunction number |
||
4003 | * +4: dword: file offset |
||
4004 | * +8: dword: high dword of offset (must be 0) or flags field |
||
114 | mikedld | 4005 | * +12 = +0xC: dword: size |
118 | diamond | 4006 | * +16 = +0x10: dword: pointer to data |
4007 | * +20 = +0x14: n db: ASCIIZ-string with the filename |
||
114 | mikedld | 4008 | or |
4009 | * +20 = +0x14: db 0 |
||
118 | diamond | 4010 | * +21 = +0x15: dd pointer to ASCIIZ-string with the filename |
4011 | Specifications - in documentation on the appropriate subfunction. |
||
4012 | Filename is case-insensitive. Russian letters must be written in |
||
4013 | the encoding cp866 (DOS). |
||
4014 | Format of filename: |
||
114 | mikedld | 4015 | /base/number/dir1/dir2/.../dirn/file, |
118 | diamond | 4016 | where /base/number identifies device, on which file is located: |
114 | mikedld | 4017 | one of |
118 | diamond | 4018 | * /RD/1 = /RAMDISK/1 to access ramdisk |
4019 | * /FD/1 = /FLOPPYDISK/1 to access first floppy drive, |
||
4020 | /FD/2 = /FLOPPYDISK/2 to access second one |
||
4021 | * /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices |
||
4022 | IDE0 (Primary Master), IDE1 (Primary Slave), |
||
114 | mikedld | 4023 | IDE2 (Secondary Master), IDE3 (Secondary Slave); |
118 | diamond | 4024 | x - partition number on the selected hard drive, varies from 1 |
4025 | to 255 (on each hard drive the indexing starts from 1) |
||
4026 | * /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to |
||
4027 | CD on IDE0 (Primary Master), IDE1 (Primary Slave), |
||
4028 | IDE2 (Secondary Master), IDE3 (Secondary Slave) |
||
114 | mikedld | 4029 | Examples: |
4030 | * '/rd/1/kernel.asm',0 |
||
4031 | * '/HD0/1/kernel.asm',0 |
||
4032 | * '/hd0/2/menuet/pics/tanzania.bmp',0 |
||
4033 | * '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0 |
||
118 | diamond | 4034 | Available subfunctions: |
114 | mikedld | 4035 | * subfunction 0 - read file |
4036 | * subfunction 1 - read folder |
||
4037 | * subfunction 2 - create/rewrite file |
||
131 | diamond | 4038 | * subfunction 3 - write to existing file |
133 | diamond | 4039 | * subfunction 4 - set file size |
118 | diamond | 4040 | * subfunction 5 - get attributes of file/folder |
4041 | * subfunction 6 - set attributes of file/folder |
||
114 | mikedld | 4042 | * subfunction 7 - start application |
193 | diamond | 4043 | * subfunction 8 - delete file/folder |
321 | diamond | 4044 | * subfunction 9 - create folder |
118 | diamond | 4045 | For CD-drives due to hardware limitations only subfunctions |
4046 | 0,1,5 and 7 are available, other subfunctions return error |
||
4047 | with code 2. |
||
114 | mikedld | 4048 | |
4049 | ====================================================================== |
||
118 | diamond | 4050 | === Function 70, subfunction 0 - read file with long names support. == |
114 | mikedld | 4051 | ====================================================================== |
4052 | Parameters: |
||
118 | diamond | 4053 | * eax = 70 - function number |
4054 | * ebx = pointer to the information structure |
||
4055 | Format of the information structure: |
||
4056 | * +0: dword: 0 = subfunction number |
||
4057 | * +4: dword: file offset (in bytes) |
||
4058 | * +8: dword: 0 (reserved for high dword of offset) |
||
4059 | * +12 = +0xC: dword: number of bytes to read |
||
4060 | * +16 = +0x10: dword: pointer to buffer for data |
||
4061 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
||
4062 | given in the general description |
||
114 | mikedld | 4063 | or |
4064 | * +20 = +0x14: db 0 |
||
118 | diamond | 4065 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
114 | mikedld | 4066 | Returned value: |
118 | diamond | 4067 | * eax = 0 - success, otherwise file system error code |
4068 | * ebx = number of read bytes or -1=0xffffffff if file was not found |
||
114 | mikedld | 4069 | Remarks: |
118 | diamond | 4070 | * If file was ended before last requested block was read, |
4071 | the function will read as many as it can, and after that return |
||
4072 | eax=6 (EOF). |
||
4073 | * The function does not allow to read folder (returns eax=10, |
||
4074 | access denied). |
||
114 | mikedld | 4075 | |
118 | diamond | 4076 | ====================================================================== |
4077 | == Function 70, subfunction 1 - read folder with long names support. = |
||
4078 | ====================================================================== |
||
114 | mikedld | 4079 | Parameters: |
118 | diamond | 4080 | * eax = 70 - function number |
4081 | * ebx = pointer to the information structure |
||
4082 | Format of the information structure: |
||
4083 | * +0: dword: 1 = subfunction number |
||
4084 | * +4: dword: index of starting block (beginning from 0) |
||
4085 | * +8: dword: flags field: |
||
114 | mikedld | 4086 | * bit 0 (mask 1): in what format to return names, |
4087 | 0=ANSI, 1=UNICODE |
||
118 | diamond | 4088 | * other bits are reserved and must be set to 0 for the future |
4089 | compatibility |
||
4090 | * +12 = +0xC: dword: number of blocks to read |
||
4091 | * +16 = +0x10: dword: pointer to buffer for data, buffer size |
||
4092 | must be not less than 32 + [+12]*560 bytes |
||
4093 | * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are |
||
4094 | given in the general description |
||
114 | mikedld | 4095 | or |
4096 | * +20 = +0x14: db 0 |
||
118 | diamond | 4097 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
114 | mikedld | 4098 | Returned value: |
118 | diamond | 4099 | * eax = 0 - success, otherwise file system error code |
4100 | * ebx = number of files, information on which was written to |
||
4101 | the buffer, or -1=0xffffffff, if folder was not found |
||
114 | mikedld | 4102 | Structure of the buffer: |
4103 | * +0: 32*byte: header |
||
4104 | * +32 = +0x20: n1*byte: block with information on file 1 |
||
118 | diamond | 4105 | * +32+n1: n2*byte: block with information on file 2 |
114 | mikedld | 4106 | * ... |
4107 | Structure of header: |
||
118 | diamond | 4108 | * +0: dword: version of structure (current is 1) |
4109 | * +4: dword: number of placed blocks; is not greater than requested |
||
4110 | in the field +12 of information structure; can be less, if |
||
4111 | there are no more files in folder (the same as in ebx) |
||
4112 | * +8: dword: total number of files in folder |
||
4113 | * +12 = +0xC: 20*byte: reserved (zeroed) |
||
4114 | Structure of block of data for folder entry (BDFE): |
||
4115 | * +0: dword: attributes of file: |
||
4116 | * bit 0 (mask 1): file is read-only |
||
4117 | * bit 1 (mask 2): file is hidden |
||
4118 | * bit 2 (mask 4): file is system |
||
4119 | * bit 3 (mask 8): this is not a file but volume label |
||
4120 | (for one partition meets no more than once and |
||
4121 | only in root folder) |
||
4122 | * bit 4 (mask 0x10): this is a folder |
||
4123 | * bit 5 (mask 0x20): file was not archived - many archivation |
||
4124 | programs have an option to archive only files with this bit set, |
||
4125 | and after archiving this bit is cleared - it can be useful |
||
4126 | for automatically creating of backup-archives as at writing |
||
4127 | this bit is usually set |
||
4128 | * +4: byte: type of name data: |
||
4129 | (coincides with bit 0 of flags in the information structure) |
||
4130 | * 0 = ASCII = 1-byte representation of each character |
||
4131 | * 1 = UNICODE = 2-byte representation of each character |
||
114 | mikedld | 4132 | * +5: 3*byte: reserved (zero) |
118 | diamond | 4133 | * +8: 4*byte: time of file creation |
4134 | * +12 = +0xC: 4*byte: date of file creation |
||
4135 | * +16 = +0x10: 4*byte: time of last access (read or write) |
||
114 | mikedld | 4136 | * +20 = +0x14: 4*byte: date of last access |
118 | diamond | 4137 | * +24 = +0x18: 4*byte: time of last modification |
4138 | * +28 = +0x1C: 4*byte: date of last modification |
||
4139 | * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb) |
||
114 | mikedld | 4140 | * +40 = +0x28: name |
118 | diamond | 4141 | * for ASCII format: maximum length is 263 characters |
4142 | (263 bytes), byte after the name has value 0 |
||
321 | diamond | 4143 | * for UNICODE format: maximum length is 259 characters |
118 | diamond | 4144 | (518 bytes), 2 bytes after the name have value 0 |
4145 | Time format: |
||
114 | mikedld | 4146 | * +0: byte: seconds |
4147 | * +1: byte: minutes |
||
4148 | * +2: byte: hours |
||
4149 | * +3: byte: reserved (0) |
||
118 | diamond | 4150 | * for example, 23.59.59 is written as (in hex) 3B 3B 17 00 |
4151 | Date format: |
||
4152 | * +0: byte: day |
||
4153 | * +1: byte: month |
||
4154 | * +2: word: year |
||
4155 | * for example, 25.11.1979 is written as (in hex) 19 0B BB 07 |
||
114 | mikedld | 4156 | Remarks: |
118 | diamond | 4157 | * If BDFE contains ASCII name, the length of BDFE is 304 bytes, |
4158 | if UNICODE name - 560 bytes. Value of length is aligned |
||
4159 | on 16-byte bound (to accelerate processing in CPU cache). |
||
4160 | * First character after a name is zero (ASCIIZ-string). The further |
||
4161 | data contain garbage. |
||
4162 | * If files in folder were ended before requested number was read, |
||
4163 | the function will read as many as it can, and after that return |
||
4164 | eax=6 (EOF). |
||
114 | mikedld | 4165 | * Any folder on the disk, except for root, contains two special |
118 | diamond | 4166 | entries "." and "..", identifying accordingly the folder itself |
4167 | and the parent folder. |
||
4168 | * The function allows also to read virtual folders "/", "/rd", |
||
4169 | "/fd", "/hd[n]", thus attributes of subfolders are set to 0x10, |
||
4170 | and times and dates are zeroed. An alternative way to get the |
||
4171 | equipment information - subfunction 11 of function 18. |
||
114 | mikedld | 4172 | |
4173 | ====================================================================== |
||
118 | diamond | 4174 | ===================== Function 70, subfunction 2 ===================== |
4175 | ============ Create/rewrite file with long names support. ============ |
||
114 | mikedld | 4176 | ====================================================================== |
4177 | Parameters: |
||
118 | diamond | 4178 | * eax = 70 - function number |
4179 | * ebx = pointer to the information structure |
||
4180 | Format of the information structure: |
||
4181 | * +0: dword: 2 = subfunction number |
||
114 | mikedld | 4182 | * +4: dword: 0 (reserved) |
4183 | * +8: dword: 0 (reserved) |
||
118 | diamond | 4184 | * +12 = +0xC: dword: number of bytes to read |
4185 | * +16 = +0x10: dword: pointer to data |
||
4186 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
||
4187 | given in the general description |
||
114 | mikedld | 4188 | or |
4189 | * +20 = +0x14: db 0 |
||
118 | diamond | 4190 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
114 | mikedld | 4191 | Returned value: |
118 | diamond | 4192 | * eax = 0 - success, otherwise file system error code |
4193 | * ebx = number of written bytes (possibly 0) |
||
114 | mikedld | 4194 | Remarks: |
118 | diamond | 4195 | * If a file with given name did not exist, it is created; |
4196 | if it existed, it is rewritten. |
||
4197 | * If there is not enough free space on disk, the function will |
||
4198 | write as many as can and then return error code 8. |
||
4199 | * The function is not supported for CD (returns error code 2). |
||
114 | mikedld | 4200 | |
4201 | ====================================================================== |
||
131 | diamond | 4202 | ===================== Function 70, subfunction 3 ===================== |
4203 | =========== Write to existing file with long names support. ========== |
||
4204 | ====================================================================== |
||
4205 | Parameters: |
||
4206 | * eax = 70 - function number |
||
4207 | * ebx = pointer to the information structure |
||
4208 | Format of the information structure: |
||
4209 | * +0: dword: 3 = subfunction number |
||
4210 | * +4: dword: file offset (in bytes) |
||
4211 | * +8: dword: high dword of offset (must be 0 for FAT) |
||
4212 | * +12 = +0xC: dword: number of bytes to write |
||
4213 | * +16 = +0x10: dword: pointer to data |
||
4214 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
||
4215 | given in the general description |
||
4216 | or |
||
4217 | * +20 = +0x14: db 0 |
||
4218 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
||
4219 | Returned value: |
||
4220 | * eax = 0 - success, otherwise file system error code |
||
4221 | * ebx = number of written bytes (possibly 0) |
||
4222 | Remarks: |
||
4223 | * The file must already exist, otherwise function returns eax=5. |
||
4224 | * The only result of write 0 bytes is update in the file attributes |
||
4225 | date/time of modification and access to the current date/time. |
||
4226 | * If beginning and/or ending position is greater than file size |
||
4227 | (except for the previous case), the file is expanded to needed |
||
4228 | size with zero characters. |
||
133 | diamond | 4229 | * The function is not supported for CD (returns error code 2). |
131 | diamond | 4230 | |
4231 | ====================================================================== |
||
133 | diamond | 4232 | ============ Function 70, subfunction 4 - set end of file. =========== |
4233 | ====================================================================== |
||
4234 | Parameters: |
||
4235 | * eax = 70 - function number |
||
4236 | * ebx = pointer to the information structure |
||
4237 | Format of the information structure: |
||
4238 | * +0: dword: 4 = subfunction number |
||
4239 | * +4: dword: low dword of new file size |
||
4240 | * +8: dword: high dword of new file size (must be 0 for FAT) |
||
4241 | * +12 = +0xC: dword: 0 (reserved) |
||
4242 | * +16 = +0x10: dword: 0 (reserved) |
||
4243 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
||
4244 | given in the general description |
||
4245 | or |
||
4246 | * +20 = +0x14: db 0 |
||
4247 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
||
4248 | Returned value: |
||
4249 | * eax = 0 - success, otherwise file system error code |
||
4250 | * ebx destroyed |
||
4251 | Remarks: |
||
4252 | * If the new file size is less than old one, file is truncated. |
||
4253 | If the new size is greater than old one, file is expanded with |
||
4254 | characters with code 0. If the new size is equal to old one, |
||
4255 | the only result of call is set date/time of modification and |
||
4256 | access to the current date/time. |
||
4257 | * If there is not enough free space on disk for expansion, the |
||
4258 | function will expand to maximum possible size and then return |
||
4259 | error code 8. |
||
4260 | * The function is not supported for CD (returns error code 2). |
||
4261 | |||
4262 | ====================================================================== |
||
118 | diamond | 4263 | ==== Function 70, subfunction 5 - get information on file/folder. ==== |
114 | mikedld | 4264 | ====================================================================== |
4265 | Parameters: |
||
118 | diamond | 4266 | * eax = 70 - function number |
4267 | * ebx = pointer to the information structure |
||
4268 | Format of the information structure: |
||
4269 | * +0: dword: 5 = subfunction number |
||
114 | mikedld | 4270 | * +4: dword: 0 (reserved) |
4271 | * +8: dword: 0 (reserved) |
||
4272 | * +12 = +0xC: dword: 0 (reserved) |
||
118 | diamond | 4273 | * +16 = +0x10: dword: pointer to buffer for data (40 bytes) |
4274 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
||
4275 | given in the general description |
||
114 | mikedld | 4276 | or |
4277 | * +20 = +0x14: db 0 |
||
118 | diamond | 4278 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
114 | mikedld | 4279 | Returned value: |
118 | diamond | 4280 | * eax = 0 - success, otherwise file system error code |
4281 | * ebx destroyed |
||
4282 | Information on file is returned in the BDFE format (block of data |
||
4283 | for folder entry), explained in the description of |
||
4284 | subfunction 1, but without filename |
||
4285 | (i.e. only first 40 = 0x28 bytes). |
||
114 | mikedld | 4286 | Remarks: |
118 | diamond | 4287 | * The function does not support virtual folders such as /, /rd and |
4288 | root folders like /rd/1. |
||
114 | mikedld | 4289 | |
4290 | ====================================================================== |
||
118 | diamond | 4291 | ===== Function 70, subfunction 6 - set attributes of file/folder. ==== |
114 | mikedld | 4292 | ====================================================================== |
4293 | Parameters: |
||
118 | diamond | 4294 | * eax = 70 - function number |
4295 | * ebx = pointer to the information structure |
||
4296 | Format of the information structure: |
||
4297 | * +0: dword: 6 = subfunction number |
||
114 | mikedld | 4298 | * +4: dword: 0 (reserved) |
4299 | * +8: dword: 0 (reserved) |
||
4300 | * +12 = +0xC: dword: 0 (reserved) |
||
118 | diamond | 4301 | * +16 = +0x10: dword: pointer to buffer with attributes (32 bytes) |
4302 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
||
4303 | given in the general description |
||
114 | mikedld | 4304 | or |
4305 | * +20 = +0x14: db 0 |
||
118 | diamond | 4306 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
114 | mikedld | 4307 | Returned value: |
118 | diamond | 4308 | * eax = 0 - success, otherwise file system error code |
4309 | * ebx destroyed |
||
4310 | File attributes are first 32 bytes in BDFE (block of data |
||
4311 | for folder entry), explained in the description of subfunction 1 |
||
4312 | (that is, without name and size of file). Attribute |
||
4313 | file/folder/volume label (bits 3,4 in dword +0) is not changed. |
||
4314 | Byte +4 (name format) is ignored. |
||
114 | mikedld | 4315 | Remarks: |
118 | diamond | 4316 | * The function does not support virtual folders such as /, /rd and |
4317 | root folders like /rd/1. |
||
4318 | * The function is not supported for CD (returns error code 2). |
||
114 | mikedld | 4319 | |
4320 | ====================================================================== |
||
118 | diamond | 4321 | =========== Function 70, subfunction 7 - start application. ========== |
114 | mikedld | 4322 | ====================================================================== |
4323 | Parameters: |
||
118 | diamond | 4324 | * eax = 70 - function number |
4325 | * ebx = pointer to the information structure |
||
4326 | Format of the information structure: |
||
4327 | * +0: dword: 7 = subfunction number |
||
4328 | * +4: dword: flags field: |
||
4329 | * бит 0: start process as debugged |
||
4330 | * other bits are reserved and must be set to 0 |
||
4331 | * +8: dword: 0 or pointer to ASCIIZ-string with parameters |
||
114 | mikedld | 4332 | * +12 = +0xC: dword: 0 (reserved) |
4333 | * +16 = +0x10: dword: 0 (reserved) |
||
118 | diamond | 4334 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
4335 | given in the general description |
||
114 | mikedld | 4336 | or |
4337 | * +20 = +0x14: db 0 |
||
118 | diamond | 4338 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
114 | mikedld | 4339 | Returned value: |
4340 | * eax > 0 - program is loaded, eax contains PID |
||
118 | diamond | 4341 | * eax < 0 - an error has occured, -eax contains |
4342 | file system error code |
||
4343 | * ebx destroyed |
||
114 | mikedld | 4344 | Remarks: |
118 | diamond | 4345 | * Command line must be terminated by the character with the code 0 |
4346 | (ASCIIZ-string); function takes into account either all characters |
||
4347 | up to terminating zero inclusively or first 256 character |
||
4348 | regarding what is less. |
||
4349 | * If the process is started as debugged, it is created in |
||
4350 | the suspended state; to run use subfunction 5 of function 69. |
||
114 | mikedld | 4351 | |
4352 | ====================================================================== |
||
193 | diamond | 4353 | ========== Function 70, subfunction 8 - delete file/folder. ========== |
4354 | ====================================================================== |
||
4355 | Parameters: |
||
4356 | * eax = 70 - function number |
||
4357 | * ebx = pointer to the information structure |
||
4358 | Format of the information structure: |
||
4359 | * +0: dword: 8 = subfunction number |
||
4360 | * +4: dword: 0 (reserved) |
||
4361 | * +8: dword: 0 (reserved) |
||
4362 | * +12 = +0xC: dword: 0 (reserved) |
||
4363 | * +16 = +0x10: dword: 0 (reserved) |
||
4364 | * +20 = +0x14: ASCIIZ-name of file, the rules of names forming are |
||
4365 | given in the general description |
||
4366 | or |
||
4367 | * +20 = +0x14: db 0 |
||
4368 | * +21 = +0x15: dd pointer to ASCIIZ-string with file name |
||
4369 | Returned value: |
||
4370 | * eax = 0 - success, otherwise file system error code |
||
4371 | * ebx destroyed |
||
4372 | Remarks: |
||
4373 | * The function is not supported for CD (returns error code 2). |
||
4374 | * The function can delete only empty folders (attempt to delete |
||
4375 | nonempty folder results in error with code 10, "access denied"). |
||
4376 | |||
4377 | ====================================================================== |
||
321 | diamond | 4378 | ============= Function 70, subfunction 9 - create folder. ============ |
4379 | ====================================================================== |
||
4380 | Parameters: |
||
4381 | * eax = 70 - function number |
||
4382 | * ebx = pointer to the information structure |
||
4383 | Format of the information structure: |
||
4384 | * +0: dword: 9 = subfunction number |
||
4385 | * +4: dword: 0 (reserved) |
||
4386 | * +8: dword: 0 (reserved) |
||
4387 | * +12 = +0xC: dword: 0 (reserved) |
||
4388 | * +16 = +0x10: dword: 0 (reserved) |
||
4389 | * +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are |
||
4390 | given in the general description |
||
4391 | or |
||
4392 | * +20 = +0x14: db 0 |
||
4393 | * +21 = +0x15: dd pointer to ASCIIZ-string with folder name |
||
4394 | Returned value: |
||
4395 | * eax = 0 - success, otherwise file system error code |
||
4396 | * ebx destroyed |
||
4397 | Remarks: |
||
4398 | * The function is not supported for CD (returns error code 2). |
||
4399 | * The parent folder must already exist. |
||
4400 | * If target folder already exists, function returns success (eax=0). |
||
4401 | |||
4402 | ====================================================================== |
||
118 | diamond | 4403 | ========== Function 71, subfunction 1 - set window caption. ========== |
114 | mikedld | 4404 | ====================================================================== |
4405 | Parameters: |
||
4406 | * eax = 71 - function number |
||
4407 | * ebx = 1 - subfunction number |
||
118 | diamond | 4408 | * ecx = pointer to caption string |
114 | mikedld | 4409 | Returned value: |
118 | diamond | 4410 | * function does not return value |
114 | mikedld | 4411 | Remarks: |
118 | diamond | 4412 | * String must be in the ASCIIZ-format. Disregarding real string |
4413 | length, no more than 255 characters are drawn. |
||
4414 | * Pass NULL in ecx to remove caption. |
||
114 | mikedld | 4415 | |
4416 | ====================================================================== |
||
118 | diamond | 4417 | =============== Function -1 - terminate thread/process =============== |
114 | mikedld | 4418 | ====================================================================== |
4419 | Parameters: |
||
118 | diamond | 4420 | * eax = -1 - function number |
114 | mikedld | 4421 | Returned value: |
118 | diamond | 4422 | * function does not return neither value nor control |
114 | mikedld | 4423 | Remarks: |
118 | diamond | 4424 | * If the process did not create threads obviously, it has only |
4425 | one thread, which termination results in process termination. |
||
4426 | * If the current thread is last in the process, its termination |
||
4427 | also results in process terminates. |
||
4428 | * This function terminates the current thread. Other thread can be |
||
4429 | killed by call to subfunction 2 of function 18. |
||
114 | mikedld | 4430 | |
4431 | ====================================================================== |
||
4432 | =========================== List of events =========================== |
||
4433 | ====================================================================== |
||
118 | diamond | 4434 | Next event can be retrieved by the call of one from functions 10 |
4435 | (to wait for event), 11 (to check without waiting), 23 |
||
4436 | (to wait during the given time). |
||
4437 | These functions return only those events, which enter into a mask set |
||
4438 | by function 40. By default it is first three, |
||
4439 | there is enough for most applications. |
||
114 | mikedld | 4440 | Codes of events: |
118 | diamond | 4441 | * 1 = redraw event (is reset by call to function 0) |
4442 | * 2 = key on keyboard is pressed (acts, only when the window is |
||
4443 | active) or hotkey is pressed; is reset, when all keys from |
||
4444 | the buffer are read out by function 2 |
||
4445 | * 3 = button is pressed, defined earlier by function 8 |
||
4446 | (or close button, created implicitly by function 0; |
||
4447 | minimize button is handled by the system and sends no message; |
||
4448 | acts, only when the window is active; |
||
4449 | is reset when all buttons from the buffer |
||
4450 | are read out by function 17) |
||
4451 | * 4 = reserved (in current implementation never comes even after |
||
4452 | unmasking by function 40) |
||
4453 | * 5 = the desktop background is redrawed (is reset automatically |
||
4454 | after redraw, so if in redraw time program does not wait and |
||
4455 | does not check events, it will not remark this event) |
||
4456 | * 6 = mouse event (something happened - button pressing or moving; |
||
4457 | is reset at reading) |
||
4458 | * 7 = IPC event (see function 60 - |
||
4459 | Inter Process Communication; is reset at reading) |
||
4460 | * 8 = network event (is reset at reading) |
||
4461 | * 9 = debug event (is reset at reading; see |
||
4462 | debug subsystem) |
||
4463 | * 16..31 = event with appropriate IRQ |
||
4464 | (16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data) |
||
114 | mikedld | 4465 | |
4466 | ====================================================================== |
||
118 | diamond | 4467 | =================== Error codes of the file system =================== |
114 | mikedld | 4468 | ====================================================================== |
118 | diamond | 4469 | * 0 = success |
4470 | * 1 = base and/or partition of a hard disk is not defined |
||
4471 | (by subfunctions 7, 8 of function 21) |
||
4472 | * 2 = function is not supported for the given file system |
||
4473 | * 3 = unknown file system |
||
448 | diamond | 4474 | * 4 = reserved, is never returned in the current implementation |
118 | diamond | 4475 | * 5 = file not found |
4476 | * 6 = end of file, EOF |
||
4477 | * 7 = pointer lies outside of application memory |
||
4478 | * 8 = disk is full |
||
4479 | * 9 = FAT table is destroyed |
||
114 | mikedld | 4480 | * 10 = access denied |
118 | diamond | 4481 | * 11 = device error |
4482 | Application start functions can return also following errors: |
||
4483 | * 30 = 0x1E = not enough memory |
||
4484 | * 31 = 0x1F = file is not executable |
||
4485 | * 32 = 0x20 = too many processes>>=4>=n<=4>=39>0,>=>=>=0xFFFF. |