Page 1 of 1

BIOS interrupt (IVT) map to IDT

Posted: Mon Feb 19, 2007 8:10 am
by maheshstms
Hello all,
I am in the phase of writing my kernel.
I have completed switching to protected mode, handling interrupts and initializing PIC for IRQ.

Problem:
I like to add graphics to my OS, I like to use BIOS interrupt 10h.
Since I have defined my IDT and so, unable to access any BIOS interrupt. I tried using the ISR location of int 10h, in my IDT but the selector location points to my GDT. How to solve this? What address should the selector point to in my Int 10h IDT. Will this method work??

Is there any other way of implementing graphics in a fine way like VESA?

awiting help

Mahesh

Posted: Mon Feb 19, 2007 8:55 am
by AJ
Hi,

IIRC, there are 2 main ways to use VESA in pmode:

1. Change display modes and get the VESA information you need before switching to pmode.
2. Implement v86 tasks in your kernel and do it that way (before you trash the real mode IVT!

If I understand what you are trying to do, no, you can't simply point your IDT entry at the corresponding entry in the IVT.

Cheers,
Adam

Posted: Mon Feb 19, 2007 9:16 am
by Dex
AJ is right, you can not do it the way you want, but as well as the way AJ suggested, you can also switch back to realmode from pmode, for mode switching.
Here is a demo i made, it swith to and from realmode to pmode and switch from vesa to text mode every 10 seconds.
http://www.dex4u.com/tuts/DemoVesa.zip

NOTE: I was called ASHLEY4, when i made this.

Posted: Tue Feb 20, 2007 12:37 am
by maheshstms
Thanks Dax and Aj
I was trying for this file!

The purpose of making the IDT 10h pointing to ISR of 10h was just to get the functionality working.

I will try it today and will let u know.

Posted: Wed Feb 21, 2007 5:04 am
by maheshstms
I have initialised VESA using
vbeset in the patched version of GRUB
from http://www.djm.co.za/spoon/grub/vbe.php :)

I have initialise 640x480 16bit color,
Can I now use lenior address.
I used the address to be (0xfffA0000) + (calculated address for x abd y)
:(

but I dont find any change in color. Should I choose any bank before using direct addressing. (In protected mode is bank switching required)

Mahesh

Posted: Wed Feb 21, 2007 10:36 am
by JAAman
640x480x4 doesnt use banking -- it uses planes instead (which is why most people dont like using it)

basically with planes you have 4 'planes', memory ocupies space extending 640*480/8 bytes
each bit in this field represents 1 pixel, each plane represents 1 color (1 bit of the 4bits per pixel)

when you write to the memory, what your doing is writing a mask for the currently active planes (you can have multiple planes active at once if you want)

this is a simple explanation, but i hope it helps

Posted: Mon Feb 26, 2007 4:21 am
by maheshstms
Ok, I have left using 640x480 (mode 0x111)
instead I have switched to the very basic 800x600 256 colors (mode 0x103)

My OS works this way,
1. GRUB loads first and initializes graphics for me as 800x600 256 colors
2. GRUB loads my kernel in ELF format
2.a My kernel moves to protected mode and Initializes IVT.
3. Now starts the graphics screen.

HOW DO I IMPLEMENT THE 3rd STEP???

I am using VMWare with VBE2.0

1. How do I initialize linear buffer
2. What is the physical address to write to for graphics to appear on my screen.

Thanks