Index: [thread] [date] [subject] [author]
  From: Emmanuel Marty <core@suntech.fr>
  To  : ggi-develop@eskimo.com
  Date: Mon, 06 Jul 1998 21:16:03 +0000

Re: here we go...

Hi Frank !

> Ok guys, if you're into this, so am I.  I'm gonna start by trying
> to port KGI to Roadrunner.

Great ! I've been following Roadrunner development as a spectator
for a while now (discovered it at the incredibly exhaustive listing
of OSes by Fare Rideau at http://www.tunes.org) and I'm glad
we can take part in it somehow.

>  So, what do I do first? :/  First off, I'm
> using the 1.0 release of degas.  I think I will go from something stable
> to start off with.

Well, I think you should have a look at Jon M. Taylor's kgicon wrapper,
which will make the KGI drivers work on the stock 2.1.x Linux kernel
(since Linus finally included the abstract consoles in it). Basically,
it's what you need to write : the "encapsulation" code for drivers,
which provides them with services such as memory allocation,
PCI lookup, etc. And translates the calls of the OS into calls
into the drivers. Of course kgicon is very linux-specific, but from
what I saw of it it's quite cleanly programmed and rather easy to
follow, so you should find your way in it and understand the
concepts you need to write the same thing for Roadrunner ..

> I'm looking at kgi/driver and the configure script.  Not quite sure
> what it does and I'm running BSD so of course it doesn't work.  When
> I run it I get the following output to stderr:
>
> type: not found
> dialog: not found
> cat: /tmp/ggiset: No such file or directory

I guess Dialog is linux-specific.. :) It's some inane ncurses program
to display pretty textmode dialog boxes, etc. GGI uses it for the
user to select which chipset, ramdac, etc. it has.

You don't really need to do make config anyway, you just need to
write a .config file in the root of the drivers tree (kgi/driver) like the
following example :

MON_CLASS=monosync
MON_TYPE=svga

CHIP_CLASS=IBM
CHIP_TYPE=vga

CLK_CLASS=fixed
CLK_TYPE=vga

DAC_CLASS=IBM
DAC_TYPE=vga

KERNEL_CLASS=Linux
KERNEL_TYPE=i386

(I'm typing that from the top of my head so there may be some typo.. :)

> What exactly is this script doing and can I change the script somehow to
> make it work under BSD?

You need to write some script that generates the kind of file above ; or
you can generate .config by hand and work with it until you have a
working port; you should be set for a little while.. :)

> It looks like I need to somehow build things that are in various
> subdirectories, ramdac, chipset, graphic, clock, kernel, and monitor.
> Now, it looks like I need to do this configure thing before I try any
> of these.

Yup.. once you did the .config, it's easier )

Note that you should use the Dali drivers with kgicon small changes
(see Jon's earlier post) with kgicon as a basis of work, not EvStack,
as the drivers are going kgicon's way.. If you want to stay up to
date with their development .. :)

> One thing I do know, when I finally come down to compiling the various
> C and assembly files, I will need to use my own set of header files.
> This will probably require some #ifdef'ing around the Linux header files.
> This is probably something that will be a general problem for different
> OS ports.  So I thought I would do something like this:
>
> #define __Roadrunner__ in a Makefile or config file somewhere, you tell
> me where is best I guess.  Then:
>
> #ifdef __Roadrunner__
>
>     /* ... Roadrunner header files here ... */
>
> #else
>
>     /* ... Linux header files here ... */
>
> #endif
>
> or some variant of this, will have to be added to all the source files.

No, actually we aren't THAT dirty :) You just need to edit
include/kgi/system.h
and do what you described above there, but only once. The KGI drivers
only use functions defined there, so you just need to write them for
Roadrunner and you're set. A small glitch though, the drivers use the linux
pci lookup functions as somehow noone bothered to wrap them in system.h
ever for some reason; you'll have to change that, but it's rather
straightforward :)

The best bet is to write, in that order, the relevant defines in kgi/system.h,
then
a "kernel driver" (like the linux/i386.c one) like roadrunner/i386.c or so :),
then
finally code in your kernel that encapsulates the KGI drivers, like kgicon
does. That's not a huge, huge amount of work actually, just a few functions
to write, then to get the KGI drivers to conform to your graphics API. It's
not that you'll be done within a day, but if you wrote most of an operating
system, you won't be bothered by that :)

> So, you asked for new OS's, I got one.  Let's roll up our sleeves and
> hopefully you won't all hate me before it done with...

Nah, more likely you'll hate us and our strange structures and calls.. :)
You're welcome to ask as much information as you need.. I guess I'll have to
try RoadRunner sometime soon..

--
Emmanuel

Index: [thread] [date] [subject] [author]