• Blitmode | Gets or changes blitter configuration. |
• CacheCtrl | CPU cache management. |
• CJar | Creates, interrogates and removes cookies. |
• Dbmsg | Outputs debug message. |
• Janus | Makes the "Janus" emulator available. |
• Puntaes | Switches off AES in ROM. |
• Random | Generates a random number. |
• Ssbrk | Reserves memory (only used internally). |
• Supexec | Starts routine in supervisor-mode. |
• Trapper | Hooks into system functions. |
• WdgCtrl | Sets the hardware watchdog. |
See Also: Interface programming
Name: | »blitter mode« - Blitter-chip configuration
| ||||||||||||||||
Opcode: | 64
| ||||||||||||||||
Syntax: | int16_t Blitmode( int16_t mode );
| ||||||||||||||||
Description: | Blitmode is an XBIOS routine to switch on the blitter or to
verify its existence. If the parameter mode has the value -1
then one obtains the state of the blitter chip. All other values
configure the blitter:
Note: According to Atari the function may be used without checking the TOS version (although it is not present in TOS 1.0, for instance). This is possible due to a side-effect in the dispatcher of the XBIOS. However, it is better not to rely on this, as the corresponding trap may be diverted by other programs, so that the correct value may not be returned. | ||||||||||||||||
Return value: | The function returns the properties of the blitter chip by the
set bits:
All further bits are reserved. | ||||||||||||||||
Availability: | Officially this function is present only as of TOS Version
1.02.
| ||||||||||||||||
Group: | Special commands
| ||||||||||||||||
See Also: | Binding
|
C: | #include <tos.h>
int16_t Blitmode( int16_t mode ); |
Assembler: |
move.w mode,-(sp) ; Offset 2 move.w #64,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #4,sp ; Correct stack |
Name: | »CacheCtrl« - CPU cache management
| ||||||||||||||||||||||||||||||
Opcode: | 160
| ||||||||||||||||||||||||||||||
Syntax: | int32_t CacheCtrl( int16_t OpCode, int16_t Param );
| ||||||||||||||||||||||||||||||
Description: | The XBIOS routine CacheCtrl serves for the management of the
CPU cache.
Note: Under the CT60 XBIOS, OpCode 5/7 has the same effect : Param: 0 = disable all caches. 1 = enable all caches. All caches are: Data cache, store buffer, branch cache, instruction cache. | ||||||||||||||||||||||||||||||
Return value: | If successful the function returns the value 0, or EBADRQ when
a value larger than seven is passed for OpCode.
As an alternative the driver "CPU Cache Control Driver v1.10" by Robert Federle and Thomas Tempelmann is available for other computers. | ||||||||||||||||||||||||||||||
Availability: | The function ist available on the Milan from TOS 4.06, in
CT60 XBIOS as of Version v0.98a.
| ||||||||||||||||||||||||||||||
Group: | Special commands
| ||||||||||||||||||||||||||||||
See Also: | Binding
|
C: | int32_t CacheCtrl( int16_t OpCode, int16_t Param );
|
Assembler: |
move.w Param,-(sp) ; Offset 4 move.w OpCode,-(sp) ; Offset 2 move.w #160,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #6,sp ; Correct stack |
Name: | »CJar« - Creation, interrogation and removal of cookies
| ||||||||||
Opcode: | 17226 (0x434A)
| ||||||||||
Syntax: | int32_t CJar( int16_t mode, int32_t cookie, int32_t *value );
| ||||||||||
Description: | The XBIOS routine CJar offers a simple way of creating,
interrogating and removing cookies.
| ||||||||||
Return value: | If successful the function returns the value CJar_OK (0x6172).
| ||||||||||
Availability: | The function is available when the cookie 'CJar' ($434A6172) is
present. This is created by JARxxx (Cookie Jar Manager) or by Liberty.
| ||||||||||
Group: | Special commands
| ||||||||||
See Also: | Binding Cookie function
|
C: | int32_t CJar( int16_t mode, int32_t cookie, int32_t *value );
|
Assembler: |
pea value ; Offset 8 move.l cookie,-(sp) ; Offset 4 move.w mode,-(sp) ; Offset 2 move.w #17226,-(sp) ; Offset 0 trap #14 ; Call XBIOS lea 12(sp),sp ; Correct stack |
Name: | »Dbmsg« - Output debug message
|
Opcode: | 11
|
Syntax: | void Dbmsg( int16_t rsrvd, int16_t msg_num, int32_t msg_arg )
|
Description: | Dbmsg allows special debugging messages to be sent to a
resident debugger application.
srsrvd is currently reserved and should always be 5. msg_num is the message number which you want to send to the debugging host. Values of 0x0000 to 0xEFFF are reserved for applications to define. Values of 0xF000 to 0xFFFF are reserved for special debugging messages. If msg_num is in the application defined range, it and the int32_t contained in msg_arg will be displayed by the debugger and the application will be halted. If msg_num is between 0xF001 and 0xF0FF inclusive then msg_arg is interpreted as a character pointer pointing to a string to be output by the debugger and debugging to halt. The string length is determined by the low byte of msg_num. If msg_num is DB_NULLSTRING (0xF000), the string will be output until a NULL is reached. If msg_num is DB_COMMAND (0xF100), msg_arg is interpreted as a character pointer to a string containing a debugger command. The command format is specific to the debugger which you are running. A useful example of this format when running under the Atari debugger allows a string to be output to the debugger without terminating debugging as shown in the following example: Dbmsg( 5, DB_COMMAND, "echo 'Debugging Message';g" ); The Atari Debugger only understands the value DB_COMMAND (0xF100) for msg_num as of version 3. Though it is normally harmless to run an application with embedded debugging messages when no debugger is present in the system, distribution versions of applications should have these instructions removed. |
Return value: |
|
Availability: | Only if a resident debugger was loaded, which supports this
call. The only debugger that currently supports this call is the Atari
debugger.
|
Group: | Special commands
|
See Also: | Binding
|
C: | #include <tos.h>
void Dbmsg( int16_t rsrvd, int16_t msg_num, int32_t msg_arg ) |
Assembler: |
move.l msg_arg,-(sp) ; Offset 6 move.w msg_num,-(sp) ; Offset 4 move.w srsrvd,-(sp) ; Offset 2 move.w #11,-(sp) ; Offset 0 trap #14 ; Call XBIOS lea 10(sp),sp ; Correct stack |
Name: | »Janus« - Make the "Janus" emulator available.
| ||||||||||
Opcode: | 43
| ||||||||||
Syntax: | void Janus( int16_t mode )
| ||||||||||
Description: | This function makes the hardware emulator "Janus"
available. According to an article in ST-Computer 1996-04 p.
44, the following may be achieved with this:
Note: All statements without any guarantees, as the article is not very detailed. | ||||||||||
Return value: | Unknown, or see above.
| ||||||||||
Availability: | Only with hardware emulator Janus.
| ||||||||||
Group: | Special commands
| ||||||||||
See Also: | Binding
|
C: | #include <tos.h>
void Janus( int16_t mode ) |
Assembler: |
move.w mode,-(sp) ; Offset 2 move.w #43,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #4,sp ; Correct stack |
Name: | »punt AES« - Switch off AES in ROM
|
Opcode: | 39
|
Syntax: | void Puntaes( void );
|
Description: | The XBIOS function Puntaes switches off the AES part of the
operating system. The AES will start only if the "os_magic"
in OSHEADER has the magic number 0x87654321. Puntaes sets the flag
back (if possible) and reboots the system. Note that the call is only
valid with disk-loaded AES's.
Hint: Ab MagiC 4.00 wurde diese Funktion verändert und besitzt verschiedene Unterfunktionen. Zum Aufruf muss zusätzlich der Wert 'AnKr' übergeben werden. Bei einer falschen Funktionsnummer wird EINVFN zurückgeliefert. int32_t Puntaes ( 'AnKr', subfn, ... )
|
Return value: | Die Funktion liefert kein Ergebnis.
|
Availability: | All TOS versions.
|
Group: | Special commands
|
See Also: | Binding Cookie function
|
C: | #include <tos.h>
void Puntaes( void ); |
Assembler: |
move.w #39,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #2,sp ; Correct stack |
Name: | »random generator« - Random number generator
|
Opcode: | 17
|
Syntax: | int32_t Random( void );
|
Description: | The XBIOS routine Random returns a 24-bit random number (based
on a clock in the computer).
Note: With this function we are not dealing with a hardware random number generator, but with a software version, which uses the following algorithm: X = (X * 3.1415926...) + 1 The return value is X shifted by 8 bits to the right, i.e. using the lower three bytes of the returned int32_t. Incidentally, the behaviour for the complete number is pretty good, the inquiry of individual bits in the sense of reduced randomness is however not advisable. |
Return value: | The function returns a 24-bit random number.
|
Availability: | All TOS versions.
|
Group: | Special commands
|
See Also: | Binding
|
C: | #include <tos.h>
int32_t Random( void ); |
Assembler: |
move.w #17,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #2,sp ; Correct stack |
Name: | »set memory break point« - Reserve memory
|
Opcode: | 1
|
Syntax: | void *Ssbrk( int16_t count );
|
Description: | The XBIOS routine Ssbrk reserves memory at the top of RAM. The
number of bytes must be passed in count. This function must be
called prior to the initialization of GEMDOS, and should therefore
not be used by application programs. In all the Atari ROM
versions this function is implemented only as a dummy routine.
|
Return value: | The function returns the start address of the allocated memory
segment.
|
Availability: | All TOS versions.
|
Group: | Special commands
|
See Also: | Binding
|
C: | #include <tos.h>
void *Ssbrk( int16_t count ); |
Assembler: |
move.w count,-(sp) ; Offset 2 move.w #1,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #4,sp ; Correct stack |
Name: | »supervisor execute« - Start routine in supervisor-mode.
|
Opcode: | 38
|
Syntax: | int32_t Supexec( int32_t (*func)( ) );
|
Description: | The XBIOS routine Supexec executes a user-defined routine in
supervisor-mode. func is the address of the function to be
called in supervisor-mode.
|
Return value: | The function returns the int32_t value returned by the user
function.
|
Availability: | All TOS versions.
|
Group: | Special commands
|
See Also: | Binding Super
|
C: | #include <tos.h>
int32_t Supexec( int32_t (*func)( ) ); |
Assembler: |
pea func ; Offset 2 move.w #38,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #6,sp ; Correct stack |
Name: | »Trapper« - Hook into system functions.
|
Opcode: | 555
|
Syntax: | int32_t xbios( 555, int16_t layer, int16_t install, int16_t
opcode, void *function );
|
Description: | With the aid of Trapper, other programs can hook themselves
simply and effectively before and after system calls - even completely
replace them - or add new system calls to the system.
With Trapper we are dealing with an external program! More information in the instructions to be found there. |
Return value: |
|
Availability: | The function is only present on computers on which the program
Trapper has been installed.
|
Group: | Special commands
|
See Also: | Binding
|
C: | #include <tos.h>
int32_t xbios( 555, int16_t layer, int16_t install, int16_t opcode, void *function ); |
Assembler: |
pea (a2) ; TOS does not save A2 in traps move.l function,-(sp) ; Offset 8 move.w opcode,-(sp) ; Offset 6 move.w install,-(sp) ; Offset 4 move.w layer,-(sp) ; Offset 2 move.w #555,-(sp) ; Offset 0 trap #14 ; Call XBIOS lea 12(sp),sp ; Correct stack move.l (sp)+,a2 ; restore A2 |
Name: | »WdgCtrl« - Set the hardware watchdog.
| ||||||||||||
Opcode: | 161
| ||||||||||||
Syntax: | int32_t WdgCtrl ( int16_t OpCode );
| ||||||||||||
Description: | This function disables or activates the hardware watchdog.
Note: The function is only meant for the hardware of the Milan 2.1. The version however exists only as a special version and is not freely available. | ||||||||||||
Return value: |
| ||||||||||||
Availability: | The function is present from MilanTOS with the date 2002-06-09
onwards.
| ||||||||||||
Group: | Special commands
| ||||||||||||
See Also: | Binding
|
C: |
int32_t WdgCtrl ( int16_t OpCode ); |
Assembler: |
pea (a2) ; TOS does not save A2 in traps move.w OpCode,-(sp) ; Offset 2 move.w #161,-(sp) ; Offset 0 trap #14 ; Call XBIOS lea 4(sp),sp ; Correct stack move.l (sp)+,a2 ; restore A2 |