Hi,Dear friends,
After the discussions about the reentrant stack in Keilc http://www.keil.com/forum/docs/thread10048.asp#msg47666 ,I believe It really hit the spot. Thanks again!
But, There is another question, Why It is not recommended porting a OS(ucos) to c51?
If some one heared about this, Most of them will suggest the two points, One,It's ok for a study, but for a business. And the other is that if you really need ,pls switch to ARM or else.
If I have a enhanced fast C51, and there is about 5~7K RAM, It's about two/three clocks per machine cycle working on 40Mhz, which means about 50ns for single-cycle instruction, Is it powerful enough for a OS?
Is there any statistics about these things? It'll be very kind of you to let me know the details.
It can be done (I have seen it). It is a huge drain on resourses. RAM, ROM, and CPU cycles. The way the 8051 stack and pointer handling are to blame. You can not just save the stack pointer, and set a new task stack. The stack is too small and maxes out at less han 256 bytes. So the compiler makes a software stack. It has much more overhead. The task switch time is slower, so you will have less switches per second.
It can be done (I have seen it). It is a huge drain on resourses. RAM, ROM, and CPU cycles.
Hi,I am so glad to know there are some "products" about this point , Could u tell me the type of the C51, or some informations about the resources,such as the RAM, the speed, the run-time behaviour and others.
The way the 8051 stack and pointer handling are to blame. You can not just save the stack pointer, and set a new task stack. The stack is too small and maxes out at less han 256 bytes. So the compiler makes a software stack. It has much more overhead. The task switch time is slower, so you will have less switches per second.
Thanks for your advices, you're right,we should set it less switches per second.
It was not a "Product" In the end a science experiment. It was a 6 clock phillips "RD" CPU 12 Mhz I think. It the programmer wanted to learn RTOS. The code base was used in a bigger CPU in an expanded project. It works well there. The 8052 was losing time with 4 tasks. The switch time had to be slowed down a lot to fix it. The switch time is Key here. A 1ms switch time on a 2ms clock means 50% of the time is wasted. With a 10 ms clock only 10% is wasted. Does it matter in your project? That is for you to decide. In the end you will need More RAM, ROM, and a faster CPU to get equivilent performance. You may have better luck with Keils O/S. It is smaller, but I have not used it.