[Coco] Environment Variables for NitrOS-9

Boisy Pitre boisy at boisypitre.com
Mon Dec 4 20:33:17 EST 2006


On Dec 4, 2006, at 7:36 AM, Jeff Teunissen wrote:


> Also, has anyone thought of using a per-user data module for  
> mocking up an
> environment space? Say, an 8K module named ENV<uid> that would be  
> read from a
> random or sequential file by the Shell (or LOGIN, on multi-user  
> systems) to
> hold shell variables like the PATH, Multi-Vue information, the  
> user's "home"
> directory, etc.
>

Some years back I made a proposal for environment variables under  
then-OS-9 (now NitrOS-9) but cannot seem to find that post.  My  
solution didn't use a data module but instead relied on the memory  
being allocated in the process' space at F$Fork time and accessible  
in such a way that it would pose no compatibility problems.

Now that I think about it, here's an implementation off the top of my  
head:  reserve two bytes in the process descriptor to be a pointer to  
a block of system RAM.  Also create a new system call: F$Env.  From  
this call, a SetEnv or GetEnv could be performed.

Upon the first call to F$Env for a process, a 256 byte page would be  
allocated from process' 64K memory space.  Some indexing scheme could  
be employed to hold the environment variable name and its contents in  
that page.  When that page is filled, a new one could be allocated.

The real work would be to develop an efficient (both in terms of  
space and time) way to manage the environment variables in those 256  
byte pages: SET, GET and DELETE operations would be need to be  
implemented.

It definitely is doable and can even be written to exist in a KrnP3  
kernel extension module.  Jeff, do you think this is something you  
would be interested in tackling?  I would definitely add something  
like this to the NitrOS-9 Project.


> -- 
> | Jeff Teunissen -=- Pres., Dusk To Dawn Computing -=- deek at  
> d2dc.net
> | GPG: 1024D/9840105A 7102 808A 7733 C2F3 097B 161B 9222 DAB8 9840  
> 105A
> | Core developer, The QuakeForge Project     http:// 
> www.quakeforge.net/
> | Specializing in Debian GNU/Linux           http://www.d2dc.net/ 
> ~deek/
>
> -- 
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>


--
Boisy G. Pitre
337.781.3570 mobile
email: boisy at boisypitre.com
Website: www.boisypitre.com

"If there is truth to the proposition that knowing the past helps us  
to understand the present, I believe there is at least as much truth  
to the proposition that what we know of the present is crucial to our  
understanding of the past.  What we have not ourselves experienced or  
observed we can at most only partially and imperfectly comprehend;  
and I suspect that there is much in history that is so remote from  
our own experiences or observations as to be largely beyond our  
understanding." - Kenneth M. Stamp






More information about the Coco mailing list