|
yaya
银牌会员
    
积分 1009
发帖 353
注册 2003-9-4
状态 离线
|
『楼 主』:
u盘引导扇区制作体会
使用 LLM 解释/回答一下
使用grubinst_gui安装grub4dos引导程序到u盘MBR(郎盛N100,格式化为HDD),在电脑1(厂商LENOVO 芯片组I945G/GZ 南桥82801GB(ICH7/R) bios版本 2TKT51AUS)上启动不成功。
用WinHex把grldr的63E-7FF复制到u盘启动扇区DBR的03E-1FF,在电脑1启动成功(u盘识别为A:),但是在把u盘识别为C:的电脑2上启动不成功。
查看引导代码:
7C00 EB3C JMP 7C3E
......
7C3E FA CLI
7C3F FC CLD
7C40 B6FF MOV DH,FF
7C42 80FEFF CMP DH,FF
7C45 7502 JNZ 7C49
7C47 B200 MOV DL,00
7C49 31C0 XOR AX,AX
7C4B BD007C MOV BP,7C00
7C4E 8ED0 MOV SS,AX
7C50 8D66E0 LEA SP,
7C53 FB STI
7C54 895624 MOV ,DX
7C57 60 PUSHA
7C58 B441 MOV AH,41
7C5A BBAA55 MOV BX,55AA
7C5D CD13 INT 13
......
分析代码,总是把00付给DL,把u盘当作ZIP格式,因此在把u盘识别为C:的电脑2上启动不成功。
修改代码:
7C54 8B5624 MOV DX,
修改后,在电脑1、2都启动成功。但是在u盘识别为A:的电脑1,提示找不到menu.lst,再修改grldr,把文件末尾菜单中的‘--ignore-floppies ’全删除。此时一切正常。
Last edited by yaya on 2008-9-11 at 09:30 AM ]
Install the grub4dos bootloader to the USB drive MBR (Langsheng N100, formatted as HDD) using grubinst_gui, but it fails to boot on Computer 1 (manufacturer LENOVO, chipset I945G/GZ, southbridge 82801GB(ICH7/R), BIOS version 2TKT51AUS).
Copy the 63E-7FF of grldr to the 03E-1FF of the USB drive boot sector DBR using WinHex, and it boots successfully on Computer 1 (the USB drive is recognized as A:), but fails to boot on Computer 2 where the USB drive is recognized as C:.
Examine the boot code:
7C00 EB3C JMP 7C3E
......
7C3E FA CLI
7C3F FC CLD
7C40 B6FF MOV DH,FF
7C42 80FEFF CMP DH,FF
7C45 7502 JNZ 7C49
7C47 B200 MOV DL,00
7C49 31C0 XOR AX,AX
7C4B BD007C MOV BP,7C00
7C4E 8ED0 MOV SS,AX
7C50 8D66E0 LEA SP,
7C53 FB STI
7C54 895624 MOV ,DX
7C57 60 PUSHA
7C58 B441 MOV AH,41
7C5A BBAA55 MOV BX,55AA
7C5D CD13 INT 13
......
Analyze the code: It always assigns 00 to DL and treats the USB drive as ZIP format, so it fails to boot on Computer 2 where the USB drive is recognized as C:.
Modify the code:
7C54 8B5624 MOV DX,
After modification, it boots successfully on both Computer 1 and 2. But on Computer 1 where the USB drive is recognized as A:, it prompts that menu.lst is not found. Then modify grldr, delete all '--ignore-floppies ' in the menu at the end of the file. At this point, everything is normal.
Last edited by yaya on 2008-9-11 at 09:30 AM ]
|
|
2008-7-11 13:31 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
你懂得汇编,当然难不住你,手术刀都用上了。不过你的办法只能在你的机器上用,不能保证在其他主板 BIOS 下顺利通过。
有些机器的 BIOS 并不能传递正确的 DL 值,那么你将遇到失败。而我们的代码强制 DL=0,则能够避免在软盘上失败。当用于硬盘的分区引导扇区时,DL=0 的操作是不会执行的。安装程序应该把 DH 和 DL 都设置成正确的值,你看 README 文件,就有说明。
你的 U 盘当作硬盘时,连分区表、MBR都不要了,这样做,其实属于走“非常规道路”。你走这条路,假若别人都不走,那么你指不定会在什么地方、什么机器上碰到障碍。还是“随大流”比较好,而“独辟蹊径”则可能潜伏着危机。
你应该把 U 盘搞成一个含有 MBR、分区表的 FAT 格式,然后用最新版的 bootlace 来安装,则这个 U盘同时具有两种规格:一种是裸露的 FAT 格式,直接可以当作软盘来用,一种是含有分区表的硬盘格式,可以直接当作硬盘来用。也就是说,U盘的格式变成双重的了,无论主板识别为软盘还是硬盘,都畅通无阻。
You understand assembly, so it's no problem for you, even using a scalpel. But your method can only work on your machine, and can't guarantee smooth passage under other motherboard BIOSes.
Some machines' BIOSes can't pass the correct DL value, then you'll encounter failure. And our code forces DL=0, which can avoid failure on floppy disks. When used for the partition boot sector of a hard disk, the operation of DL=0 won't be executed. The installer should set DH and DL to the correct values; you can see the README file for instructions.
When you use your USB flash drive as a hard disk, you even discard the partition table and MBR. Actually, this is taking a "non-conventional path". If you take this path while others don't, then you might run into obstacles somewhere and on some machine. It's better to "follow the crowd", while "going off the beaten track" may lurk with dangers.
You should make the USB flash drive into a FAT format containing MBR and partition table, then use the latest version of bootlace to install. Then this USB flash drive has two specifications: one is a bare FAT format, directly usable as a floppy disk; the other is a hard disk format containing partition table, directly usable as a hard disk. That is, the format of the USB flash drive becomes dual, and it can go smoothly whether the motherboard recognizes it as a floppy disk or a hard disk.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2008-7-11 16:36 |
|
|
yaya
银牌会员
    
积分 1009
发帖 353
注册 2003-9-4
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
我的U盘格式化为FAT16硬盘,有MBR、分区表。有些机器的 BIOS int13 不能传递正确的 DL 值已有所闻,但是在U盘引导扇区的 7C24 处含有物理驱动器号,格式为 ZIP 时是 00 00,格式为 HDD 时是 80 00.软盘是 00 00。u盘启动时分区应当是活动的,而且作为第一硬盘或软盘,所以把 00 或 80 传递给 DL 是正确的。
GRUB4DOS安装在MBR,可能有完善的判断和引导功能,但是安装在DBR,由于代码长度有限,可能功能有所降低,但是参考微软引导IO.SYS或引导NTLDR的代码,都是把7C24传递给DL,是比较保险和有效的。
之所以费了很大劲,不是想“独辟蹊径”,主要是用grubinst_gui安装grub4dos没有成功。也可能用 bootlace 来安装会成功的。
My USB flash drive is formatted as a FAT16 hard disk, with an MBR and partition table. It has been heard that some machines' BIOS int13 cannot pass the correct DL value. However, at offset 7C24 in the USB flash drive boot sector, there is a physical drive number. When formatted as ZIP, it is 00 00; when formatted as HDD, it is 80 00. For a floppy disk, it is 00 00. When the USB flash drive is booted, the partition should be active, and as the first hard disk or floppy disk, so passing 00 or 80 to DL is correct.
GRUB4DOS installed in the MBR may have perfect judgment and booting functions, but when installed in the DBR, due to the limited code length, the functions may be reduced. But referring to the code of Microsoft's boot IO.SYS or boot NTLDR, they all pass 7C24 to DL, which is relatively safe and effective.
The reason for going through a lot of trouble is not to "take a unique path," mainly because the grubinst_gui installation of grub4dos was not successful. It may also be that installing with bootlace will be successful.
|
|
2008-7-11 17:40 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
grub4dos 安装在 DBR 时,你说的偏移 24h 处的 磁盘号码,已经被忽略,参见 README 文件。我们假定传给引导扇区的 DL 总是正确的。我们可以保证这一点,只要 MBR 用的是 GRLDR 的引导代码。用其他 MBR 则不一定能保证这一点,但通常也是没问题的。而在软盘的情况,我们强制使用 DL=0,是因为发现有些 buggy 的机器对于软盘使用了错误的 DL 值。因为从软盘启动没有 MBR 代码,而是直接由 BIOS 调用,所以,我们无法保证 BIOS 一定赋予 DL=0,也就是在这样的背景下,我们强制从软盘启动时 DL=0,是用代码来实现的。我们的 DH 是代表分区号,这一点是你应该注意的。对于软盘而言,它的所谓“分区号”就确定为 0xFF。一个硬盘的分区号,当然也就不能是 0xFF 了。因此,如果你是安装到硬盘,你必须修改 0xFF 为适当的分区号。
我们不限定必须从 0x80 启动,如果把 DBR 引导扇区安装在 0x81,我们也能启动。如果像你说的那样,当你的 0x80 盘由于某种原因而作为 0x81 使用时,里面的 grldr 将无法启动了(你必须修改偏移 24h 处的 80h 为 81h 才行)。
When grub4dos is installed in the DBR, the disk number at offset 24h you mentioned has been ignored, refer to the README file. We assume that the DL passed to the boot sector is always correct. We can ensure this as long as the MBR uses the boot code of GRLDR. It may not be guaranteed with other MBRs, but usually it's okay. And in the case of a floppy disk, we force the use of DL=0 because some buggy machines are found to use incorrect DL values for floppy disks. Since there is no MBR code when booting from a floppy disk, but it's directly called by the BIOS, we can't guarantee that the BIOS will definitely assign DL=0. That is, in this context, we force DL=0 when booting from a floppy disk, which is implemented by code. Our DH represents the partition number, which is what you should pay attention to. For a floppy disk, its so-called "partition number" is determined as 0xFF. Of course, the partition number of a hard disk can't be 0xFF. Therefore, if you are installing to a hard disk, you must modify 0xFF to an appropriate partition number.
We don't limit that it must boot from 0x80. If the DBR boot sector is installed at 0x81, we can also boot. If as you said, when your 0x80 disk is used as 0x81 for some reason, the grldr inside will not be able to boot (you must modify 80h at offset 24h to 81h).
|

因为我们亲手创建,这个世界更加美丽。 |
|
2008-7-11 18:50 |
|
|
sunny
新手上路

积分 12
发帖 5
注册 2007-7-12
状态 离线
|
|
2008-7-11 21:36 |
|
|
loveheartrain
初级用户
  DOS之迷
积分 174
发帖 81
注册 2007-11-7
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
个人觉得 制作启动U盘最好是在支持USB启动的电脑下启动DOS系统 然后用DISKGEN对可移动磁盘 或读卡器加SD卡 进行分区格式化后 在XP系统下用DSPTW写入代码成功率很高我用的是1G的可移动磁盘 2G的SD卡.
代码如下
@echo off
color 0A
:mmbr
title 安装GRUB MBR!
set hd=
cls
echo 请选择要安装GRUB的硬盘编号。
echo 0 1 2 3 4 5
echo 输入数字后回车执行!
set /p hd="">nul
if not %hd%'==0' if not %hd%'==1' if not %hd%'==2' if not %hd%'==3' if not %hd%'==4' if not %hd%'==5' goto mmbr
if %hd%'==' goto mmbr
:mmbr1
set h=
ECHO 你选择的硬盘编号是%hd%!以下是该硬盘的分区情况!
dsptw %hd% /l /y
ECHO 开始安装GRUB MBR!
echo 请选择所要的操作。
echo 恢复输入Y 其它键退出
echo 输入后回车执行!
set /p h="">nul
if not %h%'==y' if not %h%'==Y' goto exit
if %h%'==' goto exit
ECHO 安装GRUBMBR前备份原来的MBR到文件mbry%hd%.bin!
dsptw %hd% 0 1 /s mbry%hd%.bin /y
ECHO 备份完成!
ECHO @
ECHO 正在将MBR备份到第2扇区 ...
dsptw %hd% 0 1 /D %hd% 1 /y
ECHO 备份到第2扇区完成!
ECHO @
ECHO 正在写入00h ...
dsptw %hd% 0 0 /m /hex:EB5E01026D32FFFF0000000000000000 /Y
if errorlevel 1 goto err
ECHO 写入00h完成!
ECHO @
ECHO 正在写入10h ...
dsptw %hd% 0 16 /m /hex:00000000000000000000000000000000 /Y
ECHO 写入10h完成!
ECHO @
ECHO 正在写入20h ...
dsptw %hd% 0 32 /m /hex:00000000000000000000000000000000 /Y
ECHO 写入20h完成!
ECHO @
ECHO 正在写入30h ...
dsptw %hd% 0 48 /m /hex:00000000000000000000000000000000 /Y
ECHO 写入30h完成!
ECHO @
ECHO 正在写入40h ...
dsptw %hd% 0 64 /m /hex:00000000000000000000000000000000 /Y
ECHO 写入40h完成!
ECHO @
ECHO 正在写入50h ...
dsptw %hd% 0 80 /m /hex:00000000000000000000000000000000 /Y
ECHO 写入50h完成!
ECHO @
ECHO 正在写入60h ...
dsptw %hd% 0 96 /m /hex:E800005B81EB6300C1EB048CC801C38E /Y
ECHO 写入60h完成!
ECHO @
ECHO 写入70h ...
dsptw %hd% 0 112 /m /hex:DB536A75CBF606020004740F31C08EC0 /Y
ECHO 写入70h完成!
ECHO @
ECHO 正在写入80h ...
dsptw %hd% 0 128 /m /hex:BFFC0566B84455434566AB68002017BC /Y
ECHO 写入80h完成!
ECHO @
ECHO 正在写入90h ...
dsptw %hd% 0 144 /m /hex:009031C951BA8000B408E8D800581607 /Y
ECHO 写入90h完成!
ECHO @
ECHO 正在写入a0h ...
dsptw %hd% 0 160 /m /hex:721580E13FF9740F91B40289C531DB41 /Y
ECHO 写入a0h完成!
ECHO @
ECHO 正在写入b0h ...
dsptw %hd% 0 176 /m /hex:E8C2007202F6DC0E1F9C31F631FFB9DF /Y
ECHO 写入b0h完成!
ECHO @
ECHO 正在写入c0h ...
dsptw %hd% 0 192 /m /hex:00FCF3A5BBFC2166B8475255AA663907 /Y
ECHO 写入c0h完成!
ECHO @
ECHO 正在写入d0h ...
dsptw %hd% 0 208 /m /hex:7503E8401BEADA000020161F66390774 /Y
ECHO 写入d0h完成!
ECHO @
ECHO 正在写入e0h ...
dsptw %hd% 0 224 /m /hex:336660A1180083F83F77223C11721E48 /Y
ECHO 写入e0h完成!
ECHO @
ECHO 正在写入f0h ...
dsptw %hd% 0 240 /m /hex:BF0300B40299BB0002B9020060E87500 /Y
ECHO 写入f0h完成!
ECHO @
ECHO 正在写入100h ...
dsptw %hd% 0 256 /m /hex:61730A6031C0E86C00614F75E6666166 /Y
ECHO 写入100h完成!
ECHO @
ECHO 正在写入110h
dsptw %hd% 0 272 /m /hex:390775599D72400E1FAD88E6AD89C124 /Y
ECHO 写入110h完成!
ECHO @
ECHO 正在写入120h ...
dsptw %hd% 0 288 /m /hex:3F742129E848F6D8BF0300B40268000D /Y
ECHO 写入120h完成!
ECHO @
ECHO 写入130h ...
dsptw %hd% 0 304 /m /hex:0731DB60E83E0061730B6031C0E83500 /Y
ECHO 写入130h完成!
ECHO @
ECHO 正在写入140h ...
dsptw %hd% 0 320 /m /hex:614F75E7F9E830110F87E21A83C60C81 /Y
ECHO 写入140h完成!
ECHO @
ECHO 正在写入150h ...
dsptw %hd% 0 336 /m /hex:FEFE0172C27716BEB231B4089952E814 /Y
ECHO 写入150h完成!
ECHO @
ECHO 写入160h ...
dsptw %hd% 0 352 /m /hex:005872099991243F740341EBBBBEA001 /Y
ECHO 写入160h完成!
ECHO @
ECHO 正在写入170h ...
dsptw %hd% 0 368 /m /hex:E82600EBFE1E0652565755F9CD135D5F /Y
ECHO 写入170h完成!
ECHO @
ECHO 正在写入180h ...
dsptw %hd% 0 384 /m /hex:5E5A071FC3FAB800208ED0BCDC8FFB66 /Y
ECHO 写入180h完成!
ECHO @
ECHO 正在写入190h ...
dsptw %hd% 0 400 /m /hex:61071FEBB7B40ECD102EAC3C0075F6C3 /Y
ECHO 写入190h完成!
ECHO @
ECHO 正在写入1a0h ...
dsptw %hd% 0 416 /m /hex:0D0A4D697373696E67204D42522D6865 /Y
ECHO 写入1a0h完成!
ECHO @
ECHO 正在写入1b0h ...
dsptw %hd% 0 432 /m /hex:6C7065722E0000000000000000008001 /Y
ECHO 写入1b0h完成!
ECHO @
ECHO 正在清除3到62扇区的数据 ...
dsptw %hd% 2 60 /e /y
ECHO 清除3到62扇区的数据完成!
ECHO @
echo GRUB MBR安装完成!
echo 以下是安装GRUB MBR后MBR内容
echo 按任意键继续!
pause >nul
ECHO 正在将GRUB MBR写到文件GRmbrx%hd%.bin ...
dsptw %hd% 0 1 /s GRmbrx%hd%.bin /y
ECHO 写入完成!
dsptw %hd% 0 1 /l /p /a
ECHO 正在安装GRUB MBR其它代码到3-17扇区
dsptw %hd% 2 15 /R axyqd.bin /Y
ECHO 安装其它代码完成!
goto exit
:err
echo 安装GRUB MBRMBR失败!
:exit
echo 按任意键退出!
echo Love Makes The World Go Ronud
echo 因为虚幻所以美丽
echo 因为虚幻所以永恒
echo 在你孤寂时&在你失意时
echo 在你无助时&在你烦乱时
echo 爱意之无尽@灵犀!将带给你永恒的快乐
echo Mtel:13050788308
echo QQ:71216716 E_mail:l.h.r.@163.com
pause >nul
Personally, I think the best way to make a bootable USB drive is to boot into a DOS system on a computer that supports USB booting, then use DISKGEN to partition and format the removable disk or the SD card via the card reader. Then, using DSPTW to write the code in the XP system has a high success rate. I'm using a 1G removable disk and a 2G SD card.
The code is as follows
@echo off
color 0A
:mmbr
title Install GRUB MBR!
set hd=
cls
echo Please select the hard disk number where you want to install GRUB.
echo 0 1 2 3 4 5
echo Enter the number and press Enter to execute!
set /p hd="">nul
if not %hd%'==0' if not %hd%'==1' if not %hd%'==2' if not %hd%'==3' if not %hd%'==4' if not %hd%'==5' goto mmbr
if %hd%'==' goto mmbr
:mmbr1
set h=
ECHO The hard disk number you selected is %hd%! The following is the partition situation of this hard disk!
dsptw %hd% /l /y
ECHO Starting to install GRUB MBR!
echo Please select the operation you want.
echo Restore, enter Y Other keys to exit
echo Enter and press Enter to execute!
set /p h="">nul
if not %h%'==y' if not %h%'==Y' goto exit
if %h%'==' goto exit
ECHO Backing up the original MBR to the file mbry%hd%.bin before installing GRUB MBR!
dsptw %hd% 0 1 /s mbry%hd%.bin /y
ECHO Backup completed!
ECHO @
ECHO Backing up to the second sector...
dsptw %hd% 0 1 /D %hd% 1 /y
ECHO Backup to the second sector completed!
ECHO @
ECHO Writing 00h...
dsptw %hd% 0 0 /m /hex:EB5E01026D32FFFF0000000000000000 /Y
if errorlevel 1 goto err
ECHO Writing 00h completed!
ECHO @
ECHO Writing 10h...
dsptw %hd% 0 16 /m /hex:00000000000000000000000000000000 /Y
ECHO Writing 10h completed!
ECHO @
ECHO Writing 20h...
dsptw %hd% 0 32 /m /hex:00000000000000000000000000000000 /Y
ECHO Writing 20h completed!
ECHO @
ECHO Writing 30h...
dsptw %hd% 0 48 /m /hex:00000000000000000000000000000000 /Y
ECHO Writing 30h completed!
ECHO @
ECHO Writing 40h...
dsptw %hd% 0 64 /m /hex:00000000000000000000000000000000 /Y
ECHO Writing 40h completed!
ECHO @
ECHO Writing 50h...
dsptw %hd% 0 80 /m /hex:00000000000000000000000000000000 /Y
ECHO Writing 50h completed!
ECHO @
ECHO Writing 60h...
dsptw %hd% 0 96 /m /hex:E800005B81EB6300C1EB048CC801C38E /Y
ECHO Writing 60h completed!
ECHO @
ECHO Writing 70h...
dsptw %hd% 0 112 /m /hex:DB536A75CBF606020004740F31C08EC0 /Y
ECHO Writing 70h completed!
ECHO @
ECHO Writing 80h...
dsptw %hd% 0 128 /m /hex:BFFC0566B84455434566AB68002017BC /Y
ECHO Writing 80h completed!
ECHO @
ECHO Writing 90h...
dsptw %hd% 0 144 /m /hex:009031C951BA8000B408E8D800581607 /Y
ECHO Writing 90h completed!
ECHO @
ECHO Writing a0h...
dsptw %hd% 0 160 /m /hex:721580E13FF9740F91B40289C531DB41 /Y
ECHO Writing a0h completed!
ECHO @
ECHO Writing b0h...
dsptw %hd% 0 176 /m /hex:E8C2007202F6DC0E1F9C31F631FFB9DF /Y
ECHO Writing b0h completed!
ECHO @
ECHO Writing c0h...
dsptw %hd% 0 192 /m /hex:00FCF3A5BBFC2166B8475255AA663907 /Y
ECHO Writing c0h completed!
ECHO @
ECHO Writing d0h...
dsptw %hd% 0 208 /m /hex:7503E8401BEADA000020161F66390774 /Y
ECHO Writing d0h completed!
ECHO @
ECHO Writing e0h...
dsptw %hd% 0 224 /m /hex:336660A1180083F83F77223C11721E48 /Y
ECHO Writing e0h completed!
ECHO @
ECHO Writing f0h...
dsptw %hd% 0 240 /m /hex:BF0300B40299BB0002B9020060E87500 /Y
ECHO Writing f0h completed!
ECHO @
ECHO Writing 100h...
dsptw %hd% 0 256 /m /hex:61730A6031C0E86C00614F75E6666166 /Y
ECHO Writing 100h completed!
ECHO @
ECHO Writing 110h
dsptw %hd% 0 272 /m /hex:390775599D72400E1FAD88E6AD89C124 /Y
ECHO Writing 110h completed!
ECHO @
ECHO Writing 120h...
dsptw %hd% 0 288 /m /hex:3F742129E848F6D8BF0300B40268000D /Y
ECHO Writing 120h completed!
ECHO @
ECHO Writing 130h...
dsptw %hd% 0 304 /m /hex:0731DB60E83E0061730B6031C0E83500 /Y
ECHO Writing 130h completed!
ECHO @
ECHO Writing 140h...
dsptw %hd% 0 320 /m /hex:614F75E7F9E830110F87E21A83C60C81 /Y
ECHO Writing 140h completed!
ECHO @
ECHO Writing 150h...
dsptw %hd% 0 336 /m /hex:FEFE0172C27716BEB231B4089952E814 /Y
ECHO Writing 150h completed!
ECHO @
ECHO Writing 160h...
dsptw %hd% 0 352 /m /hex:005872099991243F740341EBBBBEA001 /Y
ECHO Writing 160h completed!
ECHO @
ECHO Writing 170h...
dsptw %hd% 0 368 /m /hex:E82600EBFE1E0652565755F9CD135D5F /Y
ECHO Writing 170h completed!
ECHO @
ECHO Writing 180h...
dsptw %hd% 0 384 /m /hex:5E5A071FC3FAB800208ED0BCDC8FFB66 /Y
ECHO Writing 180h completed!
ECHO @
ECHO Writing 190h...
dsptw %hd% 0 400 /m /hex:61071FEBB7B40ECD102EAC3C0075F6C3 /Y
ECHO Writing 190h completed!
ECHO @
ECHO Writing 1a0h...
dsptw %hd% 0 416 /m /hex:0D0A4D697373696E67204D42522D6865 /Y
ECHO Writing 1a0h completed!
ECHO @
ECHO Writing 1b0h...
dsptw %hd% 0 432 /m /hex:6C7065722E0000000000000000008001 /Y
ECHO Writing 1b0h completed!
ECHO @
ECHO Clearing data from sectors 3 to 62...
dsptw %hd% 2 60 /e /y
ECHO Clearing data from sectors 3 to 62 completed!
ECHO @
echo GRUB MBR installation completed!
echo The following is the MBR content after installing GRUB MBR
echo Press any key to continue!
pause >nul
ECHO Writing GRUB MBR to the file GRmbrx%hd%.bin...
dsptw %hd% 0 1 /s GRmbrx%hd%.bin /y
ECHO Writing completed!
dsptw %hd% 0 1 /l /p /a
ECHO Installing other GRUB MBR codes to sectors 3-17
dsptw %hd% 2 15 /R axyqd.bin /Y
ECHO Other codes installed completed!
goto exit
:err
echo GRUB MBR installation failed!
:exit
echo Press any key to exit!
echo Love Makes The World Go Ronud
echo Because of the illusory, so beautiful
echo Because of the illusory, so eternal
echo When you are lonely & when you are down
echo When you are helpless & when you are upset
echo The endless love @ Lingxi! Will bring you eternal happiness
echo Mtel:13050788308
echo QQ:71216716 E_mail:l.h.r.@163.com
pause >nul
|

愛意之无尽@灵犀!
QQ:71216716 E_mail:l.h.r.@163.com |
|
2008-7-18 22:51 |
|
|
yaya
银牌会员
    
积分 1009
发帖 353
注册 2003-9-4
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
用bootlace在u盘安装grub4dos,由于u盘被分配盘符b,故命令为
bootlace --floppy --chs 0x01
安装后,用WinHex查看,磁道0没有写入代码,磁道1启动扇区写入了1扇区代码,也就是grldr的600-7FF的代码(BPB不同)。
在u盘识别为a的电脑上启动成功,在识别为c的电脑上启动不成功。
由于磁道0没有写入16扇区grldr引导代码,grldr的强大引导功能没有被体现。磁道1启动扇区引导代码存在的问题仍然存在,如1楼。
此时仍需要修改代码:
1. 7C54处代码89改为8B。
2. 7C1C处代码00改为3F(隐含扇区数),7C24处00改为80(磁盘的物理驱动器号)。
3. 修改grldr,把文件末尾菜单中的‘--ignore-floppies ’全删除。
修改后不论u盘被识别为a或c都能正常启动。
Last edited by yaya on 2008-9-11 at 10:03 AM ]
Install GRUB4DOS on a USB drive using bootlace. Since the USB drive is assigned the drive letter B, the command is:
bootlace --floppy --chs 0x01
After installation, when checked with WinHex, the code was not written to track 0, and the boot sector of track 1 had 1 sector of code written, which is the code from 600-7FF of grldr (with different BPB).
It started successfully on a computer where the USB drive was recognized as A, but did not start successfully on a computer where it was recognized as C.
Because track 0 did not have the 16-sector grldr boot code written, the powerful boot function of grldr was not reflected. The problem with the boot sector code of track 1 still existed, as in floor 1.
At this time, the code still needs to be modified:
1. Change the code at 7C54 from 89 to 8B.
2. Change the code at 7C1C from 00 to 3F (implicit number of sectors), and change the code at 7C24 from 00 to 80 (physical drive number of the disk).
3. Modify grldr, and delete all '--ignore-floppies ' in the menu at the end of the file.
After modification, it can start normally regardless of whether the USB drive is recognized as A or C.
Last edited by yaya on 2008-9-11 at 10:03 AM ]
|
|
2008-9-11 09:58 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
这点困难应该难不住你吧?你在识别U盘为硬盘的机器上操作,应该就好了。
This little difficulty shouldn't be a problem for you, right? You should be fine if you operate on a machine that recognizes the USB flash drive as a hard disk.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2008-9-11 16:30 |
|
|