zoukankan      html  css  js  c++  java
  • 搭建S3C6410开发板的测试环境

    环境配置:

    Window7 32-bit OS + VMware Workstation 6.5 + Ubuntu9.10

    FORLINX OK6410A开发板

    嵌入式Linux驱动开发环境的搭建

    1.       安装arm-linux-gcc交叉编译器,并设置环境变量

    2.       将飞凌提供的FORLINX_linux-3.0.1.tar.gz拷贝到/usr/src,解压并进入linux-3.0.1目录

    3.       执行以下命令:#make oldconfig; #make prepare; 这两个命令用来测试交叉编译器和驱动开发需要的源文件包是否能正常使用,可能会出现提示arm-linux-gcc找不到的情况,这是因为步骤1中交叉编译器没有配置好。另外,可以修改顶层Makefile文件中的CROSS_COMPILE来设置交叉编译器,然后执行#make scripts/使能新的交叉编译器。

    嵌入式Linux驱动开发环境的测试

    最好的方法莫过于用HelloWorld实例来测试一下。

    //hello.c

    #include

    #include

    MODULE_LICENSE("Dual BSD/GPL");

    static int __init s3c6410_hello_init(void)

    {

     printk(KERN_EMERG "Hello World! This is the sample driver of S3C6410! ");

     return 0;

    }

    static void __exit s3c6410_hello_exit(void)

    {

     printk(KERN_EMERG "Hello World exit! ");

    }

    module_init(s3c6410_hello_init);

    module_exit(s3c6410_hello_exit);

    //Makefile

    obj-m:=hello.o

    KERNELDIR?=/usr/src/linux-3.0.1

    default:

             $(MAKE) -C $(KERNELDIR) M=$(shell pwd) modules

    clean:

             rm -rf *.o *~ *.ko *.mod.c *.order *.symvers

  • 相关阅读:
    数学+高精度 ZOJ 2313 Chinese Girls' Amusement
    最短路(Bellman_Ford) POJ 1860 Currency Exchange
    贪心 Gym 100502E Opening Ceremony
    概率 Gym 100502D Dice Game
    判断 Gym 100502K Train Passengers
    BFS POJ 3278 Catch That Cow
    DFS POJ 2362 Square
    DFS ZOJ 1002/HDOJ 1045 Fire Net
    组合数学(全排列)+DFS CSU 1563 Lexicography
    stack UVA 442 Matrix Chain Multiplication
  • 原文地址:https://www.cnblogs.com/jingjing521/p/5551459.html
Copyright © 2011-2022 走看看