Int 21h IDT Entry Number

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
JoeTheProgrammer
Member
Member
Posts: 48
Joined: Mon Aug 13, 2007 2:30 pm

Int 21h IDT Entry Number

Post by JoeTheProgrammer »

I am sort of confused, what would be the entry number for int 21h in the IDT?

Please Help,
Joseph
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

21h?
C8H10N4O2 | #446691 | Trust the nodes.
JoeTheProgrammer
Member
Member
Posts: 48
Joined: Mon Aug 13, 2007 2:30 pm

Post by JoeTheProgrammer »

Would it be 21 * 8?

Edited To Add: Or am I totally lost?
Last edited by JoeTheProgrammer on Tue May 13, 2008 3:57 pm, edited 1 time in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
JoeTheProgrammer
Member
Member
Posts: 48
Joined: Mon Aug 13, 2007 2:30 pm

Post by JoeTheProgrammer »

Combuster wrote:http://www.catb.org/~esr/faqs/smart-questions.html
What did I do wrong?
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

STFW helps a lot, but because I'm feeling generous - 21h == 0x21.
JoeTheProgrammer
Member
Member
Posts: 48
Joined: Mon Aug 13, 2007 2:30 pm

Post by JoeTheProgrammer »

I did search the web and found nothing, so I thought I would ask here.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post 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
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post 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')
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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.
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

does it also hold for x64?
Author of COBOS
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

os64dev wrote:does it also hold for x64?
Hey, you are the 64-bit developer! :)


JAL
Post Reply