Welcome, Guest. Please login or register.

Author Topic: df0:/df1: boot selector switch  (Read 4046 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline curtisTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 1049
    • Show only replies by curtis
    • http://www.suddenlink.net/pages/curtismc
df0:/df1: boot selector switch
« on: July 10, 2017, 12:06:10 AM »
Has anyone tried one of these?  http://www.ebay.com/itm/122327373472

I've tried this on 2 separate A500's and have had absolutely zero luck with it.

Both drives are fully functional and work without the switch in the line.  Add the switch and the boot process doesn't even get to the insert workbench screen.

I've tried every combination of the switch orientation and nothing works.

However, without the switch and adapter in place, if I have a diskette in df1: and not df0: if quite happily boots up!

Is the switch even needed?
Outside a dog, a book is a man\'s best friend. Inside a dog it\'s too dark to read! Groucho Marx

Curtis McCain

http://pages.suddenlink.net/curtismc/
 

Offline BLTCON0

  • Jr. Member
  • **
  • Join Date: Oct 2013
  • Posts: 91
    • Show only replies by BLTCON0
Re: df0:/df1: boot selector switch
« Reply #1 on: July 10, 2017, 01:59:00 AM »
At the heart of proper hardware-level df0: - df1: switching is the switching of the SEL0 and SEL1 signals produced from the even CIA chip.

The ebay selector supposedly does that:
In the default position, it routes SEL0 (on CIA) to SEL0 (on motherboard socket and eventually to internal floppy connector) and SEL1 (on CIA) to SEL1 (on motherboard socket and eventually to external floppy connector), let's call this the || (straight-through) mapping.
In the alternate position, it routes SEL0 (on CIA) to SEL1 (on motherboard socket and eventually to external floppy connector) and SEL1 (on CIA) to SEL0 (on motherboard socket and eventually to internal floppy connector), let's call this the X (cross-over) mapping.
Obviously the switcher's PCB isolates the relevant pins so it can manipulate the routing via the switch or the jumpers.

With the X mapping, an external drive will work as DF0: at the hardware level but the internal drive will generally NOT work as DF1: (exception: if it is an Amiga-specific high density drive), hence the appropriate name "boot selector" rather than "drive switcher".
However, the claim made "By switch the button you can change your internal DF0 into DF1" is erroneous.


My guess (please verify accordingly, as you don't provide much info on your A500s) is:

1. Both your A500s have 2.x/3.x Kickstarts and are thus normally able to boot from DF1:, which is what you describe:
"However, without the switch and adapter in place, if I have a diskette in df1: and not df0: if quite happily boots up!"
But this happens due to KS 2.x/3.x ability to mount df1: at boot time and thus boot from it, the A500 *knows* it's booting from df1: and not df0:

2. With the switch in the default || position, everything also works as it would
without the switch present (if it doesn't, there's something fundamentally wrong with the switch obviously).

3. "Add the switch and the boot process doesn't even get to the insert workbench screen."
This (I guess) happens with the switch at the X position, and (I guess) it actually gets to the insert Workbench screen if you leave it alone for 30 or more seconds.
The reason this happens is that KS 2.x/3.x will try to mount df1: (which now is the internal drive) but, as explained above, this particular switch is not equipped to allow this. After a while the process will fail/give up and you will be able to just use the external drive as df0:

4. "I've tried every combination of the switch orientation and nothing works."
Big ouch! NEVER make such orientation experiments, you're sending +5V to random places. Not all pins can sink the current produced.

5. "Is the switch even needed?"
A proper switch, yes. You can't rely on KS2.x/3.x ability to boot from df1: as this won't generally work for NDOS games. For true switching, you need it done at the hardware SEL0/SEL1 signals level.
« Last Edit: July 10, 2017, 02:03:41 AM by BLTCON0 »
 

Offline curtisTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 1049
    • Show only replies by curtis
    • http://www.suddenlink.net/pages/curtismc
Re: df0:/df1: boot selector switch
« Reply #2 on: July 10, 2017, 03:11:59 PM »
@BLKTCON0

First, thanks for the reply and the tutorial.

You're right.  Forgot to mention I was using a 3.1 ROM.

After reading your reply, I tried the switch again.

I also applies a bit more pressure with the heel of my hand and was rewarded with a nice "chunk" sound as the adapter seated in properly into the socket.  That may have been the root cause of my initial problems.  Those machined pins require a bit more pressure than I was expecting.

BTW, all changes in switch position and plug in location were done with the computer OFF.  Also studying the theory behind this switch from a file in aminet shows only the sel0 and sel1 are being switched so there shouldn't be a problem with voltages going to ground.

Trying the switch in the outer set or pins resulted in the Insert disk screen on both positions of the switch.  

Moving the switch connector to the inner set of pins results in being able to boot from the "external" drive but the internal drive is nowhere to be found!

Switching the switch to (what I guess is) the default position, the internal disk boots up just find AND the external drive is found.

So, it does sound like the switch is sort of working.  Drives can be switched, but by booting from the external drive, with the switch in circuit, results in the "loss" of the internal drive.

Weird!
Outside a dog, a book is a man\'s best friend. Inside a dog it\'s too dark to read! Groucho Marx

Curtis McCain

http://pages.suddenlink.net/curtismc/
 

Offline BLTCON0

  • Jr. Member
  • **
  • Join Date: Oct 2013
  • Posts: 91
    • Show only replies by BLTCON0
Re: df0:/df1: boot selector switch
« Reply #3 on: July 10, 2017, 07:19:11 PM »
Quote from: curtis;828116
@BLKTCON0

First, thanks for the reply and the tutorial.

You're right.  Forgot to mention I was using a 3.1 ROM.

After reading your reply, I tried the switch again.

I also applies a bit more pressure with the heel of my hand and was rewarded with a nice "chunk" sound as the adapter seated in properly into the socket.  That may have been the root cause of my initial problems.  Those machined pins require a bit more pressure than I was expecting.

...and hopefully they won't widen the receptacles in the socket beyond being able to accept normal thin-pin chips again! Using an intermediate socket, if possible, to take all the stress from the machined pins is always a good idea.

Quote
BTW, all changes in switch position and plug in location were done with the computer OFF.  Also studying the theory behind this switch from a file in aminet shows only the sel0 and sel1 are being switched so there shouldn't be a problem with voltages going to ground.
Yes, of course, but you mentioned "orientation" which I suppose means you also tried installing the switch rotated by 180 degrees. Of course if you didn't change the actual CIA chip orientation (i.e. it remained correctly orientated with respect to the underlying motherboard socket) then yes, much less to worry about.

Quote
Trying the switch in the outer set or pins resulted in the Insert disk screen on both positions of the switch.  

Moving the switch connector to the inner set of pins results in being able to boot from the "external" drive but the internal drive is nowhere to be found!

Switching the switch to (what I guess is) the default position, the internal disk boots up just find AND the external drive is found.

So, it does sound like the switch is sort of working.  Drives can be switched, but by booting from the external drive, with the switch in circuit, results in the "loss" of the internal drive.

Weird!

Not really weird, that's why I insisted on calling it a "boot selector" rather than an actual drive switcher. As I said, this switcher is not equipped for proper drives switching (unless the internal drive happens to be a high-density FB-357A one, which rarely is the case in an A500 as it's strictly a DIY job).

The reason it won't properly swap drives is trackdisk.device unit detection.
Since ALL Amigas are expected to have a 3.5" DD unit installed as df0: at the very minimum, trackdisk.device won't bother requesting the drive type.

(with KS 2.x and 3.x which supports HD drives it actually will, but just to check if it's an HD FB-357A drive with an HD disk inserted. If a regular FB-354 or other plain DD drive is installed, trackdisk.device won't lose any sleep over lack of drive ID and (correctly, in logical terms) assume it's a DD drive.)

For the external drive however, the ID sequence is mandatory (even with KS 1.x) as it can be either a 5.25" or 3.5" (DD) drive.
Therefore all Amiga external DD drives have suitable circuitry (the circuitry is not on the drives themselves, those are bog standard mechanisms. It's on the small interfacing board every external drive enclosure has) to correctly ID themselves upon request (the ID sequence is fully detailed in the Hardware Manual). Some use a NAND gate, some use a transistor, some might use a serial shift register, but the net result is the same: a bit sequence which tells trackdisk.device "hello, I'm a 3.5" DD drive" etc.

So now you can appreciate the complexities arising from simply switching SEL0 and SEL1:
The external drive (which now responds to SEL0) does have the required ID circuitry which, incidentally, is no longer required. It still reports itself as a 3.5" DD drive, but that's what KS 3.1 would anyway have assumed.
The internal drive (which now responds to SEL1) must correctly report itself (as it's now considered an external drive), but sadly lacks the necessary circuitry (unless it's an FB-357A).
So you must re-implement the ID circuitry.

If you take a look at the A2000 schematics, the A2000 motherboard (which must internally support an "external" drive and thus incorporate the ID circuitry to keep trackdisk.device happy) uses the NAND gate approach to ID the second drive:
J301, when jumpered, passes the ID bit sequence onto the RDY line as the output of a NAND buffer, with one input being the inverted _SEL1 signal (aka SEL1) and the other input being the Q output of the motor flip-flop.
Gary outputs the motor control signal as active high (MTR0 instead of _MTR0, so MTR0 corresponds to Q').
But with some simple boolean logic we have:

SEL1 NAND Q translates to:

(here SEL1 refers to SEL0 of course, and Q' is MTR0 so Q is _MTR0)

(SEL0 * _MTR0)' = (by De Morgan's laws)

= SEL0' + (MTR0')' = _SEL0 OR MTR0

which incidentally happen to be the exact signals available on Gary.

So grab yourself a small piece of veroboard, solder an OR gate there (with appropriate decoupling cap), wire appropriately to Vcc and GND, wire 3 of the 4 gates to GND and use the 4th gate to implement
_SEL0 OR MTR0

_SEL0 is Gary pin 16
MTR0 is Gary pin 46

and wire the OR gate output to the _RDY line, which is on ODD CIA (U7) pin7.

This will provide the missing circuitry from the "switch" you bought so it fully swaps the drives.
« Last Edit: July 10, 2017, 09:04:34 PM by BLTCON0 »
 

Offline thebajaguy

  • Newbie
  • *
  • Join Date: May 2017
  • Posts: 35
  • Country: us
  • Gender: Male
    • Show only replies by thebajaguy
Re: df0:/df1: boot selector switch
« Reply #4 on: July 11, 2017, 12:45:11 AM »
I ran across the little jumper mod to connect pin 2 to pin 10 on the floppy header (in this case, an A2000, but would work for any DF0:), with the net result being that Amiga thinks there's no floppy in the drive.  

I have not tried it yet on the boot swap adapter I have, but, on an A500 (or 1000, or A2000 jumpered for a single internal floppy) if one could do this jumper in addition to the SEL line X, would it render the internal drive (missing the extra circuitry, and therefore not functional) as just a drive without a disk?

(If it worked, a TPDT switch (3 poles, 2 positions) would be needed, or a second switch of SPST type to effect the jumpering.)
Former GVP Tech Support 1989-1993 - Bloodied in the original trenches of the Amiga Wild Wild West.
 

Offline BLTCON0

  • Jr. Member
  • **
  • Join Date: Oct 2013
  • Posts: 91
    • Show only replies by BLTCON0
Re: df0:/df1: boot selector switch
« Reply #5 on: July 11, 2017, 01:48:53 AM »
Quote from: thebajaguy;828141
... would it render the internal drive (missing the extra circuitry, and therefore not functional) as just a drive without a disk?


Yes. Use a standard 1N4148 diode for that, not just a jumper wire.
Cathode on pin10, anode on pin2 and place the switch inline (open at ||, closed at X).

A three-way two-position switch will suffice with careful wiring.
1 2 3
4 5 6
7 8 9

CIA sel0/sel1 isolated from socket sel0/sel1
CIA sel0 to 4 and CIA sel1 to 5
socket sel0 to 1 (||) and 8 (X)
socket sel1 to 2 (||) and 7 (X)
6 to floppy header pin2
9 to anode of diode
floppy header pin10 to cathode of diode

Switch at 1-4, 2-5, 3-6 implements || (original) mapping
Switch at 4-7, 5-8, 6-9 implements X mapping with suppressed internal drive.
 

Offline curtisTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 1049
    • Show only replies by curtis
    • http://www.suddenlink.net/pages/curtismc
Re: df0:/df1: boot selector switch
« Reply #6 on: July 11, 2017, 02:31:12 AM »
Wow!

Now that's how an explanation should run!

Excellent description and explanation.
Outside a dog, a book is a man\'s best friend. Inside a dog it\'s too dark to read! Groucho Marx

Curtis McCain

http://pages.suddenlink.net/curtismc/
 

Offline BLTCON0

  • Jr. Member
  • **
  • Join Date: Oct 2013
  • Posts: 91
    • Show only replies by BLTCON0
Re: df0:/df1: boot selector switch
« Reply #7 on: July 13, 2017, 10:17:27 PM »
@curtis
Thank you.
I had to do this research when designing my own automatic drive switcher (it doesn't use a mechanical switch but the state of the left mousebutton upon reset to decide if it'll switch or not. I didn't like drilling holes in my pristine A500 case :-) ).
As I'm one of the few with FB-357A's inside their A500 all was well until I moved testing to another A500, when the lack of ID became a problem which I solved the way I presented above.
The good thing about this whole Boolean transformation approach is that since it ends up only using a simple OR gate on readily available signals, it is quite possible to implement using a couple of diodes and a resistor (and not waste 3 of the 4 gates of a standardised IC).
 

Offline e5frog

  • Newbie
  • *
  • Join Date: Jun 2010
  • Posts: 5
    • Show only replies by e5frog
Re: df0:/df1: boot selector switch
« Reply #8 on: November 27, 2017, 08:17:03 AM »
Quote from: BLTCON0;828123

So grab yourself a small piece of veroboard, solder an OR gate there (with appropriate decoupling cap), wire appropriately to Vcc and GND, wire 3 of the 4 gates to GND and use the 4th gate to implement
_SEL0 OR MTR0

_SEL0 is Gary pin 16
MTR0 is Gary pin 46

and wire the OR gate output to the _RDY line, which is on ODD CIA (U7) pin7.

This will provide the missing circuitry from the "switch" you bought so it fully swaps the drives.


I have made a boot selector myself, put it in my A500 (already had spare holes since my youth). Added it to be able to boot from a so called Gotek drive hooked up in an external housing

Clever solution, I suppose the OR:ed signal should only be connected to _RDY when the X:ing is active?
 

Offline BLTCON0

  • Jr. Member
  • **
  • Join Date: Oct 2013
  • Posts: 91
    • Show only replies by BLTCON0
Re: df0:/df1: boot selector switch
« Reply #9 on: November 27, 2017, 01:14:20 PM »
Quote from: e5frog;833587
Clever solution, I suppose the OR:ed signal should only be connected to _RDY when the X:ing is active?

It could but it doesn't make any difference, it would just complicate things.
In other words, keeping it connected at all times is surplus to requirements but does not contradict them either.

From an "elegance" point of view, we have a kludge from Commodore here.
On the one hand they decided to implement an identification mechanism (via the RDY line) for floppy drives to accompany their whole autoconfig concept for the Amiga.
So far so good, but then on the other hand they skipped implementation of it for DF0: by reason that a 3.5" DD drive (and nothing else) will always be there, so no need to request an ID for the drive connected to the SEL0 line. In other words, the 3.5" DD floppy drive at DF0: was considered an indispensable part of a working Amiga system, so no need to question about it.

So when you swap drives the proper way (by X-ing SEL0 and SEL1), the external drive ends up as DF0: and its implemented ID mechanism is no longer required, while the internal drive ends up as DF1: and requires a (missing on the motherboard) ID mechanism, which has to be retrofitted.

But just like the surplus ID mechanism doesn't cause any problem for the external drive when in X-ed mode, the retrofitted ID mechanism won't harm anything for the internal drive when in ||-ed mode either.

The exception is if you somehow have a special Amiga HD drive as an internal unit in your A500 (Chinon FB-357A). These drives take care of ID-ing themselves, so no need to retrofit an ID mechanism in that case, in fact you must NOT retrofit it as the drive will probably lock in DD mode only.
 

Offline r.cade

  • Jr. Member
  • **
  • Join Date: Apr 2011
  • Posts: 62
    • Show only replies by r.cade
Re: df0:/df1: boot selector switch
« Reply #10 on: January 19, 2018, 12:58:24 AM »
Both drives will also work in switched mode as long as you have it in the "normal" position during boot up (just wait until insert workbench screen with no disks in) and then flip the switch.

Then, DF0 is external, DF1 is internal. There is no danger of damaging anything by flipping when power is on, I wouldn't think.