UCOS transplantation

xiaoxiao2021-03-05  22

In the past few days, I saw the μCOS embedded operating system, and there were experiences on the Internet who said that learning μCOS is the simplest entry embedded operating system. During this time, I saw a book about μCOS, learning an embedded operating system, and the most important thing is to apply. The first question to be solved is transplantation.

μCOS is completely written by C (except for C-cannot prepared with the underlying hardware: this is also the focus of transplantation).

The transplantation has several major focus: modifying 3 files_cpu.h mainly the definition, constant and macro definition of the data structure. This part is relatively simple. The second is OS_CPU_C.C, which is mainly Ostaskstkinit () over this file, mainly involved is to initialize the stack, we know the task switching, interrupt, etc. in μCOS, etc. Maintain the original task stack, go to the new task, The interrupt stack makes restore processing, so this part of the rewriting is very important. The third is an overwritten of the file of OS_CPU_A.ASM, including OsStarhighrdy (), OSCTXSW (), OSINTCTXSW (), and Ostickisr (). Simple processing of 4 functions.

Completing this above the above operations also completed the migration of μCOS, which was then tested.

This is a 51 Keilc transplant code, interested in download

转载请注明原文地址:https://www.9cbs.com/read-35665.html

New Post(0)