讯为4412使用SD卡方式运行应用程序

在UBUNTU下已经编写了一个源文件,里面内容如下:

#include<stdio.h>

int main(int argc, const char *argv[])
{
	printf("hello world!\n");

	return 0;
}

编写Makefile:

CC=/home/skyfall/qt/arm-2014.05/bin/arm-none-linux-gnueabi-gcc
OBJ=hello_world
OBJS=hello_world.c 
CFLAGS= -Wall -g 
$(OBJ):$(OBJS)
	$(CC) $(CFLAGS) $^ -o $@
$*.o:$%.c
	$(CC) $(CFLAGS) -c $< -o $@ 
.PHONY:clean
clean:
	$(RM) *.o hello_world

编译程序:make

生成了hello_world的可执行文件。将其拷贝到SD卡下,将SD卡插入到开发板上。

在/dev下查看具体的信息,以便挂载。

可以看到为mmcblk1p1,使用挂载命令将其挂载至/mnt下。

mount /dev/mmcblk1p1  /mnt

运行该文件,得到结果,整个操作过程结束。

最后,需要将其umount。

umount  -t  /dev/mmcblk1p1  /mnt

猜你喜欢

转载自blog.csdn.net/zxy131072/article/details/84675217
今日推荐