Reputation: 74
I would like to have a computer running only one program, so whenever the computer boots, it executes that program.
For example: Computer board from Tesla car, common supermarket systems
One example of how I use that: Develop a system to make a house automatic, so there would be a screen showing lights which can be turned on or off, and if the house runs out of power, when the energy come back the computer would reboot and display lights options again.
Do I have to build a OS for that?
Upvotes: 0
Views: 1734
Reputation: 16099
You should take a look at IncludeOS Which is made exactly for your purpose, only include what is needed.
Upvotes: 1
Reputation: 364458
A program that boots + runs on bare metal is called a "freestanding" program. It doesn't run under an OS, and includes everything it needs to manage the hardware, and includes all libraries it needs (statically linked).
It needs to do some of the same things an OS does (talk to hardware, install interrupt handlers, etc.) so in some respects you could call it an OS, but it's also just one program and doesn't necessarily provide any mechanism for running other programs.
The more bare-bones and light-weight the microcontroller is (and/or the program), the more obvious it is that it's just a program, not an OS. (e.g. if you don't do any dynamic memory allocation. Or you don't load any code from anywhere into RAM, just execute it from ROM).
BTW, an OS kernel is a freestanding program. Not all freestanding programs are kernels, but a kernel has to be be freestanding by the normal definitions of what a kernel is.
Also BTW, it's totally normal for an embedded system to run an OS, and have that OS start some specific programs. In fact the examples you cited do use OSes. So instead of writing all your own drivers, scheduling code, etc., you use an existing OS and write a program that runs under that OS.
Sometimes that OS is Linux, sometimes it's a light-weight real-time OS.
For a kiosk, sometimes that OS is even Windows. (Or in older systems, DOS which is barely an OS.) See comments under the question.
Upvotes: 2