[SeaBIOS] [PATCH v3 3/3] Boot up with a splash picture configurable

Kevin O'Connor kevin at koconnor.net
Mon Jul 4 18:22:19 CEST 2011


On Mon, Jul 04, 2011 at 03:51:57PM +0800, Wayne Xia wrote:
> make the showing time configurable.
> 
> Signed-off-by: Wayne Xia <xiawenc at linux.vnet.ibm.com>

Thanks.  I'm okay with the first two patches, and will commit them if
there are no further comments.

> --- a/src/boot.c
> +++ b/src/boot.c
> @@ -381,8 +381,31 @@ boot_add_cbfs(void *data, const char *desc, int prio)
>  static void
>  interactive_bootmenu(void)
>  {
> -    if (! CONFIG_BOOTMENU || ! qemu_cfg_show_boot_menu())
> +    int filecfg_size;
> +    u8 *filecfg_p = romfile_loadfile("qemu_extra_params_fw.cfg", &filecfg_size);
> +    u16 splash_time = 0;
> +
> +    if (filecfg_p != NULL && filecfg_size >= 2) {
> +        splash_time = *(filecfg_p+0)+(*(filecfg_p+1)<<8); /* little endian */
> +        free(filecfg_p);
> +    }
[...]

This patch should be simplified though - I think the boot code should
end up looking something like:

static void
interactive_bootmenu(void)
{
    if (! CONFIG_BOOTMENU || ! qemu_cfg_show_boot_menu())
        return;

    u32 menutime = romfile_getint("etc/bootmenu_wait", CONFIG_BOOTMENU_WAIT);

    while (get_keystroke(0) >= 0)
        ;

    printf("Press F12 for boot menu.\n\n");

    enable_bootsplash();
    int scan_code = get_keystroke(menutime);
    ...

That is, the config extraction should be abstracted out of the boot
code, and a splash time variable shouldn't be needed as a bootmenu
variable should be enough.

I'll try and write up the code for romfile_getint().

-Kevin



More information about the SeaBIOS mailing list