操作系统、Linux、CPU的几个疑惑点

  1. Linux与Debian、Slackware、Redhat之间是什么关系?
    Linux仅仅是一个内核,而一个完整意义上的操作系统应该是由内核+各种应用程序applications组成,而对于现行的Linux而言,它完整的操作系统其实是由Linux内核+GNU组织的各种各样的开源的应用程序共同组成,所以完整的Linux应称为GNULinux,但是GNU仅仅是众多开源协定当中的一个发起者,gtl是GNU组织下的开源协定。
    GNULinux是一组开源程序,大多数通常都以源代码方式提供,而开源软件的最大特性在于自由和灵活,自由与灵活的代价是使用者要肩负起更大的责任,而Windows则没有多余的选择,但是Linux给了我们更多自己可以拼凑相关应用程序的权限和机会。
    任何高级语言甚至是汇编语言所编写的程序的源代码是不可能能在计算机上直接运行的,计算机只能执行二进制指令,同样CPU也只能处理二进制数据
  2. 二进制与源代码的区别
    源代码是文本格式的,文本格式的程序必须把一种语言翻译成机器语言,我们可以把机器语言理解成为二进制格式的数据,CPU只能理解二进制格式的数据,所以说,编译器可以将应用程序的源代码翻译成为对应的机器能够运行的二进制格式
  3. 不同系列的CPU
    对于CPU而言,不同厂商生产的CPU的内部设计与所支持的指令可能并不完全相同,如英特尔所生产的CPU 32位的称为×86系列,但是这个叫做×86兼容PC CPU,amd或者英特尔所生产的×86CPU即便内在的设计逻辑不同,外部接口也可能不同,但它们都称为PC兼容机×86 CPU
    对于64位的CPU来讲,我们称为×64,从本质上来讲,称为amd64,因为真正第一款64 位的PC架构上的CPU是由amd研发的,英特尔发行后在后面先假装自己有了64位,而后过了很长时间才有了真的64位,所以到现在为止想Debian这个系列它们的64位发行版都叫amd64,事实上他们都是×64这个系列的
    早期Linux所运行的主机主要是摩托罗拉生产的,摩托罗拉的CPU是很有名的,叫m68000,简称为m68k
    我们现在手持的移动智能设备的CPU架构是arm系列的
    区别:每一种系列CPU内在的设计逻辑和外部支持的逻辑指令以及内部的运行方式和耗电性都不一样,如果一款程序写完以后只能支持前两种的某一种,比如×64是能够兼容×86的,在×86上写的程序在×64上也可以运行,反之不行;同理,如果写了一个程序在m68k上运行的话,那么在×64上是运行不了的。
  4. 机器语言、汇编语言与高级语言
    任何一个底层应用程序编写的时候其机器指令一定是机器本身所能够说的语言,很显然,我们可以把它理解成为不同国家的语言,如×86是方言,×64是同一国家的普通话,但m68完完全全是另一种机器语言,虽然都是机器语言但彼此之间差异甚大,而arm系列是目前手持移动智能终端设备上最常见的CPU,而arm仅仅是设计商,这就意味着设计arm体系架构的厂商几乎从来不生产CPU。
    CPU架构(跑的系统)
    ×86
    ×64
    m68000 m68k
    arm
    ultrasparc:solaris
    power:aix
    powerpc ppc
    MIPS
    alpha:hp-ux
    系统可不是乱跑的,每个硬件厂商所生产的机器,所说的机器语言和其他厂商是不兼容的
    每一种底层的硬件架构都要有自己的机器语言,而我们写程序时都使用它的机器语言来编写的话就太拙劣了,开发起来太慢,程序媛也极难学会机器语言,所以后来每一种机器的生产厂商在机器设计完后提供一个叫微码编程的接口,称为汇编语言,任何汇编程序员就可以调用这个汇编语言来编写程序,但是汇编语言写的程序仍然不能在机器上运行,需要汇编器转换成机器语言才能运行,而任何一个操作系统都是直接运行在硬件之上的,即便使用汇编语言写,但有一部分代码又可能仍然离不开机器的语言,那时候用汇编语言写的程序是极难移植的,所以如果想开发一个通用软件让它在一种架构上可以运行,换一种架构也能运行是很困难的,此外,汇编语言还有一种特性,即便是同一系列的不同代的CPU,如奔1、奔2…奔1上写的程序在奔2上能运行,可以做到向后兼容,即在老CPU上写的程序在新CPU上可以运行,但反过来不行,如奔2写的程序在奔1上不能运行,因为奔2可能提供了新的指令,奔1不具备的指令,这样的结果就是为了有更好的兼容性,程序员只敢使用老系列的CPU。
    这时就迫切需要使用一种高级语言,这种高级语言所写的代码与底层的CPU是没有关系的,它脱离了CPU的依赖型,因此,用高级语言写的程序在任何一种CPU上都能运行。
    高级语言的特性:高级语言先编译,借助编译器,编译后转换成汇编语言,即转换成CPU所支持的汇编语言代码,然后再由汇编器转化成机器代码,这些高级语言通常指C、C++,它们所编写的代码通常是跟CPU没有关系的,在任何CPU架构都可以运行,但前提是我们需要使用编译器将此源程序即文本格式的程序先转换成对应CPU架构的,那么如何知道对应的CPU架构呢?所谓编译过程就是运行一个程序的过程,而任何程序的运行一定在主机CPU上运行的,而这一编译过程开始时就决定了我们编译的结果会适用于哪一款CPU,即编译器在转换时就转换成了编译器所正在运行的这款CPU所支持对应的汇编语言代码,然后在使用汇编器转换成这个底层CPU所真正能执行的机器代码,然后就可以运行啦
    编译器是支持交叉编译的,我们称为cross compile,这样一来我们使用高级语言所编写的代码具有较好的移植性,但是这个代码在没编译时可以在各种平台上编译且都可以适用于该平台,但一旦编译完成就不能在互相交叉适用。
  5. 系统调用、库调用、硬件规格、系统可移植性解决
    kernel把底层硬件的复杂性给隐藏起来,向上提供了一种较为简洁的接口,叫做系统调用systemcall(系统调用的主要目的是隐藏底层硬件复杂性,并将底层硬件所提供的功能使用一种统一规范的风格提供出来的,所以说Linux内核被编译运行在×86CPU上或arm CPU上对程序员来说没有区别,程序员只需要面对Linux内核就行,kernel把底层所有的差异性统一了起来但是为了保证这个kernel有足够的通用性,它们所提供的系统调用接口依然非常底层,因此就有人专门为Linux内核上,把这些功能键上比较公共的部分再一次做了封装和抽象,让它离用户更近一步,这一层叫做“”,而对于库而言,它们所提供的接口就是库调用**,再向上一层叫做硬件规格。对于库本身,无论底层CPU是什么样的架构,在库之上的层次上,它们是统一而规范的。但是不同操作系统的库可能不一样,比如Windows与Linux的库即便都是C库,但它们的接口、内部实现、编码机制、调用接口可能都不一样,因此,在Linux上运行的程序在Windows上未必能跑起来,这又阻碍了程序的可移植性,因此,POSIX规范可移植操作系统出现。每一个操作系统自己这只不过是把底层硬件的复杂性给隐藏起来,但它向上提供的接口虽然叫系统调用,但系统调用有两种层面的意义,第一,对程序员而言,叫系统调用,是一种编程接口,但对于运行程序却是另一种接口,叫调用的二进制格式程序接口,通常称之为ABI,每一种操作系统,无论是它自己的系统调用还是其上面库所提供的调用,二者一旦被制作成二级制格式之后,其一定能形成自己的固定固有的二进制格式,比如Windows的二进制程序都是exe格式或msi格式,而对于Linux而言,它的二进制格式叫elf格式,即便都是二进制文件,但它们的内生格式是不一样的,所以此二进制不同于彼二进制,因此,在编译之前,即便调用接口都一样,但一旦转成二进制格式,它们所运行的环境依然不同,所以之前说程序员的编程接口有API:Application Program Interface(又可能是兼容的,只要遵循POSIX规范就兼容)和ABI:Application Binary Interface(运行时的接口)
    Unix-like操作系统:类Unix系统,如Linux、BSD、AIX,这一类系统的特性在于接口是兼容的,无论是API还是ABI系统都兼容,即早年开发在Unix主机上的程序即便在Unix上编译出来后泡在Linux上也是可以的。
  6. 开源程序与闭源程序
    闭源程序:封闭源代码,不提供源代码的
    开源程序:提供源代码,为程序的服务而收费
    几种开源协定:
    GPL:General Public License通用公共许可证,任何一款软件只要遵循GPL协定就意味着其版权属于GPL
    LGPL:Lesser GPL任何程序员在写程序时,没有盗用我们的代码,但调用了我的代码中的库,就可以不用开源,即基于库接口调用时可以不用开源,但只能以库接口方式进行
    BSD
    Apache
    这两种协定相对宽松,比如一家公司用了遵循Apache协定的程序,该程序本来有2万行代码,该公司改了两行,该公司就可以说这个程序是它研发的。即拿去做商业化使用时,只要不以原作者的名义做宣传都可以
    双线授权:community:遵循开源协定;Enterprise:收费
  7. 程序管理
    (1)程序的组成部分:
    【1】二进制程序:最关键的,一个程序能运行的内容
    【2】配置文件:通常为文本文件,为了让一个程序运行表现出不同的特性,通常一个程序会在内部提供一些接口,给了很多选项,能够让用户指明不同选项从而拥有不同的运行特征,这些都是通过配置文件保留的
    【3】库文件:应用文件自己提供的库,很多应用程序支持二次开发,
    【4】帮助文件:写程序的使用帮助
    (2)程序包管理器:(是事先运行在操作系统之上的)
    【1】程序的组成文件打包成一个或有限几个文件
    【2】安装:打包成的文件指定在安装目录下
    【3】卸载:安装生成的所有文件查出来并删除
    【4】查询
    不同的发行版在程序管理上所用到的程序包管理器有可能是不一样的
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Linux Hardware Compatibility Lists Debian GNU/Linux device driver check page - This database verifies the PCI devices at this time (X drivers, ISA, USB, IEEE1394 or any other devices are out of its focus). Paste your result of 'lspci -n' taken from GNU/Linux OS (such as Debian, Knoppix, RedHat, and so on) to the box, then push 'Check' button. openSUSE Hardware Compatibility List - The following pages are used by the openSUSE community to record the compatibility of various hardware and full systems with SUSE Linux. Please share your experience by adding your hardware, especially if you had some issue that you overcame. Mandriva Hardware Database - This hardware database allows you to check the compatibility of your hardware with the Mandriva Linux OS. The certified hardware has the highest level of compatibility. Red Hat Hardware Catalog - Database containing certified hardware for Red Hat products. UbuntuUsers Hardwaredatenbank - Auf dieser Seite soll eine Hardwaredatenbank fuer Ubuntu Linux entstehen. Sie koennen hier unter Ubuntu Linux verwendete (neuere) Hardware hinzufuegen, welche gut laeuft. LinuxQuestions.org HCL - This is the Linux Hardware Compatibility List from LinuxQuestions.org. Linux Hardware Compatibility HOWTO - This document attempts to list most of the hardware known to be either supported or unsupported under Linux. Linux Hardware Components - The manufacturers and distributors listed on this site sell hardware and peripherals that are Linux-friendly. If you're looking for drivers or need to know if your hardware is supported, this is a good place to find out. LinuxCompatible.org Compatibility List - This is a user submitted compatibility database for hardware running under GNU/Linux. Phoronix Linux Compatible Hardware - is designed to be a community-driven indexing system for computer hardware under GNU/Linux. This system allows you to post GNU/Linux information on hardware as well as sharing your own personal experiences when it comes to GNU/Linux compatibility. You are also able to browse and search the database for other hardware as well. FSF Hardware Database - Free Software Foundation's listing of hardware that supports free software. Linux-Hardware.org - Die Linux Hardware Datenbank soll Usern einen Ueberblick verschaffen, welche Hardware von welcher Distribution unterstuezt wird. Sie ist so angelegt, dass sie problemlos fuer alle Distributionen genutzt und von Usern ergaenzt werden kann. Linux Support for HP PC's - This page provides an overview of Linux support for HP PC's and peripeherals. Don't base purchasing decisions on the information provided here. This site's main goal is to provide information for people already owning an HP PC. Tuxhardware.de - (TU)X-beliebige Hardware. Tuxhardware.de ist ein Online- Shop in Deutschland der Produkte mit LINUX- Eignung anbietet. Hier finden Sie u.a. auch Installationsanleitungen, Tipps & Tricks und Links zu Treibern. Unix printer compatiblity database listing - The LinuxPrinting.org printer database contains a wealth of information about specific printers, along with extensive driver information, basic specifications, and an associated set of configuration tools. You can just go straight to a particular printer, or you can list all printers from a given manufacturer. Looking for a printer to buy? Take a look at: "Suggested Printers for Free Software Users". Gutenprint Supported Printers - Gutenprint, formerly called Gimp-Print, offers high quality drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL printers for use with Ghostscript, CUPS, Foomatic, and the Gimp. TurboPrint Supported Printers - This is the list of TurboPrint Supported Printers. It includes almost every Canon, Epson & HP and many Brother printers. TurboPrint makes it possible to use the latest color printers with Linux. It is designed to produce maximum quality photo prints as well as high-speed text documents. Printer set-up and configuration is as simple as on Windows or MacOS. TurboPrint is a high-quality printer driver system for Linux built on existing standards (lpr or CUPS printer spooler, ghostscript interpreter for Postscript) thus achieving easy integration and maximum compatibility with existing applications. Von TurboPrint unterstuetzte Drucker - TurboPrint ermoeglicht den Einsatz moderner Farbdrucker unter Linux. Mit TurboPrint erzielen Sie sowohl die bestmoegliche Druckqualitaet bei fotorealistischen Ausdrucken, als auch eine schnelle Ausgabe von Text-Dokumenten. Drucker-Einrichtung und Konfiguration sind durch grafische Menues genauso einfach wie in MS Windows. TurboPrint unterstuetzt fast alle Canon, Epson & HP und viele Brother Drucker. ESP Print Pro Supported Printers - ESP Print Pro supports thousands of printers - search for yours. ESP Print Pro is a complete (commercial) UNIX cross- platform printing software package, containing thousands of high quality printer drivers for AIX, Digital UNIX, HP-UX, IRIX, Linux and Solaris (Intel and SPARC). A free 21-day demo license is available for first-time users. SANE: Supported Devices - shows if your scanner is supported and if yes, by which backend. If it's not supported, it may at least point to documentation or test programs. The search engine contains information from the latest stable SANE release, the development ("CVS") version of SANE and from external backends. The database is updated once per day. VueScan: Supported Scanners - is a continuously upgraded list of VueScan supported scanners. VueScan supports more than 500 different scanners, and these are organized by vendor name. VueScan is a scanning utility that works with most high- quality flatbed and film scanners to produce scans that have excellent color fidelity and color balance. A free trial version is available. Digital Camera Support for UNIX, Linux and BSD - trys to explain how to find out if your camera may work or not under a UNIX system. This site includes a table summarize for digital cameras, how they are supported under UNIX operating systems. Supported Cameras in gPhoto - On this page, you find a list of the supported camera models of the current release of gPhoto (=digital camera software applications for Unix-like systems. gPhoto2 is a free, redistributable, ready to use set of digital camera software applications for Unix-like systems). Support for additional cameras may be in the current libgphoto2 SVN trunk code. They will be added to the next release. If your camera is neither supported in the current release nor in current SVN trunk, it is possible that it is an old camera for which the original gPhoto driver has not been ported yet (mostly due to lack of demand) or it is a new camera for which there is no support at all. Working Webcams with PWC - This is a web-based collaboration area for the next generation Philips Web Camera Linux Kernel Module. On this page, you find a list of the supported Webcams. ALSA Soundcard Matrix - ALSA ("Advanced Linux Sound Architecture") supported audio- cards or chipsets. ALSA provides audio and MIDI functionality to the Linux operating system. OSS Sound Card List - OSS supported audio- cards or chipsets. This list is not 100% complete. There are dozens of sound cards that are based on some standard sound chips (or motherboard chipset) made by vendors like Intel, VIA, Cirrus/Crystal, Analog Devices, Realtek, Yamaha, C'Media, Trident, Sigmatel and many others. Such cards may not be listed in the following list but they are still supported. Driver Status for XFree86 4.3.0 - provides information about the status of the driver and hardware support in XFree86 4.3.0 compared with that in XFree86 3.3.6. Xi Graphics Accelerated-X support - listed by Notebooks/ Laptops, Graphics Cards, Graphics Chips. Li
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值