2012-03-13 17:51:57 +01:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2010-10-17 10:53:29 +02:00
|
|
|
SYSTEM FUNCTIONS of OS Kolibri 0.7.7.0
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
Number of the function is located in the register eax.
|
2006-08-11 15:30:23 +02:00
|
|
|
The call of the system function is executed by "int 0x40" command.
|
|
|
|
All registers except explicitly declared in the returned value,
|
|
|
|
including eflags, are preserved.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============== Function 0 - define and draw the window. ==============
|
|
|
|
======================================================================
|
|
|
|
Defines an application window. Draws a frame of the window, header and
|
2006-08-21 15:06:02 +02:00
|
|
|
working area. For skinned windows defines standard close and minimize
|
|
|
|
buttons.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = [coordinate on axis x]*65536 + [size on axis x]
|
|
|
|
* ecx = [coordinate on axis y]*65536 + [size on axis y]
|
|
|
|
* edx = 0xXYRRGGBB, where:
|
|
|
|
* Y = style of the window:
|
2006-08-18 15:32:18 +02:00
|
|
|
* Y=0 - type I - fixed-size window
|
2006-08-11 15:30:23 +02:00
|
|
|
* Y=1 - only define window area, draw nothing
|
2006-08-18 15:32:18 +02:00
|
|
|
* Y=2 - type II - variable-size window
|
|
|
|
* Y=3 - skinned window
|
2007-09-23 22:58:50 +02:00
|
|
|
* Y=4 - skinned fixed-size window
|
|
|
|
* other possible values (from 5 up to 15) are reserved,
|
2006-08-03 21:30:32 +02:00
|
|
|
function call with such Y is ignored
|
2006-08-11 15:30:23 +02:00
|
|
|
* RR, GG, BB = accordingly red, green, blue components of a color
|
|
|
|
of the working area of the window (are ignored for style Y=2)
|
2006-08-03 21:30:32 +02:00
|
|
|
* X = DCBA (bits)
|
2007-09-23 22:58:50 +02:00
|
|
|
* A = 1 - window has caption; for styles Y=3,4 caption string
|
2006-08-11 15:30:23 +02:00
|
|
|
must be passed in edi, for other styles use
|
|
|
|
subfunction 1 of function 71
|
|
|
|
* B = 1 - coordinates of all graphics primitives are relative to
|
|
|
|
window client area
|
2007-01-30 22:54:34 +01:00
|
|
|
* C = 1 - don't fill working area on window draw
|
2006-08-11 15:30:23 +02:00
|
|
|
* D = 0 - normal filling of the working area, 1 - gradient
|
|
|
|
The following parameters are intended for windows
|
|
|
|
of a type I and II, and ignored for styles Y=1,3:
|
|
|
|
* esi = 0xXYRRGGBB - color of the header
|
|
|
|
* RR, GG, BB define color
|
2006-08-03 21:30:32 +02:00
|
|
|
* Y=0 - usual window, Y=1 - unmovable window
|
2006-08-11 15:30:23 +02:00
|
|
|
* X defines a gradient of header: X=0 - no gradient,
|
2006-08-03 21:30:32 +02:00
|
|
|
X=8 - usual gradient,
|
|
|
|
for windows of a type II X=4 - negative gradient
|
2006-08-11 15:30:23 +02:00
|
|
|
* other values of X and Y are reserved
|
|
|
|
* edi = 0x00RRGGBB - color of the frame
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Position and sizes of the window are installed by the first
|
|
|
|
call of this function and are ignored at subsequent; to change
|
|
|
|
position and/or sizes of already created window use function 67.
|
2007-09-23 22:58:50 +02:00
|
|
|
* For windows with styles Y=3,4 and caption (A=1) caption string
|
|
|
|
is set by the first call of this function and is ignored
|
|
|
|
at subsequent (strictly speaking, is ignored after a call to
|
|
|
|
subfunction 2 of function 12 - end redraw); to change caption of
|
|
|
|
already created window use subfunction 1 of function 71.
|
2006-08-11 15:30:23 +02:00
|
|
|
* If the window has appropriate styles, position and/or sizes can be
|
|
|
|
changed by user. Current position and sizes can be obtained
|
|
|
|
by function 9.
|
|
|
|
* The window must fit on the screen. If the transferred
|
|
|
|
coordinates and sizes do not satisfy to this condition,
|
|
|
|
appropriate coordinate (or, probably, both) is considered as zero,
|
2006-08-18 15:32:18 +02:00
|
|
|
and if it does not help too, the appropriate size
|
2006-08-11 15:30:23 +02:00
|
|
|
(or, probably, both) is installed in a size of the screen.
|
2012-02-26 05:22:47 +01:00
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
Further let us designate xpos,ypos,xsize,ysize - values passed
|
|
|
|
in ebx,ecx. The coordinates are resulted concerning
|
2006-08-11 15:30:23 +02:00
|
|
|
the left upper corner of the window, which, thus, is set as (0,0),
|
|
|
|
coordinates of the right lower corner essence (xsize,ysize).
|
|
|
|
* The sizes of the window are understood in sence of coordinates
|
|
|
|
of the right lower corner. This concerns all other functions too.
|
|
|
|
It means, that the real sizes are on 1 pixel more.
|
|
|
|
* The window of type I looks as follows:
|
|
|
|
* draw external frame of color indicated in edi, 1 pixel in width
|
|
|
|
* draw header - rectangle with the left upper corner (1,1) and
|
|
|
|
right lower (xsize-1,min(25,ysize)) color indicated in esi
|
|
|
|
(taking a gradient into account)
|
|
|
|
* if ysize>=26, fill the working area of the window -
|
|
|
|
rectangle with the left upper corner (1,21) and right lower
|
|
|
|
(xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
|
|
|
|
indicated in edx (taking a gradient into account)
|
|
|
|
* if A=1 and caption has been already set by subfunction 1
|
|
|
|
of function 71, it is drawn in the corresponding place of header
|
|
|
|
* The window of style Y=1 looks as follows:
|
2006-08-03 21:30:32 +02:00
|
|
|
* completely defined by the application
|
2006-08-11 15:30:23 +02:00
|
|
|
* The window of type II looks as follows:
|
|
|
|
* draw external frame of width 1 pixel with the "shaded" color
|
|
|
|
edi (all components of the color decrease twice)
|
|
|
|
* draw intermediate frame of width 3 pixels with color edi
|
|
|
|
* draw internal frame of width 1 pixel with the "shaded" color edi
|
2006-08-03 21:30:32 +02:00
|
|
|
* draw header - rectangle with the left upper corner (4,4)
|
2006-08-11 15:30:23 +02:00
|
|
|
and right lower (xsize-4,min(20,ysize)) color, indicated in esi
|
|
|
|
(taking a gradient into account)
|
|
|
|
* if ysize>=26, fill the working area of the window -
|
2006-08-03 21:30:32 +02:00
|
|
|
rectangle with the left upper corner (5,20) and right lower
|
2006-08-11 15:30:23 +02:00
|
|
|
(xsize-5,ysize-5) with color indicated in edx
|
|
|
|
(taking a gradient into account)
|
|
|
|
* if A=1 and caption has been already set by subfunction 1
|
|
|
|
of function 71, it is drawn in the corresponding place of header
|
|
|
|
* The skinned window looks as follows:
|
2006-08-03 21:30:32 +02:00
|
|
|
* draw external frame of width 1 pixel
|
2006-08-11 15:30:23 +02:00
|
|
|
with color 'outer' from the skin
|
|
|
|
* draw intermediate frame of width 3 pixel
|
|
|
|
with color 'frame' from the skin
|
|
|
|
* draw internal frame of width 1 pixel
|
|
|
|
with color 'inner' from the skin
|
|
|
|
* draw header (on bitmaps from the skin) in a rectangle
|
2006-08-03 21:30:32 +02:00
|
|
|
(0,0) - (xsize,_skinh-1)
|
2006-08-11 15:30:23 +02:00
|
|
|
* if ysize>=26, fill the working area of the window -
|
|
|
|
rectangle with the left upper corner (5,_skinh) and right lower
|
|
|
|
(xsize-5,ysize-5) with color indicated in edx
|
|
|
|
(taking a gradient into account)
|
2006-08-21 15:06:02 +02:00
|
|
|
* define two standard buttons: close and minimize
|
2006-08-03 21:30:32 +02:00
|
|
|
(see function 8)
|
2006-08-11 15:30:23 +02:00
|
|
|
* if A=1 and edi contains (nonzero) pointer to caption string,
|
|
|
|
it is drawn in place in header defined in the skin
|
|
|
|
* value _skinh is accessible as the result of call
|
|
|
|
subfunction 4 of function 48
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
================ Function 1 - put pixel in the window. ===============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 1 - function number
|
|
|
|
* ebx = x-coordinate (relative to the window)
|
|
|
|
* ecx = y-coordinate (relative to the window)
|
|
|
|
* edx = 0x00RRGGBB - color of a pixel
|
|
|
|
edx = 0x01xxxxxx - invert color of a pixel
|
|
|
|
(low 24 bits are ignored)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============ Function 2 - get the code of the pressed key. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Takes away the code of the pressed key from the buffer.
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 2 - function number
|
|
|
|
Returned value:
|
|
|
|
* if the buffer is empty, function returns eax=1
|
|
|
|
* if the buffer is not empty, function returns al=0,
|
|
|
|
ah=code of the pressed key, high word of eax is zero
|
|
|
|
* if there is "hotkey", function returns al=2,
|
|
|
|
ah=scancode of the pressed key (0 for control keys),
|
|
|
|
high word of eax contains a status of control keys at the moment
|
|
|
|
of pressing a hotkey
|
|
|
|
Remarks:
|
|
|
|
* There is a common system buffer of the pressed keys
|
|
|
|
by a size of 120 bytes, organized as queue.
|
|
|
|
* There is one more common system buffer on 120 "hotkeys".
|
|
|
|
* If the application with the inactive window calls this function,
|
|
|
|
the buffer of the pressed keys is considered to be empty.
|
|
|
|
* By default this function returns ASCII-codes; to switch
|
|
|
|
to the scancodes mode (and back) use function 66.
|
|
|
|
However, hotkeys are always notificated as scancodes.
|
|
|
|
* To find out, what keys correspond to what codes, start
|
|
|
|
the application keyascii and scancode.
|
|
|
|
* Scancodes come directly from keyboard and are fixed;
|
|
|
|
ASCII-codes turn out with usage of the conversion tables,
|
|
|
|
which can be set by subfunction 2 of function 21
|
|
|
|
and get by subfunction 2 of function 26.
|
|
|
|
* As a consequence, ASCII-codes take into account current
|
|
|
|
keyboard layout (rus/en) as opposed to scancodes.
|
|
|
|
* This function notifies only about those hotkeys, which were
|
|
|
|
defined by this thread by subfunction 4 of function 66.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
==================== Function 3 - get system time. ===================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 3 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
|
2006-08-11 15:30:23 +02:00
|
|
|
* each item is BCD-number, for example,
|
|
|
|
for time 23:59:59 function returns 0x00595923
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* See also subfunction 9 of function 26 - get time from
|
|
|
|
the moment of start of the system; it is more convenient, because
|
|
|
|
returns simply DWORD-value of the time counter.
|
|
|
|
* System time can be set by function 22.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============ Function 4 - draw text string in the window. ============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 4 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
2012-04-02 00:29:11 +02:00
|
|
|
* ecx = 0xXYRRGGBB, where
|
2006-08-11 15:30:23 +02:00
|
|
|
* RR, GG, BB specify text color
|
2006-08-28 15:34:54 +02:00
|
|
|
* X=ABnn (bits):
|
2012-04-02 00:29:11 +02:00
|
|
|
* nn specifies the used font: 0=system monospaced,
|
|
|
|
1=system font of variable width
|
|
|
|
* A=0 - output esi characters, A=1 - output ASCIIZ-string
|
|
|
|
* B=1 - fill background with the color edi
|
|
|
|
* Y = Cnnn
|
|
|
|
* C=1 redirect the output to the user area, specified in edi
|
2013-07-08 10:17:53 +02:00
|
|
|
* nnn - not used in the current, must be 0 (zero)
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = pointer to the beginning of the string
|
2006-08-28 15:34:54 +02:00
|
|
|
* esi = for A=0 length of the string, must not exceed 255;
|
|
|
|
for A=1 is ignored
|
2012-04-02 00:29:11 +02:00
|
|
|
* edi = color to fill background, if B=1
|
|
|
|
* edi = pointer to user area, for redirect, if C=1
|
2013-07-08 10:17:53 +02:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* First system font is read out at loading from the file char.mt,
|
|
|
|
second - from char2.mt.
|
|
|
|
* Both fonts have height 9 pixels, width of the monospaced font
|
|
|
|
is equal to 6 pixels.
|
2012-04-02 00:29:11 +02:00
|
|
|
* C=1, pixel depth = 32 bits, user area is as follows:
|
|
|
|
dword Xsize
|
|
|
|
dword Ysize
|
|
|
|
rest of the area = Xsize * Y size * 4
|
|
|
|
* You can not use B = 1 and C = 1, at the same time. Since in both
|
|
|
|
cases, the register edi is used for different purposes.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========================= Function 5 - delay. ========================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Delays execution of the program on the given time.
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 5 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = time in the 1/100 of second
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Passing ebx=0 does not transfer control to the next process
|
|
|
|
and does not make any operations at all. If it is really required
|
|
|
|
to transfer control to the next process (to complete a current
|
|
|
|
time slice), use subfunction 1 of function 68.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============== Function 6 - read the file from ramdisk. ==============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 6 - function number
|
|
|
|
* ebx = pointer to the filename
|
|
|
|
* ecx = number of start block, beginning from 1;
|
|
|
|
ecx=0 - read from the beginning of the file (same as ecx=1)
|
|
|
|
* edx = number of blocks to read;
|
|
|
|
edx=0 - read one block (same as edx=1)
|
|
|
|
* esi = pointer to memory area for the data
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = file size in bytes, if the file was successfully read
|
|
|
|
* eax = -1, if the file was not found
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* This function is out-of-date; function 70 allows
|
|
|
|
to fulfil the same operations with the extended possibilities.
|
2006-08-03 21:30:32 +02:00
|
|
|
* Block = 512 bytes.
|
2006-08-11 15:30:23 +02:00
|
|
|
* For reading all file you can specify the certainly large value
|
|
|
|
in edx, for example, edx = -1; but in this case be ready that
|
|
|
|
the program will "fall", if the file will appear too large and can
|
|
|
|
not be placed in the program memory.
|
|
|
|
* The filename must be either in the format 8+3 characters
|
|
|
|
(first 8 characters - name itself, last 3 - extension,
|
|
|
|
the short names and extensions are supplemented with spaces),
|
|
|
|
or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
|
|
|
|
(name no more than 8 characters, dot, extension 3 characters
|
|
|
|
supplemented if necessary by spaces).
|
|
|
|
The filename must be written with capital letters. The terminating
|
|
|
|
character with code 0 is not necessary (not ASCIIZ-string).
|
|
|
|
* This function does not support folders on the ramdisk.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=============== Function 7 - draw image in the window. ===============
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
Paramters:
|
|
|
|
* eax = 7 - function number
|
|
|
|
* ebx = pointer to the image in the format BBGGRRBBGGRR...
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = [size on axis x]*65536 + [size on axis y]
|
|
|
|
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Coordinates of the image are coordinates of the upper left corner
|
|
|
|
of the image relative to the window.
|
2006-08-03 21:30:32 +02:00
|
|
|
* Size of the image in bytes is 3*xsize*ysize.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=============== Function 8 - define/delete the button. ===============
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
Parameters for button definition:
|
|
|
|
* eax = 8 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = [coordinate on axis x]*65536 + [size on axis x]
|
|
|
|
* ecx = [coordinate on axis y]*65536 + [size on axis y]
|
|
|
|
* edx = 0xXYnnnnnn, where:
|
|
|
|
* nnnnnn = identifier of the button
|
2006-08-11 15:30:23 +02:00
|
|
|
* high (31st) bit of edx is cleared
|
|
|
|
* if 30th bit of edx is set - do not draw the button
|
|
|
|
* if 29th bit of edx is set - do not draw a frame
|
2006-08-03 21:30:32 +02:00
|
|
|
at pressing the button
|
2006-08-11 15:30:23 +02:00
|
|
|
* esi = 0x00RRGGBB - color of the button
|
|
|
|
Parameters for button deleting:
|
|
|
|
* eax = 8 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* edx = 0x80nnnnnn, where nnnnnn - identifier of the button
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Sizes of the button must be more than 0 and less than 0x8000.
|
2006-08-18 15:32:18 +02:00
|
|
|
* For skinned windows definition of the window
|
2006-08-11 15:30:23 +02:00
|
|
|
(call of 0th function) creates two standard buttons -
|
|
|
|
for close of the window with identifier 1 and
|
|
|
|
for minimize of the window with identifier 0xffff.
|
|
|
|
* The creation of two buttons with same identifiers is admitted.
|
|
|
|
* The button with the identifier 0xffff at pressing is interpreted
|
|
|
|
by the system as the button of minimization, the system handles
|
|
|
|
such pressing independently, not accessing to the application.
|
|
|
|
In rest it is usual button.
|
|
|
|
* Total number of buttons for all applications is limited to 4095.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============ Function 9 - information on execution thread. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 9 - function number
|
|
|
|
* ebx = pointer to 1-Kb buffer
|
|
|
|
* ecx = number of the slot of the thread
|
|
|
|
ecx = -1 - get information on the current thread
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = maximum number of the slot of a thread
|
|
|
|
* buffer pointed to by ebx contains the following information:
|
|
|
|
* +0: dword: usage of the processor (how many time units
|
|
|
|
per second leaves on execution of this thread)
|
2006-08-03 21:30:32 +02:00
|
|
|
* +4: word: position of the window of thread in the window stack
|
2006-08-11 15:30:23 +02:00
|
|
|
* +6: word: (has no relation to the specified thread)
|
|
|
|
number of the thread slot, which window has in the window stack
|
|
|
|
position ecx
|
2006-08-03 21:30:32 +02:00
|
|
|
* +8: word: reserved
|
|
|
|
* +10 = +0xA: 11 bytes: name of the process
|
2012-04-18 00:17:20 +02:00
|
|
|
(name of the started file - executable file without extension)
|
2006-08-29 14:52:52 +02:00
|
|
|
* +21 = +0x15: byte: reserved, this byte is not changed
|
2006-08-03 21:30:32 +02:00
|
|
|
* +22 = +0x16: dword: address of the process in memory
|
|
|
|
* +26 = +0x1A: dword: size of used memory - 1
|
|
|
|
* +30 = +0x1E: dword: identifier (PID/TID)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +34 = +0x22: dword: coordinate of the thread window on axis x
|
|
|
|
* +38 = +0x26: dword: coordinate of the thread window on axis y
|
|
|
|
* +42 = +0x2A: dword: size of the thread window on axis x
|
|
|
|
* +46 = +0x2E: dword: size of the thread window on axis y
|
|
|
|
* +50 = +0x32: word: status of the thread slot:
|
|
|
|
* 0 = thread is running
|
|
|
|
* 1 = thread is suspended
|
|
|
|
* 2 = thread is suspended while waiting for event
|
|
|
|
* 3 = thread is terminating as a result of call to function -1
|
|
|
|
or under duress as a result of call to subfunction 2
|
|
|
|
of function 18 or termination of the system
|
|
|
|
* 4 = thread is terminating as a result of exception
|
|
|
|
* 5 = thread waits for event
|
|
|
|
* 9 = requested slot is free, all other information on the slot
|
|
|
|
is not meaningful
|
2006-08-29 14:52:52 +02:00
|
|
|
* +52 = +0x34: word: reserved, this word is not changed
|
|
|
|
* +54 = +0x36: dword: coordinate of the client area on axis x
|
|
|
|
* +58 = +0x3A: dword: coordinate of the client area on axis y
|
|
|
|
* +62 = +0x3E: dword: width of the client area
|
|
|
|
* +66 = +0x42: dword: height of the client area
|
|
|
|
* +70 = +0x46: byte: state of the window - bitfield
|
|
|
|
* bit 0 (mask 1): window is maximized
|
|
|
|
* bit 1 (mask 2): window is minimized to panel
|
|
|
|
* bit 2 (mask 4): window is rolled up
|
2010-10-17 18:22:47 +02:00
|
|
|
* +71 = +0x47: dword: event mask
|
2006-08-11 15:30:23 +02:00
|
|
|
Remarks:
|
|
|
|
* Slots are numbered starting from 1.
|
|
|
|
* Returned value is not a total number of threads, because there
|
|
|
|
can be free slots.
|
|
|
|
* When process is starting, system automatically creates
|
|
|
|
execution thread.
|
|
|
|
* Function gives information on the thread. Each process has
|
|
|
|
at least one thread. One process can create many threads,
|
|
|
|
in this case each thread has its own slot and the fields
|
|
|
|
+10, +22, +26 in these slots coincide.
|
|
|
|
Applications have no common way to define whether two threads
|
2006-08-03 21:30:32 +02:00
|
|
|
belong to one process.
|
2006-08-11 15:30:23 +02:00
|
|
|
* The active window - window on top of the window stack -
|
|
|
|
receives the messages on a keyboard input. For such window
|
|
|
|
the position in the window stack coincides with returned value.
|
|
|
|
* Slot 1 corresponds to special system thread, for which:
|
|
|
|
* the window is in the bottom of the window stack, the fields
|
|
|
|
+4 and +6 contain value 1
|
|
|
|
* name of the process - "OS/IDLE" (supplemented by spaces)
|
|
|
|
* address of the process in memory is 0, size of used memory is
|
2006-08-03 21:30:32 +02:00
|
|
|
16 Mb (0x1000000)
|
|
|
|
* PID=1
|
2006-08-29 14:52:52 +02:00
|
|
|
* coordinates and sizes of the window and the client area are by
|
|
|
|
convention set to 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* status of the slot is always 0 (running)
|
|
|
|
* the execution time adds of time leaving on operations itself
|
|
|
|
and idle time in waiting for interrupt (which can be got by call
|
|
|
|
to subfunction 4 of function 18).
|
|
|
|
* Beginning from slot 2, the normal applications are placed.
|
2010-10-17 10:53:29 +02:00
|
|
|
* The normal applications are placed in memory at the address
|
|
|
|
0 (kernel constant 'std_application_base_address').
|
2006-08-11 15:30:23 +02:00
|
|
|
There is no intersection, as each process has its own page table.
|
|
|
|
* At creation of the thread it is assigned the slot
|
|
|
|
in the system table and identifier (Process/Thread IDentifier =
|
|
|
|
PID/TID), which do not vary with time for given thread.
|
|
|
|
After completion of the thread its slot can be anew used
|
|
|
|
for another thread. The thread identifier can not be assigned
|
|
|
|
to other thread even after completion of this thread.
|
|
|
|
Identifiers, assigned to new threads, grow monotonously.
|
|
|
|
* If the thread has not yet defined the window by call to
|
|
|
|
function 0, the position and the sizes
|
|
|
|
of its window are considered to be zero.
|
2006-08-29 14:52:52 +02:00
|
|
|
* Coordinates of the client area are relative to the window.
|
2006-08-11 15:30:23 +02:00
|
|
|
* At the moment only the part of the buffer by a size
|
2006-08-29 14:52:52 +02:00
|
|
|
71 = 0x37 bytes is used. Nevertheless it is recommended to use
|
2006-08-11 15:30:23 +02:00
|
|
|
1-Kb buffer for the future compatibility, in the future
|
|
|
|
some fields can be added.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
==================== Function 10 - wait for event. ===================
|
|
|
|
======================================================================
|
|
|
|
If the message queue is empty, waits for appearance of the message
|
|
|
|
in queue. In this state thread does not consume CPU time.
|
2006-08-03 21:30:32 +02:00
|
|
|
Then reads out the message from queue.
|
|
|
|
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 10 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = event (see the list of events)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Those events are taken into account only which enter into
|
|
|
|
a mask set by function 40. By default it is
|
|
|
|
redraw, key and button events.
|
|
|
|
* To check, whether there is a message in queue, use function 11.
|
|
|
|
To wait for no more than given time, use function 23.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
=============== Function 11 - check for event, no wait. ==============
|
|
|
|
======================================================================
|
|
|
|
If the message queue contains event, function reads out
|
|
|
|
and return it. If the queue is empty, function returns 0.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 11 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0 - message queue is empty
|
2006-08-11 15:30:23 +02:00
|
|
|
* else eax = event (see the list of events)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Those events are taken into account only, which enter into
|
|
|
|
a mask set by function 40. By default it is
|
|
|
|
redraw, key and button events.
|
|
|
|
* To wait for event, use function 10.
|
|
|
|
To wait for no more than given time, use function 23.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=============== Function 12 - begin/end window redraw. ===============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
|
2006-08-28 15:34:54 +02:00
|
|
|
---------------- Subfunction 1 - begin window redraw. ----------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 12 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
2006-08-28 15:34:54 +02:00
|
|
|
----------------- Subfunction 2 - end window redraw. -----------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 12 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Subfunction 1 deletes all buttons defined with
|
|
|
|
function 8, they must be defined again.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============ Function 13 - draw a rectangle in the window. ===========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 13 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = [coordinate on axis x]*65536 + [size on axis x]
|
|
|
|
* ecx = [coordinate on axis y]*65536 + [size on axis y]
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* Coordinates are understood as coordinates of the left upper corner
|
2006-08-11 15:30:23 +02:00
|
|
|
of a rectangle relative to the window.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=================== Function 14 - get screen size. ===================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 14 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = [xsize]*65536 + [ysize], where
|
|
|
|
* xsize = x-coordinate of the right lower corner of the screen =
|
2006-08-11 15:30:23 +02:00
|
|
|
horizontal size - 1
|
2006-08-03 21:30:32 +02:00
|
|
|
* ysize = y-coordinate of the right lower corner of the screen =
|
2006-08-11 15:30:23 +02:00
|
|
|
vertical size - 1
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* See also subfunction 5 of function 48 - get sizes of
|
|
|
|
working area of the screen.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
== Function 15, subfunction 1 - set a size of the background image. ==
|
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = width of the image
|
|
|
|
* edx = height of the image
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2007-05-16 15:59:46 +02:00
|
|
|
* Before calling subfunctions 2 and 5 you should call this function
|
2007-05-10 15:48:35 +02:00
|
|
|
to set image size!
|
2006-08-11 15:30:23 +02:00
|
|
|
* For update of the screen (after completion of a series of commands
|
|
|
|
working with a background) call subfunction 3.
|
|
|
|
* There is a pair function for get size of the background image -
|
|
|
|
subfunction 1 of function 39.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=== Function 15, subfunction 2 - put pixel on the background image. ==
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = offset
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = color of a pixel 0xRRGGBB
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Offset for a pixel with coordinates (x,y) is calculated as
|
2006-08-03 21:30:32 +02:00
|
|
|
(x+y*xsize)*3.
|
2007-05-16 15:59:46 +02:00
|
|
|
* If the given offset exceeds size set by subfunction 1,
|
2006-08-11 15:30:23 +02:00
|
|
|
the call is ignored.
|
|
|
|
* For update of the screen (after completion of a series of commands
|
|
|
|
working with a background) call subfunction 3.
|
|
|
|
* There is a pair function for get pixel on the background image -
|
|
|
|
subfunction 2 of function 39.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=========== Function 15, subfunction 3 - redraw background. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
== Function 15, subfunction 4 - set drawing mode for the background. =
|
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
|
|
|
* ecx = drawing mode:
|
2006-08-03 21:30:32 +02:00
|
|
|
* 1 = tile
|
|
|
|
* 2 = stretch
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* For update of the screen (after completion of a series of commands
|
|
|
|
working with a background) call subfunction 3.
|
|
|
|
* There is a pair function for get drawing mode of the background -
|
|
|
|
subfunction 4 of function 39.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
===================== Function 15, subfunction 5 =====================
|
|
|
|
============ Put block of pixels on the background image. ============
|
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
|
|
|
* ecx = pointer to the data in the format BBGGRRBBGGRR...
|
2006-08-03 21:30:32 +02:00
|
|
|
* edx = offset in data of the background image
|
2006-08-11 15:30:23 +02:00
|
|
|
* esi = size of data in bytes = 3 * number of pixels
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2007-05-16 15:59:46 +02:00
|
|
|
* Offset and size are not checked for correctness.
|
2006-08-11 15:30:23 +02:00
|
|
|
* Color of each pixel is stored as 3-bytes value BBGGRR.
|
|
|
|
* Pixels of the background image are written sequentially
|
|
|
|
from left to right, from up to down.
|
|
|
|
* Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
|
|
|
|
* For update of the screen (after completion of a series of commands
|
|
|
|
working with a background) call subfunction 3.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-06-18 18:39:42 +02:00
|
|
|
======================================================================
|
|
|
|
===================== Function 15, subfunction 6 =====================
|
|
|
|
======== Map background data to the address space of process. ========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 6 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* eax = pointer to background data, 0 if error
|
|
|
|
Remarks:
|
|
|
|
* Mapped data are available for read and write.
|
|
|
|
* Size of background data is 3*xsize*ysize. The system blocks
|
|
|
|
changes of background sizes while process works with mapped data.
|
|
|
|
* Color of each pixel is stored as 3-bytes value BBGGRR.
|
|
|
|
* Pixels of the background image are written sequentially
|
|
|
|
from left to right, from up to down.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
===== Function 15, subfunction 7 - close mapped background data. =====
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
|
|
|
* ecx = pointer to mapped data
|
|
|
|
Returned value:
|
|
|
|
* eax = 1 - success, 0 - error
|
|
|
|
|
2012-03-28 18:32:08 +02:00
|
|
|
======================================================================
|
|
|
|
===================== Function 15, subfunction 8 =====================
|
|
|
|
============= Get coordinates of last draw the background ============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* eax = [left]*65536 + [right]
|
|
|
|
* ebx = [top]*65536 + [bottom]
|
|
|
|
Remarks:
|
|
|
|
* (left,top) are coordinates of the left upper corner,
|
|
|
|
(right,bottom) are coordinates of the right lower one.
|
|
|
|
* For receiving more reliable information, call the function
|
|
|
|
immediately after the event:
|
|
|
|
5 = kernel finished redrawing of the desktop background
|
|
|
|
|
2012-04-03 00:30:24 +02:00
|
|
|
======================================================================
|
|
|
|
===================== Function 15, subfunction 9 =====================
|
|
|
|
============= Redraws a rectangular part of the background ===========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 15 - function number
|
|
|
|
* ebx = 9 - subfunction number
|
|
|
|
* ecx = [left]*65536 + [right]
|
|
|
|
* edx = [top]*65536 + [bottom]
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* (left,top) are coordinates of the left upper corner,
|
|
|
|
(right,bottom) are coordinates of the right lower one.
|
|
|
|
* If parameters are set incorrectly then background is not redrawn.
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=============== Function 16 - save ramdisk on a floppy. ==============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 16 - function number
|
|
|
|
* ebx = 1 or ebx = 2 - on which floppy save
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 1 - error
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======= Function 17 - get the identifier of the pressed button. ======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Takes away the code of the pressed button from the buffer.
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 17 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* if the buffer is empty, function returns eax=1
|
2009-01-31 07:09:36 +01:00
|
|
|
* if the buffer is not empty:
|
|
|
|
* high 24 bits of eax contain button identifier (in particular,
|
|
|
|
ah contains low byte of the identifier; if all buttons have
|
|
|
|
the identifier less than 256, ah is enough to distinguish)
|
|
|
|
* al = 0 - the button was pressed with left mouse button
|
|
|
|
* al = bit corresponding to used mouse button otherwise
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* "Buffer" keeps only one button, at pressing the new button the
|
|
|
|
information about old is lost.
|
|
|
|
* The call of this function by an application with inactive window
|
|
|
|
will return answer "buffer is empty".
|
2009-01-31 07:09:36 +01:00
|
|
|
* Returned value for al corresponds to the state of mouse buttons
|
|
|
|
as in subfunction 2 of function 37 at the beginning
|
|
|
|
of button press, excluding lower bit, which is cleared.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2011-09-27 09:08:12 +02:00
|
|
|
======================================================================
|
|
|
|
===================== Function 18, subfunction 1 =====================
|
|
|
|
============= Make deactive the window of the given thread. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* ecx = number of the thread slot
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2012-02-26 05:22:47 +01:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
= Function 18, subfunction 2 - terminate process/thread by the slot. =
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = number of the slot of process/thread
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* It is impossible to terminate system thread OS/IDLE (with
|
|
|
|
number of the slot 1),
|
|
|
|
it is possible to terminate any normal process/thread.
|
|
|
|
* See also subfunction 18 - terminate
|
|
|
|
process/thread by the identifier.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
===================== Function 18, subfunction 3 =====================
|
|
|
|
============= Make active the window of the given thread. ============
|
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
|
|
|
* ecx = number of the thread slot
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If correct, but nonexistent slot is given,
|
|
|
|
some window is made active.
|
|
|
|
* To find out, which window is active, use subfunction 7.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
===================== Function 18, subfunction 4 =====================
|
|
|
|
=========== Get counter of idle time units per one second. ===========
|
|
|
|
======================================================================
|
|
|
|
Idle time units are units, in which the processor stands idle
|
|
|
|
in waiting for interrupt (in the command 'hlt').
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = value of the counter of idle time units per one second
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 18, subfunction 5 - get CPU clock rate. ==========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = clock rate (modulo 2^32 clock ticks = 4GHz)
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
2012-02-26 05:22:47 +01:00
|
|
|
Function 18, subfunction 6 - save ramdisk to the file on hard drive.
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 6 - subfunction number
|
2007-02-12 06:14:58 +01:00
|
|
|
* ecx = pointer to the full path to file
|
|
|
|
(for example, "/hd0/1/kolibri/kolibri.img")
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* else eax = error code of the file system
|
2007-05-16 15:59:46 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* All folders in the given path must exist, otherwise function
|
|
|
|
returns value 5, "file not found".
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 18, subfunction 7 - get active window. ==========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = number of the active window
|
|
|
|
(number of the slot of the thread with active window)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Active window is at the top of the window stack and receives
|
|
|
|
messages on all keyboard input.
|
|
|
|
* To make a window active, use subfunction 3.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
== Function 18, subfunction 8 - disable/enable the internal speaker. =
|
|
|
|
======================================================================
|
|
|
|
If speaker sound is disabled, all calls to subfunction 55 of
|
|
|
|
function 55 are ignored. If speaker sound is enabled,
|
|
|
|
they are routed on builtin speaker.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
------------------- Subsubfunction 1 - get status. -------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
|
|
|
* ecx = 1 - number of the subsubfunction
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - speaker sound is enabled; 1 - disabled
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
----------------- Subsubfunction 2 - toggle status. ------------------
|
|
|
|
Toggles states of disable/enable.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
|
|
|
* ecx = 2 - number of the subsubfunction
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
2009-01-31 07:09:36 +01:00
|
|
|
== Function 18, subfunction 9 - system shutdown with the parameter. ==
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 9 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = parameter:
|
2006-08-11 15:30:23 +02:00
|
|
|
* 2 = turn off computer
|
|
|
|
* 3 = reboot computer
|
|
|
|
* 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
|
|
|
|
Returned value:
|
|
|
|
* at incorrect ecx the registers do not change (i.e. eax=18)
|
|
|
|
* by correct call function always returns eax=0
|
|
|
|
as the tag of success
|
|
|
|
Remarks:
|
|
|
|
* Do not rely on returned value by incorrect call, it can be
|
|
|
|
changed in future versions of the kernel.
|
2009-01-31 07:09:36 +01:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
===== Function 18, subfunction 10 - minimize application window. =====
|
|
|
|
======================================================================
|
|
|
|
Minimizes the own window.
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 10 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The minimized window from the point of view of function 9
|
|
|
|
keeps position and sizes.
|
2012-02-26 05:22:47 +01:00
|
|
|
* Restoring of an application window occurs at its activation by
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 3.
|
|
|
|
* Usually there is no necessity to minimize/restire a window
|
|
|
|
obviously: minimization of a window is carried out by the system
|
|
|
|
at pressing the minimization button (for skinned windows
|
|
|
|
it is defined automatically by function 0,
|
|
|
|
for other windows it can be defined manually by function 8),
|
|
|
|
restore of a window is done by the application '@panel'.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2012-02-26 05:22:47 +01:00
|
|
|
Function 18, subfunction 11 - get information on the disk subsystem.
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 11 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = type of the table:
|
|
|
|
* 1 = short version, 10 bytes
|
|
|
|
* 2 = full version, 65536 bytes
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = pointer to the buffer (in the application) for the table
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2006-08-11 15:30:23 +02:00
|
|
|
Format of the table: short version:
|
|
|
|
* +0: byte: information about FDD's (drives for floppies),
|
|
|
|
AAAABBBB, where AAAA gives type of the first drive, BBBB -
|
|
|
|
of the second regarding to the following list:
|
2006-08-03 21:30:32 +02:00
|
|
|
* 0 = there is no drive
|
|
|
|
* 1 = 360Kb, 5.25''
|
|
|
|
* 2 = 1.2Mb, 5.25''
|
|
|
|
* 3 = 720Kb, 3.5''
|
|
|
|
* 4 = 1.44Mb, 3.5''
|
2006-08-11 15:30:23 +02:00
|
|
|
* 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
|
|
|
|
For example, for the standard configuration from one 1.44-drive
|
|
|
|
here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
|
|
|
|
the value is 24h.
|
|
|
|
* +1: byte: information about hard disks and CD-drives, AABBCCDD,
|
2006-08-03 21:30:32 +02:00
|
|
|
where AA corresponds to the controller IDE0, ..., DD - IDE3:
|
|
|
|
* 0 = device is absent
|
2006-08-11 15:30:23 +02:00
|
|
|
* 1 = hard drive
|
|
|
|
* 2 = CD-drive
|
|
|
|
For example, in the case HD on IDE0 and CD on IDE2
|
|
|
|
this field contains 48h.
|
|
|
|
* +2: 4 db: number of the retrieved partitions on hard disks
|
|
|
|
at accordingly IDE0,...,IDE3.
|
|
|
|
If the hard disk on IDEx is absent, appropriate byte is zero,
|
|
|
|
otherwise it shows number of the recognized partitions, which
|
|
|
|
can be not presented (if the drive is not formatted or if
|
|
|
|
the file system is not supported). Current version of the kernel
|
2007-01-17 15:43:18 +01:00
|
|
|
supports only FAT16, FAT32 and NTFS for hard disks.
|
2006-08-03 21:30:32 +02:00
|
|
|
* +6: 4 db: reserved
|
2006-08-11 15:30:23 +02:00
|
|
|
Format of the table: full version:
|
|
|
|
* +0: 10 db: same as for the short version
|
2006-08-03 21:30:32 +02:00
|
|
|
* +10: 100 db: data for the first partition
|
|
|
|
* +110: 100 db: data for the second partition
|
|
|
|
* ...
|
|
|
|
* +10+100*(n-1): 100 db: data for the last partition
|
2006-08-11 15:30:23 +02:00
|
|
|
The partitions are located as follows: at first sequentially all
|
|
|
|
recoginzed partitions on HD on IDE0 (if present),
|
|
|
|
then on HD on IDE1 (if present) and so on up to IDE3.
|
|
|
|
Format of the information about partition
|
|
|
|
(at moment only FAT is supported):
|
2006-08-03 21:30:32 +02:00
|
|
|
* +0: dword: first physical sector of the partition
|
|
|
|
* +4: dword: last physical sector of the partition
|
2006-08-11 15:30:23 +02:00
|
|
|
(belongs to the partition)
|
2007-01-17 15:43:18 +01:00
|
|
|
* +8: byte: file system type:
|
|
|
|
16=FAT16, 32=FAT32, 1=NTFS
|
|
|
|
* other data are dependent on file system, are modified with
|
|
|
|
kernel modifications and therefore are not described
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The short table can be used for obtaining the information about
|
|
|
|
available devices.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 18, subfunction 13 - get kernel version. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 13 - subfunction number
|
|
|
|
* ecx = pointer to the buffer (not less than 16 bytes), where
|
|
|
|
the information will be placed
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Structure of the buffer:
|
|
|
|
db a,b,c,d for version a.b.c.d
|
2010-10-24 18:06:14 +02:00
|
|
|
db 0: reserved
|
2007-06-11 17:42:19 +02:00
|
|
|
dd REV - kernel SVN revision number
|
2010-10-24 18:06:14 +02:00
|
|
|
For Kolibri 0.7.7.0+ kernel:
|
2010-10-17 10:53:29 +02:00
|
|
|
db 0,7,7,0
|
2010-10-24 18:06:14 +02:00
|
|
|
db 0
|
2010-10-24 18:08:19 +02:00
|
|
|
dd 1675
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
======= Function 18, subfunction 14 - wait for screen retrace. =======
|
|
|
|
======================================================================
|
|
|
|
Waits for the beginning of retrace of the scanning ray of the screen
|
|
|
|
monitor.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 14 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 as the tag of success
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Function is intended only for active high-efficiency graphics
|
2006-08-03 21:30:32 +02:00
|
|
|
applications; is used for smooth output of a graphics.
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
|
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 15 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 as the tag of success
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 18, subfunction 16 - get size of free RAM. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 16 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = size of free memory in kilobytes
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======== Function 18, subfunction 17 - get full amount of RAM. =======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 17 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = total size of existing memory in kilobytes
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===================== Function 18, subfunction 18 ====================
|
|
|
|
============= Terminate process/thread by the identifier. ============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 18 - subfunction number
|
|
|
|
* ecx = identifer of process/thread (PID/TID)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = -1 - error (process is not found or is system)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* It is impossible to terminate system thread OS/IDLE (identifier
|
|
|
|
1), it is possible to terminate any normal process/thread.
|
|
|
|
* See also subfunction 2 - terminate
|
|
|
|
process/thread by given slot.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-13 15:02:57 +02:00
|
|
|
======================================================================
|
2006-08-18 15:32:18 +02:00
|
|
|
======== Function 18, subfunction 19 - get/set mouse features. =======
|
2006-08-13 15:02:57 +02:00
|
|
|
======================================================================
|
2006-08-18 15:32:18 +02:00
|
|
|
|
|
|
|
---------------- Subsubfunction 0 - get mouse speed. -----------------
|
2006-08-13 15:02:57 +02:00
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 19 - subfunction number
|
2006-08-18 15:32:18 +02:00
|
|
|
* ecx = 0 - subsubfunction number
|
|
|
|
Returned value:
|
|
|
|
* eax = current mouse speed
|
2006-08-13 15:02:57 +02:00
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
---------------- Subsubfunction 1 - set mouse speed. -----------------
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 19 - subfunction number
|
|
|
|
* ecx = 1 - subsubfunction number
|
|
|
|
* edx = new value for speed
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2006-08-13 15:02:57 +02:00
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
---------------- Subsubfunction 2 - get mouse delay. -----------------
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 19 - subfunction number
|
|
|
|
* ecx = 2 - subsubfunction number
|
|
|
|
Returned value:
|
|
|
|
* eax = current mouse delay
|
2006-08-13 15:02:57 +02:00
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
---------------- Subsubfunction 3 - set mouse delay. -----------------
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 19 - subfunction number
|
|
|
|
* ecx = 3 - subsubfunction number
|
|
|
|
* edx = new value for mouse delay
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2006-08-13 15:02:57 +02:00
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
----------- Subsubfunction 4 - set mouse pointer position. -----------
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 19 - subfunction number
|
|
|
|
* ecx = 4 - subsubfunction number
|
|
|
|
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2007-09-05 23:30:16 +02:00
|
|
|
|
2007-09-23 22:58:50 +02:00
|
|
|
-------- Subsubfunction 5 - simulate state of mouse buttons. ---------
|
2007-09-05 23:30:16 +02:00
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 19 - subfunction number
|
|
|
|
* ecx = 5 - subsubfunction number
|
2007-09-23 22:58:50 +02:00
|
|
|
* edx = information about emulated state of mouse buttons:
|
|
|
|
(same as return value in subfunction 2 of function 37)
|
2007-09-05 23:30:16 +02:00
|
|
|
* bit 0 is set = left button is pressed
|
|
|
|
* bit 1 is set = right button is pressed
|
|
|
|
* bit 2 is set = middle button is pressed
|
|
|
|
* bit 3 is set = 4th button is pressed
|
|
|
|
* bit 4 is set = 5th button is pressed
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2006-08-13 15:02:57 +02:00
|
|
|
Remarks:
|
2006-08-18 15:32:18 +02:00
|
|
|
* It is recommended to set speed of the mouse (in subsubfunction 1)
|
|
|
|
from 1 up to 9. The installed value is not inspected by the kernel
|
|
|
|
code, so set it carefully, at incorrect value the cursor
|
|
|
|
can "freeze". Speed of the mouse can be regulated through the
|
|
|
|
application SETUP.
|
|
|
|
* Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
|
|
|
|
value is not handled by COM mice. At the very large values the
|
|
|
|
movement of the mouse on 1 pixel is impossible and the cursor will
|
|
|
|
jump on the value of installed speed (subsubfunction 1). The
|
|
|
|
installed value is not inspected by the kernel code.
|
2006-08-21 15:06:02 +02:00
|
|
|
Mouse delay can be regulated through the application SETUP.
|
2006-08-18 15:32:18 +02:00
|
|
|
* The subsubfunction 4 does not check the passed value. Before
|
|
|
|
its call find out current screen resolution (with function 14)
|
|
|
|
and check that the value of position is inside the limits of the
|
|
|
|
screen.
|
2006-08-13 15:02:57 +02:00
|
|
|
|
2006-10-24 16:39:29 +02:00
|
|
|
======================================================================
|
|
|
|
======== Function 18, subfunction 20 - get information on RAM. =======
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 20 - subfunction number
|
|
|
|
* ecx = pointer to the buffer for information (36 bytes)
|
|
|
|
Returned value:
|
|
|
|
* eax = total size of existing RAM in pages
|
|
|
|
or -1 if error has occured
|
|
|
|
* buffer pointed to by ecx contains the following information:
|
|
|
|
* +0: dword: total size of existing RAM in pages
|
|
|
|
* +4: dword: size of free RAM in pages
|
|
|
|
* +8: dword: number of page faults (exceptions #PF)
|
|
|
|
in applications
|
|
|
|
* +12: dword: size of kernel heap in bytes
|
|
|
|
* +16: dword: free in kernel heap in bytes
|
|
|
|
* +20: dword: total number of memory blocks in kernel heap
|
|
|
|
* +24: dword: number of free memory blocks in kernel heap
|
|
|
|
* +28: dword: size of maximum free block in kernel heap
|
|
|
|
(reserved)
|
|
|
|
* +32: dword: size of maximum allocated block in kernel heap
|
|
|
|
(reserved)
|
|
|
|
|
2007-08-23 00:34:57 +02:00
|
|
|
======================================================================
|
2007-09-23 22:58:50 +02:00
|
|
|
===================== Function 18, subfunction 21 ====================
|
|
|
|
======== Get slot number of process/thread by the identifier. ========
|
2007-08-23 00:34:57 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 21 - subfunction number
|
2007-09-23 22:58:50 +02:00
|
|
|
* ecx = identifer of process/thread (PID/TID)
|
2007-08-23 00:34:57 +02:00
|
|
|
Returned value:
|
2007-09-23 22:58:50 +02:00
|
|
|
* eax = 0 - error (invalid identifier)
|
|
|
|
* otherwise eax = slot number
|
2007-08-23 00:34:57 +02:00
|
|
|
|
|
|
|
======================================================================
|
2007-09-23 22:58:50 +02:00
|
|
|
===================== Function 18, subfunction 22 ====================
|
|
|
|
============== Operations with window of another thread. =============
|
2007-08-23 00:34:57 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 22 - subfunction number
|
2007-09-23 22:58:50 +02:00
|
|
|
* ecx = operation type:
|
|
|
|
* 0 = minimize window of the thread with given slot number
|
|
|
|
* 1 = minimize window of the thread with given identifier
|
|
|
|
* 2 = restore window of the thread with given slot number
|
|
|
|
* 3 = restore window of the thread with given identifier
|
|
|
|
* edx = parameter (slot number or PID/TID)
|
2007-08-23 00:34:57 +02:00
|
|
|
Returned value:
|
2007-09-23 22:58:50 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = -1 - error (invalid identifier)
|
|
|
|
Remarks:
|
|
|
|
* The thread can minimize its window with subfunction 10.
|
|
|
|
* One can restore and activate window simultaneously with
|
|
|
|
subfunction 3 (which requires slot number).
|
2007-08-23 00:34:57 +02:00
|
|
|
|
2012-04-26 16:21:46 +02:00
|
|
|
======================================================================
|
|
|
|
======== Function 18, subfunction 23 - minimize all windows. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 23 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - all windows have been minimized before a function call
|
|
|
|
* eax = N - number of windows minimized from function
|
|
|
|
Remarks:
|
|
|
|
* Window of special thread (name begin to symbol @) is not minimize.
|
2012-05-01 00:07:24 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
======= Function 18, subfunction 24 - set limits of screen. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 18 - function number
|
|
|
|
* ebx = 24 - subfunction number
|
|
|
|
* ecx = new X size
|
|
|
|
* edx = new Y size
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* The function does not change the physical size of the video mode.
|
|
|
|
It is designed for non-standard displays which display the image
|
|
|
|
partially.
|
|
|
|
* The sizes specified in the function should not exceed the sizes
|
|
|
|
of the current video mode, otherwise the function will not change
|
|
|
|
anything.
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
==================== Function 20 - MIDI interface. ===================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
----------------------- Subfunction 1 - reset ------------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 20 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
-------------------- Subfunction 2 - output byte ---------------------
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 20 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* cl = byte for output
|
2006-08-11 15:30:23 +02:00
|
|
|
Returned value (is the same for both subfunctions):
|
|
|
|
* eax = 0 - success
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 1 - base port is not defined
|
|
|
|
Remarks:
|
2012-02-26 05:22:47 +01:00
|
|
|
* Previously the base port must be defined by
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 1 of function 21.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* ecx = number of base port
|
|
|
|
Returned value
|
|
|
|
* eax = 0 - success
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = -1 - erratic number of a port
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
|
|
|
|
* The installation of base is necessary for function 20.
|
|
|
|
* To get base port use subfunction 1 of function 26.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 21, subfunction 2 - set keyboard layout. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
|
|
|
|
which will be read by function 2.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
|
|
|
* ecx = which layout to set:
|
2006-08-03 21:30:32 +02:00
|
|
|
* 1 = normal layout
|
|
|
|
* 2 = layout at pressed Shift
|
|
|
|
* 3 = layout at pressed Alt
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = pointer to layout - table of length 128 bytes
|
2006-08-03 21:30:32 +02:00
|
|
|
Or:
|
|
|
|
* ecx = 9
|
2006-08-11 15:30:23 +02:00
|
|
|
* dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - incorrect parameter
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If Alt is pressed, the layout with Alt is used;
|
|
|
|
if Alt is not pressed, but Shift is pressed,
|
|
|
|
the layout with Shift is used;
|
|
|
|
if Alt and Shift are not pressed, but Ctrl is pressed, the normal
|
|
|
|
layout is used and then from the code is subtracted 0x60;
|
|
|
|
if no control key is pressed, the normal layout is used.
|
2012-02-26 05:22:47 +01:00
|
|
|
* To get layout and country identifier use
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 2 of function 26.
|
|
|
|
* Country identifier is global system variable, which is not used
|
|
|
|
by the kernel itself; however the application '@panel' displays
|
|
|
|
the corresponding icon.
|
|
|
|
* The application @panel switches layouts on user request.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============== Function 21, subfunction 3 - set CD base. =============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
|
|
|
* ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* CD base is used by function 24.
|
|
|
|
* To get CD base use subfunction 3 of function 26.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 21, subfunction 5 - set system language. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
|
|
|
* ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* System language is global system variable and is not used
|
|
|
|
by the kernel itself, however application @panel draws the
|
|
|
|
appropriate icon.
|
|
|
|
* Function does not check for correctness, as the kernel does not
|
|
|
|
use this variable.
|
|
|
|
* To get system language use subfunction 5 of function 26.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============== Function 21, subfunction 7 - set HD base. =============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
The HD base defines hard disk to write with usage of obsolete
|
2007-02-14 17:01:07 +01:00
|
|
|
syntax /HD in obsolete function 58; at usage of modern syntax
|
|
|
|
/HD0,/HD1,/HD2,/HD3 base is set automatically.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
|
|
|
* ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Any application at any time can change the base.
|
|
|
|
* Do not change base, when any application works with hard disk.
|
|
|
|
If you do not want system bugs.
|
|
|
|
* To get HD base use subfunction 7 of function 26.
|
2012-02-26 05:22:47 +01:00
|
|
|
* It is also necessary to define used partition of hard disk by
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 8.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 21, subfunction 8 - set used HD partition. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
The HD partition defines partition of the hard disk to write with
|
2007-02-14 17:01:07 +01:00
|
|
|
usage of obsolete syntax /HD and obsolete function 58;
|
2006-08-11 15:30:23 +02:00
|
|
|
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
|
2007-02-14 17:01:07 +01:00
|
|
|
base and partition are set automatically.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
|
|
|
* ecx = HD partition (beginning from 1)
|
|
|
|
Return value:
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 0
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Any application at any time can change partition.
|
|
|
|
* Do not change partition when any application works with hard disk.
|
|
|
|
If you do not want system bugs.
|
|
|
|
* To get used partition use subfunction 8 of function 26.
|
|
|
|
* There is no correctness checks.
|
2012-02-26 05:22:47 +01:00
|
|
|
* To get the number of partitions of a hard disk use
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 11 of function 18.
|
|
|
|
* It is also necessary to define used HD base by subfunction 7.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2012-02-26 05:22:47 +01:00
|
|
|
Function 21, subfunction 11 - enable/disable low-level access to HD.
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 11 - subfunction number
|
|
|
|
* ecx = 0/1 - disable/enable
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Is used in LBA-read (subfunction 8 of function 58).
|
|
|
|
* The current implementation uses only low bit of ecx.
|
|
|
|
* To get current status use subfunction 11 of function 26.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2012-02-26 05:22:47 +01:00
|
|
|
Function 21, subfunction 12 - enable/disable low-level access to PCI.
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 12 - subfunction number
|
|
|
|
* ecx = 0/1 - disable/enable
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Is used in operations with PCI bus (function 62).
|
|
|
|
* The current implementation uses only low bit of ecx.
|
|
|
|
* To get current status use subfunction 12 of function 26.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============ Function 21, subfunction 13, subsubfunction 1 ===========
|
|
|
|
======== Initialize + get information on the driver vmode.mdr. =======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 13 - subfunction number
|
|
|
|
* ecx = 1 - number of the driver function
|
|
|
|
* edx = pointer to 512-bytes buffer
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* if driver is not loaded
|
|
|
|
(never happens in the current implementation):
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = -1
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx, ecx destroyed
|
|
|
|
* if driver is loaded:
|
|
|
|
* eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
|
|
|
|
- signature
|
|
|
|
* ebx = current frequency of the scanning (in Hz)
|
|
|
|
* ecx destroyed
|
|
|
|
* buffer pointed to by edx is filled
|
2006-08-03 21:30:32 +02:00
|
|
|
Format of the buffer:
|
2006-08-11 15:30:23 +02:00
|
|
|
* +0: 32*byte: driver name, "Trans VideoDriver"
|
|
|
|
(without quotes, supplemented by spaces)
|
|
|
|
* +32 = +0x20: dword: driver version (version x.y is encoded as
|
|
|
|
y*65536+x), for the current implementation is 1 (1.0)
|
|
|
|
* +36 = +0x24: 7*dword: reserved (0 in the current implementation)
|
|
|
|
* +64 = +0x40: 32*word: list of supported videomodes (each word
|
|
|
|
is number of a videomode, after list itself there are zeroes)
|
|
|
|
* +128 = +0x80: 32*(5*word): list of supported frequences of the
|
|
|
|
scannings for videomodes: for each videomode listed in the
|
|
|
|
previous field up to 5 supported frequences are given
|
|
|
|
(unused positions contain zeroes)
|
|
|
|
Remarks:
|
|
|
|
* Function initializes the driver (if it is not initialized yet)
|
|
|
|
and must be called first, before others (otherwise they will do
|
|
|
|
nothing and return -1).
|
|
|
|
* The current implementation supports only one frequency
|
|
|
|
of the scanning on videomode.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============ Function 21, subfunction 13, subsubfunction 2 ===========
|
|
|
|
================ Get information on current videomode. ===============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 13 - subfunction number
|
|
|
|
* ecx = 2 - number of the driver function
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 - driver is not loaded or not initialized;
|
|
|
|
ebx,ecx are destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = [width]*65536 + [height]
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx = frequency of the vertical scanning (in Hz)
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = number of current videomode
|
|
|
|
Remarks:
|
2012-02-26 05:22:47 +01:00
|
|
|
* Driver must be initialized by call to
|
2006-08-11 15:30:23 +02:00
|
|
|
driver function 1.
|
|
|
|
* If only screen sizes are required, it is more expedient to use
|
|
|
|
function 14 taking into account that it
|
|
|
|
returns sizes on 1 less.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 13 - subfunction number
|
|
|
|
* ecx = 3 - number of the driver function
|
|
|
|
* edx = [scanning frequency]*65536 + [videomode number]
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - driver is not loaded, not initialized or
|
|
|
|
an error has occured
|
|
|
|
* eax = 0 - success
|
|
|
|
* ebx, ecx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Driver must be initialized by driver function 1.
|
|
|
|
* The videomode number and frequency must be in the table
|
|
|
|
returned by driver function 1.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============ Function 21, subfunction 13, subsubfunction 4 ===========
|
|
|
|
================== Return to the initial videomode. ==================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
Returns the screen to the videomode set at system boot.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 13 - subfunction number
|
|
|
|
* ecx = 4 - number of the driver function
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - driver is not loaded or not initialized
|
|
|
|
* eax = 0 - success
|
|
|
|
* ebx, ecx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Driver must be initialized by call to driver function 1.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
============ Function 21, subfunction 13, subsubfunction 5 ===========
|
|
|
|
===== Increase/decrease the size of the visible area of monitor. =====
|
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 21 - function number
|
|
|
|
* ebx = 13 - subfunction number
|
|
|
|
* ecx = 5 - number of the driver function
|
|
|
|
* edx = 0/1 - decrease/increase horizontal size on 1 position
|
|
|
|
* edx = 2/3 - is not supported in the current implementation;
|
|
|
|
is planned as decrease/increase vertical size on 1 position
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - driver is not loaded or not initialized
|
|
|
|
* eax = 0 - success
|
|
|
|
* ebx, ecx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Driver must be initialized by call to driver function 1.
|
|
|
|
* Function influences only the physical size of the screen image;
|
|
|
|
the logical size (number of pixels) does not change.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
================= Function 22 - set system date/time. ================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 22 - function number
|
|
|
|
* ebx = 0 - set time
|
|
|
|
* ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
|
2006-08-03 21:30:32 +02:00
|
|
|
* HH=hour 00..23
|
|
|
|
* MM=minute 00..59
|
|
|
|
* SS=second 00..59
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx = 1 - set date
|
|
|
|
* ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
|
2006-08-03 21:30:32 +02:00
|
|
|
* DD=day 01..31
|
|
|
|
* MM=month 01..12
|
|
|
|
* YY=year 00..99
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx = 2 - set day of week
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = 1 for Sunday, ..., 7 for Saturday
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx = 3 - set alarm clock
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = 0x00SSMMHH
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - incorrect parameter
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 2 - CMOS-battery was unloaded
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Value of installation of day of week seems to be doubtful,
|
|
|
|
as it a little where is used
|
|
|
|
(day of week can be calculated by date).
|
|
|
|
* Alarm clock can be set on operation in the given time every day.
|
|
|
|
But there is no existing system function to disable it.
|
|
|
|
* Operation of alarm clock consists in generation IRQ8.
|
|
|
|
* Generally CMOS supports for alarm clock set of value 0xFF
|
|
|
|
as one of parameters and it means that the appropriate parameter
|
|
|
|
is ignored. But current implementation does not allow this
|
|
|
|
(will return 1).
|
|
|
|
* Alarm clock is a global system resource; the set of
|
|
|
|
an alarm clock cancels automatically the previous set.
|
|
|
|
However, at moment no program uses it.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============= Function 23 - wait for event with timeout. =============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
If the message queue is empty, waits for new message in the queue,
|
|
|
|
but no more than given time. Then reads out a message from the queue.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 23 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = timeout (in 1/100 of second)
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - the message queue is empty
|
|
|
|
* otherwise eax = event (see the list of events)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Only those events are taken into account, which enter into
|
|
|
|
the mask set by function 40. By default it is
|
|
|
|
redraw, key and button events.
|
|
|
|
* To check for presence of a message in the queue use function 11.
|
|
|
|
To wait without timeout use function 10.
|
|
|
|
* Transmission ebx=0 results in immediate returning eax=0.
|
|
|
|
* Current implementation returns immediately with eax=0,
|
|
|
|
if the addition of ebx with the current value of time counter
|
|
|
|
makes 32-bit overflow.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======== Function 24, subfunction 1 - begin to play CD-audio. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 24 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = 0x00FRSSMM, where
|
2006-08-11 15:30:23 +02:00
|
|
|
* MM = starting minute
|
|
|
|
* SS = starting second
|
|
|
|
* FR = starting frame
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - CD base is not defined
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2012-02-26 05:22:47 +01:00
|
|
|
* Previously CD base must be defined by the call to
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 3 of function 21.
|
|
|
|
* One second includes 75 frames, one minute includes 60 seconds.
|
|
|
|
* The function is asynchronous (returns control, when play begins).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======= Function 24, subfunction 2 - get information on tracks. ======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 24 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
|
|
|
* ecx = pointer to the buffer for the table
|
|
|
|
(maximum 8*64h+4 bytes=100 tracks)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - CD base is not defined
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The format of the table with tracks information is the same as
|
|
|
|
for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
|
|
|
|
Function returns addresses in MSF.
|
2012-02-26 05:22:47 +01:00
|
|
|
* Previously CD base port must be set by call to
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 3 of function 21.
|
|
|
|
* Function returns information only about no more than 100
|
|
|
|
first tracks. In most cases it is enough.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 24, subfunction 3 - stop play CD-audio. ==========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 24 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - CD base is not defined
|
2007-05-16 15:59:46 +02:00
|
|
|
Remarks:
|
2012-02-26 05:22:47 +01:00
|
|
|
* Previously CD base port must be defined by call to
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 3 of function 21.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-07-26 14:25:17 +02:00
|
|
|
======================================================================
|
2007-09-23 22:58:50 +02:00
|
|
|
======= Function 24, subfunction 4 - eject tray of disk drive. =======
|
2007-07-26 14:25:17 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 24 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
2007-09-23 22:58:50 +02:00
|
|
|
* ecx = position of CD/DVD-drive
|
|
|
|
(from 0=Primary Master to 3=Secondary Slave)
|
2007-07-26 14:25:17 +02:00
|
|
|
Returned value:
|
2007-09-23 22:58:50 +02:00
|
|
|
* function does not return value
|
2007-07-26 14:25:17 +02:00
|
|
|
Remarks:
|
|
|
|
* The function is supported only for ATAPI devices (CD and DVD).
|
2007-09-23 22:58:50 +02:00
|
|
|
* When the tray is being ejected,
|
|
|
|
manual control of tray is unlocked.
|
|
|
|
* When the tray is being ejected, the code clears the cache for
|
|
|
|
corresponding device.
|
2007-07-26 14:25:17 +02:00
|
|
|
* An example of usage of the function is the application CD_tray.
|
|
|
|
|
|
|
|
======================================================================
|
2007-09-23 22:58:50 +02:00
|
|
|
======== Function 24, subfunction 5 - load tray of disk drive. =======
|
2007-07-26 14:25:17 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 24 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
2007-09-23 22:58:50 +02:00
|
|
|
* ecx = position of CD/DVD-drive
|
|
|
|
(from 0=Primary Master to 3=Secondary Slave)
|
2007-07-26 14:25:17 +02:00
|
|
|
Returned value:
|
2007-09-23 22:58:50 +02:00
|
|
|
* function does not return value
|
2007-07-26 14:25:17 +02:00
|
|
|
Remarks:
|
|
|
|
* The function is supported only for ATAPI devices (CD and DVD).
|
|
|
|
* An example of usage of the function is the application CD_tray.
|
2012-03-26 23:10:43 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
======= Function 25 - put image area on the background layer. ========
|
|
|
|
======================================================================
|
|
|
|
Paramters:
|
|
|
|
* eax = 25 - function number
|
|
|
|
* ebx = pointer to the previously allocated memory area,
|
|
|
|
where placed the source images in a format BBGGRRTTBBGGRRTT...
|
|
|
|
* ecx = [size on axis x]*65536 + [size on axis y]
|
|
|
|
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* Coordinates of the image are coordinates of the upper left corner
|
|
|
|
of the image relative to the screen.
|
|
|
|
* Size of the image in bytes is 4*xsize*ysize
|
|
|
|
* TT - byte pointer of transparency, at current version:
|
|
|
|
1 to FF - opaque, 0 - transparent.
|
|
|
|
* The function places the image directly to LFB. It is not for
|
|
|
|
background image f.15. Options f.15 to f.25 does not make sense.
|
2007-07-26 14:25:17 +02:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = port number
|
|
|
|
Parameters:
|
|
|
|
* To set base port use subfunction 1 of function 21.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
========== Function 26, subfunction 2 - get keyboard layout. =========
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
The keyboard layout is used to convert keyboard scancodes to
|
|
|
|
ASCII-codes for function 2.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = what layout to get:
|
|
|
|
* 1 = normal layout
|
2006-08-11 15:30:23 +02:00
|
|
|
* 2 = layout with pressed Shift
|
|
|
|
* 3 = layout with pressed Alt
|
|
|
|
* edx = pointer to the 128-bytes buffer, where the layout will be
|
|
|
|
copied
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2006-08-11 15:30:23 +02:00
|
|
|
Or:
|
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = 9
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If Alt is pressed, the layout with Alt is used;
|
|
|
|
if Alt is not pressed, but Shift is pressed,
|
|
|
|
the layout with Shift is used;
|
|
|
|
if Alt and Shift are not pressed, but Ctrl is pressed, the normal
|
|
|
|
layout is used and then from the code is subtracted 0x60;
|
|
|
|
if no control key is pressed, the normal layout is used.
|
2012-02-26 05:22:47 +01:00
|
|
|
* To set layout and country identifier use
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 2 of function 21.
|
|
|
|
* Country identifier is global system variable, which is not used
|
|
|
|
by the kernel itself; however the application '@panel' displays
|
|
|
|
the corresponding icon (using this function).
|
|
|
|
* The application @panel switches layouts on user request.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============== Function 26, subfunction 3 - get CD base. =============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* CD base is used by function 24.
|
|
|
|
* To set CD base use subfunction 3 of function 21.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 26, subfunction 5 - get system language. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* System language is global system variable and is not used
|
|
|
|
by the kernel itself, however application @panel draws the
|
|
|
|
appropriate icon (using this function).
|
|
|
|
* To set system language use subfunction 5 of function 21.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============== Function 26, subfunction 7 - get HD base. =============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
The HD base defines hard disk to write with usage of obsolete
|
2007-02-14 17:01:07 +01:00
|
|
|
syntax /HD in obsolete function 58; at usage of modern syntax
|
|
|
|
/HD0,/HD1,/HD2,/HD3 base is set automatically.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Any application in any time can change HD base.
|
|
|
|
* To set base use subfunction 7 of function 21.
|
|
|
|
* To get used partition of hard disk use subfunction 8.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 26, subfunction 8 - get used HD partition. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
The HD partition defines partition of the hard disk to write with
|
2007-02-14 17:01:07 +01:00
|
|
|
usage of obsolete syntax /HD in obsolete function 58;
|
2006-08-11 15:30:23 +02:00
|
|
|
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
|
2007-02-14 17:01:07 +01:00
|
|
|
base and partition are set automatically.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = HD partition (beginning from 1)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Any application in any time can change partition.
|
|
|
|
* To set partition use subfunction 8 of function 21.
|
|
|
|
* To get number of partitions on a hard disk use
|
|
|
|
subfunction 11 of function 18.
|
|
|
|
* To get base of used hard disk, use subfunction 7.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=== Function 26, subfunction 9 - get the value of the time counter. ==
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 9 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = number of 1/100s of second, past from the system boot time
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Counter takes modulo 2^32, that correspond to a little more
|
|
|
|
than 497 days.
|
|
|
|
* To get system time use function 3.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===================== Function 26, subfunction 11 ====================
|
|
|
|
========== Find out whether low-level HD access is enabled. ==========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 11 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0/1 - disabled/enabled
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Is used in LBA read (subfunction 8 of function 58).
|
|
|
|
* To set current state use subfunction 11 of function 21.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===================== Function 26, subfunction 12 ====================
|
|
|
|
========== Find out whether low-level PCI access is enabled. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 26 - function number
|
|
|
|
* ebx = 12 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0/1 - disabled/enabled
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Is used by operations with PCI bus (function 62).
|
|
|
|
* The current implementation uses only low bit of ecx.
|
|
|
|
* To set the current state use subfunction 12 of function 21.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=================== Function 29 - get system date. ===================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 29 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0x00DDMMYY, where
|
2006-08-11 15:30:23 +02:00
|
|
|
(binary-decimal coding, BCD, is used)
|
|
|
|
* YY = two low digits of year (00..99)
|
|
|
|
* MM = month (01..12)
|
|
|
|
* DD = day (01..31)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* To set system date use function 22.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-05-24 13:27:05 +02:00
|
|
|
======================================================================
|
|
|
|
============= Function 30 - work with the current folder. ============
|
|
|
|
======================================================================
|
|
|
|
|
|
|
|
--------- Subfunction 1 - set current folder for the thread. ---------
|
|
|
|
Parameters:
|
|
|
|
* eax = 30 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* ecx = pointer to ASCIIZ-string with the path to new current folder
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
|
|
|
--------- Subfunction 2 - get current folder for the thread. ---------
|
|
|
|
Parameters:
|
|
|
|
* eax = 30 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
|
|
|
* ecx = pointer to buffer
|
|
|
|
* edx = size of buffer
|
|
|
|
Returned value:
|
|
|
|
* eax = size of the current folder's name (including terminating 0)
|
|
|
|
Remarks:
|
|
|
|
* If the buffer is too small to hold all data, only first (edx-1)
|
|
|
|
bytes are copied and than terminating 0 is inserted.
|
2010-10-17 10:53:29 +02:00
|
|
|
* By default, current folder for the thread is "/rd/1".
|
2012-02-26 05:22:47 +01:00
|
|
|
* At process/thread creation the current folder will be inherited
|
2010-10-17 10:53:29 +02:00
|
|
|
from the parent.
|
2009-01-31 07:09:36 +01:00
|
|
|
|
2013-06-15 23:17:06 +02:00
|
|
|
--- Subfunction 3 - install the add.system directory for the kernel --
|
|
|
|
Parameters:
|
|
|
|
* eax = 30 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
|
|
|
* ecx = pointer to a block of data:
|
|
|
|
sysdir_name rb 64
|
|
|
|
sysdir_path rb 64
|
2013-07-08 10:17:53 +02:00
|
|
|
For example:
|
|
|
|
dir_name1 db 'KolibriOS',0
|
2013-06-15 23:17:06 +02:00
|
|
|
rb 64-8
|
|
|
|
dir_path1 db 'HD0/1',0
|
|
|
|
rb 64-6
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* The function can be called only 1 time for 1 session of the OS.
|
|
|
|
|
2012-03-27 15:25:30 +02:00
|
|
|
======================================================================
|
|
|
|
========= Function 34 - who owner the pixel on the screen. ===========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 34 - function number
|
|
|
|
* ebx = x-coordinate (relative to the display)
|
|
|
|
* ecx = y-coordinate (relative to the display)
|
|
|
|
|
|
|
|
Returned value:
|
|
|
|
* eax = 0x000000XX - owner of pixel the slot window N
|
|
|
|
If incorrect values ebx and ecx then function returns 0
|
|
|
|
* The function takes the value from the area [_WinMapAddress]
|
2013-07-08 10:17:53 +02:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======= Function 35 - read the color of a pixel on the screen. =======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 35
|
|
|
|
* ebx = y*xsize+x, where
|
2006-08-11 15:30:23 +02:00
|
|
|
* (x,y) = coordinates of a pixel (beginning from 0)
|
|
|
|
* xsize = horizontal screen size
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = color 0x00RRGGBB
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* To get screen sizes use function 14. Pay attention,
|
|
|
|
that it subtracts 1 from both sizes.
|
|
|
|
* There is also direct access (without any system calls)
|
|
|
|
to videomemory through the selector gs. To get parameters of
|
|
|
|
the current videomode, use function 61.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2008-11-16 16:23:40 +01:00
|
|
|
======================================================================
|
2009-01-31 07:09:36 +01:00
|
|
|
=================== Function 36 - read screen area. ==================
|
2008-11-16 16:23:40 +01:00
|
|
|
======================================================================
|
|
|
|
Paramters:
|
|
|
|
* eax = 36 - function number
|
2009-01-31 07:09:36 +01:00
|
|
|
* ebx = pointer to the previously allocated memory area,
|
|
|
|
where will be placed the image in the format BBGGRRBBGGRR...
|
2008-11-16 16:23:40 +01:00
|
|
|
* ecx = [size on axis x]*65536 + [size on axis y]
|
|
|
|
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* Coordinates of the image are coordinates of the upper left corner
|
2008-11-17 09:05:51 +01:00
|
|
|
of the image relative to the screen.
|
2008-11-16 16:23:40 +01:00
|
|
|
* Size of the image in bytes is 3*xsize*ysize.
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2007-01-17 15:43:18 +01:00
|
|
|
=================== Function 37 - work with mouse. ===================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
---------- Subfunction 0 - screen coordinates of the mouse -----------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 37 - function number
|
|
|
|
* ebx = 0 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
|
|
|
|
(beginning from 0)
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
-- Subfunction 1 - coordinates of the mouse relative to the window ---
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 37 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
|
|
|
|
relative to the application window (beginning from 0)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
|
|
|
|
If y>=ywnd, the low word is non-negative and contains
|
|
|
|
relative y-coordinate, and the high word - relative x-coordinate
|
|
|
|
(with correct sign). Otherwise the low word is negative and still
|
|
|
|
contains relative y-coordinate, and to the high word
|
|
|
|
1 should be added.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
------------ Subfunction 2 - pressed buttons of the mouse ------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 37 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax contains information on the pressed mouse buttons:
|
|
|
|
* bit 0 is set = left button is pressed
|
|
|
|
* bit 1 is set = right button is pressed
|
2007-05-10 16:43:38 +02:00
|
|
|
* bit 2 is set = middle button is pressed
|
|
|
|
* bit 3 is set = 4th button is pressed
|
|
|
|
* bit 4 is set = 5th button is pressed
|
2006-08-11 15:30:23 +02:00
|
|
|
* other bits are cleared
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-01-17 15:43:18 +01:00
|
|
|
-------------------- Subfunction 4 - load cursor ---------------------
|
|
|
|
Parameters:
|
|
|
|
* eax = 37 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
|
|
|
* dx = data source:
|
|
|
|
* dx = LOAD_FROM_FILE = 0 - data in a file
|
|
|
|
* ecx = pointer to full path to the cursor file
|
|
|
|
* the file must be in the format .cur, which is standard for
|
|
|
|
MS Windows, at that of the size 32*32 pixels
|
|
|
|
* dx = LOAD_FROM_MEM = 1 - data of file are already loaded in memory
|
|
|
|
* ecx = pointer to data of the cursor file
|
|
|
|
* the data format is the same as in the previous case
|
|
|
|
* dx = LOAD_INDIRECT = 2 - data in memory
|
|
|
|
* ecx = pointer to cursor image in the format ARGB 32*32 pixels
|
|
|
|
* edx = 0xXXYY0002, where
|
|
|
|
* XX = x-coordinate of cursor hotspot
|
|
|
|
* YY = y-coordinate
|
|
|
|
* 0 <= XX, YY <= 31
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - failed
|
|
|
|
* otherwise eax = cursor handle
|
|
|
|
|
|
|
|
--------------------- Subfunction 5 - set cursor ---------------------
|
|
|
|
Sets new cursor for the window of the current thread.
|
|
|
|
Parameters:
|
|
|
|
* eax = 37 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
|
|
|
* ecx = cursor handle
|
|
|
|
Returned value:
|
|
|
|
* eax = handle of previous cursor
|
|
|
|
Remarks:
|
|
|
|
* If the handle is incorrect, the function restores the default
|
|
|
|
cursor (standard arrow). In particular, ecx=0 restores it.
|
|
|
|
|
|
|
|
------------------- Subfunction 6 - delete cursor --------------------
|
|
|
|
Parameters:
|
|
|
|
* eax = 37 - function number
|
|
|
|
* ebx = 6 - subfunction number
|
|
|
|
* ecx = cursor handle
|
|
|
|
Returned value:
|
|
|
|
* eax destroyed
|
|
|
|
Remarks:
|
|
|
|
* The cursor must be loaded previously by the current thread
|
|
|
|
(with the call to subfunction 4). The function does not delete
|
|
|
|
system cursors and cursors, loaded by another applications.
|
|
|
|
* If the active cursor (set by subfunction 5) is deleted,
|
|
|
|
the system restores the default cursor (standard arrow).
|
|
|
|
|
2007-05-16 15:59:46 +02:00
|
|
|
------------------ Subfunction 7 - get scroll data -------------------
|
2007-05-10 16:43:38 +02:00
|
|
|
Parameters:
|
|
|
|
* eax = 37 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
|
|
|
Returned value:
|
2007-05-16 15:59:46 +02:00
|
|
|
* eax = [horizontal offset]*65536 + [vertical offset]
|
2007-05-10 16:43:38 +02:00
|
|
|
Remarks:
|
2007-05-16 15:59:46 +02:00
|
|
|
* Scroll data is available for active window only.
|
|
|
|
* Values are zeroed after reading.
|
|
|
|
* Values are signed.
|
2007-05-10 16:43:38 +02:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
====================== Function 38 - draw line. ======================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 38 - function number
|
|
|
|
* ebx = [start coordinate on axis x]*65536 +
|
|
|
|
[end coordinate on axis x]
|
|
|
|
* ecx = [start coordinate on axis y]*65536 +
|
|
|
|
[end coordinate on axis y]
|
|
|
|
* edx = 0x00RRGGBB - color
|
2006-08-21 15:06:02 +02:00
|
|
|
edx = 0x01xxxxxx - draw inversed line
|
|
|
|
(low 24 bits are ignored)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Coordinates are relative to the window.
|
|
|
|
* End point is also drawn.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
== Function 39, subfunction 1 - get a size of the background image. ==
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 39 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = [width]*65536 + [height]
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* There is a pair function to set sizes of background image -
|
|
|
|
subfunction 1 of function 15. After which it is necessary,
|
|
|
|
of course, anew to define image.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
== Function 39, subfunction 2 - get pixel from the background image. =
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 39 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = offset
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0x00RRGGBB - pixel color, if offset is valid
|
|
|
|
(less than 0x160000-16)
|
|
|
|
* eax = 2 otherwise
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Do not rely on returned value for invalid offsets, it may be
|
|
|
|
changed in future kernel versions.
|
|
|
|
* Offset for pixel with coordinates (x,y)
|
|
|
|
is calculated as (x+y*xsize)*3.
|
2012-02-26 05:22:47 +01:00
|
|
|
* There is a pair function to set pixel on the background image -
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 2 of function 15.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
== Function 39, subfunction 4 - get drawing mode for the background. =
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 39 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 1 - tile
|
|
|
|
* eax = 2 - stretch
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2012-02-26 05:22:47 +01:00
|
|
|
* There is a pair function to set drawing mode -
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 4 of function 15.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 40 - set the mask for expected events. ==========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
The mask for expected events affects function working with events
|
|
|
|
10, 11, 23 - they notify only about events allowed by this mask.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 40 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = mask: bit i corresponds to event i+1 (see list of events)
|
2006-08-11 15:30:23 +02:00
|
|
|
(set bit permits notice on event)
|
2012-02-28 09:36:15 +01:00
|
|
|
bit 31: active/inactive filter
|
|
|
|
bit 31 = 0 - inactive window receive mouse events
|
|
|
|
bit 31 = 1 - inactive window does not receive mouse events
|
|
|
|
bit 30: cursor position filter
|
|
|
|
bit 30 = 0 = the window receive mouse events if cursor
|
|
|
|
outside window
|
|
|
|
bit 30 = 1 - the window does not receive mouse events if cursor
|
|
|
|
outside window
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2009-09-08 13:32:39 +02:00
|
|
|
* eax = previous value of mask
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Default mask (7=111b) enables nofices about redraw,
|
|
|
|
keys and buttons. This is enough for many applications.
|
|
|
|
* Events prohibited in the mask are saved anyway, when come;
|
|
|
|
they are simply not informed with event functions.
|
|
|
|
* Event functions take into account the mask on moment of
|
|
|
|
function call, not on moment of event arrival.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
================ Function 43 - input/output to a port. ===============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
------------------------ Output data to port -------------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 43 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* bl = byte for output
|
2006-08-11 15:30:23 +02:00
|
|
|
* ecx = port number 0xnnnn (from 0 to 0xFFFF)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - the thread has not reserved the selected port
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
------------------------ Input data from port ------------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 43 - function number
|
|
|
|
* ebx is ignored
|
|
|
|
* ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success, thus ebx = entered byte
|
|
|
|
* eax = 1 - the thread has not reserved the selected port
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Previously the thread must reserve the selected port
|
|
|
|
for itself by function 46.
|
|
|
|
* Instead of call to this function it is better to use
|
|
|
|
processor instructions in/out - this is much
|
|
|
|
faster and a bit shorter and easier.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
====== Function 46 - reserve/free a group of input/output ports. =====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
To work with reserved ports an application can access directly by
|
|
|
|
commands in/out (recommended way) and can use function 43
|
|
|
|
(not recommended way).
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 46 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = 0 - reserve, 1 - free
|
2006-08-11 15:30:23 +02:00
|
|
|
* ecx = start port number
|
|
|
|
* edx = end port number (inclusive)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 1 - error
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* For ports reservation: an error occurs if and only if
|
|
|
|
one from the following condition satisfies:
|
|
|
|
* start port is more than end port;
|
|
|
|
* the selected range contains incorrect port number
|
|
|
|
(correct are from 0 to 0xFFFF);
|
|
|
|
* limit for the total number of reserved areas is exceeded
|
|
|
|
(maximum 255 are allowed);
|
|
|
|
* the selected range intersects with any of earlier reserved
|
|
|
|
* For ports free: an error is an attempt to free range,
|
|
|
|
that was not earlier reserved by this function
|
|
|
|
(with same ecx,edx).
|
|
|
|
* If an error occurs (for both cases) function performs no action.
|
2007-01-17 15:43:18 +01:00
|
|
|
* At booting the system reserves for itself ports
|
|
|
|
0..0x2d, 0x30..0x4d, 0x50..0xdf, 0xe5..0xff (inclusively).
|
2006-08-11 15:30:23 +02:00
|
|
|
* When a thread terminates, all reserved by it ports
|
|
|
|
are freed automatically.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============= Function 47 - draw a number in the window. =============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 47 - function number
|
|
|
|
* ebx = parameters of conversion number to text:
|
2006-08-03 21:30:32 +02:00
|
|
|
* bl = 0 - ecx contains number
|
2007-10-25 13:20:02 +02:00
|
|
|
* bl = 1 - ecx contains pointer to dword/qword-number
|
2006-08-11 15:30:23 +02:00
|
|
|
* bh = 0 - display in decimal number system
|
|
|
|
* bh = 1 - display in hexadecimal system
|
|
|
|
* bh = 2 - display in binary system
|
2007-05-16 15:59:46 +02:00
|
|
|
* bits 16-21 = how many digits to display
|
2007-10-18 18:27:26 +02:00
|
|
|
* bits 22-29 reserved and must be set to 0
|
2007-10-25 13:20:02 +02:00
|
|
|
* bit 30 set = display qword (64-bit) number (must be bl=1)
|
|
|
|
* bit 31 set = do not display leading zeroes of the number
|
2006-08-11 15:30:23 +02:00
|
|
|
* ecx = number (if bl=0) or pointer (if bl=1)
|
2006-08-03 21:30:32 +02:00
|
|
|
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
2006-08-28 15:34:54 +02:00
|
|
|
* esi = 0xX0RRGGBB:
|
|
|
|
* RR, GG, BB specify the color
|
|
|
|
* X = ABnn (bits)
|
|
|
|
* nn = font (0/1)
|
|
|
|
* A is ignored
|
|
|
|
* B=1 - fill background with the color edi
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The given length must not exceed 60.
|
|
|
|
* The exactly given amount of digits is output. If number is small
|
|
|
|
and can be written by smaller amount of digits, it is supplemented
|
|
|
|
by leading zeroes; if the number is big and can not be written by
|
|
|
|
given amount of digits, extra digits are not drawn.
|
|
|
|
* Parameters of fonts are shown in the description of function 4
|
|
|
|
(text output).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 48, subfunction 0 - apply screen settings. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 0 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = 0 - reserved
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Function redraws the screen after parameters change by
|
2006-08-03 21:30:32 +02:00
|
|
|
subfunctions 1 and 2.
|
2006-08-11 15:30:23 +02:00
|
|
|
* Function call without prior call to one of indicated subfunctions
|
|
|
|
is ignored.
|
|
|
|
* Function call with nonzero ecx is ignored.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 48, subfunction 1 - set button style. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* ecx = button style:
|
|
|
|
* 0 = flat
|
|
|
|
* 1 = 3d
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* After call to this function one should redraw the screen by
|
|
|
|
subfunction 0.
|
|
|
|
* Button style influences only to their draw of function 8.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
======================================================================
|
|
|
|
====== Function 48, subfunction 2 - set standard window colors. ======
|
|
|
|
======================================================================
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
|
|
|
* ecx = pointer to the color table
|
2006-08-03 21:30:32 +02:00
|
|
|
* edx = size of the color table
|
2006-08-11 15:30:23 +02:00
|
|
|
(must be 40 bytes for future compatibility)
|
|
|
|
Format of the color table is shown in description of subfunction 3.
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* After call to this function one should redraw the screen by
|
|
|
|
subfunction 0.
|
|
|
|
* Table of standard colors influences only to applications,
|
|
|
|
which receive this table obviously (by subfunction 3)
|
|
|
|
and use it (specifying colors from it to drawing functions).
|
|
|
|
* Table of standard colors is included in skin and is installed
|
|
|
|
anew with skin installation (by subfunction 8).
|
|
|
|
* Color table can be viewed/changed interactively with
|
|
|
|
the application 'desktop'.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
====== Function 48, subfunction 3 - get standard window colors. ======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
|
|
|
* ecx = pointer to the buffer with size edx bytes,
|
|
|
|
where table will be written
|
|
|
|
* edx = size of color table
|
|
|
|
(must be 40 bytes for future compatibility)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2006-08-11 15:30:23 +02:00
|
|
|
Format of the color table:
|
|
|
|
each item is dword-value for color 0x00RRGGBB
|
|
|
|
* +0: dword: frames - color of frame
|
|
|
|
* +4: dword: grab - color of header
|
|
|
|
* +8: dword: grab_button - color of button on header bar
|
|
|
|
* +12 = +0xC: dword: grab_button_text - color of text on button
|
|
|
|
on header bar
|
|
|
|
* +16 = +0x10: dword: grab_text - color of text on header
|
|
|
|
* +20 = +0x14: dword: work - color of working area
|
|
|
|
* +24 = +0x18: dword: work_button - color of button in working area
|
|
|
|
* +28 = +0x1C: dword: work_button_text - color of text on button
|
|
|
|
in working area
|
|
|
|
* +32 = +0x20: dword: work_text - color of text in working area
|
|
|
|
* +36 = +0x24: dword: work_graph - color of graphics in working area
|
|
|
|
Remarks:
|
|
|
|
* Structure of the color table is described in the standard
|
|
|
|
include file 'macros.inc' as 'system_colors'; for example,
|
|
|
|
it is possible to write:
|
2010-10-17 10:53:29 +02:00
|
|
|
sc system_colors ; variable declaration
|
|
|
|
... ; somewhere one must call
|
|
|
|
; this function with ecx=sc
|
|
|
|
mov ecx, [sc.work_button_text] ; read text color on
|
|
|
|
; buttin in working area
|
2006-08-11 15:30:23 +02:00
|
|
|
* A program itself desides to use or not to use color table.
|
|
|
|
For usage program must simply at calls to drawing functions select
|
|
|
|
color taken from the table.
|
|
|
|
* At change of the table of standard colors (by subfunction 2 with
|
|
|
|
the subsequent application of changes by subfunction 0 or
|
|
|
|
at skin set by subfunction 8) the system sends to all windows
|
|
|
|
redraw message (the event with code 1).
|
|
|
|
* Color table can be viewed/changed interactively with
|
|
|
|
the application 'desktop'.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============ Function 48, subfunction 4 - get skin height. ===========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* eax = skin height
|
|
|
|
Remarks:
|
|
|
|
* Skin height is defined as the height of a header
|
|
|
|
of skinned windows.
|
|
|
|
* See also general structure of window in the description
|
|
|
|
of function 0.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
======== Function 48, subfunction 5 - get screen working area. =======
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = [left]*65536 + [right]
|
|
|
|
* ebx = [top]*65536 + [bottom]
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The screen working area defines position and coordinates of
|
|
|
|
a maximized window.
|
|
|
|
* The screen working area in view of normal work is all screen
|
|
|
|
without system panel (the application '@panel').
|
|
|
|
* (left,top) are coordinates of the left upper corner,
|
|
|
|
(right,bottom) are coordinates of the right lower one.
|
|
|
|
Thus the size of working area on x axis can be calculated by
|
|
|
|
formula right-left+1, on y axis - by formula bottom-right+1.
|
|
|
|
* See also function 14,
|
|
|
|
to get sizes of all screen.
|
|
|
|
* There is a pair function to set working area - subfunction 6.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======== Function 48, subfunction 6 - set screen working area. =======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 6 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = [left]*65536 + [right]
|
|
|
|
* edx = [top]*65536 + [bottom]
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The screen working area defines position and coordinates of
|
|
|
|
a maximized window.
|
|
|
|
* This function is used only by the application '@panel',
|
|
|
|
which set working area to all screen without system panel.
|
|
|
|
* (left,top) are coordinates of the left upper corner,
|
|
|
|
(right,bottom) are coordinates of the right lower one.
|
|
|
|
Thus the size of working area on x axis can be calculated by
|
|
|
|
formula right-left+1, on y axis - by formula bottom-right+1.
|
|
|
|
* If 'left'>='right', x-coordinate of working area is not changed.
|
|
|
|
If 'left'<0, 'left' will not be set. If 'right' is greater than or
|
|
|
|
equal to screen width, 'right' will not be set.
|
|
|
|
Similarly on y axis.
|
|
|
|
* See also function 14,
|
|
|
|
to get sizes of all screen.
|
|
|
|
* There is a pair function to get working area - subfunction 5.
|
|
|
|
* This function redraws the screen automatically,
|
|
|
|
updating coordinates and sizes of maximized windows.
|
|
|
|
The system sends to all windows redraw message (the event 1).
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=========== Function 48, subfunction 7 - get skin margins. ===========
|
|
|
|
======================================================================
|
|
|
|
Returns the area of a header of a skinned window, intended for
|
|
|
|
a text of a header.
|
|
|
|
Parameters:
|
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = [left]*65536 + [right]
|
|
|
|
* ebx = [top]*65536 + [bottom]
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* An application decides itself to use or not to use this function.
|
|
|
|
* It is recommended to take into account returned value
|
|
|
|
of this function for choice of a place for drawing header text
|
|
|
|
(by function 4) or a substitute of header text
|
|
|
|
(at the discretion of an application).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============= Function 48, subfunction 8 - set used skin. ============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 48 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
|
|
|
* ecx = pointer to a block for function 58, in
|
|
|
|
which the fields of intermediate buffer and file name are filled
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* otherwise eax = file system error code; if file does not
|
|
|
|
contain valid skin, function returns error 3
|
|
|
|
(unknown file system).
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* After successful skin loading the system sends to all windows
|
|
|
|
redraw message (the event 1).
|
|
|
|
* At booting the system reads skin from file 'default.skn'
|
|
|
|
on ramdisk.
|
|
|
|
* User can change the skin statically by creating hisself
|
|
|
|
'default.skn' or dynamically with the application 'desktop'.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 49 - Advanced Power Management (APM). ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 49 - function number
|
|
|
|
* dx = number of the APM function
|
|
|
|
(analogue of ax in APM specification)
|
|
|
|
* bx, cx = parameters of the APM function
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
|
|
|
|
are set according to the APM specification
|
|
|
|
* high halves of 32-bit registers eax, ebx, ecx,
|
|
|
|
edx, esi, edi are destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* APM 1.2 specification is described in the document
|
|
|
|
"Advanced Power Management (APM) BIOS Specification"
|
|
|
|
(Revision 1.2), available at
|
2006-08-03 21:30:32 +02:00
|
|
|
http://www.microsoft.com/whdc/archive/amp_12.mspx;
|
2006-08-11 15:30:23 +02:00
|
|
|
besides it is included in famous Interrupt List by Ralf Brown
|
2006-08-03 21:30:32 +02:00
|
|
|
(http://www.pobox.com/~ralf/files.html,
|
|
|
|
ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=================== Function 50 - set window shape. ==================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
Normal windows have rectangular shape. This function can give to
|
|
|
|
a window any shape. The shape is given by a set of points inside
|
|
|
|
the base rectangle belonging to a window. Position and coordinates
|
|
|
|
of the base rectangle are set by function 0
|
|
|
|
and changed by function 67.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
--------------------------- Set shape data ---------------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 50 - function number
|
|
|
|
* ebx = 0 - subfunction number
|
|
|
|
* ecx = pointer to shape data (array of bytes 0/1)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
-------------------------- Set shape scale ---------------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 50 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* ecx sets a scale: each byte of data defines
|
|
|
|
(2^scale)*(2^scale) pixels
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Default scale is 0 (scale factor is 1). If in the shape data
|
|
|
|
one byte corresponds to one pixel, there is no necessity
|
|
|
|
to set scale.
|
|
|
|
* Let's designate xsize = window width (in pixels), ysize = height;
|
|
|
|
pay attention, that they are one pixel more than defined by
|
2006-08-03 21:30:32 +02:00
|
|
|
functions 0, 67.
|
2006-08-11 15:30:23 +02:00
|
|
|
* On definition of scale xsize and ysize must be divisible
|
|
|
|
on 2^scale.
|
|
|
|
* Byte of data on offset 'a' must be 0/1 and defines belonging
|
|
|
|
to a window of square with the side 2^scale (if scale=0,
|
|
|
|
this is one pixel) and coordinates of the left upper corner
|
2006-08-03 21:30:32 +02:00
|
|
|
(a mod (xsize shr scale), a div (xsize shr scale))
|
2006-08-11 15:30:23 +02:00
|
|
|
* Data size: (xsize shr scale)*(ysize shr scale).
|
|
|
|
* Data must be presented in the memory and not change
|
|
|
|
after set of shape.
|
|
|
|
* The system views the shape data at every window redraw by
|
|
|
|
function 0.
|
|
|
|
* The call of subfunction 0 with NULL pointer results in return
|
|
|
|
to the rectangular shape.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
==================== Function 51 - create thread. ====================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 51 - function number
|
|
|
|
* ebx = 1 - unique subfunction
|
|
|
|
* ecx = address of thread entry point (starting eip)
|
|
|
|
* edx = pointer to thread stack (starting esp)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - error (there is too many threads)
|
|
|
|
* otherwise eax = TID - thread identifier
|
2012-02-26 05:22:47 +01:00
|
|
|
</UL>
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2013-05-29 15:47:55 +02:00
|
|
|
======================================================================
|
|
|
|
=========================== Function 52 ==============================
|
|
|
|
======================================================================
|
|
|
|
|
2013-07-08 10:17:53 +02:00
|
|
|
WARNING: This function is obsolete and is only present in the
|
2013-05-29 15:47:55 +02:00
|
|
|
documentation as a guide to understand/port the older network
|
|
|
|
applications. For new programs, use function 74
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=== Function 52, subfunction 0 - get network driver configuration. ===
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2013-05-29 15:47:55 +02:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 0 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = configuration dword
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Configuration dword can be set by subfunction 2.
|
|
|
|
* The kernel does not use this variable. The value of this
|
|
|
|
variable and working with it subfunctions 0 and 2 is represented
|
|
|
|
doubtful.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 52, subfunction 1 - get local IP-address. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = IP-address (4 bytes)
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Local IP-address is set by subfunction 3.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=== Function 52, subfunction 2 - set network driver configuration. ===
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
|
|
|
* ecx = configuration dword; if low 7 bits derivate the number 3,
|
|
|
|
function [re-]initializes Ethernet-card, otherwise
|
|
|
|
Ethernet turns off
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* if Ethernet-interface is not requested, function returns eax=2,
|
|
|
|
but this can be changed in future kernel versions
|
|
|
|
* if Ethernet-interface is requested, eax=0 means error
|
|
|
|
(absence of Ethernet-card), and nonzero value - success
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Configuration dword can be read by subfunction 0.
|
|
|
|
* The kernel does not use this variable. The value of this
|
|
|
|
variable, subfunction 0 and part of subfunction 2, which set it,
|
2006-08-03 21:30:32 +02:00
|
|
|
is represented doubtful.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
========= Function 52, subfunction 3 - set local IP-address. =========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = IP-address (4 bytes)
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* the current implementation returns eax=3, but this can be changed
|
|
|
|
in future versions
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Local IP-address can be get by subfunction 1.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
= Function 52, subfunction 6 - add data to the stack of input queue. =
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 6 - subfunction number
|
|
|
|
* edx = data size
|
|
|
|
* esi = data pointer
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = -1 - error
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* This function is intended only for slow network drivers
|
|
|
|
(PPP, SLIP).
|
|
|
|
* Data size must not exceed 1500 bytes, though function
|
|
|
|
performs no checks on correctness.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2012-02-26 05:22:47 +01:00
|
|
|
Function 52, subfunction 8 - read data from the network output queue.
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
|
|
|
* esi = pointer to 1500-byte buffer
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = number of read bytes (in the current implementation
|
|
|
|
either 0 = no data or 1500)
|
|
|
|
* data was copied in buffer
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* This function is intended only for slow network drivers
|
|
|
|
(PPP, SLIP).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============ Function 52, subfunction 9 - get gateway IP. ============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 9 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = gateway IP (4 bytes)
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 52, subfunction 10 - get subnet mask. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 10 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = subnet mask
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============ Function 52, subfunction 11 - set gateway IP. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 11 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = gateway IP (4 bytes)
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* the current implementation returns eax=11, but this can be changed
|
|
|
|
in future versions
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 52, subfunction 12 - set subnet mask. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 12 - subfunction number
|
|
|
|
* ecx = subnet mask
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* the current implementation returns eax=12, but this can be changed
|
|
|
|
in future versions
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============== Function 52, subfunction 13 - get DNS IP. =============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 13 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = DNS IP (4 bytes)
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============== Function 52, subfunction 14 - set DNS IP. =============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 14 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = DNS IP (4 bytes)
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* the current implementation returns eax=14, but this can be changed
|
|
|
|
in future versions
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-01-17 15:43:18 +01:00
|
|
|
======================================================================
|
|
|
|
======== Function 52, subfunction 15 - get local MAC address. ========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 52 - function number
|
|
|
|
* ebx = 15 - subfunction number
|
|
|
|
* ecx = 0 - read first 4 bytes,
|
|
|
|
ecx = 4 - read last 2 bytes
|
|
|
|
Returned value:
|
|
|
|
* for ecx=0: eax = first 4 bytes of MAC address
|
|
|
|
* for ecx=4: ax = last 2 bytes of MAC address,
|
|
|
|
high half of eax is destroyed
|
|
|
|
* for other ecx: eax = -1 indicates an error
|
|
|
|
|
2013-05-29 15:47:55 +02:00
|
|
|
======================================================================
|
|
|
|
=========================== Function 53 ==============================
|
|
|
|
======================================================================
|
|
|
|
|
2013-07-08 10:17:53 +02:00
|
|
|
WARNING: This function is obsolete and is only present in the
|
2013-05-29 15:47:55 +02:00
|
|
|
documentation as a guide to understand/port the older network
|
|
|
|
applications. For new programs, use function 75.
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============ Function 53, subfunction 0 - open UDP-socket. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 0 - subfunction number
|
2009-09-09 13:31:04 +02:00
|
|
|
* ecx = local port (only low word is taken into account),
|
|
|
|
ecx = 0 - let the system choose a port
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = remote port (only low word is taken into account)
|
2006-08-03 21:30:32 +02:00
|
|
|
* esi = remote IP
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 = 0xFFFFFFFF - error; ebx destroyed
|
|
|
|
* eax = socket handle (some number which unambiguously identifies
|
|
|
|
socket and have sense only for the system) - success;
|
|
|
|
ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 53, subfunction 1 - close UDP-socket. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* ecx = socket handle
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - incorrect handle
|
|
|
|
* eax = 0 - success
|
|
|
|
* ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The current implementation does not close automatically all
|
|
|
|
sockets of a thread at termination. In particular, one should not
|
|
|
|
kill a thread with many opened sockets - there will be an outflow
|
|
|
|
of resources.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============== Function 53, subfunction 2 - poll socket. =============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
|
|
|
* ecx = socket handle
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2009-01-31 07:09:36 +01:00
|
|
|
* eax = number of read bytes, 0 for incorrect handle
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 53, subfunction 3 - read byte from socket. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
|
|
|
* ecx = socket handle
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2009-01-31 07:09:36 +01:00
|
|
|
* if there is no read data or handle is incorrect: eax=0, bl=0,
|
2006-08-11 15:30:23 +02:00
|
|
|
other bytes of ebx are destroyed
|
|
|
|
* if there are read data: eax=number of rest bytes
|
|
|
|
(possibly 0), bl=read byte, other bytes of ebx are destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 53, subfunction 4 - write to UDP-socket. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
|
|
|
* ecx = socket handle
|
|
|
|
* edx = number of bytes to write
|
|
|
|
* esi = pointer to data to write
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2009-01-31 07:09:36 +01:00
|
|
|
* eax = 0xffffffff - error (invalid handle or not enough memory)
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Number of bytes to write must not exceed 1500-28, though
|
|
|
|
the appropriate check is not made.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============ Function 53, subfunction 5 - open TCP-socket. ===========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
2009-09-09 13:31:04 +02:00
|
|
|
* ecx = local port (only low word is taken into account),
|
|
|
|
ecx = 0 - let the system choose a port
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = remote port (only low word is taken into account)
|
2006-08-03 21:30:32 +02:00
|
|
|
* esi = remote IP
|
2006-08-11 15:30:23 +02:00
|
|
|
* edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 = 0xFFFFFFFF - error; ebx destroys
|
|
|
|
* eax = socket handle (some number which unambiguously identifies
|
|
|
|
socket and have sense only for the system) - success;
|
|
|
|
ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 53, subfunction 6 - get TCP-socket status. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 6 - subfunction number
|
|
|
|
* ecx = socket handle
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2009-01-31 07:09:36 +01:00
|
|
|
* eax = 0 for incorrect handle or socket status: one of
|
2006-08-03 21:30:32 +02:00
|
|
|
* TCB_LISTEN = 1
|
|
|
|
* TCB_SYN_SENT = 2
|
|
|
|
* TCB_SYN_RECEIVED = 3
|
|
|
|
* TCB_ESTABLISHED = 4
|
|
|
|
* TCB_FIN_WAIT_1 = 5
|
|
|
|
* TCB_FIN_WAIT_2 = 6
|
|
|
|
* TCB_CLOSE_WAIT = 7
|
|
|
|
* TCB_CLOSING = 8
|
|
|
|
* TCB_LAST_ASK = 9
|
|
|
|
* TCB_TIME_WAIT = 10
|
|
|
|
* TCB_CLOSED = 11
|
2009-01-31 07:09:36 +01:00
|
|
|
* ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 53, subfunction 7 - write to TCP-socket. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
|
|
|
* ecx = socket handle
|
|
|
|
* edx = number of bytes to write
|
|
|
|
* esi = pointer to data to write
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2009-01-31 07:09:36 +01:00
|
|
|
* eax = 0xffffffff - error (invalid handle or not enough memory)
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Number of bytes to write must not exceed 1500-40, though
|
|
|
|
the appropriate check is not made.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 53, subfunction 8 - close TCP-socket. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
|
|
|
* ecx = socket handle
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2009-01-31 07:09:36 +01:00
|
|
|
* eax = -1 - error (invalid handle or
|
|
|
|
not enough memory for socket close packet)
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The current implementation does not close automatically all
|
|
|
|
sockets of a thread at termination. In particular, one should not
|
|
|
|
kill a thread with many opened sockets - there will be an outflow
|
|
|
|
of resources.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=== Function 53, subfunction 9 - check whether local port is free. ===
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 9 - subfunction number
|
|
|
|
* ecx = local port number (low 16 bits are used only)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0 - port is used
|
|
|
|
* eax = 1 - port is free
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-02-02 16:09:14 +01:00
|
|
|
======================================================================
|
|
|
|
===== Function 53, subfunction 10 - query Ethernet cable status. =====
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 10 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* al = -1 - a network driver is not loaded or
|
|
|
|
does not support this function
|
|
|
|
* al = 0 - Ethernet cable is unplugged
|
|
|
|
* al = 1 - Ethernet cable is plugged
|
2007-02-14 17:01:07 +01:00
|
|
|
* ebx destroyed
|
2007-02-02 16:09:14 +01:00
|
|
|
Remarks:
|
|
|
|
* The current kernel implementation supports this function
|
|
|
|
only for RTL8139 network cards.
|
|
|
|
|
2007-02-12 02:06:46 +01:00
|
|
|
======================================================================
|
2007-02-14 17:01:07 +01:00
|
|
|
======= Function 53, subfunction 11 - read network stack data. =======
|
2007-02-12 02:06:46 +01:00
|
|
|
======================================================================
|
2007-02-14 17:01:07 +01:00
|
|
|
Paramters:
|
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 11 - subfunction number
|
|
|
|
* ecx = socket handle
|
|
|
|
* edx = pointer to buffer
|
|
|
|
* esi = number of bytes to read;
|
|
|
|
* esi = 0 - read all data (maximum 4096 bytes)
|
|
|
|
Returned value:
|
2009-01-31 07:09:36 +01:00
|
|
|
* eax = number of bytes read (0 for incorrect handle)
|
2007-02-14 17:01:07 +01:00
|
|
|
* ebx destroyed
|
2007-02-12 02:06:46 +01:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2012-02-26 05:22:47 +01:00
|
|
|
= Function 53, subfunction 255 - debug information of network driver.
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 53 - function number
|
|
|
|
* ebx = 255 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = type of requested information (see below)
|
|
|
|
Returned value:
|
|
|
|
* eax = requested information
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx destroyed
|
|
|
|
Possible values for ecx:
|
2006-08-03 21:30:32 +02:00
|
|
|
* 100: length of queue 0 (empty queue)
|
|
|
|
* 101: length of queue 1 (ip-out queue)
|
|
|
|
* 102: length of queue 2 (ip-in queue)
|
|
|
|
* 103: length of queue 3 (net1out queue)
|
2006-08-11 15:30:23 +02:00
|
|
|
* 200: number of items in the ARP table
|
|
|
|
* 201: size of the ARP table (in items) (20 for current version)
|
|
|
|
* 202: read item at edx of the ARP table to the temporary buffer,
|
|
|
|
whence 5 following types take information;
|
2006-08-03 21:30:32 +02:00
|
|
|
in this case eax is not defined
|
2006-08-11 15:30:23 +02:00
|
|
|
* 203: IP-address saved by type 202
|
|
|
|
* 204: high dword of MAC-address saved by type 202
|
|
|
|
* 205: low word of MAC-address saved by type 202
|
|
|
|
* 206: status word saved by type 202
|
|
|
|
* 207: ttl word saved by type 202
|
|
|
|
* 2: total number of received IP-packets
|
|
|
|
* 3: total number of transferred IP-packets
|
|
|
|
* 4: total number of dumped received packets
|
|
|
|
* 5: total number of received ARP-packets
|
|
|
|
* 6: status of packet driver, 0=inactive, nonzero=active
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2012-02-26 05:22:47 +01:00
|
|
|
Function 55, subfunction 55 - begin to play data on built-in speaker.
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 55 - function number
|
|
|
|
* ebx = 55 - subfunction number
|
|
|
|
* esi = pointer to data
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 55 - error (speaker is off or busy)
|
|
|
|
Data is an array of items with variable length.
|
|
|
|
Format of each item is defined by first byte:
|
2006-08-03 21:30:32 +02:00
|
|
|
* 0 = end of data
|
2006-08-11 15:30:23 +02:00
|
|
|
* 1..0x80 = sets sound duration on 1/100 of second; sound note
|
|
|
|
is defined by immediate value of frequency
|
|
|
|
* following word (2 bytes) contains frequency divider;
|
|
|
|
frequency is defined as 1193180/divider
|
2006-08-03 21:30:32 +02:00
|
|
|
* 0x81 = invalid
|
2006-08-11 15:30:23 +02:00
|
|
|
* 0x82..0xFF = note is defined by octave and number:
|
|
|
|
* duration in 1/100 of second = (first byte)-0x81
|
2006-08-03 21:30:32 +02:00
|
|
|
* there is one more byte;
|
2006-08-11 15:30:23 +02:00
|
|
|
* (second byte)=0xFF - delay
|
|
|
|
* otherwise it looks like a*0x10+b, where b=number of the note in
|
|
|
|
an octave from 1 to 12, a=number of octave (beginning from 0)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Speaker play can be disabled/enabled by
|
|
|
|
subfunction 8 of function 18.
|
|
|
|
* Function returns control, having informed the system
|
|
|
|
an information on request. Play itself goes independently from
|
|
|
|
the program.
|
|
|
|
* The data must be kept in the memory at least up to the end
|
|
|
|
of play.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-09-23 22:58:50 +02:00
|
|
|
======================================================================
|
|
|
|
======================= Function 57 - PCI BIOS. ======================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 57 - function number
|
|
|
|
* ebp corresponds to al in PCI BIOS specification
|
|
|
|
* other registers are set according to PCI BIOS specification
|
|
|
|
Returned value:
|
|
|
|
* CF is undefined
|
|
|
|
* other registers are set according to PCI BIOS specification
|
|
|
|
Remarks:
|
|
|
|
* Many effects of this function can be also achieved with
|
|
|
|
corresponding subfunctions of function 62.
|
|
|
|
* The function calls PCI32 BIOS extension, documented e.g. in
|
|
|
|
http://alpha1.dyns.net/files/PCI/bios21.pdf.
|
|
|
|
* If BIOS does not support this extension, its behavior is emulated
|
|
|
|
(through kernel-mode analogues of subfunctions of function 62).
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
================ Function 58 - work with file system. ================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 58
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx = pointer to the information structure
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success; otherwise file system error code
|
|
|
|
* some subfunctions return value in other registers too
|
|
|
|
General format of the information structure:
|
|
|
|
* +0: dword: subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* +4: dword: number of block
|
|
|
|
* +8: dword: size
|
2006-08-11 15:30:23 +02:00
|
|
|
* +12 = +0xC: dword: pointer to data
|
|
|
|
* +16 = +0x10: dword: pointer to a memory for system operations
|
2006-08-03 21:30:32 +02:00
|
|
|
(4096 bytes)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +20 = +0x14: n db: ASCIIZ-string with the file name
|
|
|
|
Specifications - in documentation on the appropriate subfunction.
|
|
|
|
Filename is case-insensitive for latin letters, russian letters
|
|
|
|
must be capital.
|
|
|
|
Format of filename:
|
2006-08-03 21:30:32 +02:00
|
|
|
/base/number/dir1/dir2/.../dirn/file,
|
2006-08-11 15:30:23 +02:00
|
|
|
where /base/number identifies device, on which file is located:
|
2006-08-03 21:30:32 +02:00
|
|
|
one of
|
2006-08-11 15:30:23 +02:00
|
|
|
* /RD/1 = /RAMDISK/1 to access ramdisk
|
|
|
|
* /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
|
|
|
|
/FD/2 = /FLOPPYDISK/2 to access second one
|
|
|
|
* /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
|
|
|
|
(in this case base is defined by subfunction 7 of function 21),
|
|
|
|
x - partition number (beginning from 1)
|
|
|
|
* /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
|
|
|
|
IDE0 (Primary Master), IDE1 (Primary Slave),
|
2006-08-03 21:30:32 +02:00
|
|
|
IDE2 (Secondary Master), IDE3 (Secondary Slave);
|
2006-08-11 15:30:23 +02:00
|
|
|
x - partition number on the selected hard drive, varies from 1
|
|
|
|
to 255 (on each hard drive the indexing starts from 1)
|
|
|
|
Remarks:
|
|
|
|
* In the first two cases it is also possible to use FIRST
|
|
|
|
instead of 1, SECOND instead of 2, but it is not recommended
|
|
|
|
for convenience of transition to the future extensions.
|
|
|
|
* Limitation n<=39 is imposed.
|
|
|
|
* Names of folders and file dir1,...,dirn,file must have the
|
|
|
|
format 8.3: name no more than 8 characters, dot, extension no
|
|
|
|
more than 3 characters. Trailing spaces are ignored, no other
|
|
|
|
spaces is allowed. If name occupies equally 8 characters,
|
|
|
|
dot may be omitted (though it is not recommended to use this
|
|
|
|
feature for convenience of transition to the future extensions).
|
|
|
|
* This function does not support folders on ramdisk.
|
2006-08-03 21:30:32 +02:00
|
|
|
Examples:
|
|
|
|
* '/RAMDISK/FIRST/KERNEL.ASM',0
|
|
|
|
'/rd/1/kernel.asm',0
|
|
|
|
* '/HD0/1/kernel.asm',0
|
|
|
|
* '/hd0/1/menuet/pics/tanzania.bmp',0
|
2006-08-11 15:30:23 +02:00
|
|
|
Existing subfunctions:
|
|
|
|
* subfunction 0 - read file/folder
|
|
|
|
* subfunction 8 - LBA-read from device
|
|
|
|
* subfunction 15 - get file system information
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 58, subfunction 0 - read file/folder. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 58
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 0 = subfunction number
|
|
|
|
* +4: dword: first block to read (beginning from 0)
|
|
|
|
* +8: dword: amount of blocks to read
|
|
|
|
* +12 = +0xC: dword: pointer to buffer for data
|
|
|
|
* +16 = +0x10: dword: pointer to buffer for system operations
|
2006-08-03 21:30:32 +02:00
|
|
|
(4096 bytes)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx = file size (in bytes) or -1=0xffffffff, if file was not found
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Block size is 512 bytes.
|
2006-08-03 21:30:32 +02:00
|
|
|
* This function is obsolete, for reading files use subfunction 0
|
2006-08-11 15:30:23 +02:00
|
|
|
of function 70, for reading folders - subfunction 1 of
|
|
|
|
function 70.
|
|
|
|
* Function can read contents of a folder. Only FAT file system is
|
|
|
|
supported. The format of FAT-folder is described
|
|
|
|
in any FAT documentation.
|
|
|
|
* Size of a folder is determined by size of FAT clusters chain.
|
|
|
|
* If file was ended before last requested block was read,
|
|
|
|
the function will read as many as it can, and after that return
|
|
|
|
eax=6 (EOF).
|
|
|
|
* Function can read root folders /rd/1,/fd/x,/hd[n]/x, but
|
|
|
|
in the first two cases the current implementation does not follow
|
|
|
|
to the declared rules:
|
2006-08-03 21:30:32 +02:00
|
|
|
for /rd/1:
|
2006-08-11 15:30:23 +02:00
|
|
|
* if one want to read 0 blocks, function considers,
|
|
|
|
that he requested 1;
|
|
|
|
* if one requests more than 14 blocks or starting block is
|
2013-05-28 00:16:00 +02:00
|
|
|
not less than 14, function returns eax=5 (not found) and ebx=-1;
|
2012-02-26 05:22:47 +01:00
|
|
|
* size of ramdisk root folder is 14 blocks,
|
2013-05-28 00:16:00 +02:00
|
|
|
0x1C00=7168 bytes; but function returns ebx=0
|
2006-08-11 15:30:23 +02:00
|
|
|
(except of the case of previous item);
|
|
|
|
* strangely enough, it is possible to read 14th block (which
|
|
|
|
generally contains a garbage - I remind, the indexing begins
|
|
|
|
from 0);
|
|
|
|
* if some block with the number not less than 14 was requested,
|
|
|
|
function returns eax=6(EOF); otherwise eax=0.
|
|
|
|
For /fd/x:
|
|
|
|
* if the start block is not less than 14, function returns
|
|
|
|
eax=5 (not found) and ebx=0;
|
|
|
|
* note that format of FAT12 allows floppies with the root size
|
|
|
|
more or less than 14 blocks;
|
|
|
|
* check for length is not performed;
|
|
|
|
* if data was successful read, function returns
|
|
|
|
eax=0,ebx=0; otherwise eax=10 (access denied), ebx=-1.
|
|
|
|
* The function handles reading of special folders /,/rd,/fd,/hd[n];
|
|
|
|
but the result does not correspond to expected (on operations with
|
|
|
|
normal files/folders), does not follow the declared rules,
|
|
|
|
may be changed in future versions of the kernel and consequently
|
|
|
|
is not described. To obtain the information about the equipment
|
|
|
|
use subfunction 11 of function 18 or
|
|
|
|
read corresponding folder with subfunction 1 of function 70.
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 58, subfunction 8 - LBA-read from device. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 58 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 8 = subfunction number
|
|
|
|
* +4: dword: number of block to read (beginning from 0)
|
|
|
|
* +8: dword: ignored (set to 1)
|
|
|
|
* +12 = +0xC: dword: pointer to buffer for data (512 bytes)
|
|
|
|
* +16 = +0x10: dword: pointer to buffer for system operations
|
2006-08-03 21:30:32 +02:00
|
|
|
(4096 bytes)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
|
|
|
|
/rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
|
2006-08-03 21:30:32 +02:00
|
|
|
1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
|
2006-08-11 15:30:23 +02:00
|
|
|
Instead of digits it is allowed, though not recommended for
|
|
|
|
convenience of transition to future extensions, to use
|
|
|
|
'first','second','third','fourth'.
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* for device name /hd/xxx, where xxx is not in the list above:
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = ebx = 1
|
2006-08-11 15:30:23 +02:00
|
|
|
* for invalid device name (except for the previous case):
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 5
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx does not change
|
|
|
|
* if LBA-access is disabled by subfunction 11 of function 21:
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 2
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx destroyed
|
|
|
|
* for ramdisk: attempt to read block outside ramdisk
|
|
|
|
(18*2*80 blocks) results in
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 3
|
|
|
|
* ebx = 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* for successful read:
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = ebx = 0
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Block size is 512 bytes; function reads one block.
|
|
|
|
* Do not depend on returned value, it can be changed
|
|
|
|
in future versions.
|
2012-02-26 05:22:47 +01:00
|
|
|
* Function requires that LBA-access to devices is enabled by
|
|
|
|
subfunction 11 of function 21. To check this one can use
|
2006-08-11 15:30:23 +02:00
|
|
|
subfunction 11 of function 26.
|
|
|
|
* LBA-read of floppy is not supported.
|
|
|
|
* Function reads data on physical hard drive; if for any reason
|
|
|
|
data of the concrete partition are required, application must
|
|
|
|
define starting sector of this partition (either directly
|
|
|
|
through MBR, or from the full structure returned by
|
2013-05-28 00:16:00 +02:00
|
|
|
subfunction 11 of function 18).
|
2006-08-11 15:30:23 +02:00
|
|
|
* Function does not check error code of hard disk, so request of
|
|
|
|
nonexisting sector reads something (most probably it will be
|
|
|
|
zeroes, but this is defined by device) and this is considered
|
|
|
|
as success (eax=0).
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
==== Function 58, subfunction 15 - get information on file system. ===
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 58 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 15 = subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* +4: dword: ignored
|
|
|
|
* +8: dword: ignored
|
|
|
|
* +12 = +0xC: dword: ignored
|
|
|
|
* +16 = +0x10: dword: ignored
|
2006-08-11 15:30:23 +02:00
|
|
|
* +20 = +0x14: (only second character is checked)
|
2006-08-03 21:30:32 +02:00
|
|
|
/rd=/RAMDISK or /hd=/HARDDISK
|
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* if the second character does not belong to set {'r','R','h','H'}:
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 3
|
|
|
|
* ebx = ecx = dword [fileinfo] = 0
|
|
|
|
* for ramdisk:
|
|
|
|
* eax = 0 (success)
|
|
|
|
* ebx = total number of clusters = 2847
|
|
|
|
* ecx = number of free clusters
|
|
|
|
* dword [fileinfo] = cluster size = 512
|
2006-08-11 15:30:23 +02:00
|
|
|
* for hard disk: base and partition are defined by subfunctions
|
|
|
|
7 and 8 of function 21:
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 0 (success)
|
|
|
|
* ebx = total number of clusters
|
|
|
|
* ecx = number of free clusters
|
|
|
|
* dword [fileinfo] = cluster size (in bytes)
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Be not surprised to strange layout of 4th returned parameter
|
|
|
|
- when this code was writing, at system calls application got
|
|
|
|
only registers eax,ebx,ecx (from pushad-structure transmitted
|
|
|
|
as argument to the system function). Now it is corrected, so,
|
|
|
|
probably, it is meaningful to return cluster size in edx, while
|
|
|
|
this function is not used yet.
|
|
|
|
* There exists also subfunction 11 of function 18,
|
|
|
|
which returns information on file system. From the full table
|
|
|
|
of disk subsystem it is possible to deduce cluster size (there
|
|
|
|
it is stored in sectors) and total number of clusters
|
|
|
|
for hard disks.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
========== Function 60 - Inter Process Communication (IPC). ==========
|
|
|
|
======================================================================
|
|
|
|
IPC is used for message dispatching from one process/thread to
|
|
|
|
another. Previously it is necessary to agree how to interpret
|
2006-08-03 21:30:32 +02:00
|
|
|
the concrete message.
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
----------- Subfunction 1 - set the area for IPC receiving -----------
|
|
|
|
Is called by process-receiver.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 60 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* ecx = pointer to the buffer
|
|
|
|
* edx = size of the buffer
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - always success
|
|
|
|
Format of IPC-buffer:
|
|
|
|
* +0: dword: if nonzero, buffer is considered locked;
|
|
|
|
lock/unlock the buffer, when you work with it and need that
|
|
|
|
buffer data are not changed from outside (no new messages)
|
2006-08-03 21:30:32 +02:00
|
|
|
* +4: dword: occupied place in the buffer (in bytes)
|
|
|
|
* +8: first message
|
|
|
|
* +8+n: second message
|
|
|
|
* ...
|
2006-08-11 15:30:23 +02:00
|
|
|
Format of a message:
|
|
|
|
* +0: dword: PID of sender
|
|
|
|
* +4: dword: message length (not including this header)
|
|
|
|
* +8: n*byte: message data
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
------------------ Subfunction 2 - send IPC message ------------------
|
|
|
|
Is called by process-sender.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 60 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = PID of receiver
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = pointer to the message data
|
|
|
|
* esi = message length (in bytes)
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - the receiver has not defined buffer for IPC messages
|
|
|
|
(can be, still have no time,
|
|
|
|
and can be, this is not right process)
|
|
|
|
* eax = 2 - the receiver has blocked IPC-buffer; try to wait a bit
|
|
|
|
* eax = 3 - overflow of IPC-buffer of the receiver
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 4 - process/thread with such PID does not exist
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Immediately after writing of IPC-message to the buffer the system
|
|
|
|
sends to the receiver the event with code 7 (see event codes).
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
==== Function 61 - get parameters for the direct graphics access. ====
|
|
|
|
======================================================================
|
|
|
|
The data of the graphics screen (the memory area which displays
|
|
|
|
screen contents) are accessible to a program directly, without
|
|
|
|
any system calls, through the selector gs:
|
2010-10-17 10:53:29 +02:00
|
|
|
mov eax, [gs:0]
|
2006-08-11 15:30:23 +02:00
|
|
|
places in eax the first dword of the buffer, which contains
|
|
|
|
information on color of the left upper point (and, possibly, colors
|
|
|
|
of several following).
|
2010-10-17 10:53:29 +02:00
|
|
|
mov [gs:0], eax
|
2006-08-11 15:30:23 +02:00
|
|
|
by work in VESA modes with LFB sets color of the left upper point
|
|
|
|
(and, possibly, colors of several following).
|
|
|
|
To interpret the data of graphics screen program needs to know
|
|
|
|
some parameters, returning by this function.
|
|
|
|
Remarks:
|
|
|
|
* Graphics parameters changes very seldom at work,
|
|
|
|
namely, only in cases, when user works with the application VRR.
|
|
|
|
* At videomode change the system redraws all windows (event
|
|
|
|
with code 1) and redraws the background (event 5).
|
|
|
|
Same events occur in other cases too, which meet much more often,
|
|
|
|
than videomode change.
|
|
|
|
* By operation in videomodes with LFB the selector gs points to
|
|
|
|
LFB itself, so reading/writing on gs result directly in
|
|
|
|
change of screen contents. By operation in videomodes without
|
|
|
|
LFB gs points to some data area in the kernel, and all functions
|
|
|
|
of screen output fulfil honesty double operation on writing
|
|
|
|
directly to the screen and writing to this buffer. In result
|
|
|
|
at reading contents of this buffer the results correspond to
|
|
|
|
screen contents (with, generally speaking, large color
|
|
|
|
resolution), and writing is ignored.
|
|
|
|
One exception is the mode 320*200, for which main loop of the
|
|
|
|
system thread updates the screen according to mouse movements.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
------------------------- Screen resolution --------------------------
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 61 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = [resolution on x axis]*65536 + [resolution on y axis]
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* One can use function 14 paying attention that
|
|
|
|
it returns sizes on 1 pixel less. It is fully equivalent way.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
---------------------- Number of bits per pixel ----------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 61 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = number of bits per pixel (24 or 32)
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
-------------------- Number of bytes per scanline --------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 61 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = number of bytes occupied by one scanline
|
2006-08-03 21:30:32 +02:00
|
|
|
(horizontal line on the screen)
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===== Function 62, subfunction 0 - get version of PCI-interface. =====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 62 - function number
|
|
|
|
* bl = 0 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - PCI access is disabled; otherwise
|
|
|
|
* ah.al = version of PCI-interface (ah=version, al=subversion)
|
|
|
|
* high word of eax is zeroed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Previously low-level access to PCI for applications must be
|
|
|
|
enabled by subfunction 12 of function 21.
|
|
|
|
* If PCI BIOS is not supported, the value of ax is undefined.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 62 - function number
|
|
|
|
* bl = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - access to PCI is disabled; otherwise
|
|
|
|
* al = number of the last PCI-bus; other bytes of eax are destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Previously low-level access to PCI for applications must be
|
|
|
|
enabled by subfunction 12 of function 21.
|
|
|
|
* If PCI BIOS is not supported, the value of ax is undefined.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===================== Function 62, subfunction 2 =====================
|
|
|
|
===== Get mechanism of addressing to the PCI configuration space. ====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 62 - function number
|
|
|
|
* bl = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - access to PCI is disabled; otherwise
|
|
|
|
* al = mechanism (1 or 2); other bytes of eax are destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Previously low-level access to PCI for applications must be
|
|
|
|
enabled by subfunction 12 of function 21.
|
|
|
|
* Addressing mechanism is selected depending on
|
|
|
|
equipment characteristics.
|
|
|
|
* Subfunctions of read and write work automatically
|
|
|
|
with the selected mechanism.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 62 - function number
|
|
|
|
* bl = 4 - read byte
|
|
|
|
* bl = 5 - read word
|
|
|
|
* bl = 6 - read dword
|
2006-08-03 21:30:32 +02:00
|
|
|
* bh = number of PCI-bus
|
2006-08-11 15:30:23 +02:00
|
|
|
* ch = dddddfff, where ddddd = number of the device on the bus,
|
|
|
|
fff = function number of device
|
|
|
|
* cl = number of register (must be even for bl=5,
|
|
|
|
divisible by 4 for bl=6)
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 - error (access to PCI is disabled or parameters
|
|
|
|
are not supported); otherwise
|
|
|
|
* al/ax/eax (depending on requested size) contains the data;
|
|
|
|
the other part of register eax is destroyed
|
|
|
|
Remarks:
|
|
|
|
* Previously low-level access to PCI for applications must be
|
|
|
|
enabled by subfunction 12 of function 21.
|
|
|
|
* Access mechanism 2 supports only 16 devices on a bus and ignores
|
|
|
|
function number. To get access mechanism use subfunction 2.
|
|
|
|
* Some registers are standard and exist for all devices, some are
|
|
|
|
defined by the concrete device. The list of registers of the
|
|
|
|
first type can be found e.g. in famous
|
2006-08-03 21:30:32 +02:00
|
|
|
Interrupt List by Ralf Brown
|
|
|
|
(http://www.pobox.com/~ralf/files.html,
|
|
|
|
ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
|
2006-08-11 15:30:23 +02:00
|
|
|
registers of the second type must be listed
|
|
|
|
in the device documentation.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 62 - function number
|
|
|
|
* bl = 8 - write byte
|
|
|
|
* bl = 9 - write word
|
|
|
|
* bl = 10 - write dword
|
2006-08-03 21:30:32 +02:00
|
|
|
* bh = number of PCI-bus
|
2006-08-11 15:30:23 +02:00
|
|
|
* ch = dddddfff, where ddddd = number of the device on the bus,
|
|
|
|
fff = function number of device
|
|
|
|
* cl = number of register (must be even for bl=9,
|
|
|
|
divisible by 4 for bl=10)
|
|
|
|
* dl/dx/edx (depending on requested size) contatins
|
|
|
|
the data to write
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 - error (access to PCI is disabled or parameters
|
|
|
|
are not supported)
|
|
|
|
* eax = 0 - success
|
|
|
|
Remarks:
|
|
|
|
* Previously low-level access to PCI for applications must be
|
|
|
|
enabled by subfunction 12 of function 21.
|
|
|
|
* Access mechanism 2 supports only 16 devices on a bus and ignores
|
|
|
|
function number. To get access mechanism use subfunction 2.
|
|
|
|
* Some registers are standard and exist for all devices, some are
|
|
|
|
defined by the concrete device. The list of registers of the
|
|
|
|
first type can be found e.g. in famous Interrupt List by
|
|
|
|
Ralf Brown; registers of the second type must be listed
|
|
|
|
in the device documentation.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============== Function 63 - work with the debug board. ==============
|
|
|
|
======================================================================
|
|
|
|
The debug board is the global system buffer (with the size
|
2007-05-16 15:59:46 +02:00
|
|
|
1024 bytes), to which any program can write (generally speaking,
|
2006-08-11 15:30:23 +02:00
|
|
|
arbitrary) data and from which other program can read these data.
|
|
|
|
By the agreement written data are text strings interpreted as
|
|
|
|
debug messages on a course of program execution. The kernel in
|
|
|
|
some situations also writes to the debug board information on
|
|
|
|
execution of some functions; by the agreement kernel messages
|
|
|
|
begins from the prefix "K : ".
|
|
|
|
For view of the debug board the application 'board' was created,
|
|
|
|
which reads data from the buffer and displays them in its window.
|
|
|
|
'board' interpretes the sequence of codes 13,10 as newline.
|
|
|
|
A character with null code in an end of line is not necessary,
|
2006-08-03 21:30:32 +02:00
|
|
|
but also does not prevent.
|
2006-08-11 15:30:23 +02:00
|
|
|
Because debugger has been written, the value of the debug board
|
|
|
|
has decreased, as debugger allows to inspect completely a course of
|
|
|
|
program execution without any efforts from the direction of program
|
|
|
|
itself. Nevertheless in some cases the debug board is still useful.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
----------------------------- Write byte -----------------------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 63 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* cl = data byte
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Byte is written to the buffer. Buffer size is 512 bytes.
|
|
|
|
At buffer overflow all obtained data are lost.
|
|
|
|
* For output to the debug board of more complicated objects
|
|
|
|
(strings, numbers) it is enough to call this function in cycle.
|
|
|
|
It is possible not to write the appropriate code manually and use
|
|
|
|
file 'debug.inc', which is included into the distributive.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
----------------------------- Read byte ------------------------------
|
|
|
|
Takes away byte from the buffer.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 63 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = ebx = 0 - the buffer is empty
|
|
|
|
* eax = byte, ebx = 1 - byte was successfully read
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============== Function 64 - resize application memory. ==============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 64 - function number
|
|
|
|
* ebx = 1 - unique subfunction
|
|
|
|
* ecx = new memory size
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - not enough memory
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-10-24 16:39:29 +02:00
|
|
|
* There is another way to dynamically allocate/free memory -
|
|
|
|
subfunctions 11, 12, 13 of function 68.
|
|
|
|
* The function cannot be used together with 68.11, 68.12, 68.13.
|
|
|
|
The function call will be ignored after creation of process heap
|
|
|
|
with function 68.11.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-01-19 16:02:33 +01:00
|
|
|
======================================================================
|
|
|
|
======== Function 65 - draw image with palette in the window. ========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 65 - function number
|
|
|
|
* ebx = pointer to the image
|
|
|
|
* ecx = [size on axis x]*65536 + [size on axis y]
|
|
|
|
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
2012-06-03 16:32:49 +02:00
|
|
|
* esi = number of bits per pixel, must be 1,2,4,8,9,15,16,24 or 32;
|
2009-01-31 07:09:36 +01:00
|
|
|
* edi = pointer to palette (2 to the power esi colors 0x00RRGGBB);
|
|
|
|
ignored when esi > 8
|
2007-02-02 16:09:14 +01:00
|
|
|
* ebp = offset of next row data relative to previous row data
|
2007-01-19 16:02:33 +01:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* Coordinates of the image are coordinates of the upper left corner
|
|
|
|
of the image relative to the window.
|
2009-01-31 07:09:36 +01:00
|
|
|
* Format of image with 1 bit per pixel: each byte of image
|
|
|
|
(possibly excluding last bytes in rows), contains information on
|
|
|
|
the color of 8 pixels, MSB corresponds to first pixel.
|
|
|
|
* Format of image with 2 bits per pixel: each byte of image
|
|
|
|
(possibly excluding last bytes in rows), contains information on
|
|
|
|
the color of 4 pixels, two MSBs correspond to first pixel.
|
|
|
|
* Format of image with 4 bits per pixel: each byte of image
|
|
|
|
excluding last bytes in rows (if width is odd) contains
|
|
|
|
information on the color of 2 pixels, high-order tetrad
|
|
|
|
corresponds to first pixel.
|
|
|
|
* Format of image with 8 bits per pixel: each byte of image is
|
|
|
|
index in the palette.
|
2012-06-03 16:32:49 +02:00
|
|
|
* Format of image with 9 bits per pixel: array of one byte values;
|
|
|
|
each byte (8 bit) represents the intensity of gray for one pixel;
|
|
|
|
this format is equal to 8bpp without palette.
|
2009-01-31 07:09:36 +01:00
|
|
|
* Format of image with 15 bits per pixel: the color of each pixel
|
|
|
|
is coded as (bit representation) 0RRRRRGGGGGBBBBB - 5 bits per
|
|
|
|
each color.
|
|
|
|
* Format of image with 16 bits per pixel: the color of each pixel
|
|
|
|
is coded as RRRRRGGGGGGBBBBB (5+6+5).
|
|
|
|
* Format of image with 24 bits per pixel: the color of each pixel
|
|
|
|
is coded as 3 bytes - sequentially blue, green, red components.
|
|
|
|
* Format of image with 32 bits per pixel: similar to 24, but
|
|
|
|
one additional ignored byte is present.
|
2007-02-02 16:09:14 +01:00
|
|
|
* The call to function 7 is equivalent to call to this function
|
|
|
|
with esi=24, ebp=0.
|
2007-01-19 16:02:33 +01:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
================== Function 66 - work with keyboard. =================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
The input mode influences results of reading keys by function 2.
|
|
|
|
When a program loads, ASCII input mode is set for it.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
-------------- Subfunction 1 - set keyboard input mode. --------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 66 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = mode:
|
|
|
|
* 0 = normal (ASCII-characters)
|
|
|
|
* 1 = scancodes
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
-------------- Subfunction 2 - get keyboard input mode. --------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 66 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = current mode
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
------------ Subfunction 3 - get status of control keys. -------------
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 66 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = bit mask:
|
2013-03-08 17:27:43 +01:00
|
|
|
* bit 0 (mask 1): left Shift is pressed
|
|
|
|
* bit 1 (mask 2): right Shift is pressed
|
|
|
|
* bit 2 (mask 4): left Ctrl is pressed
|
|
|
|
* bit 3 (mask 8): right Ctrl is pressed
|
|
|
|
* bit 4 (mask 0x10): left Alt is pressed
|
|
|
|
* bit 5 (mask 0x20): right Alt is pressed
|
|
|
|
* bit 6 (mask 0x40): CapsLock is on
|
|
|
|
* bit 7 (mask 0x80): NumLock is on
|
|
|
|
* bit 8 (mask 0x100): ScrollLock is on
|
|
|
|
* bit 9 (mask 0x200): left Win is pressed
|
|
|
|
* bit 10 (mask 0x400): right Win is pressed
|
2006-08-11 15:30:23 +02:00
|
|
|
* other bits are cleared
|
|
|
|
|
|
|
|
-------------- Subfunction 4 - set system-wide hotkey. ---------------
|
|
|
|
When hotkey is pressed, the system notifies only those applications,
|
|
|
|
which have installed it; the active application (which receives
|
|
|
|
all normal input) does not receive such keys.
|
|
|
|
The notification consists in sending event with the code 2.
|
|
|
|
Reading hotkey is the same as reading normal key - by function 2.
|
|
|
|
Parameters:
|
|
|
|
* eax = 66 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
|
|
|
* cl determines key scancode;
|
|
|
|
use cl=0 to give combinations such as Ctrl+Shift
|
|
|
|
* edx = 0xXYZ determines possible states of control keys:
|
|
|
|
* Z (low 4 bits) determines state of LShift and RShift:
|
|
|
|
* 0 = no key must be pressed;
|
|
|
|
* 1 = exactly one key must be pressed;
|
|
|
|
* 2 = both keys must be pressed;
|
|
|
|
* 3 = must be pressed LShift, but not RShift;
|
|
|
|
* 4 = must be pressed RShift, but not LShift
|
|
|
|
* Y - similar for LCtrl and RCtrl;
|
|
|
|
* X - similar for LAlt and RAlt
|
|
|
|
Returned value:
|
|
|
|
* eax=0 - success
|
|
|
|
* eax=1 - too mant hotkeys (maximum 256 are allowed)
|
|
|
|
Remarks:
|
|
|
|
* Hotkey can work either at pressing or at release. Release
|
|
|
|
scancode of a key is more on 128 than pressing scancode
|
|
|
|
(i.e. high bit is set).
|
|
|
|
* Several applications can set the same combination;
|
|
|
|
all such applications will be informed on pressing
|
|
|
|
such combination.
|
|
|
|
|
|
|
|
-------------- Subfunction 5 - delete installed hotkey. --------------
|
|
|
|
Parameters:
|
|
|
|
* eax = 66 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
|
|
|
* cl = scancode of key and edx = 0xXYZ the same as in subfunction 4
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 1 - there is no such hotkey
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* When a process/thread terminates, all hotkey installed by it are
|
|
|
|
deleted.
|
|
|
|
* The call to this subfunction does not affect other applications.
|
|
|
|
If other application has defined the same combination, it will
|
|
|
|
still receive notices.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2012-06-01 02:58:16 +02:00
|
|
|
--------------- Subfunction 6 - block the normal input. --------------
|
|
|
|
Parameters:
|
|
|
|
* eax = 66 - function number
|
|
|
|
* ebx = 6 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* Blocking the normal keyboard input for installed hotkeys
|
|
|
|
* To emulate a mouse via the keyboard, the application MOUSEMUL
|
|
|
|
|
|
|
|
------------ Subfunction 7 - unlock the normal input. ----------------
|
|
|
|
Parameters:
|
|
|
|
* eax = 66 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
|
|
|
* Unlocking the results of the f. 66.6
|
|
|
|
* To emulate a mouse via the keyboard, the application MOUSEMUL
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========= Function 67 - change position/sizes of the window. =========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 67 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ebx = new x-coordinate of the window
|
|
|
|
* ecx = new y-coordinate of the window
|
|
|
|
* edx = new x-size of the window
|
|
|
|
* esi = new y-size of the window
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The value -1 for a parameter means "do not change"; e.g. to move
|
|
|
|
the window without resizing it is possible to specify edx=esi=-1.
|
|
|
|
* Previously the window must be defined by function 0.
|
2006-08-03 21:30:32 +02:00
|
|
|
It sets initial coordinates and sizes of the window.
|
2006-08-11 15:30:23 +02:00
|
|
|
* Sizes of the window are understood in sense of function 0,
|
|
|
|
that is one pixel less than real sizes.
|
|
|
|
* The function call for maximized windows is simply ignored.
|
|
|
|
* For windows of appropriate styles position and/or sizes can be
|
|
|
|
changed by user; current position and sizes can be obtained by
|
|
|
|
call to function 9.
|
|
|
|
* The function sends to the window redraw event (with the code 1).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
====== Function 68, subfunction 0 - get the task switch counter. =====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 0 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = number of task switches from the system booting
|
|
|
|
(modulo 2^32)
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======= Function 68, subfunction 1 - switch to the next thread. ======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
The function completes the current time slice allocated to the
|
|
|
|
thread and switches to the next. (Which thread in which process
|
|
|
|
will be next, is unpredictable). Later, when execution queue
|
|
|
|
will reach the current thread, execution will be continued.
|
2006-08-03 21:30:32 +02:00
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
============= Function 68, subfunction 2 - cache + rdpmc. ============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
|
|
|
* ecx = required action:
|
|
|
|
* ecx = 0 - enable instruction 'rdpmc'
|
|
|
|
(ReaD Performance-Monitoring Counters) for applications
|
|
|
|
* ecx = 1 - find out whether cache is disabled/enabled
|
|
|
|
* ecx = 2 - enable cache
|
|
|
|
* ecx = 3 - disable cache
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* for ecx=0:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = the value of cr4
|
2006-08-03 21:30:32 +02:00
|
|
|
* for ecx=1:
|
|
|
|
* eax = (cr0 and 0x60000000):
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - cache is on
|
|
|
|
* eax <> 0 - cache is off
|
2006-08-03 21:30:32 +02:00
|
|
|
* for ecx=2 and ecx=3:
|
|
|
|
* function does not return value
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=========== Function 68, subfunction 3 - read MSR-register. ==========
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
MSR = Model Specific Register; the complete list of MSR-registers
|
|
|
|
of a processor is included to the documentation on it (for example,
|
|
|
|
IA-32 Intel Architecture Software Developer's Manual,
|
|
|
|
Volume 3, Appendix B); each processor family has its own subset
|
|
|
|
of the MSR-registers.
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
|
|
|
* ecx is ignored
|
|
|
|
* edx = MSR address
|
|
|
|
Returned value:
|
|
|
|
* ebx:eax = high:low dword of the result
|
|
|
|
Remarks:
|
|
|
|
* If ecx contains nonexistent or not implemented for this processor
|
|
|
|
MSR, processor will generate an exception in the kernel, which
|
|
|
|
will kill the thread.
|
|
|
|
* Previously it is necessary to check, whether MSRs are supported
|
|
|
|
as a whole, with the instruction 'cpuid'. Otherwise processor
|
|
|
|
will generate other exception in the kernel, which will anyway
|
|
|
|
kill the thread.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
========= Function 68, subfunction 4 - write to MSR-register. ========
|
|
|
|
======================================================================
|
|
|
|
MSR = Model Specific Register; the complete list of MSR-registers
|
|
|
|
of a processor is included to the documentation on it (for example,
|
|
|
|
IA-32 Intel Architecture Software Developer's Manual,
|
|
|
|
Volume 3, Appendix B); each processor family has its own subset
|
|
|
|
of the MSR-registers.
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
|
|
|
* ecx is ignored
|
|
|
|
* edx = MSR address
|
|
|
|
* esi:edi = high:low dword
|
|
|
|
Returned value:
|
2007-05-16 15:59:46 +02:00
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If ecx contains nonexistent or not implemented for this processor
|
|
|
|
MSR, processor will generate an exception in the kernel, which
|
|
|
|
will kill the thread.
|
|
|
|
* Previously it is necessary to check, whether MSRs are supported
|
|
|
|
as a whole, with the instruction 'cpuid'. Otherwise processor
|
|
|
|
will generate other exception in the kernel, which will anyway
|
|
|
|
kill the thread.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-10-24 16:39:29 +02:00
|
|
|
======= Function 68, subfunction 11 - initialize process heap. =======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 68 - function number
|
2006-10-24 16:39:29 +02:00
|
|
|
* ebx = 11 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-10-24 16:39:29 +02:00
|
|
|
* eax = 0 - failed
|
|
|
|
* otherwise size of created heap
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-10-24 16:39:29 +02:00
|
|
|
* The function call initializes heap, from which one can in future
|
|
|
|
allocate and free memory blocks with subfunctions 12 and 13.
|
|
|
|
Heap size is equal to total amount of free application memory.
|
|
|
|
* The second function call from the same process results in
|
|
|
|
returning the size of the existing heap.
|
|
|
|
* After creation of the heap calls to function 64 will be ignored.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-10-24 16:39:29 +02:00
|
|
|
======== Function 68, subfunction 12 - allocate memory block. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 68 - function number
|
2006-10-24 16:39:29 +02:00
|
|
|
* ebx = 12 - subfunction number
|
|
|
|
* ecx = required size in bytes
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-10-24 16:39:29 +02:00
|
|
|
* eax = pointer to the allocated block
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-10-24 16:39:29 +02:00
|
|
|
* Before this call one must initialize process heap by call to
|
|
|
|
subfunction 11.
|
|
|
|
* The function allocates an integer number of pages (4 Kb) in such
|
|
|
|
way that the real size of allocated block is more than or equal to
|
|
|
|
requested size.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-10-24 16:39:29 +02:00
|
|
|
========== Function 68, subfunction 13 - free memory block. ==========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 68 - function number
|
2006-10-24 16:39:29 +02:00
|
|
|
* ebx = 13 - subfunction number
|
|
|
|
* ecx = pointer to the memory block
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-10-24 16:39:29 +02:00
|
|
|
* eax = 1 - success
|
|
|
|
* eax = 0 - failed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2007-04-02 16:29:39 +02:00
|
|
|
* The memory block must have been allocated by subfunction 12
|
|
|
|
or subfunction 20.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2009-05-22 10:55:09 +02:00
|
|
|
===================== Function 68, subfunction 14 ====================
|
2010-10-17 10:53:29 +02:00
|
|
|
============ Wait for signal from another program/driver. ============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 68 - function number
|
2006-10-24 16:39:29 +02:00
|
|
|
* ebx = 14 - subfunction number
|
2009-05-22 10:55:09 +02:00
|
|
|
* ecx = pointer to the buffer for information (24 bytes)
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-10-24 16:39:29 +02:00
|
|
|
* buffer pointed to by ecx contains the following information:
|
2010-10-17 10:53:29 +02:00
|
|
|
* +0: dword: identifier for following data of signal
|
|
|
|
* +4: dword: data of signal (20 bytes), format of which is defined
|
|
|
|
by the first dword
|
2006-10-24 16:39:29 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============= Function 68, subfunction 16 - load driver. =============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 16 - subfunction number
|
|
|
|
* ecx = pointer to ASCIIZ-string with driver name
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - failed
|
|
|
|
* otherwise eax = driver handle
|
|
|
|
Remarks:
|
|
|
|
* If the driver was not loaded yet, it is loaded;
|
|
|
|
if the driver was loaded yet, nothing happens.
|
|
|
|
* Driver name is case-sensitive.
|
|
|
|
Maximum length of the name is 16 characters, including
|
|
|
|
terminating null character, the rest is ignored.
|
2007-02-14 17:01:07 +01:00
|
|
|
* Driver ABC is loaded from file /rd/1/drivers/ABC.obj.
|
2006-10-24 16:39:29 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============ Function 68, subfunction 17 - driver control. ===========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 17 - subfunction number
|
|
|
|
* ecx = pointer to the control structure:
|
|
|
|
* +0: dword: handle of driver
|
|
|
|
* +4: dword: code of driver function
|
|
|
|
* +8: dword: pointer to input data
|
|
|
|
* +12 = +0xC: dword: size of input data
|
|
|
|
* +16 = +0x10: dword: pointer to output data
|
|
|
|
* +20 = +0x14: dword: size of output data
|
|
|
|
Returned value:
|
2010-10-17 10:53:29 +02:00
|
|
|
* eax = determined by driver
|
2006-10-24 16:39:29 +02:00
|
|
|
Remarks:
|
|
|
|
* Function codes and the structure of input/output data
|
|
|
|
are defined by driver.
|
|
|
|
* Previously one must obtain driver handle by subfunction 16.
|
|
|
|
|
2007-01-17 15:43:18 +01:00
|
|
|
======================================================================
|
|
|
|
=============== Function 68, subfunction 19 - load DLL. ==============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 19 - subfunction number
|
|
|
|
* ecx = pointer to ASCIIZ-string with the full path to DLL
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - failed
|
|
|
|
* otherwise eax = pointer to DLL export table
|
|
|
|
Remarks:
|
|
|
|
* Export table is an array of structures of 2 dword's, terminated
|
|
|
|
by zero. The first dword in structure points to function name,
|
|
|
|
the second dword contains address of function.
|
|
|
|
|
2007-04-02 16:29:39 +02:00
|
|
|
======================================================================
|
|
|
|
======= Function 68, subfunction 20 - reallocate memory block. =======
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 20 - subfunction number
|
|
|
|
* ecx = new size in bytes
|
|
|
|
* edx = pointer to already allocated block
|
|
|
|
Returned value:
|
|
|
|
* eax = pointer to the reallocated block, 0 = error
|
|
|
|
Remarks:
|
|
|
|
* Before this call one must initialize process heap by call to
|
|
|
|
subfunction 11.
|
|
|
|
* The function allocates an integer number of pages (4 Kb) in such
|
|
|
|
way that the real size of allocated block is more than or equal to
|
|
|
|
requested size.
|
|
|
|
* If edx=0, the function call is equivalent to memory allocation
|
|
|
|
with subfunction 12. Otherwise the block at edx
|
|
|
|
must be allocated earlier with subfunction 12 or this subfunction.
|
|
|
|
* If ecx=0, the function frees memory block at edx and returns 0.
|
|
|
|
* The contents of the block are unchanged up to the shorter of
|
|
|
|
the new and old sizes.
|
|
|
|
|
2012-04-25 21:49:25 +02:00
|
|
|
======================================================================
|
|
|
|
=========== Function 68, subfunction 21 - load driver PE. ============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 21 - subfunction number
|
|
|
|
* ecx = pointer to ASCIIZ-string with driver name
|
2012-04-25 23:35:25 +02:00
|
|
|
* edx = pointer to command line
|
2012-04-25 21:49:25 +02:00
|
|
|
Returned value:
|
|
|
|
* eax = 0 - failed
|
|
|
|
* otherwise eax = driver handle
|
|
|
|
Remarks:
|
|
|
|
* If the driver was not loaded yet, it is loaded;
|
|
|
|
if the driver was loaded yet, nothing happens.
|
|
|
|
|
2009-05-23 10:23:03 +02:00
|
|
|
======================================================================
|
2010-10-17 10:53:29 +02:00
|
|
|
======== Function 68, subfunction 22 - open named memory area. =======
|
2009-05-23 10:23:03 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
2010-10-17 10:53:29 +02:00
|
|
|
* ebx = 22 - subfunction number
|
|
|
|
* ecx = area name. Maximum of 31 characters with terminating zero
|
|
|
|
* edx = area size in bytes for SHM_CREATE and SHM_OPEN_ALWAYS
|
|
|
|
* esi = flags for open and access:
|
|
|
|
* SHM_OPEN = 0x00 - open existing memory area. If an area
|
|
|
|
with such name does not exist, the function
|
|
|
|
will return error code 5.
|
|
|
|
* SHM_OPEN_ALWAYS = 0x04 - open existing or create new
|
|
|
|
memory area.
|
|
|
|
* SHM_CREATE = 0x08 - create new memory area. If an area
|
|
|
|
with such name already exists, the function
|
|
|
|
will return error code 10.
|
|
|
|
* SHM_READ = 0x00 - only read access
|
|
|
|
* SHM_WRITE = 0x01 - read and write access
|
|
|
|
Returned value:
|
|
|
|
* eax = pointer to memory area, 0 if error has occured
|
|
|
|
* if new area is created (SHM_CREATE or SHM_OPEN_ALWAYS):
|
|
|
|
edx = 0 - success, otherwise - error code
|
|
|
|
* if existing area is opened (SHM_OPEN or SHM_OPEN_ALWAYS):
|
|
|
|
edx = error code (if eax=0) or area size in bytes
|
|
|
|
Error codes:
|
|
|
|
* E_NOTFOUND = 5
|
|
|
|
* E_ACCESS = 10
|
|
|
|
* E_NOMEM = 30
|
|
|
|
* E_PARAM = 33
|
|
|
|
Remarks:
|
|
|
|
* Before this call one must initialize process heap by call to
|
|
|
|
subfunction 11.
|
|
|
|
* If a new area is created, access flags set maximal rights
|
|
|
|
for other processes. An attempt from other process to open
|
|
|
|
with denied rights will fail with error code E_ACCESS.
|
|
|
|
* The process which has created an area always has write access.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
======= Function 68, subfunction 23 - close named memory area. =======
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 23 - subfunction number
|
|
|
|
* ecx = area name. Maximum of 31 characters with terminating zero
|
2009-05-23 10:23:03 +02:00
|
|
|
Returned value:
|
2010-10-17 10:53:29 +02:00
|
|
|
* eax destroyed
|
2009-05-23 10:23:03 +02:00
|
|
|
Remarks:
|
2010-10-17 10:53:29 +02:00
|
|
|
* A memory area is physically freed (with deleting all data and
|
|
|
|
freeing physical memory), when all threads which have opened
|
|
|
|
this area will close it.
|
|
|
|
* When thread is terminating, all opened by it areas are closed.
|
2009-05-23 10:23:03 +02:00
|
|
|
|
|
|
|
======================================================================
|
2010-10-17 10:53:29 +02:00
|
|
|
======== Function 68, subfunction 24 - set exception handler. ========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 24 - subfunction number
|
|
|
|
* ecx = address of the new exception handler
|
|
|
|
* edx = the mask of handled exceptions
|
|
|
|
Returned value:
|
|
|
|
* eax = address of the old exception handler (0, if it was not set)
|
|
|
|
* ebx = the old mask of handled exceptions
|
|
|
|
Remarks:
|
|
|
|
* Bit number in mask of exceptions corresponds to exception number
|
|
|
|
in CPU-specification (Intel-PC). For example, FPU exceptions have
|
|
|
|
number 16 (#MF), and SSE exceptions - 19 (#XF).
|
|
|
|
* The current implementation ignores the inquiry for hook of 7
|
|
|
|
exception - the system handles #NM by its own.
|
|
|
|
* The exception handler is called with exception number as first
|
|
|
|
(and only) stack parameter. So, correct exit from the handler is
|
|
|
|
RET 4. It returns to the instruction, that caused the exception,
|
|
|
|
for faults, and to the next instruction for traps (see
|
|
|
|
classification of exceptions in CPU specification).
|
|
|
|
* When user handler receives control, the corresponding bit in
|
|
|
|
the exception mask is cleared. Raising this exception
|
|
|
|
in consequence leads to default handling, that is,
|
|
|
|
terminating the application in absence of debugger or
|
|
|
|
suspend with notification of debugger otherwise.
|
|
|
|
* After user handler completes critical operations, it can set
|
|
|
|
the corresponding bit in the exception mask with subfunction 25.
|
|
|
|
Also user handler is responsible for clearing exceptions flags in
|
|
|
|
FPU and/or SSE.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
====== Function 68, subfunction 25 - set FPU exception handler. ======
|
2009-05-23 10:23:03 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 25 - subfunction number
|
|
|
|
* ecx = signal number
|
|
|
|
* edx = value of activity (0/1)
|
|
|
|
Returned value:
|
2010-10-17 10:53:29 +02:00
|
|
|
* eax = -1 - invalid signal number
|
|
|
|
* otherwise eax = old value of activity for this signal (0/1)
|
2009-05-23 10:23:03 +02:00
|
|
|
Remarks:
|
2010-10-17 10:53:29 +02:00
|
|
|
* In current implementation only mask for user excepton handler,
|
|
|
|
which has been previously set by subfunction 24,
|
|
|
|
is changed. Signal number corresponds to exception number.
|
2009-05-23 10:23:03 +02:00
|
|
|
|
2013-07-09 19:56:44 +02:00
|
|
|
======================================================================
|
|
|
|
====== Function 68, subfunction 26 - release memory pages ============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 26 - subfunction number
|
|
|
|
* ecx = pointer to the memory block, allocated by subfunction 12
|
|
|
|
* edx = offset from the block beginnings
|
|
|
|
* esi = the size of the region of memory to release, in bytes
|
|
|
|
Remarks:
|
|
|
|
* function release range of pages from ecx+edx to ecx+edx+esi
|
|
|
|
and set virtual memory into reserved state.
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
========== Function 68, subfunction 27 - load file ===================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 68 - function number
|
|
|
|
* ebx = 27 - subfunction number
|
|
|
|
* ecx = pointer to ASCIIZ-string with the filename
|
|
|
|
Returned value:
|
|
|
|
* eax = pointer to the loaded file, or zero
|
|
|
|
* edx = size of the loaded file, or zero
|
|
|
|
Remarks:
|
|
|
|
* function loads file and unpacks, if necessary
|
|
|
|
|
2008-12-30 17:27:38 +01:00
|
|
|
======================================================================
|
2010-10-17 10:53:29 +02:00
|
|
|
====================== Function 69 - debugging. ======================
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
A process can load other process as debugged by set of corresponding
|
2006-10-24 16:39:29 +02:00
|
|
|
bit by call to subfunction 7 of function 70.
|
2006-08-11 15:30:23 +02:00
|
|
|
A process can have only one debugger; one process can debug some
|
|
|
|
others. The system notifies debugger on events occuring with
|
|
|
|
debugged process. Messages are written to the buffer defined by
|
2006-08-03 21:30:32 +02:00
|
|
|
subfunction 0.
|
2006-08-11 15:30:23 +02:00
|
|
|
Format of a message:
|
|
|
|
* +0: dword: message code
|
|
|
|
* +4: dword: PID of debugged process
|
|
|
|
* +8: there can be additional data depending on message code
|
|
|
|
Message codes:
|
2006-08-03 21:30:32 +02:00
|
|
|
* 1 = exception
|
2006-08-11 15:30:23 +02:00
|
|
|
* in addition dword-number of the exception is given
|
|
|
|
* process is suspended
|
|
|
|
* 2 = process has terminated
|
|
|
|
* comes at any termination: both through the system function -1,
|
|
|
|
and at "murder" by any other process (including debugger itself)
|
2006-08-03 21:30:32 +02:00
|
|
|
* 3 = debug exception int 1 = #DB
|
2006-08-11 15:30:23 +02:00
|
|
|
* in addition dword-image of the register DR6 is given:
|
|
|
|
* bits 0-3: condition of the corresponding breakpoint (set by
|
|
|
|
subfunction 9) is satisfied
|
2013-05-28 00:16:00 +02:00
|
|
|
* bit 14: exception has occured because of the trace mode
|
2006-08-11 15:30:23 +02:00
|
|
|
(flag TF is set TF)
|
|
|
|
* process is suspended
|
|
|
|
When debugger terminates, all debugged processes are killed.
|
|
|
|
If debugger does not want this, it must previously detach by
|
2006-08-03 21:30:32 +02:00
|
|
|
subfunction 3.
|
|
|
|
|
2009-01-31 07:09:36 +01:00
|
|
|
All subfunctions are applicable only to processes/threads started
|
|
|
|
from the current by function 70 with set debugging flag.
|
2006-08-11 15:30:23 +02:00
|
|
|
Debugging of multithreaded programs is not supported yet.
|
|
|
|
The full list of subfunctions:
|
|
|
|
* subfunction 0 - define data area for debug messages
|
|
|
|
* subfunction 1 - get contents of registers of debugged thread
|
|
|
|
* subfunction 2 - set contents of registers of debugged thread
|
|
|
|
* subfunction 3 - detach from debugged process
|
|
|
|
* subfunction 4 - suspend debugged thread
|
|
|
|
* subfunction 5 - resume debugged thread
|
|
|
|
* subfunction 6 - read from the memory of debugged process
|
|
|
|
* subfunction 7 - write to the memory of debugged process
|
|
|
|
* subfunction 8 - terminate debugged thread
|
|
|
|
* subfunction 9 - set/clear hardware breakpoint
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
= Function 69, subfunction 0 - define data area fror debug messages. =
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 0 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = pointer
|
|
|
|
Format of data area:
|
2006-08-11 15:30:23 +02:00
|
|
|
* +0: dword: N = buffer size (not including this header)
|
|
|
|
* +4: dword: occupied place
|
2006-08-03 21:30:32 +02:00
|
|
|
* +8: N*byte: buffer
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If the size field is negative, the buffer is considered locked
|
|
|
|
and at arrival of new message the system will wait.
|
|
|
|
For synchronization frame all work with the buffer by operations
|
|
|
|
lock/unlock
|
2010-10-17 10:53:29 +02:00
|
|
|
neg [bufsize]
|
2006-08-11 15:30:23 +02:00
|
|
|
* Data in the buffer are considered as array of items with variable
|
|
|
|
length - messages. Format of a message is explained in
|
|
|
|
general description.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===================== Function 69, subfunction 1 =====================
|
|
|
|
============ Get contents of registers of debugged thread. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = thread identifier
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = size of context structure, must be 0x28=40 bytes
|
|
|
|
* esi = pointer to context structure
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2006-08-11 15:30:23 +02:00
|
|
|
Format of context structure: (FPU is not supported yet)
|
2006-08-03 21:30:32 +02:00
|
|
|
* +0: dword: eip
|
|
|
|
* +4: dword: eflags
|
|
|
|
* +8: dword: eax
|
|
|
|
* +12 = +0xC: dword: ecx
|
|
|
|
* +16 = +0x10: dword: edx
|
|
|
|
* +20 = +0x14: dword: ebx
|
|
|
|
* +24 = +0x18: dword: esp
|
|
|
|
* +28 = +0x1C: dword: ebp
|
|
|
|
* +32 = +0x20: dword: esi
|
|
|
|
* +36 = +0x24: dword: edi
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If the thread executes code of ring-0, the function returns
|
|
|
|
contents of registers of ring-3.
|
|
|
|
* Process must be loaded for debugging (as is shown in
|
|
|
|
general description).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===================== Function 69, subfunction 2 =====================
|
|
|
|
============ Set contents of registers of debugged thread. ===========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 2 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = thread identifier
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = size of context structure, must be 0x28=40 bytes
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2006-08-11 15:30:23 +02:00
|
|
|
Format of context structure is shown in the description of
|
|
|
|
subfunction 1.
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If the thread executes code of ring-0, the function returns
|
|
|
|
contents of registers of ring-3.
|
|
|
|
* Process must be loaded for debugging (as is shown in
|
|
|
|
general description).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===== Function 69, subfunction 3 - detach from debugged process. =====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 3 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = identifier
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If the process was suspended, it resumes execution.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2009-01-31 07:09:36 +01:00
|
|
|
======== Function 69, subfunction 4 - suspend debugged thread. =======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 4 - subfunction number
|
|
|
|
* ecx = thread identifier
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2009-01-31 07:09:36 +01:00
|
|
|
Remarks:
|
|
|
|
* Process must be loaded for debugging (as is shown in
|
|
|
|
general description).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2009-01-31 07:09:36 +01:00
|
|
|
======== Function 69, subfunction 5 - resume debugged thread. ========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 5 - subfunction number
|
|
|
|
* ecx = thread identifier
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
2009-01-31 07:09:36 +01:00
|
|
|
Remarks:
|
|
|
|
* Process must be loaded for debugging (as is shown in
|
|
|
|
general description).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 6 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = identifier
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = number of bytes to read
|
|
|
|
* esi = address in the memory of debugged process
|
|
|
|
* edi = pointer to buffer for data
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 at an error (invalid PID or buffer)
|
|
|
|
* otherwise eax = number of read bytes (possibly, 0,
|
|
|
|
if esi is too large)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Process must be loaded for debugging (as is shown in
|
|
|
|
general description).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
== Function 69, subfunction 7 - write to memory of debugged process. =
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 7 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = identifier
|
2006-08-11 15:30:23 +02:00
|
|
|
* edx = number of bytes to write
|
|
|
|
* esi = address of memory in debugged process
|
|
|
|
* edi = pointer to data
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 at an error (invalid PID or buffer)
|
|
|
|
* otherwise eax = number of written bytes (possibly, 0,
|
|
|
|
if esi is too large)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Process must be loaded for debugging (as is shown in
|
|
|
|
general description).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
======= Function 69, subfunction 8 - terminate debugged thread. ======
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 8 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = identifier
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Process must be loaded for debugging (as is shown in
|
|
|
|
general description).
|
|
|
|
* The function is similar to subfunction 2 of function 18
|
|
|
|
with two differences: it requires first remark and
|
|
|
|
accepts PID rather than slot number.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 69 - function number
|
|
|
|
* ebx = 9 - subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* ecx = thread identifier
|
2006-08-11 15:30:23 +02:00
|
|
|
* dl = index of breakpoint, from 0 to 3 inclusively
|
2006-08-03 21:30:32 +02:00
|
|
|
* dh = flags:
|
2006-08-11 15:30:23 +02:00
|
|
|
* if high bit is cleared - set breakpoint:
|
2006-08-03 21:30:32 +02:00
|
|
|
* bits 0-1 - condition:
|
|
|
|
* 00 = breakpoint on execution
|
2006-08-11 15:30:23 +02:00
|
|
|
* 01 = breakpoint on read
|
|
|
|
* 11 = breakpoint on read/write
|
|
|
|
* bits 2-3 - length; for breakpoints on exception it must be
|
|
|
|
00, otherwise one of
|
|
|
|
* 00 = byte
|
2006-08-03 21:30:32 +02:00
|
|
|
* 01 = word
|
2006-08-11 15:30:23 +02:00
|
|
|
* 11 = dword
|
|
|
|
* esi = breakpoint address; must be aligned according to
|
|
|
|
the length (i.e. must be even for word breakpoints,
|
|
|
|
divisible by 4 for dword)
|
|
|
|
* if high bit is set - clear breakpoint
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success
|
2006-08-03 21:30:32 +02:00
|
|
|
* eax = 1 - error in the input data
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 2 - (reserved, is never returned in the current
|
|
|
|
implementation) a global breakpoint with that index is already set
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Process must be loaded for debugging (as is shown in
|
|
|
|
general description).
|
|
|
|
* Hardware breakpoints are implemented through DRx-registers of
|
|
|
|
the processor, all limitations results from this.
|
|
|
|
* The function can reinstall the breakpoint, previously set
|
|
|
|
by it (and it does not inform on this).
|
|
|
|
Carry on the list of set breakpoints in the debugger.
|
|
|
|
* Breakpoints generate debug exception #DB, on which the system
|
|
|
|
notifies debugger.
|
|
|
|
* Breakpoints on write and read/write act after
|
|
|
|
execution of the caused it instruction.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
==== Function 70 - work with file system with long names support. ====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 70
|
2006-08-11 15:30:23 +02:00
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success; otherwise file system error code
|
|
|
|
* some subfunctions return value in other registers too
|
|
|
|
General format of the information structure:
|
|
|
|
* +0: dword: subfunction number
|
|
|
|
* +4: dword: file offset
|
|
|
|
* +8: dword: high dword of offset (must be 0) or flags field
|
2006-08-03 21:30:32 +02:00
|
|
|
* +12 = +0xC: dword: size
|
2006-08-11 15:30:23 +02:00
|
|
|
* +16 = +0x10: dword: pointer to data
|
|
|
|
* +20 = +0x14: n db: ASCIIZ-string with the filename
|
2006-08-03 21:30:32 +02:00
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with the filename
|
|
|
|
Specifications - in documentation on the appropriate subfunction.
|
|
|
|
Filename is case-insensitive. Russian letters must be written in
|
|
|
|
the encoding cp866 (DOS).
|
|
|
|
Format of filename:
|
2006-08-03 21:30:32 +02:00
|
|
|
/base/number/dir1/dir2/.../dirn/file,
|
2006-08-11 15:30:23 +02:00
|
|
|
where /base/number identifies device, on which file is located:
|
2006-08-03 21:30:32 +02:00
|
|
|
one of
|
2006-08-11 15:30:23 +02:00
|
|
|
* /RD/1 = /RAMDISK/1 to access ramdisk
|
|
|
|
* /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
|
|
|
|
/FD/2 = /FLOPPYDISK/2 to access second one
|
|
|
|
* /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
|
|
|
|
IDE0 (Primary Master), IDE1 (Primary Slave),
|
2006-08-03 21:30:32 +02:00
|
|
|
IDE2 (Secondary Master), IDE3 (Secondary Slave);
|
2006-08-11 15:30:23 +02:00
|
|
|
x - partition number on the selected hard drive, varies from 1
|
|
|
|
to 255 (on each hard drive the indexing starts from 1)
|
|
|
|
* /CD0/1, /CD1/1, /CD2/1, /CD3/1 to access accordingly to
|
|
|
|
CD on IDE0 (Primary Master), IDE1 (Primary Slave),
|
|
|
|
IDE2 (Secondary Master), IDE3 (Secondary Slave)
|
2007-06-18 18:39:42 +02:00
|
|
|
* /SYS means system folder; with the usual boot (from floppy)
|
|
|
|
is equivalent to /RD/1
|
2006-08-03 21:30:32 +02:00
|
|
|
Examples:
|
|
|
|
* '/rd/1/kernel.asm',0
|
|
|
|
* '/HD0/1/kernel.asm',0
|
|
|
|
* '/hd0/2/menuet/pics/tanzania.bmp',0
|
|
|
|
* '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
|
2007-06-18 18:39:42 +02:00
|
|
|
* '/sys/MySuperApp.ini',0
|
2013-07-08 10:17:53 +02:00
|
|
|
Also function supports relative names. If the path begins not
|
|
|
|
with '/', it is considered relative to a current folder. To get or
|
2010-10-17 10:53:29 +02:00
|
|
|
set a current folder, use the function 30.
|
|
|
|
|
2006-08-11 15:30:23 +02:00
|
|
|
Available subfunctions:
|
2006-08-03 21:30:32 +02:00
|
|
|
* subfunction 0 - read file
|
|
|
|
* subfunction 1 - read folder
|
|
|
|
* subfunction 2 - create/rewrite file
|
2006-08-18 15:32:18 +02:00
|
|
|
* subfunction 3 - write to existing file
|
2006-08-21 15:06:02 +02:00
|
|
|
* subfunction 4 - set file size
|
2006-08-11 15:30:23 +02:00
|
|
|
* subfunction 5 - get attributes of file/folder
|
|
|
|
* subfunction 6 - set attributes of file/folder
|
2006-08-03 21:30:32 +02:00
|
|
|
* subfunction 7 - start application
|
2006-10-24 16:39:29 +02:00
|
|
|
* subfunction 8 - delete file/folder
|
2007-02-05 15:20:36 +01:00
|
|
|
* subfunction 9 - create folder
|
2006-08-11 15:30:23 +02:00
|
|
|
For CD-drives due to hardware limitations only subfunctions
|
|
|
|
0,1,5 and 7 are available, other subfunctions return error
|
|
|
|
with code 2.
|
2007-09-23 22:58:50 +02:00
|
|
|
At the first call of subfunctions 0,1,5,7 to ATAPI devices
|
|
|
|
(CD and DVD) the manual control of tray is locked due to caching
|
|
|
|
drive data. Unlocking is made when subfunction 4 of function 24
|
|
|
|
is called for corresponding device.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=== Function 70, subfunction 0 - read file with long names support. ==
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 0 = subfunction number
|
|
|
|
* +4: dword: file offset (in bytes)
|
|
|
|
* +8: dword: 0 (reserved for high dword of offset)
|
|
|
|
* +12 = +0xC: dword: number of bytes to read
|
|
|
|
* +16 = +0x10: dword: pointer to buffer for data
|
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
2006-08-03 21:30:32 +02:00
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx = number of read bytes or -1=0xffffffff if file was not found
|
|
|
|
Remarks:
|
|
|
|
* If file was ended before last requested block was read,
|
|
|
|
the function will read as many as it can, and after that return
|
|
|
|
eax=6 (EOF).
|
|
|
|
* The function does not allow to read folder (returns eax=10,
|
|
|
|
access denied).
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
== Function 70, subfunction 1 - read folder with long names support. =
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 1 = subfunction number
|
|
|
|
* +4: dword: index of starting block (beginning from 0)
|
|
|
|
* +8: dword: flags field:
|
2006-08-03 21:30:32 +02:00
|
|
|
* bit 0 (mask 1): in what format to return names,
|
|
|
|
0=ANSI, 1=UNICODE
|
2006-08-11 15:30:23 +02:00
|
|
|
* other bits are reserved and must be set to 0 for the future
|
|
|
|
compatibility
|
|
|
|
* +12 = +0xC: dword: number of blocks to read
|
|
|
|
* +16 = +0x10: dword: pointer to buffer for data, buffer size
|
|
|
|
must be not less than 32 + [+12]*560 bytes
|
|
|
|
* +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
|
|
|
|
given in the general description
|
2006-08-03 21:30:32 +02:00
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx = number of files, information on which was written to
|
|
|
|
the buffer, or -1=0xffffffff, if folder was not found
|
2006-08-03 21:30:32 +02:00
|
|
|
Structure of the buffer:
|
|
|
|
* +0: 32*byte: header
|
|
|
|
* +32 = +0x20: n1*byte: block with information on file 1
|
2006-08-11 15:30:23 +02:00
|
|
|
* +32+n1: n2*byte: block with information on file 2
|
2006-08-03 21:30:32 +02:00
|
|
|
* ...
|
|
|
|
Structure of header:
|
2006-08-11 15:30:23 +02:00
|
|
|
* +0: dword: version of structure (current is 1)
|
|
|
|
* +4: dword: number of placed blocks; is not greater than requested
|
|
|
|
in the field +12 of information structure; can be less, if
|
|
|
|
there are no more files in folder (the same as in ebx)
|
|
|
|
* +8: dword: total number of files in folder
|
|
|
|
* +12 = +0xC: 20*byte: reserved (zeroed)
|
|
|
|
Structure of block of data for folder entry (BDFE):
|
|
|
|
* +0: dword: attributes of file:
|
|
|
|
* bit 0 (mask 1): file is read-only
|
|
|
|
* bit 1 (mask 2): file is hidden
|
|
|
|
* bit 2 (mask 4): file is system
|
|
|
|
* bit 3 (mask 8): this is not a file but volume label
|
|
|
|
(for one partition meets no more than once and
|
|
|
|
only in root folder)
|
|
|
|
* bit 4 (mask 0x10): this is a folder
|
|
|
|
* bit 5 (mask 0x20): file was not archived - many archivation
|
|
|
|
programs have an option to archive only files with this bit set,
|
|
|
|
and after archiving this bit is cleared - it can be useful
|
|
|
|
for automatically creating of backup-archives as at writing
|
|
|
|
this bit is usually set
|
|
|
|
* +4: byte: type of name data:
|
|
|
|
(coincides with bit 0 of flags in the information structure)
|
|
|
|
* 0 = ASCII = 1-byte representation of each character
|
|
|
|
* 1 = UNICODE = 2-byte representation of each character
|
2006-08-03 21:30:32 +02:00
|
|
|
* +5: 3*byte: reserved (zero)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +8: 4*byte: time of file creation
|
|
|
|
* +12 = +0xC: 4*byte: date of file creation
|
|
|
|
* +16 = +0x10: 4*byte: time of last access (read or write)
|
2006-08-03 21:30:32 +02:00
|
|
|
* +20 = +0x14: 4*byte: date of last access
|
2006-08-11 15:30:23 +02:00
|
|
|
* +24 = +0x18: 4*byte: time of last modification
|
|
|
|
* +28 = +0x1C: 4*byte: date of last modification
|
|
|
|
* +32 = +0x20: qword: file size in bytes (up to 16777216 Tb)
|
2006-08-03 21:30:32 +02:00
|
|
|
* +40 = +0x28: name
|
2006-08-11 15:30:23 +02:00
|
|
|
* for ASCII format: maximum length is 263 characters
|
|
|
|
(263 bytes), byte after the name has value 0
|
2007-02-05 15:20:36 +01:00
|
|
|
* for UNICODE format: maximum length is 259 characters
|
2006-08-11 15:30:23 +02:00
|
|
|
(518 bytes), 2 bytes after the name have value 0
|
|
|
|
Time format:
|
2006-08-03 21:30:32 +02:00
|
|
|
* +0: byte: seconds
|
|
|
|
* +1: byte: minutes
|
|
|
|
* +2: byte: hours
|
|
|
|
* +3: byte: reserved (0)
|
2006-08-11 15:30:23 +02:00
|
|
|
* for example, 23.59.59 is written as (in hex) 3B 3B 17 00
|
|
|
|
Date format:
|
|
|
|
* +0: byte: day
|
|
|
|
* +1: byte: month
|
|
|
|
* +2: word: year
|
|
|
|
* for example, 25.11.1979 is written as (in hex) 19 0B BB 07
|
|
|
|
Remarks:
|
|
|
|
* If BDFE contains ASCII name, the length of BDFE is 304 bytes,
|
|
|
|
if UNICODE name - 560 bytes. Value of length is aligned
|
|
|
|
on 16-byte bound (to accelerate processing in CPU cache).
|
|
|
|
* First character after a name is zero (ASCIIZ-string). The further
|
|
|
|
data contain garbage.
|
|
|
|
* If files in folder were ended before requested number was read,
|
|
|
|
the function will read as many as it can, and after that return
|
|
|
|
eax=6 (EOF).
|
2006-08-03 21:30:32 +02:00
|
|
|
* Any folder on the disk, except for root, contains two special
|
2006-08-11 15:30:23 +02:00
|
|
|
entries "." and "..", identifying accordingly the folder itself
|
|
|
|
and the parent folder.
|
|
|
|
* The function allows also to read virtual folders "/", "/rd",
|
|
|
|
"/fd", "/hd[n]", thus attributes of subfolders are set to 0x10,
|
|
|
|
and times and dates are zeroed. An alternative way to get the
|
|
|
|
equipment information - subfunction 11 of function 18.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===================== Function 70, subfunction 2 =====================
|
|
|
|
============ Create/rewrite file with long names support. ============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 2 = subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* +4: dword: 0 (reserved)
|
|
|
|
* +8: dword: 0 (reserved)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +12 = +0xC: dword: number of bytes to read
|
|
|
|
* +16 = +0x10: dword: pointer to data
|
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
2006-08-03 21:30:32 +02:00
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx = number of written bytes (possibly 0)
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If a file with given name did not exist, it is created;
|
|
|
|
if it existed, it is rewritten.
|
|
|
|
* If there is not enough free space on disk, the function will
|
|
|
|
write as many as can and then return error code 8.
|
|
|
|
* The function is not supported for CD (returns error code 2).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
======================================================================
|
|
|
|
===================== Function 70, subfunction 3 =====================
|
|
|
|
=========== Write to existing file with long names support. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 3 = subfunction number
|
|
|
|
* +4: dword: file offset (in bytes)
|
|
|
|
* +8: dword: high dword of offset (must be 0 for FAT)
|
|
|
|
* +12 = +0xC: dword: number of bytes to write
|
|
|
|
* +16 = +0x10: dword: pointer to data
|
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx = number of written bytes (possibly 0)
|
|
|
|
Remarks:
|
|
|
|
* The file must already exist, otherwise function returns eax=5.
|
|
|
|
* The only result of write 0 bytes is update in the file attributes
|
|
|
|
date/time of modification and access to the current date/time.
|
|
|
|
* If beginning and/or ending position is greater than file size
|
|
|
|
(except for the previous case), the file is expanded to needed
|
|
|
|
size with zero characters.
|
2006-08-21 15:06:02 +02:00
|
|
|
* The function is not supported for CD (returns error code 2).
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============ Function 70, subfunction 4 - set end of file. ===========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 4 = subfunction number
|
|
|
|
* +4: dword: low dword of new file size
|
|
|
|
* +8: dword: high dword of new file size (must be 0 for FAT)
|
|
|
|
* +12 = +0xC: dword: 0 (reserved)
|
|
|
|
* +16 = +0x10: dword: 0 (reserved)
|
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx destroyed
|
|
|
|
Remarks:
|
|
|
|
* If the new file size is less than old one, file is truncated.
|
|
|
|
If the new size is greater than old one, file is expanded with
|
|
|
|
characters with code 0. If the new size is equal to old one,
|
|
|
|
the only result of call is set date/time of modification and
|
|
|
|
access to the current date/time.
|
|
|
|
* If there is not enough free space on disk for expansion, the
|
|
|
|
function will expand to maximum possible size and then return
|
|
|
|
error code 8.
|
|
|
|
* The function is not supported for CD (returns error code 2).
|
2006-08-18 15:32:18 +02:00
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
==== Function 70, subfunction 5 - get information on file/folder. ====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 5 = subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* +4: dword: 0 (reserved)
|
|
|
|
* +8: dword: 0 (reserved)
|
|
|
|
* +12 = +0xC: dword: 0 (reserved)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +16 = +0x10: dword: pointer to buffer for data (40 bytes)
|
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
2006-08-03 21:30:32 +02:00
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx destroyed
|
|
|
|
Information on file is returned in the BDFE format (block of data
|
|
|
|
for folder entry), explained in the description of
|
|
|
|
subfunction 1, but without filename
|
|
|
|
(i.e. only first 40 = 0x28 bytes).
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The function does not support virtual folders such as /, /rd and
|
|
|
|
root folders like /rd/1.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
===== Function 70, subfunction 6 - set attributes of file/folder. ====
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 6 = subfunction number
|
2006-08-03 21:30:32 +02:00
|
|
|
* +4: dword: 0 (reserved)
|
|
|
|
* +8: dword: 0 (reserved)
|
|
|
|
* +12 = +0xC: dword: 0 (reserved)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +16 = +0x10: dword: pointer to buffer with attributes (32 bytes)
|
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
2006-08-03 21:30:32 +02:00
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx destroyed
|
|
|
|
File attributes are first 32 bytes in BDFE (block of data
|
|
|
|
for folder entry), explained in the description of subfunction 1
|
|
|
|
(that is, without name and size of file). Attribute
|
|
|
|
file/folder/volume label (bits 3,4 in dword +0) is not changed.
|
|
|
|
Byte +4 (name format) is ignored.
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* The function does not support virtual folders such as /, /rd and
|
|
|
|
root folders like /rd/1.
|
|
|
|
* The function is not supported for CD (returns error code 2).
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=========== Function 70, subfunction 7 - start application. ==========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 7 = subfunction number
|
|
|
|
* +4: dword: flags field:
|
2013-05-28 00:16:00 +02:00
|
|
|
* bit 0: start process as debugged
|
2006-08-11 15:30:23 +02:00
|
|
|
* other bits are reserved and must be set to 0
|
|
|
|
* +8: dword: 0 or pointer to ASCIIZ-string with parameters
|
2006-08-03 21:30:32 +02:00
|
|
|
* +12 = +0xC: dword: 0 (reserved)
|
|
|
|
* +16 = +0x10: dword: 0 (reserved)
|
2006-08-11 15:30:23 +02:00
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
2006-08-03 21:30:32 +02:00
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
2006-08-11 15:30:23 +02:00
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
|
|
|
* eax > 0 - program is loaded, eax contains PID
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax < 0 - an error has occured, -eax contains
|
|
|
|
file system error code
|
|
|
|
* ebx destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* Command line must be terminated by the character with the code 0
|
|
|
|
(ASCIIZ-string); function takes into account either all characters
|
|
|
|
up to terminating zero inclusively or first 256 character
|
|
|
|
regarding what is less.
|
|
|
|
* If the process is started as debugged, it is created in
|
|
|
|
the suspended state; to run use subfunction 5 of function 69.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2006-10-24 16:39:29 +02:00
|
|
|
======================================================================
|
|
|
|
========== Function 70, subfunction 8 - delete file/folder. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 8 = subfunction number
|
|
|
|
* +4: dword: 0 (reserved)
|
|
|
|
* +8: dword: 0 (reserved)
|
|
|
|
* +12 = +0xC: dword: 0 (reserved)
|
|
|
|
* +16 = +0x10: dword: 0 (reserved)
|
|
|
|
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
|
|
|
|
given in the general description
|
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx destroyed
|
|
|
|
Remarks:
|
|
|
|
* The function is not supported for CD (returns error code 2).
|
|
|
|
* The function can delete only empty folders (attempt to delete
|
|
|
|
nonempty folder results in error with code 10, "access denied").
|
|
|
|
|
2007-02-05 15:20:36 +01:00
|
|
|
======================================================================
|
|
|
|
============= Function 70, subfunction 9 - create folder. ============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 70 - function number
|
|
|
|
* ebx = pointer to the information structure
|
|
|
|
Format of the information structure:
|
|
|
|
* +0: dword: 9 = subfunction number
|
|
|
|
* +4: dword: 0 (reserved)
|
|
|
|
* +8: dword: 0 (reserved)
|
|
|
|
* +12 = +0xC: dword: 0 (reserved)
|
|
|
|
* +16 = +0x10: dword: 0 (reserved)
|
|
|
|
* +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
|
|
|
|
given in the general description
|
|
|
|
or
|
|
|
|
* +20 = +0x14: db 0
|
|
|
|
* +21 = +0x15: dd pointer to ASCIIZ-string with folder name
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success, otherwise file system error code
|
|
|
|
* ebx destroyed
|
|
|
|
Remarks:
|
|
|
|
* The function is not supported for CD (returns error code 2).
|
|
|
|
* The parent folder must already exist.
|
|
|
|
* If target folder already exists, function returns success (eax=0).
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
========== Function 71, subfunction 1 - set window caption. ==========
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 71 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
2006-08-11 15:30:23 +02:00
|
|
|
* ecx = pointer to caption string
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* function does not return value
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* String must be in the ASCIIZ-format. Disregarding real string
|
|
|
|
length, no more than 255 characters are drawn.
|
|
|
|
* Pass NULL in ecx to remove caption.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
2007-10-25 13:20:02 +02:00
|
|
|
======================================================================
|
|
|
|
=============== Function 72 - send message to a window. ==============
|
|
|
|
======================================================================
|
|
|
|
|
|
|
|
- Subfunction 1 - send message with parameter to the active window. --
|
|
|
|
Parameters:
|
|
|
|
* eax = 72 - function number
|
|
|
|
* ebx = 1 - subfunction number
|
|
|
|
* ecx = event code: 2 or 3
|
|
|
|
* edx = parameter: key code for ecx=2, button identifier for ecx=3
|
|
|
|
Returned value:
|
|
|
|
* eax = 0 - success
|
|
|
|
* eax = 1 - buffer is full
|
|
|
|
|
2013-03-03 16:03:27 +01:00
|
|
|
======================================================================
|
|
|
|
===================== Function 73 - blit bitmap =====================
|
|
|
|
======================================================================
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* eax = 73 - function number
|
|
|
|
|
|
|
|
* ebx = ROP and optional flags
|
|
|
|
31 6 5 4 3 0
|
|
|
|
[ reserved ][T][B][ROP]
|
|
|
|
ROP - raster operation code
|
|
|
|
0: Copy
|
|
|
|
1-15: reserved
|
|
|
|
B - blit into the background surface
|
|
|
|
T - transparent blit
|
|
|
|
|
|
|
|
* ecx = pointer to the function parameters
|
|
|
|
destination offset and clipping
|
|
|
|
+0 signed dword: destination rectangle X offset from the window
|
|
|
|
top-left corner
|
|
|
|
+4 signed dword: destination rectangle Y offset from the window
|
|
|
|
top-left corner
|
|
|
|
+8 dword: destination rectangle width
|
|
|
|
+12 dword: destination rectangle height
|
|
|
|
|
|
|
|
source offset and clipping
|
|
|
|
+16 signed dword: source rectangle X offset from the bitmap
|
|
|
|
top-left corner
|
|
|
|
+20 signed dword: source rectangle Y offset from the bitmap
|
|
|
|
top-left corner
|
|
|
|
+24 dword: source rectangle width
|
|
|
|
+28 dword: source rectangle height
|
|
|
|
|
2013-03-05 22:11:06 +01:00
|
|
|
+32: dword: bitmap data - must be 32bpp
|
|
|
|
+36: dword: size of the bitmap row in bytes
|
2013-03-03 16:03:27 +01:00
|
|
|
|
|
|
|
Returned value:
|
|
|
|
* function does not return value
|
|
|
|
|
2013-05-29 15:47:55 +02:00
|
|
|
======================================================================
|
|
|
|
= Function 74, Subfunction -1, Get number of active network devices. =
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 74 - function number
|
|
|
|
* bl = -1 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* eax = number of active network devices
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
======== Function 74, Subfunction 0, Get network device type. ========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 74 - function number
|
|
|
|
* bl = 0 - subfunction number
|
|
|
|
* bh = device number
|
|
|
|
Returned value:
|
|
|
|
* eax = device type
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
======== Function 74, Subfunction 1, Get network device name. ========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 74 - function number
|
|
|
|
* bl = 1 - subfunction number
|
|
|
|
* bh = device number
|
|
|
|
* ecx = pointer to 64 byte buffer
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
* The network device name is written into the buffer, on success
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
========= Function 74, Subfunction 2, Reset network device. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 74 - function number
|
|
|
|
* bl = 2 - subfunction number
|
|
|
|
* bh = device number
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
========== Function 74, Subfunction 3, Stop network device. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 74 - function number
|
|
|
|
* bl = 3 - subfunction number
|
|
|
|
* bh = device number
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============== Function 75, Subfunction 0, Open socket. ==============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 0 - subfunction number
|
|
|
|
* ecx = domain
|
|
|
|
* edx = type
|
|
|
|
* esi = protocol
|
|
|
|
Returned value:
|
|
|
|
* eax = socket number, -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============= Function 75, Subfunction 1, Close socket. ==============
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 1 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
================== Function 75, Subfunction 2, Bind. =================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 2 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
* edx = pointer to sockaddr structure
|
|
|
|
* esi = length of sockaddr structure
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
================= Function 75, Subfunction 3, Listen. ================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 3 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
* edx = backlog
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
================ Function 75, Subfunction 4, Connect. ================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 4 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
* edx = pointer to sockaddr structure
|
|
|
|
* esi = length of sockaddr structure
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
================= Function 75, Subfunction 5, Accept. ================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 5 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
* edx = pointer to sockaddr structure
|
|
|
|
* esi = length of sockaddr structure
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
================== Function 75, Subfunction 6, Send. =================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 6 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
* edx = pointer to buffer
|
|
|
|
* esi = length of buffer
|
|
|
|
Returned value:
|
|
|
|
* eax = number of bytes copied, -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
================ Function 75, Subfunction 7, Receive. ================
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 7 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
* edx = pointer to buffer
|
|
|
|
* esi = length of buffer
|
|
|
|
* edi = flags
|
|
|
|
Returned value:
|
|
|
|
* eax = number of bytes copied, -1 on error
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=========== Function 75, Subfunction 8, Set socket options. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 8 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
* edx = pointer to optstruct
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
Remarks:
|
|
|
|
|
|
|
|
Optstruct: dd level
|
|
|
|
dd optionname
|
|
|
|
dd optlength
|
|
|
|
db options...
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=========== Function 75, Subfunction 9, Get socket options. ==========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 9 - subfunction number
|
|
|
|
* ecx = socket number
|
|
|
|
* edx = pointer to optstruct
|
|
|
|
Returned value:
|
|
|
|
* eax = -1 on error
|
|
|
|
Remarks:
|
|
|
|
|
|
|
|
Optstruct: dd level
|
|
|
|
dd optionname
|
|
|
|
dd optlength
|
|
|
|
db options...
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
============ Function 75, Subfunction 10, Get socketpair. ===========
|
|
|
|
======================================================================
|
|
|
|
Parameters:
|
|
|
|
* eax = 75 - function number
|
|
|
|
* bl = 10 - subfunction number
|
|
|
|
Returned value:
|
|
|
|
* eax = socketnum1, -1 on error
|
|
|
|
* ebx = socketnum2
|
|
|
|
Remarks:
|
|
|
|
|
|
|
|
Optstruct: dd level
|
|
|
|
dd optionname
|
|
|
|
dd optlength
|
|
|
|
db options...
|
|
|
|
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
=============== Function -1 - terminate thread/process ===============
|
2006-08-03 21:30:32 +02:00
|
|
|
======================================================================
|
|
|
|
Parameters:
|
2006-08-11 15:30:23 +02:00
|
|
|
* eax = -1 - function number
|
2006-08-03 21:30:32 +02:00
|
|
|
Returned value:
|
2006-08-11 15:30:23 +02:00
|
|
|
* function does not return neither value nor control
|
2006-08-03 21:30:32 +02:00
|
|
|
Remarks:
|
2006-08-11 15:30:23 +02:00
|
|
|
* If the process did not create threads obviously, it has only
|
|
|
|
one thread, which termination results in process termination.
|
|
|
|
* If the current thread is last in the process, its termination
|
|
|
|
also results in process terminates.
|
|
|
|
* This function terminates the current thread. Other thread can be
|
|
|
|
killed by call to subfunction 2 of function 18.
|
2006-08-03 21:30:32 +02:00
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=========================== List of events ===========================
|
|
|
|
======================================================================
|
2006-08-11 15:30:23 +02:00
|
|
|
Next event can be retrieved by the call of one from functions 10
|
|
|
|
(to wait for event), 11 (to check without waiting), 23
|
|
|
|
(to wait during the given time).
|
|
|
|
These functions return only those events, which enter into a mask set
|
|
|
|
by function 40. By default it is first three,
|
|
|
|
there is enough for most applications.
|
2006-08-03 21:30:32 +02:00
|
|
|
Codes of events:
|
2006-08-11 15:30:23 +02:00
|
|
|
* 1 = redraw event (is reset by call to function 0)
|
|
|
|
* 2 = key on keyboard is pressed (acts, only when the window is
|
|
|
|
active) or hotkey is pressed; is reset, when all keys from
|
|
|
|
the buffer are read out by function 2
|
|
|
|
* 3 = button is pressed, defined earlier by function 8
|
|
|
|
(or close button, created implicitly by function 0;
|
|
|
|
minimize button is handled by the system and sends no message;
|
|
|
|
acts, only when the window is active;
|
|
|
|
is reset when all buttons from the buffer
|
|
|
|
are read out by function 17)
|
|
|
|
* 4 = reserved (in current implementation never comes even after
|
|
|
|
unmasking by function 40)
|
2012-03-27 22:02:50 +02:00
|
|
|
* 5 = kernel finished redrawing of the desktop background
|
2006-08-11 15:30:23 +02:00
|
|
|
* 6 = mouse event (something happened - button pressing or moving;
|
|
|
|
is reset at reading)
|
|
|
|
* 7 = IPC event (see function 60 -
|
|
|
|
Inter Process Communication; is reset at reading)
|
|
|
|
* 8 = network event (is reset at reading)
|
|
|
|
* 9 = debug event (is reset at reading; see
|
|
|
|
debug subsystem)
|
|
|
|
* 16..31 = event with appropriate IRQ
|
|
|
|
(16=IRQ0, 31=IRQ15) (is reset after reading all IRQ data)
|
|
|
|
|
|
|
|
======================================================================
|
|
|
|
=================== Error codes of the file system ===================
|
|
|
|
======================================================================
|
|
|
|
* 0 = success
|
|
|
|
* 1 = base and/or partition of a hard disk is not defined
|
|
|
|
(by subfunctions 7, 8 of function 21)
|
|
|
|
* 2 = function is not supported for the given file system
|
|
|
|
* 3 = unknown file system
|
2007-04-02 16:29:39 +02:00
|
|
|
* 4 = reserved, is never returned in the current implementation
|
2006-08-11 15:30:23 +02:00
|
|
|
* 5 = file not found
|
|
|
|
* 6 = end of file, EOF
|
|
|
|
* 7 = pointer lies outside of application memory
|
|
|
|
* 8 = disk is full
|
|
|
|
* 9 = FAT table is destroyed
|
2006-08-03 21:30:32 +02:00
|
|
|
* 10 = access denied
|
2006-08-11 15:30:23 +02:00
|
|
|
* 11 = device error
|
|
|
|
Application start functions can return also following errors:
|
|
|
|
* 30 = 0x1E = not enough memory
|
|
|
|
* 31 = 0x1F = file is not executable
|
|
|
|
* 32 = 0x20 = too many processes
|