BootX enhancement request
Quoted 11 lines · Paul Mackerras
Yep. There are two problems at the moment, which I should get off my butt and fix. :-)
The first is that the current machines use a different structure for nvram, based on the CHRP spec, which means that just using a fixed offset in nvram doesn't work. In fact it seems like macos adds a OF property with a really strange encoding to store arbitrary bits of information for the device drivers for arbitrary devices.
The second is that macos is now using mode numbers > 20. I haven't worked out the correspondence yet.
MacOS no longer relies on the nvram setting. Video drivers are free to put whatever they want in their own device tree node, and usually store an nvram value for the mode there, but this is proprietary and depends on the driver. MacOS itself now stores the various infos in a preferences file. The old "Monitors" control panel still updates the old pram location with a mode value but the meaning is not guaranteed (can be driver specific).
Signature · 9 lines
Perso. e-mail: <mailto:[email protected]> Work e-mail: <mailto:[email protected]> BenH. Web : <http://calvaweb.calvacom.fr/bh40/> [[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]] [[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 2 lines · Paul Mackerras
The second is that macos is now using mode numbers > 20. I haven't worked out the correspondence yet.
MacOS no longer relies on the nvram setting. Video drivers are free to put whatever they want in their own device tree node, and usually store an nvram value for the mode there, but this is proprietary and depends on the driver. MacOS itself now stores the various infos in a preferences file. The old "Monitors" control panel still updates the old pram location with a mode value but the meaning is not guaranteed (can be driver specific).
Thus I can remove the nvram code from atyfb?
Greetings,
Geert
--
Geert Uytterhoeven [email protected]
Wavelets, Linux/{m68k~Amiga,PPC~CHRP} http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 1 line · Geert Uytterhoeven
Thus I can remove the nvram code from atyfb?
Depending on the version of MacOS, and if the user uses or not the old "Monitors" control panel, it may still be useful. On my PowerBook, I always had to set the resolution in the kernel command line, but I think that the vram stuff still works on my 8500 (controlfb).
I beleive the nvram code is useless on iMacs and blue G3s.
Signature · 10 lines
Perso. e-mail: <mailto:[email protected]> Work e-mail: <mailto:[email protected]> BenH. Web : <http://calvaweb.calvacom.fr/bh40/> --GAG19404.935596886/motgate.mot.com-- [[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]] [[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 1 line · Benjamin Herrenschmidt
MacOS no longer relies on the nvram setting. Video drivers are free to
That's not _entirely_ true. The hardware itself relies on the nvram setting in order to determine the initial startup mode before it starts loading MacOS. That's why you can do tricks with newer versions of MacOS like have the preferences set to 1024x768 and the pram/nvram set to 640x480 and have it switch half-way into booting. (Makes it nice for MkLinux on x100's where you have to be in 8-bit color, but don't want to run MacOS that way.) The Monitors & Sound CP does set the nvram value, at least on some machines, unless it changed quite recently, but you sometimes have to delete its prefs files to convince it to do so.
David
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 9 lines · David A. Gatwood
That's not _entirely_ true. The hardware itself relies on the nvram setting in order to determine the initial startup mode before it starts loading MacOS. That's why you can do tricks with newer versions of MacOS like have the preferences set to 1024x768 and the pram/nvram set to 640x480 and have it switch half-way into booting. (Makes it nice for MkLinux on x100's where you have to be in 8-bit color, but don't want to run MacOS that way.) The Monitors & Sound CP does set the nvram value, at least on some machines, unless it changed quite recently, but you sometimes have to delete its prefs files to convince it to do so.
Yes, you are right. But the fact remains that video drivers are free to store this in any proprietary format they want and I had some trouble getting this to work with iMacs and blue G3s. Also, this nvram setting is limited to those "official" mode values, but the driver is free to implement completely different modes, and there's also some support for DCC slowly appearing in MacOS. I don't think we can rely reliably on this nvram value.
What I could eventually do is to add code to BootX that asks the driver about the current mode (the driver should be able to return me all sorts of informations, including some, but not all, of the timings) and build a kernel command line with those. We should find something generic since I'm not sure I can easily find out which kind of driver to use on the command line (atyfb, platinumfb, controlfb, ...)
I have plans to extend BootX so that i can also setup OF environement variables for quik-based booting. It would be able to setup those infos there too. I'll look into this as soon as I have a new hard drive for my 8500 (the old one joined my pile of dead HDs last week, I'll soon be able to make some kind of modern art with all those HDs ;-).
Signature · 9 lines
Perso. e-mail: <mailto:[email protected]> Work e-mail: <mailto:[email protected]> BenH. Web : <http://calvaweb.calvacom.fr/bh40/> [[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]] [[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 1 line · Geert Uytterhoeven
Thus I can remove the nvram code from atyfb?
Well, what's there doesn't seem to be much use. OTOH, we really do need something to make it less likely that a newbie will be confronted by a blank screen because they forgot to put "video=atyfb:vmode:17" in their kernel command line. Maybe it should look at the registers and see if the chip is already running, and if so, just use whatever timings the chip is currently set to (as long as they look sane). Or maybe there needs to be some intelligence somewhere that looks at the `compatible' property on the device-tree root node and says "aha, an iMac, default to 1024x768@75Hz".
I see that there properties called "ATY,DefaultMode" and "ATY,DisplayMode" on the device-tree node for the ATI chip on my G3 desktop. They both have the value 30 (0x1e). I don't know what mode 30 is.
Paul.
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 4 lines · Paul Mackerras
Quoted 1 line · Geert Uytterhoeven
Thus I can remove the nvram code from atyfb?
Quoted 9 lines
Well, what's there doesn't seem to be much use. OTOH, we really do need something to make it less likely that a newbie will be confronted by a blank screen because they forgot to put "video=atyfb:vmode:17" in their kernel command line. Maybe it should look at the registers and see if the chip is already running, and if so, just use whatever timings the chip is currently set to (as long as they look sane). Or maybe there needs to be some intelligence somewhere that looks at the `compatible' property on the device-tree root node and says "aha, an iMac, default to 1024x768@75Hz".
The default video mode should be chosen depending on the machine type.
Quoted 4 lines
I see that there properties called "ATY,DefaultMode" and "ATY,DisplayMode" on the device-tree node for the ATI chip on my G3 desktop. They both have the value 30 (
0x1e). I don't know what mode 30 is.
Look at the OF `words' of that node. There should be a function to get the supported video mode list.
Greetings,
Geert
--
Geert Uytterhoeven [email protected]
Wavelets, Linux/{m68k~Amiga,PPC~CHRP} http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Well the whole point of this was to get around having to boot into MacOS, set resolution, call bootX, boot single user, Xautoconfig, init 5, just to change your resolution.
Solaris2.7 has that nice m64config command that lets you set your resolution and color depth on the command line, then you kill and restart X and it takes effect.
It would be really cool if linuxppc had something like that.
Does it?
-b
Quoted 28 lines · Benjamin Herrenschmidt
Quoted 9 lines · David A. Gatwood
That's not _entirely_ true. The hardware itself relies on the nvram setting in order to determine the initial startup mode before it starts loading MacOS. That's why you can do tricks with newer versions of MacOS like have the preferences set to 1024x768 and the pram/nvram set to 640x480 and have it switch half-way into booting. (Makes it nice for MkLinux on x100's where you have to be in 8-bit color, but don't want to run MacOS that way.) The Monitors & Sound CP does set the nvram value, at least on some machines, unless it changed quite recently, but you sometimes have to delete its prefs files to convince it to do so.
Yes, you are right. But the fact remains that video drivers are free to store this in any proprietary format they want and I had some trouble getting this to work with iMacs and blue G3s. Also, this nvram setting is limited to those "official" mode values, but the driver is free to implement completely different modes, and there's also some support for DCC slowly appearing in MacOS. I don't think we can rely reliably on this nvram value.
What I could eventually do is to add code to BootX that asks the driver about the current mode (the driver should be able to return me all sorts of informations, including some, but not all, of the timings) and build a kernel command line with those. We should find something generic since I'm not sure I can easily find out which kind of driver to use on the command line (atyfb, platinumfb, controlfb, ...)
Quoted 12 lines
I have plans to extend BootX so that i can also setup OF environement variables for quik-based booting. It would be able to setup those infos there too. I'll look into this as soon as I have a new hard drive for my 8500 (the old one joined my pile of dead HDs last week, I'll soon be able to make some kind of modern art with all those HDs ;-).
Signature · 3 lines
Perso. e-mail: <mailto:[email protected]> Work e-mail: <mailto:[email protected]> BenH. Web : <http://calvaweb.calvacom.fr/bh40/>
--
AOL SAPI 703.265.0908 AIM:jackal242
http://jackal.fudge.org `I was never more certain of how far away I was
from my goal than when I was standing right beside it.' - Ethan Hawke, Gattaca
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 14 lines · Geert Uytterhoeven
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 2 lines · Paul Mackerras
The second is that macos is now using mode numbers > 20. I haven't worked out the correspondence yet.
MacOS no longer relies on the nvram setting. Video drivers are free to put whatever they want in their own device tree node, and usually store an nvram value for the mode there, but this is proprietary and depends on the driver. MacOS itself now stores the various infos in a preferences file. The old "Monitors" control panel still updates the old pram location with a mode value but the meaning is not guaranteed (can be driver specific).
Quoted 1 line
Thus I can remove the nvram code from atyfb?
Why? It works fine on lots of older machines w/ ati cards and older MacOS versions. If you remove it I can garrenty people will notice and complain.
---
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 5 lines · Tom Rini
Quoted 1 line
Thus I can remove the nvram code from atyfb?
Why? It works fine on lots of older machines w/ ati cards and older MacOS versions. If you remove it I can garrenty people will notice and complain.
We should get rid of it for atyfb once we have DDC working. According to Apple, all machines with ATI controllers are using DDC now. The nvram setting would still be useful for the older video controllers.
Signature · 8 lines
Perso. e-mail: <mailto:[email protected]> Work e-mail: <mailto:[email protected]> BenH. Web : <http://calvaweb.calvacom.fr/bh40/> [[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]] [[ and http://www.linuxppc.org/ for useful information before posting. ]]
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 5 lines · Tom Rini
Quoted 1 line
Thus I can remove the nvram code from atyfb?
Why? It works fine on lots of older machines w/ ati cards and older MacOS versions. If you remove it I can garrenty people will notice and complain.
We should get rid of it for atyfb once we have DDC working. According to Apple, all machines with ATI controllers are using DDC now. The nvram setting would still be useful for the older video controllers.
The NVRAM code should be separated from atyfb, so it can be used by all Mac drivers.
Greetings,
Geert
--
Geert Uytterhoeven [email protected]
Wavelets, Linux/{m68k~Amiga,PPC~CHRP} http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]