摘要: 原文链接:http://vbird.dic.ksu.edu.tw/linux_basic/0510osloader_1.php;由于鸟哥的语言稍显啰嗦,在此稍微做些删改~~^_^,同时对台湾的用语按大陆的习惯进行了修改启动流程一览启动是很严肃的一件事,让我们就来了解一下整个启动的过程吧!不过,由于启动的过程中,那个启动加载程序 (Boot Loader) 使用的软件可能不一样,例如目前各大 Linux distributions 的主流为 grub,但早期 Linux 默认是使用 LILO ,台湾地区则很多朋友喜欢使用spfdisk。 但无论如何,我们总是得要了解整个 boot loader 阅读全文
posted @ 2012-10-23 20:40 beanmoon 阅读(1017) 评论(0) 推荐(0) 编辑
摘要: 来源:http://baike.baidu.com/view/2367608.htm vmlinuz是可引导的、压缩的内核。“vm”代表 “Virtual Memory”。Linux 支持虚拟内存,不像老的操作系统比如DOS有640KB内存的限制。Linux能够使用硬盘空间作为虚拟内存,因此得名“vm”。vmlinuz是可执行的Linux内核,它位于/boot/vmlinuz,它一般是一个软链接。 vmlinuz的建立有两种方式。 一是编译内核时通过“make zImage”创建,然后通过: “cp /usr/src/linux-2.4/arch/i386/linux/boot/z... 阅读全文
posted @ 2012-10-23 17:28 beanmoon 阅读(1741) 评论(0) 推荐(0) 编辑
摘要: 文章出处:http://www.chinaz.com/server/2009/0807/85796.shtml今天一个很偶然的机会看到了linux中的find命令,然后我在网上搜索了一下这方面的内容,为了方便大家学习参考,我就总结一下,一上午的劳动成果,呵呵!首先是find的语法:find [起始目录] 寻找条件 操作还有种表述方式:find PATH OPTION [-exec COMMAND { } \;]因为find命令会根据我们给的option,也就是寻找条件从我们给出的目录开始对其中文件及其下子目录中的文件进行递归搜索,所以我觉的这个地方说是“起始目录”是非常好的。该命令中的寻找条件 阅读全文
posted @ 2012-10-23 17:20 beanmoon 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 从毕业到现在,在从事软件行业三年的时间里,经历了很多,也成长了很多,从一个笨笨嗑嗑的毕业生到现在能独立工作完成任务的程序员,这个过程并非是一帆风顺的,好多次都是到了逆境的尽头一转弯又重见新的希望,我相信哪个行业都是这样,人都是需要不断磨炼的才能成长起来的,而最能磨炼人时候的就是身处逆境的时候。 这几年的时间,因为各种原因,我换过三家公司,而这三家公司都是不同性质的公司,第一家国企,第二家民企,现在这家外企,暂且不说三年换三家公司这个企业忠诚度问题,这里面有公司的原因也有自己的考虑,频繁跳槽并不是好事,对于一个刚入行的程序员来说这确实能在一定程度上打开眼界,我个人认为,刚工作的几年中是进步最.. 阅读全文
posted @ 2012-10-23 17:09 beanmoon 阅读(576) 评论(0) 推荐(0) 编辑
摘要: cpio命令利用cpio 可将文件或目录从文件库获取出来或将散列文件拷贝到文件库。cpio 的指令格式:cpio –i[bcdmrtuv] [patterns]cpio –o [abcv]cpio –p [adlmuv][directory]cpio有三种操作模式: 在copy-out模式中,cpio把文件复制到归档包中。它从标准输入获得文件名列表(一行一个),把归档包写到标准输出。生成文件名列表的典型方法是使用find命令;你可能要在find后面用上-depth选项,减少因为进入没有访问权限的目录而引起的麻烦。 在copy-in模式中,cpio从归档包里读取文件,或者列出归档包里的内容。.. 阅读全文
posted @ 2012-10-23 15:25 beanmoon 阅读(836) 评论(0) 推荐(0) 编辑
摘要: BufferingThe goal of the buffering provided by the standard I/O library is to use the minimum number ofreadandwritecalls. (RecallFigure 3.5, where we showed the amount of CPU time required to perform I/O using various buffer sizes.) Also, it tries to do its buffering automatically for each I/O strea 阅读全文
posted @ 2012-10-23 15:23 beanmoon 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 5.8. Standard I/O EfficiencyUsing the functions from the previous section, we can get an idea of the efficiency of the standard I/O system. The program inFigure 5.4is like the one inFigure 3.4: it simply copies standard input to standard output, usinggetcandputc. These two routines can be implemente 阅读全文
posted @ 2012-10-23 15:23 beanmoon 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 1.出处fflush是libc.a中提供的方法,fsync是系统提供的系统调用。2.原形fflush接受一个参数FILE *.fflush(FILE *);fsync接受的时一个Int型的文件描述符。fsync(int fd);3.功能fflush:是把C库中的缓冲调用write函数写到磁盘[其实是写到内核的缓冲区]。fsync:是把内核缓冲刷到磁盘上。c库缓冲-----fflush---------〉内核缓冲--------fsync-----〉磁盘另外关于内核缓冲,标准库缓冲和用户空间缓冲的说法见APUE 5.14:One inefficiency inherent in the stan 阅读全文
posted @ 2012-10-23 15:22 beanmoon 阅读(705) 评论(0) 推荐(0) 编辑
摘要: When a C program is executed by the kernelby one of theexecfunctions, which we describe inSection 8.10.a special start-up routine is called before themainfunction is called. The executable program file specifies this routine as the starting address for the program; this is set up by the link editor 阅读全文
posted @ 2012-10-23 15:21 beanmoon 阅读(192) 评论(0) 推荐(0) 编辑
摘要: There are eight ways for a process to terminate. Normal termination occurs in five ways:Return frommainCallingexitCalling_exitor_ExitReturn of the last thread from its start routine (Section 11.5)Callingpthread_exit(Section 11.5) from the last threadAbnormal termination occurs in three ways:Callinga 阅读全文
posted @ 2012-10-23 15:20 beanmoon 阅读(348) 评论(0) 推荐(0) 编辑
摘要: ISO C specifies three functions for memory allocation:malloc, which allocates a specified number of bytes of memory. The initial value of the memory is indeterminate.calloc, which allocates space for a specified number of objects of a specified size. The space is initialized to all 0 bits.realloc, w 阅读全文
posted @ 2012-10-23 15:19 beanmoon 阅读(278) 评论(0) 推荐(0) 编辑
摘要: Historically, a C program has been composed of the following pieces:Text segment, the machine instructions that the CPU executes. Usually, the text segment is sharable so that only a single copy needs to be in memory for frequently executed programs, such as text editors, the C compiler, the shells, 阅读全文
posted @ 2012-10-23 15:19 beanmoon 阅读(245) 评论(0) 推荐(0) 编辑
摘要: volatile 影响编译器编译的结果,指出,volatile 变量是随时可能发生变化的,与volatile变量有关的运算,不要进行编译优化,以免出错。例如:volatile int i=10;int j = i;...int k = i;volatile 告诉编译器i是随时可能发生变化的,每次使用它的时候必须从i的地址中读取,因而编译器生成的可执行码会重新从i的地址读取数据放在k中。而优化做法是,由于编译器发现两次从i读数据的代码之间的代码没有对i进行过操作,它会自动把上次读的数据放在k中。而不是重新从i里面读。这样以来,如果i是一个寄存器变量或者表示一个端口数据就容易出错,所以说volat 阅读全文
posted @ 2012-10-23 15:18 beanmoon 阅读(207) 评论(0) 推荐(0) 编辑
摘要: register修饰符暗示编译程序相应的变量将被频繁地使用,如果可能的话,应将其保存在CPU的寄存器中,以加快其存储速度。例如下面的内存块拷贝代码, #ifdef NOSTRUCTASSIGN memcpy(d, s, l) {register char *d; register char *s; register int i; while (i--) *d++ = *s++; } #endif 但是使用register修饰符有几点限制。 首先,register变量必须是能被CPU所接受的类型。这通常意味着register变量必须是一个单个的值,并且长度应该小于或... 阅读全文
posted @ 2012-10-23 15:17 beanmoon 阅读(395) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示