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

Re: more newbie questions...



"David G. Andersen" wrote:
> > I'd be willing to have a go at it, but I've never actually
> > written anything that works with the OSKit.  What does porting
> > a driver to the OSKit involve ?
> 
>    Basically, you have to write glue code in two directions for it.
> The driver is going to expect a certain environment in which to
> execute.  This environment will include things like how to manage
> interrupts, get memory, access hardware, etc.  We call this the
> "osenv".  You need to write glue code that maps the driver's native
> calls (say, "kmalloc") into standard oskit calls like
> osenv_mem_alloc(...).  Then, you need to write glue code which turns
> standard osenv calls, like oskit_stream_read(...).
> 
>    Much of this is discussed in chapter 2, "Execution Environments."
> You can also look at the code in places like freebsd/net to see
> examples of glue code we've written.
> 
>    If you incorporate a driver from a source where we've already done
> some encapsulation, you'd likely have to write less glue code, *but*
> that depends on the assumptions made by the driver in question.  Some
> components, like the FreeBSD network stack, are relatively easy to
> encapsulate.  Others, like some of the disk device drivers which Kevin
> managed, took a great deal more work because they had some pretty firm
> assumptions about their interrupt environment/etc.

Well, I was more thinking of taking the actual hardware access code
and writing the actual OSKit code around that.  Unlike in linux,
VSTA drivers nicely separate hardware access code and application
communication code into separate source files.

>    For more information on this, you may want to dig up some of the
> papers we've published, or read through the docs extensively.  The
> list of Flux group papers can be found at:
> 
>   http://www.cs.utah.edu/projects/flux/

Okay, I will do that.
 
>   (look for some of Kevin and Bryan's papers about user-mode device
> drivers for an example of a hard encapsulation job. :-).
> 
>    If you haven't really used the oskit yet, then starting out porting
> the floppy driver could be an experience.  I'd get more familiar with
> the internal oskit osenv_* functions and the COM interfaces used by
> the oskit before jumping head-first, but that's just me.

Hmm, okay.  I haven't really used the OSKit, I do have some
experience with OS development without the OSKit though.
I'll have a go sometime when I have some free time (so don't
expect anything within a week or so :))

Ramon

References: