OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 1:06 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: IDT help
PostPosted: Sat Feb 22, 2003 4:15 am 
hi i started working on OS dev about 3 months ago and worked on it for about one and half month .. i got the boot loader working a a simple kernel with P mode enabled after that i tried to make my IDT which really got me in trouble .. i posted many messages but couldnt managed to make IDT ..
so here i m again asking for help
i want to make a simple IDT in C .. may be some one could help me
thanx


Top
  
 
 Post subject: Re:IDT help
PostPosted: Sat Feb 22, 2003 5:30 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
basically, what you need is some code that will set up an IDT entry to a given pointer (assuming most of your entries will be simple interrupt traps to the kernel code segment)

I also suggest you wrote a small assembly (yes. This is mandatory) stub code that will save registers and restore them once the C code has returned. Forget about having your C code referred directly by the IDT entry: this will not work (and using asm("iretd") at the end of the C function will not help you alot).

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:IDT help
PostPosted: Sat Feb 22, 2003 5:04 pm 
what about writing the IDT directly in asm? when i call an int instruction from within my kernel, the compputer resets..so theres probibly something wrong in my IDT.

so, an example of some IDT entry's in asm would look like?

dd isr_pointer0, isr_pointer1, isr_pointer2, isr_pointer3, isr_pointer4

or will that not work?


Top
  
 
 Post subject: Re:IDT help
PostPosted: Sat Feb 22, 2003 6:35 pm 
Mr_Spam wrote:
what about writing the IDT directly in asm? when i call an int instruction from within my kernel, the compputer resets..so theres probibly something wrong in my IDT.

so, an example of some IDT entry's in asm would look like?

dd isr_pointer0, isr_pointer1, isr_pointer2, isr_pointer3, isr_pointer4

or will that not work?

The IDT entries is 8 byte wide.

The first word is the lower word of the Interrupt handler offset (the entry point for the interrupt).
The second word is the selector which the offset is located within.
The byte followed should be zero, according to what I've read.
Then a flag-byte is followed and the entry ends with the higher word of the offset to the handler...

Sorry if it was not that good as an explanation... is a bit tired...


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], FrankRay78, Google [Bot] and 61 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group