From 61c54a1be65e599d354f728c27d916af9c6bf09e Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Fri, 25 May 2007 09:37:08 +0000 Subject: [PATCH] * Correct value of selector gs * Support for kpack'ed skin files * Default setting for DMA access is now "disabled" * Fixed kernel fault when network packet sending git-svn-id: svn://kolibrios.org@523 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/boot/bootcode.inc | 8 ++- kernel/trunk/core/sched.inc | 2 + kernel/trunk/gui/skincode.inc | 67 +++++++++++------------ kernel/trunk/gui/skindata.inc | 2 - kernel/trunk/gui/window.inc | 52 ++++-------------- kernel/trunk/kernel.asm | 7 +-- kernel/trunk/network/eth_drv/ethernet.inc | 4 +- 7 files changed, 54 insertions(+), 88 deletions(-) diff --git a/kernel/trunk/boot/bootcode.inc b/kernel/trunk/boot/bootcode.inc index 0456d03d56..0e14e0203f 100644 --- a/kernel/trunk/boot/bootcode.inc +++ b/kernel/trunk/boot/bootcode.inc @@ -381,9 +381,11 @@ cfgmanager: @@: mov [di], al .preboot_gr_end: -; following 6 lines set variables to 1 if its current value is 0 - cmp [di+preboot_dma-preboot_graph], 1 - adc [di+preboot_dma-preboot_graph], 0 + cmp [di+preboot_dma-preboot_graph], 0 + jnz @f + mov [di+preboot_dma-preboot_graph], 3 ; DMA: defaults to none +@@: +; following 4 lines set variables to 1 if its current value is 0 cmp [di+preboot_vrrm-preboot_graph], 1 adc [di+preboot_vrrm-preboot_graph], 0 cmp [di+preboot_device-preboot_graph], 1 diff --git a/kernel/trunk/core/sched.inc b/kernel/trunk/core/sched.inc index 214712d104..64a7238d5e 100644 --- a/kernel/trunk/core/sched.inc +++ b/kernel/trunk/core/sched.inc @@ -216,6 +216,8 @@ do_change_task: mov ebx, [ebx+APPDATA.pl0_stack] add ebx, RING0_STACK_SIZE mov [tss._esp0], ebx + push graph_data + pop gs mov ecx, cr0 or ecx, CR0_TS ;set task switch flag mov cr0, ecx diff --git a/kernel/trunk/gui/skincode.inc b/kernel/trunk/gui/skincode.inc index 6fe694ba42..96d8b16231 100644 --- a/kernel/trunk/gui/skincode.inc +++ b/kernel/trunk/gui/skincode.inc @@ -10,30 +10,35 @@ include "skindata.inc" ;skin_data = 0x00778000 -load_skin_file: -; eax = filename -; edx = destination - mov ebx,1 - or ecx,-1 - mov esi,12 - pushad - push eax - mov [skin_to_load.adr],edx - - mov [skin_to_load.stradr],_skin_file_default - mov eax,skin_to_load - call file_system_lfn - pop eax - popad - ret - -skin_to_load: - dd 0,0,0 - dd 64*1024 - .adr dd 0 - db 0 - .stradr dd 0 +read_skin_file: + stdcall load_file, ebx + test eax, eax + jz .notfound + cmp dword [eax], 'SKIN' + jnz .noskin + cmp ebx, 32*1024 + jb @f + mov ebx, 32*1024 +@@: + lea ecx, [ebx+3] + shr ecx, 2 + mov esi, eax + mov edi, skin_data + rep movsd + stdcall kernel_free, eax + call parse_skin_data + xor eax, eax + ret +.notfound: + xor eax, eax + inc eax + ret +.noskin: + stdcall kernel_free, eax + push 2 + pop eax + ret struct SKIN_HEADER .ident dd ? @@ -75,20 +80,10 @@ struct SKIN_BITMAPS .data dd ? ends -load_skin: - pushad +load_default_skin: mov [_skinh],22 - mov eax,_skin_file - mov edx,skin_data - mov [edx+SKIN_HEADER.ident],'????' - call load_skin_file - cmp eax,ERROR_SUCCESS - je @f - cmp eax,ERROR_END_OF_FILE - jne .exit - @@: call parse_skin_data - .exit: - popad + mov ebx,_skin_file_default + call read_skin_file ret parse_skin_data: diff --git a/kernel/trunk/gui/skindata.inc b/kernel/trunk/gui/skindata.inc index 2f728fa1fe..353a13db90 100644 --- a/kernel/trunk/gui/skindata.inc +++ b/kernel/trunk/gui/skindata.inc @@ -55,8 +55,6 @@ skin_udata: skin_active SKIN_DATA skin_inactive SKIN_DATA - _skin_file rb 256 - align 4 skin_udata.end: diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index b13385c087..7dbff53c28 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -475,47 +475,19 @@ display_settings: cmp eax,8 ; set window skin jne no_set_skin - mov eax,ebx - mov edi,[TASK_BASE] - add ebx,[edi+TASKDATA.mem_start] ; abs start of info block - pushd [ebx+0] [ebx+4] [ebx+8] [ebx+12] - mov dword[ebx+0],0 ; read - mov dword[ebx+4],0 ; from the beginning - mov dword[ebx+8],64 ; 32 KBytes maximum - mov ecx,skin_data+64*512 - sub ecx,[edi+0x10] - mov dword[ebx+12],ecx ; destination - push eax - pushad - call file_system - popad - pop eax - popd [ebx+12] [ebx+8] [ebx+4] [ebx+0] - cmp eax,ERROR_SUCCESS - je @f - cmp eax,ERROR_END_OF_FILE - jne .exit - @@: cmp [skin_data+64*512+SKIN_HEADER.ident],'SKIN' - mov eax,ERROR_UNKNOWN_FS - jne .exit - mov esi,skin_data+64*512 - mov edi,skin_data - mov ecx,(64*512)/4 - rep movsd - call parse_skin_data - pushad - mov eax, 0 - mov ebx, 0 - mov ecx, [ScreenWidth] - mov edx, [ScreenHeight] - call calculatescreen - popad - mov dword[esp+32+36],0 + call read_skin_file + mov [esp+32+36], eax + test eax, eax + jnz .ret + xor eax, eax + xor ebx, ebx + mov ecx, [ScreenWidth] + mov edx, [ScreenHeight] + call calculatescreen jmp redraw_screen_direct - .exit: - mov [esp+32+36],eax - popad - ret +.ret: + popad + ret no_set_skin: popad diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 7070c54e03..5285ac66a1 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -748,12 +748,7 @@ no_lib_load: ; LOAD DEFAULT SKIN - mov esi,_skin_file_default - mov edi,_skin_file - movsd - movsd - movsd - call load_skin + call load_default_skin ;protect io permission map diff --git a/kernel/trunk/network/eth_drv/ethernet.inc b/kernel/trunk/network/eth_drv/ethernet.inc index 5a3894d88d..b1ad970621 100644 --- a/kernel/trunk/network/eth_drv/ethernet.inc +++ b/kernel/trunk/network/eth_drv/ethernet.inc @@ -160,7 +160,7 @@ dd 0x595110b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 dd 0x595210b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 dd 0x900010b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 dd 0x900110b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 -;dd 0x900410b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 ; tested by hidnplayr: makes system crash +dd 0x900410b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 dd 0x900510b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 dd 0x900610b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 dd 0x900A10b7, e3c59x_probe, e3c59x_reset, e3c59x_poll, e3c59x_transmit, 0 @@ -319,7 +319,9 @@ local MACAddress dp ? ;allocate 6 bytes in the stack xchg ch, cl ; because mirror byte-order mov esi, ebx ; Pointer to packet data mov bx, ETHER_IP ; Type of packet + push ebp call dword [drvr_transmit] ; Call the drivers transmit function + pop ebp ; OK, we have sent a packet, so increment the count inc dword [ip_tx_count]