programming:linux:start
Table of Contents
Linux Kernel Programming
General
Style & Documentation
RT Linux
- Linux Foundation Wiki: BROKEN-LINK:Real-Time LINUXLINK-BROKEN
- Linux Foundation Wiki: BROKEN-LINK:HOWTO setup Linux with PREEMPT_RT properlyLINK-BROKEN
- Linux Foundation Wiki: BROKEN-LINK:HOWTO build a simple RT applicationLINK-BROKEN
Drivers
- J. Corbet, A. Rubini, G. Kroah-Hartman: Linux Device Drivers (LDD3)
- P. J. Salzman, M. Burian, O. Pomerantz: The Linux Kernel Module Programming Guide
- Tariq Shureih (Intel): HOWTO: Linux Device Driver Dos and Don'ts
- Linux Kernel Documentation: Driver Model
- Linux Kernel Documentation: Building External Modules
Network
- phylink (SFP)
Code/Examples
Debug
- Embedded Linux Wiki: Debugging by printing
- Stack Overflow: Linux-kernel debug printouts?
- Linux Kernel Documentation: pr_debug()
Hints
- Use
WARN_ON()andBUG_ON()macros for run-time assertions. - Force a backtrace (programmatically) using
dump_stack(). - Use this code in a
Makefileto enablepr_debug(),dev_dbg()and friends based output in kernel ring buffer:- for a particular source file
CFLAGS_<basename>.o := -DDEBUG
- or; in whole kernel module
ccflags-y += -DDEBUG
See this Wiki page how to show such messages.
Locking
- Linux Kernel Documentation: Proper Locking Under a Preemptible Kernel
- Linux Kernel Documentation: Spin locks
- Linux Kernel Documentation: Generic Mutex Subsystem
- Linux Kernel Documentation: RT-mutex implementation design
Hints
- Suppress scheduling by use of function
preempt_disable(). - Functions
irqs_disabled()andin_interrupt()are very helpful regarding protection of non-preemptive code (see also the comments at Stack Overflow).
Memory
- Mel Gorman: Understanding the Linux Virtual Memory Manager
- Ulrich Drepper: What every programmer should know about memory
- Server Fault: How is kernel oom score calculated?
Random
- ArchWiki: Rng-tools
programming/linux/start.txt · Last modified: by Ralf Hoppe
