IO Mapped IO
Memory Mapped IO
PCI
Kernel Modules for Keyboard and RTC
What you will learn in this course:
- Two modes of communication with hardware – IO Mapped IO and Memory Mapped IO
- Kernel Drivers/Modules for IO Mapped IO – Speaker, RTC, Keyboard
- Kernel Drivers/Modules for Memory Mapped IO – Hardware Random Generator, GPIO, UART
- Accessing IO Mapped IO and Memory Mapped IO from user space
- PCI and SMBIOS
API’s/Macros/Structures
- inb, outb, inw, outw, inl, outl
- inb_p, outb_p, inw_p, outw_p, inl_p, outl_p
- struct resource, request_region, release_region
- ioperm, iopl, geteuid
- request_mem_region, release_mem_region, ioremap, iounmap, ioread8, ioread16, ioread32, iowrite8, iowrite16, iowrite32
- ioport_map, ioport_unmap,mmap
Files:
/dev/port, /dev/mem, /proc/iomem, /proc/ioports
Commands
- hwclock
- date
- showkey
- hexdump
- strings
- dd
- lspci
- biosdecode
- dmidecode
Introduction
1
Introduction
2
Registers in Hardware devices
3
How does hardware distinguish between port IO and memory access
IO Mapped IO
1
X86 I/O ports
2
Accessing I/O Ports
3
Requesting I/O Ports
4
Linux Kernel Module Example for requesting i/o ports
5
Why read value is not same as write
6
Why all ports are not listed in /proc/ioports
7
Where to find information of processor ioports
8
Linux Kernel Module to enable the Speaker
9
Ports list
RTC
1
Introduction to RTC
2
RTC Ports and Registers Part1
3
RTC Ports and Registers Part2
4
Linux Kernel Module communicating with RTC
5
Walkthrough of rtc driver in Linux kernel
6
Hardware and software clock
7
Linux Kernel Module example to update time
Keyboard
1
Introduction to PC Keyboard
2
Scancodes
3
How to find out scancode of a key
4
Typematic
5
Reset Command
6
I/O Ports of keyboard
7
Linux Kernel Module sending keyboard controller commands
8
Linux Kernel Module Enabling and Disabling mouse
9
Linux Kernel Module Enabling and Disabling keyboard
10
Linux Kernel Module reading command byte after disabling keyboard
11
Status Register
12
Linux Kernel Module to print keys typed
13
Linux Kernel Module to turn on keyboard leds
User Space IO Access
1
Introduction
2
ioperm system call
3
Add an error message to normal user
4
What happens when you dont call ioperm and access IO Ports from userspace
5
Accessing RTC Registers from user space
6
iopl
7
Accessing RTC Registers after iopl
8
Pushing keys from user space process
9
Restart Your Computer using keyboard port
10
Restart Your Computer using Reset PCI Port
11
Enabling and Disabling speaker
12
8254 Timers and speakers
13
/dev/port
Memory Mapped IO
1
Introduction
2
Requesting IO Memory
3
Accessing IO Memory
4
Why cant we directly access IO memory
5
Linux Kernel Module example calling request mem region failed case
6
Linux Kernel Module example calling request mem region success case
7
Linux Kernel Module example calling ioremap and iounmap
8
Linux Kernel Module example writing to memory
9
Linux Kernel Module example calling ioread and iowrite
10
Hardware Random Number Generator
11
Registers in Hardware Random Number Generator
12
Ports access as IO Memory
13
Accessing memory mapped io from user space
14
CONFIG_STRICT_DEVMEM
15
devmem utility
16
Simple implementation of devmem utility in c
17
Updated code to print string
18
Configure GPIO using devmem
19
RTC on qemu arm
20
Dump BIOS data on file
21
Writing string into RAM and reading back
SMBIOS
1
Introduction
2
SMBIOS Entry Point Table
3
Parsing Entry Point Table
4
dmidecode
5
biosdecode
PCI
1
Introduction
2
PCI Address Space
3
PCI Configuration Space
4
How to access registers in PCI Configuration Space
5
lspci
6
Access configuration address space from Linux Kernel Module
7
Linux Kernel Module to print full address space
8
What happens when we try to read a device which doesnt exist
9
Base Address Registers
10
Base Address of Base Address Register
11
Find out amount of memory consumed by PCI Device
12
Introduction to PCI Express
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
Be the first to add a review.
Please, login to leave a review