| View previous topic :: View next topic |
| Author |
Message |
andlabs Very interested
Joined: 08 Aug 2009 Posts: 62
|
Posted: Sat Aug 08, 2009 5:00 pm Post subject: 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
Last edited by andlabs on Sat Aug 08, 2009 10:08 pm; edited 1 time in total |
|
| Back to top |
|
 |
Chilly Willy Very interested
Joined: 17 Aug 2007 Posts: 1956
|
Posted: Sat Aug 08, 2009 6:20 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
andlabs Very interested
Joined: 08 Aug 2009 Posts: 62
|
Posted: Sat Aug 08, 2009 9:31 pm Post subject: |
|
|
| Chilly 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. | 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 =P |
|
| Back to top |
|
 |
Chilly Willy Very interested
Joined: 17 Aug 2007 Posts: 1956
|
Posted: Sun Aug 09, 2009 3:22 pm Post subject: |
|
|
| Well, there's more CODE in the Amiga task switching than the example you posted, but that would be in ROM. It uses far less RAM than your example, and would have no trouble working fine on the MD. |
|
| Back to top |
|
 |
|