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

Re: xwindow in oskit




I wrote:
> The console wrappers are pretty simple:
> 
>   oskit/kern/x86/pc/{gdb,direct}_console.c
> 
> All these do is wrap a COM layer around some plain old C code.

I just made them even simpler by factoring them into two parts:
1) A bunch of COM wrapper functions (COM_foo*)
   These are the same for any implementation of a given set of
   interfaces and are contained in a header file to be #included into
   the other part.
2) A bunch of worker functions (foo*) which do the actual work.

The code isn't that much shorter - the gain is that the normal C
hacker doesn't have to get bogged down in COMification and gets to
share some of the more mind-numbing bits of code.

The code is in 

  http://www2.cs.utah.edu/~reid/berlin19990817.tgz

Let me know if you find this useful and I'll do some more of these COM
wrappers (suggestions for which ones to do welcome).

Alastair

ps I haven't actually tested this code (I'm working remotely at the
moment) but I did diff the generated assembly code and it looks the
same modulo renamings and the way the gdb and com versions access the
per-stream state in read/write (a few instructions more but they're
outside the main loop).

pps Thanks for the offer to write a floppy driver.  Contributions are
very welcome and we certainly don't want the oskit to be a utah-only
thing.

Follow-Ups: References: