Holy crap!
Dec. 9th, 2005 12:28 amIt worked. Still have much to do - I am still farther behind than I wanted to be last Sunday, but a major chunk of the work is done, and I'm back to a place where I feel like I might be able to fix the rest on my own.
The final problem was the way calls for virtual pages happened. He used a global switch for handling page fault/not handling page fault. When I did a call (inside a page fault) to memory, to get the frame data in order to send it off to disk for frame reuse, my call to the same function flipped the switch off. Then, when the disk I/O was done, the program didn't resume inside the request to write to the newly mapped page, it hopped to the next logical instruction.
I think mostly this is tap dancing for the fact that this isn't actually a peice of hardware, it's a C construct imitating a peice of hardware. I was right - in the end it was having multiple executions of the same function, essentially nested in each other, but manipulating global variables independantly that gave the whole thing massive heart burn.
Instead, I now reach my grimy little 'fingers' into the frame memory storage structure directly, bypassing the evil function. No evil function - no goofy switch. No goofy switch... all is happy.
The final problem was the way calls for virtual pages happened. He used a global switch for handling page fault/not handling page fault. When I did a call (inside a page fault) to memory, to get the frame data in order to send it off to disk for frame reuse, my call to the same function flipped the switch off. Then, when the disk I/O was done, the program didn't resume inside the request to write to the newly mapped page, it hopped to the next logical instruction.
I think mostly this is tap dancing for the fact that this isn't actually a peice of hardware, it's a C construct imitating a peice of hardware. I was right - in the end it was having multiple executions of the same function, essentially nested in each other, but manipulating global variables independantly that gave the whole thing massive heart burn.
Instead, I now reach my grimy little 'fingers' into the frame memory storage structure directly, bypassing the evil function. No evil function - no goofy switch. No goofy switch... all is happy.