Jump to content
IGNORED

Atari ST hard disk facts, things to know


Recommended Posts

I feel need to put here little longer text about basic facts related with Atari ST computers hard disk usage. Mostly because see here lot of shallow posts, which instead giving help just make more confusion in all this.

 

First thing, the terminology :

Drive: stays for physical hard disk, but we can consider as it some modern Flash card with it's adapter. And right here comes possible confusion: UltraSatan has 2 SD card slots. So, is it one or 2 drives ? It is 2 for sure, since ACSI targer # is different for 2 slots/cards, so they act for TOS as 2 separated hard disks in fact.  Today we call Flash cards rather media.

 

Logical drive: that's actually partition of physical drive, since hard disks are usually divided into smaller sections. Usual letters for are:  C to P under TOS .

 

Filesystem: the way how data, files self are organized on storage media (drive) . All modern solutions (since late 70-es) are based on access by filename, have directories, sub directories, allow changes of file content and size at any time.

 

FAT filesystem:  abbrev of File Allocation Table - so there is table what covers complete partition area. Records in that table are called clusters too. For each file there is start cluster, so where in partition file starts, after that comes next cluster # - and that must be not next one, what comes after current one. If cluster is last, there is mark for it instead next cluster # . This is what allows mentioned file size change - so file can be longer even when space right after it is allocated (with some other file).

 

FAT12 - used by floppies. Means 2 POW 12 = 4096 possible FAT records (clusters) . Enough for floppies up to 4 MB size, because normally 1 cluster is 2 sectors.

 

FAT16 - used by hard disks. 2 POW 16 = 65536 possible FAT records.

And here need to say much more, since Atari and DRI made some really not too good solution, when established so called AHDI, BigGEM, or as many say 'TOS' partitions.

So, usual FAT16, what was used mostly by DOS allows up to 65534 FAT records (2 records at start are reserved) - what is btw. max file count on that partition too, and partition sizes supported by DOS were up to 2 GB.  Wait ... if there are max 65536 records, how big is 1 record size in case of 2 GB partition ?  Calculation says: 32 KB - and yes, that means that one cluster is 64 sectors long (1 sector is always 512 bytes) . And means that even shortest files will take min 32 KB space on drive - but that's price of simpler filesystem.

Cluster size practically depends from partition size - if it is in range 256-511 MB will be 8 KB .

 

FAT16 used by TOS: most likely because used C compiler limitations (Alcyon) Atari went on little different FAT16 system: they introduced so called logical sectors, what is actually group of physical (512 byte) sectors - so 1,2,4,8,16 of them handled as one.  Because did not use 32-bit sector addressing, only 16-bit one (mentioned compiler limit) - so could access larger partition sizes with that - like 16 phys. sectors = 8 KB x 65536 = 512 MB .

Then, cluster count is set on fixed 2 - what means that in case of partition size 256-511 MB it is 2x8 KB = 16 KB . In range of 64-127 MB it is 4x less, 4 KB .

But then what is max cluster (and file) count ? Well, only 32766 - 2 POW 15 and not 16 !  Yeah, that's another compiler limitation, most likely. And believe me, I know what I talking since I disassembled FAT16 filesystem of TOS and even corrected it to real 16-bit one (iTOS) . Those who looked some TOS sources in C can see there comment "it should be 32-bit" .

We can even say that TOS uses FAT15 actually.

The sad thing is that it was done as partially DOS compatible, so even byte order is in Intel format (low Endian), not Motorola. But you can not access 'TOS' partitions on some PC or MAC without special SW .

 

Still at terminology:  'DOS partitions' should mean FAT16 partitions used by DOS, with real FAT16 - and they are not accessible under TOS, except partitions under 32 MB size.

'TOS' partitions are with different parameters, with some kind of limited FAT16 . Called AHDI, BigGEM partitions too. And even MBR (very first sector in hard disk where locations of partitions are given) format is different. Which sector is not handled by TOS at all (except loading it in RAM), it's on hard disk driver to deal with data in it.

 

TOS/DOS compatible partitions, disk/media:

 

Luckily, it is possible to make such thing, and that's better solution than using program BigDOS with pure DOS partitions.

The whole thing is in giving such parameters, that they will be good for DOS and for TOS type FAT16. For instance count of reserved sectors at start  must be dividable with logical sector's physical sector count (usually it is 1-2 by DOS) .

Such partitions (with regular DOS type MBR) will be directly accessible under DOS, Windows, Linux, MacOS . Well, here must say that Windows normally allows access only to first partition in case of removable drives/medias, so will need to install some special driver to override that - very stupid limit in my opinion.

On Atari side needs of course driver what can handle it properly - what means as 'TOS' partitions.

 

TOS limitations:

 

TOS 1.00-1.02 :  max partition size is 256 MB

TOS 1.04-4.02 : max partition size is 512 MB

TOS 4.04 - max p. size is 1 GB.

 

Max partirion count (all partitions on all attached disks, medias together) :  14    C-P .

And yes, that's another strange limit on 32 bit CPU - because including A and B for floppies it makes exactly 16 instead 32 .

 

The efficiency:

 

Here must say that TOS FAT16 with it's large logical sectors is less efficient than real FAT16 with regular 512 sectors. Because minimum data size with what TOS and hard disk driver operate is 1 logical sector - so even if only few bytes, or few sectors are needed system is forced to load or write whole logical sector.

And another big flaw: because max 2 POW 15 records instead 2 POW 16 cluster size is 2x bigger in case of same partition size in case of TOS than DOS - so more slack (wasted space) on disk.

 

Usual errors, misinterpretations by users:

 

Not using proper terminology, confusing terms. Instead of looking for facts, and that's really easy now in Internet era, they making some own assumptions, or asking on forums - well later just works not as good as could, because some people likes to write, even if they have no sufficient knowledge about subject.

 

Some practical, up to date advice:

 

What to use today with ancient Ataris, as mass storage ?

Indeed some Flash card based solution. Some say 'old hard disks are real thing, that 'retro feeling', etc ...'  Yeah, do so if have too much money and like 'feeling of seeing it break' ? I say it from own experience - I had really lot of hard disks with my Ataris - starting with diverse 2.5 inch IDE drives from 1992, then later SCSI drives - almost all of it broke. Appearance of Flash cards, since about 2005 was the best thing what happened - and I bought that year my first Sandisk CF card (128 MB), then same capacity Flash IDE (what goes directly to IDE connector/port) - later one is still working. CF cards are by my experience more fragile than SD cards, probably because 50 pin connector. But overall failure rate is very low in my case: max 10% during 15 years and about 35 cards overall. Much better than with classic hard disks.  Not to mention low power and space consumption.

 

As here I seen solution: ACSI-SCSI adapter + SCSI2SD adapter  multiple times suggested need to say:

Don't see it as good idea. Why 2 adapters instead one ? We have UltraSatan, Gigafile what goes in ACSI port, or may go internally. It's cheaper, more reliable.

And not to forget 1 GB limitation of Mega STE or Stacy internal ACSI-SCSI adapter. You can not even buy now so low capacity new SD card.

 

Possible speeds:

 

In case of Ataris, speed of hard disk transfers, using ACSI port (so DMA chip) is limited mostly by DMA chip max speed. And it is 2 MB/sec in peak. Here to say that literature is wrong about it - I saw values of 1 MB/ses, 10 Mbit/sec. Wrong for sure - I did tests with all possible versions of DMA chip, on STs, Mega ST, Mega STE, even TT, and with all it was 2 MB/sec .

Of course, with older, small capacity drives, max speed will be rather under 800 KB/sec.

UlltraSatan can up to some 1150 KB/sec, but that depends from used SD card.

Satandisk is very slow: some 150 KB/sec .

Old good ICD adapters, later versions with overridden limit of 1 GB could up to 1.6 MB/sec with better SCSI drives. And that was what made me to make those DMA speed tests. btw.

My ACSI-CF adapter can up to 1.8 MB/sec with Sandisk cards.

 

Good IDE adapters with fast disk, CF card can up to 1.6 MB/sec .

 

Another factor is access time, and no wonder, it's much better in case of Flash cards than by classic hard disks - no mechanic.

 

My speed test SW: http://atari.8bitchip.info/ahpt.html

 

 

 

  • Like 8
Link to comment
Share on other sites

Good stuff, thanks for all that information Peter.

 

As far as the STacy and Mega STe goes (both use the same controller),

SD card readers are a god-send. Using Alan H's, or Lotharek's adapters,

users can blow right past that former 1 gig limit on mass storage.

 

Link to comment
Share on other sites

9 hours ago, zzip said:

When I had a hard drive on my STe back in the day,  I was told that the partition size limit was 32Mb,  and was 16Mb for older TOS's.  Was that misinformation or a limit of some hard disk driver?  (I think I had the ICD one)

That limit was only for first partition ( C ) by some not so good coded drivers. And yes, it was even only 16 MB by some. But that's really not TOS limitation, even if those who sold that crap said so ?

 

Link to comment
Share on other sites

20 hours ago, ParanoidLittleMan said:

That limit was only for first partition ( C ) by some not so good coded drivers. And yes, it was even only 16 MB by some. But that's really not TOS limitation, even if those who sold that crap said so ?

 

The guy who helped me set it up told me 32Mb was the max for all partitions,  so I guess I ended up having more partitions than I needed!   Ha!  oh well.    32mb seems small, but it was a decent size for an ST.

Edited by zzip
Link to comment
Share on other sites

On 4/8/2020 at 2:37 AM, Cyprian_K said:

Cool stuff,

 

BTW, there is a nice and cheap project for connecting SD card to ACSI port,

and Peter, you are credited there:

https://github.com/retro16/acsi2stm

 

s-l1600.jpg

 

Nice project!  Is there the possibility of pass-through for other devices on the bus?

Link to comment
Share on other sites

9 hours ago, TheNameOfTheGame said:

Nice project!  Is there the possibility of pass-through for other devices on the bus?

According to my experiences, with modern devices - I tested with Satandisk and UltraSatan it is better to connect multiple devices to ACSI port parallel, than using pass-through. So, can solve it with simple splitter - where hardest part is to get 19-pin connectors - need 2 female and 1 male.

Well, as picture says, can solve with 25-pin one with some wire removing.

Link to comment
Share on other sites

1 hour ago, zzip said:

The guy who helped me set it up told me 32Mb was the max for all partitions,  so I guess I ended up having more partitions than I needed!   Ha!  oh well.    32mb seems small, but it was a decent size for an ST.

 

I've ran into that belief a lot. PP's absolutely right though. I run an Atari ST based BBS that

has been going since the early 90's and I've always had a large C partition. In fact, I'm using

a 4 gig SCSI drive with something like 8 partitions, all just slightly under 512 megs, including

the C drive - it's worked just fine all these years and is still going (HDDriver software).

 

It really does depend on the TOS version/software. Lowest version I have on any of my Atari's

is v1.04, so it's not an issue. You really don't want to run anything less than that, especially if

you're using any mass storage.

 

Glad you got everything working.  :)

 

Link to comment
Share on other sites

With the world the way it is at the moment, it could be months and months before Lotharek is able to ship my Ultrasatan from Poland to the U.S. This, at least, gives me some good reading material. Between all of my projects, I'll be getting hard drives for my 8-bit and my STE soon, and I have no experience with one on either, so this will be a major learning opportunity.

 

Thanks for posting this Peter! I really appreciate it.

 

Link to comment
Share on other sites

I'm waiting on a VBXE for my 1088XEL, and the US, cable, & software SD for my STE. I ordered right before things started getting bad. Just bad timing. It'll make it eventually. I have a lot to learn between now and then though.

 

I'm sure I'll be contacting you soon about the drivers I'll need.

 

Thanks again for all of the information.

 

Link to comment
Share on other sites

20 hours ago, ParanoidLittleMan said:

According to my experiences, with modern devices - I tested with Satandisk and UltraSatan it is better to connect multiple devices to ACSI port parallel, than using pass-through. So, can solve it with simple splitter - where hardest part is to get 19-pin connectors - need 2 female and 1 male.

Well, as picture says, can solve with 25-pin one with some wire removing.

Ah, thanks for the information.

Link to comment
Share on other sites

  • 4 weeks later...
  • 6 months later...

I'm bumping this post because I need some HD solution for my Atari 1040 STe.

This ACSI2STM looks interesting, perhaps I can port this to Teensy 4.1. with 3.3v <> 5v level shifter. (need the speed of native (4 bit SDIO) micro SD card port access)

 

I am also looking into the HD IDE interface for Atari ST/E based on the GAL20V8 IC (Generic Array Logic) solution but I am complete noob at programming GAL chip. Well with the GAL IC the main issue is they are obsolete so I am forced to use Atmel AFT22V10C and using WinCupl as the editor and I got plenty of syntax errors. Wish there was simplified BOOLEAN-EQUATIONS version with out the TOS ROM switching.?

 

Link to comment
Share on other sites

Well if anyone here has the knowledge of GAL chip and willing to help translating this to WinCupl editor please help:

/* BOOLEAN-EQUATIONS */

/*         /CE1=LOW, CE1=HIGH, *=AND GATE, +=OR GATE */
/* WinCupl !CE1=LOW, CE1=HIGH, &=AND GATE, #=OR GATE  */

   DTACK = /AS*A23*A22*A21*/A20*/A19*/A18*RW+
   A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14; 
   
   /CE1 = /AS*A23*A22*A21*/A20*/A19*/A18*/A17*RW+/ROM2;
   /CE2 = /AS*A23*A22*A21*/A20*/A19*/A18*A17*RW;
   /SELP = A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14*/A5;
   /SELS = A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14*A5;
   /IORD = /AS*A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14*RW;
   /IOWR = /AS*A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14*/RW;
   /LINEA = A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14;

EDIT: Well perhaps I can figure this out on my own --> WinCupl !CE1=LOW, CE1=HIGH, &=AND GATE, #=OR GATE ?

Edited by Chri O.
Link to comment
Share on other sites

Ok I should really post the whole GAL code here so it's easier to understand what I'm trying to do here.

Note this is partially translated to Atmel WinCupl editor.

 

Name T206IDE3;
Partno ;
Revision 02;
Date 5/18/1992;
Designer Ulrich Hack;
Company None;
Location None;
Assembly None;
Device g20v8a;

/* IDENTIFICATION 
   T206IDE3;
*TYPE
  GAL20V8;
*PINS
*/

/* %INPUTS % */

PIN 1 = A23;   /* A23 = 1, (ORG.) */
PIN 2 = A22;   /* A22 = 2, */
PIN 3 = A21;   /* A21 = 3, */ 
PIN 4 = A20;   /* A20 = 4, */
PIN 5 = A19;   /* A19 = 5, */
PIN 6 = A18;   /* A18 = 6, */
PIN 7 = A17;   /* A17 = 7, */
PIN 8 = A16;   /* A16 = 8, */
PIN 9 = A15;   /* A15 = 9, */
PIN 10 = A14;  /* A14 = 10, */

PIN 11 = A5;   /* A5 = 11, */ 
     
PIN 13 = AS;   /* AS = 13, */
PIN 14 = RW;   /* RW = 14, */      /* OUTPUT ? PIN */
PIN 23 = ROM2; /* ROM2 = 23, */    /* OUTPUT ? PIN */

/* %OUTPUTS % */
  
/* https://atari.8bitchip.info/flashest.php */
/* Atari ST(E) Flash EPROMs instead normal (EP)ROMs with TOS version switch */
/* for TOS 1.6, 2.06... (STE) ,  address space is $E00000-$E3FFFF  */
  			 
PIN 21 = CE1;   /* CE1 = 21,   */    /* %E00000-E1FFFF % */
PIN 22 = CE2;   /* CE2 = 22,   */    /* %E20000-E3FFFF % */
PIN 16 = SELP;  /* SELP = 16,  */
PIN 17 = SELS;  /* SELS = 17,  */
PIN 18 = IORD;  /* IORD = 18,  */
PIN 19 = IOWR;  /* IOWR = 19,  */
PIN 20 = DTACK; /* DTACK = 20, */    /* %Goes to inverter with Open Collector e.g. 74LS03 % */
PIN 15 = LINEA; /* LINEA = 15; */    /* %To line transc. drivers for D0-D15, e.g. 74HCT245 % */


/* BOOLEAN-EQUATIONS */

/*         /CE1=LOW, CE1=HIGH, *=AND GATE, +=OR GATE */
/* WinCupl !CE1=LOW, CE1=HIGH, &=AND GATE, #=OR GATE */

   DTACK = /AS*A23*A22*A21*/A20*/A19*/A18*RW+
   A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14; 
   
   /CE1 = /AS*A23*A22*A21*/A20*/A19*/A18*/A17*RW+/ROM2;
   /CE2 = /AS*A23*A22*A21*/A20*/A19*/A18*A17*RW;
   /SELP = A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14*/A5;
   /SELS = A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14*A5;
   /IORD = /AS*A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14*RW;
   /IOWR = /AS*A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14*/RW;
   /LINEA = A23*A22*A21*A20*/A19*/A18*/A17*/A16*/A15*/A14;
   
/* *END */

/*
https://github.com/dwery/galasm/blob/master/GAL-ALGS.PGM

The pin out of GALs for programming:
---------------------------------------------------------
                                22V10
                                20XV10  6001
Pin     16V8    18V10   20V8    20RA10  6002    26CV12
1       VIL     VIL     VIL     VIL     VIL     VIL
2       EDIT    EDIT    EDIT    EDIT    EDIT    EDIT
3       RA1     RA3     RA1     P/V     VIL     P/V
4       RA2     RA4     RA2     RA2     RA2     RA2
5       RA3     RA5     RA3     RA1     RA5     RA1
6       RA4     SCLK    VIL     RA0     RA1     RA0
7       RA5     SDIN    VIL     RA3     RA4     VCC
8       SCLK    /STB    RA4     RA4     RA0     VIL
9       SDIN    SDOUT   RA5     RA5     RA3     RA3
10      GND     GND     SCLK    SCLK    SCLK    RA4
11      /STB    VIL     SDIN    SDIN    SDIN    RA5
12      SDOUT   VIL     GND     GND     GND     SCLK
13      VIL     VIL     /STB    /STB    /STB    SDIN
14      VIL     VIL     VIL     SDOUT   SDOUT   /STB
15      VIL     VIL     SDOUT   VIL     VIL     SDOUT
16      VIL     RA0     VIL     VIL     VIL     VIL
17      VIL     RA1     VIL     VIL     VIL     VIL
18      RA0     RA2     VIL     VIL     VIL     VIL
19      P/V     P/V     VIL     VIL     VIL     VIL
20      VCC     VCC     VIL     VIL     VIL     VIL
21                      RA0     VIL     VIL     GND
22                      P/V     VIL     VIL     VIL
23                      VIL     VIL     P/V     VIL
24                      VCC     VCC     VCC     VIL
25                                              VIL
26                                              VIL
27                                              VIL
28                                              VIL

 

Link to comment
Share on other sites

  • 1 year later...

Limitation to 1 GB in case of Stacy is actually limitation of internal ACSI-SCSI adapter (same as by Mega STE).

It is binary 1 GB, as result of 21-bit sector addressing. So, as wrote 2097152 ($200000) sectors ...

 

This was discussed here in multiple threads in last years.

Now there is choice of diverse Flash Card adapters for Atari ST(E) machines, and that is good for Stacy too for sure. So with UltraSatan, ACSI2SD(STM), SD4ST you have single adapter instead 2, and they can access SD cards with larger capacity - even 64 GB microSD worked with SD4ST well. But then we are at TOS limits - as wrote zillion times it is in case of TOS 1.04 and later: max 14 partitions of max 512 MB size.

So, 8 GB card is what can serve well, and to add here that they never have full 8 GB capacity, rather around 7 GB - so can use whole capacity ..

 

Link to comment
Share on other sites

  • 4 months later...
On 5/3/2020 at 10:19 AM, tzok said:

Sadly, this ACSI2STM is written on Arduino Environment, thus it is NOT using DMA, which STM32F103 is capable of, but the idea is really great!

Sorry for late reply. So, you claim that ACSI2STM connected to ACSI port of ST not using DMA (with capital letters, so must be true ?  ).

With all due to respect, I inform you that is can't be .  Because ACSI port uses DMA transfers by default. And all devices connected there will use it.   I know only 1 exception - and it is my ACSItoCF adapter - it uses DMA normally (but it works only with Sandisk CF cards), and then it is fastest adapter for ACSI port (2 MB/sec in peak, and that's max what DMA can) . I just added so called single byte mode, so other brand CF cards can work with. Then transfer speed is about 300 KB/sec, and that's max possible (I know to write fast ASM code). 

While ACSI2STM transfer speed is 600 KB/sec (firmware from about 1 year ago) - it is what I measured on my ACSI2STM.  And it can be only in DMA mode.   

Actually, why you think that because is written in specific environment it does not using DMA ?

 

And when I'm here, let's talk about other nonsense spread in Atari ST circles, forums, articles, and even e-mails:

 

So, few posts above mentioned 'first partition size special limit by TOS' - some say 16 MB, some 32 MB :

 

This is result of pure shallowness by those who stated it. They experienced it, and instead looking better about just jumped to conclusion that it must be TOS limit.   Well, that really does not make sense that TOS has such limit - all partitions are threatened in same way. And why would be different ?   Will not go more detailed in it. Will only say that I know TOS well, and I even modded it's FAT16 filesystem driver part to be better.

The reason for those partition C size limits are hard disk drivers. Concrete their not well concepted load of DRIVER.SYS file (typical name) .

That load must be done before filesystem is initialized - of course, because initialization can happen only after hard disk driver is loaded and set up.

But space in bootsector (MBR by hard disks) is only 512 bytes. And that's not enough to load file from FAT16 filesystem, only if making it shorter, so no large logical sector ...  However, simple solution is:

1. Load extra few sectors after MBR, and there will be more space for more complex code to load that SYS . There is space for it before first partition.

2. Even better is to load driver self from those sectors after MBR . And that's how my driver works. Size of it is around 10 KB (packed), while usual start sector of first partition is 63 - so there is 31 KB space for it . Why in 2 steps when can do it in 1 step ? Benefits of placing driver SYS in partition C ?  Like easier update of driver - just copy new v. over older one .  Yeah, but running driver installer program and press couple keys actually takes not more time and clicks, key presses .

 

Claims as result of not knowing basic things + shallowness :

 

"Also, a way better hard driver emulator for ST is ACSI2STM (it enables you to use generic FAT-16 formatted SD cards, it has an integrated driver)" .

It was written in thread where someone asked about  'Ebay SCSI2SD adapter' - OMG ! Ebay now manufactures HW ! How I missed it ?

OK, let's be serious (although it is really hard) .  So, what is wrong with it. Shallow formulation, writing 'driver' instead drive - or maybe it was not typo ?   So, if someone points on that it can use generic FAT-16 formatted ...  it is normal to assume that it is not common, that what was asked about in thread start can not use it ... And on top of that comes mentioning of integrated driver, right after first claim. In normal people head that means only one: that integrated driver is what solves usage of that generic FAT-16.

In all it only true thing is that it really has integrated driver - actually more than one.  Who want, can visit ACSI2STM site to see what actually is written there - will need some time .

So, what is reality ?  It is simple, and everyone using Flash cards could see it after some time and experience:  Adapters, generally said can use cards formatted with any filesystem. Like FAT16 - DOS type, TOS (AHDI) type, FAT32, NTFS, diverse Linux filesystems, total rare, custom filesystems ....   Adapters work with sectors, and their location on media (LBA, CHS)  - and that has nothing with filesystem.

So, it is so with old ACSI-SCSI adapters, IDE adapters etc . Up to latest ACSI port of ST to some Flash card adapters. And we have now at least 7 of such - Satandisk, Gigafile ...

What is responsible for filesystem handle, or where is filesystem driver ?  It is well known thing - OS . 

Ah, I need to cut with so much details, already too long . So, just concrete mistakes:

Being very shallow. Not knowing how it works (mass storage on computers) . Then, that integrated driver in ACSI2STM works only with TOS (AHDI) type partitions, and not with generic (DOS) FAT16 !  LOL !   

And guess what ?  It was written by same tzok as that ' NOT using DMA'  .

Now, I guess that some will post here, saying how rude I'm, disrespectful, etc . Freedom to exposing own opinion.

There is no 'opinion' in hard facts, binary logic, simple math, how some device actually works ....

I spent almost 1 hour preparing and writing this. Not to fight, insult someone. There are higher values, much more useful things.

And that would be helping, teaching people.  And I hope that some will give further what read here. \

Some will say: what is guarantee that I'n in right ?  My work so far with all mentioned here.  But if not enough - everyone can test all what I wrote here, on my site ...  Reading other articles, posts ? Well, it is known that not everything on WEB is true. Sadly, even Atari official DOCs contain errors.

To add, that I made filesystem self:  https://zx48.8bitchip.info/zx.php

It is very simple, and there is no space in 16 KB ROM for Spectrum OS for not simple. FAT16 filesystem driver in ST TOS self in longer than 16 KB. So, there are no subdirectories, FAT - all files are in one contingous block (so not fragmentation), and that means that can delete only last one. Instead subdirs, there are sections by start letter of filename.  And that's enough to avoid too many files in 1 section.  100 MB storage is way enough for all Spectrum SW .

 

In case of Atari - they (or rather DRI) went on being compatible. Sadly, it is compatible only up to 32 MB partition size.

For the end:  Atari ST can work with other filesystems too - but not with in ROM TOS filesystem driver (regular TOS versions).

And there are drivers for it. Or different OS - Mint for instance.  It is possible to write program to handle FAT32 . Not sure that it will be useful. Because it is easy to copy files from FAT32 to Atari partition with some modern computer (and faster, of course). Can do it with USB reader, with NetUsBee ...

32 MB partitions were OK in early 90-es. Now surely not. I even made special driver what could select what block on media to use as hard disk - they were with 4-8 32 MB partitions, so 1 block of average size about 100-150 MB, on media with capacity around 160-400 MB . All it was in driver SW, was no need for any extra support from adapter.  Of course, it is obsolete now.

 

Link to comment
Share on other sites

Un, I think he meant not using DMA inside the STM32F103 to move data from GPIOs to memory without using the CPU. This is a feature available in many microcontrollers but it seems the API is not available when using Arduino IDE. This is not related with the Atari DMA which is obviously required for ACSI. 

Link to comment
Share on other sites

I am also curious why everyone is crying about Arduino C++ programming style ?

Why can't you use the DMA ?

I can program my Teensy 4.1 Microcontroller in Assembly Language if I want to. All in Arduino IDE ?

 

// --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ----- DMA - Data In Phase ---------------------------------------------
// DATA direction: From Target Device to Atari
// A1   : ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ HIGH indicates inactive.
// DRQ  : ¯¯¯¯¯¯\________________/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ Active LOW, DMA Device Data request, Used by the peripheral to request a DMA data transfer.
//                |
// _ACK : ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\______________/¯¯¯¯¯¯¯¯¯¯¯
//                |     ||              |
// DATA   =============><--------VALID--------><==== 8bit DATA Bus
//                |     ||              |     |
//                |<-a->||<-----b------>|<-c->|
// Timing
// a)  60 ns  (max)
// b)  250 ns (max)
// c)  50 ns  (min)
// DRQ Active LOW (open-collector) 1K 5V+ Pullup on ATARI.
//
// Send some bytes from dataBuf through the port to the Atari DMA controller
static inline void sendDma(uint32_t count) {
  uint32_t b;
  noInterrupts();
  acquireDataBus();
  for (uint32_t i = 0; i < count; ++i) {
    WriteData(dataBuf[i]);
    digitalWriteFast(_DRQ, LOW);
    //while ((b = GPIOB_PDIR) & (ACK_MASK)); // Read Port B and ACK_MASK at the same time, TEENSY 3.x              ACK                            Teensy INPUT ONLY
    while ((b = GPIO7_PSR) & (ACK_MASK));    // TEENSY 4.1
    //  T4.1 ACK_MASK
    // #define ACK_MASK 0b00000000000001000000000000000000 // 0b0000 0000 0000 0100 0000 0000 0000 0000 -GPIO7-18 Pin 36 B1_02     ACK            Teensy INPUT ONLY

    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;"); //
    digitalWriteFast(_DRQ, HIGH);
    digitalWriteFast(_DRQ, HIGH);
    digitalWriteFast(_DRQ, HIGH);
    // digitalWriteFast(_DRQ, HIGH);
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //
    asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop;"); //

    // for (uint32_t i=0; i<59; i++) __asm__("nop\n\t"); // about 250 nanoseconds @600MHz.
  }
  releaseBus();
  interrupts();
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...