Hardware Interrupts not working after switch to ring 3
Posted: Tue Feb 11, 2014 2:16 am
I know I did not get off well in this forum but I will try...
I was working on sleeping using the PIT(sleep works when tasking and user mode are disabled) but found that 1. my PIT was not firing and 2. None of my hardware interrupts where firing(after user mode(ring 3)).
I have searched around for similar problems and found none .
My kernel is based of JamesM's tutorial and has been read through half a dozen times to find possible fixes.
I know that my interrupts AND my PIT work before user mode.
I think you want to look at my "switch_to_user_mode" function.
if you would like me to post any other code please ask and if youwould like to look at the whole picture please visit my https://github.com/teenHack42/MatrixOS
PS. how do I make a link under a word or something like that?
I was working on sleeping using the PIT(sleep works when tasking and user mode are disabled) but found that 1. my PIT was not firing and 2. None of my hardware interrupts where firing(after user mode(ring 3)).
I have searched around for similar problems and found none .
My kernel is based of JamesM's tutorial and has been read through half a dozen times to find possible fixes.
I know that my interrupts AND my PIT work before user mode.
I think you want to look at my "switch_to_user_mode" function.
Code: Select all
void switch_to_user_mode()
{
// Set up our kernel stack.
set_kernel_stack(current_task->kernel_stack+KERNEL_STACK_SIZE);
// Set up a stack structure for switching to user mode.
asm volatile(" \
cli; \
mov $0x23, %ax; \
mov %ax, %ds; \
mov %ax, %es; \
mov %ax, %fs; \
mov %ax, %gs; \
\
\
mov %esp, %eax; \
pushl $0x23; \
pushl %esp; \
pushf; \
pop %eax; \
or %eax, 0x200 ; \
push %eax ; \
pushl $0x1B; \
push $1f; \
iret; \
1: \
");
}
PS. how do I make a link under a word or something like that?