Rev 6790 | Rev 6800 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6790 | Rev 6798 | ||
---|---|---|---|
Line 1675... | Line 1675... | ||
1675 | ---------------------- Constants for registers: ---------------------- |
1675 | ---------------------- Constants for registers: ---------------------- |
1676 | eax - SF_GET_SYS_DATE (29) |
1676 | eax - SF_GET_SYS_DATE (29) |
1677 | ====================================================================== |
1677 | ====================================================================== |
1678 | ============= Function 30 - work with the current folder. ============ |
1678 | ============= Function 30 - work with the current folder. ============ |
1679 | ====================================================================== |
1679 | ====================================================================== |
1680 | - | ||
1681 | --------- Subfunction 1 - set current folder for the thread. --------- |
1680 | --------- Subfunction 1 - set current folder for the thread. --------- |
1682 | Parameters: |
1681 | Parameters: |
1683 | * eax = 30 - function number |
1682 | * eax = 30 - function number |
1684 | * ebx = 1 - subfunction number |
1683 | * ebx = 1 - subfunction number |
1685 | * ecx = pointer to string with the path to new current folder, |
1684 | * ecx = pointer to string with the path to new current folder, |
1686 | rules of path forming can be found in function 70 description. |
1685 | rules of path forming can be found in function 70 description. |
1687 | Returned value: |
1686 | Returned value: |
1688 | * function does not return value |
1687 | * function does not return value |
1689 | - | ||
- | 1688 | ---------------------------------------------------------------------- |
|
1690 | --------- Subfunction 2 - get current folder for the thread. --------- |
1689 | --------- Subfunction 2 - get current folder for the thread. --------- |
1691 | Parameters: |
1690 | Parameters: |
1692 | * eax = 30 - function number |
1691 | * eax = 30 - function number |
1693 | * ebx = 2 - subfunction number |
1692 | * ebx = 2 - subfunction number |
1694 | * ecx = pointer to buffer |
1693 | * ecx = pointer to buffer |
1695 | * edx = size of buffer |
1694 | * edx = size of buffer |
1696 | Returned value: |
1695 | Returned value: |
1697 | * eax = size of the current folder's name (including terminating 0) |
1696 | * eax = size of the string (including terminating 0) |
1698 | Remarks: |
1697 | Remarks: |
1699 | * If the buffer is too small to hold all data, only first (edx-1) |
1698 | * If the buffer is too small to hold all path, only part of the string |
1700 | bytes are copied and than terminating 0 is inserted. |
1699 | will be copied and terminated with 0. |
1701 | * By default, current folder for the thread is "/rd/1". |
1700 | * By default, current folder for the thread is "/rd/1". |
1702 | * At process/thread creation the current folder will be inherited |
1701 | * At process/thread creation the current folder will be inherited |
1703 | from the parent. |
1702 | from the parent. |
1704 | - | ||
- | 1703 | ---------------------------------------------------------------------- |
|
1705 | --- Subfunction 3 - install the add.system directory for the kernel -- |
1704 | --- Subfunction 3 - install the add.system directory for the kernel -- |
1706 | Parameters: |
1705 | Parameters: |
1707 | * eax = 30 - function number |
1706 | * eax = 30 - function number |
1708 | * ebx = 3 - subfunction number |
1707 | * ebx = 3 - subfunction number |
1709 | * ecx = pointer to a block of data: |
1708 | * ecx = pointer to a block of data: |
1710 | for cp866 encoding: |
- | |
1711 | key rb 64 |
1709 | key rb 64 |
1712 | path rb 64 |
1710 | path rb 64 |
1713 | for UTF-16LE encoding: |
- | |
1714 | key rb 64 |
- | |
1715 | dw 2 |
- | |
1716 | path rw 31 |
- | |
1717 | Example: |
1711 | Example: |
1718 | align 64 |
1712 | align 64 |
1719 | key db 'kolibrios',0 ; key must be in lower case |
1713 | key db 'kolibrios',0 ; key must be in lower case |
1720 | align 64 |
1714 | align 64 |
1721 | path db 'HD0/1',0 |
1715 | path db 'HD0/1',0 |
Line 1722... | Line 1716... | ||
1722 | 1716 | ||
1723 | Returned value: |
1717 | Returned value: |
1724 | * function does not return value |
1718 | * function does not return value |
1725 | Remarks: |
1719 | Remarks: |
1726 | * The function can be called only 1 time for 1 session of the OS. |
1720 | * The function can be called only 1 time for 1 session of the OS. |
1727 | * The key is not affected by encoding. |
- | |
- | 1721 | * On input the symbolic key is not changing by encoding. |
|
1728 | 1722 | ---------------------------------------------------------------------- |
|
1729 | ------ Subfunction 4 - get current folder in UTF-16LE encoding. ------ |
1723 | ---- Subfunction 4 - set current folder, specifying the encoding. ---- |
1730 | Parameters: |
1724 | Parameters: |
1731 | * eax = 30 - function number |
1725 | * eax = 30 - function number |
- | 1726 | * ebx = 4 - subfunction number |
|
- | 1727 | * ecx = pointer to string with the path to new current folder |
|
- | 1728 | * edx = string encoding, details can be found in function 80 description. |
|
- | 1729 | Returned value: |
|
- | 1730 | * function does not return value |
|
- | 1731 | ---------------------------------------------------------------------- |
|
- | 1732 | ---- Subfunction 5 - get current folder, specifying the encoding. ---- |
|
- | 1733 | Parameters: |
|
- | 1734 | * eax = 30 - function number |
|
1732 | * ebx = 4 - subfunction number |
1735 | * ebx = 5 - subfunction number |
1733 | * ecx = pointer to buffer |
1736 | * ecx = pointer to buffer |
- | 1737 | * edx = size of buffer |
|
1734 | * edx = size of buffer |
1738 | * esi = string encoding |
1735 | Returned value: |
1739 | Returned value: |
1736 | * eax = number of chars in the buffer (including terminating 0) |
1740 | * eax = size of the string in bytes (including terminating 0) |
1737 | Remarks: |
1741 | Remarks: |
1738 | * If the buffer is too small to hold all data, only first (edx-2) |
1742 | * If the buffer is too small to hold all path, only part of the string |
1739 | bytes are copied and than terminating 0 is inserted. |
1743 | will be copied and terminated with 0. |
1740 | * By default, current folder for the thread is "/rd/1". |
1744 | * By default, current folder for the thread is "/rd/1". |
1741 | * At process/thread creation the current folder will be inherited |
1745 | * At process/thread creation the current folder will be inherited |
Line 1742... | Line 1746... | ||
1742 | from the parent. |
1746 | from the parent. |
Line 3341... | Line 3345... | ||
3341 | 3345 | ||
3342 | ---------------------- Constants for registers: ---------------------- |
3346 | ---------------------- Constants for registers: ---------------------- |
3343 | eax - SF_SYS_MISC (68) |
3347 | eax - SF_SYS_MISC (68) |
3344 | ebx - SSF_CONTROL_DRIVER (17) |
3348 | ebx - SSF_CONTROL_DRIVER (17) |
3345 | ====================================================================== |
3349 | ====================================================================== |
3346 | =============== Function 68, subfunction 19 - load DLL. ============== |
3350 | == Function 68, subfunction 18 - load DLL, specifying the encoding. == |
3347 | ====================================================================== |
3351 | ====================================================================== |
3348 | Parameters: |
3352 | Parameters: |
3349 | * eax = 68 - function number |
3353 | * eax = 68 - function number |
3350 | * ebx = 19 - subfunction number |
3354 | * ebx = 18 - subfunction number |
3351 | * ecx = pointer to the string with path to DLL, |
3355 | * ecx = pointer to the string with path to DLL |
3352 | rules of path forming can be found in function 70 description. |
3356 | * edx = string encoding, details can be found in function 80 description. |
3353 | Returned value: |
3357 | Returned value: |
3354 | * eax = 0 - failed |
3358 | * eax = 0 - failed |
3355 | * otherwise eax = pointer to DLL export table |
3359 | * otherwise eax = pointer to DLL export table |
3356 | Remarks: |
3360 | Remarks: |
3357 | * Export table is an array of structures of 2 dword's, terminated |
3361 | * Export table is an array of structures of 2 dword's, terminated |
3358 | by zero. The first dword in structure points to function name, |
3362 | by zero. The first dword in structure points to function name, |
Line -... | Line 3363... | ||
- | 3363 | the second dword contains address of function. |
|
- | 3364 | ||
- | 3365 | ====================================================================== |
|
- | 3366 | =============== Function 68, subfunction 19 - load DLL. ============== |
|
- | 3367 | ====================================================================== |
|
- | 3368 | Parameters: |
|
- | 3369 | * eax = 68 - function number |
|
- | 3370 | * ebx = 19 - subfunction number |
|
- | 3371 | * ecx = pointer to the string with path to DLL, |
|
- | 3372 | rules of path forming can be found in function 70 description. |
|
- | 3373 | Returned value: |
|
- | 3374 | * eax = 0 - failed |
|
3359 | the second dword contains address of function. |
3375 | * otherwise eax = pointer to DLL export table |
3360 | 3376 | ||
3361 | ---------------------- Constants for registers: ---------------------- |
3377 | ---------------------- Constants for registers: ---------------------- |
3362 | eax - SF_SYS_MISC (68) |
3378 | eax - SF_SYS_MISC (68) |
3363 | ebx - SSF_LOAD_DLL (19) |
3379 | ebx - SSF_LOAD_DLL (19) |
Line 3550... | Line 3566... | ||
3550 | 3566 | ||
3551 | ---------------------- Constants for registers: ---------------------- |
3567 | ---------------------- Constants for registers: ---------------------- |
3552 | eax - SF_SYS_MISC (68) |
3568 | eax - SF_SYS_MISC (68) |
3553 | ebx - SSF_LOAD_FILE (27) |
3569 | ebx - SSF_LOAD_FILE (27) |
- | 3570 | ====================================================================== |
|
- | 3571 | == Function 68, subfunction 28 - load file, specifying the encoding == |
|
- | 3572 | ====================================================================== |
|
- | 3573 | Parameters: |
|
- | 3574 | * eax = 68 - function number |
|
- | 3575 | * ebx = 28 - subfunction number |
|
- | 3576 | * ecx = pointer to the string with path to file |
|
- | 3577 | * edx = string encoding, details can be found in function 80 description. |
|
- | 3578 | Returned value: |
|
- | 3579 | * eax = pointer to the loaded file, or zero |
|
- | 3580 | * edx = size of the loaded file, or zero |
|
- | 3581 | Remarks: |
|
- | 3582 | * function loads file and unpacks, if necessary |
|
- | 3583 | ||
3554 | ====================================================================== |
3584 | ====================================================================== |
3555 | ====================== Function 69 - debugging. ====================== |
3585 | ====================== Function 69 - debugging. ====================== |
3556 | ====================================================================== |
3586 | ====================================================================== |
3557 | A process can load other process as debugged by set of corresponding |
3587 | A process can load other process as debugged by set of corresponding |
3558 | bit by call to subfunction 7 of function 70. |
3588 | bit by call to subfunction 7 of function 70. |
Line 3845... | Line 3875... | ||
3845 | Returned value: |
3875 | Returned value: |
3846 | * eax = 0 - success; otherwise file system error code |
3876 | * eax = 0 - success; otherwise file system error code |
3847 | * some subfunctions return value in other registers too |
3877 | * some subfunctions return value in other registers too |
3848 | General format of the information structure: |
3878 | General format of the information structure: |
3849 | * +0: dword: subfunction number |
3879 | * +0: dword: subfunction number |
3850 | * +4: dword: file offset |
3880 | * +4: dword: offset in file or folder |
3851 | * +8: dword: high dword of offset (must be 0) or flags field |
3881 | * +8: dword: higher part of offset or flags |
3852 | * +12 = +0xC: dword: size |
3882 | * +12 = +0xC: dword: size of data |
3853 | * +16 = +0x10: dword: pointer to data |
3883 | * +16 = +0x10: dword: pointer to data |
3854 | * +20 = +0x14: ?: path - zero terminated string |
3884 | * +20 = +0x14: ?: path - zero terminated string |
3855 | or |
3885 | or |
3856 | * +20 = +0x14: byte: 0 |
3886 | * +20 = +0x14: byte: 0 |
3857 | * +21 = +0x15: dword: pointer to string |
3887 | * +21 = +0x15: dword: pointer to string |
3858 | Case sensitivity depends on filesystem. |
3888 | Case sensitivity depends on filesystem. |
3859 | If a path not begins with '/', it is considered a relative. |
3889 | If a path not begins with '/', it is considered a relative. |
3860 | To get or set the current folder, use the function 30. |
3890 | To get or set the current folder, use the sysfunction 30. |
3861 | '../' in the beginning means a lift by one folder relatively current folder. |
3891 | '../' in the path means a lift by one folder relatively current folder. |
3862 | To set the encoding, put at the start of the string a byte with next values: |
3892 | To set the encoding, put at the start of the string a byte with next values: |
3863 | * 1 = cp866 |
3893 | * 1 = cp866 |
3864 | * 2 = UTF-16LE |
3894 | * 2 = UTF-16LE |
3865 | * 3 = UTF-8 |
3895 | * 3 = UTF-8 |
3866 | otherwise will be used cp866. In an absolute path |
3896 | otherwise will be used cp866. In an absolute path |
3867 | you may put this byte after the '/' or put an additional '/' before it. |
3897 | you may put this byte after the '/' or put an additional '/' before it. |
- | 3898 | Also, you may use the sysfunction 80. |
|
3868 | Format of an absolute path: |
3899 | Format of an absolute path: |
3869 | /base/number/dir1/dir2/.../dirn/file, |
3900 | /base/number/dir1/dir2/.../dirn/file, |
3870 | where base/number identifies device, on which file is located: |
3901 | where base/number identifies device, on which file is located: |
3871 | * RD/1 = ramdisk |
3902 | * RD/1 = ramdisk |
3872 | * FD/1 = first floppy drive, |
3903 | * FD/1 = first floppy drive, |
Line 3943... | Line 3974... | ||
3943 | * eax = 70 - function number |
3974 | * eax = 70 - function number |
3944 | * ebx = pointer to the information structure |
3975 | * ebx = pointer to the information structure |
3945 | Format of the information structure: |
3976 | Format of the information structure: |
3946 | * +0: dword: 1 = subfunction number |
3977 | * +0: dword: 1 = subfunction number |
3947 | * +4: dword: index of starting block (beginning from 0) |
3978 | * +4: dword: index of starting block (beginning from 0) |
3948 | * +8: dword: encoding: |
3979 | * +8: dword: names encoding: |
- | 3980 | 0 = default |
|
3949 | * 0 = cp866 -> byte per char |
3981 | 1 = cp866 |
3950 | * 1 = UTF-16LE -> word per char |
3982 | 2 = UTF-16LE |
- | 3983 | 3 = UTF-8 |
|
3951 | * +12 = +0xC: dword: number of blocks to read |
3984 | * +12 = +0xC: dword: number of blocks to read |
3952 | * +16 = +0x10: dword: pointer to buffer for data, buffer size |
3985 | * +16 = +0x10: dword: pointer to buffer for data |
3953 | must be not less than 32+n(40+256*enc+8) bytes |
- | |
3954 | * +20 = +0x14: path, general rules of names forming |
3986 | * +20 = +0x14: path, general rules of names forming |
3955 | Returned value: |
3987 | Returned value: |
3956 | * eax = 0 - success, otherwise file system error code |
3988 | * eax = 0 - success, otherwise file system error code |
3957 | * ebx = number of files, information on which was written to |
3989 | * ebx = number of files, information on which was written to |
3958 | the buffer, or -1=0xffffffff, if folder was not found |
3990 | the buffer, or -1=0xffffffff, if folder was not found |
Line 3980... | Line 4012... | ||
3980 | * bit 5 (mask 0x20): file was not archived - many archivation |
4012 | * bit 5 (mask 0x20): file was not archived - many archivation |
3981 | programs have an option to archive only files with this bit set, |
4013 | programs have an option to archive only files with this bit set, |
3982 | and after archiving this bit is cleared - it can be useful |
4014 | and after archiving this bit is cleared - it can be useful |
3983 | for automatically creating of backup-archives as at writing |
4015 | for automatically creating of backup-archives as at writing |
3984 | this bit is usually set |
4016 | this bit is usually set |
3985 | * +4: dword: encoding: |
4017 | * +4: dword: encoding, equals to field +8 in the information structure |
3986 | * 0 = cp866 -> byte per char |
- | |
3987 | * 1 = UTF-16LE -> word per char |
- | |
3988 | * +8: 4*byte: time of file creation |
4018 | * +8: 4*byte: time of file creation |
3989 | * +12 = +0xC: 4*byte: date of file creation |
4019 | * +12 = +0xC: 4*byte: date of file creation |
3990 | * +16 = +0x10: 4*byte: time of last access (read or write) |
4020 | * +16 = +0x10: 4*byte: time of last access (read or write) |
3991 | * +20 = +0x14: 4*byte: date of last access |
4021 | * +20 = +0x14: 4*byte: date of last access |
3992 | * +24 = +0x18: 4*byte: time of last modification |
4022 | * +24 = +0x18: 4*byte: time of last modification |
3993 | * +28 = +0x1C: 4*byte: date of last modification |
4023 | * +28 = +0x1C: 4*byte: date of last modification |
3994 | * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb) |
4024 | * +32 = +0x20: qword: file size in bytes (up to 16777216 Tb) |
3995 | * +40 = +0x28: (256*enc+8)*byte: name |
4025 | * +40 = +0x28: name, 264 bytes in cp866, otherwise - 520 bytes. |
3996 | Time format: |
4026 | Time format: |
3997 | * +0: byte: seconds |
4027 | * +0: byte: seconds |
3998 | * +1: byte: minutes |
4028 | * +1: byte: minutes |
3999 | * +2: byte: hours |
4029 | * +2: byte: hours |
4000 | * +3: byte: reserved (0) |
4030 | * +3: byte: reserved (0) |
Line 4004... | Line 4034... | ||
4004 | * +1: byte: month |
4034 | * +1: byte: month |
4005 | * +2: word: year |
4035 | * +2: word: year |
4006 | * for example, 25.11.1979 is written as (in hex) 19 0B BB 07 |
4036 | * for example, 25.11.1979 is written as (in hex) 19 0B BB 07 |
4007 | Remarks: |
4037 | Remarks: |
4008 | * If BDFE contains cp866 name, the length of BDFE is 304 bytes, |
4038 | * If BDFE contains cp866 name, the length of BDFE is 304 bytes, |
4009 | if UTF-16LE name - 560 bytes. Value of length is aligned |
4039 | otherwise - 560 bytes. |
4010 | on 16-byte bound to accelerate processing in CPU cache. |
- | |
4011 | * Name string is zero terminated, further data contain garbage. |
4040 | * Name string is zero terminated, further data contain garbage. |
4012 | * If files in folder were ended before requested number was read, |
4041 | * If files in folder were ended before requested number was read, |
4013 | the function will read as many as it can, and after that return |
4042 | the function will read as many as it can, and after that return |
4014 | eax=6 (EOF). |
4043 | eax=6 (EOF). |
4015 | * Any folder on the disk, except for root, contains two special |
4044 | * Any folder on the disk, except for root, contains two special |
Line 5045... | Line 5074... | ||
5045 | 5074 | ||
5046 | ---------------------- Constants for registers: ---------------------- |
5075 | ---------------------- Constants for registers: ---------------------- |
5047 | eax - SF_FUTEX (77) |
5076 | eax - SF_FUTEX (77) |
5048 | ebx - SSF_WAKE (3) |
5077 | ebx - SSF_WAKE (3) |
- | 5078 | ====================================================================== |
|
- | 5079 | === Function 80 - file system interface with parameter of encoding === |
|
- | 5080 | ====================================================================== |
|
- | 5081 | Parameters: |
|
- | 5082 | * eax = 80 |
|
- | 5083 | * ebx = pointer to the information structure |
|
- | 5084 | Returned value: |
|
- | 5085 | * eax = 0 - success; otherwise file system error code |
|
- | 5086 | * some subfunctions return value in other registers too |
|
- | 5087 | General format of the information structure: |
|
- | 5088 | * +0: dword: subfunction number |
|
- | 5089 | * +4: dword: offset in file or folder |
|
- | 5090 | * +8: dword: higher part of offset or flags |
|
- | 5091 | * +12 = +0xC: dword: size of data |
|
- | 5092 | * +16 = +0x10: dword: pointer to data |
|
- | 5093 | * +20 = +0x14: dword: string encoding: |
|
- | 5094 | 1 = cp866 |
|
- | 5095 | 2 = UTF-16LE |
|
- | 5096 | 3 = UTF-8 |
|
- | 5097 | 0 = default (supports encoding byte at the start of the string) |
|
- | 5098 | * +24 = +0x18: dword: pointer to zero terminated string with path |
|
- | 5099 | ||
- | 5100 | The rest is similar to sysfunction 70. |
|
- | 5101 | ||
5049 | ====================================================================== |
5102 | ====================================================================== |
5050 | =============== Function -1 - terminate thread/process =============== |
5103 | =============== Function -1 - terminate thread/process =============== |
5051 | ====================================================================== |
5104 | ====================================================================== |
5052 | Parameters: |
5105 | Parameters: |
5053 | * eax = -1 - function number |
5106 | * eax = -1 - function number |