This has been in development for a while now as an in-house utility to use
FAT drives (SD Card, USB hard drive, flash drive) mounted on a
Ser-USB/USBWiz from QDOS. It's primary purpose was to provide a facility to
load files into a standard QL that had no other storage devices attached and
insufficient memory to load the full Ser-USB driver. After using it in
conjunction with another project that I am working on I decided that it was
time to put it out in the open.

Not really a driver as such, the new utility installs a set of S*BASIC
extensions that provide equivalents to many of the QDOS/SMSQ commands for
manipulating files. As it runs entirely in user mode it gets around the
truly horrendous problems of calling the serial driver from within another
device driver.  Because of this it is actually faster than the Ser-USB
driver, works in more configurations and allows you to more easily move
files to/from PCs/Macs etc. Executable files may also be stored on FAT file
systems using Q-emuLator-compatible prefix headers.
 
Current owners of Ser-USBs will be able to download the new software to use
as an alternative to the native QDOS driver supplied with their devices.  A
ROM version of the new utility will also be available for purchase.



Adrian
www.memorylanecomputing.com

Here is the command set, in no particular order (apologies for any surplus
blank lines that I suspect the QL Users Mailing List server will add to
this):

PROCEDURES
==========

UZ_MNT Drive%
  Mount a FAT file system on the USBWiz.
  Drive% = 1..3
  1 = SD Card
  2 = USB Port 1
  3 = USB Port 2

UZ_DIR [#Channel]
  Display a directory of the currently mounted drive.

UZ_FORMAT
  Quick Format the media currently mounted on the USBWiz.

UZ_COPY "Source Target"
  Copy a file to/from the USBWiz.
  Filename on USBWiz is prefixed by a ':'.
  No surplus spaces are allowed in the parameter string.

UZ_LOAD Filename$
  Load a file from the USBWiz by stuffing its contents into the keyboard
queue.
  Maximum file size is 32K.

UZ_EX Filename$
  Load and execute a file from the USBWiz.

UZ_EW Filename$
  Load and execute a file from the USBWiz and wait for completion.

UZ_LRESPR Filename$
  Load and install an extension from the USBWiz.

UZ_LBYTES Filename$, Address
  Load a file from the USBWiz into memory.

UZ_SBYTES Filename$, Address, Length
  Save memory (overwrite) to a file on the USBWiz.

UZ_SBYTES_A Filename$, Address, Length
  Save memory (append) to a file on the USBWiz.

UZ_DEL Filename$
  Delete a file on the USBWiz.

UZ_REN "Old New"
  Rename a file/directory on the USBWiz.

UZ_MD Directory$
  Make a directory on the USBWiz.

UZ_RD Directory$
  Remove a directory on the USBWiz.

UZ_CD Directory$
  Change directory on the USBWiz.

UZ_FLUSH
  Flush the USBWiz input queue.

UZ_RESET
  Re-sync if the USBWiz has to be reset.
  Select 9600 baud and flush the USBWiz input queue.

UZ_BAUD Rate
  Set the USBWiz Baud Rate.

UZ_GETLBA Drive, LBA, Buffer
  Read one LBA from the USBWiz into memory.

UZ_PUTLBA Drive, LBA, Buffer
  Write one LBA to the USBWiz from memory.

UZ_GETLBAS Drive, LBA, Count, Buffer
  Read the contents of consecutive LBAs into memory.

UZ_PUTLBAS Drive, LBA, Count, Buffer
  Write the contents of memory into consecutive LBAs.

UZ_PORT Name$
  Change the port through which the USBWiz is connected.

UZ [#Ch,] Command$
  Send a command string to the USBWiz and display the result to the console
or specified channel.

UZ_CC [#Ch,] Filename$
  Copy a file's contents from the USBWiz to the specified channel (default
#1).
  Note: Maximum file size = 32K.

UZ_SCLK [DOSDateTime$]
  Set the USBWiz Clock.
  Omit the parameter to use the current Date/Time.


FUNCTIONS
=========

UZ_COPYF("Source Target")
  Copy a file to/from the USBWiz.
  Filename on USBWiz is prefixed by a ':'.
  No surplus spaces are allowed in the parameter string.
  Returns 0 for success, else error code.

UZ_HDRS(State%)
  Set/test whether file headers are ignored during copy operations. If set,
a Q-emuLator-style prefix header is pre-pended to files of types 1 and 2
before they are written to the FAT file system, and extracted when they are
read.
  State% =  0: Ignore headers.
  State% =  1: Process headers (the default)
  State% = -1: Return current setting.

UZ_FLEN(Filename$)
  Return the length of a file on the USBWiz.

UZ_FATTR(Filename$)
  Return the (FAT) attributes of a file on the USBWiz.

UZ_FDATE(Filename$)
  Return the date stamp (as a FAT long word bit field) of a file on the
USBWiz.

UZ_FTEST(Filename$)
  Test whether a file exists on the USBWiz.

UZ_MTEST()
  Test whether there is media currently mounted on the USBWiz.

UZ_MSIZE()
  Return the capacity of the media currently mounted on the USBWiz.

UZ_MFREE()
  Return the free space on the media currently mounted on the USBWiz.

UZ_CDRIVE%()
  Return the currently selected drive on the USBWiz.

UZ_VER$()
  Return the driver version.

UZ_HWVER$()
  Return the hardware version.

UZ_WRITE% (String$)
  Write a string to the USBWiz channel.

UZ_READ$(Bytes%)
  Read a string of up to Bytes% characters from the USBWiz channel.

UZ_FETCH% (Template$)
  Fetch a USBWiz response and match the template.

UZ_RESULT$(Index%)
  Fetch an entry from the USBWiz result table.

UZ_OK()
  Get a response from the USBWiz.
  Return 1 if succeeded and it's OK, otherwise 0.

UZ_BUSY(State%)
  State% =  0: Try and clear the USBWiz BUSY Flag.
  State% =  1: Try and set the USBWiz BUSY Flag.
  State% = -1: Test the USBWiz BUSY Flag, returning 1 if set or 0 if clear.

UZ_GETLBAF(Drive, LBA, Buffer)
  Read one LBA from the USBWiz into memory.
  Return 0 if success, else error code.

UZ_PUTLBAF(Drive, LBA, Buffer)
  Write one LBA from memory to the USBWiz.
  Return 0 if success, else error code.

UZ_GETLBASF(Drive, LBA, Count, Buffer)
  Read the contents of consecutive LBAs into memory from the USBWiz.
  Return 0 for success, else negative error code.

UZ_PUTLBASF(Drive, LBA, Count, Buffer)
  Write the contents of memory into consecutive LBAs on the USBWiz.
  Return 0 for success, else negative error code.

UZ_BAUDF()
  Return the current USBWiz baud rate.

UZ_CHANNEL()
  Return the current USBWiz Channel ID.

UZ_PORT$()
  Return the current USBWiz port name.

UZ_ERROR$()
  Return the last USBWiz error response.

DATE_DOS$()
  Return the current Date/Time as a DOS long word bit field represented by
an 8 digit hex string.

DATE_DOS
  Return the current Date/Time as a DOS long word bit field.

DOS_DATE$(DOSDate)
  Convert a long word bit field DOS date to a string of the form "YYYY/MM/DD
HH:MM:SS".

UZ_VARS()
  Return the base address of the USBWiz driver variables.



_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to