[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] GlueSTiK and mem protection



Hi Ozk!

>  I have managed to get gluestik to work perfectly with memory-protection
> here on my machine. What I did was change the kmallocs that gets memory
> that user programs need to access with umalloc. And I had to run the
> "standalone" program from mint.cnf. I think this is because an XDD and all
> its text is regarded being part of the kernel, and thus users apps can not
> access functions in its text area, where the stik functions are. Anyway,
> now it works flawlessly here ;-)

Sorry, I do the same at the weekend :-).

I analyzed the existing gluestik and the design is completly wrong.

First, on all places you break memory protection because private kernel 
memory is allocated. Then the complete xdd is loaded in global(!) memory. 
The xdd is part of the kernel. After this you place a STiK cookie with 
some entry points to the xdd code (that's why these xdd must be loaded 
in global memory) in user accessible space.

The data flow looks horrible:

user program -> STiK cookie -> get direct entry points to kernel code -> 
jump to these functions in user mode content (the function looks like a 
normal function call) -> these functions made system calls to the kernel 
-> the gluestik.xdd only redirect all calls directly to the Sockets 
(through internal kernel calls).

DNS resolving is much more complicated. It's not possible to do this 
inside the device driver. That's why a seperate process must be running 
that is synchronized with Pmsg(). The Pmsg() calls are made in the kernel 
code that is called in user contents.

And at least there is an enourmous calling overhead. All parameters must 
be packed into a structure, call the device driver, the device driver 
unpack all parameters and call the target function and so on.

I see no reason for a device driver. The only thing that the device 
driver do is to redirect all calls to the sockets.

That's why I rewritten GlueSTiK completly at the weekend. GlueSTiK is now 
a normal TSR that is placed in global memory (but in user space!). The DNS 
resolver isn't needed anymore and it's much more compact.

I tested it internally on my Falcon with IRC and CAB. Also the testit.prg 
looks good.

Scott, what are the copyright conditions of GlueSTiK? I doesn't found 
anything in the readme about this. GNU? Public Domain?


Tschuess
   ...Frank

--
ATARI FALCON 040
--------------------------------------
Internet: fnaumann@cs.uni-magdeburg.de
Mausnet:  Frank Naumann @ L2