Subject: Re: OpenFirmware questions
To: Emmanuel Dreyfus <p99dreyf@criens.u-psud.fr>
From: gabriel rosenkoetter <gr@eclipsed.net>
List: port-macppc
Date: 01/28/2001 12:05:34
On Sun, Jan 28, 2001 at 12:21:09PM +0100, Emmanuel Dreyfus wrote:
> There are a few features today missing to NetBSD/macppc that makes it a
> bit desktop unfriendly:

Well, most versions of OpenFirmware are desktop unfriendly, and
there's some hideous code in MacOS to hide that from the user.

> The FAQ tells that screen resolution can be changed in OF. Anybody know
> how?

I'm nowhere near an OF console right now, but as I recall it's
something that shows up with a dev / ls.

I'm actually pulling a 1.4R machine up to 1.5 later today (and
losing my 146-day uptime just short of 150 days... ::sigh::), so
I'll double check.

Which leads me to my next point: some versions of OF only support
certain (extremely low, as in 640x480 at 60 Hz) resolutions, and
various different framebuffers have been used over the years (not
meshing exactly with updates of OF) which want thing handled
different ways.

> As I understood, if we know how to change it from the OF console,
> then we know how to change it from inside the kernel, with the OF client
> interface. Is that right?

Um, yeah, if it's compiled in. (It's a lot of code, I seldom
include it... NetBSD kernels are bloated enough as it is.)
I think it would be a bad idea to force people to include
"macofcons0 ..." in their kernel config just to get something so
basic as resolution changes (and you could whack off the resolution
bits as a separate hunk of code, which logically belongs in the ofb
code, to my mind).

> If this is right, I assume I would able to change the resolution from
> kernel code. The goal is having it working from user code.

Yeah, but it's easy to export a knob for user land to turn.

> How does this works on i386? Is there any standard ioctl to
> control screen resolution?

I don't know the exact details, but that sounds pretty reasonable.
This shouldn't be hard to find (it'll be in src/sys/dev somewhere).

> Now, for power management: I beleive it works in the same way. Anyone
> knows an OF command to put a powerbook to sleep? Is there any special
> issue we should handle for the sleep/wake-up operations?

No clue on powerbooks, but I have a sinking suspicion that this
isn't done through OF, but by twiddling some hardware in a
proprietary Apple way.

       ~ g r @ eclipsed.net