|
|
#include<stdio.h> 4 z, l- ?1 Z) \! f7 t; r+ @' g
#include <string.h>
' K1 x* A- G1 g. f9 ~- _4 P: w#include<sysan.h>3 ]: j2 I- M2 v: V9 W& Y$ F
#include<fcntl.h>
: P9 O1 s6 F, T7 \0 V# l) g#include<errno.h>7 _. x% t1 p; W" Y0 L+ l
int main(void)5 Y1 X- Z h1 B. z% n2 F! q
{ 4 g1 }+ v* ^% t+ X
int fd;
+ V' {8 V) w& n! F0 d: f fd=open("dev/mem", 0);
( g7 S8 t" U) u3 Q8 ` printf("==(%d)==%s==",fd,strerror(errno)); 5 g! A& c1 b0 v. A& X* J
}
+ r: r! u6 `; t, a: P在OMAPL138开发板上运行时总是打印5 L0 f0 F$ F, W9 @, {! F7 g
==(-1)==No such file or directory==
) E) _; b% y& J3 U! J( T+ c* N就是说dev/mem 不存在的意思? 在dev确实存在mem呀.
! E/ L( s& c* o5 N5 z4 o, W6 a请问这是什么原因导致打开dev/mem失败呀?9 z9 [- K! O) K+ `* r- c7 x
0 n y' b' Z1 ]# N5 N5 ^2 q# i
# H% d8 H3 X; J4 w |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|