1
00:00:06,379 --> 00:00:09,650
In this video I would like
to talk a bit about CPU architecture.

2
00:00:10,490 --> 00:00:14,669
So the CPU architecture defines how
instructions are executed on the cpu.

3
00:00:15,330 --> 00:00:18,879
And it's still the case that if
you have a program that is compiled

4
00:00:18,879 --> 00:00:22,429
for ARM, it won't work on
Intel CPUs and the other way around.

5
00:00:23,089 --> 00:00:29,204
Why is that? Well, that's because
Intel CPUs use the complex instruction

6
00:00:29,204 --> 00:00:35,320
set computing CISC ARM CPUs use
reduced instruction set computing or RISC.

7
00:00:35,939 --> 00:00:39,899
And that has been a main difference that
has been existing for a long time yet.

8
00:00:40,719 --> 00:00:43,500
And the problem is that
the instruction sets are incompatible.

9
00:00:44,060 --> 00:00:47,359
And that is why code needs
to be compiled for either construction set.

10
00:00:48,640 --> 00:00:53,039
If you want to find the architecture that
you are using, you can use the ARC command.

11
00:00:53,619 --> 00:00:57,625
Alternatively, the CPU architecture is
also shown in the current kernel

12
00:00:57,625 --> 00:01:01,630
version in use Uname R
if you want to see it.

13
00:01:02,149 --> 00:01:02,729
Let me
show you.

14
00:01:04,409 --> 00:01:09,409
Okay, to start it, I would like to
run a program and that is my zombie program.

15
00:01:10,469 --> 00:01:13,150
What do we see? Well,
we see this error message.

16
00:01:14,109 --> 00:01:18,265
The error message is giving
me cannot execute binary file

17
00:01:18,265 --> 00:01:22,420
exec format error. Now what
is this exec format error?

18
00:01:23,049 --> 00:01:25,950
That is indicating that I'm
running it on the wrong architecture.

19
00:01:26,760 --> 00:01:29,019
Hey, does the file
utility give me anything?

20
00:01:29,859 --> 00:01:32,480
Let's use file
on which zombie.

21
00:01:34,260 --> 00:01:38,215
And there you can
see that this is a

22
00:01:38,215 --> 00:01:42,170
binary that has been
compiled as x86 64.

23
00:01:42,769 --> 00:01:49,384
And that's exactly the problem, because if
you use file no matter which other program,

24
00:01:49,384 --> 00:01:56,000
like PASSWD for instance, there you can
see that is compiled for ARM ARC 64.

25
00:01:57,400 --> 00:02:01,140
So it's in the binary for
which architecture they have been created.

26
00:02:01,739 --> 00:02:04,859
So you can use ARC
to figure out your architecture.

27
00:02:05,579 --> 00:02:07,900
And as you can
see, I'm on arc.

28
00:02:08,479 --> 00:02:14,319
And you can also use UNAME R.
UNAME R is also showing you that in

29
00:02:14,319 --> 00:02:20,159
the kernel version. So I'm on the
ARC kernel version and that's providing enough information.

30
00:02:20,159 --> 00:02:26,000
And it means that I can only
use programs that have been compelled for arm.

31
00:02:26,490 --> 00:02:33,310
Now I can tell you from my own practice, because
I'm using virtual machines on top of the ARC architecture.

32
00:02:34,050 --> 00:02:39,603
Most programs on Linux by default work perfectly
on Intel. When you are working on ARC architecture,

33
00:02:39,603 --> 00:02:45,156
every now and then doesn't happen too often,
but you might find some externally obtained programs that

34
00:02:45,156 --> 00:02:50,710
won't work and give you this exact format
error. And this is what is behind it.
