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

📄 posix2.htm

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quadralay WebWorks Publisher Professional Edition 6.0.5">
<meta name="TEMPLATEBASE" content="book_html">
<meta name="LASTUPDATED" content="12/04/03 16:07:18">
<title>17.1 Introduction</title>

<STYLE TYPE="text/css">
<!--
	span.Signal { text-transform: uppercase; font-family: Verdana }
-->
</STYLE>

</head>

<body link="#3366CC" vlink="#9999CC" text="#000000" alink="#0000CC" bgcolor="#FFFFFF"
background="images/backgrnd.gif">

<p><img src="images/stlogo.gif" width="106" height="83" align="left"
alt="logo here!"> </p>

<table width="331" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="a_refman.htm"><img src="images/navtoc.gif" width="84" height="23"
    border="0" alt="TOC"> </a></td>
    <td><a href="posix.htm"><img src="images/navprev.gif" width="80" height="23"
    border="0" alt="PREV"> </a></td>
    <td><a href="posix3.htm"><img src="images/navnext.gif" width="83" height="23"
    border="0" alt="NEXT"> </a></td>
    <td><a href="a_refmaa.htm"><img src="images/navidx.gif" width="84" height="23"
    border="0" alt="INDEX"> </a></td>
  </tr>
</table>

<p><br clear="all">
</p>

<hr align="left">

<blockquote>
<h2>
  <a name="1204413"> </a><font color="#003366"  face="Verdana, Arial, Helvetica, sans-serif">17.1 	 Introduction</font>
</h2><hr>


<p>
  <a name="1204415"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">The ST20 device-independent I/O system is designed to provide a uniform interface to devices of different types. These devices typically fall into one of the following three categories:</font>
</p>

<ul>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204416"> </a>character based devices, such as serial ports,</font></p>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204417"> </a>block devices, for example disk drives,</font></p>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204418"> </a>file systems, which can be either on a local device such as a disk drive, or a remote host.</font></p>
</ul>

<p>
  <a name="1204419"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">However, these differences are hidden behind a common set of application program interfaces (APIs). This makes it possible to change the device which provides a particular piece of functionality, without affecting the application code which uses it. For example, a file may be read from the host file system during development, and then transferred to a local disk for the final product, without having to change any of the code which accesses that file.</font>
</p>


<p>
  <a name="1204420"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">The ST20 run-time libraries provide three different APIs for accessing devices.</font>
</p>

<ul>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204421"> </a><strong>ANSI style I/O</strong></font></p>
  <dl>
    <dt> <a name="1208160"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">Examples include <font size=2 face=Courier><strong>printf()</strong></font> and <font size=2 face=Courier><strong>fopen()</strong></font>. This is a high level interface, which is provided by virtually all C implementations, and provides a rich set of functionality. In particular all file access can be buffered, to improve efficiency.</font>
  </dl>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1204422"> </a><strong>POSIX (or UNIX) style I/O</strong></font></p>
  <dl>
    <dt> <a name="1210104"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">Examples include <font size=2 face=Courier><strong>write()</strong></font> and <font size=2 face=Courier><strong>open()</strong></font>. This interface is lower level, providing a simple set of functions for accessing devices, in which virtually all operations are passed onto the device directly. Its main advantage is that it provides a standard interface to devices of all types.</font>
  </dl>
<p>  <font size=2  face="Verdana, Arial, Helvetica, sans-serif"><li ><a name="1206343"> </a><strong>Device specific functions</strong></font></p>
  <dl>
    <dt> <a name="1210111"> </a><font size=2  face="Verdana, Arial, Helvetica, sans-serif">Examples include <font size=2 face=Courier><strong>debugwrite()</strong></font> and <font size=2 face=Courier><strong>debugopen()</strong></font>. These functions are specific to a particular device, and applications using these APIs need to be modified if the device is changed, or the application ported to a different system. Calling these functions directly is more efficient in terms of memory if it allows the ANSI and POSIX layers to be eliminated. Using device specific functions may cause the application to execute a little faster if ANSI buffering is not required. These APIs are layered on top of each other, as shown in <a href="posix2.htm#1206374"><font  color="#0000ff" face="Verdana, Arial, Helvetica, sans-serif"><i>Figure

⌨️ 快捷键说明

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