flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Does the IDT need to have 256 entries, or can it have less? |
Author |
|
StringCheesian 27 Feb 2004, 09:42
What's the bare minimum?
|
|||
27 Feb 2004, 09:42 |
|
Ralph 28 Feb 2004, 05:54
f0dder is completly right, but if I may add something, I don't see why you need to create entries for all. It's just a waste of space. I just use a structure like this:
Code: struc interrupt id1,id2,id3,id4 { .Offset0_15 dw id1 ;low word of int offset .Selector0_15 dw id2 ;segment selector .Flags dw id3 ;flags .Offset16_31 dw id4 ;high word of int offset } And then just create an idt like this: Code: idt: idt_limit dw idt_end-int_00-1 idt_base dd int_00 int_00 interrupt interrupt_00,0008h,8E00h,0001h ...... idt_end: This lets me fill memory above 1mb with interrupt code. I keep all my interrupts between 1mb and 2mb, so I just need to change the interrupt_00 label to create a new one if needed. Hope this helps~ |
|||
28 Feb 2004, 05:54 |
|
StringCheesian 28 Feb 2004, 06:19
Thanks! One more question:
Say I wanted to have int 9 point somewhere, would I have to make 0-8 point to a dummy int handler or could 0-8 be disabled somehow? Would a null selector work or just cause errors? |
|||
28 Feb 2004, 06:19 |
|
Ralph 29 Feb 2004, 03:15
Remember that the IDT is a table, and the interrupts are indices. That means that the interrupt number will be used as the index into the IDT to find the correct handler. The processor doesn't care what is at that address, and merily execute what you told it to.
In other words, yes you will have to create 9 entries if you plan on using 9 indices into the table. What is in those 8 other entries is irrelevant as long as you don't execute them. |
|||
29 Feb 2004, 03:15 |
|
f0dder 29 Feb 2004, 03:28
...and when you're doing protected mode, you will want an IDT that contains at least enough entries to handle all the possible exceptions (and dummy handlers for reserved stuff). If you don't do this and an exception happens... well, I can't remember the details, refer to the intel docs, but iirc you end up with a triple fault.
|
|||
29 Feb 2004, 03:28 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.