2. Computer architecture and Linux operating system analysis

Source: Internet
Author: User
Tags echo command

On the computer, we know that there are memory, CPU, hard disk, keyboard, mouse, monitor and so on. So how did they get connected?

If each peripheral is connected to the direct CPU, then the CPU will have a lot of pins, but we know that the computer now has a variety of more than a number of hardware connections, to achieve the CPU with each hardware has a direct connection between the line is not realistic.

In fact, in the reality of the CPU is through the bus and external hardware indirectly connected, wherein the bus has address bus, data bus, control bus of these kinds.

The address bus is used to find storage units with storage capacity;

The control bus is used to connect each hardware controller, and provides its sending control signal;

Data bus is used to transmit data;

When the computer is working, if there are other hardware to request, how does the CPU know that the hardware sent the request information? One will check if there is a request, after a while to check, if there is a request to deal with, if there are other hardware in the process of the request, then how to manipulate the CPU? If there is a major error, it is not the CPU first to deal with the more important is to deal with things just not finished.

When the CPU is handling things, there are other important requests to interrupt the operation, which we call interrupts. Interrupts are available in two types with soft interrupts and hard interrupts. There are hardware interrupts that are being processed by the work we call a hard interrupt, and there is software that interrupts the work we are dealing with as a soft interrupt.

We installed the operating system it can do a lot of work, operating system we installed a lot of programs, a number of programs to run normally, run in order to read and write data, if the program needs external network to provide data, then to access the network, the program to run and to achieve the corresponding function will operate the hardware, There is also the need for network communication to communicate and ensure the security of data. The following functions are implemented by the operating system:

Process scheduling Management

File System Management

Network protocol Stack Control

Memory management

Driver Management

Security features

These are the operating system must be provided, we installed a Linux system to provide us with a login interface, then we need to log in with users, Linux is a multi-user multi-tasking operating system can, each user has their own data, obviously different users have different permissions. Under Linux we divide the user into:

Admin user (with all permissions)

Ordinary users (through the administrator authorized by the ordinary users, different user rights are different)

Admin command Prompt is: # [email Protected]_basic ~]#
Command prompt under normal User: $ [[Email Protected]_basic ~]$

What does a command prompt consist of?

Can be viewed by PS1 variables, to add $PS1 to the variables, with the echo command to display

[[Email Protected]_basic ~]# echo $PS 1
[\[email protected]\h \w]\$

\u the username of the current user user name

\H the hostname up to the first '. ' Show '. ' Previous hostname, hostname none '. ' The direct host name

\w the basename of the current working directory, with $HOME abbreviated with a tilde

Current working directory base name

\w the absolute path of the current working directory

\$ if the effective ([' fktv] valid, functioning;) UID is 0, a #, otherwise a $

If the valid UID is 0, #, the other is #

\ newline New Line

\j the number of jobs currently managed by the Shell

Here the UID is the user's identity. Each user has a UID, the UID of the administrator is 0, the other user UID is $

To see more information can be used in man sh, will be used to find, not explained here

Assigning variables to a variable under Linux is to use the variable name = value if the value has characters, we are quoted in quotation marks.

"Single quote" "double quotation mark" Inverted quote the key below the ESC key

[Email PROTECTED]_BASIC/ETC/INIT.D] #echo $HOME
/root

We can change the value of the PS1 variable.

[Email protected]_basic ~]# ps1= ' [\[email protected]\j \w]\$ '
[[Email protected] ~] #PS1 = ' [\[email protected]\h \w]\$ '
[[Email Protected]_basic ~]#
Is strictly case-sensitive under Linux

[[Email protected]_basic ~] #PS1 = ' [\[email protected]\h \w]\$ '
[Email protected]_basic ~] #cd/etc/init.d/
[[Email protected]_basic/etc/init.d]#

The directory structure of Linux is an inverted tree, that is, it has only one root (/), absolute path refers to the full path from the root to the directory in which the relative path refers to not starting with the root, is a current directory as the starting point to specify. A CD is a command that implements a directory jump. PWD Displays the current location in an absolute path

[Email protected]_basic INIT.D] #pwd
/etc/init.d
[Email protected]_basic init.d] #cd/boot/grub/

To the EFI directory under the/boot/directory, use the relative path
[Email protected]_basic Grub] #cd. /efi/
[email protected]_basic EFI] #pwd
/boot/efi

There are errors welcome to revise, hope can do better!

This article is from the "Happy is good" blog, please be sure to keep this source http://6625958.blog.51cto.com/6615958/1591853

2. Computer architecture and Linux operating system analysis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.