1992.4.29

SUBJECT: Solaris 2.x Boot and Run Levels

 * Boot and Run Levels


   1. Booting¿¡°ü·ÃµÈ °Íµé.


        SunOS 4.x¿Í ºñ±³ÇÏ¿© º¯È­ÇѰ͵éÀº ´ÙÀ½°ú °°´Ù.

         - ´õÀÌ»ó kernelÀ» ¸¸µé ÇÊ¿ä°¡ ¾ø´Ù.

         - deviceµéÀº óÀ½¿¡ openµÉ¶§ ÀÚµ¿À¸·Î loadµÇ±â¶§¹®¿¡,kernel memory ¼Òºñ¸¦ ÁÙÀ̰ԵȴÙ.

         - file systemÀº ´ÜÁö ÇÊ¿ä°¡ ÀÖÀ»¶§¸¸ checkµÇ±â¶§¹®¿¡ boot timeÀÌ ´õ »¡¶óÁø´Ù.

         - boot programÀÌ ¿Å°ÜÁ®µµ ´õÀÌ»ó booting½Ã error°¡ ¾ø´Ù.

        Solaris 2.0ÀÇ boot modelÀº UNIX Software Laboratories(USL)ÀÇ ÀϹÝÀûÀÎ SVR4 ¹æ¹ý°ú´Â ´Ù¸£´Ù.

        Solaris 2.0ÀÇ modelÀº SPARC systemÀ» À§ÇØ ´õ Àû´çÇÑ modelÀÌ´Ù.

        ÇÏÁö¸¸,Solaris 2.0Àº SVR4ÀÇ bootÀýÂ÷¸¦ µû¸¥´Ù.

        ¿¹¸¦µé¸é,process control°ú system°ü¸®´Â ÀϹÝÀûÀÎ SVR4¿Í °ÅÀÇ °°´Ù.


   2. SunOS 4.x¿Í Solaris 2.0ÀÇ ÁÖ¿äÂ÷ÀÌ


      2°¡Áö °üÁ¡¿¡¼­ Å« Â÷ÀÌ°¡ ÀÖ´Ù.

      1) boot modelÀÌ °³¼±µÊ.

         (1) self-configuring kernel

         (2) loadable kernel modules

         (3) autoloading drivers

      2) ÀüÅëÀûÀÎ SVR4¸¦ Àû¿ë

         (1) system run level

         (2) logical device names


   3. Self-configuring kernel


      Solaris 2.0 kernelÀº small static core ¿Í ¸¹Àº dynamically loadable kernel moduleµé·Î ±¸¼ºµÈ´Ù.

      ¸¹Àº kernel moduleµéÀº booting½Ã ÀÚµ¿ÀûÀ¸·Î loadµÈ´Ù.

      booting½Ã¿¡ ÇÊ¿ä¾ø´Â device´Â ±× device°¡ »ç¿ëµÉ¶§ ÀÚµ¿À¸·Î addµÈ´Ù.

      Solaris 2.0Àº static kernelÀ» ¸¸µé ÇÊ¿ä°¡ ¾ø´Ù.

      ±×·¯¹Ç·Î,third partyµé¿¡¼­  ¸ðµç kernel level code,device drive,STREAMS moduleµé°ú ´Ù¸¥ kernel level 

      code´Â loadable moduleµéÀ» Á¦°øÇÏ¿©¾ß ÇÑ´Ù. 

      ÀÛÀº static core´Â /kernelÇÏ¿¡ ÀְԵǰí , unix¶ó°í ºÒ¸®¿î´Ù.

      /etc/systemÀº booting½Ã ÀÚµ¿ÀûÀ¸·Î loadµÇ´Â °Í°ú µÇÁö¾Ê´Â °ÍÀ» ¹«½ÃÇÏ¿© »ç¿ëµÇ´Â kernel configuration 

      fileÀÌ´Ù. ( SunOS 4.x¿¡¼­ÀÇ param.c function°ú ºñ½ÁÇÏ´Ù )


   4. Directory layout

      - the kernel directory

        
     /kernel --------- /drv    ( Drivers ) - device drivers & pseudo drivers

                       /exec   ( exeec() modules ) - ELF , a.out

                       /fs     ( file systems ) - ufs , nfs , proc , fifo , etc

                       /misc   ( miscellaneous modules ) 

                       /sched  ( scheduling classes ) - schedulong classes & dispatch tables

                       /strmod ( STREAMS modules ) 

                       /sys    ( loadable system calls ) - system accounting & semaphore operations


   5. Bootprom differences


      1) no new bootproms required

         bootfileÀº À̸§Àº /kernel/unixÀÌ´Ù.

      2) new boot options

         »õ·Î¿î hardware¸¦ ºÙÀ϶§,»ç¿ëÀÚ´Â reconfigureÀ» ÇÏ·Á¸é -r optionÀ» »ç¿ëÇÏ¿©¾ß ÇÑ´Ù.

         logical device nameÀº physical device name¿¡·Î linkµÈ´Ù.
        
      3) booting½Ã¿¡´Â booting¿¡ °ü·ÃµÈ message°¡ defaults·Î´Â ³ª¿ÀÁö ¾Ê´Â´Ù.

         ¸¸¾à »ç¿ëÀÚ°¡ booting½Ã¿¡ message°¡ ³ª¿À°ÔÇÏ·Á¸é -v optionÀ» »ç¿ëÇÏ¿©¾ß ÇÑ´Ù.

         diagnoticÀ» À§Çؼ­´Â -b optionÀ» »ç¿ëÇÏ¿©¾ß ÇÑ´Ù.

      4) Bootprom differences

         (1) Solaris 2.0¿¡¼­´Â »õ·Î¿î PROMÀÌ ¿ä±¸µÇÁö ¾Ê´Â´Ù.

         (2) PROM systemÀÇ boot parameter°¡ º¯ÇÏ¿´´Ù.

             ok setenv boot-device /sbus/esp@0,800000/sd@0,0

             ok setenv boot-file /kernel/unix

         (3) 3°¡Áö »õ·Î¿î options

             reconfigure ---- boot -r

             verbose -------- boot -v

             minimum boot --- boot -b

   6. System run state differences

      SunOS 4.X´Â µÎ°¡Áö »óÅ Áï,single °ú multiuserÀÇ »óÅ·Π±¸ºÐµÇ³ª,Solaris 2.0Àº 8°¡Áö »óÅ·Π±¸ºÐµÇÁö¸¸

      ½ÇÁ¦ÀûÀ¸·Î´Â halt , single user , multiuser , rebootÀÇ 4°¡Áö »óŸ¦ °¡Áø´Ù.

      Run level 1 Àº SunOS 4.XÀÇ single mode¿Í °°´Ù.

      Run level 3 ´Â SunOS 4.XÀÇ multiuser mode¿Í °°´Ù.

   7. Run state comparison

      who -rÀº Áö±Ý runµÇ°í ÀÖ´Â system levelÀ» º¸¿©ÁØ´Ù.

      ÀϹÝÀûÀÎ SVR4´Â Solaris 2.0°ú ¼¼°¡Áö °æ¿ì¿¡¼­ ´Ù¸£´Ù.

      1) run level 0 ´Â prom monitor»óŸ¦ ³ªÅ¸³ª°Ô µÈ´Ù.

      2) run level 2´Â file systemÀ» exportÇÏÁö´Â ¾ÊÁö¸¸,networkÀ» ÀÌ¿ëÇÏ¿© bootingÀÌ °¡´ÂÇÏ°Ô ÇÑ´Ù.

      3) run level 3´Â file systemÀ» exportÇÑ´Ù.

      * Run state ºñ±³

        Run state    Solaris 2.0 action                  SVR4 action
        ---------  ----------------------           ------------------------
         s , S     single user mode                   single user mode

           0       PROM Monitor level                 Power off

           1       single user mode:                  single user mode:
                   Root & user mounted                system admin mode

           2       Multi user mode:                   Multi user mode:
                   No Resources exported              Network disabled

           3       Multi user mode:                   Multi user mode:
                   Machine Resources exported         Network enabled

           4       Not currently used                 Not currently used

           5       PROM Monitor level                 PROM Monitor level

           6       Halt and reboot to default state   Halt and reboot to default state


   8. Device Name differences

      device´Â device¿Í logical name¿¡ À¯ÀÏÇÏ°Ô µ¿ÀÏÈ­µÇ´Â physical device nameÀ» °¡Áø´Ù.

      UNIX command´Â logical nameÀ» »ç¿ëÇÑ´Ù.

      Solaris 2.0Àº System 5ÀÇ logical device nameµéÀ» Àû¿ëÇÏ¿´´Ù.

      1) ¿¹Á¦

        /dev/dsk/c0t0d0s6 = /dev/sd0g

        /dev/rmt/01 = /dev/rst0

      2) device´Â physical device name¿¡ symbolic linkµÇ¾îÀÖ´Ù.

        /dev/dsk/c0t0d0s6 --> /device/sbus@1,f8000000/esp@0,800000/sd@1,0:g

      3) SunOS 4.XÀÇ device nameÀº »ç¿ëÀÌ °¡´ÉÇÏ´Ù.

   9. Local UFS bootup sequence

      bootblock dhk  boot programÀÌ ´Ù¸£Áö¸¸,boot sequence stepÀº º»ÁúÀûÀ¸·Î´Â °°´Ù.

      »õ·Î¿î boot device¸¦ ´õÇÏ´Â °ÍÀº bootblock¿Í boot program¿¡¼­ ´Ù·ç¾îÁö´Â°ÍÀÌ ¾Æ´Ï¹Ç·Î ´õ ½±´Ù.

      bootblockÀº Sbus card»ó¿¡ ȤÀº bootprom¿¡¼­ ¹ß°ßµÇ´Â driverµéÀ» »ç¿ëÇÑ´Ù.

      ±×·¯¹Ç·Î,bootblockÀ̳ª boot programÀº »õ·Î¿î device¸¦ Áö¿øÇϱâÀ§ÇØ ´õÀÌ»ó »õ·Î ¸¸µé¾îÁöÁö ¾Ê¾ÆµµµÈ´Ù.

      * UFS¸¦ bootblock programÀÌ ¾î¶»°Ô Àд°¡ ?

        1.promÀÌ boot block¿¡¼­ ÀÐÀ½.

        2.bootblock(ufsbootblk)ÀÌ boot program¿¡¼­ ÀÐÀ½.

        3.boot program(ufsboot)ÀÌ kernel¿¡¼­ ÀÐÀ½.

        4.kernel9/kernel/unix)ÀÌ systemÀ» ÃʱâÈ­ÇÏ°í init¸¦ ½ÃÀÛ½ÃÅ´.

        5./sbin/init°¡ /etc/inittab¸¦ Àаí,rc script¸¦ ½ÃÀÛÇÔ.

   10. Network Bootup sequence

       1) inetboot

          network bootingÀº ±âº»ÀûÀ¸·Î °°´Ù.

          ´Ù¸¥°ÍÀº ufsboot¿¡¼­ ºñ½ÁÇÑ ±â´ÉÀ» ¼öÇàÇÏ´Â programÀÌ inetboot¶ó°í ºÒ¸®¿ì´Â °ÍÀÌ´Ù.

          inetboot´Â kernelÀÌ ÀڽŠ¹× ´Ù¸¥ moduleµéÀ» ÃæºÐÈ÷ ÃʱâÈ­ ÇÒ¶§±îÁö kernel,unix,load module¸¦ 

          µ½´Â´Ù.

          root file systemÀÌ mountµÇ¸é kernelÀº ´õÀÌ»ó inetboot¸¦ ÇÊ¿ä·ÎÇÏÁö ¾Ê´Â´Ù.

          * diskless bootingÀº SunOS 4.X¿Í °ÅÀÇ °°´Ù.
         
          * bootp = Internet RFC for booting

            
                     server                                diskless client

                                             RARP
             RARP server sends IP address  <-------   prom broadcasts RARP request
                                            ------->

                                              TFTP
             TFTP server sends inetboot     <-------  prom makes TFTP request
                                             ------->

                                              whoami
             root server sends hostname     <-------  inetboot gets IP address & issues
             & domainname                    -------> bootparams "whoami"
             (root server = bootparams)

                                              getfile
             root server sends pathname to   <-------  inetboot makes bootparams "getfile"
             client's root partition & name   -------> request
             of its server

                                                NFS
             root server sends kernel(unix)   <------  inetboot makes NFS mount request and
                                               ------> reads in unix

         2) init and /etc/inittab

            (1) init

              init´Â ÀϹÝÀûÀÎ process spawnerÀÌ´Ù.

              ±×°ÍÀÇ ÁÖ¿ä ¿ªÈ°Àº /etc/inittab file¿¡ ÀúÀåµÈ Á¤º¸·ÎºÎÅÍ process¸¦ ¸¸µå´Â °ÍÀÌ´Ù.

              UNIX°¡ bootµÉ¶§ init°¡ ¸¸µé¾îÁö°ÔµÇ°í,init´Â /etc/inittab fileÀ» Á¶»çÇϰԵȴÙ.

              /etc/inittab fileÀÇ entry´Â systemÀÌ bootingÇÒ¶§ °¡Áö°ÔµÇ´Â run levelÀ» ¾Ë·ÁÁØ´Ù.

              SUN system¿¡¼­ ÀÌ°ÍÀº run level 3¸¦ ¸»Çϴ°ÍÀÌ´Ù.

              * initÀÇ ÁÖ¿äÀÓ¹«´Â default run levelÀ» °¡Á®¿À´À °ÍÀÌ´Ù.

              *  /etc/inittab fileÀº init¿¡°Ô ´ÙÀ½À» ¾Ë·ÁÁØ´Ù.

                 1.default run level
                 2.process to start
                 3.process to monitor and restart if they die

               * init´Â /etc/inittab¸¦ ´Ù½Ã Àаí,run level¿¡ ÀÇÁ¸ÇÏ´Â rc script¸¦ runÇÏ´Â »óŵé»çÀÌ¿¡¼­
                 transitionÀ» Á¶Á¤ÇÑ´Ù. 

             (2) inittab

                 ù¹ø° field´Â entry¸¦ Áõ¸íÇϴµ¥ »ç¿ëµÇ´Â 2 letter characterÀÌ´Ù.

                 µÎ¹ø° field´Â ÀÌ process°¡ init¿¡ÀÇÇØ ¸¸µé¾îÁö´Â run levelÀ» ¸í½ÃÇÑ´Ù.

                 action field´Â process¸¦ ¾î¶»°Ô ´Ù·ç¾î¾ßÇÏ´ÂÁö¸¦ init¿¡°Ô ¾Ë¸°´Ù.

                 process field´Â ¹ß»ýµÇ´Â command¿Í ±×commandÀÇ arguments·Î ±¸¼ºµÈ´Ù.

                 * /etc/inittab

                   ex) s3:3:wait:/sbin/rc3  > /dev/console 2>&1  s3 : id¸¦ ³ªÅ¸³½´Ù.(ù¹ø° field)
                        
                             3 : rstate¸¦ ³ªÅ¸³½´Ù.(µÎ¹ø° field)

                            wait : actionÀ» ¸»ÇÑ´Ù (action field)

                            /sbin/rc3 : process¸¦ ³ªÅ¸³½´Ù(process field)

 
                    ex) /etc/inittab

                    ap::sysinit:/sbin/autopush -f /etc/iu.ap
                    fs::sysinit:/sbin/bcheckrc > /dev/console 2>&1 /dev/consile2>&1 /dev/consile2>&1 /dev/consile2>&1   /sbin/autopush
                                    |
                                    |
                                    V 

                              /sbin/bcheckrc
                                    |
                                    |
                                    V 
  
                              /sbin/rc2    -------------------->  /etc/rc2.d/K*,S*
                                    |
                                    |
                                    V
                              /sbin/rc3    -------------------->  /etc/rc3.d/K*,S*
                                    |
                                    |                              S10syslog      S20nis
                                    V                              S15nfs.server  S20rfs

                               /usr/lib/saf/sac
                                    |
                                    |
                                    V

                               /usr/lib/saf/ttymon

   11. shutdown process

       init¿Í telinit command´Â control process¸¦ ÃʱâÈ­Çϰųª run state levelÀ» º¯°æÇÒ¶§ »ç¿ëµÈ´Ù.

       init 0  ¿Í telinit 0 ´Â  ½Ã½ºÅÛÀ» Á¤Áö½ÃÅ°°í prom monitor¿¡ controlÀ» ÁÖ°ÔÇÑ´Ù.

       init 1 °ú telinit 1Àº ½Ã½ºÅÛÀ» single user»óÅ·Π¸¸µé°í ¸ðµç ½Ã½ºÅÛÀº mountµÇ°í,¾î¶² »ç¿ëÀÚµµ 

       loginÇÒ¼ö¾ø°ÔµÈ´Ù.

       * SunOS ¿Í Solaris 2.0ÀÇ ºñ±³

        SunOS 4.X command         Solaris 2.0 command
        ------------------        -------------------

             halt                 halt,int0,telinit0,init5 or telinit 5

             fasthalt             init 0,telinit 0,init 5,telinit 5

             reboot               reboot,init 6,telinit 6

             kill -1 1            init q,init Q,telinit q,telinit Q

             shutdown             /usr/ucb/shutdown or /sbin/shutdown

    12. Modify system startup / shutdown

        system bootup sequence´Â bootingÀ» À§ÇØ ÇÊ¿äÇÑ kernel moduleÀÇ subsetÀ» ÀÚµ¿À¸·Î loadÇÑ´Ù.

        ±×¸®°í,/etc/inittab fileÀ» ¼öÁ¤ÇÏ¿© booting½ÃÀÇ ÀýÂ÷¸¦ º¯°æ°¡´ÉÇÏ´Ù.

        
    13. Loading Modules

        /etc/system fileÀ» ¼öÁ¤ÇÏ¿© booting½ÃÀÇ loadingÀ» º¯°æ°¡´ÉÇÏ´Ù.

        forceload command ´ÙÀ½ÀÇ entry Ãß°¡¸¦ ÇϸéµÈ´Ù.

        systemÀÌ runningµÇ´Â µ¿¾È¿¡ moduleÀ» loadÇϱâÀ§Çؼ­´Â modload command¸¦ ÀÌ¿ëÇÑ´Ù.

    14. Unloading modules

        /etc/system fileÀ» ¼öÁ¤ÇϸéµÈ´Ù.

        systemÀÌ runningµÇ´Â µ¿¾È¿¡´Â modunload command¸¦ »ç¿ëÇϸéµÈ´Ù.

        * Àý´ë  /kernel¿¡¼­ kernel moduleÀ» Áö¿ìÁö¸»¾Æ¾ßÇÑ´Ù.

        * loadingÀ» ¸·±âÀ§Çؼ­´Â /etc/system¿¡¼­ ´ÙÀ½°ú °°ÀÌ ÇϸéµÈ´Ù.

          exclude /kernel/fs/rfs

    15. Ways to change run states

        install S* , K* script¸¦ ¼öÁ¤ÇϸéµÈ´Ù.

        script´Â alphanumeric order·Î ÀÛµ¿µÈ´Ù.

    16. Summary of differences

        SunOS 4.X                Solaris 2.0                  Description
        ---------                -----------              ------------------------
   
         bootsd                   ufsbootblk              load ufsboot from disk

         boot                     ufsboot                 load unix from disk

         vmunix                   unix                    bootable kernel image

         boot.sun4c.sunos.4.1.1   inetboot                mount /usr and check file systems

         rc.local                 /etc/rc3 , /etc/rc3d/*  system config script

         /etc/config              modload,add_drv         modules loaded when needed

         single/multiuser         8 run states            system run levels

         /dev/sd1g                /dev/dsk/c0t01ds6       logical device names

         MAKEDEV                  boot -r                 make device nodes

evision History
Created                 on 29 Apr , 1992