Hello everyone, I am Architect Xiao En, here to explain the knowledge for the senior architect and system analyst examination in a fun way. Today, we will talk about the
special forces — Embedded Operating Systems.
If general-purpose operating systems (like Windows and Linux) are likened to “all-round warriors”, then embedded operating systems are like “precision snipers” —specifically designed for particular tasks, they operate on hardware with extremely limited resources (such as microcontrollers, sensors, and automotive ECUs), using minimal code and power to achieve core functions like real-time control, data acquisition, and communication..

For example:
- Your smartwatch can monitor heart rate, count steps, and display notifications 24/7, all managed by the embedded OS controlling low-power sensors and screens.
- The Tesla autopilot system can respond to changes in road conditions in seconds, relying on the embedded OS running real-time algorithms on the vehicle’s chips.
- The Mars rover operates stably in -130°C space, with the embedded OS serving as its “central brain”.
What is an embedded operating system?

It specializes in extreme environments and hardcore tasks, being the “invisible champion” in fields like the Internet of Things, industrial control, and automotive electronics.
Where are embedded systems applied in special places?

- Miniaturization: Minimize resource usage and code size,fitting the system into a “matchbox”, retaining only essential modules (like task scheduling and memory management), while cutting out “luxury configurations” like file systems and graphical interfaces;
- Real-time performance: Divided into hard real-time and soft real-time, the former requires responses within a specified time, while the latter allows occasional timeouts.
- Reliability: Must run stably and reliably, providing fault tolerance and failure prevention mechanisms, such as an internal watchdog timer that automatically restarts the system when it hangs.
- Customization: Supportsfunction trimming,retaining only necessary modules based on requirements.
- Portability: Shields lower-level hardware differences, allowing upper-level applications to be moved to different microprocessor platforms without modifying code.
How do embedded processors differ from traditional architectures?

Processors supporting embedded system deployment generally adopt Harvard architecture, differing from traditional architectures in the following ways:
| Architecture Classification | Definition | Characteristics | Typical Applications |
|---|---|---|---|
| Von Neumann Architecture | Also known as Princeton architecture, it is a memory structure that combines program instruction memory and data memory. | Instruction and data memory are combined. Both instructions and data are transmitted via the same data bus. | Generally used in PC processors, such as I3, I5, I7 processors. Note: Conventional computers belong to Von Neumann architecture. |
| Harvard Architecture | A parallel architecture characterized by storing programs and data in different memory spaces, meaning program memory and data memory are two independent memories, each with independent addressing and access. | Instructions and data are stored separately, allowing for parallel reading, resulting in higher data throughput. There are 4 buses: data and address buses for instructions and data. | Generally used in embedded system processors. Note: DSPs belong to Harvard architecture. |
I hope this meets your needs!
How do embedded systems achieve high portability?
Mainly through the underlying design techniques of hardware abstraction layers and board support packages.
The hardware abstraction layer (HAL) is like giving hardware operations a uniform uniform, encapsulating hardware-related code like register operations and interrupt handling into a unified interface, allowing the upper-level OS to call the interface without worrying about specific hardware implementations.
The board support package (BSP) acts like a “startup guide” for hardware, providing driver code, startup scripts, linking scripts, and other content.
How do embedded systems boot up?
The initialization process follows a bottom-up order, from hardware to software: chip-level initialization → board-level initialization → system initialization.
Chip-level refers to the initialization of the microprocessor, board-level refers to the initialization of other hardware devices, and system-level initialization refers to the initialization of software and the operating system.
- Chip-level initializationsets the CPU core parameters of the microprocessor (such as stack pointer and interrupt vector table);
- Board-level initializationconfigures other hardware device initialization parameters, including peripheral clocks, GPIO modes, and DMA channels;
- System initializationloads the embedded system kernel, creates initial tasks, etc., including:
- Driver code: initializes CPU, memory, and peripherals (like ADC, SPI);
- Startup scripts: configure clocks, frequency division coefficients, and pin multiplexing functions;
- Linking scripts: define the storage addresses of code in Flash/RAM.
-
Initialization process(bottom-up):
Chip-level initialization: sets CPU core parameters (such as stack pointer and interrupt vector table);Board-level initialization: configures peripheral clocks, GPIO modes, and DMA channels;System initialization: loads OS kernel, creates initial tasks.
What are the requirements for embedded software development?

Embedded software has its unique development methods and requirements, including:
- Development environment and deployment
Embedded software is developed using specialized embedded development tools. This is different from traditional software, which is written and tested directly on the target machine.
- Hardware-software collaboration
In embedded software development, it is essential to consider the interaction efficiency between software and hardware, as well as overall stability.
- Firmware storage
It needs to be unloaded onto the target machine using specialized tools or embedded in the target machine’s memory to run on the target machine.
- Specialized tools and devices
Without specialized development tools, target systems, and testing equipment, embedded software development can be extremely challenging.
- Performance requirements
Embedded software has very high requirements for real-time performance, safety, and reliability, needing to respond to external events in a very short time.
- Code size control
Due to limited resources in embedded systems, developers need to consider the size of the code when writing it.
- Special requirements for safety-critical systems
If embedded software is used in safety-critical systems, its development must also meet certain domain-specific design and code review requirements.
- Modular design
Modular design is an important method in embedded software development, dividing a larger program into several modules based on functionality, with each module implementing specific functions.
Why is it recommended to use dedicated devices for NAS services instead of deploying NAS software directly on a computer?

An important reason is that dedicated NAS devices are typically equipped with hardware optimized for storage, such as low-power processors, specially designed storage controllers, and numerous hard drive slots. These hardware configurations are designed to provide efficient data storage and access performance while maintaining low energy consumption. In contrast, using a regular computer as a NAS can lead to significantly higher operating costs due to higher power consumption and lack of energy efficiency optimization.
| Device Type | Average Power Consumption (W) | Daily Energy Consumption (kWh) | Annual Energy Consumption (kWh) | Electricity Price (CNY/kWh) | Annual Electricity Cost (CNY) |
|---|---|---|---|---|---|
| Dedicated NAS Device | 30 | 0.72 | 262.8 | 0.6 | 157.68 |
| Regular Computer Running NAS Software | 100 | 2.4 | 876 | 0.6 | 525.6 |
Even 100W for a computer is considered conservative, leading to a threefold difference in electricity costs over a year, and it needs to run 24 hours a day.
So, how can embedded devices achieve low power consumption? This is mainly reflected in:
| Low Power Design Secrets | Specific Explanation |
|---|---|
| Optimized Algorithms | By improving algorithm logic, unnecessary computation steps and data transmission can be reduced, thereby lowering processor power consumption. |
| Compiler Optimization Techniques | By adjusting the compiler’s optimization options, more efficient machine code can be generated, reducing power consumption during execution. |
| Software and Hardware Co-design | Ensuring that software instructions match hardware characteristics to avoid unnecessary hardware operations and improve energy efficiency. |
| Power Supply Partitioning and Timing Technology (with software coordination) | In software design, consider the usage frequency and duration of each module, dynamically adjusting power supply strategies for refined power management. |
| Selecting Low-Power Processors | In the early stages of software design, choose processors with low power characteristics as the hardware platform, laying the foundation for subsequent low-power designs. |
| Low Power Design of Buses (Software Optimized Transmission) | By optimizing data transmission protocols and timing in software, reduce data conflicts and retransmissions on the bus, lowering bus power consumption. |
| Design of Interface Driver Circuits (Software Control Optimization) | Design efficient interface driver software to reduce the number of switchings and duration of interface circuits, lowering interface power consumption. |
| Low Power Design of Board-Level Circuits (Software Layout Assistance) | In software design, consider board-level circuit layout, such as reasonably planning signal routing to reduce signal transmission distances and interference, indirectly lowering power consumption. |
Corresponding Exam Points:
- Embedded processors commonly adopt Harvard architecture to enhance data processing efficiency.
- Embedded systems are a type of operating system characterized by miniaturization, customizability, real-time performance, reliability, and portability.
- To improve portability, hardware abstraction layers and board support packages are used in the underlying design techniques.
- Initialization process of embedded systems: chip-level initialization → board-level initialization → system initialization. Chip-level refers to the initialization of the microprocessor, board-level refers to the initialization of other hardware devices, and system-level initialization refers to the initialization of software and the operating system.
- Embedded system software development differs from traditional development methods, requiring a comprehensive consideration of both software and hardware aspects.
Follow me, and I will help you apply what you learn and easily master computer knowledge!
