Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

USB drive boot manager

Name: Anonymous 2012-07-13 20:00

Hi /prog/

I have windows installed to one HDD, and *nix to another. ATM i use the BIOS to switch between drives at boot. This is because I want each drive to remain bootable on its own [eg if i brick one of the two OSes]. Obviously this isn't very efficient.

I'd like to have a boot manager installed on a USB drive to select between which to boot, but I want to avoid doing anything that modifies the drives so that they become unbootable without the USB stick either.

Can you point me in the direction of some software that can do this? I've looked at Plop, YUMI, GRUB and LILO but i'm not really sure which best suits my needs, and if its possible to use them in the way i describe [from USB stick, with USB keyboard and without modifying their MBR etc].

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-07-15 7:41

>>27
Not tested, it's been a while since I worked with this stuff, but should print '?' and wait for you to press 0-3. It then tries to load the boot sector of the specified hard drive and runs it, printing an 'X' and waiting for you to try again indefinitely.


@h7c00
:start
 ; make sure we are executing at 0000:7c00
 jmpf h00007c05
 ; setup stack to 0000:7a00, right below relocated boot sector
 cli | xor ax ax | mov ss ax | mov sp h7a00 | sti
 ; make sure segment registers set correctly
 push cs | push cs | pop ds | pop es
 ; relocate to 7a00...
 mov si :stuborig | mov di :stubnew | mov cx 256 | rep movsw
 jmp h7a00 ; ... and continue there
:stuborig
@h7a00
:stubnew
 mov ax h0a3f | xor bx bx | mov cx 1 | int h10 ; write '?' prompt
:readloop
 mov ah 0 | int h16 ; wait for key
 cmp al h30 | jb :readloop | cmp al h33 | ja :readloop ; valid values: '0' ~ '3'
 ; prepare for read call
 add al h50 | xor dx dx | mov dl al | mov cx 1 | mov bx h7c00
 mov ax h0201 ; read from hard disk 0 ~ 3
 push dx      ; save dl
 int h13
 pop dx       ; restore dl to pass to chainloaded boot sector
 jnc h7c00 ; read successful, run new boot sector directly
 mov ax h0a5a | xor bx bx | mov cx 1 | int h10 ; write 'X' to indicate error
 jmp :readloop ; ...and try again
.pos 510
 dw haa55      ; MBR validation signature

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List