Page 2 of 2
Re:Bootsector trouble...
Posted: Thu Sep 05, 2002 1:39 am
by Pype.Clicker
just write the offset of your handler function in your IDT: it'll be the compiler's goal to do the proper job.
However, If CS&DS base is not 0, then you should not put "idt" in IDTR.base, but rather "idt+CS.base" so that IDTR.base becomes an absolute address
Re:Bootsector trouble...
Posted: Thu Sep 05, 2002 6:01 am
by Warmaster199
Is it possible for you to show an example? I'm pretty sure I was writing the offset... But I don't think that I am writing the upper word to my IDT's limit... can you check?(The code is posted in my last post)
One last thing: Is it possible that the error(That started occuring ONLY after I moved the kernel to 0x0001:0000) could have been cause somewhere else in the interrupt functions? I am almost certain it's the IDT, but is it possible it could be somewhere else as well?
Re:Bootsector trouble...
Posted: Thu Sep 05, 2002 3:49 pm
by Warmaster199
Anyone have any ideas?
Re:Bootsector trouble...
Posted: Thu Sep 05, 2002 11:08 pm
by Dave_Hunt
Just an observation -
You keep saying "0x0001:0000". If you are refering to segment:offset, then that is not the same address as 0x10000. It's actually 0x10.
If you knew that and segment:offset isn't what you meant, then ignore me. If not, ...
Re:Bootsector trouble...
Posted: Fri Sep 06, 2002 1:47 pm
by Warmaster199
Segment:offset is exactly what I meant. In PMode, 0x10000 is the exact same thing as 0x0001:0000. In Real mode, 0x10000 is the same thing as 0x1000:0000. Since we are using PMode, I will continue to use the same format, It seems that everyone so far understands
Re:Bootsector trouble...
Posted: Fri Sep 06, 2002 2:41 pm
by Tim
Except that in protected mode, 0x0001:0000 isn't a valid selector:offset pair; selector 0001 refers to the null descriptor, which you can't use. We don't know what B800:0000 means in protected mode because it depends on the layout of the GDT.
It would be better to use seg16:ofs16 addresses for real mode and ofs32 or sel16:ofs32 addresses for protected mode.
Re:Bootsector trouble...
Posted: Fri Sep 06, 2002 4:25 pm
by Warmaster199
[attachment deleted by admin]
Re:Bootsector trouble...
Posted: Sun Sep 08, 2002 2:17 pm
by Pype.Clicker
Warmaster199 wrote:
That's right... But 0x0001:0000 is a 32-bit address in PMode. The 1 is in the 65536 colomn, so that means that it's still at the 64K mark.
hmm, in litterature, the 1234:5678 notation is kept for real mode segment:offset and i *strongly* suggest you only use it for that purpose (or you'll lose everybody). I use 1234.5678 when i want to show the alignment more clearly