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

Wayne Xia xiawenc at linux.vnet.ibm.com
Tue Jul 5 08:23:41 CEST 2011


于 2011-7-5 0:22, Kevin O'Connor 写道:
> 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().

I am OK about abstracting the time from seabios itself, but I think at
the start of the "interactive_bootmenu(void)", a communication method
with qemu, is needed, to let qemu decide whether to show the logo, when
it is invoked without -menu=on specified.

So the splash_time acts like a flag more than a quantity variable. If
it is removed, I think at this point the image data should be tried to
read, to get the qemu's decision. maybe keep this variable here would
make things simple.

>
> -Kevin
>


-- 
Best Regards

Wayne Xia
mail:xiawenc at linux.vnet.ibm.com
tel:86-010-82450803




More information about the SeaBIOS mailing list