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

linux»ù±¾Çý¶¯ºÍlinux×Ö·ûÉ豸Çý¶¯

 ÏÈÕ³ÌùÒ»¸ölinux×î¼òµ¥µÄÇý¶¯£¬Æäʵ¶ÔÓÚÒ»¸ö´Ó2.4ÍæÉÏÀ´µÄÈËÀ´Ëµ£¬Çý¶¯²»¸´ÔÓ£¬±È½Ï²»Ï°¹ßµÄÊÇÄǸömakefile
Çý¶¯±¾Éí£º
hello.c:
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(vodi){
    printk(KERN_ALERT "hello world\n");
    return 0;
}
static void hello_exit(vodi){
    printk(KERN_ALERT"bye bye\n");
}
module_init(hello_init);
module_exit(hello_exit);
Makefile:
obj-m := hello.o
KERNELDIR :=/lib/modules/$(shell uname -r)/build
all:
    make -C $(KERNELDIR) M=$(shell pwd) modules
clean:
    rm -rf *.o *.ko
È»ºó¸½¹ýÀ´Ò»¸öÇý¶¯£¬ÔÝʱûÓÐÑéÖ¤£¬ÊÇ×Ö·ûÐ͵ģ¬Èç¹ûÑéÖ¤ºÃÓã¬ÎÒÔÙ¸üÐÂÕâÆªÈÕÖ¾
±¾ÀýÊÇ·ë¹ú½øµÄ ¡¶Ç¶ÈëʽLinux Çý¶¯³ÌÐòÉè¼Æ´ÓÈëÃŵ½¾«Í¨¡·µÄµÚÒ»¸öÀý×Ó
¸Ð¾õÕæÊǺÃÊé   Ç¿ÁÒÍÆ¼ö
×¢ÊÍÊÇdeep_pro¼ÓµÄ ×ªÔØÇë×¢Ã÷£¡ÎÒµÄÌØµãÊÇÎIJ»¼Óµã£¡
Õâ¸öÇý¶¯ÊÇÔÚÄÚ´æÖзÖÅäÒ»¸ö256×ֽڵĿռ䣬¹©Óû§Ì¬Ó¦ÓóÌÐò¶Áд¡£
ÏÈÊÇÍ·Îļþ demo.h
#ifndef _DEMO_H_
#define _DEMO_H_
#include <linux/ioctl.h> /* needed for the _IOW etc stuff used later */
/********************************************************
* Macros to help debugging
********************************************************/
#undef PDEBUG             /* undef it, just in case */
#ifdef DEMO_DEBUG
#ifdef __KERNEL__
#    define PDEBUG(fmt, args...) printk( KERN_DEBUG "DEMO: " fmt, ## args)
#else//usr space
#    define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
#endif
#else
# define PDEBUG(fmt, args...) /* not debugging: nothing */
#endif
#undef PDEBUGG
#define PDEBUGG(fmt, args...) /* nothing: it's a placeholder */
//É豸ºÅ
#define DEMO_MAJOR 224
#define DEMO_MINOR 0
#define COMMAND1 1
#define COMMAND2 2
//×Ô¼º¶¨ÒåµÄÉ豸½á¹¹
struct DEMO_dev
{
    struct cdev cdev;    /* Char de


Ïà¹ØÎĵµ£º

Linux³ÌʽÉè¼Æ

 
http://www.openchess.org/noitatsko/programming/ (2001-05-24 16:47:48)
ÐźŴ¦Àí
--------------------------------------------------------------------------------
ÐźŴ¦Àí¸Å˵ 
ËͳöÐźŠ
½ÓÊÕÐźŠ
ÐźŵĴ¦Àí 
ÈÎÎñ¿ØÖÆ 
----------------------------------- ......

LinuxÎı¾Ä£Ê½ÏÂÈçºÎ¿ØÖÆÑÕÉ«

 ÓÃsecureCRT»òÕ߯äËûһЩ¿Í»§¶Ë¹¤¾ßµÇ½µ½Linux¿ÉÒÔ¿´µ½ËüÏÔʾÁËһЩÑÕÉ«£¬ÕâÊÇÔõô×öµ½µÄÄØ£¿
linuxÎı¾ÖÕ¶Ë¿ÉÒÔÀûÓÃÒ»¸ö¼òµ¥¶øÌØÊâµÄÃüÁîÀ´¿ØÖÆÑÕÉ«µÄÏÔʾ£º\033[<command>m£¬ ÆäÖÐcommand¾ÍÊÇÒ»¸öÊý×Ö
Èç¹ûÊÇÓÃechoÀ´ÏÔʾµÄ»°£¬±ØÐëÖ¸¶¨-e²ÎÊý£¬Èç
echo -e "\033[32mtest\033[0m"
ÆäÖÐÊý×Ö0±íʾ»Ö¸´Ö®Ç° ......

Linux¶àÏ̱߳à³Ì

Ïß³Ì ÊǼÆËã»úÖжÀÁ¢ÔËÐеÄ×îСµ¥Î»£¬ÔËÐÐʱռÓúÜÉÙµÄϵͳ×ÊÔ´¡£¿ÉÒÔ°ÑÏ߳̿´³ÉÊDzÙ×÷ϵͳ·ÖÅäCPUʱ¼äµÄ»ù±¾µ¥Ôª¡£Ò»¸ö½ø³Ì¿ÉÒÔÓµÓÐÒ»¸öÖÁ¶à¸öÏ̡߳£ËüÏß³ÌÔÚ½ø³ÌÄÚ²¿¹²ÏíµØÖ·¿Õ¼ä¡¢´ò¿ªµÄÎļþÃèÊö·ûµÈ×ÊÔ´¡£Í¬Ê±Ïß³ÌÒ²ÓÐÆä˽ÓеÄÊý¾ÝÐÅÏ¢£¬°üÀ¨£ºÏ̺߳š¢¼Ä´æÆ÷£¨³ÌÐò¼ÆÊýÆ÷ºÍ¶ÑÕ»Ö¸Õ룩¡¢¶ÑÕ»¡¢ÐźÅÑÚÂë¡¢ÓÅÏȼ¶¡¢Ïß³ÌË ......

½â¾ölinuxÏÂtoo many fileÎÊÌâ

¹¤×÷Öз¢ÏÖ£¬ÔÚlinuxÖдWEBLOGICÓ¦Ó÷þÎñÆ÷µÄ»·¾³Ï£¬ÓÐʱ¿ÉÄÜͬʱ·¢²¼¶à¸öwar°ü£¬¶øÇÒÿһ¸öwar°üµÄÎļþÊýÄ¿ºÜ¶à£¬»òÕ߿ͻ§Í¬Ê±·ÃÎÊÁ¿±È½Ï´ó£¬´ËʱWEBLOGIC¾Í»á±¨´í£¬±¨´íÐÅÏ¢Öаüº¬“Too many open files”£¬ÀýÈ磺
java.io.FileNotFoundException: /home/weblogic/bea/user_projects/domains/lhyth/server ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ