GenDev SpritesMind Website SpritesMind.Net
Sega Megadrive/Genesis development
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Preemptive context switching, aka multitasking

 
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Demos
View previous topic :: View next topic  
Author Message
andlabs
Very interested


Joined: 08 Aug 2009
Posts: 62

PostPosted: Sat Aug 08, 2009 5:00 pm    Post subject: Preemptive context switching, aka multitasking Reply with quote

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 Very Happy

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
View user's profile Send private message
Chilly Willy
Very interested


Joined: 17 Aug 2007
Posts: 1956

PostPosted: Sat Aug 08, 2009 6:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
andlabs
Very interested


Joined: 08 Aug 2009
Posts: 62

PostPosted: Sat Aug 08, 2009 9:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Chilly Willy
Very interested


Joined: 17 Aug 2007
Posts: 1956

PostPosted: Sun Aug 09, 2009 3:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Demos All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group