arm9 编写linux驱动,11.5 ARM9的linux驱动接口--linux设备驱动程序笔记--嵌入式linux中文站...

在SBC2440嵌入式平台上,用户成功加载了IO_port和IO_mem两个内核模块,并通过cat /proc/devices查看到模块已注册为字符设备。接着创建了相应的设备节点/dev/IO_port和/dev/IO_mem,并运行测试程序进行交互,展示了模块的ioctl功能。
摘要由CSDN通过智能技术生成

[Tekkaman2440@SBC2440V4]#cd/lib/modules/[Tekkaman2440@SBC2440V4]#insmod IO_port.ko[Tekkaman2440@SBC2440V4]#insmod IO_mem.ko[Tekkaman2440@SBC2440V4]#cat/proc/devicesCharacter devices:1 mem2 pty3 ttyp4/dev/vc/04 tty4 ttyS5/dev/tty5/dev/console5/dev/ptmx7 vcs10 misc13 input14 sound81 video4linux89 i2c90 mtd116 alsa128 ptm136

pts153 spi180 usb189 usb_device204 s3c2410_serial251 IO_mem252 IO_port253 usb_endpoint254 rtcBlock devices:1 ramdisk256 rfd7 loop31 mtdblock93 nftl96 inftl179 mmc[Tekkaman2440@SBC2440V4]#mknod-m 666/dev/IO_port c 252 0[Tekkaman2440@SBC2440V4]#mknod-m 666/dev/IO_mem c 251 0[Tekkaman2440@SBC2440V4]#cd/tmp/[Tekkaman2440@SBC2440V4]#./IO_mem_testio_addr:c485e0d0IO_mem:the module cannotlseek!please input the command:1IO_mem:ioctl 1 ok!please input the command:8IO_mem:ioctl STATUS ok!current_status=0X1please input the command:3IO_mem:ioctl 3 ok!please input the command:q[Tekkaman2440@SBC2440V4]#./IO_porttest_sleep&[Tekkaman2440@SBC2440V4]#./IO_porttest_sleep&[Tekkaman2440@SBC2440V4]#./IO_porttest_sleep&[Tekkaman2440@SBC2440V4]#./IO_port_testIO_port:the module cannotlseek!please input the command:1IO_port:ioctl 1 ok!please input the command:8IO_port:ioctl STATUS ok!current_status=0X1please input the command:3IO_port:ioctl 3 ok!please input the command:8IO_port:ioctl STATUS ok!current_status=0X3please input the command:q[1]Done./IO_porttest_sleep[Tekkaman2440@SBC2440V4]#psPID Uid VSZ Stat Command1 root 1744 S init2 root SW

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值