资源描述
Click to edit Master title style,Click to edit Master text styles,Second level,Third level,Fourth level,Fifth level,11/7/2009,#,IntroductionandStartLinux,Outline,HistoryofUnix,IntroductiontoLinux,OverviewofOSandKernel,CompareLinuxandUnix,KernelVersion,ObtainingLinuxKernel,BuildLinuxKernelandInstallit,ABeastofaDifferentNature,2022/4/21,LiangShi:LinuxOperatingSystems,60,HistoryofUnix,2022/4/21,LiangShi:LinuxOperatingSystems,60,2022/4/21,LiangShi:LinuxOperatingSystems,60,IntroductiontoLinux,OpenSourceOperatingSystems,Embeddedsystemstoservers,widelyused,GeneralPublicLicense(GPL),WhatisLinux?,2022/4/21,LiangShi:LinuxOperatingSystems,60,什么是Linux?,Linux是一个类Unix(Unix-like)的操作系统,,在1991年发行了它的第一个版本,在Linux内核维护网站上,“WhatisLinux?”,2022/4/21,LiangShi:LinuxOperatingSystems,60,From“www.kernel.org”,Linux的来历和目标:,Linuxis,acloneoftheoperatingsystemUnix,written,fromscratchby,LinusTorvalds,withassistancefroma,loosely-knitteamofhackersacrosstheNet.,Itaims,towardsPOSIXand,SingleUNIXSpecification,compliance,PortableOperatingSystemInterfaceStandard,.,Linux的功能,可移植操作系统接口标准由IEEE制订,并由ISO接受为国际标准。,Ithasallthefeaturesyouwouldexpectinamodernfully-,fledgedUnix,includingtrue,InstituteforElectricalandElectronicEngineers,multitasking,virtual,memory,电气电子工程师学会,sharedlibraries,美,demandloading,shared,copy-on,InternationalOrganizationforStandardization,-writeexecutables,propermemory,management,国际标准化组织,andmultistack,networking,includingIPv4,andIPv6.,制定各行各业各种产品和服务的技术规范(国际标准),2022/4/21,LiangShi:LinuxOperatingSystems,60,Linux支持的目标体系结构,Althoughoriginallydevelopedfirst,for32-bitx86-based,PCs(386orhigher),todayLinuxalsorunson(atleast),the,AlphaAXP,SunSPARC,Motorola68000,PowerPC,ARM,HitachiSuperH,IBMS/390,MIPS,HPPA-RISC,IntelIA-64,AMDx86-64,AXISCRIS,RenesasM32R,AtmelAVR32,RenesasH8/300,NEC,V850,TensilicaXtensa,and,AnalogDevicesBlackfin,architectures;formanyofthesearchitecturesinboth32-,and64-bitvariants.,2022/4/21,LiangShi:LinuxOperatingSystems,60,在内存管理方面不得不说的,Linuxiseasilyportabletomostgeneral-purpose32-or,64-bitarchitectures,aslongastheyhaveapaged,memorymanagementunit(PMMU),and,aportofthe,GNUCcompiler(gcc)(partof,TheGNUCompiler,Collection,GCC,).,Linuxhasalsobeenportedtoa,numberofarchitectures,withoutaPMMU,although,functionalityis,thenobviouslysomewhat,limited,.See,the,Clinuxproject,formoreinfo.,2022/4/21,LiangShi:LinuxOperatingSystems,60,“Linux”,在不同的语境下,“Linux”具有不同的内涵,例,如:,Linux内核、Linux系统或Linux开发套件等术语。,严格来说,Linux指的是LinuxTorvalds维护的(,及通过主要和镜像网站发布的)内核。,GNU/Linux,GNU/Linux的拥护者们认为,Linux仅仅是指Linux内,核,而整个Linux系统的大部分都建立在GNU软件之,上。,2022/4/21,LiangShi:LinuxOperatingSystems,60,GNU,“g-noo”,“GNUsNotUnix”,2022/4/21,LiangShi:LinuxOperatingSystems,60,Linux内核维护网站,www.kernel.org/,TheLinuxKernelArchivesMirrorSystem,2022/4/21,LiangShi:LinuxOperatingSystems,60,Linux发展简史,1991年11月,芬兰赫尔辛基大学的学生Linus,Torvalds写了个小程序,后来取名为Linux,放在,互联网上。他表达了一个愿望,希望借此搞出一,个操作系统的“内核”来,这完全是一个偶然事,件,1993,在一批高水平黑客的参与下,诞生了Linux,1.0版,1994年,Linux的第一个商业发行版Slackware问,世,2022/4/21,LiangShi:LinuxOperatingSystems,60,1996年,美国国家标准技术局的计算机系统实验,室确认Linux版本1.2.13(由OpenLinux公司打,包)符合,POSIX,标准,2001年,Linux2.4版内核发布,2003年,Linux2.6版内核发布,2022/4/21,LiangShi:LinuxOperatingSystems,60,Linux操作系统的主要内容,Linux是免费的、源代码开放的、符合POSIX标,准规范的操作系统,拥有现代操作系统具有的所有内容,例如,抢占式多任务处理,支持多用户,内存保护,,支持SMP,支持TCP/IP,,支持绝大多数的32位和64位CPU等,还有一些其他操作系统没有的特色,比如,NFS,VFS,高效的EXT系列文件系统等,2022/4/21,LiangShi:LinuxOperatingSystems,60,Linux版本,Linux的,内核版本,几种流行的Linux,发行版本,2022/4/21,LiangShi:LinuxOperatingSystems,60,Linux的内核版本,Linux内核版本是由LinusTorvalds作为总体协调人的,Linux开发小组(分布在各个国家的近百位高手)开发出,的系统内核的版本号,Linux内核采用的是双树系统,一棵是稳定树,主要用于发行,另一棵是非稳定树或称为开发树,用于产品开发和改进,Linux,内核版本号,由3位数字组成,r.x.y,第3位数字y为修改号,表示,第1位数,错误修补的次数,字r为主,版本号,第2位数字x为说明版本类型的次版本号,如果,x为偶数,则表示为产品化版本,为奇数时表,示为实验版本,2022/4/21,LiangShi:LinuxOperatingSystems,60,几种流行的Linux发行版本,2022/4/21,LiangShi:LinuxOperatingSystems,60,Linux系统的好处,支持多种CPU,X86,ARM,MIPS,SH,i960,PPC,etc.,开放源代码(Opensource),强大的网络功能,可移植性,使用GNUtools,2022/4/21,LiangShi:LinuxOperatingSystems,60,一个新潮,非常稳定,多用户,多任务的环境,标准的平台,无法超越的计算能力,可移动性和适应性,先进的图形用户界面,几十个异常出色而且免费的桌面应用程序,成千上万个免费的工具和应用小程序,几百上千个专业程序由全世界的无数研究人员编制,覆,盖了天文,信息技术,化学,物理,工程,语言,生物,等各个学科领域,2022/4/21,LiangShi:LinuxOperatingSystems,60,一个真正杰出的学习系统,很多顶级的系统开发平台,友好的编程语言及编程工具,都免费包含在操作系统里面,病毒入侵,计算机的“后门”,软件提供商的“特别要,求”,强迫性的软件升级,专有的文件格式,软件使用,许可证和市场策略,产品注册登记,高得惊人的软件价,格,等等-Linux都没有,Linux操作系统平台保证它的“永久性”,一个技术快速更新的平台,2022/4/21,LiangShi:LinuxOperatingSystems,60,OverviewofOSandKernel,2022/4/21,LiangShi:LinuxOperatingSystems,60,操作系统的基本概念,任何计算机系统都包含一个基本的程序集合,称,为操作系统。,内核(进程管理,进程调度,进程间通讯机制,内存,管理,中断异常处理,文件系统,I/O系统,网络部,分),其他程序(例如函数库,shell程序等等),操作系统的目的,与硬件交互,管理所有的硬件资源,为用户程序(应用程序)提供一个良好的执行环境,2022/4/21,LiangShi:LinuxOperatingSystems,60,一个典型的Linux操作系统的结构,(theusers),用户应用程序,Shellsandcommands,Compilersandinterpreters,Shell,lib,Systemlibraries,System-callinterfacetothekernel,System,call,Signalsterminal,Filesystem,CPUscheduling,handling,swappingblockI/O,pagereplacement,Kernel,implementation,characterI/Osystem,system,demandpaging,terminaldrivers,diskandtapedriver,virtualmemoryr,Kernelinterfacetothehardware,对硬件资,源的管理,Terminalcontrollers,Devicecontrollers,Memorycontrollers,terminals,disksandtapes,physicalmemory,2022/4/21,LiangShi:LinuxOperatingSystems,60,最简单也是最复杂的操作,在控制台下输入ls命令,为什么我们敲击键盘,就会在终端上显示?,中断的概念,终端,控制台设备驱动的,概念,Shell程序分析输入参,数,确定这是ls命令,什么是shell?,终端解释程序,保护模式和实模式,,内存保护,内核态用,户态相关问题,什么是系统调用?,调用系统调用fork生成,一个shell本身的拷贝,系统调用是怎,么实现的?,软中断、异常的概念,。陷阱门,系统门,fork是什么?,为什么要调用fork?,进程的描述,,进程的创建。,COW技术,调用exec系统调用将ls,的可执行文件装入内存,内存管理模块,进程的地址空间,,分页机制,文件系统,从系统调用返回,如何做到正确的返回?,堆栈的维护,寄存,器的保存与恢复,Shell和ls都得以执行,进程的调度,运行队列,等待队列的维护,2022/4/21,LiangShi:LinuxOperatingSystems,60,LinuxVS.Unix,Different,ButSimilar,OpenorClose,Advanced:,Dynamicalloadingofkernelmodules,SMPsupport,Preemptive,Threadsupportdifferently,.,2022/4/21,LiangShi:LinuxOperatingSystems,60,KernelVersion,2022/4/21,LiangShi:LinuxOperatingSystems,60,ObtainingLinuxKernel,www.kernel.org,Gitcommand,Gitclonegit:/git.kernel.org/pub./linux-2.6.git,2022/4/21,LiangShi:LinuxOperatingSystems,60,BuildLinuxKernelandInstallit,Config,Makeconfig,Compile,make,Install,Copyandstartupthenewkernel,2022/4/21,LiangShi:LinuxOperatingSystems,60,ABeastofaDifferentNature,Nolibcorstandardhearders,GNUC,InlineFunctions,InlineAssembly,BranchAnnotation,NoMemoryProtection,No(Easy)UseofFloatingPoint,Small,Fixed-SizeStack,SynchronizationandConcurrency,ImportantofPortability,2022/4/21,LiangShi:LinuxOperatingSystems,60,SourceInsight,源代码阅读和编辑工具,拥有内置的对C/C+,C#和Java等程序的分析。,能分析源代码并动态维护符号数据库,能自动显,示有用的上下文信息。,到,Shi:LinuxOperatingSystems,60,当前源码文件,当前文件的,符号表,Project相关信息,符号类型分类文件类型配置信息按目录,文件列表所有文件列表符号表,当前所看的符号上下文,当前所看符号的调用关系,2022/4/21,LiangShi:LinuxOperatingSystems,60,课后作业,调研Linux发展史,写一个Linux对你的启发以及,你对本门课程的期望(1000字以内),电子稿,,发到邮箱cqu_liang,下载Linux,安装SourceInsight,,开始,阅读源码,购买书籍,,开始,Linux基础学习,安装Linux操作系统,,开始,学习Linux的使用,2022/4/21,LiangShi:LinuxOperatingSystems,60,
展开阅读全文