Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
2012 / uCOS / uCOSII_ebook.pdf
Скачиваний:
90
Добавлен:
10.02.2015
Размер:
1.08 Mб
Скачать

Chapter 10

Upgrading from µC/OS to µC/OS-II

This chapter describes what you need to do to migrate a port done for µC/OS to run on µC/OS-II. If you have gone through the effort of porting µC/OS to a processor then the amount of work to get this port to work with µC/OS-II should be minimal. In most cases, you should be able to do this in about an hour. If you are familiar with the µC/OS port then, you may want to go to the summary in section 10.05.

10.00Directories and Files

The first thing you will n otice in that the directory structure for µC/OS-II is similar to µC/OS except that the main directory is called \SOFTWARE\uCOS-II instead of \SOFTWARE\uCOS, respectively.

All µC/OS-II ports should be placed under the \SOFTWARE\uCOS-II directory on your hard drive. The source

code for each microprocessor or microcontroller port MUST be found in either two or three files: OS_CPU.H, OS_CPU_C.C and optionally, OS_CPU_A.ASM. The assembly language file is optional because some

compilers will allow you to havein-line assembly language and thus, you can place the needed assembly language code directly in OS_CPU_C.C.

The processor specific code (i.e. the port) for µC/OS was placed in files having the processor name as part of the file names. For example, the Intel 80x86 real-mode, large model had files called: Ix86L.H, Ix86L_C.C, and

Ix86L_A.ASM. Table 10.1 shows the correspondance between the new file and directory names and the old ones.

\SOFTWARE\uCOS\Ix86L

\SOFTWARE\uCOS-II\Ix86L

Ix86L.H

OS_CPU.H

Ix86L_A.ASM

OS_CPU_A.ASM

Ix86L_C.C

OS_CPU_C.C

Table 10.1, Renaming files for µC/OS-II

As a starting point, all you have to do is copy the old file names (from the µC/OS directory) to the new names in the equivalent µC/OS-II directory. It will be easier to modify these files than to create them from scratch. Table 10.2 shows a few more examples of µC/OS port file translations.

\SOFTWARE\uCOS\I80251

\SOFTWARE\uCOS-II\I80251

I80251.H

OS_CPU.H

I80251.C

OS_CPU_C.C

 

 

\SOFTWARE\uCOS\M680x0

\SOFTWARE\uCOS-II\M680x0

M680x0.H

OS_CPU.H

M680x0.C

OS_CPU_C.C

 

 

Соседние файлы в папке uCOS