The Linux Channel

Videos :: Linux ioctl() API interface

Written by: Kiran Kankipati - Published: 11-Oct-2017

Watch Video: 251 Linux ioctl( ) API interface - Introduction - Episode 1

* Click the image above to watch this video on Youtube ↗

net-tools (ioctl APIs - user-space side):
net-tools -
net-tools Project -
net-tools Linux Foundation Wiki -
net-tools Git source -
ifconfig.c -

Watch Video: 252 Linux ioctl( ) API interface - Kernel Examples - Episode 2

* Click the image above to watch this video on Youtube ↗

Carrier grade -
Carrier Grade Linux -
High Availability (HA) -
Redundancy(engineering) -

Kernel Source (ioctl APIs - kernel-space side):
/net/core/dev_ioctl.c -
/net/core/dev.c -
The Linux Channel video series:
Linux Kernel net_device data-structure -
Linux Kernel Networking Sub-system -
Linux Kernel /proc Interface -
Linux Kernel sk_buff data-structure - Episode-1 to Episode-10 -
Linux Kernel sk_buff data-structure - Episode-11 to Episode-18 -

Watch Video: 253 Linux ioctl API interface - Sample Code - Kernel Module - User App - Episode 3

* Click the image above to watch this video on Youtube ↗

Download this episode my entire kernel module sample code, make file, clean script HERE.

Device Drivers, Part 9: I/O Control in Linux - by Anil Kumar Pugalia <email_at_sarika-pugs_dot_com> -
The Linux Kernel Module Programming Guide - Chapter 7. Talking To Device Files -
(NOTE: Sample example source-code mentioned here will not work as it is in newer kernels. It needs porting.)

Watch Video: 254 Linux ioctl() API interface - copy_from_user() and copy_to_user() - Episode 4

* Click the image above to watch this video on Youtube ↗

/include/linux/uaccess.h - copy_from_user(), copy_to_user() -
/arch/x86/include/asm/uaccess_32.h - raw_copy_from_user(), raw_copy_to_user() [x86 32-bit]
/arch/x86/include/asm/uaccess_64.h - raw_copy_from_user(), raw_copy_to_user() [x86 64-bit]
/arch/arm/include/asm/uaccess.h - raw_copy_from_user(), raw_copy_to_user() [arm]
/arch/arm64/include/asm/uaccess.h- raw_copy_from_user(), raw_copy_to_user() [arm 64-bit]

As discussed in the video (Episode 4), we cannot use memcpy() to communicate between user-space applications (processes). Since each process has its own virtual memory space. Instead we need to use standard Linux predefined IPC (for example: sockets, message queues, pipes, signals and so on), which in turn built via APIs such as: copy_from_user() and copy_to_user().
copy_from_user() and copy_to_user()
Notice: copy_from_user() and copy_to_user() looks similar to memcpy() in terms of their function arguments.
copy_from_user() and copy_to_user() vs memcpy()
Here is the Kernel source API flow of the copy_from_user() and copy_to_user() APIs. As discussed in the video, eventually it transitions from architecture (or platform) independent code to the platform (or hardware/CPU) dependent code:
copy_from_user() and copy_to_user() Kernel Source API path

Suggested Topics:

Linux Kernel programming :: Video Episodes
 Linux Kernel FileSystems Subsystem ↗

 Linux ioctl() API interface ↗

 Linux Kernel struct iphdr data-structure ↗

 Linux Kernel TCP Congestion Control Algorithms ↗

 Linux Kernel Architecture - Generic ↗

 Linux Kernel /proc Interface ↗

 Linux Kernel dst_entry data-structure ↗

 Linux Kernel Networking Sub-system ↗

 Linux Kernel Programming - Device Drivers ↗

 Linux Kernel struct ethhdr data-structure ↗

 Linux Kernel - Containers and Namespaces ↗

 Linux Kernel Programming ↗

 Linux Kernel struct udphdr data-structure ↗

 Linux Kernel Compilation ↗

 Linux Operating System - User-space Processes ↗

 Linux Kernel Network Programming ↗

 Linux Kernel net_device data-structure ↗

 Linux Kernel struct socket and struct sock data-structure ↗

 Linux Kernel sk_buff data-structure - Episode-1 to Episode-10 ↗

 Linux Kernel sk_buff data-structure - Episode-11 to Episode-18 ↗

 Linux Kernel struct tcphdr data-structure ↗

 Linux Kernel Network Programming - struct net - struct netns_ipv4 - /proc/sys/net/ipv4 ↗


Join The Linux Channel :: Facebook Group

Join a course:

💎 Linux, Kernel and Network Software Developer: PDF Brochure
💎 Linux, Kernel, Networking and Device Drivers: PDF Brochure
💎 PhD or equivalent (or Post Doctoral) looking for assistance: Details
💎 ... or unlimited life-time mentorship: Details

💗 Help shape the future: Sponsor/Donate

Recommended Topics:
Featured Video:

* Click the image above to watch this video on Youtube ↗

Download: Linux Kernel Booting_1.pdf

Trending Video:

* Click the image above to watch this video on Youtube ↗

TUTORIALS :: UDP sample socket code for Systems and Network software developers:

Linux ioctl() API interface:

Research :: Content Delivery Networks (CDN):
CDN Networks

Recommended Video:

* Click the image above to watch this video on Youtube ↗

The TOFFEE Project - v10.20 :: Updated: 27-Feb-2019 :: © 2019 :: Author: Kiran Kankipati
Your IP: :: Browser: CCBot/2.0 (