Page 1 of 1
Interrupt 10 -- right value to pass to Ah register
Posted: Wed Feb 01, 2006 11:30 pm
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.
Re:Interrupt 10 -- right value to pass to Ah register
Posted: Wed Feb 01, 2006 11:50 pm
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.
Re:Interrupt 10 -- right value to pass to Ah register
Posted: Thu Feb 02, 2006 12:15 am
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.
Re:Interrupt 10 -- right value to pass to Ah register
Posted: Thu Feb 02, 2006 1:00 am
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.
Re:Interrupt 10 -- right value to pass to Ah register
Posted: Thu Feb 02, 2006 1:14 am
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.
Re:Interrupt 10 -- right value to pass to Ah register
Posted: Tue Feb 07, 2006 3:09 am
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.
Re:Interrupt 10 -- right value to pass to Ah register
Posted: Tue Feb 07, 2006 3:29 am
by bubach
Re:Interrupt 10 -- right value to pass to Ah register
Posted: Wed Feb 08, 2006 9:25 pm
by vishal.soni
Thank you. I would check this.