📄 write your own operating system - lesson 7.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://www.cse.unl.edu/~jgompert/OS/lesson7.htm -->
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>Write Your Own Operating System - Lesson 7</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content=Word.Document name=ProgId>
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<META content="Microsoft Word 9" name=Originator><LINK
href="./lesson7_files/filelist.xml" rel=File-List><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>Joel Matthias Gompert</o:Author> <o:LastAuthor>Joel Matthias Gompert</o:LastAuthor> <o:Revision>18</o:Revision> <o:TotalTime>35</o:TotalTime> <o:Created>2001-12-28T03:27:00Z</o:Created> <o:LastSaved>2001-12-28T04:37:00Z</o:LastSaved> <o:Pages>2</o:Pages> <o:Words>822</o:Words> <o:Characters>4686</o:Characters> <o:Company>The Flaming Gymsocks</o:Company> <o:Lines>39</o:Lines> <o:Paragraphs>9</o:Paragraphs> <o:CharactersWithSpaces>5754</o:CharactersWithSpaces> <o:Version>9.2720</o:Version> </o:DocumentProperties></xml><![endif]-->
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; mso-header-margin: .5in; mso-footer-margin: .5in; mso-paper-source: 0; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 12pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-weight: bold
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 12pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-weight: bold
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 12pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-weight: bold
}
H1 {
FONT-SIZE: 16pt; MARGIN: 0in 0in 12pt; FONT-FAMILY: Arial; mso-pagination: widow-orphan; mso-bidi-font-weight: normal; mso-bidi-font-size: 12.0pt; mso-style-next: Normal; mso-outline-level: 1; mso-bidi-font-family: "Courier New"; mso-font-kerning: 0pt
}
H2 {
FONT-SIZE: 12pt; MARGIN: 0in 0in 12pt; FONT-FAMILY: "Times New Roman"; mso-pagination: widow-orphan; mso-bidi-font-weight: normal; mso-style-next: Normal; mso-outline-level: 2
}
P.MsoTitle {
FONT-WEIGHT: bold; FONT-SIZE: 16pt; MARGIN: 12pt 0in 3pt; FONT-FAMILY: Arial; TEXT-ALIGN: center; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-outline-level: 1; mso-font-kerning: 14.0pt
}
LI.MsoTitle {
FONT-WEIGHT: bold; FONT-SIZE: 16pt; MARGIN: 12pt 0in 3pt; FONT-FAMILY: Arial; TEXT-ALIGN: center; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-outline-level: 1; mso-font-kerning: 14.0pt
}
DIV.MsoTitle {
FONT-WEIGHT: bold; FONT-SIZE: 16pt; MARGIN: 12pt 0in 3pt; FONT-FAMILY: Arial; TEXT-ALIGN: center; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-outline-level: 1; mso-font-kerning: 14.0pt
}
P.MsoBodyText {
FONT-SIZE: 12pt; MARGIN: 0in 0in 12pt; FONT-FAMILY: "Times New Roman"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
LI.MsoBodyText {
FONT-SIZE: 12pt; MARGIN: 0in 0in 12pt; FONT-FAMILY: "Times New Roman"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
DIV.MsoBodyText {
FONT-SIZE: 12pt; MARGIN: 0in 0in 12pt; FONT-FAMILY: "Times New Roman"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
P.MsoBodyTextIndent {
FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Courier New"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-weight: bold; mso-bidi-font-size: 12.0pt
}
LI.MsoBodyTextIndent {
FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Courier New"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-weight: bold; mso-bidi-font-size: 12.0pt
}
DIV.MsoBodyTextIndent {
FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Courier New"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"; mso-bidi-font-weight: bold; mso-bidi-font-size: 12.0pt
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
DIV.Section1 {
page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1026"> <o:colormru v:ext="edit" colors="#ffc,#ff9"/> <o:colormenu v:ext="edit" fillcolor="#cff"/> </o:shapedefaults></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US style="tab-interval: .5in" vLink=purple link=blue>
<P class=MsoTitle><A name=_Toc534120514>Write Your Own Operating System
Tutorial</A></P>
<DIV class=Section1
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 1pt; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 0.75pt solid"><A
href="http://www.cse.unl.edu/~jgompert/OS/lesson6.htm">Previous Lesson</A>
| <A href="http://www.cse.unl.edu/~jgompert/OS/TableOfContents.htm">Table
of Contents</A> | Next Lesson
<P></P></DIV><SPAN style="mso-bookmark: _Toc534120514"></SPAN>
<H1 class=Section1><A name=_Toc534120520>Lesson 7: Start Saying Goodbye To
BIOS</A></H1>
<P class=MsoNormal>Now that we have a boot loader that will load our operating
system, and thus can make our operating system larger than one sector, we can
now begin to add some complexity to our system. One of the first things to do is
to loosen our tie to BIOS. So far we have been using BIOS functions for all of
our input and output. BIOS hides all of the input and output from us with its
interface, so we don抰 know exactly how it goes about performing its functions.
BIOS can often be slower than handling I/O by ourselves, and in doing it
ourselves, we can know exactly what is going on, thus giving us more power,
control, and flexibility with the design of our operating system. The
benefit to using BIOS is that the interface is very standard and should not
vary from machine to machine. On the other hand, BIOS can only be
used in real mode. Later on, if the operating system switches the
processor over to protected mode, then the BIOS functions are unusable. Of
course, my main reason for learning to perform the I/O myself it simply to see
how it is done. If anyone has any arguments for or against the use of BIOS for
I/O, let me know. Perhaps we could discuss it further.</P>
<P class=MsoNormal>The area we will begin with is that of text output to the
screen.<SPAN style="mso-spacerun: yes"> </SPAN>So far we have been using
BIOS interrupt 0x10, function 0x0E.<SPAN style="mso-spacerun: yes">
</SPAN>We will begin performing text output ourselves.<SPAN
style="mso-spacerun: yes"> </SPAN>Before we can even start to do this, we
need to know a few things. First of all, video memory is mapped to main memory
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -