• 第一步 移植Uboot ti AM335x 官方wiki: ... http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide(官方文档仅供参考,与实际编译有出入,总体内容丰富,涵盖了所有启动方法的介绍,请...

    第一步 移植Uboot

    ti  AM335x 官方wiki:    http://processors.wiki.ti.com/index.php/Category:AM335x

    http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide(官方文档仅供参考,与实际编译有出入,总体内容丰富,涵盖了所有启动方法的介绍,请详细阅读)。

    在AM335x中,ROM代码充当引导加载程序,有时称为初始程序加载程序(IPL)或主程序加载程序(PPL)。通过U-Boot二进制文件在两个连续的阶段完成booting。第一阶段U-BOOT的二进制被称为二级程序装入程序(SPL)或MLO。第二U-BooD阶段的二进制被简单地称为U-BooD。SPL是非交互式加载器,是U-BooD的一种特殊版本。它是在构建U-BooT时并发构建的。

    ROM代码可以从以下任何设备加载SPL图像

    交叉编译工具链下载地址:https://releases.linaro.org/components/toolchain/gcc-linaro/5.2-2015.11/(编译uboot提示版本低)

                                                  https://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabihf/(换成7.2.1即可)

    具体编译方法参考这个博客:https://blog.csdn.net/zy812248258/article/details/39252733

    首先 (http://software-dl.ti.com/processor-sdk-linux/esd/AM335X/latest/index_FDS.html    重要网址)

    下载TI官方文件,地址如下:http://www.ti.com/tool/beaglebk#technicaldocuments 选择:PROCESSOR-SDK-LINUX-AM335X :Linux Processor SDK for AM335x    选择get software 进入 http://software-dl.ti.com/processor-sdk-linux/esd/AM335X/latest/index_FDS.html  下载

    am335x-evm-linux-sdk-src-05.01.00.11.tar.xz

    step1:在进行任何操作之前,先清除源码树,$make distclean

    step2:编译之前的配置工作  $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 O=am335x_beaglebone_black am335x_boneblack_defconfig

    step3: 正式编译 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 O=am335x_beaglebone_black all

    以上编译的是uboot

     

    第二步 移植内核(方法A-C还未走通)

    方法X:

                  参考借鉴了这位兄弟的方法:https://blog.csdn.net/zy812248258/article/details/39253989 

                  编译方法见:http://processors.wiki.ti.com/index.php?oldid=149205#Getting_the_Code

    我实现的步骤为如下:

            一、到kernel.org下载linux-4.9内核

            二、下载gcc-linaro-5.2-2015.11-x86_64_arm-linux-gnueabihf.tar 交叉编译器并修改环境变量

           三、 在http://software-dl.ti.com/processor-sdk-linux/esd/AM335X/latest/index_FDS.html 下载am335x-evm-sdk-src-06.00.00.00.tar,将内核源码中arch/arm/configs中的tisdk_am335x-evm_defconfig(一说:bb.org_defconfig)拷贝到linux-4.9内核arch/arm/configs的目录中

           四、执行命令 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig 生成 .config文件

           五、执行make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage 生成 zImage 文件

    生成设备树

           六:执行命令:make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x-boneblack.dtb (注:由于粗心没有输入ARCH=arm 导致编译出错)

          七:执行命令:make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules 产生模块

    方法A:

    https://elinux.org/Building_BBB_Kernel#Downloading_and_building_the_Linux_Kernel

    方法B:

    打开beaglebone官网

    在 Other currently available software images 标题下找到如下内容:

    At the time of release, not all of these distributions support BeagleBone Black, but should soon.

    在网页底部找到

    For Debian images for boards other than BeagleBone, check out http://elinux.org/BeagleBoardDebian.字样

           然后由https://elinux.org/BeagleBoardDebian中的第9项找到Building Kernel 链接选择BeagleBone Black进入

    https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black网页

    未走通

    方法C:

    打开beagle bone 官网,在 Other currently available software images 标题下找到如下内容

    At the time of release, not all of these distributions support BeagleBone Black, but should soon.

    http://processors.wiki.ti.com/index.php?oldid=149205#Compiling_the_Kernel

     

    从uboot 通过tftp 服务器 下载zImage 到0x82000000

    => tftp 0x82000000 zImage
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    => 
    link up on port 0, speed 100, full duplex
    *** ERROR: `serverip' not set
    => setenv serverip 192.168.1.100
    => 
    => printenv serverip                                                                                             
    serverip=192.168.1.100
    => 
    serverip=192.168.1.100
    => tftp 0x82000000 zImage       
    link up on port 0, speed 100, full duplex
    *** ERROR: `ipaddr' not set
    => 
    link up on port 0, speed 100, full duplex
    *** ERROR: `ipaddr' not set
    => setenv ipaddr 192.168.1.102  
    => 
    => printenv ipaddr            
    ipaddr=192.168.1.102
    => 
    ipaddr=192.168.1.102
    => tftp 0x82000000 zImage     
    link up on port 0, speed 100, full duplex
    Using cpsw device
    TFTP from server 192.168.1.100; our IP address is 192.168.1.102
    Filename 'zImage'.
    Load address: 0x82000000
    Loading: #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             #################################################################
             ########################################
             760.7 KiB/s
    done
    Bytes transferred = 3531712 (35e3c0 hex)
    => 

    展开全文
  • 获取内核源码及工具 源码链接: https://github.com/raspberrypi/linux 工具链接: https://github.com/raspberrypi/tools patch链接: https://www.kernel.org/pub/linux/kernel/projects/rt/ 源码在git上...

    获取内核源码及工具

    源码链接:

    https://github.com/raspberrypi/linux

    工具链接:

    https://github.com/raspberrypi/tools

    patch链接:

    https://www.kernel.org/pub/linux/kernel/projects/rt/

     

    源码在git上的master的版本是4.9,可直接复制git的链接

    git clone https://github.com/raspberrypi/linux.git

    如果想下载其他版本的内核,比如想下载5.1.y版本内核,则使用如下方式

    git clone -b rpi-5.1.y https://github.com/raspberrypi/linux.git

    tools工具则是一些交叉编译所使用的编译器

    git clone https://github.com/raspberrypi/tools.git

    下载patch,要下载和你将要编译的内核版本一致的patch。

    以上是使用git下载,在国内的下载速度是比较慢的。如果想高速下载,可以使用迅雷。方法是复制浏览器顶部链接,复制到迅雷进行搜索

    然后下载压缩版本,我在迅雷里的下载速度达到了3m,速度还可以。

    下载完成后全部解压。

     

    打patch

    我们对Linux内核添加补丁,这个过程就是打patch。将上面下载的patch压缩版解压到对应的内核文件夹下,并执行

    cat *.patch | patch p1

     

    配置交叉编译环境

    这个要用到我们下载的tools。使用git方式下载的文件夹名为tools;下载压缩包版本直接解压的文件夹名为tool-master。我们以tools为命名来讲解。

    ubuntu系统位数查看

    $ getconf LONG_BIT
    64

    如果你的ubuntu系统位数为32位,执行

    echo PATH=\$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin >> ~/.bashrc
    source ~/.bashrc

    如果是64位,执行

    echo PATH=\$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin >> ~/.bashrc
    source ~/.bashrc

    ​​​​并且64位系统也要安装32位的编译器的支持​​​​​​​

    sudo apt-get install lib32stdc++6
    sudo apt-get install libc6:i386
    sudo apt-get install lib32z1

    进入Linux源码目录,进行交叉编译的配置​​​​​​​

    KERNEL=kernel7
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig

     

    编译

    进入Linux源码目录,执行

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs

    或者你的处理器有多个线程,可以使用-jn来加速编译

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs -j4

    这个过程应该要持续几十分钟,取决于电脑运行速度。喝杯茶等一下吧~
     

    部署到SD卡

    首先将插入装有系统的内存卡读卡器,并在虚拟机内挂载。

    查看分区在/dev下的名称

    lsblk

    sdc1是boot分区,sdc2是rootfs分区。

    接下来进行挂载。首先在/mnt下创建两个文件夹​​​​​​​

    sudo mkdir /mnt/fat32
    sudo mkdir /mnt/ext4

    然后将sdc1和sdc2分别挂载在fat32和ext4​​​​​​​

    sudo mount /dev/sdc1 /mnt/fat32
    sudo mount /dev/sdc2 /mnt/ext4

    首先安装内核模块到/mnt/ext4,定位到内核源码文件夹下,执行

    sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=/mnt/ext4 modules_install

    接下来的操作都是对boot分区进行,也就是/mnt/fat32

    备份原本的内核,本次调试发现,kernel7.img是树莓派所使用的内核,所以我们对树莓派的kernel7.img进行备份

    mv kernel7.img kernel7-pre.img

    将内核源码中的zImage重命名为kernel7.img(所在位置:linux-rpi-4.9.y/arch/arm/boot)

    mv zImage kernel7.img

    或者使用tools下的工具进行类型转换​​​​​​​

    cd tools/mkimage
    ./imagetool-uncompressed.py ~/linux-rpi-4.9.y/arch/arm/boot/zImage

    这样生成的名称为kernel.img,将他重命名为kernel7.img

    mv kernel.img kernel7.img

    **********************************************

    如果出现python编译的错

    /usr/bin/env python\r no such file or directory

    则是由于windows下编写的python代码不符合Linux下的规范,使用以下方式进行转码

    sudo apt-get install dos2unix

    dos2unix <filename>

    **********************************************

    将生成的kernel复制到/mnt/fat32下​​​​​​​

    sudo cp ~/linux-rpi-4.9.y/arch/arm/boot/kernel7.img /mnt/fat32
    或者
    sudo cp ~/tools/mkimage/kernel7.img /mnt/fat32

    复制.dts文件和README文件​​​​​​​

    sudo cp ~/linux-rpi-4.9.y/arch/arm/boot/dts/*.dtb /mnt/fat32
    sudo cp ~/linux-rpi-4.9.yarch/arm/boot/dts/overlays/README /mnt/fat32/overlays

    至此树莓派内核更新完成,插入到树莓派中试一试

     

    展开全文
  • X4412开发板移植Linux内核4.9.123版本 基本移植 1、源码下载 官网下载linux4.9.123内核:https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/。   2、解压并配置 xz -d linux-4.9.123.tar.xz tar -...

    X4412开发板移植Linux内核4.9.123版本


    基本移植

    1、源码下载

    官网下载linux4.9.123内核:https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/。

     

    2、解压并配置

    xz -d linux-4.9.123.tar.xz

    tar -xvf linux-4.9.123.tar

    使用命令cd linux-4.9.123进入源码根目录, 然后vi Makefile 打开顶层的Makefile进行如下修改:

    修改:

    ARCH  ?= $(SUBARCH)

    CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)

    为:

    ARCH  ?= arm

    CROSS_COMPILE ?= arm-linux-gnueabi-     /*根据实际使用的toolchain修改*/

    注意:

    • 在VI命令下,可以使用/ CROSS_COMPILE 搜索并快速定位
    • 如果不修改编译工具链,默认将使用编译x86的gcc编译器,此时make编译需要指定架构和工具链前缀,如:
      make uImage ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

    3、导入的exynos的默认配置

    make exynos_defconfig

    实际上是执行了:cp arch/arm/configs/exynos_defconfig .config

    4、配置内核

    make menuconfig

    修改指定内核的调试串口:

    Kernel hacking

        --> Kernel low-level debugging functions (read help!)  选择

            --> Kernel low-level debugging port (Use Samsung S3C UART 2 for low-level debug)  打开选择uart2

    选择这个调试串口很重要,否则打印不出内核启动的相关信息(exynos默认没有打开此功能,没有打开此处会发现内核打印信息停止在Starting kernel …处)

    5、编译内核和设备树

    一、编译uImage镜像:

    make uImage LOADADDR=0x40008000

    注意:

    LOADADDR=0X40008000表示指定内核的加载地址(如果没有添加该选项编译会出错) 

    二、编译设备树:

    在编译设备树之前需要对设备树进行配置,由于x4412和参考板origen类似,所以一般都是参考origen进行x4412的配置。

    的设备树文件。

    cp arch/arm/boot/dts/exynos4412-origen.dts  arch/arm/boot/dts/exynos4412-x4412.dts

    修改arch/arm/boot/dts/下的Makefile文件:

    make dtbs

    6、移植网卡

    增加DM9000网卡的设备树节点信息: vi arch/arm/boot/dts/exynos4412-x4412.dts 

    srom-cs1@7000000 {

            compatible = "simple-bus";

            #address-cells = <1>;

            #size-cells = <1>;

            reg = <0x7000000 0x1000000>;

            ranges;

            ethernet@7000000 {

                    compatible = "davicom,dm9000";

                    reg = <0x7000000 0x2 0x7000004 0x2>;

                    interrupt-parent = <&gpx2>;

                    interrupts = <5 4>;

                    davicom,no-eeprom;

                    mac-address = [00 0a 2d a6 55 a2];

            };

    };

    添加外部中断pin配置,vi arch/arm/boot/dts/exynos4x12-pinctrl.dtsi。添加如下节点

    eint21: ext-int21 {

                                samsung,pins = "gpx2-5";

                                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;

                                samsung,pin-pud = <EXYNOS_PIN_PULL_NON22E>;

                                samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;

                       };

     

    注意:

    DM9000 网卡驱动正常都是一样的,移植时主要是更改pin配置和base addr,这个需要根据实际硬件电路修改.通过查询x4412电路图已经DM9000的trm,可知base addr是0x7000000.而pin使用的是gpx2-5,外部中断号eint21,所以还需要修改gedit arch/arm/boot/dts/exynos4x12-pinctrl.dtsi,添加eint21的初始化。(功能需要选择wakeup,也就是功能2).完成后按照手册的方法修改interrupt-parent = <&gpx2>;#xeint31是gpx2_5   
    interrupts = <5 4>;#中断偏移是5,  4代表高电平触发

     

    内核配置:

    // 网络协议配置

    [*] Networking support --->

    Networking options --->

    <*> Packet socket

    <*> Unix domain sockets

    [*] TCP/IP networking

    [*] IP: kernel level autoconfiguration

     

    // 网卡驱动的配置

    Device Drivers --->

    [*] Network device support --->

    [*] Ethernet driver support (NEW) --->

    <*> DM9000 support

     

    // NFS服务和根文件系统配置

    File systems --->

    [*] Network File Systems (NEW) --->

    <*> NFS client support

    [*] NFS client support for NFS version 3

    [*] NFS client support for the NFSv3 ACL protocol extension

    [*] Root file system on NFS

    重新编译内核和设备树即可。

    最后为了能正常启动linux需要配置uboot环境变量,这边使用的变量如下:

    fatload mmc 0:1 42000000 linux4.9/exynos4412-x4412.dtb
    fatload mmc 0:1 41000000 linux4.9/uImage
    setenv bootargs root=/dev/mmcblk0p2 rw rootfstype=ext4 console=ttySAC2,115200
    bootm 41000000 - 42000000

    展开全文
  • 交叉编译linux驱动程序

    1,获取源码odroid开发板内核源码(已经打了preempt_rt-3.14.79-rt84实时补丁),并编译内核和驱动模块,并安装驱动模块:

          $cd ~/odroid_c2

          $git clone https://github.com/moonlinux/linux.git  -b odroidc2-3.14.y-rt

          $cd ./linux

          $make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image -j4

          $make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules -j4

          $make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- modules_install INSTALL_MOD_PATH=~/odroid_c2/modules

    (编译器下载地址:https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/aarch64-linux-gnu/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz)

    2,编译驱动:

       $make  ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-  -j4


    3,源码

    驱动源码:

    /* simple kernel module:hello.c

     *
     * Copyright (C) 2014 Barry Song (baohua@kernel.org)
     *
     * Licensed under GPLv2 or later.
     */

    #include <linux/init.h>
    #include <linux/module.h>

    static int __init hello_init(void)
    {
      printk(KERN_INFO "Hello World enter\n");
      return 0;
    }
    module_init(hello_init);

    static void __exit hello_exit(void)
    {
      printk(KERN_INFO "Hello World exit\n");
    }
    module_exit(hello_exit);

    MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
    MODULE_LICENSE("GPL v2");
    MODULE_DESCRIPTION("A simple Hello World Module");
    MODULE_ALIAS("a simplest module");

    -----------------------

    Makefile文件:

    #for Amlogic S905-build commond line :
    #or: make  ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-  -j4

    obj-m := hello.o
    KDIR := /home/bruce/odroid_c2/modules/lib/modules/3.14.79-rt84+/build
    KBUILD_CFLAGS +=  -march=armv8-a -mtune=cortex-a53
    MAKE := make
    build: kernel_modules
    kernel_modules:
            ${MAKE} -C $(KDIR) M=$(PWD) modules

    .PHONY: clean
    clean:
            ${MAKE} -C $(KDIR) M=$(PWD) clean

    展开全文
  • 内核源码的github地址 现在之后进入到目录之中 编译之前的准备工作:安装一些软件 sudo apt-get install qemu libncurses5-dev gcc-arm-linux-gnueabi build-essential gdb-arm-none-eabi gcc-aarch64-linux-...

    内核源码的github地址

    现在之后进入到目录之中

    编译之前的准备工作:安装一些软件

    sudo apt-get install qemu libncurses5-dev gcc-arm-linux-gnueabi build-essential gdb-arm-none-eabi gcc-aarch64-linux-gnu

    然后配置编译选项

    adog@E531:runninglinuxkernel_4.0$ export ARCH=arm  //参数位arm表示编译的是arm32的linux内核,参数为arm64代表编译的是arm64位的linux内核
    adog@E531:runninglinuxkernel_4.0$ export CROSS_COMPILE=arm-none-eabi-  //指定交叉编译工具链:使用ubuntu默认的编译工具链
    adog@E531:runninglinuxkernel_4.0$ make vexpress_defconfig   //编译内核的时候需要指定一个硬件的板子,这里指定使用arm公司的vexpress的开发板

    arm-none-eabi-的意思是-后面可以匹配上的所有的命令,如arm-node-eabi-gcc、arm-none-eabi-g++等等

    然后创建设备结点。最小的文件系统,运行起来需要创建一个设备结点:(之前已经创建好了,这里只是演示)

    使用make menuconfig命令查看内核的配置菜单,这里只进行查看,不进行更改。

    接下来进行编译,使用命令make bzImage -j4  对内核进行编译   //4代表的是编译的时候使用4个cpu核心

    但是报错如下:

    adog@E531:runninglinuxkernel_4.0$ make bzImage -j4
      CHK     include/config/kernel.release
      CHK     include/generated/uapi/linux/version.h
      CHK     include/generated/utsrelease.h
      CC      scripts/mod/devicetable-offsets.s
    In file included from include/linux/compiler.h:54:0,
                     from include/uapi/linux/stddef.h:1,
                     from include/linux/stddef.h:4,
                     from ./include/uapi/linux/posix_types.h:4,
                     from include/uapi/linux/types.h:13,
                     from include/linux/types.h:5,
                     from include/linux/mod_devicetable.h:11,
                     from scripts/mod/devicetable-offsets.c:2:
    include/linux/compiler-gcc.h:107:30: fatal error: linux/compiler-gcc6.h: No such file or directory
     #include gcc_header(__GNUC__)
    

    经过在网上查找信息得知,是因为使用的交叉编译的工具不合适,可能是版本太高了,所以换一个版本低一些的交叉编译的工具。交叉编译指的是在一个平台上编译出能够运行在另外一个平台上的程序。如在linux平台上编译出在windows平台上运行的程序。

    tar.xz格式的压缩包的解压缩需要两个步骤:第一步获取*.tar文件,第二步解压*.tar文件

    第一步:xz -d *.tar.xz    命令实现将*.tar.xz 格式的文件解压为 *.tar格式的文件

    第二步:tar -xvf *.tar    命令实现对*.tar格式的文件进行解压

    然后可以进入到bin目录:

    然后为刚刚下载的交叉编译工具链配置环境变量,之所以叫做工具链,说明会用到很多工具,如上图,用红色矩形框围起来的是这些工具的公共前缀。这是使用的前提条件。

    编辑家目录的隐藏文件 .bashrc

    在文件的底部添加两行信息:

    然后 source ~/.bashrc 即可

    既然新的交叉编译工具链设置好了,那么还需要在编译选项中重新指明使用的交叉编译工具链:

    然后,就进入编译阶段

    几分钟之后,编译完成:

    如上图,生成了一个内核的Image,即zImage

    启动的话,还需要一个dtb文件,现在生成它:

    adog@E531:runninglinuxkernel_4.0$ make dtbs
      CHK     include/config/kernel.release
      CHK     include/generated/uapi/linux/version.h
      CHK     include/generated/utsrelease.h
    make[1]: “include/generated/mach-types.h”已是最新。
      CALL    scripts/checksyscalls.sh
      DTC     arch/arm/boot/dts/vexpress-v2p-ca5s.dtb
      DTC     arch/arm/boot/dts/vexpress-v2p-ca9.dtb
      DTC     arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dtb
      DTC     arch/arm/boot/dts/vexpress-v2p-ca15_a7.dtb
    adog@E531:runninglinuxkernel_4.0$ 
    

    然后,使用命令启动内核:

    adog@E531:runninglinuxkernel_4.0$ qemu-system-arm -nographic -M vexpress-a9 -m 1024M -kernel arch/arm/boot/zImage -append "rdinit=/linuxrc console=ttyAMA0 loglevel=8" -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb

    可以看到打印出来的启动信息:

    pulseaudio: set_sink_input_volume() failed
    pulseaudio: Reason: Invalid argument
    pulseaudio: set_sink_input_mute() failed
    pulseaudio: Reason: Invalid argument
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Initializing cgroup subsys cpuset
    [    0.000000] Linux version 4.0.0+ (adog@E531) (gcc version 4.9.4 20151028 (prerelease) (Linaro GCC 4.9-2016.02) ) #1 SMP Tue Jul 9 21:36:15 CST 2019
    [    0.000000] CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
    [    0.000000] Machine model: V2P-CA9
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] On node 0 totalpages: 262144
    [    0.000000] free_area_init_node: node 0, pgdat c10e9f40, node_mem_map eeffa000
    [    0.000000]   Normal zone: 1520 pages used for memmap
    [    0.000000]   Normal zone: 0 pages reserved
    [    0.000000]   Normal zone: 194560 pages, LIFO batch:31
    [    0.000000]   HighMem zone: 67584 pages, LIFO batch:15
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] PERCPU: Embedded 11 pages/cpu @eefbd000 s16064 r8192 d20800 u45056
    [    0.000000] pcpu-alloc: s16064 r8192 d20800 u45056 alloc=11*4096
    [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260624
    [    0.000000] Kernel command line: rdinit=/linuxrc console=ttyAMA0 loglevel=8
    [    0.000000] log_buf_len individual max cpu contribution: 4096 bytes
    [    0.000000] log_buf_len total cpu_extra contributions: 12288 bytes
    [    0.000000] log_buf_len min size: 16384 bytes
    [    0.000000] log_buf_len: 32768 bytes
    [    0.000000] early log buf free: 14884(90%)
    [    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Memory: 1021736K/1048576K available (11532K kernel code, 237K rwdata, 1820K rodata, 3716K init, 189K bss, 26840K reserved, 0K cma-reserved, 270336K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    [    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0d124a4   (13354 kB)
    [    0.000000]       .init : 0xc0d13000 - 0xc10b4000   (3716 kB)
    [    0.000000]       .data : 0xc10b4000 - 0xc10ef708   ( 238 kB)
    [    0.000000]        .bss : 0xc10ef708 - 0xc111edd0   ( 190 kB)
    [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
    [    0.000000] Hierarchical RCU implementation.
    [    0.000000] 	Additional per-CPU info printed with stalls.
    [    0.000000] 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
    [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000000] GIC CPU mask not found - kernel will fail to boot.
    [    0.000000] GIC CPU mask not found - kernel will fail to boot.
    [    0.000000] L2C: platform modifies aux control register: 0x02020000 -> 0x02420000
    [    0.000000] L2C: device tree omits to specify unified cache
    [    0.000000] L2C: DT/platform modifies aux control register: 0x02020000 -> 0x02420000
    [    0.000000] L2C-310 enabling early BRESP for Cortex-A9
    [    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
    [    0.000000] L2C-310 dynamic clock gating disabled, standby mode disabled
    [    0.000000] L2C-310 cache controller enabled, 8 ways, 128 kB
    [    0.000000] L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x46420001
    [    0.000409] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
    [    0.020233] Console: colour dummy device 80x30
    [    0.020638] kmemleak: Kernel memory leak detector disabled
    [    0.028339] Calibrating delay loop... 634.88 BogoMIPS (lpj=3174400)
    [    0.201170] pid_max: default: 32768 minimum: 301
    [    0.205782] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.205869] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.245960] CPU: Testing write buffer coherency: ok
    [    0.265272] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
    [    0.267389] Setting up static identity map for 0x60b14670 - 0x60b146c8
    [    0.324067] Brought up 1 CPUs
    [    0.324273] SMP: Total of 1 processors activated (634.88 BogoMIPS).
    [    0.324396] CPU: All CPU(s) started in SVC mode.
    [    0.347924] devtmpfs: initialized
    [    0.382248] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
    [    0.823790] NET: Registered protocol family 16
    [    0.832101] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    1.097835] cpuidle: using governor ladder
    [    1.098317] cpuidle: using governor menu
    [    1.132327] of_amba_device_create(): amba_device_add() failed (-19) for /memory-controller@100e0000
    [    1.134206] of_amba_device_create(): amba_device_add() failed (-19) for /memory-controller@100e1000
    [    1.135592] of_amba_device_create(): amba_device_add() failed (-19) for /watchdog@100e5000
    [    1.204276] of_amba_device_create(): amba_device_add() failed (-19) for /smb/motherboard/iofpga@7,00000000/sysctl@01000
    [    1.256169] of_amba_device_create(): amba_device_add() failed (-19) for /smb/motherboard/iofpga@7,00000000/wdt@0f000
    [    1.312954] No ATAGs?
    [    1.313307] hw-breakpoint: debug architecture 0x4 unsupported.
    [    1.313817] Serial: AMBA PL011 UART driver
    [    1.320845] 10009000.uart: ttyAMA0 at MMIO 0x10009000 (irq = 38, base_baud = 0) is a PL011 rev1
    [    1.356318] console [ttyAMA0] enabled
    [    1.501407] 1000a000.uart: ttyAMA1 at MMIO 0x1000a000 (irq = 39, base_baud = 0) is a PL011 rev1
    [    1.519958] 1000b000.uart: ttyAMA2 at MMIO 0x1000b000 (irq = 40, base_baud = 0) is a PL011 rev1
    [    1.544359] 1000c000.uart: ttyAMA3 at MMIO 0x1000c000 (irq = 41, base_baud = 0) is a PL011 rev1
    [    2.342889] SCSI subsystem initialized
    [    2.364498] libata version 3.00 loaded.
    [    2.383414] usbcore: registered new interface driver usbfs
    [    2.387315] usbcore: registered new interface driver hub
    [    2.390445] usbcore: registered new device driver usb
    [    2.445015] Advanced Linux Sound Architecture Driver Initialized.
    [    2.564834] Switched to clocksource arm,sp804
    [    3.988045] NET: Registered protocol family 2
    [    4.010157] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [    4.011197] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
    [    4.012267] TCP: Hash tables configured (established 8192 bind 8192)
    [    4.016130] TCP: reno registered
    [    4.016673] UDP hash table entries: 512 (order: 2, 16384 bytes)
    [    4.017425] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
    [    4.025188] NET: Registered protocol family 1
    [    4.047403] RPC: Registered named UNIX socket transport module.
    [    4.048028] RPC: Registered udp transport module.
    [    4.048434] RPC: Registered tcp transport module.
    [    4.049561] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    5.443128] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 1 counters available
    [    5.500245] futex hash table entries: 1024 (order: 4, 65536 bytes)
    [    7.580826] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    7.732179] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
    [    7.884616] 9p: Installing v9fs 9p2000 file system support
    [    8.112376] bounce: pool size: 64 pages
    [    8.113057] io scheduler noop registered (default)
    [    8.125596] clcd-pl11x 10020000.clcd: PL111 rev2 at 0x10020000
    [    8.140347] clcd-pl11x 10020000.clcd: /clcd@10020000 hardware, 1024x768@59 display
    [    8.252218] Console: switching to colour frame buffer device 128x48
    [    8.277084] clcd-pl11x 1001f000.clcd: PL111 rev2 at 0x1001f000
    [    8.279516] clcd-pl11x 1001f000.clcd: /smb/motherboard/iofpga@7,00000000/clcd@1f000 hardware, 640x480@59 display
    [    8.825319] 40000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
    [    8.827079] Intel/Sharp Extended Query Table at 0x0031
    [    8.828428] Using buffer write method
    [    8.829812] erase region 0: offset=0x0,size=0x40000,blocks=256
    [    8.833742] 40000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
    [    8.834965] Intel/Sharp Extended Query Table at 0x0031
    [    8.835929] Using buffer write method
    [    8.836484] erase region 0: offset=0x0,size=0x40000,blocks=256
    [    8.837082] Concatenating MTD devices:
    [    8.837454] (0): "40000000.flash"
    [    8.837725] (1): "40000000.flash"
    [    8.837983] into device "40000000.flash"
    [    9.112860] libphy: smsc911x-mdio: probed
    [    9.190701] smsc911x 4e000000.ethernet eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=4e000000.etherne:01, irq=-1)
    [    9.196985] smsc911x 4e000000.ethernet eth0: MAC Address: 52:54:00:12:34:56
    [    9.359781] isp1760 4f000000.usb: bus width: 32, oc: digital
    [    9.363073] isp1760 4f000000.usb: NXP ISP1760 USB Host Controller
    [    9.364284] isp1760 4f000000.usb: new USB bus registered, assigned bus number 1
    [    9.366694] isp1760 4f000000.usb: Scratch test failed.
    [    9.367443] isp1760 4f000000.usb: can't setup: -19
    [    9.369329] isp1760 4f000000.usb: USB bus 1 deregistered
    [    9.393403] usbcore: registered new interface driver usb-storage
    [    9.443959] mousedev: PS/2 mouse device common for all mice
    [    9.487885] rtc-pl031 10017000.rtc: rtc core: registered pl031 as rtc0
    [    9.548449] Driver 'mmcblk' needs updating - please use bus_type methods
    [    9.555282] mmci-pl18x 10005000.mmci: Got CD GPIO
    [    9.556001] mmci-pl18x 10005000.mmci: Got WP GPIO
    [    9.561071] mmci-pl18x 10005000.mmci: No vqmmc regulator found
    [    9.566689] mmci-pl18x 10005000.mmci: mmc0: PL181 manf 41 rev0 at 0x10005000 irq 34,35 (pio)
    [    9.596164] input: AT Raw Set 2 keyboard as /devices/platform/smb/smb:motherboard/smb:motherboard:iofpga@7,00000000/10006000.kmi/serio0/input/input0
    [    9.714163] ledtrig-cpu: registered to indicate activity on CPUs
    [    9.790647] usbcore: registered new interface driver usbhid
    [    9.791123] usbhid: USB HID core driver
    [   10.041422] aaci-pl041 10004000.aaci: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 33
    [   10.042068] aaci-pl041 10004000.aaci: FIFO 512 entries
    [   10.052109] oprofile: using arm/armv7-ca9
    [   10.056818] TCP: cubic registered
    [   10.057409] NET: Registered protocol family 17
    [   10.060460] 9pnet: Installing 9P2000 support
    [   10.064342] Registering SWP/SWPB emulation handler
    [   10.174801] rtc-pl031 10017000.rtc: setting system clock to 2019-07-09 14:40:01 UTC (1562683201)
    [   10.201050] ALSA device list:
    [   10.201434]   #0: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 33
    [   10.262758] Freeing unused kernel memory: 3716K (c0d13000 - c10b4000)
    [   10.282369] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/smb/smb:motherboard/smb:motherboard:iofpga@7,00000000/10007000.kmi/serio1/input/input2
    [   12.027667] 9pnet_virtio: no channels available
    mount: mounting kmod_mount on /mnt failed: No such file or directory
    
    Please press Enter to activate this console. 
    / # 
    

    查看Cpu信息和memory信息

    / # cat /proc/cpuinfo
    processor	: 0
    model name	: ARMv7 Processor rev 0 (v7l)
    BogoMIPS	: 634.88
    Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpd32 
    CPU implementer	: 0x41
    CPU architecture: 7
    CPU variant	: 0x0
    CPU part	: 0xc09
    CPU revision	: 0
    
    Hardware	: ARM-Versatile Express
    Revision	: 0000
    Serial		: 0000000000000000
    / # 
    / # cat /proc/meminfo
    MemTotal:        1025452 kB
    MemFree:         1002212 kB
    MemAvailable:     999192 kB
    Buffers:               0 kB
    Cached:             6384 kB
    SwapCached:            0 kB
    Active:             2228 kB
    Inactive:           4260 kB
    Active(anon):       2228 kB
    Inactive(anon):     4260 kB
    Active(file):          0 kB
    Inactive(file):        0 kB
    Unevictable:           0 kB
    Mlocked:               0 kB
    HighTotal:        270336 kB
    HighFree:         263376 kB
    LowTotal:         755116 kB
    LowFree:          738836 kB
    SwapTotal:             0 kB
    SwapFree:              0 kB
    Dirty:                 0 kB
    Writeback:             0 kB
    AnonPages:           104 kB
    Mapped:             1300 kB
    Shmem:              6384 kB
    Slab:              11436 kB
    SReclaimable:       4016 kB
    SUnreclaim:         7420 kB
    KernelStack:         672 kB
    PageTables:           24 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:      512724 kB
    Committed_AS:       7392 kB
    VmallocTotal:     245760 kB
    VmallocUsed:      174892 kB
    VmallocChunk:      16380 kB
    CmaTotal:              0 kB
    CmaFree:               0 kB
    / # 
    

    qemu+gdb调试内核

    进行调试,只要在启动的时候在后面加上 -S -s即可开启调试模式

    qemu-system-arm -nographic -M vexpress-a9 -m 1024M -kernel arch/arm/boot/zImage -append "rdinit=/linuxrc console=ttyAMA0 loglevel=8" -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb -S -s

    然后打开另一个terminal,使用命令armeb-eabi-gdb --tui vmlinux进入到调试界面

    adog@E531:runninglinuxkernel_4.0$ armeb-eabi-gdb --tui vmlinux
    

    qemu和gdb使用的是tcp/ip进行通信的,需要指明端口号:

    设置断点

    并continue

     

    展开全文
  • 支持uvc摄像头的内核,已经交叉编译好的镜像文件,直接使用
  • 目前的技巧就是在linux中正常地编译一个内核模块和Makefile,正常使用之后,寻找一下具体执行的命令进行分解: (步骤大概是通用的,也许路径不一样) 1.进入了/usr/src/linux-headers-3.4.9-rtai-686-pae/Makefile ...
  •  为了搭建交叉编译环境,查了很多的方法,有自己搭建的(高手),有的用cross-ng工具的等等,最后查到了buildroot这个工具,最后为啥选择这个工具的原因是buildroot不仅能搭建交叉编译环境,而且还能编译内核,根文件...
  • 上一篇讲了在jetson平台上编译内核,本篇讲在x86 PC上编译 这里提一点,我并不建议你用虚拟机来搞Linux开发,你的host...配置交叉编译环境 请查看第10篇博文 玩转NVIDIA Jetson AGX Xavier(10)— L4T内核kernel编...
  • 一: 当我们在Android平台上开发一些软件的时候,有时不可避免...二: 不同的目标平台都有明确的编译器,所以说在一个平台上编译另一个平台上所运行的程序就叫做交叉编译。常见的ARM平台的交叉编译工具链有: arm-lin
  • 内核下载: 官网下载 https://github.com/raspberrypi/linux/tree/rpi-4.9.y 下载后进行解压unzip rpi_xx.zip 使用git git clone git://github.com/raspberrypi/linux/tree/rpi-4.9.y config配置 拷贝树莓派配置...
  • 将压缩包gcc-linaro-arm-linux-bnueabihf-4.9-2014.07_linux.tar存放在一个目录下,这个目录就是你等会解压缩的目录,以后这个目录就不能随便删掉了,我的存放路径是/home/zyr/Am335x/Sourcefiletools,如下图,记住...
  • 符合目标平台的交叉编译链制作及简单分析 关键字: 交叉编译、工具链、ARM、gcc bug 项目或工作中存在的的问题 由于本组使用的现有交叉编译工具链为网上下载的工具链,名称为arm-2014.05-29-arm-none-linux-...
  • 移植最新的内核linux-4.9到开发板JZ2440全过程笔记
  • Ubuntu16.04 32 bit 交叉编译Arm Linux平台的QT5 1、准备交叉编译环境 源环境平台:ubuntu16.04 32位 目标坏境平台:树莓派,Jetson TK1,tinker board, 等arm平台 配置流程: 1,Qt库开源代码,Qt软件,我使用...
  • 目的是在实验室的VERTEX 4上移植Linux,首先还是安装交叉编译工具链,主要的工作参考了华盛顿大学的资料。链接:http://www.cs.washington.edu/research/lis/mosaic/xup_ppc_linux.shtml这篇文章可以说是集合了以前...
  • 交叉编译工具:arm-none-linux-gnueabi-gcc 一、解压内核 $ tar xvf linux-3.0.8.tar.gz $ cd linux-3.0.8 二、修改内核顶层目录下的Makefile $ vim Makefile 修改: ARCH ?= $(SUBARCH)...
  • iw是Linux下的一种wifi配置工具,它替代了Wireless tools中的iwconfig,支持最近已添加到内核所有新的驱动程序,有两种加密认证加密方式:open(开放系统认证+有效等线加密)、wep方式(共享秘钥认证+有效等线加密)...
  • 1、首先建立arm-linux-gcc交叉编译环境:  下载arm-linux-gcc-3.4.1.tar.bz2  复制,解压  #cd /  复制arm-linux-gcc-3.4.1.tar.bz2到当根目录  #tar jxvf arm-linux-gcc-3.4.1.tar.bz2  这样
  • 树莓派Linux内核代码打上RT-Patch并在Ubuntu16.04环境下完成交叉编译
1 2 3 4 5 ... 20
收藏数 595
精华内容 238
关键字:

4.9内核 交叉编译linux