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

±àÒëÒ»¸ölinuxÄÚºËÄ£¿é

¿´Ô´´úÂë¡£
#include <linux/kernel.h>
#include <linux/module.h>
#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif
int init_module()
{
printk("Hello, I'm kernel\n");
return 0;
}
void cleanup_module()
{
printk("I'm kernel, bye\n");
}

ÔÙÀ´¿´ makefileµÄд·¨
TARGET = hello
OBJS = hello.o
MDIR = drivers/misc
EXTRA_CFLAGS = -DEXPORT_SYMTAB
CURRENT = $(shell uname -r)
KDIR = /lib/modules/$(CURRENT)/build
PWD = $(shell pwd)
DEST = /lib/modules/$(CURRENT)/kernel/$(MDIR)
obj-m      := $(TARGET).o
default:
 make -C $(KDIR) SUBDIRS=$(PWD) modules
$(TARGET).o: $(OBJS)
 $(LD) $(LD_RFLAG) -r -o $@ $(OBJS)
ifneq (,$(findstring 2.4.,$(CURRENT)))
install:
 echo $(DEST) $(LD_RFLAG)
 su -c "cp -v $(TARGET).o $(DEST) && /sbin/depmod -a"
else
install:
 su -c "cp -v $(TARGET).ko $(DEST) && /sbin/depmod -a"
endif
clean:
 -rm -f *.o *.ko .*.cmd .*.flags *.mod.c
-include $(KDIR)/Rules.make
ºÃÁË ·ÅÈ뵽λÖÃÔËÐÐmakefile¼´¿É
²åÈëÄ£¿éµÄÃüÁîÊÇÕâÑùµÄ
$insmod hello.ko£¨PS£º¾¡¹ÜÄã¿´²»µ½ÓÐ.koÕâÑùµÄÎļþ£¬µ«ÊǵÄÈ·ÊÇÕâôÀ´×öµÄ£©
Óà dmesg ¾Í¿ÉÒÔ¿´µ½ Êä³öÀ²¡£¡£¡£¡£
²¹³äÒ»¸ö´íÎó£º
./linux/include/asm/elf.h: In function `start_ia32_thread':
./linux/include/asm/elf.h:153: warning: implicit declaration of function `load_g
s_index'
./linux/include/asm/elf.h: In function `elf_common_init':
./linux/include/asm/elf.h:166: error: structure has no member named `r8'
./linux/include/asm/elf.h:166: error: structure has no member named `r9'
./linux/include/asm/elf.h:166: error: structure has no member named `r10'
./linux/include/asm/elf.h:166: error: structure has no member named `r11'
./linux/include/asm/elf.h:167: error: structure has no member named `r12'
./linux/include/asm/elf.h:167: error: structure has no member named `r13'
./linux/include/asm/elf.h:167: error: structure has no member named `r14'
./linux/include/asm/elf.h:167: erro


Ïà¹ØÎĵµ£º

linuxºÍUnix

Ò»¡¢Àí½âLinuxµÄµ¥Óû§¶àÈÎÎñ£¬¶àÓû§¶àÈÎÎñ¸ÅÄ
Linux ÊÇÒ»¸ö¶àÓû§¡¢¶àÈÎÎñµÄ²Ù×÷ϵͳ£»ÎÒÃÇÓ¦¸ÃÁ˽ⵥÓû§¶àÈÎÎñºÍ¶àÓû§¶àÈÎÎñµÄ¸ÅÄ
1¡¢Linux µÄµ¥Óû§¶àÈÎÎñ£»
µ¥Óû§¶àÈÎÎñ£»±ÈÈçÎÒÃÇÒÔbeinan µÇ¼ϵͳ£¬½øÈëϵͳºó£¬ÎÒÒª´ò¿ªgedit À´Ð´Îĵµ£¬µ«ÔÚдÎĵµµÄ¹ý³ÌÖУ¬ÎҸоõÉÙµãÒôÀÖ£¬ËùÒÔÓÖ´ò¿ªxmms À´µãÒôÀÖ£» ......

LAMP(Linux+Apache+Mysql+PHP)²¿ÊðÈÕÖ¾

±¾ÎļǼһϱ¾ÈË°²×°LAMPµÄÈ«¹ý³Ì
±¾ÈËʹÓõÄLinuxΪRedHat Enterprise 5 X64
µÚÒ»²½:°²×°Mysql
MysqlµÄ°²×°±È½Ï¼òµ¥£¬ÎªÁ˱ÜÃâ³öÏÖÎļþÕÒ²»µ½µÄÇé¿ö£¬ÎÒÒÀ´ÎÏÂÔØ°²×°ÁËÒÔÏÂ4¸öRPM°ü
MySQL-server-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-client-community-5.1.46-1.rhel5.x86_64.rpm 
MySQL-devel-commu ......

linux Kill¶à¸ö½ø³Ì

¾­³£ÐèÒªKill¶à¸ö½ø³Ì£¬ÕâЩ½ø³Ì°üº¬¹²Í¬µÄ¹Ø¼ü×Ö£¬¿ÉÒÔÓÃÒ»ÌõÃüÁîKillµôËüÃÇ¡£ ps aux | grep "common" | cut –c 9-15 | xargs kill –9 ¹ÜµÀ·û¡°|¡±ÓÃÀ´¸ô¿ªÁ½¸öÃüÁ¹ÜµÀ·û×ó±ßÃüÁîµÄÊä³ö»á×÷Ϊ¹ÜµÀ·ûÓÒ±ßÃüÁîµÄÊäÈë¡£ÏÂÃæ˵˵ÓùܵÀ·ûÁª½ÓÆðÀ´µÄ¼¸¸öÃüÁ "ps aux" ²é¿´ËùÓнø³ÌµÄÃüÁî¡£Õâʱ¼ìË÷³öµÄ ......

²¦¿ªÃÔÎí µ¥Æ¬»úºÍǶÈëʽLINUX¿ª·¢µÄÄǵãʶù

×÷ÕߣºÎ¤¶«É½,»ªÇåÔ¶¼ûǶÈëʽѧԺ½²Ê¦¡£
Ëæ×ÅǶÈëʽÐÐÒµÓ²¼þƽ̨µÄÐÔÄÜÔöÇ¿£¬ÏîÄ¿ÐèÇóºÍ¹¦ÄÜÈÕÒ渴ÔÓ£¬ARM¹«Ë¾ÍƳöµÄ CORTEX-M3£¬¸üÊÇÈÃÒÔÍù×öµ¥Æ¬»úµÄ¹¤³ÌʦÔÚоƬºÍ¼¼ÊõÑ¡ÐÍÃæÁÙÁ½ÄÑÑ¡Ôñ£¬±¾×¨Ì⽫´ÓоƬ¼Û¸ñ¡¢Õû¸öϵͳµÄÓ²¼þÈí¼þÉè¼Æ¼°Î¬»¤µÄ³É±¾µÈ¸÷¸ö·½Ãæ¸øÄúÌṩһ¸ö²Î¿¼£¬ ²¢´Ó¼¼Êõ½Ç¶È·ÖÎöµ¥Æ¬»úºÍ´ø²Ù×÷ϵͳµÄÏµÍ ......

Linux²Ù×÷ϵͳÏÂÈçºÎÌí¼Ó·þÎñ

#!/bin/sh ÊÇ˵Ã÷¸Ã½Å±¾µ÷ÓõÄshellµÄÀàÐÍ
 
#chkconfig: 2345 80 05 ÆäÖÐ2345ÊÇÖ¸Ã÷·þÎñµÄÔËÐеȼ¶£¬80±íÃ÷ÊÇϵͳÆô¶¯Ê±ÒªÆô¶¯µÚ80ºÅ·þÎñ£¨·þÎñºÅ¿ÉÒÔÖظ´£©¡£05±íÃ÷ÊÇϵͳ¹Ø±ÕҪֹͣµÄ·þÎñºÅ¡£
 
#descrīption: service ÕâÀïµÄserviceÄã¿ÉÒÔËæ±ãÌí£¬µ«±ØÐëÓÐ
 
case $1 in ÕâÀïµÄcaseÊǸöÑ¡ÔñÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ