Multi-sector operations implementation

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
ManOfSteel
Member
Member
Posts: 60
Joined: Tue Feb 01, 2005 12:00 am

Multi-sector operations implementation

Post by ManOfSteel »

Hello,

I would like to know how did you implement your multi-sector read/write operations (eg: if your filesystem needs 1KB blocks or more instead of 512 bytes blocks).
Did you program your FDC driver (and DMA) to read more than one 512-bytes sector (eg: reading an entire track) or did you simply leave it to the filesystem driver to issue as many SEPARATE sector reads/writes as there are "sectors per block"?

Thank you for your replies.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Hi,

I'm not certain what level you are talking about: VFS or lower-down in the driver. So I'll quickly talk about both.

My VFS obviously has no concept of 'sectors', 'blocks' or 'tracks'. It can read/write any number of bytes.

The HDD driver (I don't have a floppy one) recieves reads/writes for any number of bytes. It converts this number into a number of sector reads. If it can convert it to a single bus read of multiple sectors then it does.

JamesM
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

When dealing with the hard drive I always read in 64 sectors at a time and then buffer that. I put 64 in the sector count register and just issue the command once instead of issuing 64 separate sector reads. It just seems more efficient to me. So a request for 96 sectors worth of data would end up performing 2 64 sector reads from the hard disk.

The floppy driver always reads 18 sectors at a time. Requests longer that 18 sectors would result in multiple 18 sector reads.

All the fixed read lengths make it a lot easier to buffer the data in the drivers.
Post Reply