post.c revision 8f66dec264d4b13b02d5041e7e2e73273855d66d
/** @file
* BIOS POST routines. Used only during initialization.
*/
/*
* Copyright (C) 2004-2014 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.
*/
#include <stdint.h>
#include <string.h>
#include "biosint.h"
#include "inlines.h"
#if DEBUG_POST
#else
# define DPRINT(...)
#endif
/* In general, checksumming ROMs in a VM just wastes time. */
//#define CHECKSUM_ROMS
/* The format of a ROM is as follows:
*
* ------------------------------
* 0 | AA55h signature (word) |
* ------------------------------
* 2 | Size in 512B blocks (byte) |
* ------------------------------
* 3 | Start of executable code |
* | ....... |
* end | |
* ------------------------------
*/
typedef struct rom_hdr_tag {
} rom_hdr;
/* Calculate the checksum of a ROM. Note that the ROM might be
* larger than 64K.
*/
{
#ifdef CHECKSUM_ROMS
while (blocks--) {
int i;
for (i = 0; i < 512; ++i)
/* Add 512 bytes (32 paragraphs) to segment. */
}
#endif
return sum;
}
/* Scan for ROMs in the given range and execute their POST code. */
{
/* Check for the ROM signature. */
/* Checksum good, initialize ROM. */
rom_init();
int_disable();
DPRINT("ROM initialized\n");
/* Continue scanning past the end of this ROM. */
}
} else {
/* Scanning is done in 2K steps. */
}
}
}