0. Introduction
   This file will show you how to build the RTL8186 linux system. Besides, It
will guide you how to download the built image to Realtek EV (Evaluation)
board for testing. PLEASE NOTE, the download image will overwrite the original
image existed in the flash memory of EV board.

1. Build Environment
   RedHat 7.3/9.0

2. Toolchain
   You have to install the RTL8186 LINUX toolchain in advance.

3. Build Linux kernel
3.1 AP version (with 8M/1M SDRAM/Flash)
   - cd linux-2.4.18
   - make distclean
   - cp arch/mips/defconfig-rtl8186-ap  .config
   - make menuconfig
   - exit and save
   - make dep;make 
   - cd rtkload
   - make
   - ==> 'rtkrom' is the linux image
     ==> 'linux.bin' is the image, which could be booted by Realtek boot code.

3.2 GW version (with 8M/2M SDRAM/Flash)
   - cd linux-2.4.18
   - make distclean
   - cp arch/mips/defconfig-rtl8186-gw-8m  .config
   - make menuconfig
   - exit and save
   - make dep;make 
   - cd rtkload
   - make
   - ==> 'rtkrom' is the linux image
     ==> 'linux.bin' is the image, which could be booted by Realtek boot code.
         (linux.bin doesn't include the ramdisk image)

3.3 VPN version (with 16M/2M SDRAM/Flash)
   - cd linux-2.4.18
   - make distclean
   - cp arch/mips/defconfig-rtl8186-gw-vpn  .config
   - make menuconfig
   - exit and save
   - make dep;make 
   - cd rtkload
   - make
   - ==> 'rtkrom' is the linux image
     ==> 'linux.bin' is the image, which could be booted by Realtek boot code.
   	
3.4 GW SNMP version (with 16M/2M SDRAM/Flash)
   - cd linux-2.4.18
   - make distclean
   - cp arch/mips/defconfig-rtl8186-gw-snmp  .config
   - make menuconfig
   - exit and save
   - make dep;make 
   - cd rtkload
   - make
   - ==> 'nfjrom' is the linux image
     ==> 'linux.bin' is the image, which could be booted by Realtek boot code.
     
4. Build Linux application
  - edit Makefile to add your application for compile

5. Edit script file for system initialization
   - cd etc
   - edit 'profile' to setup system in initialization

6. Make a application image
   - edit 'mkimg' to add in application program or create any entry
     in target file system when system is up
   - 'make gw' will build the root file system for gw platform
   - ==> 'root.bin' is the rootfs image 
   - 'make ap' will build the ramdisk for ap platform  
   - ==> 'ramdisk.img' application image will be put into 
   	  linux-2.4.18/arch/mips/ramdisk
   - 'make gw-snmp' will build the root file system for gw platform with SNMP support
   - ==> 'root-lzma.bin' is the rootfs image 

7. Download image to Realtek EV (evaluation) board for testing
   - Use a RS232 cable to connect COM port between a LINUX PC and EV board.
   - Connect LINUX PC Ethernet port to the LAN port of EV board. Set PC IP
     address to 192.168.1.x (e.g., type 'ifconfig eth0 192.168.1.1').
   - Start a COM port console (e.g., minicom), and set COM port setting to
     38400, 8N1 and no flow control.
   - Power on EV board, and press 'ESC' key in COM port console to escape the
     booting process. If ok, you may see "<RealTek>" prompt in the console.
   - Start a TFTP client in LINUX PC, and connect to 192.168.1.6. Set file
     type to binary mode, and put boot file (boot) to TFTP server of EV
     board.
   - After TFTP upload is completed, you may see a message in COM port
     console as "**TFTP Client Upload File Size = 00xxxxxx Bytes at 80300000".
     "00xxxxxx" and "80300000" indicate the hex value of upload file size and
     memory address stored image respectively.
   - Type command in COM port console as "flw 8000 80300000 xxxxxx" to write
     upload image to flash address "8000" from SDRAM address "80500000" with
     size "xxxxxx" in hex (NOTE).
   - Then that, you may see a message shown in COM port console as:
     "Flash Program from 80300000 to 00000000 with 00xxxxxx bytes     ?
     (Y)es, (N)o->". Type 'y' to confirm the writing. After the updated is
     completed, you could power off/on the EV board, and the new linux image
     will be effective (NOTE).
  
	NOTE: Normally, these two steps commands (write flash memory) are not
			necessary because the boot code will recognized the Linux image
			and write it into flash memory automatically after image is 
			uploaded.  

8. Bootcode
   - Support auto burning when image header is recognized .
   - Enter bootcode monitor when reload button is pressed over 1 sec.

08/1/2006
