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.
Hm... Your bochs output says otherwise... Is your Bochs log different then the one you posted? If so, can you post it?
We may also still need that disassembly...
P.S. neon, your tutorials helped me in the development of my bootloader
I'm am glad they helped I am going to be uploading a new version of it soon do to 4 bugs being fixed (As well as making the kernel a real 32 bit EXE program)
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
You should be able to have the compiler output the assembly. Just make sure you are building with Assembly With Source Code (/FAs) and look for the assembled file.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
You still need to answer the other question: Does it only #GPF when accessing the variable from within the interrupt handler? ...Or from anywhere?
You may need to run this in the Bochs debugger to see exactally what is going on.
Just put a CLI+HLT instructions in your interrupt handler. Run the debugger and use the continue command (c). It will stop at your HLT instruction. use ctrl+c to break into the debugger and you will be inside of your interrupt handler. Hit s to single step and h for help.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
it stops before the cli&hlt(which is prior to the pitticks++), but when I comment out the pitticks++, it works
It is supposed to stop. That is when you need to break into the debugger (CTRL+C) and single step to see what the next couple of instructions are what you expect them to be. Using your linker map, you can get the location of your pitticks variable.
When I initialize the GDT it GPFs.
I didn't add it as a class member (it was(like my PIT IRQ) part of _pit, but I later removed it from the class to solve another error that came up).
You should be able to do both without any problems. What is the "other error"?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}