1

Need your help to clarify primitive concepts:

In an embedded system, when a program runs on the processor (ARM as an example), in my understanding that it is because the "code to be executed" is loaded in the main memory.

My question is:

  • Is "the code to be executed" called "executable", what does "executable" mean?
  • What is the difference between "executable" and "the software or binary image".

I am not coming from a SW engineering background, please excuse my non solid background.

Berin Loritsch
  • 45,784
  • 7
  • 87
  • 160
Lavender
  • 119
  • 3
  • You might need to look up a CS101 class (Computer Science 101) you can audit. Sometimes you can find it for free. – Berin Loritsch Feb 06 '20 at 13:51
  • 2
    These terms have a lot of overlap and contextual distinctions, such that it might be confusing to look them up without context. You may find it easier to present a specific situation in which these terms are used together. – Nat Feb 06 '20 at 14:54
  • in my understanding that it is because the "code to be executed" is loaded in the main memory. - FWIW that's not always true, some embedded processors have separate memory for instructions and data, and the program never gets "loaded" except when it's flashed to non-volatile memory. – whatsisname Feb 07 '20 at 06:18

2 Answers2

1

I assume you are coming from a non-technical background, so the terms are new to you. To fully understand a lot of the answers on this site, it is a good idea to take a beginners course like Computer Science 101 (CS101). That at least introduces you to the vocabulary and general concepts for how computers work.

There really isn't much difference between the two questions you have.

Executable: A file that is designed to be run by a computer

Executables are compiled to run for a specific architecture (like your ARM system) and the same executable can't run on other architectures. The CS 101 class will go into detail on why that is the case.

Software: A set of instructions that tell a CPU (like ARM) what to do

Software has more to do with the instructions than the files that make up a running application.

Binary Image: A file that contains a set of bytes.

Binary images are a low level concept, and can be an executable, a picture, a movie, or a copy of a disk drive. The main distinction here is that the contents are binary, not text.

Berin Loritsch
  • 45,784
  • 7
  • 87
  • 160
  • Text files are binary files. But binary files are more things than text files. Calling a binary file a text file is really just a promise that the whole file is encoded the same way (ASCII, UTF8, etc). Some people call a file "binary" to indicate that you can't count on that. But even such a binary file may contain snips of text between other data. You can open such a binary file in a text editor and find readable text sitting between runs of strange symbols. If you know how it's laid out you can read the whole file. Once you do the strange symbols become readable. Ints, floats, op codes... – candied_orange Feb 06 '20 at 19:19
  • I intentionally simplified the answers for someone who has a non-technical background like the author of the question is presenting himself. I am aware of the distinctions, but in the context of the other terms the OP was using I felt that the answer I provided was succinct and understandable enough for his purposes. – Berin Loritsch Feb 06 '20 at 20:24
0

As @Nat mentioned, context here is important. I'll address it from a bare-metal (no OS) context.

Typically, your software is written in some sort of language (C/C++, Assembler, etc.) This makes up your Source Code. Now Source Code is not in a format that can be directly executed by the target processor, so we need run our Source Code through a compilation/assembly process to generate Object Code, which we then run through a linker to generate our Executable Object Code file.

This EOC file is in a format that can be directly executed by the target processor, but still needs to be loaded into memory somehow.

On bare metal (no OS) embedded systems this is typically written to some form of non-volatile storage through a Debugger or Flash Programmer and then gets executed directly by the target processor according to its startup process.