It is currently Thu Mar 28, 2024 4:58 am




 Page 4 of 4 [ 54 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: Fast Reads - how?
PostPosted: Thu Sep 23, 2010 6:01 am 

Joined: Mon Jan 23, 2006 10:49 am
Posts: 187
Location: Salzburg, Austria
flashjazzcat wrote:
I had an idea for a foolproof way to read the LBA drive geometry in 16 bit mode: just use a binary chop, starting with LBA 0 through <arbitrarily high value>. I would imagine the upper LBA range would be found after a dozen or so disk reads.

I just had the same idea and then read that you already came up with it :-)

Set the "<arbitrarily high value>" to 2^28-1 and then loop until lo==hi, you'll have the last readable sector after a constant 28 runs. This could also be handy to check if the drive isn't lying about the size in the "identify" command :-)

so long,

Hias


Offline
 Profile  
 
 Post subject: Re: Fast Reads - how?
PostPosted: Thu Sep 23, 2010 7:38 am 

Joined: Wed Mar 04, 2009 7:27 am
Posts: 98
Location: United Kingdom
HiassofT wrote:
flashjazzcat wrote:
I had an idea for a foolproof way to read the LBA drive geometry in 16 bit mode: just use a binary chop, starting with LBA 0 through <arbitrarily high value>. I would imagine the upper LBA range would be found after a dozen or so disk reads.

I just had the same idea and then read that you already came up with it :-)

Set the "<arbitrarily high value>" to 2^28-1 and then loop until lo==hi, you'll have the last readable sector after a constant 28 runs. This could also be handy to check if the drive isn't lying about the size in the "identify" command :-)
Hias

LOL. It came to me while my wife was talking to me about something or other... that's when I do a lot of my best thinking. :lol:

To answer the question about separate versions for inernal and external devices: there's no need, since the driver will automatically configure itself to whichever interface is installed. Of course there are ATM relatively few possible configurations:

1) IntSDX and external MyIDE
2) SDX cart and internal MyIDE
3) AtariMax MyIDE+Flash cart containing SDX

I was considering making a homebrew internal interface which will live with IntSDX, but I really don't have the time just at the moment (Thanks for the plans and files, by the way Matthias: sorry I haven't gotten around to replying yet: I had to take a day off to finish a couple of XM301/SIO2SD conversions).

I also forgot to respond to Sijmen's question about the non-checksummed I/O code. Well - there's nothing complex about it. The code in the driver is basically the same as the code in the MyIDE movie viewer. In my view, the IDE device either works or it doesn't. Mine didn't work (properly) until I performed a proper Phi2 mod. Before that, the need to constantly check DRQ during the read/write loop basically meant the interface wasn't working properly. I was ready to abandon the hadrware and driver at that point, even though it was functional. Now the timing issues are sorted out, IDE read/write is 100% accurate. I may be wrong, but surely extensive retry/error correction logic/DRQ/busy checks are basically to compensate for the Phi2 timing errors on so many Atari computers?

Of course the option of "safer" I/O code will remain for those who have stability problems or for whom speed is not a great concern: at the very least, DRQ checking inside the loop, and error checking and retry logic needs building into both (fast and slower) flavours. But speed was the main objective at the outset: MyIDE running at 12KB/s under DOS is no use to me at all: I might as well use an SIO2SD which can achieve the same speed and brings no OS compatibility problems. MyIDE at 60KB/s, however, is a different matter altogether. That's the whole reason I wanted to finish Kyle's driver.



_________________
The Last Word, MA65 Assembler, RIF SpartaDOS Utilities, XEDIT
Offline
 Profile  
 
 Post subject: Re: Fast Reads - how?
PostPosted: Thu Sep 23, 2010 7:15 pm 

Joined: Sat Sep 13, 2003 12:21 am
Posts: 251
FJC, Sijmen is probably talking about the checksum that is currently being done on sector 0 in the CHS scheme... it protects against corruption of the config info. Here's how I implemented that in MyIDE Config:

chksum = 0;
for(ret=0; ret<0xFE; ++ret) {
chksum += buffer[ret];
}
buffer[0xFE] = (unsigned char) (chksum % 256);
buffer[0xFF] = (unsigned char) (chksum / 256);

buffer is the entire 256 bytes of sector 0.

PS. is there a SDX version for the Atarimax 1mb+Flash cart? I didn't think there was yet.



_________________
MyIDE Tools
Offline
 Profile  
 
 Post subject: Re: Fast Reads - how?
PostPosted: Fri Sep 24, 2010 2:47 am 
User avatar

Joined: Sun Nov 02, 2003 8:15 am
Posts: 1549
Location: netherlands
With the checksum option I ment to save a 129e byte when doing 128byte transfer.
To complete a IDE-cycle, you must do 256 reads anyway (PIO-16)
But for 256 and 512 bytes transfer that is not an option.

The partition checksum BTW has moved and is now calculated and stored in ram.
This is safer. When a program destroys the table, the code re-reads sector 0
and extract the drive-info.

About master/slave:
Yes that works perfectly. Just set the master/slave-bit in the head-register first,
then the other registers before doing IO. With LBA a nice way to create identical backups ;-)

Later,
Sijmen.


Offline
 Profile  
 
 Post subject: Re: Fast Reads - how?
PostPosted: Fri Sep 24, 2010 6:34 am 

Joined: Wed Mar 04, 2009 7:27 am
Posts: 98
Location: United Kingdom
Ah - right. I understand now regarding the checksums. This is something to implement later... :)

Sijmen: what is the exact error-checking sequence to detect a failed drive read? My system is still showing successful reads from both master and slave, even though only the master is connected. I assume the error register should be non-zero after issuing the read sector command to the slave drive? This doesn't seem to be the case...



_________________
The Last Word, MA65 Assembler, RIF SpartaDOS Utilities, XEDIT
Offline
 Profile  
 
 Post subject: Re: Fast Reads - how?
PostPosted: Fri Sep 24, 2010 8:33 am 
User avatar

Joined: Sun Nov 02, 2003 8:15 am
Posts: 1549
Location: netherlands
That is a good question. I've not experimented with master/slave since years......
I remember something like the master-drive checks for a slave and has the status for it.
Directly after powerup or after the diagnostic-command.
Here is a ATA-3 specification, perhaps that helps you out.
http://www.t10.org/t13/project/d2008r7b-ATA-3.pdf

Later,
Sijmen.


Offline
 Profile  
 
 Post subject: Re: Fast Reads - how?
PostPosted: Fri Sep 24, 2010 2:33 pm 

Joined: Wed Mar 04, 2009 7:27 am
Posts: 98
Location: United Kingdom
Thanks Sijmen. I looked at the ATA3 docs before and they're an excellent reference. Haven't debugged the master slave stuff yet; still perfecting FDISK. I'm about a day behind schedule because I decided to revise the partition table editing interface. Now, with an empty disk, the user is presented with a single chunk of free space. They create up to 15 partitions in this unallocated space, and the "unallocated" entry always remains at the end of the list, shrinking in size as partitions are added. Later, when partitions are erased or resized, more "unallocated" entries appear and disappear, in amongst the active partitions. The user can later choose which unallocated area to create partitions in. It offers much greater control over partition placement, is completely visual, and leaves the door open for active partition movement in future. This table is generated from (and translated back to) the partition table on the disk.

No doubt about it: 32-bit arithmetic is very code-heavy! :)



_________________
The Last Word, MA65 Assembler, RIF SpartaDOS Utilities, XEDIT
Offline
 Profile  
 
 Post subject: Re: Fast Reads - how?
PostPosted: Sat Sep 25, 2010 12:20 pm 

Joined: Wed Mar 04, 2009 7:27 am
Posts: 98
Location: United Kingdom
Going well here: should be about done on Sunday night. :)

Still can't reliably detect read errors to distinguish master/slave presence. ERROR never seems to get set. I also need this to work for the binary chop (to establish the number of LBA blocks on the device).

...whoops - it seems to be working now. Not sure how, but it works... :)



_________________
The Last Word, MA65 Assembler, RIF SpartaDOS Utilities, XEDIT
Offline
 Profile  
 
 Post subject: Re: Fast Reads - how?
PostPosted: Sat Oct 02, 2010 2:08 am 

Joined: Wed Mar 04, 2009 7:27 am
Posts: 98
Location: United Kingdom
Hoping to get a beta driver released on Sunday. :)



_________________
The Last Word, MA65 Assembler, RIF SpartaDOS Utilities, XEDIT
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 4 of 4 [ 54 posts ]  Go to page Previous  1, 2, 3, 4


Who is online

Users browsing this forum: No registered users and 61 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

cron