drivers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
drivers [2018/02/16 17:14] – [Interrupts] admindrivers [2018/05/18 09:53] (current) – [Debugging] admin
Line 15: Line 15:
   * kmalloc is the primary allocator in the Linux kernel, for objects from 8 bytes to 128KB. The allocated area is guaranteed to be physically contiguous.   * kmalloc is the primary allocator in the Linux kernel, for objects from 8 bytes to 128KB. The allocated area is guaranteed to be physically contiguous.
   * vmalloc provides virtually contiguous memory zones that may not be physically contiguous. The resulting virtual addresses are higher than the top of physical memory. vmalloc cannot be used when the real physical address is needed, e.g. for DMA, and cannot be used at interrupt time. Allocation of large areas is possible, since physical memory fragmentation is not an issue.   * vmalloc provides virtually contiguous memory zones that may not be physically contiguous. The resulting virtual addresses are higher than the top of physical memory. vmalloc cannot be used when the real physical address is needed, e.g. for DMA, and cannot be used at interrupt time. Allocation of large areas is possible, since physical memory fragmentation is not an issue.
 +  * kzalloc
 +  * kcalloc
 +  * dma_alloc_coherent
 +  * dma_alloc_sg
 +  * contiguous memory algorithms (CMA, ION)
  
 Debugging features: Debugging features:
Line 24: Line 29:
 An issue with I/O memory accesses is memory reordering, which may require memory barriers (rmb(), wmb(), mw()). An issue with I/O memory accesses is memory reordering, which may require memory barriers (rmb(), wmb(), mw()).
  
 +===== User space memory handling =====
 User-space applications can access physical addresses directly through /dev/mem. User-space applications can access physical addresses directly through /dev/mem.
 +
 +  * Process heap (sbrk, brk)
 +  * Direct/Abstract (mmap)
 +  * Allocators (malloc, calloc, realloc, free)
 +
  
 ====== Modules ====== ====== Modules ======
Line 98: Line 109:
  
 Threaded interrupts are executed inside a thread (allows to block inside the handler). There is support for interrupt handler execution priority. Threaded interrupts are executed inside a thread (allows to block inside the handler). There is support for interrupt handler execution priority.
 +
 +UIO allows the handling from interrupt in user space.
  
 ====== Concurrency ====== ====== Concurrency ======
  
 The kernel lock validator is an useful tool to detect violations of locking rules during system life. Alternatives to locking are the use of lock-free algorithms (e.g. read copy update, RCU) or atomic operations (.e.g. atomic_set/atomic_read). The kernel lock validator is an useful tool to detect violations of locking rules during system life. Alternatives to locking are the use of lock-free algorithms (e.g. read copy update, RCU) or atomic operations (.e.g. atomic_set/atomic_read).
 +===== Semaphores =====
 ===== Mutexes ===== ===== Mutexes =====
  
Line 127: Line 141:
   * Kernel markers   * Kernel markers
   * LTTng with LTTV   * LTTng with LTTV
 +  * printk
 +  * kernel configs
 +  * debugfs/sysfs
 +  * ftrace
 +  * Kdb
 +  * Kgdb
 +  * jtag + gdb
 +  * emulation (QEmu)
  
 +Userspace:
 +  * printf
 +  * strace
 +  * ltrace
 +  * valgrind
 +  * gdb
 ====== Userspace drivers ====== ====== Userspace drivers ======
 http://2net.co.uk/slides/ew2016-userspace-drivers-slides.pdf http://2net.co.uk/slides/ew2016-userspace-drivers-slides.pdf
  
  
  • drivers.1518801274.txt.gz
  • Last modified: 8 years ago
  • by admin