如何在SBC-2410X上安装嵌入式Linux

来源:互联网 发布:如何根据域名查ip 编辑:程序博客网 时间:2024/05/22 05:46
技创科技:2006-7-4 16:37:29 阅读:1735 次
 
- 返回 -
 

本文介绍如何在SBC-2410X上安装带有可读写文件系统的嵌入式Linux

1. 可能用到的文件和主机环境配置
2. 使用Jtag安装vivi(bootloader)
3. 使用串口下载安装内核
4. 通过NFS(网络文件系统)安装整个系统

1. 可能用到的文件和主机环境配置

(1) 主机环境推荐配置:

主板: 推荐使用Intel芯片组的主板(其他如威盛的主板可能不行)

操作系统: 推荐在您的计算机上同时安装WindowsXP/2000和Redhat9.0, 不建议使用任何形式的虚拟机如Vmware等

(2) 可能用到的文件列表

vivi-yaffs-v5 - bootloader

zImage-yaffs-v5 - 通过串口下载的内核

root-for-nfs-v5.8.tgz - nfs共享目录

fa_exports - 共享目录路径设置文件

Jflash - linux下Jtag烧写工具

以上文件的安装位置:

请把viv-yaffs-v5i和zImage-yaffs-v5复制到root目录下以方便使用minicom下载.

把root-for-nfs-v5.8.tgz按照以下命令解压:

tar xvzf root-for-nfs-v5.8.tgz -C /friendly-arm

2. 使用Jtag安装vivi(bootloader)

(1) 如图所示使用Jtag下载电缆连接SBC-2410X,并打开电源开关

按此在新窗口浏览图片

(2) 如图所示使用Jflash烧写vivi到Nand Flash

按此在新窗口浏览图片

3. 使用串口下载安装内核

当 vivi 烧入Flash,并能正常启动,就可以使用它来下载内核了,(见vivi的详细使用方法),下面我们介绍如何使用 vivi 下载内核。

(1)连接好串口,在Linux控制台上输入minicom, 打开串口终端, 因为SBC-2410X附带的 vivi 启动等待时间很短,因此请一直按下您PC上的空格键,然后打开电源开关,就会进入 vivi 的命令提示符下,如图所示.

按此在新窗口浏览图片

按住空格键,打开电源,进入bootloader模式

(2) 执行“ load flash kernel x ”命令,开始下载内核,如图 7-16 所示,该命令的解释如下:

load – vivi 的下载命令

flash – 把文件下载到 flash 中

kernel – 要下载的文件是 kernel 类型, 和分区参数同名

x – 使用超级终端的 xmdoem 协议下载。

此时先按下“Ctrl”不要松开, 再按下“a”键, 然后同时松开, 再按下“s”键, 进入下载模式,如图所示选择 xmodem 协议方式下载。发送文件结束, vivi 将自动保存所下载的文件到flash中.

注意事项:当使用xmodem进行下载时,一般第一次会出现超时不能下载的现象,再次输入load flash kernel x,之后请快速按Ctrl+A,松开,再快速按s键,然后一直快速按回车即可。

下面是使用minicom下载kernel时的顺序图例.

按此在新窗口浏览图片

输入"load flash kernel x"开始下载内核

按此在新窗口浏览图片

选择"xmodem"协议开始下载

按此在新窗口浏览图片

输入要发送的文件和并选择 Xmodem 协议发送

按此在新窗口浏览图片

kernel下载过程

按此在新窗口浏览图片

vivi 自动把内核保存到 flash 中

4. 通过NFS(网络文件系统)安装整个系统

按照以上步骤执行完毕, 在vivi模式下输入"boot", 将会启动刚刚下载的内核,但是无法进入系统,是因为还没有文件系统,下面介绍如何使用NFS安装文件系统.

(1)在PC Linux上启动NFS服务

step1: 首先解压root-for-nfs-v5.8.tgz创建nfs共享目录: tar xvzf root-for-nfs-v5.8.tgz -C /friendly-arm

如果你的系统上已经存在/friendly-arm/root目录, 请先删除它:rm -rf /friendly-arm/root

step2: 把共享目录路径加入到/etc/exports中: cat fa_exports >> /etc/exports (点击查看fa_exports内容)

如果您已经设置好了/etc/exports, 则不需要执行该步.

step3: 启动nfs服务:

确认你的PC Linux系统IP地址已经配置好, 为了适合我们提供的nfs启动参数, 请使用以下命令设置您的IP地址:

ifconfig eth0 192.168.0.1

然后使用以下命令启动nfs服务:

/etc/init.d/nfs restart

(2)使用bk和bs命令烧写文件系统

step1: 首先使用NFS启动系统

在vivi提示符模式输入以下命令参数, 使用nfs启动系统:

param set linux_cmd_line "console=ttyS0 root=/dev/nfs nfsroot=192.168.0.1:/friendly-arm/root ip=192.168.0.69:192.168.0.1:192.168.0.1:255.255.255.0:matrix4.arm9.net:eth0:off"

然后使用"boot"命令启动系统, 启动信息如下:

VIVI version 0.1.4 (root@capbily) (gcc version 2.95.3 20010315 (release)) #0.1.4 Mon Oct 4 16:20:35 CST 2004
MMU table base address = 0x33DFC000
Succeed memory mapping.
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V 0M )
Found saved vivi parameters.
Press Return to start the LINUX now, any other key for vivi
type "help" for help.
friendly-arm>param set linux_cmd_line "console=ttyS0 root=/dev/nfs nfsroot=192.168.0.1:/friendly-arm/root ip=192.168.0.69:192.168.0.1:192.168.0.1:255.255.255.0:matrix4.arm9.net:eth0:off"
Change linux command line to "console=ttyS0 root=/dev/nfs nfsroot=192.168.0.1:/friendly-arm/root ip=192.168.0.69:192.168.0.1:192.168.0.1:255.255.255.0:matrix4.arm9.net:eth0:off"
friendly-arm> boot
Copy linux kernel from 0x00030000 to 0x30008000, size = 0x00100000 ... done
zImage magic = 0x 016f 2818
Setup linux parameters at 0x30000100
linux command line is: "console=ttyS0 root=/dev/nfs nfsroot=192.168.0.1:/friendly-arm/root ip=192.168.0.69:192.168.0.1:192.168.0.1:255.255.255.0:matrix4.arm9.net:eth0:off"
MACH_TYPE = 193
NOW, Booting Linux......
Uncompressing Linux....................................................... done, booting the kernel.
Linux version 2.4.18 -rmk7-pxa1 (root@capbily) (gcc version 2.95.3 20010315 (release)) #9 Wed Oct 6 17:00:54 CST 2004
CPU: ARM/CIRRUS Arm920Tsid(wb) revision 0
Machine: Samsung-SMDK2410
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: console=ttyS0 root=/dev/nfs nfsroot=192.168.0.1:/friendly-arm/root ip=192.168.0.69:192.168.0.1:192.168.0.1:255.255.255.0:matrix4.arm9.net:eth0:off
DEBUG: timer count 15626
Calibrating delay loop... 99.94 BogoMIPS
Memory: 64MB = 64MB total
Memory: 62676KB available (1374K code, 364K data, 56K init)
Dentry-cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode-cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 4096 (order: 2, 16384 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
CPU clock = 200.000 Mhz, HCLK = 100.000 Mhz, PCLK = 50.000 Mhz
Initializing S 3C 2410 buffer pool for DMA workaround
usbctl: zombie --> [reset] --> default. Device in default state.
S 3C 2410 USB Controller Core Initialized
USB Function Character Driver Interface - 0.5, (C) 2001, Extenex Corp.
usbctl: Opened for usb-char
usbctl: Started for usb-char
Starting kswapd
devfs: v1.10 (20020120) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
ttyS%d0 at I/O 0x50000000 (irq = 52) is a S 3C 2410
ttyS%d1 at I/O 0x50004000 (irq = 55) is a S 3C 2410
ttyS%d2 at I/O 0x50008000 (irq = 58) is a S 3C 2410
pty: 256 Unix98 ptys configured
leds initialized
S 3C 2410 Real Time Clock Driver v0.1
block: 128 slots per queue, batch=32
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
eth0: cs8900 rev K(3.3 Volts) found at 0xd0000300
cs89x0 media RJ-45, IRQ 37
Linux video capture interface: v1.00
SCSI subsystem driver Revision: 1.00
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
UDA1341 audio driver initialized
NAND device: Manufacture ID: 0xec, Chip ID: 0x76 (Samsung K9D1208V 0M )
bon0: 00000000-00030000 (00030000) 00000000
bon1: 00030000-00130000 (00100000) 00000000
bon2: 00130000-03ff4000 (03ec4000) 00000000
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xe9000000, IRQ 26
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
port #1 suspened!
port #0 alived!
hub.c: 1 port detected
usb.c: registered new driver usblp
printer.c: v0.8:USB Printer Device Class driver
usb.c: registered new driver ov511
ov511.c: v 1.48a for Linux 2.4 : OV511 USB Camera Driver
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 4096)
IP-Config: Complete:
device=eth0, addr=192.168.0.69, mask=255.255.255.0, gw=192.168.0.1,
host=matrix4, domain=, nis-domain=arm9.net,
bootserver=192.168.0.1, rootserver=192.168.0.1, rootpath=
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
Looking up port of RPC 100003/2 on 192.168.0.1
Looking up port of RPC 100005/1 on 192.168.0.1
VFS: Mounted root (nfs filesystem).
Mounted devfs on /dev
Freeing init memory: 56K
========================================
= Friendly-ARM Tech. Ltd. =
= http://www.arm9.net =
= http://www.arm9.com.cn =
========================================
init started: BusyBox v0.60.5 (2003.09.05-09:25+0000) multi-c 齦 l binary
Using /lib/input.o
Using /lib/keybdev.o
insmod: unresolved symbol handle_scancode
insmod: unresolved symbol keyboard_tasklet
insmod: unresolved symbol kbd_ledfunc
Using /lib/mousedev.o
mice: PS/2 mouse device common for all mice
Using /lib/evdev.o
Using /lib/video.o
insmod: couldn't find the kernel version the module was compiled for
Using /lib/videodev.o
Linux video capture interface: v1.00
video_dev: unable to get major 81
insmod: init_module: videodev: Input/output error
Using /lib/ov511.o
usb.c: registered new driver ov511
ov511.c: v 1.48a for Linux 2.4 : OV511 USB Camera Driver
Using /lib/lcd640x480x32.o
lcd address is c4960000(33800000)
LCD640x480x32 installed, by capbily@hotmail.com(http://www.arm9.net
Using /lib/hid-core.o
insmod: unresolved symbol hidinput_connect
insmod: unresolved symbol hidinput_hid_event
insmod: unresolved symbol hidinput_disconnect
Using /lib/usbmouse.o
usb.c: registered new driver usb_mouse
usbmouse.c: v1.6:USB HID Boot Protocol mouse driver
Using /lib/usbkbd.o
usb.c: registered new driver keyboard
usbkbd.c: :USB HID Boot Protocol keyboard driver
[04/Dec/2030:15:57:15 +0000] boa: server version Boa/0.94.13
[04/Dec/2030:15:57:15 +0000] boa: server built Feb 28 2004 at 21:47:23.
[04/Dec/2030:15:57:15 +0000] boa: starting server pid=37, port 80

Please press Enter to activate this console.
BusyBox v0.60.5 (2003.09.05-09:25+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
sh: can't access tty; job control turned off

???? [root@fa /]#

如以上信息, 按回车进入系统, 然后运行"bk"命令更新系统内核.

bk命令其实是一个脚本,该脚本首先使用 imagewrite 对 flash 进行分区, 然后烧写 bootloader 和 kernel. 关于 imaewrite 的使用方法可以参考其帮助信息.

按此在新窗口浏览图片

运行bk命令以进行分区和重新安装vivi及kernel

bk 执行完毕, 按照提示, 复位系统, 再次使用 nfs 启动系统, 然后使用“bs”(bs也是一个脚本, 请使用任何一种编辑器自行打开查看, )命令先对 flash 进行格式化,再安装根文件系统内容,如下图所示:

按此在新窗口浏览图片

bs命令执行完毕

 
原创粉丝点击