Page 1 of 1

ring3 expectation considered harmful?

Posted: Mon Feb 11, 2008 7:14 pm
by jerryleecooper
By optimizing my kernel I have found a bug, my mouse module, which runs at ring 3 suddenly started "crashing", it gave me a pagefault. That's because its codesize is bigger than one page. All my other modules are less than one page big. So I guess the processor doesn't check the tlb for the first page when iret-ing, expecting the code to be both present and be of the correct ring-space, hence the "considered harmful" famous quote?
As you see, Im just an hobbyist trying figurying things out.

Posted: Mon Feb 11, 2008 9:13 pm
by jerryleecooper
I have just found the bug, it has nothing to do with whatever I have said. Sorry to mislead you. The bug was that the code wasnt aligned to a page boundary because of my silly filesystem! :oops: :oops: :oops:

Posted: Tue Feb 12, 2008 3:16 am
by JamesM
This is *not* the correct subforum for bugs in your kernel. Try OS Development.

Posted: Tue Feb 12, 2008 12:02 pm
by jerryleecooper
JamesM wrote:This is *not* the correct subforum for bugs in your kernel. Try OS Development.
I will be more careful about that. :oops:


About the bug I supposedly corrected, it's still here. Im envisaging switching to ELF for my binaries, right now im just using plain vanila binaries which are statically linked with a.o , the C library.