Re: [hatari-devel] GEMDOS HD emulation, Hatari cartridge program load code and TT-RAM

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On sunnuntai 12 huhtikuu 2015, Thomas Huth wrote:
> schrieb Eero Tamminen <oak@xxxxxxxxxxxxxx>:
> > On keskiviikko 08 huhtikuu 2015, Eero Tamminen wrote:
> > > On keskiviikko 08 huhtikuu 2015, Eero Tamminen wrote:
> > > > Ps. I hadn't yet time to check whether things work better
> > > > from disk image (no Hatari cartridge code involved, program
> > > > is loaded completely by TOS).
> > > 
> > > When using IDE disk image with Falcon emulation, program
> > > is executed from TT-RAM.  I.e. problem is Hatari cartridge
> > > code used for loading program for GEMDOS HD emulation.
> > 
> > I looked what the cartridge code does, and it just asks TOS
> > to allocate/return pointer to new basepage + rest of memory
> > with Pexec(PE_BASEPAGE, ...) call.
> > 
> > I assume that it should be changed to check program header for
> > PRGFLAGS (long @ offset 0x16) bits and depending on those:

http://toshyp.atari.org/en/005005.html

> > * If PF_TTRAMLOAD bit (1) is set, and there's "enough" TT-RAM:
> >   - shrink the memory returned by Pexec() call to basepage size
> >   - try Mxalloc(MX_PREFTTRAM) memory for program TEXT/BSS/DATA
> 
> The memory is allocated with Pexec5 ... so for supporting TT-RAM, I
> think that should be Pexec7 instead.

Although TosHyp mentions Pexec7, Compedium doesn't:
	http://toshyp.atari.org/en/00500b.html#Pexec

According to TosHyp, Pexec7 is supported from GEMDOS v0.19 onwards
which is TOS v2.  EmuTOS sources don't seem to support it either [1].
I.e. Cart code needs also GEMDOS version check for Pexec7.

[1] I'll mail emutos-devel.  With PE_LOAD*, EmuTOS already checks
    the header flags for the program it loads and allocates it from
    TT-RAM when requested, so mode 7 should be easy to add.


> Hmm, looking at the cart_asm.s code, this is slowly getting very ugly,
> I guess the assembly logic has to be changed quite a bit for this (the
> flags then have to be read-in before the pexec call, so you also need
> a temporary buffer for this etc.).

Good thing finding Pexec7, that simplifies things a bit.

Program header flags are all in a single long, so one long is
enough of buffer.  It should be ignored if GEMDOS version is <0.19
as TOSes with older GEMDOS versions don't support TT-RAM.


> At least I currently don't have time
> to do this ... so could you maybe add this item to the doc/todo.txt
> list so that we don't forget about this?

Done.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/