Browse Source

[prefix] Reasonable value for lkrn initrd_addr_max

H. Peter Anvin <hpa@zytor.com> sent word that Sergey Vlasov
<vsu@altlinux.ru> discovered gPXE lkrn images fail to load in SYSLINUX
3.70 because we have initrd_addr_max zeroed.  This patch sets the same
value as the Linux kernel.

Also change the header jmp instruction to use a hardcoded opcode value
like Linux does.  Just in case the assembler decides to use a three-byte
instruction instead of the desired two-byte jmp.
tags/v0.9.4
Stefan Hajnoczi 16 years ago
parent
commit
4cc786de81
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      src/arch/i386/prefix/lkrnprefix.S

+ 8
- 2
src/arch/i386/prefix/lkrnprefix.S View File

110
 boot_flag: 
110
 boot_flag: 
111
 	.word	0xAA55
111
 	.word	0xAA55
112
 jump:
112
 jump:
113
-	jmp	setup_code
113
+	/* Manually specify a two-byte jmp instruction here rather
114
+	 * than leaving it up to the assembler. */
115
+	.byte	0xeb
116
+	.byte	setup_code - header
114
 header:
117
 header:
115
 	.byte	'H', 'd', 'r', 'S'
118
 	.byte	'H', 'd', 'r', 'S'
116
 version:
119
 version:
142
 cmd_line_ptr:
145
 cmd_line_ptr:
143
 	.long	0
146
 	.long	0
144
 initrd_addr_max:
147
 initrd_addr_max:
145
-	.long	0
148
+	/* We don't use an initrd but some bootloaders (e.g. SYSLINUX) have
149
+	 * been known to require this field.  Set the value to 2 GB.  This
150
+	 * value is also used by the Linux kernel. */
151
+	.long	0x7fffffff
146
 kernel_alignment:
152
 kernel_alignment:
147
 	.long	0
153
 	.long	0
148
 relocatable_kernel:
154
 relocatable_kernel:

Loading…
Cancel
Save