diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-02-01 15:42:39 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-01 15:42:39 -0800 |
commit | 4ea1dfba92844dd53b66bb706f6f9c02962ad03a (patch) | |
tree | df6478945106111c0ac3cb3b8214351b8cb4f8ec | |
parent | 8e489d0b0a3a78afd717a54576c26e6be62a586d (diff) | |
parent | 1e96e9cc1c3549c86dbf4e7caf880477e16e93e0 (diff) | |
download | syslinux-4ea1dfba92844dd53b66bb706f6f9c02962ad03a.tar.gz |
Merge commit 'origin/master' into fsc
-rw-r--r-- | com32/modules/chain.c | 13 | ||||
-rw-r--r-- | core/kernel.inc | 2 | ||||
-rw-r--r-- | core/runkernel.inc | 10 | ||||
-rw-r--r-- | utils/mkdiskimage.in | 16 |
4 files changed, 26 insertions, 15 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c index 2dd80746..458ea890 100644 --- a/com32/modules/chain.c +++ b/com32/modules/chain.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * * * Copyright 2003-2009 H. Peter Anvin - All Rights Reserved - * Copyright 2009 Intel Corporation; author: H. Peter Anvin + * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -394,10 +394,13 @@ static struct part_entry *find_logical_partition(int whichpart, char *table, /* Adjust the offset to account for the extended partition itself */ ptab[i].start_lba += self->start_lba; - /* Sanity check entry: must not extend outside the extended partition. - This is necessary since some OSes put crap in some entries. */ - if (ptab[i].start_lba + ptab[i].length <= self->start_lba || - ptab[i].start_lba >= self->start_lba + self->length) + /* + * Sanity check entry: must not extend outside the + * extended partition. This is necessary since some OSes + * put crap in some entries. Note that root is non-NULL here. + */ + if (ptab[i].start_lba + ptab[i].length <= root->start_lba || + ptab[i].start_lba >= root->start_lba + root->length) continue; /* OK, it's a data partition. Is it the one we're looking for? */ diff --git a/core/kernel.inc b/core/kernel.inc index 9b888cc8..5e1c7a39 100644 --- a/core/kernel.inc +++ b/core/kernel.inc @@ -85,6 +85,8 @@ HEADER_ID equ 'HdrS' ; HdrS (in littleendian hex) ; Flags for the su_loadflags field ; LOAD_HIGH equ 01h ; Large kernel, load high +QUIET_FLAG equ 20h ; Quiet the kernel +KEEP_SEGMENTS equ 40h ; Don't reload segments CAN_USE_HEAP equ 80h ; Boot loader reports heap size ; diff --git a/core/runkernel.inc b/core/runkernel.inc index df3d1509..74f23c45 100644 --- a/core/runkernel.inc +++ b/core/runkernel.inc @@ -1,7 +1,7 @@ ;; ----------------------------------------------------------------------- ;; ;; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved -;; Copyright 2009 Intel Corporation; author: H. Peter Anvin +;; Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -168,7 +168,7 @@ opt_mem: ret opt_quiet: - mov byte [QuietBoot],1 + mov byte [QuietBoot],QUIET_FLAG ret %if IS_PXELINUX @@ -228,6 +228,8 @@ new_kernel: ; we were provided. ; mov al,[es:su_loadflags] + or al,[QuietBoot] ; Set QUIET_FLAG if needed + mov [es:su_loadflags],al mov [LoadFlags],al any_kernel: @@ -458,7 +460,7 @@ setup_move: ; BX points to the final real mode segment, and will be loaded ; into DS. - test byte [QuietBoot],01h ; Don't clear the mode if quiet + test byte [QuietBoot],QUIET_FLAG jz replace_bootstrap jmp replace_bootstrap_noclearmode @@ -631,7 +633,7 @@ loadinitrd: ; assumes CS == DS ; writestr_qchk: - test byte [QuietBoot],01h + test byte [QuietBoot],QUIET_FLAG jz writestr ret diff --git a/utils/mkdiskimage.in b/utils/mkdiskimage.in index 9231fa21..533193a1 100644 --- a/utils/mkdiskimage.in +++ b/utils/mkdiskimage.in @@ -2,7 +2,7 @@ ## ----------------------------------------------------------------------- ## ## Copyright 2002-2008 H. Peter Anvin - All Rights Reserved -## Copyright 2009 Intel Corporation; author: H. Peter Anvin +## Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -144,6 +144,7 @@ if ( $file eq '' || $c < 1 || $h < 1 || $h > 256 || $s < 1 || $s > 63 ) { print STDERR " -z use zipdisk geometry (h=64 s=32)\n"; print STDERR " -4 use partition entry 4 (standard for zipdisks)\n"; print STDERR " -i specify the MBR ID\n"; + print STDERR " -s output a sparse file (don't allocate all blocks)\n"; exit 1; } @@ -216,13 +217,16 @@ print OUTPUT "\x55\xaa"; $totalsize = $c*$h*$s; $tracks = $c*$h; -$track = "\0" x (512*$s); +# If -s is given, try to simply use truncate... +unless ($opt{'s'} && truncate(OUTPUT, $totalsize)) { + $track = "\0" x (512*$s); -# Print fractional track -print OUTPUT "\0" x (512 * ($s-1)); + # Print fractional track + print OUTPUT "\0" x (512 * ($s-1)); -for ( $i = 1 ; $i < $tracks ; $i++ ) { - print OUTPUT $track; + for ( $i = 1 ; $i < $tracks ; $i++ ) { + print OUTPUT $track; + } } # Print mtools temp file |