<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 24 Feb 1996 22:26:15 +0000 (GMT)
From   : Tom Seddon <T.W.Seddon@...>
Subject: Re: Emulation systems

I have just started implementing a file-based filing system in my 
emulator. I will probably have hardware-level disk emulation at some 
point as well.

My disk format consists of a single file which contains BBC files inside
it, one after another, with a header at the beginning detailing the
catalogue entries, their attributes, and their position within the main
file. When a new disk image is mounted, its contents are read entirely
into memory and manipulated there (this makes changing files' lengths etc
very easy). When the disk image is un-mounted the data is written back to
disk. 

This seems to me to have several advantages:

1. The data on this disk is never in a half-way stage, so if the program 
crashes you'll be able to recover everything you had on the disk image 
before.
2. To handle different image file formats, only the 'mount image' and 
'unmount image' routines need be changed.
3. The filing system will be very quick.

However:

1. The size of a disk image is limited by free memory.

On my 8MB machine I have about 6MB free when running my emulator though 
(and that's with a 1MB SMARTDRV cache) so I think that, unless you have a 
2MB machine, there will be enough space for useful disk emulation.

What do others think? Also, my filing system is (for the moment) 
non-hierachical with DFS (directory.filename) style filenames. Do people 
think it is worth providing ADFS/sub-directory support?

On a related filing-systemy note, I need some help (again! Sorry!) with
file pointers. It's the sort of thing which isn't really detailed in
manuals and guides, but could be determined in seconds with a real BBC
(which I don't have!). 

When changing PTR#, what happens if the new pointer is past the file's
end? Presumably the EOF flag for that channel is set, but is the file
extended? Similarly, when writing data with OSGBPB, if the start pointer
is past the end of the file should the file be padded in the middle with
zeros? From my reading of the Advanced Disk User Guide it appears that
setting PTR# to past the file's length is OK, but what happens when
writing to it? 

--Tom
 
    |     ** Tom Seddon **	  E-mail: T.W.Seddon@...
  - . -   			  www: http://www.ncl.ac.uk/~n5013784/
   /|\
  //|\\   If you help a friend in need, he's sure to remember you...
 ///|\\\  next time he's in need.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>