root.bin/linux.bin/webpages-gw.bin をどうやって1ファイルにまとめて いるかを探す。
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3$ tar zxvf rtl819x.tar.gz : :
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3$ cd rtl819x yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ grep fw.bin * yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ grep fw.bin */* target/Makefile:FW_BIN = image/fw.bin yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$これだ。
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ cd target
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x/target$ less Makefile
:
:
$(MGBIN) -c -o $(FW_BIN) $(ROOT_BIN) $(WEBPAGE_BIN) $(LINUX_BIN); \
:
:
MGBIN は、
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x/target$ grep MGBIN Makefile
MGBIN = $(DIR_USERS)/boa/tools/mgbin
MGBIN = $(DIR_USERS)/goahead-2.1.1/LINUX/mgbin
$(MGBIN) -c -o $(FW_NOWEB_BIN) $(ROOT_BIN) $(LINUX_BIN);
$(MGBIN) -c -o $(FW_BIN) $(ROOT_BIN) $(WEBPAGE_BIN) $(LINUX_BIN); \
$(MGBIN) -c -o $(FW_BIN) $(ROOT_BIN) $(WEBPAGE_BIN) $(LINUX_BIN); \
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x/target$
tools にあるようだ。
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x/target$ cd .. yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ ls users/boa/tools/ Makefile compweb.c cvcfg.c cvimg.c mgbin.c ramdisk.c yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$がー。Cで書いてあるみたい。
見てみる
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ less users/boa/tools/mgbin.cヘッダは、IMG_HEADER_T で、その定義は apmib.h に有りそう。
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ ls users/boa/apmib/apmib.h users/boa/apmib/apmib.h yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$見てみる
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ less !$
:
:
/* Firmware image file header */
typedef struct img_header {
unsigned char signature[SIGNATURE_LEN];
unsigned int startAddr;
unsigned int burnAddr;
unsigned int len;
}__PACK__ IMG_HEADER_T, *IMG_HEADER_Tp;
SIGNATURE_LEN は、
#define SIGNATURE_LEN 4
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ od -xc image/fw.bin |head -4
0000000 3677 6763 0100 0000 0100 0000 0100 c4db
w 6 c g \0 001 \0 \0 \0 001 \0 \0 \0 001 333 304
0000020 5a42 3968 4131 2659 5953 9ce0 5df8 a905
B Z h 9 1 A Y & S Y 340 234 370 ] 005 251
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$
img_header にあてはめてみる。
signature が "w6cg" これは
#define WEB_HEADER ((char *)"w6cg")
startAddr が 0100 0000
これはリトルエンディアン??
burnAddr も 0100 0000
len は 0100 c4db
webpages.bin のサイズは、、、
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ ls -l image/webpages.bin
-rw-r--r-- 1 yasunari yamasita 121812 Jan 4 18:04 image/webpages.bin
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$ od -xc !$ | head -4
od -xc image/webpages.bin | head -4
0000000 3677 6763 0100 0000 0100 0000 0100 c4db
w 6 c g \0 001 \0 \0 \0 001 \0 \0 \0 001 333 304
0000020 5a42 3968 4131 2659 5953 9ce0 5df8 a905
B Z h 9 1 A Y & S Y 340 234 370 ] 005 251
yasunari@vl:/mnt/share/rtl819x-SDK-v3.2.3/rtl819x$
121812 バイト = 0x1dbd4 ということは、ヘッダの 0x10 を考慮すると、では、startAddr/burnAddr の 0x10000 って何?
|
← TAXAN MeoBank SD ファームウェアと RTL819X SDK |
山下康成の きばらないブログ |
→ TAXAN MeoBank SD ファームウェアの展開 |
Copyright (C) 2003-2017 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市