Interrupt 10 -- right value to pass to Ah register

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
vishal.soni

Interrupt 10 -- right value to pass to Ah register

Post by vishal.soni »

i need to understand BIOS Function Calls specifically INT 10H BIOS inetrrupt. I was debugging linux kernel using kgdb to understand how the video is displayed.

I am actually looking for the control word register's address of video card.
so i generated INT 10H (wrote a small kernel module) expecting that there would be some change at the control word register(cwr), address 0xfc400000+offset(of cwr), when interrupt 10H is used but i don't see any change, where 0xfc400000 is base address of video card.

What i need to know is...... Does INT 10h changes/access the control word register's data and what is the right way to do the same.

like i am doing
asm("mov $13h, %AX");
asm("INT 10h);

Your help would be highly appreciated.
Phugoid

Re:Interrupt 10 -- right value to pass to Ah register

Post by Phugoid »

Well, the Linux you were using almost certainly runs in protected mode. You are calling a real mode interrupt handler, which has probably been replaced with an appropriate exception handler by Linux. Therefore, what you are doing is totally wrong. I don't know how to solve your problem, but I can say that the handler for interrupt 10h has nothing to do with it.
vishal.soni

Re:Interrupt 10 -- right value to pass to Ah register

Post by vishal.soni »

Thank you. You are very right.

Do we have any document which tells all about interrupt 10h.

Actually what i got to do is to get the address of the control work register (CWR) of the video card.

I do have the offset of CWR from base addrees of Intel AGP card and different video card vendors have different offsets for the control word register.

So what i wish to do with INT 10h is..........
generate the interrupt and see (by debugger) if there is any change @ CWR address.
Thank you.
vishal.soni

Re:Interrupt 10 -- right value to pass to Ah register

Post by vishal.soni »

And is it possible v.iz. there is some way or x86 instruction to switch from protected mode to real mode, generate interrupt 10, and then switch back to protected mode.
Rob

Re:Interrupt 10 -- right value to pass to Ah register

Post by Rob »

Ralf Brown's interrupt list for INT 10h

There are (old) books on programming the (S)VGA card that both describe the BIOS INT 10h interface as well as how to program the cards directly. However, that latter method only supports VGA (ie, 640 x 480 in 16 colors, 320 x 240 in 256 colors, etc.).

All the advanced stuff is specific to each card brand and model, that's why the likes of nVidia or ATI have custom drivers to make it all work.

You may be able to find some specific books as well (card manufacturers used to publish those as well), like for the S3 ViRGE that contain how to control specific cards like that.

In the end for your own OS you either have to let the BIOS do the work (switching back to realmode for the BIOS calls), only support the standard VGA stuff, or be compatible with something like Linux / Windows and be able to load their drivers.

I can tell you that programming the VGA chipsets (and I'm talking the old simple 2D cards here) involves a complex set of register changes to control the cards timings and refresh rates and whatnot. It's not something you can "debug" and understand. You really need some good books, but I'm not sure how useful that still is in this day and age.

Most people however usually don't get far enough with their Operating System to get into (graphic) video drivers.
vishal.soni

Re:Interrupt 10 -- right value to pass to Ah register

Post by vishal.soni »

But the question still remains unanswered :(
Could anyone please brief me the steps or the sample code or any pointers to switch from protected mode to real mode v.i.z how do we save processor context followed by using vm86() to switch to real mode and then generate INT10h.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Interrupt 10 -- right value to pass to Ah register

Post by bubach »

Seen this?
http://my.execpc.com/CE/AC/geezer/osd/g ... /index.htm

For a real switch back to real mode:
http://free.pages.at/cosmo86/bubach/pm1.nasm

maybe that helps?
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
vishal.soni

Re:Interrupt 10 -- right value to pass to Ah register

Post by vishal.soni »

Thank you. I would check this.
Post Reply