2 * (C) Copyright 2000-2006
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
36 #include <environment.h>
38 #include <asm/byteorder.h>
40 #ifdef CFG_HUSH_PARSER
44 DECLARE_GLOBAL_DATA_PTR;
46 extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long *lenp);
48 #define CFG_BOOTM_LEN 0x800000 /* use 8MByte as default max gunzip size */
52 extern void bz_internal_error(int);
55 #if defined(CONFIG_CMD_IMI)
56 static int image_info (unsigned long addr);
59 #if defined(CONFIG_CMD_IMLS)
61 extern flash_info_t flash_info[]; /* info for FLASH chips */
62 static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
65 #ifdef CONFIG_SILENT_CONSOLE
66 static void fixup_silent_linux (void);
69 static void *get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char *argv[],
70 bootm_headers_t *images, ulong *os_data, ulong *os_len);
71 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
74 * Continue booting an OS image; caller already has:
75 * - copied image header to global variable `header'
76 * - checked header magic number, checksums (both header & image),
77 * - verified image architecture (PPC) and type (KERNEL or MULTI),
78 * - loaded (first part of) image to header load address,
79 * - disabled interrupts.
81 typedef void boot_os_fn (cmd_tbl_t *cmdtp, int flag,
82 int argc, char *argv[],
83 bootm_headers_t *images); /* pointers to os/initrd/fdt */
85 extern boot_os_fn do_bootm_linux;
86 static boot_os_fn do_bootm_netbsd;
87 #if defined(CONFIG_LYNXKDI)
88 static boot_os_fn do_bootm_lynxkdi;
89 extern void lynxkdi_boot (image_header_t *);
91 static boot_os_fn do_bootm_rtems;
92 #if defined(CONFIG_CMD_ELF)
93 static boot_os_fn do_bootm_vxworks;
94 static boot_os_fn do_bootm_qnxelf;
95 int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
96 int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
98 #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
99 extern uchar (*env_get_char)(int); /* Returns a character from the environment */
100 static boot_os_fn do_bootm_artos;
103 ulong load_addr = CFG_LOAD_ADDR; /* Default Load Address */
104 static bootm_headers_t images; /* pointers to os/initrd/fdt images */
107 /*******************************************************************/
108 /* bootm - boot application image from image in memory */
109 /*******************************************************************/
110 int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
113 const char *type_name;
114 uint unc_len = CFG_BOOTM_LEN;
115 uint8_t comp, type, os;
118 ulong os_data, os_len;
119 ulong image_start, image_end;
120 ulong load_start, load_end;
124 memset ((void *)&images, 0, sizeof (images));
125 images.verify = getenv_verify();
130 #ifdef CFG_SDRAM_BASE
131 lmb_add(&lmb, CFG_SDRAM_BASE, gd->bd->bi_memsize);
133 lmb_add(&lmb, 0, gd->bd->bi_memsize);
136 /* get kernel image header, start address and length */
137 os_hdr = get_kernel (cmdtp, flag, argc, argv,
138 &images, &os_data, &os_len);
142 show_boot_progress (6);
144 /* get image parameters */
145 switch (gen_image_get_format (os_hdr)) {
146 case IMAGE_FORMAT_LEGACY:
147 type = image_get_type (os_hdr);
148 comp = image_get_comp (os_hdr);
149 os = image_get_os (os_hdr);
151 image_end = image_get_image_end (os_hdr);
152 load_start = image_get_load (os_hdr);
154 #if defined(CONFIG_FIT)
155 case IMAGE_FORMAT_FIT:
156 fit_unsupported ("bootm");
160 puts ("ERROR: unknown image format type!\n");
164 image_start = (ulong)os_hdr;
166 type_name = image_get_type_name (type);
169 * We have reached the point of no return: we are going to
170 * overwrite all exception vector code, so we cannot easily
171 * recover from any failures any more...
173 iflag = disable_interrupts();
175 #ifdef CONFIG_AMIGAONEG3SE
177 * We've possible left the caches enabled during
178 * bios emulation, so turn them off again
181 invalidate_l1_instruction_cache();
188 if (load_start == (ulong)os_hdr) {
189 printf (" XIP %s ... ", type_name);
191 printf (" Loading %s ... ", type_name);
193 memmove_wd ((void *)load_start,
194 (void *)os_data, os_len, CHUNKSZ);
196 load_end = load_start + os_len;
201 printf (" Uncompressing %s ... ", type_name);
202 if (gunzip ((void *)load_start, unc_len,
203 (uchar *)os_data, &os_len) != 0) {
204 puts ("GUNZIP ERROR - must RESET board to recover\n");
205 show_boot_progress (-6);
206 do_reset (cmdtp, flag, argc, argv);
209 load_end = load_start + os_len;
213 printf (" Uncompressing %s ... ", type_name);
215 * If we've got less than 4 MB of malloc() space,
216 * use slower decompression algorithm which requires
217 * at most 2300 KB of memory.
219 int i = BZ2_bzBuffToBuffDecompress ((char*)load_start,
220 &unc_len, (char *)os_data, os_len,
221 CFG_MALLOC_LEN < (4096 * 1024), 0);
223 printf ("BUNZIP2 ERROR %d - must RESET board to recover\n", i);
224 show_boot_progress (-6);
225 do_reset (cmdtp, flag, argc, argv);
228 load_end = load_start + unc_len;
230 #endif /* CONFIG_BZIP2 */
234 printf ("Unimplemented compression type %d\n", comp);
235 show_boot_progress (-7);
239 debug (" kernel loaded at 0x%08lx, end = 0x%08lx\n", load_start, load_end);
240 show_boot_progress (7);
242 if ((load_start < image_end) && (load_end > image_start)) {
243 debug ("image_start = 0x%lX, image_end = 0x%lx\n", image_start, image_end);
244 debug ("load_start = 0x%lx, load_end = 0x%lx\n", load_start, load_end);
246 puts ("ERROR: image overwritten - must RESET the board to recover.\n");
247 do_reset (cmdtp, flag, argc, argv);
250 show_boot_progress (8);
252 lmb_reserve(&lmb, load_start, (load_end - load_start));
255 default: /* handled by (original) Linux case */
257 #ifdef CONFIG_SILENT_CONSOLE
258 fixup_silent_linux();
260 do_bootm_linux (cmdtp, flag, argc, argv, &images);
264 do_bootm_netbsd (cmdtp, flag, argc, argv, &images);
267 #ifdef CONFIG_LYNXKDI
269 do_bootm_lynxkdi (cmdtp, flag, argc, argv, &images);
274 do_bootm_rtems (cmdtp, flag, argc, argv, &images);
277 #if defined(CONFIG_CMD_ELF)
279 do_bootm_vxworks (cmdtp, flag, argc, argv, &images);
283 do_bootm_qnxelf (cmdtp, flag, argc, argv, &images);
289 do_bootm_artos (cmdtp, flag, argc, argv, &images);
294 show_boot_progress (-9);
296 puts ("\n## Control returned to monitor - resetting...\n");
297 do_reset (cmdtp, flag, argc, argv);
303 * get_kernel - find kernel image
304 * @os_data: pointer to a ulong variable, will hold os data start address
305 * @os_len: pointer to a ulong variable, will hold os data length
307 * get_kernel() tries to find a kernel image, verifies its integrity
308 * and locates kernel data.
311 * pointer to image header if valid image was found, plus kernel start
312 * address and length, otherwise NULL
314 static image_header_t *image_get_kernel (ulong img_addr, int verify)
316 image_header_t *hdr = (image_header_t *)img_addr;
318 if (!image_check_magic(hdr)) {
319 puts ("Bad Magic Number\n");
320 show_boot_progress (-1);
323 show_boot_progress (2);
325 if (!image_check_hcrc (hdr)) {
326 puts ("Bad Header Checksum\n");
327 show_boot_progress (-2);
331 show_boot_progress (3);
332 image_print_contents (hdr);
335 puts (" Verifying Checksum ... ");
336 if (!image_check_dcrc (hdr)) {
337 printf ("Bad Data CRC\n");
338 show_boot_progress (-3);
343 show_boot_progress (4);
345 if (!image_check_target_arch (hdr)) {
346 printf ("Unsupported Architecture 0x%x\n", image_get_arch (hdr));
347 show_boot_progress (-4);
354 * get_kernel - find kernel image
355 * @os_data: pointer to a ulong variable, will hold os data start address
356 * @os_len: pointer to a ulong variable, will hold os data length
358 * get_kernel() tries to find a kernel image, verifies its integrity
359 * and locates kernel data.
362 * pointer to image header if valid image was found, plus kernel start
363 * address and length, otherwise NULL
365 static void *get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
366 bootm_headers_t *images, ulong *os_data, ulong *os_len)
370 #if defined(CONFIG_FIT)
372 const char *fit_uname_config = NULL;
373 const char *fit_uname_kernel = NULL;
376 /* find out kernel image address */
378 img_addr = load_addr;
379 debug ("* kernel: default image load address = 0x%08lx\n",
381 #if defined(CONFIG_FIT)
382 } else if (fit_parse_conf (argv[1], load_addr, &img_addr,
383 &fit_uname_config)) {
384 debug ("* kernel: config '%s' from image at 0x%08lx\n",
385 fit_uname_config, img_addr);
386 } else if (fit_parse_subimage (argv[1], load_addr, &img_addr,
387 &fit_uname_kernel)) {
388 debug ("* kernel: subimage '%s' from image at 0x%08lx\n",
389 fit_uname_kernel, img_addr);
392 img_addr = simple_strtoul(argv[1], NULL, 16);
393 debug ("* kernel: cmdline image address = 0x%08lx\n", img_addr);
396 show_boot_progress (1);
397 printf ("## Booting kernel image at %08lx ...\n", img_addr);
399 /* copy from dataflash if needed */
400 img_addr = gen_get_image (img_addr);
402 /* check image type, for FIT images get FIT kernel node */
403 switch (gen_image_get_format ((void *)img_addr)) {
404 case IMAGE_FORMAT_LEGACY:
406 debug ("* kernel: legacy format image\n");
407 hdr = image_get_kernel (img_addr, images->verify);
410 show_boot_progress (5);
412 switch (image_get_type (hdr)) {
414 *os_data = image_get_data (hdr);
415 *os_len = image_get_data_size (hdr);
418 image_multi_getimg (hdr, 0, os_data, os_len);
421 printf ("Wrong Image Type for %s command\n", cmdtp->name);
422 show_boot_progress (-5);
425 images->legacy_hdr_os = hdr;
426 images->legacy_hdr_valid = 1;
429 #if defined(CONFIG_FIT)
430 case IMAGE_FORMAT_FIT:
431 fit_hdr = (void *)img_addr;
432 debug ("* kernel: FIT format image\n");
433 fit_unsupported ("kernel");
437 printf ("Wrong Image Format for %s command\n", cmdtp->name);
441 debug (" kernel data at 0x%08lx, end = 0x%08lx\n",
442 *os_data, *os_data + *os_len);
444 return (void *)img_addr;
448 bootm, CFG_MAXARGS, 1, do_bootm,
449 "bootm - boot application image from memory\n",
450 "[addr [arg ...]]\n - boot application image stored in memory\n"
451 "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n"
452 "\t'arg' can be the address of an initrd image\n"
453 #if defined(CONFIG_OF_LIBFDT)
454 "\tWhen booting a Linux kernel which requires a flat device-tree\n"
455 "\ta third argument is required which is the address of the\n"
456 "\tdevice-tree blob. To boot that kernel without an initrd image,\n"
457 "\tuse a '-' for the second argument. If you do not pass a third\n"
458 "\ta bd_info struct will be passed instead\n"
462 /*******************************************************************/
463 /* bootd - boot default image */
464 /*******************************************************************/
465 #if defined(CONFIG_CMD_BOOTD)
466 int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
470 #ifndef CFG_HUSH_PARSER
471 if (run_command (getenv ("bootcmd"), flag) < 0)
474 if (parse_string_outer (getenv ("bootcmd"),
475 FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0)
482 boot, 1, 1, do_bootd,
483 "boot - boot default, i.e., run 'bootcmd'\n",
487 /* keep old command name "bootd" for backward compatibility */
489 bootd, 1, 1, do_bootd,
490 "bootd - boot default, i.e., run 'bootcmd'\n",
497 /*******************************************************************/
498 /* iminfo - print header info for a requested image */
499 /*******************************************************************/
500 #if defined(CONFIG_CMD_IMI)
501 int do_iminfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
508 return image_info (load_addr);
511 for (arg = 1; arg < argc; ++arg) {
512 addr = simple_strtoul (argv[arg], NULL, 16);
513 if (image_info (addr) != 0)
519 static int image_info (ulong addr)
521 void *hdr = (void *)addr;
523 printf ("\n## Checking Image at %08lx ...\n", addr);
525 switch (gen_image_get_format (hdr)) {
526 case IMAGE_FORMAT_LEGACY:
527 puts (" Legacy image found\n");
528 if (!image_check_magic (hdr)) {
529 puts (" Bad Magic Number\n");
533 if (!image_check_hcrc (hdr)) {
534 puts (" Bad Header Checksum\n");
538 image_print_contents (hdr);
540 puts (" Verifying Checksum ... ");
541 if (!image_check_dcrc (hdr)) {
542 puts (" Bad Data CRC\n");
547 #if defined(CONFIG_FIT)
548 case IMAGE_FORMAT_FIT:
549 puts (" FIT image found\n");
550 fit_unsupported ("iminfo");
554 puts ("Unknown image format!\n");
562 iminfo, CFG_MAXARGS, 1, do_iminfo,
563 "iminfo - print header information for application image\n",
565 " - print header information for application image starting at\n"
566 " address 'addr' in memory; this includes verification of the\n"
567 " image contents (magic number, header and payload checksums)\n"
572 /*******************************************************************/
573 /* imls - list all images found in flash */
574 /*******************************************************************/
575 #if defined(CONFIG_CMD_IMLS)
576 int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
582 for (i = 0, info = &flash_info[0];
583 i < CFG_MAX_FLASH_BANKS; ++i, ++info) {
585 if (info->flash_id == FLASH_UNKNOWN)
587 for (j = 0; j < info->sector_count; ++j) {
589 hdr = (void *)info->start[j];
593 switch (gen_image_get_format (hdr)) {
594 case IMAGE_FORMAT_LEGACY:
595 if (!image_check_magic (hdr))
598 if (!image_check_hcrc (hdr))
601 printf ("Legacy Image at %08lX:\n", (ulong)hdr);
602 image_print_contents (hdr);
604 puts (" Verifying Checksum ... ");
605 if (!image_check_dcrc (hdr)) {
606 puts ("Bad Data CRC\n");
611 #if defined(CONFIG_FIT)
612 case IMAGE_FORMAT_FIT:
613 printf ("FIT Image at %08lX:\n", (ulong)hdr);
614 fit_unsupported ("imls");
631 "imls - list all images found in flash\n",
633 " - Prints information about all images found at sector\n"
634 " boundaries in flash.\n"
638 /*******************************************************************/
639 /* helper routines */
640 /*******************************************************************/
641 #ifdef CONFIG_SILENT_CONSOLE
642 static void fixup_silent_linux ()
644 char buf[256], *start, *end;
645 char *cmdline = getenv ("bootargs");
647 /* Only fix cmdline when requested */
648 if (!(gd->flags & GD_FLG_SILENT))
651 debug ("before silent fix-up: %s\n", cmdline);
653 if ((start = strstr (cmdline, "console=")) != NULL) {
654 end = strchr (start, ' ');
655 strncpy (buf, cmdline, (start - cmdline + 8));
657 strcpy (buf + (start - cmdline + 8), end);
659 buf[start - cmdline + 8] = '\0';
661 strcpy (buf, cmdline);
662 strcat (buf, " console=");
665 strcpy (buf, "console=");
668 setenv ("bootargs", buf);
669 debug ("after silent fix-up: %s\n", buf);
671 #endif /* CONFIG_SILENT_CONSOLE */
674 /*******************************************************************/
675 /* OS booting routines */
676 /*******************************************************************/
678 static void do_bootm_netbsd (cmd_tbl_t *cmdtp, int flag,
679 int argc, char *argv[],
680 bootm_headers_t *images)
682 void (*loader)(bd_t *, image_header_t *, char *, char *);
683 image_header_t *os_hdr, *hdr;
684 ulong kernel_data, kernel_len;
688 #if defined(CONFIG_FIT)
689 if (!images->legacy_hdr_valid) {
690 fit_unsupported_reset ("NetBSD");
691 do_reset (cmdtp, flag, argc, argv);
694 hdr = images->legacy_hdr_os;
697 * Booting a (NetBSD) kernel image
699 * This process is pretty similar to a standalone application:
700 * The (first part of an multi-) image must be a stage-2 loader,
701 * which in turn is responsible for loading & invoking the actual
702 * kernel. The only differences are the parameters being passed:
703 * besides the board info strucure, the loader expects a command
704 * line, the name of the console device, and (optionally) the
705 * address of the original image header.
708 if (image_check_type (hdr, IH_TYPE_MULTI)) {
709 image_multi_getimg (hdr, 1, &kernel_data, &kernel_len);
715 #if defined (CONFIG_8xx_CONS_SMC1)
717 #elif defined (CONFIG_8xx_CONS_SMC2)
719 #elif defined (CONFIG_8xx_CONS_SCC2)
721 #elif defined (CONFIG_8xx_CONS_SCC3)
729 for (i = 2, len = 0; i < argc; i += 1)
730 len += strlen (argv[i]) + 1;
731 cmdline = malloc (len);
733 for (i = 2, len = 0; i < argc; i += 1) {
735 cmdline[len++] = ' ';
736 strcpy (&cmdline[len], argv[i]);
737 len += strlen (argv[i]);
739 } else if ((cmdline = getenv ("bootargs")) == NULL) {
743 loader = (void (*)(bd_t *, image_header_t *, char *, char *))image_get_ep (hdr);
745 printf ("## Transferring control to NetBSD stage-2 loader (at address %08lx) ...\n",
748 show_boot_progress (15);
751 * NetBSD Stage-2 Loader Parameters:
752 * r3: ptr to board info data
755 * r6: boot args string
757 (*loader) (gd->bd, os_hdr, consdev, cmdline);
760 #ifdef CONFIG_LYNXKDI
761 static void do_bootm_lynxkdi (cmd_tbl_t *cmdtp, int flag,
762 int argc, char *argv[],
763 bootm_headers_t *images)
765 image_header_t *hdr = images->legacy_hdr_os;
767 #if defined(CONFIG_FIT)
768 if (!images->legacy_hdr_valid) {
769 fit_unsupported_reset ("Lynx");
770 do_reset (cmdtp, flag, argc, argv);
774 lynxkdi_boot ((image_header_t *)hdr);
776 #endif /* CONFIG_LYNXKDI */
778 static void do_bootm_rtems (cmd_tbl_t *cmdtp, int flag,
779 int argc, char *argv[],
780 bootm_headers_t *images)
782 image_header_t *hdr = images->legacy_hdr_os;
783 void (*entry_point)(bd_t *);
785 #if defined(CONFIG_FIT)
786 if (!images->legacy_hdr_valid) {
787 fit_unsupported_reset ("RTEMS");
788 do_reset (cmdtp, flag, argc, argv);
792 entry_point = (void (*)(bd_t *))image_get_ep (hdr);
794 printf ("## Transferring control to RTEMS (at address %08lx) ...\n",
797 show_boot_progress (15);
801 * r3: ptr to board info data
803 (*entry_point)(gd->bd);
806 #if defined(CONFIG_CMD_ELF)
807 static void do_bootm_vxworks (cmd_tbl_t *cmdtp, int flag,
808 int argc, char *argv[],
809 bootm_headers_t *images)
812 image_header_t *hdr = images->legacy_hdr_os;
814 #if defined(CONFIG_FIT)
816 fit_unsupported_reset ("VxWorks");
817 do_reset (cmdtp, flag, argc, argv);
821 sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into string */
822 setenv("loadaddr", str);
823 do_bootvx(cmdtp, 0, 0, NULL);
826 static void do_bootm_qnxelf(cmd_tbl_t *cmdtp, int flag,
827 int argc, char *argv[],
828 bootm_headers_t *images)
832 image_header_t *hdr = images->legacy_hdr_os;
834 #if defined(CONFIG_FIT)
835 if (!images->legacy_hdr_valid) {
836 fit_unsupported_reset ("QNX");
837 do_reset (cmdtp, flag, argc, argv);
841 sprintf(str, "%x", image_get_ep (hdr)); /* write entry-point into string */
842 local_args[0] = argv[0];
843 local_args[1] = str; /* and provide it via the arguments */
844 do_bootelf(cmdtp, 0, 2, local_args);
848 #if defined(CONFIG_ARTOS) && defined(CONFIG_PPC)
849 static void do_bootm_artos (cmd_tbl_t *cmdtp, int flag,
850 int argc, char *argv[],
851 bootm_headers_t *images)
856 int i, j, nxt, len, envno, envsz;
858 void (*entry)(bd_t *bd, char *cmdline, char **fwenv, ulong top);
859 image_header_t *hdr = images->legacy_hdr_os;
861 #if defined(CONFIG_FIT)
862 if (!images->legacy_hdr_valid) {
863 fit_unsupported_reset ("ARTOS");
864 do_reset (cmdtp, flag, argc, argv);
869 * Booting an ARTOS kernel image + application
872 /* this used to be the top of memory, but was wrong... */
874 /* get stack pointer */
875 asm volatile ("mr %0,1" : "=r"(top) );
877 debug ("## Current stack ends at 0x%08lX ", top);
879 top -= 2048; /* just to be sure */
880 if (top > CFG_BOOTMAPSZ)
884 debug ("=> set upper limit to 0x%08lX\n", top);
886 /* first check the artos specific boot args, then the linux args*/
887 if ((s = getenv( "abootargs")) == NULL && (s = getenv ("bootargs")) == NULL)
890 /* get length of cmdline, and place it */
892 top = (top - (len + 1)) & ~0xF;
893 cmdline = (char *)top;
894 debug ("## cmdline at 0x%08lX ", top);
898 top = (top - sizeof (bd_t)) & ~0xF;
899 debug ("## bd at 0x%08lX ", top);
901 memcpy (kbd, gd->bd, sizeof (bd_t));
903 /* first find number of env entries, and their size */
906 for (i = 0; env_get_char (i) != '\0'; i = nxt + 1) {
907 for (nxt = i; env_get_char (nxt) != '\0'; ++nxt)
910 envsz += (nxt - i) + 1; /* plus trailing zero */
912 envno++; /* plus the terminating zero */
913 debug ("## %u envvars total size %u ", envno, envsz);
915 top = (top - sizeof (char **) * envno) & ~0xF;
916 fwenv = (char **)top;
917 debug ("## fwenv at 0x%08lX ", top);
919 top = (top - envsz) & ~0xF;
924 for (i = 0; env_get_char (i) != '\0'; i = nxt + 1) {
925 for (nxt = i; env_get_char (nxt) != '\0'; ++nxt)
928 for (j = i; j < nxt; ++j)
929 *s++ = env_get_char (j);
932 *ss++ = NULL; /* terminate */
934 entry = (void (*)(bd_t *, char *, char **, ulong))image_get_ep (hdr);
935 (*entry) (kbd, cmdline, fwenv, top);