[K42-discussion] Linux Dynamic Upgrade

Andrew Baumann andrewb at cse.unsw.edu.au
Wed Oct 25 08:27:15 EST 2006


Hi,

On Wednesday 25 October 2006 04:44, Will Schmidt wrote:
> A question here on the 'specific instance of a module' reference..  for
> K42, do you actually have a module instance for every user of (or
> reference to?) the module?

No, one module can have multiple references and callers. What I meant was, as 
in Linux you have separate instances of the module for separate 
resources/hardware. For example, if you have two ext2 filesystems mounted, 
there will be two sets of all the data structures like superblock etc., and 
you could use different functions and different implementation of the module 
for the different instances.

In K42 it's a bit easier because those "module instances" are separate C++ 
objects with virtual functions, but in Linux I think you can do it too. The 
functions for a filesystem are accessed through the tables of function 
pointers like struct {super,file,inode}_operations. Every filesystem 
superblock has a pointer to its super_operations table. Normally that points 
to a static structure like ext2_sops which is the same for all ext2 
filesystems, but by changing that pointer you can control which functions are 
used on a per-filesystem rather than per-module basis.

I hope that helps explain what I was thinking,
Andrew



More information about the K42-discussion mailing list