Confusion regarding Multiprogramming.

49 views
Skip to first unread message

nidhin mohan

unread,
Oct 14, 2020, 12:48:48 PM10/14/20
to xos-...@googlegroups.com
Sir,
I am currently at Stage 12 of the roadmap. I had run into some problems with stage 12, and hadn't been able to fix it properly. 

The doubts I had was after the timer interrupt handler is called and it changes the process, the Instruction Pointer is popped from the stack of the new process, in this case, it was the idle process. But no return address has been pushed into the stack of the idle process. And as such my program terminates after the timer interrupt handler returns back to user mode. 

I might not be understanding it completely, but I would like to know what exactly the problem could be. I feel like it's something wrong with assigning process table entries for the idle and init programs, most notably the UPTR and KPTR values, but I do not know.

Murali Krishnan

unread,
Oct 14, 2020, 1:08:14 PM10/14/20
to xos-...@googlegroups.com
Dear Nidhin,
  I didn't understand the issue clearly.  But if the IRET instruction has to work properly, the top of the stack (which is determined by the values of SP register, PTBR value and the entries in the stack page of the page table pointed to by PTBR) must contain the correct return IP logical address from which the execution of the program (to which IRET returns) must happen.  Note that PTBR must be set to the beginning of the page table of the process that must be run and page table entries also must be set correctly so that after address translation, the next instruction is fetched from the right physical address.  Further note that instruction fetch always happen from the physical memory address determined by IP, PTBR and page table entries.  
  Hence the stack top of the IDLE process needs to contain the return (logical) IP address at the time of IRET. 
  Did I answer the question?
Murali

--
You received this message because you are subscribed to the Google Groups "XOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xos-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/xos-users/CAEME5HMoRUBxH-0qjogdCe1Bxi8yvxNKTo5coV5%2Brz6%2BPF1BsA%40mail.gmail.com.

nidhin mohan

unread,
Oct 15, 2020, 12:08:37 PM10/15/20
to xos-...@googlegroups.com
Thank you for your help sir.
I think my issue was with some stack pointer assignment, because after a while the timer managed to successfully shift to the idle process and that problem was solved. It's working now.


Reply all
Reply to author
Forward
0 new messages