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.
2: yes, it is a linear address, in the form descriptor:offset, so data has a value of 0x10
lidt will load from a linear address. Only lidt, lgdt, sidt and sgdt do this. This means if your data segment is based at 0x1000 and your idt is at 0x2000, you need to lidt 0x3000. The processor does NOT look at the DS to get the base address, you must do it yourself.
I'm pretty sure that your base address of DS is zero (It usually is) so ignore this.
If a trainstation is where trains stop, what is a workstation ?
gcc won't generate any code unless i is used for something. Make sure that code is generated and put a while (1); after the code just in case it doesn't.
I just went thru this type of pain to get into 64bit mode. Do you have the Intel software Developers Manual Vol 2A ? If you look for the "INT n" instruction it has pseudo code for what happens when an interrupt occurs. It goes thru the privilege checks that are made etc. I went thru it line by line over a weekend checking every step and eventually found that the problem was my interrupt stack wasn't aligned correctly.
If a trainstation is where trains stop, what is a workstation ?
I believe that my div intruction is being executed. In memory there is the instruction idic eax,ecx and eax = 4, while ecx = 0.
Also, the code doesn't continue after this point so i'm assuming an interrupt is called.
Sadly I don't have a copy of the developer manuals, but I can get them.
"For those about to rock, we salute you"
-Brian Johnson
Ok, There was a problem with my GDT, so it didn't work, but now after I finish my first interrupt and after I go into a while(1); loop, I get a int 8, followed by a bunch a int 13's. My question is, do you have any idea why the first double fault is being called. It's no like my code is doing anything, it is just looping.
"For those about to rock, we salute you"
-Brian Johnson