|
#include<stdio.h>
; y* i8 `3 Q& G4 G7 r#include <string.h>" } W* w, \/ c2 K/ Q! @9 x7 F6 M
#include<sysan.h>; J7 s( J+ z& \! P2 g1 ~( e
#include<fcntl.h>
2 }( F5 O, b `: I" d" S: s9 G0 U#include<errno.h>/ m) ~" u+ i5 l f
int main(void)- x. J8 d6 z. H! M/ k2 |
{ , S2 X2 Z5 h: i$ ~
int fd;0 C! b, `1 Y: Z& J
fd=open("dev/mem", 0);
- e% h3 ]3 y" S( z8 Y. D# b! `1 z printf("==(%d)==%s==",fd,strerror(errno));
5 d! @0 z" N3 r6 w" U}7 ]* |) h% W4 M" v6 E
在OMAPL138开发板上运行时总是打印7 U/ p7 f7 r& n4 h2 J
==(-1)==No such file or directory==4 G# j3 U+ k) p
就是说dev/mem 不存在的意思? 在dev确实存在mem呀.6 {5 l) V# `# Z3 ?& Y. _* O
请问这是什么原因导致打开dev/mem失败呀?+ F4 j' s/ T8 p# Y7 L
W, b/ e# m! N
0 O5 y: P$ b+ T: C! y$ s3 R# p
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|