Re: [cc65] Uniform mass storage device discovery and file locations

From: Oliver Schmidt <ol.sc1web.de>
Date: 2012-08-17 10:02:08
Hi,

So far I understand that there is by no means a prepared list of
devices currently present. One could however "check" the device
numbers 7-31 for presence.

There were two hints into this direction:

1.
> just check with a simple LISTEN/SECLISTN/UNLISTEN or
> similar that a device is there

2.
> Each successfully open device above #7 is a potential mass storage device. Further identification can be done by sending UI command and parsing returned string.

Could please somebode elaborate on this for a non-CBMer? Do they both
mean the same?

Again: Ideally this would be a two step process:
a) Check if the device is present
b) Check if a (formatted, usable) disk is in the devie.

Maybe it helps if I come up with ideas for a potential API for both steps:

a)
#define INVALID_DEVICE 255
unsigned char findnextdevice(unsigned char device);

If called with INVALID_DEVICE returns the first device number. If
called with with the device number found last returns the next device
number. If there's no next device returns INVALID_DEVICE.

b)
#define MAX_DIR <target-specific>
char *rootdir(unsigned char device, char *buf, size_t size);

Fills 'buf' with the name of the root directory on 'deviceid'. Returns
a pointer to 'buf' if successful, returns NULL on failure. Is supposed
to check if the device is ready (i.e. if a formatted disk is in a
drive). The name can be used as paramter to chdir(). The name is
target-specific and supposed to have a meaning to users of that
target.

Regards,
Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Aug 17 10:02:16 2012

This archive was generated by hypermail 2.1.8 : 2012-08-17 10:02:19 CEST