2

I'm having a lot of trouble expressing my questions properly when I'm trying to ask other questions on this topic, so what is the proper name for a program running directly on the machine in question?

A term that could describe both a kernel, and a bootloader in the sense that they are being executed directly without an operating system?

Hawken
  • 2,059
  • 19
  • 34
  • I think such programs are described by their function (OS, bootloader, BIOS) rather than as a class. At best, I think maybe "privileged process/program/code" would be an appropriate term, for programs running on the x86 architecture anyways. All of these programs will execute in the most privileged run level. – aroth Apr 23 '12 at 03:46
  • 1
    I think Jerry's answer is good. I think the reason there isn't a solid term for it is because there is no big difference between a program running 'directly on the hardware', and an application running under the OS, other than some dependencies (they all run on the same architecture). –  Apr 23 '12 at 03:47
  • @hassan if they are not running so differently, how can applications have sanctioned memory, whereas otherwise they SegFault? – Hawken Apr 23 '12 at 03:50
  • A Segmentation fault is a signal that the operating system generates. Theoretically, the OS could simply choose not to handle the application's memory, and Segfaults would never occur. However, this would not be a very good operating system. The operating system also provides many other functions and useful facilities, which is why we use them. However, even the application's code is run directly by the processor. –  Apr 23 '12 at 03:56
  • @hassan how does the OS "control" the memory in question if the application is truly running? – Hawken Apr 23 '12 at 03:58
  • Modern processors support something called _pre-emptive multitasking_. This allows a privileged program (eg an OS) to set a certain time limit for code to run. A timer is set in the processor, indicating the time limit, then the processor jumps to the application's code, executing it. Once the time runs out in the timer, the processor stops executing the application's code, then jumps back to the OS's code. This is done many times in quick succession to seem as though multiple tasks are running at once. –  Apr 23 '12 at 04:04
  • @hassan In the short time that the code is running though, can't it do whatever it wants? Segfaults happen before any problem occurs, I thought – Hawken Apr 23 '12 at 04:10
  • No, I don't think Segfaults _always_ happen before any problem occurs. And the application can't do _anything_ it wants. There are certain things that the processor will only allow privileged code to do. Now, whether accessing other programs' memory is among those things, I'm not sure. But I've been in situations where my code accessed another program's code illegally before a Segfault occurred. –  Apr 23 '12 at 04:16
  • And remember that much of what the application does 'relies' on the OS, in that accessing certain resources is done by calling OS code. –  Apr 23 '12 at 04:16

2 Answers2

4

The C standard calls that a "free standing environment", which strikes me as about as good a term to use as most others I've seen.

Jerry Coffin
  • 476,176
  • 80
  • 629
  • 1,111
1

I would just use the term "standalone" because that's essentially what it's doing. Standing alone, without the benefit of an operating system.

Regardless of the term you use, you'll probably still find it useful to define it at least once in your question, then, once defined, you can use it to your heart's content.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953