biossums.c revision 3e220fd84572af9be6e21433191b346c4fe4dc80
/* biossums.c --- written by Eike W. for the Bochs BIOS */
/* adapted for the LGPL'd VGABIOS by vruppert */
* 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.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef unsigned char byte;
#define MAX_BIOS_DATA 0x10000
#define PMID_LEN 20
#define PMID_CHKSUM 19
long bios_len;
{
long offset, tmp_offset;
if (argc != 2) {
printf( "Error. Need a file-name as an argument.\n" );
exit( EXIT_FAILURE );
}
}
if (bios_len > MAX_BIOS_DATA) {
}
modified = 0;
if (bios_len < 0x8000) {
bios_len = 0x8000;
modified = 1;
} else if ((bios_len & 0x1FF) != 0) {
modified = 1;
}
if (modified == 0) {
bios_len += 0x200;
}
modified = 1;
}
hits = 0;
offset = 0L;
offset = tmp_offset;
hits++;
}
printf("Setting checksum.");
if (modified == 0) {
bios_len += 0x200;
bios_data[2]++;
}
modified = 1;
}
if (hits >= 2) {
printf( "Multiple PMID entries! No checksum set." );
}
if (hits) {
printf("\n");
}
offset = 0L;
do {
bios_len += 0x200;
bios_data[2]++;
modified = 1;
} else {
printf("Setting checksum.");
modified = 1;
}
printf( "\n" );
}
if (modified == 1) {
#ifdef VBOX
#endif
}
#ifdef VBOX
new_bios_len = 0x8000;
new_bios_len = 0xC000;
#else
#endif
}
}
return (EXIT_SUCCESS);
}
if( !okay ) {
exit( EXIT_FAILURE );
}
}
return (bios_len - 1);
}
int i;
sum = 0;
for( i = 0; i < offset; i++ ) {
}
return( sum );
}
}
}
int i;
int len;
sum = 0;
for( i = 0; i < len; i++ ) {
if( i != PMID_CHKSUM ) {
}
}
return( sum );
}
long result = -1L;
break;
}
}
return( result );
}
}
}