Reserving a contiguous block on an ACSI or IDE device.

Hardware, coding, music, graphic and various applications

Moderators: Mug UK, moondog/.tSCc., [ProToS], lp, Moderator Team

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 654
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Reserving a contiguous block on an ACSI or IDE device.

Postby Anima » Mon Oct 23, 2017 1:58 pm

I would like to have a contiguous block of a certain size reserved on the hard disk from which I can read using the ACSI DMA or IDE registers. The "best" way so far, all I can think of, is to defragment the HD first, then create a file of the given size and obtain somehow the CHS info from its starting sector. Is this possible in an easier way like using some existing HD driver routines or tools?

User avatar
AdamK
Captain Atari
Captain Atari
Posts: 234
Joined: Wed Aug 21, 2013 8:44 am

Re: Reserving a contiguous block on an ACSI or IDE device.

Postby AdamK » Mon Oct 23, 2017 3:51 pm

There is no 'OS' way to do that.
Atari: FireBee, Falcon030 + CT60e + SuperVidel + SvEthlana, TT, 520ST + 4MB ST RAM + 8MB TT RAM + CosmosEx + SC1435, 1040STFM + UltraSatan + SM124, 1040STE 4MB ST RAM + 8MB TT RAM + CosmosEx + NetUSBee + SM144 + SC1224, 65XE + U1MB + VBXE + SIDE2, Jaguar, Lynx II, 2 x Portfolio (HPC-006)

Adam Klobukowski [adamklobukowski@gmail.com]

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 654
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: Reserving a contiguous block on an ACSI or IDE device.

Postby Anima » Mon Oct 23, 2017 4:50 pm

AdamK wrote:There is no 'OS' way to do that.

Ok, so I think the best way is to reserve a whole partition then. However, it's not that easy to detect them properly when you have to cope with different HD driver signatures.

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 676
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Reserving a contiguous block on an ACSI or IDE device.

Postby mfro » Mon Oct 23, 2017 6:20 pm

On a FAT16 or FAT32 filesystems, you could scan the FAT for a suitable number of adjacent clusters, set up a cluster chain, mark the clusters used and create a corresponding directory entry. Not sure if the danger jeopardizing the user's precious data makes this worthwhile, however.

It's also unsafe as this might break if the user decides to copy your file around.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2800
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Reserving a contiguous block on an ACSI or IDE device.

Postby AtariZoll » Mon Oct 23, 2017 7:48 pm

Anima wrote:I would like to have a contiguous block of a certain size reserved on the hard disk from which I can read using the ACSI DMA or IDE registers. The "best" way so far, all I can think of, is to defragment the HD first, then create a file of the given size and obtain somehow the CHS info from its starting sector. Is this possible in an easier way like using some existing HD driver routines or tools?

I have code for it - what is used by audio track DMA playback in some games, modded for that. The size can be from some 1MB, up to partition size.
Of course, partition must be defragmented for proper work. The condition that my code can detect exact loc. on disk - in linear, absolute sector pos. on media (and not obsolete CHS) is that hard disk driver using regular PUN structure. And that is case with most of better, newer driver SW.
Detection of loc. uses not hard disk driver rutines, but code for accessing that area will need, of course.

Now, idea of reserving whole partition is not bad too - depending of needed sizes. I had in some earlier partitioner SW option for creating such, special RAW partitions. Absolute loc. of some partition on media can find with help of PUN too. That is part of code for finding loc. of specific file, where just need to add to it loc. of file inside partition. That later is done with little trick, so no need to walk thru FAT.
Btw. you will need at least 3 low level hard disk code: basic ACSI, ICD extended ACSI and IDE (LBA, CHS only if want to support some really old drives).
Negative feedback has usually positive effect.

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 654
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: Reserving a contiguous block on an ACSI or IDE device.

Postby Anima » Mon Oct 23, 2017 8:35 pm

AtariZoll wrote:Now, idea of reserving whole partition is not bad too - depending of needed sizes. I had in some earlier partitioner SW option for creating such, special RAW partitions. Absolute loc. of some partition on media can find with help of PUN too. That is part of code for finding loc. of specific file, where just need to add to it loc. of file inside partition. That later is done with little trick, so no need to walk thru FAT.
Btw. you will need at least 3 low level hard disk code: basic ACSI, ICD extended ACSI and IDE (LBA, CHS only if want to support some really old drives).

I'll need a lot of space on the partition. Simply the more the better. I have some very simple low level routines for ACSI and IDE physical sector access because there's no room for any higher level drivers. As long as I can obtain the start address (sector) of the raw data everything's fine.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2800
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Reserving a contiguous block on an ACSI or IDE device.

Postby AtariZoll » Tue Oct 24, 2017 7:46 am

I sent you code in PM. That's for getting file location. Part of it is how to get partition loc. on drive, using PUN. That should work with any decent driver SW. There are other ways, but that will be for sure more complicated.
Low level rutines for ACSI, IDE access are not long. All it can fit in couple hundred bytes. But to access locations over first GB need ICD extended ACSI - that can be combined with basic ACSI code to keep it short.
Negative feedback has usually positive effect.

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 654
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: Reserving a contiguous block on an ACSI or IDE device.

Postby Anima » Tue Oct 24, 2017 8:14 am

AtariZoll wrote:I sent you code in PM. That's for getting file location. Part of it is how to get partition loc. on drive, using PUN. That should work with any decent driver SW. There are other ways, but that will be for sure more complicated.
Thanks for the code. Looks promising so far. :cheers:


Social Media

     

Return to “Professionals”

Who is online

Users browsing this forum: No registered users and 7 guests