Sigh! Testing GRUB FOR DOS is a long-term, arduous, and complex task! Just to take good care of win98 takes a lot of time.
Below, take a look at part of my testing:
map --read-only (hd0) (hd0)
chainloader (hd0)+1
boot
The above command accesses the C: drive as read-only. 【For simplicity, from now on when we say C: drive we mean the first hard disk drive, not DOS's logical C: drive. Similarly, D: also means the second hard disk drive, not logical D: drive.】
I originally thought booting win98 this way would fail, but as a result, it actually succeeded! At the beginning of startup, two messages appeared:
write protect error writing drive C:
Abort, Retry, Fail ?
Pressing F can continue booting. After entering win98 this way, the C: drive is not write-protected and files can still be written. This was already expected. Since the C: drive does not use BIOS, the C: drive is no longer write-protected. What win98 performs on the C: drive is “protected-mode disk access”.
Look at this test again:
map --read-only --disable-chs-mode (hd0) (hd0)
chainloader (hd0)+1
boot
At this time, windows finally cannot start. After CHS is disabled, win98's startup program cannot find the C: drive. From this it can be seen that when win98 starts, it uses CHS mode to read the C: drive, not LBA mode.
Change it; this time use the D: drive, and look at this test:
map --read-only --disable-chs-mode (hd1) (hd1)
chainloader (hd0)+1
boot
This time it smoothly enters win98, and accessing the D: drive in win98 is normal. This is also expected, because what win98 performs on the D: drive is “protected-mode disk access”. So although DOS access to the D: drive may not work, it can be accessed under win98.
Look at this peculiar test again:
map (hd0) (hd1)
map (hd1) (hd0)
map (hd1,0)/dos.img (fd0)
chainloader (hd1)+1
boot
Swap the C: drive and D: drive. After entering win98, the A: drive cannot be accessed. This is because A: is still using BIOS, and in BIOS, A: is mapped to an area of (hd1). At this time, BIOS does not know that win98 has already swapped the hardware information of C drive and D drive; it still blindly goes to the original BIOS disk to look for its sectors, and of course cannot find them. At this time, if only reading the A: drive, it does not matter. However, if writing to the A: drive at this time, then it is extremely dangerous!!!! because it blindly writes to another wrong disk, and may destroy that entire disk. No matter how much is destroyed, even if only one sector is destroyed, it is wrong. We should also realize that if at this time only unimportant sectors are destroyed, then this is actually the worst, because we may not discover this is an error, and still think it is very normal!!
In short, win98's “protected-mode disk access” is a layer of disk access independent of BIOS. If not handled well, these two accesses will conflict and fight, and there is also a huge hidden danger. Therefore, all of us users must be careful, and because of this, our testing time will be dragged out very, very long. After all, safety first; better not to have this software than to have dangerous software.
因为我们亲手创建,这个世界更加美丽。