Set-top box C Language Development (ucos C Language Development), set-top box ucos
Ucos C Language Development
I am now working in an export set-top box company. The company only serves foreign markets and its products mainly include T2/S2 COMBO (T2_S2)-C-T. The set-top box uses the ucos operating system, and the chip comes from montage, which is in the rising stage compared with sunpluse ali.
Ucos operating system:
μC/OS II (Micro-Controller Operating System Two) is a ROM-based, customizable, preemptible, and real-time multi-task kernel with high portability, it is particularly suitable for microprocessor and controller, and is suitable for many real-time operating systems (RTOS) with comparable commercial operating system performance ). To provide the best porting performance, μC/OS II is developed using ANSI C language to the maximum extent and has been transplanted to nearly 40 processor systems, it covers a variety of CPUs (including DSP) from 8-bit to 64-bit ). μC/OS II can be regarded as a multi-task scheduler. On this scheduler, complete and add system services related to multi-task operating systems, such as semaphores and mailboxes. Its main features include open source code, clear and clear code structure, detailed comments, organized, portable, cropped, and solidified.
μC/OS-II can be roughly divided into core, task processing, time processing, task synchronization and communication, CPU transplantation and other five parts.
1) core part (OSCore. c) It is the core of the operating system processing, including operating system initialization, operating system running, leading interrupt in and out, clock cycle, task scheduling, event processing, and so on. The basic work of the system is maintained here.
2) the content in the processing part of the task processing part (OSTask. c) is closely related to the operation of the task. Including task creation, deletion, suspension, and restoration. Because the μC/OS-II is scheduled Based on the task, so this part of content is also very important.
3) The minimum clock unit in the clock part (OSTime. c) μC/OS-II is timetick (clock beat ). Task latency and other operations are completed here.
4) task synchronization and communication are part of event processing, including semaphores, mailboxes, message queues, and event signs. They are mainly used for interlinking tasks and access to critical resources.
5) the interface part with the CPU refers to the porting part of the μC/OS-II for the CPU used. Because μC/OS-II is a universal operating system, the implementation of the key issues, or need to be transplanted according to the specific content and requirements of the specific CPU. This part of content involves SP and other system pointers, so it is usually written in assembly language. It mainly includes the underlying implementation of interruption-level task switching.
Current, the underlying implementation of task-level task switching, clock cycle generation and processing, and interrupt-related processing.
At present, some tasks that use the clock in the development process and process some communication components at the underlying layer have not been fully touched yet. For example, sleep (200) is a latency operation of the clock part. The creation thread OS _creat_Task is part of the task processing part, and the message responding to the remote control button is part of the communication part.