biosint.h revision e59d74670d251c21cea39fedf37811b140004746
/*
* Copyright (C) 2006-2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
* --------------------------------------------------------------------
*
* This code is based on:
*
*
* Copyright (C) 2002 MandrakeSoft S.A.
*
* MandrakeSoft S.A.
* 43, rue d'Aboukir
* 75002 Paris - France
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* Compile-time assertion macro. */
/* For functions called from assembly code. */
#define BX_ELTORITO_BOOT 1
#define BX_PCIBIOS 1
#define BX_USE_PS2_MOUSE 1
#define BX_APM 1
#define DEBUG_ATA 0
#define DEBUG_AHCI 0
#define DEBUG_CD_BOOT 0
#define DEBUG_ELTORITO 0
#define DEBUG_INT13_HD 0
#define DEBUG_INT13_FL 0
#define DEBUG_INT13_CD 0
#define DEBUG_INT15 0
#define DEBUG_INT15_MS 0
#define DEBUG_INT16 0
#define DEBUG_INT1A 0
#define DEBUG_INT74 0
#define DEBUG_PCI 0
#define FP_OFF(p) ((unsigned)(p))
typedef struct {
union {
struct {
} r16;
struct {
} r8;
} u;
} pusha_regs_t;
typedef struct {
union {
struct {
} r32;
struct {
} r16;
struct {
} r8;
} u;
typedef struct {
union {
struct {
} r16;
struct {
} r8;
} u;
} flags_t;
typedef struct {
} iret_addr_t;
typedef struct {
} disk_regs_t;
typedef struct {
} kbd_regs_t;
typedef struct {
} sys_regs_t;
typedef struct {
} sys32_regs_t;
typedef struct {
typedef unsigned short bx_bool;
#define BX_DEBUG_SERIAL 0 /* output to COM1 */
#define BIOS_PRINTF_HALT 1
#define BIOS_PRINTF_SCREEN 2
#define BIOS_PRINTF_INFO 4
#define BIOS_PRINTF_DEBUG 8
extern const char bios_prefix_string[];
extern uint16_t cdrom_boot(void);
extern void show_logo(void);
// Defines the output macros.
// BX_DEBUG goes to INFO port until we can easily choose debug info on a
// per-device basis. Debug info are sent only in debug mode
#define DEBUG_ROMBIOS 1
#if DEBUG_ROMBIOS
#else
# define BX_DEBUG(...)
#endif
#ifdef VBOX
#define BX_INFO(...) do { put_str(BIOS_PRINTF_INFO, bios_prefix_string); bios_printf(BIOS_PRINTF_INFO, __VA_ARGS__); } while (0)
#else /* !VBOX */
#endif /* !VBOX */
/* Because we don't tell the recompiler when guest physical memory
* is written, it can incorrectly cache guest code overwritten by
* DMA (bus master or not). We just re-write the memory block to flush
* any of its caches. This is not exactly efficient, but works!
*/
#define DMA_WORKAROUND 1
/* Random hardware-related definitions. */
#define PIC_MASTER 0x20
#define PIC_MASTER_MASK 0x21
#define PIC_SLAVE 0xA0
#define PIC_SLAVE_MASK 0xA1
#define PIC_CMD_EOI 0x20
#define PIC_CMD_RD_ISR 0x0B
#define PIC_CMD_INIT 0x11