Home >Operation and Maintenance >Linux Operation and Maintenance >Is Linux written in assembly language?

Is Linux written in assembly language?

WBOY
WBOYOriginal
2022-08-18 15:19:124960browse

Linux is written in assembly language, but not all of it is written in assembly language. Most of the Linux kernel is written in C language; C language is the "native language" of Linux, which is also the development environment of Linux. Due to the mechanism itself, only part of it is written in assembly language.

Is Linux written in assembly language?

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

Is Linux written in assembly language?

Linux is written in C language and assembly language. C language is the "native language" of Linux, which is also caused by the open source environment and its own mechanism of Linux; most of the Linux kernel is written in C language, and some are written in assembly language, because for hardware, assembly has more Good performance and speed.

linux

Linux, the full name is GNU/Linux, is a UNIX-like operating system that is free to use and freely disseminated. Its kernel was designed by Linus Benardi First released by Kurt Torvalds on October 5, 1991, it is mainly inspired by the ideas of Minix and Unix. It is a POSIX-based multi-user, multi-tasking operating system that supports multi-threading and multi-CPU. It can run major Unix software tools, applications and network protocols. It supports 32-bit and 64-bit hardware. Linux inherits the network-centric design philosophy of Unix and is a multi-user network operating system with stable performance.

So what language is Linux developed in? Many newbies are not very clear about this? Let’s take a look:

Most of the Linux kernel is written in C language, and some are written in assembly language, because assembly has better performance and speed on hardware.

Some component systems and additional applications of Linux are written in C, C, Python, perl and other languages.

Assembly language

Assembly language (Assembly Language) is any low-level language used for electronic computers, microprocessors, microcontrollers or other programmable devices , also known as symbolic language. In assembly language, mnemonics are used to replace the opcodes of machine instructions, and address symbols or labels are used to replace the addresses of instructions or operands. In different devices, assembly language corresponds to different machine language instruction sets, which are converted into machine instructions through the assembly process. There is a one-to-one correspondence between a specific assembly language and a specific machine language instruction set, and they are not directly portable between different platforms.

Assembly language, that is, the second generation computer language, uses some abbreviations that are easy to understand and remember to replace some specific instructions. For example: use "ADD" to represent addition operation instructions, and "SUB" to represent subtraction operation instructions. , and "INC" stands for increment by 1, "DEC" stands for minus 1, "MOV" stands for variable transfer, etc. Through this method, people can easily read the completed program or understand the function being executed by the program. Programmed bug fixing and operation and maintenance have become simpler and more convenient. However, the computer hardware does not recognize alphabetic symbols. At this time, a special program is needed to convert these characters into binary numbers or machine language that the computer can recognize.

Because assembly language is just a simple compilation of machine language, it does not fundamentally solve the specificity of machine language. Therefore, assembly language is closely related to the programming environment of the machine itself. It is difficult to promote and transplant, but it still remains Due to the excellent execution efficiency of machine language and its readability and simplicity, assembly language is still one of the commonly used programming languages ​​today.

Assembly language is not as widely used in programming as most other programming languages. In today's practical applications, it is usually used in low-level, hardware operations and demanding program optimization situations. Assembly language is required for drivers, embedded operating systems, and real-time running programs.

Recommended learning: Linux video tutorial

The above is the detailed content of Is Linux written in assembly language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Why does linux need mmuNext article:Why does linux need mmu