I have recently purchased a copy of the book "MicroC/OS-II" by Jean Labrosse to help
me better understand how the uC/OS Library functions work.
Although I'm only halfway through chapter one, I have already spotted some differences
with using this operating system on the Netburner platform, which albiet a bit trivial,
it does nag me that I can't immmediately reconcile these issues.
Netburner Constants.h file states :-
System task priorities
*
* Restating the uC/OS RTOS Library document (uCOSLibrary.pdf)
* Lowest priority is 63, 1 is the highest.
* There can only be one task at each priority level.
* Idle task is created at priority 63.
According to Jean Labrosse's book, 1 is not the highest priority - zero actually is - 1 would therefore by default be the second highest task priority.
Does OSSimpleTaskCreate(){MACRO} include OSInit(),OSStart(), stack size definitions etc.
which is a mandatory requirement for uC/OS-II to work?
I see that OSInit() is declared in the ucos.h header file as a function prototype but not typically directly invoked in Main(), indirectly perhaps? Having OSSimpleTaskCreate() disguised as an exclusive NetBurner MACRO; makes it a bit slower for me to learn to what is actually layered underneath it, for a beginner who only knows a bit of C and Machine Assembly code programming.
uC/OS Library
Re: uC/OS Library
I believe the Netburner libraries are an extended version of uCOS version 1 while the book you are reading discusses uCOS version 2. While the overall netburner sdk gives you most functionality that would come with uCOS version 2 it isnt version 2. So the book is useful for understanding things on a conceptual level but you should use the netburner documentation for descriptions of the netburner libraries.
Re: uC/OS Library
I appreciate your comments - nirias999 from the perspective that you are coming from.
It seems that rather than reinventing the RTOS wheel for the NetBurner platform, the development engineers may have preferred to customise Jean Labrosse's uCOS source code, as you say - by extending Version 1, which I believe has less restrictions in terms of it's licensing requirements as opposed to Version 2 which is Open Source but NOT free to license in terms of its actual use.
That maybe why they decided to go for Version 1, but I'm not 100% sure if this is the case?
I would need to have this confirmed from the horse's mouth so to speak!
It seems that rather than reinventing the RTOS wheel for the NetBurner platform, the development engineers may have preferred to customise Jean Labrosse's uCOS source code, as you say - by extending Version 1, which I believe has less restrictions in terms of it's licensing requirements as opposed to Version 2 which is Open Source but NOT free to license in terms of its actual use.
That maybe why they decided to go for Version 1, but I'm not 100% sure if this is the case?
I would need to have this confirmed from the horse's mouth so to speak!
Re: uC/OS Library
Hi,
Actually NetBurner purchased the uCOS OS from Labrosse before uCOS II was created. Since then there have been changes to the NetBurner OS for performance and new features. The OS still follows very closely to the uCOS II platform but it definitely is not identical. If you find any major functionality supported by uCOS II that is lacking in the NetBurner OS mention it here and we will consider adding it. For example, we have recently added an OSTaskDelete function, but for resource safety reasons we only allow tasks to delete themselves. There has also been a recent addition of the OSFlags functionality. Another difference between uCOS II and the NetBurner OS is that uCOSII has an object called Mutex where the NetBurner OS has a similar object called OSCrit. There are a few other differences but in the end they are very similar OSes as they both originated from the same original OS.
The OSSimpleTaskCreate macro simply creates a task stack of the size USER_TASK_STK_SIZE and then creates a task that uses this stack. The OSInit(),UCosBegin() and all the other Ucos initialization is called before UserMain runs. You would not want these functions in the Macro since they would be called every time you create a new task. In the system folder there is a file called main.c which is where "int main()" is located. This runs before UserMain to initialize all the OS fucntionality.
-Larry
Actually NetBurner purchased the uCOS OS from Labrosse before uCOS II was created. Since then there have been changes to the NetBurner OS for performance and new features. The OS still follows very closely to the uCOS II platform but it definitely is not identical. If you find any major functionality supported by uCOS II that is lacking in the NetBurner OS mention it here and we will consider adding it. For example, we have recently added an OSTaskDelete function, but for resource safety reasons we only allow tasks to delete themselves. There has also been a recent addition of the OSFlags functionality. Another difference between uCOS II and the NetBurner OS is that uCOSII has an object called Mutex where the NetBurner OS has a similar object called OSCrit. There are a few other differences but in the end they are very similar OSes as they both originated from the same original OS.
The OSSimpleTaskCreate macro simply creates a task stack of the size USER_TASK_STK_SIZE and then creates a task that uses this stack. The OSInit(),UCosBegin() and all the other Ucos initialization is called before UserMain runs. You would not want these functions in the Macro since they would be called every time you create a new task. In the system folder there is a file called main.c which is where "int main()" is located. This runs before UserMain to initialize all the OS fucntionality.
-Larry