tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Early console attach vs PCI_NETBSD_CONFIGURE

Hash: SHA1


On Aug 1, 2009, at 4:10 PM, Gavan Fantom wrote:

I'm trying to find a good way to do early console attach on NetBSD/ iyonix with a genfb-based console.

NetBSD/macppc uses an early rasops-based console.

The graphics card is a NVidia GeForce2 MX which is supplied with the machine, and there are drivers in flash for RISC OS, which boots natively on the machine.

NetBSD reconfigures the PCI bus early on during boot, so the base addresses of the devices can and do move around from the way RISC OS chose to lay out the bus.

Why do you reconfigure the bus? Any chance to leave the graphics card alone?

The NetBSD bootloader passes enough information through about how RISC OS has configured the card that we can attach genfb to it.

Look at macppc for a graphical console that works long before autoconfiguration.

I'd like to attach the console early so that we can get early boot messages appearing on the screen, but the problem is that if I do that then the base address of the graphics card will move during autoconfiguration and genfb will be left writing kernel messages to memory which may not be backed by an actual framebuffer.

As I said - any way to avoid that? Otherwise you'd have to shut up the console during PCI reconfiguration and hand it the new fb address somehow.

I can't see an obvious hook where I can reattach genfb with the new address, and setup_memwins (in pci/pciconf.c) is peppered with calls to printf guarded by pci_conf_debug. Given that after changing the base address of the framebuffer and before reattaching the console a printf could be fatal, I don't think simply reattaching after pciconf has done its thing is enough.

When genfb at pci attaches the reconfiguration dance should be long done. You want something that works much earlier ;)

I'm reluctant to add a hook that will be called immediately after changing every single base address register, but that's the only way I can think of right now.

Is there a better way to do this?

If there is no output during PCI reconfiguration just add hooks right before and right after.
Why is it even necessary?

have fun

Version: GnuPG v1.4.7 (Darwin)


Home | Main Index | Thread Index | Old Index