OSDev.org https://forum.osdev.org/ |
|
Problem with ISR handling https://forum.osdev.org/viewtopic.php?f=1&t=33583 |
Page 1 of 1 |
Author: | Shvets04 [ Fri Mar 15, 2019 12:44 pm ] |
Post subject: | Problem with ISR handling |
When i get a page fault i get continuous printing error(https://ibb.co/1bPsH5Z), but i need a one print about a page fault. (isr.c - https://github.com/s04v/locOS/blob/master/cpu/isr.c) (interrupt.asm - https://github.com/s04v/locOS/blob/mast ... errupt.asm) The code that cause a page fault, I wrote it just for test. Code: initialise_paging(); print_s("Hello, paging world!\n"); u32 *ptr = (u32*)0xA00000; u32 do_page_fault = *ptr; /* next code is not executed*/ How to fix it?? |
Author: | BenLunt [ Fri Mar 15, 2019 1:07 pm ] |
Post subject: | Re: Problem with ISR handling |
Shvets04 wrote: Code: initialise_paging(); print_s("Hello, paging world!\n"); u32 *ptr = (u32*)0xA00000; u32 do_page_fault = *ptr; /* next code is not executed*/ Without looking at your code, I bet that it is a simple mistake of: Code: u32 *ptr = (u32*)0xA00000; Has too many zeros....One too many. Ben - http://www.fysnet.net/osdesign_book_series.htm |
Author: | Shvets04 [ Fri Mar 15, 2019 1:19 pm ] |
Post subject: | Re: Problem with ISR handling |
BenLunt wrote: Shvets04 wrote: Code: initialise_paging(); print_s("Hello, paging world!\n"); u32 *ptr = (u32*)0xA00000; u32 do_page_fault = *ptr; /* next code is not executed*/ Without looking at your code, I bet that it is a simple mistake of: Code: u32 *ptr = (u32*)0xA00000; Has too many zeros....One too many. Ben - http://www.fysnet.net/osdesign_book_series.htm i wrote it especially for test. |
Author: | MichaelPetch [ Sat Mar 16, 2019 12:56 am ] |
Post subject: | Re: Problem with ISR handling |
Because you aren't rectifying the page fault when your interrupt handler is executed it will return back to the same instruction,fault again, and repeat the cycle continuously. If you get a page fault you could temporarily issue a `hlt` instruction. This will of course effectively stop your kernel since it is being done in an interrupt handler with interrupts off. |
Author: | MichaelPetch [ Sat Mar 16, 2019 1:23 am ] |
Post subject: | Re: Problem with ISR handling |
The tutorial on which some of your IRQ code is based on is flawed with regards to passing registers_t by value and not by reference. I've recently wrote a post on reddit about it (and a fix): https://www.reddit.com/r/osdev/comments ... _interrupt .This bug is also mentioned on OSDev wiki here: https://wiki.osdev.org/James_Molloy%27s ... pted_state |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |