Disabled caching in cr0 - Cpu still caching??
Posted: Wed Sep 07, 2011 4:02 am
Hi,
I have got some strange bugs lately. It was very hard to debug since it worked in Bochs/Virtualbox, but failed on real hw very early on.
After some time i found that i needed to wbinvd after loading GDT to fix problem. Problem seems to be that the CPU did not really flush/reload with normal jmp and segment register updating. The cpu is a Intel i7 2600K (4 cores).
Anyway the problem was fixed with invalidating all caches before these places that caused a exception. The thing though is that the cache disable and write-back flag in CR0 was actually set in my very first code stub, so that it was disabled when these exceptions was generated. So i wonder is there any additional settings that i should set to disable cache?
I can also say that "Grub 1.99" is my bootloader. I had some problems with this too since i from before expected cs=0x8,ds=0x10, but this is not the case anymore.. doing a push cs, push ADDR, ret will work though..
best regards
Thomas
I have got some strange bugs lately. It was very hard to debug since it worked in Bochs/Virtualbox, but failed on real hw very early on.
After some time i found that i needed to wbinvd after loading GDT to fix problem. Problem seems to be that the CPU did not really flush/reload with normal jmp and segment register updating. The cpu is a Intel i7 2600K (4 cores).
Anyway the problem was fixed with invalidating all caches before these places that caused a exception. The thing though is that the cache disable and write-back flag in CR0 was actually set in my very first code stub, so that it was disabled when these exceptions was generated. So i wonder is there any additional settings that i should set to disable cache?
I can also say that "Grub 1.99" is my bootloader. I had some problems with this too since i from before expected cs=0x8,ds=0x10, but this is not the case anymore.. doing a push cs, push ADDR, ret will work though..
best regards
Thomas