Page 1 of 1

MSX-DOS2 working?

Posted: Mon Feb 25, 2019 2:57 pm
by DarkSchneider
Hi, I'd like to ask for 2 features:

- Sub-dir access: if fopen i.e. "dir/file.ext" will work?

- Set program start address: instead always at $100, be able to do the same than with LINK-80 linker:
/P and /D allow the origin(s) to be set for the next
program loaded. /P and /D take effect when seen (not
deferred), and they have no effect on programs already
loaded. The form is /P:<address> or /D:<address>, where
<address> is the desired origin in the current typeout
radix. (Default radix is hex. /O sets radix to octal; /H
to hex.) LINK-80 dos a default /P:<link origin>+3 (i.e.,
103H for CP/M and 4003H for ISIS) to leave room for the
jump to the start address. NOTE: Do not use /P or /D to
load programs or data into the locations of the loader's
jump to the start address (100H to 102H for CP/M) unless
it is to load the start of the program there. If
programs or data are loaded into these locations, the
jump will not be generated.

If no /D is given, data areas are loaded before program
areas for each module. If a /D is given, all Data and
Common areas are loaded starting at the data origin and
the program area at the program origin. Example:

*/P:200,FOO
Data 200 300
*/R
*/P:200 /D:400,FOO
Data 400 480
Program 200 280
As summary, if we use /P:4000 the program is loaded at $4000 instead $100.

Posted: Mon Feb 25, 2019 3:13 pm
by dom
The second request should already be possible with -pragma-define:CRT_ORG_CODE=0x4000

Opening files in directories will require work - we use the CP|/M BDOS interface for file handling and the filename is copied into an FCB so with a path the filename would overflow. Have you got a pointer to the MSXDOS2 documentation?

Posted: Tue Feb 26, 2019 9:10 am
by DarkSchneider
dom wrote:The second request should already be possible with -pragma-define:CRT_ORG_CODE=0x4000
Nice!, thanks.

About the MSXDOS2, maybe this could help:
http://map.grauw.nl/resources/
At "DOS2 documentation". Not sure if includes the required stuff.

Posted: Tue Feb 26, 2019 12:02 pm
by dom
That's a perfect link and a nice API to work with as well.

I'll find some ROMs and add some support when I get a chance - it shouldn't take too long to add.

Posted: Tue Feb 26, 2019 2:01 pm
by DarkSchneider
Thank you very much for the support.

Posted: Thu Feb 28, 2019 8:26 pm
by dom
I've added -subtype=msxdos2 to the +msx target. This will use the MSXDOS2 api to open/write etc files. The library should be available in the 20190301 nightly build.

I've made some basic tests and open/read/write look like things are working correctly - if you have any problems let me know and I'll fix them!

Posted: Fri Mar 01, 2019 8:06 am
by DarkSchneider
Nice, thanks.

Posted: Sat Mar 02, 2019 8:59 pm
by stefano
brilliant, thank you!

Posted: Sun Mar 03, 2019 9:59 am
by Timmy
So what does it do? What is special about this than just for MSX1 or ROMs?

Posted: Sun Mar 03, 2019 2:32 pm
by dom
MSXDOS2 added support for sub-directories, so this work was just adding a library that used the API calls rather than the regular FCB entry points that work for CP/M and MSXDOS1.

There's no further extra support for the MSX2 at this point in time, I've not got enough machine knowledge to add appropriate, usable APIs so I'd prefer to incorporate a proven 3rd party library.

Posted: Sun Mar 03, 2019 10:22 pm
by Timmy
Ok, thanks.