2019-2020-1 20175218 "Information Security System Design Basics," the first week of learning summary

2019-2020-1 20175218 "Information Security System Design Basics," the first week of learning summary

Learning content summary

The first chapter roaming computer system

  • Source is a bit sequence of 0's and 1 values. Some text characters in the program is byte, each byte consists of 8 bits.
  • Only ASCII file consisting of characters known as text files, all other files are called binary file.
  • Build system

    - 预处理器(cpp)————将源程序进行修改,将.c文件转换成.i文件。命令示例(-E):gcc -E hello.c -o hello.i
    - 编译器(ccl)————将.i文件转换成.s文件。命令示例(-S):gcc -S hello.i -o hello.s
    - 汇编器(as)————将文件翻译成机器语言指令。命令示例(-c):gcc -c hello.s -o hello.o
    - 链接器(ld)————生成可执行目标程序。命令示例:gcc hello.o -o hello
    • Step by step 4 above can be implemented by commands (gcc hello.c -o hello)
    • Step 3, you can enter objdump -d hello.o view files

  • After all files have, ./ + filename achieve running by entering

  • Hardware system consists of:
    • bus
    • I / O device
    • Main memory
    • processor
  • Amdahl's Law
    • Speedup: S = 1 / ((1-α) + α / k)
  • The storage system of a hierarchical structure: CPU registers at the top, then the multilayer hardware cache memory, a DRAM main memory and disk storage. Which is located in a higher-level storage device is faster than the low-level storage device.
  • Three basic abstractions provided by the operating system kernel:
    • Document is an abstract of I / O devices
    • Virtual memory is an abstraction of the main memory and disk
    • Process is a processor abstraction main memory and I / O devices
  • -I parameters: .h files into include in, .c files in src. By the gcc c -o main head.h not find file (compiled together so .c file). The reason is head.h file into another folder, the compiler can not find. In this case, the input gcc -I / header files path .c -o main specified path.

  • gdb:
    • Features
      • Start a program, and you can set parameters and operating environment to run a specified program
      • The program to stop execution at the specified breakpoint
      • After making the appropriate adjustments to the program, so that we can continue to correct an error debugging
    • Common Commands
      • Listing gdb l ---- listed in the file
      • gdb display ---- disposed variables automatically displayed when the program is stopped, or when the single-step tracking, these variables will automatically show
      • gdb p ---- specified variable display
      • gdb c ---- continue until the next breakpoint or the program ends
      • gdb b ---- stops at the specified function, or a specified line, or condition, or temporary breakpoint
      • gdb s ———— 相当于“Step Into”
      • gdb n ———— 相当于“Step Over”
      • gdb q ———— 退出gdb调试
  • makefile隐含规则:它是一种惯例,make会按照这种“惯例”自动运行,就算我们在Makefile中没有书写这样的规则

第七章 链接

  • 链接可以在编译时由静态编译器来完成,也可以在加载时和运行时由动态链接器来完成。
  • 链接器处理称为目标文件的二进制文件,有三种形式:可重定位的、可执行的和共享的。
  • 链接器的两个主要任务是符号解析和重定位。
  • 动态链接器:

    - 重定位 libc.so 的文本和数据到某个内存段
    - 重定位 libvector.so 的文本和数据到另一个内存段
    - 重定位 prog21 中所有对由 libc.so 和 libvector.so 定义的符号的引用
    • 通过以上重定位可完成链接任务

教材学习中的问题和解决过程

  • 问题1:

在学习gcc的时候,提到了静态数据库和动态数据库,一下没太懂它们的意思。

  • 问题1解决方案:

上网发现了一个大佬在CSDN上写了一篇关于它们的介绍——点击进入链接,大致就了解了一些:

静态库:
是指编译链接时,把库文件的代码全部加入到可执行文件中,因此生成的文件比较大,但在运行时也就不再需要库文件了。其后缀名一般为”.a”。

动态库:
与之相反,在编译链接时并没有把库文件的代码加入到可执行文件中,而是在程序执行时由运行时链接文件加载库,这样可以节省系统的开销。动态库一般后缀名为”.so”,gcc/g++在编译时默认使用动态库。无论静态库,还是动态库,都是由.o文件创建的。

  • 问题2:

在看教程的第七章第十节的动态链接共享库时,不理解共享库实现共享的两种方式。

  • 问题2解决方案:

这个问题还没有完全解决,主要是感觉第七章内容学起来有些艰难,以及很多知识点都不太理解。在网上看到了一个随笔,是关于Linux共享库、静态库、动态库的详细介绍的,我看了之后,还是不太理解,但稍微了解到了这三个库的基本知识。点击进入链接

代码调试中的问题和解决过程

  • 问题1:没有安装gcc

  • Problem 1 Solution: Follow the prompts to install directly on the line

Code hosting

statistics.sh script Screenshot

Last week exam wrong question summary

  • no

Other (perception, thinking, etc., optional)

  • Here is a list of text

Chapter VII feeling a little more difficult to learn

Learning progress bar

The number of lines of code (add / accumulate) Blog amount (add / accumulate) Learning time (add / accumulate) Important growth
aims 5000 rows 30 400 hours
the first week 99/99 3/3 22/22

Try recording "planned learning time" and "actual learning time" to the end see if you can improve their ability to plan. This study is very important work, is also useful.
Consuming an estimated equation
: Y = X + X / N , Y = XX / N, training more often, X, Y will close.

Reference: Why is estimated that software engineering software so hard , software engineering estimation method

  • Plan study time: 20 hours

  • The actual study time: 22 hours

  • Improved: None

(Available see more modern software engineering courseware
software engineers the ability to self-evaluation form
)

Reference material

Guess you like

Origin www.cnblogs.com/cjy-123/p/11567567.html