自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 收藏
  • 关注

原创 算法导论习题-1.2-2

题目Suppose we are comparing implementations of insertion sort and merge sort on the same machine. For inputs of size n, insertion sort runs in 8n28n^2 steps, while merge sort runs in 64nlgn64nlgn steps.

2015-06-08 23:20:47 942 1

原创 实地址模式(Real-address Mode)下,可以操控的资源有哪些(即其执行环境)?

实地址模式下的执行环境由以下几部分组成:可寻址的内存空间,范围[0, 1M]。因最初支持实地址模式的8086处理器只有20条地址线,所以其寻址范围最大只能去到2^20。用于各种用途的寄存器: 通用寄存器。这些寄存器负责临时存放运算结果,或临时存放运算需要的操作数,或临时存放操作数在内存中的地址,或辅助构筑栈(Stack)。它们是:AX, BX, CX, DX, SI, DI, BP, SP。

2015-05-17 12:02:10 1380 1

原创 怎样才算Intel的32-bit 处理器呢?

可以对Intel推出的最后一款16-bit处理器286和Intel推出的第一款32-bit处理器386作一比较,来看出怎样才算32-bit处理器:寄存器的大小不同。286的寄存器大小是16位的;386的寄存器大小扩展到了32位。寄存器大小发生的变化表明386支持对更大范围的数据进行运算,所以数据线的大小也从16位扩大到32位,寄存器也需要相应的扩宽。可寻址内存空间的不同。286支持24条地址线,

2015-05-17 11:40:38 580

原创 IA-32架构和Intel 64架构的区别

IA-32架构和Intel 64架构的区别摘自Intel的手册(Intel 64 and IA-32 Architectures Software Developer’s Manual Volume 1:Basic Architecture): IA-32 architecture is the instruction set architecture and programming envir

2015-05-17 11:31:31 2223

原创 从8086开始,Intel CPU共提供过多少种CPU工作模式?

对于32位架构的Intel CPU(IA-32),有:实地址模式(Real-address Mode),保护模式(Protected Mode),系统管理模式(System Management Mode),以及虚拟8086模式(Virtual-8086 Mode)。对于64位架构的Intel CPU(Intel 64),除了上面3种工作模式之外,还增加了一种工作模式:IA-32e模式

2015-05-17 11:23:47 896

原创 Linux下一些有用的Shell命令

1.如何判断一个ELF格式的可执行文件是32bit还是64bit的?答案:可用命令"readelf -h"。2.如何知道当前系统的Linux内核的版本?答案:可用命令“uname -a”。3.如何知道一个可执行程序的名称是否在PATH环境变量里?答案:可用命令“which”。

2014-01-14 00:02:15 577

原创 如何知道Linux内核当前支持哪些文件系统?

对于Linux操作系统,/proc/filesystems文件列出了当前内核支持的所有文件系统,如:king@debian:~$ cat /proc/filesystemsnodev sysfsnodev rootfsnodev bdevnodev procnodev cgroupnodev cpusetnodev tmpfsnodev devt

2014-01-11 12:27:53 3116

原创 如何使用open系统调用

open函数是操作系统提供的API中的其中一个。操作系统向外围的应用程序暴露API的目的在于向外界提供其管理的各种功能;至于都应该暴露哪些功能以及各种功能的接口应当如何约定,则有不同的规范协议,譬如:SVr4、4.3BSD、POSIX.1-2001等等。open函数向外界提供了:打开或创建一个文件或设备的功能。open函数

2014-01-08 22:26:55 1198

原创 如何找到系统所用的C runtime library

每个操作系统都需要一个C运行库(C runtime library),通常C运行库以动态链接库的形式存在,那如何知道这个库所在的文件目录呢?有个非常简单的方法:king@debian:/bin$ ldd bash linux-gate.so.1 => (0xb7755000) libtinfo.so.5 => /lib/i386-linux-gnu/libti

2014-01-04 14:59:23 753

原创 如何找出g++编译时的系统头文件的搜索路径

有时候,我们需要浏览系统头文件的内容从而知道该头文件里都有哪些函数以及类型,但如何找到这些系统头文件所在的文件目录呢?可以通过写一个简单的c++程序,来观察g++是怎么查找系统头文件的。譬如下面的一段程序:#include // This is a non-existant system headerint main ( int argc, char* argv[] ){

2014-01-04 14:06:28 2737

原创 为什么sizeof一个empty class的结果是1

#includeclass Empty{};int main( int argc, char* argv[] ){ std::cout << "sizeof(Empty) is " << sizeof(Empty) << std::endl; return 0;}上面的代码会出现在很多的笔试题纸上,那么它在标准输出上输出什么呢?在大多数的编译器上,输出的

2013-12-23 00:53:39 750

原创 JILK - (6) - 32-Bit and 16-Bit Address and Operand Sizes

In real-address mode, thedefault addressing and operand size is 16 bits. An address-size overridecan be used in real-address mode to enable 32-bit addressing. However, themaximum allowable 32-bit line

2013-08-03 15:47:28 916

原创 Thought Bubbles - Why do we need symbolic links?

In "The Linux Programming Interface: A Linux and UNIX Programming Handbook", Symbolic links is described as follow:"Like a normal link, a symbolic link provides an alternative name for a file. But w

2013-07-15 00:12:09 592

原创 Thought Bubbles - Stream

Stream is a metaphor in computer world, and it is also pervasive in our life. As for stream, I at first think of stream of water, which has two ends, one to flow in and one to flow out. Actually strea

2013-07-10 22:42:43 779

原创 Thought bubbles - Little End and Big End

Little end and big end are computer words, and actually they are called "Little end order" and "Big end order". What are they? How did they come into computer world?As we know, we store data in me

2013-07-09 23:59:36 677

原创 Concrete Mathematics - Recurrent Problems - Homework exercises - (8)

Chapter One: Recurrent ProblemsHomework exercises8. Solve the recurrenceQ(0) = a; Q(1) = b;Q(n) = ( 1+ Q(n-1))/Q(n-2), for n > 1.Assume that Q(n) != 0 for all n >=0.Actually, Q(0) = a,

2013-07-03 00:09:01 690

原创 Concrete Mathematics - Reccurent Problems - Warmups - (7)

Chapter One: Reccurrent ProblemsWarmup7. Let H(n) = J(n+1) - J(n). Equation (1.8) tells us that H(2n) = 2, and H(2n+1) = J(2n+2) - J(2n+1) = (2J(n+1)-1) - (2J(n)+1) = 2H(n) - 2, for all n >=1. The

2013-07-01 22:57:47 707

原创 Concrete Mathematics - Recurrent Problems - Warmups - (6)

Chapter One: Recurrent ProblemsWarmup6. Some of the regions defined by n lines in the plane are infinite, while others are bounded. What's the maximum possible number of bounded regions?Suppose

2013-06-30 22:47:36 748

原创 Concrete Mathematics - Recurrent Problems - Warmups - (5)

Chapter One: Recurrent ProblemsWarmups5. A "Venn diagram" with three overlapping circles is often used to illustrate the eight possible subsets associated with three given sets. Can the sixteen po

2013-06-30 00:09:44 1574

原创 Concrete Mathematics - Recurrent Problems - Warmups - (4)

Chapter One: Recurrent ProblemsWarmups4. Are there any starting and ending configurations of n disks on three pegs that are more than 2^n-1 moves apart, under Lucas's original rules?As we know,

2013-06-26 23:50:36 846 1

原创 Concrete Mathematics - Recurrent Problems - (3)

Chapter One: Recurrent ProblemsWarmups3. Show that, in the process of transferring a tower under the restrictions of the preceding exercise, we will actually encounter every properly stacked arran

2013-06-25 23:46:51 1080

原创 Concrete Mathematics - Recurrent Problems - (2)

Chapter One: Recurrent ProblemsWarmups2. Find the shortest sequence of moves that transfers a tower of n disks from the left peg A to the right peg B, if direct moves between A and B are disallowe

2013-06-25 21:29:33 763

原创 Concrete Mathematics - Recurrent Problems - (1)

Concrete Mathematics is book written by Donald E. Knuth. It is a nice book for programmers and computer science students. Actually I seldom read mathematic books, for it needs patience. But I really

2013-06-25 20:50:37 1051

原创 JILK - CPU - (5) - CPU管理的内存模型

CPU提供了一些相关的措施来管理物理内存,这些管理方式的存在旨要是:将程序里所出现的逻辑地址与计算机的物理内存地址解耦合。如果直接将应用程序里的逻辑地址与物理内存地址等同起来,那么就相当于两者紧密的耦合在一起了,硬件的发展和操作系统的演化都呼唤更具灵活的方式来决定如何将逻辑地址和物理地址进行映射。因此就需要CPU建立相应的内存管理机制,以便解耦程序的逻辑地址和物理地址。CPU的内存管理机制既能灵活

2013-06-08 23:46:26 1774

原创 JILK - CPU - (4) - CPU的执行环境

CPU为指令的执行提供了一个基本的环境,而一条普通指令得以执行所需的基本环境无非就是:内存+寄存器而已。CPU的基本执行环境:1)地址空间(Address space)。非64位模式下,可最大支持4GB的线性地址空间,和最多可达64GB的物理地址空间。64位模式下,可最大支持2^64B的线性地址空间,和最多可达2^40B的物理地址空间。2)基本的寄存器集合(Basic program

2013-06-04 23:44:39 1186

原创 JILK - CPU - (3) - CPU的操作模式

IA-32架构支持三种CPU操作模式(operating mode):实地址模式、保护模式和系统管理模式。到了Intel 64架构时,又增加了一种IA-32e模式,而IA-32e可分为两种子模式:兼容模式和64位模式。因此Intel CPU可处于五种操作模式下,而从一个汇编程序员的角度来看,不同的操作模式提供了不同的CPU处理环境和指令集。1)实地址模式(Real-address mode)。

2013-06-03 21:18:22 856

原创 Linux - Utility- make

最近在工作上慢慢熟悉Linux上的东西,包括用到的各种工具,其中就包括make。Linux上的应用软件普遍遵循的一个原则是:Do one thing and do it well。make就是其中的一个典范。make可用于管理多文件之间的依赖关系,以及根据这依赖关系来更新各个文件。譬如:make最初用于管理软件代码文件之间的编译依赖关系,在C++的开发情景下,.a的文件是.o文件的集合

2013-05-31 23:45:19 1192

原创 JILK - CPU - (3) - Intel 64 Architecture

Intel 64架构是IA-32架构的扩展。1)Intel 64将一个线性地址的位数扩展到了64bit,因此支持的线性地址空间(linear address space)为16EiB(1EiB=2^60Byte)。然而这只是线性地址空间的大小,而根据《Intel 64 and IA-32 Architectures Software Developers Manual Volumn 1》的2.

2013-05-26 11:11:44 571

原创 JILK - CPU - (2)

在CPU的层面,异常的含义是:“An exception is an event that typically occurs when an instruction causes an error”。有些异常能提供错误代号(error code),以提供关于异常的额外信息。Intel CPU的发展经历了下面的几个阶段:1. 16位的处理器(1978年)。16位的处理器是IA-32系列架构的

2013-05-25 11:05:50 9869

原创 Jump into Linux kernal - CPU - (1)

前一阵子,买了个日立的移动硬盘,然后下载了个VirtualBox和Debian-6.0.7,便想将VirtualBox安装在移动硬盘上,然后用VirtualBox跑Debian-6.0.7。但发现在安装的时候,还是在检测CD的那一步出了问题:报没有检测到。于是又下载了个Debian-7.0.0,一装就装上了。于是,便看起了《Linux内核源代码情景分析》。写得非常好的一本书,很适合像我

2013-05-14 23:55:44 563

原创 MAPI

半年来一直在做Outlook插件的工作。个人觉得做MS Office的插件是吃力不讨好,主要难点是:Office出现crash时,原因很难定位(如果做一个独立的应用程序还好说,插件是以单个dll的形式来与Office交互的,出现core dump时,即使生成个dump文件,也没法找出崩溃的源头。)。心想:如果MS Office是开源的,那就好办的多了。        除了插件crash的问题排

2013-02-18 21:58:25 998

原创 推荐《Version Control with Subversion》

《Version Control with Subversion》是一本subversion的手册,同时也是一本不错的入门书。        这本书的一个特点是免费、可在线下载、不断更新。书本身也是用subversion这个工具来维护着它的版本的,这确实很好:可允许多人编辑、各人提交,然后演变到下一版本。我看的版本是r4331的。        手册的原则是易懂。书中首先简单介绍subve

2013-02-16 23:55:35 719

原创 我学习的路线图

在学习上,我属于典型的深度优先的一类人。        首先从学习Linux系统说起。Linux系统最吸引我的无疑是它的内核源码,但在深入了解之前,至少要先装上系统来找找感觉吧,所以第一步先在电脑上真刀真枪地装个系统。一番Google后,Debian成为了我的选择。于是,老老实实地下载了Debian的安装手册。手头只有个装了xp的老笔记本,而且懒得去刻录张安装CD,就想能不能用U盘来引导进行安

2013-02-05 00:47:56 320

原创 How MIME comes into our lifes?

Excerpts from "Version Control with Subversion" bellow nicely describe why MIME comes into our life."Various programs on most modern operating systems make assumptions about the type and format

2013-01-28 23:56:38 641

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除