SlideShare a Scribd company logo
1 of 22
Embedded I/O Management



    © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>
                   All Rights Reserved.
What to Expect?
Basic I/O Management Support
Advanced I/O Management
 Video Subsystem
 Audio Subsystem




       © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   2
                      All Rights Reserved.
I/O Management Overview
Linux provides a uniform i/f to on-board I/O Devices
Categorized as follows
  Link oriented (Network Devices)
  Block oriented (Storage Device)
  All Other (Sequential) Devices
Sequential Device or Character Device category is one of
the largest, with majority of Devices falling under this
So, based on the specialized functions, this have been
further categorized
  Basic I/O (GPIOs, and all that uses plain character drivers)
  Custom I/O (tty, audio, video, ..)

              © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   3
                             All Rights Reserved.
Basic I/O Management
Device Category
  Domain-specific Electronics
  Actuators, Sensors, …
  General Purpose I/O
  A2D, D2A, ...
Driver Type: Character




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   4
                        All Rights Reserved.
Bus I/O Management
Device Category: I2C, SPI, …
Driver Category: Character with Platform
Porting mostly involves
  Respective bus controller code (driver) to be
  enabled in the kernel




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   5
                        All Rights Reserved.
Custom I/O Management
Topics under Consideration
  Video
  Audio




          © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   6
                         All Rights Reserved.
Video Drivers




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   7
               All Rights Reserved.
Video Subsystem
        FB-aware applications
        Such as video players                                        Console
                                                      setterm
 UM
       X Windows          fbset
Driver
                                    User Space

                                                  Virtual Terminal   lpcons    usb_uart
                                                       Driver

                                              fbcon .. vgacon

       Common Frame Buffer API over /dev/fbX

        Frame Buffer Driver
                                   Kernel Space
                                  Hardware Space

         Video Card X                                 VGA Card       Printer   USB UART

                   © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>                      8
                                  All Rights Reserved.
FB Programming Interface
Header: <linux/fb.h>
Data Structures
  struct fb_info – Main data structure
  struct fb_ops – Entry points
  struct fb_var_screen_info – Resolution, ...
  struct fb_fix_screen_info – FB start addr, ...
  struct fb_cmap – RGB colour map
APIs
  int register_framebuffer(struct fb_info *fb_info);
  int unregister_framebuffer(struct fb_info *fb_info);
  struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
  void framebuffer_release(struct fb_info *info);
  int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
  void fb_dealloc_cmap(struct fb_cmap *cmap);
Source: drivers/video/
                   © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>    9
                                  All Rights Reserved.
struct fb_ops
fb_open – Open
fb_release – Close
fb_check_var – Check video parameters
fb_set_par – Set video controller registers
fb_setcolreg – Create pseudo colour palette map
fb_blank – Blank / Unblank display
fb_fillrect – Fill rectangle with pixel lines
fb_copyarea – Copy rectangular area between screens
fb_imageblit – Draw an image to the display
fb_rotate – Rotate the display
fb_ioctl – Ioctl interface for device specific commands
              © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   10
                             All Rights Reserved.
Console Programming Interface
Header: <linux/console.h>
Data Structures
  struct console – top-level console driver
  struct consw – bottom-level console driver
APIs
  void register_console(struct console *);
  int unregister_console(struct console *);
  int register_con_driver(const struct consw *csw, int
  first, int last);
  int unregister_con_driver(const struct consw *csw);
           © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   11
                          All Rights Reserved.
Porting a Video Driver
Standard Video Chipset
 Mostly involves changing pin assignments as
 per the Board Design
New Video Chipset
 Complete Driver as per the preceeding
 discussions, need to be implemented




       © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   12
                      All Rights Reserved.
Browse some Video Drivers
For Frame Buffer drivers
  Browse the drivers/video/ folder
For Console drivers
  Browse the drivers/video/console/ folder




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   13
                        All Rights Reserved.
Audio Drivers




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   14
               All Rights Reserved.
Audio Subsystem
   ALSA conforming Apps            User Space          OSS conforming Apps
(aplay, arecord, mplayer, ...)                         (rawplay, rawrec, ...)

        /dev/snd/pcm*,
              ...                  /proc/asound          /dev/dsp, /dev/adsp,
      /dev/snd/controlC0,        /sys/class/sound       /dev/mixer, /dev/audio
        /dev/snd/timer
                                                           OSS Emulation Layer
                                                       (snd_pcm_oss, snd_mixer_oss)
                                 Sound Core


              Audio Controller                    Audio Codec
                  Driver                            Driver
                                  Kernel Space
                                 Hardware Space
                                                                        MIC
              Audio Controller                    Audio Codec
                                                                        Speaker
                    © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>                 15
                                   All Rights Reserved.
ALSA Sound Card Interface
Header: <linux/sound/core.h>
Data Structure: struct snd_card
APIs
  int snd_card_create(int idx, const char *id,
  struct module *module, int extra_size, struct
  snd_card **card_ret);
  int snd_card_free(struct snd_card *card);
  int snd_card_register(struct snd_card *card);


         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   16
                        All Rights Reserved.
ALSA PCM Interface
Header: <linux/sound/pcm.h>
Data Structure
  struct snd_pcm
  struct snd_pcm_ops
APIs
  int snd_pcm_lib_malloc_pages(struct snd_pcm_substream
  *substream, size_t size);
  int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
  int snd_pcm_new(struct snd_card *card, const char *id, int device,
  int playback_count, int capture_count, struct snd_pcm **rpcm);
  void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct
  snd_pcm_ops *ops);


              © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>        17
                             All Rights Reserved.
ALSA Sound Card Interface
Header: <linux/sound/control.h>
Data Structure: struct snd_kcontrol_new
APIs
  int snd_ctl_add(struct snd_card * card, struct
  snd_kcontrol * kcontrol);
  int snd_ctl_remove(struct snd_card * card,
  struct snd_kcontrol * kcontrol);



         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   18
                        All Rights Reserved.
Porting a Audio Driver
Standard Audio Codec
 Mostly involves changing pin assignments as
 per the Board Design
New Audio Codec
 Complete Driver as per the preceeding
 discussions, need to be implemented




       © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   19
                      All Rights Reserved.
Browse some Audio Drivers
For ALSA drivers
  Browse the sound/ folder
  Say sound/arm/aaci.*




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   20
                        All Rights Reserved.
What all have we learnt?
Basic I/O Management Support
Advanced I/O Management
 Video Subsystem
   Frame Buffer Programming Interface
   Console Programming Interface
   Porting
 Audio Subsystem
   ALSA Programming Interface
   Porting

        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   21
                       All Rights Reserved.
Any Queries?




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   22
               All Rights Reserved.

More Related Content

What's hot (20)

Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xMIntroduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 
Linux DMA Engine
Linux DMA EngineLinux DMA Engine
Linux DMA Engine
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Audio in linux embedded
Audio in linux embeddedAudio in linux embedded
Audio in linux embedded
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Processes
ProcessesProcesses
Processes
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 
Bootloaders
BootloadersBootloaders
Bootloaders
 
Toolchain
ToolchainToolchain
Toolchain
 

Viewers also liked (18)

Architecture Porting
Architecture PortingArchitecture Porting
Architecture Porting
 
Embedded Storage Management
Embedded Storage ManagementEmbedded Storage Management
Embedded Storage Management
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Interrupts
InterruptsInterrupts
Interrupts
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
File Systems
File SystemsFile Systems
File Systems
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
Signals
SignalsSignals
Signals
 
Embedded Software Design
Embedded Software DesignEmbedded Software Design
Embedded Software Design
 
Timers
TimersTimers
Timers
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Embedded C
Embedded CEmbedded C
Embedded C
 
System Calls
System CallsSystem Calls
System Calls
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Threads
ThreadsThreads
Threads
 

Similar to Embedded I/O Management

my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 infoisky guard
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Ingria. Technopark St. Petersburg
 
Track F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicsTrack F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicschiportal
 
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesBenjamin Zores
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android晓东 杜
 
Industry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionIndustry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionAnalog Devices, Inc.
 
Movi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupMovi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupLars-Erik M Ravn
 
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeVisão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeAnderson Bassani
 
Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Developer Network
 
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformUplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformSatya Harish
 
SBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board ComputerSBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board Computeryclinda666
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PICliff Samuels Jr.
 

Similar to Embedded I/O Management (20)

my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 info
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
 
Track F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicsTrack F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonics
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
 
Choosing the right processor
Choosing the right processorChoosing the right processor
Choosing the right processor
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
Industry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionIndustry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solution
 
Movi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupMovi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetup
 
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeVisão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
 
Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform
 
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformUplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
 
SBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board ComputerSBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board Computer
 
MarcoMorenoResume
MarcoMorenoResumeMarcoMorenoResume
MarcoMorenoResume
 
Beagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009bBeagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009b
 
Resume
ResumeResume
Resume
 
Linux Audio Drivers. ALSA
Linux Audio Drivers. ALSALinux Audio Drivers. ALSA
Linux Audio Drivers. ALSA
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 

More from Anil Kumar Pugalia (12)

Processes
ProcessesProcesses
Processes
 
System Calls
System CallsSystem Calls
System Calls
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
References
ReferencesReferences
References
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
 
Power of vi
Power of viPower of vi
Power of vi
 
"make" system
"make" system"make" system
"make" system
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
 
RPM Building
RPM BuildingRPM Building
RPM Building
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
 

Recently uploaded

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Embedded I/O Management

  • 1. Embedded I/O Management © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
  • 2. What to Expect? Basic I/O Management Support Advanced I/O Management Video Subsystem Audio Subsystem © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
  • 3. I/O Management Overview Linux provides a uniform i/f to on-board I/O Devices Categorized as follows Link oriented (Network Devices) Block oriented (Storage Device) All Other (Sequential) Devices Sequential Device or Character Device category is one of the largest, with majority of Devices falling under this So, based on the specialized functions, this have been further categorized Basic I/O (GPIOs, and all that uses plain character drivers) Custom I/O (tty, audio, video, ..) © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3 All Rights Reserved.
  • 4. Basic I/O Management Device Category Domain-specific Electronics Actuators, Sensors, … General Purpose I/O A2D, D2A, ... Driver Type: Character © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4 All Rights Reserved.
  • 5. Bus I/O Management Device Category: I2C, SPI, … Driver Category: Character with Platform Porting mostly involves Respective bus controller code (driver) to be enabled in the kernel © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5 All Rights Reserved.
  • 6. Custom I/O Management Topics under Consideration Video Audio © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6 All Rights Reserved.
  • 7. Video Drivers © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7 All Rights Reserved.
  • 8. Video Subsystem FB-aware applications Such as video players Console setterm UM X Windows fbset Driver User Space Virtual Terminal lpcons usb_uart Driver fbcon .. vgacon Common Frame Buffer API over /dev/fbX Frame Buffer Driver Kernel Space Hardware Space Video Card X VGA Card Printer USB UART © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8 All Rights Reserved.
  • 9. FB Programming Interface Header: <linux/fb.h> Data Structures struct fb_info – Main data structure struct fb_ops – Entry points struct fb_var_screen_info – Resolution, ... struct fb_fix_screen_info – FB start addr, ... struct fb_cmap – RGB colour map APIs int register_framebuffer(struct fb_info *fb_info); int unregister_framebuffer(struct fb_info *fb_info); struct fb_info *framebuffer_alloc(size_t size, struct device *dev); void framebuffer_release(struct fb_info *info); int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); void fb_dealloc_cmap(struct fb_cmap *cmap); Source: drivers/video/ © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
  • 10. struct fb_ops fb_open – Open fb_release – Close fb_check_var – Check video parameters fb_set_par – Set video controller registers fb_setcolreg – Create pseudo colour palette map fb_blank – Blank / Unblank display fb_fillrect – Fill rectangle with pixel lines fb_copyarea – Copy rectangular area between screens fb_imageblit – Draw an image to the display fb_rotate – Rotate the display fb_ioctl – Ioctl interface for device specific commands © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
  • 11. Console Programming Interface Header: <linux/console.h> Data Structures struct console – top-level console driver struct consw – bottom-level console driver APIs void register_console(struct console *); int unregister_console(struct console *); int register_con_driver(const struct consw *csw, int first, int last); int unregister_con_driver(const struct consw *csw); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.
  • 12. Porting a Video Driver Standard Video Chipset Mostly involves changing pin assignments as per the Board Design New Video Chipset Complete Driver as per the preceeding discussions, need to be implemented © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 12 All Rights Reserved.
  • 13. Browse some Video Drivers For Frame Buffer drivers Browse the drivers/video/ folder For Console drivers Browse the drivers/video/console/ folder © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 13 All Rights Reserved.
  • 14. Audio Drivers © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 14 All Rights Reserved.
  • 15. Audio Subsystem ALSA conforming Apps User Space OSS conforming Apps (aplay, arecord, mplayer, ...) (rawplay, rawrec, ...) /dev/snd/pcm*, ... /proc/asound /dev/dsp, /dev/adsp, /dev/snd/controlC0, /sys/class/sound /dev/mixer, /dev/audio /dev/snd/timer OSS Emulation Layer (snd_pcm_oss, snd_mixer_oss) Sound Core Audio Controller Audio Codec Driver Driver Kernel Space Hardware Space MIC Audio Controller Audio Codec Speaker © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 15 All Rights Reserved.
  • 16. ALSA Sound Card Interface Header: <linux/sound/core.h> Data Structure: struct snd_card APIs int snd_card_create(int idx, const char *id, struct module *module, int extra_size, struct snd_card **card_ret); int snd_card_free(struct snd_card *card); int snd_card_register(struct snd_card *card); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 16 All Rights Reserved.
  • 17. ALSA PCM Interface Header: <linux/sound/pcm.h> Data Structure struct snd_pcm struct snd_pcm_ops APIs int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); int snd_pcm_new(struct snd_card *card, const char *id, int device, int playback_count, int capture_count, struct snd_pcm **rpcm); void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 17 All Rights Reserved.
  • 18. ALSA Sound Card Interface Header: <linux/sound/control.h> Data Structure: struct snd_kcontrol_new APIs int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 18 All Rights Reserved.
  • 19. Porting a Audio Driver Standard Audio Codec Mostly involves changing pin assignments as per the Board Design New Audio Codec Complete Driver as per the preceeding discussions, need to be implemented © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 19 All Rights Reserved.
  • 20. Browse some Audio Drivers For ALSA drivers Browse the sound/ folder Say sound/arm/aaci.* © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 20 All Rights Reserved.
  • 21. What all have we learnt? Basic I/O Management Support Advanced I/O Management Video Subsystem Frame Buffer Programming Interface Console Programming Interface Porting Audio Subsystem ALSA Programming Interface Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 21 All Rights Reserved.
  • 22. Any Queries? © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 22 All Rights Reserved.