As of MagiC 3, the whole of the DOS, inclusive of access to DOS file systems, is reentrant and runs in the background. Thus it is possible to edit files on Drive A: without perceptibly slowing down the computer at floppy disk accesses. A prerequisite for this, however, are floppy and hard drive routines that work in the background.
So that the hard disk driver does not need to make these functions available, the BIOS of MagiC contains all the required functions. Via the MagX cookie (component hddrv_functions) one obtains access to the following structure, which contains pointers to the important routines of the background-DMA:
typedef struct { LONG dma_begin ( VOID); LONG dma_end ( VOID ); LONG dma_wait ( d0 = LONG ticks_200hz ); LONG ncr_begin ( VOID ); LONG ncr_end ( VOID ); LONG ncr_wait ( d0 = LONG ticks_200hz ); } HDFUNCS;
Note: Directly before the structure (2 bytes before) lies a WORD that gives the length of the table in LONGs (in this case 6). All of the 6 pointers lie in the system variables region and may be changed in case of need. The internal functions for the floppy drive also jump via the 6 pointers. Important: The hddrv_functions pointer in MagX cookie may not be altered!
At boot-time the preemptive multitasking is switched off (actually the multitasking itself is switched off) but the routines also work before installation of the AES, whereby the wait routines then do a 'busy waiting' (as they do when switching off the preemptive multitasking), and the semaphore routines simply do nothing (apart from setting and clearing flock).
This hypertext contains extracts from MagiC's BIOS that should demonstrate how the whole thing works. A few words about this:
The routines acsi_xxx are both for ACSI and FDC, i.e. dma_begin
sets flock, dma_end clears it again
The routines ncr_xxx are for TT-SCSI
The functions xxx_begin reserve the relevant semaphores. The
following applies for the return values:
Value | Meaning |
-1 | Semaphore is already in possession |
0 | Ok |
The functions xxx_end release the semaphores again; here too no
registers are altered
dma_wait waits for an interrupt of the ACSI-DMA (or FDC)
controller; ncr_wait is for the SCSI bus of the Atari-TT. The
following applies for the return values:
Value | Meaning |
-2 | Bus error (interrupt of TT-SCSI) |
-1 | Timeout |
0 | Ok |
See also: About the BIOS About the GEMDOS MagiC's XFS-concept