[comp.sys.ibm.pc] Patching ROMs

zielke@romeo.cs.duke.edu (David Zielke c/o hsg) (05/27/90)

  I own an IBM-AT with the original 6mhz non-speed limiting ROMs.  The only
problem being that to install a Seagate 4096 drive requires the use of
drivers which are not operating system independent.  (i.e. bringing up a
non-dos operating system, it only sees part of the drive).  The solution
seems to be to patch the ROM drive table at location F000:E4xx.  This
appears to be simple enough, however, I remember that the POST facility
does some form of checksum on the ROM itself to verify integrity.  Does
anyone know where this is stored and how it is computed?

  Many thanks...

	David Zielke

zielke@phy.duke.edu
zielke@cs.duke.edu
zielke@ccf3.nrl.navy.mil

________________________________________________________________________
|  Name:		David M. Zielke					|
|  Internet:		zielke@physics.phy.duke.edu			|
|			zielke@cs.duke.edu				|

cgordon@vpnet.chi.il.us (Gordon Hlavenka) (05/28/90)

>...the POST facility
>does some form of checksum on the ROM itself to verify integrity.  Does
>anyone know where this is stored and how it is computed?

It doesn't matter where the check routine is; the requirement is very easy
to satisfy.  Simply calculate the 16-bit arithmetic sum of the ROM contents,
ignoring overflows.  The least significant byte of the sum should be zero. 
That's all it takes!

This is usually done by selecting the last byte in the ROM such that the math
works out right.  Program the ROM with the last byte=0FFH.  Then calculate
the checksum, and reprogram the last byte to the proper value.  This worked
for ROMs in the following machines (personal experience): Compaq Portable,
IBM PC/XT 286, IBM PC/XT, IBM PC Portable, and a 386 no-name with Phoenix
BIOS.  I believe it should work for anything...

Gordon S. Hlavenka      cgordon@vpnet.chi.il.us

amichiel@rodan.acs.syr.edu (Allen J Michielsen) (05/30/90)

In article <2660b6ad-1d5b.1comp.sys.ibm.pc-1@vpnet.chi.il.us> cgordon@vpnet....
>>...the POST facility
>>does some form of checksum on the ROM itself to verify integrity. 
>
>It doesn't matter where the check routine is; the requirement is very easy
>to satisfy.  Simply calculate the 16-bit arithmetic sum of the ROM contents,
>ignoring overflows.  The least significant byte of the sum should be zero. 
>That's all it takes!
>
>This is usually done...
   To say this simpler, if the current value is FFh and you want make the
usable value at that location F0h, then you would add 0Fh to the checksum.
If the checksum value is currently FCh and you add a OFh to it, you get 10Bh.
Since only 0Bh can be stored in 16 bits, simple throw away the leading 1 making
10Bh into 0Bh.  Simple as pie.
   If you are only changing a few bytes, this is easier than doing the whole
string over again.  Besides, the checksum can use other sum values than 00h.
It's a convention and anything could be used, or even a different method, 
making this non trivial problem w/out more info.  This probably isn;t the case
here, however...
al