|
关于硬盘MBR 和DPT
这个程序本身是有点问题的. 问题虽然很小 原因就是 数据寄存器是 16位 的 而不是 8位的 所以 本来 512 扇区的硬盘 读取 分为 256次 但是 因为 8位读取 读取了 512 次 所以 后面的256 给予 FF的无效数据标识符 |
|
|
|
win7 系统挂了。
哦不好意思。 |
|
|
|
win7 系统挂了。
DPT= disk partition table. 具体资料可以去百度。 事实上我修改了分区一样可以进入win7. 我们可以做个试验。。 在winPE 下将分区修改。 然后进入win7 bootmgr(假设win7在关机时 自动读取DPT 然后将数据状态写入BCD 文件中) 。因为在PE 所以BCD 并没有更新到最新分区信息。 我拿我的机子做个实验吧。。到时候给你说结果行么? |
|
win7 系统挂了。
DPT 不是有记录了么? |
|
win7 系统挂了。
结贴。 我犯了一个小失误。 本来是想用WINRE 来恢复的。 结果来了一个热心的同事(虽然他不怎么懂) 但是我突然发现 原本的D 盘居然变成了c 盘(但是误导我的原因是 D 盘也有个BOOTMGR)。 我记得在分区表里不是(驱动器号-DriverNO)都是确定的么?(A-Z) 什么的。 为什么在win7 下原本的c 结果变成了 d??? 我准备继续去研究BCD 。 |
|
关于硬盘MBR 和DPT
嗯 我试试 |
|
关于硬盘MBR 和DPT
我这是用的PIO 方式 没用dos 提供的中断函数(函数有可能是用的DMA 方式) 但是效果是一样的 |
|
关于硬盘MBR 和DPT
[ include display.asm code segment assume cs:code buffer equ (1f0H) error_info equ (1f1H); sector_c equ(1f2H) sector equ (1F3H) cylinder_L equ (1F4H) cylinder_H equ (1f5H) header equ (1f6H) status_ctrl equ (1f7H) start : mov dx,sector mov al,1H //第一扇区 out dx,al ;setting the number of sector mov dx,cylinder_l mov al,0H //第0柱面(磁道)低位 out dx,al ;setting the number of low cylinder mov dx,cylinder_h mov al,0H //第0柱面(磁道)高位 out dx,al ;setting the number of high cylinder mov dx,header mov al,10100000b //第 0磁头 低4位 为磁头号 out dx,al ;setting the number of header mov dx,sector_c mov al,01h //指定读取扇区数 out dx,al ;setting the count of sector mov dx,status_ctrl mov al,20H; //发送读指令 out dx,al wait_read: mov dx,status_ctrl in al,dx test al,00001000b ;if 3 bit of the status equals 0 ,so read action not over jz wait_read ; mov ax,2000H mov es,ax mov di,0H mov cx,512D mov dx,buffer operation: in al,dx mov es:[di],al inc di ;将 512 位数据读入 地址 2000:0 loop operation mov ax,cs mov ds,ax mov dx,offset filepath mov ah,3Dh mov al,1h ;用21H 中断将文件地址引入dos 内部文件操作库 int 21h mov bx,ax push bx mov ax,2000H mov ds,ax ;将 2000:0 的代码写入MBR.dat文件 mov dx,0H mov cx,512D mov ah,40H int 21H mov dl,ah call far ptr binaryShow mov dl,al call far ptr binaryShow ; pop bx mov ah,4eH ;删除操作文件在dos 内部地址的映射 int 21H mov ah,4Ch int 21H filepath db 'c:\codes\test\hd\MBR.dat' ;文件路径 db 0H code ends end start 关于binaryShow 是自己写的一个显示 2进制的一个函数库 这里就不贴代码了。 |
|
关于硬盘MBR 和DPT
我发现可以修改 我修改了一下1楼也行了。 |
|
关于硬盘MBR 和DPT
可以吧 我让我朋友试过的 在下面 |
|
关于硬盘MBR 和DPT
我在最下面的补了图 请看看 这些资料其实我也有 。就是在对比的时候出现了问题。 |
|
|
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值