0

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?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • No, you don't need an OS for that. You can create a simple device like that if yoi have background in electrical/electronics/computer engineering. Or you could create one using something like a Raspberry Pi. It needs an OS though which can be easily installed. – Rod Talingting Jul 05 '20 at 02:11
  • 3
    thats not now a tesla car nor supermarket system works, those run operating systems and there is more than one thing going on. (for decades they ran DOS so sure one could argue one program, but now its windows (supermarket register/systems)). For all of these operating systems there are ways to start a program which is operating system dependent. – old_timer Jul 05 '20 at 04:02
  • 1
    if you want a baremetal program then sure you can write that (an operating system itself is a baremetal program). but the defined problem has nothing to do with one program or needing baremetal, etc you can simply download an app for that on an inexpensive amazon fire tablet. Or write your own for windows, or ios or android or linux or macos, etc. You need to define the problem better and explain how you came to this/these requirements. – old_timer Jul 05 '20 at 04:05
  • It seems that what you ask for is not what you want:) Try Googling for 'kiosk systems' - systems that host only one human interface that is tightly-controlled, but likely backed with an OS and subsystems with many processes/threads. Your supermarket EPOS till has to host a price-lookup database, communicate with the operator, laser scanner, receipt printer, card terminal, management server. Your model Y 'dashboard' is similarly complex, with many links to otber onboard systems and a wireless interface. – Martin James Jul 05 '20 at 05:45

2 Answers2

0

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.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
0

You should take a look at IncludeOS Which is made exactly for your purpose, only include what is needed.

Surt
  • 15,501
  • 3
  • 23
  • 39