diff --git a/kernel/trunk/docs/KOS help ENG/KOSHELP SOURCE/FAQ.files/colorschememapping.xml b/kernel/trunk/docs/KOS help ENG/KOSHELP SOURCE/FAQ.files/colorschememapping.xml
deleted file mode 100644
index b200daa38c..0000000000
--- a/kernel/trunk/docs/KOS help ENG/KOSHELP SOURCE/FAQ.files/colorschememapping.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
Problem solving and FAQs.
What are the
-options for downloading KolibriOS exist?
- Booting from |
-
- Supports |
-
- Hard drive (HDD/SDD) |
-
- Yes |
-
- Flash drive (USB 1.0-2.1) |
- |
- Laser disk (CD/DVD) |
- |
- Floppy disk (1.14) |
-
Information about how to install KolibriOS
-can be found here: Official distro>HD_Load. When you boot from the stick you
-may need to use setmbr.exe (distro>HD_Load>USB_Boot). Try
-to boot without his help, if it does not work, then you need to use this
-utility.
After booting hard drives are not detected,
-what should I do?
There are three options:
After all the experiments do not forget to change everything back!
How to install KolibriOS as the main OS on an old laptop?
There are several options. Below is one of them.
The laptop must be Windows 95/98/2k / XP. Copy the distribution to the root
-of the C: drive. Go to HD_Load. Run mtldr_install.exe
-and specify the path to kolibri.img. Load into KolibriOS
-and delete Windows files except boot.ini. It deleted the entry of Windows and
-set the timeout to 0. Note: do not forget to save the image of the distribution
-using RDSAVE or put a tick in the computer shutdown dialog.
Is it possible
-to boot without the image kolibri.img from hard drive?
Unfortunately, this is not possible because the image
-contains the OS kernel as well as the necessary system components.
What does the
-pop-up warning mean when the system boots "a problem is Detected with
-MTRR, performance may be downgraded"?
The problem is observed on some systems, below is a
-comment of one of the leading programmers of the project:
<< CleverMouse: the most obnoxious thing about setting up MTRR
-is that if you do something wrong, everything will work, but much slower than
-it could, and it's hard to detect. I'm on my own laptop with considerable
-experience in programming hardware is not immediately realized that the drawing
-of the background, inhibiting to what is visible to the eye - what is there in
-the eye reactivity? hundreds of milliseconds? - a consequence of problems with MTRR. Therefore, the new code
-tries to check the MTRR setting programmatically and, if it doesn't like
-something, swears a message in @notify, so that the user has a chance to
-understand that the system slows down not because of innate qualities, but
-because of problems with the hardware setting. >>
MTRRs (Memory type range registers — Range registers
-of memory type) — are used to assign a type (caching policy) to memory areas.
-MTRR registers provide a mechanism to associate memory types with the physical
-address ranges of system memory. They allow the processor to optimize
-operations for different types of memory, such as ROM, RAM, frame buffer, and
-memory-mapped I/O devices. They also simplify system hardware development by
-reducing the number of memory management pins that were used for this purpose
-in early processors and external logic devices.
What other
-programming languages, besides assembler, can be used to develop applications
-for KolibriOS?
Ported:
* Oberon-07 Compiler
* Tiny C Compiler
* C Compiler-- Shpinx
Cross compile:
* Visual C++ 6, C++ environments from Visual Studio
-.NET / 2005
* GCC, G++compilers
* Borland C++Compiler
* Pascal Pro Compiler
* Free Pascal Compiler
* Borland Delphi7 Compiler
• OpenWatcom Compiler
A detailed article on supported compilers and their
-configuration is here: http://kolibri-n.org/inf/hll/hll.
If it works in
-KolibriOS Wi-Fi ?
Unfortunately, there are no drivers or subsystems yet.
-If you want to develop a subsystem and driver(a) WiFi - email us at forum or group. To
-develop a good knowledge of Assembly. You can sponsor the development,
-the benefit have the means.
When will a
-normal browser?
The browser is a very complex program. Now partially
-ported, there is a simple text browser. However, now the development is pushed
-to the back burner.
I have an idea, let me write it to you, and
-you realize!
Most often these ideas are of little use. The fact is
-that every person already involved in the project, too, has a lot of unrealized
-ideas, sometimes more valuable than beginners, due to the fact that
-participants are better versed in the system, its capabilities and limitations.
-The problem is either motivation or lack of time. Please keep this in mind when
-coming to the project and do not demand anything from strangers. Participate as
-an observer and commentator and over time you will learn how to generate good
-ideas. Unfortunately, even a cool idea does not guarantee its early
-implementation, because the most reliable chance to realize the idea - to
-implement itself.
Why KolibriOS still no XXX?
Because this XXX has not yet been
-done.
See previous answer.
Can I rewrite
-the OS for the ARM platform?
Natively, this is not possible, because the
-Hummingbird OS is written in x86 assembler, thus maximally optimized for
-processors of this architecture. On mobile devices ARM architecture is much
-different from x86, which makes porting impossible. KolibriOS designed for the PC, love it for what it is.
Thank you for reading this text
Wrote Leency, translated,
-edited and supplemented Alex2003.
Hardware
-support
KolibriOS partially supports the hardware of the PC. Some hardware is supported
-by the OS kernel, some by dynamically loaded drivers.
Graphics
- Standard |
-
- Support in KolibriOS |
-
- VESA |
-
- Supported by the OS kernel |
-
- VGA |
-
- Manufacturer |
-
- The presence of a special driver |
-
- ATI (AMD) |
-
- Yes, ATIKMS |
-
- NVIDIA |
-
- No |
-
- VIA |
-
- No |
-
- Intel |
-
- Yes, two drivers: i915; VIDINTEL |
-
VIDINTEL starts automatically,
-the function is to set the optimal screen resolution for laptops.
The ATIKMS and i915 drivers are ported from Linux.
-They provide support for hardware mouse cursor, change of modes through the
-utility VMODE and acceleration of 2D graphics. Without these drivers, you can
-only select the screen resolution at the boot time.
Audio
- Standard |
-
- Manufacturer |
-
- Chipset |
-
- Note |
-
- AC97 |
-
- Intel Corp. |
-
- ICH0 |
-
- The AC97 sound controller is supported by the appropriate device drivers.
- Because AC97 standardizes only the functions of the codec and AC-Link
- responsible for the interaction of the controller and the codec, for
- different controllers require different AC97 driver. |
-
- IHC1 |
- |||
- ICH2 |
- |||
- ICH3 |
- |||
- ICH4 |
- |||
- ICH5 |
- |||
- ICH6 |
- |||
- Nvidia |
-
- NForce |
- ||
- NForce2 |
- |||
- NForce3 |
- |||
- NForce4 |
- |||
- NForce500 |
- |||
- Silicon Integrated Systems |
-
- SIS7012 |
- ||
- AMD |
-
- CS5536 |
- ||
- ForteMedia |
-
- FM801 |
- ||
- VIA Technologies |
-
- VT8231 |
- ||
- VT8233 |
- |||
- VT8233C |
- |||
- VT8235 |
- |||
- VT8237 |
- |||
- VT8237R |
- |||
- VT8237R Plus |
- |||
- Creative |
-
- EMU10K1X |
-
- Is not on the motherboard of the computer, and on a separate audio
- card, which is inserted into the PCI expansion slot. |
- |
- HDAudio |
-
- Work on the driver is currently underway. The driver works on most
- test systems (see the table below). |
- ||
- SB16 |
-
- Creative |
-
- SoundBlaster16 |
-
- Is not on the motherboard of the computer, and on a separate audio card,
- which is inserted into the expansion slot ISA. |
-
- SoundBlaster16 ASP |
- |||
- SoundBlaster16 PnP |
-
The list of supported cards HDAudio
- Controller |
-
- Codec |
-
- Support in KolibriOS |
-
- Test platform |
-
- ATI SB600 |
-
- Realtek ALC663 |
-
- Works |
-
- ASUS
- M51Tr |
-
- Realtek ALC883 |
-
- ASUS M4A78-EH |
- ||
- Realtek ALC887 |
-
- ASUS M4A78-VM |
- ||
- GA-MA78LMT-S2 |
- |||
- Realtek ALC888 |
-
- Status unknown |
- ||
- IDT 92HD81B1X |
- |||
- VIA VT1708B_1 |
- |||
- NVidia MCP55 |
-
- Status unknown |
- ||
- NVidia MCP73 |
-
- ALC888 |
-
- Packard Bell |
- |
- NVidia MCP78_1 |
-
- Realtek ALC662 |
-
- Status unknown |
- |
- VIA VT1708B_1 |
- |||
- NVidia MCP78 |
-
- Digital audio outputs only |
- ||
- Intel 82801F |
-
- Realtek ALC662 |
-
- Works |
-
- ASUS
- eeePC 701 |
-
- ASUS eeePC 900 |
- |||
- Sigmatel STAC9221 |
-
- VirtualBox 4.0 |
- ||
- Qumranet HDA-DUPLEX |
-
- Qemu 0.14 |
- ||
- Intel 82801G |
-
- Realtek ALC269 |
-
- Status unknown |
- |
- Realtek ALC272 |
-
- Acer Aspire
- 250D |
- ||
- Realtek ALC662 |
-
- Zotac NM10-ITX |
- ||
- Status unknown |
- |||
- Realtek ALC882 |
-
- ASUS P5LD2 |
- ||
- Realtek ALC883 |
-
- ASUS P5GZ-MX |
- ||
- ASUS P5L-VM 1394 |
- |||
- G31M-ES2C |
- |||
- Analog Devices
- AD1986A |
-
- Status unknown |
- ||
- Analog Devices
- AD1986HD |
-
- Status unknown |
-
- HP
- Compaq nc6320 |
- |
- Conexant CX20549 |
-
- HP 530 KP464AA |
- ||
- SigmaTel STAC9221_A2 |
-
- Status unknown |
- ||
- Intel 82801H |
-
- Realtek ALC268 |
-
- Works |
-
- eMachines |
-
- Realtek ALC888 |
-
- Commell LP-170C Pico-ITX |
- ||
- Realtek ALC889 |
-
- Status unknown |
-
- Status unknown |
- |
- Conexant CX20561 |
- |||
- Intel 82801I |
-
- Realtek ALC262 |
-
- Works |
-
- Toshiba Portege
- R600 |
-
- Realtek ALC883 |
-
- Status unknown |
- ||
- Silicon Image
- SI1392 |
-
- Digital audio outputs only |
- ||
- Realtek ALC888 |
-
- Works |
- ||
- Analog Devices
- AD1984A |
-
- HP EliteBook
- 8730w |
- ||
- Analog Devices
- AD198B |
-
- Silent playback |
-
- ASUS
- P5K-E |
- |
- IDT
- 92HD75B3 |
-
- Status unknown |
-
- Status unknown |
- |
- VIA
- VT17085_0 |
-
- Works |
- ||
- Intel CPT |
-
- Realtek ALC889 |
-
- H67 |
- |
- IDT 92HD81B1X |
-
- HP Pavilion
- dv6 |
- ||
- IDT 92HD87B1_3 |
-
- HP ProBook
- 4530s |
- ||
- Intel PPT1 |
-
- IDT
- 92HD87B2_4 |
-
- HP ProBook
- 4540s |
- |
- Intel PCH |
-
- Realtek ALC269 |
-
- Dell Inspiron
- N7010 (Intel i5) |
- |
- Realtek ALC272 |
-
- Acer Aspire
- 5742Z |
- ||
- Realtek ALC888 |
-
- Acer Aspire
- 4740G |
- ||
- IDT 92HD81B1X |
-
- Dell Vostro3300 |
- ||
- RDC
- R3010 |
-
- Realtek ALC262 |
-
- eBox-3300MX
- (Vortex86MX) |
- |
- Edubook (Vortex86MX) |
-
Audio output to headphones is supported.
Storage device
IDE (ATA)
FDD, SDD/HDD, CD/DVD - Supported by the OS kernel
SATA
CD/DVD - Supported kernel read in IDE mode (ATAPI in
-PIO mode)
HDD - The kernel supports reading and writing in IDE
-mode. Supported by the driver reading in AHCI mode (SYSPANEL > DriverInstall)
In some cases, the system can work with SATA and USB
-drives through the Fn13h BIOS in virtual V86 mode (read / write speed is low)
USB
- Standard |
-
- Support in KolibriOS |
-
- UHCI |
-
- Yes |
-
- OHCI |
-
- Yes |
-
- EHCI |
-
- Yes |
-
- XHCI |
-
- No |
-
There is also support for USB hubs.
Network
Wi-Fi: Not support
Ethernet: Supported by the OS kernel (drivers in the
-kernel). Active work on code removal in dynamically loaded drivers is carried
-out.
Supported
-network cards
- Driver |
-
- Supported network cards |
-
- 3c59x |
-
- 3Com Fast EtherLink
- (3c59x/450/555/556/575/900/905/980) |
-
- dec21x4x * |
-
- Accton en 1207 BTX, DEC 21140,…, VirtualPC |
-
- forcedeth* |
-
- nVidia nForce chipset integrated ethernet |
-
- i8255x |
-
- Intel eepro / 100 (i8255x, i82562, i82801,..),
- QEMU |
-
- i8254x |
-
- Intel PRO/1000 (i8254x), Virtualbox,
- BOCHS, QEMU |
-
- mtd80x |
-
- Myson MTD803 |
-
- pcnet32
- |
-
- AMD PCnet (79c970, 79c978,
- 79c973,..), Virtualbox, QEMU |
-
- r6040 |
-
- RDC R6040 Semiconductors |
-
- rhine |
-
- VIA
- Rhine II and III |
-
- rtl8029
- |
-
- Realtek 8029/8019, ne2000 PCI, BOCHS, QEMU |
-
- rtl8139 |
-
- Realtek 8139 and clones, QEMU |
-
- rtl8169 |
-
- Realtek 8110/8111/8167/8168/8169 |
-
- sis 900 |
-
- SiS 900, 7016 |
-
* - in development
Input and
-output devices
COM-mouse: supported by the driver, see SYSPANEL > AUTORUN.
The built-in
-speaker: supported by the OS kernel and is disabled by
-default. Included in the program SYSPANEL > SETUP.
HDMI: limited support, see the documentation for the ATIKMS and i915 video
-drivers.
Touchpad: supported by the OS kernel in mouse emulation mode (PS/2).
Microphone: not supported.
Digital camera: not supported.
Printer and
-scanner: not supported.
Joystick,
-steering wheel and gamepad: not supported.
Links
More complete information:
http://wiki.kolibrios.org/wiki/Hardware_Support - English
http://wiki.kolibrios.org/index.php?title=Hardware_Support&setlang=ru – Russian
Thanks for reading.
Compiled by Leency, edited,
-supplemented and translated by Alex2003.
KolibriOS help system
Common theme
Development
Using the debugger
The FASM manual
Using libraries
INI (Settings)
The file open dialog opendialog
See also
The project's wiki: http://wiki.kolibrios.org/wiki/Main_Page
Articles: http://kolibri-n.org/articles
Forum: http://board.kolibrios.org/index.php
Thanks for reading.
Compiled by Leency, edited, supplemented and
-translated by Alex2003.
KolibriOS system functions
SYSTEM FEATURES OPERATING SYSTEM Kolibri
-0.7.7.0+
The function number is placed in the eax register.
The system function is called with the command "int 0x40".
All registers except those explicitly specified in the
-return value, including the register of flags of eflags
-are saved.
Function 0 - define and draw a
-window
Function 1 - put a dot in the
-window
Function 2 - get the code of the
-pressed key
Function 4 - draw a line of text
Function 7 - display image in the
-window
Function 8 - define / delete
-button
Function 9 - information about
-the execution flow
Function 11 - check if there is
-an event, without waiting
Function 12 - start / finish
-window redrawing
Function 13 - draw a rectangle
-in the window
Function 14 - get screen sizes
Function 15 and its
-sub-functions (1-9)
Function 16 - save ram disk to
-floppy disk
Function 17 - get the code of
-the pressed button
Function 18 and its
-sub-functions (1-11, 13-25)
Function 20 - MIDI interface
Function 21 and its sub-functions (1, 2, 5, 11, 12)
Function 22 - set system date / time
Function 23 - wait for events with timeout
Function 24 and its sub-functions (4, 5)
Function 25 - record area on the background layer
Function 26 and its sub-functions (1, 2, 5, 9-12)
Function 29 - get system date
Function 30 - working with the current folder
Function 34 - find out who owns the point of the
-screen
Function 35 - read the color of the dot on the screen
Function 36 - read the screen area
Function 37 - working with the mouse
Function 38 - draw a segment
Function 39 and its sub-function (1,2,4)
Function 40 - set mask for expected events
Function 43 - input / output to port
Function 46 - reserve/release a group of I/O ports
Function 47 - display the number in the window
Function 48 and its sub-functions (0-13)
Function 49 - Advanced Power Management (APM)
Function 50 - setting the shape of the window
Function 51 - create stream
Function 54 and its sub-functions (0-4)
Function 55 and its sub-function 55
Function 57 - PCI BIOS
Function 60 - Inter Process Communication (IPC)
Function 61 - get parameters for direct access to the
-chart
Function 62 and its sub-functions (0-2, 4-6, 8-10)
Function 63 - work with the debug Board
Function 64 - redistribute application memory
Function 65 - display the image with the palette in
-the window
Function 66 - working with the keyboard
Function 67 - change window position/size
Function 68 and its sub-functions (0-4, 11-14, 16-28)
Function 69 – debugging
Function 69 and its sub-functions (0-9)
Function 70 - working with long file system names
Function 70 and its sub-function (0-10)
Function 71 - set the title bar of the window
Function 72 - send message to window
Function 73 - blit bitmap
Function 74 and its sub-functions (-1, 0-4, 6-10)
Function 75 and its sub-function (0-10)
Function 76 - Network options and statistics
Function 77 and its sub-function (0-3)
Function -1 - terminate the execution of the
-thread/process
Function 80 - working with the file system with the
-encoding
Event list
File system error codes
The following error codes are possible when starting
-the program:
- 30 |
-
- 0x1E |
-
- not enough memory |
-
- 31 |
-
- 0x1F |
-
- file is not executable |
-
- 32 |
-
- 0x20 |
-
- too many processes |
-
Thanks for reading.
Compiled by Leency, edited, supplemented and
-translated by Alex2003.
List of hotkeys used in the system
1) Ctrl + Alt
-+ Del running the CPU application (process Manager), this is the only
-combination supported at the kernel level, everything else
-is implemented through the application @TASKBAR.
2) Ctrl +
-Shift - switch keyboard layout.
3) Win - start
-the MENU application.
4) Alt + Ctrl
-+ F12 - launch the END application.
5) Alt + F4 -
-end the active application.
6) Alt + Tab -
-switch to the next window (in the window stack)
7) Alt + Shift
-+ Tab - switch to the previous window (in the window stack)
8) Alt + Shift
-+ NumLock - run application MOUSEMUL emulated if you
-have enabled NumLock mouse keys numpad
9) Alt + 1...7
-- quickly switch to the selected keyboard layout (even if there is no Ctrl +
-Shift)
10) Win + D -
-minimize/maximize all Windows (desktop cleanup)
11) Win + R -
-run application
12) Alt + Ctrl
-+ ArrowLeft - to scroll back the taskbar list
13) Alt + Ctrl
-+ ArrowRight - to scroll the taskbar list forward
14) Ctrl + PrintScreen - launch SCRSHOOT application. Immediately a
-screenshot is taken and the user is prompted to specify, using OpenDialog, where to save the picture in BMP format.
Remark: Numbering by time of appearance in the system
Function 0 -
-define and draw a window
Defines the application window. Draws a window frame, a working title and area. For Windows
-with skin, defines standard close buttons and minimizations.
Characteristic:
* eax = 0-function number
* ebx = [coordinate on axis X]*65536 + [size on axis X]
* ECx
-= [coordinate on axis y]*65536 + [size on axis g]
* edx = 0xxyrrggbb, where:
* Y = window style:
* G=1 only to define the
-scope window, nothing to draw
* Y=3 - window with skin
* Y=4 - window with skin of
-fixed sizes
* G=0.2 these styles are
-obsolete and should not be used more than, they are left for compatibility with
-older applications
* other
-possible values (5 to 15) are reserved, calling a function with such Y is
-ignored
* RR, GG, BB = red, green,
-blue, respectively components of the window workspace color (ignored for style
-y=1)
* X = DCBA (bits)
* A = 1-the window has a
-title
* B = 1-coordinates of all
-graphic primitives are set relative to the client area of the window
* C = 1-do not paint the
-workspace when drawing a window
* D = 0 - normal working
-area fill, 1-gradient fill
The following options are for
-Windows of type I and type II and ignored for styles y=1,3:
* esi = 0xXYRRGGBB-header color
* RR, GG, BB define the color
-itself
* R=0-normal window and
-y=1-non-movable window (works for all window styles)
* X defines a gradient of header:
-X=0 - there is no gradient, X=8 - normal gradient, for Windows of type II x=4 -
-negative gradient
* other
-values of x and G are reserved
* EDI = address of header line
-for styles y=3,4 (see also function 71.1)
Returned value:
* function
-does not return a value
Comments:
* The position and sizes of Windows
-installed on the first call this function is ignored in subsequent; to change
-use the position and / or size of an already created window 67th function.
* For Windows styles y=3,4
-caption with (A=1) header line set when this function is first called and
-ignored when subsequent (more precisely, ignored after the call sub-function 2
-function 12 - end of redraw); to change the title bar of an already created
-window, use the subfunction 1 of function 71.
* If you use the appropriate
-window styles, the position and / or the window size can be changed by the
-user. The current position and dimensions can be obtained by calling function
-9.
* The window should fit on the
-screen. If coordinates provided and the dimensions do not satisfy this
-condition, then the corresponding the coordinate (or possibly both) is
-considered zero, and if it is does not help, then the appropriate size (or
-maybe both) in the size of the screen. XPOS denote Next,Ypos,xsize,ysize - values passed ebx,
-ecx. The coordinates relative to the upper left Are
-given the angle of the window, which is thus defined as (0,0),
-the coordinates the essence of the lower right corner (xsize,ysize).
* Window dimensions are
-understood in terms of the coordinates of the lower right corner. The same
-applies to all other functions. This means that the actual dimensions are 1
-pixel larger.
* View window style g=1:
* fully
-defined by the application
* View window with skin R=3,4:
* draw external frame of width
-1 pixel external colour " of
-the skin
* draw intermediate frame of
-width 3 pixel frame color " of the skin
* draw internal frame of width
-1 pixel inner color " of the skin
* the
-title is drawn (by the pictures from the skin) in the rectangle (0,0)- (xsize, _skinh-1)
* if ysize>=26, the working area of the window is colored - a
-rectangle with upper-left corner (5,_skinh) and the bottom right (xsize-5,
-ysize-5) - the color specified in the edx register
-(taking into account the gradient)
* define two standard buttons:
-close and minimize (see function 8)
* if
-A=1 and in EDI (non-zero) a pointer to the title bar, in that it is displayed
-in the title of the place determined by the skin
* The value of the _skinh variable is available as a result of
-a call sub-functions 4 functions 48
Registers for Constant :
eax - SF_CREATE_WINDOW (0)
Function 1 -
-put a dot in the window
Characteristic:
* eax = 1 - the number of function
* ebx = x-coordinate (relative to the window)
* ecx = y-coordinate (relative to the window)
* edx = 0x00RRGGBB - color of a point
* edx
-= 0x01xxxxxx - to invert the color of the point (the lower 24 bits are ignored)
Returned value:
* function
-does not return a value
Constants for registers:
eax - SF_PUT_PIXEL (1)
Function 10 -
-wait for an event
If the message queue is empty, then it waits for a message in the queue.
-In this state, the thread does not receive CPU time. Then
-reads the message from the queue.
Options:
* eax =
-10 - function number
Return value:
* eax =
-event (see event list)
Remarks:
* Only those events
-that are included in the mask set by function 40 are taken into account. By
-default, these are redrawing events, pressing keys and buttons.
* To check if there
-is a message in the queue, use function 11. To wait no more than a certain
-time, use function 23.
Constants for registers:
eax -
-SF_WAIT_EVENT (10)
Function 11 -
-check if there is an event, without waiting
If there is an event in the message queue, it reads and returns it. If
-the queue is empty, returns zero.
Options:
* eax =
-11 - function number
Return value:
* eax = 0
-- the message queue is empty
* otherwise eax
-= event (see the list of events)
Remarks:
* Only those events
-that are included in the mask set by function 40 are taken into account. By
-default, these are redrawing events, pressing keys and buttons.
* To wait for an
-event in the queue, use function 10. To wait no more than a certain time, use
-function 23.
Constants for registers:
eax -
-SF_CHECK_EVENT (11)
Function 12 -
-start / finish window redrawing
Subfunction 1 - start redrawing the window
Options:
* eax =
-12 - function number
* ebx = 1
-- number of subfunction
Return value:
* function does not return value
Subfunction 2 - finish window redrawing
Options:
* eax =
-12 - function number
* ebx = 2
-- subfunction number
Return value:
* function does not return value
Remarks:
* The function of the start of redrawing removes all 8
-buttons defined by the function, they should be redefined.
Constants for registers:
eax -
-SF_REDRAW (12)
ebx -
-SSF_BEGIN_DRAW (1), SSF_END_DRAW (2)
Function 13 -
-draw a rectangle in the window
Options:
* eax =
-13 - function number
* ebx =
-[x axis coordinate] * 65536 + [x axis size]
* ecx =
-[y-coordinate] * 65536 + [y-axis size]
* edx =
-0xRRGGBB or 0x80RRGGBB color for gradient fill
Return value:
* function does not return value
Remarks:
* Coordinates are coordinates of the upper left corner of
-the rectangle relative to the window.
Constants for registers:
eax -
-SF_DRAW_RECT (13)
Function 14 -
-get screen sizes
Options:
* eax =
-14 - function number
Return value:
* eax = [xsize] * 65536 + [ysize], where
* xsize =
-x-coordinate of the lower right corner of the screen = horizontal size - 1
* ysize =
-y-coordinate of the lower right corner of the screen = vertical size - 1
Remarks:
* See also subfunction 5 function 48 - get the dimensions of the working area of
-the screen.
Constants for registers:
eax -
-SF_GET_SCREEN_SIZE (14)
Function 15
-and its sub-functions (1-9)
Subfunction 1 - set the size of the background image
Options:
* eax =
-15 - function number
* ebx = 1
-- number of subfunction
* ecx =
-image width
* edx =
-image height
Return value:
* function does not return value
Remarks:
* A function call is required before calling subfunctions 2 and 5.
* To update the screen (after completing a series of
-commands working with the background), call the subfunction
-3 background redrawing.
* There is a pair function to get the size of the background
-image - subfunction 1
-function 39
Constants for registers:
eax -
-SF_BACKGROUND_SET (15)
ebx -
-SSF_SIZE_BG (1)
Subfunction 2 - put a dot on the background image
Options:
* eax =
-15 - function number
* ebx = 2
-- subfunction number
* ecx =
-offset
* edx =
-point color 0xRRGGBB
Return value:
* function does not return value
Remarks:
* The offset for a point with coordinates (x, y) is
-calculated as (x + y * xsize) * 3.
* If the specified offset exceeds the size set by subfunction 1, the call is ignored.
* To update the screen (after completing a series of
-commands working with the background), call the subfunction
-3 background redrawing.
* There is a pair function of receiving a point from the
-background image - subfunction 2 of function 39.
Constants for registers:
eax -
-SF_BACKGROUND_SET (15)
ebx -
-SSF_PIXEL_BG (2)
Subfunction 3 - redraw the background
Options:
* eax =
-15 - function number
* ebx = 3
-- subfunction number
Return value:
* function does not return value
Constants for registers:
eax -
-SF_BACKGROUND_SET (15)
ebx -
-SSF_REDRAW_BG (3)
Subfunction 4 - set the background drawing mode
Options:
* eax =
-15 - function number
* ebx = 4
-- subfunction number
* ecx =
-draw mode:
* 1 = tile
* 2 = stretch
Return value:
* function does not return value
Remarks:
* To update the screen (after completing a series of
-commands working with the background), call the subfunction
-3 background redrawing.
* There is a pair command to get the background rendering
-mode - subfunction 4 functions 39.
Constants for registers:
eax -
-SF_BACKGROUND_SET (15)
ebx -
-SSF_MODE_BG (4)
Subfunction 5 - place a block of pixels on the background
Options:
* eax =
-15 - function number
* ebx = 5
-- subfunction number
* ecx =
-pointer to BBGGRRBBGGRR data ...
* edx =
-offset in the background image data
* esi =
-data size in bytes = 3 * number of pixels
Return value:
* function does not return value
Remarks:
* Check the correctness of the offset and size is not
-performed.
* The color of each pixel is stored as a 3-byte BBGGRR
-value.
* Pixels of the background image are recorded sequentially
-from left to right, top to bottom.
* Pixel offset with coordinates (x, y) is (x + y * xsize) * 3.
* To update the screen (after completing a series of
-commands working with the background), call the subfunction
-3 background redrawing.
Constants for registers:
eax -
-SF_BACKGROUND_SET (15)
ebx -
-SSF_IMAGE_BG (5)
Subfunction 6 - project the background data onto the process address space
Options:
* eax =
-15 - function number
* ebx = 6
-- subfunction number
Return value:
* eax =
-pointer to background data, 0 on error
Remarks:
* The projected data is readable and writeable.
* The size of the background data is 3 * xsize
-* ysize. Changing the size of the background is
-blocked while working with the projected data.
* The color of each pixel is stored as a 3-byte BBGGRR
-value.
* Pixels of the background image are recorded sequentially
-from left to right, top to bottom.
Constants for registers:
eax -
-SF_BACKGROUND_SET (15)
ebx -
-SSF_MAP_BG (6)
Subfunction 7 - close the projection of the background data on the process address
-space
Options:
* eax =
-15 - function number
* ebx = 7
-- subfunction number
* ecx =
-pointer to background data
Return value:
* eax = 1
-on success, 0 on error
Constants for registers:
eax -
-SF_BACKGROUND_SET (15)
ebx -
-SSF_UNMAP_BG (7)
Subfunction 8 - get the coordinates of the last background drawing
Options:
* eax =
-15 - function number
* ebx = 8
-- number of subfunction
Return value:
* eax =
-[left] * 65536 + [right]
* ebx =
-[top] * 65536 + [bottom]
Remarks:
* (left, top) - coordinates of the upper left corner,
-(right, bottom) - coordinates of the lower right.
* To get more reliable information, you must call the
-function immediately after receiving the event: 5 = desktop background
-redrawing has completed
Constants for registers:
eax -
-SF_BACKGROUND_SET (15)
ebx -
-SSF_LAST_DRAW (8)
Subfunction 9 - redraw the rectangular part of the background
Options:
* eax =
-15 - function number
* ebx = 9
-- subfunction number
* ecx =
-[left] * 65536 + [right]
* edx =
-[top] * 65536 + [bottom]
Return value:
* function does not return value
Remarks:
* (left, top) - coordinates of the upper left corner,
-(right, bottom) - coordinates of the lower right.
* If the parameters are set incorrectly - the background
-does not redraw.
Constants for registers:
eax - SF_BACK
GROUND_SET (15)
ebx - SSF_REDRAW_RECT (9)
Function 16 - save
-ram disk to floppy disk
Options:
* eax =
-16 - function number
* ebx = 1
-or ebx = 2 - on which floppy disk to save
Return value:
* eax = 0
-- successful
* eax = 1
-- error
Constants for registers:
eax -
-SF_RD_TO_FLOPPY (16)
Function 17 -
-get the code of the pressed button
Takes the code of the pressed button from the buffer.
Options:
* eax =
-17 - function number
Return value:
* if the buffer is empty, returns eax = 1
* if the buffer is not empty:
* the upper 24 bits of the eax
-contain the identifier of the button (in particular, in ah it turns out to be
-the low byte of the identifier; if all the buttons have an identifier less than
-256, then ah is enough to distinguish)
* al = 0 - the button
-was pressed with the left mouse button
* al = bit
-corresponding to the mouse button, if not the left
Remarks:
* "Buffer"
-stores only one button, when you press a new button, information about the old
-one is lost.
* When this function
-is called, an “buffer empty” response is returned by
-an application with an inactive window.
* The return value al
-corresponds to the state of the mouse buttons in the format of subfunction 2 of function 37 at the moment the button is
-pressed, except for the low bit (corresponding to the left mouse button), which
-is reset.
Constants for registers:
eax -
-SF_GET_BUTTON (17)
Function 18
-and its sub-functions (1-11, 13-25)
Subfunction 1 - make the lowest flow window
Options:
* eax =
-18 - function number
* ebx = 1
-- number of subfunction
* ecx =
-stream slot number
Return value:
* function does not return value
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_UNFOCUS_WINDOW (1)
Subfunction 2 - complete process / thread by slot
Options:
* eax =
-18 - function number
* ebx = 2
-- subfunction number
* ecx =
-process / thread slot number
Return value:
* function does not return value
Remarks:
* You cannot
-terminate the OS / IDLE OS thread (slot number 1), you
-can terminate any normal thread process.
* See also subfunction 18 - termination of a process / thread with a
-given identifier.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_TERMINATE_THREAD (2)
Subfunction 3 - make the specified stream window active
Options:
* eax =
-18 - function number
* ebx = 3
-- subfunction number
* ecx =
-stream slot number
Return value:
* function does not return value
Remarks:
* When specifying a
-correct, but non-existent slot, a window is activated.
* You can find out
-which window is active by calling subfunction 7.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_FOCUS_WINDOW (3)
Subfunction 4 - get the empty clock count per second
Under the empty cycles refers to the time at which the processor is idle
-while waiting for an interrupt (in the hlt
-instruction).
Options:
* eax =
-18 - function number
* ebx = 4
-- subfunction number
Return value:
* eax =
-empty clock count per second
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_GET_IDLE_COUNT (4)
Subfunction 5 - get the clock frequency
Options:
* eax =
-18 - function number
* ebx = 5
-- subfunction number
Return value:
* eax =
-clock frequency (modulo 2 ^ 32 clock cycles = 4 GHz)
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_GET_CPU_FREQUENCY (5)
Subfunction 6 - save ramdisk to a file on the hard disk
Options:
* eax =
-18 - function number
* ebx = 6
-- subfunction number
* ecx = pointer to a
-string with the full file name (for example, "/hd0/1/kolibri/kolibri.img")
Return value:
* eax = 0
-- successful
* otherwise eax
-= file system error code
Remarks:
* All folders in the
-specified path must exist, otherwise the value 5 will be returned, "file not found".
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_RD_TO_HDD (6)
Subfunction 7 - get the number of the active window
Options:
* eax =
-18 - function number
* ebx = 7
-- subfunction number
Return value:
* eax =
-number of the active window (the number of the stream slot, the window of which
actively)
Remarks:
* The active window
-is at the top of the window stack and receives messages about all input from
-the keyboard.
* You can make the
-window active by calling subfunction 3.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_GET_ACTIVE_WINDOW (7)
Subfunction 8 - disable / enable speaker sound
When sound is muted, calls to subfunction 55
-to function 55 are ignored.
When on, it is sent to the built-in speaker.
Nested
-function 1 - get state
Options:
* eax =
-18 - function number
* ebx = 8
-- number of subfunction
* ecx = 1
-- number of sub-function
Return value:
* eax = 0
-- the sound of the speaker is allowed; 1 - not allowed
Nested
-function 2 - switch state
Toggles enable / disable states.
Options:
* eax =
-18 - function number
* ebx = 8
-- number of subfunction
* ecx = 2
-- the number of the sub-function
Return value:
* function does not return value
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_SPEAKER (8)
ecx -
-SSSF_GET_STATE (1), SSSF_TOGGLE (2)
Subfunction 9 - system shutdown with a parameter
Options:
* eax =
-18 - function number
* ebx = 9
-- subfunction number
* ecx =
-parameter:
* 2 = turn off computer
* 3 = restart computer
* 4 = restart kernel from kernel.mnt
-file on ramdisk
Return value:
* if ecx
-is incorrect, the registers do not change (ie, eax = 18)
* a correct call always returns a
-sign of success eax = 0
Remarks:
* Do not rely on the
-return value for an incorrect call, it may change in
-future versions of the kernel.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_SHUTDOWN (9)
Subfunction 10 - minimize active window
Minimizes the active window.
Options:
* eax =
-18 - function number
* ebx =
-10 - subfunction number
Return value:
* function does not return value
Remarks:
* The minimized
-window in terms of function 9 saves position and size.
* Restoration of the
-application window occurs when activating the subfunction
-3.
* Usually there is no
-need to explicitly minimize / maximize your window: the system minimizes the
-window when you press the minimization button (which is automatically
-determined for windows with a skin by function 0, for windows without a skin it
-can be defined by function 8), recovery by the @taskbar application.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_MINIMIZE_WINDOW (10)
Subfunction 11 - get information about the disk subsystem
Options:
* eax =
-18 - function number
* ebx =
-11 - subfunction number
* ecx =
-table type:
* 1 = short version, 16 bytes
* edx =
-pointer to buffer (in application) for a table
Return value:
* function does not return value
Table format: short version:
* +0: byte: information about floppy disk drives, AAAABBBB,
-where AAAA specifies the type of the first floppy disk drive, BBBB - the second
-one according to the following list:
* 0 = 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 are not
-used now).
For example, for a standard configuration of one 1.44 drive, there will
-be 40h here, and for the case of 1.2Mb for A: and 1.44Mb for B: the value is
-24h.
First IDE controller:
* +1: byte: information about hard drives and CD drives,
-AABBCCDD,
where AA corresponds to
-the controller IDE0, ..., DD - IDE3:
* 0 = no device
* 1 = hard disk
* 2 = CD drive
For example, in the case of HD on IDE0 and CD on
-IDE2 here it will be 48h.
* +2: 4 db: the number of
-partitions found on hard drives with
respectively IDE0, ...,
-IDE3.
Second IDE controller:
* +6: byte: information about hard drives and CD drives,
-AABBCCDD
where AA corresponds to
-the IDE4 controller, ..., DD - IDE7:
* 0 = no device
* 1 = hard disk
* 2 = CD drive
For example, in the case of HD on IDE4 and CD on
-IDE6 here it will be 48h.
* +7: 4 db: the number of
-partitions found on hard drives with
respectively IDE4, ...,
-IDE7.
Third IDE Controller:
* +11: byte: information about hard drives and CD drives,
-AABBCCDD
where AA corresponds to
-the IDE8 controller, ..., DD - IDE11:
* 0 = no device
* 1 = hard disk
* 2 = CD drive
For example, in the case of HD on IDE8 and CD on
-IDE10 here it will be 48h.
* +12: 4 db: the number of
-partitions found on hard drives with
respectively IDE8, ...,
-IDE11.
If there is no hard disk on IDEx, the
-corresponding byte is zero, and if there is, it shows the number of recognized
-partitions that may not be (if the media is not formatted or if the file system
-is not supported). In the current kernel version for hard disks, only FAT12 /
-16/32, NTFS, ext2 / 3/4 and XFS are supported.
Remarks:
* The table can be
-used to obtain information. More about the
-supported devices.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_INFO_DISC_SYS (11)
Subfunction 13 - get the kernel version
Options:
* eax =
-18 - function number
* ebx =
-13 - number of subfunction
* ecx =
-pointer to the buffer (at least 16 bytes) where the information will be placed
Return value:
* function does not return value
Buffer structure:
db a,
-b, c, d for version a.b.c.d
db 0:
-reserved
dd
-REV - number of the kernel svn revision
For Kolibri kernel 0.7.7.0+:
db
-0,7,0
db 0
dd
-1675
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_KERNEL_VERSION (13)
Subfunction 14 - wait for the start of the return stroke of the monitor sweep
Options:
* eax =
-18 - function number
* ebx =
-14 - number of subfunction
Return value:
* eax = 0
-as a sign of success
Remarks:
* The function is
-intended exclusively for active high-performance graphics applications; used
-for smooth graphics output.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_WAIT_RETRACE (14)
Subfunction 15 - place the mouse cursor in the center of the screen
Options:
* eax =
-18 - function number
* ebx =
-15 - subfunction number
Return value:
* eax = 0
-as a sign of success
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_CURSOR_CENTER (15)
Subfunction 16 - get the size of free RAM
Options:
* eax =
-18 - function number
* ebx =
-16 - number of subfunction
Return value:
* eax =
-free memory in kilobytes
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_GET_FREE_RAM (16)
Subfunction 17 - get the size of available RAM
Options:
* eax =
-18 - function number
* ebx =
-17 - subfunction number
Return value:
* eax =
-total amount of available memory in kilobytes
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_GET_TOTAL_RAM (17)
Subfunction 18 - terminate the process / thread by identifier
Options:
* eax =
-18 - function number
* ebx =
-18 - subfunction number
* ecx =
-process / thread id (PID / TID)
Return value:
* eax =
-0 - successful
* eax =
--1 - error (process not found or is system)
Remarks:
* You cannot
-terminate the OS / IDLE OS thread (slot number 1), you
-can terminate any normal thread / process.
* See also subfunction 2 - completion of a process / thread at a given
-slot.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_TERMINATE_THREAD_ID (18)
Subfunction 19 - get / set mouse settings
Nested subfunction 0 - get mouse speed
Options:
* eax =
-18 - function number
* ebx =
-19 - subfunction number
* ecx = 0
-- number of sub-function
Return value:
* eax =
-current speed divider
Nested subfunction 1 - set the speed of the mouse
Options:
* eax =
-18 - function number
* ebx =
-19 - subfunction number
* ecx = 1
-- number of sub-function
* edx =
-new speed divider value
Return value:
* function does not return value
Note: recommended speed divider =
-4
Nested subfunction 2 - get mouse sensitivity
Options:
* eax =
-18 - function number
* ebx =
-19 - subfunction number
* ecx = 2
-- the number of the sub-function
Return value:
* eax =
-current sensitivity coefficient
Nested subfunction 3 - set mouse sensitivity
Options:
* eax =
-18 - function number
* ebx =
-19 - subfunction number
* ecx = 3
-- number of sub-function
* edx =
-new sensitivity value
Return value:
* function does not return value
Note: recommended sensitivity
-coefficient = 3
Nested subfunction 4 - set the position of the mouse cursor
Options:
* eax =
-18 - function number
* ebx =
-19 - subfunction number
* ecx = 4
-- number of sub-function
* edx =
-[x-coordinate] * 65536 + [y-coordinate]
Return value:
* function does not return value
Nested subfunction 5 - simulate mouse state
Options:
* eax =
-18 - function number
* ebx =
-19 - subfunction number
* ecx = 5
-- number of sub-function
* edx =
-information about the emulated state of the mouse buttons: (corresponds to the
-return value of the sub-function 2 functions 37)
* bit 0 set = left button pressed
* bit 1 set = right button pressed
* bit 2 set = middle button pressed
* bit 3 set = 4th button pressed
* bit 4 set = 5th button pressed
Return value:
* function does not return value
Nested subfunction 6 - get double click delay
Options:
* eax =
-18 - function number
* ebx =
-19 - subfunction number
* ecx = 6
-- number of the sub-function
Return value:
* eax =
-current double click delay (100 = second)
Nested subfunction 7 - set double click delay
Options:
* eax =
-18 - function number
* ebx =
-19 - subfunction number
* ecx = 7
-- number of sub-function
* dl = double click delay value
-(100 = second)
Return value:
* function does not return value
Note: mouse settings can be
-adjusted in the mouse_cfg application.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_MOUSE_SETTINGS (19)
ecx -
-SSSF_GET_SPEED (0), SSSF_SET_SPEED (1), SSSF_GET_SPEEDUP (2),
SSSF_SET_SPEEDUP (3), SSSF_SET_POS (4),
-SSSF_SET_BUTTON (5),
SSSF_GET_DOUBLE_CLICK_DELAY (6),
-SSSF_SET_DOUBLE_CLICK_DELAY (7)
Subfunction 20 - get information about RAM
Options:
* eax =
-18 - function number
* ebx =
-20 - subfunction number
* ecx =
-pointer to buffer for information (36 bytes)
Return value:
* eax =
-total amount of available RAM in bytes or -1 in case of error
* the buffer pointed to by ecx contains the following information:
* + 0: dword: total
-size of available RAM in pages
* +4: dword: size of
-free RAM in pages
* +8: dword: the
-number of page errors (#PF exceptions) in applications
* +12: dword: kernel
-heap size in bytes
* +16: dword: amount
-of free memory in the kernel heap in bytes
* +20: dword: total
-number of memory blocks in the kernel heap
* +24: dword: the
-number of free memory blocks in the kernel heap
* +28: dword: size of
-the largest free block in the kernel heap
(reserved)
* +32: dword: size of
-the largest allocated block in the kernel heap
(reserved)
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_GET_RAM_INFO (20)
Subfunction 21 - get the slot number of the process / thread by identifier
Options:
* eax =
-18 - function number
* ebx =
-21 - subfunction number
* ecx =
-process / thread id (PID / TID)
Return value:
* eax = 0
-- error (invalid identifier)
* otherwise eax
-= slot number
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_GET_THREAD_SLOT (21)
Subfunction 22 - operations with a window of another process / thread
Options:
* eax =
-18 - function number
* ebx =
-22 - subfunction number
* ecx =
-type of operation:
* 0 = minimizing window, stream specified by
-slot number
* 1 = minimizing window, stream specified by id
* 2 = restore window, stream specified by slot
-number
* 3 = restore window, stream specified by id
* edx =
-operation parameter (slot number or PID / TID)
Return value:
* eax = 0
-- successful
* eax =
--1 - error (invalid parameter)
Remarks:
* A thread can
-minimize its window by calling subfunction 10.
* Restoration of the
-window with simultaneous activation is carried out by subfunction
-3 (receiving the slot number).
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_FOREIGN_WINDOW (22)
ecx -
-SSSF_MINIMIZE (0), SSSF_MINIMIZE_ID (1), SSSF_RESTORE (2),
SSSF_RESTORE_ID (3)
Subfunction 23 - minimize all windows
Options:
* eax =
-18 - function number
* ebx =
-23 - subfunction number
Return value:
* eax = 0
-- all windows were minimized before the function was called
* eax = N
-- the number of windows minimized by the function
Remarks:
* Windows specials
-flows (the name begins with the @ symbol) are not
-minimized.
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_MINIMIZE_ALL (23)
Subfunction 24 - set rendering limits
Options:
* eax =
-18 - function number
* ebx =
-24 - subfunction number
* ecx =
-new size X
* edx =
-New Y Size
Return value:
* function does not return value
Remarks:
* The function does not change the physical size of the
-video mode. It is intended for non-standard displays that partially display an
-image.
* The sizes specified in the function must not exceed the
-size of the current video mode, otherwise the function
-will not change anything.
Constants for registers:
eax - SF_SYSTEM
-(18)
ebx -
-SSF_SET_SCREEN_LIMITS (24)
Subfunction 25 - window positioning relative to other windows
Nested subfunction 1 - get position
Options:
* eax =
-18 - function number
* ebx =
-25 - subfunction number
* ecx = 1
-- number of sub-function
* edx =
--1 (for the current window) or application PID
Return value:
* eax =
-one of the window position constants
Nested subfunction 2 - set position
Options:
* eax =
-18 - function number
* ebx =
-25 - subfunction number
* ecx = 2
-- the number of the sub-function
* edx =
--1 (for the current window) or application PID
* esi =
-new window position (one of the constants below)
Return value:
* eax = 0
-- failure
* eax = 1
-- success
Window constants relative to other windows:
ZPOS_DESKTOP = -2 - in the background
ZPOS_ALWAYS_BACK = -1 - behind all windows
ZPOS_NORMAL = 0 - normal
ZPOS_ALWAYS_TOP = 1 - on top of all windows
Constants for registers:
eax -
-SF_SYSTEM (18)
ebx -
-SSF_WINDOW_BEHAVIOR (25)
ecx -
-SSSF_GET_WB (1), SSSF_SET_WB (2)
Function 2 -
-get the code of the pressed key
Takes the code of the pressed key from the buffer.
Characteristic:
* eax = 2 - the number of function
Returned value:
* if
-the buffer is empty, eax=1 is returned
* if the buffer is not empty, al=0, ah=key
-code is returned, bits 16-23 contain the ASCII mode code of the pressed key, scancodes in the mode indicator bits set to zero. Bits
-23-31 are reset
* if there is a" hot
-key", it is returned al=2, ah=skankod of the
-pressed key (0 for control keys), the highest word of the eax
-register contains the state of the control keys when the hotkey is pressed
Comments:
-* There is a 120-byte system-wide keystroke buffer, organized as a
-queue.
-* There is another system-wide buffer of 120 "hot keys".
-* When this function is called by an application with an inactive window
-it is considered that a buffer of keys pressed is empty.
-* By default, this function returns ASCII codes; switch to scancode mode (and back) using function 66. However,
-hotkeys are always returned as scancodes.
-* Find out which key combinations correspond to which codes, you can,by running the keyascii and scancode
-applications.
-* The codes are returned directly by the keyboard and are fixed; ASCII
-codes are obtained using conversion tables, which can be set by sub-function 2
-functions 21 and read sub-function 2 functions 26.
-* As a result, ASCII codes take into account the current keyboard layout
-(rus / en) in contrast to the scancodes.
-* Information is received only about the hot keys that have been
-identified by this stream by sub-function 4 of function 66.
Constants for registers:
eax-SF_GET_KEY (2)
Function 20
-and its subfunctions - MIDI interface
Subfunction 1 - reset
Options:
* eax =
-20 - function number
* ebx = 1
-- number of subfunction
Subfunction 2 - output bytes
Options:
* eax = 20
-- function number
* ebx = 2
-- subfunction number
* cl = byte for output
Return value (the same for both subfunctions):
* eax = 0
-- successful
* eax = 1
-- the base port is not defined
Remarks:
The base port must
-first be defined by calling subfunction 1 of function
-21.
Constants for registers:
eax -
-SF_MIDI (20)
ebx -
-SSF_RESET (1), SSF_OUTPUT (2)
Function 21
-and its subfunctions (1,2,5,11,12)
Subfunction 1 - set the base port MPU MIDI
Options:
* eax =
-21 - function number
* ebx = 1
-- number of subfunction
* ecx =
-base port number
Return value:
* eax = 0
-- successful
* eax =
--1 - wrong port number
Remarks:
The port number must satisfy the conditions
-0x100 <= ecx <= 0xFFFF.
Base installation is
-necessary for the operation of function 20.
You can get the installed
-base port by calling subfunctions 1 functions 26.
Constants for registers:
eax -
-SF_SYSTEM_SET (21)
ebx -
-SSF_MPU_MIDI_BASE (1)
Subfunction 2 - set keyboard layout
The keyboard layout is used to convert scancodes
-coming from the keyboard into ASCII codes readable by function 2.
Options:
* eax =
-21 - function number
* ebx = 2
-- subfunction number
* ecx =
-which layout to install:
* 1 = normal
* 2 = layout when Shift is pressed
* 3 = Layout while pressing Alt
* edx =
-pointer to layout - 128 bytes table
Or:
* ecx = 9
* dx = country identifier (1 = eng, 2 = fi, 3 = ger, 4 = rus)
Return value:
* eax = 0
-- successful
* eax = 1
-- the parameter is set incorrectly
Remarks:
* If Alt is pressed,
-then the Alt; if Alt is not pressed, but Shift is pressed, then the layout with
-Shift is used; if Alt and Shift are not pressed, but Ctrl is pressed, then the
-normal layout is used, after which 0x60 is subtracted from the code; if none of
-the control keys are pressed, then the normal layout is used.
* You can get layouts
-and country identifiers using subfunction 2 of
-function 26.
* Country Identifier
-- a global system variable that is not used by the kernel itself; however, the
-@taskbar application displays an icon corresponding to the current country.
* The @taskbar application
-switches layouts on user request.
Constants for registers:
eax -
-SF_SYSTEM_SET (21)
ebx -
-SSF_KEYBOARD_LAYOUT (2)
Subfunction 5 - set the system language
Options:
* eax =
-21 - function number
* ebx = 5
-- subfunction number
* ecx = system
-language (1 = eng, 2 = fi, 3 = ger,
-4 = rus)
Return value:
* eax = 0
Remarks:
The system language
-is a global system variable that is not used by the kernel itself,
-however, the @taskbar application draws the corresponding icon.
Checks for correctness are not
-done, because the kernel does not use this variable.
You can get the system language
-by calling subfunction 5 of function 26.
Constants for registers:
eax -
-SF_SYSTEM_SET (21)
ebx -
-SSF_SYS_LANG (5)
Subfunction 11 - Allow / block low-level access to HD
Options:
* eax =
-21 - function number
* ebx =
-11 - number of subfunction
* ecx =
-0/1 - disable / allow
Return value:
* eax = 0
Remarks:
Used in
-LBA reading (subfunction 8 of function 58).
The current implementation
-uses only the low bit ecx.
You can get the current
-status by calling subfunction 11 of function 26.
Constants for registers:
eax -
-SF_SYSTEM_SET (21)
ebx -
-SSF_ACCESS_HD_LBA (11)
Subfunction 12 - Allow / block low-level access to PCI
Options:
* eax =
-21 - function number
* ebx =
-12 - subfunction number
* ecx =
-0/1 - disable / allow
Return value:
* eax =
-0
Remarks:
Used when working
-with the PCI bus (function 62).
The current
-implementation uses only the low bit ecx.
You can get the
-current status by calling subfunction 12 of function
-26.
Constants for registers:
eax -
-SF_SYSTEM_SET (21)
ebx - SSF_ACCESS_PCI (12)
Function 22 -
-set the system date / time
Options:
* eax = 22
-- function number
* ebx = 0
-- set the time
* ecx
-= 0x00SSMMHH - time in binary coded decimal code (BCD):
* HH = hour 00..23
* MM = minute 00..59
* SS = second 00..59
* ebx = 1
-- set the date
* ecx
-= 0x00DDMMYY - the date in the binary decimal code (BCD):
* DD = day 01..31
* MM = month 01..12
* YY = year 00..99
* ebx = 2
-- set the day of the week
* ecx
-= 1 for sunday, ..., 7 for saturday
* ebx = 3
-- set the alarm
* ecx
-= 0x00SSMMHH
Return value:
* eax = 0
-- successful
* eax = 1
-- the parameter is set incorrectly
* eax = 2
-- CMOS-batteries are out
Remarks:
The value of the
-installation of the day of the week seems doubtful, since it is not used very
-much (the day of the week can be calculated by date).
The alarm can be set
-to operate at a specified time every day. At the same time, it cannot be
-disabled by the existing system functions.
The alarm is
-triggered by the generation of IRQ8.
In fact, CMOS supports
-setting the value 0xFF as one of the parameters for an alarm and means that the
-corresponding parameter is ignored. But in the current implementation it will
-not work (return value 1).
Alarm clock is a
-global system resource; setting the alarm automatically cancels the previous
-setting. However, at the moment no program uses it.
Constants for registers:
eax -
-SF_SET_TIME_DATE (22)
Function 23 -
-wait for events with a timeout
If the message queue is empty, waiting for the message
-in the queue to appear, but not more than the specified time. Then reads the message from the queue.
Options:
* eax =
-23 - function number
* ebx =
-timeout (in hundredths of a second)
Return value:
* eax = 0
-- the message queue is empty
* otherwise eax
-= event (see the list of events)
Remarks:
Only those events
-that are included in the mask set by function 40 are taken into account. By
-default, these are redrawing events, pressing keys and buttons.
To check if there is
-a message in the queue, use function 11. To wait indefinitely, use function 10.
Passing ebx = 0 results in an instant return of eax
-= 0.
In the current
-implementation, an immediate return from the function with eax
-= 0 will occur if the addition of ebx with the current
-value of the time counter causes a 32-bit overflow.
Constants for registers:
eax -
-SF_WAIT_EVENT_TIMEOUT (23)
Function 24
-and its subfunctions (4,5)
Subfunction 4 - remove the disc tray
Options:
* eax =
-24 - function number
* ebx = 4
-- subfunction number
* ecx =
-CD / DVD number
from 0 = Primary Master
-to 3 = Secondary Slave for the first IDE counter.
from 4 = Primary Master
-to 7 = Secondary Slave for the second IDE counter.
from 8 = Primary Master
-to 11 = Secondary Slave for the third IDE counter.
Return value:
* function does not return value
Remarks:
This feature is
-supported for ATAPI devices only (CD and DVD).
When the tray is
-removed, the manual operation of the tray mechanism is unlocked.
When the tray is
-removed, the code clears the cache of the corresponding device.
An example of using a
-function is the CD_tray application.
Constants for registers:
eax -
-SF_CD (24)
ebx -
-SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
Subfunction 5 - load the disc tray
Options:
* eax =
-24 - function number
* ebx = 5
-- subfunction number
* ecx =
-CD / DVD number
from 0 = Primary Master
-to 3 = Secondary Slave for the first IDE counter.
from 4 = Primary Master
-to 7 = Secondary Slave for the second IDE counter.
from 8 = Primary Master
-to 11 = Secondary Slave for the third IDE counter.
Return value:
* function does not return value
Remarks:
This feature is
-supported for ATAPI devices only (CD and DVD).
An example of using a
-function is the CD_tray application.
Constants for registers:
eax -
-SF_CD (24)
ebx -
-SSF_EJECT_TRAY (4), SSF_INSERT_TRAY (5)
Function 25 -
-write area to background layer
Options:
* eax =
-25 - function number
* ebx = pointer
-to a preallocated memory area where the original
-image is placed in BBGGRRTTBBGGRRTT format ...
* ecx =
-[x-axis size] * 65536 + [y-axis size]
* edx =
-[x-coordinate] * 65536 + [y-coordinate]
Return value:
* function does not return value
Remarks:
The coordinates of
-the area are the coordinates of the upper left corner of the area relative to
-the screen.
Image size in bytes
-is 4 * xsize * ysize.
TT - byte
-transparency index, currently: from 1 to FF - opaque, from 0 - transparent.
The function places
-the image not on the background image (f.15), but directly in the LFB. Options
-f.15 for f. 25 does not make sense.
Constants for registers:
eax -
-SF_SCREEN_PUT_IMAGE (25)
Function 26
-and its subfunctions (1, 2, 5, 9-12)
Subfunction 1 - get the base port MPU MIDI
Options:
* eax =
-26 - function number
* ebx = 1
-- number of subfunction
Return value:
* eax =
-port number
Remarks:
You can set the base
-port by calling subfunction 1 of function 21.
Constants for registers:
eax -
-SF_SYSTEM_GET (26)
ebx -
-SSF_MPU_MIDI_BASE (1)
Subfunction 2 - get keyboard layout
The keyboard layout is used to convert scancodes
-coming from the keyboard into ASCII codes readable by function 2.
Options:
* eax =
-26 - function number
* ebx = 2
-- subfunction number
* ecx =
-which layout to get:
* 1 = normal
* 2 = layout when Shift is pressed
* 3 = Layout while pressing Alt
* edx =
-pointer to the 128-byte buffer where the layout will be copied
Return value:
* function does not return value
Or:
* eax =
-26 - function number
* ebx = 2
-- subfunction number
* ecx = 9
Return value:
* eax =
-country identifier (1 = eng, 2 = fi, 3 = ger, 4 = rus)
Remarks:
If Alt is pressed,
-the layout with Alt is used;
if
-Alt is not pressed, but Shift is pressed, then the layout with Shift is used;
if
-Alt and Shift are not pressed, but Ctrl is pressed, then the normal layout is
-used, after which 0x60 is subtracted from the code;
if
-none of the control keys are pressed, then the normal layout is used.
You can set the
-layouts and country ID using sub-function 2 of function 21.
The country
-identifier is a global system variable that is not used by the kernel itself;
-however, the @taskbar application displays an icon corresponding to the current
-country (using the described function).
The @taskbar
-application switches layouts on user request.
Constants for registers:
eax -
-SF_SYSTEM_GET (26)
ebx -
-SSF_KEYBOARD_LAYOUT (2)
Subfunction 5 - get system language
Options:
* eax =
-26 - function number
* ebx = 5
-- subfunction number
Return value:
* eax =
-system language (1 = eng, 2 = fi, 3 = ger, 4 = rus)
Remarks:
The system language is
-a global system variable not used by the kernel itself, however, the @taskbar
-application draws the corresponding icon (using the described function).
You can set the
-system language by calling subfunction 5 of function
-21.
Constants for registers:
eax -
-SF_SYSTEM_GET (26)
ebx -
-SSF_SYS_LANG (5)
Subfunction 9 - get the value of the time counter
Options:
* eax =
-26 - function number
* ebx = 9
-- subfunction number
Return value:
* eax =
-number of hundredths of a second since
system startup
Remarks:
The counter is taken
-modulo 2 ^ 32, which corresponds to a little more than 497 days.
System time can be
-obtained by function 3.
Constants for registers:
eax -
-SF_SYSTEM_GET (26)
ebx -
-SSF_TIME_COUNT (9)
Subfunction 10 - Get the value of a high-precision time counter
Options:
* eax =
-26 - function number
* ebx =
-10 - subfunction number
Returned value:
* edx: eax = number of nanoseconds since the kernel was loaded
* eax =
-low double word
* edx =
-senior double word
Remarks:
The function uses an
-HPET counter, if HPET is not available, a PIT counter is used. In this case,
-the accuracy will be reduced to 10,000,000 nanoseconds.
Constants for registers:
eax -
-SF_SYSTEM_GET (26)
ebx -
-SSF_TIME_COUNT_PRO (10)
Subfunction 11 - Find out if low-level access to HD is allowed
Options:
* eax =
-26 - function number
* ebx =
-11 - number of subfunction
Return value:
* eax =
-0/1 - disabled / enabled
Remarks:
Used
-in LBA reading (subfunction 8 of function 58).
-You can set the current state by calling subfunction
-11 of function 21.
Constants for registers:
eax -
-SF_SYSTEM_GET (26)
ebx -
-SSF_ACCESS_HD_LBA (11)
Subfunction 12 - Check if low-level access to PCI is allowed
Options:
* eax =
-26 - function number
* ebx =
-12 - subfunction number
Return value:
* eax =
-0/1 - disabled / enabled
Remarks:
Used when working
-with the PCI bus (function 62).
The current
-implementation uses only the low bit ecx.
You can set the
-current state by calling subfunction 12 of function 21.
Constants for registers:
eax -
-SF_SYSTEM_GET (26)
ebx -
-SSF_ACCESS_PCI (12)
Function 29 -
-get system date
Options:
* eax =
-29 - function number
Return value:
* eax =
-0x00DDMMYY, where
(BCD is used)
* YY = two lower digits of the year (00..99)
* MM = month (01..12)
* DD = day (01..31)
Remarks:
The system date can
-be set by function 22.
Constants for registers:
eax -
-SF_GET_SYS_DATE (29)
Function 3 -
-get system time
Characteristic:
* eax = 3-function number
Returned value:
* eax = 0x00SSMMHH, where HH:MM:SS = hours:minutes:seconds
* each
-element is returned as a BCD number, for example, for the time 23: 59: 59 the
-result will be 0x00595923
Comments:
-* See also subfunction 9 of function 26 - get
-timing since the launch of the system; in many cases, it is more convenient,
-because it returns just the DWORD value of the time counter.
-* System time can be set by function 22.
Constants for registers:
eax - SF_GET_SYS_TIME (3)
Function 30
-and its subfunctions (1-5) - work with the current
-folder.
Subfunction 1 - set the current folder for the stream
Options:
* eax =
-30 - function number
* ebx = 1
-- number of subfunction
* ecx =
-pointer to the string with the path to the new current folder,
The rules for forming the string are specified
-in the description of function 70
Return value:
* function does not return value
Subfunction 2 - get current folder for stream
Options:
* eax =
-30 - function number
* ebx = 2
-- subfunction number
* ecx =
-pointer to buffer
* edx =
-buffer size
Return value:
* eax =
-string length (including trailing 0)
Remarks:
If the buffer size is
-not enough to copy the entire path, only part of the string is copied and the
-trailing 0 is put at the end.
By default, the current folder for the stream is "/ rd / 1".
When creating a process / thread, the current folder is
-inherited from the parent.
Subfunction 3 - install add. system directory for the
-kernel
Options:
* eax =
-30 - function number
* ebx = 3
-- subfunction number
* ecx =
-pointer to data block:
key rb 64
path rb 64
Example:
align 64
key db 'kolibrios', 0; the key must be in lower case
align 64
path db
-'HD0 / 1', 0
Return value:
* function does not return value
Remarks:
The function can only
-be called once per session of the OS.
When entering a path,
-the character key is independent of the encoding.
Subfunction 4 - set the current folder with encoding
Options:
* eax =
-30 - function number
* ebx = 4
-- subfunction number
* ecx =
-pointer to the string with the path to the new current folder
* edx =
-string encoding, details are provided in function 80 description.
Return value:
* function does not return value
Subfunction 5 - get the
-current folder with encoding
Options:
* eax =
-30 - function number
* ebx = 5
-- subfunction number
* ecx =
-pointer to buffer
* edx =
-buffer size
* esi =
-string encoding
Return value:
* eax =
-string length in bytes (including the terminating 0)
Remarks:
If the buffer size is
-not enough to copy the entire path, only part of the string is copied and the
-trailing 0 is put at the end.
By default, the
-current folder for the stream is "/ rd /
-1".
When creating a
-process / thread, the current folder is inherited from the parent.
---------------------- Constants for registers: ----------------------
eax -
-SF_CURRENT_FOLDER (30)
ebx -
-SSF_SET_CF (1), SSF_GET_CF (2), SSF_ADD_SYS_FOLDER (3)
Function 34 -
-find out who owns the point of the screen
Options:
* eax =
-34 - function number
* ebx =
-x-coordinate (relative to the screen)
* ecx =
-y-coordinate (relative to screen)
Return value:
* eax =
-0x000000XX - the point belongs to the slot of the window N. With incorrect
-values of ebx and ecx,
-the function returns 0
* Function takes values from [_WinMapAddress]
Constants for registers:
eax -
-SF_GET_PIXEL_OWNER (34)
Function 35 -
-read dot color on screen
Options:
* eax =
-35
* ebx = y
-* xsize + x, where
* (x, y) = point coordinates (counting from 0)
* xsize =
-horizontal screen size
Return value:
* eax =
-color 0x00RRGGBB
Remarks:
You can check the screen
-size by calling function 14. Note that it subtracts 1 from both sizes.
There is also direct access
-to the video memory (without calling the system functions) via the gs selector.
The parameters of the current
-video mode can be obtained by the function 61.
Constants for registers:
eax -
-SF_GET_PIXEL (35)
Function 36 -
-read screen area
Options:
* eax =
-36 - function number
* ebx =
-pointer to a preallocated memory area where the image
-in BBGGRRBBGGRR format will be placed ...
* ecx =
-[x-axis size] * 65536 + [y-axis size]
* edx =
-[x-coordinate] * 65536 + [y-coordinate]
Return value:
* function does not return value
Remarks:
The coordinates of
-the area are the coordinates of the upper left corner of the area relative to
-the screen.
Image size in bytes
-is 3 * xsize * ysize.
Constants for registers:
eax - SF_GET_IMAGE (36)
Function 37
-and its subfunctions (0-8) - work with the mouse
Subfunction 0 - screen coordinates of the mouse
Options:
* eax =
-37 - function number
* ebx = 0
-- number of subfunction
Return value:
* eax = x
-* 65536 + y, (x, y) = coordinates of the mouse cursor (counting from 0)
Subfunction 1 - coordinates of the mouse relative to the window
Options:
* eax =
-37 - function number
* ebx = 1
-- number of subfunction
Return value:
* eax = x
-* 65536 + y, (x, y) = coordinates of the mouse cursor relative to
application windows
-(counting from 0)
Remarks:
The value is
-calculated by the formula (x-xwnd) * 65536 + (y-ywnd).
If y>
-= ywnd, then the low word is non-negative and
-contains the relative y-coordinate, and the high-order contains the relative
-x-coordinate (of the correct sign).
Otherwise, the low word is
-negative and still contains the relative y-coordinate, and the high word should
-be added 1.
Subfunction 2 - mouse button states
Options:
* eax =
-37 - function number
* ebx = 2
-- subfunction number
Return value:
* eax =
-bits 0-4 correspond to subfunctions 3
Subfunction 3 - states and events of the mouse buttons
Options:
* eax =
-37 - function number
* ebx = 3
-- subfunction number
Return value:
* eax
-contains the following information:
states:
* bit 0 set = left button held down
* bit 1 is set = right button is
-held
* bit 2 set = middle button held down
* bit 3 is set = button 4 is held
* bit 4 is set = button 5 is held
developments:
* bit 8 set = left button pressed
* bit 9 set = right button pressed
* bit 10 set = middle button pressed
* Bit 15 is set = Vertical scrolling is in use.
* bit 16 set = left button released
* bit 17 set = right button released
* bit 18 set = middle button released
* bit 23 is set = horizontal scroll
-is used
* bit 24 is set = double left click
Subfunction 4 - load the cursor
Options:
* eax =
-37 - function number
* ebx = 4
-- subfunction number
* dx = data source:
* dx = LOAD_FROM_FILE = 0 - data in
-the file
* ecx
-= pointer to the full path to the cursor file
* the cursor file must
-be in the .cur format, standard for MS Windows, with a size of 32 * 32 pixels
* dx = LOAD_FROM_MEM = 1 - the file
-data is already loaded into memory
* ecx
-= pointer to cursor file data
* data format is the
-same as in the previous case.
* dx = LOAD_INDIRECT = 2 - data in
-memory
* ecx
-= pointer to the image of the cursor in ARGB format 32 * 32 pixels
* edx
-= 0xXXYY0002, where
* Xx = x-coordinate of the cursor
-hot spot
* YY = y-coordinate
* 0 <= XX, YY <= 31
Return value:
* eax = 0
-- failure
* otherwise eax
-= cursor handle
Subfunction 5 - set the cursor
Sets a new cursor for the current stream window.
Options:
* eax =
-37 - function number
* ebx = 5
-- subfunction number
* ecx =
-cursor handle
Return value:
* eax =
-handle of previous cursor set
Remarks:
If an incorrect
-handle is passed, the function will restore the cursor to the default (standard
-arrow). In particular, ecx = 0 results in restoring
-the cursor by default.
Subfunction 6 - delete the cursor
Options:
* eax =
-37 - function number
* ebx = 6
-- subfunction number
* ecx =
-cursor handle
Return value:
* eax
-collapses
Remarks:
The cursor should
-have been previously loaded by the current thread (by calling subfunction 4). The function does not delete system cursors
-and cursors loaded by other applications.
If the active (set by
-subfunction 5) cursor is deleted, then the default
-cursor is restored (standard arrow).
Subfunction 7 - scroll data
Options:
* eax =
-37 - function number
* ebx = 7
-- subfunction number
Return value:
* eax =
-[horizontal offset] * 65536 + [vertical offset]
Remarks:
Data is available
-only to the active window.
After reading the
-values are reset.
The data has sign
-values.
Subfunction 8 - load the cursor with encoding indication
Options:
* eax =
-37 - function number
* ebx = 8
-- number of subfunction
* ecx =
-pointer to the string with the path to the cursor file
* edx =
-string encoding, details are provided in function 80 description.
Return value:
* eax =
-cursor handle, 0 - failure
Constants for registers:
eax -
-SF_MOUSE_GET (37)
ebx -
-SSF_SCREEN_POSITION (0), SSF_WINDOW_POSITION (1),
SSF_BUTTON (2), SSF_BUTTON_EXT (3),
-SSF_LOAD_CURSOR (4),
SSF_SET_CURSOR (5), SSF_DEL_CURSOR (6),
-SSF_SCROLL_DATA (7)
Function 38 -
-draw a line
Options:
* eax =
-38 - function number
* ebx =
-[start coordinate along the x axis] * 65536 +
-[x coordinate of the end coordinate]
* ecx =
-[start coordinate along the y axis] * 65536 +
-[y coordinate of the end coordinate]
* edx =
-0x00RRGGBB - color
edx
-= 0x01xxxxxx - draw inverse line
(low 24 bits are ignored)
Return value:
* function does not return value
Remarks:
The coordinates are
-taken relative to the window.
The end point is
-also drawn.
Constants for registers:
eax -
-SF_DRAW_LINE (38)
Function 39
-and its subfunctions (1,2,4)
Subfunction 1 - get the size of the background image
Options:
* eax =
-39 - function number
* ebx = 1
-- number of subfunction
Return value:
* eax =
-[width] * 65536 + [height]
Remarks:
There is a pair
-command for setting the size of the background image - subfunction
-1 of function 15. After which, of course, the image itself should be redefined.
Constants for registers:
eax -
-SF_BACKGROUND_GET (39)
Subfunction 2 - read point from background image
Options:
* eax =
-39 - function number
* ebx = 2
-- subfunction number
* ecx =
-offset
Return value:
* eax =
-0x00RRGGBB - dot color, if the offset is valid
(less than 0x160000-16)
* eax = 2
-- otherwise
Remarks:
Do not rely on the
-return value in case of an incorrect offset; it may change in future versions
-of the kernel.
The displacement of a
-point with coordinates (x, y) is calculated as (x + y * xsize)
-* 3.
There is a pair
-function of setting a point on the background image - a subfunction
-2 of function 15.
Constants for registers:
eax -
-SF_BACKGROUND_GET (39)
Subfunction 4 - get background rendering mode
Options:
* eax =
-39 - function number
* ebx = 4
-- subfunction number
Return value:
* eax = 1
-- to pave
* eax = 2
-- stretch
Remarks:
There is a paired
-function for setting the background rendering mode - a sub-function 4 of the
-function 15.
Constants for registers:
eax -
-SF_BACKGROUND_GET (39)
Function 4 - draw
-a line of text
Characteristic:
* eax = 4 is the number of functions
* ebx = X*65536+Y, window or buffer coordinates
* ecx = 0xXXRRGGBB, where
* RR, GG, BB set the text
-color
* XX=ABFFCSSS (bits):
* A=1-the drawn line ends
-with zero
* B=1-paint the background
-(color = edi)
* FF sets font and encoding:
0 = 6x9 cp866
1 = 8x16 cp866
2 = 8x16 UTF-16LE
3 = 8x16 UTF-8
* C=0-draw to window,
C=1 - draw to clipboard (edi)
* SSS = (size multiplier)-1,
-i.e. 0 = x1, 7 = x8
* edx = pointer to the beginning of the line
* esi = for A=0 string length, for A=1 ignored
* edi = if B=1-background color,
if
-C=1 - pointer to buffer
Returned value:
* function
-does not return a value
Comments:
* You cannot use B=1 and C=1 at
-the same time,
because
-in both cases the edi register is used.
* If SSS=0, the font may be
-smoothed,
depending
-on the system setting.
* Buffer structure:
Xsize dd
Ysize dd
picture rb Xsize*Ysize*4
-; 32 bits
Constants for registers:
eax - SF_DRAW_TEXT (4)
Function 40 -
-set a mask for the expected events.
The mask for the expected events affects the functions of working with
-events 10,
11, 23 - they only report on events resolved by this mask.
Options:
* eax =
-40 - function number
* ebx =
-mask: bit i corresponds to event i + 1 (see list of events)
(the set bit enables
-event notification)
bit 31: mouse event
-activity filter
bit 31 = 0 - inactive
-window always receives mouse events
bit 31 = 1 - inactive
-window does not receive mouse events
bit 30: cursor position
-filter
bit 30 = 0 - the window
-accepts mouse events if the cursor is outside the window
bit 30 = 1 - the window
-does not accept mouse events if the cursor is outside the window
Return value:
* eax =
-previous mask value
Remarks:
The default mask (7 =
-111b) allows redrawing notifications and keystrokes and buttons. This is
-sufficient for most applications.
Events prohibited in
-the mask are still saved if they come; they are simply not notified of the
-event functions.
Event functions take
-into account the mask at the time the function is called, and not at the time
-the message arrives.
Constants for registers:
eax -
-SF_SET_EVENTS_MASK (40)
DO NOT MAKE LEMONADE
Function 43 -
-Input / Output to Port
Output data to
-port
Options:
* eax =
-43 - function number
* bl =
-byte for output
* ecx =
-port number 0xnnnn (from 0 to 0xFFFF)
Return value:
* eax = 0
-- successful
* eax = 1
-- the stream did not reserve the specified port
Entering data
-from the port
Options:
* eax =
-43 - function number
* ebx
-ignored
* ecx =
-0x8000nnnn, where nnnn = port number (from 0 to
-0xFFFF)
Return value:
* eax = 0
-- successfully, with ebx = entered byte
* eax = 1
-- the stream did not reserve this port.
Remarks:
Pre-stream must
-reserve the specified port for a function 46.
For reserved ports, instead
-of calling these functions, it is better to use in / out processor commands —
-this is much faster and somewhat shorter and simpler. It is still impossible to
-read from non-reserved ports.
Constants for registers:
eax -
-SF_PORT_IN_OUT (43)
Function 46 - Reserve
-/ Release I / O Port Group
Reserved ports can be accessed directly from the application with in /
-out commands (recommended method) and function 43 (non-recommended method).
Options:
* eax =
-46 - function number
* ebx = 0
-- reserve, 1 - release
* ecx =
-number of the beginning of the range of ports
* edx =
-number of the end of the range of ports (inclusive)
Return value:
* eax = 0
-- successful
* eax = 1
-– error
Remarks:
·
-In
-the case of port redundancy, an error is the fulfillment of one of the
-following conditions:
o
-starting
-address is greater than the end;
o
-The
-specified range contains an incorrect port number (valid - from 0 to 0xFFFF);
o
-limit
-on the total number of reserved areas exceeded - a maximum of 255 is allowed;
o
-The
-specified range intersects with one of the previously reserved
·
-In
-the case of the release of ports, an attempt to free a range that was not
-previously completely reserved by the same function (with the same values
-of ecx, edx)
-is considered an error.
·
-If
-an error is detected (in both cases), no action is taken.
·
-When
-loading, the system reserves the ports 0..0x2d,
-0x30..0x4d, 0x50..0xdf, 0xe5..0xff
-(inclusive).
·
-When
-the stream ends, all ports reserved by it are automatically released.
Constants for registers:
eax -
-SF_SET_PORTS (46)
Function 47 -
-display a number in the window
Options:
·
-eax =
-47 - function number
·
-ebx =
-number to text conversion options:
o
-bl =
-0 - ecx contains a number
o
-bl =
-1 - ecx contains a pointer to dword
-/ qword-number
o
-bh =
-0 - display in decimal notation
o
-bh =
-1 - display in hexadecimal
o
-bh =
-2 - display in binary
o
-bits 16-21 = how many digits to display
o
-bits 22-29 are reserved and must be set to 0
o
-bit 30
-is set = output qword (64-bit number); it should be bl
-= 1
o
-bit 31
-is set = do not output leading zeros
o
-ecx =
-number (with bl = 0) or pointer (with bl = 1)
o
-edx =
-[x-coordinate] * 65536 + [y-coordinate]
o
-esi =
-0xXXRRGGBB, where
o
-RR, GG, BB set the text color
o
-XX = 0B0FCSSS (bits):
o
-B = 1 - fill the background (color = edi)
·
-F sets the font:
o
-0 = 6x9; 1 = 8x16;
o
-C = 0 - draw in the window,
o
-C = 1 - draw to clipboard (edi)
o
-SSS = (size multiplier) -1, that is, 0 = x1, 7 = x8
Return value:
* function does not return value
Remarks:
·
-The specified length must not exceed 60.
·
-Displays exactly the specified number of digits. If
-the number is small and can be written with a smaller number of digits, it is
-supplemented with leading zeros; if the number is large and cannot be written
-in such a number of digits, the “extra” leading digits are truncated.
Constants for registers:
eax -
-SF_DRAW_NUMBER (47)
Function 48
-and its subfunctions (0-13)
Subfunction 0 - apply screen settings.
Options:
·
-eax =
-48 - function number
·
-ebx =
-0 - number of subfunction
·
-ecx =
-0 - reserved
Return value:
·
-function does not return value
Remarks:
·
-The function redraws the screen after changing
-parameters with subfunctions 1 and 2.
·
-Calling a function without preceding calls to
-specified subfunctions is ignored.
·
-A function call with non-zero ecx
-is ignored.
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_APPLY (0)
Subfunction 1 - set button style
Options:
·
-eax =
-48 - function number
·
-ebx =
-1 - number of subfunction
·
-ecx =
-type of buttons:
o
-0 = flat
o
-1 = volume
Return value:
·
-function does not return value
Remarks:
·
-After
-calling the described function should redraw the screen subfunction
-0.
·
-The
-type of buttons affects only their drawing function 8.
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_SET_BUTTON_STYLE (1)
Subfunction 2 - set standard window colors
Options:
·
-eax =
-48 - function number
·
-ebx =
-2 - subfunction number
·
-ecx =
-pointer to color table
·
-edx =
-size of color table (must be 40 bytes for future compatibility) The format of
-the color table is specified in the description of subfunction
-3.
Return value:
·
-function does not return value
Remarks:
·
-After
-calling the described function, you should redraw the screen with subfunction 0.
·
-The
-standard color table affects only applications that explicitly receive this
-table (subfunction 3) and use it (indicating colors
-from it when calling drawing functions).
·
-The
-standard color table is included in the skin and is reinstalled when the skin
-is installed (subfunction 8).
·
-The
-color chart can be viewed / modified interactively using the desktop
-application.
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_SET_COLORS (2)
Subfunction 3 - get standard window colors
Options:
·
-eax =
-48 - function number
·
-ebx =
-3 - subfunction number
·
-ecx =
-pointer to buffer of size edx bytes, where the table
-will be written
·
-edx =
-color table size (must be 40 bytes for future compatibility)
Return value:
·
-function does not return value
Color table format: each element - dword color
-value 0x00RRGGBB
·
-+0: dword: frames - frame
-color
·
-+4: dword: grab - header
-color
·
-+8: dword: grab_button - the color of the button on the title bar
·
-+12 = + 0xC: dword: grab_button_text - the text color on the button on the
-title bar
·
-+16 = + 0x10: dword: grab_text - the color of the text on the title
·
-+20 = + 0x14: dword: work -
-the color of the workspace
·
-+24 = + 0x18: dword: work_button - color of the button in the workspace
·
-+28 = + 0x1C: dword: work_button_text - the text color on the button in the work
-area
·
-+32 = + 0x20: dword: work_text - text color in the workspace
·
-+36 = + 0x24: dword: work_graph - color of graphics in the workspace
Remarks:
·
-The
-color table structure is described in the standard included file macros.inc
-called system_colors; for example, you can write:
o
-sc system_colors ;
-variable declaration
o
-... ; somewhere you need to call the
-function being described with ecx = sc
o
-mov ecx, [sc.work_button_text] ;
-read the text color on the button in the workspace
·
-The
-use / non-use of these colors is the business of the
-program itself. To use, you just need to specify the color taken from this
-table when calling paint functions.
·
-When
-changing the table of standard colors (subfunction 2
-and then applying the changes to subfunction 0 or
-when installing the skin with subfunction 8) a
-message is sent to all windows about the need for redrawing (event with code
-1).
·
-Standard
-colors can be viewed / modified interactively using the desktop application.
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_GET_COLORS (3)
Subfunction 4 - get skin height
Options:
·
-eax =
-48 - function number
·
-ebx =
-4 - subfunction number
Return value:
·
-eax =
-skin height
Remarks:
·
-Skin
-height, by definition, is considered to be the height of the header of windows
-that use skin.
·
-See
-also the general structure of the window in the description of the function 0.
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_GET_SKIN_HEIGHT (4)
Subfunction 5 - get the working area of the screen
Options:
·
-eax =
-48 - function number
·
-ebx =
-5 - subfunction number
Return value:
·
-eax =
-[left] * 65536 + [right]
·
-ebx =
-[top] * 65536 + [bottom]
Remarks:
·
-The
-working area of the screen determines the position and
-coordinates of the maximized window.
·
-The
-working area of the screen during normal operation is the entire
-screen minus the panel (@taskbar).
·
-(left,
-top) - coordinates of the upper left corner, (right,
-bottom) - coordinates of the lower right. Thus, the size of the working area
-along the x axis is determined by the formula right-left + 1, along the y axis
-by the formula bottom-right + 1.
·
-See
-also function 14, which allows you to determine the size of the entire screen.
·
-There
-is a pair function of setting the workspace - subfunction
-6.
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_GET_SCREEN_AREA (5)
Subfunction 6 - set the working area of the screen
Options:
·
-eax =
-48 - function number
·
-ebx =
-6 - subfunction number
·
-ecx =
-[left] * 65536 + [right]
·
-edx =
-[top] * 65536 + [bottom]
Return value:
·
-function does not return value
Remarks:
·
-The
-working area of the screen determines the position and
-coordinates of the maximized window.
·
-This
-function is used only by the @taskbar application, which sets the working area
-to the entire screen minus the panel.
·
-(left,
-top) - coordinates of the upper left corner, (right,
-bottom) - coordinates of the lower right. Thus, the size of the working area
-along the x axis is determined by the formula right-left + 1, along the y axis
-by the formula bottom-right + 1.
·
-If
-left> = right, then the x-coordinates of the working area do not change. If
-left <0, then left is not set. If right> = screen width, then right is
-not set. Similarly on the y axis.
·
-See
-also function 14, which allows you to determine the size of the entire screen.
·
-There
-is a pair function of receiving the working area - subfunction
-5.
·
-This
-feature automatically redraws the screen, along the way updates the coordinates
-and dimensions of the maximized windows. All windows are notified of the need
-to redraw (event 1).
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_SET_SCREEN_AREA (6)
Subfunction 7 - Get skin area for header text.
Returns the title pane of the skin window for
-displaying the title text.
Options:
·
-eax =
-48 - function number
·
-ebx =
-7 - subfunction number
Return value:
·
-eax =
-[left] * 65536 + [right]
·
-ebx =
-[top] * 65536 + [bottom]
Remarks:
·
-Using
-/ not using this function is a personal file of the application.
·
-It
-is recommended to take into account the values returned by this
-function when choosing a place to draw the title text (function 4) or some kind
-of title text substitute (at the discretion of the application).
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_GET_SKIN_MARGINS (7)
Subfunction 8 - set the used window skin
Options:
·
-eax =
-48 - function number
·
-ebx =
-8 - number of subfunction
·
-ecx =
-pointer to the name of the skin file
Return value:
·
-eax =
-0 - successful
·
-eax =
-1 - failed to load file
·
-eax =
-2 - the file is not a skin file
Remarks:
·
-Upon
-successful loading of the skin, all windows are informed about the need to
-redraw (event 1).
·
-When
-loading, the system reads the skin from the default.skn
-file on the ramdisk.
·
-The
-user can change the skin statically by creating his default.skn,
-or dynamically using the desktop application.
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_SET_SKIN (8)
Subfunction 9 - get font
-smoothing setting
Options:
·
-eax =
-48 - function number
·
-ebx =
-9 - subfunction number
Return value:
·
-eax =
-2 - subpixel, 1 - normal, 0 - off
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_GET_FONT_SMOOTH (9)
Subfunction 10 - configure font
-smoothing
Options:
·
-eax =
-48 - function number
·
-ebx =
-10 - subfunction number
·
-cl = 2 - subpixel, 1 -
-normal, 0 - off
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_SET_FONT_SMOOTH (10)
Subfunction 11 - get font size
Options:
·
-eax =
-48 - function number
·
-ebx =
-9 - subfunction number
Return value:
·
-eax =
-current font height in pixels
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_GET_FONT_SIZE (11)
Subfunction 12 - set the font
-size
Options:
·
-eax =
-48 - function number
·
-ebx =
-10 - subfunction number
·
-cl = new font height in pixels
Constants for registers:
eax -
-SF_STYLE_SETTINGS (48)
ebx -
-SSF_SET_FONT_SIZE (12)
Subfunction 13 - install skin
-with encoding indication
Options:
·
-eax =
-48 - function number
·
-ebx =
-13 - number of subfunction
·
-ecx =
-pointer to the string with the path to the skin file
·
-edx =
-string encoding, details are provided in function 80 description.
Return value:
·
-eax =
-0 - successful
·
-eax =
-1 - failed to load file
·
-eax =
-2 - the file is not a skin file
Remarks:
·
-Upon
-successful loading of the skin, all windows are informed about the need to
-redraw (event 1).
·
-When
-loading, the system reads the skin from the default.skn
-file on the ramdisk.
·
-The
-user can change the skin statically by creating his default.skn,
-or dynamically using the desktop application.
Function 49 -
-Advanced Power Management (APM)
Options:
·
-eax = 49 - function
-number
·
-dx = APM function
-number (analogue of ax in the specification)
·
-bx, cx = APM function
-parameters
Return value:
·
-16-bit registers ax, bx, cx, dx, si, di and flag CF Installed
-according to APM specification
·
-the older half of the
-32-bit registers eax, ebx, ecx, edx, esi,
-edi are destroyed
Remarks:
The APM 1.2 specification is described in
-the Advanced Power Management (APM) BIOS Specification (Revision 1.2),
-available at http://www.microsoft.com/whdc/archive/amp_12.mspx;
-it is also included in the famous Interrupt List by Ralf Brown (http://www.pobox.com/~ralf/files.html,
-ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
Constants for registers:
eax
-- SF_APM (49)
Function 5 -
-pause.
Delays the execution of the program for a specified
-time.
Options:
* eax =
-5 - function number
* ebx =
-time in hundredths of a second
Return value:
* function does not return value
Remarks:
* Transfer ebx = 0 does not transfer control to the next process and
-no action at all. If really control to the next process is required (finish
-current time slice), use subfunction 1 functions 68.
Constants for registers:
eax -
-SF_SLEEP (5)
Function 50 -
-Set Window Form
Regular windows are rectangles. With this function,
-the window can be given an arbitrary shape. The form is defined by a set of
-points inside the framing rectangle belonging to the window. Position and the
-sizes of the framing rectangle are set by function 0 and change by function 67.
Data Setup with Form Information
Options:
·
-eax = 50 - function
-number
·
-ebx = 0 - number of subfunction
·
-ecx = pointer to the
-form data (byte array 0/1)
Return value:
·
-function does not
-return value
Scaling form data
Options:
·
-eax = 50 - function
-number
·
-ebx = 1 - number of subfunction
·
-ecx sets the scale: each
-data byte defines (2 ^ scale) * (2 ^ scale) pixels
Return value:
·
-function does not
-return value
Remarks:
·
-The default scale is 0 (scaling factor 1). If in the
-form data one byte corresponds to one pixel, then the scale can be not set.
·
-Denote xsize = window width
-(in pixels), ysize = height; note that they are one
-more than those set by functions 0, 67.
·
-By defining the scale, xsize
-and ysize should be divided by 2 ^ scale.
·
-The data byte at offset a must be 0/1 and determines
-that the window has a square with a side of 2 ^ scale (with scale = 0 we get a
-pixel) and coordinates of the upper left corner (a mod (xsize
-shr scale), a div (xsize shr scale))
·
-Data size: (xsize shr scale) * (ysize shr scale).
·
-Data must be present in the memory and not change
-after setting the form.
·
-The system views the form data every time the window
-is redrawn with function 0.
·
-Calling subfunction 0 with a
-null pointer results in a return to a rectangular shape.
Constants for registers:
eax
-- SF_SET_WINDOW_SHAPE (50)
Function 51 -
-create stream
Options:
·
-eax =
-51 - function number
·
-ebx =
-1 - the only subfunction
·
-ecx =
-address of the stream entry point (initial eip)
·
-edx =
-thread stack pointer (initial esp)
Return value:
·
-eax =
--1 - error (there are too many threads in the system)
·
-otherwise eax = TID - stream
-identifier
Constants for registers:
eax -
-SF_CREATE_THREAD (51)
Function 54
-and its subfunctions (0-4, 55)
Subfunction 0 - Find out the
-number of slots in the clipboard.
Options:
·
-eax =
-54 - function number
·
-ebx =
-0 - number of subfunction
Return value:
·
-eax =
-number of slots in the buffer
·
-eax =
--1 - the main list area is missing
Constants for registers:
eax -
-SF_CLIPBOARD (54)
ebx -
-SSF_GET_SLOT_COUNT (0)
Subfunction 1 - Read data from the clipboard.
Options:
·
-eax =
-54 - function number
·
-ebx =
-1 - number of subfunction
·
-ecx =
-slot number
Return value:
·
-eax =
-if successful - a pointer to the memory area with data
·
-eax =
-1 - error
·
-eax =
--1 - the main list area is missing
Remarks:
·
-the buffer pointed to by eax
-contains the following information:
o
-+ 0: dword: total data
-length
o
-+4: dword: defines the type
-of data:
§ 0 =
-Text
§ 1 =
-Text with block selection
§ 2 =
-Image
§ 3 =
-RAW
§ 4
-and above reserved
o
-+8: See the clipboard_container_rus.txt file for more
-details.
·
-The function should be used in conjunction with 68.11.
-An application must first initialize the local heap by calling 68.11.
Constants for registers:
eax -
-SF_CLIPBOARD (54)
ebx -
-SSF_READ_CB (1)
Subfunction 2 - Write data to
-the clipboard.
Options:
·
-eax =
-54 - function number
·
-ebx =
-2 - subfunction number
·
-ecx =
-number of bytes copied
·
-edx =
-pointer to buffer for copied data
Return value:
·
-eax =
-0 - successful
·
-eax =
-1 - error
·
-eax =
--1 - the main list area is missing
Constants for registers:
eax -
-SF_CLIPBOARD (54)
ebx -
-SSF_WRITE_CB (2)
Subfunction 3 - Delete the last
-slot with data in the clipboard
Options:
·
-eax =
-54 - function number
·
-ebx =
-3 - subfunction number
Return value:
·
-eax =
-0 - successful
·
-eax =
-1 - error
·
-eax =
--1 - the main list area is missing
Constants for registers:
eax -
-SF_CLIPBOARD (54)
ebx -
-SSF_DEL_SLOT (3)
Subfunction 4 - Failure buffer
-lock
Options:
·
-eax =
-54 - function number
·
-ebx =
-4 - subfunction number
Return value:
·
-eax =
-0 - successful
·
-eax =
--1 - the main list area is missing or there is no lock.
Remarks:
·
-It
-is used in exceptional cases when a frozen application or a dead application
-has blocked work with the clipboard.
Constants for registers:
eax -
-SF_CLIPBOARD (54)
ebx -
-SSF_UNLOCK_BUFFER (4)
Function 55 and its subfunction 55
Subfunction 55 - Start playing
-data on the built-in speaker
Options:
·
-eax =
-55 - function number
·
-ebx =
-55 - subfunction number
·
-esi =
-data pointer
Return value:
·
-eax =
-0 - successful
·
-eax =
-55 - error (speaker is disabled or busy)
Data is an array of variable-length elements. The format of each element
-is determined by the first byte:
·
-0 = end of data
·
-1..0x80 = sets the duration of the sound in hundredths
-of a second of a note, determined by the immediate frequency value
o
-the next word (2 bytes) contains a frequency divider;
-frequency is defined as 1193180 / divider
·
-0x81 = invalid
·
-0x82..0xFF = note, defined by
-octave and number:
o
-duration in hundredths of a second = (first byte)
--0x81
o
-there is one more byte;
o
-(second byte) = 0xFF - pause
o
-otherwise, it has the form a * 0x10 + b, where b =
-note number in octave from 1 to 12, a = octave number (counting from 0)
Remarks:
·
-Speaker
-eating may be prohibited / enabled by function 8 subfunction
-8.
·
-The
-function returns control, informing where the request information should go.
-The playback itself is independent of the program.
·
-Data
-should be stored in memory at least until the end of playback.
Constants for registers:
eax -
-SF_SPEAKER_PLAY (55)
Function 57 - PCI BIOS
Options:
·
-eax =
-57 - function number
·
-ebp
-matches the al register in the PCI BIOS specification
·
-other registers - according to the PCI BIOS
-specification
Return value:
·
-CF not defined
·
-other registers - according to the PCI BIOS
-specification
Remarks:
·
-Many
-of the results of this function can also be achieved by calling the
-corresponding subfunctions of function 62.
·
-The
-function calls a PCI32 BIOS extension, documented, for example, at
-http://alpha1.dyns.net/files/PCI/bios21.pdf.
·
-If
-the BIOS does not support this extension, the behavior
-of the function is emulated (through analogs of the subfunctions
-of function 62 kernel mode).
Constants for registers:
eax - SF_PCI_BIOS (57)
Function 60 - Inter Process Communication (IPC)
IPC is used to send messages from one process / thread to another. In
-doing so, you must first agree on how to interpret a particular message.
Subfunction 1 - set the area to get IPC
Called by a receiver process.
Options:
·
-eax =
-60 - function number
·
-ebx =
-1 - number of subfunction
·
-ecx =
-pointer to buffer
·
-edx =
-buffer size
Return value:
·
-eax =
-0 - always successful
IPC buffer format:
·
-+0: dword: if here is not 0,
-then the buffer is considered blocked; block / unlock the buffer when you are
-actively working with it and you need to prevent the buffer data from being
-changed from the outside (no new messages were received)
·
-+4: dword: buffer space
-occupied (bytes)
·
-+8: first post
·
-+8 + n: second message
·
-...
Message format:
·
-+0: dword: PID of the
-process / thread that sent the message
·
-+4: dword: message length
-(not counting this header)
·
-+8: n * byte: message data
Subfunction 2 - send IPC message
Called by the initiator process.
Options:
·
-eax =
-60 - function number
·
-ebx =
-2 - subfunction number
·
-ecx =
-PID receiver
·
-edx =
-pointer to the message data
·
-esi =
-message length (in bytes)
Return value:
·
-eax =
-0 - successful
·
-eax =
-1 - the receiver has not defined a buffer for IPC messages (maybe not yet had
-time, and maybe this is not the flow which is needed)
·
-eax =
-2 - the receiver has blocked the IPC buffer; try to wait a bit
·
-eax =
-3 - receiver IPC buffer overflow
·
-eax =
-4 - there is no process / thread with such a PID
Remarks:
·
-The
-system immediately after writing the IPC message to the buffer sends event 7 to
-the receiving stream (see event codes).
Constants for registers:
eax -
-SF_IPC (60)
ebx -
-SSF_SET_AREA (1), SSF_SEND_MESSAGE (2)
Function 61 - get parameters for direct access to the chart
A bit of theory:
The program can access the data of the graphic screen (the area of
-memory that actually displays the contents of the screen) directly
-without calling the system functions via the gs
-selector:
mov eax, [gs: 0] will place the first
-dword of the buffer in eax
-containing information about the color of the left top point (and possibly the
-colors of several of the following). mov
-[gs: 0], eax when operating
-in VESA modes with LFB will set the color of the left top point (and possibly
-the colors of the next few). Knowledge is required to interpret graphic screen
-data.
some parameters that are returned by
-this function.
Remarks:
·
-Graphics
-options rarely change when the system is running.
·
-When
-the video mode changes, the system redraws all windows
-(event with code 1) and redraws the background (event 5). The same events occur
-in other cases that occur much more often than the video mode change.
·
-When
-operating in LFB video modes, the gs selector points
-to the LFB itself, so reading / writing gs directly
-changes the screen contents. When working in video modes without LFB, gs points to a certain area of kernel data,
-and all display functions faithfully perform double work of writing directly to
-the screen and writing to this buffer. As a result, when reading the contents
-of this buffer, the results correspond to the contents of the screen (with,
-generally speaking, a large color resolution), and the entry is ignored. An
-exception is the 320 * 200 mode, for which the screen is updated in the main
-loop of the system thread in accordance with the movements of the mouse cursor.
Screen
-resolution
Options:
·
-eax =
-61 - function number
·
-ebx =
-1 - number of subfunction
Return value:
·
-eax =
-[x-axis resolution] * 65536 + [y-axis resolution]
Remarks:
·
-You
-can use function 14, given that it returns sizes 1 less. This is a fully
-equivalent method.
The number of bits per pixel
Options:
·
-eax =
-61 - function number
·
-ebx =
-2 - subfunction number
Return value:
·
-eax =
-number of bits per pixel (24 or 32)
Number of bytes per line
Options:
·
-eax =
-61 - function number
·
-ebx =
-3 - subfunction number
Return value:
·
-eax =
-number of bytes that one scan line occupies (horizontal line on the screen)
Constants for registers:
eax -
-SF_GET_GRAPHICAL_PARAMS (61)
ebx -
-SSF_SCREEN_SIZE (1), SSF_BITS_PER_PIXEL (2),
SSF_BYTES_PER_LINE (3)
Function 62 and its subfunctions (0-2, 4-6,
-8-10)
Subfunction 0 - get the version
-of the PCI interface
Options:
·
-eax = 62 - function number
·
-bl = 0 - subfunction
-number
Return value:
·
-eax = -1 - access to PCI is
-prohibited; otherwise
·
-ah.al = PCI version
-(ah = version, al = sub version)
·
-high word eax cleared
Remarks:
·
-Low-level access to PCI for applications of sub-function 12 of function
-21 must be enabled in advance.
·
-If the PCI BIOS is not supported, then the value of ax is undefined.
Constants for registers:
eax
-- SF_PCI (62)
ebx
-- SSF_GET_VERSION (0)
Subfunction 1 - get the latest PCI bus number
Options:
·
-eax = 62 - function number
·
-bl = 1 - subfunction
-number
Return value:
·
-eax = -1 - access to PCI is
-prohibited; otherwise
·
-al = last PCI bus
-number; the remaining eax bytes are destroyed
Remarks:
·
-Low-level access to PCI for applications of sub-function 12 of function
-21 must be enabled in advance.
·
-If the PCI BIOS is not supported, then al is undefined.
Constants for registers:
eax
-- SF_PCI (62)
ebx
-- SSF_GET_LAST_BUS (1)
Subfunction 2 - Obtain the
-mechanism for accessing the PCI configuration space
Options:
·
-eax = 62 - function number
·
-bl = 2 - subfunction
-number
Return value:
·
-eax = -1 - access to PCI is
-prohibited; otherwise
·
-al = mechanism (1 or
-2); other eax bytes are destroyed
Remarks:
·
-Low-level access to PCI for applications of sub-function 12 of function
-21 must be enabled in advance.
·
-The mechanism of treatment is selected in accordance with the
-characteristics of the equipment.
·
-Sub-functions of reading and writing automatically work with the
-selected mechanism.
Constants for registers:
eax
-- SF_PCI (62)
ebx
-- SSF_GET_ADRR_MODE (2)
Subfunctions 4,5,6
-- read the PCI register
Options:
·
-eax = 62 - function number
·
-bl = 4 - read byte
·
-bl = 5 - read the word
·
-bl = 6 - read double word
·
-bh = PCI bus number
·
-ch = dddddfff,
-where ddddd = device number on the bus, fff = device function number
·
-cl = register number
-(must be even for bl = 5, divide by 4 for bl = 6)
Return value:
·
-eax = -1 - error (access to PCI or
-unsupported parameters is prohibited); otherwise
·
-al / ax / eax (depending on the requested size) contains data; the
-rest of the eax register collapses
Remarks:
·
-Low-level access to PCI for applications of sub-function 12 of function
-21 must be enabled in advance.
·
-Access mechanism 2 supports only 16 devices on the bus and ignores the
-function number. You can get access mechanism by calling subfunction
-2.
·
-Some registers are standard and exist for all devices,
-some are determined by a specific device. The first list includes, for example,
-the well-known Interrupt List by Ralf Brown (http://www.pobox.com/~ralf/files.html,
-ftp://ftp.cs.cmu.edu/afs/cs/user/ralf
-/pub/); the second list must be specified in the device documentation.
Constants for registers:
eax
-- SF_PCI (62)
ebx
-- SSF_READ_BYTE (4), SSF_READ_WORD (5), SSF_READ_DWORD (6)
Subfunctions 8,9,10 - write to
-the PCI register
Options:
·
-eax = 62 - function number
·
-bl = 8 - write byte
·
-bl = 9 - write the word
·
-bl = 10 - write a double word
·
-bh = PCI bus number
·
-ch = dddddfff,
-where ddddd = device number on the bus, fff = device function number
·
-cl = register number
-(must be even for bl = 9, divide by 4 for bl = 10)
·
-dl / dx / edx (depending on the requested size) contains data to be
-written
Return value:
·
-eax = -1 - error (denied access to
-PCI or unsupported parameters)
·
-eax = 0 - successful
Remarks:
·
-Low-level access to PCI for applications of sub-function 12 of function
-21 must be enabled in advance.
·
-Access mechanism 2 supports only 16 devices on the bus and ignores the
-function number. You can get access mechanism by calling subfunction
-2.
·
-Some registers are standard and exist for all devices,
-some are determined by a specific device. The first list includes, for example,
-the famous Interrupt List by Ralf Brown (see above); the second list must be
-specified in the device documentation.
Constants for registers:
eax
-- SF_PCI (62)
ebx
-- SSF_WRITE_BYTE (8), SSF_WRITE_WORD (9), SSF_WRITE_DWORD (10)
Function 63 - work with fixing Board
A debug Board is a system buffer (4096 bytes) into
-which any program can write (generally speaking, arbitrary) data and from which
-another program can read that data.
There is a Convention that writes data are text
-strings that are interpreted as debug messages about the progress of the
-program. The kernel also writes some function execution information to the
-debug Board in certain situations; by Convention, kernel messages begin with
-the prefix "K : ".
To view the debug Board, you have created a board
-application that reads data from the buffer and displays it in its window. board understands the sequence of codes 13,10 as a
-transition to a new line. A character with zero code at the end of the line is
-not required, but it does not interfere. With the advent of the debugger, the
-value of the debug Board has decreased slightly, because the debugger allows
-you to fully control the progress
the implementation of the programme does not
-require any effort on the part of the programme
-itself. However, in many cases, the debug Board continues to be useful.
Write byte
Options:
eax = 63 - function number
ebx = 1 - subfunction
-number
cl = data byte
Return value: the function does not return a value
Comments:
The byte is written to the buffer. The buffer
-length is 512 bytes. When the buffer overflows, all the data is lost and the
-fill starts again from zero.
This function, called in a loop, is enough to
-output more complex objects (strings, numbers) to the debug Board. Instead of
-writing the code manually, you can use the debug file.inc, included in the
-distribution.
Read byte
Takes a byte from the buffer.
Options:
eax = 63 - function number
ebx = 2 - subfunction
-number
Returned value:
eax = ebx
-= 0 - buffer is empty
eax = byte, ebx
-= 1 - byte successfully read
Constants for registers:
eax - SF_BOARD (63)
ebx - SSF_DEBUG_WRITE (1), SSF_DEBUG_READ
-(2)
Function 64 -
-reallocate memory in the application
Options:
eax = 64 - function number
ebx = 1 - subfunction
-only
ecx = new size of memory
Returned value:
eax = 0 - successful
eax = 1 - there is not enough memory
Comments:
There is another method of allocation/release
-of dynamic memory - subfunction 11, 12, 13 of
-function 68.
The function cannot be used in conjunction
-with 68.11, 68.12, 68.13. The function call will be
-ignored if the application creates a local heap by calling 68.11.
Constants for registers: eax
-- SF_MEMORY_RESIZE (64)
Function 65 -
-display the image with the palette in the window
Options:
eax = 65 - function number
ebx = pointer to the image
ecx = [size on axis x]*65536 +
-[size on axis y]
edx = [coordinate on axis x]*65536
-+ [coordinate on axis y]
esi = number of bits per pixel,
-should be 1,2,4,8,9,15,16,24 or 32
edi = pointer to palette (2 to the
-power esi colors 0x00RRGGBB); ignored when esi > 8
ebp = offset of each successive
-row of image data from the previous row
Return value: the function does not return a value
Comments:
Image coordinates are the coordinates of the
-upper left corner of the image relative to the window.
Image format with 1 bit per pixel: each byte
-of the image, except perhaps the last bytes of the lines, contains information
-about the color of 8 pixels, the highest bit
-corresponds to the first pixel.
Image format with 2 bits per pixel: each byte
-of the image, except perhaps the last bytes of the lines, contains information
-about the color of 4 pixels, the older two bits
-correspond to the first pixel.
Image format with 4 bits per pixel: each byte
-of the image, except the last bytes of the lines (if the width of the image is
-odd), contains information about the color of 2 pixels, the highest tetrad
-corresponds to the first pixel.
Image format with 8 bits per pixel: each byte
-of the image is treated as an index in the palette.
Image format with 9 bits per pixel: each byte
-of the image (8 bits) represents the intensity of gray for a single pixel, so
-this type of image is identical to 8 bits per pixel without a palette.
Image format with 15 bits per pixel: the
-color of each pixel is encoded as (in bit representation) 0RRRRRGGGGGBBB - 5
-pixels per color.
Image format with 16 bits per pixel: the
-color of each pixel is encoded as RRRRGGGGGGBBBB (scheme 5+6+5).
Image format with 24 bits per pixel: the
-color of each pixel is encoded in three bytes - sequentially blue, green, red
-components of the color.
Image format with 32 bits per pixel: similar
-to 24, only there is still an ignored fourth byte.
Calling function 7 is equivalent to calling
-this function with parameters esi=24, ebp=0.
Constants for registers:
eax - SF_PUT_IMAGE_EXT (65)
Function 66 -
-Keyboard Operation
The input mode affects the reading of the keys by
-function 2.
When a program is loaded, an input mode is set for it.
Subfunction 1 - set keyboard input mode
Options:
eax
-= 66 function number
ebx
-= 1-subfunction number
ecx
-= mode:
0 = regular (ASCII characters)
1 = scancodes
Return value: function does not return value
Subfunction 2 - get keyboard input mode
Options:
eax
-= 66 function number
ebx
-= 2-number subfunction
Return value: eax = current
-mode
Subfunction 3 - get the state of control keys
Options:
eax
-= 66 function number
ebx
-= 3-subfunction number
Return value:
eax
-= bitmask:
bit 0 (mask 1):
-shift shift pressed
bit 1 (mask 2):
-shift shift pressed
bit 2 (mask 4):
-Ctrl Ctrl pressed
bit 3 (mask 8):
-Ctrl Ctrl pressed
bit 4 (mask
-0x10): alt alt pressed
bit 5 (mask
-0x20): alt alt pressed
bit 6 (mask
-0x40): CapsLock enabled
bit 7 (mask
-0x80): NumLock enabled
bit 8 (mask
-0x100): ScrollLock enabled
bit 9 (mask
-0x200): win win pressed
bit 10 (0x400
-mask): right win pressed
other bits are
-reset
Subfunction 4 - set a system-wide hotkey
Only applications are notified of a hotkey installed it;
-active application (to which all normal input) does not receive such keys. The
-notification consists in sending an event with code 2. You can read the hotkey
-in the same way as a regular one - function 2.
Options:
eax
-= 66 function number
ebx
-= 4-number subfunction
KL sets the key scan-code; use CL = 0 to
-specify Ctrl shift type combinations
edx
-= 0xXYZ sets the possible states of the control keys:
Z (the lower 4 bits) sets the
-state of the LShift and RShift
-keys:
0 = none of the
-keys should be pressed;
1 = exactly one of
-the keys must be pressed;
2 = both keys must
-be pressed;
3 = LShift, RShift should be pressed
-but not;
4 = RShift must be pressed, but not LShift
G - similarly
-for LKTRV and RCtrl;
X - similarly
-for Laht and Ralt
Return value:
eax
-= 0-successful
eax
-= 1 - too many hotkeys (maximum 256 is allowed)
Remarks:
A
-hot key can be triggered either when pressed or when released. The key release
-scan code is 128 more than the key scan code (i.e., the most significant bit is
-set).
Multiple
-applications can install the same combination; when such a combination is
-pressed, all such applications will be notified.
Subfunction 5 - delete the installed hotkey
Options:
eax
-= 66 function number
ebx
-= 5-number subfunction
CZ = scan key and edr
-= 0xXYZ are the same as in subfunction 4
Return value:
eax
-= 0-successful
eax
-= 1-no such hotkey
Remarks:
At
-the end of the process / thread, all hotkeys set by it are deleted.
A
-function call does not affect other applications. If another application has
-detected the same combination, it will still receive notifications.
Subfunction 6 - normal block input
Options:
eax
-= 66 function number
ebx
-= 6-number subfunction
Return value: function does not return value
Remarks:
Normal
-keyboard input for installed hotkeys is blocked
The
-MOUSEMUL application is used to emulate the mouse through the keyboard.
Subfunction 7 - unlock regular input
Options:
eax
-= 66 function number
ebx
-= 7-subfunction number
Return value: function does not return value
Remarks:
Unlocking
-the results f. 66.6
The
-MOUSEMUL application is used to emulate the mouse through the keyboard.
Registers for Constants:
eax-SF_KEYBOARD (66)
ebx-SSF_SET_INPUT_MODE (1), SSF_GET_INPUT_MODE (2),
-SSF_GET_CONTROL_KEYS (3), SSF_SET_SYS_HOTKEY (4), SSF_DEL_SYS_HOTKEY (5),
-SSF_LOCKIN (7)
Function 67 -
-Change Window Position / Size
Options:
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
esi
-= new y-size of the window
Return value: function does not return value
Remarks:
A
-value of -1 for the parameter means "do not change"; for example, to
-move a window without resizing, you can specify edx =
-esi = -1.
Previously,
-the window must be defined by function 0. It also sets the initial coordinates
-and dimensions of the window.
Window
-dimensions are understood in the sense of function 0, i.e. one pixel smaller
-than the actual size.
The
-function call for maximized windows is simply ignored.
For
-windows of appropriate styles, position and / or dimensions can be changed by
-the user; current position and dimensions can be obtained by calling function
-9.
The
-function sends the window a redraw event (with code 1).
Constants for registers:
eax
-- SF_CHANGE_WINDOW (67)EY (5), SSF_LOCKIN (7)
Function 7 -
-display image in the window.
Options:
* eax =
-7 - function number
* ebx =
-pointer to image in BBGGRRBBGGRR format ...
* ecx =
-[x-axis size] * 65536 + [y-axis size]
* edx =
-[x-coordinate] * 65536 + [y-coordinate]
Return value:
* Function does not return value
Remarks:
* Image coordinates are the coordinates of the upper left
-corner. Image relative to the window.
* Image size in bytes is 3 * xsize
-* ysize.
Constants for registers:
eax -
-SF_PUT_IMAGE (7)
Function 8 -
-define / delete button
Parameters for defining a button:
* eax = 8
-- function number
* ebx =
-[x axis coordinate] * 65536 + [x axis size]
* ecx =
-[y-coordinate] * 65536 + [y-axis size]
* edx =
-0xXYnnnnnn, where:
* nnnnnn
-= button id
* senior (31st) bit edx cleared
* if the 30th bit of edx is set - do not draw a button
* if the 29th bit of edx is set - do not draw a frame when pressing the button
* esi =
-0x00RRGGBB - button color
Parameters for deleting a button:
* eax = 8
-- function number
* edx =
-0x80nnnnnn, where nnnnnn is the button ID
Return value:
* function does not return value
Remarks:
* Button sizes must be greater than 0 and less than 0x8000.
* For windows with a skin, when defining a window (calling the
-0th function), two standard buttons are created - closing the window with
-identifier 1 and minimizing the window with identifier 0xffff.
* Create two buttons with the same ID
quite acceptable.
* The button with the identifier 0xffff, when clicked, is
-interpreted by the system as the minimization button, the system processes such
-a pressure independently, without referring to the application. The rest is the
-usual button.
* The total number of buttons for all applications is
-limited to 4095.
Constants for registers:
eax -
-SF_DEFINE_BUTTON (8)
Function 9 - information
-about the execution flow
Options:
* eax = 9
-- function number
* ebx =
-pointer to 1kb buffer
* ecx =
-stream slot number
* ecx =
--1 - get information about the current stream
Return value:
* eax =
-maximum slot slot number
* the buffer pointed to by ebx contains the following information:
* +0: dword: CPU usage
-(how many clock cycles per second it takes to execute exactly this thread)
* +4: word: position of the stream window in the
-window stack
* +6: word: (not related to the requested
-stream) The slot number of the stream whose window is
-in the window stack at the position ecx
+8: word: reserved
* +10 = + 0xA: 11 bytes: the name of the process
-(the name of the file being run is an executable file with no extension)
* +21 = + 0x15: byte: reserved, this byte does
-not change
* +22 = + 0x16: dword:
-the address of the process in memory
* +26 = + 0x1A: dword:
-the size of the memory used - 1
* +30 = + 0x1E: dword:
-PID / TID
* +34 = + 0x22: dword:
-the x axis coordinate of the stream window
* +38 = + 0x26: dword:
-y-axis of the stream window
* +42 = + 0x2A: dword:
-x-axis size of the stream window
* +46 = + 0x2E: dword:
-y-size of the stream window
* +50 = + 0x32: word: stream slot status:
* 0 = stream is running
* 1 = stream suspended
* 2 = stream suspended while waiting
-for event
* 3 = thread terminates as a result
-of calling function -1 or forcibly as a result of calling subfunction
-2 of function 18 or shutting down the system
* 4 = flow terminates as a result of
-an exception
* 5 = thread is waiting for an event
* 9 = requested slot is free, all
-other slot information does not make sense
* +52 = + 0x34: word: reserved, this word does
-not change
* +54 = + 0x36: dword:
-coordinate of the beginning of the client area along the x axis
* +58 = + 0x3A: dword:
-y-coordinate of the beginning of the client area
* +62 = + 0x3E: dword:
-client area width
* +66 = + 0x42: dword:
-height of the client area
* +70 = + 0x46: byte: window state - bit field
* bit 0
-(mask 1): maximized window
* bit 1 (mask 2): minimized window
-in the taskbar
* bit 2
-(mask 4): the window is minimized
* +71 = + 0x47: dword:
-event mask
* +75 = + 0x4B: byte: keyboard input mode (ASCII
-= 0; SCAN = 1)
Remarks:
* Slots are numbered from 1.
* The return value is not the total number of threads, as there
-are free slots.
* When creating a process, a thread is automatically
-created.
* The function provides information about the stream. Each
-process has at least one thread. One process can create several threads, in
-this case each thread gets its own slot, and the fields +10, +22, +26 in these
-slots are the same. For applications, there is no general way to determine if
-two threads belong to the same process.
* Active window - a window located at the top of the window
-stack, it receives messages about typing from the keyboard. For him, the
-position in the window stack is the same as the return value.
* Slot 1 corresponds to a special operating system thread,
-for which:
* the window is at the
-bottom of the window stack, the +4 and +6 fields contain the value 1
* process name -
-"OS / IDLE" (padded with spaces)
* process address in
-memory is 0, the size of used memory is 16 Mb (0x1000000)
* PID = 1
* coordinates and
-dimensions of the window, as well as the client area, are conditionally set
-equal to 0
* slot status - always 0 (executed)
* the execution time is
-the sum of the time spent on the work itself and the idle time waiting for the
-interruption (which can be obtained by calling subfunction
-4 of function 18).
* Starting from slot 2, the usual applications are placed.
* Normal applications are located in memory at address 0
(kernel constant std_application_base_address). Overlays do not occur,
-because each process has its own page table.
* When creating a thread, it is assigned a slot in the
-system table and an identifier (Process / Thread IDentifier
-= PID / TID), which for a given stream does not change with time. After a
-thread has completed, its slot can be reused for another thread. A thread
-identifier cannot be assigned to another thread even after the first one is
-completed. The identifiers assigned to new threads are monotonously increasing.
* If the thread has not yet defined its window by calling
-function 0, then the position and size of this window is assumed to be zeros.
* The coordinates of the client area of the
-window are taken relative to the window.
* Currently only part of the buffer of size 76 = 0x4C bytes
-is used. However, it is recommended to use a buffer 1 KB for future
-compatibility, some fields may be added in the future.
Constants for registers:
eax - SF_THREAD_INFO (9)