M
M
Moro Zota2018-07-08 17:00:44
linux
Moro Zota, 2018-07-08 17:00:44

How does the processor understand the OS?

Explain, please. If, for example, the unix kernel is written in C, and the processor understands only the binary number system, then how does it all work?
The processor cannot understand the compiler, which is also written in Japanese.

Answer the question

In order to leave comments, you need to log in

7 answer(s)
P
pfg21, 2018-07-08
@morozota

the processor understands only a small set of instructions, which are described by the processor architecture . architecture also describes the environment for executing commands, the presence and size of registers, ways to access memory and other external devices.
the flow of commands executed by the processor is hardly understood by a human programmer. years ago, there were programmers who could write an algorithm in processor commands.
but now this level of reasonableness has practically disappeared and only a few hundred people know it, creating either processors or compilers for them.
for adequate understanding and editing, programs are written in languages ​​that are specially created for a "human" :)
for execution in a processor, programs from a "human language" are compiled into executable binary code.
the compiler is also written in "human language" and then compiled into an executable file.

A
Alexander, 2018-07-08
@alexr64

If, for example, the unix kernel is written in C, and the processor understands only the binary number system, then how does it all work?

Compiler, Compiling
Operating System

A
Andrey Burov, 2018-07-08
@BuriK666

https://nsu.ru/xmlui/bitstream/handle/nsu/9054/tan...

#
#, 2018-07-08
@mindtester

far from always correct ))
(this is why patches / updates are so frequent in all systems)
however, you are not correctly cycling in the language "in which the OS is written" .. after the "OS is written" - it is compiled
ps oh yes .. compiler, before it becomes possible to run - it is also compiled ... any program is compiled, in order to become runable
there is a special case - jit compilation (usually this means compilation on the fly) (node.js, .Net) .. and there is still " interpretation " (js, python)

S
Stanislav Bodrov, 2018-07-09
@jenki

How does the processor understand the OS?
It does it with difficulty. OS universal designed for all sorts of and even impossible tasks, processors too. And it doesn't always match.
the processor understands only the binary number system
Bullshit! The processor raises only potential drops in a strictly defined level. That there will be some kind of logic, stone to the light bulb.
The processor cannot understand the compiler, which is also written in Japanese.
Usually the OS comes first, and then the compiler. The operating system completely abstracts the hardware from the application code. Therefore, the head, over what the compiler laid out, breaks the operating system. First to yourself, then to the processor.

J
Johnny Smith, 2018-07-13
@Olek1

How does the processor understand the OS?

Only through the driver

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question