推荐参考书籍:
============
《UNIX *** 作系统设计》
http://www.china-pub.com/computers/common/info.asp?id=34
*《UNIX环境高级编程》
http://www.china-pub.com/computers/common/info.asp?id=30
《 *** 作系统:设计与实现》(MINIX)
http://www.china-pub.com/computers/common/info.asp?id=2033
《IBM PC 汇编语言程序设计》
http://www.china-pub.com/computers/common/info.asp?id=7721
*《深入理解计算机系统》
http://www.china-pub.com/computers/common/info.asp?id=18133
《linux权威指南》
http://www.china-pub.com/computers/common/info.asp?id=1174
《linux Assembly Language Programming》
ftp://plinux.org/pub/linux/docs/ ... age_Programming.pdf
*《Intel 80386 Programmer';s Reference Manual》
ftp://plinux.org/pub/linux/docs/Intel_80386_Manual.pdf
*《The C Programming Language》
ftp://plinux.org/pub/linux/docs/The_C_programming_Language.rar
加星号“*”者为重点推荐读物!
============================================
如果有些忘了,就请先花哪怕一天时间将这些基础知识先浏览一遍,在看本书。
硬件方面可参考教科书。
Intel 32 mode 可见Intel 386 manual;
内核代码中用到的汇编程序(as86和AT&T语法)可参照以下一些文档。
-------------------------------------------------------------
MINIX 汇编手册: http://www.oldlinux.org/oldlinux/viewthread.php?tid=291
NASM 汇编手册: http://www.oldlinux.org/oldlinux/viewthread.php?tid=877
as86 在线手册: http://www.oldlinux.org/oldlinux/viewthread.php?tid=1895
ld86 在线手册:http://www.oldlinux.org/oldlinux/viewthread.php?tid=1428
/*****************************************/
/* 本站资源: */
/* http://oldlinux.org/Linux.old/ */
/*****************************************/
===============================================
如果你具有大学计算机本科或以上学历,那么你可以在适当复习以上知识后就能顺利看懂本书。
如果你是在读本科计算机系的学生,那么在学习过 *** 作系统课程或者正在学习时,只要复习一些有关Intel PC机组成原理,就应该很顺利地理解本书,并能很好地帮助你理解 *** 作系统的基本原理。
如果你是其它专业在读本科学生,那么你可以首先自学一些有关 *** 作系统的理论知识和计算机微机原理课程(如果没有学过的话),了解一些 *** 作系统的基本术语,再继续学习本书。
如果你是一个专科学生,那么你首先需要准备的知识与一个非计算机本科生所要做的一样。
如果你是一个中学毕业的学生,那么你可以先自学一些《计算机原理》、《微机原理》、《C语言》、《英语》等基本课程,然后再继续阅读本书。当然也可以把摊子铺开,同时阅读:)
注意: 无论你现在的学位或学历怎样,这都不是主要问题。关键在于努力和刻苦。而兴趣是学习的最好动力之一。即使你没有任何学位,只要识字能上网,那么你面前的道路还是宽广的。
“世上无难事,只要肯登攀”。
---------------------------------------------------------------------------------------------
源代码浏览工具介绍
http://www.oldlinux.org/oldlinux/viewthread.php?tid=1470
============================
在本机上阅读源代码,可以使用redhat 的snavigator或Source Dynamics的Source Insight软件。snavigator是免费的,source Insight可以去www.sourceInsight.com去下载。或者在此处下载:
http://oldlinux.org/download/tools/si350.rar (3.2MB)
http://oldlinux.org/download/tools/Release-SN51E-win32.zip (7.8MB)
http://oldlinux.org/download/tools/src2html/
Source Insight的使用方法可参见文章:
http://www-900.ibm.com/developer ... t/tip17/index.shtml
也可以使用本站网页上提供的再线交叉引用阅读程序:
http://oldlinux.org/lxr/http/source/
在阅读本书时,最好在计算机中安装这两个软件之一,边阅读书中注释边浏览代码。
------------------------------------------------------------------------------------------------
lxr设置方法介绍(1)
======================
How to make your own Cross Reference
By qhshang at 163.com
It is a long long time to gen xref for it,a not so long time to glimpse-index it.
If you are lucky enough to make lxr.conf done like it on this host in half an hour,do NOT drop me a mail:-)
----------------------------------------
Install lxr
Modify Makefile to customize the PERLBIN and INSTALLPREFIX,to indicate the perl program and where you install lxr.
then
$ make install
To generate your reference for files in Your_dir:
$ genxref Your_dir
while genxref is in lxr/bin
In my practice using genxref,locale should be set to C,en_US.utf-8 is not ok.
I don';t kNow why,because I don';t read the perl script throughly.
----------------------------------------
Install glimpse:
First make glimpse,then cp bin/{glimpse,glimpseindex} to /bin or /usr/bin
Generate index using glimpse:
$ glimpseindex -H . Your_dir
here -H means where to put the generated index files.
Test your index:
$ glimpse Your_string
----------------------------------------
Web server configuration
To make lxr vIEwable in web pages,add lines for xrefs in apache conf 文件:
<Directory /Your_path_to_lxr>
Options All
AllowOverrIDe All
order allow,deny
allow from all
</Directory>
To make sure perl script can be executed:
make a file .htaccess in your lxr perl script dir:
Options Indexes
<files ~ (search|source|IDent|diff|find)$>
SetHandler cgi-script
Options ExecCGI
</files>
NOTE: some saID only one line is OK:
SetHandler cgi-script
I don';t kNow if it works.
----------------------------------------
Make your files browsable from browsers:
First you should make sure the lxr dir can be accessed via web server.
then
$ chmod 755 xref fileIDx
$ chmod 755 .glimpse_*
$ chmod 755 Your_Dir_To_WWWROOT -R
$ chmod 755 Your_Dir_To_LXR -R
----------------------------------------
Configuration 文件: xrefs.conf
My file is only for example use.
Your can modify your conf file according to your own condition.
# define typed variable "v",read valueset from file.
variable: v,Version,[/Your_web_server_root/xrefs/src/versions],[/Your_web_server_root/xrefs/src/defversion]
# here variable v is for Version,read from file,and defversion is for
# default version,which will be shown to you by default.
# define typed variable "a". First value is default.
variable: a,Architecture,[/Your_web_server_root/xrefs/src/archs]
# and a is for Arch,the first one will be shown by default.
# define the base url for the LXR files.
baseurl: http://Your_web_server_root/xrefs/
# this url variable can be refered in template-head
# These are the templates for the HTML heading,directory Listing and
# footer,respectively.
HTMLhead: /Your_web_server_root/xrefs/template-head
HTMLtail: /Your_web_server_root/xrefs/template-tail
HTMLdir: /Your_web_server_root/xrefs/template-dir
# The source is here.
sourceroot: /Your_web_server_root/xrefs/src/linux-$v/linux
srcrootname: linux-$v
# because I have more then one linux kernel version,so I put them like the
# above for clear reference
# I make a linux subdir to hold the original kernel source here
# "#include <foo.h>" is mapped to this directory (in the LXR source
# tree)
incprefix: /usr/include
# I don';t kNow what is this mean,who can tell qhshang?
# The database files go here.
dbdir: /Your_web_server_root/xrefs/src/linux-$v
# here is where you put the fileIDx and xref file db.
# the location can be varIoUs according to your operation.
# Glimpse can be found here.
glimpsebin: /usr/local/bin/glimpse
# for freetext search
# The power of regexps. This is pretty linux-specific,but quite
# useful. Tinker with it and see what it does. (How';s that for
# documentation?)
map: /include/asm[^//]*/ /include/asm-$a/
map: /arch/[^//]+/ /arch/$a/
----------------------------------------
To provIDe the cross reference with Green-colored comments for C/C++,
there is a patch for lxr.(I am sorry that I forgot the url of this patch.)
It should be put to lxr/lib/LXR.
--- Common.pmWed Mar 7 15:34:24 2001
+++ Common.pmSat Jan 27 12:42:41 2001
@@ -18,8 +18,8 @@
@cterm = (';atom';,';////.';,';';,
- ';comment';,';//*';,';/*/';,';//';,"/n",
+ ';comment1';,
+ ';comment2';,
';string';,';"';,"';",
';include';,';#include';,"/n");
@@ -179,12 +179,17 @@
while (defined($frag)) {
&markspecials($frag);
- if ($btype eq ';comment';) {
-# Comment
+ if ($btype eq ';comment1';) {
+# C++-style comment ';//';
# Convert mail adresses to mailto:
&freetextmarkup($frag);
-$frag = "<b><i>$frag</i></b>";
-$frag =~ s#/n#</i></b>/n<b><i>#g;
+$frag = "<Font color=/"#00AA00/"><i>$frag";
+$frag =~ s#/n#</i></Font>/n#g;
+ } elsif ($btype eq ';comment2';) {
+# C-style comment ';/* ... */';
+&freetextmarkup($frag);
+$frag = "<Font color=/"#00AA00/"><i>$frag</i></Font>";
+$frag =~ s#/n#</i></Font>/n<Font color=/"/#00AA00/"><i>#g;
} elsif ($btype eq ';string';) {
# String
$frag = "<i>$frag</i>";
----------------------------------------
Some misc questions:
开始lxr作perl查询的时候出错,有时侯能工作,但是有警告:
/** Warning: Use of uninitialized value in subroutine entry at
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DB_file.pm line 259./
于是找到这个文件中的相应行,不知是错什么了:
DoTIE_($tIEHASH,@arg) ;
觉得是mod_perl问题。
下载一个mod_perl-1.99_10,照别人曾经写的作:
解压到/root:
$ perl Makefile.PL EVERYTHING=1 APACHE_SRC=../httpd.x.x.x /src
USE_APACI=1 PREP_httpD=1 DO_httpD=1
结果是:
[root@secteam mod_perl-1.99_10]# perl Makefile.PL EVERYTHING=1
APACHE_SRC=../httpd-2.0.47/ USE_APACI=1 PREP_httpD=1 DO_httpD=1
Reading Makefile.PL args from @ARGV
!!! Unable to determine server version,aborting.
!!! Please specify MP_APXS or MP_AP_PREFIX.
不行,我猜测是版本不同导致的问题
于是按照mod_perl 的INSTALL 文件作:
% perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
make没有问题,make test 有很多错:
/usr/bin/perl -Iblib/arch -Iblib/lib /
t/TEST -clean
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -clean
APACHE_USER= APACHE_GROUP= APACHE_PORT= APACHE= APXS= /
/usr/bin/perl -Iblib/arch -Iblib/lib /
t/TEST -verbose=0
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -verbose=0
*** root mode: changing the files ownership to ';nobody'; (99:99)
*** sudo -u ';#99'; /usr/bin/perl -e ';print -r "/root/mod_perl-1.99_10/t"
&& -w _ && -x _ ? "OK" : "NOK"';
*** result: NOK
!!! You are running the test suite under user ';root';.
Apache cannot spawn child processes as ';root';,therefore
we attempt to run the test suite with user ';nobody'; (99:99).
The problem is that the path:
/root/mod_perl-1.99_10/t
must be ';rwx'; by user ';nobody';,so Apache can read and write under that
path.
There several ways to resolve this issue. For example move
';/root/mod_perl-1.99_10/t'; to ';/tmp/'; and repeat the ';make test'; phase.
You can test whether the location is good by running the following test:
% sudo -u ';#99'; /usr/bin/perl -e ';print -r "/root/mod_perl-1.99_10/t" &&
-w _ && -x _ ? "OK" : "NOK"';
make: *** [run_tests] Error 29
原来是解tar gz包到root路径的原因,先不理会,make install也可以安装,重启
apache,
查询警告依旧。
于是重新解到tmp下,
% perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
% make && make test
还是同样的错,
突然看到错误中还有: /root/mod_perl-1.99_10/t,可是我已经解到/tmp下作的
呀,很不解,(:-)没有深究)
只有删掉/root下的,重新解到/tmp,
make test的时候巨多的OK。。。
然后就一路顺风成功install。
于是启动apache:
[root@secteam apache2]# ./bin/apachectl start
Syntax error on line 235 of /usr/local/apache2/conf/httpd.conf:
InvalID command ';AddModule';,perhaps mis-spelled or defined by a module
not included in the server configuration
现在注释掉下面的
[root@secteam apache2]# vi /usr/local/apache2/conf/httpd.conf
#AddModule mod_perl.c
启动
[root@secteam apache2]# ./bin/apachectl start
[Thu Oct 09 10:00:34 2003] [error] Can';t locate Apache.pm in @INC (@INC
contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .
/usr/local/apache2/ /usr/local/apache2/lib/perl) at (eval 1) line 3.
[Thu Oct 09 10:00:34 2003] [error] Can';t load Perl module Apache for
server 192.9.200.102:80,exiting...
奇怪,怎么没有Apache.pm呢,locate Apache.pm出来好几个,
因为不知道哪里修改@INC,所以我找到一个Apache.pm拷贝到@INC中的一个位置。
启动[root@secteam apache2]# ./bin/apachectl start,可以,但是查询的时候
警告仍然如初
这样认为是pm问题,需要perl5.8.1,于是make,make install
启动apachectl,发现libperl.so找不到,连vim都不能用了:
vim: error while loading shared librarIEs: libperl.so: cannot open
shared object 文件: No such file or directory
于是从别的地方找了一个拷贝到/usr/lib,可以了。
然后去掉perl5.8.0的内容,这次启动apache,发现又有很多pm找不到,
觉的是mod_perl的配置决定了perl相关程序的位置。
于是重新把mod_perl make,make install,
此时执行lxr发现错误:
The server encountered an internal error or misconfiguration and was
unable to complete your request.
分析了一下,觉的是perl的路径问题,修改lxr的以下文件的perl路径:
diff,find,IDent,search,source,
OK(或者把perl链接到/usr/bin因为大多perl脚本都是)
这样lxr的标识符索引也没有警告了,但是freetext搜索还不可以,
认为是glimpse的问题。(freetext有glimpse支持)
然后把glimpse的属性搞定,freetext搜索就好了
现在默认是linux-2.5.72-lsm1/
其他问题
apachectl的问题:
我是ssh到server上的,执行
/usr/local/apache2/bin/apachectl restart
每次都使得我的ssh链接关闭,不得其解,
到server本机终端执行
/usr/local/apache2/bin/apachectl restart
每次都退出一层shell,奇怪。(没有仔细读apachectl script)
只好到apache 所在路径下执行。
各位可否给点指点? 而且apachectl不给出成功与否,
[root@secteam apache2]# ./bin/apachectl stop
httpd (pID 20453?) not running
------------------------------------------------------------------------------------------------
Lxr设置方法介绍(2)
==========================
0. 假设你把lxr安装在你的web主目录中(也即,例如,http://oldlinux.org/lxr/),那么:
1. web目录下建立文件“.htaccess”,其内容如下:
-----------------开始(不包括本行)
# Web Access script permission
<files ~ (search|IDent|diff|find|source|IDent1)$>
SetHandler cgi-script
</files>
------------------结束
2. 编辑配置文件: lxr/http/lxr.conf 例如oldlinux.org的配置文件内容为:
--------------------开始
# Configuration file.
# define typed variable "v",版本,[/var/www/oldlinux.org/lxr/source/versions],[/var/www/oldlinux.org/lxr/source/defversion]
# define typed variable "a". First value is default.
variable: a,体系结构,(i386)
# define the base url for the LXR files.
baseurl: http://oldlinux.org/lxr/http/# These are the templates for the HTML heading,directory Listing and# footer,respectively.HTMLhead: /var/www/oldlinux.org/lxr/http/template-headHTMLtail: /var/www/oldlinux.org/lxr/http/template-tailHTMLdir: /var/www/oldlinux.org/lxr/http/template-dir# The source is here.sourceroot: /var/www/oldlinux.org/lxr/source/$v/linux/srcrootname: linux# "#include <foo.h>" is mapped to this directory (in the LXR source# tree)incprefix: /include# The database files go here.dbdir: /var/www/oldlinux.org/lxr/source/$v# Glimpse can be found here.glimpsebin: /usr/local/bin/glimpse# The power of regexps. This is pretty linux-specific,but quite# useful. Tinker with it and see what it does. (How';s that for# documentation?)map: /include/asm[^//]*/ /include/asm-$a/map: /arch/[^//]+/ /arch/$a/----------------------------结束。3. 建立源文件内容。对每一个想要浏览的内核版本,按以下步骤进行(若要使用第5,6选项步骤,你要首先安装glimpse软件):# Source install procedures1. mkdir a subdirectory with the code version number;2. chdir into the subdirectory;3. tar -zxvf the compressed soucecode(this will generate a ';linux'; subdir);4. /var/www/HTML/lxr/bin/genxref linux5. [ Optional ] glimpseindex -H . linux6. [ Optional ] chmod 644 .glim*7. Edit the ';versions'; file to contain this new code version number;8. done!Example: To Install the linux kernel code version 2.1.33:The compressed code packet is : linux-2.1.33.tar.gz----------------------------------------------------------1. mkdir /var/www/HTML/lxr/source/2.1.332. chdir /var/www/HTML/lxr/source/2.1.333. tar -zxvf linux-2.1.33.tar.gz4. /var/www/HTML/lxr/bin/genxref linux5. [ Optional ] glimpseindex -H . linux6. [ Optional ] chmod 644 .glim*7. Insert the line ';2.1.33'; into the ';versions'; file.8. Done! =======================================================================
以上是内存溢出为你收集整理的好书推荐全部内容,希望文章能够帮你解决好书推荐所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)