/*
 **************************************************************************
 *
 * Boot-ROM-Code to load an operating system across a TCP/IP network.
 *
 * Module:  ldram.i86
 * Purpose: Definitions for bootrom RAM area
 * Entries: none
 *
 **************************************************************************
 *
 * Copyright (C) 1998-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: ldram.i86,v 1.6 2007/01/06 18:30:47 gkminix Exp $
 */

#ifndef LOADER_LDRAM_I86
#define LOADER_LDRAM_I86



/*
 **************************************************************************
 *
 * This file can only get included into assembler source files
 */
#if !defined(_ASSEMBLY_) || !defined(_TARGET_)
# error This file can only get included into assembler source files
#endif




/*
 **************************************************************************
 *
 * We need to use some RAM for passing values from the ROM startup code
 * to the bootrom code. Since we cant always write into the ROM area itself
 * (thats possible with floppy boot or by using DDIM) we have to use some
 * other RAM area. The interrupt area from vector 0x90 to 0xEF is only used
 * by operating systems and the original IBM ROM BASIC, according to Ralf
 * Browns interrupt list. We can therefore use that area during boot for
 * saving important values. It will be protected by a checksum.
 */
#define RAM_START	(0x0097 * 4)	/* offset to beginning of RAM area */
#define RAM_SIGNATURE	0x5A5A		/* signature of RAM area */
#define RAM_SIZE	0x0018		/* size of RAM area (multiple of 4) */
#define RAM_DFLTCHK	0x50		/* default checksum for RAM area */


		.struct	0
ram_id:		.struct	.+2		/* ID of RAM area */
ram_chksum:	.struct	.+1		/* checksum of RAM area */
ram_flags:	.struct	.+1		/* flags */
ram_oldint:	.struct	.+4		/* old bootrom interrupt */
ram_extadr:	.struct	.+4		/* linear addr of new compressed copy */
ram_pnpstruct:	.struct	.+4		/* far ptr to PnP installation struct */
ram_pcipfa:	.struct	.+2		/* PCI PFA */
ram_pnpcsn:	.struct	.+2		/* PnP CSN */
ram_pnport:	.struct	.+2		/* PnP data port */


#define RAMFL_BBS	0x01		/* called according to BBS */
#define RAMFL_DDIM	0x02		/* use DDIM */
#define RAMFL_PMM	0x04		/* use PMM */
#define RAMFL_WRITE	0x08		/* bootrom is writable */
#define RAMFL_CHKSUM	0x10		/* bootrom needs checksum calculated */


#endif

