1 // Code for handling calls to "post" that are resume related.
3 // Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
5 // This file may be distributed under the terms of the GNU GPLv3 license.
7 #include "util.h" // dprintf
8 #include "ioport.h" // outb
9 #include "pic.h" // eoi_pic2
10 #include "biosvar.h" // struct bios_data_area_s
12 // Reset DMA controller
16 // first reset the DMA controllers
17 outb(0, PORT_DMA1_MASTER_CLEAR);
18 outb(0, PORT_DMA2_MASTER_CLEAR);
20 // then initialize the DMA controllers
21 outb(0xc0, PORT_DMA2_MODE_REG);
22 outb(0x00, PORT_DMA2_MASK_REG);
25 // Handler for post calls that look like a resume.
27 handle_resume(u8 status)
32 dprintf(1, "In resume (status=%d)\n", status);
38 // Normal post - now that status has been cleared a reset will
39 // run regular boot code..
44 // flush keyboard (issue EOI) and jump via 40h:0067h
48 // resume execution by jump via 40h:0067h
49 #define bda ((struct bios_data_area_s *)0)
53 : : "m"(bda->jump_ip), "a"(SEG_BDA)
58 // resume execution via IRET via 40h:0067h
64 : : "m"(bda->jump_ip), "m"(bda->jump_cs), "a"(SEG_BDA)
69 // resume execution via RETF via 40h:0067h
75 : : "m"(bda->jump_ip), "m"(bda->jump_cs), "a"(SEG_BDA)
80 BX_PANIC("Unimplemented shutdown status: %02x\n", status);