如何知道Linux内核当前支持哪些文件系统? 对于Linux操作系统,/proc/filesystems文件列出了当前内核支持的所有文件系统,如:king@debian:~$ cat /proc/filesystemsnodev sysfsnodev rootfsnodev bdevnodev procnodev cgroupnodev cpusetnodev tmpfsnodev devt
算法导论习题-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.
实地址模式(Real-address Mode)下,可以操控的资源有哪些(即其执行环境)? 实地址模式下的执行环境由以下几部分组成:可寻址的内存空间,范围[0, 1M]。因最初支持实地址模式的8086处理器只有20条地址线,所以其寻址范围最大只能去到2^20。用于各种用途的寄存器: 通用寄存器。这些寄存器负责临时存放运算结果,或临时存放运算需要的操作数,或临时存放操作数在内存中的地址,或辅助构筑栈(Stack)。它们是:AX, BX, CX, DX, SI, DI, BP, SP。
怎样才算Intel的32-bit 处理器呢? 可以对Intel推出的最后一款16-bit处理器286和Intel推出的第一款32-bit处理器386作一比较,来看出怎样才算32-bit处理器:寄存器的大小不同。286的寄存器大小是16位的;386的寄存器大小扩展到了32位。寄存器大小发生的变化表明386支持对更大范围的数据进行运算,所以数据线的大小也从16位扩大到32位,寄存器也需要相应的扩宽。可寻址内存空间的不同。286支持24条地址线,
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
从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模式
Linux下一些有用的Shell命令 1.如何判断一个ELF格式的可执行文件是32bit还是64bit的?答案:可用命令"readelf -h"。2.如何知道当前系统的Linux内核的版本?答案:可用命令“uname -a”。3.如何知道一个可执行程序的名称是否在PATH环境变量里?答案:可用命令“which”。
如何使用open系统调用 open函数是操作系统提供的API中的其中一个。操作系统向外围的应用程序暴露API的目的在于向外界提供其管理的各种功能;至于都应该暴露哪些功能以及各种功能的接口应当如何约定,则有不同的规范协议,譬如:SVr4、4.3BSD、POSIX.1-2001等等。open函数向外界提供了:打开或创建一个文件或设备的功能。open函数
如何找到系统所用的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
如何找出g++编译时的系统头文件的搜索路径 有时候,我们需要浏览系统头文件的内容从而知道该头文件里都有哪些函数以及类型,但如何找到这些系统头文件所在的文件目录呢?可以通过写一个简单的c++程序,来观察g++是怎么查找系统头文件的。譬如下面的一段程序:#include // This is a non-existant system headerint main ( int argc, char* argv[] ){
为什么sizeof一个empty class的结果是1 #includeclass Empty{};int main( int argc, char* argv[] ){ std::cout << "sizeof(Empty) is " << sizeof(Empty) << std::endl; return 0;}上面的代码会出现在很多的笔试题纸上,那么它在标准输出上输出什么呢?在大多数的编译器上,输出的
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
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
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
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
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,
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
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
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