- 1、本文档共22页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
CPU从键盘读取hello命令.ppt
* 当在键盘敲回车时,操作系统执行一系列命令将代码和数据从磁盘调入主存。 * 一旦hello代码和数据存入主存,CPU就开始执行hello程序中的指令并依照这些指令将“hello\n”中的字节从存储器中拷贝到寄存器组再从寄存器中输送到显示终端。 * Back to our hello example. When the shell loaded and ran the hello program, and when the hello program printed its message, neither program accessed the keyboard, display, disk, or main memory directly. Rather, they relied on the services provided by the operating system. We can think of the operating system as a layer of software interposed between the application program and the hardware, as shown in Figure 1.10. All attempts by an application program to manipulate the hardware must go through the operating system. A Tour of Computer Systems /~course/cs101/2008 Hongfei Yan School of EECS, Peking University 9/24/2008 * Outline 信息就是位 + 上下文 程序被其他程序翻译成不同格式 处理器读并解释存储在存储器中的指令 操作系统管理软件 利用网络系统和其他系统通信 * What happens and why, when you run hello on your system ? 1 # include stdio.h 2 int main() 3 { 4 printf(“hello, world\n”); 5 } * Information is bits The source program is a sequence of bits each with a value of 0 or 1, Bits organized in 8-bit chunks called bytes. Each byte represents some text character in the program. Most modern systems represent text characters using the ASCII standard that represents each character with a unique byte-sized integer value. * Hello.c的ASCII表示 * 一个基本思想 系统中所有的信息 包括磁盘文件、存储器中的程序、用户数据以及网络上传送的数据, 都是由一串比特表示的。 区分不同数据对象的惟一方法是我们读到这些数据对象时的上下文 不同的上下文,同样字节序列可能表示一个整数、浮点数、字符串或者机器指令 与常见的整数和实数是不同的,需要了解数字的机器表示 * 一个具有很多命令的功能非常强大的编辑器 Install /tool/forWin/gvim72.exe 运行vim tutor 学习一个25-30分钟的教程 * Outline 信息就是位 + 上下文 程序被其他程序翻译成不同格式 处理器读并解释存储在存储器中的指令 操作系统管理软件 利用网络系统和其他系统通信 * Programs Are Translated by Other Programs into Different Forms The hello program begins life as a high-level C program which human-readable form. In order to run hello.c on the system, the individual C statements must be translated by other programs into a sequence of low-level machine-language instructions. These instructions are then packaged in a form
文档评论(0)