⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1streadm

📁 各种硬件平台上的us OS移植实例(arm6)
💻
字号:
-------------------------------------------------------------------------------To build uC/OS:1) You will need a C-Demon source directory, so that the C-Demon   manifests and target architecture description files can be found.2) Update the Makefile to reflect the architecture you are targetting.3) make--------------------------------------------------------------------------------- NOTEs -----------------------------------------------------------------------------------------------------------------------------------------------------This release does not provide a full run-time system as required bythe ARM C compiler (i.e. __rt_sdiv10, etc.). It is assumed that theuser will link against the standard ARM library if they want suchsupport functions. However, using the current ARM library may resultin the initialisation from the library being used. This may causeproblems with C-Demon based systems due to some differences between itand the old assembler Demon.-------------------------------------------------------------------------------The uC/OS world is very simple at the moment, and there is no supportfor ARM aborts (prefetch or data), or any undefined instructionsupport. It only provides basic tasking support.-------------------------------------------------------------------------------The uC/OS system *NEEDS* to provide its own IRQ and FIQ vectorhandlers to deal with the magic of providing complete contextswitches. To perform a context switch cleanly the interrupt code needsto have access to *ALL* of the processor state at the instance of theinterrupt. It is not possible to use the C-Demon IRQ and FIQ vectoringsystem, since uC/OS would then need to know about the workspace andstack usage of the C-Demon system interrupts handlers to be able torecover the complete processor state.Unfortunately coding the main IRQ handler in C (using the __irqextension) is not a viable option. Since we do not have access to theinitial stack pointer and register contents from C. The compiler willhave saved the registers it thinks it needs to, and will have createda stack frame that we do not know the size of. To provide the handleras a C routine we would need to use the __irq extension, whichprecludes the use of a stack call frame. If we did build the worldwith frame-pointer support, we would be able to decode the stackusage. However such a scheme would be quite slow.The best all round compromise is for the uC/OS environment to provideits own, specific, system interrupt handlers.These system handlers are attached and initialised as part of theuC/OS OSStart function. To add ISRs for a particular targetarchitecture interrupt source requires that eitherARMInstallIRQHandler or ARMInstallFIQHandler be called to attach theuser supplied handler routine:	#include "osdefs.h" /* uC/OS ARM interface */	IRQHandlerFn prev ; /* holder for previous handler function */	if ((prev = ARMInstallIRQHandler(bitpos,newISR)) == NULL)	 SWI_Write0("Failed to attach IRQ handler\n") ;NOTE: The attached ISR routines are executing with interruptsdisabled, so they should not call anything that may perform anOS_EXIT_CRITICAL.-------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -