📄 write your own operating system - lesson 5.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://www.cse.unl.edu/~jgompert/OS/lesson5.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 5</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="./lesson5_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>7</o:Revision> <o:TotalTime>32</o:TotalTime> <o:Created>2001-12-28T03:24:00Z</o:Created> <o:LastSaved>2001-12-28T05:06:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>236</o:Words> <o:Characters>1350</o:Characters> <o:Company>The Flaming Gymsocks</o:Company> <o:Lines>11</o:Lines> <o:Paragraphs>2</o:Paragraphs> <o:CharactersWithSpaces>1657</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-style-next: Normal; mso-outline-level: 1; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: "Courier New"; mso-font-kerning: 0pt
}
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"
}
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="1027"/></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>
<DIV class=Section1>
<P class=MsoTitle><A name=_Toc534120514>Write Your Own Operating System
Tutorial</A></P>
<DIV
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">
<P class=MsoNormal
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: medium none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in"><SPAN
style="mso-bookmark: _Toc534120514"></SPAN><A
href="http://www.cse.unl.edu/~jgompert/OS/lesson4.htm"><SPAN
style="mso-bookmark: _Toc534120514">Previous Lesson</SPAN><SPAN
style="mso-bookmark: _Toc534120514"></SPAN></A><SPAN
style="mso-bookmark: _Toc534120514"><SPAN
style="mso-tab-count: 1">
</SPAN></SPAN><A
href="http://www.cse.unl.edu/~jgompert/OS/TableOfContents.htm"><SPAN
style="mso-bookmark: _Toc534120514">Table of Contents</SPAN><SPAN
style="mso-bookmark: _Toc534120514"></SPAN></A><SPAN
style="mso-bookmark: _Toc534120514"><SPAN
style="mso-tab-count: 1">
</SPAN></SPAN><A href="http://www.cse.unl.edu/~jgompert/OS/lesson6.htm"><SPAN
style="mso-bookmark: _Toc534120514">Next Lesson</SPAN><SPAN
style="mso-bookmark: _Toc534120514"></SPAN></A><SPAN
style="mso-bookmark: _Toc534120514"></SPAN></P></DIV><SPAN
style="mso-bookmark: _Toc534120514"></SPAN>
<H1><A name=_Toc534120518>Lesson 5: Let抯 Make It Interactive</A></H1>
<P class=MsoNormal>All of this printing stuff to the screen is fun, but no
operating system would be any good at all if it did not provide any
interactivity.<SPAN style="mso-spacerun: yes"> </SPAN>Let抯 make it read
input from the keyboard.<SPAN style="mso-spacerun: yes"> </SPAN>Again we
will be using calls to a function in BIOS to read the keyboard.</P>
<P class=MsoNormal>We are going to be using function 0, interrupt 0x16.<SPAN
style="mso-spacerun: yes"> </SPAN>This is done easily with the following
two instructions.</P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt"><SPAN
style="FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 1"> </SPAN>xor<SPAN
style="mso-tab-count: 1"> </SPAN>ah, ah<SPAN
style="mso-tab-count: 1"> </SPAN>; we want function
zero<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt"><SPAN
style="FONT-FAMILY: 'Courier New'"><SPAN
style="mso-tab-count: 1"> </SPAN>int<SPAN
style="mso-tab-count: 1"> </SPAN>0x16<SPAN style="mso-tab-count: 1">
</SPAN>; wait for a keypress<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-BOTTOM: 0pt"><SPAN
style="FONT-FAMILY: 'Courier New'"><![if !supportEmptyParas]><![endif]> <o:p></o:p></SPAN></P>
<P class=MsoNormal>This function causes the computer to pause and does not
return until a key is pressed.<SPAN style="mso-spacerun: yes"> </SPAN>This
can be used in a 揚ress any key to continue
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -