summaryrefslogtreecommitdiffstats
path: root/sys/boot/ia64/efi
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-12-08 20:04:00 +0000
committermarcel <marcel@FreeBSD.org>2002-12-08 20:04:00 +0000
commitb6c9fbe05341868799adbc263f3848dcb2e41970 (patch)
tree99b27f789b1adeb4366b09d3680e32b6dca48212 /sys/boot/ia64/efi
parentcc1323fd6695c843bdaae5d51a120fbc332f492f (diff)
downloadFreeBSD-src-b6c9fbe05341868799adbc263f3848dcb2e41970.zip
FreeBSD-src-b6c9fbe05341868799adbc263f3848dcb2e41970.tar.gz
The boot manager sets the watchdog timer to 5 minutes before invoking
a boot option. When the timer expires the machine is rebooted. Disable the watchdog timer for 2 reasons: o We're an interactive program. We cannot guarantee that we've booted the kernel in the time available to us. There have been situations where netbooting the right kernel took 2 tries and more time than given. Not to speak of the normal behaviour to have the loader sitting at the prompt while the user is off doing other things (such as figuring out what to type next ;-) o We may not boot a kernel at all. We may exit as the result of the user typing quit (assuming it took less than 5 minutes to type it :-). It is documented that loaders should have disabled the watchdog timer if they return to the boot manager. Not doing so would cause a reboot while in the boot manager. This appears to be harmless, besides of course the actual reboot. Approved by: re (weisse karte)
Diffstat (limited to 'sys/boot/ia64/efi')
-rw-r--r--sys/boot/ia64/efi/main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/boot/ia64/efi/main.c b/sys/boot/ia64/efi/main.c
index c3cc593..3d3b5ed 100644
--- a/sys/boot/ia64/efi/main.c
+++ b/sys/boot/ia64/efi/main.c
@@ -174,12 +174,16 @@ efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
currdev.d_type = currdev.d_dev->dv_type;
-#if 0
- /* Create arc-specific variables */
- bootfile = GetEnvironmentVariable(ARCENV_BOOTFILE);
- if (bootfile)
- setenv("bootfile", bootfile, 1);
-#endif
+ /*
+ * Disable the watchdog timer. By default the boot manager sets
+ * the timer to 5 minutes before invoking a boot option. If we
+ * want to return to the boot manager, we have to disable the
+ * watchdog timer and since we're an interactive program, we don't
+ * want to wait until the user types "quit". The timer may have
+ * fired by then. We don't care if this fails. It does not prevent
+ * normal functioning in any way...
+ */
+ BS->SetWatchdogTimer(0, 0, 0, NULL);
env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev),
efi_setcurrdev, env_nounset);
OpenPOWER on IntegriCloud