[comp.sys.ibm.pc] Booting a hard drive with old ROMs

nevin1@ihlpf.ATT.COM (00704a-Liber) (02/02/88)

Recently, there was a posting from a person who needed to boot his hard drive
but he had old ROMs.  I am posting a solution from a friend of mine (w/o
network access) because I feel that although the problem is not of general
interest, the solution might be.

This product is shareware with the asking price of 39 cents (a penny per byte).
For those you worried about viruses, where could he hide it? :-) (Besides, he
gives the source, not the executables.)  Send responses to this directly to him
(his name and address are near the end of the article) or email to me (or post
it).
===============================================================================

HBOOT.COM and INTS.COM
----------------------
(includes listings)
The HBOOT.COM program boots the hard disk on IBM-PCs with 1981 IBM BIOS.
The INTS.COM program enables the hardware interrupts.

HOW IT WORKS (THEORETICALLY)
----------------------------

The original BIOS in the IBM-PC did not acknowledge hard drives in disk
calls.  Different types of hard drive have their own internal configuration
and command scheme, and, therefore, they contain their own ROMs.  The ROMs
are located at segment C800H or segment D800H.  They contain substitute
disk interrupt handlers which call BIOS if the disk call is intended for
floppy drives.  The problem with the old BIOS is that the new interrupt
vectors for these hard disk interrupt handlers are not automatically
installed.  HBOOT.COM calls the hard drive's ROM to install the interrupt
vectors, then loads the boot record from the hard disk.  In effect, the PC
boots twice, once from the floppy to call HBOOT.COM, and once from the hard
disk.  This means you can have two valid AUTOEXEC.BAT files!
There is a side effect.  All the hardware interrupts are masked off.
Because the floppy disk system uses the timer interrupt to tell it when
to turn off the motor, the floppy disk motor continues to run.  So I
created INTS.COM, a 6 byte program, to re-enable these interrupts.
The AUTOEXEC.BAT file on my hard disk calls INTS.COM.

BIOS NOTES & MODIFICATIONS
--------------------------

BIOS interrupt 13H selects the drive by a number in the DL register.  The
drives are limited to A=0, B=1, C=2, and D=3.  All disk commands act on the
floppy disk controller.  To access hard disks the drive numbers are
HardDisk1=80H, HardDisk2=81H etc.  When a single hard disk is fully installed,
disk calls are checked for drive number; if the call is for floppies, then
the old BIOS is called, otherwise, the hard disk services the call:

Before HBOOT
 INT 13H VECTOR -> BIOS Floppy disk handler.
After HBOOT
 INT 13H VECTOR -> Hard drive ROM -> BIOS Floppy disk handler.

If a second hard drive is used, it is usually controlled from the
same card (i.e., the same ROM) as the first.
HBOOT.COM was written for an IBM-PC with a Seagate 10MB hard disk.  Other
hard disks possibly use different entry points and ROM segments,
e.g., C800:0030 or D800:0023 etc.  If HBOOT doesn't work the first time, try
changing the ROM segment.  If this fails, use DEBUG to examine the ROM.
N.B. After the call to the hard drive ROM, the boot sector of the hard disk
     must be executed.  If this is not done, and the program simply returned
     to DOS, references to the hard disk do not work.  I believe this is
     because the hard disk parameter blocks are not set up.

LISTINGS
--------

listing of HBOOT.COM:
CS:0100 31C0          XOR     AX,AX         ;BIOS INT 13H function 00H
CS:0102 CD13          INT     13            ;Reset disk system
CS:0104 9A230000C8    CALL    C800:0023     ;Call ROM on Hdisk card
CS:0109 B80000        MOV     AX,0000       ;Set segment for disk load
CS:010C 8EC0          MOV     ES,AX
CS:010E B80102        MOV     AX,0201       ;Disk function READ sector 1
CS:0111 B90100        MOV     CX,0001       ;Read single boot sector
CS:0114 BA8000        MOV     DX,0080       ;Hard disk number 0 (+80H)
CS:0117 BB007C        MOV     BX,7C00       ;Offset for disk load
CS:011A CD13          INT     13            ;BIOS disk call
CS:011C EA007C0000    JMP     0000:7C00     ;Jump to loaded boot sector


listing of INTS.COM:
CS:0100 B000          MOV     AL,00         ;Clear AL
CS:0102 E621          OUT     21,AL         ;Send null mask to interrupt
                                            ;controller. Enable all hardware
                                            ;interrupts
CS:0104 CD20          INT     20            ;Terminate program


The opcodes or mnemonics in the listings may be entered into a file using
DEBUG.COM as follows (further information is available in the DOS user manual)

1) at the DOS prompt type

>debug

2) EITHER use the E command to enter the opcodes:

-e100
0100 00.31 00.c0 00.cd   etc.

   or use the A command to enter the mnemonics:

-a100
0100 xor ax,ax
0102 int 13

3) choose a filename with the N command:

-nhboot.com

4) set BX:CX to 20H bytes:

-RBX
BX=0000: 0000
-RCX
CX=0000: 0020

5) save using the W command

-w

6) quit

-q


-----------------------------------------------------------------------------
I would appreciate any replies to this article concerning results other users
have achieved, and/or any inaccuracies I may have presented.

Ivan Phillips,
2112E St. Johns Ave., Highland Park, IL 60035, USA
===============================================================================

-- 
 _ __			NEVIN J. LIBER	..!ihnp4!ihlpf!nevin1	(312) 510-6194
' )  )				"The secret compartment of my ring I fill
 /  / _ , __o  ____		 with an Underdog super-energy pill."
/  (_</_\/ <__/ / <_	These are solely MY opinions, not AT&T's, blah blah blah

dick@slvblc.UUCP (Dick Flanagan) (02/03/88)

In article <869@ima.ISC.COM> johnl@ima.ISC.COM (John R. Levine) writes:
> I hear that IBM reps are telling their customers with old PCs that since
> IBM won't sell them an updated ROM, they should call Phoenix Technologies
> and get a Phoenix clone BIOS for their PC.
> 
> The Phoenix people are happy to oblige, at a price [...]
  ^^^ ^^^^^^^ ^^^^^^ ^^^ ^^^^^ ^^ ^^^^^^  ^^ ^ ^^^^^

I would be curious to know where this last bit of information came from.

The Phoenix folks are a little frustrated by IBM's largess because they
(Phoenix) neither manufacture nor sell BIOS ROM's--they license BIOS
software to OEM's who then install that software in the ROM's they
(the OEM's) sell.

All calls coming into Phoenix Technologies from people who want to buy
BIOS ROM's are referred to the nearest OEM simply because Phoenix has
none to sell!

Dick

--
Dick Flanagan, W6OLD                        GEnie: FLANAGAN
UUCP: ...!sun!plx!slvblc!dick               Voice: +1 408 336 3481
USPO: PO Box 155, Ben Lomond, CA 95005      LORAN: N37 05.5 W122 05.2
--

johnl@ima.ISC.COM (John R. Levine) (02/03/88)

In article <3578@ihlpf.ATT.COM> nevin1@ihlpf.UUCP (00704a-Ivan Phillips) writes:
>
>Recently, there was a posting from a person who needed to boot his hard drive
>but he had old ROMs.  ...

I hear that IBM reps are telling their customers with old PCs that since IBM
won't sell them an updated ROM, they should call Phoenix Technologies and get
a Phoenix clone BIOS for their PC.

The Phoenix people are happy to oblige, at a price, and think that the whole
thing is pretty funny.
-- 
John R. Levine, IECC, PO Box 349, Cambridge MA 02238-0349, +1 617 492 3869
{ ihnp4 | decvax | cbosgd | harvard | yale }!ima!johnl, Levine@YALE.something
Gary Hart for President -- Let's win one for the zipper.

rde@eagle.ukc.ac.uk (R.D.Eager) (02/03/88)

Expires:

Sender:

Followup-To:



About a year ago I posted a utility for this. It was designed to be as non
technical as possible. Basically, it was a program to generate a boot floppy
for a hard disk system; you just ran it to generate a new boot floppy and then
used that to boot the system. All the special code was in the boot sector of the
floppy.

If anyone wants a copy, let me know. If there is enough interest I'll repost it.
It is self-documenting.
-- 
           Bob Eager
           rde@ukc.UUCP
           ...!mcvax!ukc!rde
           Phone: +44 227 764000 ext 7589

cramer@optilink.UUCP (Clayton Cramer) (02/04/88)

> In article <3578@ihlpf.ATT.COM> nevin1@ihlpf.UUCP (00704a-Ivan Phillips) writes:
> >
> >Recently, there was a posting from a person who needed to boot his hard drive
> >but he had old ROMs.  ...
> 
> I hear that IBM reps are telling their customers with old PCs that since IBM
> won't sell them an updated ROM, they should call Phoenix Technologies and get
> a Phoenix clone BIOS for their PC.
> 
> John R. Levine, IECC, PO Box 349, Cambridge MA 02238-0349, +1 617 492 3869

This must be a new policy for IBM -- IBM did sell me the BIOS upgrade, 
though they were so disorganized at the IBM Sales Office, it was sort of
a miracle.

Clayton E. Cramer