Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Interface

Persistant mass storage is handled by the eprom file area with standard file i/o API using :EPR.x device.

The principle of this device is usage of a temporary file in :RAM.-

Read operations are done by copying the :EPR.x/... file to the temporary file which handle is returned by GN_Opf.

Write operations are done on a temporary file, file is saved to eprom file area on closure by GN_Cl. Existing file in eprom file file area is automatically marked as deleted.

Closure is ended by erasure of the temporary file.

 

The Dm_Epr DOR major type has been created for that purpose. When standard filing system is parsed for a filename, the devices are polled by type.

...

The DOR major type is returned and caugth if Dm_Epr major type. This is followed by creation and usage of the temporary file in :RAM.-

. It is interfaced with the :EPR device (OZ 4.7 and newer). This device follows the DOR conventions with the major type DM_Epr ($84). Internal eprom file area is accessed with :EPR.0 device name. :EPR.1, :EPR.2, :EPR.3 refer to eprom file area in slot 1, 2 or 3 if a formatted eprom or flash eprom card is available. Accessing the file requires opening with GN_Opf, followed by i/o operations (OS_Gb, OS_Pb, OS_Frm, OS_Fwm, OS_Mv...) and ended by closure with GN_Cl. All usual read and write operations are performed like standard RAM files thanks to a temporary ram files in :RAM.-. This functionality is transparent for end user, temporary files are deleted after closure of the file.

 

File Card format

The following is the format used in file Eprom and Flash Cards. Unfortunately this is not the conventions used by the DOR system. However, it is sufficient for traversing through the file contents. With this information you can program an application that can retreave previously 'deleted' (overwritten) files. The format is as follows:

$0000       File entry
...         File entry

... 

...         Latest file entry
...         $FF's until
$3FC0       $00's until
$3FF7       $01
$3FF8       4 byte random id
$3FFC       size of card in banks (2=32K, 8=128K, 16=256K)
$3FFD       sub-type, $7E for 32K cards, and $7C for 128K (or larger) cards
$3FFE       'o'
$3FFF       'z' (file eprom identifier, lower case 'oz')

A file entry has the form:

1 byte      n           length of filename
1 byte      x           '/' for latest version, $00 for old version (deleted)
n-1 bytes   'xxxx'      filename
4 bytes     m           length of file (least significant byte first)
m bytes                 body of file

When a file is saved to EPROM which has the same name as an existing file, the byte following the filename length, is set to zero, thus marking the file deleted. However, the name length and contents of the old file are all intact and so by directly reading the EPROM, old files can be recovered.

In OZ V4.2 and later, OS_Epr has been extended with new functionality to read / write File cards. A new system call, OS_Fep has also been introduced which writes and erases data on Rakewell Flash Cards. 

NOTE : The Wildcard handler does not handle eprom file area filenames (this part will be done by Mr G.)

...