Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
/*
*
*
*
*/
#include <string.h>
#include "common.c"
int main
(int argc
,char *argv
[])
{
int res
;
int c
;
int h
;
temp_device
=bdev_scan_devices
(choose_temp_callback
);
if (temp_device
<0) {
cprintf
("can't find a filesystem to mount on /TEMP!!!\n");
return -1;
}
/* mounting 2nd msdos partition on /TEMP */
res
=mount
(temp_device
,FS_MSDOS
,"/TEMP",NULL
);
if (res
!=0) {
cprintf
("can't mount XXX on /TEMP\n");
cprintf
("errno: %i '%s'\n",errno
,strerror(errno
));
//sys_end();
return -1;
}
/*
*
*/
cprintf
("OPENING %s\n",FILENAME
);
h
=open
(FILENAME
,O_RDONLY
);
if (h
>=0) {
char buffer
[128];
int len
;
cprintf
("OPENED!\n");
cprintf
("READING...\n");
len
=read
(h
,buffer
,sizeof(buffer
));
cprintf
("READ %i bytes\n",len
);
memset(buffer
,'\0',sizeof(buffer
));
cprintf
("buffer='%s'\n",buffer
);
} else
cprintf
("FAILED!\n");
cprintf
("Press [x] to exit\n");
while ((c
= keyb_getchar
()) != 'x');
bdev_dump_status
();
sys_end
();
return 0;
}