刷好了 Chaos Calmer 15.05 RC3(20150816 SVN:r46572)的 8MB 固件,便可以啓動 TP-Link TL-WR703N 路由器,透過 TL-WR703N 路由器的 TTL 輸出,可以在 PC 電腦用 Windows Terminals 或 Hyper Terminals 顯示路由器的 Firmware U-Boot過程,Firmware 程式過程包括 U-Boot 及 Linux 核心系統(Kernel ),基本上 U-Boot 是像電腦 BIOS (Basic Input/Output System) 或 MCU 的 Bootloader,所以當了解 U-Boot 的過程,再看程式碼便會容易理解。
TP-Link TL-WR703N 路由器的 8MB 固件程式過程 |
1… 初始化 CPU
2… 初始化 記憶體 (DDR RAM)
3… 記憶體劃分、分配棧、資料、配置參數、以及 U-Boot 代碼在記憶體中的位置。
4… 初始化 串口 (Serial) 、網口、時鐘
5… 對 U-Boot 代碼作 relocate、malloc6… 進入命令行或者直接啟動 Linux kernel
8MB 固件程式過程顯示:
U-Boot 1.1.4 (Dec 4 2012 - 11:19:40)
AP121 (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 ...
[ 0.000000] Linux version 3.10.4
(alpha@debian) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2012.12 r37742) )
#1 Sat Aug 10 07:17:49 EDT 2013
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 00019374 (MIPS
24Kc)
[ 0.000000] SoC: Atheros AR9330 rev 1
[ 0.000000] Clocks: CPU:400.000MHz,
DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[ 0.000000] Determined physical RAM map:
[ 0.000000]
memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty -
disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal
[mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each
node
[ 0.000000] Early memory node ranges
[ 0.000000] node
0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 64kB,
VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way,
VIPT, cache aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone
order, mobility grouping on. Total
pages: 8128
[ 0.000000] Kernel command line: board=TL-WR703N console=ttyATH0,115200
rootfstype=squashfs,jffs2 noinitrd
[ 0.000000] PID hash table entries: 128
(order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table
entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries:
2048 (order: 1, 8192 bytes)
[ 0.000000] Writing ErrCtl
register=00000000
[ 0.000000] Readback ErrCtl
register=00000000
[ 0.000000] Memory: 28848k/32768k available
(2197k kernel code, 3920k reserved, 587k data, 220k init, 0k highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3,
MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:51
[ 0.000000] Calibrating delay loop...
265.42 BogoMIPS (lpj=1327104)
[ 0.080000] pid_max: default: 32768
minimum: 301
[ 0.080000] Mount-cache hash table entries:
512
[ 0.090000] NET: Registered protocol family
16
[ 0.100000] MIPS: machine is TP-LINK
TL-WR703N v1
[ 0.350000] bio: create slab
[ 0.360000] Switching to clocksource MIPS
[ 0.360000] NET: Registered protocol family
2
[ 0.370000] TCP established hash table
entries: 512 (order: 0, 4096 bytes)
[ 0.370000] TCP bind hash table entries:
512 (order: -1, 2048 bytes)
[ 0.370000] TCP: Hash tables configured
(established 512 bind 512)
[ 0.380000] TCP: reno registered
[ 0.380000] UDP hash table entries: 256
(order: 0, 4096 bytes)
[ 0.390000] UDP-Lite hash table entries:
256 (order: 0, 4096 bytes)
[ 0.400000] NET: Registered protocol family
1
[ 0.420000] squashfs: version 4.0 (2009/01/31)
Phillip Lougher
[ 0.420000] jffs2: version 2.2 (NAND)
(SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.430000] msgmni has been set to 56
[ 0.440000] io scheduler noop registered
[ 0.440000] io scheduler deadline
registered (default)
[ 0.440000] Serial: 8250/16550 driver, 1
ports, IRQ sharing disabled
[ 0.450000] ar933x-uart: ttyATH0 at MMIO
0x18020000 (irq = 11) is a AR933X UART
[ 0.460000] console [ttyATH0] enabled,
bootconsole disabled
[ 0.460000] console [ttyATH0] enabled,
bootconsole disabled
[ 0.470000] ath79-spi ath79-spi: master is
unqueued, this is deprecated
[ 0.480000] m25p80 spi0.0: found en25q64,
expected m25p80
[ 0.480000] m25p80 spi0.0: en25q64 (8192
Kbytes)
[ 0.490000] 5 tp-link partitions found on
MTD device spi0.0
[ 0.490000] Creating 5 MTD partitions on
"spi0.0":
[ 0.500000] 0x000000000000-0x000000020000 :
"u-boot"
[ 0.500000] 0x000000020000-0x000000118b2c : "kernel"
[ 0.510000] mtd: partition
"kernel" must either start or end on erase block boundary or be
smaller than an erase block -- forcing read-only
[ 0.520000] 0x000000118b2c-0x0000007f0000 : "rootfs"
[ 0.520000] mtd: partition
"rootfs" must either start or end on erase block boundary or be
smaller than an erase block -- forcing read-only
[ 0.540000] mtd: partition
"rootfs" set to be root filesystem
[ 0.540000] mtd: partition
"rootfs_data" created automatically, ofs=0x3d0000, len=0x420000
[ 0.550000] 0x0000003d0000-0x0000007f0000 : "rootfs_data"
[ 0.560000] 0x0000007f0000-0x000000800000 : "art"
[ 0.560000] 0x000000020000-0x0000007f0000 : "firmware"
[ 0.580000] libphy: ag71xx_mdio: probed
[ 0.590000] eth0: Atheros AG71xx at 0xb9000000,
irq 4, mode:MII
[ 1.140000] ag71xx ag71xx.0 eth0: connected
to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
[ 1.150000] TCP: cubic registered
[ 1.150000] NET: Registered protocol family
17
[ 1.160000] 8021q: 802.1Q VLAN Support v1.8
[ 1.170000] VFS: Mounted root (squashfs
filesystem) readonly on device 31:2.
[ 1.180000] Freeing unused kernel memory:
220K (80319000 - 80350000)
procd:
Console is alive
procd: -
watchdog -
[ 3.480000] SCSI subsystem initialized
[ 3.620000] usbcore: registered new interface
driver usbfs
[ 3.620000] usbcore: registered new
interface driver hub
[ 3.630000] usbcore: registered new device
driver usb
[ 4.320000] ehci_hcd: USB 2.0 'Enhanced'
Host Controller (EHCI) Driver
[ 4.320000] ehci-platform: EHCI
generic platform driver
[ 4.330000] ehci-platform
ehci-platform: EHCI Host Controller
[ 4.330000] ehci-platform ehci-platform:
new USB bus registered, assigned bus number 1
[ 4.340000] ehci-platform
ehci-platform: irq 3, io mem 0x1b000000
[ 4.370000] ehci-platform
ehci-platform: USB 2.0 started, EHCI 1.00
[ 4.370000] hub 1-0:1.0: USB hub
found
[ 4.370000] hub 1-0:1.0: 1 port detected
[ 4.580000] ohci_hcd: USB 1.1 'Open' Host
Controller (OHCI) Driver
[ 4.690000] usbcore: registered new
interface driver usb-storage
procd: -
preinit -
Press the
[f] key and hit [enter] to enter failsafe mode
[ 7.210000] eth0: link up (100Mbps/Full
duplex)
mount_root:
jffs2 is not ready - marker found
[ 8.620000] eth0: link down
procd: -
early -
procd: -
watchdog -
procd: -
init -
Please
press Enter to activate this console.
[ 11.490000] Loading modules backported from
Linux version master-2013-06-27-0-gdcfa6d5
[ 11.500000] Backport generated by
backports.git backports-20130617-4-ge3220f5
[ 11.530000] cfg80211: Calling CRDA to
update world regulatory domain
[ 11.530000] cfg80211: World regulatory
domain updated:
[ 11.540000] cfg80211: (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[ 11.540000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz),
(300 mBi, 2000 mBm)
[ 11.550000] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz),
(300 mBi, 2000 mBm)
[ 11.560000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz),
(300 mBi, 2000 mBm)
[ 11.570000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz),
(300 mBi, 2000 mBm)
[ 11.570000] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz),
(300 mBi, 2000 mBm)
[ 11.860000] NET: Registered protocol family
10
[ 12.670000] ieee80211 phy0: Atheros AR9330
Rev:1 mem=0xb8100000, irq=2
[ 12.680000] cfg80211: Calling CRDA for
country: US
[ 12.680000] cfg80211: Regulatory domain
changed to country: US
[ 12.690000] cfg80211: (start_freq - end_freq @ bandwidth),
(max_antenna_gain, max_eirp)
[ 12.690000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz),
(300 mBi, 2700 mBm)
[ 12.700000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz),
(300 mBi, 1700 mBm)
[ 12.710000] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz),
(300 mBi, 2000 mBm)
[ 12.720000] cfg80211: (5490000 KHz - 5600000 KHz @ 40000 KHz),
(300 mBi, 2000 mBm)
[ 12.730000] cfg80211: (5650000 KHz - 5710000 KHz @ 40000 KHz),
(300 mBi, 2000 mBm)
[ 12.730000] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz),
(300 mBi, 3000 mBm)
[ 13.400000] PPP generic driver version 2.4.2
[ 13.580000] ip_tables: (C) 2000-2006
Netfilter Core Team
[ 13.600000] xt_time: kernel timezone is
-0000
[ 13.800000] NET: Registered protocol family
24
[ 13.920000] nf_conntrack version 0.5.0
(454 buckets, 1816 max)
[ 14.790000] ip6_tables: (C) 2000-2006
Netfilter Core Team
[ 14.940000] Linux video capture interface:
v2.00
[ 14.970000] usbcore: registered new
interface driver uvcvideo
[ 14.980000] USB Video Class driver (1.1.1)
[ 19.990000] IPv6: ADDRCONF(NETDEV_UP): eth0:
link is not ready
[ 19.990000] device eth0 entered promiscuous
mode
[ 20.010000] IPv6: ADDRCONF(NETDEV_UP):
br-lan: link is not ready
[ 20.300000] eth0: link up (100Mbps/Full
duplex)
[ 20.300000] br-lan: port 1(eth0) entered
forwarding state
[ 20.310000] br-lan: port 1(eth0) entered
forwarding state
[ 20.310000] IPv6: ADDRCONF(NETDEV_CHANGE):
eth0: link becomes ready
[ 20.320000] IPv6: ADDRCONF(NETDEV_CHANGE):
br-lan: link becomes ready
[ 22.310000] br-lan: port 1(eth0) entered
forwarding state
[ 25.370000] IPv6: ADDRCONF(NETDEV_UP):
wlan0: link is not ready
[ 25.390000] device wlan0 entered
promiscuous mode
[ 25.420000] IPv6: ADDRCONF(NETDEV_UP):
wlan0: link is not ready
[ 25.430000] IPv6: ADDRCONF(NETDEV_CHANGE):
wlan0: link becomes ready
[ 25.440000] br-lan: port 2(wlan0) entered
forwarding state
[ 25.440000] br-lan: port 2(wlan0) entered
forwarding state
[ 27.440000] br-lan: port 2(wlan0) entered
forwarding state
[ 38.420000] jffs2_scan_eraseblock(): End of
filesystem marker found at 0x0
[ 38.440000] jffs2_build_filesystem():
unlocking the mtd device... done.
[ 38.440000] jffs2_build_filesystem():
erasing all blocks after the end marker... done.
[ 53.450000] jffs2: notice: (1055)
jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum
(0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
procd: -
init complete -
|
※ Das U-Boot
2015 年 8月 26日 天氣報告
氣溫:28.4度 @ 21:40
相對濕度:百分之 84%
天氣:微雨
沒有留言:
張貼留言