Next Previous Contents

5. ¶i¶¥ªº¥DÃD

5.1 PCMCIA ³]³Æªº¸ê·½¤À°t

²z½×¤W¡A ­þ¤@­Ó´¡Â_³Q¨Ï¥Î¨ì­þ­Ó³]³Æ¤W³£¨SÃö«Y¡C ¥u­n¨â­Ó (©Î¥H¤W ) ³]³Æ¤£³Q«Øºc¦¨¨Ï¥Î¬Û¦Pªº´¡Â_§Y¥i¡C¦b /etc/pcmcia/config.opts ùاA¥i¥Hµo²{¦³­Ó¦a¤è¥Î¨Ó±Æ°£¨º¨Ç³Q«D PCMCIA ³]³Æ©Ò¨Ï¥ÎµÛªº´¡Â_¡C

¦P¼Ë¦a¡A¤]¨S¦³¿ìªk¥i¥Hª½±µ«ü©w I/O ¦ì§}µ¹¤@­Ó PCMCIA ¥d¨Ó¨Ï¥Î¡C /etc/pcmcia/config.opts Àɮפ¹³\§A«ü©w¥i³Q©Ò¦³ªº PCMCIA ³]³Æ©Ò¨Ï¥Îªº°ð½d³ò¡A ©Î¬O±Æ°£¨º¨Ç·|©M¨ä¥L³]³Æ¬Û½Ä¬ðªº°ð½d³ò¡C

¦b­×§ï¤F /etc/pcmcia/config.opts«á¡A§A¥i¥H¨Ï¥Î ``kill -HUP'' ¨Ó­«·s±Ò°Ê cardmgr¡C

³Q¥Î¨ÓºÊµø¥d¤ùª¬ºAªº´¡Â_¬O¦b cardmgr ³B²z /etc/pcmcia/config Àɮפ§«e¥Ñ§C¶¥ªº´¡¼ÑÅX°Êµ{¦¡¼Ò²Õ (i82365 ©Î tcic) ©Ò¿ï¾Ü ªº¡C¦]¦¹§ïÅܳo­ÓÀɮר䣷|¦³¤°»ò¼vÅT¡C­n³]©w³o­Ó´¡Â_¡A¦b´¡¼ÑÅX°Êµ{ ¦¡³Q¸ü¤J®É¡A³]©w¦b /etc/rc.d/rc.pcmcia ¤ºªº PCIC_OPTS ÅܼƨϥΠcs_irq= ¿ï¶µ¡C

©Ò¦³ªº«È¤áºÝ¥d¤ùÅX°Êµ{¦¡³£¦³­Ó¥s°µ irq_list ªº°Ñ¼Æ¡C ³Q¥Î¨Ó«ü ©w­þ¨Ç´¡Â_¥i¥Î¸ÕµÛ¥Î¨Ó°t¸mµ¹¥L­Ìªº¡C³o¨ÇÅX°Êµ{¦¡¿ï¶µÀ³¸Ó³Q³]©w¦b§A ªº /etc/pcmcia/config ÀÉ®×ùØ¡C¨Ò¦p:

device "serial_cs"
  module "serial_cs" opts "irq_list=8,12"
  ...

·|«ü©w¦ê¦C°ðÅX°Êµ{¦¡¥u¨Ï¥Î irq 8 ©Î irq 12¡C ¤£ºÞ irq_list ªº³]©w¦p¦ó¡A ¥d¤ùªA°Èµ{¦¡ Card Services µ´¤£·|¤À°t¤w³Q¨ä¥L³]³Æ©Ò¨Ï ¥Î¤Fªº´¡Â_¡A©Î¬O¦b«ØºcÀÉùسQ±Æ°£ªº´¡Â_¡C

5.2 §Ú«ç¼Ë¤~¯à¬°®a®x¤Î¤u§@ªº¨Ï¥Î°µ¦U§Oªº³]³Æ³]©w©O?

§Ú­Ì¥i¥H«Ü²³æ¦a¨Ï¥Î PCMCIA ``scheme'' ¤ä´©¨Ó¹F¦¨¡C ¨Ï¥Î¨âºØ¤£¦Pªº «Øºc schemes¡A¤À§O¥s ``home'' ¤Î ``work''¡C ¥H¤U¬O­Ó¦³ scheme «ü©w ªº³]©wªº network.opts ¤â½Z½d¨Ò:

case "$ADDRESS" in
work,*,*,*)
    # definitions for network card in work scheme
    ...
    ;;
home,*,*,*|default,*,*,*)
    # definitions for network card in home scheme
    ...
    ;;
esac

PCMCIA ³]³Æ¦ì§}ªº­º­n³¡¥÷³£¬O«Øºc scheme¡C ¦b³o­Ó¨Ò¤l¤¤¡A ²Ä¤G­Ó ``case'' ¥y¤l·|±q ``homee'' ©M ``default'' schemes ¤¤¬D¿ï¤@­Ó¡C ¦] ¦¹¡A¤£ºÞ¥ô¦ó²z¥Ñ scheme ¨Ã¨S³Q³]©w¤F¡A¤º©w­È¬O ``home'' ³]©w¡C

²{¦b¡A­n¦b¤G­Ó³]©w¶°ùØÀY¬D¿ï¤@­Ó¡A¥i°õ¦æ:

cardctl scheme home

©ÎªÌ¬O

cardctl scheme work

cardctl ©R¥O¬Û·í©óÃö±¼©Ò¦³ªº¥d¤ù«á¦A­«±Ò°Ê¥¦­Ì¡C ¤£ºÞ PCMCIA ¨t²Î¬O§_³Q¸ü¤J¡A³o­Ó©R¥O³£¥i¦w¥þ¦a³Q°õ¦æ¡C¦ý¬O¦pªG§A¦b·í®É¥¿¦b¨Ï¥Î ¨ä¥Lªº PCMCIA ³]³Æ®É³o­Ó©R¥O¥i¯à·|¥¢±Ñ¡C (ÁöµM¥L­Ìªº«Øºc¨Ã¤£§¹¥þ¨Ì ¾a scheme ªº³]©w¡C )¡C

­nª¾¹D¥Ø«e PCMCIA scheme ªº³]©w¡A°õ¦æ:

cardctl scheme

5.3 ±q PCMCIA ³]³Æ¶}¾÷

­n¦b¤@­Ó PCMCIA ³]³Æ¤W°µ­ÓÀɮרt²Î»Ý­n­A­Ó¤p§âÀ¸¥i¦æ¡A ¦]¬° Linux ªº PCMCIA ¨t²Î¨Ã¨S¦³³]­p¦¨³s±µ¨ì®Ö¤ßµ{¦¡¤W¡C¥¦ªº¥D­n¤¸¥ó¡A¥i¸ü¤J¦¡ ®Ö¤ß¼Ò²Õ¥H¤Î¨Ï¥ÎªÌ¼Ò¦¡ªº cardmgr ºëÆF¬O¥õ¿à¦b¤@­Ó¤w¸g¦b°õ¦æªº¨t²Î ¤W¡C®Ö¤ßªº ``initrd'' ¥H¤¹³\ Linux ¨Ï¥Î¤@­Ó¦³³Ì¤p¤Æªº®Ú ¬M¹³ÀÉ¡B¸ü¤JÅX°Êµ{¦¡ªº¼È®É©Êªº°ÊºA°O¾ÐÅéºÏºÐ¨Ó¶}¾÷¡AµM«á¦A­«·s±¾¤W ¤@­Ó¤£¦Pªº®ÚÀɮרt²Î¡C³o­Ó¼È®Éªº®Ú¨t²Î¥i¥H«Øºc PCMCIA ³]³Æ¡AµM«á¦A §â¥¦­«·s±¾¦¨¤@­Ó®Ú¨t²Î¡C

initrd ¬M¹³Àɵ´¹ï¥²¶·¦s©ñ¦b¤@­Ó¥i¶}¾÷ªº³]³Æ¤W: ¤@¯ë¨Ó»¡³o´NµLªk©ñ ¨ì PCMCIA ³]³Æ¤W¤F¡C³o¬O¦]¬° BIOS ªº­­¨î¡A¥i¤£¬O®Ö¤ßªº­­¨î¡C¦b³oùØ ¡A ¯à°÷¤À¿ë¥X `` ¥i¶}¾÷ªº (boot-able)'' ³]³Æ (¨Ò¦p¡A¥ô¦ó¥i¥H°µ¶}¾÷ ¨Ï¥Îªº³]³Æ ) »P `` ¥i°µ®Ú¨t²Îªº (root-able)'' ³]³Æ (¨Ò¦p¡A¥i¥H³Q±¾ ¤J¦¨¬°®Ú¨t²Îªº³]³Æ ) ªº¤£¦P³B¤]¬O«Ü­«­nªº¡C `` ¥i¶}¾÷ªº (Boot-able) '' ³]³Æ¬O¥Ñ BIOS ©Ò¨M©wªº¡A ³q±`¬O¤º³¡³nºÐ¾÷©Mµw¦¡ºÏºÐ ¾÷¡C`` ¥i°µ®Ú¨t²Îªº (root-able)'' ³]³Æ¬O¥ô¦ó¥i¥H¦b³Q¸ü¤J§Y§Y³Q®Ö¤ß ©Ò¤ä´©ªº°Ï¶ô³]³Æ¡C initrd ªº¥\¯à¥i¨Ï§ó¦hªº³]³ÆÅܦ¨ `` ¥i°µ®Ú¨t²Îªº (root-able)''¡A¦Ó«D ``¥i¶}¾÷ªº (boot-able)''¡C

¦³¨Ç Linux ¨ÑÀ³ª©¥»¤¹³\¦w¸Ë¨ì PCMCIA SCSI ¥d±µµÛªº³]³Æ¤W¡C¨Ï±o¥¦­Ì µL·N¦a¦h¥X¤F¥i¤ä´©±q PCMCIA SCSI CD-ROM ³]³Æ¨Ó¦w¸ËªºÃä»Ú®ÄÀ³¡C µM¦Ó¡A ¨ì¥Ø«e¬°¤î¡A ¨Ã¨S¦³¥ô¦ó Linux ¦w¸Ë¤u¨ã¤ä´©«Øºc¤@­Ó¥i¥H±q PCMCIA ®ÚÀɮרt²Î¤W¶}¾÷¨ì Linux ªº¦X¾A ``initrd''¡C ³]¥ß¤@­Ó¥H PCMCIA ®ÚÀɮתº Linux ¨t²Î»Ý­n±z¨Ï¥Î¨ä¥Lªº Linux ¨t²Î¨Ó²£¥Í¤@­Ó ``initrd'' ¬M¹³ÀɮסC¦pªG¨S¦³¥i¥Îªº¨ä¥L Linux ¨t²Î¡A¥t¤@­Ó´À¥N¤èªk ¬O°µ³Ì¤p¦w¸Ë¨ì«D PCMCIA ºÏºÐ¤W¡A«Ø¥ß¤@­Ó initrd ¬M¹³ÀÉ¡AµM«á¦A­«·s ¦w¸Ë¨ì PCMCIA ¥Ø¦a³]³Æ¤W¡C

¦b Linux Bootdisk-HOWTO ùئ³¤@¨ÇÃö©ó³]©w¶}¾÷ºÏºÐ¤ùªº¤@¯ë¸ê°T¡A¦ý«o ¨S¦³¥ô¦ó¦³Ãö©ó initrd ªº¸ê°T¡C initrd ªº¥D­n¤å¥ó³Q©ñ¦b³Ì·sªº®Ö¤ßµ{ ¦¡½X¨ÑÀ³ª©¥»ùØÀY¡A ¦b linux/Documentation/initrd.txt¡C ¦b¶}©l«e¡A§AÀ³¸Ó­n¥ýŪ¤@¤U³o¥÷¤å¥ó¡C ¹ï©ó lilo ªº¼ô±x¤]¬O¦³§U ¯qªº¡C ­n¨Ï¥Î initrd ¤]»Ý­n§A¤w¦³­Ó±N CONFIG_BLK_DEV_RAM ©M CONFIG_BLK_DEV_INITRD ¥\¯à¥´¶}«á©Ò½sĶ¥X¨Óªº®Ö¤ß¡C

³o¬O­Ó°ªµ¥«Øºc§Þ³N¡A »Ý­n±z¹ï Linux ¥H¤Î PCMCIA ¨t²Î¦³¤@©wµ{«×ªº¼ô ±x«×¡C½Ð½T»{¦b±z¾\Ū§¹©Ò¦³¬ÛÃöªº¤å¥ó«á¦A¶}©l¡C¤U­±ªº `` ­¹ÃÐ '' À³ ¸Ó¬O¥i¦æªº¡A ¦ý¬O¤@¥¹¤£¨Ì·Ó½d¨Ò¨Ó°µªº¸Ü¡A ´N·|«Ü§Ö¦a±N§A±À¦V¥¼ª¾¤Î `` ¤£³Q¤ä´©ªº '' ¦a¤è¡A¨º§A´N±o¦Û¤v¨Óªº¡C

³o¤èªk»Ý­n§A¤@©w­n¨Ï¥Î PCMCIA ÅX°Êµ{¦¡ 2.9.5 ©Î³Ì·sªºª©¥»¤~¥i¥H¡C ªº PCMCIA ®M¥ó©Î¬O­Ó§Oªº¤¸¥ó¨Ã¤£¯à¦b initrd ùبϥΡC½Ð¤£­n±N¤£¦P ªºª©¥»ªº¤¸¥ó²V¦X¤F¡C

pcinitrd »²§U­û¤â½Z

pcinitrd ¤â½Z¥Î¨Ó«Ø¥ß¤@­Ó¨Ï¥Î PCMCIA ®ÚºÏ°Ï¤À³Î¨Ó±Ò°Ê Linux ªº°ò¥» initrd ¬M¹³ÀÉ¡C ¸Ó¬M¹³ÀÉùØ¥]§t¤@­Ó³Ì¤pªº¥Ø¿ý¼h¯Åµ²ºc ¡B ¥H¤Î¦³¥Îªº³]³ÆÀɮסB¤@¨Ç¤G¶i¦ìÀɮסB¦@¥Îµ{¦¡®wÀÉ¥H¤Î¤@®M PCMCIA ÅX°Êµ{¦¡¼Ò²Õ¡C ·í§A°õ¦æ pcinitrd ®É¡A­n«ü©w­n­n¥]§t¶i¥h¬M¹³ÀÉ ùØ­±ªºÅX°Êµ{¦¡¼Ò²Õ¦WºÙ¡C ¦Ó¥D­n PCMCIA ®Ö¤ß¤¸¥ó pcmcia_core ¤Î ds·|³Q¦Û°Ê¦a¥]§t¶i¥h¡C

¨Ò¦p¡A°²³]§Aªºµ§°O¹q¸£¨Ï¥Î¤@­Ó i82365 ¦P®eªº PCMCIA ¥D±±¨î¾¹¡A¦Ó§A ·Q±q¤@­Ó±µµÛ Adaptec SlimSCSI ¥d¦Ó¸Ë¦³®ÚÀɮרt²ÎªºµwºÐ¤W±Ò°Ê Linux ¡C§A¥i¥H«Ø¥ß¤@­Ó¦X¾Aªº initrd ¬M¹³ÀÉ¡A¤èªk¦p¤U:

pcinitrd -v initrd pcmcia/i82365.o pcmcia/aha152x_cs.o

¨Ó¦Û­q initrd ±Ò¨Ï±Æµ{¡A§A¥i¥H¥Î¤U­±ªº©R¥O¨Ó¨Ï¥Î ``loopback'' ³]³Æ ¨Ó±¾¤W¸Ó¬M¹³ÀÉ®×:

mount -o loop -t ext2 initrd /mnt

µM«á½s­× linuxrc ¤â½Z¡C PCMCIA «ØºcªºÀÉ®×·|³Q¦w¸Ë¨ì¬M¹³ÀÉ®×ùØ ÀYªº /etc ¤º¡A ·íµM§A¤]¥i¥H¦Û¤w³]©w¡C ²Ó¸`½Ð¬Ý pcinitrd ªº man ­¶¡C

«Ø¥ß¤@­Ó initrd ¶}¾÷³nºÐ¤ù

¦b«Ø¥ß¤F pcinitrd ¬M¹³ÀÉ«á¡A §A¥i¥H§Q¥Î«þ¨©®Ö¤ßªº¤è¦¡¨Ó°µ¤@¤ù ¥i¶}¾÷ªººÏºÐ¤ù¡A ¨Ã§â³QÀ£ÁYªº initrd ¬M¹³ÀÉ¡B¤ä´©µ¹ lilo ¨Ï¥Î ªºÀɮרì¤@±iªÅ¥ÕºÏºÐ¤ù¤W¡C ¤U­±ªº¦C¤l¡A §Ú­Ì°²³]§Ú­Ì»Ý­nªº PCMCIA ®Ú³]³Æ¬O /dev/sda1:

mke2fs /dev/fd0
mount /dev/fd0 /mnt
mkdir /mnt/etc /mnt/boot /mnt/dev
cp -a /dev/fd0 /dev/sda1 /mnt/dev
cp [kernel-image] /mnt/vmlinuz
gzip < [initrd-image] > /mnt/initrd

«Ø¥ß¤@­Ó¥]§t¤U­±¤º®eªº /mnt/etc/lilo.conf ÀÉ®×:

boot=/dev/fd0
compact
image=/vmlinuz
    label=linux
    initrd=/initrd
    read-only
    root=/dev/sda1

³Ì«á¡A°õ¦æ lilo ¦p¤U:

lilo -r /mnt

·í lilo ³Q°õ¦æ®É°t¦X¨Ï¥Î -r ¿ï¶µ¡A¥¦·|°µ©Ò¦³»P³Q«ü©wªº®Ú ¥Ø¿ýªº¬ÛÃö°Ê§@¡C ¦b /mnt/dev ùثإ߳]³ÆÀɮתº²z¥Ñ¬O¡A ·í¥¦¬O¦b´À¥Nªº®Ú¥Ø¿ý¼Ò¦¡¤U lilo ¨ÃµLªk¨Ï¥Î¦b /dev ¤º ªºÀɮסC

¦w¸Ë initrd ¬M¶HÀɨì«DLinux ºÏºÐ¤º

initrd ¥\¯à¤@¯ë³£¨Ï¥Î¦b·í¤º³¡ªºµwºÐ¾÷³Q¤À¬£µ¹¨ä¥Lªº§@·~¨t²Î¨Ï¥Î®É ¡C Linux ®Ö¤ß¥H¤Î initrd ¬M¹³ÀÉ¥i¥H³Q©ñ¦b«D Linux ªººÏ°Ï¤À³Î¤º¡A ¦Ó¥B lilo ©Î¬O LOADLIN ¥i¥H³Q³]©w¥Ñ³o¨Ç¬M¹³ÀɨӶ}±Ò Linux ¨t²Î¡C

°²³]§A¦³­Ó¤w³Q«Øºc¦n¦X¾Aªº®Ú³]³Æ¡A¥B initrd ¬M¹³ÀɳQ«Ø¥ß¦b¥t¥~ªº¨t ²Î¤W¤F¡A±Ò°Ê Linux ¨t²Îªº³Ì®e©ö¤èªk¬O¨Ï¥Î LOADLIN¡A¦p¤U:

LOADLIN <kernel> initrd=<initrd-image>

¤@¥¹§A¥i¥H¦b§Aªº¥Ø¼Ð¾÷¾¹¤W±Ò°Ê Linux¡A §A´N¥i¥H¦w¸Ë lilo ¨Ó¤¹ ³\ª½±µ¦a±Ò°Ê Linux ¤F¡C ¨Ò¦p¡A°²³] /dev/hda1 ¬O­Ó«D Linux ªº¥Ø¼ÐºÏ°Ï¤À³Î¡A¥B /mnt ¥i¥H³Q¥Î°µ¬°±¾¤JÂI¡C ­º¥ý¡A¦b¥Ø¼Ð ºÏ°Ï¤À³Î¤W«Ø¥ß¤@­Ó©ñ Linux Àɮתº¤l¥Ø¿ý:

mount /dev/hda1 /mnt
mkdir /mnt/linux
cp [kernel-image] /mnt/linux/vmlinuz
cp [initrd-image] /mnt/linux/initrd

¦b³o­Ó¨Ò¤l¤¤¡A °²³] /dev/sda1 ¬O§Ú­Ì­n°µ¬° Linux ®Ú¤À³Îªº ºÏºÐ¡A ¥¦¬O­Ó¸g¥Ñ PCMCIA SCSI ¥d©Ò±¾¤Wªº SCSI µwºÐ¾÷¡C ­n¦w¸Ë lilo¡A½Ð«Ø¥ß¤@­Ó¦³¥H¤U¤º®eªº lilo.conf ÀÉ:

boot=/dev/hda
map=/mnt/linux/map
compact
image=/mnt/linux/vmlinuz
        label=linux
        root=/dev/sda1
        initrd=/mnt/linux/initrd
        read-only
other=/dev/hda1
        table=/dev/hda
        label=windows

¦b boot= ³o¦æùØ»¡­n¦b«ü©wªº³]³Æ¤§¥D¶}¾÷°O¿ý MBR( master boot record) ùئw¸Ë¶}¾÷¸ü¤Jµ{¦¡¡C root= ³o¦æ«ü¥X¦b¸ü¤J initrd ¬M¹³ ÀÉ«á»Ý­n¨Ï¥Îªº®ÚÀɮרt²Î¡A¦pªG®Ö¤ß¬M¹³ÀÉùؤw³o»ò«Øºc¤F¨º´N¤£»Ý³o»ò °µ¤F¡C ¦b other= ¨º¦æ¬O¥Î¨Ó´y­z»¡¦³¨ä¥Lªº§@·~¨t²Î³Q¦w¸Ë¦b /dev/hda1 ùØ¡C

­n¦w¸Ë³o­Ó¨Ò¤lùتº lilo ¡A¨Ï¥Î:

lilo -C lilo.conf

°O±o¦b³o­Ó®×¤lùØ¡Alilo.conf ÀɮרϥΤF¥]¬A /mnt ¦b¤º ªºµ´¹ï¦ì§}¡C§Ú¥Î³o­Ó¨Ò¤lªº­ì¦]¬O¥Ø¼ÐÀɮרt²Î¨Ã¤£¤@©w¤ä´©¨Ï¥Î boot= ©M root= ¿ï¶µ¨Ó«Ø¥ß Linux ³]³ÆÀɮתº«Ø¥ß¡C


Next Previous Contents