Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 117 → Rev 118

/kernel/trunk/docs/sysfuncs.txt
1,9 → 1,9
SYSTEM FUNCTIONS of OS Kolibri 0.5.8.1
 
Number of the function is located in the register eax.
The call of the system function is carried out by the command "int 0x40".
All registers, except for obviously indicated in returned value,
including the register of flags eflags, are saved.
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.
 
 
======================================================================
10,2269 → 10,2326
============== Function 0 - define and draw the window. ==============
======================================================================
Defines an application window. Draws a frame of the window, header and
working area. For windows with ñêèíîì defines standard buttons of closing
and minimization.
working area. For windows with skin defines standard buttons for close
and minimize.
Parameters:
* eax = 0 - number of the function
* eax = 0 - function number
* 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:
* Y=0 - type I - window of the fixed sizes
* Y=1 - only to define window area, nothing to draw
* Y=2 - type II - window with changed sizes
* Y=3 - window with skinned
* other possible values (from 4 up to 15) reserved,
* Y=0 - type I - window of the fixed size
* Y=1 - only define window area, draw nothing
* Y=2 - type II - window of the variable size
* Y=3 - window with skin
* other possible values (from 4 up to 15) are reserved,
function call with such Y is ignored
* RR, GG, BB = accordingly red, green, blue
colours of a working area of the window
(is ignored for style Y=2)
* RR, GG, BB = accordingly red, green, blue components of a color
of the working area of the window (are ignored for style Y=2)
* X = DCBA (bits)
* A = 1 - window has caption; if Y=3, caption string address could be passed in edi,
otherwise use function 71 subfunction 1
* B = 1 - draw all graphics primitives relative to window client area
* C - reserved
* D = 8 - fill client area with gradient
other values are reserved
The following parameters are intended for windows of a type I and II,
and ignored for styles Y=1,3:
* esi = 0xXYRRGGBB - colour of header
* RR, GG, BB define colour
* A = 1 - window has caption; for style Y=3 caption string
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
* C is reserved (set to 0)
* 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
* Y=0 - usual window, Y=1 - unmovable window
* X defines a gradient of header: X=0 - no gradient,
* X defines a gradient of header: X=0 - no gradient,
X=8 - usual gradient,
for windows of a type II X=4 - negative gradient
* other values X and Y reserved
* edi = 0x00RRGGBB - colour of a frame
* other values of X and Y are reserved
* edi = 0x00RRGGBB - color of the frame
Returned value:
* function does not return value
Remarks:
* Location and the sizes of the window are installed by the first call of
this function and are ignored at subsequent; for change of location
and/or of sizes already of created window use function 67.
* If to use windows of appropriate styles, location and - or the sizes of
the window can vary by the user.
Current location and the sizes can be obtained by function 9.
* The window should be located on the screen. If the transferred coordinates
nd the sizes do not satisfy to this condition, appropriate coordinate
(or, probably, is considered both) as zero, and if also it does not help,
the appropriate size (or, probably, both) is installed in a size of the
screen.
* 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.
* For windows with style Y=3 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.
* 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,
and if also it does not help, the appropriate size
(or, probably, both) is installed in a size of the screen.
Further we shall designate xpos, ypos, xsize, ysize - values transmitted
in ebx, ecx. The coordinates are resulted concerning the left upper corner
of the window, which, thus, is set as (0,0), coordinate of the right lower
corner essence (xsize, ysize).
* The sizes of the window are understood in sense of coordinates of the
right lower corner. This concerns and to all other functions. It means,
that the real sizes on 1 pixel are more.
* Look of the window of a type I:
* draw external frame of colour indicated in edi,
in width 1 pixel
* draw header - rectangle with the left upper corner (1,1) and right lower
(xsize-1, min (25, ysize)) colour indicated in esi
(in view of a gradient)
* If ysize > =26, 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)) - colour
indicated in edx (in view of a gradient) is painted over
* Look of the window of a type Y=1:
Further we shall designate xpos,ypos,xsize,ysize - values
transmitted in ebx,ecx. The coordinates are resulted concerning
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:
* completely defined by the application
* Look of the window of a type II:
* draw external frame of width 1 pixel of the "shaded" colour
edi (all making colours decrease twice)
* drawn intermediate frame of width 3 pixels of colour edi
* draw internal frame of width 1 pixel
"shaded" colour edi
* 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
* draw header - rectangle with the left upper corner (4,4)
and right lower (xsize-4,min(20,ysize)) colour, indicated â esi
(in view of a gradient)
* If ysize > =26, the working area of the window is painted over -
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 -
rectangle with the left upper corner (5,20) and right lower
(xsize-5,ysize-5) - colour indicated in edx (in view of a gradient)
* Look of the window with skinned:
(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:
* draw external frame of width 1 pixel
colour 'outer' from skin
* draw intermediate framework of width 3 pixels
colour 'frame' from skin
* draw internal framework of width 1 pixel
colour 'inner' from skin
* draw header (on pictures from skin) in a rectangle
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
(0,0) - (xsize,_skinh-1)
* If ysize > =26, the working area of the window is painted over -
rectangle with the left upper corner (5, _skinh) and right lower
(xsize-5,ysize-5) - colour indicated in edx (in view of a gradient)
* two standard buttons are defined: closings and minimizations
* 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)
* define two standard buttons: for close and minimize
(see function 8)
* value _skinh is accessible as result of call
subfunction 4 functions 48
* 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
 
======================================================================
================= Function 1 - put a point in the window. ============
================ Function 1 - put pixel in the window. ===============
======================================================================
Parameters:
* eax = 1 - number of the function
* ebx = x-coordinate (concerning the window)
* ecx = y-coordinate (concerning the window)
* edx = 0x00RRGGBB - colour of a point
edx = 0x01xxxxxx - to invert colour of a point
(low 24 bits ignored)
* 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)
Returned value:
* function does not return value
 
======================================================================
======== Function 2 - receive the code of the pressed key. ===========
============ Function 2 - get the code of the pressed key. ===========
======================================================================
Takes away the code of the pressed key from the buffer.
Parameters:
* eax = 2 - number of the function
* eax = 2 - function number
Returned value:
* if the buffer is empty, comes back eax=1
* If the buffer is nonblank, that comes back al=0, ah=code of the pressed key,
high word of the register eax is set zero
* If there is "hotkey", comes back
al=2, ah=scancode of the pressed key (0 for direction keys),
high word of the register eax contains a status of direction keys
at the moment of pressing a hotkey
* 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 "hotkey".
* By call of this function the application with the inactive window
considers, that the buffer of the pressed keys is empty.
* By default this function returns ASCII-codes; to switch to the mode
scancode (and back) it is possible with usage of the function 66.
However, the hotkey always come back as scancodes.
* Ffind out, what keys correspond to what codes, is possible, having started
the applications keyascii and scancode.
* Scancodes come back directly by keyboard and are fixed; ASCII-codes turn
out with usage of the conversion tables, which can be installed
subfunction 2 functions 21 and to read subfunction 2 functions 26.
* As a consequence, ASCII-codes take into account current keyboard layout
(rus/en) as against scancodes.
* The information only about those hotkeys acts which were defined by this
stream subfunction 4 functions 66.
* 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. =======================
==================== Function 3 - get system time. ===================
======================================================================
Parameters:
* eax = 3 - number of the function
* eax = 3 - function number
Returned value:
* eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
* each unit comes back as BCD-number, for example,
for time 23:59:59 result will be 0x00595923
* each item is BCD-number, for example,
for time 23:59:59 function returns 0x00595923
Remarks:
* Look also subfunction 9 functions 26 - obtaining of time from the moment
of start of the system; it in many cases is more convenient, as returns
simply DWORD-value of the counter of time.
* System time can be installed by the function 22.
* 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.
 
======================================================================
================ Function 4 - draw text in the window. ===============
============ Function 4 - draw text string in the window. ============
======================================================================
Can output both strings with given length and NULL-terminated strings
(0x0) - ASCIIZ(string db 'text',0). To draw ASCIIZ string, pass -1
in esi (mov esi,-1).
Parameters:
* eax = 4 - number of the function
* eax = 4 - function number
* ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
* ecx = 0xX0RRGGBB, where
* RR, GG, BB set colour of the text
* X sets the used font: 0=system monowide,
* RR, GG, BB specify text color
* X specifies the used font: 0=system monospaced,
1=system font of variable width
* edx = pointer by the beginning of string
* esi = length of string, should be no more 255
* edx = pointer to the beginning of the string
* esi = length of the string, must not exceed 255
Returned value:
* function does not return value
Remarks:
* The first system font is read out at loading from the file char.mt,
second system font - from char2.mt.
* Both fonts have height 9 pixels, width of the monowide font
is equal 6 pixels.
* Function outputs either first (esi and 0xFF) characters or
all characters before (but not including) terminating zero
(for ASCIIZ-strings) depending on what occurs first.
* 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.
 
======================================================================
========================= Function 5 - pause. =========================
========================= Function 5 - delay. ========================
======================================================================
Delays execution of the program on the given time.
Parameters:
* eax = 5 - number of the function
* eax = 5 - function number
* ebx = time in the 1/100 of second
Returned value:
* function does not return value
Remarks:
* The transmission ebx=0 does not transfer handle the following process
and at all does not make any operations. If really it is required to
transfer handle to the following process (to complete a current time
slice), use subfunction of 1 function 68.
* At current realization there will be an immediate return from the function,
if the addition ebx with current value of the counter of time will call
32-bit overflow.
* 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.
* At current implementation there will be an immediate return from
the function, if the addition of ebx with current value of
time counter will call 32-bit overflow.
 
======================================================================
============== Function 6 - read the file with ramdisk. ==============
============== Function 6 - read the file from ramdisk. ==============
======================================================================
Parameters:
* eax = 6 - number of the function
* ebx = pointer on a filename
* ecx = number of the start block, beginning from 1;
ecx=0 - read from a beginning of the file (same, as ecx=1);
* edx = number of blocks for reading;
edx=0 - read one block (same, as edx=1)
* esi = pointer on area of memory, where the data will be written
* 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
Returned value:
* eax = file size in bytes, if the file is successfully read
* eax = -1, if the file is not retrieved
* eax = file size in bytes, if the file was successfully read
* eax = -1, if the file was not found
Remarks:
* The given function is out-of-date; the function 70 allows to fulfil
the same operations with the extended possibilities.
* This function is out-of-date; function 70 allows
to fulfil the same operations with the extended possibilities.
* Block = 512 bytes.
* For reading all file it is possible to 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 "will not be placed" in
memory of the program.
* The filename should be or in the format 8+3 characters (first 8 characters
- purely name, last 3 - extension, the short names and extensions are
supplemented by blanks), or in the format 8.3 characters
"FILE.EXT" / "FILE.EX " (name no more than 8 characters, point,
extension 3 characters supplemented if necessary by blanks).
The filename should be written by capital letters. The completing
character with the code 0 is not necessary (ASCIIZ-string).
* Current implementation ramdisk does not support the directory.
* 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.
 
======================================================================
=============== Function 7 - draw image in the window. ===============
======================================================================
Parameters:
* eax = 7 - number of the function
* ebx = pointer on the image in the format BBGGRRBBGGRR...
Paramters:
* eax = 7 - function number
* ebx = pointer to the image in the format BBGGRRBBGGRR...
* 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 concerning the window.
* Coordinates of the image are coordinates of the upper left corner
of the image relative to the window.
* Size of the image in bytes is 3*xsize*ysize.
 
======================================================================
=============== Function 8 - define/delete the button. ===============
======================================================================
Parameters for îïðåäåëåíèÿ êíîïêè:
* eax = 8 - number of the function
Parameters for button definition:
* eax = 8 - function number
* 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
* high (31-st) bit edx is reset
* if 30-th bit edx is installed - to not draw the button
* If 29-th bit edx is installed - to not draw a frame
* 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
at pressing the button
* esi = 0x00RRGGBB - colour of the button
Parameters for deleting the button:
* eax = 8 - number of the function
* esi = 0x00RRGGBB - color of the button
Parameters for button deleting:
* eax = 8 - function number
* edx = 0x80nnnnnn, where nnnnnn - identifier of the button
Returned value:
* function does not return value
Remarks:
* Sizes of the button should be more than 0 and less than 0x8000.
* For windows with skin at definition of the window (call of 0-th function)
there are two standard buttons - closing of the window with the
identifier 1 and minimization of the window with the identifier 0xffff.
* The creation of two buttons with identical 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
the usual button.
* Total of buttons for all applications is limited to number 4095.
* Sizes of the button must be more than 0 and less than 0x8000.
* For windows with skin definition of the window
(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.
 
======================================================================
========== Function 9 - information on thread of execution. ==========
============ Function 9 - information on execution thread. ===========
======================================================================
Parameters:
* eax = 9 - number of the function
* ebx = pointer on the buffer of a size 1 Kb
* ecx = number of the slot of thread
ecx = -1 - get information on current thread
* 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
Returned value:
* eax = maximum number of the slot of thread
* buffer, which specifies ebx, contains the following information:
* +0: dword: usage of the processor (how many clock ticks per one second
leaves on fulfilment of this thread)
* 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)
* +4: word: position of the window of thread in the window stack
* +6: word: (there is no ratio to the requested thread)
number of the slot thread, which window is in the window stack
in a position ecx
* +6: word: (has no relation to the specified thread)
number of the thread slot, which window has in the window stack
position ecx
* +8: word: reserved
* +10 = +0xA: 11 bytes: name of the process
(name of an appropriate executable file in the format 8+3)
* +21 = +0x15: byte: alignment, this byte does not vary
(name of corresponding executable file in the format 8+3)
* +21 = +0x15: byte: alignment, this byte preserves
* +22 = +0x16: dword: address of the process in memory
* +26 = +0x1A: dword: size of used memory - 1
* +30 = +0x1E: dword: identifier (PID/TID)
* +34 = +0x22: dword: coordinate of the window thread on axis x
* +38 = +0x26: dword: coordinate of the window thread on axis y
* +42 = +0x2A: dword: size of the window thread on axis x
* +46 = +0x2E: dword: size of the window thread on axis y
* +50 = +0x32: word: status of the slot thread:
* 0 = thread worked
* 1 = thread paused
* 2 = thread paused at the moment of waiting event
* 3 = thread completed as a result of function call -1 or
under duress as a consequence of call subfunction 2 functions 18
or termination of the system
* 4 = thread is completed as a result of exception
* 5 = thread wait event
* 9 = requested slot is free,
all other information on the slot is not meaningful
* +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
Remarks:
* Slots are numbered with 1.
* Returned value not is a total number of streams, as there are free slots.
* Ïðè ñîçäàíèè ïðîöåññà àâòîìàòè÷åñêè ñîçäàåòñÿ thread âûïîëíåíèÿ.
* Function produces the information on thread. Each process has even one
thread. One process can create some thread, in this case everyone thread
receives the slot, and the fields +10, +22, +26 in these slots coincide.
For the applications there is no common way to define, whether two thread
* 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
belong to one process.
* Active window - window which is taking place on top of the window stack,
it receives the messages on a keyboard input. For it the position in the
window stack coincides with returned value.
* Slot 1 corresponds to special thread of an operating system, for which:
* window is in the bottom of the window stack, the fields +4 and +6
contain value 1
* Nname of the process - "OS/IDLE" (supplemented by blanks)
* address of the process is equal memory 0, size of used memory
* 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
16 Mb (0x1000000)
* PID=1
* coordinates and sizes of the window conditionally rely equal 0
* status of the slot - always 0 (worked)
* The execution time adds of time leaving on purely operation, and down
time in waiting interruption (which can be received by call
subfunction 4 functions 18).
* Since the slot 2, the usual applications are placed.
* Usual applications are placed in memory to the address 0x10000000
(constant of a kernel std_application_base_address).
Intersection does not occur, as for each process the own page table.
* At creation thread to it are assigned the slot in the system table and
identifier (Process/Thread IDentifier = PID/TID), which for given thread
do not vary in the subsequent time.
After completion thread its slot can be anew used for another thread.
The identifier thread can not be assigned to other stream even after
completion first.
Identifiers, assigned to new thread, monotonously grow.
* If thread yet has not defined the window by function call 0,
a location and the sizes of this window rely in zero.
* In the given moment the part of the buffer by a size 52 = 0x34 of byte
is used only. Nevertheless it is recommended to use the buffer
by a size 1 KB for the future compatibility, in the future some fields
can be added.
* coordinates and sizes of the window are by convention set to 0
* 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.
* The normal applications are placed in memory at the address
0x10000000 (kernel constand 'std_application_base_address').
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.
* At the moment only the part of the buffer by a size
52 = 0x34 bytes is used. Nevertheless it is recommended to use
1-Kb buffer for the future compatibility, in the future
some fields can be added.
 
======================================================================
====================== Function 10 - wait event. =====================
==================== Function 10 - wait for event. ===================
======================================================================
If the message queue is empty, waits for appearance of the message in queue.
In such status thread does not receive CPU time.
If the message queue is empty, waits for appearance of the message
in queue. In this state thread does not consume CPU time.
Then reads out the message from queue.
 
Parameters:
* eax = 10 - number of the function
* eax = 10 - function number
Returned value:
* eax = event (look the list of events)
* eax = event (see the list of events)
Remarks:
* Those events are taken into account only which enter into a mask installed
by the function 40. By default it is events redraw, pressing keys
and buttons.
* For check, whether there is a message in queue, use the function 11.
To wait for the no more defined time, use the function 23.
* 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.
 
=======================================================================
= Function 11 - check up, whether there is an event, without waiting. =
=======================================================================
If in a message queue there is any event, reads out and returns it.
If queue is empty, returns zero.
======================================================================
=============== 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.
Parameters:
* eax = 11 - number of the function
* eax = 11 - function number
Returned value:
* eax = 0 - message queue is empty
* èíà÷å eax = event (look the list of events)
* else eax = event (see the list of events)
Remarks:
* Those events are taken into account only which enter into a mask installed
by the function 40. By default it is events redraw, pressing keys
and buttons.
* For waiting appearance of event in queue, use the function 10.
To wait for the no more defined time, use the function 23.
* 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.
 
======================================================================
========= Function 12 - begin/complete redraw of the window. =========
=============== Function 12 - begin/end window redraw. ===============
======================================================================
 
---------- Subfunction 1 - begin redraw of the window. ---------------
------------ Subfunction 1 - begin redraw of the window. -------------
Parameters:
* eax = 12 - number of the function
* ebx = 1 - number subfunction
* eax = 12 - function number
* ebx = 1 - subfunction number
Returned value:
* function does not return value
 
--------- Subfunction 2 - complete redraw of the window. -------------
------------- Subfunction 2 - end redraw of the window. --------------
Parameters:
* eax = 12 - number of the function
* ebx = 2 - number subfunction
* eax = 12 - function number
* ebx = 2 - subfunction number
Returned value:
* function does not return value
Remarks:
* Function of a beginning redraw all deletes defined by the
function 8 buttons, they should be defined again.
* Subfunction 1 deletes all buttons defined with
function 8, they must be defined again.
 
======================================================================
============ Function 13 - draw a rectangle in the window. ===========
======================================================================
Parameters:
* eax = 13 - number of the function
* eax = 13 - function number
* ebx = [coordinate on axis x]*65536 + [size on axis x]
* ecx = [coordinate on axis y]*65536 + [size on axis y]
* edx = colour 0xRRGGBB èëè 0x80RRGGBB for a gradient of filling
* edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
Returned value:
* function does not return value
Remarks:
* Coordinates are understood as coordinates of the left upper corner
of a rectangle concerning the window.
of a rectangle relative to the window.
 
======================================================================
================ Function 14 - get sizes of the screen. ==============
=================== Function 14 - get screen size. ===================
======================================================================
Parameters:
* eax = 14 - number of the function
* eax = 14 - function number
Returned value:
* eax = [xsize]*65536 + [ysize], where
* xsize = x-coordinate of the right lower corner of the screen =
size on a horizontal - 1
horizontal size - 1
* ysize = y-coordinate of the right lower corner of the screen =
size on a vertical - 1
vertical size - 1
Remarks:
* Look also subfunction 5 functions 48 - to receive sizes of
a working area of the screen.
* See also subfunction 5 of function 48 - get sizes of
working area of the screen.
 
========================================================================
= Function 15, subfunction 1 - install a size of the background image. =
========================================================================
======================================================================
== Function 15, subfunction 1 - set a size of the background image. ==
======================================================================
Parameters:
* eax = 15 - number of the function
* ebx = 1 - number subfunction
* eax = 15 - function number
* ebx = 1 - subfunction number
* ecx = width of the image
* edx = height of the image
Returned value:
* function does not return value
Remarks:
* Checks on a correctness is not done. The installation of the too large
values will result that the background will be entered with the data abroad
of buffer of the background map. The size of the buffer = 0x160000-0x10,
that corresponds to maximum sizes 800*600. (800*600*3=0x15F900)
* For upgrade of the screen (after completion of a series of commands
working with a background) call subfunction 3 redraw of a background.
* There is a pair function of get of sizes of the background image -
subfunction 1 function 39.
* There is no checks for correctness. The setting of too large
values will result that the background will contain data abroad
of buffer for the background image. Buffer size = 0x160000-0x10,
that corresponds to maximum size 800*600. (800*600*3=0x15F900)
* 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.
 
======================================================================
= Function 15, subfunction 2 - put a point on the background image. ==
=== Function 15, subfunction 2 - put pixel on the background image. ==
======================================================================
Parameters:
* eax = 15 - number of the function
* ebx = 2 - number subfunction
* eax = 15 - function number
* ebx = 2 - subfunction number
* ecx = offset
* edx = colour of a point 0xRRGGBB
* edx = color of a pixel 0xRRGGBB
Returned value:
* function does not return value
Remarks:
* Offset for a point with coordinates (x, y) is calculated as
* Offset for a pixel with coordinates (x,y) is calculated as
(x+y*xsize)*3.
* If the indicated offset exceeds 0x160000-16 =
1.375 Mb - 16 bytes, call is ignored.
* For upgrade of the screen (after completion of a series of commands
working with a background) call subfunction 3 redraw of a background.
* There is a pair function of obtaining of a point from the background
image - subfunction 2 functions 39.
* If the given offset exceeds 0x160000-16 = 1.375 Mb - 16 bytes,
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.
 
======================================================================
=========== Function 15, subfunction 3 - redraw background. ==========
======================================================================
Parameters:
* eax = 15 - number of the function
* ebx = 3 - number subfunction
* eax = 15 - function number
* ebx = 3 - subfunction number
Returned value:
* function does not return value
 
=========================================================================
= Function 15, subfunction 4 - set the mode of drawing of a background. =
=========================================================================
======================================================================
== Function 15, subfunction 4 - set drawing mode for the background. =
======================================================================
Parameters:
* eax = 15 - number of the function
* ebx = 4 - number subfunction
* ecx = mode of drawing:
* eax = 15 - function number
* ebx = 4 - subfunction number
* ecx = drawing mode:
* 1 = tile
* 2 = stretch
Returned value:
* function does not return value
Remarks:
* For upgrade of the screen (after completion of a series of commands
working with a background) call subfunction 3 redraw of a background.
* There is a pair command of obtaining of the mode redraw of a background
- subfunction 4 functions 39.
* 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.
 
===========================================================================
= Function 15, subfunction 5 - place the block of pixels on a background. =
===========================================================================
======================================================================
===================== Function 15, subfunction 5 =====================
============ Put block of pixels on the background image. ============
======================================================================
Parameters:
* eax = 15 - number of the function
* ebx = 5 - number subfunction
* ecx = pointer on the data in the format BBGGRRBBGGRR...
* eax = 15 - function number
* ebx = 5 - subfunction number
* ecx = pointer to the data in the format BBGGRRBBGGRR...
* edx = offset in data of the background image
* esi = size given in bytes = 3 * number of pixels
* esi = size of data in bytes = 3 * number of pixels
Returned value:
* function does not return value
Remarks:
* If the block gets out abroad 0x160000-16 = 1.375 Mb - 16 bytes,
the call is ignored.
* Colour of each pixel is stored as 3 bytes the value BBGGRR.
* Pixels of the background image are written sequentially from left to right,
from above downwards.
* Offset of a pixel with coordinates (x,y) it (x+y*xsize)*3.
* For upgrade of the screen (after completion of a series of commands
working with a background) call subfunction 3 redraw of a background.
* 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.
 
======================================================================
============= Function 16 - save ramdisk on a diskette. ==============
=============== Function 16 - save ramdisk on a floppy. ==============
======================================================================
Parameters:
* eax = 16 - number of the function
* ebx = 1 èëè ebx = 2 - on what floppy to save
* eax = 16 - function number
* ebx = 1 or ebx = 2 - on which floppy save
Returned value:
* eax = 0 - successfully
* eax = 0 - success
* eax = 1 - error
 
======================================================================
============== Function 17 - get code of pressed button. =============
======= Function 17 - get the identifier of the pressed button. ======
======================================================================
Takes away the code of the pressed button from the buffer.
Parameters:
* eax = 17 - number of the function
* eax = 17 - function number
Returned value:
* If the buffer is empty, comes back eax=1
* If the buffer is nonblank, comes back al=0, the high 24 bits eax contain
the identifier of the button (in particular, in ah there is a low byte of
the identifier; if all buttons have the identifier, smaller 256, for
distinguishing there is enough ah)
* if the buffer is empty, function returns eax=1
* if the buffer is not empty, function returns al=0,
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).
Remarks:
* "Buffer" keeps only one button, at pressing the new button the information
about old is lost.
* By call of this function by the application with the inactive window the
answer " the buffer comes back is empty ".
* "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".
 
======================================================================
============ Function 18, subfunction 1 - shutdown system. ===========
============ Function 18, subfunction 1 - system shutdown. ===========
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 1 - number subfunction
* eax = 18 - function number
* ebx = 1 - subfunction number
Returned value:
* Always comes back eax = 0 as tag of success
* function always return eax = 0 as tag of success
Remarks:
* On last step there is a menu of quit waiting responses of the user.
* Look also subfunction 9, termination of the system with the parameter
to speed up choice in the menu of an exit.
* On the last step menu of exit from the system appears and waits
response of the user.
* See also subfunction 9, system shutdown with
the parameter to force the choice in the exit menu.
 
======================================================================
= Function 18, subfunction 2 - complete process/thread on the slot. ==
= Function 18, subfunction 2 - terminate process/thread by the slot. =
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 2 - number subfunction
* eax = 18 - function number
* ebx = 2 - subfunction number
* ecx = number of the slot of process/thread
Returned value:
* function does not return value
Remarks:
* It is impossible to complete thread of an operating system OS/IDLE
(number of the slot 1), it is possible to complete
any usual thread/process.
* See also subfunction 18 - completion of process/thread
with the given identifier.
* 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.
 
=========================================================================
= Function 18, subfunction 3 - do to the active window selected thread. =
=========================================================================
======================================================================
===================== Function 18, subfunction 3 =====================
============= Make active the window of the given thread. ============
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 3 - number subfunction
* ecx = number of the slot thread
* eax = 18 - function number
* ebx = 3 - subfunction number
* ecx = number of the thread slot
Returned value:
* function does not return value
Remarks:
* At the instruction correct, but nonexistent slot any window is made active.
* Find out, what window is active, is possible by call subfunction 7.
* If correct, but nonexistent slot is given,
some window is made active.
* To find out, which window is active, use subfunction 7.
 
==============================================================================
Function 18, subfunction 4 - get counter of empty clock ticks per one second.
==============================================================================
Empty clock ticks are understood as time, in which the processor stands idle
in waiting interruption (in the instruction hlt).
======================================================================
===================== 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').
 
Parameters:
* eax = 18 - number of the function
* ebx = 4 - number subfunction
* eax = 18 - function number
* ebx = 4 - subfunction number
Returned value:
* eax = value of the counter of empty clock ticks per one second
* eax = value of the counter of idle time units per one second
 
======================================================================
=========== Function 18, subfunction 5 - get cpu frequency. ==========
========== Function 18, subfunction 5 - get CPU clock rate. ==========
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 5 - number subfunction
* eax = 18 - function number
* ebx = 5 - subfunction number
Returned value:
* eax = cpu frequency (modulo 2^32 clock ticks = 4GHz)
* eax = clock rate (modulo 2^32 clock ticks = 4GHz)
 
=====================================================================
== Function 18, subfunction 6 - save ramdisk in file on hard disk. ==
=====================================================================
======================================================================
Function 18, subfunction 6 - save ramdisk to the file on hard drive.
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 6 - number subfunction
* eax = 18 - function number
* ebx = 6 - subfunction number
* ecx defines path to the file:
* 1 = in the directory "/KOLIBRI"
* 2 = in the root
* 3 = edx specifies path (names of folders in the format 8+3, divided '/')
* 1 = in the folder "/KOLIBRI"
* 2 = in the root folder
* 3 = edx points to the path (names of folders in the format 8+3,
divided by '/')
Returned value:
* eax = 0 - successfully
* differently eax = an error code of a file system
Remarks:
* Filename is fixed, "menuet.img" (global variable of
a kernel image_save from preboot.inc)
* On what partition what disk the file will be saved, is defined
subfunction 7 and subfunction 8 functions 21.
* All directories in the indicated path should exist, differently will
return value 5, " the file is not retrieved ".
* eax = 0 - success
* else eax = error code of the file system
Çàìå÷àíèÿ:
* Filename is fixed, "menuet.img" (global kernel variable
'image_save' from 'preboot.inc')
* Drive and partition are defined by subfunction 7
and subfunction 8 of function 21.
* All folders in the given path must exist, otherwise function
returns value 5, "file not found".
 
======================================================================
====== Function 18, subfunction 7 - get number of active window. =====
=========== Function 18, subfunction 7 - get active window. ==========
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 7 - number subfunction
* eax = 18 - function number
* ebx = 7 - subfunction number
Returned value:
* eax = number of active window (number of the slot thread, which window
is active)
* eax = number of the active window
(number of the slot of the thread with active window)
Remarks:
* Active window is at the top of the window stack and receives the messages
on all keyboard input.
* Make the window active it is possible by call subfunction 3.
* 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.
 
=======================================================================
==== Function 18, subfunction 8 - disable/enable a speaker sound . ====
=======================================================================
At the disconnected sound the calls subfunction 55 functions 55 are ignored.
At included - are routed on built - in speaker.
======================================================================
== 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.
 
--------------- Subsubfunction 1 - get a status. ----------------
------------------- Subsubfunction 1 - get status. -------------------
Parameters:
* eax = 18 - number of the function
* ebx = 8 - number subfunction
* ecx = 1 - number subsubfunction
* eax = 18 - function number
* ebx = 8 - subfunction number
* ecx = 1 - number of the subsubfunction
Returned value:
* eax = 0 - sound speaker is enabled; 1 - is disabled
* eax = 0 - speaker sound is enabled; 1 - disabled
 
-------------- Subsubfunction 2 - switch a status. --------------
Switches statuses of disable/enable.
----------------- Subsubfunction 2 - toggle status. ------------------
Toggles states of disable/enable.
Parameters:
* eax = 18 - number of the function
* ebx = 8 - number subfunction
* ecx = 2 - number subsubfunction
* eax = 18 - function number
* ebx = 8 - subfunction number
* ecx = 2 - number of the subsubfunction
Returned value:
* function does not return value
 
===========================================================================
= Function 18, subfunction 9 - shutdown of the system with the parameter. =
===========================================================================
======================================================================
== Function 18, subfunction 9 - system shutdown with the parameter. ==
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 9 - number subfunction
* eax = 18 - function number
* ebx = 9 - subfunction number
* ecx = parameter:
* 1 = On last step of shutdown to save ramdisk on a diskette then to
output the menu of an exit and to request of the user further operations
* 2 = switch off the computer
* 3 = reboot the computer
* 4 = restart a kernel from the file kernel.mnt on ramdisk
* 1 = on the last step of shutdown save ramdisk on a floppy and
then show the exit menu and request further operations
from the user
* 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 vary (i.e. eax=18)
* By correct call tag of success eax=0 always comes back
* 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:
* It is not necessary to rely on returned value by incorrect call,
it can vary in the subsequent versions of a kernel.
* It is possible to use subfunction 1, that on last step of termination
the user himself has selected, that it is necessary.
* It is not recommended to use value ecx=1 (to not irritate the user with
excessive questions); to save ramdisk on a diskette it is possible by the
function 16 (which admits specification, on which diskette to write), and
to complete operation from the menu of an output(exit) it is possible
already mentioned subfunction 1.
* Do not rely on returned value by incorrect call, it can be
changed in future versions of the kernel.
* It is possible to use subfunction 1, that on the last step
the user makes choice himself.
* It is not recommended to use value ecx=1 (to not irritate the user
with excessive questions); to save ramdisk on a floppy use
function 16 (which admits specification, on which floppy to
write), and to shutdown with the exit menu use already mentioned
subfunction 1.
 
=======================================================================
====== Function 18, subfunction 10 - minimize application window. =====
=======================================================================
Turns off the own window.
======================================================================
===== Function 18, subfunction 10 - minimize application window. =====
======================================================================
Minimizes the own window.
Parameters:
* eax = 18 - number of the function
* ebx = 10 - number subfunction
* eax = 18 - function number
* ebx = 10 - subfunction number
Returned value:
* function does not return value
Remarks:
* The minimized window from the point of view of the function 9 saves
a location and sizes.
* Restoring of an application window occurs at activation subfunction 3.
* Usually there is no necessity obviously to turn off/restore the window:
turn off of the window is carried out by the system at pressing the button
of minimization (which for windows with SKIN is defined automatically by
function 0, for windows without SKIN it is possible to define by the
function 8), restoring - application @panel.
* The minimized window from the point of view of function 9
keeps position and sizes.
* Restoring of an application window occurs at its activation by
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'.
 
======================================================================
==================== Function 18, subfunction 11 =====================
================ Get information on a disk subsystem. ================
Function 18, subfunction 11 - get information on the disk subsystem.
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 11 - number subfunction
* eax = 18 - function number
* ebx = 11 - subfunction number
* ecx = type of the table:
* 1 = short version, 10 bytes
* 2 = full version, 65536 bytes
* edx = pointer on the buffer (in the application) for table
* edx = pointer to the buffer (in the application) for the table
Returned value:
* function does not return value
Format of the table: the short version:
* +0: byte: information about FDD's (drives for diskettes), AAAABBBB,
where AAAA sets type of the first drive, BBBB - second disk agrees
to the following list:
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:
* 0 = there is no drive
* 1 = 360Kb, 5.25''
* 2 = 1.2Mb, 5.25''
* 3 = 720Kb, 3.5''
* 4 = 1.44Mb, 3.5''
* 5 = 2.88Mb, 3.5'' (such diskettes already are not used)
For example, for the standard configuration from one 1.44-drive here will
be 40h, and for a case 1.2Mb on A: and 1.44Mb on B: the value appears 24h.
* +1: byte: information about hard disks and CD - drives, AABBCCDD,
* 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,
where AA corresponds to the controller IDE0, ..., DD - IDE3:
* 0 = device is absent
* 1 = hard disk
* 2 = CD - drive
For example, in a case HD on IDE0 and CD on IDE2 here will be 48h.
* +2: 4 db: Number of the retrieved sections on hard disks with
accordingly IDE0..., IDE3.
At absence of the hard disk on IDEx appropriate byte zero, at presence
shows number of the recognized partitions, which can and to not be (if the
drive is not formatted or if the file system is not supported). In the
current version of a kernel for hard disks are supported only FAT16
and FAT32.
* 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
supports only FAT16 and FAT32 for hard disks.
* +6: 4 db: reserved
Format of the table: the complete version:
* +0: 10 db: same, as well as in the short version
Format of the table: full version:
* +0: 10 db: same as for the short version
* +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
The sections are located in the following order: at first sequentially all
recognized partitions on HD on IDE0 (if are), then on HD on IDE1 (if is)
etc. up to IDE3.
Format of the information about partition (while is supported only FAT):
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):
* +0: dword: first physical sector of the partition
* +4: dword: last physical sector of the partition
(belongs to partition)
* +8: dword: sectors in one copy FAT
* +12 = +0xC: dword: number of copies FAT
* +16 = +0x10: dword: number of sectors in a cluster
* +20 = +0x14: dword: byte in sector; the current implementation expects,
that here 0x200 = 512
* +24 = +0x18: dword: first cluster of the root in FAT32, 0 for FAT16
* +28 = +0x1C: dword: first physical sector FAT
* +32 = +0x20: dword: first physical sector of the root for FAT16,
is ignored for FAT32
* +36 = +0x24: dword: number of sectors in the root for FAT16, 0 for FAT32
* +40 = +0x28: dword: physical sector of a beginning of area of the data
(belongs to the partition)
* +8: dword: sectors per one copy of FAT
* +12 = +0xC: dword: number of copies of FAT
* +16 = +0x10: dword: number of sectors per cluster
* +20 = +0x14: dword: bytes per sector;
current implementation expects 0x200 = 512 in this field
* +24 = +0x18: dword: first root cluster in FAT32, 0 for FAT16
* +28 = +0x1C: dword: first physical sector of FAT
* +32 = +0x20: dword: first physical root sector for FAT16,
ignored for FAT32
* +36 = +0x24: dword: number of root sectors for FAT16,
0 for FAT32
* +40 = +0x28: dword: physical sector of the beginning of
the data area
* +44 = +0x2C: dword: maximum number of a cluster
* +48 = +0x30: dword: physical sector of the information about a file system
for FAT32, is ignored for FAT16
* +52 = +0x34: dword: value used as boundary of special values in FAT
* +48 = +0x30: dword: physical sector of the information
about the file system for FAT32, ignored for FAT16
* +52 = +0x34: dword: value used as boundary for special
values in FAT
* +56 = +0x38: dword: value used for bad clusters in FAT
* +60 = +0x3C: dword: Value used as the end mark at recording of a chain
in FAT
* +64 = +0x40: dword: mask superimposed on a unit FAT
* +68 = +0x44: byte: type of a file system: 16 or 32
* +60 = +0x3C: dword: value used as the end marker for FAT chain
* +64 = +0x40: dword: mask for FAT items
* +68 = +0x44: byte: file system type: 16 èëè 32
* +69 = +0x45: 31 db: reserved
Remarks:
* Short table can be used for obtaining the information about available
devices.
* First two information fields about partition in the complete version of
the table inform parameters of the unit which has stayed - parameters of
a file system FAT. For other file systems (when they will be supported)
information, specific to a file system, naturally, there will be another,
but first two fields will be saved constant.
* The short table can be used for obtaining the information about
available devices.
* First two fields in the information about partition
gives the parameters of partition, other - parameters of
FAT file system. For other file systems (when they will be
supported) specific for file system information will be, of
course, another, but first two fields will have the same sense.
 
======================================================================
======== Function 18, subfunction 13 - get version of a kernel. ======
========== Function 18, subfunction 13 - get kernel version. =========
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 13 - number subfunction
* ecx = pointer on the buffer (not less than 16 bytes), where the
information will be placed
* eax = 18 - function number
* ebx = 13 - subfunction number
* ecx = pointer to the buffer (not less than 16 bytes), where
the information will be placed
Returned value:
* function does not return value
Structure of the buffer:
db a,b,c,d for version a.b.c.d
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
db 'name',0 - ASCIIZ-string with a name
For kernel Kolibri 0.5.8.1:
db 'name',0 - ASCIIZ-string with the name
For Kolibri 0.5.8.1 kernel:
db 0,5,8,1
db 2
db 'Kolibri',0
 
=========================================================================
====================== Function 18, subfunction 14 ======================
= Expect a beginning of retrace of a ray of scanning of screen monitor. =
=========================================================================
======================================================================
======= Function 18, subfunction 14 - wait for screen retrace. =======
======================================================================
Waits for the beginning of retrace of the scanning ray of the screen
monitor.
Parameters:
* eax = 18 - number of the function
* ebx = 14 - number subfunction
* eax = 18 - function number
* ebx = 14 - subfunction number
Returned value:
* eax = 0 as tag of success
* eax = 0 as the tag of success
Remarks:
* Function is intended only for the active high-efficiency graphics
* Function is intended only for active high-efficiency graphics
applications; is used for smooth output of a graphics.
 
============================================================================
= Function 18, subfunction 15 - place a mouse pointer in centre of screen. =
============================================================================
======================================================================
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 15 - number subfunction
* eax = 18 - function number
* ebx = 15 - subfunction number
Returned value:
* eax = 0 as tag of success
* eax = 0 as the tag of success
 
======================================================================
====================== Function 18, subfunction 16 ===================
====================== Get a size of the free RAM. ===================
========= Function 18, subfunction 16 - get size of free RAM. ========
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 16 - number subfunction
* eax = 18 - function number
* ebx = 16 - subfunction number
Returned value:
* eax = size of free memory in kilobytes
 
======================================================================
====================== Function 18, subfunction 17 ===================
====================== Get a size of the amount RAM. =================
======== Function 18, subfunction 17 - get full amount of RAM. =======
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 17 - number subfunction
* eax = 18 - function number
* ebx = 17 - subfunction number
Returned value:
* eax = common size of amount memory in kilobytes
* eax = total size of existing memory in kilobytes
 
======================================================================
====================== Function 18, subfunction 18 ===================
============= complete process/thread on the identifier. =============
===================== Function 18, subfunction 18 ====================
============= Terminate process/thread by the identifier. ============
======================================================================
Parameters:
* eax = 18 - number of the function
* ebx = 18 - number subfunction
* ecx = identifier of process/thread (PID/TID)
* eax = 18 - function number
* ebx = 18 - subfunction number
* ecx = identifer of process/thread (PID/TID)
Returned value:
* eax = 0 - successfully
* eax = -1 - error (the process is not retrieved or is system)
* eax = 0 - success
* eax = -1 - error (process is not found or is system)
Remarks:
* It is impossible to complete thread of an operating system OS/IDLE
(number of the slot 1), it is possible to complete any usual thread/process.
* See also subfunction 2 - completion of process / thread on the given slot.
* 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.
 
======================================================================
============ Function 19 - start application with ramdisk. ===========
============ Function 19 - start application from ramdisk. ===========
======================================================================
Parameters:
* eax = 19 - number of the function
* ebx = pointer on an application name in format similar to function 6
* ecx = 0 or ecx = the pointer on parameters of the command line
* eax = 19 - function number
* ebx = pointer to the application name in format similar
to function 6
* ecx = 0 or ecx = pointer to command line parameters
Returned value:
* If eax > 0, eax contains PID of the created process
* If eax < 0, -eax - error code of a file system
* If eax > 0, then eax contains PID of the created process
* If eax < 0, then -eax - file system error code
Remarks:
* This function is obsolete; use subfunction 7 functions 70.
* Command line should be ended by the character with the code 0
(ASCIIZ-strings); it are taken into account or all characters up to
completing zero inclusively, or the first 256 characters, that are less.
* This function is obsolete; use subfunction 7 of function 70.
* 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.
 
======================================================================
==================== Function 20 - interface MIDI. ===================
==================== Function 20 - MIDI interface. ===================
======================================================================
 
------------------------ Subfunction 1 - reset ------------------------
----------------------- Subfunction 1 - reset ------------------------
Parameters:
* eax = 20 - number of the function
* ebx = 1 - number subfunction
* eax = 20 - function number
* ebx = 1 - subfunction number
 
-------------------- Subfunction 2 - output byte ---------------------
Parameters:
* eax = 20 - number of the function
* ebx = 2 - number subfunction
* eax = 20 - function number
* ebx = 2 - subfunction number
* cl = byte for output
Returned value (is identical to both subfunctions):
* eax = 0 - successfully
Returned value (is the same for both subfunctions):
* eax = 0 - success
* eax = 1 - base port is not defined
Remarks:
* Base port previously should be defined by call
subfunction of 1 function 21.
* Previously the base port must be defined by
subfunction 1 of function 21.
 
======================================================================
==== Function 21, subfunction 1 - install a base port MPU MIDI. ======
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 1 - number subfunction
* ecx = number of a base port
Returned value:
* eax = 0 - successfully
* eax = 21 - function number
* ebx = 1 - subfunction number
* ecx = number of base port
Returned value
* eax = 0 - success
* eax = -1 - erratic number of a port
Remarks:
* Number of a port should satisfy to conditions 0x100<=ecx<=0xFFFF.
* Installation of base is necessary for operation of the function 20.
* Get installed base port it is possible by call
subfunction of 1 function 26.
* 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.
 
======================================================================
======== Function 21, subfunction 2 - install keyboard layout. =======
========== Function 21, subfunction 2 - set keyboard layout. =========
======================================================================
Keyboard layout is used for conversion scancodes, acting from the keyboard,
in ASCII-codes which were read - out by the function 2.
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
which will be read by function 2.
Parameters:
* eax = 21 - number of the function
* ebx = 2 - number subfunction
* ecx = what layout to install:
* eax = 21 - function number
* ebx = 2 - subfunction number
* ecx = which layout to set:
* 1 = normal layout
* 2 = layout at pressed Shift
* 3 = layout at pressed Alt
* edx = pointer on layout - table of length 128 bytes
* edx = pointer to layout - table of length 128 bytes
Or:
* ecx = 9
* dx = identifier of the country (1=eng, 2=fi, 3=ger, 4=rus)
* dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
Returned value:
* eax = 0 - successfully
* eax = 1 - parameter is given incorrectly
* eax = 0 - success
* eax = 1 - incorrect parameter
Remarks:
* If is pressed Alt, the layout with Alt is used; if not is pressed Alt,
but is pressed Shift, the layout with Shift is used; if not are
pressed Alt and Shift, but is pressed Ctrl, the normal layout is used,
then from the code is subtracted 0x60; if not any of direction keys
is pressed, the normal layout is used.
* get layouts and identifier of the country it is possible with the help
subfunction 2 functions 26.
* The identifier of the country - global environment variable, which by
kernel is not used; however application @panel displays an icon,
appropriate to the current country.
* Application @panel switches layouts on search of the user.
* 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.
* To get layout and country identifier use
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.
 
======================================================================
=========== Function 21, subfunction 3 - install base CD. ============
============== Function 21, subfunction 3 - set CD base. =============
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 3 - number subfunction
* ecx = base CD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
* eax = 21 - function number
* ebx = 3 - subfunction number
* ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
Returned value:
* eax = 0
Remarks:
* Base CD is used by the function 24.
* Receive the installed base CD it is possible by call
subfunction 3 functions 26.
* CD base is used by function 24.
* To get CD base use subfunction 3 of function 26.
 
======================================================================
=== Function 21, subfunction 4 - install base port Sound Blaster. ====
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 4 - number subfunction
* ecx = number base port
* eax = 21 - function number
* ebx = 4 - subfunction number
* ecx = number of the base port
Returned value:
* eax = 0 - successfully
* eax = -1 - erratic number of a port
* eax = 0 - success
* eax = -1 - erratic port number
Remarks:
* Number of a port should satisfy to conditions 0x100<=ecx<=0xFFFF.
* Installation of base is necessary for operation of functions 25, 28, 55.
* Get installed base port it is possible by call subfunction 4 functions 26.
* Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
* The installation of the base is necessary for
functions 25, 28, 55.
* To get base port use subfunction 4 of function 26.
 
======================================================================
==== Function 21, subfunction 5 - install the language of system. ====
========== Function 21, subfunction 5 - set system language. =========
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 5 - number subfunction
* ecx = language of system (1=eng, 2=fi, 3=ger, 4=rus)
* eax = 21 - function number
* ebx = 5 - subfunction number
* ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
Returned value:
* eax = 0
Remarks:
* Language of the system - global environment variable in any way which
is not used by kernel, however application @panel draws
an appropriate icon.
* Checks on a correctness is not done, as the kernel this variable
does not use.
* Get language of the system it is possible by call
subfunction 5 functions 26.
* 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.
 
======================================================================
========= Function 21, subfunction 6 - install base port WSS. ========
=========== Function 21, subfunction 6 - set WSS base port. ==========
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 6 - number subfunction
* eax = 21 - function number
* ebx = 6 - subfunction number
* ecx = base port
Returned value:
* eax = 0 - successfully
* eax = -1 - erratic number of a port
* eax = 0 - success
* eax = -1 - erratic port number
Remarks:
* Number of a port should satisfy to conditions 0x100<=ecx.
* Base WSS is used by the function 27.
* Get installed base port WSS it is possible by call
subfunction 6 functions 26.
* Port number must satisfy to condition 0x100<=ecx.
* WSS base is used by function 27.
* To get WSS base port use subfunction 6 of function 26.
 
======================================================================
=========== Function 21, subfunction 7 - install base HD. ============
============== Function 21, subfunction 7 - set HD base. =============
======================================================================
The base HD is necessary for definition, on what hard disk to write, at usage
of out-of-date functions of operation with a file system and functions
implicitly using the hard disk (such as subfunction of 6 functions 18);
At usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
these functions install base.
The HD base defines hard disk to write with usage of obsolete
file system functions and functions implicitly using the hard disk
(such as subfunction 6 of function 18);
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
these function set base themselves.
Parameters:
* eax = 21 - number of the function
* ebx = 7 - number subfunction
* ecx = base HD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
* eax = 21 - function number
* ebx = 7 - subfunction number
* ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
Returned value:
* eax = 0
Remarks:
* Any application at any moment of time can change base.
* It is not necessary to change base, when any application works
with the hard disk. If not want errors of the system.
* Get installed base it is possible by call subfunction 7 functions 26.
* It is necessary also to define used partition of
the hard disk subfunction 8.
* 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.
* It is also necessary to define used partition of hard disk by
subfunction 8.
 
======================================================================
========= Function 21, subfunction 8 - install partition HD. =========
========= Function 21, subfunction 8 - set used HD partition. ========
======================================================================
The section HD is necessary for definition, on what partition of the hard disk
to write, at usage of out-of-date functions of operation with a file system and
functions implicitly using the hard disk (such as subfunction of 6 functions
18); at usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
these functions install base and partition.
The HD partition defines partition of the hard disk to write with
usage of obsolete file system functions and functions implicitly
using the hard disk (such as subfunction 6 of function 18);
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
these functions set base and partition themselves.
Parameters:
* eax = 21 - number of the function
* ebx = 8 - number subfunction
* ecx = partition HD (beginning from 1)
Returned value:
* eax = 21 - function number
* ebx = 8 - subfunction number
* ecx = HD partition (beginning from 1)
Return value:
* eax = 0
Remarks:
* Any application at any moment of time can change partition.
* It is not necessary to change partition, when any application works
with the hard disk. If not want errors of the system.
* Get installed partition it is possible by call subfunction 8 functions 26.
* Checks on a correctness is not done.
* Find out number of partitions on the hard disk it is possible by call
subfunction 11 functions 18.
* It is necessary also to define used base of the hard disk subfunction 7
* 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.
* To get the number of partitions of a hard disk use
subfunction 11 of function 18.
* It is also necessary to define used HD base by subfunction 7.
 
======================================================================
=== Function 21, subfunction 10 - install channel DMA for a sound. ===
======== Function 21, subfunction 10 - set sound DMA channel. ========
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 10 - number subfunction
* eax = 21 - function number
* ebx = 10 - subfunction number
* ecx = number of channel (from 0 up to 3 inclusively)
Returned value:
* eax = 0 - successfully
* eax = -1 - incorrect number of the channel
* eax = 0 - success
* eax = -1 - incorrect channel number
Remarks:
* Number of the channel DMA is used in subfunction of 1 function 55.
* Get channel DMA for a sound it is possible by call
subfunction 10 functions 26.
* Number of DMA channel is used in subfunction 1 of function 55.
* To get sound DMA channel use subfunction 10 of function 26.
 
======================================================================
====================== Function 21, subfunction 11 ===================
=============== Permit/prohibit low level access to HD. ==============
Function 21, subfunction 11 - enable/disable low-level access to HD.
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 11 - number subfunction
* ecx = 0/1 - prohibit/permit
* eax = 21 - function number
* ebx = 11 - subfunction number
* ecx = 0/1 - disable/enable
Returned value:
* eax = 0
Remarks:
* Is used at LBA-reading (subfunction 8 functions 58).
* Current realization uses only low bit ecx.
* Get a current status it is possible by call subfunction 11 functions 26.
* 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.
 
======================================================================
====================== Function 21, subfunction 12 ===================
============= Permit/prohibit low level access to PCI. ===============
Function 21, subfunction 12 - enable/disable low-level access to PCI.
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 12 - number subfunction
* ecx = 0/1 - prohibit/permit
* eax = 21 - function number
* ebx = 12 - subfunction number
* ecx = 0/1 - disable/enable
Returned value:
* eax = 0
Remarks:
* Is used by operation with the bus PCI (function 62).
* Current realization uses only low bit ecx.
* Get a current status it is possible by call subfunction 12 functions 26.
* 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.
 
======================================================================
============= Function 21, subfunction 13, subsubfunction 1 ==========
======= Initialize + get information on the driver vmode.mdr. ========
============ Function 21, subfunction 13, subsubfunction 1 ===========
======== Initialize + get information on the driver vmode.mdr. =======
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 13 - number subfunction
* ecx = 1 - number of the function äðàéâåðà
* edx = pointer on the buffer of a size of 512 bytes
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 1 - number of the driver function
* edx = pointer to 512-bytes buffer
Returned value:
* If the driver is not loaded (never it happens in current implementation):
* if driver is not loaded
(never happens in the current implementation):
* eax = -1
* ebx, ecx fail
* If the driver is loaded:
* eax = 'MDAZ' (in style fasm, i.e. 'M' - low byte,
'Z' - high) - signature
* ebx = current frequency of the scanning (in a Hz)
* ecx fail
* buffer, which specifies edx, is filled
* 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
Format of the buffer:
* +0: 32*byte: name of the driver, " Trans VideoDriver " (without quotes,
is supplemented by blanks)
* +32 = +0x20: dword: version of the driver (version x.y is encoded
as y*65536+x), for current implementation 1 (1.0)
* +36 = +0x24: 7*dword: reserved (0 in current implementation)
* +64 = +0x40: 32*word: list of supported videomodes (each word - number
of videomode, after the purely list there are zero)
* +128 = +0x80: 32*(5*word): list of supported frequencies of the scannings
for videomodes: for each videomode indicated in the previous field,
up to 5 supported frequencies (in unused positions are indicated the zero)
are written.
* +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 should
be called by first, before others (differently they will return -1,
nothing doing).
* In current implementation one frequency of the scanning on videomode
is supported only.
* 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. ==============
============ Function 21, subfunction 13, subsubfunction 2 ===========
================ Get information on current videomode. ===============
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 13 - number subfunction
* ecx = 2 - number of the function of the driver
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 2 - number of the driver function
Returned value:
* eax = -1 - driver is not loaded or is not initialized;
ebx,ecx fail
* eax = -1 - driver is not loaded or not initialized;
ebx,ecx are destroyed
* eax = [width]*65536 + [height]
* ebx = frequency of the vertical scanning (in a Hz)
* ebx = frequency of the vertical scanning (in Hz)
* ecx = number of current videomode
Remarks:
* Driver previously should be initialized by function call of the driver 1.
* If the sizes of the screen are necessary only, it is more expedient
to use the function 14 that it returns sizes on 1 less.
* Driver must be initialized by call to
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.
 
======================================================================
= Function 21, subfunction 13, subsubfunction 3 - install videomode.
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 13 - number subfunction
* ecx = 3 - number of the function of the driver
* edx = [frequency of the scanning] *65536 + [number of videomode]
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 3 - number of the driver function
* edx = [scanning frequency]*65536 + [videomode number]
Returned value:
* eax = -1 - driver is not loaded, not initialized or has taken place error
* eax = 0 - successfully
* ebx, ecx fail
* eax = -1 - driver is not loaded, not initialized or
an error has occured
* eax = 0 - success
* ebx, ecx destroyed
Remarks:
* Driver previously should be initialized by function call of the driver 1.
* Number of videomode and frequency should be in the table returned
function 1 of the driver.
* Driver must be initialized by driver function 1.
* The videomode number and frequency must be in the table
returned by driver function 1.
 
======================================================================
============= Function 21, subfunction 13, subsubfunction 4 ==========
===================== Return to former videomode. ====================
============ Function 21, subfunction 13, subsubfunction 4 ===========
================== Return to the initial videomode. ==================
======================================================================
Âîçâðàùàåò ýêðàí â videomode, óñòàíîâëåííîì ïðè çàãðóçêå ñèñòåìû.
Returns the screen to the videomode set at system boot.
Parameters:
* eax = 21 - number of the function
* ebx = 13 - number subfunction
* ecx = 4 - number of the function of the driver
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 4 - number of the driver function
Returned value:
* eax = -1 - driver is not loaded or is not initialized
* eax = 0 - successfully
* ebx, ecx fail
* eax = -1 - driver is not loaded or not initialized
* eax = 0 - success
* ebx, ecx destroyed
Remarks:
* Driver previously should be initialized by function call of the driver 1.
* Driver must be initialized by call to driver function 1.
 
=======================================================================
============= Function 21, subfunction 13, subsubfunction 5 ===========
====== Increase/reduce a size of visible area of screen monitor. ======
=======================================================================
======================================================================
============ Function 21, subfunction 13, subsubfunction 5 ===========
===== Increase/decrease the size of the visible area of monitor. =====
======================================================================
Parameters:
* eax = 21 - number of the function
* ebx = 13 - number subfunction
* ecx = 5 - number of the function of the driver
* edx = 0/1 - reduce/increase a size on a horizontal by one position
* edx = 2/3 - in current realization is not supported; is planned as
decrease/increase of a size on a vertical for one position
* 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
Returned value:
* eax = -1 - driver is not loaded or is not initialized
* eax = 0 - successfully
* ebx, ecx fail
* eax = -1 - driver is not loaded or not initialized
* eax = 0 - success
* ebx, ecx destroyed
Remarks:
* Driver previously should be initialized by function call of the driver 1.
* Function influences only a physical size of the map on the screen monitor;
the logical size (number of pixels) does not vary.
* 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.
 
======================================================================
=============== Function 22 - install system date/time. ==============
================= Function 22 - set system date/time. ================
======================================================================
Parameters:
* eax = 22 - number of the function
* ebx = 0 - install time
* ecx = 0x00SSMMHH - time in a binary-decimal code (BCD):
* eax = 22 - function number
* ebx = 0 - set time
* ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
* HH=hour 00..23
* MM=minute 00..59
* SS=second 00..59
* ebx = 1 - óñòàíîâèòü äàòó
* ecx = 0x00DDMMYY - date in a binary-decimal code (BCD):
* ebx = 1 - set date
* ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
* DD=day 01..31
* MM=month 01..12
* YY=year 00..99
* ebx = 2 - install day of week
* ebx = 2 - set day of week
* ecx = 1 for Sunday, ..., 7 for Saturday
* ebx = 3 - install an alarm clock
* ebx = 3 - set alarm clock
* ecx = 0x00SSMMHH
Returned value:
* eax = 0 - successfully
* eax = 1 - parameter is given incorrectly
* eax = 0 - success
* eax = 1 - incorrect parameter
* eax = 2 - CMOS-battery was unloaded
Remarks:
* value of installation of day of week is represented doubtful, as it a
little where is used (day of week it is possible to calculate by date of).
* Alarm clock can be installed on operation in the given time each day.
Thus to disable by its existing system functions it is impossible.
* Operation of an alarm clock consists in generation IRQ8.
* Generally CMOS supports for an alarm clock installation of value 0xFF
as one of parameters and means it, that the appropriate parameter
is ignored. But in current implementation it will not pass
(will return value 1).
* Alarm clock - global system resource; the installation of an alarm clock
automatically cancels the previous installation. However, at present any
program it does not use.
* 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.
 
======================================================================
============== Function 23 - expect event with timeout. =============
============= Function 23 - wait for event with timeout. =============
======================================================================
If message queue is empty, waits for appearance of the message in queue, but no more indicated time. Then reads out the message from queue.
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.
 
Parameters:
* eax = 23 - number of the function
* eax = 23 - function number
* ebx = timeout (in 1/100 of second)
Returned value:
* eax = 0 - message queue is empty
* differently eax = event (look the list of events)
* eax = 0 - the message queue is empty
* otherwise eax = event (see the list of events)
Remarks:
* Those events are taken into account only which enter into a mask installed
by the function 40. By default it is events redraw, pressing keys
and buttons.
* For check, whether there is a message in queue, use the function 11.
To wait as much as long, use the function 10.
* Transmission ebx=0 results in instant returning eax=0.
* At current realization there will be an immediate return from the function
with eax=0, if the addition ebx with current value of the counter of time
will call 32-bit overflow.
* 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.
 
======================================================================
======= Function 24, subfunction 1 - begin to play a CD - audio. =====
======== Function 24, subfunction 1 - begin to play CD-audio. ========
======================================================================
Parameters:
* eax = 24 - number of the function
* ebx = 1 - number subfunction
* eax = 24 - function number
* ebx = 1 - subfunction number
* ecx = 0x00FRSSMM, where
* MM = initial minute
* SS = initial second
* FR = initial frame
* MM = starting minute
* SS = starting second
* FR = starting frame
Returned value:
* eax = 0 - successfully
* eax = 1 - base CD is not defined
* eax = 0 - success
* eax = 1 - CD base is not defined
Remarks:
* Previously it is necessary to define a base port CD by call
subfunction 3 functions 21.
* In one second 75 frames, in one minute 60 seconds.
* Function is asynchronous (returns handle, when the playing) began.
* Previously CD base must be defined by the call to
subfunction 3 of function 21.
* One second includes 75 frames, one minute includes 60 seconds.
* The function is asynchronous (returns control, when play begins).
 
======================================================================
====== Function 24, subfunction 2 - get information on tracks. =======
======= Function 24, subfunction 2 - get information on tracks. ======
======================================================================
Parameters:
* eax = 24 - number of the function
* ebx = 2 - number subfunction
* ecx = pointer on the buffer for the table
(maximal 8*64h+4 byte =100 tracks)
* eax = 24 - function number
* ebx = 2 - subfunction number
* ecx = pointer to the buffer for the table
(maximum 8*64h+4 bytes=100 tracks)
Returned value:
* eax = 0 - successfully
* eax = 1 - base CD is not defined
* eax = 0 - success
* eax = 1 - CD base is not defined
Remarks:
* The format of the table with the information on tracks same, as well
as for a ATAPI-CD of the command 43h (READ TOC), usual table
(subcommand 00h). The addresses come back in the format MSF.
* Previously it is necessary to define a base port CD by call
subfunction 3 functions 21.
* Function returns the information only about no more than 100 first tracks.
In most cases it is enough of it.
* 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.
* Previously CD base port must be set by call to
subfunction 3 of function 21.
* Function returns information only about no more than 100
first tracks. In most cases it is enough.
 
======================================================================
========= Function 24, subfunction 3 - stop play CD - audio. =========
========== Function 24, subfunction 3 - stop play CD-audio. ==========
======================================================================
Parameters:
* eax = 24 - number of the function
* ebx = 1 - number subfunction
* eax = 24 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = 0 - successfully
* eax = 1 - base CD is not defined
Remarks:
* Previously it is necessary to define a base port CD by call
subfunction 3 functions 21.
* eax = 0 - success
* eax = 1 - CD base is not defined
Çàìå÷àíèÿ:
* Previously CD base port must be defined by call to
subfunction 3 of function 21.
 
======================================================================
================= Function 25 - install volume SBPro. ================
=================== Function 25 - set SBPro volume. ==================
======================================================================
Parameters:
* eax = 25 - number of the function
* ebx = what to install:
* 1 - install common volume
* 2 - install volume of CD - audio
* cl = Level of volume: high 4 bits for the left column, low 4 - for right
* eax = 25 - function number
* ebx = what to set:
* 1 - set common volume
* 2 - set CD-audio volume
* cl = volume level: high 4 bits for the left column,
low 4 bits for the right one
Returned value:
* eax = 0 - successfully
* eax = 1 - base SB is not defined
* eax = 0 - success
* eax = 1 - SB base is not defined
* eax = 2 - incorrect subfunction
Remarks:
* Previously it is necessary to define a base port SB by call
subfunction 4 functions 21.
* See also function 28 installations of a sound for later standard SB16.
* Previously SB base port must be defined by
subfunction 4 of function 21.
* See also function 28 which sets
volume for the later standard SB16.
 
======================================================================
======== Function 26, subfunction 1 - get base port MPU MIDI. ========
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 1 - number subfunction
* eax = 26 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = number of a port
Remarks:
* Install a base port it is possible by call subfunction of 1 function 21.
* eax = port number
Parameters:
* To set base port use subfunction 1 of function 21.
 
======================================================================
========== Function 26, subfunction 2 - get keyboard layout. =========
======================================================================
The keyboard layout is used for conversion scancodes, acting from the keyboard,
in ASCII-codes which were read - out by the function 2.
The keyboard layout is used to convert keyboard scancodes to
ASCII-codes for function 2.
Parameters:
* eax = 26 - number of the function
* ebx = 2 - number subfunction
* eax = 26 - function number
* ebx = 2 - subfunction number
* ecx = what layout to get:
* 1 = normal layout
* 2 = layout at pressed Shift
* 3 = layout at pressed Alt
* edx = pointer on the buffer of length 128 bytes, where the layout
will be copied
* 2 = layout with pressed Shift
* 3 = layout with pressed Alt
* edx = pointer to the 128-bytes buffer, where the layout will be
copied
Returned value:
* function does not return value
Èëè:
* eax = 26 - number of the function
* ebx = 2 - number subfunction
Or:
* eax = 26 - function number
* ebx = 2 - subfunction number
* ecx = 9
Returned value:
* eax = identifier of the country (1=eng, 2=fi, 3=ger, 4=rus)
* eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
Remarks:
* If is pressed Alt, the layout with Alt is used; if not is pressed Alt,
but is pressed Shift, the layout with Shift is used; if not are
pressed Alt and Shift, but is pressed Ctrl, the normal layout is used,
then from the code is subtracted 0x60; if not any of direction keys
is pressed, the normal layout is used.
* Install layouts and identifier of the country it is possible with the help
subfunction 2 functions 21.
* The identifier of the country - global environment variable, which by
kernel is not used; however application @panel displays an icon,
appropriate to the current country (using the described function).
* Application @panel switches layouts on search of the user.
* 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.
* To set layout and country identifier use
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.
 
======================================================================
============= Function 26, subfunction 3 - get base CD. ==============
============== Function 26, subfunction 3 - get CD base. =============
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 3 - number subfunction
* eax = 26 - function number
* ebx = 3 - subfunction number
Returned value:
* eax = base CD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
* eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
Remarks:
* Base CD is used by the function 24.
* Install base CD it is possible by call subfunction 3 functions 21.
* CD base is used by function 24.
* To set CD base use subfunction 3 of function 21.
 
======================================================================
====== Function 26, subfunction 4 - get base port Sound Blaster. =====
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 4 - number subfunction
* eax = 26 - function number
* ebx = 4 - subfunction number
Returned value:
* eax = number of a base port
* eax = base port number
Remarks:
* Installation of base is necessary for operation of functions 25, 55.
* Install a base port it is possible by call subfunction 4 functions 21.
* Bae port is used by functions 25, 55.
* To set base port use subfunction 4 of function 21.
 
======================================================================
======== Function 26, subfunction 5 - get language of system. ========
========== Function 26, subfunction 5 - get system language. =========
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 5 - number subfunction
* eax = 26 - function number
* ebx = 5 - subfunction number
Returned value:
* eax = language of system (1=eng, 2=fi, 3=ger, 4=rus)
* eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
Remarks:
* Language of the system - global environment variable in any way which
is not used by kernel, however application @panel draws
an appropriate icon (using described function).
* Install the language of the system it is possible by call
subfunction 5 functions 21.
* 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.
 
======================================================================
=========== Function 26, subfunction 6 - get base port WSS. ==========
=========== Function 26, subfunction 6 - get WSS base port. ==========
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 6 - number subfunction
* eax = 26 - function number
* ebx = 6 - subfunction number
Returned value:
* eax = base port
Remarks:
* Base WSS is used by the function 27.
* Install a base port WSS it is possible by call subfunction 6 functions 21.
* WSS base is used by function 27.
* To set WSS base port use subfunction 6 of function 21.
 
======================================================================
============== Function 26, subfunction 7 - get base HD. =============
============== Function 26, subfunction 7 - get HD base. =============
======================================================================
The base HD is necessary for definition, on what hard disk to write, at usage
of out-of-date functions of operation with a file system and functions
implicitly using the hard disk (such as subfunction of 6 functions 18);
At usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
these functions install base.
The HD base defines hard disk to write with usage of obsolete
file system functions and functions implicitly using the hard disk
(such as subfunction 6 of function 18);
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
these function set base themselves.
Parameters:
* eax = 26 - number of the function
* ebx = 7 - number subfunction
* eax = 26 - function number
* ebx = 7 - subfunction number
Returned value:
* eax = base HD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
* eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
Remarks:
* Any application at any moment of time can change áàçó.
* Install base it is possible by call subfunction 7 functions 21.
* Get used partition of the hard disk it is possible subfunction 8.
* 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.
 
======================================================================
=========== Function 26, subfunction 8 - get partition HD. ===========
========= Function 26, subfunction 8 - get used HD partition. ========
======================================================================
The partition HD is necessary for definition, on what partition of the hard disk
to write, at usage of out-of-date functions of operation with a file system and
functions implicitly using the hard disk (such as subfunction of 6 functions
18); at usage of functions 58 and 70 and modern syntax /HD0, /HD1, /HD2, /HD3
these functions install base and partition.
The HD partition defines partition of the hard disk to write with
usage of obsolete file system functions and functions implicitly
using the hard disk (such as subfunction 6 of function 18);
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
these functions set base and partition themselves.
Parameters:
* eax = 26 - number of the function
* ebx = 8 - number subfunction
* eax = 26 - function number
* ebx = 8 - subfunction number
Returned value:
* eax = partition HD (beginning from 1)
* eax = HD partition (beginning from 1)
Remarks:
* Any application at any moment of time can change partition.
* Install partition it is possible by call subfunction 8 functions 21.
* Find out number of partitions on the hard disk it is possible by call
subfunction 11 functions 18.
* Get used base of the hard disk it is possible subfunction 7.
* 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.
 
======================================================================
=== Function 26, subfunction 9 - get value of the counter of time. ===
=== Function 26, subfunction 9 - get the value of the time counter. ==
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 9 - number subfunction
* eax = 26 - function number
* ebx = 9 - subfunction number
Returned value:
* eax = number of 1/100 second, past from the moment of start of the system
* eax = number of 1/100s of second, past from the system boot time
Remarks:
* counter takes modulo 2^32, that there corresponds by little more+
than 497 day.
* System time can be get by the function 3.
* Counter takes modulo 2^32, that correspond to a little more
than 497 days.
* To get system time use function 3.
 
======================================================================
====== Function 26, subfunction 10 - get channel DMA for a sound. ====
======== Function 26, subfunction 10 - get sound DMA channel. ========
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 10 - number subfunction
* eax = 26 - function number
* ebx = 10 - subfunction number
Returned value:
* eax = number of the channel (from 0 up to 3 inclusively)
* eax = number of the channel (from 0 to 3 inclusive)
Remarks:
* Number of the channel DMA is used in subfunction 1 function 55.
* Install the channel DMA for a sound it is possible by call
subfunction 10 functions 21.
* Number of the DMA channel is used by subfunction 1 of function 55.
* To set the sound DMA channel use subfunction 10 of function 21.
 
======================================================================
====================== Function 26, subfunction 11 ===================
========= Find out, whether low level access to HD is allowed. =======
===================== Function 26, subfunction 11 ====================
========== Find out whether low-level HD access is enabled. ==========
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 11 - number subfunction
* eax = 26 - function number
* ebx = 11 - subfunction number
Returned value:
* eax = 0/1 - prohibit/permit
* eax = 0/1 - disabled/enabled
Remarks:
* Is used at LBA-reading (subfunction 8 functions 58).
* Install a current status it is possible by call
subfunction 11 functions 21.
* Is used in LBA read (subfunction 8 of function 58).
* To set current state use subfunction 11 of function 21.
 
======================================================================
====================== Function 26, subfunction 12 ===================
======= Find out, whether low level access to PCI is allowed. ========
===================== Function 26, subfunction 12 ====================
========== Find out whether low-level PCI access is enabled. =========
======================================================================
Parameters:
* eax = 26 - number of the function
* ebx = 12 - number subfunction
* eax = 26 - function number
* ebx = 12 - subfunction number
Returned value:
* eax = 0/1 - prohibit/permit
* eax = 0/1 - disabled/enabled
Remarks:
* Is used by operation with the bus PCI (function 62).
* Current realization uses only low bit ecx.
* install a current status it is possible by call
subfunction 12 functions 21.
* 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.
 
======================================================================
==== Function 27 - install volume Windows Sound System (WSS). ===
======== Function 27 - set Windows Sound System (WSS) volume. ========
======================================================================
Parameters:
* eax = 27 - number of the function
* ebx = what to install:
* 1 - install common volume
* 2 - install volume Line In
* cl = Level of volume (0x0 = highest, 0x1F = lowest,
installed bit 0x80 = to disable)
* eax = 27 - function number
* ebx = what to set:
* 1 - set common volume
* 2 - set Line In volume
* cl = volume level (0x0=highest, 0x1F=lowest,
if bit 0x80 is set=disable)
Returned value:
* eax = 0 - successfully
* eax = 1 - the base WSS is not defined
* eax = 0 - success
* eax = 1 - WSS base is not defined
* eax = 2 - incorrect subfunction
Remarks:
* Previously it is necessary to define a base port WSS by call
subfunction 6 functions 21.
* Installation of common volume is actually ignored (comes back eax=0).
* In old documentation and in source code of a kernel subfunction 2
is erraticly called as volume of a CD - audio.
* Previously WSS base port must be defined by call to
subfunction 6 of function 21.
* Set of common volume is ignored (function simply returns eax=0).
* Old documentation and kernel sources erraticly name function 2
as CD-audio volume.
 
======================================================================
================= Function 28 - install volume SB16. =================
=================== Function 28 - set SB16 volume. ===================
======================================================================
Parameters:
* eax = 28 - number of the function
* eax = 28 - function number
* ebx = what to install:
* 1 - install common volume
* 2 - install volume of a CD - audio
* cl = level of volume (0=off, 0xFF=max)
* 2 - install CD-audio volume
* cl = volume level (0=off, 0xFF=max)
Returned value:
* eax = 0 - successfully
* eax = 1 - the base SB is not defined
* eax = 0 - success
* eax = 1 - SB base is not defined
* eax = 2 - incorrect subfunction
Remarks:
* Previously it is necessary to define a base port SB by call
subfunction 4 functions 21.
* This function gives more variants for volume, than function 25.
* Previously SB base port must be defined by
subfunction 4 of function 21.
* This function gives more variants for volume, that function 25.
 
======================================================================
==================== Function 29 - get system date. ==================
=================== Function 29 - get system date. ===================
======================================================================
Parameters:
* eax = 29 - number of the function
* eax = 29 - function number
Returned value:
* eax = 0x00DDMMYY, where
(binary-decimal coding is used, BCD)
* YY = two low digits of year (00.. 99)
* MM = month (01.. 12)
* DD = day (01.. 31)
(binary-decimal coding, BCD, is used)
* YY = two low digits of year (00..99)
* MM = month (01..12)
* DD = day (01..31)
Remarks:
* The system date can be installed by the function 22.
* To set system date use function 22.
 
======================================================================
=============== Function 32 - delete file with ramdisk. ==============
=============== Function 32 - delete file from ramdisk. ==============
======================================================================
Parameters:
* eax = 32 - number of the function
* ebx = pointer on a filename
* eax = 32 - function number
* ebx = pointer to the filename
Returned value:
* eax = 0 - successfully; differently error code of a file system
* eax = 0 - success; otherwise file system error code
Remarks:
* This function is obsolete; the function 58 allows to fulfil the same
operations with the extended possibilities.
* Current realization returns only values 0 (successes)
and 5 (the file is not retrieved).
* The filename should be or in the format 8+3 characters (first 8 characters
- purely name, last 3 - extension, the short names and extensions are
supplemented by blanks), or in the format 8.3 characters
"FILE.EXT" / "FILE.EX" (name no more than 8 characters, point,
extension 3 characters supplemented if necessary by blanks).
Filename should be written by capital letters. The completing character
with the code 0 is not necessary (ASCIIZ-string).
* This function is obsolete; function 58 allows to fulfill
the same operations with the extended possibilities.
* The current implementation returns only values 0(success) and
5(file not found).
* 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.
 
======================================================================
=============== Function 33 - save file on ramdisk. ==================
================ Function 33 - write file to ramdisk. ================
======================================================================
Parameters:
* eax = 33 - number of the function
* ebx = pointer on a filename
* ecx = pointer on data for save
* edx = number byte for save
* it is necessary to install esi=0
* eax = 33 - function number
* ebx = pointer to the filename
* ecx = pointer to data for writing
* edx = number of bytes for writing
* should be set esi=0
Returned value:
* eax = 0 - successfully, differently error code of a file system
* eax = 0 - success, otherwise file system error code
Remarks:
* This function is obsolete; the function 58 allows to fulfil the same
operations with the extended possibilities.
* If to specify non-zero value in esi and on ramdisk already there is an
indicated file, one more file with the same name will be created.
* Otherwise file is resave.
* The filename should be or in the format 8+3 characters (first 8 characters
- purely name, last 3 - extension, the short names and extensions are
supplemented by blanks), or in the format 8.3 characters
"FILE.EXT" / "FILE.EX" (name no more than 8 characters, point,
extension 3 characters supplemented if necessary by blanks).
Filename should be written by capital letters. The completing character
with the code 0 is not necessary (ASCIIZ-string).
* This function is obsolete; function 70 allows to fulfil
the same operations with extended possibilities.
* If esi contains non-zero value and selected file already exists,
one more file with the same name will be created.
* Otherwise file will be overwritten.
* 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.
 
======================================================================
======== Function 35 - read colour of a point on the screen. =========
======= Function 35 - read the color of a pixel on the screen. =======
======================================================================
Parameters:
* eax = 35
* ebx = y*xsize+x, where
* (x,y) = coordinates of a point (considering from 0)
* xsize = size of the screen on a horizontal
* (x,y) = coordinates of a pixel (beginning from 0)
* xsize = horizontal screen size
Returned value:
* eax = colour 0x00RRGGBB
* eax = color 0x00RRGGBB
Remarks:
* Find out sizes of the screen it is possible by function call 14.
Pay attention, that it subtracts 1 of both sizes.
* To a video memory there is also direct access (without calls of system
functions) through the selector gs. Parameters of current videomode
it is possible to receive by the function 61.
* 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.
 
======================================================================
=========== Function 37 - get coordinate/status of mouse. ============
========= Function 37 - get coordinates/status of the mouse. =========
======================================================================
 
------------ Subfunction 0 - screen coordinates of mouse -------------
---------- Subfunction 0 - screen coordinates of the mouse -----------
Parameters:
* eax = 37 - number of the function
* ebx = 0 - number subfunction
* eax = 37 - function number
* ebx = 0 - subfunction number
Returned value:
* eax = x*65536 + y, (x,y)=coordinates of mouse pointer (considering from 0)
* eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
(beginning from 0)
 
------ Subfunction 1 - coordinates of mouse concerning window -------
-- Subfunction 1 - coordinates of the mouse relative to the window ---
Parameters:
* eax = 37 - number of the function
* ebx = 1 - number subfunction
* eax = 37 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = x*65536 + y, (x,y)=coordinates of mouse pointer concerning
an application window (considering from 0)
* eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
relative to the application window (beginning from 0)
Remarks:
* Value is calculated under the formula (x-xwnd) *65536 + (y-ywnd).
If y > =ywnd, the low word nonnegatively also contains relative
y-coordinate, and high - relative x-coordinate (correct sign).
Otherwise low word negatively and all the same contains relative
y-coordinate, and to a high word it is necessary to add 1.
* 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.
 
---------------- Subfunction 2 - pressed mouse buttons ----------------
------------ Subfunction 2 - pressed buttons of the mouse ------------
Parameters:
* eax = 37 - number of the function
* ebx = 2 - number subfunction
* eax = 37 - function number
* ebx = 2 - subfunction number
Returned value:
* eax contains information on the pressed mouse buttons:
* Bit 0 installed = left button pressed
* Bit 1 installed = right button pressed
* Other bits are reset
* eax contains information on the pressed mouse buttons:
* bit 0 is set = left button is pressed
* bit 1 is set = right button is pressed
* other bits are cleared
 
======================================================================
====================== Function 38 - draw line. ======================
======================================================================
Parameters:
* eax = 38 - number of the function
* ebx = [coordinate began on axis x] *65536 +
[coordinate of the end on axis x]
* ecx = [coordinate began on axis y]*65536 +
[coordinate of the end on axis y]
* edx = 0x00RRGGBB - colour
* 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
Returned value:
* function does not return value
Remarks:
* Coordinates take concerning window.
* Finite point also is drawn.
* Coordinates are relative to the window.
* End point is also drawn.
 
======================================================================
===== Function 39, subfunction 1 - get size of background image. =====
== Function 39, subfunction 1 - get a size of the background image. ==
======================================================================
Parameters:
* eax = 39 - number of the function
* ebx = 1 - number subfunction
* eax = 39 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = [width]*65536 + [height]
Remarks:
* There is a pair command of installation of sizes of background image -
subfunction of 1 function 15. After which, certainly, it is necessary
anew to define image.
* 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.
 
======================================================================
== Function 39, subfunction 2 - read a point from background image. ==
== Function 39, subfunction 2 - get pixel from the background image. =
======================================================================
Parameters:
* eax = 39 - number of the function
* ebx = 2 - number subfunction
* eax = 39 - function number
* ebx = 2 - subfunction number
* ecx = offset
Returned value:
* eax = 0x00RRGGBB - colour of a point, if offset is valid (less 0x160000-16)
* eax = 2 - differently
* eax = 0x00RRGGBB - pixel color, if offset is valid
(less than 0x160000-16)
* eax = 2 otherwise
Remarks:
* It is not necessary to rely on returned value in case of incorrect offset,
it can vary in the following versions of a kernel.
* Offset of a point with coordinates (x, y) is calculated as (x+y*xsize) *3.
* There is a pair function of installation of a point on background image -
subfunction 2 functions 15.
* 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.
* There is a pair function to set pixel on the background image -
subfunction 2 of function 15.
 
======================================================================
==== Function 39, subfunction 4 - get mode redraw of background. =====
== Function 39, subfunction 4 - get drawing mode for the background. =
======================================================================
Parameters:
* eax = 39 - number of the function
* ebx = 4 - number subfunction
* eax = 39 - function number
* ebx = 4 - subfunction number
Returned value:
* eax = 1 - tiled
* eax = 2 - stretched
* eax = 1 - tile
* eax = 2 - stretch
Remarks:
* There is a pair function of installation of mode redraw of a background -
subfunction 4 functions 15.
* There is a pair function to set drawing mode -
subfunction 4 of function 15.
 
======================================================================
========== Function 40 - install a mask for expected events. =========
=========== Function 40 - set the mask for expected events. ==========
======================================================================
Mask for expected events influences function of operation with events 10,
11, 23 - they inform only events allowed by this mask.
The mask for expected events affects function working with events
10, 11, 23 - they notify only about events allowed by this mask.
Parameters:
* eax = 40 - number of the function
* eax = 40 - function number
* ebx = mask: bit i corresponds to event i+1 (see list of events)
(installed bit permits notice on event)
(set bit permits notice on event)
Returned value:
* function does not return value
Remarks:
* Mask by default (7=111b) permits notices about redraw,
pressings keys and buttons.
It is enough of it for the majority of the applications.
* The events prohibited in a mask, are all same saved, if come;
with events simply do not inform on them functions of operation.
* Functions of operation with events take into account a mask on moment
of function call, instead of on moment of arrival of message.
* 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.
 
======================================================================
=============== Function 41 - find out the owner IRQ. ================
==================== Function 41 - get IRQ owner. ====================
======================================================================
Parameters:
* eax = 41 - number of the function
* ebx = number IRQ, 0..15
* eax = 41 - function number
* ebx = IRQ number, 0..15
Returned value:
* eax = PID of owner
* eax = 0, if owner is not present
* eax = owner PID
* eax = 0, if there is no owner
* eax = -1 for incorrect ebx
 
======================================================================
=============== Function 42 - read data obtained on IRQ. =============
==================== Function 42 - read IRQ data. ====================
======================================================================
At occurrence IRQ system can read out data from indicated earlier by
function 44 ports and to write these data in buffer.
Described function reads out on byte the data from this buffer.
When an IRQ occurs, the system reads data from ports indicated
earlier by function 44 and writes this data to
internal buffer. This function reads out data from that buffer
bytewise.
Parameters:
* eax = 42 - number of the function
* ebx = number IRQ, 0..15
Returned value: (situation can be distinguished on value ecx)
* if thread is not owner IRQ
(or number IRQ is given incorrectly):
* eax = 42 - function number
* ebx = IRQ number, 0..15
Returned value: (use value of ecx to distinguish)
* if the thread is not IRQ owner (or IRQ number is incorrect):
* ecx = 2
* if data is not present:
* if there is no data:
* eax = 0
* ecx = 1
* ebx fail
* if all in the order and data were:
* eax = size given, yet not read from the buffer (in bytes)
* ebx destroyed
* if all is ok:
* eax = byte size of data, not yet read from buffer
* ecx = 0
* ebx = current byte
Remarks:
* Previously thread should reserve for itself indicated IRQ
by the function 45.
* Size of the buffer for the data - 4000 bytes, at overflow
the "fresh" data cease to be written in the buffer.
* Previously the thread must reserve indicated IRQ for itself
by function 45.
* The size of data buffer is 4000 bytes, on overflow
"fresh" data cease to be written in the buffer.
 
======================================================================
================ Function 43 - input/output in port. =================
================ Function 43 - input/output to a port. ===============
======================================================================
 
------------------------ Data output in port -------------------------
------------------------ Output data to port -------------------------
Parameters:
* eax = 43 - number of the function
* eax = 43 - function number
* bl = byte for output
* ecx = number of port 0xnnnn (from 0 up to 0xFFFF)
* ecx = port number 0xnnnn (from 0 to 0xFFFF)
Returned value:
* eax = 0 - successfully
* eax = 1 - thread the indicated port has not reserved
* eax = 0 - success
* eax = 1 - the thread has not reserved the selected port
 
------------------------ Data input from a port ------------------------
------------------------ Input data from port ------------------------
Parameters:
* eax = 43 - number of the function
* ebx ignored
* ecx = 0x8000nnnn, where nnnn = number of port (from 0 up to 0xFFFF)
* eax = 43 - function number
* ebx is ignored
* ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
Returned value:
* eax = 0 - successfully, thus ebx = entered byte
* eax = 1 - thread the given port has not reserved
* eax = 0 - success, thus ebx = entered byte
* eax = 1 - the thread has not reserved the selected port
Remarks:
* Previously thread should reserve behind itself the indicated port
by the function 46.
* For the reserved ports instead of call of these functions it is better
to use commands of the processor in/out is much faster both a little bit
more shortly and easier. From the non-reserved ports to read all the same
it is impossible.
* 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.
 
======================================================================
=========== Function 44 - define operations at arrival IRQ. ==========
=========== Function 44 - define operations at IRQ arrival. ==========
======================================================================
At occurrence IRQ the system can read out the data from the ports, indicated
by this function, and to write these data in the buffer, whence they can be
read by the function 42.
At IRQ arrival the system can read the data from ports defined
by this function and write these data to internal buffer, whence
they can be read by ôóíêöèåé 42.
Parameters:
* eax = 44 - number of the function
* ebx = pointer on the array of structures describing on one port:
* +0: word: 0 means the end of the array, differently number of a port
* eax = 44 - function number
* ebx = pointer to the array of structures each describing one port:
* +0: word: 0 means end of array, otherwise port number
* +2: byte: reserved (ignored)
* +3: byte: 1 = read out byte from this port, 2 = read out a word
* ecx = number IRQ, 0..15
* +3: byte: 1=read byte from this port, 2=read word
* ecx = IRQ number, 0..15
Returned value:
* eax = 0 - successfully
* eax = 1 - thread is not owner indicated IRQ
* eax = 0 - success
* eax = 1 - the thread is not owner of selected IRQ
Remarks:
* Previously thread should reserve behind itself indicated IRQ
by the function 45.
* Previously the thread must reserve for itself selected IRQ
by function 45.
* First 16 ports are considered only.
* Current implementation considers incorrect value of a field +3
as a signal of termination of processing IRQ.
* The current implementation considers incorrect value of field +3
as a signal to terminate IRQ processing.
 
======================================================================
============ Function 45 - reserve/free IRQ. ============
=================== Function 45 - reserve/free IRQ. ==================
======================================================================
Parameters:
* eax = 45 - number of the function
* eax = 45 - function number
* ebx = 0 - reserve, 1 = free
* ecx = number IRQ, 0..15
* ecx = IRQ number, 0..15
Returned value:
* eax = 0 - successfully
* eax = 1 - error (incorrect number IRQ or attempt reserve not free IRQ
or to free IRQ, not reserved by current stream)
* eax = 0 - success
* eax = 1 - error (invalid IRQ number
or attempt to reserve not free IRQ
or to free IRQ, not reserved by this thread)
Remarks:
* Reserved IRQ is necessary for operation of functions 42 and 44.
* Only one thread can reserve selected IRQ.
* IRQ, processed by the system is independent, are reserved by
the system (stream 1) at loading.
* At completion thread are automatically released all reserved by it IRQ.
* IRQ reservation is required for functions 42 and 44.
* Only one thread can reserve the specific IRQ.
* IRQs, handled by the system itself, are reserved by the system
(thread 1) at booting.
* When a thread terminates, all reserved by it IRQs
are freed automatically.
 
======================================================================
==== Function 46 - reserve/free group of ports of input/output. ======
====== Function 46 - reserve/free a group of input/output ports. =====
======================================================================
It is possible to access to the reserved ports directly from the application by
commands in/out (recommended way) and function call 43 (not recommended way).
To work with reserved ports an application can access directly by
commands in/out (recommended way) and can use function 43
(not recommended way).
Parameters:
* eax = 46 - number of the function
* eax = 46 - function number
* ebx = 0 - reserve, 1 - free
* ecx = number of a beginning of a range of ports
* edx = number of the end of a range of ports (inclusively)
* ecx = start port number
* edx = end port number (inclusive)
Returned value:
* eax = 0 - successfully
* eax = 0 - success
* eax = 1 - error
Remarks:
* In case of backup of ports the error considers execution of one
of conditions:
* beginning address more than end address;
* indicated range contains incorrect number of a port
(correct - from 0 up to 0xFFFF);
* limitation on a total number of the reserved areas -
is exceeded the maximal 255 is admitted;
* indicated range is intersected with one of earlier reserved
* In case of release of ports the error considers attempt of release of
a range, which was not wholly reserved by same function (with the same
values ecx, edx) earlier.
* At detection of an error (in both cases) any operations is not does.
* At loading the system reserved behind itself ports 0.. 0xff, and at
detection of COM-mouse - in addition range of COM-ports 0x3f0.. 0x3ff
and/or 0x2f0.. 0x2ff.
* At completion thread all ports, reserved by it are automatically free.
* 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.
* At booting the system reserves for itself ports 0..0xff, and if
COM-mouse is detected - additionally range of COM-ports
0x3f0..0x3ff and/or 0x2f0..0x2ff.
* When a thread terminates, all reserved by it ports
are freed automatically.
 
======================================================================
============== Function 47 - draw number in window. ==================
============= Function 47 - draw a number in the window. =============
======================================================================
Parameters:
* eax = 47 - number of the function
* ebx = parameters of conversion of number in the text:
* eax = 47 - function number
* ebx = parameters of conversion number to text:
* bl = 0 - ecx contains number
* bl = 1 - ecx contains the pointer on dword-number
* bh = 0 - to display in a decimal number system
* bh = 1 - to display in the hexadecimal system
* bh = 2 - to display in the binary system
* Bits 16-21 = how many digits to display
* The bits 22-31 are reserved and should be installed in 0
* ecx = number (at bl=0) or pointer (at bl=1)
* bl = 1 - ecx contains pointer to dword-number
* bh = 0 - display in decimal number system
* bh = 1 - display in hexadecimal system
* bh = 2 - display in binary system
* áèòû 16-21 = how many digits to display
* áèòû 22-31 reserved and must be set to 0
* ecx = number (if bl=0) or pointer (if bl=1)
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
* esi = 0xN0RRGGBB, RRGGBB=colour, N=font (0/1)
* esi = 0xN0RRGGBB, RRGGBB=color, N=font (0/1)
Returned value:
* function does not return value
Remarks:
* Indicated length should not exceed 60.
* The equally indicated amount of digits is output. If the number a little
also can be written by smaller amount of digits, it is supplemented by
leading zeroes; if the number is great and can not be written by such
amount of digits, the "superfluous" carrying on digits are not draw.
* Parameters of fonts are indicated in the description of the function 4
(output of the text).
* 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).
 
======================================================================
===== Function 48, subfunction 0 - apply adjustments of screen. ======
========= Function 48, subfunction 0 - apply screen settings. ========
======================================================================
Parameters:
* eax = 48 - number of the function
* ebx = 0 - number subfunction
* eax = 48 - function number
* ebx = 0 - subfunction number
* ecx = 0 - reserved
Returned value:
* function does not return value
Remarks:
* Function redraw the screen after change of parameters
* Function redraws the screen after parameters change by
subfunctions 1 and 2.
* Function call without prior calls indicated subfunctions is ignored.
* Function call with non-zero ecx is ignored.
* Function call without prior call to one of indicated subfunctions
is ignored.
* Function call with nonzero ecx is ignored.
 
======================================================================
======= Function 48, subfunction 1 - install style of buttons. =======
=========== Function 48, subfunction 1 - set button style. ===========
======================================================================
Parameters:
* eax = 48 - number of the function
* ebx = 1 - number subfunction
* ecx = type of buttons:
* 0 = flat buttons
* 1 = 3d buttons
* eax = 48 - function number
* ebx = 1 - subfunction number
* ecx = button style:
* 0 = flat
* 1 = 3d
Returned value:
* function does not return value
Remarks:
* After call of the described function follows redraw
the screen subfunction 0.
* Type of buttons influences only their plotting by the function 8.
* After call to this function one should redraw the screen by
subfunction 0.
* Button style influences only to their draw of function 8.
 
========================================================================
== Function 48, subfunction 2 - install standard colours of windows. ===
========================================================================
======================================================================
====== Function 48, subfunction 2 - set standard window colors. ======
======================================================================
Parameters:
* eax = 48 - number of the function
* ebx = 2 - number subfunction
* ecx = pointer on the color table
* eax = 48 - function number
* ebx = 2 - subfunction number
* ecx = pointer to the color table
* edx = size of the color table
(should be 40 bytes for the future compatibility)
Format of the color table is indicated in the description subfunction 3.
(must be 40 bytes for future compatibility)
Format of the color table is shown in description of subfunction 3.
Returned value:
* function does not return value
Remarks:
* After call of the described function follows redraw
the screen subfunction 0.
* Table of standard colours influences only the applications, which receive
this table by an obvious way (subfunction 3) and use (specifying colours
from it by calls of functions of drawing).
* Table of standard colours enters in skin and is installed anew
at installation skin (subfunction 8).
* Color table can be viewed/changed online with the help of
the application desktop.
* 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'.
 
======================================================================
=== Function 48, subfunction 3 - get standard colours of windows. ====
====== Function 48, subfunction 3 - get standard window colors. ======
======================================================================
Parameters:
* eax = 48 - number of the function
* ebx = 3 - number subfunction
* ecx = pointer on the buffer the size edx byte, where will write the table
* edx = size of the color table
(should be 40 bytes for the future compatibility)
* 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)
Returned value:
* function does not return value
Format of the color table: each unit -
dword-value of colour 0x00RRGGBB
* +0: dword: frames - colour of frame
* +4: dword: grab - colour of header
* +8: dword: grab_button - colour of the button on a bar of header
* +12 = +0xC: dword: grab_button_text - colour of the text on the button
on a bar of header
* +16 = +0x10: dword: grab_text - colour of the text on header
* +20 = +0x14: dword: work - colour of a working area
* +24 = +0x18: dword: work_button - colour of the button in a working area
* +28 = +0x1C: dword: work_button_text - colour of the text on the button
in a working area
* +32 = +0x20: dword: work_text - colour of the text in a working area
* +36 = +0x24: dword: work_graph - colour of a graphics in a working area
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 included file
macros.inc under the name system_colors; for example, it is possible
to write:
sc system_colors ; declaration of a variable
... ; where it is necessary to call
; described function with ecx=sc
mov ecx, [sc.work_button_text] ; read colour of the text
; on the button in a working area
* Usage/non-use of these colours - business is exclusively of the program.
For usage it is necessary simply at call of functions of drawing to
specify colour, taken from this table.
* At change of the table of standard colours (subfunction 2 with the
subsequent application of changes subfunction 0 or at installation skin
subfunction 8) all windows the message on necessity redraw (event with
the code 1) is dispatched.
* Color table can be viewed/changed online with the help of
the application desktop.
* Structure of the color table is described in the standard
include file 'macros.inc' as 'system_colors'; for example,
it is possible to write:
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
* 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 height of skin. ==========
============ Function 48, subfunction 4 - get skin height. ===========
======================================================================
Parameters:
* eax = 48 - number of the function
* ebx = 4 - number subfunction
* eax = 48 - function number
* ebx = 4 - subfunction number
Returned value:
* eax = height of skin
* eax = skin height
Remarks:
* Height skin on definition considers height of header
of windows using skin.
* See also common structure of the window in the description
of the function 0.
* 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 working area of the screen. ====
======== Function 48, subfunction 5 - get screen working area. =======
======================================================================
Parameters:
* eax = 48 - number of the function
* ebx = 5 - number subfunction
* eax = 48 - function number
* ebx = 5 - subfunction number
Returned value:
* eax = [left]*65536 + [right]
* ebx = [top]*65536 + [bottom]
Remarks:
* Working area of the screen defines a location and coordinates
of the maximized window.
* Working area of the screen by normal operation is all screen
minus the panel (@panel).
* (left,top) - coordinates of the left upper corner,
(right,bottom) - coordinates of the right lower corner.
Thus, the size of a working area on an axis x is defined by
the formula right-left+1, on an axis y - formula bottom-right+1.
* See also function 14, permitting to define sizes of all screen.
* There is a pair function of installation of a working area -
subfunction 6.
* 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.
 
======================================================================
=== Function 48, subfunction 6 - install a working area of screen. ===
======== Function 48, subfunction 6 - set screen working area. =======
======================================================================
Parameters:
* eax = 48 - number of the function
* ebx = 6 - number subfunction
* eax = 48 - function number
* ebx = 6 - subfunction number
* ecx = [left]*65536 + [right]
* edx = [top]*65536 + [bottom]
Returned value:
* function does not return value
Remarks:
* Working area of the screen defines a location and coordinates
of the maximized window.
* This function is used only by application @panel, installing by
a working area all screen minus the panel.
* (left,top) - coordinates of the left upper corner,
(right,bottom) - coordinates of the right lower corner.
Thus, the size of a working area on an axis x is defined by
the formula right-left+1, on an axis y - formula bottom-right+1.
* If left > =right, the x-coordinates of a working area do not vary.
If left < 0, left is not installed. If right it is more or equally
width of the screen, right is not installed. Similarly on an axis y.
* See also function 14, permitting to define sizes of all screen.
* There is a pair function of get of a working area - subfunction 5.
* This function automatically redraw the screen, on a course of business
updates coordinates and rule(situation) of the maximized windows.
All windows are informed on necessity redraw (event 1).
* 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 area for the text of header. ==============
=========== Function 48, subfunction 7 - get skin margins. ===========
======================================================================
Returns title bar of the window with skin, intended for output of the
text of header.
Returns the area of a header of a skinned window, intended for
a text of a header.
Parameters:
* eax = 48 - number of the function
* ebx = 7 - number subfunction
* eax = 48 - function number
* ebx = 7 - subfunction number
Returned value:
* eax = [left]*65536 + [right]
* ebx = [top]*65536 + [bottom]
Remarks:
* Usage/non-use of this function - personal business of the application.
* It is recommended to take into account values returned by this function,
at choice of a place for drawing the text of header (function 4) or any
of a substitute of the text of header (at the discretion of the
application).
* 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).
 
======================================================================
===== Function 48, subfunction 8 - install used skin of windows. =====
============= Function 48, subfunction 8 - set used skin. ============
======================================================================
Parameters:
* eax = 48 - number of the function
* ebx = 8 - number subfunction
* ecx = pointer on the block for the function 58, in which the field of
the intermediate buffer is placed(installed) and the filename is indicated
* 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
Returned value:
* eax = 0 - successfully
* differently eax = an error code of a file system; if the file does
not set skin, comes back error 3 (unknown file system).
* eax = 0 - success
* otherwise eax = file system error code; if file does not
contain valid skin, function returns error 3
(unknown file system).
Remarks:
* At successful loading skin all windows are informed on necessity
redraw (event 1).
* At loading the system reads out skin from the file default.skn on ramdisk.
* User can change skin statically, having created default.skn,
or dynamically with the help of the application desktop.
* 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'.
 
======================================================================
============ Function 49 - Advanced Power Management (APM). ===========
=========== Function 49 - Advanced Power Management (APM). ===========
======================================================================
Parameters:
* eax = 49 - number of the function
* dx = number of the function APM (clone ax in the specification)
* bx, cx = parameters of the function APM
* eax = 49 - function number
* dx = number of the APM function
(analogue of ax in APM specification)
* bx, cx = parameters of the APM function
Returned value:
* 16-bit registers ax, bx, cx, dx, si, di and flag CF are installed
according to the specification APM
* high halves of 32-bit registers eax, ebx, ecx, edx, esi, edi fail
* 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
Remarks:
* Specification APM 1.2 is described in document
"Advanced Power Management (APM) BIOS Specification "
(Revision 1.2), accessible on
* APM 1.2 specification is described in the document
"Advanced Power Management (APM) BIOS Specification"
(Revision 1.2), available at
http://www.microsoft.com/whdc/archive/amp_12.mspx;
besides it is included in known Interrupt List by Ralf Brown
besides it is included in famous Interrupt List by Ralf Brown
(http://www.pobox.com/~ralf/files.html,
ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
 
======================================================================
=========== Function 50 - installation of form of window. ============
=================== Function 50 - set window shape. ==================
======================================================================
The usual windows represent rectangles. With the help of this function the
window can add the arbitrary form. The form sets by a set of points inside
a framing rectangle concerning to the window. Location and the sizes of
a framing rectangle are set by the function 0 and vary with the function 67.
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.
 
----------- Installation of data with information on form ------------
--------------------------- Set shape data ---------------------------
Parameters:
* eax = 50 - number of the function
* ebx = 0 - number subfunction
* ecx = pointer on the given forms (array byte 0/1)
* eax = 50 - function number
* ebx = 0 - subfunction number
* ecx = pointer to shape data (array of bytes 0/1)
Returned value:
* function does not return value
 
---------------- Installation of a scale of given form ---------------
-------------------------- Set shape scale ---------------------------
Parameters:
* eax = 50 - number of the function
* ebx = 1 - number subfunction
* ecx sets a scale: each byte of the data defines
(2^scale) * (2^scale) of pixels
* eax = 50 - function number
* ebx = 1 - subfunction number
* ecx sets a scale: each byte of data defines
(2^scale)*(2^scale) pixels
Returned value:
* function does not return value
Remarks:
* Scale is by default equal 0 (scaling factor 1). If in the given form
of one byte corresponds to one pixel, the scale is possible to not install.
* Let's designate xsize = width of the window (in pixels), ysize = height;
pay attention, that they on unit are more, than installed by
* 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
functions 0, 67.
* On definition of a scale xsize and ysize should be divided on 2^scale.
* Byte of the data on offset a should be 0/1 and defines an accessory to
the window of a square with the side 2^scale (at scale=0 we receive
a pixel) and coordinates of the left upper corner
* 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
(a mod (xsize shr scale), a div (xsize shr scale))
* Size of the data: (xsize shr scale)*(ysize shr scale).
* Data should be present at memory and not vary after installation
of the form.
* System views the data on the form at everyone redraw of the window
by the function 0.
* Call subfunction 0 with the zero pointer results in return to the
rectangular form.
* 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.
 
======================================================================
==================== Function 51 - create thread. ====================
======================================================================
Parameters:
* eax = 51 - number of the function
* ebx = 1 - sole subfunction
* ecx = address of an entry point thread (begin eip)
* edx = pointer of the stack thread (begin esp)
* eax = 51 - function number
* ebx = 1 - unique subfunction
* ecx = address of thread entry point (starting eip)
* edx = pointer to thread stack (starting esp)
Returned value:
* eax = -1 - error (In the system it is too much threads)
* differently eax = TID - identifier thread
* eax = -1 - error (there is too many threads)
* otherwise eax = TID - thread identifier
</UL>
 
======================================================================
== Function 52, subfunction 0 - get configuration of network driver. =
=== Function 52, subfunction 0 - get network driver configuration. ===
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 0 - number subfunction
* eax = 52 - function number
* ebx = 0 - subfunction number
Returned value:
* eax = double word of the configuration
* eax = configuration dword
Remarks:
* Word of the configuration can be installed subfunction 2.
* Kernel does not use an appropriate variable. The value of this variable
and working with it(her) subfunctions 0 and 2 is represented doubtful.
* 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.
 
======================================================================
========= Function 52, subfunction 1 - get local IP address. =========
========= Function 52, subfunction 1 - get local IP-address. =========
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 1 - number subfunction
* eax = 52 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = IP-address (4 bytes)
Remarks:
* Local IP-address is installed subfunction 3.
* Local IP-address is set by subfunction 3.
 
======================================================================
Function 52, subfunction 2 - install configuration of network driver.
=== Function 52, subfunction 2 - set network driver configuration. ===
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 2 - number subfunction
* ecx = Double word of the configuration; if the low 7 bits will derivate
number 3, it is perceived as call about reinitialization
of a Ethernet-map, otherwise Ethernet is switched off
* 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
Returned value:
* if not the Ethernet-interface is requested, comes back eax=2,
but it can vary in the future versions of a kernel
* if the Ethernet-interface is requested, eax=0 means an error
(absence of a Ethernet-map), and non-zero value - success
* 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
Remarks:
* Word of the configuration can be read subfunction 0.
* Kernel does not use an appropriate variable. The value of this variable,
subfunction 0 and part subfunction 2, installing this variable,
* 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,
is represented doubtful.
 
======================================================================
2279,211 → 2336,215
========= Function 52, subfunction 3 - set local IP-address. =========
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 3 - number subfunction
* eax = 52 - function number
* ebx = 3 - subfunction number
* ecx = IP-address (4 bytes)
Returned value:
* Current realization returns eax=3, but it can be changed
in the future versions
* the current implementation returns eax=3, but this can be changed
in future versions
Remarks:
* Local IP-address can be received subfunction 1.
* Local IP-address can be get by subfunction 1.
 
======================================================================
= Function 52, subfunction 6 - add data in stack of an input queue. ==
= Function 52, subfunction 6 - add data to the stack of input queue. =
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 6 - number subfunction
* edx = size of the data
* esi = pointer on the data
* eax = 52 - function number
* ebx = 6 - subfunction number
* edx = data size
* esi = data pointer
Returned value:
* eax = -1 - error
* eax = 0 - successfully
* eax = 0 - success
Remarks:
* This function is intended only for slow network drivers (PPP, SLIP).
* Size of the data should not exceed 1500 bytes, though checks
of a correctness is not done(made).
* 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.
 
======================================================================
====================== Function 52, subfunction 8 ====================
============== Read given from a network output queue. ===============
Function 52, subfunction 8 - read data from the network output queue.
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 8 - number subfunction
* esi = pointer on the buffer by a size of 1500 bytes
* eax = 52 - function number
* ebx = 8 - subfunction number
* esi = pointer to 1500-byte buffer
Returned value:
* eax = Number read byte (in current implementation or
0 = there are no data, or 1500)
* data are copied in the buffer
* eax = number of read bytes (in the current implementation
either 0 = no data or 1500)
* data was copied in buffer
Remarks:
* This function is intended only for slow network drivers (PPP, SLIP).
* This function is intended only for slow network drivers
(PPP, SLIP).
 
======================================================================
=========== Function 52, subfunction 9 - get gateway IP. ==========
============ Function 52, subfunction 9 - get gateway IP. ============
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 9 - number subfunction
* eax = 52 - function number
* ebx = 9 - subfunction number
Returned value:
* eax = gateway IP (4 bytes)
 
======================================================================
========= Function 52, subfunction 10 - get mask of a subnet. ========
=========== Function 52, subfunction 10 - get subnet mask. ===========
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 10 - number subfunction
* eax = 52 - function number
* ebx = 10 - subfunction number
Returned value:
* eax = mask of a subnet
* eax = subnet mask
 
======================================================================
========= Function 52, subfunction 11 - install gateway IP. =========
============ Function 52, subfunction 11 - set gateway IP. ===========
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 11 - number subfunction
* eax = 52 - function number
* ebx = 11 - subfunction number
* ecx = gateway IP (4 bytes)
Returned value:
* current realization returns eax=11, but it can be changed in the
future realizations
* the current implementation returns eax=11, but this can be changed
in future versions
 
======================================================================
====== Function 52, subfunction 12 - install mask of a subnet. =======
=========== Function 52, subfunction 12 - set subnet mask. ===========
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 12 - number subfunction
* ecx = mask of a subnet
* eax = 52 - function number
* ebx = 12 - subfunction number
* ecx = subnet mask
Returned value:
* Current realization returns eax=12, but it can be changed
in the future versions
* the current implementation returns eax=12, but this can be changed
in future versions
 
======================================================================
============ Function 52, subfunction 13 - get DNS IP. ============
============== Function 52, subfunction 13 - get DNS IP. =============
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 13 - number subfunction
* eax = 52 - function number
* ebx = 13 - subfunction number
Returned value:
* eax = DNS IP (4 bytes)
 
======================================================================
=========== Function 52, subfunction 14 - install DNS IP. ============
============== Function 52, subfunction 14 - set DNS IP. =============
======================================================================
Parameters:
* eax = 52 - number of the function
* ebx = 14 - number subfunction
* eax = 52 - function number
* ebx = 14 - subfunction number
* ecx = DNS IP (4 bytes)
Returned value:
* Current realization returns eax=14, but it can be changed
in the future versions
* the current implementation returns eax=14, but this can be changed
in future versions
 
======================================================================
============ Function 53, subfunction 0 - open UDP-socket. ============
============ Function 53, subfunction 0 - open UDP-socket. ===========
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 0 - number subfunction
* ecx = local port (is taken into account only low word)
* edx = remote port (is taken into account only low word)
* eax = 53 - function number
* ebx = 0 - subfunction number
* ecx = local port (only low word is taken into account)
* edx = remote port (only low word is taken into account)
* esi = remote IP
Returned value:
* eax = -1 = 0xFFFFFFFF - error; ebx fail
* eax = socket number (some number unambiguously identifying socket and
having sense only for the system) - successfully
ebx fail
* 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
 
======================================================================
============ Function 53, subfunction 1 - close UDP-socket. ===========
=========== Function 53, subfunction 1 - close UDP-socket. ===========
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 1 - number subfunction
* ecx = socket number
* eax = 53 - function number
* ebx = 1 - subfunction number
* ecx = socket handle
Returned value:
* eax = -1 - incorrect number
* eax = 0 - successfully
* ebx fail
* eax = -1 - incorrect handle
* eax = 0 - success
* ebx destroyed
Remarks:
* The current realization does not close automatically all sockets thread
at its completion. In particular, it is not necessary to kill thread
with a heap open sockets - there will be an outflow of resources.
* The current realization does not do checks on a correctness
(sole, to what the attempt comes back error, - to close not open socket
with correct number).
* 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.
* The current implementation does no checks on correctness
(function returns error only if thread tries to close not opened
socket with correct handle).
 
======================================================================
============== Function 53, subfunction 2 - poll socket. =============
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 2 - number subfunction
* ecx = socket number
* eax = 53 - function number
* ebx = 2 - subfunction number
* ecx = socket handle
Returned value:
* eax = number getting bytes
* ebx fail
* eax = number of read bytes
* ebx destroyed
Remarks:
* Checks of a correctness is not done.
* There is no checks for correctness.
 
======================================================================
======== Function 53, subfunction 3 - read byte from socket. =========
========= Function 53, subfunction 3 - read byte from socket. ========
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 3 - number subfunction
* ecx = number socket
* eax = 53 - function number
* ebx = 3 - subfunction number
* ecx = socket handle
Returned value:
* if there are no accepted data: eax=0, bl=0, the other bits ebx fail
* If there were accepted data: eax = number stayed byte (is possible, 0),
bl = read byte, the other bits ebx fail
* if there is no read data: eax=0, bl=0,
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
Remarks:
* Checks of a correctness is not done.
* There is no checks for correctness.
 
======================================================================
======== Function 53, subfunction 4 - write in UDP-socket. ===========
========== Function 53, subfunction 4 - write to UDP-socket. =========
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 4 - number subfunction
* ecx = number socket
* edx = number bytes for writing
* esi = pointer on data for writing
* eax = 53 - function number
* ebx = 4 - subfunction number
* ecx = socket handle
* edx = number of bytes to write
* esi = pointer to data to write
Returned value:
* eax = 0xffffffff - incorrect number
* eax = 0xffff - lack of memory
* eax = 0 - successfully
* ebx fail
* eax = 0xffffffff - invalid handle
* eax = 0xffff - not enough memory
* eax = 0 - success
* ebx destroyed
Remarks:
* Check on valid number is minimum - are eliminated only not so incorrect
not open numbers.
* Number bytes for writing can not exceed 1500-28, though appropriate
check is not done.
* Check on validity of handle is minimal - only not very incorrect
not opened handles are eliminated.
* Number of bytes to write must not exceed 1500-28, though
the appropriate check is not made.
 
======================================================================
============ Function 53, subfunction 5 - open TCP-socket. ===========
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 5 - number subfunction
* ecx = local port (is taken into account only low word)
* edx = remote port (is taken into account only low word)
* eax = 53 - function number
* ebx = 5 - subfunction number
* ecx = local port (only low word is taken into account)
* edx = remote port (only low word is taken into account)
* esi = remote IP
* edi = mode of opening: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
* edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
Returned value:
* eax = -1 = 0xFFFFFFFF - error; ebx fail
* eax = number socket (some number unambiguously identifying socket
and having sense only for the system) - successfully; ebx fails
* 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
 
======================================================================
======== Function 53, subfunction 6 - get status TCP-socket. =========
========= Function 53, subfunction 6 - get TCP-socket status. ========
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 6 - number subfunction
* ecx = number socket
* eax = 53 - function number
* ebx = 6 - subfunction number
* ecx = socket handle
Returned value:
* eax = status socket: one of
* eax = socket status: one of
* TCB_LISTEN = 1
* TCB_SYN_SENT = 2
* TCB_SYN_RECEIVED = 3
2495,526 → 2556,530
* TCB_LAST_ASK = 9
* TCB_TIME_WAIT = 10
* TCB_CLOSED = 11
* ebx fail
* ebx destroys
Remarks:
* Checks of a correctness is not made.
* There is no checks for correctness.
 
======================================================================
========== Function 53, subfunction 7 - write in TCP-socket. =========
========== Function 53, subfunction 7 - write to TCP-socket. =========
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 7 - number subfunction
* ecx = number socket
* edx = number bytes for writing
* esi = pointer on data for writing
* eax = 53 - function number
* ebx = 7 - subfunction number
* ecx = socket handle
* edx = number of bytes to write
* esi = pointer to data to write
Returned value:
* eax = 0xffffffff - error
* eax = 0xffff - lack of memory
* eax = 0 - successfully
* ebx fail
* eax = 0xffff - not enough memory
* eax = 0 - success
* ebx destroyed
Remarks:
* Check on valid number is minimum - are eliminated only not so incorrect
not open numbers.
* Number bytes for writing can not exceed 1500-40, though appropriate
check is not done.
* Check on validity of handle is minimal - only not very incorrect
not opened handles are eliminated.
* Number of bytes to write must not exceed 1500-40, though
the appropriate check is not made.
 
======================================================================
============ Function 53, subfunction 8 - close TCP-socket. ===========
=========== Function 53, subfunction 8 - close TCP-socket. ===========
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 8 - number subfunction
* ecx = number socket
* eax = 53 - function number
* ebx = 8 - subfunction number
* ecx = socket handle
Returned value:
* eax = -1 - incorrect number
* eax = 0xffff - lack of memory for the package of closing socket
* eax = 0 - successfully
* in many cases eax fails (comes back the result of the function queue) -
probably , is an error, which will be corrected
* ebx fail
* eax = -1 - invalid handle
* eax = 0xffff - not enough memory for socket close packet
* eax = 0 - success
* in many cases eax is destroyed (the result of function 'queue'
is returned) - probably this is bug, which will be corrected
* ebx destroyed
Remarks:
* The current realization does not close automatically all sockets thread
at its completion. In particular, it is not necessary to kill thread
with a heap open sockets - there will be an outflow of resources.
* The current realization does not do checks on a correctness
(sole, to what the attempt comes back error, - to close not open socket
with correct number).
* 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.
* The current implementation does no checks on correctness
(function returns error only if thread tries to close not opened
socket with correct handle).
 
======================================================================
======== Function 53, subfunction 9 - check - local port is free =====
=== Function 53, subfunction 9 - check whether local port is free. ===
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 9 - number subfunction
* ecx = number of a local port (the low 16 bits are used only)
* eax = 53 - function number
* ebx = 9 - subfunction number
* ecx = local port number (low 16 bits are used only)
Returned value:
* eax = 0 - port is used
* eax = 1 - port is free
* ebx fail
* ebx destroyed
 
======================================================================
Function 53, subfunction 255 - debug information of network driver. =
= Function 53, subfunction 255 - debug information of network driver.
======================================================================
Parameters:
* eax = 53 - number of the function
* ebx = 255 - number subfunction
* eax = 53 - function number
* ebx = 255 - subfunction number
* ecx = type of requested information (see below)
Returned value:
* eax = requested information
* ebx fail
Possible values ecx:
* ebx destroyed
Possible values for ecx:
* 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)
* 200: number of units in the table ARP
* 201: a size of the table ARP (in units) (20 in the current version)
* 202: read a unit edx of the table ARP in the temporary buffer,
whence take the information 5 subsequent types;
* 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;
in this case eax is not defined
* 203: IP-address saved by the type 202
* 204: high dword of MAC-address saved by the type 202
* 205: low word of MAC-address saved by the type 202
* 206: a word of the status saved by the type 202
* 207: a word ttl, saved by the type 202
* 2: a total number of the obtained IP-packages
* 3: a total number of the transferred(handed) IP-packages
* 4: a total number dumps of the obtained packages
* 5: a total number of the obtained ARP-packages
* 6: the status of the driver of packages, 0 = is inactive,
non-zero value = is active
* 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
 
 
======================================================================
========== Function 55, subfunction 0 - load data for SB16. ==========
======================================================================
Parameters:
* eax = 55 - number of the function
* ebx = 0 - number subfunction
* ecx = pointer on the data (is copied 64 kilobytes, is used so much,
how many is installed subfunction 2)
* eax = 55 - function number
* ebx = 0 - subfunction number
* ecx = pointer to data (is copied 64 kilobytes, is used as much as
set by subfunction 2)
Returned value:
* function does not return value
Remarks:
* Format and size of data are installed subfunction 2.
* Format and size of data are set by subfunction 2.
 
======================================================================
===== Function 55, subfunction 1 - begin to play data on SB16. =======
======== Function 55, subfunction 1 - begin play data on SB16. =======
======================================================================
Parameters:
* eax = 55 - number of the function
* ebx = 1 - number subfunction
* eax = 55 - function number
* ebx = 1 - subfunction number
Returned value:
* function does not return value
Remarks:
* Previously data should be loaded subfunction 0 and their format
subfunction 2 is defined.
* Function returns handle, when playing the data began; after that the
playing goes irrespective of the application (and at all does not
require loading the processor).
* Previously should be defined a base port SB16 (subfunction 4 functions 21)
and channel DMA (subfunction 10 functions 21).
* Previously data must be loaded by subfunction 0 and
their format must be defined by subfunction 2.
* Function returns control, when playing of data began; after that
play goes independently from application (and does not use
processor time at all).
* Previously must be defined SB16 base port
(by subfunction 4 of function 21) and DMA channel
(by subfunction 10 of function 21).
 
======================================================================
====== Function 55, subfunction 2 - install a data format SB16. ======
======== Function 55, subfunction 2 - set format of SB16 data. =======
======================================================================
Parameters:
* eax = 55 - number of the function
* ebx = 2 - number subfunction
* ecx = 0 - install a digit capacity
* edx = 1 - 8 bits mono
* edx = 2 - 8 bits stereo
* ecx = 1 - install a size of data
* eax = 55 - function number
* ebx = 2 - subfunction number
* ecx = 0 - set digit capacity
* edx = 1 - 8bit mono
* edx = 2 - 8bit stereo
* ecx = 1 - set data size
* edx = size in bytes
* ecx = 2 - install frequency of playing
* ecx = 2 - set play frequency
* edx = frequency
Returned value:
* function does not return value
Remarks:
* At loading the system the following default settings are installed:
a digit capacity - 8 bits mono, size - 64 KB, frequency 44100 Hz.
Nevertheless it is recommended obviously to install necessary values,
as they could be reinstalled by any program.
* When the system boots, it sets following default parameters:
digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
Nevertheless it is recommended to set necessary values obviously
as they could be reset by some application.
 
======================================================================
====================== Function 55, subfunction 55 ===================
=============== Begin to play data on built speaker. =================
Function 55, subfunction 55 - begin to play data on built-in speaker.
======================================================================
Parameters:
* eax = 55 - number of the function
* ebx = 55 - number subfunction
* esi = pointer on the data
* eax = 55 - function number
* ebx = 55 - subfunction number
* esi = pointer to data
Returned value:
* eax = 0 - successfully
* eax = 55 - error (speaker is disconnected or occupied)
Data is an array of units of a variable length.
Format of each unit is defined in first byte:
* 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:
* 0 = end of data
* 1..0x80 = sets duration of sounding in 1/100 of second of note
defined by direct value of frequency
* following word (2 bytes) is contained by a divider of frequency;
the frequency is defined as 1193180/divider
* 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
* 0x81 = invalid
* 0x82..0xFF = note defined by octave and number:
* duration in 1/100 of second = (first byte) - 0x81
* 0x82..0xFF = note is defined by octave and number:
* duration in 1/100 of second = (first byte)-0x81
* there is one more byte;
* (second byte) = 0xFF - pause
* differently it looks like a*0x10+b, where b=number of the note
in an octave from 1 up to 12, a=number of an octave (beginning from 0)
* (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)
Remarks:
* Speaker play can be disable /enable subfunction 8 functions 18.
* Function returns handle, having informed where follows the information
on play. Playing goes irrespective of the program.
* Data should be saved in memory at least up to the end of playing.
* 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.
 
======================================================================
================ Function 56 - write file to hard disk. ==============
=============== Function 56 - write file to hard disk. ===============
======================================================================
Parameters:
* eax = 56 - number of the function
* ebx = pointer on a filename
* ecx = size data for writing (in bytes)
* edx = pointer on data for writing
* esi = pointer on path (ASCIIZ-string)
* eax = 56 - function number
* ebx = pointer to the file name
* ecx = size of data to write (in bytes)
* edx = pointer to data to write
* esi = pointer to path (ASCIIZ-string)
Returned value:
* eax = 0 - successfully, differently error code of a file system
* eax = 0 - success, otherwise file system error code
Remarks:
* This function is obsolete; the function 70 allows to fulfil the same
* This function is obsolete; function 70 allows to fulfil the same
operations with the extended possibilities.
* Given function assumes, that during its call one application any other
application does not work with the hard disk.
* Path to the file - ASCIIZ-string, which can be empty (if the file creates
in the root) or to have the format /d1/d2/ .../dn, where all names of
directories should have the format 8+3, i.e. 8 characters of a name
and 3 characters of the extension without a separator if necessary
supplemented by blanks; all characters should be capital.
* Name to the file also should have the format 8+3.
* This function assumes that during its call by one application
no other application works with hard disk.
* The path to file is ASCIIZ-string, which may be empty
(if the file is created in the root folder) or have the format
/d1/d2/.../dn, where all folder names must have the 8+3 format,
i.e. 8 characters of name and 3 characters of the extension
without separator, supplemented by blanks if necessary;
all letters must be capital.
* The file name must also have the format 8+3.
 
======================================================================
============== Function 58 - ðàáîòà ñ ôàéëîâîé ñèñòåìîé. ==============
================ Function 58 - work with file system. ================
======================================================================
Parameters:
* eax = 58
* ebx = pointer on information structure
* ebx = pointer to the information structure
Returned value:
* eax = 0 - successfully; differently error code of a file system
* depending on subfunction the value and in other registers can come back
Common format of information structure:
* +0: dword: number subfunction
* 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: number of block
* +8: dword: size
* +12 = +0xC: dword: pointer on data
* +16 = +0x10: dword: pointer on memory for system operation
* +12 = +0xC: dword: pointer to data
* +16 = +0x10: dword: pointer to a memory for system operations
(4096 bytes)
* +20 = +0x14: n db: ASCIIZ-string with a filename
Specifications - in documentation on appropriate subfunction.
Filename is insensitive to the register of latin characters,
russian characters should be capital.
Format of a filename:
* +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:
/base/number/dir1/dir2/.../dirn/file,
where /base/number identifies the device, on which the file is searched:
where /base/number identifies device, on which file is located:
one of
* /RD/1 = /RAMDISK/1 for access to ramdisk
* /FD/1 = /FLOPPYDISK/1 for access to first floppy - drive,
/FD/2 = /FLOPPYDISK/2 for second floppy - drive
* /HD/x = /HARDDISK/x - out-of-date variant of access to the hard disk
(in this case base is defined subfunction 7 functions 21),
x - number of partition (beginning from 1)
* /HD0/x, /HD1/x, /HD2/x, /HD3/x for access accordingly
to devices IDE0 (Primary Master), IDE1 (Primary Slave),
* /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),
IDE2 (Secondary Master), IDE3 (Secondary Slave);
x - number of partition on selected hard disk, varies from 1 up to 255
(on each of hard disks the indexing starts with 1)
x - partition number on the selected hard drive, varies from 1
to 255 (on each hard drive the indexing starts from 1)
Remarks:
* In first two cases usage FIRST instead of 1, SECOND instead of 2 is
admitted, but to use this possibility it is not recommended for
convenience of transition on the future extensions.
* Imposed limitation n<=39.
* Names of folders and file dir1..., dirn, file should be in the format 8.3:
a name no more than 8 characters, point, extension no more than 3
characters. The tail blanks are ignored. Other blanks be does not owe.
If the name occupies equally 8 characters, the point can be omitted
(though to use it it is not recommended for convenience of transition
on the future extensions).
* 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.
Examples:
* '/RAMDISK/FIRST/KERNEL.ASM',0
'/rd/1/kernel.asm',0
* '/HD0/1/kernel.asm',0
* '/hd0/1/menuet/pics/tanzania.bmp',0
Accessible subfunction:
* subfunction 0 - reading of a file/folder
* subfunction 1 - overwriting of the file
* subfunction 2 - deleting of a file/folder
* subfunction 3 - writing data in the existing file
* subfunction 4 - creation of a folder
* subfunction 5 - renaming/moving of a file/folder
* subfunction 8 - LBA-reading from the device
* subfunction 12 - definition of a file size
* subfunction 13 - definition of attributes of a file/folder
* subfunction 14 - definition of date/time of a file/folder
* subfunction 15 - obtaining of the information about a file system
* subfunction 16 - start of the application
Existing subfunctions:
* subfunction 0 - read file/folder
* subfunction 1 - rewrite file
* subfunction 2 - delete file/folder
* subfunction 3 - write to existing file
* subfunction 4 - make folder
* subfunction 5 - rename/move file/folder
* subfunction 8 - LBA-read from device
* subfunction 15 - get file system information
* subfunction 16 - start application
 
 
======================================================================
======= Function 58, subfunction 0 - reading of a file/folder. =======
=========== Function 58, subfunction 0 - read file/folder. ===========
======================================================================
Parameters:
* eax = 58
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 0 = number subfunction
* +4: dword: number of block for reading (beginning from 0)
* +8: dword: éuantity blocks for reading
* +12 = +0xC: dword: pointer on the buffer, where the data will be written
* +16 = +0x10: dword: pointer on the buffer for system operation
* 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
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
are indicated in the common description
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
given in the general description
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx = file size (in bytes) or
-1=0xffffffff, if the file is not retrieved
* eax = 0 - success, otherwise file system error code
* ebx = file size (in bytes) or -1=0xffffffff, if file was not found
Remarks:
* Size of block - 512 bytes.
* Block size is 512 bytes.
* This function is obsolete, for reading files use subfunction 0
functions 70, for reading folders - subfunction of 1 function 70.
* Function allows to read contents of a folder. From file systems is
supported only FAT. The format of a FAT-folder is described in any
documentation on FAT.
* Size of a folder is defined on a size of a chain of clusters in FAT.
* If the file was terminated earlier, than last requested block was read,
the function will read, how many can, then will return eax=6 (EOF).
* Function allows to read root folders /rd/1, /fd/x, /hd [n] /x, but
in first two cases the current implementation does not follow the
installed rules:
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:
for /rd/1:
* if 0 blocks for reading are indicated, it is considered,
that is requested 1;
* if is requested more than 14 blocks or the initial block is not
less 14, comes back eax=5 (not found) and ebx =-1;
* size of the root ramdisk = 14 blocks, 0x1C00=7168 bytes; but comes
back ebx=0 (except for a case of the previous item);
* strangely enough, it is possible to read 14 block (there, generally
speaking, garbage - I remind, the score carries on with 0);
* if one block with number, not smaller 14 was requested even,
comes back eax=6 (EOF); differently eax=0.
for /fd/x:
* if the initial block is not less 14, comes back eax=5 (not found)
and ebx=0;
* by the way speaking, the format FAT12 admits diskettes with a size
of the root less or more than 14 blocks;
* checks of length is not done;
* if it was possible to read given with a diskette, comes back eax=0,
ebx=0; otherwise eax=10 (access denied), ebx =-1.
* Function handles reading special folders /, /rd, /fd, /hd [n]; but the
result does not correspond expected (on operation with usual
files/folders), does not follow the installed rules, can vary in the
following versions of a kernel and consequently is not described.
For obtaining the information about the equipment use subfunction 11
functions 18 or read appropriate folders subfunction of 1 function 70.
* if one want to read 0 blocks, function considers,
that he requested 1;
* if one requests more than 14 blocks or starting block is
not less than 14, function returns eax=5 (not found) è ebx=-1;
* size of ramdisk root folder is 14 blocks,
0x1C00=7168 áàéò; but function returns ebx=0
(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.
 
======================================================================
======== Function 58, subfunction 1 - overwriting of the file. =======
============= Function 58, subfunction 1 - rewrite file. =============
======================================================================
If the file does not exist, it creates.
If the file does not exist, it is created.
If the file exists, it is rewritten.
Parameters:
* eax = 58 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 1 = number subfunction
* +4: dword: ignored (install in 0)
* +8: dword: number bytes for writing
* +12 = +0xC: dword: pointer on data for çàïèñè
* +16 = +0x10: dword: pointer on buffer for system operation
* eax = 58 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 1 = subfunction number
* +4: dword: ignored (set to 0)
* +8: dword: number of bytes to write
* +12 = +0xC: dword: pointer to data to write
* +16 = +0x10: dword: pointer to buffer for system operations
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
are indicated in the common description
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
given in the general description
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx fail
* eax = 0 - success, otherwise file system error code
* ebx destroyed
Remarks:
* This function is obsolete, use subfunction 2 functions 70.
* This function is obsolete, use subfunction 2 of function 70.
 
======================================================================
====== Function 58, subfunction 2 - deleting of a file/folder. =======
========== Function 58, subfunction 2 - delete file/folder. ==========
======================================================================
Parameters:
* eax = 58 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 2 = number subfunction
* eax = 58 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 2 = subfunction number
* +4: dword: ignored
* +8: dword: ignored
* +12 = +0xC: dword: ignored
* +16 = +0x10: dword: pointer on buffer for system operation
* +16 = +0x10: dword: pointer to buffer for system operations
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
are indicated in the common description
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
given in the general description
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx fail
* eax = 0 - success, otherwise file system error code
* ebx destroyed
Remarks:
* By operation with a diskette it is not necessary to delete a nonblank
folder. The code of operation with the hard disk nonblank folders
deletes correctly (i.e. recursively with all files and nested folders).
Ramdisk of folders does not support.
* By operations with a floppy one should not delete not empty
folder. The code working with hard disk deletes not empty folders
correctly (i.e. recursively with all files and nested folders).
Function 58 does not support folders on ramdisk.
 
======================================================================
=== Function 58, subfunction 3 - writing data in the existing file ===
==== Function 58, subfunction 3 - write data to the existing file. ===
======================================================================
Parameters:
* eax = 58 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 3 = number subfunction
* +4: dword: initial position in the file; -1 = to add in the end
* +8: dword: number bytes for writing
* +12 = +0xC: dword: pointer on data for writing
* +16 = +0x10: dword: pointer on buffer for system operation
* eax = 58 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 3 = subfunction number
* +4: dword: starting position in the file; -1 = append to the end
* +8: dword: number of bytes to write
* +12 = +0xC: dword: pointer to data to write
* +16 = +0x10: dword: pointer to buffer for system operations
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
are indicated in the common description
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
given in the general description
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx fail
* eax = 0 - success, otherwise file system error code
* ebx destroyed
Remarks:
* Ramdisk and the diskettes do not support this function,
it only for hard disks.
* File should already exist (differently comes back 5, not found).
For creation of files use subfunction 1.
* If the initial position is more than a file size, comes back eax=6 (EOF).
If the finite position is more than a file size, the file extends.
* Code of processing of data writing for the hard disk interpretes zero
value of a field +8 as the instruction of a truncation of the file
up to a size indicated in a field +4. However code of processing of
58-th function locks this possibility for the applications, at once
returning handle (with eax=0) in case of a zero size.
* Ramdisk and floppies do not support this function, it is only
for hard disks.
* File must already exist (otherwise function returns 5, not found).
To create files use subfunction 1.
* If the starting position is greater than file size, the function
returns eax=6(EOF). If the end position is greater than file size,
file is extended.
* The code of write processing for hard disk interpretes zero
value of the field +8 as the instruction to truncate the file to
the size, given in the field +4. However the code of processing
58th function blocks this possibility for applications by
immediate return (with eax=0) in the case of zero size.
 
======================================================================
======== Function 58, subfunction 4 - creation of a folder. ==========
============== Function 58, subfunction 4 - make folder. =============
======================================================================
Parameters:
* eax = 58 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 4 = number subfunction
* eax = 58 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 4 = subfunction number
* +4: dword: ignored
* +8: dword: ignored
* +12 = +0xC: dword: ignored
* +16 = +0x10: dword: pointer on buffer for system operation
* +16 = +0x10: dword: pointer to buffer for system operations
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
are indicated in the common description
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
given in the general description
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx fail
* eax = 0 - success, otherwise file system error code
* ebx destroyed
Remarks:
* Ramdisk and the diskettes do not support this function,
it only for hard disks.
* Ramdisk and floppies do not support this function, it is only
for hard disks.
 
======================================================================
=== Function 58, subfunction 5 - renaming/moving of a file/folder. ===
======== Function 58, subfunction 5 - rename/move file/folder. =======
======================================================================
Parameters:
* eax = 58 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 5 = number subfunction
* eax = 58 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 5 = subfunction number
* +4: dword: ignored
* +8: dword: ignored
* +12 = +0xC: dword: ignored
* +16 = +0x10: dword: pointer on buffer for system operation
* +16 = +0x10: dword: pointer to buffer for system operations
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
are indicated in the common description
* +20+n: (at once after a completing null character) new ASCIIZ-name,
should start with /hd/1, that is interpreted as the hard disk
indicated in the first name
(moving from one disk on another is not supported)
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
given in the general description
* +20+n: (at once after terminating null character) new
ASCIIZ-name, must start from /hd/1, that is interpreted as
the hard disk, indicated in the first name
(moving from one disk to another is not supported)
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx fail
* eax = 0 - success, otherwise file system error code
* ebx destroyed
Remarks:
* Ramdisk and the diskettes do not support this function,
it only for hard disks.
* If new ASCIIZ-name strongly incorrect, i.e. does not start with /hd/1,
/hd/first, /harddisk/1, /harddisk/first or after that beginnings there
is a blank or character with the code 0, the function returns, strangely
enough, error code 4. Is the sole function, which in general returns
* Ramdisk and floppies do not support this function, it is only
for hard disks.
* If the new ASCIIZ-name is strongly incorrect, i.e. does not start
from /hd/1, /hd/first, /harddisk/1, /harddisk/first or after this
space or null character follows, function returns, strangely
enough, error code 4. It is the only function which returns
this code.
 
======================================================================
====== Function 58, subfunction 8 - LBA-reading from the device. =====
========= Function 58, subfunction 8 - LBA-read from device. =========
======================================================================
Parameters:
* eax = 58 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 8 = number subfunction
* +4: dword: number of the block for reading (beginning from 0)
* +8: dword: ignored (install in 1)
* +12 = +0xC: dword: pointer on buffer, where data will be written
(512 bytes)
* +16 = +0x10: dword: pointer on buffer for system operation
* 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
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of the device: is not sensitive to the register,
one of /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
* +20 = +0x14: ASCIIZ-name of device: case-insensitive, one of
/rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
1<=n<=4 - number of device: 1=IDE0, ..., 4=IDE3.
Instead of digits is admitted, though usage 'first', 'second', 'third',
'fourth' is not recommended for convenience of transition on the future
extensions.
Instead of digits it is allowed, though not recommended for
convenience of transition to future extensions, to use
'first','second','third','fourth'.
Returned value:
* if device name /hd/xxx is indicated, where xxx is not in list above:
* for device name /hd/xxx, where xxx is not in the list above:
* eax = ebx = 1
* if the incorrect device name is indicated
(except for the previous case):
* for invalid device name (except for the previous case):
* eax = 5
* ebx does not vary
* if the LBA-access is prohibited subfunction 11 functions 21:
* ebx does not change
* if LBA-access is disabled by subfunction 11 of function 21:
* eax = 2
* ebx fail
* for ramdisk attempt of reading of the block outside ramdisk
(18*2*80 blocks) results to
* ebx destroyed
* for ramdisk: attempt to read block outside ramdisk
(18*2*80 blocks) results in
* eax = 3
* ebx = 0
* at successful reading:
* for successful read:
* eax = ebx = 0
Remarks:
* Size of the block - 512 bytes; one block is read.
* It is not necessary to rely on returned value, it can vary in
the following versions.
* It is required, that the LBA-access to devices subfunction 11 functions 21
should be allowed. Find out it it is possible by call
subfunction 11 functions 26.
* LBA-reading of a diskette is not supported.
* Function reads out the data of the physical hard disk; if for any reasons
the data of the concrete unit are necessary, will come to define initial
sector of this unit (or directly through MBR, or from the extended
structure returned same subfunction 11 functions 18).
* Function the error code of the hard disk does not check, so search of
nonexistent sector all the same something will read (more probably
everything, zero, but it is defined by the device) and it will be
considered as success (eax=0).
* Block size is 512 bytes; function reads one block.
* Do not depend on returned value, it can be changed
in future versions.
* Function requires that LBA-access to devices is enabled by
subfunction 11 of function 21. To check this one can use
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
ïîäôóíêöèåé 11 ôóíêöèè 18).
* 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 - obtaining of information about a file system.
=============================================================================
======================================================================
==== Function 58, subfunction 15 - get information on file system. ===
======================================================================
Parameters:
* eax = 58 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 15 = number of the function
* eax = 58 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 15 = subfunction number
* +4: dword: ignored
* +8: dword: ignored
* +12 = +0xC: dword: ignored
* +16 = +0x10: dword: ignored
* +20 = +0x14: (second character is checked only, at once after /)
* +20 = +0x14: (only second character is checked)
/rd=/RAMDISK or /hd=/HARDDISK
Returned value:
* If second character does not belong to set {'r','R','h','H'}:
* if the second character does not belong to set {'r','R','h','H'}:
* eax = 3
* ebx = ecx = dword [fileinfo] = 0
* for ramdisk:
3022,384 → 3087,390
* ebx = total number of clusters = 2847
* ecx = number of free clusters
* dword [fileinfo] = cluster size = 512
* for the hard disk: base and partition are defined
subfunctions 7 and 8 functions 21:
* for hard disk: base and partition are defined by subfunctions
7 and 8 of function 21:
* eax = 0 (success)
* ebx = total number of clusters
* ecx = number of free clusters
* dword [fileinfo] = cluster size (in bytes)
Remarks:
* Be not surprised to strange layout of 4-th returned parameter - when this
code was written, at system calls to the application the registers eax,
ebx, ecx (from pushad-structure transmitted as argument to the system
function) came back only. Now it is corrected, so, probably, it is
meaningful to return a cluster size in edx, while this function have
not begun to use
* Generally still exists subfunction 11 functions 18, returning the
information on a file system. Under the extended table of a disk
subsystem it is possible to define a cluster size (there it is stored
in sectors) and total number of clusters for hard disks.
* 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 58, subfunction 16 - start of application. =========
========== Function 58, subfunction 16 - start application. ==========
======================================================================
Parameters:
* eax = 58 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 16 = number subfunction
* +4: dword: Field of flags:
* bit 0: to start the process as debugged
* other bits are reserved and should be installed in 0
* +8: dword: 0 or pointer on ASCIIZ-string with parameters
* eax = 58 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 16 = subfunction number
* +4: dword: flags:
* bit 0: start the process as debugged
* other bits are reserved and must be cleared
* +8: dword: 0 or pointer to ASCIIZ-string with parameters
* +12 = +0xC: dword: ignored
* +16 = +0x10: dword: pointer on buffer for system operation
* +16 = +0x10: dword: pointer to buffer for system operations
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of file, the rules of creation of names
are indicated in the common description
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
given in the general description
Returned value:
* eax > 0 - program is loaded, eax contains PID
* eax < 0 - has taken place error, -eax contains an error code
of a file system
* eax > 0 - the program is loaded, eax contains PID
* eax < 0 - an error has occured, -eax contains
file system error code
Remarks:
* This function is obsolete, use subfunction 7 functions 70.
* Command line should be ended by the character with the code 0
(ASCIIZ-strings); it are taken into account or all characters up to
completing zero inclusively, or the first 256 characters, that are less.
* If the process is started as debugged, it creates in the frozen status;
for start use subfunction 5 functions 69.
* This function is obsolete, use subfunction 7 of function 70.
* Command line must be terminated by character with code 0
(ASCIIZ-string); function takes into account either all characters
up to terminating null inclusively or the first 256 charachters
depending on 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.
 
======================================================================
======== Function 59 - get information on last system calls. =========
=============== Function 59 - trace last system calls. ===============
======================================================================
Get data on all system calls of all processes.
Gets data on all system calls of all processes.
Parameters:
* eax = 59 - number of the function
* ebx = 0 - sole subfunction
* ecx = pointer on buffer
* edx = size of buffer
* eax = 59 - function number
* ebx = 0 - unique subfunction
* ecx = pointer to the buffer
* edx = size of the buffer
Returned value:
* eax = total number of system calls made from moment
of loading system (modulo 2^32)
* eax = total number of system calls made from system boot
(modulo 2^32)
* ebx = 0
Format of information about one call: (size = 0x40 = 64 bytes)
* +0: dword: PID process/thread
Format of information on one call: (size = 0x40 = 64 bytes)
* +0: dword: PID of process/thread
* +4: 7*dword: garbage
* +32 = +0x20: dword: value edi by call
* +32 = +0x20: dword: value of edi at the call
* +36 = +0x24: dword: esi
* +40 = +0x28: dword: ebp
* +44 = +0x2C: dword: pointer of stack of kernel handler
* +44 = +0x2C: dword: stack pointer of the kernel handler
* +48 = +0x30: dword: ebx
* +52 = +0x34: dword: edx
* +56 = +0x38: dword: ecx
* +60 = +0x3C: dword: eax (=number system function)
* +60 = +0x3C: dword: eax (=number of system function)
Remarks:
* Function is used only in the application systrace. It is rather difficult
to present a situation, in which this application or this function are
really useful, and all system calls for support of this function are a
little decelerated (though and not strongly)...
* In this connection there is a sentence support of this function from
a kernel to remove absolutely, together with the application systrace.
* Information on system calls is saved in system ring buffer
on 0x10 of inputs.
This function simply copies the indicated size given from the mentioned
buffer to the indicated address.
* To what from inputs in the buffer corresponds to last call, it is possible
to define on value eax, namely,
input (eax and 0xF) (on offset (eax and 0xF) *0x40).
* In current implementation the seldom meeting problems of
unsynchronization are possible, when about some calls the
information becomes outdated.
* Under the system buffer the page, 4 KB is allocated.
Size of an input = 64 bytes.
Why 16 inputs - not clearly are used only.
* Value esp at moment of system call by this function cannot be found out.
* Checks of a correctness edx in current implementation is not done.
* The function is used only in the application 'systrace'.
It is rather difficult to imagine a situation, in which
this application or this function are really useful;
and all system calls for support of this function are a little
decelerated (though not strongly)...
* So there is a proposition to delete from the kernel
support of this function, together with application 'systrace'.
* The information on system calls saves in the system
ring buffer with 0x10 entries.
This function simply copies the given size of data
from this buffer to the given address.
* One can determine, which entry in the buffer corresponds to
last system call, by value of eax, namely, it is the entry
(eax and 0xF) (at offset (eax and 0xF)*0x40).
* In the current implementation there can be the seldom
meeting problems of unsynchronization, when the information
on some calls becomes outdated.
* Under the system buffer one page, 4Kb, is allocated.
Size of an entry = 64 bytes. Why only 16 entries are used,
is not clearly.
* The value of esp at the moment of system call cannot
be determined by this function.
* The current implementation does not check edx for correctness.
 
======================================================================
=========== Function 60 - Inter Process Communication (IPC). ==========
========== Function 60 - Inter Process Communication (IPC). ==========
======================================================================
IPC is applied to sendings the messages from one process / thread to another.
Thus it is necessary previously to agree how to interpreted
IPC is used for message dispatching from one process/thread to
another. Previously it is necessary to agree how to interpret
the concrete message.
 
-------- Subfunction 1 - install area for obtaining IPC ---------
Is called by the process - receiver.
----------- Subfunction 1 - set the area for IPC receiving -----------
Is called by process-receiver.
Parameters:
* eax = 60 - number of the function
* ebx = 1 - number subfunction
* ecx = pointer on buffer
* edx = size of buffer
* eax = 60 - function number
* ebx = 1 - subfunction number
* ecx = pointer to the buffer
* edx = size of the buffer
Returned value:
* eax = 0 - always successfully
Ôîðìàò IPC-áóôåðà:
* +0: dword: if here not 0, the buffer is considered disabled; lock/unblock
the buffer, when you with it actively work also to you it is necessary,
that the data of the buffer from the outside varied
(the new messages) not acted
* 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)
* +4: dword: occupied place in the buffer (in bytes)
* +8: first message
* +8+n: second message
* ...
Format of message:
* +0: dword: PID of process / thread which has transmitted the message
* +4: dword: length of the message (not including this header)
* +8: n*byte: data messages
Format of a message:
* +0: dword: PID of sender
* +4: dword: message length (not including this header)
* +8: n*byte: message data
 
--------------- Subfunction 2 - transmit message IPC. ----------------
Is called by the process - initiator.
------------------ Subfunction 2 - send IPC message ------------------
Is called by process-sender.
Parameters:
* eax = 60 - number of the function
* ebx = 2 - number subfunction
* eax = 60 - function number
* ebx = 2 - subfunction number
* ecx = PID of receiver
* edx = pointer on message data
* esi = length of message (in bytes)
* edx = pointer to the message data
* esi = message length (in bytes)
Returned value:
* eax = 0 - successfully
* eax = 1 - receiver has not defined buffer for IPC-messages
(can be, was not in time yet, and there can be, it not that thread,
which is necessary)
* eax = 2 - receiver has blocked the IPC-buffer; try slightly to wait
* eax = 3 - overflow of IPC-buffer of receiver
* 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
* eax = 4 - process/thread with such PID does not exist
Remarks:
* System at once after writing the IPC-message in the buffer dispatches
to stream - receiver event with the code 7 (see codes of events).
* 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 direct access to a graphics. ===
==== Function 61 - get parameters for the direct graphics access. ====
======================================================================
Data of graphics screen are accessible to program (area of memory, which purely
also displays contents of screen) directly without calls of system functions
through the selector gs:
mov eax, [gs:0]
will place in eax first dword of buffer containing information on colour
of left upper point (and, probably, colour of several following).
mov [gs:0], eax
by operation in modes VESA c LFB will install colour of left upper point
(and, probably, colour of several following).
Interpretations given of the graphics screen need knowledge of some parameters,
which come back by this function.
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:
mov eax, [gs:0]
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).
mov [gs:0], eax
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:
* Parameters of a graphics very seldom vary at system operation, namely,
only in cases, when the user works with the program VRR.
* At change of videomode the system redraw all windows
(event with the code 1) and redraw a background (event 5).
Same events occur and in other cases, which meet much more often,
than change of videomode.
* By operation in videomodes with LFB the selector gs specifies on purely
LFB, so reading / writing on gs result directly in change of contents of
the screen. By operation in videomodes without LFB gs specifies some area
of the given kernel, and all functions of output on the screen honesty
fulfil double operation on writing directly on the screen and on
writing in this buffer. In result at reading contents of this buffer the
results correspond to contents of the screen (with, generally speaking,
large colour permission), and writing ignored.
Exception is the mode 320*200, for which in main loop system thread the
upgrade of the screen is fulfilled according to movements
of a mouse pointer.
* 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.
 
------------------------- Screen resolution --------------------------
Parameters:
* eax = 61 - number of the function
* ebx = 1 - number subfunction
* eax = 61 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = [permission on axis x] *65536 + [permission on axis y]
* eax = [resolution on x axis]*65536 + [resolution on y axis]
Remarks:
* It is possible to use the function 14 that it returns sizes on 1 less.
It completely equivalent way.
* One can use function 14 paying attention that
it returns sizes on 1 pixel less. It is fully equivalent way.
 
------------------------ Number bits on pixel ------------------------
---------------------- Number of bits per pixel ----------------------
Parameters:
* eax = 61 - number of the function
* ebx = 2 - number subfunction
* eax = 61 - function number
* ebx = 2 - subfunction number
Returned value:
* eax = number bits on pixel (24 or 32)
* eax = number of bits per pixel (24 or 32)
 
------------------------ Number bytes on string ------------------------
-------------------- Number of bytes per scanline --------------------
Parameters:
* eax = 61 - number of the function
* ebx = 3 - number subfunction
* eax = 61 - function number
* ebx = 3 - subfunction number
Returned value:
* eax = number bytes, which is occupied by one string of the scanning
* eax = number of bytes occupied by one scanline
(horizontal line on the screen)
 
======================================================================
==== Function 62, subfunction 0 - get version of PCI-interface. =====
===== Function 62, subfunction 0 - get version of PCI-interface. =====
======================================================================
Parameters:
* eax = 62 - number of the function
* bl = 0 - number subfunction
* eax = 62 - function number
* bl = 0 - subfunction number
Returned value:
* eax = -1 - access to PCI is prohibited; differently
* ah.al = version of PCI-interface (ah=version, al=subversion)
* high word eax contains a zero
* eax = -1 - PCI access is disabled; otherwise
* ah.al = version of PCI-interface (ah=version, al=subversion)
* high word of eax is zeroed
Remarks:
* Low level access to PCI for applications subfunction 12
functions 21 previously should be allowed.
* If PCI BIOS is not supported, the value ax is not defined.
* 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.
 
======================================================================
==== Function 62, subfunction 1 - get number of last PCI-bus. ===
==== Function 62, subfunction 1 - get number of the last PCI-bus. ====
======================================================================
Parameters:
* eax = 62 - number of the function
* bl = 1 - number subfunction
* eax = 62 - function number
* bl = 1 - subfunction number
Returned value:
* eax = -1 - access to PCI is prohibited; differently
* al = number of last PCI-bus; the stayed bits eax fail
* eax = -1 - access to PCI is disabled; otherwise
* al = number of the last PCI-bus; other bytes of eax are destroyed
Remarks:
* Low level access to PCI for applications subfunction 12
functions 21 previously should be allowed.
* If PCI BIOS is not supported, the value al is not defined.
* 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.
 
======================================================================
====================== Function 62, subfunction 2 ====================
=========== Get mechanism of call to configuration space PCI. ========
===================== Function 62, subfunction 2 =====================
===== Get mechanism of addressing to the PCI configuration space. ====
======================================================================
Parameters:
* eax = 62 - number of the function
* bl = 2 - number subfunction
* eax = 62 - function number
* bl = 2 - subfunction number
Returned value:
* eax = -1 - access to PCI is prohibited; differently
* al = mechanism (1 or 2); the other bits eax fail
* eax = -1 - access to PCI is disabled; otherwise
* al = mechanism (1 or 2); other bytes of eax are destroyed
Remarks:
* Low level access to PCI for applications subfunction 12
functions 21 previously should be allowed.
* Mechanism of call is selected according to characteristics of equipment.
* Subfunctions of reading and writing automatically work with
selected mechanism.
* 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.
 
======================================================================
========= Function 62, subfunction 4,5,6 - read PCI-register. ========
======== Function 62, subfunctions 4,5,6 - read PCI-register. ========
======================================================================
Parameters:
* eax = 62 - number of the function
* bl = 4 - read bytes
* bl = 5 - read a word
* bl = 6 - tread a double word
* eax = 62 - function number
* bl = 4 - read byte
* bl = 5 - read word
* bl = 6 - read dword
* bh = number of PCI-bus
* ch = dddddfff, where ddddd = number of device on bus,
fff = number of function of device
* cl = number of the register (should be even for bl=5,
be divided on 4 for bl=6)
* 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 (prohibited access to PCI
or unsupported parameters); differently
* al/ax/eax (depending on the requested size) contains the data;
the rest of the register eax fail
* 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:
* Low level access to PCI for applications subfunction 12
functions 21 previously should be allowed.
* Access mechanism 2 supports only 16 devices on the bus and ignores number
of the function. To receive an access mechanism it is possible by call
subfunction 2.
* Some registers are standard and exist for all devices, some are defined
by the concrete device. The list first enters, for example, in known
* 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
(http://www.pobox.com/~ralf/files.html,
ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
list second should be indicated in documentation on the device.
registers of the second type must be listed
in the device documentation.
 
======================================================================
====== Function 62, subfunction 8,9,10 - write in PCI-register. ======
====== Function 62, subfunctions 8,9,10 - write to PCI-register. =====
======================================================================
Parameters:
* eax = 62 - number of the function
* bl = 8 - write bytes
* bl = 9 - write a word
* bl = 10 - write a double word
* eax = 62 - function number
* bl = 8 - write byte
* bl = 9 - write word
* bl = 10 - write dword
* bh = number of PCI-bus
* ch = dddddfff, where ddddd = number of the device on bus,
fff = number of function of device
* cl = number of register (should be even for bl=9,
be divided on 4 for bl=10)
* dl/dx/edx (depending on requested size) contains given for writing
* 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 (prohibited access to PCI or unsupported parameters)
* eax = 0 - successfully
* eax = -1 - error (access to PCI is disabled or parameters
are not supported)
* eax = 0 - success
Remarks:
* Low level access to PCI for applications subfunction 12
functions 21 previously should be allowed.
* Access mechanism 2 supports only 16 devices on the bus and ignores number
of the function. To receive an access mechanism it is possible by call
subfunction 2.
* Some registers are standard and exist for all devices, some are defined
by the concrete device. The list first enters, for example, in known
Interrupt List by Ralf Brown;
list second should be indicated in documentation on the device.
* 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 debugging board. ==============
============== Function 63 - work with the debug board. ==============
======================================================================
Debugging board represents the system buffer (on 512 bytes), in which any
program can write (generally speaking, arbitrary) data and from which other
program can these data read.
There is an agreement, according to which written given - text strings
interpreted as of the debug message on a course of execution of the program.
The kernel in the defined situations also writes to board of debugging of the
item of information about execution of some functions; under the agreement of
the message of a kernel start with the prefix " K: ".
For review of board of debugging the application board is created which reads
out the data from the buffer and displays them in the window. board understands
a sequence of codes 13,10 as transition on new string
Character with the zero code at the end of string is not mandatory,
The debug board is the global system buffer (with the size
512 bytes), to which any program can write (generally speaking,
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,
but also does not prevent.
As has appeared of the debugger necessity of board of debugging a little has
decreased, as the debugger allows completely to inspect a course of execution
of the program, and for this purpose it is not required of any efforts on the
part of the program. Nevertheless in many cases the board of debugging
continues to remain useful.
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.
 
---------------------------- Writing of byte ----------------------------
----------------------------- Write byte -----------------------------
Parameters:
* eax = 63 - number of the function
* ebx = 1 - number subfunction
* cl = bytes of data
* eax = 63 - function number
* ebx = 1 - subfunction number
* cl = data byte
Returned value:
* function does not return value
Remarks:
* Byte is written in buffer. Length of buffer - 512 bytes.
At overflow of the buffer all obtained data are lost also filling
starts again with zero.
* For output to board of debugging of more complex objects (strings, numbers)
this function called in cycle suffices. It is possible to not write
manually appropriate code, and to take advantage of the file debug.inc,
included in the distribution kit.
* 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.
 
---------------------------- Reading of byte ----------------------------
Takes away bytes from the buffer.
----------------------------- Read byte ------------------------------
Takes away byte from the buffer.
Parameters:
* eax = 63 - number of the function
* ebx = 2 - number subfunction
* eax = 63 - function number
* ebx = 2 - subfunction number
Returned value:
* eax = ebx = 0 - buffer is empty
* eax = bytes, ebx = 1 - bytes successfully is read
* eax = ebx = 0 - the buffer is empty
* eax = byte, ebx = 1 - byte was successfully read
 
======================================================================
========== Function 64 - reallocate memory of application. ==========
============== Function 64 - resize application memory. ==============
======================================================================
Parameters:
* eax = 64 - number of the function
* ebx = 1 - sole subfunction
* ecx = new size of memory
* eax = 64 - function number
* ebx = 1 - unique subfunction
* ecx = new memory size
Returned value:
* eax = 0 - successfully
* eax = 1 - not enough of memory
* eax = 0 - success
* eax = 1 - not enough memory
Remarks:
* At present this function is a sole resource for dynamic
allocation/free of memory for application.
* At the moment this function is a sole resource for dynamic
allocation/free of application memory.
 
======================================================================
================= Function 66 - work with keyboard. =================
================== Function 66 - work with keyboard. =================
======================================================================
Mode of input influences results of reading of keys by function 2.
At program loading for it ASCII-mode of input is installed.
The input mode influences results of reading keys by function 2.
When a program loads, ASCII input mode is set for it.
 
-------- Subfunction 1 - install a keyboard mode. ---------
-------------- Subfunction 1 - set keyboard input mode. --------------
Parameters:
* eax = 66 - number of the function
* ebx = 1 - number subfunction
* eax = 66 - function number
* ebx = 1 - subfunction number
* ecx = mode:
* 0 = normal (ASCII-characters)
* 1 = scancodes
3406,77 → 3477,81
Returned value:
* function does not return value
 
--------- Subfunction 2 - get a keyboard mode. ----------
-------------- Subfunction 2 - get keyboard input mode. --------------
Parameters:
* eax = 66 - number of the function
* ebx = 2 - number subfunction
* eax = 66 - function number
* ebx = 2 - subfunction number
Returned value:
* eax = current mode
 
------- Subfunction 3 - get a status of direction keys. --------
------------ Subfunction 3 - get status of control keys. -------------
Parameters:
* eax = 66 - number of the function
* ebx = 3 - number subfunction
* eax = 66 - function number
* ebx = 3 - subfunction number
Returned value:
* eax = bit mask:
* 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 included
* Bit 7 (mask 0x80): NumLock is included
* Bit 8 (mask 0x100): ScrollLock is included
* The other bits are reset
* 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
* other bits are cleared
 
----- Subfunction 4 - install common system "hotkey". -----
Applications which have installed it are informed only on pressing "hotkey";
the active application (to which acts all normal input) such keys does not get.
Notice consists in sending event with the code 2.
To read "hotkey" it is possible the same as also usual, - function 2.
-------------- 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 - number of the function
* ebx = 4 - number subfunction
* cl sets scancode of the key;
ãse cl=0 for definition of combinations of a type Ctrl+Shift
* edx = 0xXYZ ûets possible statuses of direction keys:
* Z (low 4 bits) are set by a status of keys LShift and RShift:
* 0 = any of keys should not be pressed;
* 1 = only one of keys is should be pressed;
* 2 = both keys should be pressed;
* 3 = should be pressed LShift, but not RShift;
* 4 = should be pressed RShift, but not LShift
* Y - is similar for LCtrl and RCtrl;
* X - is similar for LAlt and RAlt
* 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 - successfully
* eax=1 - too much "hotkey" is admitted (maximal 256)
* eax=0 - success
* eax=1 - too mant hotkeys (maximum 256 are allowed)
Remarks:
* Hotkey can work either at pressing, or at release. Scancode of release
of the key on 128 it is more, than scancode of pressing
(i.e. high bit is installed).
* Some applications can install the same combination; all such applications
will be informed on pressing such combination.
* 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". -------
-------------- Subfunction 5 - delete installed hotkey. --------------
Parameters:
* eax = 66 - number of the function
* ebx = 5 - number subfunction
* cl = scancode of key and edx = 0xXYZ same, as well as in subfunction 4
* 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 - successfully
* eax = 0 - success
* eax = 1 - there is no such hotkey
Remarks:
* At completion of process / thread all hotkey, installed by it are deleted.
* Function call does not influence other applications. If other application
has defined same combination, it will receive still notices.
* 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.
 
======================================================================
============ Function 67 - change location/sizes of window. ===========
========= Function 67 - change position/sizes of the window. =========
======================================================================
Parameters:
* eax = 67 - number of the function
* eax = 67 - function number
* ebx = new x-coordinate of the window
* ecx = new y-coordinate of the window
* edx = new x-size of the window
3484,62 → 3559,60
Returned value:
* function does not return value
Remarks:
* Value -1 for the parameter means "to not change"; for example, for moving
the window without resizing it is possible to specify edx=esi =-1.
* Previously window should be defined by the function 0.
* 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.
It sets initial coordinates and sizes of the window.
* Sizes of the window are understood in sense of the function 0,
i.e. on one pixel it is less, than real sizes.
* Function call for the maximized windows is simple ignored.
* For windows of appropriate styles a location and/or the sizes can be
changed by the user; current a location and the sizes can be obtained
by function call 9.
* Function dispatches to window event redraw (with the code 1).
* 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).
 
======================================================================
== Function 68, subfunction 0 - get the counter of task switchings. ==
====== Function 68, subfunction 0 - get the task switch counter. =====
======================================================================
Parameters:
* eax = 68 - number of the function
* ebx = 0 - number subfunction
* eax = 68 - function number
* ebx = 0 - subfunction number
Returned value:
* eax = number of task switchings from the moment of loading the system
(modulo 2^32)
* eax = number of task switches from the system booting
(modulo 2^32)
 
======================================================================
====================== Function 68, subfunction 1 ====================
=========== To switch to the following thread of execution. ==========
======= Function 68, subfunction 1 - switch to the next thread. ======
======================================================================
Function completes a current time slice allocated to stream,
and switches to the following.(What thread what process will be by the
following, to predict it is impossible).
Later, when up to current thread queue will reach,
the execution will be restored.
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.
Parameters:
* eax = 68 - number of the function
* ebx = 1 - number subfunction
* eax = 68 - function number
* ebx = 1 - subfunction number
Returned value:
* function does not return value
 
======================================================================
============ Function 68, subfunction 2 - cache + rdpmc. =============
============= Function 68, subfunction 2 - cache + rdpmc. ============
======================================================================
Parameters:
* eax = 68 - number of the function
* ebx = 2 - number subfunction
* ecx = required operation:
* ecx = 0 - to permit execution of the instruction rdpmc
(ReaD Performance-Monitoring Counters)
* ecx = 1 - find out, enabled/disabled cache
* ecx = 2 - enabled cache
* ecx = 3 - disabled cache
* 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
Returned value:
* for ecx=0:
* eax = value cr4
* eax = the value of cr4
* for ecx=1:
* eax = (cr0 and 0x60000000):
* eax = 0 - cache enabled
* eax <> 0 - cache disabled
* eax = 0 - cache is on
* eax <> 0 - cache is off
* for ecx=2 and ecx=3:
* function does not return value
 
3546,202 → 3619,211
======================================================================
=========== Function 68, subfunction 3 - read MSR-register. ==========
======================================================================
MSR = Model Specific Register; the complete list of the MSR-registers of the
processor contains in documentation on the processor (for example, IA-32 Intel
Architecture Software Developer's Manual, Volume 3, Appendix B); each set of
processors has the subset of the MSR-registers.
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 - number of the function
* ebx = 3 - number subfunction
* ecx ignored
* edx = address MSR
* eax = 68 - function number
* ebx = 3 - subfunction number
* ecx is ignored
* edx = MSR address
Returned value:
* ebx:eax = high:low dword of result
* ebx:eax = high:low dword of the result
Remarks:
* Instruction in ecx nonexistent or non-realized for of the given processor
MSR will entail exception in a kernel, which will kill thread.
* Previously it is necessary to define, whether are supported MSR as a whole,
command cpuid. Differently there will be already other exception in a
kernel, which all the same will kill thread.
* 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 - çàïèñàòü â MSR-ðåãèñòð. =========
========= Function 68, subfunction 4 - write to MSR-register. ========
======================================================================
MSR = Model Specific Register; the complete list of the MSR-registers of the
processor contains in documentation on the processor (for example, IA-32 Intel
Architecture Software Developer's Manual, Volume 3, Appendix B); each set of
processors has the subset of the MSR-registers.
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 - number of the function
* ebx = 4 - number subfunction
* ecx ignored
* edx = address MSR
* esi:edi = high:low dword of result
* eax = 68 - function number
* ebx = 4 - subfunction number
* ecx is ignored
* edx = MSR address
* esi:edi = high:low dword
Returned value:
* ebx:eax = copy esi:edi
Remarks:
* Instruction in ecx nonexistent or non-realized for of the given processor
MSR will entail exception in a kernel, which will kill thread.
* Previously it is necessary to define, whether are supported MSR as a whole,
command cpuid. Differently there will be already other exception in a
kernel, which all the same will kill thread.
* ebx:eax = copy of esi:edi
Çàìå÷àíèÿ:
* 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 5 - allocate physical memory. =======
======================================================================
Parameters:
* eax = 68 - number of the function
* ebx = 5 - number subfunction
* eax = 68 - function number
* ebx = 5 - subfunction number
* ecx = size (in bytes)
Returned value:
* eax = physical address of allocated memory
Remarks:
* Usual applications should not use this function, it is intended for of a
case, when by operation with any device it is required to place the data
to the known physical address. (In effect, this function was developed for
AC97WAV.)
* Number of blocks of the actual storage is limited (constant 24, and this
constant includes and some memories for of needs of a kernel).
* Free allocated memory it is possible subfunction 6, in copying data
there/back are engaged subfunction 7 and 8.
* Normal applications must not use this function, it is intended
for the case, when for some device it is required to place
data to the known physical address. (In effect, this function
was developed for AC97WAV.)
* The number of blocks of physical memory is limited (by constant
24, and this constant includes some blocks for kernel).
* To free a memory allocated by such way use
subfunction 6, to copy data there and back
use subfunctions 7 and 8.
 
======================================================================
========= Function 68, subfunction 6 - free physical memory. =========
======================================================================
Parameters:
* eax = 68 - number of the function
* ebx = 6 - number subfunction
* eax = 68 - function number
* ebx = 6 - subfunction number
* ecx = physical address of memory
Returned value:
* function does not return value
Remarks:
* Usual applications should not use this function, it is intended for of a
case, when by operation with any device it is required to place the data
to the known physical address. (In effect, this function was developed for
AC97WAV.)
* Memory should be earlier allocated subfunction 5.
* Normal applications must not use this function, it is intended
for the case, when for some device it is required to place
data to the known physical address. (In effect, this function
was developed for AC97WAV.)
* The memory must be previously allocated by subfunction 5.
 
======================================================================
==== Function 68, subfunction 7 - write data in physical memory. =====
===== Function 68, subfunction 7 - write data to physical memory. ====
======================================================================
Parameters:
* eax = 68 - number of the function
* ebx = 7 - number subfunction
* eax = 68 - function number
* ebx = 7 - subfunction number
* ecx = physical address
* edx = pointer on data (in application)
* esi = data size (in bytes)
* edx = pointer to the data (in the application)
* esi = size of the data (in bytes)
Returned value:
* function does not return value
Remarks:
* Usual applications should not use this function, it is intended for of a
case, when by operation with any device it is required to place the data
to the known physical address. (In effect, this function was developed for
AC97WAV.)
* Range of physical addresses should lay inside allocated subfunction 5
blocks of physical memory.
* Checks of a correctness is not made.
* Normal applications must not use this function, it is intended
for the case, when for some device it is required to place
data to the known physical address. (In effect, this function
was developed for AC97WAV.)
* The range of physical addresses should lie inside of previously
allocated by subfunction 5 block of physical memory.
* There is no check for correctness.
 
======================================================================
==== Function 68, subfunction 8 - read data from physical memory. ====
======================================================================
Parameters:
* eax = 68 - number of the function
* ebx = 8 - number subfunction
* eax = 68 - function number
* ebx = 8 - subfunction number
* ecx = physical address
* edx = pointer on buffer for data (in application)
* esi = data size (in bytes)
* edx = pointer to buffer for data (in application)
* esi = size of data (in bytes)
Returned value:
* function does not return value
Remarks:
* Usual applications should not use this function, it is intended for of a
case, when by operation with any device it is required to place the data
to the known physical address. (In effect, this function was developed for
AC97WAV.)
* Range of physical addresses should lay inside allocated subfunction 5
blocks of physical memory.
* Checks of a correctness is not made.
* Normal applications must not use this function, it is intended
for the case, when for some device it is required to place
data to the known physical address. (In effect, this function
was developed for AC97WAV.)
* The range of physical addresses should lie inside of previously
allocated by subfunction 5 block of physical memory.
* There is no check for correctness.
 
======================================================================
====================== Function 69 - debugging. ======================
====================== Fucntion 69 - debugging. ======================
======================================================================
Process can load other process as debugged by installation of appropriate bit
by call subfunction 16 functions 58. Process can have only one debugger;
one process can debug some processes. System notifies the debugger on events
occurring to the debugged process. Messages are written in the buffer defined
A process can load other process as debugged by set of corresponding
bit by call to subfunction 16 of function 58
or subfunction 7 of function 70.
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
subfunction 0.
Ôîðìàò ñîîáùåíèÿ:
+0: dword: the code of the message
+4: dword: PID of the debugged process
+8: there can be additional data defined by the code of the message
Codes of messages:
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:
* 1 = exception
* in addition transfers dword-number of exception
* process is paused
* 2 = process was completed
* comes at any completion: both through the system function -1,
and at "murder" by any other process (including debugger)
* 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)
* 3 = debug exception int 1 = #DB
* in addition transfers a dword-image of the register DR6:
* Bits 0-3: the condition of appropriate breakpoint
(installed subfunction 9) is fulfilled
* Bit 14: the exception has taken place because of the mode of step
tracing (the flag TF is installed)
* process is paused
At completion of the debugger all debugged processes are killed.
If the debugger it does not want, it should previously be disabled
* in addition dword-image of the register DR6 is given:
* bits 0-3: condition of the corresponding breakpoint (set by
subfunction 9) is satisfied
* áèò 14: exception has occured because of the trace mode
(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
subfunction 3.
 
All subfunction are applicable only to the processes/threads started from
current function 58 with a installed debugging flag.
Debugging of multithread programs is not supported yet.
Full list subfunctions:
* subfunction 0 - define area given for of debug messages
* subfunction 1 - get a status of the registers debugged thread
* subfunction 2 - install a status of the registers debugged thread
* subfunction 3 - disabled from the debugged process
* subfunction 4 - paused debugged thread
* subfunction 5 - restored execution debugged thread
* subfunction 6 - read from memory of the debugged process
* subfunction 7 - write in memory of the debugged process
* subfunction 8 - complete debugged thread
* subfunction 9 - place/remove the hardware point break
All subfunctions are applicable only to processes/threads started
from the current by function 58 or 70 with set debugging flag.
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
 
======================================================================
====================== Function 69, subfunction 0 ====================
============= Define area given for of debug messages. ===============
= Function 69, subfunction 0 - define data area fror debug messages. =
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 0 - number subfunction
* eax = 69 - function number
* ebx = 0 - subfunction number
* ecx = pointer
Format of data area:
* +0: dword: N = size of buffer (not including this header)
* +4: dword: occupied in buffer
* +0: dword: N = buffer size (not including this header)
* +4: dword: occupied place
* +8: N*byte: buffer
Returned value:
* function does not return value
Remarks:
* If a field of a size negatively, the buffer is considered disabled and
at arrival of the new message the system will wait.
For synchronization frame all operation with the buffer by operations
of the locking/unlocking
neg [bufsize]
* Data in the buffer are treated as the array of units of a variable
length - messages. The format of the message is indicated in
the common description.
* 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
neg [bufsize]
* Data in the buffer are considered as array of items with variable
length - messages. Format of a message is explained in
general description.
 
======================================================================
====================== Function 69, subfunction 1 ====================
=========== Get a status of the registers debugged thread. ===========
===================== Function 69, subfunction 1 =====================
============ Get contents of registers of debugged thread. ===========
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 1 - number subfunction
* eax = 69 - function number
* ebx = 1 - subfunction number
* ecx = thread identifier
* edx = length of structure of a context, should be 0x28=40 bytes
* edx = size of context structure, must be 0x28=40 bytes
* esi = pointer to context structure
Returned value:
* function does not return value
Format of structure of a context: (FPU is not supported yet)
Format of context structure: (FPU is not supported yet)
* +0: dword: eip
* +4: dword: eflags
* +8: dword: eax
3753,533 → 3835,540
* +32 = +0x20: dword: esi
* +36 = +0x24: dword: edi
Remarks:
* If thread fulfils the code of a ring-0, the status of the registers
of a ring-3 comes back.
* Process should be loaded for of debugging (as is indicated in
the common description).
* 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).
 
======================================================================
====================== Function 69, subfunction 2 ======================
======== Install a status of the registers debugged thread. ========
===================== Function 69, subfunction 2 =====================
============ Set contents of registers of debugged thread. ===========
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 2 - number subfunction
* eax = 69 - function number
* ebx = 2 - subfunction number
* ecx = thread identifier
* edx = length of structure of a context, should be 0x28=40 bytes
* edx = size of context structure, must be 0x28=40 bytes
Returned value:
* function does not return value
Format of structure of a context is indicated in the description subfunction 1.
Format of context structure is shown in the description of
subfunction 1.
Remarks:
* If thread fulfils the code of a 0-ring, the status of the registers
of a 3-ring is installed.
* Process should be loaded for of debugging (as is indicated in
the common description).
* 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).
 
======================================================================
== Function 69, subfunction 3 - disabled from the debugged process. ==
===== Function 69, subfunction 3 - detach from debugged process. =====
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 3 - number subfunction
* eax = 69 - function number
* ebx = 3 - subfunction number
* ecx = identifier
Returned value:
* function does not return value
Remarks:
* If the process was paused, it restores execution.
* If the process was suspended, it resumes execution.
 
======================================================================
======== Function 69, subfunction 4 - paused debugged thread. ========
======== Function 69, subfunction 4 - suspend debugged thread. =======
======================================================================
Parameters:
* eax = 69 - number ïðîöåññà
* ebx = 4 - number subfunction
* ecx = identifier
* eax = 69 - function number
* ebx = 4 - subfunction number
* ecx = thread identifier
Returned value:
* function does not return value
Remarks:
* Process should be loaded for of debugging (as is indicated in
the common description).
* Process must be loaded for debugging (as is shown in
general description).
 
======================================================================
====================== Function 69, subfunction 5 ====================
================ Restored execution debugged thread. =================
======== Function 69, subfunction 5 - resume debugged thread. ========
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 5 - number subfunction
* ecx = identifier
* eax = 69 - function number
* ebx = 5 - subfunction number
* ecx = thread identifier
Returned value:
* function does not return value
Remarks:
* Process should be loaded for of debugging (as is indicated in
the common description).
* Process must be loaded for debugging (as is shown in
general description).
 
======================================================================
====================== Function 69, subfunction 6 ====================
============= Read from memory of the debugged process. ==============
= Fucntion 69, subfunction 6 - read from memory of debugged process. =
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 6 - number subfunction
* eax = 69 - function number
* ebx = 6 - subfunction number
* ecx = identifier
* edx = how many bytes to read
* esi = memory address of the debugged process
* edi = pointer on buffer for data
* edx = number of bytes to read
* esi = address in the memory of debugged process
* edi = pointer to buffer for data
Returned value:
* eax = -1 error (incorrect PID or buffer)
* differently eax = the number read bytes
(is possible, 0, if in esi the too large value)
* eax = -1 at an error (invalid PID or buffer)
* otherwise eax = number of read bytes (possibly, 0,
if esi is too large)
Remarks:
* Process should be loaded for of debugging (as is indicated in
the common description).
* Process must be loaded for debugging (as is shown in
general description).
 
======================================================================
Function 69, subfunction 7 - write in memory of the debugged process.
== Function 69, subfunction 7 - write to memory of debugged process. =
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 7 - number subfunction
* eax = 69 - function number
* ebx = 7 - subfunction number
* ecx = identifier
* edx = how many bytes to write
* esi = memory address of the debugged process
* edi = pointer on data
* edx = number of bytes to write
* esi = address of memory in debugged process
* edi = pointer to data
Returned value:
* eax = -1 error (incorrect PID or buffer)
* differently eax = the number written bytes
(is possible, 0, if in esi the too large value)
* eax = -1 at an error (invalid PID or buffer)
* otherwise eax = number of written bytes (possibly, 0,
if esi is too large)
Remarks:
* Process should be loaded for of debugging (as is indicated in
the common description).
* Process must be loaded for debugging (as is shown in
general description).
 
======================================================================
======= Function 69, subfunction 8 - complete debugged thread. =======
======= Function 69, subfunction 8 - terminate debugged thread. ======
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 8 - number subfunction
* eax = 69 - function number
* ebx = 8 - subfunction number
* ecx = identifier
Returned value:
* function does not return value
Remarks:
* Process should be loaded for of debugging (as is indicated in
the common description).
* Function is similar subfunction 2 functions 18 with two differences:
the execution of the first remark is required and is accepted PID,
instead of number of the slot.
* 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.
 
======================================================================
====================== Function 69, subfunction 9 ====================
=============== Place/remove the hardware point break. ===============
===== Function 69, subfunction 9 - set/clear hardware breakpoint. ====
======================================================================
Parameters:
* eax = 69 - number of the function
* ebx = 9 - number subfunction
* eax = 69 - function number
* ebx = 9 - subfunction number
* ecx = thread identifier
* dl = index of breakpoint, from 0 up to 3 inclusively
* dl = index of breakpoint, from 0 to 3 inclusively
* dh = flags:
* if high bit is reset - install breakpoint:
* if high bit is cleared - set breakpoint:
* bits 0-1 - condition:
* 00 = breakpoint on execution
* 01 = breakpoint on writing
* 11 = breakpoint on reading/writing
* bits 2-3 - length; for breakpoints on fulfilment should be 00,
otherwise one of
* 00 = bytes
* 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
* 01 = word
* 11 = double word
* esi = address of breakpoint; should be aligned according to length
(i.e. should be even for of breakpoints on a word, is multiple 4 for
of a double word)
* if high bit is installed - reset breakpoint
* 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
Returned value:
* eax = 0 - successfully
* eax = 0 - success
* eax = 1 - error in the input data
* eax = 2 - (reserved, never comes back in current realization)
with this index global breakpoint already is installed
* eax = 2 - (reserved, is never returned in the current
implementation) a global breakpoint with that index is already set
Remarks:
* Process should be loaded for of debugging (as is indicated in
the common description).
* Hardware breakpoints are realized through the DRx-register of the
processor, from here all limitations.
* Function can reinstall the breakpoint, earlier installed to it
(in any way not informing about it).
Carry on the list of the installed breakpoints in the debugger.
* Operation of breakpoint consists in generation of debug exception #DB,
which the system informs to the debugger.
* Breakpoint on writing and reading/writing works after execution of
the instruction, which has called it.
* 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.
 
======================================================================
== Function 70 - work with a file system with support of long names. =
==== Function 70 - work with file system with long names support. ====
======================================================================
Parameters:
* eax = 70
* ebx = pointer on information structure
* ebx = pointer to the information structure
Returned value:
* eax = 0 - successfully; differently error code of a file system
* depending on subfunction the value and in other registers can come back
Common format of information structure:
* +0: dword: number subfunction
* +4: dword: offset in the file
* +8: dword: high dword of offset (should be 0) or field of flags
* 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
* +12 = +0xC: dword: size
* +16 = +0x10: dword: pointer on data
* +20 = +0x14: n db: ASCIIZ-string with a filename
* +16 = +0x10: dword: pointer to data
* +20 = +0x14: n db: ASCIIZ-string with the filename
or
* +20 = +0x14: db 0
* +21 = +0x15: dd pointer on ASCIIZ-string with a filename
Specifications - in documentation on appropriate subfunction.
Filename is insensitive to the register of characters. Russian characters should be written in the coding cp866 (DOS).
Ôîðìàò èìåíè ôàéëà:
* +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:
/base/number/dir1/dir2/.../dirn/file,
where /base/number Identifies the device, on which the file is searched:
where /base/number identifies device, on which file is located:
one of
* /RD/1 = /RAMDISK/1 for access to ramdisk
* /FD/1 = /FLOPPYDISK/1 for access to the first floppy-drive,
/FD/2 = /FLOPPYDISK/2 for access to the second floppy-drive
* /HD0/x, /HD1/x, /HD2/x, /HD3/x for access accordingly
to hard disks on IDE0 (Primary Master), IDE1 (Primary Slave),
* /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),
IDE2 (Secondary Master), IDE3 (Secondary Slave);
x - number of partition on selected hard disk, varies from 1 up to 255
(on each of hard disks partitions starts with 1)
* /CD0/1, /CD1/1, /CD2/1, /CD3/1 for access accordingly
to CD on IDE0 (Primary Master), IDE1 (Primary Slave),
IDE2 (Secondary Master), IDE3 (Secondary Slace)
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)
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
Accessible subfunctions:
Available subfunctions:
* subfunction 0 - read file
* subfunction 1 - read folder
* subfunction 2 - create/rewrite file
* subfunction 5 - get file/directory attributes structure
* subfunction 6 - set file/directory attributes structure
* subfunction 5 - get attributes of file/folder
* subfunction 6 - set attributes of file/folder
* subfunction 7 - start application
For CD-drives due to hardware limitations only subfunctions
0,1,5 and 7 are available, other subfunctions return error
with code 2.
 
======================================================================
= Function 70, subfunction 0 - read file with support of long names. =
=== Function 70, subfunction 0 - read file with long names support. ==
======================================================================
Parameters:
* eax = 70 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 0 = number subfunction
* +4: dword: position in the file (in bytes)
* +8: dword: 0 (reserved for high dword of a position)
* +12 = +0xC: dword: how many bytes to read
* +16 = +0x10: dword: pointer on buffer, where the data will be written
* +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
are indicated in the common description
* 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
or
* +20 = +0x14: db 0
* +21 = +0x15: dd pointer on ASCIIZ-string with a filename
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx = number read bytes or
-1=0xffffffff, if the file is not retrieved
* eax = 0 - success, otherwise file system error code
* ebx = number of read bytes or -1=0xffffffff if file was not found
Remarks:
* If the file was terminated earlier, than last requested block was read,
the function will read, how many can, then will return eax=6 (EOF).
* Function does not allow to read folders
(will return eax=10, access denied).
* 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 support of long names. =
========================================================================
======================================================================
== Function 70, subfunction 1 - read folder with long names support. =
======================================================================
Parameters:
* eax = 70 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 1 = number subfunction
* +4: dword: index of the initial block (beginning from 0)
* +8: dword: field of flags:
* 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:
* bit 0 (mask 1): in what format to return names,
0=ANSI, 1=UNICODE
* Other bits are reserved and should be installed in 0
for of the future compatibility
* +12 = +0xC: dword: how many blocks to read
* +16 = +0x10: dword: pointer on buffer, where the data will be written,
size of buffer should be not less than 32 + [+12] *560 bytes
* +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
are indicated in the common description
* 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
or
* +20 = +0x14: db 0
* +21 = +0x15: dd pointer on ASCIIZ-string with a filename
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx = number of files, the information about which was written
in the buffer,
or -1=0xffffffff, if the folder is not retrieved
* 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
Structure of the buffer:
* +0: 32*byte: header
* +32 = +0x20: n1*byte: block with information on file 1
* +32+n1: n2*byte: block with information on file 2 2
* +32+n1: n2*byte: block with information on file 2
* ...
Structure of header:
* +0: dword: version of structure (current version = 1)
* +4: dword: amount of the placed blocks; it is no more,
than +12 information structures are requested in a field;
can be less, if in a folder the files (same, as in ebx) were terminated
* +8: dword: total number of files in a folder
* +12 = +0xC: 20*byte: reserved (zero)
Structure of data block of input of directory (DBID):
* +0: dword: file attributes:
* áèò 0 (ìàñêà 1): file only for reading
* áèò 1 (ìàñêà 2): file is hidden
* áèò 2 (ìàñêà 4): file is system
* áèò 3 (ìàñêà 8): it not file, it is volume label
(on given partition meets no more once and only in a root folder)
* áèò 4 (ìàñêà 0x10): It is a folder
* áèò 5 (ìàñêà 0x20): file was not archived - many programs of archiving
have an option, on which the files with installed this bit are archived
only, then this bit is dumped(reset) is it can be useful for of automatic
creation of backup-archives, for at recording bit is usually installed
* +4: byte: type of data of a name:
(coincides with bit 0 flags of information structure)
* 0 = ASCII = 1- byte performance of each character
* 1 = UNICODE = 2-byte performance of each character
* +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
* +5: 3*byte: reserved (zero)
* +8: 4*byte: time of creation of file
* +12 = +0xC: 4*byte: date of creation of file
* +16 = +0x10: 4*byte: time of last access (reading or writing)
* +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)
* +20 = +0x14: 4*byte: date of last access
* +24 = +0x18: 4*byte: time of a last modification
* +28 = +0x1C: 4*byte: date of a last modification
* +32 = +0x20: qword: file size in bytes (up to 16777216 Tbytes)
* +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)
* +40 = +0x28: name
* for of the format ASCII: maximum length of a name 263 characters
(263 bytes), bytes after a name matters 0
* for of the format UNICODE: maximum length of a name 259 characters
(518 bytes), two bytes after a name matter 0
Format of time:
* for ASCII format: maximum length is 263 characters
(263 bytes), byte after the name has value 0
* äëÿ ôîðìàòà UNICODE: maximum length is 259 characters
(518 bytes), 2 bytes after the name have value 0
Time format:
* +0: byte: seconds
* +1: byte: minutes
* +2: byte: hours
* +3: byte: reserved (0)
* For example, 23.59.59 is written as (in hex) 3B 3B 17 00
Format of date:
* +0: byte: day
* +1: byte: month
* +2: word: year
* For example, 25.11.1979 is written as (in hex) 19 0B BB 07
* 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 in DBID there is a name in ASCII, length makes 304 bytes,
if in UNICODE - 560 bytes. Value of length aligned on whole
multiple 16 bytes (for of acceleration of processing in cache-memory CPU).
* First character after a name zero (ASCIIZ-string).
The further data contain garbage.
* If the files in a folder were terminated earlier, than the requested
amount was read, the function will read, how many can,
then will return eax=6 (EOF).
* 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).
* Any folder on the disk, except for root, contains two special
inputs(entrances) "." And "..", identifying accordingly folder
and parent folder.
* Function allows also to read virtual folders "/", "/rd", "/fd",
"/hd [n] ", thus the attributes subfolders rely equal 0x10, and the times
and dates are unset. An alternate way of obtaining of the information
about the equipment - subfunction 11 functions 18
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.
 
======================================================================
====================== Function 70, subfunction 2 ====================
========== Create/rewrite file with support of long names. ===========
===================== Function 70, subfunction 2 =====================
============ Create/rewrite file with long names support. ============
======================================================================
Parameters:
* eax = 70 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 2 = number subfunction
* eax = 70 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 2 = subfunction number
* +4: dword: 0 (reserved)
* +8: dword: 0 (reserved)
* +12 = +0xC: dword: how many bytes to write
* +16 = +0x10: dword: pointer on data
* +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
are indicated in the common description
* +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
or
* +20 = +0x14: db 0
* +21 = +0x15: dd pointer on ASCIIZ-string with a filename
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx = number written bytes (is possible, 0)
* eax = 0 - success, otherwise file system error code
* ebx = number of written bytes (possibly 0)
Remarks:
* If the file with such name did not exist, it creates; if existed,
is rewritten.
* If it is not enough of free space on of the disk, the function will write,
how many can, then will return an error code 8.
* 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).
 
======================================================================
= Function 70, subfunction 5 - get file/directory attributes structure.
==== Function 70, subfunction 5 - get information on file/folder. ====
======================================================================
Parameters:
* eax = 70 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 5 = number subfunction
* eax = 70 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 5 = subfunction number
* +4: dword: 0 (reserved)
* +8: dword: 0 (reserved)
* +12 = +0xC: dword: 0 (reserved)
* +16 = +0x10: dword: pointer on buffer, where data will be written (40 bytes)
* +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
are indicated in the common description
* +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
or
* +20 = +0x14: db 0
* +21 = +0x15: dd pointer on ASCIIZ-string with a filename
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx fail
Information on the file comes back in the format DBID
(data block of input of directory), indicated in the description subfunction 1,
but without a filename (only first 40 = 0x28 bytes).
* 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).
Remarks:
* Function does not support virtual folders such as /, /rd
and root folders such as /rd/1.
* The function does not support virtual folders such as /, /rd and
root folders like /rd/1.
 
======================================================================
= Function 70, subfunction 6 - set file/directory attributes structure.
===== Function 70, subfunction 6 - set attributes of file/folder. ====
======================================================================
Parameters:
* eax = 70 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 6 = number subfunction
* eax = 70 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 6 = subfunction number
* +4: dword: 0 (reserved)
* +8: dword: 0 (reserved)
* +12 = +0xC: dword: 0 (reserved)
* +16 = +0x10: dword: pointer on buffer with attributes (32 bytes)
* +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
are indicated in the common description
* +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
or
* +20 = +0x14: db 0
* +21 = +0x15: dd pointer on ASCIIZ-string with a filename
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
Returned value:
* eax = 0 - successfully, differently error code of a file system
* ebx fail
File attributes - first 32 bytes in DBID (data block of input of directory),
which format is indicated in the description subfunction 1
(that is without a name and file size). Attribute the file/folder/volume label
(bits 3,4 in dword +0) does not vary.
Byte +4 (format of a name) ignored.
* 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.
Remarks:
* Function does not support virtual folders such as /, /rd
and root folders such as /rd/1.
* 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).
 
======================================================================
============ Function 70, subfunction 7 - start application. ============
=========== Function 70, subfunction 7 - start application. ==========
======================================================================
Parameters:
* eax = 70 - number of the function
* ebx = pointer on information structure
Format of information structure:
* +0: dword: 7 = number subfunction
* +4: dword: field of flags:
* áèò 0: to start the process as debugged
* other bits are reserved and should be installed in 0
* +8: dword: 0 or pointer on ASCIIZ-string with parameters
* eax = 70 - function number
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 7 = subfunction number
* +4: dword: flags field:
* áèò 0: start process as debugged
* other bits are reserved and must be set to 0
* +8: dword: 0 or pointer to ASCIIZ-string with parameters
* +12 = +0xC: dword: 0 (reserved)
* +16 = +0x10: dword: 0 (reserved)
* +20 = +0x14: ASCIIZ-name of the file, the rules of creation of names
are indicated in the common description
* +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 on ASCIIZ-string with a filename
* +21 = +0x15: dd pointer to ASCIIZ-string with file name
Returned value:
* eax > 0 - program is loaded, eax contains PID
* eax < 0 - has taken place error,
-eax contains an error code of a file system
* ebx fail
* eax < 0 - an error has occured, -eax contains
file system error code
* ebx destroyed
Remarks:
* Command line should be ended by the character with the code 0
(ASCIIZ-strings); it are taken into account or all characters up to
completing zero inclusively, or the first 256 characters, that are less.
* If the process is started as debugged, it creates in the frozen status;
for of start use subfunction 5 functions 69.
* 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.
 
======================================================================
=========== Function 71, subfunction 1 - set window caption ==========
========== Function 71, subfunction 1 - set window caption. ==========
======================================================================
Parameters:
* eax = 71 - function number
* ebx = 1 - subfunction number
* eáx = caption string address
* ecx = pointer to caption string
Returned value:
* eax = 0 - caption changed successfully
* eax = 1 - error occured
* function does not return value
Remarks:
* String should be in ASCIIZ format. Disregarding real string length,
no more than 255 chars will be wrawn.
* Pass NULL in ecx to remove caption
* 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.
 
======================================================================
========== Function -1 - complete execution of thread/proces =========
=============== Function -1 - terminate thread/process ===============
======================================================================
Parameters:
* eax = -1 - number of the function
* eax = -1 - function number
Returned value:
* function does not return neither value, nor handle
* function does not return neither value nor control
Remarks:
* If the process obviously did not create streams, it has only one thread,
which completion results in completion of the process.
* If current thread - last in process, its completion also results
in completion of the process.
* This function completes current thread. Another thread
is possible kill by call subfunction 2 functions 18.
* 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.
 
======================================================================
=========================== List of events ===========================
======================================================================
Next event is possible get by call of one from functions 10 (to expect event),
11 (to check up without waiting), 23 (to expect during the given time).
These functions return only those events, which enter into a mask installed by
the function 40. By default it is first three, that there is enough for of many
applications of.
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.
Codes of events:
* 1 = message about redraw (is reset at function call 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 the function 2
* 3 = button is pressed, defined earlier by function 8(or buttons of closing,
created implicitly by function 0 is pressed; the button of minimization is
handled by the system and about it of the message does not come; acts, only
when the window is active; is reset, when all buttons from the buffer are
read out by the function 17)
* 4 = reserved (in current implementation never comes even at unmasking
by the function 40)
* 5 = redraw the background of a desktop (is reset automatically after
redraw, so if in time redraw of a background the program does not wait
and does not check event, this event it will not remark)
* 6 = event from the mouse (something happened - pressing a mouse button
or moving; is reset at reading)
* 7 = there was an event IPC (look the function 60 - Inter Process
Communication; is reset at reading)
* 8 = there was a network event (is reset at reading; look operation
with the network)
* 9 = there was a debug event (is reset at reading; look a debug subsystem)
* 16..31 = there was an event with appropriate IRQ
(16=IRQ0, 31=IRQ15) (is reset at reading all data IRQ)
* 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)
* 5 = the desktop background is redrawed (is reset automatically
after redraw, so if in redraw time program does not wait and
does not check events, it will not remark this event)
* 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 a file system ====================
=================== Error codes of the file system ===================
======================================================================
* 0 = successfully
* 1 = base and/or partition of the hard disk is not defined
(subfunctions 7, 8 functions 21)
* 2 = function is not supported for of the given file system
(comes back in case of attempt of LBA-reading at prohibited LBA)
* 3 = Unknown file system
* 4 = comes back only by function rename by transmission of the strongly
incorrect parameter and in any way does not correspond to the description
in sources of a kernel " partition not defined at hd "
* 5 = file is not retrieved
* 6 = file was completed
* 7 = pointer outside of memory of the application
* 8 = disk is filled
* 9 = table FAT is destroyed
* 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
* 4 = is returned only from function 'rename' by transmission of
the strongly incorrect parameter and in any way does not
correspond to the description in the kernel sources
"partition not defined at hd"
* 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
* 10 = access denied
* 11 = error of the device
At start of the program the following error codes are possible also:
* 30 = 0x1E = not enough of memory
* 31 = 0x1F = file is not application
* 32 = 0x20 = too much processes
 
* 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