Re: [hatari-devel] Fforce() fails with GEMDOS drive emulation |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
On torstai 14 maaliskuu 2013, Thomas Huth wrote:
> schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
> > I was thinking that I could track program startup and termination,
> > keep counter for current program [1] and use that to identify which
> > file handles belong to which program & are valid for it.
> >
> > However, reliably detecting progam startup and termination so
> > that they don't get out of sync, is quite tricky, so I need some
> > advice.
>
> IIRC there is an official method for determine the current running
> GEMDOS process - the "p_run" system variable. Hatari already keeps a
> pointer to its location in the "act_pd" variable. So you could try to
> find out the corresponding process via that variable?
Do you have some idea how reliable using its *address changes*
would be for detecting when program changes:
1. When program is started from TOS (desktop)
2. When program is started by another program
3. When program started in 1) or 2) terminates
?
For this purpose the detection would need to be foolproof with all
TOS versions.
I assume that just using Pexec to create basepage doesn't yet
switch to it, only calling the Pexec with GO mode will...
- Eero
PS. The GEMDOS emulation basepage finding logic doesn't work with
MiNT, but the logic used by debugger's "info basepage" command does
work also under MiNT (rombase and sysbase addresses differ under
MiNT). GEMDOS emulation doesn't work with MiNT, so it's not
a problem, I just thought to mention it. :-)