Preface
My first book, “µC/OS, The Real-Time Kernel” is now 6 years old and the publisher has sold well
over 15,000 copies around the world. When I was asked to do a second edition, I thought it would
be a fairly straightforward task; a few corrections here and there, clarify a few concepts, add a
function or two to the kernel, etc. If you have a copy of the first edition, you will notice that
“µC/OS-II, The Real-Time Kernel” is in fact a major revision. For some strange reason, I wasn’t
satisfied with minor corrections. Also, when my publisher told me that this time, the book would
be a ‘hard cover’, I really wanted to give you your moneys worth. In all, I added more than 200
new pages, and re-wrote the majority of the pages I did keep. I added a porting guide to help you
port µC/OS-II to the processor of your choice. Also, I added a chapter that will guide you through
upgrading a µC/OS port to µC/OS-II.
The code for µC/OS-II is basically the same as that of µC/OS except that it contains a number of
new and useful features, is much better commented, and should be easier to port to processor
architectures. µC/OS-II offers all the features provided in µC/OS as well as the following new
features:
• A fixed-sized block memory manager,
• A service to allow a task to suspend its execution for a certain amount of time
(specified in hours, minutes, seconds and milliseconds),
• User definable ‘callout’ functions that are invoked when:
a task is created,
a task is deleted,
a context switch is performed,
a clock tick occurs.
• A new task create function that provides additional features,
• Stack checking,
• A function returning the version of µC/OS-II,
• And more.
µC/OS-II Goals
Probably the most important goal of µC/OS-II was to make it backward compatible with µC/OS (at least from an
application’s standpoint). A µC/OS port might need to be modified to work with µC/OS-II but at least, the application
code should require only minor changes (if any). Also, because µC/OS-II is based on the same core as µC/OS, it is just
as reliable. I added conditional compilation to allow you to further reduce the amount of RAM (i.e. data space) needed
by µC/OS-II. This is especially useful when you have resource limited products. I also added the feature described in
the previous section and cleaned up the code.
Where the book is concerned, I wanted to clarify some of the concepts described in the first edition and provide
additional explanations about how µC/OS-II works. I had numerous requests about doing a chapter on how to port
µC/OS and thus, such a chapter has been included in this book for µC/OS-II.