From 1463afc2619f760c5a748f590c865e18704c1cfb Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Wed, 5 Oct 2011 11:13:17 +0000 Subject: [PATCH] reduce kernel memory usage git-svn-id: svn://kolibrios.org@2267 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/build.bat | 2 +- kernel/trunk/const.inc | 29 +++++++++++++---------------- kernel/trunk/core/malloc.inc | 5 +++++ kernel/trunk/kernel.asm | 3 +-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/kernel/trunk/build.bat b/kernel/trunk/build.bat index ade8f297e..290d05b54 100644 --- a/kernel/trunk/build.bat +++ b/kernel/trunk/build.bat @@ -1,7 +1,7 @@ @echo off cls set languages=en ru ge et -set drivers=com_mouse emu10k1x ensoniq fm801 infinity sis sound uart viasound vt823x +set drivers=com_mouse emu10k1x fm801 infinity sis sound viasound vt823x set targets=all kernel drivers skins clean call :Check_Target %1 diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index 7f7b446c5..ad0a26503 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -293,30 +293,27 @@ IDE_DMA equ 0x284000 BgrAuxTable equ (OS_BASE+0x0298000) ; unused? -SB16Buffer equ (OS_BASE+0x2A0000) +SB16Buffer equ (OS_BASE+0x02A0000) SB16_Status equ (OS_BASE+0x02B0000) BUTTON_INFO equ (OS_BASE+0x02C0000) RESERVED_PORTS equ (OS_BASE+0x02D0000) -IRQ_SAVE equ (OS_BASE+0x02E0000) -BOOT_VAR equ (OS_BASE+0x02f0000) +BOOT_VAR equ (OS_BASE+0x02E0000) -stack_data_start equ (OS_BASE+0x0300000) -eth_data_start equ (OS_BASE+0x0300000) -stack_data equ (OS_BASE+0x0304000) -stack_data_end equ (OS_BASE+0x031ffff) -resendQ equ (OS_BASE+0x0320000) -VMODE_BASE equ (OS_BASE+0x0328000) -skin_data equ (OS_BASE+0x0330000) -draw_data equ (OS_BASE+0x0338000); +stack_data_start equ (OS_BASE+0x02F0000) +eth_data_start equ (OS_BASE+0x02F0000) +stack_data equ (OS_BASE+0x02F4000) +stack_data_end equ (OS_BASE+0x030ffff) +resendQ equ (OS_BASE+0x0310000) -BgrDrawMode equ (OS_BASE+0x033BFF4) -BgrDataWidth equ (OS_BASE+0x033BFF8) -BgrDataHeight equ (OS_BASE+0x033BFFC) +skin_data equ (OS_BASE+0x0318000) +draw_data equ (OS_BASE+0x0320000) -BOOT_VAR equ (OS_BASE+0x0340000) +BgrDrawMode equ (OS_BASE+0x0323FF4) +BgrDataWidth equ (OS_BASE+0x0323FF8) +BgrDataHeight equ (OS_BASE+0x0323FFC) -sys_pgmap equ (OS_BASE+0x0350000) +sys_pgmap equ (OS_BASE+0x0324000) UPPER_KERNEL_PAGES equ (OS_BASE+0x0400000) diff --git a/kernel/trunk/core/malloc.inc b/kernel/trunk/core/malloc.inc index ad7f603ff..fedcdde28 100644 --- a/kernel/trunk/core/malloc.inc +++ b/kernel/trunk/core/malloc.inc @@ -202,6 +202,9 @@ malloc: ; eax= mem align 4 free: + test eax, eax + jz .exit + push edi mov edi, eax add edi, -8 @@ -296,7 +299,9 @@ free: pop esi .fail: pop edi +.exit: ret + @@: ; nsize = next->head & ~INUSE_BITS; diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index da1ae61b1..ad27957cb 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -1598,10 +1598,9 @@ nsyse8: no_set_lba_read: ; cmp eax,12 ; ENABLE PCI ACCESS dec ebx - jnz no_set_pci_access + jnz sys_setup_err mov [pci_access_enabled],ecx ret -no_set_pci_access: sys_setup_err: or [esp+32],dword -1