|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
你的软盘没有分区表吗?那你上面为什么提到 MBR?如果软盘上没有分区表,它的第一扇区不应叫做 MBR,而是叫做 DBR。
至于说什么软件需要 int13 的全部功能,我也没有研究过,在你的这个 bios 上究竟哪个功能实现得有问题,也不清楚,你自己可以研究一下 int13 规范,检察一下你的这个 BIOS 在哪一部分出现了错误。不过这个检查比较繁琐,一般来说需要用到汇编语言。
如果你的 BIOS 的 int13 没有毛病的话,你无法解释 grub 不能正常识别 (fd0) 这个问题。grub 识别磁盘号码,只与int 13 有关,与其它的都无关。grub 不可能在此处存在BUG(如果有的话,10年前就会被人发现和解决的,因为这里都太基本了,都是基本的 int13 调用,严格按照规范来的)。
Does your floppy disk not have a partition table? Then why did you mention MBR above? If there is no partition table on the floppy disk, its first sector should not be called MBR, but DBR.
As for which software needs the full functions of int13, I haven't studied it either. I don't know which function has a problem in your this BIOS. You can study the int13 specification by yourself and check which part of your this BIOS has an error. However, this check is relatively cumbersome. Generally speaking, assembly language is needed.
If there is no problem with the int13 of your BIOS, you can't explain the problem that grub can't recognize (fd0) normally. Grub identifies the disk number, which is only related to int 13, and has nothing to do with others. There can't be a BUG in grub here (if there is, it would have been discovered and solved by people 10 years ago, because this is all too basic, all are basic int13 calls, strictly in accordance with the specification).
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-14 00:00 |
|
|
waffle
中级用户
  
积分 230
发帖 37
注册 2003-5-24
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
只要进入OS后u盘就会被模拟成某一存储设备,比如在win2000下整个u盘看起来象是个硬盘,可以分区、格式化,在linux下会模拟成个SCSI设备sda,操作起来也和硬盘一样,在这两种OS中u盘的扇区0上的分区表会被系统识别。于是我在win2000下把u盘分一个区。现在由于我是用USB-ZIP模式启动,主板BIOS只会从扇区32(DBR)开始读,而不去理会扇区0(MBR)里的分区表!我曾经做了个dos启动盘,并把u盘的扇区0里的分区表都清零,此时在win2000下会认为这个u盘没有分区、格式化,但用它以USB-ZIP方式启动系统是成功的,盘里的数据还都能正常存取。也就是说主板BIOS把这个128M的u盘完全当个大容量软盘来操作了,而不会去理会u盘扇区0的分区表。我想不通的是:对一个普通的1.44m软盘来说,它根本没有分区表这个概念,如果map (fd0) (hd?),那hd?上面的分区表又从何而来呢?现在的情况是在grub提示符下root (+TAB,出来了fd0,应该说grub也把u盘当成了软盘,而dos启动盘启动最后也是出来a:,说明两者对u盘的识别是一致的(是否也说明int 13中对u盘的识别功能是正确的?如果grub没有正确识别出u盘,root (+TAB会出现fd0吗?能否设定让grldr把执行期间的信息都显示在屏幕上或保存在文件里?)。接下来就是对u盘上文件的存取,dos是正常的。而DBR中的GRUB引导代码能在u盘上找到grldr并加载,似乎也说明读写扇区的功能是正常的。另外我的BIOS是AWARD 6.0PG,很多主板用这个BIOS的,而且出来的时间也满长了,如果int 13出现问题的话应该也早就发现了。我觉得一个可能的地方是grldr对fd0的理解,如果当 grldr调用int 13发现u盘是fd0,它可能采用两种方法来定位FAT、根目录和数据区的位置,一种是比较通用的,从DBR的BPB中获得参数并计算,还有一种grldr认为fd0就是纯粹的软盘,FAT、根目录、数据区的位置是固定的,就直接在代码里按照固定的位置去找。另外请教不点DX,一般在DBR中的代码是如何去找它想要的文件的,比如grub引导代码是如何找到grldr,dos引导代码又是如何找到那3个启动文件的?
As long as you enter the OS, the USB flash drive will be simulated as a certain storage device. For example, under win2000, the entire USB flash drive looks like a hard disk, which can be partitioned and formatted. Under linux, it will be simulated as a SCSI device sda, and it is operated the same as a hard disk. In both of these OSes, the partition table on sector 0 of the USB flash drive will be recognized by the system. So I partitioned the USB flash drive into one partition under win2000. Now, because I am booting with the USB-ZIP mode, the motherboard BIOS will only read from sector 32 (DBR) and will not pay attention to the partition table in sector 0 (MBR)! I once made a DOS boot disk and cleared all the partition tables in sector 0 of the USB flash drive. At this time, under win2000, it will think that this USB flash drive has no partitions and is not formatted, but it is successfully booted into the system with the USB-ZIP method, and the data in the disk can still be accessed normally. That is to say, the motherboard BIOS treats this 128M USB flash drive completely as a large-capacity floppy disk and will not pay attention to the partition table in sector 0 of the USB flash drive. I can't figure out that for an ordinary 1.44m floppy disk, it has no concept of a partition table at all. If I map (fd0) (hd?), then where does the partition table on hd? come from? Now the situation is that under the grub prompt, root (+TAB, fd0 comes out, it should be said that grub also treats the USB flash drive as a floppy disk, and the DOS boot disk also finally comes out a:, which shows that the two have the same recognition of the USB flash drive (does it also show that the identification function of the USB flash drive in int 13 is correct? If grub does not correctly recognize the USB flash drive, will fd0 appear in root (+TAB? Can I set grldr to display all the information during execution on the screen or save it in a file?)? Next is the access to the files on the USB flash drive, DOS is normal. And the GRUB boot code in DBR can find grldr on the USB flash drive and load it, which also seems to show that the function of reading and writing sectors is normal. In addition, my BIOS is AWARD 6.0PG, many motherboards use this BIOS, and it has been around for a long time. If there is a problem with int 13, it should have been discovered long ago. I think a possible place is the understanding of fd0 by grldr. If grldr calls int 13 and finds that the USB flash drive is fd0, it may use two methods to locate the positions of FAT, root directory and data area. One is more general, obtaining parameters from the BPB of DBR and calculating, and the other is that grldr thinks fd0 is a pure floppy disk, and the positions of FAT, root directory and data area are fixed, and it directly finds according to the fixed positions in the code. In addition, I would like to ask BuDian DX, generally how the code in DBR finds the file it wants, for example, how the grub boot code finds grldr, and how the DOS boot code finds those 3 boot files?
|
|
2005-1-14 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
> 我想不通的是:对一个普通的1.44m软盘来说,它根本没有分区表这个概念,如果map (fd0) (hd?),那hd?上面的分区表又从何而来呢?
这个问题你已经提到多次了,我不一定能答复好,但尽最大努力吧:-)
软盘没有分区,硬盘有分区,这其实是一个历史遗留的问题。历史上,由于软盘小,所以,就弄成一个文件系统,以免 MBR占用多余的空间。(那时候,空间是很节约的,甚至FAT都只用12位的,也就是“一个半”的字节,可见空间是多么紧张了。)而硬盘由于容量大,就被分成不同的文件系统区域了,这叫做分区。分区究竟是微软创造的呢?还是在微软之前就有了标准,这个我不太清楚。但是有一点很明确,那就是,这已经形成了事实工业标准:软盘无分区,硬盘有分区,并且分区的格式是大家都了解的,完全没有秘密的。
另一方面,在逻辑上讲,软盘和硬盘都是 BIOS 的磁盘号码,都有统一的 BIOS 接口。BIOS并不了解硬盘上还有分区这个东西,它处理硬盘和软盘的方式是完全一样的,分区是由操作系统认定和解释的,BIOS不知道这些。因此,逻辑上,软盘确实可以有分区,关键是,只要操作系统能够承认它就行。
然而你的这个 BIOS 却跳过 U盘的第一扇区,直接用 DBR 来引导,这是违反从前的事实工业标准的。(我不知道是否还有另外的标准,允许 BIOS 从 DBR 引导,如果我说错了,请知道的人不吝赐教。)
不管怎么说,你的 BIOS 能够引导 U盘,也是一个优点。它试图在旧的标准和新的实际应用之间找到平衡。旧的标准是说,软盘不能有分区;新的应用是指,它又想把含有分区表的 U盘当作软盘来用。这是矛盾的。因此,它选择了跳过分区表,直接引导 DBR。是的,DBR 之后和软盘是一样的格式,都是DBR+FAT+ROOT_DIR+DATA_AREA。因此,它这种方法有它可行的一面。但问题是,有些东西它并没有完全照顾到,或者说没有考虑到,或者说是忽视了。在我的机器上,CDROM的软盘仿真就出现了类似的错误。CDROM也是用一个连续的扇区序列来仿真软盘的启动,这一点和你的 U盘完全相同。我的机器 也是 AWARD 的代码,估计写这个程序的人在 U 盘上也犯了同样的错误,那就是int13实现得不完整,残缺不全。我的机器上是 int13/ah=8 没有实现,导致 grub 认不出 cdrom 上的软盘。
> What I can't figure out is: For an ordinary 1.44m floppy disk, it doesn't have the concept of a partition table at all. If I do map (fd0) (hd?), then where does the partition table on hd? come from?
You've mentioned this question many times, and I may not be able to answer it well, but I'll do my best :-)
Floppy disks have no partitions, while hard disks have partitions. This is actually a historical legacy issue. Historically, because floppy disks were small, they were made into a single file system to avoid the MBR occupying excessive space. (At that time, space was very tight; even FAT only used 12 bits, that is, "one and a half" bytes, showing how tight space was.) Since hard disks have large capacities, they are divided into different file system areas, which are called partitions. Was the partition created by Microsoft? Or was there already a standard before Microsoft? I'm not sure. But one thing is clear: this has formed a de facto industrial standard: floppy disks have no partitions, hard disks have partitions, and the partition format is well-known and completely open.
On the other hand, logically, both floppy disks and hard disks are BIOS disk numbers and have a unified BIOS interface. The BIOS doesn't know about partitions on hard disks; it handles hard disks and floppy disks in exactly the same way. Partitions are recognized and interpreted by the operating system, and the BIOS is unaware of these. Therefore, logically, floppy disks can indeed have partitions; the key is that as long as the operating system can recognize them.
However, your BIOS skips the first sector of the USB flash drive and directly uses the DBR to boot, which violates the previous de facto industrial standard. (I don't know if there are other standards that allow the BIOS to boot from the DBR. If I'm wrong, please let those who know correct me.)
Anyway, it's a plus that your BIOS can boot from the USB flash drive. It's trying to find a balance between the old standard and new practical applications. The old standard says that floppy disks can't have partitions; the new application is that it wants to treat a USB flash drive with a partition table as a floppy disk. This is a contradiction. Therefore, it chooses to skip the partition table and directly boot from the DBR. Yes, after the DBR, it's in the same format as a floppy disk, which is DBR + FAT + ROOT_DIR + DATA_AREA. Therefore, this method has its viable aspects. But the problem is that some things haven't been fully taken into account, or say, not considered, or neglected. On my machine, there was a similar error with CDROM floppy disk emulation. CDROM also uses a continuous sequence of sectors to emulate floppy disk booting, which is exactly the same as your USB flash drive. My machine also has AWARD code, and I estimate that the person who wrote this program also made the same mistake with the USB flash drive, that is, the int13 implementation is incomplete and flawed. On my machine, int13/ah=8 wasn't implemented, causing grub to not recognize the floppy disk on the CDROM.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-14 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
grub 能 root (+TAB 出 fd0,并不表明 fd0 已经完全无问题。它能看到 fd0盘符,这是肯定的了(比如测试int13/ah=0的返回结果),但是,当 GRUB 进一步试图去确定 fd0的磁道数/扇区数/面数/总扇区数等等这些规格参数(int13/ah=8以及ah=15h)的时候,失败了。这样,GRUB就拒绝承认该磁盘上的数据。也就是说,这个盘存在,但不可用,恰如你的软驱存在,但里面没有软盘,或者软盘彻底坏掉了那样。
至于说 DBR 的代码能够找到 IO.SYS 以及GRLDR,那是因为这些程序可能没有用到那些调用(例如int13/ah=8以及15h)。然而 GRUB在接管控制之后却需要这些调用,确保磁盘的各项规格数据都是准确的,这样做是必须的,也是安全的,它对于不合乎规范的磁盘不给予承认,这样,你就不至于毁坏该磁盘设备上的扇区,不管是有意还是无意的。注意 GRUB 的 setup命令会写入磁盘,这对于那些没有确切规格的磁盘(或者规格数据不完整的磁盘)来说,将是灾难性的。因此 GRUB 对 BIOS的严格要求是合理的,不能满足 GRUB 的要求,那是 BIOS 的 BUG,这毫无疑问。(以上说的这些都是 GNU GRUB 的功能,不是GRLDR 特有的。)
就你的这个问题而言,如果和我上述猜想是一致的话,那还是有办法解救的。你可以试试 以下这些命令之一:
map (fd0)+262144 (fd0)
map (fd0)+262144 (fd1)
map (fd0)+262144 (hd2)
然后用 map --hook ,之后再看看U盘文件系统是否正常了(分别是:fd0,fd1,hd2)。
上面的 262144 其实表示 128M 的意思,你觉得太大了,可以减小一些,因为如果太大了,读尾部的扇区时要出错。你应当填入你的 fd0 的总扇区数,也就是从 BPB 表所确定的总扇区数。
不出意外的话,应当成功。
GRUB can root (+TAB to bring up fd0, which doesn't mean fd0 is completely problem-free. It can see the fd0 drive letter, which is certain (such as testing the return result of int13/ah=0). However, when GRUB further tries to determine specifications like the number of tracks/sectors/heads/total sectors of fd0 (int13/ah=8 and ah=15h), it fails. In this way, GRUB refuses to recognize the data on that disk. That is to say, this disk exists but is not usable, just like your floppy drive exists but there is no floppy disk inside or the floppy disk is completely broken.
As for the fact that the code of DBR can find IO.SYS and GRLDR, it is because these programs may not use those calls (such as int13/ah=8 and 15h). However, after GRUB takes over control, it needs these calls to ensure that the various specification data of the disk are accurate. This is necessary and safe. It does not recognize non-compliant disks, so you will not damage the sectors on that disk device, whether intentionally or unintentionally. Note that the setup command of GRUB will write to the disk, which will be disastrous for disks without exact specifications (or with incomplete specification data). Therefore, the strict requirements of GRUB for BIOS are reasonable. If GRUB's requirements are not met, it is definitely a bug of BIOS. (The above things are all the functions of GNU GRUB, not unique to GRLDR.)
As for your problem, if it is consistent with my above guess, there is still a way to rescue. You can try one of the following commands:
map (fd0)+262144 (fd0)
map (fd0)+262144 (fd1)
map (fd0)+262144 (hd2)
Then use map --hook, and then see if the USB drive file system is normal (respectively: fd0, fd1, hd2).
The above 262144 actually means 128M. You think it is too large, you can reduce it a little, because if it is too large, errors will occur when reading the tail sectors. You should fill in the total number of sectors of your fd0, that is, the total number of sectors determined by the BPB table.
If there are no accidents, it should be successful.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-14 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
又仔细考虑了一下,觉得你可以试试以下简单的办法:
map (fd0)+1 (fd0)
map --hook
如此就可以访问你的 (fd0) 中的文件了。万一不行,你再试试下面这个:
map (fd0)+1 (fd1)
map --hook
这样你应当可以访问 (fd1) 中的文件了。
After careful consideration again, I think you can try the following simple method:
map (fd0)+1 (fd0)
map --hook
In this way, you can access the files in your (fd0). In case it doesn't work, you can try the following one more:
map (fd0)+1 (fd1)
map --hook
In this way, you should be able to access the files in (fd1).
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-15 00:00 |
|
|
waffle
中级用户
  
积分 230
发帖 37
注册 2003-5-24
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
map (fd0)+262144 (hd2)
系统不认这个参数,help map也没看到有这样的参数。“stage1 encodes the location of Stage 2 (or Stage 1.5) in a block list format”这句话是什么意思?
map (fd0)+262144 (hd2)
The system doesn't recognize this parameter, and there's no such parameter seen in help map. What does the sentence "stage1 encodes the location of Stage 2 (or Stage 1.5) in a block list format" mean?
|
|
2005-1-15 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
你没有贴出出错信息。
(fd0)+1 以及 (fd0)+262144 都是表示一个文件(A_FILE)。我说过,用 262144 是不合适的,你需要用一个合适的值。如果你懒得计算的话,试试用 1 应当也可以,幸运的话。
map A_FILE (fd0)
这种用法并不特殊,这没有任何参数。在 map 和 A_FILE 之间,以及 A_FILE 和 (fd0) 之间,各有一个空格。如果你的 GRLDR 版本不太旧,应当完全支持这个用法。你也可以自己找一个最新的拷贝到软盘根目录,没问题的。
注意 (fd0)+1 表示一个文件,它中间不可以插入空格或者别的字符。中间的加号是有的,不能把 + 号漏掉。
You didn't post the error message.
(fd0)+1 and (fd0)+262144 both represent a file (A_FILE). I said that using 262144 is inappropriate, you need to use a suitable value. If you are too lazy to calculate, try using 1, and you might be lucky.
map A_FILE (fd0)
This usage is not special, there are no parameters here. There is a space between map and A_FILE, and also between A_FILE and (fd0). If your GRLDR version is not too old, this usage should be fully supported. You can also find the latest copy and put it in the root directory of the floppy disk, no problem.
Note that (fd0)+1 represents a file, and no spaces or other characters can be inserted in between. The plus sign in the middle is there, and the + sign cannot be omitted.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-15 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
GRLDR 完全不采用 stage1 以及 stage1.5, 也不采用 stage2 文件。所以,不必理会那句话的意思。
那句话是
说,stage1 这个启动扇区中含有 定位 stage1.5 或者 stage2 文件的信息。信息用“块列表”的格式在stage1
的扇区中存放。所谓的“块列表”,就是指扇区位置列表。所以,一旦 stage1.5 或者
stage2的物理扇区位置发生了变化,比如说经过了磁盘碎块整理之后,那么 stage2 将无法被引导,导致系统在引导时死机。
GRLDR
不存在这个问题,完全脱离了那些复杂的 stage 's ,直接用微软的方式寻找 GRLDR
文件,这是万无一失的。我们知道微软的引导扇区代码查找 IO.SYS 就是这样的,不管怎么整理碎块,只要 IO.SYS
这个文件存在,总能引导成功,从来不会失败的。
GRLDR does not use stage1 and stage1.5 at all, nor does it use stage2 files. So, there's no need to pay attention to the meaning of that sentence.
That sentence says that the stage1 boot sector contains information to locate the stage1.5 or stage2 file. The information is stored in the stage1 sector in the format of "block list". The so-called "block list" refers to the list of sector positions. So, once the physical sector positions of stage1.5 or stage2 change, for example, after disk defragmentation, then stage2 cannot be booted, resulting in the system freezing during boot.
GRLDR has no such problem, completely getting rid of those complicated stages, and directly using Microsoft's way to find the GRLDR file, which is foolproof. We know that the Microsoft boot sector code finds IO.SYS in this way. No matter how fragmented it is, as long as the IO.SYS file exists, it can always be booted successfully and never fails.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-15 00:00 |
|
|
waffle
中级用户
  
积分 230
发帖 37
注册 2003-5-24
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
试了一下,map (fd0)+1 (hd2)显示:FAT16 BPB found with starting 0xEB(jmp) confirmationProbed C/H/S=117/64/32,probed total sectors=240943(这个和BPB里的信息一致)然后map --hook但是root (hd2)的时候死机(fd0)+1这里的+1和chainloader里的+1是一样的意思,表示fd0的第一个扇区吗?如果改成+240943会报Attempt to access black out side partitionhd2换fd1也是一样死机。还发现个问题,刚启动到grub提示符下的时候,root,显示fd0是ntfs,而不象前几天那样显示fat,于是我root (+回车,这时候又显示fd0是fat了。
Tried it, and the display for map (fd0)+1 (hd2) is: FAT16 BPB found with starting 0xEB(jmp) confirmation. Probed C/H/S=117/64/32, probed total sectors=240943 (this is consistent with the information in BPB). Then map --hook but when root (hd2), it freezes. The +1 in (fd0)+1 is the same meaning as +1 in chainloader, indicating the first sector of fd0? If changed to +240943, it will report Attempt to access black out side partition. Changing hd2 to fd1 also freezes. Also found a problem: just when booting to the grub prompt, root shows fd0 is ntfs, but unlike a few days ago when it showed fat, then root (+ enter), at this time it shows fd0 is fat again.
|
|
2005-1-15 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
有两个问题你没有说清楚:
1. 用 map (fd0)+1 (fd0) 以及 map --hook 之后,你是否可以访问 (fd0) 中的文件了。这很重要,如果失败了,再说其它的就没有意义了,我们估计没有很好的办法了。
2. 你的 BPB 显然有矛盾,我计算了一下, 117 × 64 × 32 = 239616,这才是总扇区数,而你的 BPB 中竟然有 240943 这个数,显然是不对的。
要么你修改 BPB 中的 240943 为 239616,要么你用:
map (fd0)+239616 (fd0)
map --hook
差不多可以肯定,这样应当成功了。
=============
另外,用 (hd2) 是错误的,因为你的 (fd0) 含有分区表,也就是说,你的 (fd0) 的第一扇区是 DBR,不是 MBR。你的 U盘最开头的 32 个扇区是不可访问的,BIOS 已经阻止了你的访问权。
你也不可以用 (fd1),因为根据上面所说的事实工业标准,可以用做启动盘的,只有 (fd0) 和 (hd0),其它的诸如 (fd1) (hd1) (hd2) 等等这些,都不可以作为启动盘。
===============
你的 (fd0) 是 fat16 格式的,正如 map 命令的探测报告所说的那样,肯定不是 NTFS 的。
===================
map (fd0)+1 (fd0)
此处的 (fd0)+1 不是指 (fd0) 的第一扇区,而是指 (fd0) 上的全部扇区,也就是 (fd0)+240943
因此,当你把 240943 纠正为正确的 239616 之后,你就可以用简单的 (fd0)+1 来处理这一情况了。
(fd0)+1 代表 (fd0) 上的全部扇区,这一点是特殊的,只在 map 的磁盘仿真命令中有效,在 GNU GRUB 的其它场合无效,也就是说,这是 GRUB for DOS 对此所做的特殊解释。
在 map 命令行之外的场合,(fd0)+1 仍然只表示 (fd0) 上的第一扇区。
There are two issues you haven't made clear:
1. After using map (fd0)+1 (fd0) and map --hook, can you access the files in (fd0)? This is very important. If it fails, talking about other things is meaningless, and we estimate there won't be a good way.
2. Your BPB is obviously contradictory. I calculated that 117 × 64 × 32 = 239616, which is the total number of sectors, but your BPB has 240943, which is obviously incorrect.
Either modify 240943 in the BPB to 239616, or you use:
map (fd0)+239616 (fd0)
map --hook
It can almost be certain that this should succeed.
=============
In addition, using (hd2) is wrong because your (fd0) contains a partition table, that is, the first sector of your (fd0) is DBR, not MBR. The first 32 sectors at the very beginning of your USB flash drive are not accessible, and the BIOS has blocked your access rights.
You can't use (fd1) either. Because according to the above-mentioned industrial standards, only (fd0) and (hd0) can be used as bootable disks. Other ones such as (fd1) (hd1) (hd2) and so on cannot be used as bootable disks.
===============
Your (fd0) is in fat16 format, as the probe report of the map command says, it is definitely not NTFS.
===================
map (fd0)+1 (fd0)
Here (fd0)+1 does not refer to the first sector of (fd0), but refers to all sectors on (fd0), that is, (fd0)+240943
Therefore, after you correct 240943 to the correct 239616, you can use the simple (fd0)+1 to handle this situation.
(fd0)+1 represents all sectors on (fd0), this is special, only valid in the disk emulation command of map, invalid in other occasions of GNU GRUB, that is, this is a special interpretation made by GRUB for DOS.
In occasions other than the map command line, (fd0)+1 still only represents the first sector of (fd0).
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-15 00:00 |
|
|
waffle
中级用户
  
积分 230
发帖 37
注册 2003-5-24
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
把BPB中的扇区数改了又试了下map (fd0)+X (fd?)。当X=1,map命令显示FAT16 BPB found with starting 0xEB(jmp) confirmation,Probed C/H/S=117/64/32,probed total sectors=239616,然后map --hook,但接着root成fd?必定死机。当1<X<=2880能使命令成功,成功显示Auto detect number-of-heads failed,Use default value 2.Auto detect sectors-per-track failed,Use default value 18.然后root成fd?,还是死机。当X>2880,显示error 15,Attempt to access block outside partition.
Changed the number of sectors in the BPB and tried map (fd0)+X (fd?). When X=1, the map command shows FAT16 BPB found with starting 0xEB(jmp) confirmation, Probed C/H/S=117/64/32, probed total sectors=239616, then map --hook, but then root to fd? will definitely crash. When 1<X<=2880, the command can succeed, successfully showing Auto detect number-of-heads failed, Use default value 2. Auto detect sectors-per-track failed, Use default value 18. Then root to fd? still crashes. When X>2880, shows error 15, Attempt to access block outside partition.
|
|
2005-1-15 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
从 X > 2880 出错可见,你的 BIOS 可能仅仅支持 1.44M 的启动软盘罢了。超过 1.44M 去读取的话,它就可能死机。
你这里出现了很多的“死机”,动不动就死了。死机的原因,不在 GRUB,而在于 BIOS。这类操作,GRUB 都是利用 int13 调用,最终调用的是 ROM 里的 BIOS 程序。正是 ROM BIOS 编制得粗糙,才造成动不动就死机。
你把 BPB 改成 1.44M 的软盘映象(当然需要重新格式化它),再试试这个操作方法,看看能否躲过 BIOS 的 BUG。
我估计这可能是你的主板 BIOS 的限制,可能人家要求是 1.44M 的,你可能忘了看看主板的说明书。
From the error of X > 2880, it can be seen that your BIOS may only support a boot floppy disk of 1.44M. If you read beyond 1.44M, it may crash.
There are many "crashes" here, crashing at every turn. The cause of the crash is not in GRUB, but in the BIOS. For such operations, GRUB all uses int13 calls and finally calls the BIOS program in the ROM. It is because the ROM BIOS is roughly programmed that it crashes at every turn.
You change the BPB to a 1.44M floppy disk image (of course, it needs to be reformatted), and then try this operation method to see if you can avoid the BIOS bug.
I estimate that this may be a limitation of your motherboard BIOS. Maybe it requires 1.44M, and you may have forgotten to check the motherboard manual.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-15 00:00 |
|
|
waffle
中级用户
  
积分 230
发帖 37
注册 2003-5-24
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
感觉BIOS对启动盘应该没有1.44M的限制,我给u盘格式化后,先拷进去一些数据,然后把dos系统文件拷进去,确信那3个启动文件都在1.44M以外。去启动系统,一切正常,随便新建个文件也是在1.44M以后的扇区。前面说到的map (fd0)+2880 (fd0)的时候Auto detect number-of-heads failed,Use default value 2,那么grub是如何实现自动检测磁头数和每磁道扇区数的呢?另外grub是如何知道某个设备是HD还是FD?是调用BIOS中断?在DBR引导代码中,要找grldr,这个引导代码需要知道这个设备是HD还是FD吗?
I feel that the BIOS should not have a 1.44M limit for the boot disk. After I formatted the USB flash drive, I first copied some data into it, then copied the DOS system files in, and made sure that the three boot files were outside the 1.44M. When booting the system, everything was normal, and any newly created file was also in the sectors after 1.44M. The previous time when I used map (fd0)+2880 (fd0), it said "Auto detect number-of-heads failed, Use default value 2". Then how does GRUB automatically detect the number of heads and the number of sectors per track? Also, how does GRUB know whether a device is HD or FD? Does it call BIOS interrupts? In the DBR boot code, to find grldr, does this boot code need to know whether this device is HD or FD?
|
|
2005-1-15 00:00 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 29 楼』:
使用 LLM 解释/回答一下
GRUB for DOS 的 map 命令从 BPB 或者 MBR 中探测 C/H/S 的值。根据你指定的,fd 就是软盘,hd 就是硬盘,这不是 GRUB 主观判断的,而是用户指定的。
GRLDR在DBR中的代码,无需知道是软盘还是硬盘,不过,是软盘就得是 (fd0),是硬盘就得是 (hd0)。违反了这两个,我不能肯定一定会失败,但有可能失败。
DBR 中的 GRLDR 引导代码无需知道是从 FD 还是 HD 引导的。但是,BIOS 会把引导时的磁盘号码放在 DL 寄存器中,因此,GRLDR 也知道它究竟是经由 FD 还是 HD 引导的。
GRUB 这里没有 BUG,有 BUG 的是 BIOS。我觉得你不妨用 1.44M 的软盘实验一下,就用 win98 的启动软盘再加上 grub.exe 就可以了,一点也不麻烦。如果这时还有毛病的话,那我们也能够判定究竟是谁的错。
The map command of GRUB for DOS detects the C/H/S values from the BPB or MBR. As you specify, fd is for floppy disk and hd is for hard disk. This is not subjectively judged by GRUB but specified by the user.
The code of GRLDR in the DBR doesn't need to know whether it's a floppy disk or a hard disk. However, if it's a floppy disk, it must be (fd0), and if it's a hard disk, it must be (hd0). Violating these, I can't be sure it will definitely fail, but it may fail.
The GRLDR boot code in the DBR doesn't need to know whether it's booted from FD or HD. But the BIOS places the disk number during booting in the DL register, so GRLDR also knows whether it's booted via FD or HD.
There is no bug in GRUB here. The one with the bug is the BIOS. I think you might as well experiment with a 1.44M floppy disk. Just use the Win98 boot floppy disk plus grub.exe, which is not troublesome at all. If there is still a problem at this time, then we can also determine whose fault it is.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2005-1-15 00:00 |
|
|
pierrexqw
初级用户
 
积分 121
发帖 10
注册 2004-11-19
状态 离线
|
『第 30 楼』:
使用 LLM 解释/回答一下
发现一个问题。我用的是Gandalf的中文版,但是我想问题应该出在这边。
本来我是使用grldr,利用XP自带的引导器引导grub。现在我想把grub装到mbr上,于是在grub命令行中输入
root (hd0,0)
setup (hd0)
这时会提示grub正在安装,实际上grub也安装到mbr了。但是装的是gnu的grub,不是经过改进的grub for dos。这一点从标头文字以及不支持中文字体就可以很明显的看出来。
是我缺少了什么参数,还是这算一个Bug?
I found a problem. I'm using the Chinese version of Gandalf, but I think the problem should be here.
Originally I was using grldr to boot grub using the XP built-in bootloader. Now I want to install grub to the mbr, so I enter in the grub command line
root (hd0,0)
setup (hd0)
At this time, it will prompt that grub is being installed, and actually grub is also installed to the mbr. But what is installed is GNU's grub, not the improved grub for dos. This is very obvious from the header text and the fact that Chinese fonts are not supported.
Is it that I am missing some parameters, or is this a bug?
|
|
2005-1-16 00:00 |
|
|