CONFIG_PREBOOT@u-boot

 現在envファイルの読み込みはbootcmdでext2load,load_env,env_parseを実行しています。
 bootcmdは、autoboot時に実行されます。

 u-bootのmainloopをみていると、autoboot前にCONFIG_PREBOOTというのがあって

#ifdef CONFIG_PREBOOT
        if ((p = getenv ("preboot")) != NULL) {
# ifdef CONFIG_AUTOBOOT_KEYED
                int prev = disable_ctrlc(1);    /* disable Control C checking */
# endif

# ifndef CONFIG_SYS_HUSH_PARSER
                run_command (p, 0);
# else
                parse_string_outer(p, FLAG_PARSE_SEMICOLON |
                                    FLAG_EXIT_FROM_LOOP);
# endif

# ifdef CONFIG_AUTOBOOT_KEYED
                disable_ctrlc(prev);    /* restore Control C checking */
# endif
        }
#endif /* CONFIG_PREBOOT */

 ひとつコマンドを実行できるみたい。
 これにext2load,load_env,env_parseを仕込めば最初からncで起動できるかな?
 実験してみます。ー>実験完了
serial log

U-Boot 2011.09 (Feb 23 2013 - 14:09:33)

CPU: SH4
BOARD: IO-DATA Usl-5p
DRAM:  64MB
Using default environment

PCI: SH7751 PCI host bridge found.
PCI:   Bus Dev VenId DevId Class Int
  00:00.0     - 10ec:8139 - Network controller
  00:02.0     - 1033:0035 - Serial bus controller
  00:02.1     - 1033:0035 - Serial bus controller
  00:02.2     - 1033:00e0 - Serial bus controller
In:    serial
Out:   serial
Err:   serial
Bus 0: OK
  Device 0: Model: HMS360402D5CF00  Firm: DN2OC60G Ser#: N2GRN0HA
            Type: Removable Hard Disk
            Capacity: 1953.0 MB = 1.9 GB (3999744 x 512)
Net:   RTL8139#0Warning: failed to set MAC address

Loading file "/boot/u-boot.env" from ide device 0:1 (hda1)
66 bytes read
setenv ipaddr = 192.168.?.?
setenv ncip = 192.168.?.?
setenv stdin = nc
setenv stdout = nc

nc log

setenv stderr = nc
Hit any key to stop autoboot:  0 
Loading file "/boot/vmlinuz" from ide device 0:1 (hda1)

File not found /boot/vmlinuz

 最初からは無理ですが、autoboot前にenvファイルをロードできました。 http://www42.tok2.com/home/forester3/uboot/u-boot_usl5pa.bin  ?でもncからautobootが止められない。おかしいなあ。シリアルからはちゃんと止められます。  console.cを調べていくと、CONFIG_SYS_CONSOLE_IS_IN_ENVというのがあって、READMEにconsoleを切り替える時は設定してね!らしいことが書いてある。  設定漏れですかね? > elijahさん  ん〜難しい。  u-boot_usl5pb.binつくってみますか〜 -> ダメでした