Well, it is really exciting after all: I am about to get multitasking working on my kernel thing.
Problems I encountered whildt doing this:
to have a understanding about the fact, that it is no problem to jump to other task at the end of scheduler (which is the end of my timer interrupt) because if the task is returned to, it continues work at the instruction after the task switch - the interrupt cleanup for this task happens and the task is continued.
to have cs, ds, es,fs,gs,ss set to the proper selectors (else certain functions just blow to hell)
to pass proper adress to cr3 field in the tss structure.
really utterly weird thingses now happen to me... i 'll see if my scheduler works or not ... i'll see if the stackses are correct (stack fault ...??!!)
stay safe, folks!
Some Multitasking experience
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Some Multitasking experience
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
Re:Some Multitasking experience
Well, this will be like chatting so I am sorry for taking up space but I want to say that. Two days before I was also testing multitasknig stuff but then some very stupid error arose, when I inspected it, it went up to bootloader >:( (I said "Hey what the **** is going on here?), well when you think that sometimes things are going very well, you might in fact be getting to the disaster itself... I am now thinking that I solved the problem but anyway... I just wanted to share my feelings (Now it is 5:12 AM, I can just write what I feel... I am kinda disabled... ) with you...
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Some Multitasking experience
Yeah )
no problem gosh.
My multitasker works to some point: it switches tasks. but upon return to a task, that has been taken away from processor, esp seems to become 0 and it says in box: panic: pop-32(): can't pop from stack.
Looks as if I am messing up my stackses somehow. *gg* It is a funny learning experience. and also a test for temper - not that I am loosing temper quickly.
stay safe and good luck for you ozguxx. hope it runs well!
no problem gosh.
My multitasker works to some point: it switches tasks. but upon return to a task, that has been taken away from processor, esp seems to become 0 and it says in box: panic: pop-32(): can't pop from stack.
Looks as if I am messing up my stackses somehow. *gg* It is a funny learning experience. and also a test for temper - not that I am loosing temper quickly.
stay safe and good luck for you ozguxx. hope it runs well!
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Some Multitasking experience
hehe ... i can remember i had plenty of problems with scheduling myself, but the most troubling one was not in *creating* task nor in *scheduling* them, but when i had to *destroy* some tasks...
Think a bit about it: you have to release the task's stack (at least), but this cannot be done by the task itself (it needs that stack).
You can also find yourself in the situation when the task you attempt to kill was locking some system variables, so you need to protect a task that owns a lock on a semaphore (for instance) until it release the semaphore itself.
Also, the task may be waiting for some resource and that resource may be counting how much tasks are waiting for it, so killing the task will require an update of the shared resource.
I finally went through all these problems, but it certainly took me about one month 24/7
Think a bit about it: you have to release the task's stack (at least), but this cannot be done by the task itself (it needs that stack).
You can also find yourself in the situation when the task you attempt to kill was locking some system variables, so you need to protect a task that owns a lock on a semaphore (for instance) until it release the semaphore itself.
Also, the task may be waiting for some resource and that resource may be counting how much tasks are waiting for it, so killing the task will require an update of the shared resource.
I finally went through all these problems, but it certainly took me about one month 24/7
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Some Multitasking experience
*ggg* it is been a kind of a damned curse to get the task switching stuff working in the very beginning: I always set the wrong values in the fields of tss: well, after some days i found out: you have to understand the stuff in the books. It does not suffice to read them. That's it after all. Since I get more and mor used to c programming and asm, it becomes easier for me to handle all these matters.
Cobol programming is not the experience one needs to implement multitasking on i386.
the next things I gonna do are: making tasks runnable/blocked. These states, the scheduler will have to take into consideration, since it handles whole process structures and extracts tss-selectors from them. - ha . its time to trust my memory manager. I am curious if i have programmed it right.
Cobol programming is not the experience one needs to implement multitasking on i386.
the next things I gonna do are: making tasks runnable/blocked. These states, the scheduler will have to take into consideration, since it handles whole process structures and extracts tss-selectors from them. - ha . its time to trust my memory manager. I am curious if i have programmed it right.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Some Multitasking experience
I DID IT!!! *youw...*
Multitasking with tss works now in a very very pure round robin manner.
Gosh, this has been a hard birth i have to admit. But it does now what i expect it to do. I find this amazing )
Multitasking with tss works now in a very very pure round robin manner.
Gosh, this has been a hard birth i have to admit. But it does now what i expect it to do. I find this amazing )
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image