summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2013-03-22 14:54:44 +0100
committerMichael Brown2013-03-22 14:54:44 +0100
commite68a6ca225115a8796e6d63ffc32856043e25886 (patch)
tree3bb58a45adbf41533d910482618b2ea306e4cb2c /src/arch
parent[efi] Add "reboot" command for EFI (diff)
downloadipxe-e68a6ca225115a8796e6d63ffc32856043e25886.tar.gz
ipxe-e68a6ca225115a8796e6d63ffc32856043e25886.tar.xz
ipxe-e68a6ca225115a8796e6d63ffc32856043e25886.zip
[cmdline] Add ability to perform a warm reboot
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/i386/include/bios.h2
-rw-r--r--src/arch/i386/interface/pcbios/bios_reboot.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/arch/i386/include/bios.h b/src/arch/i386/include/bios.h
index fadb9f1b7..3e6a845e3 100644
--- a/src/arch/i386/include/bios.h
+++ b/src/arch/i386/include/bios.h
@@ -6,6 +6,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
#define BDA_SEG 0x0040
#define BDA_EQUIPMENT_WORD 0x0010
#define BDA_FBMS 0x0013
+#define BDA_REBOOT 0x0072
+#define BDA_REBOOT_WARM 0x1234
#define BDA_NUM_DRIVES 0x0075
#endif /* BIOS_H */
diff --git a/src/arch/i386/interface/pcbios/bios_reboot.c b/src/arch/i386/interface/pcbios/bios_reboot.c
index 86f4e3eb3..68546b2e5 100644
--- a/src/arch/i386/interface/pcbios/bios_reboot.c
+++ b/src/arch/i386/interface/pcbios/bios_reboot.c
@@ -27,12 +27,19 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/reboot.h>
#include <realmode.h>
+#include <bios.h>
/**
* Reboot system
*
+ * @v warm Perform a warm reboot
*/
-static void bios_reboot ( void ) {
+static void bios_reboot ( int warm ) {
+ uint16_t flag;
+
+ /* Configure BIOS for cold/warm reboot */
+ flag = ( warm ? BDA_REBOOT_WARM : 0 );
+ put_real ( flag, BDA_SEG, BDA_REBOOT );
/* Jump to system reset vector */
__asm__ __volatile__ ( REAL_CODE ( "ljmp $0xf000, $0xfff0" ) : : );