This completed downloadable of Linux Kernel Programming – Second Edition Kaiwan N. Billimoria
Instant downloaded Linux Kernel Programming – Second Edition Kaiwan N. Billimoria pdf docx epub after payment.
Product details:
- ISBN 10: 180324108X
- ISBN 13: 9781803241081
- Author: Kaiwan N. Billimoria
Gain both a firm practical understanding and sufficient theoretical insight into the inner workings of Linux kernel internals, learn to write high-quality kernel module code, understand the complexities of kernel synchronization Purchase of the print or Kindle book includes a free eBook in PDF format.
Table of contents:
Step 1 – Obtaining a Linux kernel source tree
Downloading a specific kernel tree
Cloning a Git tree
Step 2 – Extracting the kernel source tree
A brief tour of the kernel source tree
Step 3 – Configuring the Linux kernel
Minimally understanding the Kconfig/Kbuild build system
How the Kconfig+Kbuild system works – a minimal take
Arriving at a default configuration
Obtaining a good starting point for kernel configuration
Kernel config using distribution config as a starting point
Tuned kernel config via the localmodconfig approach
Kernel config for typical embedded Linux systems
Seeing all available config options
Getting going with the localmodconfig approach
Tuning our kernel configuration via the make menuconfig UI
Sample usage of the make menuconfig UI
Kernel config – exploring a bit more
Searching within the menuconfig UI
Looking up the differences in configuration
Using the kernel’s config script to view/edit the kernel config
Configuring the kernel for security
Miscellaneous tips – kernel config
Customizing the kernel menu, Kconfig, and adding our own menu item
Understanding the Kconfig* files
Creating a new menu item within the General Setup menu
A few details on the Kconfig language
Summary
Exercise
Questions
Further reading
Building the 6.x Linux Kernel from Source – Part 2
Technical requirements
Step 4 – building the kernel image and modules
Getting over a cert config issue on Ubuntu
Step 5 – installing the kernel modules
Locating the kernel modules within the kernel source
Getting the kernel modules installed
Overriding the default module installation location
Step 6 – generating the initramfs image and bootloader setup
Generating the initramfs image – under the hood
Understanding the initramfs framework
Why the initramfs framework?
Understanding the basics of the boot process on the x86
More on the initramfs framework
Peeking into the initramfs image
Step 7 – customizing the GRUB bootloader
Customizing GRUB – the basics
Selecting the default kernel to boot into
Booting our VM via the GNU GRUB bootloader
Experimenting with the GRUB prompt
Verifying our new kernel’s configuration
Kernel build for the Raspberry Pi
Step 1 – cloning the Raspberry Pi kernel source tree
Step 2 – installing an x86_64-to-AArch64 cross-toolchain
Step 3 – configuring and building the Raspberry Pi AArch64 kernel
Miscellaneous tips on the kernel build
Minimum version requirements
Building a kernel for another site
Watching the kernel build run
A shortcut shell syntax to the build procedure
Dealing with missing OpenSSL development headers
How can I check which distro kernels are installed?
Summary
Questions
Further reading
Writing Your First Kernel Module – Part 1
Technical requirements
Understanding the kernel architecture – part 1
User space and kernel space
Library and system call APIs
Kernel space components
Exploring LKMs
The LKM framework
Kernel modules within the kernel source tree
Writing our very first kernel module
Introducing our Hello, world LKM C code
Breaking it down
Kernel headers
Module macros
Entry and exit points
Return values
Common operations on kernel modules
Building the kernel module
Running the kernel module
A quick first look at the kernel printk()
Listing the live kernel modules
Unloading the module from kernel memory
Our lkm convenience script
Understanding kernel logging and printk
Using the kernel memory ring buffer
Kernel logging and systemd’s journalctl
Using printk log levels
The pr_<foo> convenience macros
Writing to the console
Writing output to the Raspberry Pi console
Turning on debug-level kernel messages
Rate limiting the printk instances
Rate-limiting macros to use
Generating kernel messages from user space
Standardizing printk output via the pr_fmt macro
Portability and the printk format specifiers
Understanding the new printk indexing feature
Understanding the basics of a kernel module Makefile
Summary
Questions
Further reading
Writing Your First Kernel Module – Part 2
Technical requirements
A “better” Makefile template for your kernel modules
Configuring a “debug” kernel
Cross-compiling a kernel module
Setting up the system for cross-compilation
Attempt 1 – setting the ARCH and CROSS_COMPILE environment variables
Attempt 2 – pointing the Makefile to the correct kernel source tree for the target
Attempt 3 – cross-compiling our kernel module
Examining Linux kernel ABI compatibility issues
Attempt 4 – cross-compiling our kernel module
Summarizing what went wrong with the module cross-buildd/load and how it was fixed
Gathering minimal system information
Being a bit more security-aware
Licensing kernel modules
Licensing of inline kernel code
Licensing of out-of-tree kernel modules
Emulating “library-like” features for kernel modules
Performing library emulation via linking multiple source files
Understanding function and variable scope in a kernel module
Understanding module stacking
Trying out module stacking
Emulating ‘library-like’ features – summary and conclusions
Passing parameters to a kernel module
Declaring and using module parameters
Getting/setting module parameters after insertion
Learning module parameter data types and validation
Validating kernel module parameters
Overriding the module parameter’s name
Hardware-related kernel parameters
Floating point not allowed in the kernel
Forcing FP in the kernel
Auto-loading modules on system boot
Module auto-loading – additional details
Kernel modules and security – an overview
Proc filesystem tunables affecting the system log
A quick word on the dmesg_restrict sysctl
A quick word on the kptr_restrict sysctl
Understanding the cryptographic signing of kernel modules
The two module-signing modes
Disabling kernel modules altogether
The kernel lockdown LSM – an introduction
Coding style guidelines for kernel developers
Contributing to the mainline kernel
Getting started with contributing to the kernel
Summary
Questions
Further reading
Kernel Internals Essentials – Processes and Threads
Technical requirements
Understanding process and interrupt contexts
Understanding the basics of the process Virtual Address Space (VAS)
Organizing processes, threads, and their stacks – user and kernel space
Running a small script to see the number of processes and threads alive
User space organization
Kernel space organization
Summarizing the kernel with respect to threads, task structures, and stacks
Viewing the user and kernel stacks
Traditional approach to viewing the stacks
eBPF – the modern approach to viewing both stacks
The 10,000-foot view of the process VAS
Understanding and accessing the kernel task structure
Looking into the task structure
Accessing the task structure with current
Determining the context
Working with the task structure via ‘current’
Built-in kernel helper methods and optimizations
Trying out the kernel module to print process context info
Seeing that the Linux OS is monolithic
Coding for security with printk
Iterating over the kernel’s task lists
Iterating over the task list I – displaying all processes
Iterating over the task list II – displaying all threads
Differentiating between the process and thread – the TGID and the PID
Iterating over the task list III – the code
Summary
Questions
Further reading
Memory Management Internals – Essentials
Technical requirements
Understanding the VM split
Looking under the hood – the Hello, world C program
Going beyond the printf() API
Virtual addressing and address translation
VM split on 64-bit Linux systems
Common VM splits
Understanding the process VAS – the full view
Examining the process VAS
Examining the user VAS in detail
Directly viewing the process memory map using procfs
Frontends to view the process memory map
Understanding VMA basics
Examining the kernel VAS
High memory on 32-bit systems
Writing a kernel module to show information about the kernel VAS
Macros and variables describing the kernel VAS layout
Trying it out – viewing kernel VAS details
The kernel VAS via procmap
Trying it out – the user segment
Viewing kernel documentation on the memory layout
Randomizing the memory layout – KASLR
User memory randomization with ASLR
Kernel memory layout randomization with KASLR
Querying/setting KASLR status with a script
Understanding physical memory organization
Physical RAM organization
Nodes and NUMA
Zones within a node
Direct-mapped RAM and address translation
An introduction to physical memory models
Understanding the sparsemem[-vmemmap] memory model in brief
Summary
Questions
Further reading
Kernel Memory Allocation for Module Authors – Part 1
Technical requirements
Introducing kernel memory allocators
Understanding and using the kernel page allocator (or BSA)
The fundamental workings of the page allocator
Understanding the organization of the page allocator freelist
The workings of the page allocator
Working through a few scenarios
Page allocator internals – a few more details
Learning how to use the page allocator APIs
Dealing with the GFP flags
Freeing pages with the page allocator
A few guidelines to observe when (de)allocating kernel memory
Writing a kernel module to demo using the page allocator APIs
Deploying our lowlevel_mem_lkm kernel module
The page allocator and internal fragmentation (wastage)
The GFP flags – digging deeper
Never sleep in interrupt or atomic contexts
Page allocator – pros and cons
Understanding and using the kernel slab allocator
The object caching idea
A few FAQs regarding (slab) memory usage and their answers
Learning how to use the slab allocator APIs
Allocating slab memory
Freeing slab memory
Data structures – a few design tips
The actual slab caches in use for kmalloc
Writing a kernel module to use the basic slab APIs
Size limitations of the kmalloc API
Testing the limits – memory allocation with a single call
Checking via the /proc/buddyinfo pseudofile
Slab allocator – a few additional details
Using the kernel’s resource-managed memory allocation APIs
Additional slab helper APIs
Control groups and memory
Caveats when using the slab allocator
Background details and conclusions
Testing slab allocation with ksize() – case 1
Testing slab allocation with ksize() – case 2
Interpreting the output from case 2
Graphing it
Finding internal fragmentation (wastage) within the kernel
The easy way with slabinfo
More details with alloc_traces and a custom script
Slab layer – pros and cons
Slab layer – a word on its implementations within the kernel
Summary
People also search:
linux kernel programming guide
linux kernel programming interview questions
linux kernel programming and introduction to yocto project
linux kernel programming – second edition
linux kernel programming amazon