[Coco] Data Modules

Gregory Law glaw at live.com
Sun Sep 17 13:35:38 EDT 2023


The easy way to calculate the CRC of a module is to call OS9 F$CRC, 
although you'll need to look up the parameters in the manual since I 
don't remember these off the top of my head.

Look in the NitrOS-9 repository for 3rdparty/packages/os9l2bb2/cmds/ to 
see some sample code that uses data modules. Conf.dat.asm is the data 
module and this is used in BBS.conf.asm and BBS.conf.who.asm. It looks 
as if Conf.dat is used to store the aliases of the user in conference, 
although I haven't had a chance to dig into it to see if it may store 
other information as well.

The CRC is checked only when loading a module into memory with F$Load. 
Once the module is in memory, the CRC is never checked again so you can 
make all the modifications you want to a data module without worrying 
about the CRC. In theory you can persist a data module from memory back 
to disk if you recalculate the CRC before saving to disk but this is not 
very useful with OS-9 Level 2. The reason I say it's not very useful is 
because this requires loading a stand-alone data module into memory 
(e.g. F$Load Conf.dat) that eats an entire 8K memory block for a 
316-byte data module. The more common scenario is to merge all the 
program modules and the data module into one file. This way the entire 
set of modules can load into the smallest number of 8K blocks possible 
and save a good chunk of memory.

On 9/17/2023 11:59:54 AM, "coco--- via Coco" <coco at maltedmedia.com> 
wrote:

>All
>
>Trying to understand more about NitrOS9 modules.
>There is some good info in the "Technical Reference"
>however it focuses on Program Modules and leaves some
>questions to be answered.
>
>1. How is the CRC calculated ?
>2. What are the best practices for using Data Modules ?
>3. Is there any sample code of Data Module use ?
>
>Would appreciate any hints as to where I could find such information.
>
>Thanks
>Charlie.
>


More information about the Coco mailing list