> When a PC boots, it looks in the expansion ROM space for, well, > expansion ROM's. What must an (EP)ROM contain in order for the PC to > recognise it as being valid and for it to start executing? I presume > some ID bytes and maybe a checksum? from "The XT-AT Handbook for Engineers, Programmers, And Other Serious PC/XT and PC/AT Users" by John P Choisser and John O Foster; fourth edition; July 1994; ISBN 0-929392-00-0 published by Annabooks, 11848 Bernardo Plaza Ct, Suite 110, San Diego, CA 92128 USA. It's a great little 3.5" x 6" (90mm x 150mm) pocket reference to all those PC facts that you need. (page 58) 41. User ROM Scan The BIOS provides a means whereby builders of adapter cards may hook into the power-on initialization sequence. During POST, the BIOS loads a set of default vectors into the appropriate BIOS interrupt addresses. The the BIOS scans memory addresses C8000 to F4000 in 2K blocks looking for valid modules on the I/O bus. A valid module will have 55H as byte 0, AAH as byte 1, and a length indicator in byte 2. The length byte is the number of 512 byte blocks over which a checksum (module hex 100) mut be zero. (The length byte must not exceed FBh, regardless of the length of your code, so you must force a sum of 00 starting with byte 0 up to whatever length byte [2] represents. Your actual code may be longer, but an error will occur if the length byte is larger than FBh.) Your initialization code must start in Byte 3, since the BIOS will do a Far Call there if the module is found to be valid (passes the three tests above). If you will want control back later when the computer boots, this is also your chance to change the boot vector to point to the entry point for you code. At the end, do a Far Return so the BIOS can finish the power- on routines. If you have changed the boot vector to point to your entry point, you will regain control when the computer boots. If your module is correct, it will start with 55 AA, and will have a checksum of 00 over the distance indicated by the length code in byte 2. (The length code will be divisible by four.) I believe that last parenthetical statement about the length being "divisible by four" is an assumption that each adapter will fill a multiple of the 2K byte blocks reserved for add-in modules. There was also a series of columns in Circuit Cellar Ink called Firmware Furnace by Ed Nisley. They started about 3 years ago (circa early-1996) and have ended. In it, he described turning a PC into an embedded controller. It covered hooking into the POST, writing a boot sector, etc. Very usefull series of articles. Lee Jones ------------------------------------------------------------------- Jones Computer Communications lee@frumble.claremont.edu 509 Black Hills Dr, Claremont, CA 91711 voice: 909-621-9008 -------------------------------------------------------------------