摘要
研究了μC/OSII的内存管理,发现当对一个申请到的内存块进行越界写操作或产生了指向空闲内存块指针区(头几个字节)非法指针时可能会破坏它指向下一个空闲内存块的指针,这样,空闲内存块链表就会被破坏。出于安全性要求,必须将控制信息与用户使用的空闲内存块分开,内存块的控制信息属于系统数据,必须对其进行保护。利用μC/OSII的就绪表(ReadyList)中任务的调入和删除原理,构造一个内存管理表,实现内存块的分配和释放。由此,μC/OSII在内存管理中存在的安全性问题得到了解决。
The memory management of μC/OSII is studied,find the pointer which point to the next free memory block and which stored in the free memory blocks'first several bytes will be destroyed when an allocated memory block is written over the edge of it by accidentally, or is pointed to it pointer area(the first several bytes) by the illegal pointer,so the free memory block list will be destroyed.For safety,must extract the control information from the free memory blocks,the memory control information must be protected because it belong to the system data.Then,apply the way of place and remove a task in the ready list,realize the allocation and de-allocation of the memory block by constructing a memory management list.From this,the safe problem of μC/OSII memory management is solved in the new method.
出处
《微机发展》
2005年第5期137-138,141,共3页
Microcomputer Development