Creating a database from disk images on a DataCentre

discuss both original and modern hardware for the bbc micro/electron
Post Reply
User avatar
SimonSideburns
Posts: 537
Joined: Mon Aug 26, 2013 9:09 pm
Location: Purbrook, Hampshire
Contact:

Creating a database from disk images on a DataCentre

Post by SimonSideburns » Mon Mar 02, 2020 8:36 pm

I may be rambling here but I have an idea and don't know if it's possible or would be well received.

I have a Retroclinic DataCentre. I've EXPORTed several floppy disks from multiple locations and would like to make some sort of database of the files on all the disk images. I could do something with the disk images on my laptop by reading the first sector from both sides and parsing out the file names, but if anything changed (which it would as and when I use the Beeb), I'd have to keep taking the USB Stick out of the DataCentre and run the script, routine or program again now and then to keep the list up to date.

Here's my thinking. Write a program on the Beeb (in BASIC maybe) that recursively reads through the contents of Drive 5 on the DataCentre, and upon finding a file ending in SSD or DSD file importing it into the DataCentre, then reading the list of filenames from every catalogue, storing these into another file.

The idea is to be able to locate a file easily by searching through this database if I'm in need to locate a particular file (by name), or browsing quickly through disks to try to locate something when I've forgotten the name.

I'd need one database of pathnames/filenames from the USB stick as they appear to the DataCentre, with possibility to add a longer description to each entry, and another listing each file that appears on each disk, so ideally they would need to be held in a relational database with each database storing a unique ID per entry. Do such things exist, or are they easy to make?

In the mid to late 1990s I worked for a company who had written a piece of software that allowed you to create any number of C-ISAM files with any number of indexes, and the software had a forms writer, report writer, etc. to allow rapid development of relational databases and apps, so I'm happy with that side of the theory, but the system was on UNIX and later Windows, and I've never heard of C-ISAM or an equivalent being available on our humble 8-bit computers.

I'd imagine the storage space required might be the issue, but as I'd be only ever importing the disks to drive 0/2, I could use drives 1 and 3 to hold the two database files (and indexes), but I wonder if DRIVE 4 or DRIVE 5 on the DataCentre can have files OPENed for reading/writing sequentially. That way, each database could be stored on the USB stick holding the files indexed.

Anyway, I'd like to hear any thoughts/ideas you have and whether you think it could be done, along with any recommendations for database programs that would save me the hassle of writing my own code to perform this useful task.
Just remember kids, Beeb spelled backwards is Beeb!

User avatar
lurkio
Posts: 2588
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Creating a database from disk images on a DataCentre

Post by lurkio » Tue Mar 03, 2020 11:50 am

SimonSideburns wrote:
Mon Mar 02, 2020 8:36 pm
I have a Retroclinic DataCentre. I've EXPORTed several floppy disks
Yes. Yes, you have. Well done. :wink:

SimonSideburns wrote:
Mon Mar 02, 2020 8:36 pm
... Anyway, I'd like to hear any thoughts/ideas you have and whether you think it could be done, along with any recommendations for database programs that would save me the hassle of writing my own code to perform this useful task.
I think that's actually a very interesting idea, although I haven't a clue how feasible the database part is, or even whether such a database is already available for Beebs or not. But I imagine the indexing and query stuff could be done much more easily in a Unix-like environment, especially if you use sweh's Perl tools for interrogating .SSD/.DSD disc-images, for example.

Setting the databasey part aside, though, what might still be quite useful is a program on the Beeb that could just do a "live navigation" of the filesystem on the USB stick in the DataCentre, allowing you to use the arrow keys to go up and down the folder hierarchy, select a .SSD/.DSD and drill into it -- i.e. *EXPORT *IMPORT it to from the USB stick to RAM drive zero in the DC and then *CAT the contents straight to screen. (But there wouldn't be any caching or permanent indexing of anything.)

Basically, I'm asking for a Finder- or Explorer-type app for Beebs with DataCentres.

:idea:

User avatar
SimonSideburns
Posts: 537
Joined: Mon Aug 26, 2013 9:09 pm
Location: Purbrook, Hampshire
Contact:

Re: Creating a database from disk images on a DataCentre

Post by SimonSideburns » Tue Mar 03, 2020 5:39 pm

lurkio wrote:
Tue Mar 03, 2020 11:50 am
Yes. Yes, you have. Well done. :wink:
Export, import, (consult the user guide often). You'd think that after a bout of archiving the commands would stay forever burned into my brain, but sadly, not.
lurkio wrote:
Tue Mar 03, 2020 11:50 am
Basically, I'm asking for a Finder- or Explorer-type app for Beebs with DataCentres.

:idea:
I hadn't thought of it in that way, but yes, that would make quite the useful thing.

I might just have to investigate the possibilities of how this would work, and start dusting off my very basic ROM writing skills. It's been well over 20 years since I last wrote one. Does anyone have a PDF of any of the books that talk you through writing ROMs? Back in the 1990s I borrowed one from a friend and it was very comprehensive, but I forget the title.
Just remember kids, Beeb spelled backwards is Beeb!

User avatar
lurkio
Posts: 2588
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Creating a database from disk images on a DataCentre

Post by lurkio » Tue Mar 03, 2020 9:58 pm

SimonSideburns wrote:
Tue Mar 03, 2020 5:39 pm
I might just have to investigate the possibilities of how this would work, and start dusting off my very basic ROM writing skills. It's been well over 20 years since I last wrote one. Does anyone have a PDF of any of the books that talk you through writing ROMs?
Is this any good?:
Or this?:
:?:

julie_m
Posts: 141
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: Creating a database from disk images on a DataCentre

Post by julie_m » Tue Mar 03, 2020 10:24 pm

If you're going to be writing anything "database-y" then you will have to get thoroughly familiar with the (zp),Y addressing mode. You'll need a list of the starting points in memory and lengths of each record, and two two-byte pairs in zero page to act as the pointers to your list and the record itself.

Code: Select all

ASL A \ double it because we are reading pairs of bytes
TAY \ move doubled index into Y
LDA (&80),Y \ 80,81 is base address of 1st list
STA &82 \ 82, 83 will be base address of 2nd list
INY
LDA (&80),Y
STA &83
LDY #0 \ now read the actual record
LDA (&82),Y \ the address we just read
\ ...
.listbase
EQUW record1
EQUW record2
\ ...
.record1
EQUB record2-record1 \ the length
EQUS record1$
.record2
EQUB record3-record2
EQUS record2$
.record3
\ ...

Post Reply

Return to “8-bit acorn hardware”