Skip to content

Commit

Permalink
Re-fix VDI under FreeMiNT with memory protect
Browse files Browse the repository at this point in the history
Commit f9f751d allocated the memory with an incorrect protect mode.
It should be allocated in supervisor-accessible memory, like the
existing kludge in FreeMiNT does when using the ROM-based TOS VDI.
Thanks to Thorsten Otto for pointing out the error.
  • Loading branch information
anodynesoftware committed Apr 13, 2022
1 parent 7bbba93 commit b245f3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vdi/vdi_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* is only significant when running under FreeMiNT, since EmuTOS ignores
* these bits of the mode field.
*/
#define MX_PRIVREAD (4<<4)
#define MX_SUPER (3<<4)


/*
Expand Down Expand Up @@ -417,9 +417,9 @@ void vdi_v_opnvwk(Vwk * vwk)
* The virtual workstations for all programs are chained together by
* build_vwk_chain(), because some programs (notably Warp9) expect this.
* To avoid problems when running FreeMiNT with memory protection, we
* must allocate the virtual workstations in private/readable memory.
* must allocate the virtual workstations in supervisor-accessible memory.
*/
vwk = (Vwk *)Mxalloc(sizeof(Vwk), MX_PRIVREAD);
vwk = (Vwk *)Mxalloc(sizeof(Vwk), MX_SUPER);
if (vwk == NULL) {
CONTRL[6] = 0; /* No memory available, exit */
return;
Expand Down

0 comments on commit b245f3c

Please sign in to comment.