EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Small sector sizes?

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#27329
Posted: 11/24/2013 11:24:13
by Andy Key (Standard support level)
Joined: 11/12/2013
Posts: 16

I am trying to write a CP/M filesystem.
On CP/M, sectors are 128 bytes long, and there isn't really the idea of clusters.

So I tried :-

cbfs.SetSectorSize(128);
cbfs.SetClusterSize(128);

My program crashes executing the first method.
Because of an anomoly with link.exe not being able to find vc110.pdb for object files in cbfs.lib, I can't give a lot more detail, other than to say it looks like an unhandled exception resulting in a call to terminate.

The online docs on this site for SectorSize say it is 512 by default, and can be 1024, or 2048, ... if needed.

What is the significance of these sizes?
Can you say more about what values are acceptable?
Can you say more about the relationship between the choice of these sizes and any values returned as AllocationSize for example?

I'm not sure this is a big issue for me.
I suppose I could round down the NumberOfFreeSectors returned from GetVolumeSize for example...

{{{ Andy
#27331
Posted: 11/24/2013 11:39:26
by Eugene Mayevski (EldoS Corp.)

The size of the sector must be multiple of 512 and it can't be less than 512. Moreover, larger values, while generally working, can be unexpected for some software or even system modules (depending on whether the programmer thought about larger sector sizes). So the best approach is not to change sector size.

Note that CBFS emulates mainly a filesystem and as it doesn't let the OS or the application read or write sectors, this property has limited use.


Sincerely yours
Eugene Mayevski
#27335
Posted: 11/24/2013 12:17:35
by Andy Key (Standard support level)
Joined: 11/12/2013
Posts: 16

Thanks for the info.
That's good advice you give there too.
Might be worth making the online doc explicit about this.
By the way, I caught the exception, and sure enough, its an ECBFSError telling me I am trying to use an illegal sector size.
Thanks.

{{{ Andy
#27336
Posted: 11/24/2013 12:20:15
by Eugene Mayevski (EldoS Corp.)

In version 5 documentation reflects what I've written.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 1261 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!