Home BIOSBIOS XBRA procedureXBRA procedure BIOS function listBIOS function list

3.10 BSIM-BIOS-Extension

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.

bsim_id Check if BSIM is available
drv_change Swap drives
drvprotec Get/set software write-protection for drives
dstate Get details about the drive
kill_disk Remove disk from memory
load_disk Load disk into memory
save_disk Save to disk

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.

3.10.1 bsim_id

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
 

3.10.1.1 Bindings for bsim_id

Assembler:
 
move.w    #$12C,-(sp)   ; Offset 0
trap      #13           ; Call BIOS
addq.l    #2,sp         ; Correct stack
GFA-Basic: Fehler%=Bios(300)
 

3.10.2 drv_change

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:
 
0: Normal
1: Swapped
Availability: Drive-B-Simulator.
 
See also: Binding
 

3.10.2.1 Bindings for drv_change

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%)
 

3.10.3 drvprotec

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
 

3.10.3.1 Bindings for drvprotec

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%)
 

3.10.4 dstate

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
 

3.10.4.1 Bindings for dstate

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%)
 

3.10.5 kill_disk

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
 

3.10.5.1 Bindings for kill_disk

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%)
 

3.10.6 load_disk

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
 

3.10.6.1 Bindings for load_disk

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%)
 

3.10.7 save_disk

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
 

3.10.7.1 Bindings for save_disk

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%)
 

Home BIOSBIOS XBRA procedureXBRA procedure BIOS function listBIOS function list