Page 1 of 1
Emulating special hardware in Bochs?
Posted: Tue Feb 14, 2012 5:25 pm
by Marcus
My friend brought up a very interesting question when talking to him about operating system development.
How do you change what hardware is emulated in Bochs?
For example, if you needed to test a special graphics card to make drivers for them, would you have to buy that graphics card, or could you just set Bochs to enable it?
I didn't know the answer so I figured I would ask here.
Re: Emulating special hardware in Bochs?
Posted: Wed Feb 15, 2012 1:59 am
by xenos
As far as I know Bochs can emulate only very few graphics cards. If you wanted to emulate a specific one, you'd have to write your own emulation for it and integrate it into the Bochs source code, which is probably as hard as (or even harder than) writing a driver for that graphics card.
Re: Emulating special hardware in Bochs?
Posted: Wed Feb 15, 2012 2:05 am
by Combuster
Bochs emulates a limited set of devices, and video hardware is lagging behind the most in that regard: it does the job and little more. Your practical choices include a VGA or a Cirrus Logic.
The developers don't have the time to write emulations of all devices out there, so you will have to write your own if you want it emulated. Since you don't know the hardware inside out this usually results in a different device than what you want so in practice you end up testing graphics on physical hardware only.
Re: Emulating special hardware in Bochs?
Posted: Wed Feb 15, 2012 3:01 am
by Jezze
The Bochs Graphic Adapter is a nice alternative I think. It is easy to write a driver for and it can be used with hi-res modes. The sad part is of course that it only exist in bochs/qemu and not as a real graphic device.
On a sidenote I'm working on a i915 driver. It has some documentation but it wasn't very friendly so I'm going through the linux implementation. As soon as I've managed to get it to switch modes I'll put it on the wiki.