|
楼主 |
发表于 2009-9-10 01:01:45
|
显示全部楼层
本帖最后由 icewalkleader 于 2009-9-10 01:02 编辑
今日小成,把kernel配置稍作修改。嵌入了一个initrd
以tftp将新修改的kernel下载到机器可以正常运行。
同时可以识别到U盘。这样实验rootfs的过程大大的方便。今天太晚了,后面再把initrd的>脚本写的好一点,实现tftp->kernel->U盘rootfs垂手可得。
以下是启动的log:
CFE> r 192.168.1.100:vmlinux
0x80010000/3121285 0x8030a085/142995 Entry at 0x802f5018
Closing network.
Starting program at 0x802f5018
Linux version 2.6.8.1 (root@lr-laptop) (gcc version 3.4.2) #6 Thu Sep 10 00:07:19 CST 2009
Parallel flash device: name AM29LV320MT, id 0x2201, size 16384KB
96358VW2 prom init
CPU revision is: 0002a010
Determined physical RAM map:
memory: 01fa0000 @ 00000000 (usable)
Initial ramdisk at: 0x802a0000 (339968 bytes)
On node 0 totalpages: 8096
DMA zone: 4096 pages, LIFO batch:1
Normal zone: 4000 pages, LIFO batch:1
HighMem zone: 0 pages, LIFO batch:1
Built 1 zonelists
Kernel command line: root=1:0 console=ttyS0,115200
brcm mips: enabling icache and dcache...
Primary instruction cache 32kB, physically tagged, 2-way, linesize 16 bytes.
Primary data cache 16kB 2-way, linesize 16 bytes.
PID hash table entries: 128 (order 7: 1024 bytes)
Using 150.000 MHz high precision timer.
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 28768k/32384k available (2151k kernel code, 3572k reserved, 808k data, 88k init, 0k highmem)
KLOB Pool 1 Initialized: 1048576 bytes <0x80e00000 ... 0x80f00000>
Calibrating delay loop... 299.82 BogoMIPS
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Checking for 'wait' instruction... unavailable.
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 332k freed
NET: Registered protocol family 16
Total Flash size: 16384K with 128 sectors
File system address: 0xbe020100
Can't analyze prologue code at 80228494
SCSI subsystem initialized
usbcore: registered new driver hub
Initializing Cryptographic API
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
PPP generic driver version 2.4.2
NET: Registered protocol family 24
Using noop io scheduler
bcm963xx_mtd driver v1.0
PCI: Enabling device 0000:00:0a.0 (0000 -> 0002)
ehci_hcd 0000:00:0a.0: EHCI Host Controller
PCI: Setting latency timer of device 0000:00:0a.0 to 64
ehci_hcd 0000:00:0a.0: irq 18, pci mem c0000300
ehci_hcd 0000:00:0a.0: new USB bus registered, assigned bus number 1
PCI: cache line size of 32 is not supported by device 0000:00:0a.0
ehci_hcd 0000:00:0a.0: USB f.f enabled, EHCI 1.00, driver 2004-May-10
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci_hcd: block sizes: ed 64 td 64
PCI: Enabling device 0000:00:09.0 (0000 -> 0002)
ohci_hcd 0000:00:09.0: OHCI Host Controller
PCI: Setting latency timer of device 0000:00:09.0 to 64
ohci_hcd 0000:00:09.0: irq 13, pci mem c0001400
ohci_hcd 0000:00:09.0: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usbcore: registered new driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
brcmboard: brcm_board_init entry
SES: Button Interrupt 0x3 is enabled
SES: LED GPIO 0xc007 is enabled
Serial: BCM63XX driver $Revision: 3.00 $
ttyS0 at MMIO 0xfffe0100 (irq = 10) is a BCM63XX
ttyS1 at MMIO 0xfffe0120 (irq = 11) is a BCM63XX
u32 classifier
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
Initializing IPsec netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
NET: Registered protocol family 15
Ebtables v2.0 registered
NET: Registered protocol family 8
NET: Registered protocol family 20
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
root dev=100000
make ramdisk
RAMDISK: Compressed image found at block 0
root_devic=1:0,flag=8001
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 88k freed
init started: BusyBox v1.00 (2009.09.09-12:43+0000) multi-call binary
Algorithmics/MIPS FPU Emulator v1.5
BusyBox v1.00 (2009.09.09-12:43+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
# usb 1-1: new high speed USB device using address 2
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: USB Model: Storage Device Rev:
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 29120 512-byte hdwr sectors (15 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
sda: sda1
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
USB Mass Storage device found at 2
#
#
#
# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/ram0 2971 805 2013 29% /
# mount /dev/sda1 /mn s / ls
bin etc linuxrc mnt sbin var
dev lib lost+found proc usr
# cd usr
# ls
bin sbin
# cd ..
# ls
bin etc linuxrc mnt sbin var
dev lib lost+found proc usr
# cd /mn
/mn: bad directory
# cd /mnt
# ls
# cd ..
# ls
bin etc linuxrc mnt sbin var
dev lib lost+found proc usr
# mount /dev/sda1 /mnt
VFS: Can't find ext3 filesystem on dev sda1.
VFS: Can't find ext2 filesystem on dev sda1.
# mount -t squashfs /dev/sda1 /mnt
mount: Mounting /dev/sda1 on /mnt failed: Device or resource busy
# umount /mn cd /mnt
# ls
bin etc linuxrc proc usr webs
dev lib mnt sbin var
# ls -l
drwxr-xr-x 1 0 0 728 Sep 2 2009 bin
drwxr-xr-x 1 0 0 1103 Sep 2 2009 dev
drwxr-xr-x 1 0 0 277 Sep 2 2009 etc
drwxr-xr-x 1 0 0 127 Sep 2 2009 lib
lrwxrwxrwx 1 0 0 11 Sep 2 2009 linuxrc -> bin/busybox
drwxr-xr-x 1 0 0 0 Sep 2 2009 mnt
drwxr-xr-x 1 0 0 0 Sep 2 2009 proc
drwxr-xr-x 1 0 0 170 Sep 2 2009 sbin
drwxr-xr-x 1 0 0 17 Sep 2 2009 usr
drwxr-xr-x 1 0 0 0 Sep 2 2009 var
drwxr-xr-x 1 0 0 2476 Sep 2 2009 webs
# cd ..
# ls
bin etc linuxrc mnt sbin var
dev lib lost+found proc usr
# root prir iv buys sy b /bin/busybox
BusyBox v1.00 (2009.09.09-12:43+0000) multi-call binary
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use, and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
[, bunzip2, busybox, bzcat, cat, chmod, chown, chroot, cp, date,
dd, df, dirname, dmesg, du, echo, egrep, expr, false, fgrep, find,
free, grep, gunzip, gzip, httpd, ifconfig, init, insmod, kill,
killall, klogd, linuxrc, ln, logger, logread, losetup, ls, lsmod,
md5sum, mkdir, mkfifo, mknod, mkswap, modprobe, more, mount, msh,
mv, netstat, ping, pivot_root, ps, pwd, reboot, rm, rmmod, route,
sed, sendarp, sh, sleep, sort, stty, swapoff, swapon, sync, sysinfo,
syslogd, tar, test, tftp, tftpd, time, top, touch, true, tty,
umount, unzip, vconfig, vi, wget, xargs, zcat
# # /bin/busybox pivot_root ls
bin etc linuxrc mnt sbin var
dev lib lost+found proc usr
# cd
# ls
bin etc linuxrc mnt sbin var
dev lib lost+found proc usr
# pv ivot_root . /mnt
# chroot cd /mnt
# ls
bin etc linuxrc proc usr webs
dev lib mnt sbin var
# cd ..
# ls
bin etc linuxrc mnt sbin var
dev lib lost+found proc usr
# Shell exited after timing out
BusyBox v1.00 (2009.09.09-12:43+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
# Shell exited after timing out
BusyBox v1.00 (2009.09.09-12:43+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.
# |
|