Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/22/02 14:39
Read: times


 
#22035 - RE: Task switching for Keil C51
Letting context switches from only main task function seems quite restricted. And I'm trying to consider the preemptive approach also.

Yes, it is restrictive, but then the restriction provides a simple model and small context (usually only the program counter). When targeting small designs like single-chip 8051's (i.e., internal memory only) or Microchip PIC's and the like, it's a reasonable restriction considering the types of projects in which these MCU's would be used. This, of course, is assuming a cooperative model, which I now understand you are moving away from.

For all tasks using reentrant functions, do not I need seperate reentrant stack area? And also, I need seperate hw-stack area for all tasks? Right?

Yes, or separate saved stack contexts that get moved to the "real" stack areas.

Saving all the stack content to another place does not seem reasonable.

But yet, this is the way it's done in at least one commercial preemptive RTOS (CMX RTX51, IIRC). With it, you specify a combined stack size for it to allocate a chunk of external memory where both the hardware and reentrant stacks are copied to/from at context switch time. The context switcher saves (copies) the current stack frames, stack pointers, register banks, and other registers (e.g., ACC, B, DPL, DPH, PSW, PC, etc.) to the task's external memory save area and control block and then restores all that from another tasks area.

Regards,

--Dan Henry

List of 25 messages in thread
TopicAuthorDate
pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
RE: pros and cons of using an OS            01/01/70 00:00      
Task switching for Keil C51            01/01/70 00:00      
RE: Task switching for Keil C51            01/01/70 00:00      
RE: Task switching for Keil C51            01/01/70 00:00      
RE: Task switching for Keil C51            01/01/70 00:00      
RE: Task switching for Keil C51            01/01/70 00:00      
RE: Task switching for Keil C51            01/01/70 00:00      
RE: Task switching for Keil C51            01/01/70 00:00      
RE: Task switching for Keil C51            01/01/70 00:00      

Back to Subject List