BIOS interrupt (IVT) map to IDT

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
maheshstms
Posts: 5
Joined: Mon Jan 22, 2007 3:44 am
Location: Chennai, India
Contact:

BIOS interrupt (IVT) map to IDT

Post 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
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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.
maheshstms
Posts: 5
Joined: Mon Jan 22, 2007 3:44 am
Location: Chennai, India
Contact:

Post 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.
maheshstms
Posts: 5
Joined: Mon Jan 22, 2007 3:44 am
Location: Chennai, India
Contact:

Post 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
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post 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
maheshstms
Posts: 5
Joined: Mon Jan 22, 2007 3:44 am
Location: Chennai, India
Contact:

Post 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
Post Reply