2011年5月19日

摘要: head.s开始pg_dir.................org 0x1000pg0:.org 0x2000pg1:.org 0x3000pg2:.org 0x4000pg3:.org 0x5000后面是setup_paging代码setup_paging: movl $1024*5,%ecx /* 5 pages - pg_dir+4 page tables */ xorl %eax,%eax xorl %edi,%edi /* pg_dir is at 0x000 */ cld;rep;stosl movl $pg0+7,pg_dir /* set present bit/us... 阅读全文
posted @ 2011-05-19 22:25 yming0221 阅读(291) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<sys/types.h>#include<unistd.h>int main(){ pid_t pid,pid1; pid=fork(); pid1=fork(); sleep(1); if(pid>0) { if(pid1>0) printf("This is the parent process,my pid is %d/n",getpid()); else printf("This is the son2 process,my pid is %d,my fat 阅读全文
posted @ 2011-05-19 20:35 yming0221 阅读(1023) 评论(0) 推荐(0)
摘要: 这是简单的生产者消费者问题,只有一个缓冲区#include<stdio.h>#include<unistd.h>#include<sys/types.h>#include<linux/sem.h>struct sembuf buf;int Psem(int sem_id);int Vsem(int sem_id);int cache;int main(){ union semun arg; int mutexid; int full_sem; int empty_sem; mutexid=semget(IPC_PRIVATE,1,0666|IPC 阅读全文
posted @ 2011-05-19 20:29 yming0221 阅读(265) 评论(0) 推荐(0)
摘要: ubuntu10.10以后,启动方式改成了基于事件的启动方式,Upstart,代替以往的init.d/rcX.d的线性启动方式,采用事件的并行,并发执行,有助于加快启动速度。Upstart init daemon 是基于事件的,当系统中的什么情况发生变化时,它会运行某个特定的程序.这里被运行的程序多半是用来启动或终止服务的脚本.这个配置方式和systemv 在系统进入某个运行级别的时候运行init脚本的链接的概念实际上是非常类似的,只不过 upstart 更加灵活一些.Upstart 不仅能在运行级别改变的时候启动或终止服务,也能在接收到系统发生其他改变的信息的时候启动或终止服务.这些系统的改 阅读全文
posted @ 2011-05-19 14:53 yming0221 阅读(130) 评论(0) 推荐(0)

导航