Linux v LinuxUnixUnixlike 1991 v LinuxWhat is Linux
- Slides: 57
什么是Linux? v Linux是一个类Unix(Unix-like)的操作系统, 在 1991年发行了它的第一个版本 v 在Linux内核维护网站上,“What is Linux? ” 2/24/2021 xlanchen:Linux OS Analysis 4
From “www. kernel. org” v Linux的来历和目标: Ø Linux is a clone of the operating system Unix, written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX and Single UNIX Specification compliance. Portable Operating System Interface Standard 可移植操作系统接口标准 v Linux的功能 由IEEE制订,并由ISO接受为国际标准。 Ø It has all the features you would expect in a modern fully. Institute for Electrical and Electronic Engineers fledged Unix, including true multitasking, virtual 电气电子 程师学会[美] memory, shared libraries, demand loading, shared International Organization for Standardization copy-on-write executables, proper memory 国际标准化组织 management, and multistack networking including IPv 4 制定各行各业各种产品和服务的技术规范(国际标准) and IPv 6. 2/24/2021 xlanchen:Linux OS Analysis 5
v Linux支持的目标体系结构 Ø Although originally developed first for 32 -bit x 86 -based PCs (386 or higher), today Linux also runs on (at least) the Alpha AXP, Sun SPARC, Motorola 68000, Power. PC, ARM, Hitachi Super. H, IBM S/390, MIPS, HP PA-RISC, Intel IA-64, AMD x 86 -64, AXIS CRIS, Renesas M 32 R, Atmel AVR 32, Renesas H 8/300, NEC V 850, Tensilica Xtensa, and Analog Devices Blackfin architectures; for many of these architectures in both 32 - and 64 -bit variants. 2/24/2021 xlanchen:Linux OS Analysis 6
v 在内存管理方面不得不说的 Ø Linux is easily portable to most general-purpose 32 - or 64 -bit architectures as long as they have a paged memory management unit (PMMU) and a port of the GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has also been ported to a number of architectures without a PMMU, although functionality is then obviously somewhat limited. See the µClinux project for more info. 2/24/2021 xlanchen:Linux OS Analysis 7
v GNU,“g-noo”,“GNU's Not Unix” 2/24/2021 xlanchen:Linux OS Analysis 9
Linux内核维护网站 v http: //www. kernel. org/ v The Linux Kernel Archives Mirror System 2/24/2021 xlanchen:Linux OS Analysis 10
Linux版本 v Linux的内核版本 v 几种流行的Linux发行版本 2/24/2021 xlanchen:Linux OS Analysis 14
几种流行的Linux发行版本 2/24/2021 xlanchen:Linux OS Analysis 16
Linux系统的好处 v 支持多种CPU Ø X 86, ARM, MIPS, SH, i 960, PPC, etc. v 开放源代码(Open source) v 强大的网络功能 v 可移植性 v 使用GNU tools 2/24/2021 xlanchen:Linux OS Analysis 17
一个典型的Linux操作系统的结构 用户应用程序 Shell,lib System call Kernel implementation 对硬件资 源的管理 2/24/2021 xlanchen:Linux OS Analysis 22
补充知识 v AT&T汇编语言和Intel汇编语言 Ø AT&T汇编语言中指令的操作数顺序与Intel相反 l AT&T opcode[b+w+l] src, dest Ø 寄存器:%reg Ø 访存大小:[b+w+l] - 8, 16, 32 bits Ø 引用内存地址:section: disp(base, index, scale) l 实际偏移:base + index*scale + disp 缺省为 0 2/24/2021 取值可以是 1,2,4,8 xlanchen:Linux OS Analysis 28
观察p 2的堆栈框架 v 从test的反汇编文件中找到p 2的反汇编代码 int p 2(int x, int y) { push %ebp mov %esp, %ebp return x+y; mov 0 xc(%ebp), %eax add 0 x 8(%ebp), %eax } pop %ebp ret 建立框架 低地址 ebp esp 拆除框架 ebp x y 调用者 堆栈 框架 ebp 高地址 2/24/2021 xlanchen:Linux OS Analysis 33
观察main函数是如何传递参数给p 2的 esp … z=p 2(x, y); pushl 0 xfffffff 8(%ebp) pushl 0 xfffffff 4(%ebp) call 804839 b <p 2> add $0 x 8, %esp mov %eax, 0 xfffffffc(%ebp) printf("%d=%d+%dn", z, x, y); pushl 0 xfffffff 8(%ebp) pushl 0 xfffffff 4(%ebp) pushl 0 xfffffffc(%ebp) push $0 x 8048510 call 80482 b 0 <printf@plt> … 被调用者 堆栈 框架 ebp esp esp ebp cs: eip x的值 y的值 低地址 调用者 堆栈 框架 ebp 高地址 p 2的返回值是如何返回给main的? 2/24/2021 xlanchen:Linux OS Analysis 34
观察main中的局部变量 int main(void) { push %ebp mov %esp, %ebp sub $0 x 18, %esp … char c='a'; movb $0 x 61, 0 xfffffff 3(%ebp) int x, y, z; x=1; movl $0 x 1, 0 xfffffff 4(%ebp) y=2; movl $0 x 2, 0 xfffffff 8(%ebp) … 2/24/2021 xlanchen:Linux OS Analysis 35 低地址 esp c=‘a’ x=1 y=2 ebp esp ebp 调用者 ebp 高地址
观察程序运行时堆栈的变化 eip eip 2/24/2021 p 2 p 1 p 2 main … main p 1(c) … p 2(x, y) … 程序的代码段 xlanchen:Linux OS Analysis esp p 1的堆栈 p 2堆栈 eip x,y c main堆栈 堆栈 36
观察程序运行时堆栈的变化 eip p 1 eip eip p 2 … p 1(c) … p 2 eip eip eip main … p 2(x, y) … main esp p 1堆栈 eip c p 2堆栈 eip x,y main堆栈 esp 堆栈 程序的代码段 2/24/2021 xlanchen:Linux OS Analysis 38
pt_regs结构 2/24/2021 Include/asm-x 86/ptrace. h xlanchen:Linux OS Analysis 41
arch/x 86/kernel/entry_32. S SAVE_ALL和restore_all使用RESTORE_REGS 2/24/2021 xlanchen:Linux OS Analysis 42
站在CPU执行指令的角度 idle 系统调用处理 进程管理 中断处理 CPU idtr intr esp 内核其他模块 eip wait keyborad queue eip esp Wakeup progress cs ds等等 esp 0 xc 0000000 some action 8259 c=gets() … esp main keyboard 2/24/2021 进程x xlanchen:Linux OS Analysis 进程x 50
virtualbox v http: //www. virtualbox. org/ Ø Windows和Kubuntu下都可以安装 Ø Kubuntu下安装的是virtualbox-ose (Open Source Edition) 2/24/2021 xlanchen:Linux OS Analysis 54
- Linux 1991
- Linus torvalds 1991
- Linux kernel linux security module m1
- Embedded linux vs desktop linux
- History of html
- Java is invented by_______in 1991.
- Martha stewart living masthead
- Industrial policy
- Pindaan minit mesyuarat
- School established 1991
- Codex stan 1-1985, rev. 1-1991
- In 1991
- Alcock v chief constable
- Dillan 1991
- Self – marc quinn, 1991
- The little mermaid 1989 characters
- Scans report 1991
- Modelo de besseyre des horts (1990)
- Photorealism chuck close
- Perang dingin
- Ritter 1991
- 1991 pacs
- Industrial licensing policy 1991
- 1991 realignment
- Robbins 1991
- Starbuck logo
- December 25 1991
- 1991-1947
- Poblogaeth cymru 1991
- World wide web 1991
- Alice dixson
- Cold war 1947
- 1991
- 1991
- Demi moore, culver city, california, 1991
- Ajzen (1991)
- Amina rashad
- Como es la pendiente de una recta perpendicular
- Good places better health
- Java diciptakan pada tahun 1991 oleh
- Firm resources and sustained competitive advantage
- Communsim
- 1991-1964
- Html 1991
- Hardware
- Bagian bagian microsoft publisher
- Onion model of stakeholders
- Eruption 1991
- 1991-1979
- Karmen zupanovic
- 1991-1975
- Aaker 1991 brand equity model
- Cuales son las fuentes del derecho penal
- Ajzen 1991
- Nelson 1991
- 1973 türkiye güzeli beyhan kıral
- Constitucion de 1991
- Self – marc quinn, 1991