
























User space and Kernel space
Unix transfers execution from user space to kernel space whenever an application
or is suspended by a hardware interrupt. Kernel code executing
a system call is
— it operates
on behalf of. Code
that handles interrupts, on the other hand, is asynchronous with respect to processes
and is
.
Concurrency in the Kernel
(1)kernel code must be
source of concurrency in kernel - device interrupt , mutiple process , several sortware abstract layer in kernel(such as timer)."
that mean if you modify some global date , you must first lock then modify? and "protect your static code when other call your driver interface."one common mistake was to assume concurrence not a problem as segment code does not go to sleep.
"2.6 and 2.4 big different here",mean 2.4 will not be preempted by other until timer(scheduler?) or be blocked(access resource?)
Compiling and Loading
MODULE to define a modue
__KERNEL__ preprocessor to include some data struct which defined in kernel include file
inline vs -O
link -r =>relocable
Use Resources
memory can be obtained by kmalloc and release by kfree.
i/o memory ,port,interrupt has a role - to use it must first to require in order to ensure it was not used by elsewhere.
I/O Port and I/O Memory
proc/ioport,iomem
(x86 has seperate io/mem space ,while arm has a unify)
x86 - io-mapped, risc like arm m68k powerpc - io-mapped check_region is available to arm and other system?此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。