TRSDOS/NEWDOS fcntl support on the TRS-80

Post Reply
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

TRSDOS/NEWDOS fcntl support on the TRS-80

Post by stefano »

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.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Is it worthwhile adding support for creating TRSDOS discs? Or is it a "cranky" format like the C128 discs?
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

I don't know, the existing tools are quite handy.
The format shouldn't be too terrible but I'd focus elsewhere.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

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 :)
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

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.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

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).
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

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.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

interesting discovery: the trs80 native MioSys C was already able to support redirection :
https://ia801709.us.archive.org/BookRea ... 7&rotate=0
Post Reply