Subject: Re: ofb console problem and some questions
To: Christian Groessler <cpg@aladdin.de>
From: Michael Lorenz <macallan@netbsd.org>
List: port-macppc
Date: 12/05/2006 15:56:45
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Dec 5, 2006, at 15:26, Christian Groessler wrote:

> I recently upgraded my beige G3 (open firmware 2.4) to -current.
>
> The console doesn't work anymore, it only displays half a line (the
> upper parts of the characters) at the bottom of the display.
>
> The following change fixes this and the console works as before:
>
> -------------------
> RCS file:
> /net/swamp/zeug/netbsd-rsync/main/src/sys/arch/macppc/dev/ofb_cons.c,v
> retrieving revision 1.1
> diff -u -p -r1.1 ofb_cons.c
> --- ofb_cons.c  8 Nov 2006 01:25:10 -0000       1.1
> +++ ofb_cons.c  5 Dec 2006 18:33:55 -0000
> @@ -101,6 +101,7 @@ ofb_cnattach()
>
>         /* get current cursor position */
>         OF_interpret("line#", 1, &crow);
> +       if (crow) crow--;
>
>         /* move (rom monitor) cursor to the lowest line - 1 */
>         OF_interpret("#lines 2 - to line#", 0);
> -------------------
>
> I did this change from some guts feeling that crow might not return
> the current position as written in the comment, but the total number
> of lines. (Which thinking about it now doesn't really make sense,
> given the different character heights of the ofb console and the
> NetBSD console fonts.)

Much of the code is cargo cult anyway, I just didn't get around to do a 
real cleanup yet.
When running in less than 1024x768 ofb will steal the font from OF, in 
an attempt to somehow emulate its look. Maybe that should be made the 
default and - maybe - overridden when a driver attaches later on.

> Now the questions:
>
> - can I somehow run this "line#" command from the ofb console to see
>   what it returns?

Just type it in on the OF prompt, then '.' will show what it left on 
the stack.

> - can I read the variables of a running kernel? I wrote the crow
>   value into a global kernel variable to get its value. Then I tried
>   to crash the kernel to get a kernel dump. This didn't work (no
>   kernel dump), probably because my swap space is a bit smaller than
>   the machine's memory. How would I read the variables of a live
>   kernel, given that I have a netbsd.gdb file with all the symbols?

just add printf()s, they'll end up as kernel output.

have fun
Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iQEVAwUBRXXdDcpnzkX8Yg2nAQKtiwf+KaVoVrH54xf2sIrnixlVb/aOjMXEq8Zg
QLyeTh7xkrsKE8TmN94rMfR3HB3qP8VNV0EMTBbSPTAArR7dKPEsqqf8FMSZkC9A
m8wjrKiDGLKVi78E8D6gK1qpzAMUIig5ICglj2q5QQeLbSyDJRaC1ASENkZDkVJ9
FgPKM5ETukfOCRj4MjYwLzRWl19F35nmnU+qphZoDy2J8Y2qgdqmWFLOENc/PMpu
YPxIbXZJPKJlpnMufHBo3fEdSv+kAfDSJhvtOWuXc2yUu6xflFDCaGTq4Je8wPsp
WEbp2QzyHNYoGSz6D5nk6O9Pv7SUw8k6YVfZOAS3rM9zuvp42yNl1Q==
=T0CJ
-----END PGP SIGNATURE-----