From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LYT0t-0002kA-A2 for qemu-devel@nongnu.org; Sat, 14 Feb 2009 17:29:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LYT0s-0002jy-1U for qemu-devel@nongnu.org; Sat, 14 Feb 2009 17:29:30 -0500 Received: from [199.232.76.173] (port=37349 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LYT0r-0002jv-Tj for qemu-devel@nongnu.org; Sat, 14 Feb 2009 17:29:29 -0500 Received: from mail-gx0-f175.google.com ([209.85.217.175]:37904) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LYT0r-0004Zs-7q for qemu-devel@nongnu.org; Sat, 14 Feb 2009 17:29:29 -0500 Received: by gxk23 with SMTP id 23so2409746gxk.10 for ; Sat, 14 Feb 2009 14:29:28 -0800 (PST) Message-ID: <499745AB.9070107@codemonkey.ws> Date: Sat, 14 Feb 2009 16:28:59 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] enable quietbios and biosprompt checks References: <1234421329-8119-1-git-send-email-FOSS@AtlasTechnologiesInc.com> <1234421329-8119-4-git-send-email-FOSS@AtlasTechnologiesInc.com> In-Reply-To: <1234421329-8119-4-git-send-email-FOSS@AtlasTechnologiesInc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cory Fields wrote: > Note: Default behavior is changed. Now it will default to skipping > the boot menu. > > Signed-off-by: Cory Fields > --- > bios/rombios.c | 90 +++++++++++++++++++++++++++++++++++++++++-------------- > 1 files changed, 67 insertions(+), 23 deletions(-) > > diff --git a/bios/rombios.c b/bios/rombios.c > index ee46e42..39a79b1 100644 > --- a/bios/rombios.c > +++ b/bios/rombios.c > @@ -144,6 +144,12 @@ > #define BX_PCIBIOS 1 > #define BX_APM 1 > > +#define BX_CFG_CTL_PORT 0x510 > +#define BX_CFG_DATA_PORT 0x511 > +#define BX_CFG_SIGNATURE 0x0 > +#define BX_CFG_BIOSPROMPT 0x07 > +#define BX_CFG_QUIETBIOS 0x08 > + > #define BX_USE_ATADRV 1 > #define BX_ELTORITO_BOOT 1 > > @@ -2014,6 +2020,32 @@ Bit16u i; ipl_entry_t *e; > return 1; > } > > +int qemu_cfg_port_probe() > +{ > + outw(BX_CFG_CTL_PORT, BX_CFG_SIGNATURE); > + if (inb(BX_CFG_DATA_PORT) != 'Q') return 0; > + if (inb(BX_CFG_DATA_PORT) != 'E') return 0; > + if (inb(BX_CFG_DATA_PORT) != 'M') return 0; > + if (inb(BX_CFG_DATA_PORT) != 'U') return 0; > + return 1; > +} > + > +int qemu_biosprompt_probe() > +{ > + if(qemu_cfg_port_probe()) > + outw(BX_CFG_CTL_PORT, BX_CFG_BIOSPROMPT); > + if (inb(BX_CFG_DATA_PORT)) return 1; > + return 0; > +} > + > +int qemu_quietbios_probe() > +{ > + if(qemu_cfg_port_probe()) > + outw(BX_CFG_CTL_PORT, BX_CFG_QUIETBIOS); > + if (inb(BX_CFG_DATA_PORT)) return 1; > + return 0; > +} > + > #if BX_ELTORITO_BOOT > void > interactive_bootkey() > @@ -2478,7 +2510,7 @@ static int await_ide(when_done,base,timeout) > void ata_detect( ) > { > Bit16u ebda_seg=read_word(0x0040,0x000E); > - Bit8u hdcount, cdcount, device, type; > + Bit8u hdcount, cdcount, device, type, quietbios; > Bit8u buffer[0x0200]; > > #if BX_MAX_ATA_INTERFACES > 0 > @@ -2738,26 +2770,28 @@ void ata_detect( ) > break; > } > > - switch (type) { > - case ATA_TYPE_ATA: > - printf("ata%d %s: ",channel,slave?" slave":"master"); > - i=0; while(c=read_byte(get_SS(),model+i++)) printf("%c",c); > - if (sizeinmb < (1UL<<16)) > - printf(" ATA-%d Hard-Disk (%4u MBytes)\n", version, (Bit16u)sizeinmb); > - else > - printf(" ATA-%d Hard-Disk (%4u GBytes)\n", version, (Bit16u)(sizeinmb>>10)); > - break; > - case ATA_TYPE_ATAPI: > - printf("ata%d %s: ",channel,slave?" slave":"master"); > - i=0; while(c=read_byte(get_SS(),model+i++)) printf("%c",c); > - if(read_byte(ebda_seg,&EbdaData->ata.devices[device].device)==ATA_DEVICE_CDROM) > - printf(" ATAPI-%d CD-Rom/DVD-Rom\n",version); > - else > - printf(" ATAPI-%d Device\n",version); > - break; > - case ATA_TYPE_UNKNOWN: > - printf("ata%d %s: Unknown device\n",channel,slave?" slave":"master"); > - break; > + if (!quietbios){ > + switch (type) { > + case ATA_TYPE_ATA: > + printf("ata%d %s: ",channel,slave?" slave":"master"); > + i=0; while(c=read_byte(get_SS(),model+i++)) printf("%c",c); > + if (sizeinmb < (1UL<<16)) > + printf(" ATA-%d Hard-Disk (%4u MBytes)\n", version, (Bit16u)sizeinmb); > + else > + printf(" ATA-%d Hard-Disk (%4u GBytes)\n", version, (Bit16u)(sizeinmb>>10)); > + break; > + case ATA_TYPE_ATAPI: > + printf("ata%d %s: ",channel,slave?" slave":"master"); > + i=0; while(c=read_byte(get_SS(),model+i++)) printf("%c",c); > + if(read_byte(ebda_seg,&EbdaData->ata.devices[device].device)==ATA_DEVICE_CDROM) > + printf(" ATAPI-%d CD-Rom/DVD-Rom\n",version); > + else > + printf(" ATAPI-%d Device\n",version); > + break; > + case ATA_TYPE_UNKNOWN: > + printf("ata%d %s: Unknown device\n",channel,slave?" slave":"master"); > + break; > + } > } > } > } > @@ -2767,7 +2801,7 @@ void ata_detect( ) > write_byte(ebda_seg,&EbdaData->ata.cdcount, cdcount); > write_byte(0x40,0x75, hdcount); > > - printf("\n"); > + if (!quietbios) printf("\n"); > Maybe just make a change in printf() to suppress output if quietbios? Regards, Anthony Liguori > // FIXME : should use bios=cmos|auto|disable bits > // FIXME : should know about translation bits > @@ -10613,7 +10647,11 @@ post_default_ints: > mov ax, #0xc780 > call rom_scan > > + call _qemu_quietbios_probe > + test al,al > + jnz skip_bios_print > call _print_bios_banner > + skip_bios_print: > > #if BX_ROMBIOS32 > call rombios32_init > @@ -10660,7 +10698,13 @@ post_default_ints: > call rom_scan > > #if BX_ELTORITO_BOOT > - call _interactive_bootkey > + > + call _qemu_biosprompt_probe > + test al,al > + jz skip_timer > + call _interactive_bootkey > + > +skip_timer: > #endif // BX_ELTORITO_BOOT > > sti ;; enable interrupts >