Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Ìí¼ÓLinuxÄ£¿é

ÓÐÁËϵͳµ÷Óõľ­Ñ飬Ìí¼ÓÄ£¿é»¹ÊǺÜ˳ÀûµÄ¡£
¡¾ÊµÑé»·¾³¡¿
Fedora£¬ÄÚºË2.6.21.6
¡¾ÊµÑé²½Öè¡¿
1. cd /root/homework/module
2. vi process.c
3. ¼ÓÈëÈçÏ´úÂ룺
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
static int process_init(void)
{
int num=0;
struct task_struct *p;
for_each_process(p)
{
struct task_struct *q=p->parent;
printk("pid=%-5d,name=%-20s,",p->tgid,p->comm);
printk("prio=%-5d,",p->prio);
printk("my_parent is: %s[%d]\n",q->comm,q->tgid);
num++;
}
printk("\ntotal number is: %d\n",num);
return num;
}
static void process_exit(void)
{
printk("==================\n");
printk("process_exit,GoodBye!\n");
}
module_init(process_init);
module_exit(process_exit);
MODULE_LICENSE("GPL");

4. vi Makefile
5. ¼ÓÈëÈçÏ´úÂë
obj-m :=process.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean
6. make
7. /sbin/init 3 ½øÈë×Ö·û½çÃæ
8. insmod process.ko ÏÔʾ½á¹û
9. rmmod process.ko ÒƳöÄںˣ¬ÏÔʾ½á¹û


Ïà¹ØÎĵµ£º

Linux iptableÎĵµ

×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......

vmware tools ÔÚºìñLinuxÖеݲװ

redhat9Ï°²×°VMware Tools
ÏÂÃæÊÇ°²×°²½Öè:
1.Æô¶¯Rad Hat 9.0(ͼÐνçÃ淽ʽµÇ½)£¬²¢ÇÒÒÔ¹ÜÀíÔ±µÄÉí·ÝµÇ½¡£
2.ÔÚVMwareÐéÄâ»úµÄ²Ëµ¥Öеã»÷£ºÐéÄâ»ú->°²×°VMware ¹¤¾ß->install¡£
3.Red Hat 9.0×Ô¶¯¹ÒÔØVMware ToolsµÄÐéÄâ¹âÇý,²¢ÏÔʾÔÚ×ÀÃæ¡£
4.½øÈ¥VMware ToolsµÄÐéÄâ¹âÇýÀ°ÑVMwareTools-5.5.1-19175.tar ......

linux³õѧ

Èç¹ûÄãºÜÏëÖªµÀÕû¸ö²Ù×÷ϵͳÄÚµÄÿ¸öĿ¼ÄÚ¶¼ÓÐЩʲô£¬Ö´ÐÐÃüÁ
cd / && tree >> ~/filesystem.tree
Õ⽫ÊÇÒ»¸ö¶à´ï8MµÄÎļþ£¬ÀïÃæ»áÃèÊöÕû¸öÎļþϵͳµÄĿ¼¼°ÆäÎļþ½á¹¹£¬ÏÖÔÚ¾ÍÕûÌå¶øÑÔÀ´¸ÅÊöһϣº
Ò»¼¶»ù±¾Ä¿Â¼½á¹¹£º
/
Îļþϵͳ¸ùĿ¼£¬Î»ÓÚÕû¸öÎļþϵͳµÄ×¼¶
/boot  
´æ·Å×ÅÆ ......

ת£ºLinuxϽøÐÐMYSQLµÄC++±à³ÌÆð²½ÊÖ¼Ç


LinuxϽøÐÐMYSQLµÄC++±à³ÌÆð²½ÊÖ¼Ç
Ê×ÏÈ°²×°±ØÐèµÄ¿ª·¢°ü
sudo apt-get install gcc g++ libgcc1 libg++ make gdb
°²×°MYSQLµÄCÓïÑÔ¿ª·¢°ü
sudo apt-get install libmysql++-dev libmysql++2c2a libmysqlclient15-dev libmysqlclient15off
......

Ìí¼ÓLinuxϵͳµ÷ÓÃ

¡¾ÊµÑé»·¾³¡¿
Fedora£¬ÄÚºË2.6.21.6
¡¾ÊµÑé²½Öè¡¿
1. cd /usr/src/linux
2. vi kernel/sys.c
ÔÚ×îºóÌí¼ÓÈçÏ´úÂ룺
asmlinkage long sys_processinfo(void)
{
int num=0;
unsigned long state;
struct task_struct *p;
for_each_process(p)
{
printk("pid=%-5d,name=%-20s",p->tgid,p->co ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ