| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
Grub Legacy stage2 will read the install_partition variable from
memory address 0x8208.
We only need to change the value at 0x820a to the correct partition
number:
-1: whole drive (default)
0-3: primary partitions
4-*: logical partitions
Signed-off-by: Gert Hulselmans <gerth@zytor.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add grldr= as boot parameter, so the partition number is only passed to
grub4dos grldr, when grldr= is used.
Currently the partition number is passed in DH unconditionally.
As consequence, grldr will set its root partition on which is searches its
menu.lst to (hd0), because -1 (whole drive) is passed in DH as root partition:
chain.c32 file=/grldr
When the conditional check, this problem is solved:
chain.c32 file=/grldr
Grub4dos will search all partitions for its menu.lst
When you want to set the root partition, use something like the following:
chain.c32 hd0,2 grldr=/grldr
chain.c32 fs grldr=/grldr
Signed-off-by: Gert Hulselmans <gerth@zytor.com>
|
| |
|
|
|
| |
Add keeppxe to usage output.
Cleanup some comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When used with the "fs" option to chain.c32, we need to know our own
filesystem offset. That means knowing if we used the MBR vs GPT
partition information, as well as if we ended up using the passed-in
information or not.
Resolve this by providing an explicit pointer to the current partition
offset. Eventually this should be replaced by some kind of statfs()
call.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
| |
Make sure the handover information to a logical partition is adjusted
correctly -- we can't just hand over the partition entry, but we have
to adjust start_lba to match the real start LBA.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
fs is a full token, not a prefix.
Reported-by: Gert Hulselmans <gerth@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
Use the "label:" specifier followed by the label for
one of a GPT disk's partitions.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
| |
Use the "guid:" specifier followed by the GUID for
a GPT disk or one of its partitions.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
| |
We need to make sure the entire GPT handover structure is mapped
correctly by the shuffler.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
|
| |
When a partition was yielded by a GPT partition iterator,
we follow the protocol documented in syslinux/doc/gpt.txt.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
|
|
| |
We will now accept an "fs" option which instructs us to
chain-load whatever partition we were booted from. Not
useful for PXELINUX, for obvious reasons. Can be used
in combination with a "file=" option, to boot something
other than Syslinux.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
| |
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
|
|
| |
A coding pattern from WinVBlock leaked through whereby a
macro is used to declare functions having the same
prototype. This makes their declarations look a little less
like a traditional declarations however, so that pattern
has been removed.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
| |
A GPT disk partition iterator is introduced, so
we can chain-load partitions on such a disk.
Tested-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
|
|
| |
In order to support more than just MBR and EBR walking, we
introduce the abstraction of a partition iterator. Currently
there are just the two types: MBR partition iterator and
extended partition iterator.
Tested-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
| |
Oops. We might allocate more than just one sector.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
| |
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
| |
Instead of magic offsets.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
| |
A DOS partition table entry contains cylinder, head, sector
tuples which can be convenient to group together and extract
with convenience macros. Currently unused.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
| |
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
| |
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds (basic) support for GRUB stage2 image files.
Loading a stage2 image will probably give you a GRUB prompt, with GRUB's
"root" set at "(hd0)" (ie, entire first disk). Maybe the "root" will
differ in less common setups. (One can of course select another disk
and/or partition with GRUB's "root" command.)
This has only been tested with version 3.2 stage2 images (as used by
GRUB 0.97). I'm not familiair with differences with other versions.
GRUB's loading mechanism allows to somehow provide stage2 with the
selected disk and partition, BSD slice, etc. (ie, to tell stage2 what
it's "root" is). I don't yet understand the notation used in that
mechanism. Besides, since stage2 images will not necessarily be loaded
from the disk (and partition, etc.) they were installed to, it seems
best to just use the first disk.
GRUB stage1_5 image files load quite similarly. However, for some
reason, a short test only got those images to print an error ("Error
17"). This could be related to the partition info these images are
provided with when they're loaded. I have never used stage1_5 images,
and do not know how to properly use and configure those, so my test
stopped there, and stage1_5 images are not supported.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
| |
Hidden sectors value was applied at the wrong offset.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
| |
The change to load the bootsector even when loading a bootstrap from a
file broke the handing of chainloading the MBR of a disk. Fix this.
Debugging-info-by: Thomas Mieslinger <thomas.mieslinger@lundl.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
| |
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
Add an option to update the in-memory version of FAT/NTFS hidden
sectors (== partition offset); load the boot sector for NTLDR.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Some partitioning program, including at least parted, apparently
create the list of logical partition headers nonlinearly with the
partition themselves. Thus, make it a requirement that then fit
inside the overall extended partition, but not inside the
corresponding sublogical partition.
Reported-by: Gert Huselmans <gerth@zytor.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
Grub4dos (like Grub in general) uses the same partition numbers as
Linux (and chain.c32), minus one.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
grldr of Grub4dos wants the partition number in DH:
0xff: whole drive
0-3: primary partitions
4-*: logical partitions
Hmmm... there really isn't a huge reason not to do this
unconditionally, at least unless it's known to cause problems. It
would be better, of course, if grldr used the standard DS:SI, but it
doesn't, so oh well.
Some info of a Grub4dos developer (Tinybit):
GRLDR can be loaded at any address with alignment 16(i.e., a possible
segment base address). Generally you want to load it at 0000:7C00, or at
2000:0000. Of course you never load it at 0000:0000 or similar.
Before jumping to the entry point at the very beginning of GRLDR, you
should setup DL=(BIOS drive) and DH=(partition number). For partition
numbers, 0 - 3 are primary, 4 - 0xFE are logical. (DH=0xFF) stands for
whole drive(unpartitioned). DH will later be passed to
install_partition(the third byte, from bit 16 to bit 23).
http://www.boot-land.net/forums/index.php?showtopic=8457&st=20&start=20 post #22
|
| |
|
|
|
|
|
|
|
| |
Comments fix and usage output corrected for chain.c32
- Gert Hulselmans
Signed-off-by: Gert Hulselmans <kimmik999999@yahoo.co.uk>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
Instead of writing into memory that we might not own, create a proper
copy operation using syslinux_add_movelist().
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following patch for chain.c32 adds support to boot the Recovery Console of Windows NT/2K/XP.
Normally when you want to boot the recovery console, you need to patch "cmdcons\0" into the
bootsectorof the partition (8 bytes starting at 0x3 (4th byte)).
We can do this patching in memory:
strcpy((char *) 0x7c03, "cmdcons");
To boot the recovery console with chain.c32:
chain.c32 cmldr=/cmldr
- Gert Hulselmans
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
‘syslinux_force_text_mode’
When building chain.c32:
$ make chain.c32
gcc -Wp,-MT,chain.o,-MD,./..chain.o.d -std=gnu99 -m32 -fno-stack-protector -mregparm=3 -DREGPARM=3 -march=i386 -Os -W -Wall -march=i386 -fomit-frame-pointer -D__COM32__ -nostdinc -iwithprefix include -I../../com32/libutil/include -I../../com32/include -I../../com32/gplinclude -c -o chain.o chain.c
chain.c: In function ‘do_boot’:
chain.c:552: warning: implicit declaration of function ‘syslinux_force_text_mode’
ld -m elf_i386 -T ../../com32/lib/com32.ld -o chain.elf chain.o ../../com32/libutil/libutil_com.a ../../com32/gpllib/libcom32gpl.a ../../com32/lib/libcom32.a /usr/lib/gcc/i486-linux-gnu/4.4.1/libgcc.a
objcopy -O binary chain.elf chain.c32
The following was missing:
#include <syslinux/video.h>
- Gert Hulselmans
|
| |
|
|
|
|
| |
When loading an unknown system, revert to text mode first.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| | |
|
| |
|
|
|
| |
Add 'isolinux=' option to chain.c32 for chain-loading
another isolinux.bin.
|
| |
|
|
|
|
|
| |
Impact: Error message is more detailed
In case of syntax error, the message is far more detailed and provides
the same content as the documentation integrated in the source code.
|
| |
|
|
|
|
|
|
| |
Impact: visual
Some \n where missing in some error() calls
Signed-off-by: Gert Hulselmans <kimmik999999@yahoo.co.uk>
|
| |\
| |
| |
| |
| |
| |
| | |
Conflicts:
com32/modules/chain.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| | |
| |
| |
| |
| |
| |
| | |
When loaded from ISOLINUX, we still have a valid boot drive. Set it!
This permits the use of chainloaded boot loaders.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |/
|
|
|
|
|
|
|
| |
Automatically reformat com32/modules/chain.c using Nindent.
Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
| |
Remove a clobber of drivename and partition, after we have spent time
computing what the should have been...
Reported-by: Luciano Miguel Ferreira Rocha <strange@nsk.no-ip.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
| |
Update copyright notices; add Intel copyright notices where appropriate.
|
| |
|
|
|
|
| |
Remove a never-implemented, misleading comment
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
|
| |
Remove the special hack for loadbase < 0x7c00. We no longer need it,
since the shuffler will relocate appropriately by magic.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
|
|
| |
If we're booting a disk or partition, then error out if the loaded
sector doesn't have a boot sector signature, rather than the
otherwise-inevitable crash.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
The result of shift in C is undefined if the shift count is greater
than the width of type. On x86 the corresponding CPU instruction
masks the shift count with 0x1f, therefore (mask >> (t & ~0x10)) & 1)
gives false positives for types greater than 0x1f (e.g., the partition
type 0x8e (Linux LVM) could be "hidden" to 0x9e).
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix breakage in the "hide" option support patch:
- The code which initialized the global variable "dapa" was lost in
commit 81c203f2, therefore EBIOS access did not work properly.
Fixed by removing the global variable completely and moving all
bounce buffer handling into read_sector() and write_sector().
- write_sector() copied data to the bounce buffer, but then tried
to use the pointer to the original buffer in BIOS calls.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
| |
If we write the MBR, do verify by reading it back and comparing.
Right now all we do is print an error, though.
|
| |
|
|
| |
Option for chain.c32 to hide primary partitions on the boot drive.
|