TOS 4.04 internal debugger calls [was: Re: [hatari-devel] Xbios interception?]

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


On 8 Sep 2016 at 21:58, Eero Tamminen wrote:

> Hi,
> 
> On 08/13/2016 11:35 PM, Roger Burrows wrote:
> > On 13 Aug 2016 at 22:26, Eero Tamminen wrote:
> >> On 04/23/2016 09:28 PM, Roger Burrows wrote:
> >>> On 23 Apr 2016 at 14:44, Eero Tamminen wrote:
> >>>> On 04/21/2016 02:05 AM, Roger Burrows wrote:
> >>>>> The Atari debugger (distributed to developers) uses it.  See:
> >>>>>    http://dev-docs.atariforge.org/files/Atari_Debugger_1-24-1990.pdf
> >>>>> for documentation.
> >>>>
> >>>> That implements (provides) the API, I was more interested about
> >>>> whether there's anything that actually uses it, so that I could
> >>>> test that Hatari's implementation works OK.
> >>>>
> >>>> Is there any program that has left these calls into the production
> >>>> version version of its binary that's still available?  Preferably
> >>>> something where one can actually trigger calls to this API. :-)
> >>>>
> >>> TOS4 (for sure) and TOS3 I believe.
> >>
> >> While those implement the API, I was actually interested about
> >> something that *uses* them.  I.e. test-cases. :)
> >>
> > I'm pretty sure that if you set some magic value somewhere in TOS RAM
> (can't
> > remember where right now), then TOS4 will use the API to output debugging
> > messages.  I can look further if you can't find it.
> 
> Yes please. :-)
> 
The following is for TOS 4.04, base on my own researches.  AFAIK, this hasn't 
been published anywhere else.  There could be errors ;-).

There is one long of debugger flags located at $5692 in RAM, but only the 
low-order byte is used.  If all bits are 0, debugging is off; individual bits 
may be set on to select tracing different types of events.  Bit meanings are as 
follows:
bit 0: trace all GEMDOS calls
bit 1: trace BCB internals
bit 2: trace FAT internals
bit 3: trace internals for file handling (Fopen etc)
bit 4: trace internals for system memory handling (OS pool)
bit 5: trace internals for directory handling
bit 6: trace internals for process handling (Pexec etc)
bit 7: trace internals for user memory processing (Malloc etc)

I haven't actually tested this, so I'd be very interested to hear how/if it 
works in practice.

Roger




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