Post by I am RobDoes any one know how the SmartPort assigns a slot/drive to a device
Dev 1 = Slot 7 Drv 1
Dev 2 = Slot 7 Drv 2
Dev 3 = Slot 4 Drv 1
Dev 4 = Slot 4 Drv 2
Dev 5 = Slot 1 Drv 1
Dev 6 = Slot 1 Drv 2
Dev 7 = Slot 2 Drv 1
Dev 8 = Slot 2 Drv 2
Dev 9 = Slot 3 Drv 1
Dev 10 = Slot 6 Drv 1
Dev 11 = Slot 6 Drv 2
Dev 12 = Slot 3 Drv 2
or is there a translation table stored somewhere in memory?
If Kent will respond, I would like to know how you handled the COP 82
instruction at the end of the $C70D routine (entry to SmartPort) in your
Kegs emulator,
Smartport is two things: a physical port you can plug 3.5", 5.25", etc.
drives into, and a software convention so OS's can communicate with devices
they may not have a "driver" for.
The software convention: If the $Cnxx ROM space for a slot appears to be
bootable, and $CnFF=0A, then it supports Smartport calls at $C70D, and
ProDOS calls at $C70A. The ProDOS entry point at $C70A supports just
two devices and supports just 65535 blocks, but the $C70D "Smarport" entry
point supports many more devices, I think 127, and can support up to
24-bit block numbers (or 32-bit block numbers, for Extended Smartport).
ProDOS 8 can only support two devices per "slot", so it remaps drives to
"virtual" slots. If slot 1 is a printer, for example, with no drives,
then ProDOS 8 can map 2 drives from another slot to be s1d1 and s1d2.
In this way, ProDOS 8 can support up to 14 devices, but s3d2 can only be
/RAM.
I don't know off the top of my head how ProDOS 8 manages this, but I do
know it was constantly changing, and the latest non-Apple ProDOS 2.5x does it
differently than any official release. Technote ProDOS #20 talks about
this remapping, and ProDOS Technote #23 talks about the versions of
ProDOS 8, which seems to say ProDOS 2.0.1 was the first to automatically
do this remapping.
ProDOS 16/GSOS doesn't have to deal with this 2-devices-per-slot restriction,
and can support lots more devices (I don't know the actual limit offhand).
KEGS doesn't use COP $82. KEGS does something really dumb, and compares
all instruction fetch addresses to see if it is to $00C70D, and if it is, it
calls do_c70d() in smartport.c. No matter what code you try to place at
$C70D, KEGS will interpret it as a smartport call to s7dx devices if you
execute at that address. And this is done for $C700 and $C70A as well.
So "PR#7" in KEGS runs no code from the $C700 space at all, it doesn't matter
what's there. I have plans to change this, but it's not a high priority.
Kent