- 論壇徽章:
- 0
|
如題,我的思路是這樣:當(dāng)插入U盤后,調(diào)用shell命令掛載U盤,然后對U盤對應(yīng)的文件進(jìn)行讀寫。
源程序如下:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
char *mountusb="mount -t -vfat /dev/scsi/host0/bus0/target0/lun0/part1 /tmp/udisk";
/*char *mountusb="mount /mnt/usb";*/
printf("Now the usb flash will be mounted, please waiting...\n");
if(system(mountusb)==0)
{
printf("OK! You can use the usb flash now!\n");
system("ls /tmp/udisk");
}
else
printf("There is something wrong!\n");
return 0;
}
用arm-linux-gcc編譯通過,但下載到板子上之后運行時出現(xiàn)了:找不到denpendence file /lib/modules/2.4.18-rmk-pxal 的錯誤,我看了一下板子上的文件,在/lib目錄下卻是沒有modules這個文件夾,請各位高手幫忙解決一下,太感謝了!!
開發(fā)板是優(yōu)龍s3c2440a,linux內(nèi)核是2.4.18-rmk-pxal,裝有busybox,有mount命令。 |
|