摘要
Free RTOS作为一种开源的轻量级多任务实时操作系统,被广泛应用在各种嵌入式仪器和设备中,但该操作系统不支持软件模块的动态加载,这限制了它的灵活性和扩展性。本文在详细分析ELF文件符号重定位原理的基础上,通过修改Free RTOS任务的内存布局,并在其内核中添加ELF文件加载器,实现软件模块的动态加载和卸载功能。程序在STM32平台上的测试结果表明,软件模块能够在系统运行时被动态加载入内存,并成功被Free RTOS内核调度执行。
Free RTOS,as an open source lightweight multi- task real- time operating system,is widely used in all kinds of embedded instruments and equipments. But Free RTOS does not support the dynamic loading of the software module,which limits its flexibility and scalability. Based on the detailed analysis of symbol relocation principle in the ELF file,dynamic loading and unloading function of the software module is realized by modifying the memory layout for Free RTOS task,and adding the ELF file loader in the kernel. The test results on the STM32 platform show that the software module can be dynamically loaded into the memory and successfully scheduled by the kernel,while the OS is running.
出处
《计算机与现代化》
2016年第6期24-28,共5页
Computer and Modernization
基金
北京交通大学基金资助项目(2012JBZ015)