Page 1 of 1
Pre-emptive multitasking / paging
Posted: Mon Jun 14, 2010 2:54 pm
by oschaos
anyone know were I can get more info on these?
links... asm code examples? ect...
Thanks in advance..
Re: Pre-emptive multitasking / paging
Posted: Mon Jun 14, 2010 4:30 pm
by StephanvanSchaik
Re: Pre-emptive multitasking / paging
Posted: Mon Jun 14, 2010 4:53 pm
by oschaos
check Wikipedia and do some research....
just joking.. I have..
sometimes asking ... helps to narrow down sites people have used... and that are good sites to goto.. that in some cases take a while to find...
its not good learning going to a site that miss informs one on the methods used... and a waste of time.. so asking for a good site/ download/ example code from someone experienced helps not to make mistakes on a website that is outdated or just wrong... anyone can make a webpage...
but thanks..
Re: Pre-emptive multitasking / paging
Posted: Mon Jun 14, 2010 5:18 pm
by Combuster
If you did do your research (which truly is doubtful, see the link why), you definitely broke the
smart questions forum rule which would have prevented the response you just received. (Which, to be honest, could have been much worse)
Stay safe, and happy coding.
Re: Pre-emptive multitasking / paging
Posted: Mon Jun 14, 2010 5:20 pm
by gravaera
okay
.. but it's generally okay to trust wikipedia
... since IT related topics are usually edited by persons who are interested in, and know about IT .. so you should attempt to look up topics there... and on various other websites... before posting.. so that you don't disrupt the flow of the forum..
you'll generally learn a lot from reading documentation from currently existing kernels.. and from papers written by researchers... and from reading source code.. linux is useful for that... there are linux lexers online... those are good for quick browsing to find asm source code examples.. 'ect'...like you asked...
and asking about paging is not very productive either.. since paging and virtual memory implementations on various processors differ greatly... there are many different processor architectures... what you want to do is dive into the manuals for your target architecture... and see how virtual memory/paging is implemented in that architecture..
but thanks..
Re: Pre-emptive multitasking / paging
Posted: Tue Jun 15, 2010 11:35 am
by oschaos
what you want to do is dive into the manuals for your target architecture... and see how virtual memory/paging is implemented in that architecture..
and that is a good ans.. that will direct me to the manual.. instead of jumping around to website to website... see... was not a waste of time for me..
Thanks..
those are good for quick browsing to find asm source code examples
yes but many are outdated...
Thanks again!
Re: Pre-emptive multitasking / paging
Posted: Tue Jun 15, 2010 12:48 pm
by StephanvanSchaik
oschaos wrote:and that is a good ans.. that will direct me to the manual.. instead of jumping around to website to website... see... was not a waste of time for me..
Thanks..
I don't think you even bothered looking at the links. Seriously, being spoon-fed and still not swallowing it.
Regards,
Stephan J.R. van Schaik.
Re: Pre-emptive multitasking / paging
Posted: Wed Jun 16, 2010 7:45 am
by rknox
You have not told us what you know thus it is hard to answer.
But
The intel SPg 253668.pdf (search web) has good descriptions of many of the basics you need. Chpts 3 to 7 or so.
There is a good wiki at this site on programming the Programmable Interval timer.
The book "Operating Systems ..." by Tanenbaum - old book - cheap used at Amazon - has good discussion of scheduling algos. Old book is ok since people have been doing preemptive multi tasking since the 1960's.
enjoy
~~
Re: Pre-emptive multitasking / paging
Posted: Wed Jun 16, 2010 6:41 pm
by rknox
Pre emptive mulit tasking. Here is more or less what happens whan a task has completed it’s time slice. I really don’t know from your question whether this is old stuff to you, or useful. I don’t deal here with tasks that are blocked waiting for I/O. That is a different discussion.
You write an assembler timer interrupt routine to respond to interrupts from the PIC. If you don’t reprogram the PIC it interrupts about every 50 ms. Every N interrupts - maybe 2? - you decide - the routine saves the context on the stack, calls code that can be compiled - lets assume C code.
When the C code returns, the assembler code restores the context and issues an IRET instruction - not RET - to allow the application involved to resume. The resuming application may or may not be the application that was running when the interrupt occured.
But it’s a little more complicated than I described.
The C code looks to see whether there is anyone waiting. If not it returns, otherwise it ques the old task in the waiting que, subsitutes the task at the top of the list, and allows the timer interrupt routine to transfer control to that task.
If that is too basic - plese excuse. Next time be more detailed. If some of those here with greater knowledge want to amplify I would be happy to defer to them.