VxWorks 学习笔记-IO and File System

来源:互联网 发布:主机域名的正确写法 编辑:程序博客网 时间:2024/06/10 07:39

§ IO and File System

分层结构

  • Stardand I/O (stdio, fioLib) is based on Basic I/O

  • Stardand I/O routines use file pointer

  • Basic I/O routines use file descriptor



IO System Interface

  • 分层结构:Application ---> I/O system ---> xxDriver ---> Device

  • VxWorks I/O system provides a simple device-independent and portable interface to these device drivers.

  • A device driver must be installed in the I/O system.

  • -> devs

  • File Descriptors

  • -> iosFdShow

Character I/O

Reserved file descriptors

  • STD_IN, STD_OUT, STD_ERR

  • 相关的操作:ioGlobalStdSet, ioGlobalStdGet, ioTaskStdSet, ioTaskStdGet

Basic I/O Routines

Open, close, create, remove, read, write, ioctl, select

Standard I/O

  • VxWorks provides two libraries for higher level I/O functionality:

  • ansiStdio: Buffered I/O package. “stdio.h”. Not reentrant.

  • fioLib: Formatted, non-buffered I/O. “FioLib.h”. Reentrant.

Block I/O

  • 调用关系:File system routines ---> Block driver

  • Block driver的功能: 1) Reads/writes disk sectors. 2) Formats disk (marks sector boundaries).

  • File system routines manage files on a disk.

  • VxWorks提供了一些Block Drivers file systems

  • 使用:Create block device ---> Initialize file system ---> use read( ), write( ), etc. to manipulate files on the file system

 
原创粉丝点击