* [Qemu-devel] [PATCH] Define a new route for sending data to bios
2009-02-14 23:57 [Qemu-devel] [PATCH 0/4] Option to suppress bios output and prompt (v2) Cory Fields
@ 2009-02-14 23:57 ` Cory Fields
2009-02-14 23:57 ` [Qemu-devel] [PATCH] Add args for quiet and prompt Cory Fields
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Cory Fields @ 2009-02-14 23:57 UTC (permalink / raw)
To: qemu-devel
---
hw/fw_cfg.c | 2 ++
hw/fw_cfg.h | 2 ++
sysemu.h | 3 +++
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index 4333ed9..fe5d393 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
@@ -287,6 +287,8 @@ void *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16);
fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)nographic);
fw_cfg_add_i16(s, FW_CFG_NB_CPUS, (uint16_t)smp_cpus);
+ fw_cfg_add_i16(s, FW_CFG_QUIETBIOS, (uint16_t)quietbios);
+ fw_cfg_add_i16(s, FW_CFG_BIOSPROMPT, (uint16_t)biosprompt);
register_savevm("fw_cfg", -1, 1, fw_cfg_save, fw_cfg_load, s);
qemu_register_reset(fw_cfg_reset, s);
diff --git a/hw/fw_cfg.h b/hw/fw_cfg.h
index ef8f378..a119867 100644
--- a/hw/fw_cfg.h
+++ b/hw/fw_cfg.h
@@ -8,6 +8,8 @@
#define FW_CFG_NOGRAPHIC 0x04
#define FW_CFG_NB_CPUS 0x05
#define FW_CFG_MACHINE_ID 0x06
+#define FW_CFG_BIOSPROMPT 0x07
+#define FW_CFG_QUIETBIOS 0x08
#define FW_CFG_MAX_ENTRY 0x10
#define FW_CFG_WRITE_CHANNEL 0x4000
diff --git a/sysemu.h b/sysemu.h
index bc6d5af..14b9aef 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -85,6 +85,9 @@ extern int graphic_width;
extern int graphic_height;
extern int graphic_depth;
extern int nographic;
+extern int quietbios;
+extern int biosprompt;
+
extern const char *keyboard_layout;
extern int win2k_install_hack;
extern int rtc_td_hack;
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] Add args for quiet and prompt
2009-02-14 23:57 [Qemu-devel] [PATCH 0/4] Option to suppress bios output and prompt (v2) Cory Fields
2009-02-14 23:57 ` [Qemu-devel] [PATCH] Define a new route for sending data to bios Cory Fields
@ 2009-02-14 23:57 ` Cory Fields
2009-02-14 23:57 ` [Qemu-devel] [PATCH] enable quietbios and biosprompt checks Cory Fields
2009-02-14 23:57 ` [Qemu-devel] [PATCH] enable quietbios check Cory Fields
3 siblings, 0 replies; 5+ messages in thread
From: Cory Fields @ 2009-02-14 23:57 UTC (permalink / raw)
To: qemu-devel
Syntax is -boot [cad],prompt=x,quiet=x where x is [0,1,true,false]
Boot drive is mandatory
If prompt is set user will see "Press f12 for boot menu"
This behavior has changed, it is now off by default
If quiet is set user will see no normal text output from bios.
Errors will stil be displayed.
Signed-off-by: Cory Fields <FOSS@AtlasTechnologiesInc.com>
---
vl.c | 43 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/vl.c b/vl.c
index 5f237d0..3b4d866 100644
--- a/vl.c
+++ b/vl.c
@@ -230,6 +230,8 @@ int no_shutdown = 0;
int cursor_hide = 1;
int graphic_rotate = 0;
int daemonize = 0;
+int biosprompt = 0;
+int quietbios = 0;
const char *option_rom[MAX_OPTION_ROMS];
int nb_option_roms;
int semihosting_enabled = 0;
@@ -3911,6 +3913,10 @@ static void help(int exitcode)
"-sd file use 'file' as SecureDigital card image\n"
"-pflash file use 'file' as a parallel flash image\n"
"-boot [a|c|d|n] boot on floppy (a), hard disk (c), CD-ROM (d), or network (n)\n"
+ " [,quiet=true|false]\n"
+ " hide bios text [default=false]\n"
+ " [,prompt=true|false]\n"
+ " hide boot menu prompt [default=true]\n"
"-snapshot write to temporary files instead of disk image files\n"
"-m megs set virtual RAM size to megs MB [default=%d]\n"
#ifndef _WIN32
@@ -4865,14 +4871,14 @@ int main(int argc, char **argv, char **envp)
drive_add(optarg, CDROM_ALIAS);
break;
case QEMU_OPTION_boot:
- boot_devices = optarg;
/* We just do some generic consistency checks */
{
/* Could easily be extended to 64 devices if needed */
const char *p;
-
+ char boot_opt_val[6]=""; //Holds value of RHS of boot option.
+
boot_devices_bitmap = 0;
- for (p = boot_devices; *p != '\0'; p++) {
+ for (p = optarg; *p != '\0' && *p != ','; p++) {
/* Allowed boot devices are:
* a b : floppy disk drives
* c ... f : IDE disk drives
@@ -4893,6 +4899,37 @@ int main(int argc, char **argv, char **envp)
}
boot_devices_bitmap |= 1 << (*p - 'a');
}
+
+
+ if (*p == ',') p++;
+ if (get_param_value(boot_opt_val, sizeof(boot_opt_val), "quiet", p)) {
+ if (!strcmp(boot_opt_val, "true") || !strcmp(boot_opt_val, "1")) {
+ quietbios=1;
+ biosprompt=0;
+ }
+ else if (!strcmp(boot_opt_val, "false") || !strcmp(boot_opt_val, "0")) {
+ quietbios=0;
+ }
+ else {
+ printf("Boot option not recognized\n");
+ exit(1);
+ }
+ }
+
+ if (get_param_value(boot_opt_val, sizeof(boot_opt_val), "prompt", p)){
+ if (!strcmp(boot_opt_val, "true") || !strcmp(boot_opt_val, "1")) {
+ biosprompt=1;
+ }
+ else if (!strcmp(boot_opt_val, "false") || !strcmp(boot_opt_val, "0")) {
+ biosprompt=0;
+ }
+ else {
+ printf("Boot option not recognized\n");
+ exit(1);
+ }
+ }
+ boot_devices=strtok(optarg,",");
+ printf("boot_devices: %s\n",boot_devices);
}
break;
case QEMU_OPTION_fda:
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] enable quietbios and biosprompt checks
2009-02-14 23:57 [Qemu-devel] [PATCH 0/4] Option to suppress bios output and prompt (v2) Cory Fields
2009-02-14 23:57 ` [Qemu-devel] [PATCH] Define a new route for sending data to bios Cory Fields
2009-02-14 23:57 ` [Qemu-devel] [PATCH] Add args for quiet and prompt Cory Fields
@ 2009-02-14 23:57 ` Cory Fields
2009-02-14 23:57 ` [Qemu-devel] [PATCH] enable quietbios check Cory Fields
3 siblings, 0 replies; 5+ messages in thread
From: Cory Fields @ 2009-02-14 23:57 UTC (permalink / raw)
To: qemu-devel
Note: Default behavior is changed. Now it will default to skipping
the boot menu.
Signed-off-by: Cory Fields <FOSS@AtlasTechnologiesInc.com>
---
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");
// 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
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] enable quietbios check
2009-02-14 23:57 [Qemu-devel] [PATCH 0/4] Option to suppress bios output and prompt (v2) Cory Fields
` (2 preceding siblings ...)
2009-02-14 23:57 ` [Qemu-devel] [PATCH] enable quietbios and biosprompt checks Cory Fields
@ 2009-02-14 23:57 ` Cory Fields
3 siblings, 0 replies; 5+ messages in thread
From: Cory Fields @ 2009-02-14 23:57 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Cory Fields <FOSS@AtlasTechnologiesInc.com>
---
vgabios.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/vgabios.c b/vgabios.c
index fbc3588..bb78bd5 100644
--- a/vgabios.c
+++ b/vgabios.c
@@ -55,6 +55,10 @@
#endif
#define USE_BX_INFO
+#define BX_CFG_CTL_PORT 0x510
+#define BX_CFG_DATA_PORT 0x511
+#define BX_CFG_SIGNATURE 0x00
+#define BX_CFG_QUIETBIOS 0x08
/* Declares */
static Bit8u read_byte();
@@ -250,6 +254,10 @@ vgabios_init_func:
call cirrus_init
#endif
+ call _qemu_quietbios_probe
+ test al,al
+ jnz skip_display
+
;; display splash screen
call _display_splash_screen
@@ -269,7 +277,7 @@ vgabios_init_func:
;; show cirrus info
call cirrus_display_info
#endif
-
+skip_display:
retf
ASM_END
@@ -3897,6 +3905,23 @@ ASM_END
#endif
// --------------------------------------------------------------------------------------------
+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_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;
+}
ASM_START
;; DATA_SEG_DEFS_HERE
--
1.6.0.6
^ permalink raw reply related [flat|nested] 5+ messages in thread