Mac68k Forums

Home


Welcome, Guest
Guest Settings
Help

Mac68k Forums » Development » Software Hacking

Thread: Serial Disk Driver


Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 72 - Pages: 5 [ Previous | 1 2 3 4 5 | Next ] - Last Post: Oct 29, 2013 12:19 PM Last Post By: bbraun
tt


Posts: 145
Registered: 8/25/12
Re: Serial Disk Driver
Posted: Oct 27, 2012 4:32 AM   in response to: landonf in response to: landonf
Click to report abuse...   Click to reply to this thread Reply
Congrats! I would like to try it when I get a chance. I hope I can figure out a way to compile for Arduino. =/

Here's the hook-ups I have in mind (first image is bigger than it appears here):





With a side of something like this (or maybe a simpler version):



BTW, how do I post attachments?

Message was edited by: tt
bbraun


Posts: 493
Registered: 7/25/12
Re: Serial Disk Driver
Posted: Oct 27, 2012 3:47 PM   in response to: tt in response to: tt
Click to report abuse...   Click to reply to this thread Reply
For attaching images, there's the "Attach Files/ Choose File" button at the bottom of the editing screen for new posts.
To make the image show up inline, you use exclamation points around the attached filename. So <!>mypicture.png<!> without the angle brackets.
tt


Posts: 145
Registered: 8/25/12
Re: Serial Disk Driver
Posted: Oct 27, 2012 6:58 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
bbraun wrote:
For attaching images, there's the "Attach Files/ Choose File" button at the bottom of the editing screen for new posts.

Odd, I have never seen that button, maybe my browsers aren't supported (Chromium, Firefox, Safari). I even disabled ad blocker.
landonf


Posts: 86
Registered: 7/23/12
Re: Serial Disk Driver
Posted: Oct 27, 2012 7:55 PM   in response to: tt in response to: tt
Click to report abuse...   Click to reply to this thread Reply
tt wrote:
bbraun wrote:
For attaching images, there's the "Attach Files/ Choose File" button at the bottom of the editing screen for new posts.

Odd, I have never seen that button, maybe my browsers aren't supported (Chromium, Firefox, Safari). I even disabled ad blocker.

Hum. I'm using Chrome too. Do you not get the 'Choose File' button shown below?

tt


Posts: 145
Registered: 8/25/12
Re: Serial Disk Driver
Posted: Oct 28, 2012 8:23 PM   in response to: landonf in response to: landonf
Click to report abuse...   Click to reply to this thread Reply
Nope, it's deleted. Could it be a permissions issue?

landonf


Posts: 86
Registered: 7/23/12
Re: Serial Disk Driver
Posted: Oct 28, 2012 8:53 PM   in response to: tt in response to: tt
Click to report abuse...   Click to reply to this thread Reply
tt wrote:
Nope, it's deleted. Could it be a permissions issue?

Ooops. Yep. Should be fixed now. Sorry!
tt


Posts: 145
Registered: 8/25/12
Re: Serial Disk Driver
Posted: Oct 30, 2012 2:26 AM   in response to: landonf in response to: landonf
Click to report abuse...   Click to reply to this thread Reply
Attachment smiley_bw.gif (125 bytes)
Cool.
landonf


Posts: 86
Registered: 7/23/12
Re: Serial Disk Driver
Posted: Nov 14, 2012 11:26 AM   in response to: landonf in response to: landonf
Click to report abuse...   Click to reply to this thread Reply
I realized that I will probably never get this done if I try to do everything up-front, PCB design included, so I just ordered a basic SD-card breakout board from Sparkfun: https://www.sparkfun.com/products/11403

I can drop that in with my existing AVR work and wire up the sd card code.
bbraun


Posts: 493
Registered: 7/25/12
Re: Serial Disk Driver
Posted: Nov 25, 2012 12:15 AM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
Boom. I got this working on a 512KE running System 3.3. At 57.6kbps.
serialdisk0.9-presys6.cpt.hqx

The control panel part obviously doesn't work, so you can't select the baud rate. It loads at boot and is always active. Every couple seconds it'll try to look for a server and attach if one is found.

The only real changes to this are:
1) All references to StripAddress (instruction 0xA055) in the INIT and DRVR resource were changed to NOP (instruction 0x4E71) using a hex editor.
2) The file type was changed from 'cdev' to 'INIT' since pre-system6 doesn't know much about 'cdev' files.

The most difficult part was finding a working serial cable. I had tried the Imagewriter cable since the Apple KB on the cable says tx and rx are connected. However, trying both an official Apple cable from the era and this cable, I found the tx line is connected as per the KB, but the rx line is not. That didn't make it terribly useful.

However, once a suitable cable was located, all was well with the above INIT.
bbraun


Posts: 493
Registered: 7/25/12
Re: Serial Disk Driver
Posted: Nov 25, 2012 12:02 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
It occurs to me the main reason why 57.6kbps is safe on these older machines is the communication is synchronous (as in, the server will not send any data unless the host mac has asked for it, and then it will only have 1 outstanding request at a time), and there is not much going on while requests are outstanding.
In light of this, it might be reasonable to up the data rate on faster machines. It is my understanding that there is no driver call to enable faster data rates on machines before the AV macs, because it requires selecting not just a different clock divisor, but using an entirely different clock. I suspect if we open the driver, then bang on the SCC directly to setup the clock and data rate, the OS driver will work with the current setup.
bbraun


Posts: 493
Registered: 7/25/12
Re: Serial Disk Driver
Posted: Nov 25, 2012 4:20 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
FWIW, I tested the driver on a true 64KB ROM, 512K system. M0001W, on a 400K floppy running System 3.3. With the HD20 INIT to get HFS support, it works fine.

A standalone serial server would be pretty neat since this would be a pretty usable mass storage solution for pre-SCSI machines.
bbraun


Posts: 493
Registered: 7/25/12
Re: Serial Disk Driver
Posted: Nov 25, 2012 5:44 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
And now an application loader for the DRVR:
serialdisk0.9-loaderapp.cpt.hqx

Since INITs weren't supported until System 3.2, this is just an app that loads the driver and exits. Tested on System 1.1/Finder 1.1g on a 64KB ROM 512K.

Arbee

Posts: 61
Registered: 11/29/12
Re: Serial Disk Driver
Posted: Nov 29, 2012 11:01 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
This project is really cool. Is the protocol still as documented on page 1?

Let me explain my interest: I maintain the Mac drivers for MESS. We strictly emulate the actual chips in the actual machines as a philosophy. While this allows us to do fun things that would kill Basilisk like running 7.6.1 with virtual memory cranking or plugging 4 different video cards and an ethernet card into an emulated Mac IIx, it has the downside that our HDD images need to be complete volume images with the Apple partition map and disk driver and stuff. (Because we emulate the actual 5380 and 5394/96 SCSI chips and simulate a generic SCSI HDD at the other end of the SCSI bus). Most images you find around the Internet are bare HFS partitions because vMac and Basilisk patch out the .Sony driver (and in the case of Basilisk, everything else - I think by the time they're done patching you could run on an Amiga). We don't have that option because we have working IWM emulation.

Thus, if I optionally simulated that server it would give me the capability to mount those images without disturbing any of my actual h/w emulation.
bbraun


Posts: 493
Registered: 7/25/12
Re: Serial Disk Driver
Posted: Nov 29, 2012 11:11 PM   in response to: Arbee in response to: Arbee
Click to report abuse...   Click to reply to this thread Reply
Welcome, and I'm glad this can be useful to you.
The protocol should be the same as documented with an addition.
Command 4 is "eject". The current server exits when it gets this command, although that shouldn't really be necessary. After sending the eject command, the driver will go into a disconnected state and will poll the serial port for a server again using command 1 (Get Image Size). So if the server doesn't exit, it'll probably just remount the image.

FWIW, the server is super bare bones. You could probably pretty easily adapt it for your purposes.
techknight

Posts: 110
Registered: 10/13/12
Re: Serial Disk Driver
Posted: Dec 9, 2012 10:07 PM   in response to: bbraun in response to: bbraun
Click to report abuse...   Click to reply to this thread Reply
I could be entirely out in left field with this, But can we make the serial disk put in ROM so we can boot from it? albeit slow, but it may work especially for machines like the duo without floppy drives, and dead HDDs.

Now of course, that would mean the ROM chips would have to be replaced and new ones hacked into place (SMD).

I fear though that it would require expansion of the protocol so the MAC could request a specific image to be mounted. such as "system.hfx". if not found/not blessed then dismount, unload the serial driver, and move on. or instead of system.hfx, make it a particular machine name. so before writing ROM, system.hfx could be changed to macse30.hfx or pbduo280.hfx or whatever. So multiple boots could technically be on the same SD card. I chose the hfx file becuase apple disk image IMG file i dont think are raw and i dont feel like handling the image header/etc in the AVR. id rather have a raw binary file. like a hardfile.

Message was edited by: techknight

Point your RSS reader here for a feed of the latest messages in all forums