In this video I would like to talk a bit about CPU architecture.
So the CPU architecture defines how instructions are executed on the cpu.
And it's still the case that if you have a program that is compiled
for ARM, it won't work on Intel CPUs and the other way around.
Why is that? Well, that's because Intel CPUs use the complex instruction
set computing CISC ARM CPUs use reduced instruction set computing or RISC.
And that has been a main difference that has been existing for a long time yet.
And the problem is that the instruction sets are incompatible.
And that is why code needs to be compiled for either construction set.
If you want to find the architecture that you are using, you can use the ARC command.
Alternatively, the CPU architecture is also shown in the current kernel
version in use Uname R if you want to see it.
Let me show you.
Okay, to start it, I would like to run a program and that is my zombie program.
What do we see? Well, we see this error message.
The error message is giving me cannot execute binary file
exec format error. Now what is this exec format error?
That is indicating that I'm running it on the wrong architecture.
Hey, does the file utility give me anything?
Let's use file on which zombie.
And there you can see that this is a
binary that has been compiled as x86 64.
And that's exactly the problem, because if you use file no matter which other program,
like PASSWD for instance, there you can see that is compiled for ARM ARC 64.
So it's in the binary for which architecture they have been created.
So you can use ARC to figure out your architecture.
And as you can see, I'm on arc.
And you can also use UNAME R. UNAME R is also showing you that in
the kernel version. So I'm on the ARC kernel version and that's providing enough information.
And it means that I can only use programs that have been compelled for arm.
Now I can tell you from my own practice, because I'm using virtual machines on top of the ARC architecture.
Most programs on Linux by default work perfectly on Intel. When you are working on ARC architecture,
every now and then doesn't happen too often, but you might find some externally obtained programs that
won't work and give you this exact format error. And this is what is behind it.