Linux É豸Çý¶¯³ÌÐò½ø½×£¨0£©
ºÜ¾ÃûÓÐд¼¼Êõ²©ÎÄÁË£¬´ÓÕâÀ↑ʼÎÒµÄÑо¿ÉúÉúÑÄ£¬×ªÑÛ¾ÍÒªÔÚÖ°³¡ÉÏÑø¼Òºý¿Ú£¬Éú»îÕæµÄ²»ÈÝÒ×£¬ÐҺû¹Óм¼ÊõÏà°éΪÎé¡£
ÓÉÓÚ¹¤×÷µÄ¹Øϵ£¬ÖÕÓÚ½Ó´¥µ½linuxÍøÂçºÍkernelµÄ±à³Ì£¬×ÜÌåÀ´Ëµ×ÜÊÇÒ»¸öºÃµÄÆõ»ú¡£ÈÃÎÒÄܹ»ÉîÈë²Ù×÷ϵͳÄںˡ£×ö¹ýÒ»¶Îʱ¼äµÄÓû§³ÌÐòµÄ¿ª·¢£¬×ÜÊÇÔÚWindowsƽ̨ÉÏ£¬ÖÕÓÚÓлú»áÔÚlinuxÉÏ×öµã¶«Î÷£¬»¹ÊǺÜÐ˷ܵġ£
Ê×ÏÈÊÇÒ»¸öHello WorldµÄÄں˳ÌÐò£¬È»ºó¾ÍÊÇÒ»´ó¶Ñ±àÒëµÄÎÊÌ⣬ÓÉÓÚûÓнӴ¥¹ýLinuxËùÒÔ»¨·ÑÁ˺ܶàʱ¼äÔÚÕâÉÏÃæ¡£
1£© hellokernel.c ÎҵıàÒë»·¾³ÊÇÔÚÐéÄâµÄLinux Redhat 5.0 ÉϱàÒëµÄ
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL")£» //Õâ¸öºêµÄÒâ˼ÎÒ»¹ÊDz»Ì«Ã÷°×£¬Ö±½Ó³Á˹ýÀ´
static int hello_init(void)
{
printk(KERN_ALERT"Hello,world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT"Goodby,cruel world\n");
}
module_init(hello_init); //µ±ÄÚºËÄ£¿é±»×°ÔصÄʱºòµ÷ÓÃhello_initº¯Êý
module_exit(hello_exit); //µ±ÄÚºËÄ£¿é±»Ð¶ÔصÄʱºòµ÷ÓÃhello_exitº¯Êý
2£©Ô´´úÂë×¼±¸ºÃÁËÖ®ºóÏÂÃæ¾ÍÊDZàÒëµÄÎÊÌâ
step1: ×¼±¸ºÃlinuxÄÚºËÔ´´úÂ룬עÒâ°æ±¾ºÅÒªÓëÖ÷»úÒ»Ö£¬ÕâÀïÒòΪÎÒÖ±½ÓÔÚÖ÷»ú£¨Linux»úÆ÷£©ÉϱàÒ룬ËùÒÔ²»´æÔÚ½»²æ±àÒëµÄÎÊÌâ¡£²é¿´linux»úÆ÷µÄÄں˰汾ºÅÓкܶàÃüÁÎÒÓõÄÊÇuname -r
[root@localhost ~]# uname -r
2.6.18-128.el5
¿´µ½Äں˰汾֮ºó¾Í¿ÉÒÔÔÚ¹ÙÍøÉÏÏÂÔضÔÓ¦°æ±¾µÄÄںˡ£http://www.kernel.org/pub/linux/kernel/v2.6/ÔÚÕâÀïÕÒµ½linux-2.6.18.tar.bz2 Õâ¸ö°æ±¾£¬È»ºó½âѹµ½/usr/src/Ŀ¼Ï¡£½âѹÃüÁîÊÇtar -xvf linux-2.6.18.tar.bz2¾Í¿ÉÒÔÁË¡£
step2: ×¼±¸¹¤×÷×öºÃÖ®ºóÊ×ÏÈÊDZàÒëÄںˣ¬Èç¹ûÄãÏÂÔصÄÄں˰汾ºÍÄãµÄÖ÷»ú°æ±¾ÊÇÒ»Ò»¶ÔÓ¦µÄ£¬ÄÇô±àÒëÆðÀ´ºÜ¼òµ¥µÄ£¬Ò»°ãûÓÐʲôÎÊÌâµÄ£¬Ö÷Òª¾ÍÊǼ¸¸ömakeÃüÁ
make oldconfig
make prepare
make scripts
step 3: ÏÂÃæ¾ÍÊÇÔÚhellokernel.cµÄĿ¼Ï±àдMakefileÎļþ£¬×¢ÒâMakefileµÄµÚÒ»×Öĸ±ØÐë´óд£¬ÎÒ¾ÍÊÇÔÚÕâÀï·¸´í£¬²éÁË°ëÌìû²é³öÎÊÌâ¡£MakefileµÄ±àд¶ÔÓÚÕâ¸öÀý×Ӻܼòµ¥£¬µ«ÊÇÈç¹û¸´ÔÓµÄÄÚºËÄ£¿éµÄ¿ª·¢»¹ÊÇÒªºÃºÃѧϰÔõô±àдµÄ¡£
Æäʵ¾ÍÊǼòµ¥µÄ¼¸¾ä»°¾ÍokÁË£º
obj-m := hellokernel.o //Ä¿±êÄ£¿éµÄ±àÒëÀ´×ÔÓÚhellokernel.oµÄÎļþ, hellokerne
Ïà¹ØÎĵµ£º
Ò».²é¿´ËùÓÐÓ²Å̵Äuuid
ls -all /dev/disk/by-uuid
longseakerµÄʵÀý
lrwxrwxrwx 1 root root 10 2009-09-19 08:17 05434a61-8a78-4ee5- a5db-6a49079b9e3d -> ../../sda5
lrwxrwxrwx 1 root root 10 2009-09-19 08:17 07D8-0104 -> ../../sda1
lrwxrwxrwx 1 root root 10 2009-09-19 08:17 18201249-998a-4bb1 ......
×¢£ºÕâƪÎÄÕ±ȽϾɣ¬µ«ÊÇÓÐÒ»¶¨µÄ²Î¿¼¼ÛÖµ~~×Ô¼ºÊÔ¹ýµÄLinux²»¶à£¬ËùÒÔ»¹ÊÇÓÐÒª²Î¿¼µÄµØ·½¡£
ÔÎÄÁ´½Ó£ºhttp://www.linux521.com/2009/newbie/200904/1963.html
Ä¿Ç°LinuxÔÚ¹úÄÚ½øÈëÁËÒ»¸ö½Ï¿ìËٵķ¢Õ¹½×¶Î,ÕýÈçÎÒÃÇ¿´µ½µÄ,Ðí¶àµÄWindowsÓû§×ªÍ¶
LinuxÕóÓª.ÓÉÓÚLinux±¾ÉíÊÇÒ»¸ö¿ª·ÅµÄ²Ù×÷ϵͳ,Òò¶øÓµÓÐÖÚ¶àµÄ·¢Ðаæ°æ± ......
×îÔç½Ó´¥LinuxÄÚºËÊÇÔÚ´óÈýµÄʱºò£¬ÄÇʱ¡¶²Ù×÷ϵͳ¡·µÄ¿Î³ÌÉè¼Æ¾ÍÊǽøÐÐLinuxÄÚºËÔ´´úÂëµÄ·ÖÎöÓë½ø³Ìµ÷¶ÈµÄ¸Ä½ø¡£ÌâÄ¿ÊÇ´óµÄÓеãÏÅÈË£¬ÌØ
±ðÊǶÔÄÇʱһ¸öÉæ×ãδÉîµÄÄêÇáÈË¿´À´¡£²»¹ýÄÇʱ×öµÄÊÂÇéºÜ¼òµ¥£¬ÈÏÈÏÕæÕæµÄ¿´ÁË¡¶LinuxÄÚºËÔ´´úÂëÇé¾°·ÖÎö¡·µÄÇ°ÑÔ²¿·Ö£¨Ö÷Òª½²µÄAT&T»ã
±àÓïÑÔ£¬ÄÚºËÖÐһЩÌØÊâµÄ±à³Ì¹æÔò£©£¬Ó ......
½ñÌì¿´µ½Ê¦ÐÖ¹¤Î»ÉÏÓб¾Linux Kernel In a Nutshell£¬»¹ÊÇÈ«Ó¢µÄÓ°Ó¡°æ£¬ËùÒԾͽè¹ýÀ´¿´¿´£¬·¢ÏÖÏÖÔÚ¿´Ó¢ÎĵÄÊé½¥½¥ÊÊÓ¦ÁË£¬»¹ÊDZȽÏÈÝÒ׵ģ¬ÊéÖпªÊ¼½éÉÜÈçºÎ±àÒëLinuxÄںˣ¬LinuxÄں˴óÈýµÄʱºòҲѧ¹ý±àÒë¹ý£¬µ«Êǵ±Ê±±àÒë±È½Ï¼òµ¥£¬Õâ´Î¾ö¶¨ÔÙÖØÍ·µ½Î²ºÃºÃ±àÒëһϣ¬Ê×ÏÈÏÂÔØlinux kernel£¬ÔÙÓÃsecureCRTÉÏ´«µ½Ubuntu 8. ......
¸´ÖÆÒÔÏÂÄÚÈÝ£¬±£´æΪ py ºó׺µÄÎļþ£¬¿½±´µ½wallpaperÎļþ¼Ð£¬½øÈëÎļþ¼Ð£¬ÒÔpythonÔËÐУ¬Ñ¡È¡xmlΪ±ÚÖ½
#!/usr/bin/env python2.6
# -*- coding: utf-8 -*-
# Ubuntu 9.10 dynamic wallpaper maker_Can be used in all the distributions of linux
#
# Auto generate a configuration file which you can use ......