|
#include<stdio.h> 0 n1 f2 \" H1 h
#include <string.h>
$ k- {7 R2 @$ e! p# l#include<sysan.h>
& ~1 r( a3 ]7 E& L/ o# T: J, ^#include<fcntl.h> o" w8 p4 p) A* y& e: r
#include<errno.h>
: j- h( }/ t% S) D4 yint main(void)
4 y# U& C4 B# R0 `1 j{ p0 ~/ N! E* R9 @* C, K! [
int fd;
3 W9 h9 o- s: ^( x2 \& k* e+ r fd=open("dev/mem", 0); 9 ~% @' z" x$ y4 V8 S. [
printf("==(%d)==%s==",fd,strerror(errno)); 7 Y- A- r* U0 v" @* F
}
% A) k; c( P9 n; v/ E在OMAPL138开发板上运行时总是打印
+ o7 A* m. r; f' }$ _==(-1)==No such file or directory==
( ]7 T! ^6 T: w就是说dev/mem 不存在的意思? 在dev确实存在mem呀.
. l. ~. n, z2 h/ H( |' \请问这是什么原因导致打开dev/mem失败呀?- q2 u! Q& R- V+ l9 f
, i0 ]# N }& i" A
% }# e6 m R2 ]
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|