Network File System

Download Report

Transcript Network File System

Introduction
VxWorks developed by Wind River System, is a networked real
time System, designed to be used in distributed environment.
It requires a host work station for program development.
VxWorks used in combination like VxWorks and Unix or
VxWorks and Windows.
VxWorks handles the critical real time chores, while the host
machine is used for program development and for applications
that are not time critical.
Basic Operating System

VxWorks kernel “wind” includes both POSIX interfaces and
interfaces specially for VxWorks.

Task: Applications are organized into independent, though
cooperating, programs, each of these programs, while
executing, is called task. (Multitasking is carried out).

Task’s Context:
(A) A thread of execution, which is task’s program counter
(B) The CPU registers and floating point registers.
(C) A stack for dynamic variables and function calls.
(D) I/O assignments for standard input, output, and error.
(E) A delay timer, timer slice timer, Kernel control structures.
Basic Operating System Cont.
Task State Transition:
 Upon creation, task enters suspended state.
 Activation is necessary for the task to enter ready state.
 Task can be deleted from any state.
Pended
Ready
Suspended
taskinit()
Delayed
Basic Operating System Cont..
Wind Task Scheduling
Priority based preemptive scheduling is default algorithm, but we
can select Round-Robin Scheduling for application as well.
 Preemptive Priority Scheduling: Higher priority Task executes
first, during switching kernel saves current task’s context.
256 Priority Levels: Highest priority 0 and Lowest priority is 256
 Round-Robin Scheduling: Round robin scheduling achieves fair
allocation of CPU to tasks of same priority by time slicing.
Preemption Lock: wind scheduler can be explicitly disabled and
enabled on a per task basis.
Basic Operating System Cont…
Inter-task Communication:
Includes:
1)
2)
3)
4)
5)
Shared Memory: For simple sharing of data.
Semaphores: For basic mutual exclusion and synchronization
Message Queues and Pipes: For Inter-task message passing
Sockets and RPC: For network transparent inter-task
communication
Signals: For exception handling.
Inter-Task Communication Cont..


Shared Memory: Task communicates by accessing shared
data structure. Global variables, linear buffers, ring buffers,
linked lists and pointers can be referenced directly by code
running in different contexts.
Semaphores: Three types of semaphores, optimized to address
different classes of problems.
(a) Binary:Optimized for synchronization or mutual exclusion.
(b) Mutual Exclusion: Specialized binary semaphore.
It differs from binary semaphore in following ways.
(1) It can be used for only mutual exclusion.
(2) It can be given only by the task that took it.
(3) semFlush() operation is illegal.

(c) POSIX: These semaphore are for use on a single CPU.
Inter-Task Communication Cont..
 Message Queues: Primary Inter-task communication mechanism.
Optional Product VxMP provides global message queues that can be used across
processor.
(a) Message queues allows variable number of messages, each of variable
length. Any task can send or receive messages to or from message queue.
(b) Multiple tasks can sent to and receive from same message queue.
(c) Messages are queued in FIFO (High priority messages attached at head of
queue)
(d) Time Outs: During sending or receiving messages, timeout specifies how
many ticks to wait for buffer space to become available or a message
become available.
 Pipes: Pipes are virtual I/O device. Task blocks when tries to read from empty
pipe or tries to write to full pipe. It provides unique facility called select()
This routine allows task to wait for data to be available on any of a set of I/O
device.
Inter-Task Communication Cont..
 Remote Procedure Call:
It allows a process on one machine to call a procedure that is executed by
another process on either the same machine or remote machine.
VxWorks tasks and host system processes can invoke routines that execute on
other VxWorks or host machines, in any combination.
 Signals:
Signals asynchronously alter the control flow of a task. Any task or ISR can
raise a signal for a particular task.
wind kernel support two types of signals:
(a) UNIX BSD- style signals
(b) POSIX- compatible signals.
Basic Operating System Cont…
 Interrupt: To inform the system the occurrence of external event.
For the fastest possible response to interrupts, ISR in VxWorks run in a special
context outside of any task’s context.Thus interrupt handling involves no task
context switch.
 Watch Dog Timers:This mechanism allows any C function to be
connected to a specified time delay.
 POSIX Clocks: Clock is a software construct that keeps time in seconds
and nanoseconds.
 Timers:It provides routines for tasks to signal themselves at some time in
future.
I/O System
VxWorks I/O system is designed to present a simple, uniform, device
independent interface to any kind of device, including:
.
(1)
Character-oriented devices: such as terminals or communications lines
random-access block devices such as disks
(2)
Virtual devices: such as intertask pipes and sockets – monitor and control
devices such as digital/analog I/O devices
(3)
Network devices that give access to remote devices The VxWorks I/O
system provides standard C libraries for both basic and buffered I/O.
I/O System Cont…
 Buffered I/O:
The VxWorks I/O library provides a buffered I/O package that is compatible
with the UNIX and Windows stdio package and provides full ANSI C support.
To include the stdio package in the VxWorks system, select
INCLUDE_ANSI_STDIO for inclusion in the project facility VxWorks view.
 Message Logging:
Another higher-level I/O facility is provided by the library logLib, which
allows formatted messages to be logged without having to do I/O in the
current task’s context, or when there is no task context.
 Asynchronous Input/Output:
Asynchronous Input/Output (AIO) is the ability to perform input and output
operations concurrently with ordinary internal processing.
I/O System
I/O Devices In VxWorks
 Serial I/O Device:
VxWorks provides terminal and pseudo-terminal device drivers (tty and pty
drivers).Pseudo terminals are useful in applications such as remote login
facilities.
 Pipe Devices:
Pipes are virtual devices by which tasks communicate with each other through
the I/O system. Tasks write messages to pipes; these messages can then be read
by other tasks.
 Pseudo Memory Devices:
The memDrv driver allows the I/O system to access memory directly as a
pseudo- I/O device. This feature is useful when data must be preserved between
boots of VxWorks or when sharing data between CPUs.
I/O System Cont..
 Network File System (NFS) Device:
Network File System (NFS) devices allow files on remote hosts to be accessed
with the NFS protocol. The NFS protocol specifies both client software, to read
files from remote machines, and server software, to export files to remote
machines. VxWorks also allows you to run an NFS server to export files to
other systems.
 Non-NFS Network Device:
VxWorks also supports network access to files on the remote host through the
Remote Shell protocol (RSH) or the File Transfer Protocol (FTP). The entire
file is copied into local memory. As a result, the largest file that can be opened
is restricted by the available memory.
I/O System Cont..
 Block Devices:
A block device is a device that is organized as a sequence of individually
accessible blocks of data. The most common type of block device is a disk.
In VxWorks, the term block refers to the smallest addressable unit on the
device, which is Sector.
Differences Between VxWorks and Host System I/O
(a) Device Configuration: Device drivers can be installed and removed
dynamically
(b) File Descriptors: In UNIX and Windows, fds are unique to each process. In
VxWorks fds are global entities, accessible by any task except for std input,
std output and std error which can be task specific.
(c) I/O Control: The specific parameters passed to ioctl() functions can differ
between UNIX and VxWorks.
(a) Driver Routines: In UNIX, device drivers executes in system mode and are
not preemptible. In VxWorks driver routines are preemptible as they execute
within the context of the task that invoked them.
Local File System
 VxWorks provides two local file systems appropriate for real-time used with
block devices (disks):
 One is compatible with MS-DOS file systems and the other with the RT-11 file
system.
 In VxWorks, the file system is not tied to a specific type of block device or its
driver. VxWorks block devices all use a standard interface so that file systems
can be freely mixed with device drivers. Alternatively, you can write your own
file systems that can be used by drivers in the same way, by following the same
standard interfaces between the file system, the driver, and the I/O system.
VxWorks I/O architecture makes it possible to have multiple file systems, even
of different types, in a single VxWorks system.
Local File System Cont..
MS-DOS-Compatible File System: dosFs
The dosFs file system offers considerable flexibility appropriate to the varying
demands of real-time applications.
Major features include:
(1)Hierarchical arrangement of files and directories, allowing efficient
organization and permitting an arbitrary number of files to be created on a
volume.
(2) A choice of contiguous or non-contiguous files on a per-file basis.
Noncontiguous files result in more efficient use of available disk space, while
contiguous files offer enhanced performance.
(3) Compatibility with widely available storage and retrieval media. Diskettes
created with VxWorks (that do not use dosFs extended filenames) and MSDOS
PCs and other systems can be freely interchanged. Hard disks are compatible if
the partition table is accounted for.
Local File System Cont..
(4) The ability to boot VxWorks from any local SCSI device that has a dosFs
file system.
(5) The ability to use longer file names than the 8-character filename plus 3character extension (8.3) convention allowed by MS-DOS.
(6) NFS (Network File System) support.
Basic Virtual Memory Support
For systems with an MMU, VxWorks allows to perform DMA and inter
processor communication more efficiently by rendering related buffers noncacheable. This is necessary to ensure that data is not being buffered locally
when other processors or DMA devices are accessing the same memory
location.
Virtual Memory Context:
A virtual memory context (VM_CONTEXT, defined in vmLib) is made up of a
translation table and other information used for mapping a virtual address to a
physical address. Multiple virtual memory contexts can be created and swapped
in and out as desired.
Basic Virtual Memory Support Cont..
 Global Virtual Memory:
Some system objects, such as text segments and semaphores, must be
accessible to all tasks in the system regardless of which virtual memory context
is made current. These objects are made accessible by means of global virtual
memory.
 Private Virtual Memory:
Private virtual memory can be created by creating a new virtual memory
context. This is useful for protecting data by making it inaccessible to other
tasks or by limiting access to specific routines.
Information
 VxWorks User Group:
Email:
[email protected] or [email protected]
phone:
408-289-7757
 VxWorks is not free…
Development License $23.5K (per project?)
Source $120K.
Target Licenses from $1000 for single quantity to $10 for
100,000+.