Linux Device Drivers (3rd) - Study Notes

Chapter 9/10 "Short"


# hardware interrupts and installed handlers.
cat /proc/interrupts
cat /proc/stat


Methold 1:
=======
# install modules
insmod short.ko
lsmod | grep short

# create device node
# <250> is the major NO. which output from the 1st command
cat /proc/devices | grep short
mknod /dev/short0 c 250 0
mknod /dev/short1 c 250 1
ls /dev/ | grep short

# verify
echo  -n "any string"  > /dev/short0


Methold 2:
=======
# install/remove modules by using scripts
./short_load
./short_unload


Linux space & context

In fact, in Linux, we can generalize that each processor is doing one of three things at any given moment:

  • In kernel-space, in process context, executing on behalf of a specific process

  • In kernel-space, in interrupt context, not associated with a process, handling an interrupt

  • In user-space, executing user code in a process

device driver

The software that handles or manages a hardware controller is known as a device driver.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值