Subject: Re: old hpbsd sources
To: None <port-hp300@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-hp300
Date: 03/17/1997 11:42:39
> The errors in cfb seem to me rather strange:

>  In file included from cfbrrop.c:36:
>  cfbmskbits.h:132: division by zero in #if

>  but in cfbmskbits.h
>  130: /*  set PWSH = log2(PPW) using brute force */
>  131:
>  132: #if PPW == 1       !! what can here produce a division by zero?
>  133: #define PWSH 0

I imagine PPW is something like


and BITS_PER_PIXEL is zero.  Remeber, a #define is (loosely speaking) a
textual replacement; "#define A (B/C)" does not perform the division
until A is used in a context where it has to be the
#if that's puzzling you.

> Maybe someone of the hp300 group can evaluate if I can come closer to
> a XhpBSD server for the hp300 with this kind of behaviour.


> Yea, the server has to be rewritten, but where to start?
> What can be integrated from the old server?
> What has to be replaced?
> A dirty server should be possible quite quick, but how?

If I were handed this job, I would proceed as follows:

- Figure out how to memory-map the framebuffer.
- Figure out how to turn keystrokes and mouse events into something
   comprehensible.  This probably means stealing chunks of code from
   elsewhere, such as the kernel keyboard handler.
- Take a Sun server (sparc or sun3, not much difference).  (Why Sun?
   Simply because that's the one I know best, so it would be the
   easiest one for me to figure out what each piece of the code does.)
   Clone it into a new ddx tree.  Rip out all the hardware interface
   stuff and shove in code from the first two steps.
- Debug. :-)

That's basically what I did, years ago, when I ported X11R4 to the
NeXT.  In the HP case, based on conversations with people who ought to
know, the second step is probably the part I would find the hardest.

In particular, I wouldn't start step 3 until steps 1 and 2 have been
completed.  If you're lucky, you may be able to get a leg up with steps
1 and 2 from the old Xhpbsd code.

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B