there is still a scheduling problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

there is still a scheduling problem

Post 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!
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: there is still a scheduling problem

Post 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)?
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: there is still a scheduling problem

Post 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.
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: there is still a scheduling problem

Post 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?
mariuszp
Member
Member
Posts: 587
Joined: Sat Oct 16, 2010 3:38 pm

Re: there is still a scheduling problem

Post by mariuszp »

is it possible to do that in qemu? bochs is really confusing
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: there is still a scheduling problem

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply