Rev 303 | Rev 321 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 303 | Rev 314 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | SYSTEM FUNCTIONS of OS Kolibri 0.6.3.0 |
1 | SYSTEM FUNCTIONS of OS Kolibri 0.6.4.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 848... | Line 848... | ||
848 | * function does not return value |
848 | * function does not return value |
849 | Structure of the buffer: |
849 | Structure of the buffer: |
850 | db a,b,c,d for version a.b.c.d |
850 | db a,b,c,d for version a.b.c.d |
851 | db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2 |
851 | db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2 |
852 | db 'name',0 - ASCIIZ-string with the name |
852 | db 'name',0 - ASCIIZ-string with the name |
853 | For Kolibri 0.6.3.0 kernel: |
853 | For Kolibri 0.6.4.0 kernel: |
854 | db 0,6,3,0 |
854 | db 0,6,4,0 |
855 | db 2 |
855 | db 2 |
856 | db 'Kolibri',0 |
856 | db 'Kolibri',0 |
Line 857... | Line 857... | ||
857 | 857 | ||
858 | ====================================================================== |
858 | ====================================================================== |
Line 2691... | Line 2691... | ||
2691 | * eax = 0 - port is used |
2691 | * eax = 0 - port is used |
2692 | * eax = 1 - port is free |
2692 | * eax = 1 - port is free |
2693 | * ebx destroyed |
2693 | * ebx destroyed |
Line 2694... | Line 2694... | ||
2694 | 2694 | ||
- | 2695 | ====================================================================== |
|
- | 2696 | ===== Function 53, subfunction 10 - query Ethernet cable status. ===== |
|
- | 2697 | ====================================================================== |
|
- | 2698 | Parameters: |
|
- | 2699 | * eax = 53 - function number |
|
- | 2700 | * ebx = 10 - subfunction number |
|
- | 2701 | Returned value: |
|
- | 2702 | * al = -1 - a network driver is not loaded or |
|
- | 2703 | does not support this function |
|
- | 2704 | * al = 0 - Ethernet cable is unplugged |
|
- | 2705 | * al = 1 - Ethernet cable is plugged |
|
- | 2706 | Remarks: |
|
- | 2707 | * The current kernel implementation supports this function |
|
- | 2708 | only for RTL8139 network cards. |
|
- | 2709 | ||
2695 | ====================================================================== |
2710 | ====================================================================== |
2696 | = Function 53, subfunction 255 - debug information of network driver. |
2711 | = Function 53, subfunction 255 - debug information of network driver. |
2697 | ====================================================================== |
2712 | ====================================================================== |
2698 | Parameters: |
2713 | Parameters: |
2699 | * eax = 53 - function number |
2714 | * eax = 53 - function number |
Line 3099... | Line 3114... | ||
3099 | of disk subsystem it is possible to deduce cluster size (there |
3114 | of disk subsystem it is possible to deduce cluster size (there |
3100 | it is stored in sectors) and total number of clusters |
3115 | it is stored in sectors) and total number of clusters |
3101 | for hard disks. |
3116 | for hard disks. |
Line 3102... | Line 3117... | ||
3102 | 3117 | ||
3103 | ====================================================================== |
- | |
3104 | =============== Function 59 - trace last system calls. =============== |
- | |
3105 | ====================================================================== |
- | |
3106 | Gets data on all system calls of all processes. |
- | |
3107 | Parameters: |
- | |
3108 | * eax = 59 - function number |
- | |
3109 | * ebx = 0 - unique subfunction |
- | |
3110 | * ecx = pointer to the buffer |
- | |
3111 | * edx = size of the buffer |
- | |
3112 | Returned value: |
- | |
3113 | * eax = total number of system calls made from system boot |
- | |
3114 | (modulo 2^32) |
- | |
3115 | * ebx = 0 |
- | |
3116 | Format of information on one call: (size = 0x40 = 64 bytes) |
- | |
3117 | * +0: dword: PID of process/thread |
- | |
3118 | * +4: 7*dword: garbage |
- | |
3119 | * +32 = +0x20: dword: value of edi at the call |
- | |
3120 | * +36 = +0x24: dword: esi |
- | |
3121 | * +40 = +0x28: dword: ebp |
- | |
3122 | * +44 = +0x2C: dword: stack pointer of the kernel handler |
- | |
3123 | * +48 = +0x30: dword: ebx |
- | |
3124 | * +52 = +0x34: dword: edx |
- | |
3125 | * +56 = +0x38: dword: ecx |
- | |
3126 | * +60 = +0x3C: dword: eax (=number of system function) |
- | |
3127 | Remarks: |
- | |
3128 | * The function is used only in the application 'systrace'. |
- | |
3129 | It is rather difficult to imagine a situation, in which |
- | |
3130 | this application or this function are really useful; |
- | |
3131 | and all system calls for support of this function are a little |
- | |
3132 | decelerated (though not strongly)... |
- | |
3133 | * So there is a proposition to delete from the kernel |
- | |
3134 | support of this function, together with application 'systrace'. |
- | |
3135 | * The information on system calls saves in the system |
- | |
3136 | ring buffer with 0x10 entries. |
- | |
3137 | This function simply copies the given size of data |
- | |
3138 | from this buffer to the given address. |
- | |
3139 | * One can determine, which entry in the buffer corresponds to |
- | |
3140 | last system call, by value of eax, namely, it is the entry |
- | |
3141 | (eax and 0xF) (at offset (eax and 0xF)*0x40). |
- | |
3142 | * In the current implementation there can be the seldom |
- | |
3143 | meeting problems of unsynchronization, when the information |
- | |
3144 | on some calls becomes outdated. |
- | |
3145 | * Under the system buffer one page, 4Kb, is allocated. |
- | |
3146 | Size of an entry = 64 bytes. Why only 16 entries are used, |
- | |
3147 | is not clearly. |
- | |
3148 | * The value of esp at the moment of system call cannot |
- | |
3149 | be determined by this function. |
- | |
3150 | * The current implementation does not check edx for correctness. |
- | |
3151 | - | ||
3152 | ====================================================================== |
3118 | ====================================================================== |
3153 | ========== Function 60 - Inter Process Communication (IPC). ========== |
3119 | ========== Function 60 - Inter Process Communication (IPC). ========== |
3154 | ====================================================================== |
3120 | ====================================================================== |
3155 | IPC is used for message dispatching from one process/thread to |
3121 | IPC is used for message dispatching from one process/thread to |
3156 | another. Previously it is necessary to agree how to interpret |
3122 | another. Previously it is necessary to agree how to interpret |
Line 3434... | Line 3400... | ||
3434 | Parameters: |
3400 | Parameters: |
3435 | * eax = 65 - function number |
3401 | * eax = 65 - function number |
3436 | * ebx = pointer to the image |
3402 | * ebx = pointer to the image |
3437 | * ecx = [size on axis x]*65536 + [size on axis y] |
3403 | * ecx = [size on axis x]*65536 + [size on axis y] |
3438 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
3404 | * edx = [coordinate on axis x]*65536 + [coordinate on axis y] |
3439 | * esi = number of bits per pixel, must be 8 |
3405 | * esi = number of bits per pixel, must be 8, 24 or 32 |
3440 | * edi = pointer to palette (256 colors 0x00RRGGBB) |
3406 | * edi = pointer to palette (256 colors 0x00RRGGBB); |
- | 3407 | ignored when esi = 24 and 32 |
|
- | 3408 | * ebp = offset of next row data relative to previous row data |
|
3441 | Returned value: |
3409 | Returned value: |
3442 | * function does not return value |
3410 | * function does not return value |
3443 | Remarks: |
3411 | Remarks: |
3444 | * Coordinates of the image are coordinates of the upper left corner |
3412 | * Coordinates of the image are coordinates of the upper left corner |
3445 | of the image relative to the window. |
3413 | of the image relative to the window. |
3446 | * Size of the image in bytes is xsize*ysize. |
3414 | * Size of the image in bytes is xsize*ysize. |
3447 | * Each byte of image is index in the palette. |
3415 | * Each byte of image is index in the palette. |
3448 | * If the image uses less than 256 colors, palette size may be |
3416 | * If the image uses less than 256 colors, palette size may be |
3449 | less than 256 too. |
3417 | less than 256 too. |
- | 3418 | * The call to function 7 is equivalent to call to this function |
|
- | 3419 | with esi=24, ebp=0. |
|
Line 3450... | Line 3420... | ||
3450 | 3420 | ||
3451 | ====================================================================== |
3421 | ====================================================================== |
3452 | ================== Function 66 - work with keyboard. ================= |
3422 | ================== Function 66 - work with keyboard. ================= |
3453 | ====================================================================== |
3423 | ====================================================================== |