Enviar búsqueda
Cargar
Block Drivers
•
5 recomendaciones
•
38,998 vistas
Anil Kumar Pugalia
Seguir
Tecnología
Vista de diapositivas
Denunciar
Compartir
Vista de diapositivas
Denunciar
Compartir
1 de 21
Recomendados
USB Drivers
USB Drivers
Anil Kumar Pugalia
U-Boot Porting on New Hardware
U-Boot Porting on New Hardware
RuggedBoardGroup
Bootloaders (U-Boot)
Bootloaders (U-Boot)
Omkar Rane
Introduction to Linux Drivers
Introduction to Linux Drivers
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
Linux Porting
Linux Porting
Anil Kumar Pugalia
U-Boot presentation 2013
U-Boot presentation 2013
Wave Digitech
SPI Drivers
SPI Drivers
SysPlay eLearning Academy for You
Recomendados
USB Drivers
USB Drivers
Anil Kumar Pugalia
U-Boot Porting on New Hardware
U-Boot Porting on New Hardware
RuggedBoardGroup
Bootloaders (U-Boot)
Bootloaders (U-Boot)
Omkar Rane
Introduction to Linux Drivers
Introduction to Linux Drivers
Anil Kumar Pugalia
Network Drivers
Network Drivers
Anil Kumar Pugalia
Linux Porting
Linux Porting
Anil Kumar Pugalia
U-Boot presentation 2013
U-Boot presentation 2013
Wave Digitech
SPI Drivers
SPI Drivers
SysPlay eLearning Academy for You
Bootloaders
Bootloaders
Anil Kumar Pugalia
PCI Drivers
PCI Drivers
Anil Kumar Pugalia
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
Emertxe Information Technologies Pvt Ltd
U-Boot - An universal bootloader
U-Boot - An universal bootloader
Emertxe Information Technologies Pvt Ltd
Introduction Linux Device Drivers
Introduction Linux Device Drivers
NEEVEE Technologies
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
Embedded_Linux_Booting
Embedded_Linux_Booting
Rashila Rr
Linux Initialization Process (2)
Linux Initialization Process (2)
shimosawa
U boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
Linux Kernel Overview
Linux Kernel Overview
Anil Kumar Pugalia
Linux Kernel Image
Linux Kernel Image
艾鍗科技
Uboot startup sequence
Uboot startup sequence
Houcheng Lin
Video Drivers
Video Drivers
Anil Kumar Pugalia
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
Macpaul Lin
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
Emertxe Information Technologies Pvt Ltd
Linux booting procedure
Linux booting procedure
Dhaval Kaneria
File System Modules
File System Modules
Anil Kumar Pugalia
References
References
Anil Kumar Pugalia
Más contenido relacionado
La actualidad más candente
Bootloaders
Bootloaders
Anil Kumar Pugalia
PCI Drivers
PCI Drivers
Anil Kumar Pugalia
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
Emertxe Information Technologies Pvt Ltd
U-Boot - An universal bootloader
U-Boot - An universal bootloader
Emertxe Information Technologies Pvt Ltd
Introduction Linux Device Drivers
Introduction Linux Device Drivers
NEEVEE Technologies
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
I2C Drivers
I2C Drivers
SysPlay eLearning Academy for You
Embedded_Linux_Booting
Embedded_Linux_Booting
Rashila Rr
Linux Initialization Process (2)
Linux Initialization Process (2)
shimosawa
U boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
Linux Kernel Overview
Linux Kernel Overview
Anil Kumar Pugalia
Linux Kernel Image
Linux Kernel Image
艾鍗科技
Uboot startup sequence
Uboot startup sequence
Houcheng Lin
Video Drivers
Video Drivers
Anil Kumar Pugalia
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
Macpaul Lin
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
Emertxe Information Technologies Pvt Ltd
Linux booting procedure
Linux booting procedure
Dhaval Kaneria
La actualidad más candente
(20)
Bootloaders
Bootloaders
PCI Drivers
PCI Drivers
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
U-Boot - An universal bootloader
U-Boot - An universal bootloader
Introduction Linux Device Drivers
Introduction Linux Device Drivers
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
I2C Drivers
I2C Drivers
Embedded_Linux_Booting
Embedded_Linux_Booting
Linux Initialization Process (2)
Linux Initialization Process (2)
U boot porting guide for SoC
U boot porting guide for SoC
Arm device tree and linux device drivers
Arm device tree and linux device drivers
Linux Kernel Overview
Linux Kernel Overview
Linux Kernel Image
Linux Kernel Image
Uboot startup sequence
Uboot startup sequence
Video Drivers
Video Drivers
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
Linux booting procedure
Linux booting procedure
Destacado
File System Modules
File System Modules
Anil Kumar Pugalia
References
References
Anil Kumar Pugalia
Interrupts
Interrupts
Anil Kumar Pugalia
Serial Drivers
Serial Drivers
SysPlay eLearning Academy for You
Embedded C
Embedded C
Anil Kumar Pugalia
gcc and friends
gcc and friends
Anil Kumar Pugalia
Platform Drivers
Platform Drivers
SysPlay eLearning Academy for You
Character Drivers
Character Drivers
Anil Kumar Pugalia
Kernel Programming
Kernel Programming
Anil Kumar Pugalia
Low-level Accesses
Low-level Accesses
Anil Kumar Pugalia
Audio Drivers
Audio Drivers
Anil Kumar Pugalia
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
BeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
SysPlay eLearning Academy for You
File Systems
File Systems
Anil Kumar Pugalia
Destacado
(14)
File System Modules
File System Modules
References
References
Interrupts
Interrupts
Serial Drivers
Serial Drivers
Embedded C
Embedded C
gcc and friends
gcc and friends
Platform Drivers
Platform Drivers
Character Drivers
Character Drivers
Kernel Programming
Kernel Programming
Low-level Accesses
Low-level Accesses
Audio Drivers
Audio Drivers
BeagleBone Black Bootloaders
BeagleBone Black Bootloaders
BeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
File Systems
File Systems
Similar a Block Drivers
File System Modules
File System Modules
Anil Kumar Pugalia
Linux File System
Linux File System
Anil Kumar Pugalia
Introduction to Linux
Introduction to Linux
Anil Kumar Pugalia
Introduction to Linux
Introduction to Linux
Anil Kumar Pugalia
BeagleBone Black Booting Process
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
Linux IO
Linux IO
Liran Ben Haim
Linux Memory Management
Linux Memory Management
Anil Kumar Pugalia
Let Me Pick Your Brain - Remote Forensics in Hardened Environments
Let Me Pick Your Brain - Remote Forensics in Hardened Environments
Nicolas Collery
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
Acácio Oliveira
TLPI Chapter 14 File Systems
TLPI Chapter 14 File Systems
Shu-Yu Fu
2.1 design hard disk layout v2
2.1 design hard disk layout v2
Acácio Oliveira
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
Moabi.com
Linux Network Management
Linux Network Management
Anil Kumar Pugalia
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
SysPlay eLearning Academy for You
Linux
Linux
keydak11
Hardware backdooring is practical : slides
Hardware backdooring is practical : slides
Moabi.com
Shell Scripting
Shell Scripting
Anil Kumar Pugalia
Bootkits: Past, Present & Future - Virus Bulletin
Bootkits: Past, Present & Future - Virus Bulletin
ESET
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
Character drivers
Character drivers
pradeep_tewani
Similar a Block Drivers
(20)
File System Modules
File System Modules
Linux File System
Linux File System
Introduction to Linux
Introduction to Linux
Introduction to Linux
Introduction to Linux
BeagleBone Black Booting Process
BeagleBone Black Booting Process
Linux IO
Linux IO
Linux Memory Management
Linux Memory Management
Let Me Pick Your Brain - Remote Forensics in Hardened Environments
Let Me Pick Your Brain - Remote Forensics in Hardened Environments
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
TLPI Chapter 14 File Systems
TLPI Chapter 14 File Systems
2.1 design hard disk layout v2
2.1 design hard disk layout v2
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
Linux Network Management
Linux Network Management
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
Linux
Linux
Hardware backdooring is practical : slides
Hardware backdooring is practical : slides
Shell Scripting
Shell Scripting
Bootkits: Past, Present & Future - Virus Bulletin
Bootkits: Past, Present & Future - Virus Bulletin
Kernel Debugging & Profiling
Kernel Debugging & Profiling
Character drivers
Character drivers
Más de Anil Kumar Pugalia
Processes
Processes
Anil Kumar Pugalia
System Calls
System Calls
Anil Kumar Pugalia
Embedded Software Design
Embedded Software Design
Anil Kumar Pugalia
Playing with R L C Circuits
Playing with R L C Circuits
Anil Kumar Pugalia
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Anil Kumar Pugalia
Functional Programming with LISP
Functional Programming with LISP
Anil Kumar Pugalia
Power of vi
Power of vi
Anil Kumar Pugalia
"make" system
"make" system
Anil Kumar Pugalia
Hardware Design for Software Hackers
Hardware Design for Software Hackers
Anil Kumar Pugalia
RPM Building
RPM Building
Anil Kumar Pugalia
Linux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
Anil Kumar Pugalia
System Calls
System Calls
Anil Kumar Pugalia
Timers
Timers
Anil Kumar Pugalia
Threads
Threads
Anil Kumar Pugalia
Synchronization
Synchronization
Anil Kumar Pugalia
Processes
Processes
Anil Kumar Pugalia
Signals
Signals
Anil Kumar Pugalia
Inter Process Communication
Inter Process Communication
Anil Kumar Pugalia
Más de Anil Kumar Pugalia
(18)
Processes
Processes
System Calls
System Calls
Embedded Software Design
Embedded Software Design
Playing with R L C Circuits
Playing with R L C Circuits
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
Functional Programming with LISP
Functional Programming with LISP
Power of vi
Power of vi
"make" system
"make" system
Hardware Design for Software Hackers
Hardware Design for Software Hackers
RPM Building
RPM Building
Linux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
System Calls
System Calls
Timers
Timers
Threads
Threads
Synchronization
Synchronization
Processes
Processes
Signals
Signals
Inter Process Communication
Inter Process Communication
Último
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Zilliz
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Product Anonymous
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Architecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Orbitshub
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
sammart93
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
Sandro Moreira
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Zilliz
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Khushali Kathiriya
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
MIND CTI
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Dropbox
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Jeffrey Haguewood
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
jfdjdjcjdnsjd
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
debabhi2
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
The Digital Insurer
Último
(20)
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Architecting Cloud Native Applications
Architecting Cloud Native Applications
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
presentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
Block Drivers
1.
© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Block Drivers
2.
2© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? Why the need for the Block Layer? Decoding a Block Device in Linux Role of Block Drivers Writing a Block Driver
3.
3© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Block vs Character Concept Similarities Device Registration Usage of Device Files Major & Minor number File Operations Then, why a different category? To access block-oriented devices (Really?) To achieve buffering for efficiency To enable a generic caching abstraction To provide a device independent block access of data
4.
4© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. System-wide Block Devices Category is to Major IDE: 3; SCSI: 8; ... Naming Convention (Try: ls -l /dev/sd*) IDE: hd*; SCSI: sd*; ... Disk is to Minor Typically limited to 4 per system, represented using a, b, ... Partition also is to Minor 256 / 4 = 64 to each disk First one for the whole disk, e.g. hda Remaining for the partitions, thus limiting to 63, e.g. hda1
5.
5© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Generic Hard Disk Disk or Platter Tracks Sectors
6.
6© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. The Generic Hard Disk . . . . . . Spindle Heads Cylinder
7.
7© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Computing a Generic Hard Disk Example (Hard Disk) Heads (or Platters): 0 – 9 Tracks (or Cylinders): 0 – 24 Sectors: 1 – 64 Size of the Hard Disk 10 x 25 x 64 x 512 bytes = 8000KiB Device independent numbering (h, t, s) → 64 * (10 * t + h) + s → (1 - 16000)
8.
8© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Partitioning Visualization 2 3 4 5 7 86 N-5 N-4 N-3 N-2 N-1 N Linearized sector numbers 1MBR MBR P1 P2 P4P3ExtBR BR BR BR ExtL1 RemLBR L2 RemL3LBR L4LBR LnLBR Boot Code Partition Table Sec. Boot Code Logical Part. Table BRLBR
9.
9© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Partitioning a Block Device First Sector – Master Boot Record (MBR) Contains Boot Info Contains Physical Partition Table Maximum Physical Partitions: 4 At max 1 as Extended Partition Rest as Primary Partition Extended could be further partitioned into Logical Partitions In each partition First Sector – Boot Record (BR) Remaining for File System / Format Extended Partition BR contains the Logical Partition Table
10.
10© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Block Input / Output Virtual File System (VFS) Layer Block Driver Individual Filesystems (ext3, vfat, ...) Buffer Cache (Page Cache) I/O Schedulers Block Driver User Space Storage Space Kernel Space CD Drive ...... Disk File I/O Request Queue Request Queue ......
11.
11© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Now, let's write a Driver to Achieve the Purpose
12.
12© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Block Registration Driver Registration Header: <linux/fs.h> APIs int register_blkdev(major, name); int unregister_blkdev(major, name); Disk Drive Registration Header: <linux/genhd.h> Data Structure: struct gendisk *gd APIs struct gendisk *alloc_disk(minors); void put_disk(gd); void add_disk(gd); void del_gendisk(gd);
13.
13© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. struct gendisk int major int first_minor int minors char disk_name[32] struct block_device_operations *fops struct request_queue *queue int flags (GENHD_FL_REMOVABLE, ...) sector_t nr_sects → struct hd_struct part0 void *private_data
14.
14© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. struct hd_struct sector_t start_sect sector_t nr_sects sector_t alignment_offset ...
15.
15© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Block Device Operations Header: <linux/blkdev.h> System Calls (till <= 2.6.27) int open(struct inode *i, struct file *f); int close(struct inode *i, struct file *f); int ioctl(struct inode *i, struct file *f, cmd, arg); int media_changed(struct gendisk *gd); int revalidate_disk(struct gendisk *gd); ... Other Important Fields struct module *owner;
16.
16© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Block Device Operations Header: <linux/blkdev.h> System Calls (after 2.6.27) int (*open)(struct block_device *, fmode_t); int (*release)(struct block_device *, fmode_t); int (*ioctl)(struct block_device *, fmode_t, cmd, arg); int (*media_changed)(struct gendisk *gd); int (*revalidate_disk)(struct gendisk *gd); int (*getgeo)(struct block_device *, struct hd_geometry *); ... Other Important Fields struct module *owner;
17.
17© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Request Queues & Processing Header: <linux/blkdev.h> Types request_queue_t *q; request_fn_proc rqf; struct request *req; APIs q = blk_init_queue(rqf, lock); blk_cleanup_queue(q); req = blk_fetch_request(q);
18.
18© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Requests Interfaces rq_data_dir(req) – Operation type zero: read from device non-zero: write to the device blk_req_pos(req) – Starting sector blk_req_sectors(req) – Total sectors Iterator for extracting buffers from bio_vec Request Function typedef void (*request_fn_proc)(request_queue_t *queue);
19.
19© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Disk on RAM Let's try out the RAM Block Driver Horizontal: Disk on RAM ram_device.c, ram_device.h Vertical: Block Driver ram_block.c Useful commands blockdev dd fdisk
20.
20© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. What all have we learnt? Understood the need for the Block Layer Decoding a Block Device in Linux Role of Block Drivers Writing a Block Driver Registration Block Device Operations Request & Request Queues
21.
21© 2010-16 SysPlay
Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?