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

linuxÇý¶¯Ö®makefileÏê½â

# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
    obj-m := hello.o
# Otherwise we were called directly from the command
# line; invoke the kernel build system.
else
    KERNELDIR ?= /lib/modules/$(shell uname -r)/build
    PWD := $(shell pwd)
default:
    $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
µ±ÎÒÃÇÇÃÏÂmakeʱ£¬ÎÒÃǽøÈëÁËÕâ¸öȨÍþµÄmakefile¶þ´Î¡£µÚÒ»´Î½øÈëmakefile£¬·¢ÏÖKERNELRELEASEûÓб»ÉèÖÃʱ£¬ÓÚÊÇËý¸ù¾ÝbuildÕâ¸ö·ûºÅÁ´½Ó¶¨Î»ÄÚºËÔ´´úÂëĿ¼£¬È»ºó½øÈëdefault£¬¿ªÊ¼µÚ¶þ¸ömake£¬£­CÑ¡Ïî½øÈëÄÚºËÔ´´úÂëĿ¼£¬ÕÒµ½¶¥²ãµÄmakefile£¬È»ºó£­M·µ»Øµ±Ç°Ä¿Â¼Ö´ÐÐmakefileÎļþ£¬Õâ¾ÍÊǵڶþ´Î½øÈëÕâ¸ömakefile£¬ÔÚÕâ´Î£¬ÓÉÓÚKERNELRELEASE±äÁ¿ÒѾ­¶¨Ò壬Òò´Ë²»ÐèÒª½øÈëelseÓïÑÔ£¬ÔÚÕâÀobj-m:=hello.oÕâ¸öÓï¾äºÍÎÒÃÇÒÔǰ²»ÊÇÇý¶¯³ÌÐòÖеÄmakefile²»Í¬£¬ÔÚÕâÀïÄں˻á°ïÄã´¦ÀíÒ»ÇУ¬Õâ¾ä»°ÊǸæËßÄںˣ¬ÐèÒª´Óhello.o´´½¨Ò»¸öÇý¶¯Ä£ÐÍ£¨module£©¡£
²Î¿¼ÎÄÏ× ¡¶linux device drivers 3¡·
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØ×Ô£ºhttp://blog.csdn.net/abc19842008/archive/2008/02/14/2095836.aspx


Ïà¹ØÎĵµ£º

2010 3 16ÈÕ×ܽᣨlinuxµÄ½ø³Ì¹ÜÀí1£©

Ö÷Òª¿´ÁËLinuxÍêȫעÊÍÄDZ¾Ê飬ÖÕÓÚ×¼±¸¹¥¶ÁLinuxÄÚºËÔ´ÂëÁË£¬ÏÈ¿´Á˵ڶþÕŵÄ×ÜÌå¸ÅÄ¸Ð¾õ²Ù×÷ϵͳÓкܶණÎ÷»¹ÕæÊÇ´óͬСÒ죬¼ÇµÃucos¾ÍÊÇÓÐÒ»¸ö½Ð×ö¿ì±íµÄ¶«Î÷£¬ÀïÃæ×î¶à¿ÉÒÔ±íʾ64¸ö½ø³Ì£¬¶øÔç°æµÄLinux£¨0.11£©Ò²ÓÐÕâ¸öһ˵µÄ¶«Î÷¡£
 
ÔÚLinuxÖÐÒ²ÓÐÒ»¸öPCBÀ´±íʾÿ¸ö½ø³Ì£¬ÔÚÕâ¸ö½á¹¹ÌåÖУ¬ÓÐÖ¸ÏòÈÎÎñ´úÂëµÄÖ ......

ubuntu Ô¶³ÌÁ¬½Ó linux ʹÓÃSSH (ubuntu ÅäÖÃssh·þÎñ)

°²×°OpenSSH
UbuntuȱʡûÓа²×°SSH Server£¬Ê¹ÓÃÒÔÏÂÃüÁî°²×°£º
sudo apt-get install openssh-server openssh-client
²»¹ýUbuntuȱʡÒѾ­°²×°ÁËssh client¡£
ÅäÖÃÍê³ÉºóÖØÆð£º
sudo /etc/init.d/ssh restart
windows ¿Í»§¶ËÓÃputtyÁ¬½ÓÃüÁîshellģʽ
......

ÈçºÎ´ÓWindowsÇáËɹý¶Éµ½Linux£¿

Òý£º
Linux²Ù×÷ϵͳÊÇÓÉLinus TorvaldsÏÈÉúÔÚ1991Äê´´½¨µÄ£¬Ö®ºó²»¶Ï»ñµÃ»¥ÁªÍøÉÏÖÚ¶à³ÌÐòÔ±µÄ×ÔÔ¸Ö§³Ö£¬¾­¹ýÊ®¼¸ÄêµÄ·¢Õ¹£¬Èç½ñÒѾ­³ÉΪ¼ÌWindowsÖ®ºóµÄµÚ¶þ´óµçÄÔ²Ù×÷ϵͳÈí¼þ¡£
ÄãÊÇ·ñ¶ÔLinuxÓгä·ÖµÄÁ˽âÄØ£¿×÷ΪһÖÖÆ½Ì¨£¬LinuxÊ×ÏÈ»ñµÃÁ˳ÁÄçÓÚijÖÖñ±ºÃ֮ʿºÍºÚ¿ÍÃǵÄ
Çàíù¡£Linux²Ù×÷ϵͳÊÇÓÉLinus
TorvaldsÏÈÉú ......

Linux 2.6.19.x Äں˱àÒëÅäÖÃÑ¡Ïî¼ò½é

Ô­Îijö´¦£ºhttp://www.svn8.com/shouce/Linux/kernel_options.html×ðÖØÔ­´´£¡
Code maturity level options
´úÂë³ÉÊì¶ÈÑ¡Ïî
Prompt for development and/or incomplete code/drivers ÏÔʾÉÐÔÚ¿ª·¢ÖлòÉÐδÍê³ÉµÄ´úÂëÓëÇý¶¯.³ý·ÇÄãÊDzâÊÔÈËÔ±»òÕß¿ª·¢Õß,·ñÔòÇëÎðÑ¡Ôñ
General setup
³£¹æÉèÖÃ
Local version - append ......

Linux GCC makeÎļþµÄд·¨2

ÎļþÔÚÁ½¸öÎļþ¼Ð£º
inc/hello.h
main/hello.c, main.c, Makefile
ÎļþÄÚÈÝ£º
hello.h
void hello(char name[]);

hello.c
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}

main.c
#include <stdio.h>
#include "../inc/hello.h"
// The second
int main( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ