Dual Booting in Hardware
While boot sector software has been written to allow a PC to boot with
an operating system chosen from a menu, there are some operating systems
(like windows 95) which like to use the first sector of the hard drive
in a way which makes this awkward. The instructions that follow describe
how to wire a system with two hard drives on a switched cable so that the
effective drive order (ide master/slave) can be reversed, allowing different
boot sectors on each.
I will say at the outset that I am not a master programmer, and am
happier with wire cutters and a soldering iron than compilers and linkers.
My instructions reflect this, and the procedure is probably not for the
faint hearted, and I'm afraid if you do something silly and manage to damage
your hard drive or control card or chip on the motherboard, please do not
say you were not warned!
Unless the drive sizes are identical, the CMOS needs to be updated
each time the drives are swapped, motherboards which 'autodetect' the drive
size at boot time will not be troubled by this, otherwise the CMOS needs
to be updated by the operating system as it loads.
Certainly for windows 95 or MSDOS this is no problem, utilities to
save/load the necessary part of the CMOS to a short file exist and a short
sequence to check CMOS then LOAD CMOS with the correct numbers if wrong
and reboot can be put into the autoexec.bat. Although it might seem that
this should not work, because autoexec.bat would not load unless the drive
size was already indicated correctly in CMOS, this is not the case, (providing
both drives are addressed by the bios in LBA mode) because the way logical
blocks are calculated from the master boot sector partition table will
work out correctly, even if the cylinder/head numbers are wrong. I presume
a similar argument will apply to LINUX, as the MBR records read by LILO
are also calculated in absolute sectors, means the effective LBA should
work out OK.
The system has not been tested with LINUX, it was designed for a more
modest purpose, to help keep a PC that ran DOS and win 3.X, with all the
comfort of familiar clothes, and at the same time have a new PC running
the new(ish) windows 95, and get used to that without having to lose the
old one. To that end the CMOS updates have been deliberately chosen to
make the 'old machine' have DOS and windows on drive C:, and see the windows
95 drive as drive D:, however, when booting under windows 95 the drive
containing DOS and windows 3.X is marked as 'NOT INSTALLED' in the CMOS.
This way files can be transferred from the 'old' to the 'new', but even
if the most horrendous accidents occur on win 95, there is no danger at
all of the 'old' machine being upset. All one has to do to change machines
is to switch off in the normal way, throw the switch, switch back on, and
reboot a second time after the CMOS has been updated. One day I will automate
this part of the process too, when I do I will post it here.
Note on early and late IDE interfaces:
Initially it had been hoped that all that was necessary was to swap
the two 'circuit select' lines in the ribbon cable, wires 37 (low= master
on) and 38 (low =slave on) as these are supposed to be nothing more
than decoded addresses. Indeed inspection of a 1993 interface card revealed
nothing more than some 74 series gates pulling these lines low when the
correct binary sequences were present on the address lines of the edge
connector. Sadly, this was a red herring, requiring the use of a 'scope
and a lot of thought before understanding dawned.
The effect of a double pole double throw switch swapping wires 37 and
38 was to produce a system that worked fine when the wires were connected
normally, the drive jumpered as 'master' came up as 'c:' and the slave
as 'd:'. However, when the wires were crossed, instead of just swapping
the drives as expected the system would hang during the power up sequence,
and after a depressingly long delay report a HDD controller failure. Of
course, if I'd read the ATA3 spec, available from the seagate web site
as a 280+ page PDF file first, instead of later, I could have avoided
this detour. One of the refinements in going from IDE to ATA is the addition
of DMA, and this requires the interface chip to be rather more than a I/O
bus extender with address decoding. During the DMA sequence, and also during
power up on a motherboard that supports DMA both lines go low together
- this could never happen with the simple address decoder, as the address
lines cannot have the same bit both set and unset at the same time! Master/Slave
differentiation becomes more than just the drive waking up on either pin
37 or 38 going low -which is what the jumpers on early PIO only drives
used to select. Fortunately, there is a solution, buried deep in the ATA
spec. Pin 28 which used to be spindle sync (pulses to allow the rev rates
of drives to be synchronized) is redundant in modern drives with large
buffers, and has been redefined as 'cable select'. The jumpers on both
drives are set to 'C sel' or 'cable' and pin 28 on one drive is grounded,
and not on the other. The drive with the grounded pin 28 is 'master'. On
the 'slave' drive the open circuited line is pulled up to 5V by a resistor
of 10K or so (a quick 'buzz' with the multimeter between pin 28 and the
5v pin of the power block should confirm this, but use a meter which applies
a test voltage less than 0.6V or you could be fooled by forward biasing
anti-static protection diodes.) AH-HA a solution dawns -
WIRING (Switched cable select):
First identify the ribbon cable that runs from the controller to the
two hard drives, if you are unsure with wire cutters etc., it might be
best to buy a spare ribbon cable before starting. You will also need a
single pole change over switch, some where on the case to attach it.
(In the test system a blanking plate at the back was drilled to take
the switch, rather than spoil the case. This meant that there was no danger
of getting drilling swarf into the machine, and if the machine is ever
sold, a new blanking plate and ribbon cable will remove the evidence that
anything 'non standard' was ever done. Also the fact that you have to reach
round the back reduces the risk of the machine being 'personality switched'
by accident)
You also need enough hook up wire to reach from the furthest drive
to the chosen switch position- there are no massive currents involved,
but be neat and choose a gauge of wire and a route that is not going to
foul cooling fans or so tight that it snaps off at the roots as it vibrates
like a violin string! Tie wraps or carpet tape work well in this department!
Cut into the ribbon at wire number 28, and tease out the two wire 28s
-one for each drive. Cut back and isolate wire 28 to the controller, and
insulate if need be. Solder the outer two terminals of the switch to the
two drive 'Cable select' lines, and connect the slider of the switch to
a convenient logic low. I obtained this by joining into a OV wire, in the
power connector 'Y' junction feeding the two drives (0V is either of the
central pair of wires, probably black or blue, the outer wires are +5V
and +12V) Once again the multimeter can be used to confirm this is at the
same voltage as the case. Actually a wire to the case would probably have
been OK, but I wanted a secure connection, and was also keen to have everything
neat and reversible by replacing standard cables, rather than hacking into
anything permanent. Verify with the meter that with the switch in
one position one drive has a grounded pin 28, and the other is high impedance
but pulled to the supply, and that with the switch in the other position
they swap over. Once you are happy about this, mount the drives securely,
tie back your new wiring, double checking all is secure, and joins well
insulated.
You can then run the machine up - it is worth confirming that the drives
really do swap over- you may need to boot off floppy and see files that
were on C: appear on D:, and as the new C: has no operating system you
will need to install one.
Go Back to my welcome page A 'circuit'
if you can call it that is shown below.
