biossums.c revision 3e220fd84572af9be6e21433191b346c4fe4dc80
/*
* $Id: biossums.c,v 1.4 2007/05/28 08:09:13 vruppert Exp $
*
* 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
*/
/*
* Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Sun elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
/* biossums.c --- written by Eike W. */
#include <stdlib.h>
#include <stdio.h>
typedef unsigned char byte;
#define LEN_BIOS_DATA 0x10000
#define BIOS_OFFSET 0xFFFF
#define _32__LEN 9
#define _32__CHKSUM 10
#define _32__MINHDR 16
#define _MP__LEN 8
#define _MP__CHKSUM 10
#define _MP__MINHDR 16
#define PCMP_BASELEN 4
#define PCMP_CHKSUM 7
#define PCMP_EXT_LEN 40
#define PCMP_EXT_CHKSUM 42
#define PCMP_MINHDR 42
#define _PIR_LEN 6
#define _PIR_CHKSUM 31
#define _PIR_MINHDR 32
long offset, tmp_offset;
int hits;
if( argc != 2 ) {
printf( "Error. Need a file-name as an argument.\n" );
exit( EXIT_FAILURE );
}
exit( EXIT_FAILURE );
}
exit( EXIT_FAILURE );
}
hits = 0;
offset = 0L;
offset = tmp_offset;
hits++;
}
printf( "Setting checksum." );
}
if( hits >= 2 ) {
printf( "Multiple PCI headers! No checksum set." );
}
if( hits ) {
printf( "\n" );
}
hits = 0;
offset = 0L;
offset = tmp_offset;
hits++;
}
printf( "Setting checksum." );
}
if( hits >= 2 ) {
printf( "Warning! Multiple MP headers. No checksum set." );
}
if( hits ) {
printf( "\n" );
}
hits = 0;
offset = 0L;
offset = tmp_offset;
hits++;
}
printf( "Setting checksum." );
}
if( hits >= 2 ) {
printf( "Warning! Multiple PCMP headers. No checksum set." );
}
if( hits ) {
printf( "\n" );
}
hits = 0;
offset = 0L;
offset = tmp_offset;
hits++;
}
printf( "Setting checksum." );
}
if( hits >= 2 ) {
printf( "Warning! Multiple $PIR headers. No checksum set." );
}
if( hits ) {
printf( "\n" );
}
offset = 0L;
printf( "Setting checksum." );
}
printf( "\n\n" );
exit( EXIT_FAILURE );
}
exit( EXIT_FAILURE );
}
return( EXIT_SUCCESS );
}
if( !okay ) {
exit( EXIT_FAILURE );
}
}
return( BIOS_OFFSET );
}
int i;
sum = 0;
for( i = 0; i < MAX_OFFSET; i++ ) {
}
return( sum );
}
return( *( data + BIOS_OFFSET ) );
}
}
int i;
int len;
sum = 0;
for( i = 0; i < len; i++ ) {
if( i != _32__CHKSUM ) {
}
}
return( sum );
}
long result = -1L;
break;
}
}
return( result );
}
}
}
int i;
int len;
sum = 0;
for( i = 0; i < len; i++ ) {
if( i != _MP__CHKSUM ) {
}
}
return( sum );
}
long result = -1L;
break;
}
}
return( result );
}
}
}
int i;
int len;
check( 0, "PCMP header indicates extended tables (unsupported)" );
}
sum = 0;
for( i = 0; i < len; i++ ) {
if( i != PCMP_CHKSUM ) {
}
}
return( sum );
}
long result = -1L;
break;
}
}
return( result );
}
}
}
int i;
int len;
sum = 0;
for( i = 0; i < len; i++ ) {
if( i != _PIR_CHKSUM ) {
}
}
return( sum );
}
long result = -1L;
break;
}
}
return( result );
}
}
}