From b26531da12501da0d4a587f4624f2eae3c15d62a Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Mon, 16 Jul 2007 16:19:43 +0000 Subject: [PATCH] reduce core memory git-svn-id: svn://kolibrios.org@581 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/blkdev/hd_drv.inc | 28 +++++++++++++------------- kernel/trunk/const.inc | 36 ++++++++++++++++------------------ kernel/trunk/drivers/vmode.asm | 2 +- kernel/trunk/init.inc | 8 -------- kernel/trunk/memmap.inc | 22 ++++++++++----------- 5 files changed, 43 insertions(+), 53 deletions(-) diff --git a/kernel/trunk/blkdev/hd_drv.inc b/kernel/trunk/blkdev/hd_drv.inc index 633e56a4aa..dccddcf16f 100644 --- a/kernel/trunk/blkdev/hd_drv.inc +++ b/kernel/trunk/blkdev/hd_drv.inc @@ -22,7 +22,7 @@ hd_read: ; mov esi,HD_CACHE+8 call calculate_cache add esi,8 - + mov edi,1 hdreadcache: @@ -71,7 +71,7 @@ hd_read: call calculate_cache_2 add esi,eax pop eax - + mov edi,ebx mov ecx,512/4 cld @@ -129,7 +129,7 @@ hd_read_pio: call calculate_cache_2 add edi,eax pop eax - + mov ecx,256 mov edx,[hdbase] cld @@ -170,7 +170,7 @@ hd_write: ; mov esi,HD_CACHE+8 call calculate_cache add esi,8 - + mov edi,1 hdwritecache: @@ -213,7 +213,7 @@ hd_write: call calculate_cache_2 add edi,eax pop eax - + mov esi,ebx mov ecx,512/4 cld @@ -225,7 +225,7 @@ hd_write: align 4 cache_write_pio: ; call disable_ide_int - + call wait_for_hd_idle cmp [hd_error],0 jne hd_write_error @@ -273,7 +273,7 @@ cache_write_pio: call calculate_cache_2 add esi,eax pop eax - + mov ecx,256 mov edx,[hdbase] cld @@ -470,7 +470,7 @@ iglobal align 4 ; note that IDE descriptor table must be 4-byte aligned and do not cross 4K boundary IDE_descriptor_table: - dd 0x284000 + dd IDE_DMA dw 0x2000 dw 0x8000 @@ -564,7 +564,7 @@ hd_read_dma: mov eax, [esp+4] sub eax, [dma_cur_sector] shl eax, 9 - add eax, OS_BASE+0x284000 + add eax, (OS_BASE+IDE_DMA) push ecx esi edi mov esi, eax shl edi, 9 @@ -573,7 +573,7 @@ hd_read_dma: call calculate_cache_2 add edi,eax pop eax - + mov ecx, 512/4 cld rep movsd @@ -583,7 +583,7 @@ hd_read_dma: ret .notread: mov eax, IDE_descriptor_table - mov dword [eax], 0x284000 + mov dword [eax], IDE_DMA mov word [eax+4], 0x2000 sub eax, OS_BASE mov dx, [IDEContrRegsBaseAddr] @@ -666,7 +666,7 @@ align 4 write_cache_sector: mov [cache_chain_size],1 mov [cache_chain_pos],edi -write_cache_chain: +write_cache_chain: push esi mov eax, IDE_descriptor_table mov edx,eax @@ -675,8 +675,8 @@ write_cache_chain: shl esi, 9 call calculate_cache_2 add esi,eax - mov edi,OS_BASE+0x284000 ;HD_CACHE - mov dword [edx], 0x284000 ;DMA_HD_MEM + mov edi, (OS_BASE+IDE_DMA) + mov dword [edx], IDE_DMA movzx ecx, [cache_chain_size] shl ecx, 9 mov word [edx+4], cx diff --git a/kernel/trunk/const.inc b/kernel/trunk/const.inc index 8961830599..a60c39202c 100644 --- a/kernel/trunk/const.inc +++ b/kernel/trunk/const.inc @@ -282,6 +282,8 @@ RAMDISK equ (OS_BASE+0x0100000) RAMDISK_FAT equ (OS_BASE+0x0280000) FLOPPY_FAT equ (OS_BASE+0x0282000) +IDE_DMA equ 0x284000 + BgrAuxTable equ (OS_BASE+0x0298000) ; unused? SB16Buffer equ (OS_BASE+0x2A0000) @@ -292,30 +294,26 @@ RESERVED_PORTS equ (OS_BASE+0x02D0000) IRQ_SAVE equ (OS_BASE+0x02E0000) BOOT_VAR equ (OS_BASE+0x02f0000) -; DMA_HD_MEM equ 0x0300000 -; HD_CACHE equ (OS_BASE+DMA_HD_MEM) +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+0x0400000) -eth_data_start equ (OS_BASE+0x0400000) -stack_data equ (OS_BASE+0x0404000) -stack_data_end equ (OS_BASE+0x041ffff) -resendQ equ (OS_BASE+0x0420000) -VMODE_BASE equ (OS_BASE+0x0428000) -skin_data equ (OS_BASE+0x0430000) -draw_data equ (OS_BASE+0x0438000); +BgrDrawMode equ (OS_BASE+0x033BFF4) +BgrDataWidth equ (OS_BASE+0x033BFF8) +BgrDataHeight equ (OS_BASE+0x033BFFC) +WinMapAddress equ (OS_BASE+0x033C000) +display_data equ (OS_BASE+0x033C000) ;1024*1280=0x140000 -virtual at (OS_BASE+0x043BF80) +virtual at (OS_BASE+0x047CF80) tss TSS end virtual -BgrDrawMode equ (OS_BASE+0x043EFF4) -BgrDataWidth equ (OS_BASE+0x043EFF8) -BgrDataHeight equ (OS_BASE+0x043EFFC) -WinMapAddress equ (OS_BASE+0x043F000) -display_data equ (OS_BASE+0x043F000) - -sys_pgmap equ (OS_BASE+0x057F000) - +sys_pgmap equ (OS_BASE+0x047F000) HEAP_BASE equ (OS_BASE+0x0800000) HEAP_MIN_SIZE equ 0x01000000 diff --git a/kernel/trunk/drivers/vmode.asm b/kernel/trunk/drivers/vmode.asm index fb12519828..9cb0427bbf 100644 --- a/kernel/trunk/drivers/vmode.asm +++ b/kernel/trunk/drivers/vmode.asm @@ -16,7 +16,7 @@ use32 macro align value { rb (value-1) - ($ + value-1) mod value } - org OS_BASE+0x0428000 + org OS_BASE+0x0328000 headerstart=$ diff --git a/kernel/trunk/init.inc b/kernel/trunk/init.inc index ef8e7f2150..b9062a3009 100644 --- a/kernel/trunk/init.inc +++ b/kernel/trunk/init.inc @@ -70,14 +70,6 @@ proc init_mem mov ebx, cr4 or ebx, CR4_PSE mov eax, PG_LARGE+PG_SW - -; bt [cpu_caps-OS_BASE], CAPS_PGE -; jnc @F - -; or eax, PG_GLOBAL -; or ebx, CR4_PGE -; -;@@: mov cr4, ebx dec [pg_data.kernel_tables-OS_BASE] diff --git a/kernel/trunk/memmap.inc b/kernel/trunk/memmap.inc index 4a3c0b0809..24f7461804 100644 --- a/kernel/trunk/memmap.inc +++ b/kernel/trunk/memmap.inc @@ -207,27 +207,27 @@ ; 0x802E0000 -> 2EFFFF irq data area ; 0x802F0000 -> 2FFFFF low memory save ; -; 0x80300000 -> 400000 hd cache - -; 0x80400000 -> 41FFFF tcp memory 128 Kb -; 0x80420000 -> 427FFF tcp memory 32 Kb +; 0x80300000 -> 31FFFF tcp memory 128 Kb +; 0x80320000 -> 327FFF tcp memory 32 Kb ; -; 0x80428000 -> 42FFFF !vrr driver 32 Kb +; 0x80328000 -> 32FFFF !vrr driver 32 Kb -; 0x80430000 -> 477FFF skin data +; 0x80330000 -> 377FFF skin data -; 0x80438000 -> 43AFFF draw data - 256 entries +; 0x80338000 -> 33AFFF draw data - 256 entries ; 00 dword draw limit - x start ; 04 dword draw limit - y start ; 08 dword draw limit - x end ; 0C dword draw limit - y end -; 0x8043BF80 -> 43BFFF TSS 128 bytes -; 0x8043C000 -> 43DFFF IO map for (8192*8)=65536 ports +; 0x8033C000 -> 47BFFF display info -; 0x8043F000 -> 57EFFF display info -; 0x8057F000 -> 58FFFF page map max 128 Kb +; 0x8047CF80 -> 47CFFF TSS 128 bytes +; 0x8047D000 -> 47EFFF IO map for (8192*8)=65536 ports + +; 0x8047F000 -> 48FFFF page map max 128 Kb ; + ; 0x80800000 -> kernel heap ; 0x81FFFFFF heap min limit ; 0xFDBFFFFF heap max limit