Emulating special hardware in Bochs?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Marcus
Posts: 4
Joined: Wed Dec 21, 2011 10:23 am

Emulating special hardware in Bochs?

Post 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.
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Emulating special hardware in Bochs?

Post 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.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Emulating special hardware in Bochs?

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

Re: Emulating special hardware in Bochs?

Post 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.
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
Post Reply