diff options
author | H. Peter Anvin <hpa@zytor.com> | 2005-09-06 18:17:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:29 -0400 |
commit | f8eeaaf4180334a8e5c3582fe62a5f8176a8c124 (patch) | |
tree | f2db782c1a67c1d632942d43b68bd2c5c7c3981d /arch/x86_64 | |
parent | 5e1efe4931bf7d95b2f3d48ca0b79ea0e8341cc2 (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/x86_64')
-rw-r--r-- | arch/x86_64/boot/setup.S | 2 | ||||
-rw-r--r-- | arch/x86_64/boot/tools/build.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86_64/boot/setup.S b/arch/x86_64/boot/setup.S index ff58b2832b75..12ea0b6c52e2 100644 --- a/arch/x86_64/boot/setup.S +++ b/arch/x86_64/boot/setup.S | |||
@@ -81,7 +81,7 @@ start: | |||
81 | # This is the setup header, and it must start at %cs:2 (old 0x9020:2) | 81 | # This is the setup header, and it must start at %cs:2 (old 0x9020:2) |
82 | 82 | ||
83 | .ascii "HdrS" # header signature | 83 | .ascii "HdrS" # header signature |
84 | .word 0x0203 # header version number (>= 0x0105) | 84 | .word 0x0204 # header version number (>= 0x0105) |
85 | # or else old loadlin-1.5 will fail) | 85 | # or else old loadlin-1.5 will fail) |
86 | realmode_swtch: .word 0, 0 # default_switch, SETUPSEG | 86 | realmode_swtch: .word 0, 0 # default_switch, SETUPSEG |
87 | start_sys_seg: .word SYSSEG | 87 | start_sys_seg: .word SYSSEG |
diff --git a/arch/x86_64/boot/tools/build.c b/arch/x86_64/boot/tools/build.c index 18b5bac1c428..c44f5e2ec100 100644 --- a/arch/x86_64/boot/tools/build.c +++ b/arch/x86_64/boot/tools/build.c | |||
@@ -178,7 +178,9 @@ int main(int argc, char ** argv) | |||
178 | die("Output: seek failed"); | 178 | die("Output: seek failed"); |
179 | buf[0] = (sys_size & 0xff); | 179 | buf[0] = (sys_size & 0xff); |
180 | buf[1] = ((sys_size >> 8) & 0xff); | 180 | buf[1] = ((sys_size >> 8) & 0xff); |
181 | if (write(1, buf, 2) != 2) | 181 | buf[2] = ((sys_size >> 16) & 0xff); |
182 | buf[3] = ((sys_size >> 24) & 0xff); | ||
183 | if (write(1, buf, 4) != 4) | ||
182 | die("Write of image length failed"); | 184 | die("Write of image length failed"); |
183 | 185 | ||
184 | return 0; /* Everything is OK */ | 186 | return 0; /* Everything is OK */ |