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

LinuxϵͳÏ ÄÚºËÄ£¿é¿ª·¢

 
1. modprobe ¼ÓÔØÄÚºËÄ£¿é
 
a) ÔÚ /etc/module.conf ÖвéÕÒ±ðÃû
b) ÔÚ lib/modules/version/module.dep ÖÐÅжÏÊÇ·ñÓÐÒÀÀµÄ£¿éÐèÒª±»ÌáÇ°¼ÓÔØ£¨¸ÃÎļþ±»depmod-a½¨Á¢£©
 
2. 2.4ÄÚºËÖв»Ò»¶¨·ÇÓÃinit_moduleºÍcleanup_module×ö¿ªÊ¼ºÍ½áÊøµÄº¯Êý£¬µ«ÐèÒªÓÃmodule_initºÍ
 
module_exitÉêÃ÷¡£
 
3. ºê __init ºÍ __exit ¿ÉÒÔʹº¯ÊýÔÚÔËÐÐÍê³Éºó×Ô¶¯»ØÊÕÄڴ棨ÏÞÄ£¿éÖУ©£¬__initdataÓÃÓÚ±äÁ¿£¬
 
¾ÙÀý£º
 
#include //ÐèÒª°üº¬µÄÍ·Îļþ
 
static int ntest __initdata = 3;
 
static int __init test_init(void) {...}
static void __exit test_exit(void) {...}
 
module_init(test_init); //ÉêÃ÷·ÅÔÚʵÏÖº¯Êýºó
module_exit(test_exit);
 
4. һЩģ¿é˵Ã÷µÄÏà¹Øºê£¬¿ÉÒÔÓÃobjdump¿ÉÒԲ鿴Ïà¹ØÐÅÏ¢¡£
MODULE_LICENSE() ˵Ã÷´úÂëÐí¿ÉÀàÐÍ
MODULE_DESCRIPTION() Ä£¿éÃèÊö
MODULE_AUTHOR() ×÷Õß
MODULE_SUPPORTED_DEVICE() Ä£¿éÖ§³ÖµÄÉ豸
 
5. ²ÎÊý´«µÝʹÓúê MODULE_PARM(±äÁ¿Ãû,ÀàÐÍ)¡£
Ö§³ÖµÄÀàÐÍÓÐ"b"±ÈÌØ "h"¶ÌÕû "i"ÕûÊý "l"³¤Õû "s"×Ö·û´®
 
static int myint = 9;
static char *mystr = "test"; //×¢ÒâÐèÒª´«µÝ²ÎÊýµÄĬÈÏÖµ
 
MODULE_PARM(myint, "i");
MODULE_PARM(mystr, "s");
 
6. ¶à¸öÎļþ±àÒë³ÉÒ»¸öÄÚºËÄ£¿é£º
a) ÐèÒªÔÚÒ»¸öÔ´³ÌÐòÖмÓÈë
#define __NO_VERSION__
#include
b) ±àÒëͬÆÕͨµÄµ¥¸öÄÚºËÎļþ
c) Á¬½Ó£ºld -m elf_i386 -r -o <1st src file.o> <2nd src file.o>
 
7. strace ²éÒ»¸ö³ÌÐòËùÓõ½µÄϵͳµ÷ÓÃ
 
8. ¹ØÓÚfile_operations½á¹¹Ì嶨ÒåÔÚlinux/fs.hÎļþÖС£
ʹÓ÷½Ê½£º
struct file_operations fops = {
read: device_read,
write: device_write,
open: device_open,
release: device_release
}
C99µÄʹÓ÷½Ê½£º
struct file_operations fops = {
.read = device_read,
.write = device_write,
.open = device_open,
.release = device_release
}


Ïà¹ØÎĵµ£º

linuxÉÏжÔØdb2

DB2жÔØ:ÓÉÓÚijÖÖÔ­Òò£¬ÒªÐ¶ÔØDB2ÔÙÖØа²×°µÄ»°£¬Ò»¶¨ÒªÕýÈ·µÄжÔØDB2£¬·ñÔò²»ÄÜÖ´ÐÐÖØа²×°»ò°²×°µÄDB2²»¿ÉÓá£
1¡¢ÔÚlinuxÉÏжÔØDB2µÄÒ»°ã¹ý³ÌÈçÏÂËùʾ£º
a.¿ÉÑ¡£ºÉ¾³ýËùÓÐÊý¾Ý¿â¡£¿ÉÒÔʹÓá°¿ØÖÆÖÐÐÄ¡±»òdrop databaseÃüÁîɾ³ýÊý¾Ý¿â¡£
b.Í£Ö¹DB2¹ÜÀí·þÎñÆ÷¡£
c.Í£Ö¹DB2ʵÀý¡£
d.³ýÈ¥DB2¹ÜÀí· ......

LinuxÖÐtty¡¢pty¡¢ptsµÄ¸ÅÄîÇø±ð

 LinuxÖÐtty¡¢pty¡¢ptsµÄ¸ÅÄîÇø±ð
»ù±¾¸ÅÄ
1> tty(ÖÕ¶ËÉ豸µÄͳ³Æ):
ttyÒ»´ÊÔ´ÓÚTeletypes£¬»òÕßteletypewriters£¬Ô­À´Ö¸µÄÊǵ紫´ò×Ö»ú£¬ÊÇͨ¹ý´®ÐÐÏßÓôòÓ¡»ú¼üÅÌͨ¹ýÔĶÁºÍ·¢ËÍÐÅÏ¢µÄ¶«Î÷£¬ºóÀ´ÕⶫÎ÷±»¼üÅÌÓëÏÔʾÆ÷È¡´ú£¬ËùÒÔÏÖÔÚ½ÐÖն˱ȽϺÏÊÊ¡£
ÖÕ¶ËÊÇÒ»ÖÖ×Ö·ûÐÍÉ豸£¬ËüÓжàÖÖÀàÐÍ£¬Í¨³£Ê¹ÓÃttyÀ´¼ò ......

Linuxϳ£Óú¯Êý


getenv£¨È¡µÃ»·¾³±äÁ¿ÄÚÈÝ£©  
Ïà¹Øº¯Êý   putenv£¬setenv£¬unsetenv
±íÍ·Îļþ   #include<stdlib.h>
¶¨Ò庯Êý   char * getenv(const char *name);
º¯Êý˵Ã÷   getenv()ÓÃÀ´È¡µÃ²ÎÊýname»·¾³±äÁ¿µÄÄÚÈÝ¡£²ÎÊýnameΪ»·¾³±äÁ¿µÄÃû³Æ£¬Èç¹û¸Ã±äÁ¿´æÔÚÔò»á·µ»Ø ......

DBAÒªÕÆÎÕµÄLinux ÃüÁָͨÄÏ

¸ß¼¶ Linux ÃüÁָͨÄÏ
×÷ÕߣºArup Nanda
2006 Äê 8 Ô·¢²¼
ÔÚ Sheryl Calish ׫дµÄ“Linux ÎļþÃüÁָͨÄÏ”Õâƪ³öÉ«µÄÎÄÕÂÖУ¬Äúѧϰµ½ÁËһЩ¶ÔÓÚ Linux ÐÂÊÖÓÈΪÖØÒªµÄ³£Óà Linux ÃüÁî¡£¼ÈÈ»ÄúÏÖÔÚÒѾ­ÕÆÎÕÁË»ù´¡ÖªÊ¶£¬ÏÂÃæÎÒÃǽ«½éÉÜһЩ¸üΪ¸´ÔÓµ«È´·Ç³£ÓÐÓõÄÃüÁî¡£
ÔÚÕâ¸ö¹²·Ö 4 ¸ö²¿·ÖµÄÎÄÕ ......

DBAÒªÕÆÎÕµÄLinux ÃüÁָͨÄÏ

¸ß¼¶ Linux ÃüÁָͨÄÏ£¬µÚ 3 ²¿·Ö£º×ÊÔ´¹ÜÀí
×÷ÕߣºArup Nanda
2009 Äê 1 Ô·¢±í
Ôڴ˲¿·ÖÖУ¬Á˽âÓÃÓÚ¼àÊÓÎïÀí×é¼þµÄ¸ß¼¶ Linux ÃüÁî
Linux ϵͳÓÉÈô¸ÉÖ÷ÒªÎïÀí×é¼þ×é³É£¬Èç CPU¡¢ÄÚ´æ¡¢Íø¿¨ºÍ´æ´¢É豸¡£ÒªÓÐЧµØ¹ÜÀí Linux »·¾³£¬ÄúÓ¦¸ÃÄܹ»ÒÔºÏÀíµÄ¾«¶È²âÁ¿ÕâЩ×ÊÔ´µÄ¸÷ÖÖÖ¸±ê — ÿ¸ö×é¼þ´¦Àí¶àÉÙ×ÊÔ´¡¢ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ