China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 05:43
中国DOS联盟论坛 » GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » How can grub boot an operating system on SATA? View 1,372 Replies 6
Original Poster Posted 2007-12-17 20:57 ·  中国 北京 中移铁通
新手上路
Credits 8
Posts 3
Joined 2005-11-20 10:53
20-year member
UID 45600
Gender Male
Status Offline
Question for all the experts:
How can grub boot an operating system on SATA?? Also, what do the fallback and map commands mean?


There is no problem booting the operating system on IDE, and the BIOS can recognize the SATA hard disk, but how should it be set in grub??
Floor 2 Posted 2007-12-17 21:49 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
title find and load NTLDR of Windows NT/2K/XP
find --set-root /ntldr
chainloader /ntldr


title boot from the first partition of the first hard disk
root (hd0,0)
chainloader +1

title boot from the first partition of the second hard disk
root (hd1,0)
chainloader +1


title boot NTLDR from the first partition of the first hard disk
chainloader (hd0,0)/ntldr

title boot NTLDR from the first partition of the second hard disk
chainloader (hd1,0)/ntldr
第一高手 第二高手

Floor 3 Posted 2007-12-17 22:50 ·  中国 北京 中移铁通
新手上路
Credits 8
Posts 3
Joined 2005-11-20 10:53
20-year member
UID 45600
Gender Male
Status Offline
Thanks to the poster in reply #2, but we can't possibly always know whether the system on the current hard disk is 2000/xp/2003 or vista, so how can we make a menu that guarantees all four systems can boot???
Thanks, it seems to use fallback, but I don't know how to use it. Friends who know, please give some pointers!!
Floor 4 Posted 2007-12-17 23:10 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
There is a sample menu.lst in the grub4dos-0.4.3 package.
The problem is that you didn't say the booting rule; which should have priority among 2000/xp/2003/vista?

title priority 1
fallback 1
.....

title jump here if 1 fails
fallback 2
.....

title jump here if 2 fails
fallback 3
.....

title jump here if 3 fails
fallback 4
.....



# This is a sample menu.lst file. You should make some changes to it.
# The old install method of booting via the stage-files has been removed.
# Please install GRLDR boot strap code to MBR with the bootlace.com
# utility under DOS/Win9x or Linux.

color black/cyan yellow/cyan
timeout 30
default /default

title find and load NTLDR of Windows NT/2K/XP
fallback 1
find --set-root /ntldr
chainloader /ntldr
savedefault --wait=2

title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
fallback 2
find --set-root /cmldr
chainloader /cmldr
#####################################################################
# write string "cmdcons" to memory 0000:7C03 in 2 steps:
#####################################################################
# step 1. Write 4 chars "cmdc" at 0000:7C03
write 0x7C03 0x63646D63
# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
write 0x7C07 0x00736E6F
savedefault --wait=2

title find and load IO.SYS of Windows 9x/Me
fallback 3
find --set-root /io.sys
chainloader /io.sys
savedefault --wait=2

title find and boot Mandriva with menu.lst already installed
fallback 4
find --set-root /etc/mandriva-release
savedefault --wait=2
configfile /boot/grub/menu.lst

title find and boot Linux with menu.lst already installed
fallback 5
find --set-root /sbin/init
savedefault --wait=2
configfile /boot/grub/menu.lst

title commandline
savedefault --wait=2
commandline

title floppy (fd0)
chainloader (fd0)+1
rootnoverify (fd0)
savedefault --wait=2

title back to dos
savedefault --wait=2
quit

title reboot
savedefault --wait=2
reboot

title halt
savedefault --wait=2
halt

title memdrive duplicated from floppy image file (hd0,0)/sbm.bin
map --mem (hd0,0)/sbm.bin (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
savedefault --wait=2

title memdrive based on win98 partition (hd0,6)
map --mem (hd0,6)+1 (hd0)
# map --mem (hd0,0)/win98.gz (hd0)
map --hook
chainloader (hd0)+1
rootnoverify (hd0)
savedefault --wait=2
第一高手 第二高手

Floor 5 Posted 2007-12-18 10:24 ·  中国 上海 中国科学院上海分院
金牌会员
★★★★
Credits 3,467
Posts 1,616
Joined 2004-06-21 00:00
22-year member
UID 27148
Status Offline
No need to make it this complicated, just do this directly:
map (hd0) (hd1)
map (hd1) (hd0)
map --hook
chainloader (hd0)+1
boot
Floor 6 Posted 2007-12-19 11:38 ·  中国 北京 联通(数字北京大厦IDC机房)
新手上路
Credits 8
Posts 3
Joined 2005-11-20 10:53
20-year member
UID 45600
Gender Male
Status Offline
What the poster in #5 said still doesn't work, at least on my system with a hidden partition it didn't boot successfully.
I remember there is a command to check all partitions of the system; is it root (hd0
Ah, why doesn't it work??
Thanks/
Floor 7 Posted 2007-12-19 12:30 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
title map the fourth partition of the first hard disk as the first partition of the first hard disk
map --in-situ (hd0,6)+1 (hd0)
find --set-root /ntldr
chainloader /ntldr
boot
第一高手 第二高手

Forum Jump: