Added automatic CMOS RAM checksum calculation.

This commit is contained in:
Andreas Mohr 1999-01-03 12:30:43 +00:00 committed by Alexandre Julliard
parent 382e2024b2
commit eeaafcc047
1 changed files with 14 additions and 1 deletions

View File

@ -29,7 +29,7 @@ static BYTE cmosimage[64] =
0x40, 0xb1, 0x00, 0x9c, 0x01, 0x80, 0x02, 0x00,
0x1c, 0x00, 0x00, 0xad, 0x02, 0x10, 0x00, 0x00,
0x08, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x58,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x03, 0x19,
0x00, 0x1c, 0x19, 0x81, 0x00, 0x0e, 0x00, 0x80,
0x1b, 0x7b, 0x21, 0x00, 0x00, 0x00, 0x05, 0x5f
};
@ -52,6 +52,18 @@ static char port_permissions[0x10000];
#endif /* DIRECT_IO_ACCESS */
static void IO_FixCMOSCheckSum()
{
WORD sum = 0;
int i;
for (i=0x10; i < 0x2d; i++)
sum += cmosimage[i];
cmosimage[0x2e] = sum >> 8; /* yes, this IS hi byte !! */
cmosimage[0x2f] = sum & 0xff;
TRACE(int, "calculated hi %02x, lo %02x\n", cmosimage[0x2e], cmosimage[0x2f]);
}
/**********************************************************************
* IO_port_init
*/
@ -188,6 +200,7 @@ void IO_port_init()
do_IO_port_init_read_or_write(temp, IO_WRITE);
}
#endif /* DIRECT_IO_ACCESS */
IO_FixCMOSCheckSum();
}