Setting up interrupts in pmode

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
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Setting up interrupts in pmode

Post by Troy Martin »

I know about the IDT and the IDT register pointing to it, but can I poke in an address to where the jump vector of interrupt 50 is?

OK, let me explain this better: I want to set up a protected mode handler for int 50h, which will be the TBOS2 syscall interrupt similar to DOS' int 21h. How can I do this?
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Setting up interrupts in pmode

Post by neon »

Just install your int handler into the correct location within your IDT...thats about it.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
geppy
Member
Member
Posts: 27
Joined: Wed Jun 11, 2008 5:30 pm

Re: Setting up interrupts in pmode

Post by geppy »

You do it same way as you already installed #GP,PF,DF,SS,TS and other exceptions which involes writing writing handler address into the correct(number 50?) entry of the pmode IDT and extending the IDT limit (in idtr) if necessary.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Setting up interrupts in pmode

Post by AJ »

Hi,

One thing - just remember to increase the limit portion of IDTR appropriately, otherwise you'll wonder why you're getting a read beyond the IDT limits.

Cheers,
Adam
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Setting up interrupts in pmode

Post by Troy Martin »

G'morning...

Well that sounds easy enough. I'll get to work on that when I need to throw it in.

Thanks!
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Post Reply