summaryrefslogtreecommitdiff
path: root/pxelinux.asm
diff options
context:
space:
mode:
Diffstat (limited to 'pxelinux.asm')
-rw-r--r--pxelinux.asm14
1 files changed, 12 insertions, 2 deletions
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