Kernel updated to 0.7.0.0

git-svn-id: svn://kolibrios.org@536 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2007-06-07 13:34:43 +00:00
parent 5154195769
commit dea47105d0
5 changed files with 130 additions and 153 deletions

View File

@ -20,13 +20,8 @@ endl
push eax push eax
invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def
pop eax pop eax
stdcall strtoint,eax stdcall strtoint,eax
push eax mov [mouse_speed_factor], ax
pop edx
call _mouse_speed
popad
ret
;mouse_delay ;mouse_delay
lea eax,[par] lea eax,[par]
@ -34,9 +29,7 @@ endl
invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def
pop eax pop eax
stdcall strtoint,eax stdcall strtoint,eax
push eax mov [mouse_delay], eax
pop edx
call _mouse_delay
;[dev] ;[dev]
;sb16 ;sb16
@ -45,9 +38,12 @@ endl
invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def
pop eax pop eax
stdcall strtoint,eax stdcall strtoint,eax
push eax cmp eax, 0x100
pop ecx jb @f
call _sb16 cmp eax, 0x10000
jae @f
mov [sb16], eax
@@:
;sound_dma ;sound_dma
lea eax,[par] lea eax,[par]
@ -55,10 +51,10 @@ endl
invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def
pop eax pop eax
stdcall strtoint,eax stdcall strtoint,eax
push eax cmp eax, 3
pop ecx ja @f
call _sound_dma mov [sound_dma], eax
@@:
;midibase ;midibase
lea eax,[par] lea eax,[par]
@ -66,10 +62,15 @@ endl
invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def
pop eax pop eax
stdcall strtoint,eax stdcall strtoint,eax
push eax cmp eax, 0x100
pop ecx jb @f
call _midibase cmp eax, 0x10000
jae @f
mov [midi_base], ax
mov [mididp], eax
inc eax
mov [midisp], eax
@@:
popad popad
ret ret
@ -102,7 +103,11 @@ endl
invoke ini.get_int,conf_fname, unet, unet_active, 0 invoke ini.get_int,conf_fname, unet, unet_active, 0
or eax,eax or eax,eax
jz .do_not_set_net jz .do_not_set_net
call _net_up mov eax, [stack_config]
and eax, 0xFFFFFF80
add eax, 3
mov [stack_config], eax
call ash_eth_enable
;addr ;addr
lea eax,[par] lea eax,[par]
@ -110,9 +115,7 @@ endl
invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def
pop eax pop eax
stdcall do_inet_adr,eax stdcall do_inet_adr,eax
push eax mov [stack_ip], eax
pop ecx
call _net_addr
;mask ;mask
lea eax,[par] lea eax,[par]
@ -120,9 +123,7 @@ endl
invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def
pop eax pop eax
stdcall do_inet_adr,eax stdcall do_inet_adr,eax
push eax mov [subnet_mask], eax
pop ecx
call _net_mask
;gate ;gate
lea eax,[par] lea eax,[par]
@ -130,9 +131,7 @@ endl
invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def
pop eax pop eax
stdcall do_inet_adr,eax stdcall do_inet_adr,eax
push eax mov [gateway_ip], eax
pop ecx
call _net_gate
.do_not_set_net: .do_not_set_net:
popad popad
ret ret
@ -311,70 +310,3 @@ proc do_inet_adr stdcall,strs
popad popad
ret ret
endp endp
;setup configurations
_mouse_speed:
mov eax,18
mov ebx,19
mov ecx,1
int 0x40
ret
_mouse_delay:
mov eax,18
mov ebx,19
mov ecx,3
int 0x40
ret
_sb16:
mov eax,21
mov ebx,4
int 0x40
ret
_sound_dma:
mov eax,21
mov ebx,10
int 0x40
ret
_midibase:
mov eax,21
mov ebx,1
int 0x40
ret
_net_addr:
mov eax,52
mov ebx,3
int 0x40
ret
_net_mask:
mov eax,52
mov ebx,12
int 0x40
ret
_net_gate:
mov eax,52
mov ebx,11
int 0x40
ret
_net_up:
mov eax,52
mov ebx,0
int 0x40
and eax,0xFFFFFF80
add eax,3
mov ecx,eax
mov eax,52
mov ebx,2
int 0x40
ret

View File

@ -613,16 +613,15 @@ proc map_mem stdcall, lin_addr:dword,pdir:dword,\
mov eax, [pdir] mov eax, [pdir]
and eax, 0xFFFFF000 and eax, 0xFFFFF000
stdcall map_page,[ipc_pdir],eax,dword PG_UW stdcall map_page,[ipc_pdir],eax,PG_UW
mov ebx, [ofs] mov ebx, [ofs]
shr ebx, 22 shr ebx, 22
mov esi, [ipc_pdir] mov esi, [ipc_pdir]
mov edi, [ipc_ptab] mov edi, [ipc_ptab]
mov eax, [esi+ebx*4] mov eax, [esi+ebx*4]
and eax, 0xFFFFF000 and eax, 0xFFFFF000
test eax, eax
jz .exit jz .exit
stdcall map_page,edi,eax,dword PG_UW stdcall map_page,edi,eax,PG_UW
; inc ebx ; inc ebx
; add edi, 0x1000 ; add edi, 0x1000
; mov eax, [esi+ebx*4] ; mov eax, [esi+ebx*4]
@ -645,13 +644,22 @@ proc map_mem stdcall, lin_addr:dword,pdir:dword,\
.map: mov eax, [esi+edx*4] .map: mov eax, [esi+edx*4]
and eax, 0xFFFFF000 and eax, 0xFFFFF000
test eax, eax jz .exit
jz .exit stdcall map_page,edi,eax,PG_UW
stdcall map_page,edi,eax,dword PG_UW dec ecx
jz .exit
add edi, 0x1000 add edi, 0x1000
inc edx inc edx
dec ecx cmp edx, 0x400
jnz .map jnz .map
inc ebx
mov eax, [ipc_pdir]
mov eax, [eax+ebx*4]
and eax, 0xFFFFF000
jz .exit
stdcall map_page,esi,eax,PG_UW
xor edx, edx
jmp .map
.exit: .exit:
ret ret
@ -749,7 +757,7 @@ proc set_ipc_buff
.touch: mov eax, [ebx] .touch: mov eax, [ebx]
add ebx, 0x1000 add ebx, 0x1000
cmp ebx, ecx cmp ebx, ecx
jna .touch jb .touch
popf popf
xor eax, eax xor eax, eax
@ -761,6 +769,7 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
dst_slot dd ? dst_slot dd ?
dst_offset dd ? dst_offset dd ?
buf_size dd ? buf_size dd ?
used_buf dd ?
endl endl
pushf pushf
@ -785,11 +794,21 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
mov esi, [eax+SLOT_BASE+0xa4] mov esi, [eax+SLOT_BASE+0xa4]
mov [buf_size], esi mov [buf_size], esi
stdcall map_mem, [ipc_tmp], [SLOT_BASE+eax+0xB8],\ mov ecx, [ipc_tmp]
cmp esi, 0x40000-0x1000 ; size of [ipc_tmp] minus one page
jbe @f
push eax esi edi
add esi,0x1000
stdcall alloc_kernel_space,esi
mov ecx, eax
pop edi esi eax
@@:
mov [used_buf], ecx
stdcall map_mem, ecx, [SLOT_BASE+eax+0xB8],\
edi, esi edi, esi
mov edi, [dst_offset] mov edi, [dst_offset]
add edi, [ipc_tmp] add edi, [used_buf]
cmp dword [edi], 0 cmp dword [edi], 0
jnz .ipc_blocked ;if dword [buffer]<>0 - ipc blocked now jnz .ipc_blocked ;if dword [buffer]<>0 - ipc blocked now
@ -803,8 +822,6 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
mov dword [edi+4], ebx mov dword [edi+4], ebx
mov eax,[TASK_BASE] mov eax,[TASK_BASE]
mov eax, [eax+0x04] ;eax - our PID mov eax, [eax+0x04] ;eax - our PID
mov edi, [dst_offset]
add edi, [ipc_tmp]
add edi, edx add edi, edx
mov [edi], eax mov [edi], eax
mov ecx, [msg_size] mov ecx, [msg_size]
@ -845,12 +862,11 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
mov dword [check_idle_semaphore],5 mov dword [check_idle_semaphore],5
.ipc_no_cis: .ipc_no_cis:
popf push 0
xor eax, eax jmp .ret
ret
.no_pid: .no_pid:
popf popf
mov eax, 4 mov eax, 4
ret ret
.no_ipc_area: .no_ipc_area:
popf popf
@ -858,12 +874,18 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword
inc eax inc eax
ret ret
.ipc_blocked: .ipc_blocked:
popf push 2
mov eax, 2 jmp .ret
ret
.buffer_overflow: .buffer_overflow:
push 3
.ret:
mov eax, [used_buf]
cmp eax, [ipc_tmp]
jz @f
stdcall free_kernel_space,eax
@@:
pop eax
popf popf
mov eax, 3
ret ret
endp endp

View File

@ -382,13 +382,13 @@ cd_get_parameters_of_file:
cd_get_parameters_of_file_1: cd_get_parameters_of_file_1:
; ïîëó÷àåì àòðèáóòû ôàéëà ; ïîëó÷àåì àòðèáóòû ôàéëà
xor eax,eax xor eax,eax
; ôàéë íå àðõèâèðîâàëñ ; ôàéë íå àðõèâèðîâàëñÿ
inc al inc eax
shl eax,1 shl eax,1
; ýòî êàòàëîã? ; ýòî êàòàëîã?
test [ebp-8],byte 2 test [ebp-8],byte 2
jz .file jz .file
inc al inc eax
.file: .file:
; ìåòêà òîìà íå êàê â FAT, â ýòîì âèäå îòñóòñâóåò ; ìåòêà òîìà íå êàê â FAT, â ýòîì âèäå îòñóòñâóåò
; ôàéë íå ÿâëÿåòñÿ ñèñòåìíûì ; ôàéë íå ÿâëÿåòñÿ ñèñòåìíûì
@ -396,11 +396,11 @@ cd_get_parameters_of_file_1:
; ôàéë ÿâëÿåòñÿ ñêðûòûì? (àòðèáóò ñóùåñòâîâàíèå) ; ôàéë ÿâëÿåòñÿ ñêðûòûì? (àòðèáóò ñóùåñòâîâàíèå)
test [ebp-8],byte 1 test [ebp-8],byte 1
jz .hidden jz .hidden
inc al inc eax
.hidden: .hidden:
shl eax,1 shl eax,1
; ôàéë âñåãäà òîëüêî äëÿ ÷òåíèÿ, òàê êàê ýòî CD ; ôàéë âñåãäà òîëüêî äëÿ ÷òåíèÿ, òàê êàê ýòî CD
inc al inc eax
mov [edi],eax mov [edi],eax
; ïîëó÷àåì âðåìÿ äëÿ ôàéëà ; ïîëó÷àåì âðåìÿ äëÿ ôàéëà
;÷àñ ;÷àñ
@ -462,27 +462,31 @@ fs_CdGetFileInfo:
mov eax, 2 mov eax, 2
ret ret
@@: @@:
push edi ebp push edi
call cd_find_lfn call cd_find_lfn
pushfd pushfd
cmp [DevErrorCode], 0 cmp [DevErrorCode], 0
jz @f jz @f
popfd popfd
pop ebp edi pop edi
mov eax, 11 mov eax, 11
ret ret
@@: @@:
popfd popfd
jnc @f jnc @f
pop ebp edi pop edi
mov eax, ERROR_FILE_NOT_FOUND mov eax, ERROR_FILE_NOT_FOUND
ret ret
@@: @@:
mov edi, edx mov edi, edx
push ebp
mov ebp, [cd_current_pointer_of_input]
add ebp, 33
call cd_get_parameters_of_file_1 call cd_get_parameters_of_file_1
pop ebp
and dword [edi+4], 0 and dword [edi+4], 0
pop ebp edi pop edi
xor eax, eax xor eax, eax
ret ret
@ -612,18 +616,16 @@ cd_compare_name:
.loop: .loop:
cld cld
lodsb lodsb
push ax push eax
call char_todown call char_todown
call ansi2uni_char call ansi2uni_char
xchg ah,al xchg ah,al
cld
scasw scasw
pop ax pop eax
je .coincides je .coincides
call char_toupper call char_toupper
call ansi2uni_char call ansi2uni_char
xchg ah,al xchg ah,al
cld
sub edi,2 sub edi,2
scasw scasw
jne .name_not_coincide jne .name_not_coincide

View File

@ -107,7 +107,7 @@ use16
org 0x0 org 0x0
jmp start_of_code jmp start_of_code
version db 'Kolibri OS version 0.6.5.0 ',13,10,13,10,0 version db 'Kolibri OS version 0.7.0.0 ',13,10,13,10,0
include "boot/bootstr.inc" ; language-independent boot messages include "boot/bootstr.inc" ; language-independent boot messages
include "boot/preboot.inc" include "boot/preboot.inc"
@ -2285,7 +2285,7 @@ endg
iglobal iglobal
version_inf: version_inf:
db 0,6,5,0 ; version 0.6.5.0 db 0,7,0,0 ; version 0.7.0.0
db UID_KOLIBRI db UID_KOLIBRI
db 'Kolibri',0 db 'Kolibri',0
version_end: version_end:

View File

@ -911,6 +911,10 @@ vesa20_drawbackground_stretch:
; dword [esp+4] = y * BgrDataHeight / ScreenHeight ; dword [esp+4] = y * BgrDataHeight / ScreenHeight
push eax push eax
mov ecx, [BgrDataWidth] mov ecx, [BgrDataWidth]
lea edx, [ecx*3]
imul edx, [BgrDataHeight]
add edx, [img_background]
push edx
mul ecx mul ecx
imul esi, ecx imul esi, ecx
dec ecx dec ecx
@ -932,16 +936,18 @@ vesa20_drawbackground_stretch:
; dword [esp] = saved esi ; dword [esp] = saved esi
; dword [esp+4] = saved edx ; dword [esp+4] = saved edx
; dword [esp+8] = saved ecx ; dword [esp+8] = saved ecx
; dword [esp+12] = limit for overlapping of points ; dword [esp+12] = BgrDataWidth-1, x-limit for overlapping of points
; dword [esp+16] = x ; dword [esp+16] = end of bgr memory (defines y-limit for overlapping of points)
; dword [esp+20] = (y * BgrDataHeight) mod ScreenHeight (used to fast recalculating of esi) ; dword [esp+20] = x
; dword [esp+24] = y ; dword [esp+24] = (y * BgrDataHeight) mod ScreenHeight (used to fast recalculating of esi)
; dword [esp+28] = y
; precalculated constants: ; precalculated constants:
; dword [esp+28] = BgrDataHeight mod ScreenHeight ; dword [esp+32] = BgrDataHeight mod ScreenHeight
; dword [esp+32] = BgrDataHeight div ScreenHeight ; dword [esp+36] = BgrDataHeight div ScreenHeight
; dword [esp+36] = BgrDataWidth mod ScreenWidth ; dword [esp+40] = BgrDataWidth mod ScreenWidth
; dword [esp+40] = BgrDataWidth div ScreenWidth ; dword [esp+44] = BgrDataWidth div ScreenWidth
sdp3: sdp3:
add edx, [esp+40]
cmp [ebp+WinMapAddress], byte 1 cmp [ebp+WinMapAddress], byte 1
jnz snbgp jnz snbgp
mov al, [esi+2] mov al, [esi+2]
@ -949,9 +955,24 @@ sdp3:
mov ax, [esi] mov ax, [esi]
cmp ecx, [esp+12] cmp ecx, [esp+12]
jae @f jae @f
cmp edx, [ScreenWidth]
jb @f
mov ebx, [esi+2] mov ebx, [esi+2]
shr ebx, 8 shr ebx, 8
call overlapping_of_points call overlapping_of_points
@@:
mov ebx, [esp+24]
add ebx, [esp+32]
cmp ebx, [ScreenHeight]
jbe @f
mov ebx, [BgrDataWidth]
lea ebx, [ebx*3]
add ebx, esi
cmp ebx, [esp+16]
jae @f
mov ebx, [ebx-1]
shr ebx, 8
call overlapping_of_points
@@: @@:
mov [edi], ax mov [edi], ax
shr eax, 16 shr eax, 16
@ -960,16 +981,16 @@ snbgp:
cmp [ScreenBPP], byte 25 cmp [ScreenBPP], byte 25
sbb edi, -4 sbb edi, -4
add ebp, 1 add ebp, 1
mov eax, [esp+16] mov eax, [esp+20]
add eax, 1 add eax, 1
mov [esp+16], eax mov [esp+20], eax
cmp eax, [draw_data+32+RECT.right] cmp eax, [draw_data+32+RECT.right]
ja sdp4 ja sdp4
mov eax, [esp+40] mov eax, [esp+44]
add ecx, eax add ecx, eax
lea eax, [eax*3] lea eax, [eax*3]
add esi, eax add esi, eax
add edx, [esp+36] ; add edx, [esp+40]
cmp edx, [ScreenWidth] cmp edx, [ScreenWidth]
jbe sdp3 jbe sdp3
sub edx, [ScreenWidth] sub edx, [ScreenWidth]
@ -979,9 +1000,9 @@ snbgp:
jmp sdp3 jmp sdp3
sdp4: sdp4:
; next y ; next y
mov ebx, [esp+24] mov ebx, [esp+28]
add ebx, 1 add ebx, 1
mov [esp+24], ebx mov [esp+28], ebx
cmp ebx, [draw_data+32+RECT.bottom] cmp ebx, [draw_data+32+RECT.bottom]
ja sdpdone ja sdpdone
; advance edi, ebp to next scan line ; advance edi, ebp to next scan line
@ -1001,25 +1022,25 @@ sdp4:
pop esi edx ecx pop esi edx ecx
push ecx edx push ecx edx
xor ebx, ebx xor ebx, ebx
mov eax, [esp+20-4] mov eax, [esp+24-4]
add eax, [esp+28-4] add eax, [esp+32-4]
cmp eax, [ScreenHeight] cmp eax, [ScreenHeight]
jbe @f jbe @f
sub eax, [ScreenHeight] sub eax, [ScreenHeight]
mov ebx, 1 mov ebx, 1
sub eax, ebx sub eax, ebx
@@: @@:
mov [esp+20-4], eax mov [esp+24-4], eax
add ebx, [esp+32-4] add ebx, [esp+36-4]
lea ebx, [ebx*3] lea ebx, [ebx*3]
imul ebx, [BgrDataWidth] imul ebx, [BgrDataWidth]
add esi, ebx add esi, ebx
push esi push esi
mov eax, [draw_data+32+RECT.left] mov eax, [draw_data+32+RECT.left]
mov [esp+16], eax mov [esp+20], eax
jmp sdp3 jmp sdp3
sdpdone: sdpdone:
add esp, 44 add esp, 48
popad popad
mov [EGA_counter],1 mov [EGA_counter],1
call VGA_drawbackground call VGA_drawbackground