It is currently Wed Apr 23, 2014 10:14 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Adding a HDD/partition menu listing to chainload partitions
PostPosted: Tue Aug 04, 2009 6:33 am 
Offline

Joined: Mon Jun 01, 2009 8:30 am
Posts: 49
Saw this today:

Image

And I was curious on how it could be implemented within syslinux. I was thinking about adding this kind of listing as an extra handy menu. In the current release of ubcd (5.0b12) there is following code to load next device.
Code:
LABEL -
   MENU LABEL Boot next device
TEXT HELP
Boot next device in the boot sequence. Supporting BIOS required. May not work
with all systems.
ENDTEXT
   LOCALBOOT -1
I looked at the syslinux wiki page but am not completely sure what the proper syntax would be. Any tips?

thanks,
dpc


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 04, 2009 6:56 am 
Offline

Joined: Fri Jan 11, 2008 2:52 pm
Posts: 1278
Can you post the menu.lst file?

You need chain.c32 (/com32/modules/)
Code:
* chain.c
*
* Chainload a hard disk (currently rather braindead.)
*
* Usage: chain hd<disk#> [<partition>] [options]
*        chain fd<disk#> [options]
*     chain mbr:<id> [<partition>] [options]
*     chain boot [<partition>] [options]
*
* ... e.g. "chain hd0 1" will boot the first partition on the first hard
* disk.
*
*
* The mbr: syntax means search all the hard disks until one with a
* specific MBR serial number (bytes 440-443) is found.
*
* Partitions 1-4 are primary, 5+ logical, 0 = boot MBR (default.)
*
* Options:
*
* file=<loader>:
*   loads the file <loader> **from the SYSLINUX filesystem**
*   instead of loading the boot sector.
*
* seg=<segment>:
*   loads at and jumps to <seg>:0000 instead of 0000:7C00.
*
* ntldr=<loader>:
*   equivalent to -seg 0x2000 -file <loader>, used with WinNT's loaders
*
* freedos=<loader>:
*   equivalent to -seg 0x60 -file <loader>, used with FreeDOS kernel.sys.
*
* msdos=<loader>
* pcdos=<loader>
*   equivalent to -seg 0x70 -file <loader>, used with DOS' io.sys.
*
* swap:
*   if the disk is not fd0/hd0, install a BIOS stub which swaps
*   the drive numbers.
*
* hide:
*   change type of primary partitions with IDs 01, 04, 06, 07,
*   0b, 0c, or 0e to 1x, except for the selected partition, which
*   is converted the other way.

Code:
UI /boot/syslinux/menu.c32

LABEL -
MENU LABEL Boot MBR on first hard disk
COM32 /boot/syslinux/chain.c32
APPEND hd0

LABEL -
MENU LABEL Boot primary partition #1 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 1

LABEL -
MENU LABEL Boot primary partition #2 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 2

LABEL -
MENU LABEL Boot primary partition #3 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 3

LABEL -
MENU LABEL Boot primary partition #4 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 4

LABEL -
MENU LABEL Boot logical partition #1 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 5

LABEL -
MENU LABEL Boot logical partition #2 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 6

LABEL -
MENU LABEL Boot logical partition #3 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 7

LABEL -
MENU LABEL Boot MBR on second hard disk
COM32 /boot/syslinux/chain.c32
APPEND hd1

LABEL -
MENU LABEL Boot primary partition #1 on second hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd1 1

LABEL -
MENU LABEL Boot primary partition #2 on second hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd1 2

LABEL -
MENU LABEL Boot primary partition #3 on second hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd1 3

LABEL -
MENU LABEL Boot primary partition #4 on second hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd1 4

LABEL -
MENU LABEL Boot logical partition #1 on second hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd1 5

LABEL -
MENU LABEL Boot logical partition #2 on second hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd1 6

LABEL -
MENU LABEL Boot logical partition #3 on second hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd1 7

If you boot from CD (ISOLINUX), all entries with 'on first hard drive' will boot your internal HDD (in normal cases at least).
When you boot from an USB stick (SYSLINUX), all entries with 'on first hard drive' refer to your USB stick (if it is detected as HDD in BIOS, not if is detected as a floppy). So you need the 'on second hard drive' options to boot your internal HDD.

_________________
Download Ultimate Boot CD v5.0: http://www.ultimatebootcd.com/download.html
Use Parted Magic for handling all partitioning task: http://partedmagic.com/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 06, 2009 6:33 am 
Offline

Joined: Mon Jun 01, 2009 8:30 am
Posts: 49
thanks Icecube!
Quote:
Can you post the menu.lst file?
Not my project - just pic I saw on the internet...
Quote:
If you boot from CD (ISOLINUX), all entries with 'on first hard drive' will boot your internal HDD (in normal cases at least).
When you boot from an USB stick (SYSLINUX), all entries with 'on first hard drive' refer to your USB stick (if it is detected as HDD in BIOS, not if is detected as a floppy). So you need the 'on second hard drive' options to boot your internal HDD.
I will only be using the first HDD portion to chainload other partitions on the USB-HDDs. I will use this to work around the single INSTALL.WIM limitation of setup.exe in Win7/Vista/Win2k8. First partition would have my custom UBCD build with a BOOTMGR with all the recovery WIMs and a single INSTALL.WIM (say Win7 32bit). Second partition would be likely just a NTFS partition with say Win7 64bit ISO extracted into it.

I wouldnt see any good reason for supporting hdd loading in UBCD ISO so I dont have to worry about drive 2.

I will likely only add code for partition 2 and 3 on the first hdd using following code:
Code:
LABEL -
MENU LABEL Boot primary partition #2 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 2

LABEL -
MENU LABEL Boot primary partition #3 on first hard drive
COM32 /boot/syslinux/chain.c32
APPEND hd0 3
As an "aside" thought.... If my whole goal was to chainload a second partition with BOOTMGR to kick off a different installation version/bootmgr instance (and it is) then a more sensible way would be to add an entry(s) into the BCD file of the first partition that would have an option of loading the second/third partitions. Does that make sense?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 06, 2009 8:01 am 
Offline

Joined: Mon Jun 01, 2009 8:30 am
Posts: 49
Quote:
As an "aside" thought.... If my whole goal was to chainload a second partition with BOOTMGR to kick off a different installation version/bootmgr instance (and it is) then a more sensible way would be to add an entry(s) into the BCD file of the first partition that would have an option of loading the second/third partitions. Does that make sense?
Just posted my musings on MSFN forums.

http://www.msfn.org/board/index.php?showtopic=135332

~
dpc


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group