Semester : SEMESTER 6
Subject : Embedded System
Year : 2018
Term : MARCH
Scheme : 2015 Full Time
Course Code : EC 308
Page:63
SE
3. In a pipe there may be no fixed number of bytes per message but there is end-pointer. 4 ங்
therefore be inserted limited number of bytes and have a variable number of bytes per Message ६
the initial and final pointers. ಕ್
4. Pipe is unidirectional. One thread or task inserts into 1 and the other one deletes from it.
An example of the need for messaging and thus for IPC using a pipe is a network stack.
The OS functions for pipe are the following:
1. pipeDevCreate for creating a device, which functions as pipe.
2. open ( ) for opening the device to enable its use from beginning of its allocated buffer, its use jg 5
options and restrictions (or permissions) defined at the time of opening. 5 With
3. connect ( ) for connecting a thread or task inserting bytes to the thread or task deleting bytes from the bi
4. write ) ( function for inserting (writing) from the bottom of the empty memory space in the ಗೊ
allotted to it.
5. read ) ) function for deleting (reading) from the pipe from the bottom of the unread memory spaces in
the buffer filled after writing into the pipe.
6. close ( ) for closing the device to enable its use from beginning of its allocated buffer only after
opening it again.
Figure 7.10(a) shows functions at an OS. A function is for initialization and creating a pipe. It defines pipe
ID, length, maximum length (not defined in some OSes) and initial values of two pointers. These are *pFRONT
and *pBACK for pipe message destination (head) and pipe message source (tail) memory locations, respectively.
A function is for pipe connecting and thus defining source ID and destination ID. A function is for the error
handling. Figure 7.10(b) shows pipe messages in a message buffer.
OS device driver
functions for pipe
source
and sink
close the
pipe
device
Error
handling
function
Messages (byte stream) at pi pipe top
(insertion 1 for win Last writen
without ன் னம بل (inserted)
) as FIFO (first-in first-out) Awaiting byte Bt “pBACK
waiting for byte
read (deletion) pipe end
∙ (9)
Fig. 7.10 (a) Functions at operating system (initialization, connect, read, write and ೮1101-101011
functions) and the use of write a
nd ⋅ es
a message buffer read functions by tasks A and 8 (2) Pipe 28