An Introduction to FreeRTOS Kernel Source Code: From Task Creation to Context Switching

An Introduction to FreeRTOS Kernel Source Code: From Task Creation to Context Switching

1. Introduction FreeRTOS has become the preferred choice for embedded real-time systems due to its small footprint, portability, and flexible customization capabilities. Before delving into the source code, let us review the core requirements of real-time operating systems (RTOS) in the embedded field: Determinism: Predictable task response delays. Scalability: Support for memory usage ranging from … Read more

How FreeRTOS Manages Time: An Analysis of Tick, Interrupts, and Scheduling Mechanisms

How FreeRTOS Manages Time: An Analysis of Tick, Interrupts, and Scheduling Mechanisms

Table of Contents Background and Overview Source and Configuration of Tick Timer 2.1 <span>configTICK_RATE_HZ</span> 2.2 Hardware Timer & <span>vPortSetupTimerInterrupt</span> Processing Flow of Tick Interrupt 3.1 Interrupt Entry and FreeRTOS Hook 3.2 Time Statistics and Delay Management Time Slicing and Dynamic Priority Scheduling 4.1 Preemptive vs. Cooperative Kernel 4.2 Round Robin Scheduling Context Switching Mechanism 5.1 … Read more

MIT6.S081 – Lab7 Multithreading | Process Scheduling

MIT6.S081 - Lab7 Multithreading | Process Scheduling

This article is a lab note for Lab7 of the MIT6.S081 Operating Systems course. The task is to simulate kernel process switching by implementing a user-level thread switching functionality. Additionally, I will introduce how xv6 achieves process switching by examining the source code. Lab7 address: https://pdos.csail.mit.edu/6.828/2020/labs/thread.html My lab records: https://github.com/yibaoshan/xv6-labs-2020/tree/thread Before starting the experiment, you … Read more

Guide to Building an RTOS Kernel (Part 1)

Guide to Building an RTOS Kernel (Part 1)

1IntroductionImagine if the MCU we work with only runs bare-metal programs; when it reaches a thread that includes a delay, our CPU would start to “idle”.To maximize CPU utilization, we need to use an RTOS (Real-Time Operating System). In simple terms, an RTOS is an operating system that schedules all available resources to complete real-time … Read more

Mastering RTOS Fundamentals (Part 1)

Mastering RTOS Fundamentals (Part 1)

This article discusses the three main elements of tasks: task control blocks, task stacks, and task entry functions, and highlights three important considerations when writing RTOS task entry functions. 1. Knowledge Review Before we officially start explaining the content, I will first review some basic knowledge points. Please ensure you have understood and mastered them. … Read more

A Method for Context Switching and Perfect Decoupling in Embedded Programming

A Method for Context Switching and Perfect Decoupling in Embedded Programming

Follow “Embedded Mix” and select “Star the Official Account” to progress together! Source: CSDN Fast Context Switching – cpost Application It is commonly believed that time-consuming operations cannot be executed during interrupts, as this would affect system stability, especially in embedded programming. For programs with an operating system, interrupt handling can be divided into two … Read more

A Solution for Context Switching in Embedded Programming

A Solution for Context Switching in Embedded Programming

Click the card below to follow Arm Technology Academy This article is from CSDN, and it mainly shares a solution for achieving high cohesion and low coupling during context switching in embedded programming.. Original link: https://blog.csdn.net/qq_34245464/article/details/111804661 The demands of embedded programming are ever-changing. To ensure system stability while maintaining code reusability, high cohesion and low … Read more

Embedded Communication Protocol: How Many RTOS Interview Questions Can You Answer?

Embedded Communication Protocol: How Many RTOS Interview Questions Can You Answer?

1. What Is the Task State Machine Model? The task state machine model describes the lifecycle and state transitions of a task. Typical states include: (1) Ready: The task can execute but is waiting for the scheduler to allocate CPU. (2) Running: The task is currently using the CPU to execute. (3) Blocked: The task … Read more

Ethernet Switch Chip Report: AI Boom and Domestic Breakthroughs

Ethernet Switch Chip Report: AI Boom and Domestic Breakthroughs

(Report Producer/Author: CITIC Securities, Huang Yayuan) Detailed Explanation of Switch Chips: Core Components of Switches, Responsible for Forwarding Functions Switches: The Core Foundation of the Digital Economy A switch is a network device used for forwarding electrical (optical) signals, providing a dedicated telecom signal pathway for any two network nodes connected to it, thus forwarding … Read more

Four Networking Methods of Switches and Eight Common Troubleshooting Techniques

Four Networking Methods of Switches and Eight Common Troubleshooting Techniques

The switch is a very important part of network construction, and some friends have doubts about how to choose a switch. Before choosing a switch, you should first understand how switches are used in networking. This article summarizes the networking methods of switches in four network scenarios and common troubleshooting solutions. 1. Small Network A … Read more