avatar_GUNHED

Random access using native OS and the Firmware - no RSX needed - BASIC only!

Started by GUNHED, 16:41, 11 February 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GUNHED

Well, some say it can't be done.

Here's my simple idea:

- Image a random access database, maximum size is 178 KB (just because it fits on a 3" disc).

- Now split the data into 4 KB blocks. These blocks are saved as 4 KB files on disc. For a full 178 KB data-set this would require 45 files of 4 KB each = 180 KB. This way only 45 of the 64 directory entries of the disc are occupied. But you can also work with 60 blocks of 3 KB each.

- Now you simple BASIC program has random access to the data by loading a 4 KB block and alter it. Also a second block can be loaded. This way the program can be still as big as 30 KB

I leave you with this for the weekend  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

abalore

I think it would run faster if instead of saving the blocks as files, you do it as contiguous sectors on disk.

andycadley

It would work, but 4K is a lot of data to load from disk. And there is quite a bit of overhead reading directory entries etc to find the file. Normally the reason for wanting random access within a file is to minimize this as much as possible. Loading sectors directly is probably the way to go, as that's essentially the minimum amount of disk access you can do in one go anyway.

GUNHED

Quote from: abalore on 17:19, 11 February 23I think it would run faster if instead of saving the blocks as files, you do it as contiguous sectors on disk.
Of course! Just mentioned this idea, because in some other threads there was a discussion about being able to do this all in BASIC (which I scarcely use anyway).
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

GUNHED

Quote from: andycadley on 22:02, 11 February 23It would work, but 4K is a lot of data to load from disk. And there is quite a bit of overhead reading directory entries etc to find the file. Normally the reason for wanting random access within a file is to minimize this as much as possible. Loading sectors directly is probably the way to go, as that's essentially the minimum amount of disk access you can do in one go anyway.
See my previous post and...

Having 40 KB of RAM can hold two 4 KB Blocks of data, 2 KB for DOS read/write buffer and around 30 KB for the program.
A full disc of data (178 KB) has the 45 different files with names like '01' to '45'. Then the disc is full and you don't need to put anything else on it. 

The whole thing is an experiment of the mind anyway.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod