5.3. ·Î´õ: ºÎÆ®½ºÆ®·¦ÀÇ ¼¼¹øÂ° ´Ü°è

·Î´õ´Â ºÎÆ®½ºÆ®·¦ÀÇ ¼¼ ´Ü°è Áß ¸¶Áö¸· ´Ü°èÀ̸ç, ÆÄÀϽýºÅÛ À§¿¡ À§Ä¡Çϰí ÀÖ½À´Ï´Ù. º¸Åë /boot/loader»ó¿¡ Á¸ÀçÇϰí ÀÖ½À´Ï´Ù.

The loader is the final stage of the three-stage bootstrap, and is located on the filesystem, usually as /boot/loader.

Note: /boot/boot0, /boot/boot1, /boot/boot2 ÆÄÀϵéÀÌ ±×°÷¿¡ ÀÖÁö¸¸, ÀÌ·¯ÇÑ ÆÄÀϵéÀÌ MBR, ºÎÆ® ¼½ÅÍ, ¶Ç´Â disklabelÀÇ ½ÇÁ¦ÀûÀÎ º¹»çº»Àº ¾Æ´Õ´Ï´Ù.

While /boot/boot0, /boot/boot1, and /boot/boot2 are files there, they are not the actual copies in the MBR, the boot sector, or the disklabel respectively.

·Î´õ´Â »ç¿ëÀÚ¿¡°Ô Ä£¼÷ÇÑ ¼³Á¤ ±â´É°ú »ç¿ëÇϱ⠽¬¿î ³»Àå ¸í·É¾îµé, º¸´Ù °­·ÂÇÑ ÀÎÅÍÇÁ¸®Åͳª ´õ º¹ÀâÇÑ ¸í·É¾îµé·Î ¹é¾÷µÉ ¼ö ÀÖµµ·Ï ¸¸µé¾îÁ³½À´Ï´Ù.

The loader is intended as a user-friendly method for configuration, using an easy-to-use built-in command set, backed up by a more powerful interpreter, with a more complex command set.

5.3.1. ·Î´õ ÇÁ·Î±×·¥ÀÇ ¼öÇà °úÁ¤

ÃʱâÈ­ °úÁ¤ Áß¿¡ ·Î´õ´Â Äְܼú µð½ºÅ©¸¦ ŽÁöÇÏ°í ¾î¶² µð½ºÅ©·ÎºÎÅÍ ºÎÆÃÀ» ¼öÇàÇÒ °ÍÀÎÁö¸¦ ¾Ë¾Æ³À´Ï´Ù. ±×¿¡ µû¶ó º¯¼öµéÀ» ÁöÁ¤ÇÏ°Ô µÇ¸é ÀÎÅÍÇÁ¸®ÅͰ¡ ¼öÇàµÇ°í, ÀÎÅÍÇÁ¸®ÅÍ´Â »ç¿ëÇϱ⠽¬¿î ¸í·É¾îµéÀ» ÇØ¼®ÇÏ¿© ·Î´õ·Î º¸³À´Ï´Ù.

During initialization, the loader will probe for a console and for disks, and figure out what disk it is booting from. It will set variables accordingly, and then the interpreter is started, and the easy-to-use commands are explained to it.

±×·± ÈÄ, ·Î´õ´Â /boot/loader.rcÀ» ÀÐ°Ô µË´Ï´Ù. ÀÌ ÆÄÀÏÀº /boot/defaults/loader.conf - ±âº»ÀûÀÎ º¯¼ö °ªµé¿¡ ´ëÇÑ ¼³Á¤À» ´ã°í ÀÖ´Â ÆÄÀÏ - ¿¡¼­ ÁöÁ¤ÇÑ ÆÄÀÏÀÔ´Ï´Ù. ±×¸®°í /boot/loader.conf¸¦ Àо ±×·¯ÇÑ º¯¼öµé¿¡ ´ëÇÑ °ªÀ» ÁöÁ¤ÇÏ°Ô µË´Ï´Ù. loader.rcÀº ÀÌ·¯ÇÑ º¯¼öµé¿¡ ÀÇÇØ¼­ ÀÛµ¿Çϸç, ¼±ÅÃµÈ Ä¿³Î°ú ¸ðµâµéÀ» ÀоîµéÀÔ´Ï´Ù.

loader will then read /boot/loader.rc, which by default reads in /boot/defaults/loader.conf which sets reasonable defaults for variables and reads /boot/loader.conf for local changes to those variables. loader.rc then acts on these variables, loading whichever modules and kernel are selected.

¸¶Áö¸·À¸·Î ·Î´õ´Â 10Ãʰ£ÀÇ Å° ÀÔ·ÂÀ» ±â´Ù¸³´Ï´Ù. - ÀÌ ÀÛ¾÷Àº ±âº»À¸·Î ÇàÇØÁý´Ï´Ù. ±×¸®°í ÀÎÅÍ·´Æ®°¡ °É¸®¸é Ä¿³Î·Î ºÎÆÃÇÕ´Ï´Ù. ÀÎÅÍ·´Æ®°¡ °É¸®¸é »ç¿ëÀÚ°¡ »ç¿ëÇϱ⠽¬¿î ¸í·É¾îµéÀ» »ç¿ëÇÒ ¼ö ÀÖ´Â ¸í·É ÇÁ·ÒÇÁÆ®°¡ ¶å´Ï´Ù. ¿©±â¼­ »ç¿ëÀÚ´Â ¸ðµâÀ» ·ÎµåÇϰųª ¾ð·ÎµåÇϰí, º¯¼öµéÀ» Á¶Á¤Çϰí, ºÎÆÃ ¶Ç´Â ¸®ºÎÆÃ ÀÛ¾÷À» ¼öÇàÇÒ ¼ö ÀÖ½À´Ï´Ù.

Finally, by default, the loader issues a 10 second wait for keypresses, and boots the kernel if it is interrupted. If interrupted, the user is presented with a prompt which understands the easy-to-use command set, where the user may adjust variables, unload all modules, load modules, and then finally boot or reboot.

ÀÌ °úÁ¤¿¡ ´ëÇÑ º¸´Ù ±â¼úÀûÀÎ »çÇ×µéÀº loader(8)¿¡¼­ ã¾Æº¼ ¼ö ÀÖ½À´Ï´Ù.

A more technical discussion of the process is available in loader(8)

5.3.2. ·Î´õÀÇ ³»Àå ¸í·É¾îµé

»ç¿ëÇϱ⠽¬¿î ¸í·É¾îµéÀº ´ÙÀ½°ú °°ÀÌ ÀÌ·ç¾îÁ® ÀÖ½À´Ï´Ù.:

autoboot seconds

ÁÖ¾îÁø ½Ã°£ ³»¿¡ ÀÎÅÍ·´Æ®°¡ °É¸®Áö ¾ÊÀ¸¸é(»ç¿ëÀÚ°¡ ۸¦ ´©¸£Áö ¾ÊÀ¸¸é) Ä¿³ÎÀ» ºÎÆÃ½Ãŵ´Ï´Ù. ÀÌ ½Ã°£Àº ÃÊ ´ÜÀ§À̸ç, Ä«¿îÆ®´Ù¿îÀ» Ç¥½ÃÇÏ°Ô µË´Ï´Ù. ±âº»°ªÀº 10ÃÊ·Î ÁöÁ¤µÇ¾î ÀÖ½À´Ï´Ù.

Proceeds to boot the kernel if not interrupted within the time span given, in seconds. It displays a countdown, and the default timespan is 10 seconds.

boot [-options] [kernelname]

ÁÖ¾îÁø ¿É¼ÇÀ» ¹ÙÅÁÀ¸·Î ¹Ù·Î Ä¿³Î ºÎÆÃ ÀÛ¾÷À» ¼öÇàÇÕ´Ï´Ù. ¾î¶² ¿É¼ÇÀÌ ÁÖ¾îÁöµç, ÁÖ¾îÁø À̸§ÀÇ Ä¿³ÎÀÌ Á¸ÀçÇÑ´Ù¸é ºÎÆÃ ÀÛ¾÷Àº ¼öÇàµË´Ï´Ù.

Immediately proceeds to boot the kernel, with the given options, if any, and with the kernel name given, if it is.

boot-conf

ºÎÆ®½Ã¿¡ ³ªÅ¸³ª´Â °Í°ú °°Àº º¯¼öµé¿¡ ±âÃÊÇØ¼­ ¸ðµâµéÀ» ÀÚµ¿À¸·Î ±¸¼ºÇϵµ·Ï ÇÕ´Ï´Ù. ÀÌ´Â unload¸í·ÉÀ» ¸ÕÀú »ç¿ëÇÏ°í ¾î¶² °ªµéÀ» º¯°æÇßÀ» ¶§ - ÁÖ·Î kernel °ª - ¼öÇàµË´Ï´Ù.

Goes through the same automatic configuration of modules based on variables as what happens at boot. This only makes sense if you use unload first, and change some variables, most commonly kernel.

help [topic]

/boot/loader.help¿¡¼­ µµ¿ò¸» ¸Þ¼¼Áö¸¦ Àо È­¸é¿¡ Ç¥½ÃÇÕ´Ï´Ù. ¸¸¾à ¿äûÇÑ »çÇ×ÀÌ indexÀÎ °æ¿ì¿¡´Â °¡´ÉÇÑ »çÇ׿¡ ´ëÇÑ ¸ñ·ÏÀ» Ãâ·ÂÇÕ´Ï´Ù.

Shows help messages read from /boot/loader.help. If the topic given is index, then the list of available topics is given.

include filename ...

ÁÖ¾îÁø ÆÄÀϸíÀÇ ÆÄÀÏÀ» ¼öÇàÇÕ´Ï´Ù. ÀÌ ÆÄÀÏÀº Çà ´ÜÀ§·Î ÀÐÇôÁö°í ¼öÇàµË´Ï´Ù. ¿¡·¯°¡ ¹ß»ýÇÏ´Â °æ¿ì¿¡´Â ÀÌ ¸í·ÉÀº ±× Áï½Ã Áߴܵ˴ϴÙ.

Processes the file with the given filename. The file is read in, and interpreted line by line. An error immediately stops the include command.

load [-t type] filename

Ä¿³Î, Ä¿³Î ¸ðµâ, ¶Ç´Â ÁÖ¾îÁø À̸§ ¶Ç´Â À¯ÇüÀÇ ÆÄÀÏÀ» ·ÎµåÇÕ´Ï´Ù. ÆÄÀÏ¸í µÚ¿¡ ÁÖ¾îÁö´Â ÀμöµéÀº ÇØ´ç ÆÄÀÏ·Î ³Ñ¾î°©´Ï´Ù.

Loads the kernel, kernel module, or file of the type given, with the filename given. Any arguments after filename are passed to the file.

ls [-l] [path]

ÁÖ¾îÁø °æ·Î ¾È¿¡ ÀÖ´Â ÆÄÀϵéÀÇ ¸ñ·ÏÀ» Ãâ·ÂÇÕ´Ï´Ù. ¸¸¾à °æ·Î¸íÀÌ ÁÖ¾îÁöÁö ¾ÊÀ¸¸é ·çÆ® µð·ºÅ丮 ¾ÈÀÇ ÆÄÀϵéÀ» Ãâ·ÂÇÕ´Ï´Ù. -l ÀÌ ÁÖ¾îÁö¸é ÆÄÀÏÀÇ Å©±âµµ ÇÔ²² Ç¥½ÃµË´Ï´Ù.

Displays a listing of files in the given path, or the root directory, if the path is not specified. If -l is specified, file sizes will be shown too.

lsdev [-v]

¸ðµâÀ» ¿Ã¸± ¼ö ÀÖ´Ù°í ÆÇ´ÜµÇ´Â ÀåÄ¡µéÀÇ ¸ñ·ÏÀ» Ç¥½ÃÇÕ´Ï´Ù. -v ¿É¼ÇÀÌ ÁÖ¾îÁö¸é »ó¼¼ »çÇ×µéÀÌ ÇÔ²² Ãâ·ÂµË´Ï´Ù.

Lists all of the devices from which it may be possible to load modules. If -v is specified, more details are printed.

lsmod [-v]

·ÎµåµÈ ¸ðµâµéÀÇ ¸ñ·ÏÀ» Ç¥½ÃÇÕ´Ï´Ù. ¸¸¾à -v¿É¼ÇÀÌ ÁÖ¾îÁö¸é »ó¼¼ »çÇ×µéÀÌ ÇÔ²² Ãâ·ÂµË´Ï´Ù.

Displays loaded modules. If -v is specified, more details are shown.

more filename

ÁöÁ¤µÈ ÆÄÀÏÀÇ ³»¿ëÀ» Ãâ·ÂÇÕ´Ï´Ù. Ãâ·ÂµÇ´Â °¢ LINES¸¶´Ù Ãâ·ÂÀÌ ¸ØÃß¾îÁý´Ï´Ù.

Note: Ä¿¸Çµå »óÀÇ more¿Í °°Àº ±â´ÉÀÔ´Ï´Ù.

Display the files specified, with a pause at each LINES displayed.

reboot

½Ã½ºÅÛÀ» ¹Ù·Î ¸®ºÎÆÃÇÕ´Ï´Ù.

set variable, set variable=value

·Î´õÀÇ È¯°æ º¯¼ö¿¡ ´ëÇÑ °ªÀ» ÁöÁ¤ÇÕ´Ï´Ù.

unload

·ÎµåµÈ ¸ðµç ¸ðµâÀ» Áö¿ó´Ï´Ù.

5.3.3. ·Î´õ ¿¹½Ã

´ÙÀ½Àº ·Î´õ »ç¿ë¿¡ ´ëÇÑ ÀϹÝÀûÀÎ ¿¹Á¦µéÀÔ´Ï´Ù.