HiWiFi

来自IPTV爱好者
跳转至: 导航搜索

软件分析

HiWiFi busybox | HiWiFi ipks | HiWiFi lsmod

硬件配置

  • SOC采用ATHEROS的AR9331
  • RAM容量为64MB
  • Flash容量为16MB
  • 内置8GB U盘

详见:HiWiFi硬件

Bootloader

Bootloader采用U-Boot,启动信息如下:

U-Boot 1.1.4 (Jun 20 2013 - 13:51:18)

AP121 (ar9331) U-boot

DRAM:  64 MB
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16777216, sector count = 256
Flash: 16 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
ag7240 gmac: cfg1 0x5 cfg2 0x7114
eth0: 00:de:ad:be:ef:32
eth0 up
ag7240 gmac: cfg1 0xf cfg2 0x7214
eth1: 00:de:ad:be:ef:32
athrs26_reg_init_lan
ATHRS26: resetting s26
ATHRS26: s26 reset done
eth1 up
eth0, eth1
Autobooting in 2 seconds
## Booting image at 9f020000 ...
   Image Name:   tw150v1-Linux-3.3.8
   Created:      2013-06-20   8:19:36 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    982592 Bytes = 959.6 kB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9f020040 ...OK
   Uncompressing Kernel Image ... OK

如果在上电时按住RESET按钮,则U-Boot进入Recovery模式,自动从192.168.1.88 TFTP服务器上下载恢复固件。恢复固件recovery.bin实际上就是HiWiFi的升级固件,可从HiWiFi官方网站上下载,最新的HC6361 - 0.775.784s的下载链接为:http://updaterom.ikcd.net/upgrade_file/HC6361-0.775.784s_130802-131633-96d56f0c,将下载的固件换名为recovery.bin即可。当然也可以对固件进行适当修改,例如打开dropbear服务。刷recovery.bin的日志见:HiWiFi刷恢复固件

如果按Ctrl+C,则中断下载过程,进入U-Boot命令状态。

Autobooting in 2 seconds
Using eth1 device
TFTP from server 192.168.1.88; our IP address is 192.168.1.119
Filename 'recovery.bin'.
Load address: 0x81000000
Loading: T T T 
Retry count exceeded; starting again

U-Boot命令:

hornet> ?
bootd   - boot default, i.e., run 'bootcmd'
?       - alias for 'help'
boot    - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
cp      - memory copy
erase   - erase FLASH memory
help    - print online help
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
progmac - Set ethernet MAC addresses
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
setenv  - set environment variables
tftpboot- boot image via network using TFTP protocol
version - print monitor version

hornet> printenv
bootargs=console=ttyS0,115200 root=31:01 rootfstype=squashfs init=/sbin/init mtdparts=spi0.0:64k(u-boot),64k(bdinfo),1280k(kernel),14848k(rootfs),64k(nvram),64k(art)
bootcmd=bootm 0x9f020000
bootdelay=2
baudrate=115200
ethaddr=0x00:0xde:0xad:0xbe:0xef:0x32
stdin=serial
stdout=serial
stderr=serial
serverip=192.168.1.88
ipaddr=192.168.1.119
ethact=eth1

Environment size: 353/65532 bytes

在U-Boot命令行环境下可以下载固件,并更新Flash中的固件,具体参考HiWiFi固件更新

Linux内核

内核启动日志信息:

Starting kernel ...

[    0.000000] Linux version 3.3.8 (kai.li@WEB-9-1-43) (gcc version 4.6.4 20121210 (prerelease) (Linaro GCC 4.6-2012.12) ) #2 Thu Jun 20 14:33:10 CST 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: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00004000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  board=HC6361 console=ttyATH0,115200 mtdparts=spi0.0:64k(u- boot),64k(bdinfo)ro,1280k(kernel),14848k(rootfs),64k(nvram),64k(art)ro,16128k@0x20000(firmware) rootfstype=squashfs,jffs2 noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    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] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 61516k/65536k available (2106k kernel code, 4020k reserved, 537k data, 176k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, 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.090000] gpiochip_add: registered GPIOs 0 to 29 on device: ath79
[    0.100000] MIPS: machine is Turbo Wireless TW150V1 Board
[    0.550000] bio: create slab <bio-0> at 0
[    0.560000] Switching to clocksource MIPS
[    0.560000] NET: Registered protocol family 2
[    0.570000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.570000] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.580000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.580000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.590000] TCP reno registered
[    0.590000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.600000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.600000] NET: Registered protocol family 1
[    0.630000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.630000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.640000] msgmni has been set to 120
[    0.640000] io scheduler noop registered
[    0.650000] io scheduler deadline registered (default)
[    0.650000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.660000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
[    0.670000] console [ttyATH0] enabled, bootconsole disabled
[    0.670000] console [ttyATH0] enabled, bootconsole disabled
[    0.680000] m25p80 spi0.0: found w25q128, expected m25p80
[    0.680000] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.690000] 7 cmdlinepart partitions found on MTD device spi0.0
[    0.690000] Creating 7 MTD partitions on "spi0.0":
[    0.700000] 0x000000000000-0x000000010000 : "u-boot"
[    0.710000] 0x000000010000-0x000000020000 : "bdinfo"
[    0.710000] 0x000000020000-0x000000160000 : "kernel"
[    0.720000] 0x000000160000-0x000000fe0000 : "rootfs"
[    0.720000] mtd: partition "rootfs" set to be root filesystem
[    0.730000] mtd: partition "rootfs_data" created automatically, ofs=6F0000, len=8F0000 
[    0.730000] 0x0000006f0000-0x000000fe0000 : "rootfs_data"
[    0.740000] 0x000000fe0000-0x000000ff0000 : "nvram"
[    0.750000] 0x000000ff0000-0x000001000000 : "art"
[    0.750000] 0x000000020000-0x000000fe0000 : "firmware"
[    0.760000] ar933x_spiop_ioc: init
[    0.780000] ag71xx_mdio: probed
[    0.780000] eth0: Atheros AG71xx at 0xba000000, irq 5
[    1.340000] eth0: Found an AR7240/AR9330 built-in switch
[    2.370000] eth1: Atheros AG71xx at 0xb9000000, irq 4
[    2.920000] ag71xx ag71xx.0: eth1: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
[    2.930000] TCP cubic registered
[    2.930000] NET: Registered protocol family 17
[    2.940000] 8021q: 802.1Q VLAN Support v1.8
[    2.950000] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    2.950000] Freeing unused kernel memory: 176k freed

OpenWrt版本信息:

/etc # cat openwrt_release 
DISTRIB_ID="OpenWrt"
DISTRIB_RELEASE="Bleeding Edge"
DISTRIB_REVISION="0.684.672s"
DISTRIB_CODENAME="barrier_breaker"
DISTRIB_TARGET="ar71xx/generic"
DISTRIB_DESCRIPTION="OpenWrt Barrier Breaker 0.684.672s"