Back to main

 

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)