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

📄 1_3 boot sector - 《自己动手写操作系统》 -2.htm

📁 10分钟完成的操作系统 - 《自己动手写操作系统》 - 2
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<DIV class=col1>
<DIV class=lineBlue></DIV><!-- title -->
<DIV class=arcTitle>
<H1><A href="http://book.csdn.net/bookfiles/88">自己动手写操作系统 </A></H1>
<DIV style="FONT-SIZE: 15px; TEXT-ALIGN: center"><A 
href="http://book.csdn.net/bookfiles/88/100882494.shtml">1.3 Boot Sector 
</A></DIV>
<DIV style="FONT-SIZE: 15px; TEXT-ALIGN: center"><A class=url 
href="http://book.csdn.net/">http://book.csdn.net/</A> 2006-8-11 18:35:00 </DIV>
<DIV class=clear></DIV>
<DIV 
style="BORDER-RIGHT: #0b5f98 1px solid; BORDER-TOP: #0b5f98 1px solid; MARGIN: 0px auto; BORDER-LEFT: #0b5f98 1px solid; WIDTH: 700px; BORDER-BOTTOM: #0b5f98 1px solid">
<DIV 
style="PADDING-RIGHT: 1px; PADDING-LEFT: 1px; FLOAT: left; PADDING-BOTTOM: 1px; WIDTH: 16px; COLOR: white; PADDING-TOP: 1px; BACKGROUND-COLOR: #0b5f98">图书导读 
</DIV>
<DIV 
style="PADDING-LEFT: 2px; FLOAT: right; WIDTH: 670px; LINE-HEIGHT: 16pt; TEXT-ALIGN: left"><!--导读-->
<H1 id=divCurrentNode 
style="PADDING-LEFT: 2px; FONT-SIZE: 12px; WIDTH: 100%; COLOR: #b83507; TEXT-ALIGN: left">当前章节:<A 
href="http://book.csdn.net/bookfiles/88/100882494.shtml"><FONT color=red>1.3 
Boot Sector</FONT></A></H1>
<DIV id=divRelateNode style="PADDING-LEFT: 2px">
<DIV style="FLOAT: left; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882492.shtml">1.1 准备工作</A></DIV>
<DIV style="FLOAT: right; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882493.shtml">1.2 
10分钟完成的操作系统</A></DIV>
<DIV style="FLOAT: left; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882495.shtml">1.4 代码解释</A></DIV>
<DIV style="FLOAT: right; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882496.shtml">1.5 水面下的冰山</A></DIV>
<DIV style="FLOAT: left; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882497.shtml">1.6 回顾</A></DIV>
<DIV style="FLOAT: right; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882498.shtml">2.1 虚拟计算机(Virtual 
PC)</A></DIV></DIV></DIV></DIV>
<DIV class=clear></DIV></DIV><!-- main -->
<DIV id=main>
<DIV id=text>
<DIV id=csdn_zhaig_ad_yahoo_2></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt"><FONT 
size=2><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">你可能还没有从刚刚的兴奋中走出来,可是我不得不告诉你,实际上,你刚刚所完成的并不是一个完整的</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">OS</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,而仅仅是一个最最简单的引导扇区(</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">Boot Sector</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)。然而不管我们完成的是什么,至少,它是直接在裸机上运行的,不依赖于任何其他软件,所以,这和我们平时所编写的应用软件有本质的区别。它不是操作系统,但已经具备了操作系统的一个特性。</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt"><FONT 
size=2><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">我们知道,当计算机电源被打开时,它会先进行加电自检(</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">POST</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">),然后寻找启动盘,如果是选择从软盘启动,计算机就会检查软盘的</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">0</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">面</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">0</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">磁道</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">1</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">扇区,如果发现它以</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">0xAA55</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(假如我们把此扇区看做一个字符数组</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">sector[]</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的话,那么此结束标志相当于</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">sector[510]=0x55</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,且</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">sector[511]=0xAA</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)结束,则</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">BIOS</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">认为它是一个引导扇区,也就是我们说的</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">Boot Sector</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。当然,一个正确的</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">Boot Sector</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">除了以</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">0xAA55</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">结束之外,还应该包含一段少于</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">512B</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的执行码。</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt"><FONT 
size=2><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">好了,一旦</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">BIOS</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">发现了</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">Boot Sector</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,就会将这</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">512B</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的内容装载到内存的</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">0000:<ST1:CHMETCNV w:st="on" tcsc="0" 
numbertype="1" negative="False" hasspace="False" sourcevalue="7" 
unitname="C">7c</ST1:CHMETCNV>00</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处,然后跳转到</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">0000:<ST1:CHMETCNV w:st="on" tcsc="0" 
numbertype="1" negative="False" hasspace="False" sourcevalue="7" 
unitname="C">7c</ST1:CHMETCNV>00</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处将控制权彻底交给这段引导代码。到此为止,计算机不再由</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">BIOS</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中固有的程序来控制,而变成由操作系统的一部分来控制。</SPAN></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 20pt"><FONT 
size=2><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">现在,你可能明白了为什么在那段代码的第一行会出现</SPAN><SPAN 
lang=EN-US><FONT face="Times New Roman">org <ST1:CHMETCNV w:st="on" tcsc="0" 
numbertype="1" negative="False" hasspace="False" sourcevalue="7" 
unitname="C">07c</ST1:CHMETCNV>00</FONT></SPAN><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这样的代码。没错,这行代码就是告诉编译器,将来我们的这段程序要被加载到内存偏移地址</SPAN><FONT 
face="Times New Roman"><ST1:CHMETCNV w:st="on" tcsc="0" numbertype="1" 
negative="False" hasspace="False" sourcevalue="7" unitname="C"><SPAN 
lang=EN-US>7c</SPAN></ST1:CHMETCNV><SPAN lang=EN-US>00</SPAN></FONT><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">处。好了,下面将对代码的其他部分进行详细解释。</SPAN></FONT><SPAN 
lang=EN-US style="COLOR: blue"><O:P></O:P></SPAN></P></DIV><!-- page -->
<DIV class=page style="TEXT-ALIGN: center"><A 
href="http://book.csdn.net/bookfiles/88/100882493.shtml">上一页</A>&nbsp;&nbsp;&nbsp;<A 
href="http://book.csdn.net/bookfiles/88/index.html">首页</A>&nbsp;&nbsp;&nbsp;<A 
href="http://book.csdn.net/bookfiles/88/100882495.shtml">下一页</A> </DIV>
<DIV 
style="BORDER-RIGHT: #0b5f98 1px solid; BORDER-TOP: #0b5f98 1px solid; MARGIN: 0px auto; BORDER-LEFT: #0b5f98 1px solid; WIDTH: 700px; BORDER-BOTTOM: #0b5f98 1px solid">
<DIV 
style="PADDING-RIGHT: 1px; PADDING-LEFT: 1px; FLOAT: left; PADDING-BOTTOM: 1px; WIDTH: 16px; COLOR: white; PADDING-TOP: 1px; BACKGROUND-COLOR: #0b5f98">图书导读 
</DIV>
<DIV 
style="PADDING-LEFT: 2px; FLOAT: right; WIDTH: 670px; LINE-HEIGHT: 16pt; TEXT-ALIGN: left"><!--导读-->
<H1 id=divCurrentNode2 
style="PADDING-LEFT: 2px; FONT-SIZE: 12px; WIDTH: 100%; COLOR: #b83507; TEXT-ALIGN: left">当前章节:<A 
href="http://book.csdn.net/bookfiles/88/100882494.shtml"><FONT color=red>1.3 
Boot Sector</FONT></A></H1>
<DIV id=divRealteNod2 style="PADDING-LEFT: 2px">
<DIV style="FLOAT: left; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882492.shtml">1.1 准备工作</A></DIV>
<DIV style="FLOAT: right; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882493.shtml">1.2 
10分钟完成的操作系统</A></DIV>
<DIV style="FLOAT: left; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882495.shtml">1.4 代码解释</A></DIV>
<DIV style="FLOAT: right; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882496.shtml">1.5 水面下的冰山</A></DIV>
<DIV style="FLOAT: left; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882497.shtml">1.6 回顾</A></DIV>
<DIV style="FLOAT: right; WIDTH: 49%">·<A 
href="http://book.csdn.net/bookfiles/88/100882498.shtml">2.1 虚拟计算机(Virtual 
PC)</A></DIV></DIV></DIV></DIV>
<DIV class=clear> </DIV></DIV>
<DIV class=todayCommend style="WIDTH: 100%">
<DIV class=title>
<H5>同类图书推荐</H5></DIV>
<DIV class="blank6 clear"></DIV>
<DIV class=content id=divSameSort>
<LI style="FLOAT: left; WIDTH: 20%"><A title=Linux应用程序开发(Java版) 
href="http://book.csdn.net/bookfiles/222/"><IMG height=112 
src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/TS00123568__.jpg" width=80 
border=0></A>
<P><A title=Linux应用程序开发(Java版) 
href="http://book.csdn.net/bookfiles/222/">Linux应用程序开发(Ja...</A></P></LI>
<LI style="FLOAT: left; WIDTH: 20%"><A title="Linux C编程" 
href="http://book.csdn.net/bookfiles/54/"><IMG height=112 
src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/smallTS_730211369001top.jpg" 
width=80 border=0></A>
<P><A title="Linux C编程" href="http://book.csdn.net/bookfiles/54/">Linux 
C编程</A></P></LI>
<LI style="FLOAT: left; WIDTH: 20%"><A title=UNIX编程艺术 
href="http://book.csdn.net/bookfiles/34/"><IMG height=112 
src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/TS0091589__.jpg" width=80 
border=0></A>
<P><A title=UNIX编程艺术 
href="http://book.csdn.net/bookfiles/34/">UNIX编程艺术</A></P></LI>
<LI style="FLOAT: left; WIDTH: 20%"><A title="Solaris 10红宝书" 
href="http://book.csdn.net/bookfiles/19/"><IMG height=112 
src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/TS00105905__.jpg" width=80 
border=0></A>
<P><A title="Solaris 10红宝书" href="http://book.csdn.net/bookfiles/19/">Solaris 
10红宝书</A></P></LI>
<LI style="FLOAT: left; WIDTH: 20%"><A title=Linux内核分析及编程 
href="http://book.csdn.net/bookfiles/12/"><IMG height=112 
src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/TS0079168__.jpg" width=80 
border=0></A>
<P><A title=Linux内核分析及编程 
href="http://book.csdn.net/bookfiles/12/">Linux内核分析及编程</A></P></LI></DIV></DIV><!-- 评论 -->
<DIV class=clear></DIV>
<DIV class=todayCommend style="WIDTH: 100%">
<DIV class=title>
<H5>网友热评</H5></DIV>
<DIV class="blank6 clear"></DIV>
<DIV class=content style="OVERFLOW: scroll; WIDTH: 99%; TEXT-ALIGN: left">
<SCRIPT 
src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/NewsCsdnNetJsReferences.aspx" 
type=text/javascript></SCRIPT>
</DIV></DIV><!-- 今日推荐 -->
<DIV class=clear></DIV>
<DIV id=tagad style="TEXT-ALIGN: left">
<DIV id=csdn_zhaig_ad_yahoo style="WIDTH: 99%"></DIV>
<SCRIPT type=text/javascript>
                ad_width=468;
ad_height=60;
adcss=2;
unionuser=22;
  
ad_type='j';
count=3;
                </SCRIPT>

<SCRIPT src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/showads.js" 
type=text/javascript></SCRIPT>

<SCRIPT src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/tag.js" 
type=text/javascript></SCRIPT>
</DIV></DIV><!-- 页脚 -->
<DIV id=foot><IMG height=0 alt="" 
src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/readbook.aspx" width=0> </DIV>
<STYLE>#CFBig {
	CLEAR: both; FONT-SIZE: 12px; MARGIN: auto; WIDTH: 770px; FONT-FAMILY: Tahoma, sans-serif; TEXT-ALIGN: center
}
#CFBig #CFContent {
	MARGIN: auto; WIDTH: 500px; TEXT-ALIGN: center
}
#CFBig #CFContent P {
	MARGIN: 2px
}
#CFBig HR {
	COLOR: #4682b4; HEIGHT: 1px
}
#CFBig #CFBiaoShi {
	FLOAT: right; WIDTH: 40px
}
#CFBig A:link {
	COLOR: #000; TEXT-DECORATION: none
}
#CFBig A:visited {
	COLOR: #000; TEXT-DECORATION: none
}
#CFBig A:hover {
	COLOR: #369; TEXT-DECORATION: none
}
#CFBig A:active {
	COLOR: #000; TEXT-DECORATION: none
}
</STYLE>
<!-- 页脚 -->
<DIV style="TEXT-ALIGN: center">
<DIV id=CFBig>
<HR>

<DIV id=CFContent>
<DIV id=CFBiaoShi><A 
href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010"><IMG 
height=48 alt="" src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/BiaoShi.gif" 
width=40 border=0></A> </DIV>
<P><A href="http://www.csdn.net/intro/intro.asp?id=2">网站简介</A>-<A 
href="http://www.csdn.net/intro/intro.asp?id=5">广告服务</A>-<A 
href="http://www.csdn.net/map/map.shtm">网站地图</A>-<A 
href="http://www.csdn.net/help/help.asp">帮助</A>-<A 
href="http://www.csdn.net/intro/intro.asp?id=9">联系方式</A>-<A 
href="http://job.csdn.net/Jobs/f9c75c9f2ad14404a604669b757b9ed0/viewcompany.aspx">诚聘英才</A>-<A 
href="http://www.csdn.net/english/">English</A>-<A 
href="javascript:navigate('mai'%20+%20'lto:'%20+%20'webm'%20+%20'aster@c'%20+%20'sdn.n'+'et?subject=向CSDN报告问题')">问题报告</A></P>
<P>北京百联美达美数码科技有限公司&nbsp;&nbsp;版权所有&nbsp;&nbsp;京 ICP 证 020026 号</P>
<P>Copyright &copy; 2000-2006, CSDN.NET, All Rights Reserved</P></DIV>
<HR>
</DIV></DIV>
<SCRIPT type=text/javascript>document.write("<img src=http://counter.csdn.net/pv.aspx?id=115 border=0 width=0 height=0>");</SCRIPT>

<SCRIPT language=JavaScript 
src="1_3 Boot Sector - 《自己动手写操作系统》 -2.files/counter.js"></SCRIPT>
<!-- /页脚 --></DIV></BODY></HTML>

⌨️ 快捷键说明

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