Page 1 of 1

Int 21h IDT Entry Number

Posted: Tue May 13, 2008 3:41 pm
by JoeTheProgrammer
I am sort of confused, what would be the entry number for int 21h in the IDT?

Please Help,
Joseph

Posted: Tue May 13, 2008 3:50 pm
by Alboin
21h?

Posted: Tue May 13, 2008 3:54 pm
by JoeTheProgrammer
Would it be 21 * 8?

Edited To Add: Or am I totally lost?

Posted: Tue May 13, 2008 3:56 pm
by Combuster

Posted: Tue May 13, 2008 3:59 pm
by JoeTheProgrammer
Combuster wrote:http://www.catb.org/~esr/faqs/smart-questions.html
What did I do wrong?

Posted: Tue May 13, 2008 4:06 pm
by pcmattman
STFW helps a lot, but because I'm feeling generous - 21h == 0x21.

Posted: Tue May 13, 2008 4:08 pm
by JoeTheProgrammer
I did search the web and found nothing, so I thought I would ask here.

Posted: Tue May 13, 2008 4:15 pm
by Combuster
JoeTheProgrammer wrote:
Combuster wrote:http://www.catb.org/~esr/faqs/smart-questions.html
What did I do wrong?

Obviously, you posted a stupid question :roll:

The key points:
Before you ask, ...
...
Use meaningful, specific subject headers
...
Be precise and informative about your problem
...
Describe the goal, not the step

Posted: Tue May 13, 2008 4:19 pm
by Alboin
The wiki has a page on the IDT.
Would it be 0x21 * 8?
Yes, that would be its offset within the IDT, however, the index is still 21h.

Check the wiki. (Search 'IDT')

Posted: Wed May 14, 2008 4:55 am
by Dex
In the IDT, starts at 0 then make 33 more set 8 bytes insize (which will be 34 including 0).
example

Code: Select all

;====================================================;
;  Idt.                                              ;
;====================================================;
idt:

;0 interrupt 0h
	dw div_error			   ; div error
	dw sys_code
	db 0
	db sys_interrupt
	dw 0

;1 interrupt 1h
	dw debug_exception		   ; debug exception
	dw sys_code
	db 0
	db sys_interrupt
	dw 0

;2 interrupt 2h
	dw nmi_interrupt		   ; non maskable interrupt
	dw sys_code
	db 0
	db sys_interrupt
	dw 0

;****FILL THE REST OF INT HERE****

;33 interrupt 21h 
	dw unhandled_int 		    ; reserved
	dw sys_code
	db 0
	db sys_interrupt
	dw 0
;****FILL MORE INT HERE****
;255 interrupt FFh
	dw unhandled_int		   ; reserved
	dw sys_code
	db 0
	db sys_interrupt
	dw 0
idt_end:
But you should also think about remapping pic.

Posted: Wed May 14, 2008 4:57 am
by os64dev
does it also hold for x64?

Posted: Thu May 15, 2008 1:01 am
by jal
os64dev wrote:does it also hold for x64?
Hey, you are the 64-bit developer! :)


JAL