summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>1998-12-01 17:40:32 +0000
committerhpa <hpa>1998-12-01 17:40:32 +0000
commit6fb6d76a71464bf7e7780e863e1e9e214ffecd26 (patch)
tree9256f9ee51f45b378d8c55a8d559a69f66d64261
parent2d6d3c08b1d135c6a51f4067a8c9d24991bbd46b (diff)
downloadsyslinux-1.41-0x36642a1d.tar.gz
Always make the initrd fit under the 0x3f000000 mark imposed by unmodifiedsyslinux-1.41-0x36642a1dsyslinux-1.41
Linux kernels.
-rw-r--r--ldlinux.asm9
1 files changed, 8 insertions, 1 deletions
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