2009年2月28日星期六

我读Linux0.01

这是我过去写的,而且我还写了很多,以后将会把其他的发表!
今天,再次看Linux 0.0.1内核分析与操作系统设计——创造你自己的操作系统
感觉很不错的一本书,但是就是里面很多是在windows下完成的,但是我想那样也不会影响我对Linux的喜爱和坚持使用Linux而学习它,主要是学习她里面的思想。
把操作系统的原理学习清楚,把自己的想法添加进去,学习就要学会她!
她 主要写了关于GUN/Linux的历史,还有Bochs这个工具,当然你也可以学到GUN的很多的工具,如:GCC,MAKE,GDB,等!操作系统的设 计基础;Linux0.0.1内核简介;操作系统的引导;存储管理分析;进程管理和调度;磁盘文件系统;shell编程技术和实例;系统调用和C语言库的 实现;Linux网络实现分析。
一定要好好的学习!我相信我自己!

Linux0.0.1支持的硬件平台:
Intel 386以上CPU VGA/EGA显示器 标准IDE接口硬盘 支持芬兰键盘布局
如果希望修改为其他键盘布局,可以对kernel/keyboard.s文件进行修改。

Linux 充分地发挥了Intel80386芯片的功能。系统中的函数调用不使用消息传送机制而是直接函数调用;多线程的文件系统(虽然实现比较复杂但是性能更 好);精简的任务切换;中断是不隐藏的(中断处理的代码主要是汇编代码,设备驱动程序主要是中断例程,可参见kernel/hd.c);核心处理、文件系 统、存储管理没有严格地分离。
原则是:运行得更快
核心设计特点:所有的任务只有一个数据结构。在Linux 0.0.1的实现中,任务信息存放在不同的地方;既支持分页机制也支持分段机制的一个非常简单的存储管理机制;在Linux 0.0.1中的mm目录中memory.c和page.s

在Linux0.0.1 中,存储管理(memory management)是最简单的模块之一。在存储管理的模块中包含了一些函数的入口,这些函数是在kernel模块中实现的。系统的其他部分对存储管理 机制是透明的。一种避免多线程竞争资源的方法是一个进程运行时将所需要的资源全部获得,但是这样系统的资源利用效率较低,也可能带来一些不必要的等待。为 了提高文件系统的性能,Linux实现文件系统的访问时不锁定任何的数据结构(除非实际的读或者写物理设备)采用双检查分配(fs/buffer.c和 fs/inode.c都进行资源分配检查)来避免任何时候可能出现的条件竞争。一个进程陷入核心态时是不会被核心切换的。所有的核心功能,文件系统,存储 管理操作都是原子性的(atomic)。
硬件依赖性代码大多定义在文件"include/linux/config.h"中。
Linux0.0.1的核心源文件分布在几个子目录中,总共包含5900行左右的ANSI C源代码、2500行左右的C头文件代码和约1450行左右的Intel 80386汇编语言代码。
--------------------------------------------------------------------------------
boot 核心引导代码(kernel bootstrap code)
fs 文件系统(file system)
include 头文件(header files)
init Init进程,Linux系统中执行的第一个进程(init procss-the first process exec _uted by a UNIX system)
kernel 系统调用(system calls)
lib 库代码(library code)
mm 内存管理(memory management)
tools 内核引导文件的制作工具(program that splices three images together into a kernel image that can be booted from PC BIOS starup)

太极拳

有好东西就和大家分享! 啊哈!!!

关于太极拳,我这个寒假每天早上都和老头们学太极拳,可是我们学的太极拳和平时咱们见到的是不太一样的。几乎是没有固定的招式,但是它里面的每一招都蕴含了太极拳的精髓,而且是很实用的那种,是强身健体的那种而且有很多是可以防卫等等!感觉很不错!用我舍友的话说是挺神奇的!
我现在每天晚上也在“玩” 这个,你也许会看到我,每天晚上的十点左右在操场上,“发疯”的那个人便是我了,想相互切磋的,想学的,我很欢迎,一起练习吧!现在感觉那个真的很好“玩”
我就把一些心得和大家分享吧!
防守,攻打,拳种。打不过的时候记得要躲开才是,利用别人的缺点打击他,要灵活,要快,要准,打手要三个部位,(肘,肩,腕)。变化,来源于平时的练习,基本功一定要扎实。学任何东西也是一样的,没有扎实的基本功是很难成就一番事业的。
一动全身动,起与脚,动于腰,发于手。
放松,一定要学会放松,以静制动,内力(爆发力),使得自己的思维发散。
学习学无形有时会胜于有形的,没有固定招数,但是理念是很关键的,每一种学习,最重要的是学习他的华和他的理念,他的思维方式。
干一件事情就要把他干好,这才是很重要的。
中国文化博大精深是世界公认的,而不是所谓的现代科学所能解释清的,希望大家好好感悟!
禪密心咒
啊 鲁 披 折 那 抡

阿 嘛 昵 叭 弥 吽
下面的是我的一个师傅让我抄的,当然网上可以搜索到很多的相关的知识!

太极拳论 王宗岳
太极者,无极而生,阴阳之母也。动之则分,静之则合。无过不及,随曲就>伸 。人刚我柔谓之走,我顺人背谓之粘。动急则急应,动缓则缓随。虽变化万端, 而理>为一贯。由招熟而渐悟懂劲,由懂劲而阶及神明。然非用力日久,不能豁 然贯通焉。虚灵顶劲,气沉丹田。不偏不倚,忽隐忽现。左重则左虚,右重则 右杳。仰之则弥高,府之则弥深,进之则愈长,退之则愈促。一羽不能加,蝇 虫不能落,人不知我,我独知人。英雄所向无敌,盖皆由此而及也。斯技旁门 甚多,虽势有区别,概不外,壮欺弱,慢让快耳。有力打无力,手慢让手快, 是皆先天自然之能,非关学力而有为也。察四两拨千斤之句,显非力胜;观耄 耋御众之形,快何能为。立如秤准,活如车轮,偏沉则随,双重则滞。每见数 年纯功,不能运化者,率皆自为人制,双重之病未悟而。欲避此病,须知阴阳; 粘>即是走,走即是粘,阳不离阴,阴不离阳;阴阳相济,方为懂劲。懂劲后, 愈练愈精,默识揣摩,渐至从心所欲。本是舍己从人,多误舍近求远。所谓差 之毫厘,谬之千里。学者
不可不详辨焉。是为论。

十三势歌
清乾隆年间山右王宗岳

一名长拳,一名十三势。长拳者,如长江大海,滔滔不绝也。十三势者,掤、 捋、挤、按、采、挒、肘、靠。进、退、顾、盼、定也。掤、捋、挤、按、即 坎、离 震、兑,四正方也。采、挒、肘、靠,即乾、坤、良、巽,四斜角也。 此八卦也。进步、退步 左顾、右盼、中定,即金、木、水、火、土也。此五 行也。合而言之,曰十三势。

十三总势莫轻视。命意源头在腰际。
变转虚实须留意。气遍身躯不少滞。
静中触动动犹静。因敌变化示神奇。
势势存心揆用意。得来不觉费功夫。
刻刻留意在腰间。腹内松静气腾然。
尾闾中正神贯顶。满身轻利顶头悬。
仔细留心向推求。屈伸开合听自由。
入门引路须口授。功夫无息法自修。
若言体用何为准。意气君来骨肉臣。
想推用意终何在。益寿延年不老春。
歌兮歌兮百四十。字字真切意无遗。

太极拳总论 陈鑫
纯阴无阳是软手,纯阳无阴是硬手。
一阴九阳根头棍,二阴八阳是散手,
三阴七阳犹觉硬,四阴六阳显好手,
惟有五阴并五阳,阴阳无偏称妙手。
妙手一看一太极,空空迎化归乌有。

身法八要

身 法八要相传为武派太极拳创始人武禹襄所建立,即含胸、拔背、裹裆、护肫、提顶、>吊裆、松肩、沉肘,后人又在这八条基础上加入腾挪、闪战。武禹襄之 甥李经纶亦从其修>习太极拳,李将舅舅所传编成一首七言歌诀,同样名为《身法八要》,云:提顶吊裆心中>悬,松肩沈肘气丹田;裹裆护肫须下 势,含胸拔背落自然。

2008年12月22日星期一

内存管理实验源代码

我的内存管理实验的源代码
[gaowei@localhost memory]$ ls
display_menu.c main.c Makefile2 memory.h
上面是代码的目录
编译后的目录如下:
[gaowei@localhost memory]$ ls
display_menu.c display_menu.o main.o Makefile2 memory memory.h
再详细看看我的代码
头文件在memory.h中!
#include <stdio.h>
#include <stdlib.h>/*会引起警告:隐式声明与内建函数 “malloc” "exit“ 不兼容*/
#include <unistd.h>
/*memory.c:331: 警告:隐式声明与内建函数 ‘_exit’ 不兼容*/
#define PROCESS_NAME_LEN 32 /*进程名称的最大长度*/
#define MIN_SLICE 10 /*最小碎片的大小*/
#define DEFAULT_MEM_SIZE 1024 /*默认内存的大小*/
#define DEFAULT_MEM_START 0 /*默认内存的起始位置*/
/* 内存分配算法 */
#define MA_FF 1
#define MA_BF 2
#define MA_WF 3
在看看我的Makefile的文件:
memory: main.o display_menu.o
gcc -o memory main.o display_menu.o
main.o: main.c memory.h
gcc -c main.c
display_memu.o: display_memu.c memory.h
gcc -c display_memu.c
在看看我的菜单的文件,现在由于要考试了,时间紧张,所以只是完成了老师规定的内容,我想用把他做成图形界面的,用#include <curses.h>这个头文件,如果你没有可以下载,是终端界面设计的
所以我的菜单文件是
#include "memory.h"

int display_menu(void){
printf("\n");
printf("1 - Set memory size (default=%d)\n", DEFAULT_MEM_SIZE);
printf("2 - Select memory allocation algorithm\n");
printf("3 - New process \n");
printf("4 - Terminate a process \n");
printf("5 - Display memory usage \n");
printf("0 - Exit\n");

}
我的主函数的代码是
#include "memory.h"

extern void display_menu();

struct allocated_block *find_process(int pid);

/*描述每一个空闲块的数据结构*/
struct free_block_type{
int size;
int start_addr;
struct free_block_type *next;
};

/*指向内存中空闲块链表的首指针*/
struct free_block_type *free_block;

/*每个进程分配到的内存块的描述*/
struct allocated_block{
int pid;
int size;
int start_addr;
char process_name[PROCESS_NAME_LEN];
struct allocated_block *next;
};

/*进程分配内存块链表的首指针*/
struct allocated_block *allocated_block_head = NULL;

int mem_size=DEFAULT_MEM_SIZE; /*内存大小*/
int ma_algorithm = MA_FF; /*当前分配算法*/
static int pid = 0; /*初始pid*/
int flag = 0;/* 设置内存大小标志*/

/*初始化空闲块,默认为一块,可以指定大小及起始地址*/
struct free_block_type* init_free_block(int mem_size){
struct free_block_type *fb;
fb=(struct free_block_type *)malloc(sizeof(struct free_block_type));
if(fb==NULL){
printf("No mem\n");
return NULL;
}
fb->size = mem_size;
fb->start_addr = DEFAULT_MEM_START;
fb->next = NULL;
return fb;
}

/*设置内存的大小*/
set_mem_size() {
int size;
if(flag!=0){ /*防止重复设置*/
printf("Cannot set memory size again\n");
return 0;
}
printf("Total memory size =");
scanf("%d", &size);
if(size>0) {
mem_size = size;
free_block->size = mem_size;
}
flag=1;
return 1;
}

/* 设置当前的分配算法 */
set_algorithm(){
int algorithm;
printf("\t1 - First Fit\n");
printf("\t2 - Best Fit \n");
printf("\t3 - Worst Fit \n");
scanf("%d", &algorithm);
if(algorithm>=1 && algorithm <=3)
ma_algorithm=algorithm; /*按指定算法重新排列空闲区链表*/
rearrange(ma_algorithm); }

/*按指定的算法整理内存空闲块链表*/
rearrange(int algorithm){
switch(algorithm){
case MA_FF: rearrange_FF(); break;
case MA_BF: rearrange_BF(); break;
case MA_WF: rearrange_WF(); break;
}
}

void swap(int *p1,int *p2) {
int temp; temp=*p1; *p1=*p2; *p2=temp;
}

/*按FF算法重新整理内存空闲块链表*/
rearrange_FF(){
struct free_block_type *tmp, *work;
printf("Rearrange free blocks for FF \n");
tmp = free_block; while(tmp!=NULL) {
work = tmp->next;
while(work!=NULL){
if( work->start_addr <>start_addr) { /*地址递增*/
swap(&work->start_addr, &tmp->start_addr);
swap(&work->size, &tmp->size);
}
work=work->next;
}
tmp=tmp->next;
}
}


/*按BF算法重新整理内存空闲块链表*/
rearrange_BF(){
struct free_block_type *tmp, *work;
printf("Rearrange free blocks for BF \n");
tmp = free_block;
while(tmp->next!=NULL) {
work = tmp->next;
while(work!=NULL) {
if(work->size > tmp->size) { /*大小递减*/
swap(&work->start_addr,&tmp->start_addr);
swap(&work->size,&tmp->size);
}
work = work->next;
}
tmp = tmp->next;
}
return 0;
}

/*按WF算法重新整理内存空闲块链表*/
rearrange_WF(){
struct free_block_type *tmp, *work;
printf("Rearrange free blocks for WF \n");
tmp = free_block;
while(tmp->next!=NULL) {
work = tmp->next;
while(work!=NULL) {
if(work->size <>size) { /*大小递增*/
swap(&work->start_addr,&tmp->start_addr);
swap(&work->size,&tmp->size);
}
work = work->next;
}
tmp = tmp->next;
}
return 0;
}

/*创建新的进程,主要是获取内存的申请数量*/
int new_process(void) {
struct allocated_block *ab;
int size;
int ret;
ab = (struct allocated_block *)malloc(sizeof(struct allocated_block));
if(!ab) exit(-5);
ab->next = NULL;
pid++;
sprintf(ab->process_name, "PROCESS-%02d", pid);
ab->pid = pid;

printf("Memory for %s:", ab->process_name);
scanf("%d", &size);
if(size>0) ab->size = size;
ret = allocate_mem(ab); /* 从空闲区分配内存,ret==1表示分配ok*/
/*如果此时allocated_block_head尚未赋值,则赋值*/
if((ret==1) &&(allocated_block_head == NULL)){
allocated_block_head=ab;
return 1;
}
/*分配成功,将该已分配块的描述插入已分配链表*/
else if (ret==1) {
ab->next=allocated_block_head;
allocated_block_head=ab;
return 2;
}
else if(ret==-1){ /*分配不成功*/
printf("Allocation fail\n");
free(ab);
return -1;
}
return 3;
}

/*分配内存模块*/
int allocate_mem(struct allocated_block *ab) {
struct free_block_type *fbt, *pre;
int request_size = ab->size;
fbt = pre = free_block;
printf("%d", fbt->start_addr);
while(fbt!=NULL) {
if(fbt->size>=request_size){/*分配后空闲空间足够大,则分割*/
if((fbt->size-request_size)>MIN_SLICE) {
ab->size = request_size;
ab->start_addr = fbt->start_addr;
fbt->size -= request_size;
fbt->start_addr += request_size;
}
else {/*分割后空闲区成为小碎片,一起分配*/
ab->size = fbt->size;
ab->start_addr = fbt->start_addr;
if (fbt == free_block)
free_block = fbt->next;
else {
pre->next = fbt->next;
free(fbt);
}
}
return 1;
}
pre = fbt;
fbt = fbt->next;
}
return 0;
}

/*删除进程,归还分配的存储空间,并删除描述该进程内存分配的节点*/
kill_process(void){
struct allocated_block *ab;
int pid;
printf("Kill Process, pid=");
scanf("%d", &pid);
ab=find_process(pid);
if(ab!=NULL){
free_mem(ab); /*释放ab所表示的分配区*/
dispose(ab); /*释放ab数据结构节点*/
}
}

/*struct free_block_type* find_process(int pid) */
struct allocated_block *find_process(int pid)
{
struct allocated_block *ab=allocated_block_head;
while(ab!=NULL) {
if(pid != ab->pid) {
ab=ab->next;
}
else return ab;
}
}


/*将ab所表示的已分配区归还,并进行可能的合并*/
int free_mem(struct allocated_block *ab){
int algorithm = ma_algorithm;
struct free_block_type *fbt, *pre, *work;

fbt=(struct free_block_type*) malloc(sizeof(struct free_block_type));
if(!fbt) return -1;
fbt->size = ab->size;
fbt->start_addr = ab->start_addr;
/*插入到空闲区链表的头部并将空闲区按地址递增的次序排列*/
fbt->next = free_block;
free_block=fbt;
rearrange(MA_FF);/*默认是FF算法*/
fbt=free_block;
while(fbt!=NULL){
work = fbt->next;
if(work!=NULL){
/*如果当前空闲区与后面的空闲区相连,则合并*/
if(fbt->start_addr+fbt->size == work->start_addr){
fbt->size += work->size;
fbt->next = work->next;
free(work);
continue;
}
}
fbt = fbt->next;
}
rearrange(algorithm); /*重新按当前的算法排列空闲区*/
return 1;
}

/*释放ab数据结构节点*/
int dispose(struct allocated_block *free_ab) {
struct allocated_block *pre, *ab;
if(free_ab == allocated_block_head) { /*如果要释放第一个节点*/
allocated_block_head = allocated_block_head->next;
free(free_ab);
return 1;
}

pre = allocated_block_head;
ab = allocated_block_head->next;

while(ab!=free_ab){ pre = ab; ab = ab->next; }
pre->next = ab->next;
free(ab);
return 2;
}

/* 显示当前内存的使用情况,包括空闲区的情况和已经分配的情况 */
int display_mem_usage(void) {
struct free_block_type *fbt = free_block;
struct allocated_block *ab = allocated_block_head;
if(fbt==NULL) return(-1);
printf("----------------------------------------------------------\n");

/* 显示空闲区 */
printf("Free Memory:\n");
printf("%20s %20s\n", " start_addr", " size");
while(fbt!=NULL) {
printf("%20d %20d\n", fbt->start_addr, fbt->size);
fbt=fbt->next;
}
/* 显示已分配区 */
printf("\nUsed Memory:\n");
printf("%10s %20s %10s %10s\n", "PID", "ProcessName", "start_addr", " size");
while(ab!=NULL){
printf("%10d %20s %10d %10d\n", ab->pid, ab->process_name, ab->start_addr, ab->size);
ab=ab->next;
}
printf("----------------------------------------------------------\n");
return 0;
}



do_exit()
{
/* exit(0); */
_exit(0);
return 0;
}


int main(void)
{
char choice;

pid=0;
free_block = init_free_block(mem_size); /*初始化空闲区*/
for(;;) {
display_menu(); //显示菜单
fflush(stdin);
scanf("%s", &choice);
switch(choice) {
case '1': set_mem_size();break; /*设置内存大小*/
case '2': set_algorithm();flag=1;break;/*设置分配算法*/
case '3': new_process(); flag=1;break; /*创建新进程*/
case '4': kill_process(); flag=1;break;/*删除进程*/
case '5': display_mem_usage();flag=1;break;/*显示内存使用*/
case '0': do_exit(); exit(0); /*释放链表并退出*/
default: break;
}
}
}

2008年12月11日星期四

fc8 重装之后

命令
挂载ntfs格式的命令
mount -t ntfs-3g /dev/sda7 /media/gao/ -o force
看一些权限
cat /boot/config-2.6.23.1-42.fc8 | grep -i ext3
解压rar包
/media/SOFTWARE/linux/rar/rar x
alacarte 是Main Menu的命令
用cat /proc/下面的看到很多的信息
如:cat /proc/version 看linux的版本
cat /proc/meminfo 看内存信息
cat /proc/cpuinfo 看cpu的信息
在终端打开emacs -nw
mysoftware
1。安装chm阅读器sudo yum install gnochm
2。firefox
标签/home/gaowei/.mozilla/firefox/8umrv5sm.default
bookmarksb.bak
bookmarksb.html
3.webmin-1.400-1.noarch.rpm
4.realplayer 11 gold
http://linux.softpedia.com/progDownload/RealPlayer-Download-2742.html
Preparing... ########################################### [100%]
package RealPlayer-11.0.1.1056-20081001 is already installed
6。gtk
当./configure完了之后就
出现下面的内容:
checking pkg-config is at least version 0.9.0... yes
checking for BASE_DEPENDENCIES... configure: error: Package requirements (glib-2.0 >= 2.17.6 atk >= 1.13.0 pango >= 1.20 cairo >= 1.6) were not met:
Requested 'glib-2.0 >= 2.17.6' but version of GLib is 2.14.2
Requested 'pango >= 1.20' but version of Pango is 1.18.3
Requested 'cairo >= 1.6' but version of cairo is 1.4.10
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables BASE_DEPENDENCIES_CFLAGS
and BASE_DEPENDENCIES_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
7 VirtualBox
sudo rpm -ivh qt4-4.4.1-2.fc8.i386.rpm
sudo rpm -ivh qt4-4.4.3-1.fc8.i386.rpm
sudo rpm -ivh qt4-x11-4.4.3-1.fc8.i386.rpm
sudo rpm -ivh VirtualBox-2.0.6_39765_fedora8-1.i386.rpm
rpm
口令:
Preparing... ########################################### [100%]
1:VirtualBox ########################################### [100%]
chcon: can't apply partial context to unlabeled file /usr/lib/virtualbox/VirtualBox
chcon: can't apply partial context to unlabeled file /usr/lib/virtualbox/VBoxSDL
chcon: can't apply partial context to unlabeled file /usr/lib/virtualbox/VBoxHeadless
chcon: can't apply partial context to unlabeled file /usr/lib/virtualbox/vboxwebsrv
Creating group 'vboxusers'. VM users must be member of that group!
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.
Success!
8。关于一些绘图软件
gaphor
安装要超级用户,而且要有网络才可以,好像要下载一些东西的
You can start Gaphor by running the run-gaphor.sh
dia
很好安装,和一般的源代码安装方法是一样的!
关于一些图片的位置
/usr/share/pixmaps
/usr/share/icons/hicolor/scalable/apps
9
[gaowei@localhost qq]$ sudo rpm -ivh skype-2.0.0.72-fc5.i586.rpm
warning: skype-2.0.0.72-fc5.i586.rpm: Header V3 DSA signature: NOKEY, key ID d66b746e
Preparing... ########################################### [100%]
1:skype ########################################### [100%]
[gaowei@localhost qq]$ skype
10.
[gaowei@localhost player]$ ./Livestation-2.5.0.run
----------------------------------------\n
Do you accept the license [y/n]: y
\n----------------------------------------\n
-> Non-root user detected, will try to sudo when copying.
\n----------------------------------------\n
Installation directory [/usr/local/Livestation]:
Installation directory [/usr/local/Livestation]:
\n----------------------------------------\n
Create a symlink in /usr/bin [Y/n]: y
\n----------------------------------------\n
-> Making directory /usr/local/Livestation.
口令:
-> Copying files.
-> Creating symlinks.
\n----------------------------------------\n
Done. Run 'livestation' to start the player.\n
[gaowei@localhost player
http://tvants.en.softonic.com/
11.3d软件
[gaowei@localhost ArtOfIllusion]$ ls
aoi-linux-install.jar aoisetup.sh
[gaowei@localhost ArtOfIllusion]$ ./aoisetup.sh
/usr/bin/java -jar aoi-linux-install.jar
[gaowei@localhost ArtOfIllusion]$
12
[root@localhost install_flash_player_10_linux]# ./flashplayer-installer
Copyright(C) 2002-2006 Adobe Macromedia Software LLC. All rights reserved.
Adobe Flash Player 10 for Linux
Adobe Flash Player 10 will be installed on this machine.
You are running the Adobe Flash Player installer as the "root" user.
Adobe Flash Player 10 will be installed system-wide.
Support is available at http://www.adobe.com/support/flashplayer/
To install Adobe Flash Player 10 now, press ENTER.
To cancel the installation at any time, press Control-C.
NOTE: Please exit any browsers you may have running.
Press ENTER to continue...
Please enter the installation path of the Mozilla, Netscape,
or Opera browser (i.e., /usr/lib/mozilla):
10。links浏览器
vmware
序列号N1HPX-6U248-D206Y-4Y8Z6
[root@localhost ~]# /usr/bin/vmware-config.pl
1.
In which directory do you want to install the theme icons?
[/usr/share/icons]
What directory contains your desktop menu entry files? These files have a
.desktop file extension. [/usr/share/applications]
In which directory do you want to install the application's icon?
[/usr/share/pixmaps]
None of the pre-built vmmon modules for VMware Workstation is suitable for your
running kernel. Do you want this program to try to build the vmmon module for
your system (you need to have a C compiler installed on your system)? [yes]
Using compiler "/usr/bin/gcc". Use environment variable CC to override.
What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.23.1-42.fc8/build/include]
None of the pre-built vmblock modules for VMware Workstation is suitable for
your running kernel. Do you want this program to try to build the vmblock
module for your system (you need to have a C compiler installed on your system)? [yes]
Do you want networking for your virtual machines? (yes/no/help) [yes]
You must read and accept the VMware VIX API End User License Agreement to
continue.
Press enter to display it.
Do you accept? (yes/no) yes
Thank you.
In which directory do you want to install the VMware VIX API binary files?
[/usr/bin]
In which directory do you want to install the VMware VIX API library files?
[/usr/lib/vmware-vix/lib]
The path "/usr/lib/vmware-vix/lib" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]
In which directory do you want to install the VMware VIX API document pages?
[/usr/share/doc/vmware-vix]
In which directory do you want to install the VMware VIX API document pages?
[/usr/share/doc/vmware-vix]
In which directory do you want to install the VMware VIX API document pages?
[/usr/share/doc/vmware-vix]
hardware
[gaowei@localhost AMUSEMENT ]$ mount
/dev/sda9 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
/dev/sda8 on /media/AMUSEMENT type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
/dev/sda1 on /media/OS type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=500)
/dev/sda6 on /media/SOFTWARE type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=500)
/dev/sda7 on /media/LESSON type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
/dev/sda5 on /media/VMWARE type ext2 (rw,nosuid,nodev,uhelper=hal)
[gaowei@localhost AMUSEMENT ]$ df
文件系统 1K-块 已用 可用 已用% 挂载点
/dev/sda9 19304228 8826728 9481072 49% /
tmpfs 772932 12 772920 1% /dev/shm
/dev/sda8 12330328 6150732 6179596 50% /media/AMUSEMENT
/dev/sda1 15716960 712152 15004808 5% /media/OS
/dev/sda6 15716960 2769888 12947072 18% /media/SOFTWARE
/dev/sda7 15732328 4274160 11458168 28% /media/LESSON
/dev/sda5 34911367 5847569 27228610 18% /media/VMWARE
一种IDE应为hdb是用来命名主IDE上的从接口
另一种SCSI接口设备是用sd命名的
http://219.238.239.156:8000/osw/nimda
用户 u1006 口令 pass
 李开复:一是“内功”要学好,不要只是去学各种皮毛的语言、工具,和一些三流公司招聘列出来的要求,要把数据结构、算法、数据库、操作系统原理、计算机结构、离散数学等课程学好;二是多编程,最好大学四年有十万行编程的经验;还要讲究“实干”,Google是动手者的天堂,另外要有一些数学能力,还要练习团队精神,与人合作。
在 Linux 内核源文件 include/asm-i386/unistd.h 中,可以找到所有系统调用的定义。
http://kernelnewbies.org/KernelHacking
解压
.tar
解包: tar xvf FileName.tar
打包:tar cvf FileName.tar DirName
(注:tar是打包,不是压缩!)
---------------------------------------------
.gz
解压1:gunzip FileName.gz
解压2:gzip -d FileName.gz
压缩:gzip FileName
.tar.gz
解压:tar zxvf FileName.tar.gz
压缩:tar zcvf FileName.tar.gz DirName
---------------------------------------------
.bz2
解压1:bzip2 -d FileName.bz2
解压2:bunzip2 FileName.bz2
压缩: bzip2 -z FileName
.tar.bz2
解压:tar jxvf FileName.tar.bz2
压缩:tar jcvf FileName.tar.bz2 DirName
---------------------------------------------
.bz
解压1:bzip2 -d FileName.bz
解压2:bunzip2 FileName.bz
压缩:未知
.tar.bz
解压:tar jxvf FileName.tar.bz
压缩:未知
---------------------------------------------
.Z
解压:uncompress FileName.Z
压缩:compress FileName
.tar.Z
解压:tar Zxvf FileName.tar.Z
压缩:tar Zcvf FileName.tar.Z DirName
---------------------------------------------
.tgz
解压:tar zxvf FileName.tgz
压缩:未知
.tar.tgz
解压:tar zxvf FileName.tar.tgz
压缩:tar zcvf FileName.tar.tgz FileName
---------------------------------------------
.zip
解压:unzip FileName.zip
压缩:zip FileName.zip DirName
---------------------------------------------
.rar
解压:rar a FileName.rar
压缩:r ar e FileName.rar


rar请到:http://www.rarsoft.com/download.htm 下载!
解压后请将rar_static拷贝到/usr/bin目录(其他由$PATH环境变量指定的目录也可以):
[root@www2 tmp]# cp rar_static /usr/bin/rar
---------------------------------------------
.lha
解压:lha -e FileName.lha
压缩:lha -a FileName.lha FileName

lha请到:http://www.infor.kanazawa-it.ac.jp/.../lhaunix/下载!
>解压后请将lha拷贝到/usr/bin目录(其他由$PATH环境变量指定的目录也可以):
[root@www2 tmp]# cp lha /usr/bin/
---------------------------------------------
.rpm
解包:rpm2cpio FileName.rpm | cpio -div
---------------------------------------------
.tar .tgz .tar.gz .tar.Z .tar.bz .tar.bz2 .zip .cpio .rpm .deb .slp .arj .rar .ace .lha .lzh
.lzx .lzs .arc .sda .sfx .lnx .zoo .cab .kar .cpt .pit .sit .sea
解压:sEx x FileName.*
压缩:sEx a FileName.* FileName

sEx只是调用相关程序,本身并无压缩、解压功能,请注意!
sEx请到: http://sourceforge.net/projects/sex下载!
解压后请将sEx拷贝到/usr/bin目录(其他由$PATH环境变量指定的目录也可以):
[root@www2 tmp]# cp sEx /usr/bin/
(其实看帮助是最好的方法,一般各个命令都可以用“--help”参数得到常用使用方法!
卸载wine安装的软件
Wine Software Uninstaller万一不行就用下面的!
~/.wine/drive_c/删除你不想要的!
cd~/.local/share/applications/wine/
这四个目录中保存着安装的程序信息,删除就可以了:
$HOME/.config/menus/applications-merged/wine* (好像是xml文件,有乱码也没有关系,不会影响显示!)
$HOME/.local/share/applications/wine (直接影响开始程序菜单中的显示!)
$HOME/.local/share/desktop-directories/wine*
$HOME/.local/share/icons/????_*.xpm (程序图标)

2008年11月16日星期日

浏览器——应该学习!

Google Chrome 源码下载

Goolgle 于 2008.09.02 发布了浏览器 Google Chrome。Google Chrome 使用的内核源码来自开源浏览器引擎 WebKit Open Source Project。Google Chrome 的源码,同样亦是开源的。在 Google 的中文官方 Blog - Google 黑板报中,提到:

QUOTE: 我们对很多开发开源项目的人心存 感激,我们承诺会沿着前人的路继续前行。 我们借鉴了一些源自 Apple WebKit 和 Mozilla Firefox 的技术,怀着同样开源的精神,谷歌浏览器所有的代码全部开源。我们希望能与整个业界合作从而促进互联网的健康发展。

  目前 Google Chrome 源码已经公布了,有兴趣的软件开发者程序员可以从 chromium.org 服务器使用 SVN checkout Google Chrome Source Code,自定义自己的浏览器。

Google Chrome 源码下载地址 (Google Chrome Source Code Download)

  1. Google Chrome 源码 SVN 地址http://src.chromium.org/svn。包含有 Chrome、Gears、Webkit、GCC 等源码以及编译依赖工具。Chrome 浏览器项目的源码,位于目录 http://src.chromium.org/svn/trunk/src/chrome/

  2. Google Chrome 源码 Web 浏览地址http://src.chromium.org/viewvc/

  3. Google Chrome 所使用的 JavaScript V8 的源码下载地址http://code.google.com/p/v8/

WebKit Open Source Project 内核引擎的前世今生

  WebKit 的前身是 KDE 小组的 KHTML。Apple将 KHTML 发扬光大,推出了装备 KHTML 改进型的 WebKit 引擎的浏览器 Safari,获得了非常好的反响。

  WebKit 引擎比 Gecko 引擎更受程序员欢迎的原因,除了其引擎的高效稳定,兼容性好外,其源码结构清晰,易于维护,是一个重要的原因。而 Gecko 的可维护性就差多了。我在 2008年6月时候,曾编译 Gecko 引擎,准备做一个基于 Gecko 的 Embed 应用程序,但文档缺乏、结构欠清晰,折腾了一星期之后,最终不得不承认自己水平有限,放弃了事。

  现在浏览器的内核引擎,基本上是三分天下:

  • Trident: IE 以Trident 作为内核引擎。
  • Gecko: Firefox 是基于 Gecko 开发。
  • WebKit: Safari, Google Chrome 基于 Webkit 开发。

  WebKit 内核在手机上的应用十分广泛,例如 Google 的手机 Gphone、 Apple 的 iPhone, Nokia’s Series 60 browser 等所使用的 Browser 内核引擎,都是基于 WebKit。

  下面是 WebKit 首页关于 WebKit 的介绍:

Webkit Open Source Project

The WebKit Open Source Project

WebKit is an open source web browser engine. WebKit is also the name of the Mac OS X system framework version of the engine that's used by Safari, Dashboard, Mail, and many other OS X applications.

WebKit's HTML and JavaScript code began as a branch of the KHTML and KJS libraries from KDE. This website is also the home of S60's S60 WebKit development.

  WebKit 的 Source Code 源码程序,可从 http://webkit.org/building/checkout.html checkou 下载。

Google Chrome Source Code 源码下载

  基于 WebKit 内核的 Google Chrome 的源码也是是公开的,Google 官方 Blog 的文章 《谷歌浏览器(Google Chrome), Chromium 以及竞争》 说道:

  为确保我们所推动的每一个进展都有益于整个互联网社区——不仅仅是我们自己,谷歌浏览器完全开源。谷歌浏览器的源代码放在 Chromium 之下,任何人都可以在他们的项目中使用谷歌浏览器的源代码——即使他们意图开发一个与我们形成竞争的浏览器(“Shrome”,或者其它名字?)。

Google Chrome究竟伤害了谁?(来源)

谷歌与微软的战线从搜索到网络广告、办公软件、手机操作 系统。除了搜索以外,谷歌后来推出的基于互联网的免费产品,都难以对微软形成致命打击。新发布的浏览器Chrome则被谷歌寄予厚望,谷歌的内部人士“我 们天天研究IE8的弱点,然后照着它的弱点去打。它复杂,我们就把界面做得超级简单;它慢,我们就拼命提高速度;它不开源,我们就一定要开源。”看来 Chrome的竞争对手是IE。

事实是否如此呢?在Chrome上线短短的24小时内,在浏览器市场占据了令人印象深刻的1%的市场份额。此外,因Chrome浏览器的火爆而受到用户骤减伤害的是Firefox和Safari浏览器,而不是IE浏览器。



在Chrome发布的几天后,我也下载了一个,看看是否好用。装好Chrome后,第一印象是界面简单,很符合Google的风格,但是很多国内网站都是符合IE标准的,因此Chrome对某些在IE下正常运行的脚本的兼容性不够好。

面对特殊的中国市场,在未来的数个月,我们更加期待看到Chrome的发展前景。Chrome会继续赢得更多Firefox用户的芳心,还是用户在 Chrome更加成熟之前就人心恋旧,重返Firefox?Chrome会不会同样俘获主流IE用户?当Mac版本的Chrome发布之后,它又将对 Safari浏览器有何影响?

谷歌Chrome浏览器使用微软源代码

  新浪科技讯 北京时间9月16日消息,据国外媒体报道,众所周知,谷歌Chrome浏览器基于Firefox和WebKit,但微软高级项目经理斯科特·汉塞尔曼(Scott Hanselman)日前却表示,Chrome同时也使用了微软的源代码。

  在发布Chrome浏览器时,谷歌就承认Chrome得益于两大开源项目,Firefox和WebKit,而并未提及微软。但汉塞尔曼日前表示,这里也有微软的功劳。

  汉塞尔曼称,Chrome浏览器使用了微软的开源项目Windows Template Library(以下简称“WTL”),一个用来开发Windows应用程序和用户界面的组件。

  但汉塞尔曼强调,谷歌使用微软这部分代码乃合法之举。因为微软于2004年将有关浏览器的一部分代码转为开源,而谷歌正是根据开源协议授权使用了这批代码。

  在谷歌的Chrome浏览器上,谷歌将WTL 8.0列为第三方软件。Chrome浏览器为开源应用,因此其代码也对外开放。(李明)

http://hi.baidu.com/zhaochunyu0104/blog/item/dbf41adf1bbd601562279855.html

http://www.downdig.com/chrome/?tag=chrome%e6%ba%90%e7%a0%81%e5%88%86%e6%9e%90

2008年11月4日星期二

linux命令点滴记

很多时候,我们使用的命令是不常用的,但是很有用,当时用了,但是以后就很容易就忘记了。
所以,我现在开始记录一些有用的。
dmesg是一个查看系统日志的命令;
cat /proc/meminfo可以看内存;
free - Display amount of free and used memory in the system
ps(1), slabtop(1), vmstat(8), top(1)
[gaowei@localhost ~]$ dmesg |grep [mM][eE][mM]这个不错哦!看看内容不少啊!

cat /proc/stat

ps -aux|awk '{print $3,$11}'|sort -r

dmesg|grep -i ^mem
命令一个一个用,好用的记录,命令都是自己理解的。
arch是看你的机器是*86的?如我的是i686
animate可以放动画,也可以放照片但是不好用,只是可以放一张,以后学习一下。想一下,可以看照片的命令有:gthumb还有gimp当然它还可以对相片进行加工和处理,还算不错;还有f-spot
alacarte 这个命令可以打开,改变目录的对话窗口。

[gaowei@localhost common]$ nautilus --help
用法:nautilus [选项...] [URI...]
用文件管理器浏览文件系统

以后要不断的更新哦!

2008年10月10日星期五

svn的一些用法

由于现在一些需求,所以我要学svn
为什么要学它呢?因为我们接下来的一个实验要管理代码,所以我选择了google code作为储存代码的仓库了,不详细介绍了google code。因为现在很多人用,而且也比较简单了。
学习svn,当然先要下载一个它的客户端,安装好。
http://subversion.tigris.org/它的官方网站,可以下载,您要的!
手册下载http://svnbook.red-bean.com/
[gaowei@localhost myebook]$ mv IPv6.c trunk/
[gaowei@localhost myebook]$ ls
trunk
[gaowei@localhost myebook]$ cd trunk/
[gaowei@localhost trunk]$ cd ..
[gaowei@localhost myebook]$ svnadmin create tags
[gaowei@localhost myebook]$ svnadmin create branches
[gaowei@localhost myebook]$ ls
branches tags trunk
[gaowei@localhost myebook]$ svn import trunk https://myebook.googlecode.com/svn/trunk/ -m "first use svn"
增加 trunk/hooks
增加 trunk/hooks/pre-revprop-change.tmpl
增加 trunk/hooks/post-commit.tmpl
增加 trunk/hooks/post-lock.tmpl
增加 trunk/hooks/pre-commit.tmpl
增加 trunk/hooks/pre-lock.tmpl
增加 trunk/hooks/post-unlock.tmpl
增加 trunk/hooks/pre-unlock.tmpl
增加 trunk/hooks/start-commit.tmpl
增加 trunk/hooks/post-revprop-change.tmpl
增加 trunk/IPv6.c
增加 trunk/conf
增加 trunk/conf/svnserve.conf
增加 trunk/conf/passwd
增加 trunk/conf/authz
增加 trunk/db
增加 trunk/db/revs
增加 trunk/db/revs/0
增加 trunk/db/write-lock
增加 trunk/db/revprops
增加 trunk/db/revprops/0
增加 trunk/db/current
增加 trunk/db/uuid
增加 trunk/db/fs-type
增加 trunk/db/transactions
增加 trunk/db/format
增加 trunk/format
增加 trunk/dav
增加 trunk/locks
增加 trunk/locks/db.lock
增加 trunk/locks/db-logs.lock
增加 trunk/README.txt

提交后的版本为 6。
[gaowei@localhost myebook]$


我不知道它为什么要添加那么多呢?但是实际上才增加了三个
看这里http://code.google.com/p/myebook/source/browse/#svn/trunk

time