• Gettime | Gets the date and time. |
• NVMaccess | Configures the NVM of the real-time clock. |
• Settime | Sets the date and time. |
• Xbtimer | Initializes the system timer. |
Name: | »get time« - Get the time and date.
| ||||||||||||||
Opcode: | 23
| ||||||||||||||
Syntax: | uint32_t Gettime( void );
| ||||||||||||||
Description: | The XBIOS routine Gettime obtains the date and time from the
computer's hardware clock.
| ||||||||||||||
Return value: | The function returns the date and time, which are coded as
follows:
| ||||||||||||||
Availability: | All TOS versions.
| ||||||||||||||
Group: | Date, Time and Timer
| ||||||||||||||
See also: | Binding Settime
|
C: | #include <tos.h>
uint32_t Gettime( void ); |
Assembler: |
move.w #23,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #2,sp ; Correct stack |
Name: | »NVMacess« - Configure the "Non-Volatile
Memory" of the real-time clock.
| ||||||||||||||||||
Opcode: | 46
| ||||||||||||||||||
Syntax: | int16_t NVMaccess( int16_t op, int16_t start, int16_t count,
int8_t *buffer );
| ||||||||||||||||||
Description: | The XBIOS routine NVMaccess permits the configuration of the
NVM of the real-time clock. This has available 50 bytes of
non-volatile RAM, where the last two bytes are used as a checksum. The
following apply:
| ||||||||||||||||||
Return value: | The function returns the value 0 if no error has occurred. A
value of -5 means that the arguments were not within the permitted
region. A return value of -12 identifies an inconsistent checksum.
| ||||||||||||||||||
Availability: | Atari TT (TOS 3.xx) and Falcon (TOS 4.xx)
| ||||||||||||||||||
Group: | Date, Time and Timer
| ||||||||||||||||||
See also: | Binding Assignment of the NVM
|
C: | #include <tos.h>
int16_t NVMaccess( int16_t op, int16_t start, int16_t count, int8_t *buffer ); |
Assembler: |
pea buffer ; Offset 8 move.w count,-(sp) ; Offset 6 move.w start,-(sp) ; Offset 4 move.w op,-(sp) ; Offset 2 move.w #46,-(sp) ; Offset 0 trap #14 ; Call XBIOS lea $C(sp),sp ; Correct stack |
Name: | »set time« - Set the time and date.
| ||||||||||||||
Opcode: | 22
| ||||||||||||||
Syntax: | void Settime( uint32_t time );
| ||||||||||||||
Description: | The XBIOS routine Settime sets the date and time. The 32-bit
parameter time is split up as follows:
| ||||||||||||||
Return value: | The function does not return a result.
| ||||||||||||||
Availability: | All TOS versions.
| ||||||||||||||
Gruppe: | Date, Time and Timer
| ||||||||||||||
See Also: | Binding Gettime
|
C: | #include <tos.h>
void Settime( uint32_t time ); |
Assembler: |
move.l time,-(sp) ; Offset 2 move.w #22,-(sp) ; Offset 0 trap #14 ; Call XBIOS addq.l #6,sp ; Correct stack |
Name: | »timer init« - Initialize the timer in the MFP chip.
| ||||||||||||||||||||
Opcode: | 31
| ||||||||||||||||||||
Syntax: | void Xbtimer( int16_t timer, int16_t control, int16_t data,
void(*vector)( ) );
| ||||||||||||||||||||
Description: | The XBIOS routine Xbtimer initializes one of the four timers
(A-D) in the 68901 multi-function peripheral chip. The following
apply:
| ||||||||||||||||||||
Return value: | The function does not return a result.
| ||||||||||||||||||||
Availability: | All TOS versions.
| ||||||||||||||||||||
Group: | Date, Time and Timer
| ||||||||||||||||||||
See also: | Binding
|
C: | #include <tos.h>
void Xbtimer( int16_t timer, int16_t control, int16_t data, void(*vector)( ) ); |
Assembler: |
pea vector ; Offset 8 move.w data,-(sp) ; Offset 6 move.w control,-(sp) ; Offset 4 move.w timer,-(sp) ; Offset 2 move.w #31,-(sp) ; Offset 0 trap #14 ; Call XBIOS lea $C(sp),sp ; Correct stack |
The real-time clock in the Atari TT030 and Falcon030 has available 50 bytes of non-volatile memory that can be used by programs for configuration purposes. The following assignments apply:
typedef struct { unsigned int bootpref; char reserved[4]; unsigned char language; unsigned char keyboard; unsigned char datetime; char separator; unsigned char bootdelay; char reserved2[3]; unsigned int vmode; unsigned char scsi; } NVM;
bootpref | Boot preference:
0x00 = No preference 0x08 = MagiC 0x10 = Linux 0x20 = NetBSD 0x40 = UNIX will be booted 0x80 = TOS will be booted | ||||||
language | Language:
0 = English 1 = German 2 = French 3 = Reserved 4 = Spanish 5 = Italian | ||||||
keyboard | Keyboard layout:
0 = USA 1 = German 2 = French 3 = British 4 = Spanish 5 = Italian 6 = Swedish 7 = (French) Swiss 8 = (German) Swiss | ||||||
datetime | Formatting of the date:
| ||||||
separator | ASCII-value of the character that is to act as the separator
for the date.
| ||||||
bootdelay | Boot delay
| ||||||
vmode | Video mode
| ||||||
scsi |
|
All further bytes are not documented at present. As one can see, it is possible, in particular, to specify the SCSI ID of a TT030 or Falcon030 via the NVM.
In a Milan the NVM has a size of 224 bytes.
The following structure applies only for TOS 4.08 (2003-03-09) and Bootblock 1.02!
typedef struct { unsigned int bootpref; char reserved[4]; unsigned char language; unsigned char keyboard; unsigned char datetime; char separator; unsigned char bootdelay; unsigned char ide_drives; unsigned char scsi_drives; char reserved2; unsigned int vmode; unsigned char scsi; char reserved3[31]; unsigned char memory; char INT1_2; char INT3_4; char reserved4[173]; } NVM_Milan;
memory |
|
See also: NVMaccess XHDI specification