11 Misconceptions About µC/OS

↑ Click the “Mactec Technology” above to follow us

11 Misconceptions About µC/OS

On the occasion of the 25th anniversary of µC/OS, Jean Labrosse (founder of Micrium and expert in RTOS and embedded design) believes it is a good opportunity to clarify some misconceptions about this popular kernel.

µC/OS, a world-renowned embedded real-time operating system (RTOS), celebrates its 25th anniversary this year. This is an appropriate time to clarify some misconceptions that have circulated in the embedded market over the years regarding this product.

1. The µC/OS kernel is developed by the community

Absolutely not. I wrote 100% of the source code and a series of books describing the internal structure of the µC/OS kernel: µC/OS (1992), µC/OS-II (1998), and µC/OS-III (2008). The only help I received was as an author of the books, and like most typical writers, I did receive a lot of feedback from embedded developers, which led to the development of corresponding features to meet their requirements. However, over the past few years, Micrium’s developers have adhered to the strict coding guidelines I established when I founded Micrium to maintain the code.

Nonetheless, I am always eager to hear customer needs. Ultimately, for this reason, the µC/OS kernel reflects user demand. Thus, I feel it is a “win-win” situation. The kernel benefits from feedback submitted by users and the community, and users receive professionally maintained support from a commercial entity.

11 Misconceptions About µC/OS

2. µC/OS is based on other kernels

µC/OS was inspired by the VRTX kernel from Ready System, but only as a guideline for understanding what functions are necessary. µC/OS was independently designed and written in C, with a strong emphasis on high portability from the start. As a result, other kernels have been inspired by the structure of the µC/OS kernel. For example, FreeRTOS has recently added some features that were previously unique to µC/OS-III: task semaphores, task message queues, and static allocation of kernel objects. Moreover, task stacks can be allocated statically or dynamically to any place in RAM.

3. µC/OS is a real-time kernel, not an RTOS

When I designed µC/OS, the terms real-time kernel and real-time operating system (RTOS) were synonymous. In 1992, every RTOS was a kernel. Perhaps I should have called it µC/RTK, but I believe it is more of a microcontroller (MCU) operating system. Because, back then (in 1992), operating systems were much simpler than they are now. The definition of RTOS is debatable today. For example, FreeRTOS is a kernel (just like µC/OS), but more than a decade after the launch of the µC/OS operating system, Richard Barry (the author of FreeRTOS) prominently used RTOS in the name of his kernel.

4. µC/OS is limited to 64 tasks

In fact, for the original µC/OS, when it was released in 1992, it only supported 64 tasks. The limitation was because µC/OS was specifically targeted at small microcontrollers (typically 8-bit). I decided that each task would be assigned a unique priority, represented by a bit in a bitmap (8×8 matrix). One very attractive feature of the real-time kernel is that I adopted a very efficient algorithm (setting or clearing a bit), which ensures that execution time is constant and deterministic.

In 1998, we released µC/OS-II, which also used the bitmap algorithm. However, it could be configured for either an 8×8 or 16×16 bitmap, allowing for up to 256 different tasks and priorities.

We released µC/OS-III in 2008, removing the restriction of only one task per priority. In other words, multiple tasks can share the same priority. This feature made the priority inheritance feature of mutexes and round-robin scheduling algorithms for multiple tasks at the same priority a reality. We retained the scheduling bitmap, but the order of the table was reversed. Therefore, we can speed up the scheduling process using the leading zero count (CLZ) instruction provided by ARM Cortex-M processors and other architectures. In fact, if you only need 32 priorities, the scheduling algorithm can be implemented using a single embedded assembly instruction CLZ.

In 2017, we released Micrium OS (a fully functional embedded operating system), which includes the µC/OS5 kernel. We skipped µC/OS-IV because Micrium OS included the very popular Micrium µC/ series middleware (file system FS, graphical user interface GUI, and protocol stack). Some of these modules have been marked as version 5, so for those versions that are already V5 modules, we did not want to regress. µC/OS 5 is deeply built on µC/OS-III, with some improvements, and is consistent with other Micrium OS modules.

11 Misconceptions About µC/OS

5. RTOS requires a Memory Management Unit (MMU)

Customers often tell us that their impression of real-time operating systems is that they require a hardware memory management unit. The reality is that they do not need one, and µC/OS is no exception. Although MMUs are more common than before, there has never been a requirement for an MMU when using real-time operating systems.

6. The µC/OS-xx kernel is free and only for hobbyists, not professionals

The µC/OS kernel is designed for professional users and has been applied in thousands of products and systems worldwide, including NASA’s Curiosity Mars rover. µC/OS-II and µC/OS-III are certified operating systems in safety-critical applications. µC/OS 5, based on μC/OS-III, has not yet been certified. The table below summarizes the certification status.

11 Misconceptions About µC/OS

If you intend to use our provided kernel in a profitable commercial product, you will need to pay a licensing fee for the kernel. In other words, the µC/OS kernel is free for non-commercial use, and in fact, all code available for download is provided in source code form. If you do not intend to use the µC/OS kernel for profit, then you do not need to pay for it. In general, students, educators, hobbyists, etc., can download and use the kernel for free.

7. The µC/OS-III book is a user guide

These books are not just user guides; they can also be used for education and practice. Of course, the quality and content of the books have evolved over the years (from the µC/OS book to the μC/OS-III book). The latest book (μC/OS-III) is designed in four parts:

  1. The first two-thirds of this book explains what the kernel is, how to use it, and illustrates how the kernel works using μC/OS-III as an example.

  2. The last third of this book discusses examples of how to use μC/OS-III with microcontrollers (MCUs) and tools.

  3. Each book targets a specific evaluation development board, so you can practically test the examples.

  4. Finally, each book includes obtaining a free tool (compiler, assembler, linker/locator, and debugger) to run μC/OS-III instances on the evaluation development board.

The μC/OS-III book has seven versions, each corresponding to a different MCU and semiconductor vendor.

1. ST and STM32F107 (IAR tools)

2. NXP and LPC1768 (Keil tools)

3. Renesas and SH7216 (HEW tools)

4. Renesas and RX62N (HEW tools)

5. Freescale/NXP and Kinetis K53 (IAR tools)

6. Infineon XMC4500 (IAR tools)

7. TI and Stellaris LM3S9B92 (IAR tools)

8. µC/OS kernel is unpopular

Industry surveys consistently show that the µC/OS kernel is widely used. These books have also made the kernel very popular. You can download all the µC/OS eBooks for free from the Micrium website (except for version 1 of µC/OS). Over the years, we have sold or provided for free (in both print or PDF format) hundreds of thousands of copies, reaching about 50% of embedded developers worldwide. Some books have also been translated into several languages:

  • µC/OS has been translated into Chinese, with parts of the book translated into Japanese.

  • µC/OS-II has been translated into Chinese and Korean.

  • µC/OS-III has been translated into Chinese.

In addition to this book, the µC/OS kernel has been ported to almost all processors. Any processor is likely to have µC/OS running on it.

9. The µC/OS kernel is the first OS kernel ported to many ARM processors

This is absolutely true. µC/OS was the first OS kernel ported to ARM6, ARM7, and ARM9 processors. µC/OS-II was also the first OS kernel ported to the Cortex series processors. At the same time, the µC/OS kernel has been used to validate some new CPU architectures, including the AMD 29000 series, Altera Nios and NIOS-II, Xilinx MicroBlaze, and other processors. In fact, some features in the design of the ARM Cortex-M architecture are derived from the µC/OS kernel:

  • Dedicated timer for tick interrupts (called SysTick)

  • CLZ (count leading zeros) instruction helps µC/OS improve scheduling algorithm performance, also used for floating-point operation normalization

  • Hangable interrupt vector for context switching (called PendSV handler)

  • Tail interrupt function. During back-to-back interrupts, it avoids meaningless saving and restoring of CPU registers

11 Misconceptions About µC/OS

10. The µC/OS kernel code is messy and difficult to use

I am very picky about coding style and code quality. Don’t take my word for it: Jack Ganssle (a well-known embedded system developer, writer, lecturer, and consultant) once said that Micrium’s code is the most beautiful and the cleanest code he has ever seen. The kernel’s coding style is very consistent, well-commented, and highly efficient.

For example, all kernel APIs, variables, data types, and macros have the prefix “OS”, making it easy for users to utilize and identify the kernel structure. Additionally, the coding style convention places code on the left and comments on the right, making it easier for programmers to follow the coding style (if they need to). I have always believed that programmers should not be limited to 80 columns, as was the case many years ago.

Another coding style convention is that each functional module is prefixed with a comment header block describing the function, parameters, return values, etc. By browsing through Micrium’s code, you will also notice some other subtle details, such as alignment of equal signs and arrangement of comment delimiters reflecting our high attention to code detail quality.

As for the difficulty of using the µC/OS kernel, this is not the case. Extensive books, blogs, application notes, training materials, user communities, and other open-source resources, along with its unified coding standards and detailed code comments, make it possible for the µC/OS kernel to run with minimal technical support. These APIs are highly intuitive and consistent.

11. Micrium will abandon µC/OS-II and µC/OS-III, only supporting Silicon Labs chips

Absolutely not. We (Micrium and Silicon Labs) will certainly not abandon these already very popular products or the technical support work for other architecture processors. In fact, we intend to continue to provide support for other architecture processors. Micrium has supported about 45 processor architectures, so for developers considering using the kernel in their projects, choosing from the processors we support will be much easier.

We often encounter individual customers requesting ports for processor architectures that are already supported. Micrium will not change its commitment to continue providing technical support due to the acquisition by Silicon Labs. As part of Silicon Labs, Micrium’s mission is to continue supporting both new and old customers, regardless of what CPU they wish to use. Therefore, if customers have been using and wish to continue using ST, NXP, TI, Renesas, Altera, Xilinx, etc., Micrium will continue to support them as always.

11 Misconceptions About µC/OS

Leave a Comment