proon
驱动牛犊
驱动牛犊
  • 注册日期2004-02-29
  • 最后登录2004-08-04
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1046回复:0

请教怎样在驱动中访问外部设备内存?

楼主#
更多 发布于:2004-04-29 14:30
我用的是SMDK2410,在0x28000000地址接了一个设备,访问代码如下:
    static unsigned long ADDRESS;
    ADDRESS = 0x28000000;
    Temp =inb(ADDRESS);

另外我已经成功注册了IOPORTS,为什么它报错说虚拟地址不可访问,如下:

unable to handle kernel paging request at virtual address 28000000
pgd = c21f8000
*pgd = 00000000, *pmd = 00000000
Internal error: Oops: 0
CPU: 0
pc : [<c48f0390>]    lr : [<c48f0a98>]    Not tainted
sp : c21fdec4  ip : 28000000  fp : c21fded0
r10: c21fc000  r9 : 0202ca80  r8 : c48f1054
r7 : c48f0c9c  r6 : c48f109c  r5 : c48f0cc8  r4 : 00000000
r3 : 00002801  r2 : c48f1174  r1 : 00000032  r0 : 00000001
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  Segment user
Control: C000317F  Table: 321F8000  DAC: 00000015
Process insmod (pid: 63, stackpage=c21fd000)
Stack: (0xc21fdeb4 to 0xc21fe000)
dea0:  c48f0a98 c48f0390 60000013
dec0:  ffffffff c21fdf04 c21fded4 c48f0a98 c48f0360    
       c48f0334 c21fdef4 c21fdee8
dee0:  c003d4d0 c48f0000 00000000 c2183000 00000060  
       ffffffea c21fdfa4 c21fdf08
df00:  c0024804 c48f0910 c2183000 c21fdf1c c2184000
       0000000b c2631b60 00000060
df20:  c48e0000 c48f0060 00001340 00000000 00000000
       00000000 00000000 00000000
df40:  00000000 00000000 00000000 00000000 00000000  
       00000000 00000000 00000000
df60:  00000000 00000000 00000000 00000000 00000000
       00000000 00000000 bfffd050
df80:  02028560 0202ca80 00000080 c00177c4 c21fc000
       00000000 00000000 c21fdfa8
dfa0:  c0017640 c002411c bfffd050 c001d888 0201f3b0
       0202ca80 ffffffff fbad2084
dfc0:  bfffd050 02028560 0202ca80 c48f0000 00001340
       00000000 00000000 bfffd020
dfe0:  4009eb40 bfffd010 02010064 4009eb4c 60000010  
       0201f3b0 400219b4 00000000
Backtrace:
Function entered at [<c48f0350>] from [<c48f0a98>]
Function entered at [<c48f0900>] from [<c0024804>]
 r8 = FFFFFFEA  r7 = 00000060  r6 = C2183000  r5 = 00000000
 r4 = C48F0000
Function entered at [<c002410c>] from [<c0017640>]
Code: 13a03001 e5823000 e3a0c30a e59f202c (e5dc3000)
Segmentation fault

请高手指点,多谢
游客

返回顶部