Preemptive context switching, aka multitasking
Moderator: Mask of Destiny
Preemptive context switching, aka multitasking
Hi. Like snkenjoi before me, I am also from Sonic Retro.
I decided to make a simple preemptive context switcher on the Genesis, based on some code I already had for x86 and some guidelines I found a while ago.
http://idisk.mac.com/pietro10-Public/mtask.zip
It just flashes between a and b every second or two. Not really much to say
Comments are welcome, source code is included. Read the main source code file for the thanks. =P
I decided to make a simple preemptive context switcher on the Genesis, based on some code I already had for x86 and some guidelines I found a while ago.
http://idisk.mac.com/pietro10-Public/mtask.zip
It just flashes between a and b every second or two. Not really much to say
Comments are welcome, source code is included. Read the main source code file for the thanks. =P
Last edited by andlabs on Sat Aug 08, 2009 10:08 pm, edited 1 time in total.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
It's small, but not really a great framework for tasks. You'd be better off to use the Amiga task switching. It was easily capable of handling 100 switches a second on a stock 7MHz 68000, only took a few K of code, and had a small struct for the tasks. Get the exec.library disassembly off AmiNet and look it over. If you have any questions, just ask - I was an expert on that part of exec.
Right. The Genesis isn't really the best system for serious multitasking, especially with very limited RAM (that repeats). It is a small proof of concept. I will look into this Amiga multitasker though. I didn't make this a flexible system because I didn't want to =PChilly Willy wrote:It's small, but not really a great framework for tasks. You'd be better off to use the Amiga task switching. It was easily capable of handling 100 switches a second on a stock 7MHz 68000, only took a few K of code, and had a small struct for the tasks. Get the exec.library disassembly off AmiNet and look it over. If you have any questions, just ask - I was an expert on that part of exec.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 484
- Joined: Sat Mar 05, 2011 11:11 pm
- Location: Berlin, Germany
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 484
- Joined: Sat Mar 05, 2011 11:11 pm
- Location: Berlin, Germany
Hey thanks, TmEE - that was quick work I'll have a look at his work nowTmEE co.(TM) wrote:http://www.tmeeco.eu/BitShit/MTASK.ZIP
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
My MD dev folder has a loooooot of stuff in it. I made a search for the filename and found it ^^
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 484
- Joined: Sat Mar 05, 2011 11:11 pm
- Location: Berlin, Germany