Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Additional Hard Disks #1186

Closed
paulhlee1967 opened this issue Feb 21, 2023 · 12 comments
Closed

Add Support for Additional Hard Disks #1186

paulhlee1967 opened this issue Feb 21, 2023 · 12 comments

Comments

@paulhlee1967
Copy link

Would like to be able to have multiple hard disk controllers so I can mount more than two large disk volumes at the same time.

@tomcw
Copy link
Contributor

tomcw commented Feb 23, 2023

This has been requested in other issues before, but ultimately depends on #853.

NB. The backend work for this was done in #996, so it just needs exposing in the UI.
Also note, that there's no workaround for this yet (eg. directly editing the Registry for AppleWin won't work as the HDD image files are only loaded for slot 7).

See #1033 - there were some proposed command line options.
Maybe command line is good enough for now?

@burniouf
Copy link

wouldn't it be possible to add a way to select "Block Mode" $Cn07 = $3C with 2 devices so that Apple ][+ could boot and "Smartport Mode" $Cn07 = $00 with more than 2 devices so that Slot 7 being seen as a SmartPort device by ProDOS and Enh //e could boot ?

@tomcw
Copy link
Contributor

tomcw commented Mar 5, 2023

@paulhlee1967 - I released a new AppleWin 1.30.14.0, and if you are okay with using command line options, then you can put a 2nd hard disk controller (hdc) into slot 5, eg:

applewin.exe -s5 hdc -s5h1 <pathname>

(I will leave this issue open - I still need to investigate and reply to @burniouf)

@tomcw
Copy link
Contributor

tomcw commented Apr 2, 2023

@burniouf

wouldn't it be possible to add a way to select "Block Mode" $Cn07 = $3C with 2 devices so that Apple ][+ could boot and "Smartport Mode" $Cn07 = $00 with more than 2 devices so that Slot 7 being seen as a SmartPort device by ProDOS and Enh //e could boot ?

From the current firmware (hddrvr.a65):

start

; Autoboot and ProDOS look at the following few opcodes to detect block devices
; NB. $Cn07 should be $00 for a SmartPort Interface, but changing this means that it won't autoboot on ][, ][+ and unenhanced IIe.
; . ref: http://www.1000bit.it/support/manuali/apple/technotes/udsk/tn.udsk.2.html
 lda #$20
 lda #$00
 lda #$03
 lda #$3C

The obvious idea is if the Apple II model is "Enh //e", then modify the firmware so that $Cn07 = $00 (otherwise just leave it as $3C).

Then for this Smartport version, there'd need to be a way to specify more devices. The command line is the simplest way initially (with some GUI support following).

The firmware may need extending to better support Smartport commands (currently it just assumes STATUS, READBLOCK or WRITEBLOCK).

The emulator may need extending to support more Smartport commands (eg. INIT, FORMAT, CONTROL).

Best to spin this off into a new issue.

@burniouf
Copy link

burniouf commented Apr 2, 2023

Would you like me to write some "smartport" ROM for Applewin ?
All i need is the core IO to status and read / write blocks from/to DEV ID = 1,2......
Minimal code also requires proper handling for status call to DEV ID = 0 (Smartport controller itself, must returns device count, and DIB) i hope $Cn00 space is enough to get all of this within 256 bytes.
Next step would be a way to add a $C800 ROM space to add more conplex SmartPort firmware...that potentially could handle other than BLK devices....ideally added to smartport bus by some advanced GUI stuff :-)

@burniouf
Copy link

burniouf commented Apr 2, 2023

About switching from Cn07 = $3C <-> $00....should be more an option...putting a $00 device in a ][+ is absolutely possible in real hardawre.....the only difference is that you cannot autoboot on it....

@tomcw
Copy link
Contributor

tomcw commented Apr 2, 2023

Thanks, but maybe the current firmware (here) is "good enough" (except for the $Cn07 value)?

EG, here I already have a regression test that uses the current firmware's Smartport entrypoint to do READBLOCK:
https://github.com/AppleWin/AppleWin-Test/tree/master/Projects/GH319-SmartPort-page-cross

And if it is "good enough", then the extra support just needs adding in the AppleWin emulation of the hard disk controller.

Reading your A2osX ProDOS doc, you say:

With ProDOS 8 Version 2.0.1, ProDOS supports more than two SmartPort devices per slot by remapping the third device and beyond to different slots.

So I think I can use that to test this.

@burniouf
Copy link

burniouf commented Apr 3, 2023

You need proper support for Smartport STATUS call, because ProDOS (and maybe Pascal 1.3...etc...) uses STATUS:0:0 to build device list while booting...and most utilities use STATUS:ID:0 and STATUS:ID:3 to query devices for DIB to at least get the blocksize to create ProDOS catalog / bitmap while formatting.

Your regression test only check for block I/O...but actual ROM may not be enough to be handled properly by OSes.

@tomcw
Copy link
Contributor

tomcw commented Apr 3, 2023

I think this (eg. STATUS) should be handled in the emulator - leaving the firmware to just be a simple, thin layer.
EG, in the extreme case where there are $7E units(!), then the emulator can easily support this, whereas the firmware will struggle.

@tomcw
Copy link
Contributor

tomcw commented Apr 3, 2023

I've spun this off to #1207, and I will close this issue.

@sh95014
Copy link
Contributor

sh95014 commented Jun 4, 2023

@tomcw Is a hard disk attached to slot 5 expected to be bootable? It always boots to a slot 6 floppy drive instead (and just goes to monitor without the floppy), and would appreciate any hints/guesses before I go digging. Thanks!

@tomcw
Copy link
Contributor

tomcw commented Jun 10, 2023

Is a hard disk attached to slot 5 expected to be bootable?
It always boots to a slot 6 floppy drive instead

You'll need to remove the Disk II Controller card from slot 6.
...and you can only currently do this from the command line:

> applewin.exe -s6 empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants