SlideShare a Scribd company logo
Embedded System
Programming
Introduction to Device Drivers
By :- Vibrant Technologies &
Computer
What are device drivers?
• Software interfaces to hardware resources in the
kernel
– Mirrors variety of hardware resources
– Can change constantly
– Will require reconfiguration
– Different interfaces into the same devices
– Require kernel resident programs
– Uses module interface
Types of device driver
• There are some general types or characteristics of
device drivers
– Character devices
• Serial data stream
– Block devices
• Accessed via blocked data stream
– Network interfaces
• Although serial, has no mapping into file system
Recognising device drivers
• Apart from network devices most drivers
appear like file in the Unix system
• ls –l /dev
– crw-r--r-- 1 root root 10, 134 Jun7 1996 apm_bios
– brw-rw---- 1 root floppy 2, 0 May 14 1996 fd0
Device
type
Major
number
Minor
number
File
Name
Character Device Drivers
• Data is a serial stream
• No random access
• Even a block devices can be a character one!
– Printers
Block Devices
• Data is read in blocks
• Block size depends upon the device
• Random access is supported
• Files systems can only be mounted block devices
• Block devices can have character interfaces
– fsck works on character “raw” interface to file
system
Network Interfaces
• Network interfaces act in some ways like a serial
character orientated device, however they don’t exist
in the file system
• For example eth0 is queried through the ifconfig
command
• Weirdly, network devices can support block features
for example network mounted file systems
Character & Block Device number assignment
• Character devices
– 1 Memory
– 4 Terminal
– 6 Parallel interfaces
– 7 Vitual consoles
– 9 SCSI tapes
– 10 Bus mice
– 12 QIC02 Tape
– 13 PC speaker driver
• Block devices
– 1 RAM disk
– 2 Floppy disk
– 3 IDE disk
– 8 SCSI disk
– 11 SCSI CD-ROM
– 13XT 8-bit hard disk
Loadable modules
• Historically there has been a split between monolithic kernels
– All code is contained in the kernel, fixed at build or boot time
• This means that kernel can be fast and efficient
• And Micro kernels
– Small lightweight kernel that load features in at run time, when
required
• The kernel is smaller, easier to port, the feaure list of more
flexible
• Linux loadable modules gives a compromise position
– Mainly monolithic kernel but can load modules in when needed
– The use of modules for devices is clearly important
Kernel Modules
• The provision of kernel modules allows code to be
introduced into a running kernel.
• This requires the kernel to be built with this capability,
it also requires the commands
– Insmod and rmmod (plus lsmod, depmod and
modprobe)
• Modules can be loaded on demand automatically.
Module programming
• The 2.6 kernel has changed the way module
programming is handled.
– We will look at this later on – for the moment we will
deal with 2.4
• Modules under 2.4 are just ordinary unlinked object
files (cc –o)
– Although they must link with the kernel and can
bring it down, so they are rather special.
Module programs
• Requires header files
– These will include
others
• Needs an init_module
and cleanup_module
function
• The return value is
important
– Only return 0.
• Use of printk
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
printk("<1>Hello world 1.n");
return 0;
}
void cleanup_module(void)
{
printk("KERN_ALERT "Goodbye
cruel world 1.n");
}
Using macros
• Use of init &
exit macros
• Use of __init
and __initdata
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
static int hello_data __init_data= 47;
static int __init hello2_init(void)
{
printk("<1>Hello world 2. %d n", hello_data);
return 0;
}
static void __exit hello2_exit(void)
{
printk("KERN_ALERT "Goodbye cruel world 2.n");
}
module_init(hello2_init);
module_exit(hello2_exit);
Features of kernel programming
• Don’t use libraries – only kernel code
– Printk not printf
• Set use of headers
– /usr/include/asm & /usr/include/linux
• Beware of namespace pollution
– Code shares names with the kernel
– Use static
ThankThank You !!!You !!!
For More Information click below link:
Follow Us on:
http://vibranttechnologies.co.in/embedded-system-classes-in-
mumbai.html

More Related Content

What's hot

Embedded system
Embedded systemEmbedded system
Embedded system
Nitish kumar
 
Embedded system
Embedded systemEmbedded system
Embedded system
Md.Abdullah Ahmad
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded System
rmkceteee
 
Embedded system...
Embedded system...Embedded system...
Embedded system...
Sarvesh Hegde
 
Embedded Systems - Training ppt
Embedded Systems - Training pptEmbedded Systems - Training ppt
Embedded Systems - Training ppt
Nishant Kayal
 
Embedded system
Embedded systemEmbedded system
Embedded system
Pankaj Upadhyay
 
Embedded system
Embedded systemEmbedded system
Embedded system
Insane Gamer
 
Embedded system
Embedded systemEmbedded system
Embedded system
Mohammad Shakirul islam
 
Embedded system
Embedded systemEmbedded system
Embedded system
VETRIVELNR
 
Embedded system introduction
Embedded system introductionEmbedded system introduction
Embedded system introduction
RajalakshmiSermadurai
 
2. block diagram and components of embedded system
2. block diagram and components of embedded system2. block diagram and components of embedded system
2. block diagram and components of embedded system
Vikas Dongre
 
Embedded systems
Embedded systemsEmbedded systems
Embedded systems
Edgefxkits & Solutions
 
Embedded systems
Embedded systems Embedded systems
Embedded systems
Ashok Mutyala
 
embedded systems ppt 3
embedded systems ppt 3embedded systems ppt 3
embedded systems ppt 3
pavan kumar
 
Embedded Systems : introduction
Embedded Systems : introductionEmbedded Systems : introduction
Embedded Systems : introduction
Anant Shrivastava
 
Architecture design of a virtual embedded system ppt
Architecture design of a virtual embedded system pptArchitecture design of a virtual embedded system ppt
Architecture design of a virtual embedded system ppt
Rajeev Mohanty
 
Embedded System
Embedded SystemEmbedded System
Embedded System
Smile Hossain
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
Dileep Kumar Tiwari
 
Embedded system Design
Embedded system DesignEmbedded system Design
Embedded system Design
AJAL A J
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
Apurva Zope
 

What's hot (20)

Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded System
 
Embedded system...
Embedded system...Embedded system...
Embedded system...
 
Embedded Systems - Training ppt
Embedded Systems - Training pptEmbedded Systems - Training ppt
Embedded Systems - Training ppt
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embedded system introduction
Embedded system introductionEmbedded system introduction
Embedded system introduction
 
2. block diagram and components of embedded system
2. block diagram and components of embedded system2. block diagram and components of embedded system
2. block diagram and components of embedded system
 
Embedded systems
Embedded systemsEmbedded systems
Embedded systems
 
Embedded systems
Embedded systems Embedded systems
Embedded systems
 
embedded systems ppt 3
embedded systems ppt 3embedded systems ppt 3
embedded systems ppt 3
 
Embedded Systems : introduction
Embedded Systems : introductionEmbedded Systems : introduction
Embedded Systems : introduction
 
Architecture design of a virtual embedded system ppt
Architecture design of a virtual embedded system pptArchitecture design of a virtual embedded system ppt
Architecture design of a virtual embedded system ppt
 
Embedded System
Embedded SystemEmbedded System
Embedded System
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
Embedded system Design
Embedded system DesignEmbedded system Design
Embedded system Design
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 

Viewers also liked

C++ for Embedded Programming
C++ for Embedded ProgrammingC++ for Embedded Programming
C++ for Embedded Programming
Colin Walls
 
States & Capitals 111
States & Capitals 111States & Capitals 111
States & Capitals 111
Bermanburgh
 
Embedded c programming
Embedded c programmingEmbedded c programming
Embedded c programming
PriyaDYP
 
C prog ppt
C prog pptC prog ppt
C prog ppt
xinoe
 
Embedded C
Embedded CEmbedded C
Embedded C workshop
Embedded C workshopEmbedded C workshop
Embedded C workshop
Mostafa El-koumy
 
Embedded C - Lecture 3
Embedded C - Lecture 3Embedded C - Lecture 3
Embedded C - Lecture 3
Mohamed Abdallah
 
C Programming For Embedded Systems
C Programming For Embedded SystemsC Programming For Embedded Systems
C Programming For Embedded Systems
Ganesh Samarthyam
 
Embedded c program and programming structure for beginners
Embedded c program and programming structure for beginnersEmbedded c program and programming structure for beginners
Embedded c program and programming structure for beginners
Kamesh Mtec
 
Embedded C - Lecture 4
Embedded C - Lecture 4Embedded C - Lecture 4
Embedded C - Lecture 4
Mohamed Abdallah
 
Embedded c programming22 for fdp
Embedded c programming22 for fdpEmbedded c programming22 for fdp
Embedded c programming22 for fdp
Pradeep Kumar TS
 
1 measurement and error
1 measurement and error 1 measurement and error
1 measurement and error
LOHYINNEE
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
Mohamed Abdallah
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
Hossam Hassan
 
Embedded c
Embedded cEmbedded c
Embedded c
Ami Prakash
 
Embedded C
Embedded CEmbedded C
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program execution
Rumman Ansari
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
Ahmad Idrees
 

Viewers also liked (18)

C++ for Embedded Programming
C++ for Embedded ProgrammingC++ for Embedded Programming
C++ for Embedded Programming
 
States & Capitals 111
States & Capitals 111States & Capitals 111
States & Capitals 111
 
Embedded c programming
Embedded c programmingEmbedded c programming
Embedded c programming
 
C prog ppt
C prog pptC prog ppt
C prog ppt
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Embedded C workshop
Embedded C workshopEmbedded C workshop
Embedded C workshop
 
Embedded C - Lecture 3
Embedded C - Lecture 3Embedded C - Lecture 3
Embedded C - Lecture 3
 
C Programming For Embedded Systems
C Programming For Embedded SystemsC Programming For Embedded Systems
C Programming For Embedded Systems
 
Embedded c program and programming structure for beginners
Embedded c program and programming structure for beginnersEmbedded c program and programming structure for beginners
Embedded c program and programming structure for beginners
 
Embedded C - Lecture 4
Embedded C - Lecture 4Embedded C - Lecture 4
Embedded C - Lecture 4
 
Embedded c programming22 for fdp
Embedded c programming22 for fdpEmbedded c programming22 for fdp
Embedded c programming22 for fdp
 
1 measurement and error
1 measurement and error 1 measurement and error
1 measurement and error
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program execution
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 

Similar to Embedded system - embedded system programming

Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running Modules
YourHelper1
 
Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers
Ahmed El-Arabawy
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
Kushal Modi
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
Linux操作系统01 简介
Linux操作系统01 简介Linux操作系统01 简介
Linux操作系统01 简介
lclsg123
 
linux device driver
linux device driverlinux device driver
linux device driver
Rahul Batra
 
Linux Device Driver,LDD,
Linux Device Driver,LDD,Linux Device Driver,LDD,
Linux Device Driver,LDD,
Rahul Batra
 
Linux Memory Analysis with Volatility
Linux Memory Analysis with VolatilityLinux Memory Analysis with Volatility
Linux Memory Analysis with Volatility
Andrew Case
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
Saurabh Bangad
 
NXP IMX6 Processor - Embedded Linux
NXP IMX6 Processor - Embedded LinuxNXP IMX6 Processor - Embedded Linux
NXP IMX6 Processor - Embedded Linux
NEEVEE Technologies
 
Window ce
Window ceWindow ce
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
QUONTRASOLUTIONS
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
dibyajyotig
 
Ch07
Ch07Ch07
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
Vandana Salve
 
Linux device drivers
Linux device driversLinux device drivers
Linux device drivers
Abhishek Sagar
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programming
Vandana Salve
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!
Peter Hlavaty
 
5120224.ppt
5120224.ppt5120224.ppt
5120224.ppt
dedanndege
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 

Similar to Embedded system - embedded system programming (20)

Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running Modules
 
Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers Course 102: Lecture 25: Devices and Device Drivers
Course 102: Lecture 25: Devices and Device Drivers
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Linux操作系统01 简介
Linux操作系统01 简介Linux操作系统01 简介
Linux操作系统01 简介
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Linux Device Driver,LDD,
Linux Device Driver,LDD,Linux Device Driver,LDD,
Linux Device Driver,LDD,
 
Linux Memory Analysis with Volatility
Linux Memory Analysis with VolatilityLinux Memory Analysis with Volatility
Linux Memory Analysis with Volatility
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
 
NXP IMX6 Processor - Embedded Linux
NXP IMX6 Processor - Embedded LinuxNXP IMX6 Processor - Embedded Linux
NXP IMX6 Processor - Embedded Linux
 
Window ce
Window ceWindow ce
Window ce
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
 
Ch07
Ch07Ch07
Ch07
 
Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
 
Linux device drivers
Linux device driversLinux device drivers
Linux device drivers
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programming
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!
 
5120224.ppt
5120224.ppt5120224.ppt
5120224.ppt
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
 

More from Vibrant Technologies & Computers

Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5
Vibrant Technologies & Computers
 
SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables  SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables
Vibrant Technologies & Computers
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
Vibrant Technologies & Computers
 
SQL- Introduction to SQL database
SQL- Introduction to SQL database SQL- Introduction to SQL database
SQL- Introduction to SQL database
Vibrant Technologies & Computers
 
ITIL - introduction to ITIL
ITIL - introduction to ITILITIL - introduction to ITIL
ITIL - introduction to ITIL
Vibrant Technologies & Computers
 
Salesforce - Introduction to Security & Access
Salesforce -  Introduction to Security & Access Salesforce -  Introduction to Security & Access
Salesforce - Introduction to Security & Access
Vibrant Technologies & Computers
 
Data ware housing- Introduction to olap .
Data ware housing- Introduction to  olap .Data ware housing- Introduction to  olap .
Data ware housing- Introduction to olap .
Vibrant Technologies & Computers
 
Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.
Vibrant Technologies & Computers
 
Data ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housingData ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housing
Vibrant Technologies & Computers
 
Salesforce - classification of cloud computing
Salesforce - classification of cloud computingSalesforce - classification of cloud computing
Salesforce - classification of cloud computing
Vibrant Technologies & Computers
 
Salesforce - cloud computing fundamental
Salesforce - cloud computing fundamentalSalesforce - cloud computing fundamental
Salesforce - cloud computing fundamental
Vibrant Technologies & Computers
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
Vibrant Technologies & Computers
 
SQL- Introduction to advanced sql concepts
SQL- Introduction to  advanced sql conceptsSQL- Introduction to  advanced sql concepts
SQL- Introduction to advanced sql concepts
Vibrant Technologies & Computers
 
SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data   SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data
Vibrant Technologies & Computers
 
SQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set OperationsSQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set Operations
Vibrant Technologies & Computers
 
Sas - Introduction to designing the data mart
Sas - Introduction to designing the data martSas - Introduction to designing the data mart
Sas - Introduction to designing the data mart
Vibrant Technologies & Computers
 
Sas - Introduction to working under change management
Sas - Introduction to working under change managementSas - Introduction to working under change management
Sas - Introduction to working under change management
Vibrant Technologies & Computers
 
SAS - overview of SAS
SAS - overview of SASSAS - overview of SAS
SAS - overview of SAS
Vibrant Technologies & Computers
 
Teradata - Architecture of Teradata
Teradata - Architecture of TeradataTeradata - Architecture of Teradata
Teradata - Architecture of Teradata
Vibrant Technologies & Computers
 
Teradata - Restoring Data
Teradata - Restoring Data Teradata - Restoring Data
Teradata - Restoring Data
Vibrant Technologies & Computers
 

More from Vibrant Technologies & Computers (20)

Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5Buisness analyst business analysis overview ppt 5
Buisness analyst business analysis overview ppt 5
 
SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables  SQL Introduction to displaying data from multiple tables
SQL Introduction to displaying data from multiple tables
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
 
SQL- Introduction to SQL database
SQL- Introduction to SQL database SQL- Introduction to SQL database
SQL- Introduction to SQL database
 
ITIL - introduction to ITIL
ITIL - introduction to ITILITIL - introduction to ITIL
ITIL - introduction to ITIL
 
Salesforce - Introduction to Security & Access
Salesforce -  Introduction to Security & Access Salesforce -  Introduction to Security & Access
Salesforce - Introduction to Security & Access
 
Data ware housing- Introduction to olap .
Data ware housing- Introduction to  olap .Data ware housing- Introduction to  olap .
Data ware housing- Introduction to olap .
 
Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.Data ware housing - Introduction to data ware housing process.
Data ware housing - Introduction to data ware housing process.
 
Data ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housingData ware housing- Introduction to data ware housing
Data ware housing- Introduction to data ware housing
 
Salesforce - classification of cloud computing
Salesforce - classification of cloud computingSalesforce - classification of cloud computing
Salesforce - classification of cloud computing
 
Salesforce - cloud computing fundamental
Salesforce - cloud computing fundamentalSalesforce - cloud computing fundamental
Salesforce - cloud computing fundamental
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
 
SQL- Introduction to advanced sql concepts
SQL- Introduction to  advanced sql conceptsSQL- Introduction to  advanced sql concepts
SQL- Introduction to advanced sql concepts
 
SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data   SQL Inteoduction to SQL manipulating of data
SQL Inteoduction to SQL manipulating of data
 
SQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set OperationsSQL- Introduction to SQL Set Operations
SQL- Introduction to SQL Set Operations
 
Sas - Introduction to designing the data mart
Sas - Introduction to designing the data martSas - Introduction to designing the data mart
Sas - Introduction to designing the data mart
 
Sas - Introduction to working under change management
Sas - Introduction to working under change managementSas - Introduction to working under change management
Sas - Introduction to working under change management
 
SAS - overview of SAS
SAS - overview of SASSAS - overview of SAS
SAS - overview of SAS
 
Teradata - Architecture of Teradata
Teradata - Architecture of TeradataTeradata - Architecture of Teradata
Teradata - Architecture of Teradata
 
Teradata - Restoring Data
Teradata - Restoring Data Teradata - Restoring Data
Teradata - Restoring Data
 

Recently uploaded

Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 

Recently uploaded (20)

Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 

Embedded system - embedded system programming

  • 1.
  • 2. Embedded System Programming Introduction to Device Drivers By :- Vibrant Technologies & Computer
  • 3. What are device drivers? • Software interfaces to hardware resources in the kernel – Mirrors variety of hardware resources – Can change constantly – Will require reconfiguration – Different interfaces into the same devices – Require kernel resident programs – Uses module interface
  • 4. Types of device driver • There are some general types or characteristics of device drivers – Character devices • Serial data stream – Block devices • Accessed via blocked data stream – Network interfaces • Although serial, has no mapping into file system
  • 5. Recognising device drivers • Apart from network devices most drivers appear like file in the Unix system • ls –l /dev – crw-r--r-- 1 root root 10, 134 Jun7 1996 apm_bios – brw-rw---- 1 root floppy 2, 0 May 14 1996 fd0 Device type Major number Minor number File Name
  • 6. Character Device Drivers • Data is a serial stream • No random access • Even a block devices can be a character one! – Printers
  • 7. Block Devices • Data is read in blocks • Block size depends upon the device • Random access is supported • Files systems can only be mounted block devices • Block devices can have character interfaces – fsck works on character “raw” interface to file system
  • 8. Network Interfaces • Network interfaces act in some ways like a serial character orientated device, however they don’t exist in the file system • For example eth0 is queried through the ifconfig command • Weirdly, network devices can support block features for example network mounted file systems
  • 9. Character & Block Device number assignment • Character devices – 1 Memory – 4 Terminal – 6 Parallel interfaces – 7 Vitual consoles – 9 SCSI tapes – 10 Bus mice – 12 QIC02 Tape – 13 PC speaker driver • Block devices – 1 RAM disk – 2 Floppy disk – 3 IDE disk – 8 SCSI disk – 11 SCSI CD-ROM – 13XT 8-bit hard disk
  • 10. Loadable modules • Historically there has been a split between monolithic kernels – All code is contained in the kernel, fixed at build or boot time • This means that kernel can be fast and efficient • And Micro kernels – Small lightweight kernel that load features in at run time, when required • The kernel is smaller, easier to port, the feaure list of more flexible • Linux loadable modules gives a compromise position – Mainly monolithic kernel but can load modules in when needed – The use of modules for devices is clearly important
  • 11. Kernel Modules • The provision of kernel modules allows code to be introduced into a running kernel. • This requires the kernel to be built with this capability, it also requires the commands – Insmod and rmmod (plus lsmod, depmod and modprobe) • Modules can be loaded on demand automatically.
  • 12. Module programming • The 2.6 kernel has changed the way module programming is handled. – We will look at this later on – for the moment we will deal with 2.4 • Modules under 2.4 are just ordinary unlinked object files (cc –o) – Although they must link with the kernel and can bring it down, so they are rather special.
  • 13. Module programs • Requires header files – These will include others • Needs an init_module and cleanup_module function • The return value is important – Only return 0. • Use of printk #include <linux/module.h> #include <linux/kernel.h> int init_module(void) { printk("<1>Hello world 1.n"); return 0; } void cleanup_module(void) { printk("KERN_ALERT "Goodbye cruel world 1.n"); }
  • 14. Using macros • Use of init & exit macros • Use of __init and __initdata #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> static int hello_data __init_data= 47; static int __init hello2_init(void) { printk("<1>Hello world 2. %d n", hello_data); return 0; } static void __exit hello2_exit(void) { printk("KERN_ALERT "Goodbye cruel world 2.n"); } module_init(hello2_init); module_exit(hello2_exit);
  • 15. Features of kernel programming • Don’t use libraries – only kernel code – Printk not printf • Set use of headers – /usr/include/asm & /usr/include/linux • Beware of namespace pollution – Code shares names with the kernel – Use static
  • 16. ThankThank You !!!You !!! For More Information click below link: Follow Us on: http://vibranttechnologies.co.in/embedded-system-classes-in- mumbai.html