bare metal explanaion

Thread Starter

alimash

Joined Oct 12, 2016
67
hello guys
i recently got a nanopi m1 board
and i was reading online about how i can install an operating system on it
then i read about bare metal environment
what i know that it is running the controller with no operating system installed
is that a precise definition?
can any one link me to an article about it or maybe explain it further?
thank you
 

ErnieM

Joined Apr 24, 2011
8,377
AFAIK yes, bare metal in this context is code run on a small micro with no over riding operating system. It is very efficient for speed and resource usage, though the programmer must understand all the interactions of the code and hardware.

Sorry I have no links to share, it is just a common knowedge term.

As Wikipedia would put it, "citation needed."
 

nsaspook

Joined Aug 27, 2009
13,315
Even with an OS like Linux it's still possible to run code in a close to bare metal environment (direct hardware hacking) at the kernel level. The trick is how to make your code compatible with the OS and other OS processes. Most of the ARM SOC hardware is fairly complex, this makes true bare metal programming of all the possible hardware without an OS a difficult job at best.

http://linux-sunxi.org/H3
 

Thread Starter

alimash

Joined Oct 12, 2016
67
ok friends
thank you all for replying
i now have a general idea
statements:
1-bare metal is programming in hardware level,no operating system running
2-not all microcontroller are designed to handle an operating system(pic for example),the programmer interact with the registers to make a complete code for a specific application
this lead to one result:
the term "bare metal" only exist in the case where a processor or a devloppment board(rasbpery bi for example) can handle an operating system,but the programmer choose not to use this feature for the sake of abstractions and layers of processing that may slow the application
my questions are :
1-did i get it right?
2-is speed the only adventage in bare metal? and how much can this be critical?
3-if i want to learn further,what courses do you recommend?
 

nsaspook

Joined Aug 27, 2009
13,315
1. You can program 'bare metal' with the right kind of OS and language tools. Bare metal programming is a buzz word with little concrete absolute meaning.
2. Most simple embedded systems are programmed as a 'bare machine' where the programming instructions directly operate on the computer hardware. This usually is when there is a monolithic, single-purpose software application. You don't need an OS to blink a LED or to read a signal and send it via a RS-232 data line so the lack of a OS reduces the computer resources needed for simple tasks at the expense of the programmer knowing every detail of the 'bare machine'. With modern multi-core hardware it's easy to get 'bare machine' speed with an OS that's designed for nuts&bolts systems programming like Linux.
3. If you really want to learn modern 'bare machine' programming in detail you need to understand the reasons for modern OS design so you can use those concepts during 'bare machine programming'. Just about any complicated embedded multi-tasking program with shared resources with eventually contain OS elements so it's a requirement to know what works for your application.
Some books from my personal collection that provide the basic concepts of modern OS computer systems. I sure you can find many others online today.

 
Last edited:

Thread Starter

alimash

Joined Oct 12, 2016
67
1. You can program 'bare metal' with the right kind of OS and language tools. Bare metal programming is a buzz word with little concrete absolute meaning.
2. Most simple embedded systems are programmed as a 'bare machine' where the programming instructions directly operate on the computer hardware. This usually is when there is a monolithic, single-purpose software application. You don't need an OS to blink a LED or to read a signal and send it via a RS-232 data line so the lack of a OS reduces the computer resources needed for simple tasks at the expense of the programmer knowing every detail of the 'bare machine'. With modern multi-core hardware it easy to get 'bare machine' speed with an OS that's designed for nuts&bolts systems programming like Linux.
3. If you really want to learn modern 'bare machine' programming in detail you need to understand the reasons for modern OS design so you can use those concepts during 'bare machine programming'. Just about any complicated embedded multi-tasking program with shared resources with eventually contain OS elements so it's a requirement to know what works for your application.
Some books from my personal collection that provide the basic concepts of modern OS computer systems. I sure you can find many others online today.

thank you man
you were very helpful
see you around
 
Top