How to execute an SWI to put display into graphics mode


QNX 6.x and I can’t use Photon…

I need to put my monochrome display into 640X480 monochrome graphics mode. It’s a PC 104 system so I should be able to invoke BIOS services by executing SWI 0x10 with an appropriate value in AX and do it that way, correct? If anyone has some example code I’d really love to see it. I can’t even get the code snippets in the online help to compile, probably because I’m not using any photon libraries?

I just found _intr_v86() … could that be the right way to go about this?

I’ve done it with previously this hardware and Borland C in DOS, but that was a different memory model and I was dealing directly with the BIOS.

After I get it into graphics mode my strategy is to map video RAM into my address space and write a few primitives to twiddle the pixels. I’m not drawing anything complicated, just lines and circles. Or are those functions already available?



I don’t beleive you can call BIOS services that way. However I beleive you can use graphics driver primitive to draw stuff and switch mode (at least use the mode switcher)

Great! What is the mode switcher and where are the graphics driver primitives?

From QNX 6.2.x look in /usr/src/ddk-6.2.1/graphics/src/utils/s/setmode
and /usr/src/ddk-6.2.1/graphics/src/services/graphics/tests/bench

QNX 6.3.x doesn’t seem to have these examples.

These programs directly load the graphics driver instead of using Photon. In fact you can’t have both controlling the same display at the same time.

Also, have a read of the section “Writing a Graphics Driver” in the DDK docs so you will have an understanding of what you are talking to.