瀏覽代碼

[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 年之前
父節點
當前提交
4cc786de81
共有 1 個檔案被更改,包括 8 行新增2 行删除
  1. 8
    2
      src/arch/i386/prefix/lkrnprefix.S

+ 8
- 2
src/arch/i386/prefix/lkrnprefix.S 查看文件

@@ -110,7 +110,10 @@ root_dev:
110 110
 boot_flag: 
111 111
 	.word	0xAA55
112 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 117
 header:
115 118
 	.byte	'H', 'd', 'r', 'S'
116 119
 version:
@@ -142,7 +145,10 @@ pad1:
142 145
 cmd_line_ptr:
143 146
 	.long	0
144 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 152
 kernel_alignment:
147 153
 	.long	0
148 154
 relocatable_kernel:

Loading…
取消
儲存