⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 588.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
0000:068C 886604     MOV    [BP+04],AH    注意:如果扩展INT13h不能使用则A改分区类型为06,但如果<br>
                                          扩展INT13h能使用,则仍保持原分区类型不变<br>
0000:068F BF0A00     MOV    DI,000A       ;★★★其它类型分区由此开始处理。此条指令初始化计数器<br>
0000:0692 B80102     MOV    AX,0201       ;AH:读操作,AL:读取1个扇区的内容<br>
0000:0695 8BDC       MOV    BX,SP         ;SP=7C00→BX,指定分区引导记录装入内存的位置偏移<br>
0000:0697 33C9       XOR    CX,CX         ;CX清零<br>
0000:0699 83FF05     CMP    DI,+05        注意5 0000:069C 7F03       JG     06A1          大于则转去读由分区表指定的分区引导扇区<br>
0000:069E 8B4E25     MOV    CX,[BP+25]    小于则证明所读分区表指定的引导扇区无合法的引导记录,<br>
                                          改按???再读,毕竟多一种选择多一次机会嘛!;)<br>
; 以下标有①②者请注意它们的地址都是一样的,就是说实际运行中只可能是二者之一,但为了分析之方便,我<br>
; 把两者都列了出来以供对比,阅读时千万别看成是两条指令了啊!<br>
①0000:06A1 034E02     ADD    CX,[BP+02]    获取分区引导扇区所在的柱面号和物理扇区号<br>
②0000:06A1 EB1E       JMP    06C1          如果分区类型是0Ch、0Eh而且扩展读能使用则执行该指令<br>
;<br>
; 0000:06A4:将可引导分区的分区引导记录装入内存指定区域<br>
; 入口参数:AH=功能号,02为读盘操作;AL=一次读取的扇区数<br>
;          ES:BX=读入内存的起始地址<br>
;          CH=10位柱面号的低8位;CL:高两位是10位柱面号的高两位,低6位是物理扇区号<br>
;          DH=磁头号;DL=驱动器号,最高位(即位7)为0是软盘,为1是硬盘<br>
0000:06A4 CD13       INT    13            读分区引导记录到0000:7C00起始的区域<br>
;<br>
;<br>
0000:06A6 7229       JB     06D1          不成功转<br>
0000:06A8 BE2D07     MOV    SI,072D       ;错误信息字符串偏移→SI<br>
0000:06AB 813EFE7D55AA CMP    WORD PTR [7DFE],AA55 ;分区引导记录合法吗?<br>
0000:06B1 745A       JZ     070D          合法则转(这是主引导记录唯一的正常出口)<br>
<br>
0000:06B3 83EF05     SUB    DI,+05        不合法则为换读其他扇区做准备<br>
0000:06B6 7FDA       JG     0692          只有一次换读扇区的机会!<br>
;<br>
; 0000:06B8~0000:06BF:错误预处理<br>
0000:06B8 85F6       TEST   SI,SI         ;测试SI值是否为0,其意义在于确定该显示哪条信息<br>
0000:06BA 7583       JNZ    063F          不为0则转错误处理,显示“Missing operating system”<br>
0000:06BC BE1A07     MOV    SI,071A       ;错误信息字符串偏移→SI<br>
0000:06BF EB8A       JMP    064B          转错误处理,显示“加载操作系统时出错”<br>
;<br>
; 0000:06C1~0000:06CF:整理扩展读所需入口参数,然后调用扩展读子程序<br>
; 这段代码只有在以扩展读方式读取分区引导记录时才有机会获得执行<br>
0000:06C1 98         CBW                  转换字节AL为字AX,执行后,AX中是一次要读的扇区数<br>
0000:06C2 91         XCHG   CX,AX         ;AX→CX,CX→AX,执行后,CX中是一次要读的扇区数<br>
0000:06C3 52         PUSH   DX           <br>
0000:06C4 99         CWD                  将字AX转换为双字→DX,AX<br>
0000:06C5 034608     ADD    AX,[BP+08]   <br>
0000:06C8 13560A     ADC    DX,[BP+0A]    执行后,DX:AX=LBA绝对物理扇区号<br>
0000:06CB E81200     CALL   06E0          调用扩展读子程序<br>
0000:06CE 5A         POP    DX           <br>
0000:06CF EBD5       JMP    06A6         <br>
;<br>
; 0000:06D1~0000:06D8分区引导记录装入失败时的处理<br>
0000:06D1 4F         DEC    DI            计数器减1<br>
0000:06D2 74E4       JZ     06B8          五次读盘均未成功则转错误处理(注意这时SI=0)<br>
0000:06D4 33C0       XOR    AX,AX         ;置功能号<br>
0000:06D6 CD13       INT    13            复位磁盘系统<br>
0000:06D8 EBB8       JMP    0692          再读<br>
;<br>
;<br>
0000:06DA 00 00 80 49 12 00 ...I..<br>
;<br>
; 0000:06E0~0000:070C:使用扩展INT 13h功能读取分区引导记录的子程序<br>
; 调用时,SP=7BFE。这段程序利用压栈寄存器方式构造了一个磁盘地址包,请注意体会。另外,0000:06FC处<br>
; 的一条指令就释放了几乎全部由本段程序占用的栈空间,构思之巧妙,绝对需要我们学习!<br>
; 所以,分析该段程序,一个重点应放在栈的变化上。<br>
0000:06E0 56         PUSH   SI            保存SI——注意,这次压栈并不构造磁盘地址包<br>
0000:06E1 33F6       XOR    SI,SI         ;清零<br>
0000:06E3 56         PUSH   SI           <br>
0000:06E4 56         PUSH   SI           <br>
0000:06E5 52         PUSH   DX           <br>
0000:06E6 50         PUSH   AX            以上四条指令压栈的是扇区LBA号码*2<br>
0000:06E7 06         PUSH   ES            压栈内存目标缓冲区首址段址<br>
0000:06E8 53         PUSH   BX            压栈内存目标缓冲区首址偏移<br>
0000:06E9 51         PUSH   CX            压栈所读扇区数<br>
0000:06EA BE1000     MOV    SI,0010       ;注意SI的高8位对应着磁盘地址包的保留字节,必须为0<br>
0000:06ED 56         PUSH   SI            压栈磁盘地址包包长,执行完本条指令一个包已经构造完毕<br>
0000:06EE 8BF4       MOV    SI,SP         ;规定磁盘地址包偏移指针,这时SP=7BEA<br>
0000:06F0 50         PUSH   AX            保存AX<br>
0000:06F1 52         PUSH   DX            保存DX<br>
0000:06F2 B80042     MOV    AX,4200       ;置扩展读功能号<br>
0000:06F5 8A5624     MOV    DL,[BP+24]    取驱动器号,参照0000:0683<br>
; 入口参数:AH=功能号,02为读盘操作;DL=驱动器号<br>
;          DS:SI=16字节磁盘地址包——第0字节:包长度(固定为10h);第1字节:保留,必须为0;<br>
;          第2、3字节:所读扇区数;第4~5字节:内存目标缓冲区首址偏移;<br>
;          第6~7字节:内存目标缓冲区首址段址; 第8~15字节:扇区LBA号码<br>
; 出口参数:成功则AH=0;错误则AH=错误代码<br>
0000:06F8 CD13       INT    13            执行扩展读操作<br>
0000:06FA 5A         POP    DX           <br>
0000:06FB 58         POP    AX           <br>
0000:06FC 8D6410     LEA    SP,[SI+10]    7BEA+10h=7BFA→SP(注意是取偏移而不是取单元内容)<br>
0000:06FF 720A       JB     070B          扩展读不成功转<br>
0000:0701 40         INC    AX           <br>
0000:0702 7501       JNZ    0705         <br>
0000:0704 42         INC    DX            AX加1溢出时(比如0FFFFh+1)DX才加1<br>
0000:0705 80C702     ADD    BH,02         ;调整BX,使偏移量增加512字节(刚好一扇区)<br>
0000:0708 E2F7       LOOP   0701          0701~0708一段代码暂未明白其真实意图!<br>
0000:070A F8         CLC                 <br>
0000:070B 5E         POP    SI           <br>
0000:070C C3         RET                 <br>
;<br>
; 0000:070D:中继跳转<br>
0000:070D EB74       JMP    0783         <br>
;<br>
; 070F~0745是错误信息!果然是中文Windows98生成的主引导记录,所以我要特别<br>
; “感谢”微软这个傻B,真难为它竟然用中文表述前两个信息!可惜真需显示的时<br>
; 候鬼才能看懂是什么呢!!!我K!——耍弄我们耶!?<br>
; 070F~0718:“分区表无效”中文信息<br>
; 071A~072B:“加载操作系统时出错”中文信息<br>
; 072D~0744:“Missing operating system”英文信息<br>
0000:070F B7 .<br>
0000:0710 D6 C7 F8 B1 ED CE DE D0-A7 00 BC D3 D4 D8 B2 D9 ................<br>
0000:0720 D7 F7 CF B5 CD B3 CA B1-B3 F6 B4 ED 00 4D 69 73 .............Mis<br>
0000:0730 73 69 6E 67 20 6F 70 65-72 61 74 69 6E 67 20 73 sing operating s<br>
0000:0740 79 73 74 65 6D 00 00 00-00 00 00 00 00 00 00 00 system..........<br>
0000:0750 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................<br>
0000:0760 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................<br>
0000:0770 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................<br>
0000:0780 00 00 00 ...<br>
;<br>
; 0000:0783~0000:0789:控制权移交<br>
0000:0783 8BFC       MOV    DI,SP         ;<br>
0000:0785 1E         PUSH   DS           <br>
0000:0786 57         PUSH   DI            构造一个跳转地址<br>
0000:0787 8BF5       MOV    SI,BP         ;<br>
0000:0789 CB         RETF                 ;交控制权给分区引导记录(0000:7C00)<br>
;<br>
;<br>
0000:078A 00 00 00 00 00 00 ......<br>
0000:0790 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................<br>
0000:07A0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................<br>
;<br>
; 07B8~07BB四个字节的内容用于什么呢?(不同机器此四字节均不同)<br>
; 07BE~07FD为分区表,内含四个分区表项(每表项10h字节)<br>
0000:07B0 00 00 00 00 00 00 00 00-86 D8 00 00 00 00 80 01 ................<br>
0000:07C0 01 00 06 3F 3F FD 3F 00-00 00 41 A0 0F 00 00 00 ...??.?...A.....<br>
0000:07D0 01 FE 05 3F FF FE 80 A0-0F 00 C0 4F 2F 00 00 00 ...?.......O/...<br>
0000:07E0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................<br>
0000:07F0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 55 AA ..............U.<br>
<br>
<br>
<br>
*1:因为物理扇区号总是从1排列而起<br>
*2:由此可见,就是使用LBA扩展读的功能,主引导记录却限制了分区引导扇区必须在LBA绝对物理扇区<br>
     0FFFFFFFFh之前才有可能从该分区引导系统! 
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -