APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY Previous Years Question Paper & Answer

Course : B.Tech

Semester : SEMESTER 6

Subject : Embedded System

Year : 2018

Term : MARCH

Scheme : 2015 Full Time

Course Code : EC 308

Page:51





PDF Text (Beta):

8.7 Set of Command Functions for Device Management

ऋ ‏ڑچ‎ Commands

create is 9 i
and open £ സ്ഥ

Action(s)

8 and open is for creati

: ∙∙∙ ng (if not created earlier) and
configuring and initializing the device!

55 Write into the device buffer or send output from the device and advance the
pointer (cursor),

7 Read from the device buffer Or read input from the device and advance the
pointer (cursor),

ಟೆ Specified device configured for s
parameters.

close and delete close is for de-registering the device from the system and delete is for close
(if not closed earlier) and detaching the device.

pecific functions and given specific

' There are two types of devices: char devices and bl
218 ೩ system the ioctl ( ) is used for the following:
control functions of device registers; (iii) 10 chann

00% devices. (Refer to Table 4.2 for definitions.)

(1) accessing specific Partition information; (ii) defining commands and
6] control.

The ioctl ( ) has three arguments for the device-specific parameters.

1. First argument: Defines the chosen device and its functions by passing as argument, the device-
descriptor (a number), for example, fd or sfd in Sections 7.14 and 7.15 for a device control. Example
is fd = | for read device, fd = 2 for write device.

2. Second argument: Defines the control option or use option for the 10 device, Network devices control
by defining baud rate or other parameters. Its use is as per function defined, as a second argument.
Controlled device will be according to the first argument.

3. Third argument: Values needed by the defined function are at the third argument.

Example 8.7

Status = 10001 (fd, FOBAUDRATE, 19,200) is an instruction in RTOS VxWorks. The fd is the 7

descriptor (an integer returned when the device is opened) and ۶1۱۱۵۸۲۶۸۸۶8 isa pointer for 10
rate function that takes value of baud rate = 19.200 from third argument. This configures

the device for operation at the 19,200-baud rate.

A device driver ISR uses several OS functions. Examples are as follows: intlock ( ) to disable interrupts
‘ystem, intUnlock ( ) to enable interrupts. intConnect ) to connect a 6 function to an interrupt vector (the
in Vector address for a device ISR points to a specific C function). Function intContext ( ) finds whether
பூவ பத in execution.

ND ಆ Ce ಭಃ and files to have an analogous implementation as far as possible. A
device has open ( ), close ( ), read ( ), write ( ) functions analogous to ೩ file open, close, read and write

functions (Section 7.14). APIs and kernel interfaces in BSD (Berkley sockets for devices) UNIX are open,
, Tead and write. The following are the in-kernel commands: (1) select, which is to first check whether a
"ead or write will succeed. (ii) ioctl to transfer driver-specific information to the device driver. (For example,
baud rate in Example 81 (iii) stop to cancel the output activity from the device. (iv) strategy to permit a
१०९५ read or write or character read or write. 8

Close

Similar Question Papers