Page 1 of 1
Has anyone tried to port nouveau(opensource nvidia driver)?
Posted: Fri Sep 30, 2011 5:31 am
by cjxgm
VESA/VBE is too difficult to use in pmode, and they look not so formal. So, I need to write a video driver for my nv18 card. I just need to switch to graphics mode with high resolution, and i don't need hardware acceleration now.
I tried to look into nouveau's source code, but after searching a lot, I still didn't find where is the code that switches modes.
Could someone who has read nouveau's code tell me where can I find it or paste the key codes here?
By the way, is there any vm that emulates nvidia's video card?
Apology for my bad English.
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Fri Sep 30, 2011 5:55 am
by Combuster
VBE is an industry standard, and the corresponding document is quite complete. On the other hand, you won't find a VM that does an nvidia card so you really have to be ready to do things on actual hardware. The closest thing you can get is the Trio64 with hardware acceleration found in VirtualPC.
And searching ftw
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Mon Oct 03, 2011 10:37 pm
by blackoil
i have interests. cooperate?
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Tue Oct 04, 2011 12:05 am
by Love4Boobies
The better arguments against VBE are non-BIOS firmware (e.g., EFI, UEFI, OFW, etc.), lack of acceleration (well, VBE/AF does that but very few cards actually supported it in their ROM), and maybe long mode (because it takes extra work).
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Fri Jun 22, 2012 4:34 am
by cjxgm
First, I'm sorry I haven't reply till now. I was busy at school (you know, China's education system sucks) and now the summer holiday is coming so I have more time on the Internet. (In fact, I nearly forgot my post here...)
I know a lot of advantages of VBE, but it's really not so easy to use in non-real mode (whatever pmode or lmode).
I looked at the post
Combuster provided, but it still uses VBE to switch modes.
And
blackoil, I like to cooperate with you, and my OS's code base is here:
https://github.com/cjxgm/lanos
I'm not so good at documenting, and I used to believe a good line-break replaces comments, so there are few docs and comments. I'm sorry for that. And for the summer holiday doesn't start yet, I can now be online only at weekends.
Maybe an x86 emulator serves my need, but unless I understand the mechanism, I won't use it. (And I don't fully understand it yet.)
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Fri Jun 22, 2012 4:38 am
by Griwes
Just set the mode at the bootup, while you're still in real mode via VBE, or while you are still using boot services via (U)EFI, and tell the user to reboot the system to change resolution, while you don't have driver for his specific graphics card (= most of time).
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Fri Jun 22, 2012 5:06 am
by cjxgm
Griwes wrote:Just set the mode at the bootup, while you're still in real mode via VBE, or while you are still using boot services via (U)EFI, and tell the user to reboot the system to change resolution, while you don't have driver for his specific graphics card (= most of time).
My kernel was loaded by GRUB1, so I can not set mode before entering pmode.
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Fri Jun 22, 2012 7:28 am
by Griwes
http://forum.osdev.org/viewtopic.php?f=1&t=10488 - see Brendan's post. While this may be a little hacky, on my laptop GRUB sets video mode before showing its menu; I'm almost sure it's 1600x900 - highest resolution available on this particular laptop; thus, I think that GRUB is capable of using VBE modes, and with little searching in google, or asking on grub mailing list, you should find easy (or at least not hacky) way to use GRUB to set the mode.
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Fri Jun 22, 2012 8:26 am
by Combuster
The thing with linux driver sets is that they have several components to them - Parts of the driver may be in the kernel, parts of the driver are loaded into X, and the biggest pile of junk you'll find somewhere around libgl.so. Porting is always an option, but the design may be quite not what you want.
I do know a Nouveau developer personally, and he was confident that the dependencies on the driver architecture were small. The question remains how that relates to others subjective opinion - my personal experience with X drivers demands replicating a large part of the server architecture, which is not generally what you want.
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Tue Jul 03, 2012 12:24 am
by zity
This might be a little off topic, but handling VBE in pmode or long mode can easily be done by porting x86emu. This is probabaly not an ideal solution but it's easy and so far it works well in my OS. You will get all the usual 4:3 modes, but widescreen modes are not available.
Re: Has anyone tried to port nouveau(opensource nvidia drive
Posted: Tue Jul 03, 2012 1:55 am
by JamesM
cjxgm wrote:VESA/VBE is too difficult to use in pmode, and they look not so formal. So, I need to write a video driver for my nv18 card. I just need to switch to graphics mode with high resolution, and i don't need hardware acceleration now.
I tried to look into nouveau's source code, but after searching a lot, I still didn't find where is the code that switches modes.
Could someone who has read nouveau's code tell me where can I find it or paste the key codes here?
By the way, is there any vm that emulates nvidia's video card?
Apology for my bad English.
I've had a go, on Pedigree,
here. It supported bitblitting and fillrects on the pre-GPGPU architectures.
Beware, there be dragons. And magic numbers. Lots of magic numbers.