aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2005-09-06 18:17:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 19:57:29 -0400
commitf8eeaaf4180334a8e5c3582fe62a5f8176a8c124 (patch)
treef2db782c1a67c1d632942d43b68bd2c5c7c3981d /arch/i386
parent5e1efe4931bf7d95b2f3d48ca0b79ea0e8341cc2 (diff)
[PATCH] Make the bzImage format self-terminating
Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Frank Sorenson <frank@tuxrocks.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/boot/setup.S2
-rw-r--r--arch/i386/boot/tools/build.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
index 8cb420f40c58..ca668d9df164 100644
--- a/arch/i386/boot/setup.S
+++ b/arch/i386/boot/setup.S
@@ -82,7 +82,7 @@ start:
82# This is the setup header, and it must start at %cs:2 (old 0x9020:2) 82# This is the setup header, and it must start at %cs:2 (old 0x9020:2)
83 83
84 .ascii "HdrS" # header signature 84 .ascii "HdrS" # header signature
85 .word 0x0203 # header version number (>= 0x0105) 85 .word 0x0204 # header version number (>= 0x0105)
86 # or else old loadlin-1.5 will fail) 86 # or else old loadlin-1.5 will fail)
87realmode_swtch: .word 0, 0 # default_switch, SETUPSEG 87realmode_swtch: .word 0, 0 # default_switch, SETUPSEG
88start_sys_seg: .word SYSSEG 88start_sys_seg: .word SYSSEG
diff --git a/arch/i386/boot/tools/build.c b/arch/i386/boot/tools/build.c
index 6835f6d47c31..05798419a6a9 100644
--- a/arch/i386/boot/tools/build.c
+++ b/arch/i386/boot/tools/build.c
@@ -177,7 +177,9 @@ int main(int argc, char ** argv)
177 die("Output: seek failed"); 177 die("Output: seek failed");
178 buf[0] = (sys_size & 0xff); 178 buf[0] = (sys_size & 0xff);
179 buf[1] = ((sys_size >> 8) & 0xff); 179 buf[1] = ((sys_size >> 8) & 0xff);
180 if (write(1, buf, 2) != 2) 180 buf[2] = ((sys_size >> 16) & 0xff);
181 buf[3] = ((sys_size >> 24) & 0xff);
182 if (write(1, buf, 4) != 4)
181 die("Write of image length failed"); 183 die("Write of image length failed");
182 184
183 return 0; /* Everything is OK */ 185 return 0; /* Everything is OK */