Re: [hatari-devel] Max amount of GEMDOS HD file handles? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
On 28 Jul 2023 at 17:49, Thomas Huth wrote:
> Am Thu, 27 Jul 2023 15:22:51 -0400
> schrieb "Roger Burrows" <anodyne@xxxxxxxxxxxx>:
>
> > On 27 Jul 2023 at 21:06, Eero Tamminen wrote:
> > >
> > > Leaving 64 handles to TOS (same as now), and increasing GEMDOS handles
> > > from 32 e.g. to 64 should be fine, right?
> > >
> > This raises an interesting issue. TOS and EmuTOS allow up to 75
> non-standard
> > handles (6-80 inclusive). Hatari uses 64-95 for its GEMDOS handles. So
> it's
> > possible to have different files open on different drives (one GEMDOS and
> one
> > non-GEMDOS), with the same handle.
> >
> > It is of course extrememly unlikely that this will happen, but it could (I
> have
> > a test program if anyone needs one to verify). If it *does* happen, I
> assume
> > that I/O to the non-GEMDOS file will quietly be routed by Hatari to the
> GEMDOS
> > file. To be safe, the GEMDOS handles *should* start at 81 or higher.
>
> I'd agree at a first glance - but it could also cause troubles instead:
> What if a badly written old program uses the file handle as an index into
> an array that has only 80 entries? ... that would break if we'd increase
> the base offset ...
Well, at the moment, handles with a GEMDOS drive active can go up to 95, so
such a program would not run anyway. We can of course theorise forever about
badly-written programs. I was just pointing out that a correctly-written
program could fail with the current Hatari setup.
Roger