[syslinux:pathbased] fs: move the disk cache into high memory

syslinux-bot for H. Peter Anvin hpa at zytor.com
Tue Feb 16 13:51:13 PST 2010


Commit-ID:  b4ce3fadde8ffb9b306e8d33bb2710f2f8faadae
Gitweb:     http://syslinux.zytor.com/commit/b4ce3fadde8ffb9b306e8d33bb2710f2f8faadae
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Tue, 16 Feb 2010 13:49:33 -0800
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Tue, 16 Feb 2010 13:49:33 -0800

fs: move the disk cache into high memory

Move the disk cache out of the DOS memory area.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 core/fs/diskio.c |    5 +++--
 core/layout.inc  |   16 ++++------------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index eddcd8d..4c965cd 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -308,11 +308,12 @@ struct device * device_init(uint8_t devno, bool cdrom, sector_t part_start,
                             uint16_t bsHeads, uint16_t bsSecPerTrack)
 {
     static struct device dev;
+    static char diskcache[128*1024] __aligned(4096);
 
     dev.disk = disk_init(devno, cdrom, part_start, bsHeads, bsSecPerTrack);
         
-    dev.cache_data = core_cache_buf;
-    dev.cache_size = sizeof core_cache_buf;
+    dev.cache_data = diskcache;
+    dev.cache_size = sizeof diskcache;
     
     return &dev;
 }
diff --git a/core/layout.inc b/core/layout.inc
index 5099802..baf45b9 100644
--- a/core/layout.inc
+++ b/core/layout.inc
@@ -120,7 +120,7 @@ RBFG_brainfuck:	resb 2048		; Bigger than an Ethernet packet...
 ; This stuff really should come from the linker...
 ;
 		global	xfer_buf_seg, core_xfer_buf
-xfer_buf_seg	equ 3000h
+xfer_buf_seg	equ 2000h
 core_xfer_buf	equ xfer_buf_seg << 4
 
 serial_buf_size	equ 4096		; Should be a power of 2
@@ -141,16 +141,8 @@ serial_buf_size	equ 4096		; Should be a power of 2
 auxseg		resb aux_size
 
 ;
-; Bounce buffer for I/O to high mem
-; Note: we keep all the segments page-aligned, even if that probably
-; is somewhat excessive.  Sector alignment is obligatory, however.
+; Segment for the real mode code (needed as long as we have a in-kernel
+; loader and/or COM16 support.
 ;
-
-		global cache_seg, core_cache_buf
-cache_seg	equ 4000h		; 64K area for metadata cache
-core_cache_buf	equ cache_seg << 4
-real_mode_seg	equ 5000h
-
-pktbuf_seg	equ cache_seg		; PXELINUX packet buffers
-
+real_mode_seg	equ xfer_buf_seg + 1000h
 comboot_seg	equ real_mode_seg	; COMBOOT image loading zone



More information about the Syslinux-commits mailing list