Friday, December 31, 2010

uCOS-III VS uCOS-II (File Names and Contents)

This is the second post out of five under the same topic. In the first post in the comparison, I pointed out the difference in features. In this post, I will point the difference in file names and contents in both kernels. Difference can be summed up to 13.

Changes in File Names and Contents
1- os_app_hooks.c is added to uCOS-III for convenience so the user can add application hooks. Copy this file to the application directory and edit the contents of the file.
2- os_cfg_app.h is added to uCOS-III. In old uCOS-II, all configurations were stored in os_cfg.h. In uCOS-III, application specific configurations are moved from os_cfg.h to os_cfg_app.h.
3- os_cfg_r.h used in uCOS-II as a starting point for configuring the kernel is now changed to os_cfg.h in uCOS-II. The new file is reserved for configuring non-application specific kernel features.
4- Porting files are the same but some variables and function names are changed.
  • OSIntNesting to OSIntNestingCtr
  • OSTCBCur to OSTCBCurPtr
  • OSTCBHighRdy to OSTCBHighRdyPtr
  • OSInitHookBegin to OSInitHook
  • OSTaskStatHook to OSStatTaskHook
  • OSTaskIdleHook to OSIdelTaskHook
  • OSInitHookEnd and OSTCBInitHook are removed
  • OSTaskStkInit in the new kernel has different arguments. Instead of taking the task's stack start address, it takes the task's stack size and its stack base address. This implies a slight change in this function code in uCOS-III.
5- os_dbg.c is a must in uCOS-III compared to its counter part, os_dbg_r.c, in uCOS-II.
6- os_int.c is added to uCOS-III to support the new feature called interrupt queuing in uCOS-III. This feature allows posting calls from ISRs to be deferred to a task level handler. The goal behind this feature is to reduce interrupt latency.
7- os_pend_multi.c is added to uCOS-III to allow tasks to pend on multiple kernel objects. The old code was written in os_core.c in uCOS-II.
8- os_prio.c is added to uCOS-III to isolate the code that determines the highest priority task ready to run. A port developer can re-implement this file in assembly equivalent if this will improve the performance.
9- A message mailbox is simply a message queue with one entry. That's why the file os_mbox.c is no longer available in uCOS-II.
10- os_msg.c is added to uCOS-III to encapsulate the management of messages in message queues.
11- os_stat.c is added to uCOS-III to extract the statistics task code from os_core.c.
12- os_type.h is added to uCOS-III. This file is used to adapt the data types sizes to the cpu architecture rather than being assumed by the port developer as in uCOS-II.
13- os.h is added to uCOS-III to act as the main header file and replace ucos_ii.h in uCOS-II.

1 comment: