タグ: AR1022

WR8750Nメモ

  • WR8750NからOpenWrtのKernel Loaderが実行できるところまで行った
  • Kernel LoaderがLZMAを展開中(または展開直後)に例外吐いてhard resetが掛かる
  • データのchecksum算出方法は依然として謎
    • data length値(hex)が2byteに収まる場合単純なIPヘッダチェックサムと同じ算出方法、2byteを超える場合は計算方法に何らかの変化が生じる模様
    • checksum算出範囲: data length~data lengthに示すdata終端

コード

devadd/wr8750n – musashino-build/openwrt

イメージ生成コード
plain.binは作業用の仮のモノ。

define Device/nec_wr8750n
  ATH_SOC := ar9344
  DEVICE_TITLE := NEC Aterm WR8750N
  KERNEL := kernel-bin | append-dtb | lzma | loader-kernel
  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel
  LOADER_TYPE := bin
  IMAGES += plain.bin
  IMAGE/plain.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
    append-rootfs | pad-rootfs
  DEVICE_PACKAGES := kmod-usb-core kmod-usb2
endef
TARGET_DEVICES += nec_wr8750n

エラー

boot> start tftp load openwrt-ath79-generic-nec_wr8750
end tftp load length = 3505264
start memory load ... 
memory load complete
  begin  : 0x80060000
  length : 3505240
  startup: 0x80060000
boot
begin  : 0x80060000
length : 3505240
startup: 0x80060000
option: 0x0


OpenWrt kernel loader for AR7XXX/AR9XXX
Copyright (C) 2011 Gabor Juhos 
Decompressing kernel... 
                       @

exception!!
ExcCode:10 "Reserved instruction exception"

afbf001c (param1) 0c01ff11 (param2) 00402025 (param3) 
8fbf001c (param4) 03e00008 (errno) 40008028 (cause) 
27bdffe0 (ctx) 00003825 (fpcsr) 6c0d1a80 (badvaddr) 
afa00014 (pad) 10004002 (sr) 80a00c10 (epc) 
00000001 (lo) 00000000 (hi) 
00000000 (zero) a0080000 (at) 80ab1a80 (v0) 80a00d80 (v1) 
ffffffe0 (a0) 80a01510 (a1) 00000001 (a2) 80a01511 (a3) 
80a00258 (t0) 0000000a (t1) 80a015fd (t2) 00a51a9e (t3) 
00000000 (t4) 01000000 (t5) 80d59c04 (t6) 80a0028c (t7) 
80a00900 (s0) 80060000 (s1) 0000030d (s2) 005f0e3f (s3) 
00000001 (s4) 2cfa97a1 (s5) 80d5a930 (s6) 00000010 (s7) 
00000035 (t8) 80a00120 (t9) 00000028 (k0) 0000007c (k1) 
e087c52b (gp) 80d59c00 (sp) 00000001 (fp) 80a00bec (ra) 

call trace
pc: 80a00c10



IPL:HARD-RESET
(以降通常のブートシーケンス)

手順

※Windows使用する場合。

  • WR8750Nをブート
  • ESC連打でブートを止める
  • Bootloaderのコンソールに入る
  • tftpd 実行
  • Windows側で tftp -i 192.168.0.1 PUT filename
    (Windowsのpublicファイアウォールは切るかtftpポートを開ける)
  • WR8750N側でロードされる
  • boot 実行

WN-AG300DGR stock -> OpenWrt (ath79)

おおよそ組み上がり、(たぶん)最後のテストとしてfactoryファームの動作確認。

Stopping processmanager ...            OK
Stopping DDNS ...            OK
Stopping DHCP server ...            Closing ntpclient ...            Stopping DDNS ...            OK
Stopping LLTD ...            FAILED
FAILED
lld2d is still running kill it again.
vpnClose ...
wanClose ...
Close WAN: eth0.2 ...
Stopping DNS Proxy ...            OK
Starting sxuptpClose ...           Done !
OK
Stopping processmanager ...            OK
Stopping DHCP server ...            Stopping httpd server ...            OK
vpnClose ...
wanClose ...
Close WAN: eth0.2 ...
Stopping radio1 ....              Stopping WLAN ....              OK
OK
SW modules close completed
starting pid 5312, tty '': '/etc/reboot.sh'
/etc/reboot.sh: line 2: cannot create /proc/sys/kernel/printk: nonexistent directory
starting pid 5322, tty '': '/etc/reboot.sh'
/etc/reboot.sh: line 2: cannot create /proc/sys/kernel/printk: nonexistent directory
The system is gSignal 15 received - terminating
Signal 15 received - terminating
Sending SIGKILL to all processes
Requesting system reboot


U-Boot 1.2.6 (Jun 29 2012 - 16:01:45)
U-boot MI124
DRAM:  
sri
Wasp 1.1
wasp_ddr_initial_config(254): (16bit) ddr2 init
64 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 231k for U-Boot at: 83fc4000
Reserving 192k for malloc() at: 83f94000
Reserving 44 Bytes for Board Info at: 83f93fd4
Reserving 36 Bytes for Global Data at: 83f93fb0
Reserving 128k for boot params() at: 83f73fb0
Stack Pointer at: 83f73f98
Now running in RAM - U-Boot at: 83fc4000
id read 0xc217
venid=c2,devid=17
Unknown flash device
Flash: 16 MB
pcie module ID is correct 0x30168c 
In:    serial
Out:   serial
Err:   serial
Net:   ag934x_enet_initialize...
No valid address in Flash. Using fixed address
 wasp  reset mask:c03300 
WASP  ----> S17 PHY *
: cfg1 0x7 cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
athrs17_reg_init: complete
eth0 up
eth0
ag934x_enet_initialize...
No valid address in Flash. Using fixed address
 wasp  reset mask:c03300 
WASP  ----> S17 PHY *
: cfg1 0xf cfg2 0x7114
eth0: 00:03:7f:09:0b:ad
eth0 up
eth0

Please choose the operation: 
   1: Load system code to SDRAM via TFTP. 
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
                                                                                                                               0  
   
3: System Boot system code via Flash.
## Booting image at 9f040000 ...
   Image Name:   MIPS OpenWrt Linux-4.14.79
   Created:      2018-11-10  14:13:03 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1601981 Bytes =  1.5 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum at 0x9f040040 ...OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 67108864

Starting kernel ...

[    0.000000] Linux version 4.14.79 (musashino205@Taiha.Net) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r0+8446-568be2bd68)) #0 Sat Nov 10 14:13:03 2018
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is I-O DATA WN-AG300DGR
[    0.000000] SoC: Atheros AR9342 rev 1
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    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] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x8c/0x474 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[    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] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 58272K/65536K available (3734K kernel code, 145K rwdata, 904K rodata, 1224K init, 204K bss, 7264K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] CPU clock: 535.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7144898866 ns
[    0.000011] sched_clock: 32 bits at 267MHz, resolution 3ns, wraps every 8027976190ns
[    0.008248] Calibrating delay loop... 266.64 BogoMIPS (lpj=1333248)
[    0.094814] pid_max: default: 32768 minimum: 301
[    0.099911] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.106908] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.119387] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.129811] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.136335] pinctrl core: initialized pinctrl subsystem
[    0.143000] NET: Registered protocol family 16
[    0.155738] PCI host bridge /ahb/apb/pcie-controller@180c0000 ranges:
[    0.162609]  MEM 0x0000000010000000..0x0000000013ffffff
[    0.168121]   IO 0x0000000000000000..0x0000000000000000
[    0.194700] PCI host bridge to bus 0000:00
[    0.199041] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[    0.206343] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.212217] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.219384] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.228285] pci 0000:00:00.0: BAR 0: assigned [mem 0x10000000-0x1001ffff 64bit]
[    0.236058] pci 0000:00:00.0: BAR 6: assigned [mem 0x10020000-0x1002ffff pref]
[    0.244390] clocksource: Switched to clocksource MIPS
[    0.250977] NET: Registered protocol family 2
[    0.256503] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.263871] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.270643] TCP: Hash tables configured (established 1024 bind 1024)
[    0.277515] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.283691] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.290663] NET: Registered protocol family 1
[    0.300766] Crashlog allocated RAM at address 0x3f00000
[    0.307884] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.320350] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.326555] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.347692] io scheduler noop registered
[    0.351830] io scheduler deadline registered (default)
[    0.357737] ar7200-usb-phy usb-phy: phy reset is missing
[    0.365641] pinctrl-single 1804002c.pinmux: 544 pins at pa b804002c size 68
[    0.374187] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.381815] console [ttyS0] disabled
[    0.385689] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 8, base_baud = 1562500) is a 16550A
[    0.394804] console [ttyS0] enabled
[    0.394804] console [ttyS0] enabled
[    0.402355] bootconsole [early0] disabled
[    0.402355] bootconsole [early0] disabled
[    0.418448] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[    0.423744] 7 fixed-partitions partitions found on MTD device spi0.0
[    0.430367] Creating 7 MTD partitions on "spi0.0":
[    0.435338] 0x000000000000-0x000000030000 : "u-boot"
[    0.441467] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.447971] 0x000000040000-0x000000f50000 : "firmware"
[    0.475930] 2 uimage-fw partitions found on MTD device firmware
[    0.482069] 0x000000040000-0x0000001d0000 : "kernel"
[    0.488104] 0x0000001d0000-0x000000f50000 : "rootfs"
[    0.494070] mtd: device 4 (rootfs) set to be root filesystem
[    0.500021] 1 squashfs-split partitions found on MTD device rootfs
[    0.506428] 0x0000006e0000-0x000000f50000 : "rootfs_data"
[    0.512891] 0x000000f50000-0x000000f90000 : "manufacture"
[    0.519439] 0x000000f90000-0x000000fa0000 : "backup"
[    0.525549] 0x000000fa0000-0x000000ff0000 : "storage"
[    0.531668] 0x000000ff0000-0x000001000000 : "art"
[    0.538836] libphy: Fixed MDIO Bus: probed
[    0.884815] libphy: ag71xx_mdio: probed
[    0.891675] switch0: Atheros AR8327 rev. 2 switch registered on mdio-bus.0
[    1.544491] ag71xx 19000000.eth: invalid MAC address, using random address
[    1.885582] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:00 [uid=004dd033, driver=Atheros AR8216/AR8236/AR8316]
[    1.897391] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    1.906679] NET: Registered protocol family 10
[    1.916681] Segment Routing with IPv6
[    1.920582] NET: Registered protocol family 17
[    1.925297] 8021q: 802.1Q VLAN Support v1.8
[    1.938210] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    1.953498] Freeing unused kernel memory: 1224K
[    1.958215] This architecture does not have kernel memory protection.
[    2.554438] random: fast init done
[    2.665220] init: Console is alive
[    2.668995] init: - watchdog -
[    4.250027] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.486584] usbcore: registered new interface driver usbfs
[    4.492382] usbcore: registered new interface driver hub
[    4.498050] usbcore: registered new device driver usb
[    4.549089] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.567564] SCSI subsystem initialized
[    4.578182] ehci-platform: EHCI generic platform driver
[    4.583923] ehci-platform 1b000000.usb: EHCI Host Controller
[    4.589872] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[    4.598108] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[    4.624421] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[    4.631871] hub 1-0:1.0: USB hub found
[    4.636347] hub 1-0:1.0: 1 port detected
[    4.646317] usbcore: registered new interface driver usb-storage
[    4.653677] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.663277] init: - preinit -
[    5.972933] random: jshn: uninitialized urandom read (4 bytes read)
[    6.278310] random: jshn: uninitialized urandom read (4 bytes read)
[    6.722333] random: jshn: uninitialized urandom read (4 bytes read)
[    7.054624] urandom_read: 3 callbacks suppressed
[    7.054634] random: jshn: uninitialized urandom read (4 bytes read)
[    8.239205] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    8.245398] IPv6: ADDRCONF(NETDEV_UP): eth0.1: link is not ready
[    8.305822] random: procd: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    9.315684] eth0: link up (1000Mbps/Full duplex)
[    9.320638] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    9.327690] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[   11.510664] mount_root: loading kmods from internal overlay
[   11.564171] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[   11.573039] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[   12.542861] block: attempting to load /etc/config/fstab
[   12.554598] block: unable to load configuration (fstab: Entry not found)
[   12.561623] block: no usable configuration
[   12.566901] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[   12.626528] urandom-seed: Seed file not found (/etc/urandom.seed)
[   12.773715] procd: - early -
[   12.777263] procd: - watchdog -
[   13.474402] eth0: link down
[   13.507923] procd: - watchdog -
[   13.511493] procd: - ubus -
[   13.677651] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.877918] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.886292] procd: - init -
Please press Enter to activate this console.
[   14.473893] kmodloader: loading kernel modules from /etc/modules.d/*
[   14.629712] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   14.661929] Loading modules backported from Linux version v4.19-rc5-0-g6bf4ca7fbc85
[   14.669909] Backport generated by backports.git v4.19-rc5-1-0-g05571dcd
[   14.765265] ip_tables: (C) 2000-2006 Netfilter Core Team
[   14.784874] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   14.904288] usbcore: registered new interface driver ums-alauda
[   14.931470] usbcore: registered new interface driver ums-cypress
[   14.949806] usbcore: registered new interface driver ums-datafab
[   14.960569] usbcore: registered new interface driver ums-freecom
[   14.969417] usbcore: registered new interface driver ums-isd200
[   14.978153] usbcore: registered new interface driver ums-jumpshot
[   14.986882] usbcore: registered new interface driver ums-karma
[   14.996062] usbcore: registered new interface driver ums-sddr09
[   15.004897] usbcore: registered new interface driver ums-sddr55
[   15.013818] usbcore: registered new interface driver ums-usbat
[   15.054310] xt_time: kernel timezone is -0000
[   15.146398] PPP generic driver version 2.4.2
[   15.158642] NET: Registered protocol family 24
[   15.215803] ath9k 18100000.wmac: Direct firmware load for ath9k-eeprom-ahb-18100000.wmac.bin failed with error -2
[   15.226471] ath9k 18100000.wmac: Falling back to user helper
[   15.496276] ieee80211 phy0: Atheros AR9340 Rev:1 mem=0xb8100000, irq=11
[   15.503537] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[   15.624740] ieee80211 phy1: Atheros AR9300 Rev:3 mem=0xb0000000, irq=13
[   15.804970] kmodloader: done loading kernel modules from /etc/modules.d/*
[   34.516931] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   34.556522] device eth0 entered promiscuous mode
[   34.563371] br-lan: port 1(eth0.1) entered blocking state
[   34.569046] br-lan: port 1(eth0.1) entered disabled state
[   34.575034] device eth0.1 entered promiscuous mode
[   34.664690] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   34.764798] IPv6: ADDRCONF(NETDEV_UP): eth0.2: link is not ready
[   35.555969] eth0: link up (1000Mbps/Full duplex)
[   35.560819] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   35.634617] br-lan: port 1(eth0.1) entered blocking state
[   35.640213] br-lan: port 1(eth0.1) entered forwarding state
[   35.646234] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.2: link becomes ready
[   35.754475] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   39.112728] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   39.184715] jffs2_build_filesystem(): unlocking the mtd device... 
[   39.184728] done.
[   39.193099] jffs2_build_filesystem(): erasing all blocks after the end marker... 
[  100.259717] done.
[  100.269500] jffs2: notice: (1736) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  100.699228] overlayfs: upper fs does not support tmpfile.



BusyBox v1.29.3 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r0+8451-3cf3f5b782
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/#

WN-AG300DGR

いつものように某フリマサイトを流し見ていた際に見つけた機種。調べてみるとAR934xらしいと思われたため、今回購入した。
弄っていくのでメモ。

Switch

zone WAN LAN
port
(WN-AG300DGR)
インターネット LAN4 LAN3 LAN2 LAN1
port
(AR8327N)
port5 port4 port3 port2 port1

MAC

  • LAN: 34:76:C5:xx:xx:78 (u-boot-env, ethaddr)
  • WAN: 34:76:C5:xx:xx:7A (u-boot-env, wanaddr)
  • 2.4G: 34:76:C5:xx:xx:78
  • 5G: 34:76:C5:xx:xx:79

U-Boot

  • help
    ar7240> help
    ?       - alias for 'help'
    autoscr - run script from memory
    base    - print or set address offset
    boot    - boot default, i.e., run 'bootcmd'
    bootd   - boot default, i.e., run 'bootcmd'
    bootelf - Boot from an ELF image in memory
    bootm   - boot application image from memory
    bootp   - boot image via network using BootP/TFTP protocol
    bootvx  - Boot vxWorks from an ELF image
    cmp     - memory compare
    coninfo - print console devices and information
    cp      - memory copy
    crc32   - checksum calculation
    echo    - echo args to console
    erase   - erase FLASH memory
    exit    - exit script
    flinfo  - print FLASH memory information
    go      - start application at address 'addr'
    help    - print online help
    iminfo  - print header information for application image
    imls    - list all images found in flash
    itest   - return true/false on integer compare
    loadb   - load binary file over serial line (kermit mode)
    loads   - load S-Record file over serial line
    loady   - load binary file over serial line (ymodem mode)
    loop    - infinite loop on address range
    md      - memory display
    mii     - MII utility commands
    mm      - memory modify (auto-incrementing)
    mtest   - simple RAM test
    mw      - memory write (fill)
    nfs     - boot image via network using NFS protocol
    nm      - memory modify (constant address)
    pci     - list and access PCI Configuration Space
    ping    - send ICMP ECHO_REQUEST to network host
    printenv- print environment variables
    progmac - Set ethernet MAC addresses
    protect - enable or disable FLASH write protection
    rarpboot- boot image via network using RARP/TFTP protocol
    reset   - Perform RESET of the CPU
    run     - run commands in an environment variable
    saveenv - save environment variables to persistent storage
    setenv  - set environment variables
    sleep   - delay execution for some time
    test    - minimal test like /bin/sh
    tftpboot- boot image via network using TFTP protocol
    version - print monitor version
    

  • version
    ar7240> version
    
    U-Boot 1.2.6 (Jun 29 2012 - 16:01:45)
    

  • printenv
    ar7240> printenv
    bootargs=console=ttyS0,115200 root=31:02 rootfstype=squashfs,jffs2 init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),2752k(rootfs),896k(uImage),64k(NVRAM),64k(ART)
    bootcmd=bootm 0x9f040000
    bootdelay=4
    baudrate=115200
    ethaddr="34:76:C5:**:**:78"
    ipaddr=192.168.1.1
    serverip=192.168.1.101
    sn=000890267
    hw_ver=1.0.0
    hw_id=030A0047
    pro_id=000
    country=000
    domain=1
    wanaddr=34:76:C5:**:**:7A
    wlanaddr=00:AA:BB:CC:DD:12
    snextra=00000000B7G000890267
    bootfile=uImage
    dir=
    bc=mi124_f1e
    lu=tftp 0x80060000 ${dir}u-boot.bin&&erase 0x9f000000 +$filesize;cp.b $fileaddr 0x9f000000 $filesize
    lf=tftp 0x80060000 ${dir}${bc}-jffs2&&erase 0x9f050000 +$filesize;cp.b $fileaddr 0x9f050000 $filesize
    lk=tftp 0x80060000 ${dir}vmlinux_${bc}.lzma.uImage&&erase 0x9f300000 +$filesize;cp.b $fileaddr 0x9f300000 $filesize
    ethact=eth0
    op_mode=0
    uboot_ver=1.2.6.351
    stdin=serial
    stdout=serial
    stderr=serial
    
    Environment size: 894/65532 bytes
    

  • mii device
    ar7240> mii device
    MII devices: 'eth0' 
    Current device: 'eth0'
    

  • md.l 0x1805002c 1
    ar7240> md.l 0x1805002c 1
    1805002c: 06000000    ....
    

Kernel

パスワード要求されるため、コンソールにログインできない。
→ 入れた。

  • uname -a
    # uname -a
    Linux WN-AG300DGR 2.6.34.5 #2 Thu Sep 7 16:36:28 CST 2017 mips unknown
    

  • cat /proc/version
    # cat /proc/version
    Linux version 2.6.34.5 (root@Norkay-BM6835-BM6635-BP6335) (gcc version 4.3.4 (Buildroot 2010.05) ) #2 Thu Sep 7 16:36:28 CST 2017
    
  • cat /proc/cpuinfo
    # cat /proc/cpuinfo
    system type             : Atheros AR934x
    processor               : 0
    cpu model               : MIPS 74Kc V4.12
    BogoMIPS                : 267.26
    CPUClock                : 535
    wait instruction        : yes
    microsecond timers      : yes
    tlb_entries             : 32
    extra interrupt vector  : yes
    hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x0ff8, 0x0ff8, 0x0ff8]
    ASEs implemented        : mips16 dsp
    shadow register sets    : 1
    core                    : 0
    VCED exceptions         : not available
    VCEI exceptions         : not available
    
  • cat /proc/meminfo
    # cat /proc/meminfo
    MemTotal:          62020 kB
    MemFree:           25452 kB
    Buffers:            2644 kB
    Cached:            10944 kB
    SwapCached:            0 kB
    Active:             5592 kB
    Inactive:           9712 kB
    Active(anon):       2120 kB
    Inactive(anon):      144 kB
    Active(file):       3472 kB
    Inactive(file):     9568 kB
    Unevictable:         400 kB
    Mlocked:               0 kB
    SwapTotal:             0 kB
    SwapFree:              0 kB
    Dirty:                 0 kB
    Writeback:             0 kB
    AnonPages:          2128 kB
    Mapped:             2624 kB
    Shmem:               148 kB
    Slab:              16156 kB
    SReclaimable:        776 kB
    SUnreclaim:        15380 kB
    KernelStack:         528 kB
    PageTables:          372 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:       31008 kB
    Committed_AS:       6848 kB
    VmallocTotal:    1048372 kB
    VmallocUsed:        1188 kB
    VmallocChunk:    1033456 kB
    
  • cat /proc/mtd
    # cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 01000000 00010000 "ALL"
    mtd1: 00030000 00010000 "Bootloader"
    mtd2: 00010000 00010000 "Config"
    mtd3: 00f10000 00010000 "Kernel"
    mtd4: 00da0000 00010000 "apps"
    mtd5: 00040000 00010000 "manufacture"
    mtd6: 00010000 00010000 "backup"
    mtd7: 00050000 00010000 "storage"
    mtd8: 00010000 00010000 "caldata"
    
  • bootlog (op_mode=0)
    U-Boot 1.2.6 (Jun 29 2012 - 16:01:45)
    U-boot MI124
    DRAM:  
    sri
    Wasp 1.1
    wasp_ddr_initial_config(254): (16bit) ddr2 init
    64 MB
    Top of RAM usable for U-Boot at: 84000000
    Reserving 231k for U-Boot at: 83fc4000
    Reserving 192k for malloc() at: 83f94000
    Reserving 44 Bytes for Board Info at: 83f93fd4
    Reserving 36 Bytes for Global Data at: 83f93fb0
    Reserving 128k for boot params() at: 83f73fb0
    Stack Pointer at: 83f73f98
    Now running in RAM - U-Boot at: 83fc4000
    id read 0xc217
    venid=c2,devid=17
    Unknown flash device
    Flash: 16 MB
    pcie module ID is correct 0x30168c 
    In:    serial
    Out:   serial
    Err:   serial
    Net:   ag934x_enet_initialize...
    No valid address in Flash. Using fixed address
     wasp  reset mask:c03300 
    WASP  ----> S17 PHY *
    : cfg1 0x7 cfg2 0x7114
    eth0: 00:03:7f:09:0b:ad
    athrs17_reg_init: complete
    eth0 up
    eth0
    ag934x_enet_initialize...
    No valid address in Flash. Using fixed address
     wasp  reset mask:c03300 
    WASP  ----> S17 PHY *
    : cfg1 0xf cfg2 0x7114
    eth0: 00:03:7f:09:0b:ad
    eth0 up
    eth0
    
    Please choose the operation: 
       1: Load system code to SDRAM via TFTP. 
       3: Boot system code via Flash (default).
       4: Entr boot command line interface.
                                                                                                                                   0  
       
    3: System Boot system code via Flash.
    ## Booting image at 9f040000 ...
       Image Name:   Linux Kernel Image
       Created:      2017-09-07   8:36:32 UTC
       Image Type:   MIPS Linux Kernel Image (lzma compressed)
       Data Size:    1468045 Bytes =  1.4 MB
       Load Address: 80002000
       Entry Point:  80006110
       Verifying Checksum at 0x9f040040 ...OK
       Uncompressing Kernel Image ... OK
    No initrd
    ## Transferring control to Linux (at address 80006110) ...
    ## Giving linux memsize in bytes, 67108864
    
    Starting kernel ...
    
    Booting Atheros AR934x
    init started: BusyBox v1.7.5 (2017-09-07 16:33:23 CST)
    starting pid 717, tty '/dev/console': '/sbin/config_init'
    mknod: /dev/ttyS0: File exists
    mknod: /dev/ttyS1: File exists
    Config Init version: 1.07.000.52 date: 2017/09/07
    Sun Jan  1 00:00:00 UTC 2017
    ln: /lib/./modules: File exists
    starting pid 777, tty '/dev/ttyS0': '/sbin/config_term'
    ************************************************************************
    *                              WN-AG300DGR                             *
    ************************************************************************
    
    KernelApp/Ramdisk Ver:1.07.000.52                        Date:2017/09/07
    password: 
    

  • bootlog (op_mode=1)
    U-Boot 1.2.6 (Jun 29 2012 - 16:01:45)
    U-boot MI124
    DRAM:  
    sri
    Wasp 1.1
    wasp_ddr_initial_config(254): (16bit) ddr2 init
    64 MB
    Top of RAM usable for U-Boot at: 84000000
    Reserving 231k for U-Boot at: 83fc4000
    Reserving 192k for malloc() at: 83f94000
    Reserving 44 Bytes for Board Info at: 83f93fd4
    Reserving 36 Bytes for Global Data at: 83f93fb0
    Reserving 128k for boot params() at: 83f73fb0
    Stack Pointer at: 83f73f98
    Now running in RAM - U-Boot at: 83fc4000
    id read 0xc217
    venid=c2,devid=17
    Unknown flash device
    Flash: 16 MB
    pcie module ID is correct 0x30168c 
    In:    serial
    Out:   serial
    Err:   serial
    Net:   ag934x_enet_initialize...
    No valid address in Flash. Using fixed address
     wasp  reset mask:c03300 
    WASP  ----> S17 PHY *
    : cfg1 0x7 cfg2 0x7114
    eth0: 00:03:7f:09:0b:ad
    athrs17_reg_init: complete
    eth0 up
    eth0
    ag934x_enet_initialize...
    No valid address in Flash. Using fixed address
     wasp  reset mask:c03300 
    WASP  ----> S17 PHY *
    : cfg1 0xf cfg2 0x7114
    eth0: 00:03:7f:09:0b:ad
    eth0 up
    eth0
    
    Please choose the operation: 
       1: Load system code to SDRAM via TFTP. 
       3: Boot system code via Flash (default).
       4: Entr boot command line interface.
                                                                                                                                   2  
    You choosed 3
    
                                                                                                                                    0 
       
    3: System Boot system code via Flash.
    ## Booting image at 9f040000 ...
       Image Name:   Linux Kernel Image
       Created:      2017-09-07   8:36:32 UTC
       Image Type:   MIPS Linux Kernel Image (lzma compressed)
       Data Size:    1468045 Bytes =  1.4 MB
       Load Address: 80002000
       Entry Point:  80006110
       Verifying Checksum at 0x9f040040 ...OK
       Uncompressing Kernel Image ... OK
    No initrd
    ## Transferring control to Linux (at address 80006110) ...
    ## Giving linux memsize in bytes, 67108864
    
    Starting kernel ...
    
    Booting Atheros AR934x
    init started: BusyBox v1.7.5 (2017-09-07 16:33:23 CST)
    starting pid 717, tty '/dev/console': '/sbin/config_init'
    mknod: /dev/ttyS0: File exists
    mknod: /dev/ttyS1: File exists
    Config Init version: 1.07.000.52 date: 2017/09/07
    Sun Jan  1 00:00:00 UTC 2017
    ln: /lib/./modules: File exists
    starting pid 776, tty '/dev/ttyS0': '/sbin/config_term'
    ************************************************************************
    *                              WN-AG300DGR                             *
    ************************************************************************
    
    KernelApp/Ramdisk Ver:1.07.000.52                        Date:2017/09/07
    password: Application Ver:1.07.000.55            Date:2017/09/07
    
    cat: can't open '/apps/lib/modules/2.6.34/modulesApp.dep': No such file or directory
    ln: /sbin/apps_init: File exists
    ln: /sbin/factory_apps_init: File exists
    ln: /sbin/opmode.sh: File exists
    createShareMem keyid 7001 shmId 0
    Set Str value fail but len not in 1 to 32
    checkpApCfg i=29 [ap2ssid]
    Set Str value fail but len not in 1 to 32
    checkpApCfg i=47 [ap3ssid]
    checkpApCfg error!!
    MSGQ_GETID: Cannot get message queue for key[fwmanager]!
    MSGQ_CREATE: create message queue for key[fwmanager], msgQ Id 0
    CTRL_INTERFACE:[/var/sysconfd_if]  CTRL_INTERFACE_IF:[if0]
    
    System Monitoring
    *********************************************************************
    Initializing system environment
    Setting up /tmp directory ...
    Setting up loopback device ...
    ***************************************************
    Radio_1 is in   Access Point[0]
    Radio_2 is in   Access Point[0]
    System is in    AP Router[0]
    ***************************************************
    SEM_GETID got id -1
    Mac: 0, rtcTime:1483228802
    dmesg: klogctl: Function not implemented
    Open file err: /var/cpumhz!
    Starting system logging daemon ...OK
    Setting up Ethernet devices ...
    OK
    Configuring Bridge device ...          OK
    Setting the host&domain name ...Finished.
    Configuring net ...          OK
    Configuring LAN device ...          OK
    
    
    #############################################
    Initialize Radio setting ... OK
    Configuring radio1 setting ... 
    Configuring Atheros device index:0... wifiname=wifi0 , macaddr=34:76:C5:05:F9:78Encryption using WEP ...      
    Encryption using WEP ...      
     ... finished.
    Set Atheros power to 25 (dBm)
    Encryption using WPAWPA2_PSK ...
    Encryption using TKIP CCMP ...
    No WPA/WPA2 Encryption
    No WPA/WPA2 Encryption
    Starting Hostapd ...            OK
    System Debug : gWlan24GOff[-1].
    System Debug : gWlan5GOff[-1].
    System Debug : childSSIDoff[-1].
    athOpen OK
    OK
    
    
    #############################################
    Initialize Radio setting ... OK
    Configuring radio2 setting ... 
    Configuring Atheros device index:1... wifiname=wifi1 , macaddr=34:76:C5:05:F9:79Encryption using WEP ...      
     ... finished.
    Set Atheros power to 25 (dBm)
    Encryption using WPA2-PSK ...
    Encryption using AES ...
    Starting Hostapd ...            OK
    System Debug : gWlan24GOff[-1].
    System Debug : gWlan5GOff[-1].
    System Debug : childSSIDoff[-1].
    athOpen OK
    OK
    Wan Manager...
    Configuring WAN device[WAN0] ...
    Obtaining IP address from DHCP ... 
    No PHY Link
    Set Domain Routing for FLET'S Square Connection...            
    Starting DNS Proxy ...            OK
    Starting DHCP(udhcpd) server ...            FAILED
    Starting FW manager ...           OK
    Starting ntpclient ...            
    Setup tc for QoS ... Disabled
    
    SCHEDULE, ServiceWlanLowRateInit ...service_index[0].
    
    SCHEDULE, ServiceWlsRadioOffInit ...service_index[1].
    
    SCHEDULE, Service5GWlanLowRateInit ...service_index[2].
    
    SCHEDULE, Service5GWlsRadioOffInit ...service_index[3].
    
    SCHEDULE, ServiceLedOffInit ...service_index[4].
    
    SCHEDULE, ServiceLanOffInit ...service_index[5].
    
    SCHEDULE, ServiceWanOffInit ...service_index[6].
    
    SCHEDULE, ServiceLanLowRateInit ...service_index[7].
    
    SCHEDULE, ServicePowerLedInit ...service_index[8].
    
    
    Schedule starting  [scheduleOpen], ...wait result..
    Schedule result :[Disable (No rules)]. 
    
    
    New Schedule starting   .....wait result..
    scheduleOpen2 ,Do all Service init function.
    
    SCHEDULE, ServiceChildStaPassInit ...service_index[0],[do_nothing] 
    
    SCHEDULE, ServiceChildSSIDOnInit ...service_index[1]. 
    
    SCHEDULE, ServiceChildStaDataResetInit ...service_index[2],[do_nothing] 
    New Schedule starting result: OK 
    Configuring network routing and filtering ...Iptable restart VPN ACL ...VPN ACL ...
    OK
    Configuring Bridge filtering ...OK
    Starting SiteBlock server ...            
    Netpacket Filter Open ....              sysGetKernelInfo: netv :1.0
    Kernel netpkt ver netv: 1.0
    OK
    Starting DDNS  ...  Disabled
    Starting UPNPD  ...  WAN Speed = 10 Mbps
    FAILED
    IGMP Proxy is disabled...  Starting HTTPD server ...           OK
    Staring ALG...           OK
    Starting LLTD ...           OK
    Initialization has completed
    *We used 15.570000 seconds to initialize all modules*
    pSEM_GETID got id 65538
    [RMGMT DBG] RMGMT_VERSION: 3.42.32
    Best channel is 1
    Best channel is 40
    *** PROCESS MANAGER Starts ***
    Processmanager update modules
    Reload WAN: eth0.2 ...
    Close WAN: eth0.2 ...
    Configuring WAN device[WAN0] ...
    Obtaining IP address from DHCP ... 
    Err: read_to_buf failed to open file /proc/2895/status!
    No PHY Link
    VPN Disconnect ...
    Phy(eth0.2) link disconnected ...Wait for link recover
    Restarting Iptables ....Clean iptable...OK
    Configuring network routing and filtering ...Iptable restart VPN ACL ...VPN ACL ...
    OK
    OK
    Reloading dnsProxy ...            Stopping DNS Proxy ...            OK
    Set Domain Routing for FLET'S Square Connection...            
    Starting DNS Proxy ...            Err: read_to_buf failed to open file /proc/4184/status!
    Err: read_to_buf failed to open file /proc/4185/status!
    OK
    Processmanager update modules
    
    !!! wrong password !!! 
    password: