Web Analytics

Begin 'setup.S'

It is time for ‘setup.S’ to show its power. The ‘setup.S’ is loaded by the bootloader and virtually it belongs to neither the ‘bootstrap’ routine nor the kernel program, although it is a portion of the kernel image. The source of the ‘setup.S’ is kinda ‘big’ and what it does can be summarized into one word: “the ‘setup.S’ is responsible to establish the environment for the execution of the kernel program”. ...

February 13, 2006 · 5 min · Tony Bai

Goto 'Bootstrap'

The term ‘Bootstrap’, which originally refers to a person who tries to stand up by pulling his own boots, refers to a subroutine used to establish the full routine(its own left part, i think) or another routine in computer science. Today modern computers act as a vital role in our daily life and many of you may wonder what happens to the computer when you have it powered on. The ‘Bootstrap’, which is also called ‘boot’ for short, is the first step to be done by the computer. The process of ‘Bootstrap’, which starts on when the computer is powered on and usu ends off when the kernel of the operating system begins to run, is just what we are gonna describe. ...

February 11, 2006 · 4 min · Tony Bai

Inside the 'i386'

The term ‘i386′ in the title does not refer to the real Intel 80386 processor but the representative of Intel 32-bit architecture(IA32). I prefer ‘i386′ rather than ‘IA32′ just like what the linux kernel does, since you can find ‘i386′ folder in $(linux-2.6.x_dir)/arch directory. This artical describes some basic knowledge of ‘i386′, which may be kinda useful to those guys who wanna do research on or develop operating system. ...

February 9, 2006 · 4 min · Tony Bai

Retired 'bootsect.S'

We know that the latest linux kernel version is 2.6.x, which is different from the ‘old kernels’ in booting. The ‘bootsect.S’, which used to make the kernel image in the floppy disk bootable in the early days, becomes useless in linux kernel 2.6.x today, although it is still a part of the kernel image. ...

February 8, 2006 · 3 min · Tony Bai

收到Ubuntu光盘

一个月以前在Ubuntu上订购了Ubuntu Linux 5.10发行版,今天终于拿到手了^_^。 在Linux发行版世界,大家最熟悉的几种发行版包括RedHat(或其开源版Fedora)、Debian、SuSE等,提到Ubuntu这个奇怪的名字大家都会感到陌生,在一个多月前我也不例外。Ubuntu是一个基于Debian的Linux操作系统发行版,它完全免费,这次我收到的Ubuntu光盘就是在其官方网站上免费订购的。一次偶然的机会在’Ubuntu中文论坛‘得知Linux世界还有Ubuntu这个发行版的存在,并且可以免费寄送光盘介质,当时的我非常希望手中能有张Linux正式发行版光盘,曾经考虑过Fedora,但是由于缺少刻录条件放弃了。Ubuntu恰好让我的愿望得到满足。当时还有一个担心就是Ubuntu不是主流发行版,是否影响自己在Linux上的体验呢?我Google了一下,发现自己大可不必为此担忧,Ubuntu在Linux社区中的口碑还是很好的,而且还获得了’Linux Journal‘杂志评选出的’2005最佳Linux发行版’奖。 ...

January 23, 2006 · 2 min · Tony Bai

用GDB调试多进程程序

有一段时间没有写技术方面的东西了^_^。众所周知,GDB是Unix/Linux下调试程序的龙头老大,GDB功能强大,我们在平时多使用其一些最基本的功能,而且一般调试的都是单进程的程序。最近一个项目中的问题让我接触如何使用GDB调试多进程程序,更确切的是说调试调用fork的多进程程序。 使用GDB最好的文档就是其名为’Debugging with GDB‘的参考手册。手册中有一小章节提到了如何调试多进程程序。一般情况下,如果被gdb调试的程序中调用fork派生出一个新的子进程,这时gdb调试的仍然还是父进程,其子进程的执行不被理会。如果之前你在子进程的执行routine上设置了断点,那么当子进程执行到那个断点时,子进程会因为收到一个SIGTRAP信号而自行终止,除非你在子进程中拦截了该信号。 ...

January 8, 2006 · 4 min · Tony Bai

Hacker Culture摘要

最近看了Eric S. Raymond的被称为开源文化圣典的’Cathedral and Bazaar’(大教堂与市集)以及他的另外一篇文章’How To Become A Hacker’,必须承认的是我不能够完全理解其中的内容,因为没有体验,或者说我还不够资格对Hacker Culture高谈阔论,所以这里仅作部分摘要,并说说自己第一时间的感受,望日后能温故知新。 ...

January 5, 2006 · 4 min · Tony Bai

在Linux上工作

在Linux上学习Linux内核我想应该是最好的方法了。Linux对我来说绝对是一个新鲜环境,搭建在Linux上的工作环境就是我的首要工作,这篇blog记录的就是我在Linux上的工作环境,也希望对大家有些借鉴意义。 我的Linux是在一个多月以前安装的[注1],安装的版本是Fedora Core 4。我使用的是本地磁盘映像安装,磁盘映像文件很大,总共4个,大约2.4G体积。安装过程倒是没有像网上很多人说得那样不顺利,包括修改、合并分区在内大约用了3个小时就看到Linux的桌面了。 ...

December 15, 2005 · 5 min · Tony Bai

APR源代码分析-线程同步篇

在线程同步方面,Posix标准定义了3种同步模型,分别为互斥量、条件变量和读写锁。APR也“浅”封装了这3种模型,只是在“读写锁”一块儿还没有全部完成。 线程同步的源代码的位置在$(APR_HOME)/locks目录下,本篇blog着重分析unix子目录下的thread_mutex.c、thread_rwlock.c和thread_cond.c文件的内容,其相应头文件为(APR_HOME)/include/apr_thread_mutex.h、apr_thread_rwlock.h和apr_thread_cond.h。 ...

December 11, 2005 · 5 min · Tony Bai

APR分析-线程篇

并行一直是程序设计领域的难点,而线程是并行的一种重要的手段,而且线程的一些特性也能在进程并行时发挥很好的作用(在“线程同步篇”中详细阐述)。 APR线程的源代码的位置在$(APR_HOME)/threadproc目录下,本篇blog着重分析unix子目录下的thread.c文件内容,其相应头文件为$(APR_HOME)/include/apr_threadproc.h。 ...

December 8, 2005 · 4 min · Tony Bai