baconwaifu / propforth

Automatically exported from code.google.com/p/propforth
0 stars 0 forks source link

Minimal Kernel to call (auto load) SD resident definitions #190

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

This is an enhancement request to investigate a possible custom kernel.

Duane's inquery 

After our discussion of implementing BASIC in propforth with a minimal kernel, 
paged assembler and SD:  Duane Johnson asked about an a routine to identify 
unused words (to remove from the final application). 

Response was that the BOOT KERNEL is propbably the minimum kernel; there isn't 
a tool that checks for unused words (that I know of at this time).

Consider request for:
Minimum kernel, optimized, with SD support, configured to run as much as 
possible as extensions on SD.  For example, the boot.f file might contain a 
list of the definition files on the SD; on boot, references to these items 
would be loaded into the dictionary.  When an SD resident definition is called, 
the associated SD blocks are loaded into the buffer, and 
executed. 

Is this something to look into? Am I thinking about this the right way? 

Original issue reported on code.google.com by prof.bra...@gmail.com on 25 Mar 2013 at 9:38

GoogleCodeExporter commented 8 years ago
Just to clarify:
Years ago I was writing a data acquisition program on an Intel 8052 using Bryte 
Forth.
I was running out of space in memory.
An expert Forth programmer wrote something he called an "optimizer".
1. The application cod was added to the top of the dictionary.
2. The optimizer searched back through the dictionary and weeded
   out any words that were not referenced.
3. As I recall after each word was removed the optimizer started
   over again until the bottom of the dictionary was reached.

This process squeezed the dictionary down to a minimal size to operate. 
However, this subset of forth was now not useful for editing but it ran the 
last word in the dictionary which is all it had to do.

Duane J

Original comment by ziggy1...@gmail.com on 25 Mar 2013 at 11:05

GoogleCodeExporter commented 8 years ago
Probably could write an optimizer, but PropForth is written to start with a 
minimal Kernel and add what is needed.

The BootOptimizeKernel is effectively the minimum kernel. No error messages, 
wordlist, etc.

I frequently build kernels up from this once an app is stable. The one use most 
commonly is an eeprom read only file system kernel.

It is easy to produce the same using the SD file system. The SD file system is 
larger, if I remember correctly about 4k. I have versions of this from previous 
releases I use for data loggers.

If you think a minimal SD system is of value, let me know. Should only take a 
few hours to produce and verify.

The standard load and forget pattern is something the HTTP kernels use from SD, 
it is stable and works well. If multiple cogs are updating the dictionary some 
caution is required ie lockdict freedict to prevent unwanted side effects.

The only reason these were not released is the amount of documentation required.

Original comment by salsa...@gmail.com on 26 Mar 2013 at 5:41