[ipxe-devel] [PATCH] [romprefix] Allow building for opt-out boot strategy
Miller, Shao
Shao.Miller at yrdsb.edu.on.ca
Tue Jun 15 03:09:33 UTC 2010
Also at:
https://git.ipxe.org/people/sha0/ipxe/.git/commitdiff/e4b238f711893d6b1f
9d1886999cf3ef39ec3a60
- Shao Miller
-----
>From 2dfed87596185de7c6cded2ca18cf9144d0bdc62 Mon Sep 17 00:00:00 2001
From: Shao Miller <shao.miller at yrdsb.edu.on.ca>
Date: Mon, 14 Jun 2010 21:37:59 +0000
Subject: [PATCH] [romprefix] Allow building for opt-out boot strategy
We detect the VMware Player and VMware Workstation 7.0.1
BIOS as a non-BBS-compliant BIOS and we therefore hook
INTerrupt 0x19 for booting. As of commit
4d7c650164a759e3dadbcf8f83da6789165c68b7, we would choose
to always boot unless the user at the console specifies
otherwise with an 'N' keystroke. Some users would
rather that we not always boot by default.
This commit introduces a conditional build path for
allowing INT 0x19 users to build an "opt-out" ROM.
If INT19_OPTOUT is defined, such a ROM image will result.
This commit also adds a ROM-O-Matic option for the same.
Reported-by: Alessandro Salvatori <sandr8 at gmail.com>
Tested-by: Alessandro Salvatori <sandr8 at gmail.com>
Tested-by: Shao Miller <shao.miller at yrdsb.edu.on.ca>
Signed-off-by: Shao Miller <shao.miller at yrdsb.edu.on.ca>
---
contrib/rom-o-matic/doc/INT19_OPTOUT.html | 1 +
contrib/rom-o-matic/flag-table.php | 8 ++++++++
src/arch/i386/prefix/romprefix.S | 12 ++++++++++++
src/config/defaults/pcbios.h | 2 ++
4 files changed, 23 insertions(+), 0 deletions(-)
create mode 100644 contrib/rom-o-matic/doc/INT19_OPTOUT.html
diff --git a/contrib/rom-o-matic/doc/INT19_OPTOUT.html
b/contrib/rom-o-matic/doc/INT19_OPTOUT.html
new file mode 100644
index 0000000..d7aab28
--- /dev/null
+++ b/contrib/rom-o-matic/doc/INT19_OPTOUT.html
@@ -0,0 +1 @@
+Require 'B' keystroke to boot on INT 0x19 BIOSes
diff --git a/contrib/rom-o-matic/flag-table.php
b/contrib/rom-o-matic/flag-table.php
index 82551e4..45e41cd 100644
--- a/contrib/rom-o-matic/flag-table.php
+++ b/contrib/rom-o-matic/flag-table.php
@@ -98,6 +98,14 @@ $flag_table = array (
"cfgsec" => "general"
),
+ "INT19_OPTOUT"
+ => array (
+ "flag" => "INT19_OPTOUT",
+ "type" => "on/off",
+ "value" => "off",
+ "cfgsec" => "general"
+ ),
+
// End Console Options
// Begin Network Protocol Options:
diff --git a/src/arch/i386/prefix/romprefix.S
b/src/arch/i386/prefix/romprefix.S
index 02e5497..fdd3ae2 100644
--- a/src/arch/i386/prefix/romprefix.S
+++ b/src/arch/i386/prefix/romprefix.S
@@ -904,7 +904,11 @@ int19_entry:
call print_message
movw $int19_message_dots, %si
call print_message
+#ifdef INT19_OPTOUT
movw $0xdf4e, %bx
+#else
+ movw $0xdf42, %bx
+#endif
call wait_for_key
pushf
xorw %di, %di
@@ -912,7 +916,11 @@ int19_entry:
movw $int19_message_done, %si
call print_message
popf
+#ifdef INT19_OPTOUT
+ jnz 1f
+#else
jz 1f
+#endif
/* Leave keypress in buffer and start iPXE. The keypress will
* cause the usual initial Ctrl-B prompt to be skipped.
*/
@@ -931,7 +939,11 @@ orig_int19:
.size orig_int19, . - orig_int19
int19_message_prompt:
+#ifdef INT19_OPTOUT
+ .asciz "Press B to boot from "
+#else
.asciz "Press N to skip booting from "
+#endif
.size int19_message_prompt, . - int19_message_prompt
int19_message_dots:
.asciz "..."
diff --git a/src/config/defaults/pcbios.h b/src/config/defaults/pcbios.h
index c09105c..c881cbb 100644
--- a/src/config/defaults/pcbios.h
+++ b/src/config/defaults/pcbios.h
@@ -32,4 +32,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define SANBOOT_PROTO_ISCSI /* iSCSI protocol */
#define SANBOOT_PROTO_AOE /* AoE protocol */
+#undef INT19_OPTOUT /* INT19 BIOS boot-on-keypress-only */
+
#endif /* CONFIG_DEFAULTS_PCBIOS_H */
--
1.5.6.6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001--romprefix-Allow-building-for-opt-out-boot-strategy.patch
Type: application/octet-stream
Size: 3561 bytes
Desc: 0001--romprefix-Allow-building-for-opt-out-boot-strategy.patch
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20100614/58e3d3a3/attachment.obj>
More information about the ipxe-devel
mailing list