Page 1 of 1

Multitasking doesn't work

Posted: Fri Dec 28, 2012 3:11 pm
by erhardt
On my OS(?) Multitasking doesn't work.
when it is enabled nothing happens.

Link:
http://uploadingit.com/file/hxhu7n8o1d3 ... o_repo.zip

Thnx for help

Re: Multitasking doesn't work

Posted: Fri Dec 28, 2012 4:16 pm
by Love4Boobies
You won't get any answers to such a bad question. However, this should help.

Re: Multitasking doesn't work

Posted: Fri Dec 28, 2012 4:27 pm
by gravaera
Yo:

You might want to try to move zig, and if that doesn't work, then please thoroughly sweep the code, ensuring that you diligently, one by one, move all zig straight to Bel Air.

This is probably the most detailed answer you will get to this question, idk if anybody wants to beat that \o/

--Peace out
gravaera

Re: Multitasking doesn't work

Posted: Fri Dec 28, 2012 4:44 pm
by erhardt
The "OS" should run task_a and task_b, which print "A"(task_a)or "B" (task_b).
Although the scheduler is runned every Timer interupt,nothing is printed. The Tasks are in the file mt/zygote.c. The whole other Multitasking including the Scheduler is in the File "mt/ts.c"= taskswitch.
Here is Qemu.log

Code: Select all

DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=000f28b0 CCD=00000001 CCO=LOGICB  
EFER=0000000000000000
SMM: after RSM
EAX=00000001 EBX=17fe1f30 ECX=02000000 EDX=00000cfc
ESI=000f28dd EDI=0003802d EBP=17fe1d50 ESP=00006eb0
EIP=000f2c4a EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
CS =0008 00000000 ffffffff 00c09b00 DPL=0 CS32 [-RA]
SS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
DS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
FS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
GS =0010 00000000 ffffffff 00c09300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     000fd3a8 00000037
IDT=     000fd3e6 00000000
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000000 CCD=00000000 CCO=EFLAGS  
EFER=0000000000000000
     0: v=20 e=0000 i=0 cpl=0 IP=0008:000000000010045a pc=000000000010045a SP=0010:000000000010600c EAX=0000000000105f88
EAX=00105f88 EBX=00036d04 ECX=00000002 EDX=00000002
ESI=0005d980 EDI=0005d976 EBP=00067e5c ESP=0010600c
EIP=0010045a EFL=00000202 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     00108840 00000027
IDT=     00108040 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000004 CCD=00105fcc CCO=EFLAGS  
EFER=0000000000000000
     1: v=21 e=0000 i=0 cpl=0 IP=0008:000000000010045a pc=000000000010045a SP=0010:000000000010600c EAX=0000000000105f88
EAX=00105f88 EBX=00036d04 ECX=00000002 EDX=00000002
ESI=0005d980 EDI=0005d976 EBP=00067e5c ESP=0010600c
EIP=0010045a EFL=00000202 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     00108840 00000027
IDT=     00108040 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000004 CCD=00106000 CCO=EFLAGS  
EFER=0000000000000000
     2: v=20 e=0000 i=0 cpl=0 IP=0008:000000000010045a pc=000000000010045a SP=0010:000000000010600c EAX=0000000000105f88
EAX=00105f88 EBX=00036d04 ECX=00000002 EDX=00000002
ESI=0005d980 EDI=0005d976 EBP=00067e5c ESP=0010600c
EIP=0010045a EFL=00000202 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     00108840 00000027
IDT=     00108040 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000004 CCD=00106000 CCO=EFLAGS  
EFER=0000000000000000
     3: v=20 e=0000 i=0 cpl=0 IP=0008:000000000010045a pc=000000000010045a SP=0010:000000000010600c EAX=0000000000105f88
EAX=00105f88 EBX=00036d04 ECX=00000002 EDX=00000002
ESI=0005d980 EDI=0005d976 EBP=00067e5c ESP=0010600c
EIP=0010045a EFL=00000202 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     00108840 00000027
IDT=     00108040 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000004 CCD=00106000 CCO=EFLAGS  
EFER=0000000000000000
     4: v=20 e=0000 i=0 cpl=0 IP=0008:000000000010045a pc=000000000010045a SP=0010:000000000010600c EAX=0000000000105f88
EAX=00105f88 EBX=00036d04 ECX=00000002 EDX=00000002
ESI=0005d980 EDI=0005d976 EBP=00067e5c ESP=0010600c
EIP=0010045a EFL=00000202 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS   [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT=     00108840 00000027
IDT=     00108040 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00000004 CCD=00106000 CCO=EFLAGS  
EFER=0000000000000000
I hope this is enough.
I doesn't have more information

Re: Multitasking doesn't work

Posted: Sat Dec 29, 2012 2:45 am
by dozniak
It is allowed and actually perfectly fine to debug your OS if it doesn't work.

Re: Multitasking doesn't work

Posted: Sat Dec 29, 2012 2:52 am
by kosmisk
Hi, you need to change

task* init_task(void* entry) to task* init_task(uint32_t (*entry)())

and .eip = (uint32_t) entry, to .eip = (uint32_t) entry(),

Then ofcourse you must change the header file too.
Then it will work :)