WikiPendium

(beta)

Rwabs()

WikiPendium :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ec2-3-145-130-31.us-east-2.compute.amazonaws.com

Rwabs()

(Read write absolute sectors)

LONG Rwabs( mode, buf, count, recno, dev, lrecno )

WORD mode, count, recno, dev;
VOIDP buf;
LONG lrecno;

Rwabs() is the function used to read (resp. write) sectors from (resp. to) a block device to (resp. from) memory.

Opcode

4 (0x04)

Availability

All TOS versions.

Parameters

mode is a bitmask of operation to perform:

Name Value Bit number in mode Bit=0 Bit=1
RW_READ 0 0 Read operation -
RW_WRITE 1 0 - Write operation
RW_NOMEDIACH 2 1 Operation can update media change status Operation does not update media change status
RW_NORETRIES 4 2 Operation is retried on error condition Operation is not retried on error condition
RW_NOTRANSLATE 8 3 Operation is in logical mode Operation is in physical mode

buf is a pointer to a block of memory large enough to contain the amount of bytes that will be read or written by the operation. Its size must be count * logical sector size in logical mode, or count * 512 in physical mode.

count is the number of sectors that will be transferred during operation. Note: it is a WORD value, thus limited to 32767 sectors per operation.

recno is the number of the first sector to transfer. Note: it is a WORD value, thus you can only specify a start sector up to 32767. If your hard disk driver (above AHDI 3.0) supports it, you can use lrecno parameter to pass a LONG value, thus allowing access to many more sectors, in this case, set recno to -1.

dev is the device number on which to perform operation. In logical mode, it is associated to drive letters: 0 for device 'A:', 1 for 'B:', and so on. In physical mode, device number is as follows:
Device number Devices
0 - 1 Floppy devices 0 - 1
2 - 9 ACSI devices 0 - 7
10 - 17 SCSI devices 0 - 7
18 - 19 IDE devices 0 - 1

lrecno is the number of the first sector to transfer.

Binding

	move.l	#lrecno,-(sp)
	move.w	#dev,-(sp)
	move.w	#recno,-(sp)
	move.w	#count,-(sp)
	pea	buf
	move.w	#mode,-(sp)
	move.w	#4,-(sp)
	trap	#13
	lea	18(sp),sp


Return Value

Rwabs() returns E_OK (0) if no error occured, or a negative BIOS error code.

See also

Getbpb(), XHReadWrite()

Il n'y a pas de commentaire sur cette page. [Afficher commentaires/formulaire]