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

Re: OSKit directory structure




>         I am slightly confused about the OSkit COM directory structure. 

Assuming you mean the "registry"...  (First time I read your message,
I thought you meant the file-structure of the tarfile.)

> As I understand it, there is one global directory which (only?) stores the 
> global memory object ? 

grepping for oskit_register, I find the following calls:
  
  $ r grep oskit_register
  oskit/boot/net/main.c:  oskit_register(&oskit_osenv_iid, (void *) osenv);
  oskit/clientos/clientos.c:      oskit_register(&oskit_mem_iid, (void *) memi);
  oskit/clientos/clientos.c:      oskit_register(&oskit_libcenv_iid, (void *) libcenv);
  oskit/examples/x86/socket_com.c:        oskit_register(&oskit_osenv_iid, (void *) osenv);
  oskit/startup/start_clock.c:    if (oskit_register(&oskit_clock_iid, (void *) clock))
  oskit/startup/start_conf_network.c:     oskit_register(&oskit_socket_factory_iid, (void *) fsc);
  oskit/startup/start_network_native.c:   oskit_register(&oskit_socket_factory_iid, (void *) fsc);
  oskit/startup/start_osenv.c:    oskit_register(&oskit_osenv_iid, (void *) osenv);
  oskit/threads/osenv_safe.c:     return oskit_register(&osenv_safe_iid, (void *) &safeinterfaces);
  oskit/threads/osenv_safe_socket_factory.c:      if (oskit_register(&oskit_socket_factory_iid,
  oskit/threads/pthread_comlock.c:        return oskit_register(&oskit_lock_mgr_iid, (void *) &lock_mgr);
  oskit/cpu/c/services_init.c:        rc = oskit_register(&oskit_mem_iid,(void*)oskit_mem_object);
  
So it looks like the global registry can contain the osenv registry, a
memory object, the libcenv object, the clock (also available via osenv
I think), socket factories, thread-safe stuff (filesystems and socket
factories I think - but check the code) and lock managers (more
thread-safety stuff).  (Which of these it actually contains depends on
which initialisers you call of course.)

> Then there is an osenv directory which stores the interfaces of the
> all the glue "services" code. Then there is a devices directory
> which stores the devices and then there is another directory which
> stores all the device driver references ?

Sounds about right.

> Second, how are these directories linked, if at all ? 

There's all the entries listed above plus the osenv object contains
(oskit/dev/osenv.c):

	log
	intr
	sleep
	irq
	pci_config
	isa
	mem
	driver  <- also registries
	device  <- also registries
	ioport
	timer
	rtc

Which is pretty much all the osenv-related functions.

And the libcenv object contains (oskit/clientos/libcenv.c):

	oskit_fsnamespace_t	*fsn;
	char			hostname[256];
	oskit_ttystream_t	*console;
	void			(*exit)(int);
	void			(*siginit)(int (*func)(int, int, void *));
  #ifndef PTHREADS
	/*
	 * This stuff for sleep/wakeup support in single threaded mode.
	 * Must request these interfaces dynamically to avoid linktime
	 * dependencies.
	 */
	oskit_timer_t		*sleep_timer;
	oskit_osenv_sleep_t	*sleep_iface;
	osenv_sleeprec_t	*sleeprec;
  #endif	

(Note: this is not organised as a regsitry - I list it because it
serves a similar function.) 

That is:

a filesystem namespace, the hostname, a console, an exit function, a
signal handler and some stuff for implementing the select system call.

> The device driver lookup starts at the device driver registry
> instead of starting its search from the global registry and first
> finding the device driver registry and then the device driver, hence
> they are not linked together ?

They are linked but we don't always use the links.

There's a range of opinions here at Utah as to whether the global
registry approach is capable of achieving its goals and whether the
costs of the registry approach are acceptable.  Hence, there's a range
of coding styles ranging from never using the registry, through using
preprocessor tricks to use the registry or not use it through using it
at every available opportunity.

Hope this is of some help.

Alastair Reid

Follow-Ups: References: