《嵌入式根文件系统实验报告.doc》由会员分享,可在线阅读,更多相关《嵌入式根文件系统实验报告.doc(8页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、嵌入式根文件系统实验指导实验环境:宿主机:RHEL4(Linux vm-dev 2.6.9-42.ELsmp)目标机:博创经典S2410平台交叉编译器:arm-linux-gcc V3.4.1本次实验目录下存放着已经修改好的博创经典2410平台的文件系统源码包,将该源码包拷贝到宿主机LINUX系统中,解压至本次实验目录,配置编译生成映像文件烧写到ARM设备中。前提是:通过samba服务器把实验源码包拷贝到了虚拟机的共享目录。一、使用busybox工具创建文件系统1、创建实验目录rootfsrootvm-dev # cd /root/rootvm-dev # mkdir rootfs 2、解压实
2、验压缩包rootvm-dev # cd rootfs/rootvm-dev rootfs# lsbusybox-1.12.2.tar.bz2 mkcramfs rootfs.tar.bz2rootvm-dev rootfs# tar xjvf busybox-1.12.2.tar.bz2rootvm-dev rootfs# lsbusybox-1.12.2 busybox-1.12.2.tar.bz2 mkcramfs rootfs.tar.bz2rootvm-dev rootfs#3、编译busybox工具集3.1进入busybox源码目录rootvm-dev rootfs# cd busy
3、box-1.12.2修改该目录下Makefile文件中的ARCH和CROSS_COMPIL,指定交叉编译器和目标系统,与本机的路径一致:CROSS_COMPILE ?= arm-linux- .ARCH ?= arm3.2编译busybox。先make menuconfig,修改以下: rootvm-dev busybox-1.12.2# make menuconfigBusybox Settings -Build Options -* Build BusyBox as a static binary (no shared libs)/直接编译成静态库,简单方便(/opt/crosstools
4、/gcc-3.4.6-glibc-2.3.6/bin/arm-linux-) Cross Compiler prefix/这里和Makefile里保持一致,应该写一处就行了Installation Options - Dont use /usr/使用usr目录Busybox Library Tuning - * Fancy shell prompts /一定要选上,否则很多转意字符无法识别Miscellaneous Utilities - inotifyd/不选保存退出,直接make,make install。rootvm-dev busybox-1.12.2# make rootvm-dev
5、 busybox-1.12.2# make install可以看到如下生成的目录_installrootvm-dev busybox-1.12.2# ls _install/bin linuxrc sbin usrrootvm-dev busybox-1.12.2#至此busybox工具编译完成,生成了文件系统需要的相关命令和工具在_install目录下。用户也可以根据需要,在busybox中添加删除相关命令和工具。4、手动创建根文件系统的基本目录树,如usr、bin、lib、mnt等,并添加相关配置文件与设备节点。 该步骤用户可以省略,直接使用实验目录中解压出来的rootfs目录即可,如有兴
6、趣可以仔细分析rootfs目录下的相关配置文件。解压rootfs压缩包:rootvm-dev rootfs# tar xjvf rootfs.tar.bz2生成rootfs根目录树5、把busybox编译后默认安装目录_install中需要的命令工具复制到这里的rootfs相关目录中。此步骤可以省略,我们提供的rootfs目录内容已经比较完善,无需增加内容。6、使用mkcramfs工具将rootfs文件系统目录制作成CRAMFS根文件系统映像rootvm-dev rootfs# mkcramfs rootfs root.cramfsrootvm-dev rootfs# lsbusybox-1.
7、12.2 busybox-1.12.2.tar.bz2 mkcramfs root.cramfs rootfs rootfs.tar.bz2rootvm-dev rootfs#生成root.cramfs根文件系统文件。二、烧写根文件系统注意:前提是已烧写好uboot和内核镜像1、拷贝刚刚生生成的根文件系统文件root.cramfs到本机(宿主机)TFTP服务器下载目录/tftpboot;rootvm-dev rootfs# cp root.cramfs /tftpboot/ 2、启动ARM设备,进入U-BOOT控制台,配置网络IP,下载内核。2.1 设置网络IP:U-Boot 1.3.2 (D
8、ec 8 2024 - 11:37:21) DRAM: 64 MBFlash: 512 kBNAND: 64 MiBIn: serialOut: serialErr: serialFound DM9000 ID:90000a46 at address 10000000 !DM9000 work in 16 bus widthbd-bi_entaddr: 08:00:3e:26:0a:5beth_initMAC:8:0:3e:26:a:5b:Hit any key to stop autoboot: 0 up-class2410 # setenv serverip 192.168.1.140up
9、-class2410 # setenv ipaddr 192.168.1.199up-class2410 # saveenvSaving Environment to NAND.Erasing Nand.Writing to Nand. doneup-class2410 #setenv serverip 192.168.1.140:设置宿主机IP地址,即TFTP服务器端机器IPsetenv ipaddr 192.168.1.199:设置ARM端U-BOOT中网络设备IP地址(与服务器IP同一网段任意非冲突IP地址即可)2.2 烧写文件系统,并固化到NANDFLASH中:下载到SDRAM:up-
10、class2410 # tftp 30008000 root.cramfsFound DM9000 ID:90000a46 at address 10000000 !DM9000 work in 16 bus widthbd-bi_entaddr: 08:00:3e:26:0a:5beth_initMAC:8:0:3e:26:a:5b:TFTP from server 192.168.1.140; our IP address is 192.168.1.199Filename root.cramfs.Load address: 0x30008000Loading: T # # # #doneB
11、ytes transferred = 3743744 (392000 hex)up-class2410 # 擦除NANDFLASH空间:up-class2410 # nand erase 280000 400000 NAND erase: device 0 offset 0x280000, size 0x400000Erasing at 0x67c000 - 100% complete.OKup-class2410 #写入NANDFLASH:up-class2410 # nand write 30008000 280000 400000 NAND write: device 0 offset
12、0x280000, size 0x400000 4194304 bytes written: OKup-class2410 # 固化到FLASH中后,ARM设备掉电内核不会丢失!三、启动LINUX系统,挂载根文件系统在U-BOOT中输入boot目录引导系统。up-class2410 # boot NAND read: device 0 offset 0x80000, size 0x380000 3670016 bytes read: OK# Booting image at 30008000 . Image Name: Linux-2.6.24.4 Created: 2010-03-29 4:
13、56:17 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1814044 Bytes = 1.7 MB Load Address: 30008000 Entry Point: 30008040 Verifying Checksum . OKtest:hdr-ih_type:2test:hdr-ih_comp:0 XIP Kernel Image . OKtest:hdr-ih_type:2test:hdr-ih_os:5 Starting kernel . test:machid:805306624test:
14、bi_boot_params:0x33f5bfb8test:starting 1Uncompressing Linux. done, booting the kernel.Linux version 2.6.24.4 (rootvm-dev) (gcc version 3.4.6) #128 Mon Mar 29 12:55:10 CST 2010CPU: ARM920T 41129200 revision 0 (ARMv4T), cr=00007177Machine: SMDK2410Memory policy: ECC disabled, Data cache writebackCPU S
15、3C2410A (id 0x32410002)S3C2410: core 202.800 MHz, memory 101.400 MHz, peripheral 50.700 MHzS3C24XX Clocks, (c) 2004 Simtec ElectronicsCLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL onCPU0: D VIVT write-back cacheCPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 setsCPU0: D cache: 163
16、84 bytes, associativity 64, 32 byte lines, 8 setsBuilt 1 zonelists in Zone order, mobility grouping on. Total pages: 16256Kernel command line: root=/dev/mtdblock2 noinitrd console=ttySAC0,115200irq: clearing pending ext status 00080000irq: clearing subpending status 00000002PID hash table entries: 2
17、56 (order: 8, 1024 bytes)timer tcon=00500000, tcnt a509, tcfg 00000200,00000000, usec 00001e4cConsole: colour dummy device 80x30console ttySAC0 enabledDentry cache hash table entries: 8192 (order: 3, 32768 bytes)Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)Memory: 64MB = 64MB totalMem
18、ory: 60672KB available (3316K code, 744K data, 132K init)Mount-cache hash table entries: 512CPU: Testing write buffer coherency: oknet_namespace: 64 bytesNET: Registered protocol family 16S3C2410 Power Management, (c) 2004 Simtec ElectronicsS3C2410: Initialising architectureS3C24XX DMA Driver, (c) 2
19、003-2004,2006 Simtec ElectronicsDMA channel 0 at c4800000, irq 33DMA channel 1 at c4800040, irq 34DMA channel 2 at c4800080, irq 35DMA channel 3 at c48000c0, irq 36SCSI subsystem initializedusbcore: registered new interface driver usbfsusbcore: registered new interface driver hubusbcore: registered
20、new device driver usbNET: Registered protocol family 2IP route cache hash table entries: 1024 (order: 0, 4096 bytes)TCP established hash table entries: 2048 (order: 2, 16384 bytes)TCP bind hash table entries: 2048 (order: 1, 8192 bytes)TCP: Hash tables configured (established 2048 bind 2048)TCP reno
21、 registeredNetWinder Floating Point Emulator V0.97 (double precision)yaffs Mar 29 2010 10:08:47 Installing. io scheduler noop registeredio scheduler anticipatory registered (default)io scheduler deadline registeredio scheduler cfq registeredConsole: switching to colour frame buffer device 80x30fb0:
22、s3c2410fb frame buffer devicelp: driver loaded but no devices foundppdev: user-space parallel port driverSerial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enableds3c2410-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2410s3c2410-uart.1: s3c2410_serial1 at MMIO 0x5000400
23、0 (irq = 73) is a S3C2410s3c2410-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2410RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksizeloop: module loadedDM9000: dm9k_init_moduleBoard init for dm9000a finished! I/O: c480e000, VID: 90000a46 eth0: at 0xc480e000 IRQ 18e
24、th0: Ethernet addr: 08:00:3e:26:0a:5bLinux video capture interface: v2.00Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xxDriver sd needs updating - please use bus_type methodsS3C24XX NAND Driver, (c) 2004 Simtec Elect
25、ronicss3c2410-nand s3c2410-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29nsNAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)NAND_ECC_NONE selected by board driver. This is not recommended !Scanning device for bad blocksCreating 4 MTD partitions on NAND 64MiB 3,3V 8-bi
26、t:0x00000000-0x00080000 : Boot Agent0x00080000-0x00280000 : S3C2410 kernel0x00280000-0x00680000 : S3C2410 rootfs0x00680000-0x04000000 : userusbmon: debugfs is not availables3c2410-ohci s3c2410-ohci: S3C24XX OHCIs3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1s3c2410-ohci s3c2
27、410-ohci: irq 42, io mem 0x49000000usb usb1: configuration #1 chosen from 1 choicehub 1-0:1.0: USB hub foundhub 1-0:1.0: 2 ports detectedusb usb1: Product: S3C24XX OHCIusb usb1: Manufacturer: Linux 2.6.24.4 ohci_hcdusb usb1: SerialNumber: s3c24xxInitializing USB Mass Storage driver.usb 1-1: new full
28、 speed USB device using s3c2410-ohci and address 2usb 1-1: configuration #1 chosen from 1 choicehub 1-1:1.0: USB hub foundhub 1-1:1.0: 4 ports detectedusb 1-1: Product: Standard USB Hubusbcore: registered new interface driver usb-storageUSB Mass Storage support registered.usbcore: registered new int
29、erface driver microtekX6usbcore: registered new interface driver gspcadrivers/usb/media/gspcav1-20071224/gspca_core.c: gspca driver 00.60.00 registeredmice: PS/2 mouse device common for all mices3c2410 TouchScreen successfully loadedinput: s3c2410 TouchScreen as /class/input/input0S3C24XX RTC, (c) 2
30、004,2006 Simtec Electronicss3c2410-rtc s3c2410-rtc: rtc disabled, re-enablings3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0i2c /dev entries drivers3c2410-i2c s3c2410-i2c: slave address 0x10s3c2410-i2c s3c2410-i2c: bus frequency set to 99 KHzs3c2410-i2c s3c2410-i2c: i2c-0: S3C I2C adapterS
31、3C2410 Watchdog Timer, (c) 2004 Simtec Electronicss3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabledTCP cubic registeredNET: Registered protocol family 1RPC: Registered udp transport module.RPC: Registered tcp transport module.s3c2410-rtc s3c2410-rtc: hctosys: invalid date/timeV
32、FS: Mounted root (cramfs filesystem) readonly.Freeing init memory: 132Kinit started: BusyBox v1.12.2 (2010-03-29 13:05:22 CST)Bad inittab entry at line 5starting pid 796, tty : /etc/rc.d/rc.sysinitSetting system clock: hwclock: settimeofday() failed: Invalid argument failRemounting root rw: doneMoun
33、ting devpts: doneMounting tmpfs: doneMounting applications on /root: yaffs: dev is 32505859 name is mtdblock3yaffs: passed flags yaffs: Attempting MTD mount on 31.3, mtdblock3 doneSetting hostname: doneBackup last logfiles: doneCleaning up system: doneSetting up interface lo: doneRunning start scripts.Starting syslogd: doneStarting klogd: done faildmfe_tx_done tx_pkt_cnt ERROR!Starting custom devices initing: doneRunning vsftpd server.starting pid 865, tty : /sbin/getty -L s3c2410_serial0 115200 vt100 up-tech login: rootup-tech: #输入root用户名称,系统顺利引导运行起来了。
限制150内