[syslinux] Adding a "boot from local hard disk" option to syslinux menu, booted from USB

H. Peter Anvin hpa at zytor.com
Thu Oct 18 17:32:42 PDT 2007


bobby digital wrote:
> Hi all, 
> 
> I use XP on my laptop PC, with 30 GB HD (single
> partition), and a 3.5" hard drive (not a stick),
> accessed through a USB encasing, partitioned as five
> logical drives. 
> 
> I have successfully set up syslinux to boot several
> Ubuntu versions from the primary USB hard drive
> partition, and no problems there. The problem is, I
> would like to have an entry in the menu, like "Boot
> from first hard disk", in which case, I would boot XP
> from the laptop hard drive. 
> 
> I'm not very knowledgeable about booting, but I read
> that I would have to chainload, so I tried to use
> chain.c32 and the following entries: 
> 
> LABEL hd
>   menu label ^hd - boot IDE0 hd0 0
>   kernel chain.c32
>   append hd0 0
>   
> and 
> 
> LABEL hd2
>   menu label ^Boot from first hard disk
>   localboot 0x80
>   append -
> 
> but unfortunately nothing seems to happen (the first
> option says "illegal argument" or something, exits and
> shows boot menu again, the other simply show the boot
> menu again) - it seems as if chain.c32 interprets "hd0
> 0" to be a partition on the USB hard drive, instead of
> the local one? 
> 
> I tried to modify the source code of chain.c32 (the
> function is included below, compiled through
> DSL-embedded, with gcc package) where I tried to scan
> through possible hard disks (that is, loop through
> drive and partition indexes) and print out info, in
> hope that I'd spot the main (C) drive on the laptop.
> But apart from the USB drive itself, nothing seems to
> have an MBR, no matter how much I look? (it could be
> easier if I could save a text report, but the file
> open operation fails - I'm guessing because at the
> moment, it is not known what the default drive is??).
> 

It sounds like when your BIOS boots from the USB disk, it hides the 
primary hard disk.  This is pretty braindead behaviour, but I could see 
how it would "make sense" to someone as they implemented it.  The 
problem is, if it doesn't make the proper hard disk available as another 
drive number, the only way out would be to invoke the BIOS Boot 
Specification interfaces, to boot a different device.

Right now I don't have code for that.

	-hpa




More information about the Syslinux mailing list