BIOS
XBRA procedure
BIOS function list
The basic idea of the Drive-B-Simulator is to read a floppy disk
into memory and operate it as a RAM-disk. The 'write disk' function
writes the RAM-disk back to the disk. A 'swap mode' allows the program
to work with applications that stubbornly access drive A.
Note: Drive-B-Simulator uses the same XBRA ID as BlitSim
('BSIM').
Configuration file:
The config file BSTAT.INF is an array of 18 bytes. The following
apply:
Offset |
Meaning
|
0..15 |
Write lock status (0 or 1) for each drive, from byte 0=A to
byte 15=P
|
16 |
Load disk at startup (0 or 1)
|
17 |
Swap drives at startup (0 or 1)
|
Warning Calls to this BIOS extension must be avoided
because Drive-B-Simulator uses undocumented TOS features and
hard-coded addresses which prevent it from working under EmuTOS.
Presented in the german magazine TOS 3/1992.
Name: |
»BSIM id« - Check if BSIM is available
|
Opcode: |
300 (0x012c)
|
Syntax: |
See 'Bindings for bsim_id'
|
Description: |
The BIOS routine bsim_id checks if BSIM is available.
|
Return value: |
The function returns 0x4253494D ('BSIM') if BSIM is
available.
|
Availability: |
Drive-B-Simulator.
|
See also: |
Binding
|
Assembler: |
move.w #$12C,-(sp) ; Offset 0
trap #13 ; Call BIOS
addq.l #2,sp ; Correct stack
|
GFA-Basic: |
Fehler%=Bios(300)
|
Name: |
»Drive change« - Swap drives
|
Opcode: |
304 (0x0130)
|
Syntax: |
See 'Bindings for drv_change'
|
Description: |
The BIOS routine drv_change allows to swap drives. The
data argument is as follows:
0: |
Normal
|
1: |
Swapped
|
-1: |
Status
|
|
Return value: |
The function can return the following results in D0:
|
Availability: |
Drive-B-Simulator.
|
See also: |
Binding
|
Assembler: |
move.w #data,-(sp) ; Offset 2
move.w #$130,-(sp) ; Offset 0
trap #13 ; Call BIOS
addq.l #4,sp ; Correct stack
|
GFA-Basic: |
Fehler%=Bios(304,W:data%)
|
Name: |
»Drive protection« - Write lock settings
|
Opcode: |
305 (0x0131)
|
Syntax: |
See 'Bindings for drvprotec'
|
Description: |
The BIOS routine drvprotec gets or sets the write-protected
drive status. The prtdrv argument is a bit-vector for the
protected drives (bit 0=A, bit 1=B...), or -1 to inquire the current
status.
|
Return value: |
The function returns a bit-vector for the protected drives.
|
Availability: |
Drive-B-Simulator.
|
See also: |
Binding
|
Assembler: |
move.l #prtdrv,-(sp) ; Offset 2
move.w #$131,-(sp) ; Offset 0
trap #13 ; Call BIOS
addq.l #6,sp ; Correct stack
|
GFA-Basic: |
Fehler%=Bios(305,L:prtdrv%)
|
Name: |
»Drive status« - Get RAM-disk details
|
Opcode: |
306 (0x0132)
|
Syntax: |
See 'Bindings for dstate'
|
Description: |
The BIOS routine dstate copies details of the RAM-disk into
the buffer pointed to by pointer. The structure is as follows:
Offset |
Description
|
|
|
0 (long) |
Memory start address of the disk
|
4 (long) |
Disk size
|
8 (short) |
Sides
|
10 (short) |
Tracks
|
12 (short) |
Sectors
|
|
Return value: |
The function returns 0 in DO on success, or -1 if there is no
disk in memory.
|
Availability: |
Drive-B-Simulator.
|
See also: |
Binding
|
Assembler: |
pea pointer(pc) ; Offset 2
move.w #$132,-(sp) ; Offset 0
trap #13 ; Call BIOS
addq.l #6,sp ; Correct stack
|
GFA-Basic: |
Fehler%=Bios(306,L:pointer%)
|
Name: |
»Kill disk« - Remove disk from memory
|
Opcode: |
302 (0x012e)
|
Syntax: |
See 'Bindings for kill_disk'
|
Description: |
The BIOS routine kill_disk removes the disk from memory.
|
Return value: |
The function can return the following results in D0:
E_OK: |
No error has arisen
|
-1: |
Wrong magic value
|
|
Availability: |
Drive-B-Simulator.
|
See also: |
Binding
|
Assembler: |
move.l #magic,-(sp) ; Offset 2, magic:$87654321
move.w #$12E,-(sp) ; Offset 0
trap #13 ; Call BIOS
addq.l #6,sp ; Correct stack
|
GFA-Basic: |
Fehler%=Bios(302,L:magic%)
|
Name: |
»Load disk« - Load a disk into memory
|
Opcode: |
301 (0x012d)
|
Syntax: |
See 'Bindings for load_disk'
|
Description: |
The BIOS routine loads the disk into memory.
|
Return value: |
The function can return the following results in D0:
E_OK: |
No error has arisen
|
-1: |
Not enough memory
|
-2: |
A disk is already in memory
|
-3: |
Disk error
|
-4: |
Wrong magic value
|
|
Availability: |
Drive-B-Simulator.
|
See also: |
Binding
|
Assembler: |
move.l #magic,-(sp) ; Offset 2, magic:$12345678
move.w #$12D,-(sp) ; Offset 0
trap #13 ; Call BIOS
addq.l #6,sp ; Correct stack
|
GFA-Basic: |
Fehler%=Bios(301,L:magic%)
|
Name: |
»Save disk« - Save RAM-disk to disk
|
Opcode: |
303 (0x012f)
|
Syntax: |
See 'Bindings for save_disk'
|
Description: |
The BIOS routine save_disk saves data from memory to the
disk.
|
Return value: |
The function can return the following results in D0:
E_OK: |
No error has arisen
|
-1: |
Wrong magic value
|
-2: |
No disk in memory
|
-4: |
Write error
|
|
Availability: |
Drive-B-Simulator.
|
See also: |
Binding
|
Assembler: |
move.l #magic,-(sp) ; Offset 2, magic:$ABCD0123
move.w #$12F,-(sp) ; Offset 0
trap #13 ; Call BIOS
addq.l #6,sp ; Correct stack
|
GFA-Basic: |
Fehler%=Bios(303,L:magic%)
|
BIOS
XBRA procedure
BIOS function list