[Freemint-list] XHDI extension proposal

Thorsten Otto admin at tho-otto.de
Sun Feb 19 16:09:15 MSK 2017


On Sunday 19 February 2017 10:13:12 Adam Klobukowski wrote:
> For example, FreeMiNT requires 1.10, and hapilly works with greater api
> version.

FreeMINT is still maintained, and could be fixed if neccessary. But well, 
might be ok to bump it.

>To make it somehow consistent with  XHGetCapacity.

Why is that consistent? It only make things more complicated, both in the 
implementation and for callers of the function. Unless you have a real good 
reason for this, i would strongly suggest to use a signature like:

LONG XHGetCapacity2 (UWORD major, UWORD minor, ULONGLONG *blocks,
                               ULONG *blocksize);

It would also be nice to clarify what XHGetCapacity (the original function 
#14) returns in case the number of blocks exceeds the 32bit limit, and wether 
that happens
a) when the number overflows a signed value or  an unsigned value
b) when the number overflows the number of logical or physical sectors, i.e 
what happens if blocksize is >512 bytes, and the number would fit in a 32bit 
value of blocksize sectors, but not in a 32bit value of sectors of size 512.

And another suggestion: in several libraries i've seen a function XHMakeName 
that transforms the major/minor device numbers to some string representation 
identifying the device. It would be nice to make such a function optionally be 
part of the specification, with a signature like this:

LONG XHMakeName(UWORD major, UWORD minor, ULONGLONG start_sector, char *name, 
UWORD namelen);



More information about the Freemint-list mailing list