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 11:09
中国DOS联盟论坛 » GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » A Beginner's Tutorial on grub4dos DigestIII StickyII View 187,754 Replies 140
Floor 16 Posted 2007-03-13 23:29 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
How does bootlace choose which hard disk to operate? Does 0x80 correspond to operating all hard disks or the default first one? If it's the first one, then how to operate other hard disks?


In the parameters after bootlace, if it's 0x80, the boot code will be written to the first hard disk; if it's 0x81, it will be written to the second hard disk, and so on.

The BIOS only reads the MBR of the first hard disk, so writing to 0x81 is useless. However, in the future, you might use 0x81 as 0x80 (for example, after swapping disks), so you can write the boot code to 0x81.

The code program on the MBR will first search for the grldr file on each partition of the first hard disk. If not found, then search for the grldr file on all partitions of the second hard disk,... If all hard disks are searched in vain, it will also search for the grldr file on the first floppy disk (that is, drive A).
因为我们亲手创建,这个世界更加美丽。
Floor 17 Posted 2007-03-14 02:24 ·  中国 河南 开封 教育网
中级用户
★★
Credits 214
Posts 94
Joined 2007-01-11 10:39
19-year member
UID 76165
Gender Male
Status Offline
Experts' guidance is like breaking through clouds to see the sun, heh heh.
I have tested that the GRLDR started by BOOT.INI on the hard disk is not easy to rename, otherwise problems are likely to occur, while the GRLDR started by EASYBOOT on the CD can be renamed to other names.

The following question probably won't be paid attention to without Master Dian, please let lianjiang come to discuss.
Regarding how the Microsoft standard MBR (from FDISK/MBR) boots the system: When booting, the BIOS calls the first hard disk MBR, the MBR starts to search for the active partition, if it is found, it tries to load the first sector of this partition, and then the boot file (IO.SYS, NTLDR) is loaded by this boot sector program. Is this process wrong?

If BOOTLACE successfully installs GRLDR into a certain partition and this partition is a non-active partition, then how to boot the operating system of this partition??

Heh heh, off-topic. In the development of GRUB4DOS, is BEAN specifically responsible for developing commands or programs to improve the MBR boot code, so that the boot code of the MBR better supports GRUB??
Floor 18 Posted 2007-03-14 04:20 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
The so-called flag of the active partition is actually also formulated by Microsoft. No matter what Microsoft formulates, it wants to become an industrial standard because everyone uses its system. On the first sector of the hard disk, at the beginning is the MBR program code, and at the end is the partition table. The structure of the partition table is also formulated by Microsoft (or we can at least assume that it is formulated by Microsoft). The so-called flag of the active partition is also only what the MBR program code of Microsoft needs to use. Other boot programs do not necessarily need to recognize this active flag. For example, the GRUB boot code as MBR ignores the active flag and directly starts the GRUB main program. After the GRUB main program gains control, it then looks for GRUB's own MENU.LST file and starts the operating system on any partition (which can be the operating system in the logical partition of the extended partition) according to the instructions inside, completely ignoring the partition active flag placed on the partition table by Microsoft.

What you said about Microsoft's boot process is correct.

The GRLDR boot sector installed by bootlace is usually not installed to a certain partition, but to the MBR. In fact, bootlace can also be used to install the boot code to the boot sector of any partition, but this is an advanced topic (dangerous) and not for ordinary users. Ordinary users will be able to use this function in the future, but that has to wait until these mechanisms are all perfected.

The boot code on the MBR only takes charge of finding and starting the GRLDR file (from each partition) and does nothing else. Once the GRLDR file is started, GRLDR finds its configuration file menu.lst and starts any other operating system according to the instructions in menu.lst. GRLDR can recognize FAT12/16/32/NTFS, as well as various file systems under Linux, so it is not difficult for it to start any system. It doesn't care about the active flag of the partition, whether it is active or not, it can start. It even has a command specially used to change the active flag of a certain primary partition.

grub4dos was mainly maintained by me before. bean is to take over from me, and from now on, bean is the main maintainer, and I am also a participating member. bean's joining should be said to be a big leap in this project. bean is a professional, and I am an amateur, so there are naturally some differences. Of course, most of us are amateurs, and I don't mean that amateurs must be bad and professionals must be good. I just mean that bean is both professional and very good. bean has done a lot, for example, chainloader loading IO.SYS of WinME, which involves Microsoft's secrets (decompression), which is very difficult, and this is what bean did. There are also bean's patches in the int13 emulation code. These are the work that bean did during the period when I was the main maintainer. Now bean has shown strength in the NTFS aspect. NTFS is a tough nut to crack. The world many people are researching NTFS, but because Microsoft does not disclose the technical details of NTFS, it is very difficult for the outside world to fully grasp the access method of NTFS. Although the open-source community can now read NTFS, writing to NTFS is still unreliable. I have written the boot sector of EXT2, so I can understand the difficulty of writing the boot sector. Fairly speaking, comparing the boot sectors of all kinds of file systems, then the NTFS boot sector is the most difficult to write. bean has written it and is now perfecting it. bean has done a lot, and it can't be described one by one here. To sum up, bean will further perfect grub4dos. I believe that through his and our joint efforts, grub4dos will go further.
因为我们亲手创建,这个世界更加美丽。
Floor 19 Posted 2007-03-14 11:08 ·  中国 浙江 金华 东阳市 电信
初级用户
Credits 26
Posts 14
Joined 2005-10-14 07:22
20-year member
UID 43475
Status Offline
You're welcome!
Floor 20 Posted 2007-03-15 04:34 ·  中国 河南 新乡 联通
等待验证用户
★★★
Credits 640
Posts 314
Joined 2006-08-13 17:20
19-year member
UID 60432
Gender Male
Status Offline
Thanks to the LZ (thread starter) and Budian, support!!!
Floor 21 Posted 2007-03-23 12:42 ·  中国 新疆 乌鲁木齐 电信
新手上路
Credits 6
Posts 3
Joined 2007-03-23 11:54
19-year member
UID 82664
Gender Male
Status Offline
Thank you, the owner of the post! The owner of the post has worked hard!
Floor 22 Posted 2007-03-29 21:03 ·  中国 安徽 马鞍山 电信
金牌会员
★★★★
Credits 3,946
Posts 1,884
Joined 2006-01-20 13:00
20-year member
UID 49283
Gender Male
Status Offline
GRUB4DOS Beginner's Tutorial (CHM Graphic Version)

Main Updates:
07.03.31 Re - formatted, and added several pieces of GRUB - related materials collected from the Internet in the appendix. (CHM Graphic Version)
This version is the final version and is planned to no longer be updated.
07.03.26 Added "1.6 Appendix: How to Use grubinst_gui" at the request of some netizens.
07.03.24 Rewrote part of the content.
07.03.17 To facilitate the understanding of beginners and increase intuitiveness, added some operation and running effect screenshots, and modified part of the text. Limited to PDF version.
07.03.15 According to the suggestions of everyone, modified part of the content, but the post exceeded the word limit.
If divided into separate posts, it will bring inconvenience to readers.
For easy reference, therefore merged two posts, and simply modified part of the content. Provided as an attachment.
------------------------

[ Last edited by lianjiang2004 on 2007 - 4 - 1 at 02:04 AM ]
Windows 一键还原
http://www.yjhy.com
Floor 23 Posted 2007-04-08 10:28 ·  中国 上海 静安区 电信
新手上路
Credits 10
Posts 5
Joined 2006-11-03 02:46
19-year member
UID 69368
Gender Male
Status Offline
Read it from the beginning, it's really very helpful for beginners.
Floor 24 Posted 2007-04-16 01:22 ·  中国 广西 南宁 电信
初级用户
Credits 30
Posts 15
Joined 2007-04-15 06:31
19-year member
UID 85230
Gender Male
Status Offline
Studying hard...
Floor 25 Posted 2007-04-24 07:00 ·  中国 广东 佛山 电信
新手上路
Credits 10
Posts 6
Joined 2007-04-18 12:33
19-year member
UID 85628
Gender Male
Status Offline
My head is really dizzy
But I've finally gained a further understanding of grub4dos
Thanks to the two experts
Floor 26 Posted 2007-04-24 07:53 ·  中国 山东 临沂 电信
新手上路
Credits 4
Posts 2
Joined 2007-03-02 06:03
19-year member
UID 80533
Gender Male
Status Offline
I finally found it after looking for it several times, thank you very very much
Floor 27 Posted 2007-04-27 00:50 ·  中国 广东 广州 海珠区 电信
初级用户
Credits 81
Posts 35
Joined 2006-10-16 22:11
19-year member
UID 65994
Status Offline
Learning, it turns out that GRUB4DOS is so good...

Thanks to the LZ, Budian and bean, support!!!

[ Last edited by james168 on 2007-4-27 at 12:54 AM ]
Floor 28 Posted 2007-05-01 11:17 ·  中国 江西 南昌 电信
新手上路
Credits 12
Posts 5
Joined 2006-10-24 08:38
19-year member
UID 68021
Gender Male
Status Offline
Why are there no pictures? The poster is not kind~!
Floor 29 Posted 2007-05-01 14:58 ·  中国 安徽 马鞍山 电信
金牌会员
★★★★
Credits 3,946
Posts 1,884
Joined 2006-01-20 13:00
20-year member
UID 49283
Gender Male
Status Offline
Originally posted by yuxiang321654 at 2007-5-1 11:17:
Why are there no pictures? The LZ is not decent~!

It is prompted here that the space is full and attachments cannot be posted. The place to download the CHM graphic version has been provided in the text, please download it by yourself.
Windows 一键还原
http://www.yjhy.com
Floor 30 Posted 2007-05-08 11:10 ·  中国 山东 烟台 联通
新手上路
Credits 4
Posts 2
Joined 2007-02-23 06:20
19-year member
UID 79995
Gender Male
Status Offline
Read it from the beginning, which is really very helpful for beginners.
Forum Jump: