/*
 * first.i86  -  constants for assembler module for DOS boot loader
 *
 * Copyright (C) 1996-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: first.i86,v 1.8 2007/01/06 18:31:22 gkminix Exp $
 *
 *====================================================================
 *
 * This file can also be included into host source files:
 */
#if !defined(_ASSEMBLY_) || !defined(_TARGET_)
# if !defined(MKNBI_H_DOS) || !defined(COMMON_H) || !defined(PACK_ENABLED)
#  error This file can only be included into mknbi.h
# endif
#endif



/*
 *====================================================================
 *
 * Version of the resident area driver code. If the interrupt F8h
 * interface gets changed, this version number should get increased.
 */
#define RES_VERSION	0x0002



/*
 *====================================================================
 *
 * Vendor information for the boot rom image.
 */
#ifdef _ASSEMBLY_

			.struct	0
boot_ld_loadflags:	/* union */	/* primary loader flags */
boot_ld_secnum:		.struct	.+4	/* total number of sectors */
boot_ld_spt:		.struct	.+2	/* sectors per track */
boot_ld_cyl:		.struct	.+2	/* number of cylinders */
boot_ld_hdnum:		.struct	.+2	/* number of heads */
boot_ld_drive:		.struct	.+1	/* boot drive ID */
boot_ld_nohd:		.struct	.+1	/* no-hard-disk flag */

#include <netboot.i86>

#else

#define USE_VENDOR

struct disk_geometry {
  __long num_sectors;			/* total # of sectors */
  __u16  sect_per_track;		/* # of sectors per track */
  __u16  cylinders;			/* # of cylinders */
  __u16  num_heads;			/* # of heads */
  __u8   boot_drive;			/* ID of boot drive */
  __u8   no_hd_flag;			/* non-zero if no hard disk */
} PACKED;

union vendor_data {
  struct disk_geometry geometry;	/* disk geometry */
  __u8                 loadflags;	/* primary loader flags */
};

#include <netboot.h>

#endif


/* Vendor flags for primary boot loader */
#define BOOT_FLAG_NORPL	0x01		/* flag for not using INT2F RPL mode */
#define BOOT_FLAG_INT15	0x02		/* flag for using interrupt 15h */
#define BOOT_FLAG_KEEP	0x04		/* flag to keep driver in memory */
#define BOOT_FLAG_COMPR	0x08		/* flag if ramdisk compressed */


/* Vendor magic ID and definition of load record numbers */
#define VENDOR_MAGIC	"GK-mknbi-DOS"	/* vendor ID */
#define VENDOR_SIZE	3		/* size of ID in dwords */

#define LOADERNUM	0		/* boot loader */
#define RAMDISKNUM	1		/* ramdisk image */
#define NUM_RECORDS	2

