Bootsector trouble...

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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Bootsector trouble...

Post 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
Warmaster199

Re:Bootsector trouble...

Post 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?
Warmaster199

Re:Bootsector trouble...

Post by Warmaster199 »

Anyone have any ideas?
Dave_Hunt

Re:Bootsector trouble...

Post 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, ...
Warmaster199

Re:Bootsector trouble...

Post 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 :)
Tim

Re:Bootsector trouble...

Post 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.
Warmaster199

Re:Bootsector trouble...

Post by Warmaster199 »

[attachment deleted by admin]
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Bootsector trouble...

Post 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 ;)
Post Reply