Path: utzoo!utgpu!watserv1!watmath!att!att!bu.edu!rpi!zaphod.mps.ohio-state.edu!usc!rutgers!bellcore!decvax.dec.com!crater!paradis From: paradis@crater.zk3.dec.com (Jim Paradis) Newsgroups: comp.os.minix Subject: Help needed with MINIX scheduler Message-ID: <454@decvax.decvax.dec.com.UUCP> Date: 28 Nov 90 17:44:04 GMT Sender: news@decvax.dec.com.UUCP Reply-To: paradis@decvax.dec.com (Jim Paradis) Organization: DEC ULTRIX, Nashua, NH Lines: 63 I'm currently running MINIX 1.5.10 with Bruce Evans' 32-bit patches. I'm in the process of implementing demand-paged virtual memory, and I'm running into a problem. Here's a summary of the situation: - For simplicity's sake, I have a single page table for the entire system (much as Bruce does now). This way, MM and friends can operate as they do now, assuming a single system-wide linear memory address space. Protection et al is handled by the segmentation mechanism. - I have a task called PAGER, which handles pageins and pageouts. - When MM allocates a range of memory, it asks the kernel to set up a range of PTEs as demand-zero pages. These aren't backed with physical memory until they are actually referenced, at which time the PAGER allocates a page from the free pool, maps it in, and zeros it. - When I take a page fault, the page fault handler finds the faulting virtual (linear) address, fires off a message to the PAGER, and waits for a reply to come back before continuing. At least that's how it's SUPPOSED to happen. I've been tearing my hair out for the past week actually trying to MAKE it happen. I don't have paging to/from disk implemented yet, but I am taking page faults to resolve demand-zero pages. Things seem to work just fine UNTIL a process takes a page fault while in the middle of a system call. What happens then is that for some reason the pager doesn't get scheduled and that either the faulting process or the IDLE task gets re-scheduled. One note on my page fault handler: I modeled it after the SYSCALL handler such that it saves the process registers on the stack, switches DS and SS to the kernel data segment, gets the fault address, and calls the C handler routine. I've tried two different mechanisms for jolting the pager task: one using the interrupt() routine, and one using lock_mini_send() to send a message. Both work just fine when it's a TASK taking the page fault, but both fail when it's a user process inside a syscall. So: is there anyone out there with any insight into the MINIX scheduler who might be able to give me some suggestions? At this point I'm stuck... I've tried experimenting with this and that, all to no avail. I've been glued to my computer during every free moment I have, determined to track this one down... my wife and cats are starting not to recognize me anymore 8-) Oh, one other question: Is there any reason (other than the implementation of brk() and a few other things) why DS and SS can't be in separate segments? It would be really nice to be able to make two separate, expandable segments and not have to bother with "chmem" anymore... Thanks, Jim Paradis, working at but not employed by DEC. (603)881-1221 paradis@decvax.dec.com "All I got was a rock!"