a8 arm linux
arm linux
2009-09-04 19:40:00 ceftp 阅读数 200

arm linux 2.6.30.5移植到yc2440中..........................

2007-05-05 10:08:00 xuhaowu 阅读数 591
Arm & Linux
2007-01-26 11:22

ArmLinux :

http://www.arm.linux.org.uk/    ftp://ftp.arm.linux.org.uk/ patch download

http://www.gnuarm.com/resources.html    arm resource

kernel:

http://www.kernel.org/    ftp://ftp.kernel.org/ Kernel download & Archives

http://www.handhelds.org    Linux for handheld computers

  http://www.kerneltraffic.org/    Archives

gnu:

http://www.gnu.org/     ftp://ftp.gnu.org/gnu/    Gnu Toolchain download &    Documentation

http://www.gnu.org/manual/    GNU Manuals Online

http://gcc.gnu.org/    GCC, the GNU Compiler Collection

http://www.aleph1.co.uk/armlinux/book    onlinebook for build toolchain

http://sourceware.org/lists.html    gnu FAQ include building crosscgcc in redhat

http://www.dc.turkuamk.fi/docs/gnu/     GNU Documentation

http://www.kegel.com/crosstool/ Building and Testing gcc-glibc cross toolchains

build matrix included in the buildlogs directory of the crosstool tarball

http://frank.harvard.edu/~coldwell/toolchain/    Building and Testing gcc-glibc cross toolchains

vim:

http://www.vim.org/   ftp://ftp.vim.org/    vim download &    Documentation

embedded:

http://www.ucdot.org/    Embedded linux and uclinux developer forum

http://www.embeddedtux.org/    <<Building embedded linux system>>    

others:

http://www.handheld.org/   http://lists.6502group.org/mailman/listinfo/    

ftp://ftp.handhelds.org/           有gnuToolchain download

http://www.mizi.com/developer/s3c2410x/download/vivi.html  vivi source Download Page

http://www.embedded-computing.com/    

http://www.embedded.com/

http://linuxdevices.com/


tools in linux:

http://www.freshmeat.net/

datasheet:

http://www.alldatasheet.com/    http://www.datasheet4u.com/   

http://www.datasheetcatalog.net/    

http://www.datasheet.com.cn/    中国芯片手册网

http://av.people.com.cn/GB/47936/47951/63874/4379781.html

http://www.linuxforum.net/forum/showthreaded.php?Board=embedded&Number=607783&page=

http://blog.csdn.net/wawuta/archive/2007/01/22/1490125.aspx

Sockets Tutorial

http://www.cs.rpi.edu/courses/sysprog/sockets/sock.html  



2017-01-08 09:57:00 weixin_33919941 阅读数 16

ARM课程

回顾

  • 进入虚拟机,因为之前已经烧写好了,直接进行以下步骤。
  • ls -l /dev/ttyUSB0
  • sudo chmod 777 /dev/ttyUSB0
  • minicom

网络

  • 将网线和主机连接
  • ifconfig查看开发板ip
  • ifconfig eth0 192.168.0.230(一般不会用0)
  • 新开终端修改watch sudo ifconfig eth0 192.168.0.1
  • ping 192.168.0.230 查看是否接通


    3238825-5501735f01432122.png
    Paste_Image.png

如果不通,就查看虚拟机是否是桥接模式,

  • 断电后重启会出现问题,无法连接网络
    • 进入虚拟机管理将设置


      3238825-7178b24bba89c8b3.png
      Paste_Image.png

文件下载

  • 在开发板上输入netstat查看网络状态
  • netstat -ant查看参数


    3238825-6a7e203a857bad99.png
    Paste_Image.png
  • 可以查看各类监听状态
    • 可见80->http接通
    • 可见21->ftp
    • 可见23->终端下

玩法1:上http

3238825-6e8365d5cdc144c0.png
Paste_Image.png

玩法2:文件传输

3238825-e16cf051896983dd.png
Paste_Image.png

- 在开发板下新建文件等,可在主机中下载。


3238825-4220002169f20c54.png
Paste_Image.png

玩法3:终端登录啥的傻傻分不清

3238825-4220002169f20c54.png
Paste_Image.png

下载TFTP

  • sudo apt-get install tftpd-hpa

  • sudo apt-get install tftp-hpa

  • sudo vim /etc/default/tftpd-hpa

  • sudo mkdir tftpboot

  • sudo chmod 777 /tftpboot/

  • 配置如下


    3238825-163afedbb2eb970e.png
    Paste_Image.png
    • 0.0.0.0.代表本机任意地址都可行(any)
    • 69代表端口
  • sudo mkdir tftpboot

  • sudo chmod 777 /tftpboot/

  • 进入文件夹

    • cd tftpboot
    • vim tftptest(随便写点什么)
  • 重启服务

    1. sudo service tftpd-hpa restart
    3238825-f811832dd98e00f1.png
    Paste_Image.png
    1. netstat -anu|grep 69
    3238825-e60cc88c5b17b682.png
    Paste_Image.png
  • 下载

    • tftp -r tftptest -g 192.168.0.1
    • cat tftptest
    3238825-f34ab5d79b26a87a.png
    Paste_Image.png

嵌入式开发的流程

  1. 写代码
  2. 交叉编译
  3. 下载到开发板
  4. 运行
  • 在主机下弄个hello world
  • 复制到tftpbooot目录下:cp:tftpboot
  • tftp -r hello1 -g 192.168.0.1
3238825-5cea4b163a40f3ce.png
Paste_Image.png
  • 执行不了,有语法错误
  • 因为可执行文件是x86下的
3238825-6d1fed7556c70972.png
Paste_Image.png
  • 解决方法:
    • 在x86下编译一个在ARM平台下运行的程序
    • 将啥啥啥复制进去
      • cp ~/arm-linux-gcc-4.4.3.tar.gz .
    • 解压缩
      • tar zxvf arm-linux-gcc-4.4.3.tar.gz
    • 记下路径
      • /home/sunsuhui/1612/ARM/src/4.4.3/bin
    • cd ~
    • vi .bashrc
    • 最后一行添加
      • export PATH=$PATH:/home/sunsuhui/1612/ARM/src/4.4.3/bin
    • 因为电脑是64位需要安装一个包
      • sudo apt-get install lib32z1
    • 重开一个终端输入
      • arm-linux-gcc -v
      • 出现下文即成功


        3238825-c7e6fcb1660edc90.png
        Paste_Image.png
    • 进行编译时出现问题
      • arm-linux-gcc -o hello1 hello.c


        3238825-5b864f1dcd9d1bdd.png
        Paste_Image.png
      • 安装两个包
        • $sudo apt-get install libstdc++6
        • $sudo apt-get install lib32stdc++6
    • 重新编译
      • arm-linux-gcc XXX.c
    • 将编译完成的文件保存到开发板目录下:/home/plg
      • tftp -r XXX.c -g 192.168.0.1
      • 运行即可
2010-09-29 23:13:00 ghoshi 阅读数 444

ARM Linux Boot Sequence

The following traces the Linux boot sequence for ARM-based systems in the 2.6.18 kernel. It looks at just the earliest stages of the boot process, until the generic non-processor-specific start_kernel function is called. The line numbers of each statement are in parenthese at the end of the line; the kernel source itself can be conveniently browsed on the Linux Cross-Reference website.

zImage decompression

  • arch/arm/boot/compressed/head.S: start (108)
    • First code executed, jumped to by the bootloader, at label "start" (108)
    • save contents of registers r1 and r2 in r7 and r8 to save off architecture ID and atags pointer passed in by bootloader (118)
    • execute arch-specific code (inserted at 146)
      • arch/arm/boot/compressed/head-xscale.S or other arch-specific code file
      • added to build in arch/arm/boot/compressed/Makefile
      • linked into head.S by linker section declaration:  .section “start”
      • flush cache, turn off cache and MMU
    • load registers with stored parameters (152)
      • sp = stack pointer for decompression code (152)
      • r4 = zreladdr = kernel entry point physical address
    • check if running at link address, and fix up global offset table if not (196)
    • zero decompression bss (205)
    • call cache_on to turn on cache (218)
      • defined at arch/arm/boot/compressed/head.S (320)
      • call call_cache_fn to turn on cache as appropriate for processor variant
        • defined at arch/arm/boot/compressed/head.S (505)
        • walk through proc_types list (530) until find corresponding processor
        • call cache-on function in list item corresponding to processor (511)
          • for ARMv5tej core, cache_on function is __armv4_mmu_cache_on (417)
            • call setup_mmu to set up initial page tables since MMU must be on for cache to be on (419)
            • turn on cache and MMU (426)
    • check to make sure won't overwrite image during decompression; assume not for this trace (232)
    • call decompress_kernel to decompress kernel to RAM (277)
    • branch to call_kernel (278)
      • call cache_clean_flush to flush cache contents to RAM (484)
      • call cache_off to turn cache off as expected by kernel initialization routines (485)
      • jump to start of kernel in RAM (489)
        • jump to address in r4 = zreladdr from previous load
          • zreladdr = ZRELADDR = zreladdr-y
          • zreladdr-y specified in arch/arm/mach-vx115/Makefile.boot

 

ARM-specific kernel code

  • arch/arm/kernel/head.S: stext (72)
    • call __lookup_processor_type (76)
      • defined in arch/arm/kernel/head-common.S (146)
      • search list of supported processor types __proc_info_begin (176)
        • kernel may be built to support more than one processor type
        • list of proc_info_list structs 
          • defined in arch/arm/mm/proc-arm926.S (467) and other corresponding proc-*.S files
          • linked into list by section declaration:  .section ".proc.info.init"
      • return pointer to proc_info_list struct corresponding to processor if found, or loop in error if not
    • call __lookup_machine_type (79)
      • defined in arch/arm/kernel/head-common.S (194)
      • search list of supported machines (boards)
        • kernel may be built to support more than one board
        • list of machine_desc structs 
          • machine_desc struct for boards defined in board-specific file vx115_vep.c
          • linked into list by section declaration that's part of MACHINE_DESC macro
      • return pointer to machine_desc struct corresponding to machine (board)
    • call __create_page_tables to set up initial MMU tables (82)
    • set lr to __enable_mmu, r13 to address of __switch_data (91, 93)
      • lr and r13 used for jumps after the following calls
      • __switch_data defined in arch/arm/kernel/head-common.S (15)
    • call the __cpu_flush function pointer in the previously returned proc_info_list struct (94)
      • offset is #PROCINFO_INITFUNC into struct
      • this function is __arm926_setup for the ARM 926EJ-S, defined in arch/arm/mm/proc-arm926.S (392)
        • initialize caches, writebuffer
      •  
        • jump to lr, previously set to address of __enable_mmu
    • __enable_mmu (147)
      • set page table pointer (TTB) in MMU hardware so it knows where to start page-table walks (167)
      • enable MMU so running with virtual addresses (185)
      • jump to r13, previously set to address of __switch_data, whose first field is address of __mmap_switched
        • __switch_data defined in arch/arm/kernel/head-common.S (15)

 

  • arch/arm/kernel/head-common.S: __mmap_switched (35)
    • copy data segment to RAM (39)
    • zero BSS (45)
    • branch to start_kernel (55)

 

Processor-independent kernel code

  • init/main.c: start_kernel (456)
2013-12-19 20:53:16 shangyaowei 阅读数 283

 了解完kernel启动以前的汇编之后我们来看看正式的c语言启动代码,也就是我们的start_kernel函数了。start_kernel相当大,里面每一个调用到的函数都足够我们伤脑筋了,我这里只是浅尝辄止的描述一下函数的功能,从而对kernel启动的过程有一个比较直观的了解。很多函数真正理解需要对linux相关体系有很深的了解,暂时没有时间深入,留待以后了。

       说实话启动的代码看到现在唯一的感觉就是kernel的全局变量实在太多了,要了解一个过程跟踪一个变量的值的变化相当痛苦啊,不过耐心看下来,收获还是比较丰富的,对很多概念都有了一个比较直观的理解。闲话就不多说了,直接来上代码~~


       smp_setup_processor_id();

       //这个函数现在是空的;


        lockdep_init();

        //Runtime  locking correctness validator, see Documentation/lockdep_design.txt

        debug_objects_early_init();

        cgroup_init_early();

        //Control group, read Documentation/cgroup.txt

        local_irq_disable();

        //使用arm cpsid i指令来禁止IRQ

        early_boot_irqs_off();

        early_init_irq_lock_class();

        


       lock_kernel();

      

      

        

 


         tick_init();

         //和时钟相关的初始化,好像是注册notify事件,没有仔细研究过


         boot_cpu_init();

         //这个实际上是在SMP环境下选择CPU,这里直接CPUID选择的是0号cpu


         page_address_init();

         //初始化high memory,在arm环境下实际上这个函数是空的,也就是说arm不支持high memory 


         printk(KERN_NOTICE);

         printk(linux_banner);

         //这里的KER_NOTICE是字符串<5>,不太明白它的意思。。。后面的linux_banner定义在kernel/init/version.c里面,这里的printk是门高深的学问,以后看console的时候会仔细分析


        setup_arch(&command_line);

        

        

                 request_standard_resources(&meminfo, mdesc);

                 这个函数用来申请一些应该是内存资源,具体的内容没有仔细研究,看不大懂。。

                 cpu_init();

                 初始化CPU,这里主要是对arm寄存器cpsr的操作

                 init_arch_irq = mdesc->init_irq;

                 system_timer = mdesc->timer;

                 init_machine = mdesc->init_machine;

                 这里将体系结构相关的几个函数,中断,初始化,定时器之类的赋值给kernel全局变量;

                 conswitchp = &vga_con;

                 这里设置了关于console的一个变量,具体不知道怎么用的,以后看console的时候再仔细分析

                 early_trap_init();

                 不知道这个函数具体做什么用的。。。 */

        

 


 

 

        差不多这边就讲到这里,下一篇将start_kernel的剩余部分讲完~~

 

Booting ARM Linux

阅读数 55

原版英文文档位置:\linux-4.9.145\Documentation\arm\Booting启动ARMLinux=================作者:RussellKing日期:2002年5月18日以下文档与2.4.18-rmk6及更高版本相关。为了引导ARMLinux,您需要一个bootloader,它是一个在主内核之前运行的小程序。期望bootlo...

博文 来自: sunqian666888

Booting ARM Linux

阅读数 1104

搞armlinux应该读读,有助于理解源码。BootingARMLinuxVincentSandersvince@arm.linux.org.uk>Reviewandadvice,largechunksoftheARMLinuxkernel,allaroundgoodguy:Russel

博文 来自: bromi

arm linux faq

阅读数 917

armlinuxfaq

博文 来自: LinuxBoy1985

arm linux 自动登陆

阅读数 626

修改/etc/inittab去掉原来login语句,改为如下:console::respawn:-/bin/sh 即可实现自动登陆

博文 来自: r_Jimy

ARM与Linux的一些问题

阅读数 92

《ARM与Linux些许问题》第四章:ARM平台系统调用原理分析标签:linux平台vectorsystem编程2012-10-1917:192122人阅读评论(0)收藏举报本文章已收录于:分类:arm-Linux学习(61)作者同类文章X版权声明:本文为博主原创文章

博文 来自: weixin_36974024
没有更多推荐了,返回首页