form of ' command ' {} \; Note the space between {} and \;
OK: the same function as-exec, except that the shell command given by this parameter is executed in a more secure mode, and before each command is executed, a prompt is given to let the user determine whether to execute
Common options:
-name: Find files by file name
-perm: Find files according to file permissions
Mtime-n +n: Finds files according to file change time,-n means file change time is less t
exception.
The typical errors are:scanf("%d",val);
(2) Read uninitialized memory
Although the bass memory location is always initialized to 0 by the loader, it is not the case for heap storage.
A common mistake is to assume that the heap memory is initialized to 0.
(3) Allow stack buffer overflow
If a program writes to the target buffer in the stack without checking the size of the input string, the program will have a buffer overflow error.
(4) Assume t
processor design, it is often necessary to compare a signal to a number of possible matching signals to detect if a certain instruction code being processed is part of a class of instruction code.Sequential implementation of Y86-64Organize the processing into stages1. For OPL (integer and logical Operations), RRMOVL (register-register transfer) and IRMOVL (immediate count-register transfer)2. For RMMOVL and Mrmov3. For PUSHL and POPL4. For jump, call and RETTake a fingerDecodingPerformVisitWrit
Summary of the learning contents of the textbook fourth Chapter processor Architecture Y86-64 instruction set architectureThe "programmer" here refers to the person who writes the program with the assembler code, or the compiler that produces the machine code . The state of y86-64 is similar to x86-64.Y86-64 directive
X86-64 's MOVQ instruction is divided into 4 different instructions: IRMOVQ,RRMOVQ,MRMOVQ,RMMOVQ, which explicitly indicates the source and destination format, and the source
selection: determine where the desired word starts in the block.
Associated High-speed cache:1. group selection in group-connected high-speed cache: Same as group selection in direct ing high-speed cache, group index bit Identification Group.2. Row matching and word selection in the group-connected high-speed cache: each group is considered as a small memory associated with a (Key, value) pair array,3. Input key to return the value in the corresponding array. The cache must search for each row
. Garbage collectionvoid Garbage (){int *p = (int *) Malloc (15213)Return}garbage collector:is a dynamic storage allocator that automatically frees allocated blocks that are no longer needed by the program. These blocks are called garbage. The process of automatically reclaiming heap storage is called garbage collection. The following functions are used in the description of Marksweep: where PTR is defined as typedef void *PTRPtrisptr (PTR p): if p points to a word in an allocated block, it ret
, which represents a function pointer with no return value, with a pointer value of 0Change the sig_ign into a SIG_DFL.
Multi-Signal processing
-SIGX打断SIGX的情况处理方法: 1、递归,调用同一个处理函数 2、忽略第二个信号 3、阻塞第二个信号知道第一个处理完毕
Signal and Sigaction1, Signal:不知道信号被发送的原因信号处理过程中不能安全地阻塞其他信号2, Sigaction:When the signal handler is called, the new signal screen word created by the system automatically includes the signal being delivered. This ensures that when a given signal is processed, i
shift x>>k: Move the K-bit right and the value at the left to complement K's most significant bit
Logical right Shift x>>>k: Move K-bit right, left complement K 0
Use arithmetic right shift for signed number, logical right shift for unsigned numberInteger representation
Information = bit + context
unsigned integer: b2u4[0011]=0 2^3+0 2^2+1 2^1+1 2^0=3
Signed integer-complement code: B2t4[1011]=-1 2^3+0 2^2+1 2^1+1 2^0=-5
Unsigned number means you need to append the suf
a logic gate based on the individual bits of the input word.In the HCL, we declare all word-level signals as int, without specifying the size of the wordIn the HCL, a multiplexed function is described using a condition expression. Each case I has a Boolean expression select and an integer expression, expr. The former indicates when to choose this case, the latter represents the resulting valueThe Arithmetic/logic unit (ALU) is a very important combination circuit. This circuit has 3 inputs: two
implements a finite integer operation compared to a real integer operation, with some special properties: because of overflow, the expression x*x can produce negative numbers. However, both unsigned and complement operations satisfy many of the other properties of integer operations, including binding laws, commutative laws, and distributive laws. This allows the compiler to do a lot of optimizations. We've seen several clever ways to use bit-level arithmetic and arithmetic operations: (1) us
Division Instruction no definition for all condition code bits Bit operations Directives :and logic with or logical or not logic does not affect the flag bit XOR or test instruction except for the four kinds of, set CF, of 0,af undefined, SF,ZF, PF sets the shift instruction based on the result of the operation:SHL logical left SHIFT instruction SHR logical Right SHIFT instruction shift instruction based on result set SF,ZF,PF bit ROL loop left shift instruction ROR loop right Shift instructio
128 pages of reference books4. Translation Conditions BranchThe most common method of translating conditional expressions and statements from C to machine code combines conditional and unconditional jumps 5. Circulationthe assembly cycle can be combined with conditional tests and jumps to achieve6. Conditional Delivery InstructionsThe traditional way to implement conditional operations is to take advantage of controlled conditional shifts. Control transfer of actual use of datathe code that is
RET instruction pops the address from the stack and jumps to that position.3.7.3 Register Usage ConventionsYou must guarantee that when a caller invokes the callee, the callee does not overwrite the value of a register that the caller will later use.Two ways to achieve the above requirements:• Before calling Q, the value of y is stored in its own stack frame, and when Q returns, process P can remove the value of y from the stack, that is, the caller holds the value of Y.• Save the value of Y in
operation is the first one, the purpose operand is the second one.The rest of the instructions have been practiced in the previous chapter.3.6 ControlCondition Code:Jump instruction JP3.7 ProcessThe register%EBP is the frame pointer, and the%ESP is the stack pointer.Call and Leave,ret support procedure calls are returned.Problems encountered:The order of the target operand and the source operand in the textbook is different from the IBM-PC assembly language of the last semester.Resources:Baidu
development efficiency of the software. Make is a command tool that is a tool for Makefile commands in a timely manner.The most important and basic function of make tools is to automate compiling and maintaining multiple source files according to the relationship between source programs described in the makefile file. While the makefile file needs to be written in a certain syntax, the file needs to explain how to compile the individual source files and link them to the executable file, which r
Tenth Chapter system level I/OHow to learn system programming (learn Linux programming with Linux)One, Unix I/OA UNIX file is a sequence of M bytes: B0,B1,B2,...,BK,..., Bm-1Ii. Opening and closing files1. The process opens an existing file or creates a new file by calling the Open function:int open (char *filename, int flags, mode_t mode);2. Close an open file by calling the Close function:int close (int fd);Iii. Reading and writing documents1. Call the Read and write functions to perform input
FilesDescriptor tables: A separate table for each processFile tables: All processes shared, file locations, reference counts, and pointers to V-node tablesV-node table: All process sharing, storing file information5: Standard I/OOpen and close files: fopen and FcloseFunctions for reading and writing sections: Fread and FwriteRead-Write strings: Fgets and FputsComplex format of i/o:scanf and printfThe standard I/O library models an open file as a stream, and a stream is a pointer to the structur
);
Functions for reading and writing strings (Fgets and Fputs)
Flow application: A stream is a pointer to a structure of type file (for example, every Asni C file opens, it will open stdin,stdout,stderr three streams at the same time).
Meaning: A stream is an abstraction of a file descriptor and a stream buffer. (The purpose of the stream buffer is similar to Rio, which is to reduce the number of expensive UNIX system calls)
ls command
Ls-l View det
process.The multithreaded execution model is similar in some ways to a multi-process execution model.Each process starts its life cycle as a single thread, which is the main thread. At some point, the main thread creates a peer thread, starting at this point in time, and two threads are running concurrently with each other.A POSIX thread is a standard interface for processing threads in a C program.To terminate a process:1. When the thread routine of the when top layer returns, the line Cheng t
cause a set of states called deadlock zones.
Deadlock is a rather difficult problem because it is unpredictable.
Mutex lock Order rule : If for each pair of mutex (S,T) in the program, assign a whole order to all the locks, each thread requests the lock in this order, and is released according to reverse, the program is deadlock-free.How to resolve a deadlock
do not let a deadlock occur:
Static strategy: Design appropriate resource allocation algorithm, do not le
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.