| With the rapid development of embedded technology,embedded real-time operating system has become more and more widely used,while some mechanical equipment and military technology also put forward higher requirements for real-time and reliability of embedded real-time operating system.For the improvement of real-time kernel is not a few,but only on the soft core algorithm have been unable to improve the real-time performance of system obviously,and at present,the development of the hardware based on FPGA technology is mature,the hardware logic data parallel processing system that can save a lot of time,so on the basis of improving soft accounting method,the soft core hardware is the current mainstream research direction.This article selects the μC/OS-Ⅱ operating system as the research object.Firstly,aiming at the problem that the scheduling algorithm only supports the priority-based scheduling strategy to limit the application scenario of the system,analysis of the existing scheduling algorithm,a two-level hybrid scheduling strategy is proposed.The first level scheduling retains the priority-based strategy of the original kernel,the second level scheduling adopts the same priority scheduling strategy,the real-time task adopts the time slice rotation algorithm,while non-real-time tasks adopt first-come-first-served algorithm.In this way,peer scheduling is added to the original kernel and the number of supported tasks is expanded.Secondly,the communication mechanism between tasks is an essential part of task scheduling.Aiming at the problem that mutex mechanism in μC/OS-Ⅱ frequently suspend tasks,the implementation mechanism of mutex is further divided into read and write operations,so that when a read task is occupied by a semaphore,Other tasks that want to read shared resources can still apply for semaphores to achieve read/read sharing,read/write mutual exclusion,and write/write mutual exclusion,thus improving the execution efficiency of communication between tasks.Finally,in the Quartus Ⅱ software development environment of Altera Company,Verilog hardware description language is used to complete the hardware design of the improved task management and task scheduling and the mutex module,and complete the function simulation and verification of each part. |