The old data logging limits are gone. The logging system will now accept log records of up to 65535 bytes (the limit due to the 16-bit len field.
OASIS3 stores the log data in files named OASnnnnn.DAT, where nnn = 000 to 65535. Each file stores 16384 log records, though that can be changed through the defined constant RECS_PER_BLK in log.h. If the CFM capacity is exceeded, data files are deleted, oldest first. Note that 16384 records may be quite a lot of data, so if your CFM card is only a few megabytes, you may get only one log file, which will be deleted when the capacity is exceeded.
OASIS has traditionally defined two types of malloc memory -- tmpMalloc (temporary malloc) and permMalloc (permanently malloc'd). OASIS3 continues with this paradigm.
TmpMalloc is conveniently used as a rudimentary garbage collector -- it's reinitialized every power cycle, so if some driver forgets to tmpFree, the memory is recovered next cycle. This becomes more important now that I've implemented a kill command for the user. Kill terminates a driver task. I've modified semaphores so that kill will release any mutex semaphores when invoked, which releases access to serial ports; but it still doesn't turn off power bits or release memory.
All drivers use tmpMalloc for any buffers etc that they need. Future drivers should conform to this convention.
PermMalloc is used for things that will stick around -- downloaded code (which is not implemented), driver blocks, etc. Actually, since load is not implemented, the permMalloc space probably doesn't need to be very large. Currently, permMalloc is just a macro for "malloc", and permFree is a macro for "free".
TmpMalloc manages its own memory pool, currently defined as 192 KB (#define TMP_POOL_SIZE in malloc.h). Of the 512 KB RAM in the CF2, PicoDOS and other "system" stuff take around 170KB, leaving us with about 340 KB. Our static data, log buffers, etc, take a bunch more, leaving us with right around 256 KB to split between tmpMalloc and permMalloc (malloc). I've defined 192K for tmpMalloc, leaving 64K for permMalloc (note - we should probably make permMalloc even smaller -- it's not used for much). You can check memory usage with the new memCheck command.
I originally had the task stack set to 2 KB, but I found out that I was occasionally blowing the stack, so I changed it to 4 KB. I wrote a new command, checkStack, to allow you to see how much stack each running task takes. Note that it's for RUNNING tasks, so if you want to see what a driver uses, the driver has to be currently running. (Note - you may get more information from parm maxUsedStack). Most task stacks use either a few hundred bytes or about 2K, depending on whether they use stdio; so the 4 KB stack size should be good.
Stacks and task descriptors are allocated from tmpMalloc. Note that, if we had 32 drivers, not all could start up at once (eg at init) if TMP_POOL_SIZE is 128KB, since even a task that's waiting for a serial port needs its stack in order to wait on a semaphore. (32 tasks * 4 KB = 128 KB). The current size of tmpMalloc, 192K, should be sufficient for 32 tasks plus any buffers allocated by the drivers.