DoIO with struct IOExtTD (solved)

7 posts / 0 new
Last post
OldFart
OldFart's picture
Offline
Last seen: 2 hours 31 min ago
Joined: 2010-11-30 14:09
DoIO with struct IOExtTD (solved)

Hi,

Doing DoIO with struct IOExtTD (with io_Command set to ETD_RAWREAD) results in error -3 (in io_Error). Where can I find what this errorcode means?

From the autodocs:
IO REQUEST RESULT
io_Error - 0 for success, or an error code as defined in "devices/trackdisk.h"

Nope.

  1. struct IOExtTD
  2. {
  3. struct IOStdReq iotd_Req;
  4. ULONG iotd_Count;
  5. ULONG iotd_SecLabel;
  6. };

From the autodocs:
iotd_Count (ETD_RAWREAD only) maximum allowable change counter
value.

Should this latter be set to some value other then 0 in order to get rid of the error?

What is meant with this 'maximum allowable change counter value.'?

OldFart

OldFart
OldFart's picture
Offline
Last seen: 2 hours 31 min ago
Joined: 2010-11-30 14:09
Re: DoIO with struct IOExtTD

An error code of -3 means, accordig to exec/errors.h, that the device does not support the command.

Ok, so that problem has been solved, by replacing it by another problem: how to access a location on disk beyond the limit imposed by a 32bit offset in bytes?

OldFart

thomas
thomas's picture
Offline
Last seen: 3 days 3 hours ago
Joined: 2011-05-16 14:23
Re: DoIO with struct IOExtTD

how to access a location on disk beyond the limit imposed by a 32bit offset in bytes?

https://wiki.amigaos.net/wiki/NSD_Device_Specifics#NSDEVTYPE_TRACKDISK

Before you use it you should read the entire section about NSD.

https://wiki.amigaos.net/wiki/NSD_Standard

cwenzel
cwenzel's picture
Offline
Last seen: 2 days 9 hours ago
Joined: 2021-01-12 07:05
Re: DoIO with struct IOExtTD

** Notes from Ralph Babel, 15 April 1996.
** ===================================================================
**
** Data offsets:
** Unlike CMD READ, CMD WRITE, TD SEEK, and TD FORMAT,
** all of which deal with a 32-bit-wide byte offset passed via io Offset,
** the new commands listed above accept a 64-bit-wide byte offset to address the medium.
** The lower 32 bits of that byte offset are stored in io Offset;
** the upper 32 bits are stored in the io Actual field,
** for which the alias io HighOffset is introduced.
**
** According to the 1.3 edition of the RKRM Libraries & Devices,
** page 291, a driver may overwrite parameter fields of an I/O request
** (other than io Command) in the course of processing a command,
** so all fields need to be reinitialized upon every command submitted to the driver.
** io HighOffset thus does not differ from io Offset in that regard.
**
** This way, the io HighOffset field will not overlap with any of the
** extra IOExtTD fields required for the ETD-style trackdisk.device commands,
** and applications can continue to use the original IOStdReq-sized structure.
**
** Device-driver programmers are free to implement the TDF EXTCOM variants of the
** new 64-bit commands. Note: it is perfectly legal for a 64-bit request
** to cross a 4-GB boundary (i.e. io Offset + io Length > 2^32 ) or for it to be
** in 32-bit space completely (i.e. io HighOffset = 0; io Offset + io Length < 2^32 ).
**
** Transfer length:
** io Length and io Actual remain 32-bit quantities, and the maximum transfer
** length is thus still limited to 2^32.

cwenzel
cwenzel's picture
Offline
Last seen: 2 days 9 hours ago
Joined: 2021-01-12 07:05
Re: DoIO with struct IOExtTD

Here's a little something I use for extended CMD_READ calls, adapt it as you need.

int32 DevDoIO(struct IORequest *DevIOReq, int32 command, uint64 offset64,
uint32 length, APTR data)
{
LONG result;

#define io_HighOffset io_Actual
#define io_LowOffset io_Offset

if(( CMD_READ == command ) && ((offset64+length) > MAXUINT32 ))
{
command = NSCMD_TD_READ64;
}

DevIOReq->io_Command = command;
DevIOReq->io_HighOffset = (offset64 >> 32) & MAXUINT32;
DevIOReq->io_LowOffset = (offset64 & MAXUINT32);
DevIOReq->io_Length = length;
DevIOReq->io_Data = data;

result = (int32) IExec->DoIO((struct IORequest *)DevIOReq);

return(result);
}

OldFart
OldFart's picture
Offline
Last seen: 2 hours 31 min ago
Joined: 2010-11-30 14:09
Re: DoIO with struct IOExtTD

@thomas

Thank you for pointing out these wikipedia pages to me. They proved to be a real tresure chest. Been toying with the information provided for a couple of days now and I can honestly decalre to be enthousiastically treading new turf here,

OldFart

OldFart
OldFart's picture
Offline
Last seen: 2 hours 31 min ago
Joined: 2010-11-30 14:09
Re: DoIO with struct IOExtTD

@cwenzel

Tried and tested the information you provided now for a couple of days and this was exactly what I needed. Thanks!

OldFart

Log in or register to post comments