kernel upcall documentation

Konstantinos Boukis konstantinos.boukis at kcl.ac.uk
Fri Oct 21 09:28:14 PDT 2005


Well, to be honest I managed to bypass the NULL fd_cdir problem by assigning a
temporary valid filedesc to curthread->td_proc->p_fd just before the invocation
to linker_load_module.
However I am curious to see the upcall solution as well. When I read that:
"When a thread blocks in the kernel, the (virtual) cpu is reallocated to
another newly created context (thread) and it is allowed to proceed back
to userland and runs a known routine with a known pointer as its
argument." (from
http://lists.freebsd.org/pipermail/freebsd-threads/2003-July/001018.html)
I understood that when a kernel thread blocks it makes an upcall to userland and
it calls the ku_func function. When ku_func accomplishes its operation then the
kernel thread is resumed so as to comply with the upcall definition of clark's
"The structuring of systems using upcalls" and Kohler's "the click modular
router". So, have I got it right or I am missing something?

Quoting Daniel Eischen <deischen at freebsd.org>:

> On Fri, 21 Oct 2005, Daniel Eischen wrote:
> 
> > On Fri, 21 Oct 2005, Konstantinos Boukis wrote:
> >
> > > Hello,
> > > I am not quite sure whether this is the correct list, my problem is that
> I want
> > > to send an upcall from the kernel to userland to load a module (kernel
> threads
> > > cannot call linker_load_module since they do not have a  valid fd_cdir).
> Is
> > > there any document describing how to make an upcall from the kernel to
> > > userland?
> >
> > This is not how you want to do it.  Do it the old fashioned
> > way, with a read() or ioctl() from userland that blocks until
> > the kernel is ready to have the module loaded.
> 
> Or find some other way to do it within the kernel...
> 
> -- 
> DE
> 
> 


-- 
Konstantinos Boukis
konstantinos.boukis at kcl.ac.uk
 



More information about the freebsd-threads mailing list