•  Back 
  •  The device driver (MX_DEV) 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File11.5.16.39.12  Kernel functions for an XFS                         TOS

MagiC makes available to the installed XFSs, DFSs or device drivers 
some kernel information as well as kernel functions. The same register 
conventions apply for the kernel functions as for the XFS functions, 
i.e. d0-d2 and a0-a2 may be destroyed. One can obtain a pointer to the 
structure that contains the kernel functions with:

     kernel = Dcntl (KER_INSTXFS, NULL, &myxfs);   or
     kernel = Dcntl (KER_GETINFO, NULL, NULL);

In the first case an XFS is installed, in the second case one only 
gets the kernel structure (perhaps for a DFS or a device driver). The 
build-up of the kernel structure in detail:

typedef struct
{
  WORD mxk_version;
  VOID (*mxk_fast_clrmem)      ( void *von, void *bis );
  BYTE (*mxk_toupper)          ( char c );
  VOID (*mxk__sprintf)         ( char *dest, char *source, LONG *p );
  VOID *mxk_act_pd;
  APPL *mxk_act_appl;
  APPL *mxk_keyb_app;
  WORD *mxk_pe_slice;
  WORD *mxk_pe_timer;
  VOID (*mxk_appl_yield)       ( void );
  VOID (*mxk_appl_suspend)     ( void );
  VOID (*mxk_appl_begcritic)   ( void );
  VOID (*mxk_appl_endcritic)   ( void );
  LONG (*mxk_evnt_IO)          ( LONG ticks_50hz, void *unsel );
  VOID (*mxk_evnt_mIO)         ( LONG ticks_50hz, void *unsel, WORD cnt );
  VOID (*mxk_evnt_emIO)        ( APPL *ap );
  VOID (*mxk_appl_IOcomplete)  ( APPL *ap );
  LONG (*mxk_evnt_sem)         ( WORD mode, void *sem, LONG timeout );
  VOID (*mxk_Pfree)            ( void *pd );
  WORD mxk_int_msize;
  VOID *mxk_int_malloc         ( void );
  VOID mxk_int_mfree           ( void *memblk );
  VOID mxk_resv_intmem         ( void *mem, LONG bytes );
  LONG mxk_diskchange          ( WORD drv );
  LONG mxk_DMD_rdevinit        ( DMD *dmd );
  LONG mxk_proc_info           ( WORD code, PD *pd );
  LONG mxk_mxalloc             ( d0 = LONG amount, d1 = WORD mode, a0 = PD *pd );
  LONG mxk_mfree               ( a0 = void *block );
  LONG mxk_mshrink             ( d0 = LONG newlen, a0 = void *block );
} MX_KERNEL;

See also: MagiC's XFS-concept