Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4462814
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: 嵌入式

2011-04-05 15:09:26

1.安装
 sudo apt-get install bison flex build-essential patch libncurses5-dev

2.理解
  交叉编译的库库文件lib路径:
        arm-2010.09/arm-none-linux-gnueabi/libc/armv4t/lib  一些.so文件
  我们需要的头文件
         arm-2010.09/arm-none-linux-gnueabi/libc/usr/include    一些 .h 文件
  注意:我们在建立文件系统时,需要拷贝交叉编译的lib文件到 自己的文件系统 /lib/
        arm-none-linux-gnueabi/libc/armv4t/usr/lib/*.so*  到 文件系统/lib下
        arm-none-linux-gnueabi/libc/armv4t/lib/    到lib下
    具体可以参考 移植手册

3.内核关于S3C2440的头文件
  arch/arm/mach-s3c2410/include
  arch/arm/mach-s3c2440
  arch/arm/plat-s3c24xx/include
  arch/arm/plat-samsung/include   不知道这个有没有用 ??
  arch/arm/plat-s3c/ 

接下去的步骤与 TQ2440+2.6.30.4 步骤差不多
1.添加对ARM的支持
vim Makefile  第189行
        ARCH = arm
        CROSS_COMPILE=arm-linux-

2.修改输入平台时钟
  arch/arm/mach-s3c2440/mach-smdk2440.c
    第163 行,修改 16934400 为 12000000

3.修改机器码
   TQ板子使用的168 机器码
   arch/arm/tools/mach-types
   第379行  将362  为 168

补充:在 移植 自己的uboot 中,2010.06 时,吧 机器码修改为了  362
 
4.修改nand flash ,这步,与手册上一样
  arch/arm/plat-s3c24xx/common-smdk.c
 
  没有 修改 nand flash 的读写匹配时间 ,commmon-smdk.c的文件大概140 行的
  smdk_nand_info 结构体
 
5.支持 yaffs文件系统
  ./patch-ker.sh c /opt/me_linux/linux-2.6.33

6.busybox-1.18.4 下载了这个 
   在这个版本,make过程中没有错误,以前自己在2.6.30.4+busybox1.13 文件系统出现错误,
   可能是这个版本修改了bug了

7.建立文件系统 完全参考了 TQ移植手册10年版
  就是在/home/yu 建立了自己名字的文件
  相应的在passwd  修改为自己的名字 yu

   mkyaffs2image 工具使用:
    1.cp  mkxxxxximage_toos.tar.bz2  /home/ywx/yu/src/
    2.tar jxfv mkxxxxximage_tools.tar.bz2   生成了usr文件目录
    3.sudo cp usr/local/sbin/* /usr/local/sbin
   
 因为根目录/usr/local/sbin/ 已经添加到了 环境变量/etc/environmet下,所以我们可以直接使用
   
8.内核配置 make menuconfig 

   这部分可以参考  TQ2440+2.6.30.4 初级移植 (一)
  
    就是改了一个地方: 这次修改了没有错误出现了
  1. general setup->
  2.     [-yuweixian]local version.......

9.这样子就可以了 ,下载板子
  1. ##### EmbedSky BIOS for SKY2440/TQ2440 #####
  2. Press Space key to Download Mode !
  3. Booting Linux ...
  4. Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00200000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......
  5. Uncompressing Linux... done, booting the kernel.
  6. Linux version 2.6.33-yuweixian (root@yuweixian) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) ) #6 Tue Apr 5 14:53:53 CST 2011
  7. CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
  8. CPU: VIVT data cache, VIVT instruction cache
  9. Machine: SMDK2440
  10. ATAG_INITRD is deprecated; please update your bootloader.
  11. Memory policy: ECC disabled, Data cache writeback
  12. CPU S3C2440A (id 0x32440001)
  13. S3C24XX Clocks, Copyright 2004 Simtec Electronics
  14. S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
  15. CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
  16. Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
  17. Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0
  18. PID hash table entries: 256 (order: -2, 1024 bytes)
  19. Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
  20. Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
  21. Memory: 64MB = 64MB total
  22. Memory: 61048KB available (3272K code, 304K data, 120K init, 0K highmem)
  23. Hierarchical RCU implementation.
  24. NR_IRQS:85
  25. irq: clearing pending ext status 00080000
  26. irq: clearing subpending status 00000002
  27. Console: colour dummy device 80x30
  28. console [ttySAC0] enabled
  29. Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
  30. Mount-cache hash table entries: 512
  31. CPU: Testing write buffer coherency: ok
  32. NET: Registered protocol family 16
  33. S3C Power Management, Copyright 2004 Simtec Electronics
  34. S3C2440: Initialising architecture
  35. S3C2440: IRQ Support
  36. S3C24XX DMA Driver, Copyright 2003-2006 Simtec Electronics
  37. DMA channel 0 at c4808000, irq 33
  38. DMA channel 1 at c4808040, irq 34
  39. DMA channel 2 at c4808080, irq 35
  40. DMA channel 3 at c48080c0, irq 36
  41. S3C244X: Clock Support, DVS off
  42. bio: create slab <bio-0> at 0
  43. SCSI subsystem initialized
  44. usbcore: registered new interface driver usbfs
  45. usbcore: registered new interface driver hub
  46. usbcore: registered new device driver usb
  47. s3c-i2c s3c2440-i2c: slave address 0x10
  48. s3c-i2c s3c2440-i2c: bus frequency set to 97 KHz
  49. s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
  50. Advanced Linux Sound Architecture Driver Version 1.0.21.
  51. NET: Registered protocol family 2
  52. IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
  53. TCP established hash table entries: 2048 (order: 2, 16384 bytes)
  54. TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
  55. TCP: Hash tables configured (established 2048 bind 2048)
  56. TCP reno registered
  57. UDP hash table entries: 256 (order: 0, 4096 bytes)
  58. UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
  59. NET: Registered protocol family 1
  60. RPC: Registered udp transport module.
  61. RPC: Registered tcp transport module.
  62. RPC: Registered tcp NFSv4.1 backchannel transport module.
  63. NetWinder Floating Point Emulator V0.97 (extended precision)
  64. ROMFS MTD (C) 2007 Red Hat, Inc.
  65. yaffs Apr 5 2011 12:09:55 Installing.
  66. msgmni has been set to 119
  67. io scheduler noop registered
  68. io scheduler deadline registered
  69. io scheduler cfq registered (default)
  70. Console: switching to colour frame buffer device 30x40
  71. fb0: s3c2410fb frame buffer device
  72. lp: driver loaded but no devices found
  73. ppdev: user-space parallel port driver
  74. Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
  75. s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
  76. s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
  77. s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
  78. brd: module loaded
  79. loop: module loaded
  80. Uniform Multi-Platform E-IDE driver
  81. ide-gd driver 1.18
  82. ide-cd driver 5.00
  83. S3C24XX NAND Driver, (c) 2004 Simtec Electronics
  84. s3c24xx-nand s3c2440-nand: Tacls=2, 20ns Twrph0=6 60ns, Twrph1=2 20ns
  85. s3c24xx-nand s3c2440-nand: NAND hardware ECC
  86. NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
  87. Scanning device for bad blocks
  88. Creating 3 MTD partitions on "NAND 256MiB 3,3V 8-bit":
  89. 0x000000000000-0x000000040000 : "ywx-boot"
  90. 0x000000200000-0x000000400000 : "ywx-kernel"
  91. 0x000000400000-0x00000ff80000 : "ywx-yaffs2"
  92. dm9000 Ethernet Driver, V1.31
  93. usbmon: debugfs is not available
  94. ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
  95. s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
  96. s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
  97. s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
  98. hub 1-0:1.0: USB hub found
  99. hub 1-0:1.0: 2 ports detected
  100. usbcore: registered new interface driver libusual
  101. usbcore: registered new interface driver usbserial
  102. USB Serial support registered for generic
  103. usbcore: registered new interface driver usbserial_generic
  104. usbserial: USB Serial Driver core
  105. USB Serial support registered for FTDI USB Serial Device
  106. usbcore: registered new interface driver ftdi_sio
  107. ftdi_sio: v1.5.0:USB FTDI Serial Converters Driver
  108. USB Serial support registered for pl2303
  109. usbcore: registered new interface driver pl2303
  110. pl2303: Prolific PL2303 USB to serial adaptor driver
  111. mice: PS/2 mouse device common for all mice
  112. S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
  113. s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
  114. ALSA device list:
  115.   No soundcards found.
  116. TCP cubic registered
  117. NET: Registered protocol family 17
  118. end_request: I/O error, dev mtdblock2, sector 256
  119. isofs_fill_super: bread failed, dev=mtdblock2, iso_blknum=64, block=128
  120. yaffs: dev is 32505858 name is "mtdblock2"
  121. yaffs: passed flags ""
  122. yaffs: Attempting MTD mount on 31.2, "mtdblock2"
  123. yaffs: auto selecting yaffs2
  124. yaffs_read_super: isCheckpointed 0
  125. VFS: Mounted root (yaffs filesystem) on device 31:2.
  126. Freeing init memory: 120K

  127. Please press Enter to activate this console.
  128. [root@yuweixian /]# ls
  129. bin home lost+found proc sys var
  130. dev lib mnt root tmp web
  131. etc linuxrc opt sbin usr
  132. [root@yuweixian /]# clear

  133. [root@yuweixian /]# ls
  134. bin home lost+found proc sys var
  135. dev lib mnt root tmp web
  136. etc linuxrc opt sbin usr
  137. [root@yuweixian /]#
这次  [root/yuweixian /]# 成功显示了  !!!!!



错误处理:
1.板子执行到这里就停止了,没有继续向下执行了
  1. ##### EmbedSky BIOS for SKY2440/TQ2440 #####
  2. Press Space key to Download Mode !
  3. Booting Linux ...
  4. Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00200000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......
  5. Uncompressing Linux...
 
  分析:
    1.当时我仅仅制作了2.6.33 内核,下载到板子中,但是文件系统还是 TQ2440+2.6.30.4这个文件系统,出现了上面的错误。我想是文件系统匹配问题。
    2.所以,我继续做了文件系统arm-linux-gcc4.5.1,但是还是出现了上面的问题。一直没有解决
 
网上说的是:
   主要是串口问题:出现如下提示后停住 Uncompressing Linux done, booting the kernel
   

但是,还是没有解决,

   自己又下了一遍内核+文件系统 到板子中,就成功启动了,乖乖。


以后还是要一步一步小心的处理过程!!!!




 



阅读(943) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~