fVDI documentation states:
If you have NVDI too, you can make NVDI use fVDI for the actual screen output by making sure that NVDI runs last. This will be slower, but you'll be able to use NVDI's outline fonts and printer drivers (if you don't need the outline fonts, NVDI can run before fVDI and then there will be no speed penalty for screen output).
Then there is nvdifix
in fvdi.sys
which somehow tries to move NVDI in the trap chain so it's not first:
Modify a loaded NVDI so that it will never try to move itself forward in the Trap 2 chain.
but its description is not very encouraging:
With this uncommented fVDI can use NVDI as a background VDI (for dealing with non-screen devices). Some strange problems still remain, though.
FreeMiNT's INSTALL
file says:
NVDI must always be started before MiNT.
So this would imply that the best supported combination of those three is:
- FVDI.PRG (with
booted
set and nvdifix
not set)
- NVDI.PRG (with screen drivers disabled)
- MINT.PRG
However this means that both NVDI and FVDI are outside of FreeMiNT's control. If I understand it correctly, they even use TOS supervisor stack (right?) and are not listed as separate processes. This seems to create a strange issue.
Repro steps:
- take the latest bootable snapshot
- create a separate drive image for C:
- copy all files from hostfs's C: to image's C:
- install NVDI (5.03 in my case) to image's C:
- disable / delete all NVDIDRV?.SYS files
- make sure that the programs in AUTO are in order as described above
Now start QED (/opt/GEM/qed/qed.app). Depending on the actual setup, sometimes it runs at the first time. Quit it. Run again. It wont run again. Sometimes it wouldn't run even on the first try, sometimes TosWin2 wouldn't run.
If started from TosWin2, one can see a simple "Bus error" message. When mint.prg compiled with debug infos, one can see in Aranym's console:
pid 8 (qed): [1][ PROCESS "qed" KILLED: | MEMORY VIOLATION. (PID 008) | Type: free PC: 01008F52 | Addr: 01397FF0 BP: 01318000 |
pid 8 (qed): signal #10 raised [syscall_pc 0x1008F52, exception_pc 0x1008F52]
When looking where exactly it crashes, it goes all the way to gemlib's v_opnvwk
. It wouldn't return from the trap. FreeMiNT's trap 2 handler is not even called in this case (i.e. it's not a bug related to freemint), fVDI's
|
void CDECL v_opnvwk(Virtual *vwk, VDIpars *pars) |
seems to successfully enter and exit so it must be crashing somewhere in NVDI's trap handler. It seems to depend also on the resolution, if I set fvdi.sys
with 640x480x8, it doesn't crash, if 640x480x16, it does.
It's very hard to debug as I can't find a way to reproduce this with anything else than aranym.sys.
Strangely, when following https://atari-forum.com/viewtopic.php?p=247471#p247471, i.e. all the possible recommendations thrown away:
- NVDI started after MINT.PRG
- FVDI started after NVDI with
nvdifix
enabled
Printing and vector fonts not only work but also the crashing v_opnvwk
is gone.
Could be the issue caused by a stack overflow in NVDI.PRG ? Symptoms seems to be very similar to freemint/freemint#269 however when I started investigating this one, I had the 'wrong' setup (NVDI.PRG after MINT.PRG, FVDI.PRG in mint.cnf
with nvdifix
enabled) so the stack was wrong on a different place. Ironically, after fixing that I tried also the correct setup and everything seemed to work: https://atari-forum.com/viewtopic.php?p=435414#p435414 ... so the problem can be easily hidden as it seems.