• No results found

DEVICE DRIVERS AND TERRUPTS SERVICE MECHANISM Lesson-14: Device types, Physical and Virtual device functions

N/A
N/A
Protected

Academic year: 2021

Share "DEVICE DRIVERS AND TERRUPTS SERVICE MECHANISM Lesson-14: Device types, Physical and Virtual device functions"

Copied!
26
0
0

Loading.... (view fulltext now)

Full text

(1)

DEVICE DRIVERS AND TERRUPTS SERVICE MECHANISM

Lesson

Lesson - - 14: Device types, Physical and Virtual 14: Device types, Physical and Virtual device functions

device functions

(2)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 2

 For each type of device, there is a set of the generic commands.

 For example, for char device one set of commands and for block device there can be another set.

Device Types

Device Types

(3)

 Types of Physical and Virtual devices in a system may be as follows:

char, block, loop back device, file, pipe, socket, RAM disk, sound, video and

media.

Device Types

Device Types

(4)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 4

Virtual device driver

- Definition : A virtual-device driver is the component of a device driver that

communicates directly between an

application and memory or a physical device.

- Virtual device driver controls the flow of data

- Allows more than one application to access the same memory or physical device

without conflict.

(5)

 Char Device: For example, a device to which one character is sent at one time or is read from it at one time.

For example, mouse, keyboard, keypad, timer .

Char Device

Char Device

(6)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 6

• Block Device: For example, a device to which one block of

characters is sent at one time or is read from it at one time. For

example, printer, disk.

Block Device

Block Device

(7)

 Block as well as Char device: For example, a device to which one block of characters or a single

character is sent at one time or is read from it at one time. For, example,

LCD display unit. A device can be

configured as char or block as per the need by a generic command.

Block Device configuration as Char Device

Block Device configuration as Char Device

(8)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 8

 Loop-back Device: A device to which one character or set of

characters are sent, and those are echoed back to same.

Configuration as loop

Configuration as loop - - back Device back Device

(9)

• Copy Device: A device using which a set of characters are sent, and those are

returned to another device. For example, disk_copy device when characters are

copied from one disk to another or a

keyboard-cum-display device. Keyboard input is sent to a buffer and display unit uses that buffer for display.

Configuration as copy Device

Configuration as copy Device

(10)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 10

Virtual Devices Virtual Devices

• Besides the physical devices of a system, drivers are also used in a systems for virtual devices.

• Physical device drivers and virtual device drivers have analogies.

• Like physical device, virtual device drivers

may also have functions for device connect

or open, read, write and close.

(11)



A memory block can have data buffers for input and output in analogy to buffers at an IO device and can be accessed from a char driver or block or pipe or socket

driver.

Driver

Driver

(12)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 12

• Pipe device: A device from to which the blocks of characters are send from one end and accessed from another ends in FIFO mode (first-in first-out) after a connect function is executed to connect two ends.

Virtual Device Examples

Virtual Device Examples

(13)



Socket device: A device from to which (a) the blocks of characters are send from one end with a set of the port (application) and sender addresses, (b) accessed from

another end port (application) and receiver addresses, (c) access is in FIFO mode

(first-in first-out) only after a connect function is executed to connect two sockets.

Virtual Device Examples ...

Virtual Device Examples ...

(14)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 14



File device: A device from which the

blocks of characters are accessed similar to a disk in a tree like format (folder,

subfolder,...). For example, a named file at the memory stick.

Virtual Device Examples...

Virtual Device Examples...

(15)

 RAM disk Device: A set of RAM memory blocks used like a disk, which is accessed by defining

addresses of directory, subdirectory, second level subdirectory, folder and subfolder

Virtual Device Examples

Virtual Device Examples

(16)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 16

 Pipe needs one address at an end,

 Socket one addresses and one port number at an end, and

 File and disk can have multiple

addresses. Reading and writing into a file is from or to current cursor

address in the currently open folder.

Difference between various types of virtual Difference between various types of virtual

devices

devices

(17)

Just as a file is sent read call, a device must be sent a driver

command when its input buffer(s) is to be read.

Just as a file is sent write call, a device needs to be sent a driver

command when its output buffer is to

be written.

(18)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 18

Virtual device example for Remote Virtual device example for Remote

System access System access



A virtual device example is a device

description that is used to form a connection between a user and a physical system

networked or connected to a remote

system.

(19)

Virtual device driver File name (VxD)

- Driver filename in Windows OS is used where the V stands for virtual and D

stands for device.The “d" can be replaced with other characters; for

example, VdD means a display driver.

(20)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 20

• Linux has internal functions called

Internals. Internals exist for the device-

drivers and network-management functions.

Useful Linux drivers for the embedded system and gives the uses of each.

Linux Internals and Device Drivers and Linux

Network Functions

(21)

• Char (For driving a character)

• Block (For driving a block of char)

• Input (For standard IO devices)

• Media (For standard media device functions)

• Video (For standard video device functions)

• Sound (For standard auido device functions)

Linux drivers

(22)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 22

The Linux internal functions exist for o Sockets,

o Handling of Socket buffers, o firewalls,

o network Protocols (for examples, NFS, IP, IPv6 and Ethernet) and

o bridges.

• They work separately as drivers and also form a part of the network management function of the operating system.

Linux drivers in the net directory

(23)

Summary

Summary

(24)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 24

We learnt We learnt

• Physical and virtual devices

• Drivers for virtual devices are also written similar to the physical device drivers

• Use the same generic commands.

• Device Types : char, block, loop back, file device, pipe, socket, RAM disk, sound,

video and media.

• Device examples are char device, block

device, loop back device, file device, pipe,

socket and RAM disk

(25)

We learnt



Linux operating system has internals and a

large number of readily available device

drivers for the most common physical and

virtual devices and has the functions for the

network sockets and protocols

(26)

2008 Chapter-4 L13: "Embedded Systems - Architecture, Programming and

Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 26

End of Lesson 14 of Chapter 4

End of Lesson 14 of Chapter 4

References

Related documents

For a broad class of spherically symmetric distributions, we have demonstrated minimaxity of generalized Bayes estimators corresponding to a superharmonic prior under mild

• Linux permits a block device to read and write byte-by-byte like a char.. device or read and write block-wise like a

Computer Hardware Management Software Tamper-proofing Remote Control Customized Interface Operating System Filesystem Device Drivers Graphical Interface Application Software

ProCurve’s comprehensive security vision and strategy – ProCurve ProActive Defense – delivers a trusted network infrastructure that is immune to threats, controllable for

Analise da comercialização de alimentos através do Programa Nacional de Alimentação Escolar (PNAE) no Município de Marechal Cândido Rondon, Paraná, foi realizada

Given that, as previously stated, in these two cases there appears to be no significant evidence of contagion, it should be concluded instead that the intensity of contagion

Virtual And Physical Compatibility Modes Mapping file VMFS volume Mapped device virtual mode physical mode Virtual machine 1 Virtualization VMFS Mapping file VMFS volume Mapped

the Traffic Manager. This mode is useful if all your SIP clients are on the same network as your Traffic Manager and the Traffic Manager is acting as a gateway to the Internet.