OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:08 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Problem with ISR handling
PostPosted: Fri Mar 15, 2019 12:44 pm 
Offline
Member
Member

Joined: Wed Feb 13, 2019 3:07 pm
Posts: 28
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??


Top
 Profile  
 
 Post subject: Re: Problem with ISR handling
PostPosted: Fri Mar 15, 2019 1:07 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 934
Location: USA
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


Top
 Profile  
 
 Post subject: Re: Problem with ISR handling
PostPosted: Fri Mar 15, 2019 1:19 pm 
Offline
Member
Member

Joined: Wed Feb 13, 2019 3:07 pm
Posts: 28
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.


Top
 Profile  
 
 Post subject: Re: Problem with ISR handling
PostPosted: Sat Mar 16, 2019 12:56 am 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
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.


Top
 Profile  
 
 Post subject: Re: Problem with ISR handling
PostPosted: Sat Mar 16, 2019 1:23 am 
Offline
Member
Member

Joined: Fri Aug 26, 2016 1:41 pm
Posts: 671
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 92 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group