ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÁíÑÛ¹Û³±:´ò¿ªÈíÅÌÀïµÄLinuxСÊÀ½ç

·¢²¼Ê±¼ä:2005-09-19 22:53:09À´Ô´:ºìÁª×÷Õß:zz123
×÷ÕߣºÀ׿­¡¡À´Ô´:ÈüµÏÍø¼¼ÊõÌìµØ-¿ª·ÅϵͳÊÀ½ç
±ÊÕßÔÚ²âÊÔAMDµÄ64λCPUʱ£¬²åÈ뺬ÓÐAMD¹Ù·½²âÊÔÈí¼þMaxpower64µÄÈíÅ̺ó£¬ÏµÍ³Ìáʾ²»ÄÜÒýµ¼¡£¹ØÓÚÕâ¸öÈí¼þAMD¹«Ë¾ÌṩµÄÐÅÏ¢ºÜÉÙ£¬Ö»ÖªµÀËü±ØÐëÔÚLinux»·¾³ÏÂÖ´ÐС£±ÊÕß´ò¿ªÈíÅÌ£¬·¢ÏÖÀïÃæÖ»ÓÐsys linux.cfgºÍMaxpower64Á½¸öÎļþ¡£

ÏÔÈ»£¬¿¿ÕâÁ½¸öÎļþÊÇÎÞ·¨Òýµ¼½øÈëLinuxϵͳµÄ£¬¸ü²»ÓÃ˵ִÐÐMaxpower64¡£ÓÚÊDZÊÕß×Ô¼ºÖÆ×÷ÁËÒ»ÕÅ¿ÉÒÔÒýµ¼½øÈëLinux»·¾³µÄÈíÅÌ¡£¸ÃÈíÅ̱ØÐëÓÉÁ½²¿·Ö×é³É£¬¼´Äں˺͸ùÎļþϵͳ¡£ÏÂÃæ½éÉÜÖÆ×÷µÄ·½·¨¡£

Äں˵ıàÒë

Òª°ÑÄں˷ŵ½Ò»ÕÅ1.44MBµÄÈíÅÌÉÏÈ¥£¬Í¨³£Òª¶ÔÄں˽øÐÐѹËõ¡£Ñ¹ËõÄں˵Ä×îºÃ·½·¨ÊÇÖØбàÒ룬½«Ò»Ð©²»±ØÒªµÄÖ§³ÖÈ¥µô£¬±ÈÈç¶ÔÍøÂçºÍÆäËüÖܱßÉ豸µÄÖ§³Ö¡£×¢Ò⣬Äں˱ØÐëÖ§³ÖRAM DiskºÍext2£¬·ñÔòϵͳ²»ÄÜÕý³£Òýµ¼¡£

±àÒë֮ǰÊ×ÏÈÇëÈ·ÈÏÊÇÒÔrootµÄÉí·ÝÔÚ½øÐвÙ×÷£¬·ñÔò»á·µ»Ø¡°Permission Denied¡±µÄ´íÎóÌáʾ¡£È»ºó½øÈëºÏÊʵıàÒë·¾¶£¬Ò»°ãÊÇÔÚ/usr/src/Linux-xxÏ£¬±ÈÈ磬Red Hat 9.0µÄ±àÒë·¾¶ÊÇÔÚ/usr/src/Linux-2.4Ï¡£Ö»ÓÐÔÚÕýÈ·µÄ·¾¶Ï±àÒëÃüÁî²Å»áÉúЧ¡£·ñÔò»áÏÔʾÈçÏÂÌáʾ£º


make: *** No rule to make target 'config'
£©


Èç¹ûÒÔÇ°±àÒë¹ýÄںˣ¬ÔòÓ¦µ±ÏÈÖ´ÐС°make mrproper¡±ÃüÁîɾ³ýÒÔÇ°±àÒëµÄºÛ¼£¡£½ÓÏÂÀ´Ö´ÐС°make menuconfig¡±ÃüÁʼÅäÖÃÄںˣ¬°Ñ²»ÐèÒªµÄ¶«Î÷È¥µô£¬²¢±£´æΪ.configÎļþ¡£Ëæºó£¬ÒÀ´ÎÖ´ÐÐÒÔÏÂÃüÁÀ¨ºÅÖÐÊǹØÓÚÃüÁîµÄ½âÊÍ£©£º

#make dep £¨ÉèÖÃÒÀÀµ¹Øϵ£©
#make clean £¨×¼±¸Òª¹¹½¨µÄÔ´ÂëÊ÷£©
#make bzImage £¨¹¹½¨Äںˣ©
#make modules £¨ÅäÖÃÄ£¿é£©
#make modules_install £¨Ê¹ÓÃÅäÖõÄÄ£¿é)
#make install £¨±àÒëÐÂÄںˣ©


Ö´ÐÐÍêÕâЩÃüÁîºó£¬ÔÚ/bootĿ¼Ï»ῴµ½Ò»¸öÃû×ÖΪvmlinuz-2.4.22customµÄÎļþ£¬Õâ¾ÍÊDZàÒëËùµÃµ½µÄÄںˡ£Èç¹û¸ÃÎļþ´óÓÚ1.44MB£¬¾ÍµÃÖØбàÒ룬ÔÙÈ¥µôһЩ²»±ØÒªµÄ¶«Î÷£¬Ö±µ½ËüСÓÚ1.44MBΪֹ¡£ÎªÁ˱ãÓÚ¼ÇÒ䣬²»·Á½«ËüÖØÐÂÃüÃûΪnewkernel¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 11 ÌõÆÀÂÛ

  1. hfangrong ÓÚ 2007-03-23 11:07:23·¢±í:

    ¡£BusyBox °üº¬ÁË
    ÆßÊ®¶àÖÖ Linux Éϱê×¼µÄ¹¤¾ß³ÌÐò£¬½öÐèÒª¼¸°Ù k ´ÅÅ̿ռ䣬ÔÚǶÈëʽϵͳÉϳ£Óõ½Ëü¡£ÏÂÔØÁË
    BusyBoxµÄÔ´´úÂë°üºó¿ÉÒÔ°´ÕÕÈçϵIJ½Öè²Ù×÷£º
    DOSTATIC=true
    È»ºóÐÞ¸Ä BusyBox ÖÐµÄ init.c£¬É趨ϵͳҪִÐеĵÚÒ»¸ö³ÌÐòΪ: /etc/rc.d/rc.sysinit
    #define INIT_SRCIPT "/etc/rc.d/rc.sysinit"
    ¿ªÊ¼±àÒëBusyBox
    #make
    #make install
    µ½ÕâÒ»²½ÎÒÃǾ͵õ½ÁË¿ÉÖ´ÐÐÃüÁîbusybox
    ½«busybox ¸´ÖƵ½/mnt/initrd/binĿ¼ÏÂ
    # cp busybox /mnt/initrd/bin
    È»ºó´´½¨³£ÓÃÃüÁîµÄlink,¾ßÌåµÄ¹¤×÷Ô­ÀíÇë²ÎÔÄbusyboxµÄ¹Ù·½ËµÃ÷¡£
    ÎÒÃÇ¿ÉÒÔʹÓà ./busybox --help À´²é¿´busyboxÖж¼ÓÐÄÄЩ¹¤¾ß¡£³£ÓõŤ¾ß¼°busybox
    µÄÓ÷¨ÈçÏ£º
    # ln -s busybox ls
    # ln -s busybox cp
    # ln -s busybox mount
    # ln -s busybox umount
    # ln -s busybox more
    # ln -s busybox ps
    # ln -s busybox sh
    ÏÖÔÚÎÒÃǾÍÓÐÁËËùÐèµÄ³£ÓÃÃüÁî¡£

  2. hfangrong ÓÚ 2007-03-23 11:06:21·¢±í:

    ¡£BusyBox °üº¬ÁË
    ÆßÊ®¶àÖÖ Linux Éϱê×¼µÄ¹¤¾ß³ÌÐò£¬½öÐèÒª¼¸°Ù k ´ÅÅ̿ռ䣬ÔÚǶÈëʽϵͳÉϳ£Óõ½Ëü¡£ÏÂÔØÁË
    BusyBoxµÄÔ´´úÂë°üºó¿ÉÒÔ°´ÕÕÈçϵIJ½Öè²Ù×÷£º
    DOSTATIC=true
    È»ºóÐÞ¸Ä BusyBox ÖÐµÄ init.c£¬É趨ϵͳҪִÐеĵÚÒ»¸ö³ÌÐòΪ: /etc/rc.d/rc.sysinit
    #define INIT_SRCIPT "/etc/rc.d/rc.sysinit"
    ¿ªÊ¼±àÒëBusyBox
    #make
    #make install
    µ½ÕâÒ»²½ÎÒÃǾ͵õ½ÁË¿ÉÖ´ÐÐÃüÁîbusybox
    ½«busybox ¸´ÖƵ½/mnt/initrd/binĿ¼ÏÂ
    # cp busybox /mnt/initrd/bin
    È»ºó´´½¨³£ÓÃÃüÁîµÄlink,¾ßÌåµÄ¹¤×÷Ô­ÀíÇë²ÎÔÄbusyboxµÄ¹Ù·½ËµÃ÷¡£
    ÎÒÃÇ¿ÉÒÔʹÓà ./busybox --help À´²é¿´busyboxÖж¼ÓÐÄÄЩ¹¤¾ß¡£³£ÓõŤ¾ß¼°busybox
    µÄÓ÷¨ÈçÏ£º
    # ln -s busybox ls
    # ln -s busybox cp
    # ln -s busybox mount
    # ln -s busybox umount
    # ln -s busybox more
    # ln -s busybox ps
    # ln -s busybox sh
    ÏÖÔÚÎÒÃǾÍÓÐÁËËùÐèµÄ³£ÓÃÃüÁî¡£

  3. fulijun5858 ÓÚ 2005-10-23 15:41:48·¢±í:

    ²»´íÎÒÒ²ÊÔÒ»ÊÔ

  4. eoboot ÓÚ 2005-10-06 00:38:42·¢±í:

    ²»´í

  5. thej ÓÚ 2005-09-20 00:11:36·¢±í:

    Ö§³Ö£¬²»´í

  6. zz123 ÓÚ 2005-09-19 22:56:42·¢±í:

    2.ÓÃsysLinuxÒýµ¼

    Ê×ÏÈÒÀ´ÎÖ´ÐÐÈçÏÂÃüÁ

    obr>
    # mkdosfs /dev/fd0
    # sysLinux /dev/fd0


    È»ºó±à¼­ÎļþsysLinux.cfg£¬ÄÚÈÝÈçÏ£º

    TIMEOUT 20
    DEFAULT Linux
    LABEL Linux
    KERNEL newkernel
    APPEND root=/dev/ram0 ro initrd=Image.gz


    ×îºó½«sysLinux.cfg¡¢newkernelºÍImage.gz¿½±´µ½ÈíÅÌÖм´Íê³ÉÁËÕûºÏ£º

    # mount /dev/fd0 /mnt/floppy
    # cp newkernel /mnt/floppy# cp Image.gz /mnt/floppy
    # cp sysLinux.cfg /mnt/floppy
    #umount /mnt/floppy


    3.Ö±½ÓÒýµ¼

    Ê×ÏÈÒÀ´ÎÖ´ÐÐÈçÏÂÃüÁ

    # dd if=newkernel of=/dev/fd0 bs=1k
    252+1 records in
    252+1 records out


    ÔÚÕâ¸öÀý×ÓÖУ¬ddÃüÁîдÈëÁË252¸öÍêÕû¼Ç¼£¨Record£©ºÍ1¸öPartial Record¡£Òò´ËÄÚºËÕ¼ÓÃÁË253¸öÈíÅÌBlocks¡£Õâ¸öÊý×Ö±»³ÆΪKERNEL_BLOCKS¡£

    È»ºóÖ´ÐÐÈçÏÂÃüÁ

    #rdev /dev/fd0 /dev/fd0
    #rdev -R /dev/fd0 0
    #rdev -r /dev/fd0


    µÚÈýÌõÃüÁîÖУ¬ValueµÄֵӦΪ16384+KERNEL_BLOCKS¡£Òò´Ë¸ÃÀýÖÐΪ16637¡£

    ×îºóÖ´ÐÐÈçÏÂÃüÁî¼´¿ÉÍê³ÉÕûºÏ£º

    #dd if= root system file of=/dev/fd0 bs=1k seek=


    KERNEL_BLOCKS¾ÍÊÇÉÏÒ»²½ddÃüÁîËù²úÉúµÄÊýÖµ¡£

  7. zz123 ÓÚ 2005-09-19 22:56:02·¢±í:

    ÕûºÏÄں˺͸ùÎļþϵͳ

    ĿǰΪֹÒѾ­ÓÐÁËÄں˺ÍѹËõ¹ýµÄ¸ùÎļþϵͳ£¬ÏÖÔÚʣϵľÍÊÇ°ÑËüÃÇÕûºÏµ½Ò»ÕÅÈíÅÌÀï¡£¸ù¾ÝÒýµ¼·½Ê½µÄ²»Í¬£¬ÓÐÈýÖÖÕûºÏ·½°¸¡£

    1.ÓÃGRUBÒýµ¼

    Ê×ÏÈÒÀ´ÎÖ´ÐÐÈçÏÂÃüÁ


    # mke2fs /dev/fd0
    # mount /dev/fd0 /mnt/floppy
    # mkdir /mnt/floppy/boot
    # mkdir /mnt/floppy/boot/grub
    # cp /boot/grub/stage1 /mnt/floppy/boot/grub
    # cp /boot/grub/stage2 /mnt/floppy/boot/grub
    #grub


    È»ºóÔÚgrub>Ìáʾ·û´¦ÊäÈëÈçÏÂÃüÁ

    grub> root (fd0)
    grub> setup (fd0)
    grub> quit


    Ëæºó½«Äں˺͸ùÎļþϵͳ¿½±´µ½ÈíÅÌÖУº

    #cp newkernel /mnt/floppy/boot
    #cp Image.gz /mnt/floppy/boot
    #cp /boot/grub/grub.conf /mnt/floppy/boot/grub


    ±à¼­grub.conf£¬ÄÚÈÝÈçÏ£º

    timeout 10
    default 0
    title My little Linux
    root (fd0)
    kernel /boot/newkernel ro
    initrd /boot/ Image.gz


    ×îºó£¬ÖÆ×÷Íêgrub.confµÄLinkÎļþmenu.lst¾ÍʵÏÖÁËÕûºÏ£º

    #ln -s /mnt/floppy/boot/grub/grub.conf /mnt/floppy/boot/grub/menu.lst
    #umount /mnt/floppy

  8. zz123 ÓÚ 2005-09-19 22:55:31·¢±í:

    È»ºó´´½¨³£ÓÃÃüÁîµÄÁ´½Ó£¬¾ßÌåµÄ¹¤×÷Ô­ÀíÇë²ÎÔÄBusyBoxµÄ¹Ù·½ËµÃ÷¡£

    nobr>
    # ln -s init ls
    # ln -s init cp
    # ln -s init mount
    # ln -s init umount
    # ln -s init more
    # ln -s init ps
    # ln -s init sh


    ÕâÑù¸ùÎļþϵͳ¾ÍÖÆ×÷Íê³ÉÁË¡£

    5.ѹËõ¸ùÎļþϵͳ

    ºÍÄÚºËÒ»Ñù£¬Òª°Ñ¸ùÎļþϵͳ·Åµ½Ò»ÕÅ1.44MBµÄÈíÅÌÉÏÒ²Òª½øÐÐѹËõ¡£Ò»°ã²ÉÈ¡RAM Disk·½Ê½ÊµÏÖ¸ùÎļþϵͳµÄѹËõ£¬¼´½«×¼±¸ºÃµÄ¸ùÎļþϵͳѹËõ³ÉΪRAM DiskµÄ¾µÏñÎļþ¡£µ±ÓÃÈíÅÌÆô¶¯Ê±£¬»á°Ñ¾µÏñÎļþ½âѹµ½ÄÚ´æÖУ¬ÐγÉÒ»¸öÐéÄâÅÌ£¬Í¨¹ý¸ÃÐéÄâÅÌ¿ÉÒÔ¿ØÖÆϵͳÆô¶¯¡£

    ÒÀ´ÎÖ´ÐÐÈçÏÂÃüÁÖÆ×÷RAM DiskµÄ¾µÏñÎļþ£º

    # dd if=/dev/zero of=/tmp/tmp_loop bs=1k count=2048
    # losetup /dev/loop0 /tmp/tmp_loop
    # mke2fs -m 0 /dev/loop0# mount -t ext2 /dev/loop0 /mnt
    # cp -a /floppy-Linux /mnt
    # umount /mnt
    # losetup -d /dev/loop0
    # dd if=/tmp/tmp_loop | gzip -9 > /tmp/Image.gz
    # rm -f /tmp/tmp_loop
    # sync


    ÕâÑù¾ÍµÃµ½ÁËѹËõ¹ýµÄ¸ùÎļþϵͳÎļþImage.gz¡£

  9. zz123 ÓÚ 2005-09-19 22:54:56·¢±í:

    3.±à¼­Shell Script

    Ê×Ïȵ½/floppy-Linux/etc/Ŀ¼Ï±༭inittab¡¢rc.sysinitºÍfstabÈý¸öÎļþ£¬ÄÚÈÝ·Ö±ðÈçÏ£º

    # vi inittab
    ::sysinit:/etc/rc.d/rc.sysinit
    ::askfirst:/bin/sh

    # vi rc.sysinit
    #!/bin/sh
    mount -a

    # vi fstab
    proc /proc proc defaults 0 0


    È»ºóÐÞ¸ÄÕâÈý¸öÎļþµÄȨÏÞ£º

    # chmod 644 inittab
    # chmod 755 rc.sysinit
    # chmod 644 fstab


    ×¢Ò⣬ÕâЩShell Script»áʹÓÃһЩ/binĿ¼ÏµÄÃüÁî¡£µ«ÊÇ/binĿ¼ÏÂÊǿյġ£ÏÖÔÚ¾ÍÐèҪʹÓÃBusyBoxÀ´ÖÆ×÷ÕâЩ³£ÓÃÃüÁî¡£

    4.ʹÓÃBusyBoxÖÆ×÷³£ÓÃÃüÁî

    ½«Îļþbusybox¸´ÖƵ½ÈíÅ̵Ä/binĿ¼Ï£¬²¢ÇÒ¸ÄÃûΪinit£º

    # cp busybox /floppy-Linux/bin/init

  10. zz123 ÓÚ 2005-09-19 22:54:19·¢±í:

    È»ºóΪ¸ùÎļþϵͳ½¨Á¢Ò»Ð©±ê×¼µÄĿ¼£º

    th="400" border="1" cellspacing="0" cellpadding="2" bordercolorlight = "black" bordercolordark = "#FFFFFF" align="center">
    # mkdir dev etc etc/rc.d bin proc mnt tmp var
    # chmod 755 dev etc etc/rc.d bin mnt tmp var
    # chmod 555 proc
    # ln -s sbin bin

    ½Ó׎øÈë/devĿ¼´´½¨¸ùÎļþϵͳ±ØÐèµÄһЩÉ豸Îļþ¡£

    ½¨Á¢Öն˻úÉ豸£º

    # mknod tty c 5 0
    # mkdir console c 5 1
    # chmod 666 tty console


    ½¨Á¢VGA DisplayÐéÄâÖն˻úÉ豸£º

    # mknod tty0 c 4 0
    # chmod 666 tty0


    ½¨Á¢RAM DiskÉ豸£º

    # mknod ram0 b 1 0
    # chmod 600 ram


    ½¨Á¢FloppyÉ豸£º

    # mknod fd0 b 2
    # chmod 600 fd0


    ½¨Á¢NullÉ豸£º

    # mknod null c 1 3
    # chmod 666 null


    µ½´ËΪֹ¾ÍÓÐÁËÒ»¸ö³õ²½µÄСÐ͸ùÎļþϵͳ£¬µ«ÊÇ»¹ÐèÒª±à¼­Ò»Ð©Shell ScriptÀ´ÍêÉÆËü¡£

  11. zz123 ÓÚ 2005-09-19 22:53:39·¢±í:

    ¸ùÎļþϵͳµÄÖÆ×÷

    Ò»¸ö¸ùÎļþϵͳҪʵÏÖ»ù±¾µÄ¹¦ÄÜ£¬±ØÐë°üÀ¨Ò»Ð©³£Óù¤¾ß£¬±ÈÈ磬sh¡¢ls¡¢cd¼°catµÈ¡£µ«ÊÇÕâЩ³£ÓõŤ¾ß»áÕ¼Óúܶà¿Õ¼ä£¬¼´Ê¹Ö»ÓÃԭϵͳÖеÄÕâЩÃüÁ¼´È«²¿Óþ²Ì¬±à Ò루²»Óö¯Ì¬Á¬½Ó¿â£©£¬´ó¸ÅÒ²ÒªÓÐ2MB¡«3MB¡£

    ʹÓÃBusyBox¹¤¾ß¿ÉÒÔ½â¾ö´ËÎÊÌâ¡£BusyBox°üº¬ÁË70¶àÖÖLinuxÉϵıê×¼¹¤¾ß³ÌÐò£¬¶øÇÒÖ»ÐèÒª¼¸°ÙKB¿Õ¼ä£¬ÔÚǶÈëʽϵͳÉϳ£Óõ½Ëü£¨±ÈÈçLinux Router ProjectºÍDebian Boot Floppy£©¡£

    1.½¨Á¢ BusyBox ´Ó¹Ù·½ÍøÕ¾ÉÏÏÂÔØBusyBoxµÄ×îа汾busybox-1.00-rc3.tar.gz£¬Ê¹ÓÃÈçÏÂÃüÁî½âѹËõ£º


    #tar zxvf busybox-1.00-rc3.tar.gz


    ΪÁ˽ÚÊ¡¿Õ¼ä£¬²ÉÓþ²Ì¬±àÒ룬ÐÞ¸ÄMakefileÖеÄDOSTATIC²ÎÊýΪtrue£º

    DOSTATIC=true


    È»ºóÐÞ¸ÄBusyBoxÖеÄinit.cÎļþ£¬É趨ϵͳҪִÐеĵÚÒ»¸ö³ÌÐòΪ/etc/rc.d/rc.sysinit£º

    #define INIT_SRCIPT "/etc/rc.d/rc.sysinit"


    ʹÓÃÈçÏÂÃüÁî±àÒëBusyBox£º

    #make
    #make install


    ±àÒëÍê³Éºó£¬¾ÍµÃµ½ÁË¿ÉÖ´ÐÐÃüÁîbusybox¡£

    2.ÖÆ×÷¸ùÎļþϵͳ

    Ê×ÏÈΪ¸ùÎļþϵͳ½¨Ò»¸öfloppy-LinuxĿ¼£º

    # mkdir floppy-Linux
    # cd floppy-Linux