keyboard or file emulation problem ?

A forum about the Hatari ST/STE emulator - the current version is v2.0.0

Moderators: simonsunnyboy, thothy, Moderator Team

User avatar
ljbk
Atari Super Hero
Atari Super Hero
Posts: 513
Joined: Thu Feb 19, 2004 4:37 pm
Location: Estoril, Portugal

keyboard or file emulation problem ?

Postby ljbk » Tue Mar 26, 2013 2:12 pm

Hi !

While trying to use Hatari to debug Hextracker, i found out that i can not use MONST from Devpac 1.24.
Here is what i do:
- I launch MONST.PRG;
- The program waits for a filename as input;
- The program tries to load the code file and fails despite the file exists;

I tried with several file names, upper and lower cases to check for a case sensitive error, but it does not work.
I get TOS ERROR 1 like if the file does not exist.

I tried using Hatari because the two mouse modes are more flexible when using a remote session via VNC. But as it does not work i have to go the machine itself and use STeem.

Bye,
Paulo.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1558
Joined: Sun Jul 31, 2011 1:11 pm

Re: keyboard or file emulation problem ?

Postby Eero Tamminen » Tue Mar 26, 2013 4:31 pm

While trying to use Hatari to debug Hextracker, i found out that i can not use MONST from Devpac 1.24.
Here is what i do:
- I launch MONST.PRG;
- The program waits for a filename as input;
- The program tries to load the code file and fails despite the file exists;

I tried with several file names, upper and lower cases to check for a case sensitive error, but it does not work.
I get TOS ERROR 1 like if the file does not exist.


Thanks for reporting the issue.

Which Hatari version you're using, and is it on Linux/OSX/Windows?

Does it work if that file is located on (floppy) disk image?

Could you provide GEMDOS trace of what happens ("--trace gemdos" command line option, "trace gemdos" command in debugger, or just tick "gemdos" in Python UI tracing dialog before starting the program)?

User avatar
ljbk
Atari Super Hero
Atari Super Hero
Posts: 513
Joined: Thu Feb 19, 2004 4:37 pm
Location: Estoril, Portugal

Re: keyboard or file emulation problem ?

Postby ljbk » Tue Mar 26, 2013 5:14 pm

Hi !

I was using Hatari 1.62 with Windows Vista 64 bit, TOS 2.06 and 14MB STE.
The best is to provide you with the files:
- MONST.PRG the debugger;
- 5060HZ.PRG a small program that should be loaded and that is not;

Nice Easter,
Paulo.
You do not have the required permissions to view the files attached to this post.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1558
Joined: Sun Jul 31, 2011 1:11 pm

Re: keyboard or file emulation problem ?

Postby Eero Tamminen » Tue Mar 26, 2013 8:19 pm

ljbk wrote:I was using Hatari 1.62 with Windows Vista 64 bit, TOS 2.06 and 14MB STE.
The best is to provide you with the files:
- MONST.PRG the debugger;
- 5060HZ.PRG a small program that should be loaded and that is not;


MONST is buggy, it doesn't remove CR from end of the file name it inputted. I.e. the file extension given for Fopen() is too long and contains character that is illegal for a GEMDOS file name (according to Compedium).

However, all TOS versions, including EmuTOS, seem to handle that fine.

To make Hatari GEMDOS emulation more accurate, I would need to know what TOS does, does it:
- cut the extension to 3 characters
- filter illegal characters from the filename and if yes, does it do that only from the end
?

User avatar
ljbk
Atari Super Hero
Atari Super Hero
Posts: 513
Joined: Thu Feb 19, 2004 4:37 pm
Location: Estoril, Portugal

Re: keyboard or file emulation problem ?

Postby ljbk » Tue Mar 26, 2013 8:40 pm

Eero Tamminen wrote:MONST is buggy, it doesn't remove CR from end of the file name it inputted. I.e. the file extension given for Fopen() is too long and contains character that is illegal for a GEMDOS file name (according to Compedium).

However, all TOS versions, including EmuTOS, seem to handle that fine.

To make Hatari GEMDOS emulation more accurate, I would need to know what TOS does, does it:
- cut the extension to 3 characters
- filter illegal characters from the filename and if yes, does it do that only from the end
?


That MONST for sure is not perfect, especially because it is version 1.2x and not 3.x.
But from the user point of view (emulation point of view), there is a clear behaviour difference between the real machine and Hatari.
I have no idea what TOS does to unexpected lengths, characters, extensions lengths or strings in general it will use for fopen or for any other file function. I would have to look inside TOS as anyone can. You can go to address 0x00000084 where you can find the trap #1 vector. GEMDOS fopen receives as parameters in the stack 0x003D (function number), the classic pointer_to_file_name (.l) and an attribute (read, append, write, ...) (.w). With this, you can dissassemble a small part of the TOS and check it.
It is possible that the BIOS (trap #13) and/or the XBIOS (trap #14) will be called for real FDC or HDC operations but i assume that before that the filename string will be validated/corrected in some way.

Paulo.

PS:
I can tell you a few things:
- prefixes CON:,AUX:,PRN:,con:,aux: and prn: are checked against the start of the string;
- routine handling the func 0x3D (open) starts at 0x00FC7606 and a table for every GEMDOS code is at 0x00FD0307A for TOS 1.02UK;
- the first thing done is a Get BPB (Bios (trap #13) func 7);

I am sure that with a emulator you can do a dump trace of the executed code with automatic disassembly or something like that. It is for sure better than doing it by hand with the debugger trace function and no breakpoints (ROM) ... :(
Last edited by ljbk on Tue Mar 26, 2013 10:24 pm, edited 1 time in total.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1558
Joined: Sun Jul 31, 2011 1:11 pm

Re: keyboard or file emulation problem ?

Postby Eero Tamminen » Tue Mar 26, 2013 10:19 pm

ljbk wrote:That MONST for sure is not perfect, especially because it is version 1.2x and not 3.x.
But from the user point of view (emulation point of view), there is a clear behaviour difference between the real machine and Hatari.


Yes, the problem is that normally TOS does NOT accept too long file names, so I need to know exactly when it does.

Hatari emulation needs to be accurate, if it would accept all kinds of crap, one couldn't use it to debug issues that will fail on real TOS. :)

ljbk wrote:I have no idea what TOS does to unexpected lengths, characters, extensions lengths or strings in general it will use for fopen or for any other file function. I would have to look inside TOS as anyone can. You can go to address 0x00000084 where you can find the trap #1 vector. GEMDOS fopen receives as parameters in the stack 0x003D (function number), the classic pointer_to_file_name (.l) and an attribute (read, append, write, ...) (.w). With this, you can dissassemble a small part of the TOS and check it.


What TOS does on Fopen() for filenames unfortunately is not small. It goes back and forth the directory contents resolving first the path and reading the disk contents when trying to find match.

I've been reading EmuTOS code that that would seem to be converting names into "directory format", which involves ignoring part of extension that is longer than 3 characters.

(On host filenames Hatari of course needs to accept longer ones, otherwise user wouldn't be able to select all host files.)

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1558
Joined: Sun Jul 31, 2011 1:11 pm

Re: keyboard or file emulation problem ? (FIXED)

Postby Eero Tamminen » Wed Mar 27, 2013 6:34 pm

Wrote a test program. All TOS versions clip both base and extension part of directory and file names. Hatari does now same:
http://hg.tuxfamily.org/mercurialroot/h ... a6d6c99cb4

User avatar
ljbk
Atari Super Hero
Atari Super Hero
Posts: 513
Joined: Thu Feb 19, 2004 4:37 pm
Location: Estoril, Portugal

Re: keyboard or file emulation problem ?

Postby ljbk » Thu Mar 28, 2013 12:27 pm

Nice to have contributed to a better Hatari !

Thanks for the update. :)

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1558
Joined: Sun Jul 31, 2011 1:11 pm

Re: keyboard or file emulation problem ?

Postby Eero Tamminen » Thu Mar 28, 2013 6:09 pm

ljbk wrote:Nice to have contributed to a better Hatari !

Thanks for the update. :)


Thanks to you! Finding (details on) problems can often be more work than fixing them.

It's a bit surprising to find out that there are still issues in the GEMDOS HD emulation compatibility though. Since v1.6.2 there have been several issues that have come up and which I've fixed:
http://hg.tuxfamily.org/mercurialroot/h ... -notes.txt


Social Media

     

Return to “Hatari”

Who is online

Users browsing this forum: No registered users and 1 guest