SlideShare a Scribd company logo
1 of 19
Introduction to device management in Linux By Unnikrishnan [email_address]
Modern distributions ,[object Object],[object Object],[object Object],[object Object]
Past to present ,[object Object],[object Object],[object Object]
How they are doing this ?
Udev, HAL and Dbus ,[object Object],[object Object],[object Object],[object Object]
Udev ,[object Object],[object Object],[object Object],[object Object]
Udev ( cont .. ) ,[object Object],MODALIAS=usb:v0951p1607d0200dc00dsc00dp00ic08isc06ip50 MAJOR=8 MINOR=16
Udev ( cont... ) Kernel exports the informations to sysfs # cat /sys/block/sdb/size  7856128 # cat /sys/block/sdb/removable  1 # cat /sys/block/sdb/uevent  MAJOR=8 MINOR=16 DEVTYPE=disk #
Udev ( cont... ) Udev creates the device node using the major and minor number got from the kernel and loads the device driver using the modalias information # mknod /dev/sdc b 8 20 # ls -l /dev/sdc  brw-r--r-- 1 root root 8, 20 2009-12-20 10:35 /dev/sdc
Udev and modalias pci:v000011ABd00004363sv00001179sd0000FF10bc02sc00i00 V :- 000011AB D :- 00004363 sv and sd are subsystem version for both vendor and device. The best place to find the vendor/product from their id for a PCI device is http://www.pcidatabase.com/ .  # grep -i 11AB /lib/modules/2.6.28-11-generic/modules.alias | grep 4363 alias pci:v000011ABd00004363sv*sd*bc*sc*i* sky2
Dbus ,[object Object],[object Object],[object Object]
HAL ,[object Object],# cat /lib/udev/rules.d/90-hal.rules  RUN+="socket:@/org/freedesktop/hal/udev_event"
Working of HAL ,[object Object],[object Object],[object Object]
Device information file <deviceinfo version=&quot;0.2&quot;> <device> <match key=&quot;@storage.physical_device:info.bus&quot; string=&quot;usb&quot;> <match key=&quot;@storage.physical_device:usb.vendor_id&quot; int=&quot;0x05dc&quot;> <match key=&quot;@storage.physical_device:usb.product_id&quot; int=&quot;0x0002&quot;>   <merge key=&quot;storage.drive_type&quot; type=&quot;string&quot;>compact_flash</merge> </match> </match> </match> </device> </deviceinfo>
HAL DB The system command lshal will list the HAL DB udi = '/org/freedesktop/Hal/devices/volume_uuid_da6ed050_2beb_4a3e_b446_8eb8bb81b149' block.device = '/dev/sda5'  (string) block.is_volume = true  (bool) block.major = 8  (0x8)  (int) block.minor = 5  (0x5)  (int) block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_SATA_TOSHIBA_MK1237G_87FITJ8IT'  (string) info.capabilities = {'volume', 'block'} (string list) info.category = 'volume'  (string)
Other way to get the device info # hal-get-property --udi /org/freedesktop/Hal/devices/volume_uuid_da6ed050_2beb_4a3e_b446_8eb8bb81b149 --key volume.fstype ext4
Namespace / properties namespace properties info bus, udi, persistent, capabilities, product, vendor, parent, locked usb_device device_class, speed_bcd, serial, product, vendor, host, bus, target, lun block device, major, minor, is_volume, no_partitions volume is_mounted, mount_point, fstype, label, uuid, block_size, size, is_partition storage bus, drive_type, removable, hotpluggable, requires_eject media_check_enabled, automount_enabled_hint storage.cdrom cdr, cdrw, dvd, dvdr, ..., read_speed, write_speed storage.policy.default mount_option.*, mount_root camera access_method, libgphoto2.support
Desktop application and HAL HAL exports all the device informations to desktop application like  GNOME volume manager That helps it to mount the device to the file system.
?

More Related Content

What's hot

netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
Kernel TLV
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
hugo lu
 

What's hot (20)

Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph
 
"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越
 
TC Flower Offload
TC Flower OffloadTC Flower Offload
TC Flower Offload
 
Ceph RBD Update - June 2021
Ceph RBD Update - June 2021Ceph RBD Update - June 2021
Ceph RBD Update - June 2021
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
Practical Design Patterns in Docker Networking
Practical Design Patterns in Docker NetworkingPractical Design Patterns in Docker Networking
Practical Design Patterns in Docker Networking
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices:  A Deep DiveCeph Block Devices:  A Deep Dive
Ceph Block Devices: A Deep Dive
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
Tutorial: IPv6-only transition with demo
Tutorial: IPv6-only transition with demoTutorial: IPv6-only transition with demo
Tutorial: IPv6-only transition with demo
 
VPP事始め
VPP事始めVPP事始め
VPP事始め
 
[OpenStack 스터디] OpenStack With Contrail
[OpenStack 스터디] OpenStack With Contrail[OpenStack 스터디] OpenStack With Contrail
[OpenStack 스터디] OpenStack With Contrail
 
Enable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zunEnable DPDK and SR-IOV for containerized virtual network functions with zun
Enable DPDK and SR-IOV for containerized virtual network functions with zun
 
Introducing Scylla Cloud
Introducing Scylla CloudIntroducing Scylla Cloud
Introducing Scylla Cloud
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
 
Switchdev - No More SDK
Switchdev - No More SDKSwitchdev - No More SDK
Switchdev - No More SDK
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
 
Detailed iSCSI presentation
Detailed iSCSI presentationDetailed iSCSI presentation
Detailed iSCSI presentation
 

Viewers also liked

Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
Lihan Chen
 
Play With Android
Play With AndroidPlay With Android
Play With Android
Champ Yen
 

Viewers also liked (20)

Android Architecture
Android ArchitectureAndroid Architecture
Android Architecture
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
An Introduction to Udev (OBSOLETE)
An Introduction to Udev (OBSOLETE)An Introduction to Udev (OBSOLETE)
An Introduction to Udev (OBSOLETE)
 
Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Desktop Virtualisation
Desktop VirtualisationDesktop Virtualisation
Desktop Virtualisation
 
Aag c45 697761
Aag c45 697761Aag c45 697761
Aag c45 697761
 
High-Performance JDBC Voxxed Bucharest 2016
High-Performance JDBC Voxxed Bucharest 2016High-Performance JDBC Voxxed Bucharest 2016
High-Performance JDBC Voxxed Bucharest 2016
 
Reverse, Multi-Process and Non-Stop Debugging come to the CDT
Reverse, Multi-Process and Non-Stop Debugging come to the CDTReverse, Multi-Process and Non-Stop Debugging come to the CDT
Reverse, Multi-Process and Non-Stop Debugging come to the CDT
 
Real time debugging: using non-intrusive tracepoints to debug live systems
Real time debugging: using non-intrusive tracepoints to debug live systemsReal time debugging: using non-intrusive tracepoints to debug live systems
Real time debugging: using non-intrusive tracepoints to debug live systems
 
Working Remotely (via SSH) Rocks!
Working Remotely (via SSH) Rocks!Working Remotely (via SSH) Rocks!
Working Remotely (via SSH) Rocks!
 
Advanced Debugging with GDB
Advanced Debugging with GDBAdvanced Debugging with GDB
Advanced Debugging with GDB
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
 
Linux booting process!!
Linux booting process!!Linux booting process!!
Linux booting process!!
 
GDB Rocks!
GDB Rocks!GDB Rocks!
GDB Rocks!
 
Vim Rocks!
Vim Rocks!Vim Rocks!
Vim Rocks!
 
Play With Android
Play With AndroidPlay With Android
Play With Android
 
Linux booting Process
Linux booting ProcessLinux booting Process
Linux booting Process
 

Similar to Udev

Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android Applications
Positive Hack Days
 
outpass system
outpass systemoutpass system
outpass system
Dhivakar K
 

Similar to Udev (20)

Notes for LX0-101 Linux
Notes for LX0-101 Linux Notes for LX0-101 Linux
Notes for LX0-101 Linux
 
Windows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleWindows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sample
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry Pi
 
Android in ubuntu
Android in ubuntuAndroid in ubuntu
Android in ubuntu
 
Manish Chasta - Securing Android Applications
Manish Chasta - Securing Android ApplicationsManish Chasta - Securing Android Applications
Manish Chasta - Securing Android Applications
 
What & How to Customize Android?
What & How to Customize Android?What & How to Customize Android?
What & How to Customize Android?
 
Arduino Forensics
Arduino ForensicsArduino Forensics
Arduino Forensics
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
IoThings you don't even need to hack
IoThings you don't even need to hackIoThings you don't even need to hack
IoThings you don't even need to hack
 
outpass system
outpass systemoutpass system
outpass system
 
DeviceDriverNov18.ppt
DeviceDriverNov18.pptDeviceDriverNov18.ppt
DeviceDriverNov18.ppt
 
Deep Learning Edge
Deep Learning Edge Deep Learning Edge
Deep Learning Edge
 
Dx diag
Dx diagDx diag
Dx diag
 
Introduction of computer
Introduction of computerIntroduction of computer
Introduction of computer
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 

More from Barcamp Kerala (11)

Multi Monitor Machines
Multi Monitor MachinesMulti Monitor Machines
Multi Monitor Machines
 
The Drupal Way
The Drupal WayThe Drupal Way
The Drupal Way
 
Ltsp
LtspLtsp
Ltsp
 
Bar Camp Kerala 7
Bar Camp Kerala 7Bar Camp Kerala 7
Bar Camp Kerala 7
 
Praseed Pai
Praseed PaiPraseed Pai
Praseed Pai
 
Code Snippet
Code SnippetCode Snippet
Code Snippet
 
Blood Search
Blood SearchBlood Search
Blood Search
 
Starting Up - What they did not teach you at B-School
Starting Up - What they did not teach you at B-SchoolStarting Up - What they did not teach you at B-School
Starting Up - What they did not teach you at B-School
 
Pooling The Carpool
Pooling The CarpoolPooling The Carpool
Pooling The Carpool
 
Bar Camp 11 Oct09 Hacking
Bar Camp 11 Oct09 HackingBar Camp 11 Oct09 Hacking
Bar Camp 11 Oct09 Hacking
 
Young Kerala Technopark
Young Kerala TechnoparkYoung Kerala Technopark
Young Kerala Technopark
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Udev

  • 1. Introduction to device management in Linux By Unnikrishnan [email_address]
  • 2.
  • 3.
  • 4. How they are doing this ?
  • 5.
  • 6.
  • 7.
  • 8. Udev ( cont... ) Kernel exports the informations to sysfs # cat /sys/block/sdb/size 7856128 # cat /sys/block/sdb/removable 1 # cat /sys/block/sdb/uevent MAJOR=8 MINOR=16 DEVTYPE=disk #
  • 9. Udev ( cont... ) Udev creates the device node using the major and minor number got from the kernel and loads the device driver using the modalias information # mknod /dev/sdc b 8 20 # ls -l /dev/sdc brw-r--r-- 1 root root 8, 20 2009-12-20 10:35 /dev/sdc
  • 10. Udev and modalias pci:v000011ABd00004363sv00001179sd0000FF10bc02sc00i00 V :- 000011AB D :- 00004363 sv and sd are subsystem version for both vendor and device. The best place to find the vendor/product from their id for a PCI device is http://www.pcidatabase.com/ . # grep -i 11AB /lib/modules/2.6.28-11-generic/modules.alias | grep 4363 alias pci:v000011ABd00004363sv*sd*bc*sc*i* sky2
  • 11.
  • 12.
  • 13.
  • 14. Device information file <deviceinfo version=&quot;0.2&quot;> <device> <match key=&quot;@storage.physical_device:info.bus&quot; string=&quot;usb&quot;> <match key=&quot;@storage.physical_device:usb.vendor_id&quot; int=&quot;0x05dc&quot;> <match key=&quot;@storage.physical_device:usb.product_id&quot; int=&quot;0x0002&quot;> <merge key=&quot;storage.drive_type&quot; type=&quot;string&quot;>compact_flash</merge> </match> </match> </match> </device> </deviceinfo>
  • 15. HAL DB The system command lshal will list the HAL DB udi = '/org/freedesktop/Hal/devices/volume_uuid_da6ed050_2beb_4a3e_b446_8eb8bb81b149' block.device = '/dev/sda5' (string) block.is_volume = true (bool) block.major = 8 (0x8) (int) block.minor = 5 (0x5) (int) block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_SATA_TOSHIBA_MK1237G_87FITJ8IT' (string) info.capabilities = {'volume', 'block'} (string list) info.category = 'volume' (string)
  • 16. Other way to get the device info # hal-get-property --udi /org/freedesktop/Hal/devices/volume_uuid_da6ed050_2beb_4a3e_b446_8eb8bb81b149 --key volume.fstype ext4
  • 17. Namespace / properties namespace properties info bus, udi, persistent, capabilities, product, vendor, parent, locked usb_device device_class, speed_bcd, serial, product, vendor, host, bus, target, lun block device, major, minor, is_volume, no_partitions volume is_mounted, mount_point, fstype, label, uuid, block_size, size, is_partition storage bus, drive_type, removable, hotpluggable, requires_eject media_check_enabled, automount_enabled_hint storage.cdrom cdr, cdrw, dvd, dvdr, ..., read_speed, write_speed storage.policy.default mount_option.*, mount_root camera access_method, libgphoto2.support
  • 18. Desktop application and HAL HAL exports all the device informations to desktop application like GNOME volume manager That helps it to mount the device to the file system.
  • 19. ?