From 6fb6d76a71464bf7e7780e863e1e9e214ffecd26 Mon Sep 17 00:00:00 2001 From: hpa Date: Tue, 1 Dec 1998 17:40:32 +0000 Subject: Always make the initrd fit under the 0x3f000000 mark imposed by unmodified Linux kernels. --- ldlinux.asm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ldlinux.asm b/ldlinux.asm index 25b8f357..8e5d102a 100644 --- a/ldlinux.asm +++ b/ldlinux.asm @@ -27,10 +27,12 @@ ; **************************************************************************** ; -; Some semi-configurable constants... change on your own risk +; Some semi-configurable constants... change on your own risk. Most are imposed +; by the kernel. ; max_cmd_len equ 255 ; Must be odd; 255 is the kernel limit retry_count equ 6 ; How patient are we with the disk? +HIGHMEM_MAX equ 03f000000h ; Highest address for an initrd ; ; Should be updated with every release to avoid bootsector/SYS file mismatch @@ -1861,6 +1863,11 @@ new_kernel: add ax,dx mov [InitRDClust],ax ; Ramdisk clusters mov edx,[HighMemSize] ; End of memory + mov eax,HIGHMEM_MAX ; Limit imposed by kernel + cmp edx,eax + jna memsize_ok + mov edx,eax ; Adjust to fit inside limit +memsize_ok: sub edx,[es:su_ramdisklen] ; Subtract size of ramdisk xor dx,dx ; Round down to 64K boundary mov [InitRDat],edx ; Load address -- cgit v1.2.1