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-20 23:17
中国DOS联盟论坛 » GRUB4DOS、SYSLINUX及其它启动管理软件讨论专区 » Troublesome problems with GRUB, everyone consult together DigestI View 46,959 Replies 280
Floor 226 Posted 2004-03-02 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Before FAT12 and FAT16 are done, everyone can first try whether FAT32 works. This has to be tested eventually.

Now, when drive C: is FAT32, the NT boot sector is no longer used. Of course, this has a prerequisite: BOOTGRUB must be copied beginning from the second sector into the sectors immediately after the MBR. If it is not copied into place, the NT boot sector still has to be used.
因为我们亲手创建,这个世界更加美丽。
Floor 227 Posted 2004-03-03 00:00 ·  中国 香港 环球全域电讯国际互联节点
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
The following is quoted from 不点 on 2004-3-2 13:01:29:
Before FAT12 and FAT16 are done, everyone can first try whether FAT32 works. This has to be tested eventually.

Now, when drive C: is FAT32, the NT boot sector is no longer used. Of course, this has a prerequisite: BOOTGRUB must be copied beginning from the second sector into the sectors immediately after the MBR. If it is not copied into place, the NT boot sector still has to be used.




Dear TinyBit,

At present, is it possible to install GRLDR and other GRUB files onto
a FreeDOS floppy using FreeDOS's floppy boot sector to load GRLDR?

Floor 228 Posted 2004-03-03 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
The main significance of GRLDR is that it can be called from the hard disk MBR. If it is on a floppy disk, it is best to use GRUB.EXE, or use the stage2 file.

When the FAT12/16 boot sector for GRLDR is made, then GRLDR can be booted from the floppy boot sector. FreeDOS's KERNEL is located at 0000:0600, while GRLDR is located at 2000:0000, so GRLDR cannot be started simply by changing KERNEL.SYS to GRLDR.

All we need is a FAT12/16 boot sector for booting GRLDR, and the GRLDR file itself (it must be in the root directory). Nothing else is needed at all.
因为我们亲手创建,这个世界更加美丽。
Floor 229 Posted 2004-03-05 00:00 ·  中国 河南 南阳 内乡县 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Development of BOOTGRUB has already been completed. It is now entering the testing stage. Let's see what problems it has.

BOOTGRUB consists of four sectors.

First sector: used for the MBR, or for chainloading GRLDR from NTLDR, or from the GRUB command line using

chainloader (...)/bootgrub
rootnoverify (hd0)

to chainload GRLDR.

When the first sector is placed in the MBR, of course only the first 446 bytes at the beginning of the first sector may be copied to the beginning of the MBR, and the last 66 bytes of the MBR must not be modified (absolutely must not be modified!).

Second sector: this sector and the following third and fourth sectors only take effect when placed immediately after the MBR. The second sector is an auxiliary program for the MBR, the third sector is the boot sector for FAT32, and the fourth sector is the boot sector for FAT12/16.



The fourth sector has another use: copy the fourth sector to the first sector of a floppy disk, and GRLDR can then be booted from the floppy disk. It should be explained here that the following fields of the original floppy sector must not be modified and should retain the original data on the floppy: the 60 bytes from offset 0x02 to 0x3d must not be modified, and the data in this area should use the values from the corresponding area on the floppy. This is only valid for FAT-formatted floppies; other formats such as ext2 are invalid. The GRLDR file needs to be in the root directory of the floppy.

Download:
http://www.ipdown.com/grub4dos/bootgrub this is a 2048-byte binary file
http://www.ipdown.com/grub4dos/bootgrub.S this is the source.
因为我们亲手创建,这个世界更加美丽。
Floor 230 Posted 2004-03-05 00:00 ·  中国 广东 广州 天河区 电信
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
The following is quoted from 不点 at 2004-3-5 16:16:49:
Development of BOOTGRUB has already been completed. It is now entering the testing stage. Let’s see what problems it has.

BOOTGRUB consists of four sectors.

Sector 1: used for the MBR, or for chainloading GRLDR from NTLDR, or from the GRUB command line with

chainloader(...)/bootgrub
rootnoverify(hd0)

to chainload GRLDR.

When the first sector is placed in the MBR, of course you can only copy the first 446 bytes at the beginning of the first sector to the beginning of the MBR, and do not modify the 66 bytes at the end of the MBR (absolutely do not modify them!).

Sector 2: this sector and the following third and fourth sectors only take effect when placed immediately after the MBR. The second sector is an auxiliary program for the MBR, the third sector is the boot sector for FAT32, and the fourth sector is the boot sector for FAT12/16.



The fourth sector has another use: copy the fourth sector to the first sector of a floppy disk, and you can boot GRLDR from the floppy disk. Here it should be explained that the following fields of the original floppy sector must not be modified, and the original data on the floppy should be preserved: from offset 0x02 to 0x3d, these 60 bytes must not be modified; the data in this area should use the values from the corresponding area on the floppy. This is only valid for FAT-formatted floppy disks; other formats such as ext2 are invalid. The GRLDR file needs to be in the root directory of the floppy disk.

Download:
http://www.ipdown.com/grub4dos/bootgrub这是2048字节的二进制文件 this is a 2048-byte binary file
http://www.ipdown.com/grub4dos/bootgrub.S这是源程序 this is the source program.



Dear TinyBit,

Congratulation!

We shall join in testing it. And we now begin a freeware project
-- WINGRUB -- to support your Grub For DOS.

WINGRUB will offer the following features:

1. able to partition & format hard disk into FAT12 / 16 / 32
2. able to copy BOOTGRUB onto floppy disk / floppy disk image / hard disk /
hard disk image of FAT12 / 16 / 32
so that it loads up GRLDR as provided by Grub for DOS
3. copy relevant files onto FAT12 / 16 / 32
partitions for use
4. use our VDisk driver under Win9x / ME for loading up a VDisk for such
operations to produce suitable bootable image file or use Filedisk for
such operation under Win2000 / XP

All these operations are done under a Windows GUI.

We plan to offer this one to two weeks.

If possible, could Wengier put up a link and some description onto the
homepage of Grub For DOS for WINGRUB when it is ready?








Floor 231 Posted 2004-03-06 00:00 ·  美国
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
"If possible, could Wengier put up a link and some description onto the
homepage of Grub For DOS for WINGRUB when it is ready?"


No problem.

However, at the same time I also hope there can be a program under pure DOS and in the DOS box of WIN that can conveniently carry out the functions of "WinGRUB" as well (it only needs to accomplish some basic functions; ideally a small GUI program, though command-line parameters would also be fine), for example automatically copying BOOTGRUB and other files to the hard disk or into the hard disk MBR, instead of having the user do it manually. After all, this would make it more convenient to popularize and promote GRUB. If possible, windrv could also include it together in the release of "WinGRUB", thus achieving cross-platform functionality, similar to how WINRAR includes both WINRAR.EXE and RAR.EXE.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 232 Posted 2004-03-06 00:00 ·  中国 广东 广州 天河区 电信
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
The following is quoted from Wengier on 2004-3-6 5:02:48:
"Ifpossible,couldWengierputupalinkandsomedescriptionontothe
homepageofGrubForDOSforWINGRUBwhenitisready?"


No problem.

However, at the same time I also hope that under pure DOS and in the DOS box of WIN there can also be a program that can conveniently carry out the functions of "WinGRUB" (it only needs to accomplish some basic functions; ideally a small GUI program, though a command-line parameter style would also be acceptable), for example being able to automatically copy BOOTGRUB and other files to the hard disk or into the hard disk MBR, instead of having the user do it manually. After all, that would make it easier to popularize and promote GRUB. If possible, windrv could also include it together in the release of "WinGRUB" to achieve cross-platform functionality, similar to how WINRAR includes both WINRAR.EXE and RAR.EXE.


Dear Wengier,

Thank you very much!

We shall try our best. First we finish WINGRUB, then we try to port it to
run under real-DOS or virtual-DOS with a GUI or on command-line.

I don''t know if TinyBit is interested in doing the latter part.
If he is, he has the right to claim that priority because Grub For DOS
is originated by him.

By the way, could TinyBit clarify the following points about copying
BOOTGRUB to floppy

1. what is Offset - 0x02 to 0x3d on a floppy all about?
2. are you referring to a formatted / & sys-ed floppy?
3. formatted / & sys-ed by MSDOS or FreeDOS?
4. what are the steps of copying the 4th sector of BOOTGRUB
onto the floppy? Are they
a. format a floppy by MSDOS or FreeDOS
b. save Offset 0x20 to 0x3d to a file
c. copy the 4th sector of BOOTGRUB to the first sector of the floppy
d. restore the Offset file to Offset position 0x20 to 0x3d





Floor 233 Posted 2004-03-06 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Thanks to windrv for your concern and support all along!

To make things easier for your work, I’ll explain some related technical details here.

1。BOOTGRUB is for booting GRLDR under FAT12/16/32 and NTFS, and currently does not support other partition formats.

2。BOOTGRUB currently uses the following algorithm to look for GRLDR: first it starts searching from the first primary partition in the MBR, to see whether it is a FAT12/16/32 partition. If it is, it assumes that the root directory of that partition contains the GRLDR file, and tries to boot it. If that FAT12/16/32 partition does not have a GRLDR file, booting will fail (displaying “No GRLDR” and halting). If that partition is not FAT12/16/32, it then checks whether it is an NTFS partition, that is, whether it has Microsoft’s NTLDR boot sector. If it does, it assumes that the root directory of that NTFS partition contains the GRLDR file, and tries to start it. If that partition does not have Microsoft’s NTLDR boot sector, then the first primary partition is considered unable to boot GRLDR, and it fails. Then it moves on to the second primary partition and does similar things. If that also fails, it tries the third and fourth primary partitions. If all four primary partitions fail, it displays the Missing GRLDR message and halts. According to the current algorithm design, we do not care which primary partition has the Active flag. In general, the partition where we find GRLDR is Windows drive C:, but that may not always be so.【Note that Windows generally treats the primary partition containing the active flag as drive C:.】

3。Our boot loader is highly flexible. The user can freely adjust partition sizes, and can even change partition types (from FAT16 to FAT32 or NTFS, change them however you like!). None of this affects our program; BOOTGRUB can always find the GRLDR file in the root directory of the partition.

4。Because of the generality and transparency of the algorithm, installing BOOTGRUB into the MBR becomes simple, and it can be installed with any software under any operating system. For comparison, GNU GRUB’s stage files must enter GRUB in order to be installed. It is difficult for others to write an MBR installation program for it, because its MBR contains absolute disk location information, which changes depending on the physical location of the stage files.

5。If the floppy’s file system type is FAT12/16, then use the fourth sector of BOOTGRUB; as mentioned earlier, the 60 bytes from 0x02 to 0x3d on the floppy must not be changed. If the floppy’s partition type is FAT32, then the third sector of BOOTGRUB should be used, and the range of floppy sector bytes to leave unchanged is 0x02 to 0x59; these 88 bytes must not be changed, and the original values on the floppy should be used. Don’t be surprised that a floppy might use FAT16 or FAT32 formats; this is possible. If the floppy capacity is several hundred MB or several dozen GB, then it will use FAT16 or FAT32 formats like these. In particular, GRUB for DOS can emulate a hard disk file as a floppy, and the capacity of this emulated floppy has no limit at all.

------------------

Also, GRUB for DOS still needs a tool that can defragment a single file. I wonder whether windrv’s company can make such a tool.
因为我们亲手创建,这个世界更加美丽。
Floor 234 Posted 2004-03-06 00:00 ·  中国 广东 广州 天河区 电信
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
Dear TinyBit,

Thank you for your clarification.

About defragmentation, if the partition itself is scattered with other files
and have no continuous free space sufficient to host the image file, we
need to defrag the partition first. We have no plan to do a partition
defragmentation programme now.

But there are some other ways to work around the problem:

1. a. defragment the partition first
b. find & reserve sufficient continuous free space for the image file
c. write the image file onto it
2. under Win2000 / XP, create an empty image file and mount it up
using filedisk, then copy all the files you need one by one into the
image file -- you may then use our WINDRV or other utility to turn
it into a bootable hard disk image file and copy it onto the hard disk
with WINDRV
3. under Win9x / ME, we have a utility called FATimage to create an
empty image file of FAT 16 / 32 partition and to help copy files into
it continuously -- after that use our WINDRV or other utility to turn
it into a bootable hard disk image file and copy it onto the hard disk
with WINDRV

Please note the use of FATimage should not be done in where the M$
patents on long-file-name handling are in force if the files you copy with
FATimage have long-file-name.

We shall release details about this later.


Floor 235 Posted 2004-03-06 00:00 ·  美国
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
"I don''t know if TinyBit is interested in doing the latter part.
If he is, he has the right to claim that priority because Grub For DOS
is originated by him."


I wonder what Budian thinks about this issue?
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 236 Posted 2004-03-06 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Oh, brother windrv, you are online too. I didn't see your post just now.

Reply to brother windrv:

> We shall try our best. First we finish WINGRUB, then we try to port it to run under real-DOS or virtual-DOS
> with a GUI or on command-line.

Good!

> I don''t know if TinyBit is interested in doing the latter part. If he is, he has the right to claim that priority
> because Grub For DOS is originated by him.

My health is poor, and I do not have the ability to deal with many things anymore. For example, I rarely come to the forum, and I also cannot answer many technical questions. Thank you, brother windrv; I support your work. The work you do, I won't do. Thank you for reducing my burden. I am truly very grateful!

Right now I want to bring grub for dos 0.2.0 to a close as soon as possible; after that I may no longer touch it. Because of health reasons.

> By the way, could TinyBit clarify the following points about copying BOOTGRUB to floppy

> 1. what is Offset - 0x02 to 0x3d on a floppy all about?

0x02 ----- win98 uses this byte to indicate whether LBA disk access mode must be forcibly used. When the partition is beyond cylinder 1024, win98 writes the single-byte value 0x0e into offset 0x02. Usually the value at this location is 0x90. Our program also uses the indication of this byte to determine whether to use LBA disk mode. Usually, for compatibility, 0x0e should not be placed on a 1.44M floppy; the value 0x90 should be kept.

0x03 - 0x0A these 8 bytes are a string; any value is fine.

0x0B - 0x3D these 51 bytes are the BPB and extended BPB table. They record important physical parameters of the disk and must not be changed arbitrarily.

> 2. are you referring to a formatted / & sys-ed floppy?

Yes. More precisely, a formatted floppy, but not necessarily one containing a system. Other than these 60 bytes from 0x02 - 0x3D, we seem not to need anything else. Of course, the FAT tables and the root directory should exist, and any FAT disk has these. Without a root directory, we cannot place the GRLDR file. No matter which operating system , the BPB tables they create are all the same. So as long as it has been formatted, that is enough. An empty disk with no files is also fine .

> 3. formatted / & sys-ed by MSDOS or FreeDOS?

As above, anything is fine. You can even write your own formatting software. PC-TOOLS and similar software can also do it.

> 4. what are the steps of copying the 4th sector of BOOTGRUB onto the floppy? Are they
>
> a. format a floppy by MSDOS or FreeDOS
> b. save Offset 0x20 to 0x3d to a file
> c. copy the 4th sector of BOOTGRUB to the first sector of the floppy
> d. restore the Offset file to Offset position 0x20 to 0x3d
>

It is 0x02 to 0x3d, not 0x20 to 0x3d. Any method is fine as long as it achieves the purpose. For example,

a. Format a floppy, or use any existing floppy that has already been formatted.
b. Read the first sector of the floppy into memory area 1, and read the fourth sector of BOOTGRUB into memory area 2.
c. Copy the 60 bytes from 0x02 ---- 0x3d in memory area 1 to 0x02 ---- 0x3d in memory area 2.
d. Write the modified memory area 2 to the first sector of the floppy.
e. Copy the GRLDR file to the root directory of the floppy.

If the floppy format is FAT32, then of course you must use the third sector of BOOTGRUB instead of the fourth. Correspondingly, the 60-byte area 0x02 ---- 0x3d should be changed to the 88-byte area 0x02 ---- 0x59.
因为我们亲手创建,这个世界更加美丽。
Floor 237 Posted 2004-03-06 00:00 ·  美国
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Budian:

I discovered a "problem" with GRUB.EXE. That is, when CONFIG.SYS specifies SHELL=C:\GRUB.EXE( (with no parameters at all), or when the system prompts for the command processor path and you enter GRUB.EXE, it still cannot enter the GRUB interface normally. Instead, it shows GRUB's usage, namely the following information:

Usage:
GRUB --config-file=FILE
The options are case-sensitive, you must use lower-case letters. Example:
GRUB --config-file=(hd0,0)/boot/grub/menu.lst

I don't know why this is. Since this is still fairly important in some situations, I hope it can be solved. Thanks!
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 238 Posted 2004-03-06 00:00 ·  中国 河南 南阳 联通
银牌会员
★★★★
不甘寂寞的人
Credits 2,491
Posts 1,115
Joined 2003-09-24 00:00
22-year member
UID 10292
Gender Male
Status Offline
Thanks. When GRUB finds unrecognized parameters on the command line, it displays the usage and exits. It is possible that the shell= command adds extra parameters to the GRUB command line, such as /p and so on. All right, I hope this BUG can be fixed next time.
因为我们亲手创建,这个世界更加美丽。
Floor 239 Posted 2004-03-06 00:00 ·  中国 广东 广州 天河区 电信
中级用户
★★
Credits 385
Posts 118
Joined 2003-11-11 00:00
22-year member
UID 12678
Gender Male
Status Offline
Dear TinyBit,

Thank you for your further clarification and your grace to let us do something
for your Grub for DOS under DOS.

We shall provide such a DOS utility for copying BOOTGRUB to hard disk /
floppy disk / image files as suggested by Wengier.

We however are unable to download your bootgrub & bootgrub.S from
the URL provided by you at 229th floor above.

Could you provide another URL or put up on your GRUB for DOS homepage?

Please also take good care of your health!


Floor 240 Posted 2004-03-06 00:00 ·  中国 香港
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
The following is quoted from windrv on 2004-3-6 17:27:47:
Dear TinyBit,

Thank you for your further clarification and your grace to let us do something
for your Grub for DOS under DOS.

We shall provide such a DOS utility for copying BOOTGRUB to hard disk  /
floppy disk / image files as suggested by Wengier.

We however are unable to download your bootgrub  & bootgrub.S from
the URL provided by you at 229th floor above.

Could you provide another URL or put up on your GRUB for DOS homepage?

Please also take good care of your health!



OK then I provide two mirrors:
Japan mirror(faster):
http://i.cool.ne.jp/clspaste02/bootgrub
http://i.cool.ne.jp/clspaste02/bootgrub.S

China mirror(slower):
http://roy.e-stone.cn/bootgrub
http://roy.e-stone.cn/bootgrub.S
我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Forum Jump: