OS running on MCU

click_here

Joined Sep 22, 2020
548
Embedded programming using an OS is a sort after skill.

I see jobs pop up asking for Linux for embedded programming all the time on seek (a large job site here in Australia).

I just checked and there are still lots of jobs asking for it, so if you want to look into OS' in embedded systems, I'd say that you are not wasting your time :)

Based on the job ads I just saw (in my 5sec search) the one that you want to look into is Linux.
 

nsaspook

Joined Aug 27, 2009
13,312
What we see on most PICS are resource sharing executives/kernels (Kernel is piece of software which manages/handle the hardware) not a computer OS that manages general compute resources in the normal sense of the word. The Linux kernel is a very comprehensive OS component that can be configured to be suited for embedded programming but even a user interactive version of the kernel is useless without a set of operating system of utilities (GNU system) to make it 'general-purpose' OS.

You might need a complete OS for a 'general-purpose' computer application but most PIC sized Embedded Systems are very specific in their application so a complete OS, even if it would fit in the small memory space is usually a waste of resources for one specific application. IF you're really interested in embedded programming the you should first study (Take an Operating Systems class or two for an introduction to this complex subject) most of the general information of classic Operating Systems to really understand the problem set that needs to be solved by a OS.
https://forum.allaboutcircuits.com/...-make-the-main-loop-sleep.172188/post-1542674
 

Papabravo

Joined Feb 24, 2006
21,227
What we see on most PICS are resource sharing executives/kernels (Kernel is piece of software which manages/handle the hardware) not a computer OS that manages general compute resources in the normal sense of the word. The Linux kernel is a very comprehensive OS component that can be configured to be suited for embedded programming but even a user interactive version of the kernel is useless without a set of operating system of utilities (GNU system) to make it 'general-purpose' OS.

You might need a complete OS for a 'general-purpose' computer application but most PIC sized Embedded Systems are very specific in their application so a complete OS, even if it would fit in the small memory space is usually a waste of resources for one specific application. IF you're really interested in embedded programming the you should first study (Take an Operating Systems class or two for an introduction to this complex subject) most of the general information of classic Operating Systems to really understand the problem set that needs to be solved by a OS.
https://forum.allaboutcircuits.com/...-make-the-main-loop-sleep.172188/post-1542674
I might argue that the opposite approach of looking at application specific implementations on an embedded processor can create a knowledge base that will be invaluable when you go to take that Operating Systems Class.
 

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
Please correct me if I am misunderstanding the statement that the operating system manages hardware resources.

As I understand that operating system is a program which is written by the programmer to control the resources of the MCU. What are the resources of MCU. I think the resource is related to the timer, memory, interrupt. I think OS only controls these resources. The peripherals of the MCU are not included in the resources And the OS doesn't control directly peripherals of MCU
 

Papabravo

Joined Feb 24, 2006
21,227
Please correct me if I am misunderstanding the statement that the operating system manages hardware resources.

As I understand that operating system is a program which is written by the programmer to control the resources of the MCU. What are the resources of MCU. I think the resource is related to the timer, memory, interrupt. I think OS only controls these resources. The peripherals of the MCU are not included in the resources And the OS doesn't control directly peripherals of MCU
Wrong. All system resources should be under OS control regardless of the "type" of OS we are talking about. Why? Because there is no alternative. system resources include all the peripheral devices accessible to the CPU(s).
 
Last edited:

nsaspook

Joined Aug 27, 2009
13,312
I don't disagree with that.

The Operating Systems Class is obviously more abstract but that's a good thing if your objective is computer science and architecture and not computer programming. Application specific implementations are dissected during a good Operating Systems design class to show you 'why' X was done instead of explaining 'how' to do X.
 

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
Wrong. All system resources should be under OS control regardless of the "type" of OS we are talking about.
Thanks for clarifying. There is another statement which I may not understand very well. It says that the processor is always busy in the real time operating system. What does it mean ?

MCU will always be busy executing the code when the code runs on it. But we can say that the processor is not doing anything just waiting when software delay is used in the code
 

nsaspook

Joined Aug 27, 2009
13,312
Thanks for clarifying. There is another statement which I may not understand very well. It says that the processor is always busy in the real time operating system. What does it mean ?

MCU will always be busy executing the code when the code runs on it. But we can say that the processor is not doing anything just waiting when software delay is used in the code
It could be busy sleeping. That's a perfectly valid execution state for a processor.

It depends on how long the software delay is and for what event. A one instruction cycle NOP delay is a lot different from a several second delay in the approach one would chose to implement that delay if events need to handled asynchronously in real-time during that delay in a thread of execution.
 

Thread Starter

Pushkar1

Joined Apr 5, 2021
416
It could be busy sleeping. That's a perfectly valid execution state for a processor.
I wonder if the processor sleeps in real time operating system. Sorry but I still don't understand what it really means that the processor is always busy in managing the resources in the real time operating system.
 
Top