1. 如何从零开始写一个简单的操作系统
(一)OS说明
今后,我就要开始折腾操作系统,有了一点小小干劲。
我的计划是,先看过一份用于教育目的的系统源码,再去翻找相应的资料(我手头已有绿宝书),在翻资料的同时开始写代码,然后做好移植真机的工作,DONE!
我也明白,理性很丰满,现实很骨感,这过程不会如同我计划中这般简单和轻松。但是,见难而退可不是我的风格(那样我会被红叶二小姐调戏的),不管如何,我都会,怎么说呢,尽力吧。
出于课程需求,斯坦福那些人亲自写了一个名为“pintos”的系统。pintos的结构比较简单,分为进程管理、文件系统、用户程序、虚拟内存等几个部分,也正是因为这个原因,我选择pintos作为我的参考蓝本,现在在读它的源码。
在接下来的几个月时间里,不出意外的话,我会不断的在博客上更新我的进度。
(三)交叉编译环境
倘若我们要在ubuntu上编译另外一个完整的OS,交叉编译环境是必不可少的玩意,维基网络有云:
交叉编译器(英语:Cross compiler)是指一个在某个系统平台下可以产生另一个系统平台的可执行文件的编译器。
(想起以前,我为了给路由器编译OPENWRT,下载大量源码,愣是编译了几天几夜。那时候的我,真是“可爱”。)
为了配置好交叉编译环境,我废了好大力气,最后勉强找到了组织。
编译环境大致分为2部分,binutils和gcc。我先装好gcc-4.9.1,之后下载gcc-4.9.1和binutils-2.25的源代码,似乎gcc版本与binutils版本要对应来着…
开始编译之前,需要准备全局变量(在命令行中敲入以下命令):
export PREFIX=”$HOME/opt/cross”
export TARGET=i686-elf
export PATH=”$PREFIX/bin:$PATH”
编译Binutils
cd $HOME/binutils-2.25
mkdir build-binutils
cd build-binutils
#注意是在源码目录下面新建一个文件夹,然后cd到该文件夹里,然后才配置configure,不这么做的话,嘿嘿..
../binutils-x.y.z/configure –target=$TARGET –prefix=”$PREFIX” –with-sysroot –disable-nls –disable-werror
make
make install
–disable-nls 告诉binutils,不要添加本地语言支持
–with-sysroot 告诉binutils,在交叉编译器中允许sysroot
编译GCC
cd $HOME/gcc-4.9.1
mkdir build-gcc
cd build-gcc
#注意是在源码目录下面新建一个文件夹,然后cd到该文件夹里,然后才配置configure,不这么做的话,嘿嘿..
../gcc-x.y.z/configure –target=$TARGET –prefix=”$PREFIX” –disable-nls –enable-languages=c,c++ –without-headers
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
–disable-nls 告诉GCC,不要添加本地语言支持。
–without-headers 告诉GCC,不要依赖任何本地库,我们必须在自己的OS中实现库。
–enable-languages 告诉GCC,不要支持除了C、C++之外的语言。
提醒
不同机器配置不同,编译速度也不同。
编译这两个软件,我花了近3个钟,机器配置之低自不必说,说了都是泪。
如果任何人的任何编译过程出了任何问题,请仔细地、认真地、用心地再看看上面的命令,在你没有弄懂它的原理之前,请不要擅自做任何“改进”(血淋淋、赤裸裸的教训呀)。
(五)OS模糊框架
翻完了手头的绿宝书,我才晓得,人都是被逼出来的。
操作系统的概念都差不多已经知道,接下来,该由“理论态”切换到“实践态”了喔(书还是不能看太多,会中毒的–)。
对了,从别人推荐的地方弄来了一个框架(曾在android平台写了几万代码,我深深体会到框架的作用),轻松开工吧。
2. 英文缩写UPS 是什么意思
UPS( Uninterruptible Power System ),即不间断电源,是一种含有储能装置,以逆变器为主要组成部分的恒压恒频的不间断电源.主要用于给单台计算机,计算机网络系统或其它电力电子设备提供不间断的电力供应.当市电输入正常时,UPS 将市电稳压后供应给负载使用,此时的 UPS就是一台交流市电稳压器,同时它还向机内电池充电;当市电中断( 事故停电 )时, UPS 立即将机内电池的电能,通过逆变转换的方法向负载继续供应220V交流电,使负载维持正常工作并保护负载软,硬件不受损坏.
--------------
例: To prevent this, UPS is widely used in computer and communications systems, audio and video facilities, electronic equipment, medical facilities and many other places.
为了防止这种情况发生,ups被广泛应用于计算机系统和通信系统、声像设备、电子设备、医疗设备以及其他许多地方。
3. 求助!帮我翻译下 汉译英 高分悬赏
为了探索商用LED跑马灯的利用价值,真正实现其开发便捷,使用方便,价格低廉的特点,特设计基于嵌入式linux系统的跑马灯。随着信息时代的走进,嵌入式Linux系统逐渐被人们看好及广泛应用于商用领域,我们通过探索实验得出,做LED跑马灯基于嵌入式Linux系统是便捷、快速、成本小、开发周期短的一个最好办法。本文主要介绍了嵌入式的概况及应用领域,嵌入式Linux系统的概况及发展趋势,还简单的介绍了我们试验中要用到得ARM9实验板的概况,总之在本文中既有嵌入式的软件又有嵌入式硬件方面的内容,都很详细。通过大量前期资料的整理,我们在Linux环境中编译出了LED跑马灯的驱动程序和应用程序,通过交叉编译在ARM9实验板上运行并最终实验测试结果正常,达到我们要实验的目的。结果表明,基于嵌入式Linux系统LED跑马灯的设计与实现,是最便捷,简单,开发周期短的方式。在开发结果我们也看出LED跑马灯用嵌入式Linux系统编译,在Linux系统的开发环境下运行良好,如我们大家所期待达到我们所要求的实验目的,并从中表现出极好的运行性能和安全性能。
Make use of value for probing commercial LED horse race light's , truly put into effect whose exploitation is convenient and rapid , usage goes to the lavatory , the cheap characteristic of price , the secret agent design that owing to implanting dyadic systematic Linux horse race light. With the fact that the information ear walking moves forward, dyadic implantation Linux system is found the commercial field satisfactory and applied to broadly graally by people, that we reach , make LED horse race light by probing an experiment is convenient and rapid owing to implanting dyadic Linux system , the fleetness , cost develop a short best way of period for a short time. Implant the dyadic general situation and application field that the main body of a book has been introced mainly , implant the dyadic systematic general situation of Linux and developing trend, unnatural general situation having introced that we need to use to getting the ARM9 experiment in the experiment fairly simplely, the content both have aspect to implant the dyadic software and have to implant the dyadic hardware in the main body of a book, is in short , all very detailed. Arranging by large amount of the earlier stage data , our driver and application having compiled and translated out LED horse race light in the environment in Linux, that the work and ultimate experiment tests result by intersection compile and translate on ARM9 experiment board is regular , achieve our essential points experiment's purpose.Result is indicated, owing to the design implanting dyadic Linux system LED horse race light and the way coming true , being convenient and rapid , simple , developing a period shortly. We also perceive LED horse race light in the result developing using dyadic implantation Linux system to compile and translate , operation is fine under systematic Linux exploitation environment, if what all of us expects to achieve what our demands experiment purpose, and is extremely good out of runs the function and the safe function.
本文在介绍嵌入式Linux系统的基础上,研究在LED跑马灯方面的应用,引用嵌入式Linux系统跑马灯设计训练过程及测试结果,最后通过交叉编译,实现了基于嵌入式Linux系统的跑马灯设计能够取得比较好的效果。
The systematic basis is listed in the main body of a book in Linux introcing implantation style , is study the application in the field of LED horse race light, the horse race light quoting dyadic implantation Linux system horse race light designing the system training process and testing result , the at last having come true by intersection compile and translate, owing to implanting dyadic Linux designs that being able to get comparatively good effect.
这样就可以了。希望能帮到你。
4. 请教英语达人,GCC 是什么意思的缩写,在公司的一些资料上总看到GCC作为句子的后缀。
GCC: 1. GNU编译器合集 (GNU Complier Collection)
2. 海湾合作委员会 (Gulf Cooperation Council)
5. GCC英文缩写是什么意思
有两种答案,不知道你说的是哪个,就两个一起吧~
1、GCC,由GNU之父Stallman所开发的linux下的编译器,全称为GNU Compiler Collection, 目前可以编译的语言包括:C, C++, Objective-C, Fortran, Java, and Ada, 可以在其官方页面找到更加详细的信息
GCC是一个原本用于Unix-like系统下编程的编译器。不过,现在GCC也有了许多Win32下的移植版本。这要感谢Internet上众多程序员的共同努力。
*Win32 下的 GCC 详细可察看词条:GCC for Win32
历史
GCC是GNU公社的一个项目。是一个用于编程开发的自由编译器。最初,GCC只是一个C语言编译器,他是GNU C Compiler 的英文缩写。随着众多自由开发者的加入和GCC自身的发展,如今的GCC以经是一个包含众多语言的编译器了。其中包括 C,C++,Ada,Object C和Java等。所以,GCC也由原来的GNU C Compiler变为GNU Compiler Collection。也就是 GNU编译器家族的意思。当然,如今的GCC借助于他的特性,具有了交叉编译器的功能,即在一个平台下编译另一个平台的代码。
直到现在,GCC的历史仍然在继续,他的传奇仍然被人所传颂。
2、海湾阿拉伯国家合作委员会(GCC)由沙特、阿联酋、科威特、卡塔尔、阿曼和巴林六国于1981年5月成立。旨在加强成员国之间各领域的协调与合作,推进一体化进程。总秘书处设在沙特首都利雅得。最高权力机构为最高理事会,由成员国元首组成,主席由各国元首轮流担任,任期一年。