z88dk forums

z80 Development Kit

You are not logged in.

#1 2019-06-13 20:59:01

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

TRSDOS/NEWDOS fcntl support on the TRS-80

New driver available now!
The file support includes the redirection capabilities in the command line (>, >>, <), multiple files and dynamic buffer allocation.
malloc() is required,  -DAMALLOC is supported but it relies on the system variables and hasn't been tested outsude the TRSDOS/NEWDOS environments.
The driver is kept as small and simple as possible, which probably reduces the performances but in case of simple sequential transfers.
The filespec syntax is the original TRSDOS one: FILENAME/EXT.PASSWORD:n ... where n=drive number.  Everything is optional but the filename.  In many cases the programs will run without changes, e.g. ADVA.SAV is accepted, and will create a file named ADVA, protected with 'SAV' as password.

LDOS and directory browsing function are not supportec but could be added in the future.

Offline

 

#2 2019-06-14 00:01:17

dom
Administrator
Registered: 2007-07-15
Posts: 1446
Website

Re: TRSDOS/NEWDOS fcntl support on the TRS-80

Is it worthwhile adding support for creating TRSDOS discs? Or is it a "cranky" format like the C128 discs?

Offline

 

#3 2019-06-14 07:00:26

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

Re: TRSDOS/NEWDOS fcntl support on the TRS-80

I don't know,  the existing tools are quite handy.
The format shouldn't be too terrible but I'd focus elsewhere.

Offline

 

#4 2019-06-14 10:11:52

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

Re: TRSDOS/NEWDOS fcntl support on the TRS-80

Checking different OS versions, I found it working correctly on most of the existing OS versions, including LDOS DOSPLUS, .
The only problems I've seen so far are with TRSDOS 1.3, which seems to be unstable also with pure console applications without disk libraries linked in.

This means that the LDOS specific funtions described in the docs do not exclude the traditional ones, which is good news  smile

Offline

 

#5 2019-06-15 13:17:32

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

Re: TRSDOS/NEWDOS fcntl support on the TRS-80

I'm looking at the ldos/miosys c resource pages:
http://www.tim-mann.org/misosys.html
I'm thinking to extract the fputc implementation and have a console control code coherent with the dos environment.
I was also able to build the C example "dct.ccc", it works only on ldos but it is a good example on how to port from miosys c and to compare the resulting binaries.

Offline

 

#6 2019-06-18 10:40:16

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

Re: TRSDOS/NEWDOS fcntl support on the TRS-80

2 new fake filenames available: *DO (console output) *PR (printer output).

Programmers can remap stdout with freopen(), e.g. when creating a TRSDOS command to put the console output at the current TRSDOS cursor position.
Otherwise, at runtime, users can redirect output (>*DO or *>PR).

Offline

 

#7 2019-06-19 15:48:31

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

Re: TRSDOS/NEWDOS fcntl support on the TRS-80

Console is now well integrated.   Using the new option "-subtype=cmd" will automatically insert all the needed elements (malloc,  stdout redirection,  etc..) to create a valid DOS command.
"subtype =disk" now creates a barebones cmd.

Offline

 

#8 2019-06-21 23:08:19

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

Re: TRSDOS/NEWDOS fcntl support on the TRS-80

Offline

 

#9 2019-06-23 21:16:41

stefano
Administrator
Registered: 2007-07-16
Posts: 1580

Re: TRSDOS/NEWDOS fcntl support on the TRS-80

interesting discovery:  the trs80 native MioSys C was already able to support redirection :
https://ia801709.us.archive.org/BookRea … p;rotate=0

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson