/*
 * bios.i86  -  Definitions for accessing the system BIOS
 *
 * Copyright (C) 2003-2007 Gero Kuhlmann   <gero@gkminix.han.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: bios.i86,v 1.7 2007/01/06 18:31:08 gkminix Exp $
 */

#ifndef SYSTEM_BIOS_I86
#define SYSTEM_BIOS_I86


/*
 * Include the main C header file
 */
#define GAS_INCLUDE
#include <system/bios.h86>



/*
 * BIOS interrupt 0x15, function 0xC0 returns various system configuration
 * values in the following structure:
 */
#define ROMCFG_FUNC	0xC0		/* function number */
#define ROMCFG_MINSIZE	6		/* minimum structure size */

			.struct	0
romcfg_size:		.struct	.+2	/* size of this structure */
romcfg_model:		.struct	.+1	/* model byte */
romcfg_submodel:	.struct	.+1	/* submodel byte */
romcfg_revision:	.struct	.+1	/* revision byte */
romcfg_fb1:		.struct	.+1	/* feature byte 1 */
romcfg_fb2:		.struct	.+1	/* feature byte 2 */
romcfg_fb3:		.struct	.+1	/* feature byte 3 */


#define FB1_DUALBUS	0x01		/* system has dual bus (ISA + MCA) */
#define FB1_MCA		0x02		/* system has MCA bus */
#define FB1_EBDA	0x04		/* extended BIOS data area assigned */
#define FB1_RTC		0x20		/* real-time clock installed */
#define FB1_SLAVE	0x40		/* slave PIC installed */
#define FB1_DMA3	0x80		/* DMA channel 3 used by hard disk */

#define FB2_KBD		0x04		/* non-8042 keyboard controller */



/*
 * BIOS interrupt 0x15, function 0xE820 returns system memory map descriptors
 * in the following structure:
 */
#define SYSMAP_FUNC	0xE820		/* function number */
#define	SYSMAP_ID	0x534D4150	/* SMAP ID value */
#define SYSMAP_SIZE	20		/* structure size */

			.struct	0
sysmap_start:		.struct	.+8	/* start of memory block */
sysmap_end:		.struct	.+8	/* end of memory block */
sysmap_type:		.struct	.+4	/* type of memory block */


#define SYSMAP_BLK_OS	1		/* type for OS-usable memory block */
#define SYSMAP_BLK_RES	2		/* type for reserved memory block */
#define SYSMAP_BLK_ACPI	3		/* type for ACPI memory block */


#endif

