From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew May Date: Tue, 27 Jul 2004 15:31:52 -0700 Subject: [U-Boot-Users] bootm change for standalone images In-Reply-To: <20040727220525.F2879C109F@atlas.denx.de> References: <20040727012114.GA22062@acmay.homeip.net> <20040727220525.F2879C109F@atlas.denx.de> Message-ID: <20040727223152.GA11596@acmay.homeip.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Jul 28, 2004 at 12:05:20AM +0200, Wolfgang Denk wrote: > Dear Andrew, > > in message <20040727012114.GA22062@acmay.homeip.net> you wrote: ..... > > But I am not sure if the check would be universal. > > Would it better to add a new type or flag to image header. > > If you boot "a stupid homegrown OS" then do it like that: use the > "bootm" command for it. > > > It looks like RTEMS is the simplest OS loader and it should work as > > is with my image, but it would be nice to have a generic print instead. > > What exactly do you mean by "have a generic print instead" ? Not until after I did the code and started to write the message did I start to look at the other OS type boots. Then I realized that the RTEMS bootm is just what I need. So instead of adding a whole new type just change RTEMS to a generic OS type, that may not care about the args. So just change the function names and printf to make it obvious it is a simple OS type. Also do a fall through case for both RTEMS and GENERIC OS image types. Here is an incomplete patch of what I mean. -------------- next part -------------- --- u-boot-gige2/common/cmd_bootm.c 2004-07-15 19:55:08.000000000 -0700 +++ u-boot-gige2/common/cmd_bootm.c.test 2004-07-27 15:21:06.000000000 -0700 @@ -121,7 +121,7 @@ static void fixup_silent_linux (void); #endif static boot_os_Fcn do_bootm_netbsd; -static boot_os_Fcn do_bootm_rtems; +static boot_os_Fcn do_bootm_generic_os; #if (CONFIG_COMMANDS & CFG_CMD_ELF) static boot_os_Fcn do_bootm_vxworks; static boot_os_Fcn do_bootm_qnxelf; @@ -413,8 +413,9 @@ #endif case IH_OS_RTEMS: - do_bootm_rtems (cmdtp, flag, argc, argv, - addr, len_ptr, verify); + case IH_OS_GENERIC: + do_bootm_generic (cmdtp, flag, argc, argv, + addr, len_ptr, verify); break; #if (CONFIG_COMMANDS & CFG_CMD_ELF) @@ -1302,7 +1303,7 @@ #endif /* CONFIG_BZIP2 */ static void -do_bootm_rtems (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], +do_bootm_generic (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong addr, ulong *len_ptr, int verify) { DECLARE_GLOBAL_DATA_PTR; @@ -1311,7 +1312,7 @@ entry_point = (void (*)(bd_t *)) hdr->ih_ep; - printf ("## Transferring control to RTEMS (at address %08lx) ...\n", + printf ("## Transferring control to OS (at address %08lx) ...\n", (ulong)entry_point); SHOW_BOOT_PROGRESS (15);