/kernel/trunk/core/syscall.inc |
---|
133,7 → 133,7 |
dd 0 |
dd 0 ; |
dd 0 |
dd sys_current_directory ; 30-Get/SetCurrentDirectory |
dd 0 ; 30-Get/SetCurrentDirectory |
dd 0 |
dd 0 |
dd 0 |
142,11 → 142,11 |
dd 0 |
dd 0 ; 37-GetMousePosition_ScreenRelative,. |
dd 0 ; 38-DrawLine |
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,. |
dd 0 ; 39-GetBackgroundSize,ReadBgrData,. |
dd 0 |
dd 0 |
dd 0 |
dd sys_outport ; 43-SendDeviceData |
dd 0 ; 43-SendDeviceData |
dd 0 |
dd 0 |
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea |
212,7 → 212,7 |
dd undefined_syscall ; 27-reserved |
dd undefined_syscall ; 28-reserved |
dd sys_date ; 29-GetDate |
dd cross_order ; 30-Get/SetCurrentDirectory |
dd sys_current_directory ; 30-Get/SetCurrentDirectory |
dd undefined_syscall ; 31-reserved |
dd undefined_syscall ; 32-reserved |
dd undefined_syscall ; 33-reserved |
221,11 → 221,11 |
dd syscall_getarea ; 36-GetArea |
dd readmousepos ; 37-GetMousePosition_ScreenRelative,. |
dd syscall_drawline ; 38-DrawLine |
dd cross_order ; 39-GetBackgroundSize,ReadBgrData,. |
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,. |
dd set_app_param ; 40-WantEvents |
dd syscall_getirqowner ; 41-GetIrqOwner |
dd get_irq_data ; 42-ReadIrqData |
dd cross_order ; 43-SendDeviceData |
dd sys_outport ; 43-SendDeviceData |
dd sys_programirq ; 44-ProgramIrqs |
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq |
dd cross_order ; 46-ReservePortArea and FreePortArea |
/kernel/trunk/docs/sysfuncr.txt |
---|
1,4 → 1,4 |
Kolibri 0.7.5.0 |
Kolibri 0.7.5.0+ |
®¬¥à äãªæ¨¨ ¯®¬¥é ¥âáï ¢ ॣ¨áâà eax. |
맮¢ á¨á⥬®© äãªæ¨¨ ®áãé¥á⢫ï¥âáï ª®¬ ¤®© "int 0x40". |
1677,6 → 1677,7 |
* ecx = 㪠§ â¥«ì ¡ãä¥à |
* edx = à §¬¥à ¡ãä¥à |
®§¢à é ¥¬®¥ § 票¥: |
* eax = - 1 ®é¨¡ª , ¯ ¯ª ⥪ã饣® ¯®â®ª ¨¬¥¥â ¤«¨ã ¡®«¥¥ 祬 4096 ᨬ¢®«®¢. |
* eax = ¤«¨ ¨¬¥¨ ⥪ã饩 ¯ ¯ª¨ (¢ª«îç ï § ¢¥àè î騩 0) |
¬¥ç ¨ï: |
* ᫨ à §¬¥à ¡ãä¥à ¥¤®áâ â®ç® ¤«ï ª®¯¨à®¢ ¨ï ¢á¥£® ¨¬¥¨, |
/kernel/trunk/fs/fs_lfn.inc |
---|
967,46 → 967,67 |
ret |
sys_current_directory: |
mov esi, [current_slot] |
mov esi, [esi+APPDATA.cur_dir] |
mov edx, esi |
dec eax |
; mov esi, [current_slot] |
; mov esi, [esi+APPDATA.cur_dir] |
; mov edx, esi |
;get lenght string of appdata.cur_dir |
; mov eax, [current_slot] |
; mov edi, [eax+APPDATA.cur_dir] |
dec ebx |
jz .set |
dec eax |
dec ebx |
jz .get |
ret |
.get: |
; sysfunction 30.2: [for app] eax=30,ebx=2,ecx->buffer,edx=len |
; for our code: ebx->buffer,ecx=len |
@@: |
lodsb |
test al, al |
jnz @b |
sub esi, edx |
inc esi |
mov [esp+36], esi |
cmp ecx, esi |
jbe @f |
mov ecx, esi |
@@: |
cmp ecx, 1 |
jbe .ret |
mov esi, edx |
mov edi, ebx |
mov al, '/' |
max_cur_dir equ 0x1000 |
;get lenght string of appdata.cur_dir |
mov eax, [current_slot] |
mov edi, [eax+APPDATA.cur_dir] |
mov ebx,edi |
push ecx |
push edi |
xor eax,eax |
mov ecx,max_cur_dir |
repne scasb ;find zerro at and string |
jcxz .error ;ecx=0 and destination buffer is too small. |
sub edi,ebx ;lenght for copy |
inc edi |
mov [esp+32+8],edi ;return in eax |
cmp edx,edi ;edi must have more than 2 (for / and 0x0) |
;sourse string |
pop esi |
;destination string |
pop edi |
jb .ret |
mov al,'/' ;start string with '/' |
stosb |
dec ecx |
dec ecx |
rep movsb |
mov byte [edi], 0 |
.ret: |
mov ecx,edx |
rep movsb ;copy string |
xor eax,eax |
mov byte [edi],al ;set zerro |
.ret: ret |
.error: add esp,8 |
or dword [esp+32],-1 ;error not found zerro at string ->[eax+APPDATA.cur_dir] |
ret |
.set: |
; sysfunction 30.1: [for app] eax=30,ebx=1,ecx->string |
; for our code: ebx->string to set |
; use generic resolver with APPDATA.cur_dir as destination |
push 0x1000 |
push edx |
push max_cur_dir ;0x1000 |
push edi ;destination |
mov ebx,ecx |
call get_full_file_name |
ret |
/kernel/trunk/kernel.asm |
---|
1180,60 → 1180,62 |
ret |
align 4 |
;input eax=43,bl-byte of output, ecx - number of port |
sys_outport: |
mov edi,ebx ; separate flag for read / write |
and ebx,65535 |
mov edi,ecx ; separate flag for read / write |
and ecx,65535 |
mov ecx,[RESERVED_PORTS] |
test ecx,ecx |
jne sopl8 |
mov [esp+36],dword 1 |
mov eax,[RESERVED_PORTS] |
test eax,eax |
jnz .sopl8 |
inc eax |
mov [esp+32],eax |
ret |
sopl8: |
.sopl8: |
mov edx,[TASK_BASE] |
mov edx,[edx+0x4] |
and ebx,65535 |
cld |
sopl1: |
;and ecx,65535 |
;cld - set on interrupt 0x40 |
.sopl1: |
mov esi,ecx |
mov esi,eax |
shl esi,4 |
add esi,RESERVED_PORTS |
cmp edx,[esi+0] |
jne sopl2 |
cmp ebx,[esi+4] |
jb sopl2 |
cmp ebx,[esi+8] |
jg sopl2 |
jmp sopl3 |
jne .sopl2 |
cmp ecx,[esi+4] |
jb .sopl2 |
cmp ecx,[esi+8] |
jg .sopl2 |
.sopl3: |
sopl2: |
test edi,0x80000000 ; read ? |
jnz .sopl4 |
dec ecx |
jnz sopl1 |
mov [esp+36],dword 1 |
mov eax,ebx |
mov dx,cx ; write |
out dx,al |
and [esp+32],dword 0 |
ret |
sopl3: |
.sopl2: |
test edi,0x80000000 ; read ? |
jnz sopl4 |
mov dx,bx ; write |
out dx,al |
and [esp+36],dword 0 |
dec eax |
jnz .sopl1 |
inc eax |
mov [esp+32],eax |
ret |
sopl4: |
mov dx,bx ; read |
.sopl4: |
mov dx,cx ; read |
in al,dx |
and eax,0xff |
and [esp+36],dword 0 |
mov [esp+24],eax |
and [esp+32],dword 0 |
mov [esp+20],eax |
ret |
display_number: |
2558,49 → 2560,49 |
align 4 |
sys_getbackground: |
cmp eax,1 ; SIZE |
; cmp eax,1 ; SIZE |
dec ebx |
jnz nogb1 |
mov eax,[BgrDataWidth] |
shl eax,16 |
mov ax,[BgrDataHeight] |
mov [esp+36],eax |
mov [esp+32],eax |
ret |
nogb1: |
cmp eax,2 ; PIXEL |
; cmp eax,2 ; PIXEL |
dec ebx |
jnz nogb2 |
mov eax, [img_background] |
test ebx, ebx |
test ecx, ecx |
jz @f |
cmp eax, static_background_data |
jz .ret |
@@: |
mov ecx, [mem_BACKGROUND] |
add ecx, 4095 |
and ecx, -4096 |
sub ecx, 4 |
cmp ebx, ecx |
mov ebx, [mem_BACKGROUND] |
add ebx, 4095 |
and ebx, -4096 |
sub ebx, 4 |
cmp ecx, ebx |
ja .ret |
mov eax,[ebx+eax] |
mov eax,[ecx+eax] |
and eax, 0xFFFFFF |
mov [esp+36],eax |
mov [esp+32],eax |
.ret: |
ret |
nogb2: |
cmp eax,4 ; TILED / STRETCHED |
; cmp eax,4 ; TILED / STRETCHED |
dec ebx |
jnz nogb4 |
mov eax,[BgrDrawMode] |
nogb4: |
mov [esp+36],eax |
mov [esp+32],eax |
ret |
align 4 |
sys_getkey: |