Rev 621 | Rev 652 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 621 | Rev 641 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | SYSTEM FUNCTIONS of OS Kolibri 0.7.0.0 |
1 | SYSTEM FUNCTIONS of OS Kolibri 0.7.1.0 |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | Number of the function is located in the register eax. |
3 | Number of the function is located in the register eax. |
4 | The call of the system function is executed by "int 0x40" command. |
4 | The call of the system function is executed by "int 0x40" command. |
5 | All registers except explicitly declared in the returned value, |
5 | All registers except explicitly declared in the returned value, |
Line 20... | Line 20... | ||
20 | * Y = style of the window: |
20 | * Y = style of the window: |
21 | * Y=0 - type I - fixed-size window |
21 | * Y=0 - type I - fixed-size window |
22 | * Y=1 - only define window area, draw nothing |
22 | * Y=1 - only define window area, draw nothing |
23 | * Y=2 - type II - variable-size window |
23 | * Y=2 - type II - variable-size window |
24 | * Y=3 - skinned window |
24 | * Y=3 - skinned window |
25 | * Y=4 - skinned window with fixed sizes |
25 | * Y=4 - skinned fixed-size window |
26 | * other possible values (from 4 up to 15) are reserved, |
26 | * other possible values (from 5 up to 15) are reserved, |
27 | function call with such Y is ignored |
27 | function call with such Y is ignored |
28 | * RR, GG, BB = accordingly red, green, blue components of a color |
28 | * RR, GG, BB = accordingly red, green, blue components of a color |
29 | of the working area of the window (are ignored for style Y=2) |
29 | of the working area of the window (are ignored for style Y=2) |
30 | * X = DCBA (bits) |
30 | * X = DCBA (bits) |
31 | * A = 1 - window has caption; for style Y=3 caption string |
31 | * A = 1 - window has caption; for styles Y=3,4 caption string |
32 | must be passed in edi, for other styles use |
32 | must be passed in edi, for other styles use |
33 | subfunction 1 of function 71 |
33 | subfunction 1 of function 71 |
34 | * B = 1 - coordinates of all graphics primitives are relative to |
34 | * B = 1 - coordinates of all graphics primitives are relative to |
35 | window client area |
35 | window client area |
36 | * C = 1 - don't fill working area on window draw |
36 | * C = 1 - don't fill working area on window draw |
Line 49... | Line 49... | ||
49 | * function does not return value |
49 | * function does not return value |
50 | Remarks: |
50 | Remarks: |
51 | * Position and sizes of the window are installed by the first |
51 | * Position and sizes of the window are installed by the first |
52 | call of this function and are ignored at subsequent; to change |
52 | call of this function and are ignored at subsequent; to change |
53 | position and/or sizes of already created window use function 67. |
53 | position and/or sizes of already created window use function 67. |
54 | * For windows with style Y=3 and caption (A=1) caption string is set |
54 | * For windows with styles Y=3,4 and caption (A=1) caption string |
55 | by the first call of this function and is ignored at subsequent |
55 | is set by the first call of this function and is ignored |
56 | (strictly speaking, is ignored after a call to subfunction 2 |
56 | at subsequent (strictly speaking, is ignored after a call to |
57 | of function 12 - end redraw); to change caption of already created |
57 | subfunction 2 of function 12 - end redraw); to change caption of |
58 | window use subfunction 1 of function 71. |
58 | already created window use subfunction 1 of function 71. |
59 | * If the window has appropriate styles, position and/or sizes can be |
59 | * If the window has appropriate styles, position and/or sizes can be |
60 | changed by user. Current position and sizes can be obtained |
60 | changed by user. Current position and sizes can be obtained |
61 | by function 9. |
61 | by function 9. |
62 | * The window must fit on the screen. If the transferred |
62 | * The window must fit on the screen. If the transferred |
63 | coordinates and sizes do not satisfy to this condition, |
63 | coordinates and sizes do not satisfy to this condition, |
Line 866... | Line 866... | ||
866 | * function does not return value |
866 | * function does not return value |
867 | Structure of the buffer: |
867 | Structure of the buffer: |
868 | db a,b,c,d for version a.b.c.d |
868 | db a,b,c,d for version a.b.c.d |
869 | db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2 |
869 | db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2 |
870 | dd REV - kernel SVN revision number |
870 | dd REV - kernel SVN revision number |
871 | For Kolibri 0.7.0.0 kernel: |
871 | For Kolibri 0.7.1.0 kernel: |
872 | db 0,7,0,0 |
872 | db 0,7,0,0 |
873 | db 2 |
873 | db 2 |
874 | dd 533 |
874 | dd 638 |
Line 875... | Line 875... | ||
875 | 875 | ||
876 | ====================================================================== |
876 | ====================================================================== |
877 | ======= Function 18, subfunction 14 - wait for screen retrace. ======= |
877 | ======= Function 18, subfunction 14 - wait for screen retrace. ======= |
878 | ====================================================================== |
878 | ====================================================================== |
Line 976... | Line 976... | ||
976 | * ecx = 4 - subsubfunction number |
976 | * ecx = 4 - subsubfunction number |
977 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
977 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
978 | Returned value: |
978 | Returned value: |
979 | * function does not return value |
979 | * function does not return value |
Line 980... | Line 980... | ||
980 | 980 | ||
981 | -------- Subsubfunction 5 - emulation mouse button. -------- |
981 | -------- Subsubfunction 5 - simulate state of mouse buttons. --------- |
982 | Parameters: |
982 | Parameters: |
983 | * eax = 18 - function number |
983 | * eax = 18 - function number |
984 | * ebx = 19 - subfunction number |
984 | * ebx = 19 - subfunction number |
985 | * ecx = 5 - subsubfunction number |
985 | * ecx = 5 - subsubfunction number |
- | 986 | * edx = information about emulated state of mouse buttons: |
|
986 | * edx = information about the emulated mouse buttons: |
987 | (same as return value in subfunction 2 of function 37) |
987 | * bit 0 is set = left button is pressed |
988 | * bit 0 is set = left button is pressed |
988 | * bit 1 is set = right button is pressed |
989 | * bit 1 is set = right button is pressed |
989 | * bit 2 is set = middle button is pressed |
990 | * bit 2 is set = middle button is pressed |
990 | * bit 3 is set = 4th button is pressed |
991 | * bit 3 is set = 4th button is pressed |
991 | * bit 4 is set = 5th button is pressed |
- | |
992 | * other bits are cleared |
992 | * bit 4 is set = 5th button is pressed |
993 | Returned value: |
993 | Returned value: |
994 | * function does not return value |
- | |
995 | 994 | * function does not return value |
|
996 | Remarks: |
995 | Remarks: |
997 | * It is recommended to set speed of the mouse (in subsubfunction 1) |
996 | * It is recommended to set speed of the mouse (in subsubfunction 1) |
998 | from 1 up to 9. The installed value is not inspected by the kernel |
997 | from 1 up to 9. The installed value is not inspected by the kernel |
999 | code, so set it carefully, at incorrect value the cursor |
998 | code, so set it carefully, at incorrect value the cursor |
Line 1033... | Line 1032... | ||
1033 | (reserved) |
1032 | (reserved) |
1034 | * +32: dword: size of maximum allocated block in kernel heap |
1033 | * +32: dword: size of maximum allocated block in kernel heap |
1035 | (reserved) |
1034 | (reserved) |
Line 1036... | Line 1035... | ||
1036 | 1035 | ||
1037 | ====================================================================== |
1036 | ====================================================================== |
1038 | ====================== Function 18, subfunction 21 ===================== |
1037 | ===================== Function 18, subfunction 21 ==================== |
1039 | === Get number of the slot of process/thread at his identificator ==== |
1038 | ======== Get slot number of process/thread by the identifier. ======== |
1040 | ====================================================================== |
1039 | ====================================================================== |
1041 | Parameters: |
1040 | Parameters: |
1042 | * eax = 18 - function number |
1041 | * eax = 18 - function number |
1043 | * ebx = 21 - subfunction number |
1042 | * ebx = 21 - subfunction number |
1044 | * ecx = PID/TID (process/thread identificator) |
1043 | * ecx = identifer of process/thread (PID/TID) |
1045 | Returned value: |
1044 | Returned value: |
1046 | * eax = number of the slot of process/thread, if it really present |
1045 | * eax = 0 - error (invalid identifier) |
Line 1047... | Line 1046... | ||
1047 | or 0, if PID/TID is false |
1046 | * otherwise eax = slot number |
1048 | 1047 | ||
1049 | ====================================================================== |
1048 | ====================================================================== |
1050 | ==================== Function 18, subfunction 22 ===================== |
1049 | ===================== Function 18, subfunction 22 ==================== |
1051 | ============= Minimize/restore window of process/thread ============== |
1050 | ============== Operations with window of another thread. ============= |
1052 | ====================================================================== |
1051 | ====================================================================== |
1053 | Parameters: |
1052 | Parameters: |
1054 | * eax = 18 - function number |
1053 | * eax = 18 - function number |
1055 | * ebx = 22 - subfunction number |
1054 | * ebx = 22 - subfunction number |
1056 | * ecx = Operation type |
1055 | * ecx = operation type: |
1057 | 0 - minimize (roll to panel) at number on slot thread |
1056 | * 0 = minimize window of the thread with given slot number |
1058 | 1 - minimize window at PID/TID identificator |
1057 | * 1 = minimize window of the thread with given identifier |
1059 | 2 - restore minimized window at slot number of thread |
1058 | * 2 = restore window of the thread with given slot number |
1060 | 3 - restore minimized window at PID/TID identificator |
1059 | * 3 = restore window of the thread with given identifier |
1061 | * edx = Operation argument (Number of slot or a PID/TID) |
1060 | * edx = parameter (slot number or PID/TID) |
1062 | Returned value: |
1061 | Returned value: |
- | 1062 | * eax = 0 - success |
|
- | 1063 | * eax = -1 - error (invalid identifier) |
|
- | 1064 | Remarks: |
|
- | 1065 | * The thread can minimize its window with subfunction 10. |
|
Line 1063... | Line 1066... | ||
1063 | * eax = 0 - successfully ending |
1066 | * One can restore and activate window simultaneously with |
1064 | eax = -1 - error |
1067 | subfunction 3 (which requires slot number). |
1065 | 1068 | ||
Line 1489... | Line 1492... | ||
1489 | Remarks: |
1492 | Remarks: |
1490 | * Previously CD base port must be defined by call to |
1493 | * Previously CD base port must be defined by call to |
1491 | subfunction 3 of function 21. |
1494 | subfunction 3 of function 21. |
Line 1492... | Line 1495... | ||
1492 | 1495 | ||
1493 | ====================================================================== |
1496 | ====================================================================== |
1494 | ================ Function 24, subfunction 4 - eject tray of disk drive. ============== |
1497 | ======= Function 24, subfunction 4 - eject tray of disk drive. ======= |
1495 | ====================================================================== |
1498 | ====================================================================== |
1496 | Parameters: |
1499 | Parameters: |
1497 | * eax = 24 - function number |
1500 | * eax = 24 - function number |
- | 1501 | * ebx = 4 - subfunction number |
|
1498 | * ebx = 4 - subfunction number |
1502 | * ecx = position of CD/DVD-drive |
1499 | * ecx = position of CD/DVD-drive (from 0=Primary Master to 3=Secondary Slave) |
1503 | (from 0=Primary Master to 3=Secondary Slave) |
1500 | Returned value: |
1504 | Returned value: |
1501 | * Nothing comes back. |
1505 | * function does not return value |
1502 | Remarks: |
1506 | Remarks: |
1503 | * The function is supported only for ATAPI devices (CD and DVD). |
1507 | * The function is supported only for ATAPI devices (CD and DVD). |
- | 1508 | * When the tray is being ejected, |
|
1504 | * At extract of a tray is made deblocking of handle mechanism of a tray. |
1509 | manual control of tray is unlocked. |
- | 1510 | * When the tray is being ejected, the code clears the cache for |
|
1505 | * At extract of a tray the code makes clearing the cache of the appropriate device. |
1511 | corresponding device. |
Line 1506... | Line 1512... | ||
1506 | * An example of usage of the function is the application CD_tray. |
1512 | * An example of usage of the function is the application CD_tray. |
1507 | 1513 | ||
1508 | ====================================================================== |
1514 | ====================================================================== |
1509 | ============== Function 24, subfunction 5 - load tray of disk drive. ================= |
1515 | ======== Function 24, subfunction 5 - load tray of disk drive. ======= |
1510 | ====================================================================== |
1516 | ====================================================================== |
1511 | Parameters: |
1517 | Parameters: |
- | 1518 | * eax = 24 - function number |
|
1512 | * eax = 24 - function number |
1519 | * ebx = 5 - subfunction number |
1513 | * ebx = 5 - subfunction number |
1520 | * ecx = position of CD/DVD-drive |
1514 | * ecx = position of CD/DVD-drive (from 0=Primary Master to 3=Secondary Slave) |
1521 | (from 0=Primary Master to 3=Secondary Slave) |
1515 | Returned value: |
1522 | Returned value: |
1516 | * Nothing comes back. |
1523 | * function does not return value |
1517 | Remarks: |
1524 | Remarks: |
Line 1518... | Line 1525... | ||
1518 | * The function is supported only for ATAPI devices (CD and DVD). |
1525 | * The function is supported only for ATAPI devices (CD and DVD). |
Line 2962... | Line 2969... | ||
2962 | the program. |
2969 | the program. |
2963 | * The data must be kept in the memory at least up to the end |
2970 | * The data must be kept in the memory at least up to the end |
2964 | of play. |
2971 | of play. |
Line 2965... | Line 2972... | ||
2965 | 2972 | ||
- | 2973 | ====================================================================== |
|
- | 2974 | ======================= Function 57 - PCI BIOS. ====================== |
|
- | 2975 | ====================================================================== |
|
- | 2976 | Parameters: |
|
- | 2977 | * eax = 57 - function number |
|
- | 2978 | * ebp corresponds to al in PCI BIOS specification |
|
- | 2979 | * other registers are set according to PCI BIOS specification |
|
- | 2980 | Returned value: |
|
- | 2981 | * CF is undefined |
|
- | 2982 | * other registers are set according to PCI BIOS specification |
|
- | 2983 | Remarks: |
|
- | 2984 | * Many effects of this function can be also achieved with |
|
- | 2985 | corresponding subfunctions of function 62. |
|
- | 2986 | * The function calls PCI32 BIOS extension, documented e.g. in |
|
- | 2987 | http://alpha1.dyns.net/files/PCI/bios21.pdf. |
|
- | 2988 | * If BIOS does not support this extension, its behavior is emulated |
|
- | 2989 | (through kernel-mode analogues of subfunctions of function 62). |
|
- | 2990 | ||
2966 | ====================================================================== |
2991 | ====================================================================== |
2967 | ================ Function 58 - work with file system. ================ |
2992 | ================ Function 58 - work with file system. ================ |
2968 | ====================================================================== |
2993 | ====================================================================== |
2969 | Parameters: |
2994 | Parameters: |
2970 | * eax = 58 |
2995 | * eax = 58 |
Line 4146... | Line 4171... | ||
4146 | * subfunction 8 - delete file/folder |
4171 | * subfunction 8 - delete file/folder |
4147 | * subfunction 9 - create folder |
4172 | * subfunction 9 - create folder |
4148 | For CD-drives due to hardware limitations only subfunctions |
4173 | For CD-drives due to hardware limitations only subfunctions |
4149 | 0,1,5 and 7 are available, other subfunctions return error |
4174 | 0,1,5 and 7 are available, other subfunctions return error |
4150 | with code 2. |
4175 | with code 2. |
4151 | At the first call subfunctions 0,1,5,7 to devices ATAPI (CD and DVD) the locking |
4176 | At the first call of subfunctions 0,1,5,7 to ATAPI devices |
4152 | of handle mechanism of a tray is made. It is connected to algorithm of caching |
4177 | (CD and DVD) the manual control of tray is locked due to caching |
4153 | given obtained from a drive. Deblocking is made by call function 24.4 |
4178 | drive data. Unlocking is made when subfunction 4 of function 24 |
4154 | to the appropriate device. |
4179 | is called for corresponding device. |
Line 4155... | Line 4180... | ||
4155 | 4180 | ||
4156 | ====================================================================== |
4181 | ====================================================================== |
4157 | === Function 70, subfunction 0 - read file with long names support. == |
4182 | === Function 70, subfunction 0 - read file with long names support. == |
4158 | ====================================================================== |
4183 | ====================================================================== |