Page 1 of 1

there is still a scheduling problem

Posted: Wed Nov 03, 2010 1:55 pm
by mariuszp
OK, I posted a scheduling problem before, I was given a solution, I tried it, and it still doesn't work. I continued the thread but people seemed to stop looking at it, so I post it again.

My problem is with my multitasking code, and I still cannot possibly figure out what's going on with it. I used JamesM's tutorial. I changed most of the code. My debugging screen said:

Code: Select all

sched start
schedule!
current process: KERNEL TASK pid 0x0
EIP: 0x1062Ed
end sched
I am parent
I am done
fork() returned 0x1 and getpid() returned 0x0
==============
schedule!
current process: FORKED TASK pid 0x1
EIP: 0x106258
PAGE FAULT! HOORAY!
Address: 0x489046c
Stack is at 0x10+0x104158
Source code is here:
projekt-darma.cba.pl/proc.h.txt
Please help!

Re: there is still a scheduling problem

Posted: Wed Nov 03, 2010 6:45 pm
by thepowersgang
Ok, do you know why the code is causing a page fault?

Have you tried tracing the second task (after the task switch)?

Re: there is still a scheduling problem

Posted: Thu Nov 04, 2010 12:50 pm
by mariuszp
well, i tried debugging the whole function, and I did find one problem. I made sure that the current_directory variable (pointing to the current page directory) is set to the right value, and there was no page fault, but still, when that second process is scheduled, nothing happens, the system just freezes. I updated my code.

Re: there is still a scheduling problem

Posted: Fri Nov 05, 2010 8:58 am
by mariuszp
well, i checked what is at the memory location pointed to by the process' EIP, and it seems weird. I'm not too good with machine code, but is saw some MOv (89 45) and then HLT (F4) and then some call. I dont have the exact content right now (im at school) but ill get it when im at home and post them here.

I dont think the HLt is supposed to be there (or it is just MOV putting F4 in some reg??), but if the EIP is corrupt, what exactly shalll I do? If there's some machiine code guy here, please tell me if the 89 45 and F4 are the same instruction or not?

Re: there is still a scheduling problem

Posted: Sat Nov 06, 2010 9:46 am
by mariuszp
is it possible to do that in qemu? bochs is really confusing

Re: there is still a scheduling problem

Posted: Sat Nov 06, 2010 5:47 pm
by Combuster
Bochs is not confusing.

Did you read the documentation?
Did you read the contents of the bundled bochsrc sample?
Do you know how to use any command-line debugger?
Do you know how configure scripts work?

If the answer to any of these is no, you have some holes in your knowledge to fill up. If you know it all, then you need some really convincing proof that bochs is confusing. After all, trying to learn how to write while you have moral objections against using paper isn't getting you anywhere.