在openwrt启动过程中,向串口的输出主要有四个部分(如下所示):U-Boot 的输出,kernel的输出,文件系统启动过程中的输出(也是kernel输出的一部分,但是打印语句在系统的配置文件中),系统输出。
U-Boot 1.1.4 (Aug 27 2011 - 10:39:39)
>
AP121-2MB (ar9330) U-boot
>
DRAM: 32 MB
led turning on for 1s...
id read 0x100000ff
flash size 4194304, sector count = 64
Flash: 4 MB
Using default environment
>
In: serial
Out: serial
Err: serial
Net: ag7240_enet_initialize...
No valid address in Flash. Using fixed address
No valid address in Flash. Using fixed address
: cfg1 0x5 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
ag7240_phy_setup
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
ag7240_phy_setup
eth1 up
eth0, eth1
Autobooting in 1 seconds
## Booting image at 9f020000 ...
Uncompressing Kernel Image ... OK
>
Starting kernel ...
Linux version 2.6.39.4 (juhosg@idared) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #1 Tue Sep 20 14:44:37 CEST 2011
bootconsole [early0] enabled
CPU revision is: 00019374 (MIPS 24Kc)
SoC: Atheros AR9330 rev 1
Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
Determined physical RAM map:
memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00002000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00002000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
Kernel command line: board=TL-WR703N console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
Memory: 29376k/32768k available (2009k kernel code, 3392k reserved, 386k data, 180k init, 0k highmem)
SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:80
Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
MIPS: machine is TP-LINK TL-WR703N v1
bio: create slab at 0
Switching to clocksource MIPS
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
msgmni has been set to 57
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
console [ttyATH0] enabled, bootconsole disabled
console [ttyATH0] enabled, bootconsole disabled
Atheros AR71xx SPI Controller driver version 0.2.4
m25p80 spi0.0: found s25sl032a, expected m25p80
m25p80 spi0.0: s25sl032a (4096 Kbytes)
Searching for RedBoot partition table in spi0.0 at offset 0x3e0000
Searching for RedBoot partition table in spi0.0 at offset 0x3f0000
No RedBoot partition table detected in spi0.0
spi0.0: no WRT160NL signature found
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000020000 : "u-boot"
0x000000020000-0x000000120000 : "kernel"
0x000000120000-0x0000003f0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=2A0000, len=150000
0x0000002a0000-0x0000003f0000 : "rootfs_data"
0x0000003f0000-0x000000400000 : "art"
0x000000020000-0x0000003f0000 : "firmware"
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xb9000000, irq 4
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear
All bugs added by David S. Miller
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing unused kernel memory: 180k freed
linput: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/input0
Button Hotplug driver version 0.4.1
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
eth0: link up (100Mbps/Full duplex)
- regular preinit -
JFFS2 notice: (371) jffs2_build_xattr_subsystem: complete building xattr subsystem, 17 of xdatum (0 unchecked, 16 orphan) and 30 of xref (0 dead,
16 orphan) found.
switching to jffs2
- init -
BusyBox v1.18.5 (2011-09-17 19:36:07 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
>
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
ATTITUDE ADJUSTMENT (bleeding edge, r28258) ----------
* 1/4 oz Vodka Pour all ingredients into mixing
* 1/4 oz Gin tin with ice, strain into glass.
* 1/4 oz Amaretto
* 1/4 oz Triple sec
* 1/4 oz Peach schnapps
* 1/4 oz Sour mix
* 1 splash Cranberry juice
-----------------------------------------------------
root@OpenWrt:/#
echo 0 > /proc/sys/kernel/printk
cat /proc/sys/kernel/printk
0 4 1 7
option 'conloglevel' '1'
option 'kconloglevel' '1'
如果使用了后面的设置,前面的printk中的第一个值会被强制设置为system中的值。
U-Boot 1.1.2 (Dec 14 2005 - 12:12:14)
U-Boot code: 21F00000 -> 21F1666C BSS: -> 21F1AC44
RAM Configuration:
Bank #0: 20000000 32 MB
Flash: 16 MB
In: serial
Out: serial
Err: serial
Hit any key to stop autoboot: 0
U-Boot> setenv bootargs console=none root=/dev/ram
U-Boot> saveenv
Saving Environment to Flash...
Un-Protected 1 sectors
Erasing Flash...
. done
Erased 1 sectors
Writing to Flash...\done
static struct mtd_partition tl_wr1043nd_partitions[] = {
{
.name = "u-boot",
.offset = 0,
.size = 0x020000,
.mask_flags = MTD_WRITEABLE,
} , {
.name = "kernel",
.offset = 0x020000,
.size = 0x140000,
} , {
.name = "rootfs",
.offset = 0x160000,
.size = 0x690000,
} , {
.name = "art",
.offset = 0x7f0000,
.size = 0x010000,
.mask_flags = MTD_WRITEABLE,
} , {
.name = "firmware",
.offset = 0x020000,
.size = 0x7d0000,
}
};
去掉“u-boot”块中的“.mask_flags = MTD_WRITEABLE”,并重新编译镜像。
然后重新编译镜像。
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.2
tftpboot 0x80000000 openwrt-xxx-generic-xxx-squashfs-factory.bin
erase 0x9f020000 +0x332004
cp.b 0x80000000 0x9f020000 0x332004
boot.m 0x9f020000
#! /bin/sh
UBOOT_NAME=/tmp/tuboot.bin
RAW_UBOOT_LEN=`wc -c $UBOOT_NAME | awk '{print $1 }'`
NEED_PAD_LEN=$((0x1fc00-$RAW_UBOOT_LEN))
#Generate a file used as pad ...
dd if=/dev/zero of=/tmp/pad.bin bs=1 count=$NEED_PAD_LEN
cat $UBOOT_NAME /tmp/pad.bin >/tmp/tuboot_0x1fc00.bin
echo "Backup some config first,just like MAC address ..."
dd if=/dev/mtd0 of=/tmp/config.bin bs=1 skip=$((0x1fc00))
cat /tmp/tuboot_0x1fc00.bin /tmp/config.bin >uboot.bin
cat uboot.bin >/dev/mtdblock0
sync
3. tftp 工具:http://download.csdn.net/detail/wonengxing/5851839