aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--isolinux.asm14
-rw-r--r--ldlinux.asm17
-rw-r--r--pxelinux.asm14
4 files changed, 39 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 75fc43ac..f18dc3e0 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ Changes in 1.65:
* ISOLINUX: Support booting disk image files (to boot DOS or
other non-Linux operating systems), *IF* the BIOS works
correctly; unfortunately many BIOSes apparently don't.
+ * Support Linux boot protocol version 2.03 (explicitly
+ specify the initrd address limit.)
Changes in 1.64:
* Limited support for hardware flow control when using a
diff --git a/isolinux.asm b/isolinux.asm
index 5371e8b2..5aaa3d06 100644
--- a/isolinux.asm
+++ b/isolinux.asm
@@ -44,7 +44,7 @@
max_cmd_len equ 255 ; Must be odd; 255 is the kernel limit
FILENAME_MAX_LG2 equ 8 ; log2(Max filename size Including final null)
FILENAME_MAX equ (1 << FILENAME_MAX_LG2)
-HIGHMEM_MAX equ 038000000h ; Highest address for an initrd
+HIGHMEM_MAX equ 037FFFFFFh ; DEFAULT highest address for an initrd
HIGHMEM_SLOP equ 128*1024 ; Avoid this much memory near the top
DEFAULT_BAUD equ 9600 ; Default baud rate for serial port
BAUD_DIVISOR equ 115200 ; Serial port parameter
@@ -108,6 +108,7 @@ su_bsklugeseg resw 1 ; 0222
su_heapend resw 1 ; 0224
su_pad1 resw 1 ; 0226
su_cmd_line_ptr resd 1 ; 0228
+su_ramdisk_max resd 1 ; 022C
resb (9000h-12)-($-$$) ; Were bootsect.S puts it...
linux_stack equ $ ; 8FF4
linux_fdctab equ $
@@ -308,6 +309,7 @@ E820Buf resd 5 ; INT 15:E820 data buffer
InitRDat resd 1 ; Load address (linear) for initrd
HiLoadAddr resd 1 ; Address pointer for high load loop
HighMemSize resd 1 ; End of memory pointer (bytes)
+RamdiskMax resd 1 ; Highest address for a ramdisk
KernelSize resd 1 ; Size of kernel (bytes)
RootDir resb dir_t_size ; Root directory
CurDir resb dir_t_size ; Current directory
@@ -1949,6 +1951,7 @@ cmdline_end:
;
; Now check if we have a large kernel, which needs to be loaded high
;
+ mov dword [RamdiskMax], HIGHMEM_MAX ; Default initrd limit
cmp dword [es:su_header],HEADER_ID ; New setup code ID
jne near old_kernel ; Old kernel, load low
cmp word [es:su_version],0200h ; Setup code version 2.0
@@ -1957,6 +1960,11 @@ cmdline_end:
jb new_kernel ; If 2.00, skip this step
mov word [es:su_heapend],linux_stack ; Set up the heap
or byte [es:su_loadflags],80h ; Let the kernel know we care
+ cmp word [es:su_version],0203h ; Version 2.03+?
+ jb new_kernel ; Not 2.03+
+ mov eax,[es:su_ramdisk_max]
+ mov [RamdiskMax],eax ; Set the ramdisk limit
+
;
; We definitely have a new-style kernel. Let the kernel know who we are,
; and that we are clueful
@@ -2067,11 +2075,13 @@ load_initrd:
add ax,dx
mov [InitRDClust],ax ; Ramdisk clusters
mov edx,[HighMemSize] ; End of memory
- mov eax,HIGHMEM_MAX ; Limit imposed by kernel
+ dec edx
+ mov eax,[RamdiskMax] ; Highest address allowed by kernel
cmp edx,eax
jna memsize_ok
mov edx,eax ; Adjust to fit inside limit
memsize_ok:
+ inc edx
sub edx,[es:su_ramdisklen] ; Subtract size of ramdisk
xor dx,dx ; Round down to 64K boundary
mov [InitRDat],edx ; Load address
diff --git a/ldlinux.asm b/ldlinux.asm
index f9552f95..6b5a9ba9 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -32,7 +32,7 @@
;
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 038000000h ; Highest address for an initrd
+HIGHMEM_MAX equ 037FFFFFFh ; DEFAULT highest address for an initrd
DEFAULT_BAUD equ 9600 ; Default baud rate for serial port
BAUD_DIVISOR equ 115200 ; Serial port parameter
;
@@ -93,6 +93,7 @@ su_bsklugeseg resw 1 ; 0222
su_heapend resw 1 ; 0224
su_pad1 resw 1 ; 0226
su_cmd_line_ptr resd 1 ; 0228
+su_ramdisk_max resd 1 ; 022C
resb (9000h-12)-($-$$) ; The setup is up to 32K long
linux_stack equ $ ; 8FF4
linux_fdctab equ $
@@ -272,6 +273,7 @@ E820Buf resd 5 ; INT 15:E820 data buffer
InitRDat resd 1 ; Load address (linear) for initrd
HiLoadAddr resd 1 ; Address pointer for high load loop
HighMemSize resd 1 ; End of memory pointer (bytes)
+RamdiskMax resd 1 ; Highest address for a ramdisk
KernelSize resd 1 ; Size of kernel (bytes)
KernelName resb 12 ; Mangled name for kernel
; (note the spare byte after!)
@@ -2002,6 +2004,7 @@ cmdline_end:
;
; Now check if we have a large kernel, which needs to be loaded high
;
+ mov dword [RamdiskMax], HIGHMEM_MAX ; Default initrd limit
cmp dword [es:su_header],HEADER_ID ; New setup code ID
jne near old_kernel ; Old kernel, load low
cmp word [es:su_version],0200h ; Setup code version 2.0
@@ -2010,6 +2013,11 @@ cmdline_end:
jb new_kernel ; If 2.00, skip this step
mov word [es:su_heapend],linux_stack ; Set up the heap
or byte [es:su_loadflags],80h ; Let the kernel know we care
+ cmp word [es:su_version],0203h ; Version 2.03+?
+ jb new_kernel ; Not 2.03+
+ mov eax,[es:su_ramdisk_max]
+ mov [RamdiskMax],eax ; Set the ramdisk limit
+
;
; We definitely have a new-style kernel. Let the kernel know who we are,
; and that we are clueful
@@ -2044,13 +2052,14 @@ new_kernel:
movzx dx,dl
add ax,dx
mov [InitRDClust],ax ; Ramdisk clusters
- mov edx,[HighMemSize] ; End of memory (64K chunks)
- mov eax,HIGHMEM_MAX ; Limit imposed by kernel
+ mov edx,[HighMemSize] ; End of memory
+ dec edx
+ mov eax,[RamdiskMax] ; Highest address allowed by kernel
cmp edx,eax
jna memsize_ok
mov edx,eax ; Adjust to fit inside limit
memsize_ok:
- xor dx,dx ; Round down to 64K boundary
+ inc edx
sub edx,[es:su_ramdisklen] ; Subtract size of ramdisk
xor dx,dx ; Round down to 64K boundary
mov [InitRDat],edx ; Load address
diff --git a/pxelinux.asm b/pxelinux.asm
index 85faf63e..1bf8060e 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -37,7 +37,7 @@ max_cmd_len equ 255 ; Must be odd; 255 is the kernel limit
FILENAME_MAX_LG2 equ 6 ; log2(Max filename size Including final null)
FILENAME_MAX equ (1 << FILENAME_MAX_LG2)
REBOOT_TIME equ 5*60 ; If failure, time until full reset
-HIGHMEM_MAX equ 038000000h ; Highest address for an initrd
+HIGHMEM_MAX equ 037FFFFFFh ; DEFAULT highest address for an initrd
HIGHMEM_SLOP equ 128*1024 ; Avoid this much memory near the top
DEFAULT_BAUD equ 9600 ; Default baud rate for serial port
BAUD_DIVISOR equ 115200 ; Serial port parameter
@@ -117,6 +117,7 @@ su_bsklugeseg resw 1 ; 0222
su_heapend resw 1 ; 0224
su_pad1 resw 1 ; 0226
su_cmd_line_ptr resd 1 ; 0228
+su_ramdisk_max resd 1 ; 022C
resb (9000h-12)-($-$$) ; Were bootsect.S puts it...
linux_stack equ $ ; 8FF4
linux_fdctab equ $
@@ -345,6 +346,7 @@ E820Buf resd 5 ; INT 15:E820 data buffer
InitRDat resd 1 ; Load address (linear) for initrd
HiLoadAddr resd 1 ; Address pointer for high load loop
HighMemSize resd 1 ; End of memory pointer (bytes)
+RamdiskMax resd 1 ; Highest address for a ramdisk
KernelSize resd 1 ; Size of kernel (bytes)
Stack resd 1 ; Pointer to reset stack
PXEEntry resd 1 ; !PXE API entry point
@@ -1754,6 +1756,7 @@ cmdline_end:
;
; Now check if we have a large kernel, which needs to be loaded high
;
+ mov dword [RamdiskMax], HIGHMEM_MAX ; Default initrd limit
cmp dword [es:su_header],HEADER_ID ; New setup code ID
jne near old_kernel ; Old kernel, load low
cmp word [es:su_version],0200h ; Setup code version 2.0
@@ -1762,6 +1765,11 @@ cmdline_end:
jb new_kernel ; If 2.00, skip this step
mov word [es:su_heapend],linux_stack ; Set up the heap
or byte [es:su_loadflags],80h ; Let the kernel know we care
+ cmp word [es:su_version],0203h ; Version 2.03+?
+ jb new_kernel ; Not 2.03+
+ mov eax,[es:su_ramdisk_max]
+ mov [RamdiskMax],eax ; Set the ramdisk limit
+
;
; We definitely have a new-style kernel. Let the kernel know who we are,
; and that we are clueful
@@ -1872,11 +1880,13 @@ load_initrd:
add ax,dx
mov [InitRDClust],ax ; Ramdisk clusters
mov edx,[HighMemSize] ; End of memory
- mov eax,HIGHMEM_MAX ; Limit imposed by kernel
+ dec edx
+ mov eax,[RamdiskMax] ; Highest address allowed by kernel
cmp edx,eax
jna memsize_ok
mov edx,eax ; Adjust to fit inside limit
memsize_ok:
+ inc edx
sub edx,[es:su_ramdisklen] ; Subtract size of ramdisk
xor dx,dx ; Round down to 64K boundary
mov [InitRDat],edx ; Load address