ࡱ;   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Root Entry  !"#$%&'()+-./023456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno ®`VTextStarWriter 5.0}{:! SfxDocumentInfo Mike |1ѨMike |1Mike |1 Info 0 Info 1 Info 2 Info 3 |1Ѩ <44Standard LIBIMBEDDED LIBIMBEDDED TASK,0,1,H32,0,100,1,2368;133859;110;0;131453;14971;139757;0;0SW5HDR.0|1!Outline0 #ZOSWG, A<  #$%&'()*./0123456789:;<=>?@ABCDGHK  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFQRSTU0R'&@ TimesNewRomanX'@d X' @X'(!@. G'. XA'2*@'dxdxdxdXXJJ@NX@dPM' TimesNewRoman$' '(. . p. @ . . . . . P. . . !. $. `'. 0*. -. /. 2. p5. @8. ;. =. @. 6')(02 StandardStandard@ Text bodyStandard Text body2A'List Text bodyList'CaptionStandardCaption'' '2A'JJIndexStandardIndex'JJ FooterStandardFooter@('JJ<|?SBX sb Z Standard StarBASICSBX ARSBX AR SBX AR2c%bqqOh+'0 h t 9@r@-=@Ji@x!Mike Mike SW5HDR.0|1! Frameformat ZeichenformatTextformatvorlageStandard Text bodyListCaption IndexFooterRoot 10Standard  Illustration Table TextDrawingY  .Y  .Y  .Y .q= GeneralGeneraldNC#,###.00#,###.00SystemNC #,##0.00 CCC#,##0.00 CCCNC$#,##0.--;[RED]-$#,##0.-- $#,##0.---$#,##0.--REDNC$ MM/DD/YYYYMM/DD/YYYY def/SystemNC%MM/DD/YYMM/DD/YY def/SystemNC&NNNNMMMM DD, YYYYNNNNMMMM  DD, YYYYSystemNC' MMM D, YYMMM D, YY def/SystemNC. [HH]:MM:SS.00 [HH ]:MM:SS .00NC3MM/DD/YYYY HH:MM:SS MM/DD/YYYY HH :MM:SS  NCK MMM D, YYYYMMM D, YYYY def/SystemNCL MMMM D, YYYYMMMM  D, YYYY def/SystemNCM NN, MMM D, YYNN, MMM D, YY def/SystemNCNNN, MMMM D, YYYYNN, MMMM  D, YYYY def/SystemNCONNNNMMMM D, YYYYNNNNMMMM  D, YYYY def/SystemNCP D. MMM. YYYYD. MMM. YYYYDIN 5008 (EN 28601)NCQ D. MMMM YYYYD. MMMM  YYYYDIN 5008 (EN 28601)NCRMM-DDMM-DDDIN 5008 (EN 28601)NCSYY-MM-DDYY-MM-DDDIN 5008 (EN 28601)NCT YYYY-MM-DDYYYY-MM-DDDIN 5008 (EN 28601)NCUWWWWNCBXoeP<p5 2$99 SAP/=APdddAPddA PAu Prk FooterSYAPddADPN;T2SA @A0SAAP/=APdddAPddZSW5HDR.0|1C(569a(Build:5169)(SV569)]D!Address Book Fileaddress! Frameformat ZeichenformatTextformatvorlageStandard Text bodyListCaption IndexFooterRoot 10Standard  Illustration Table TextDrawingd f 71 4 5*jK standard.dic soffice.dicZsun.dic@ IgnoreAllListY  .Y  .Y  .Y .6NTCSystem Initialization (booting)SA A @T$SA A @T>Booting begins in the BIOSSA A @T<S1APdddA A @Tc'When the CPU reset signal is asserted, S1APdddA A @T{?the state of flags/CS/IP registers are set to predefined valuesS1APdddA A @TPreal mode is enteredS1APdddA A @T{?CS:IP is set to 0xf:fff0 -- this is the entry point to the BIOSS1APdddA A @T<S1APdddA A @Tz:The POST code is then executed and devices are initializedS'APdddA @A8:T<S1APdddA A @TZAfter POST boot devices are searched in order for a system to boot (order is configurable)S1APdddA A @TBfloppyS1APdddA A @TAcdromS1APdddA A @TI hard disk 1 S1APdddA A @T<S1APdddA A @TIf there is a disk in the drive, the first physical sector (512 bytes) is read into location 0x7c00 and a jump is made to that location. S1APdddA A @T<S1APdddA A @TThe first sector is typically referred to the boot sector or boot block on floppy and is called the master boot record (MBR) on a hard drive. S1APdddA A @T<S1APdddA A @TSSHAPdddACourierA A @T. +------------------------+SHAPdddACourierA A @T. 0x000 | |SHAPdddACourierA A @T. | Program code |SHAPdddACourierA A @T. | |SHAPdddACourierA A @T. | |SHAPdddACourierA A @T. |------------------------|SHAPdddACourierA A @T. 0x1BE | Partition table |SHAPdddACourierA A @T. | |SHAPdddACourierA A @T. |------------------------|SHAPdddACourierA A @T. 0x1FE | Magic number (0xAA55) |SHAPdddACourierA A @T1 +------------------------+ SHAPdddACourierA A @T<S1APdddA A @T<S1APdddA A @T<S1APdddA A @TMThe MBR contains S1APdddA A @TI a boot loaderS1APdddA A @Tb&the partition table (located at 0x1BE)S1APdddA A @Tc'a magic number (0x55aa at offset 0x1FE)S1APdddA A @T= S1APdddA A @Tt8In a Dos/Windows environment the boot loader in the MBR S1APdddA A @TCidentifies the active partition from a flag in the partition table S1APdddA A @Tu9loads the boot block from that partition and jumps to it.S1APdddA A @T<S1APdddA A @ToIn the Linux environment it is possible to install LILO in either the MBR or in the boot block of a partition. S1APdddA A @TSSHAPdddACourierA A @T5Dumping disk dataSA A @T$SA A @T@The dd command can be used to extract and write to the raw disk SA A @A8 A8 7A8 7?A8 ?@T.S#A  A A @T dd count=1 < /dev/hda > junkS1APdddA A @A8A8CourierTSSHAPdddACourierA A @TMThe od command can be used to format the data in a more or less readable way.S#A  A A @A8 TP,The block here starts with the instructions:SA A @T<S1APdddA A @T?cliS1APdddA A @TE jmp +0x7cS1APdddA A @T<S1APdddA A @Tw$[root@jmw7 westall]# od -t x1 < junkSHAPdddACourierA A @TSSHAPdddACourierA A @T70000000 fa eb 7c 6c 62 61 4c 49 4c 4f 01 00 15 04 5a 00SHAPdddACourierA A @T70000020 00 00 00 00 3a 24 e4 3a 4f 89 80 64 01 50 89 80SHAPdddACourierA A @T70000040 64 01 4e 89 80 64 01 01 44 5a 52 89 80 64 01 53SHAPdddACourierA A @T70000060 89 80 64 01 61 88 80 fd 01 62 88 80 fd 01 63 88SHAPdddACourierA A @T70000100 80 fd 01 64 88 80 fd 01 65 88 80 fd 01 66 88 80SHAPdddACourierA A @T70000120 fd 01 67 88 80 fd 01 68 88 80 fd 01 69 88 80 fdSHAPdddACourierA A @T70000140 01 6a 88 80 fd 01 6b 88 80 fd 01 00 00 00 00 00SHAPdddACourierA A @T70000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b8SHAPdddACourierA A @T70000200 c0 07 8e d8 8c 06 7a 00 89 36 78 00 89 1e 7c 00SHAPdddACourierA A @T70000220 88 16 7e 00 b8 00 9a 8e c0 b9 00 01 29 f6 29 ffSHAPdddACourierA A @T70000240 fc f3 a5 ea a8 00 00 9a 8e d8 b8 00 90 8e d0 bcSHAPdddACourierA A @T70000260 00 b0 fb b0 0d e8 69 00 b0 0a e8 64 00 b0 4c e8SHAPdddACourierA A @T70000300 5f 00 be 34 00 68 00 0b 07 31 db ad 91 ac a8 60SHAPdddACourierA A @T70000320 75 0f 4e ad 89 c2 09 c8 74 1c ac b4 02 cd 13 ebSHAPdddACourierA A @T70000340 0e 88 c2 ad f6 c2 20 75 02 30 e4 97 e8 3b 00 72SHAPdddACourierA A @T70000360 0f 80 c7 02 eb d5 b0 49 e8 26 00 ea 00 00 00 0bSHAPdddACourierA A @T70000400 b0 20 e8 1c 00 e8 06 00 31 c0 cd 13 eb b4 c1 c0SHAPdddACourierA A @T70000420 04 e8 03 00 c1 c0 04 24 0f 04 30 3c 3a 72 02 04SHAPdddACourierA A @T70000440 07 50 30 ff b4 0e cd 10 58 c3 56 51 53 88 d3 80SHAPdddACourierA A @T70000460 e2 8f f6 c3 40 75 33 bb aa 55 b8 00 41 cd 13 72SHAPdddACourierA A @T70000500 29 81 fb 55 aa 75 23 f6 c1 01 74 1e 5b 59 1e 31SHAPdddACourierA A @T70000520 f6 56 56 57 51 06 53 6a 01 6a 10 89 e6 16 1f b8SHAPdddACourierA A @T70000540 00 42 cd 13 8d 64 10 1f eb 44 5b 59 53 52 57 51SHAPdddACourierA A @T70000560 06 b4 08 cd 13 07 72 38 51 c0 e9 06 86 e9 89 cfSHAPdddACourierA A @T70000600 59 88 f0 fe c0 80 e1 3f f6 e1 96 58 5a 39 f2 73SHAPdddACourierA A @T70000620 23 f7 f6 39 f8 77 1d c0 e4 06 86 e0 92 f6 f1 feSHAPdddACourierA A @T70000640 c4 00 e2 89 d1 5a 5b 86 f0 b8 01 02 cd 13 5e c3SHAPdddACourierA A @T70000660 59 5f eb 02 b4 40 00 00 00 00 00 00 00 00 00 01SHAPdddACourierA A @T70000700 01 00 83 fe 7f 87 3f 00 00 00 49 17 60 00 00 00SHAPdddACourierA A @T70000720 41 88 83 fe 7f 8a 88 17 60 00 43 bc 00 00 00 00SHAPdddACourierA A @T70000740 41 8b 05 fe ff ff cb d3 60 00 37 d3 f3 01 00 00SHAPdddACourierA A @T70000760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aaSHAPdddACourierA A @TSSHAPdddACourierA A @TFS;APdddA PA A @T?Either way LILO consists of two components that work as followsS'APdddA @A8*T<S1APdddA A @TiThe first stage loader is contained in the boot block and loaded by the BIOS starting at address 0x7c00.S1APdddA A @T<S1APdddA A @TThis loader moves itself to location 0x9a000 and sets up a real mode stack at 0x9b000 with the capbility to grow down to 0x9a200. S'APdddA @A8T<S1APdddA A @THIt loads the second stage at location 0x9b000 just below VGA at 0xa0000S1APdddA A @T2S'APdddA @TPThe second stage loader is contained in the file boot.b typically found in /bootS1APdddA A @T<S1APdddA A @TIt reads the map file which describes where to find the OS's configured in LILO .conf and prompts the user for the OS to load. S1APdddA A @T<S1APdddA A @TI Loading LinuxS1APdddA A @T<S1APdddA A @Tu9The first-stage loader uses single sector transfers only,S1APdddA A @TGHowever, the second-stage loader attempts to use multisector transfers.S1APdddA A @TTLILO doesn't understand file systems.. It uses the BIOS to read components it loads.S1APdddA A @TGRaw disk addresses of the kernel components are stored in the map file S1APdddA A @A8 >AA8 AGT4How does the second stage loader read the map file??S;APdddA  A A @A8 *-To)Presumably stored in bootsector or boot.bS;APdddA  A A @T]SRAPdddACourierA  A A @Tt/boot ==> ls -l boot.b SRAPdddACourierA  A A @T>-rw-r--r-- 1 root root 5824 Aug 23 2000 boot.bSRAPdddACourierA  A A @Tu/boot ==> ls -l chain.b SRAPdddACourierA  A A @T?-rw-r--r-- 1 root root 612 Aug 23 2000 chain.bSRAPdddACourierA  A A @Tp/boot ==> ls -l mapSRAPdddACourierA  A A @T;-rw------- 1 root root 49152 Jul 15 2001 mapSRAPdddACourierA  A A @Tg /sbin/liloSRAPdddACourierA  A A @Ts/boot ==> ls -l boot.bSRAPdddACourierA  A A @T>-rw-r--r-- 1 root root 5824 Aug 23 2000 boot.bSRAPdddACourierA  A A @Tt/boot ==> ls -l chain.bSRAPdddACourierA  A A @T?-rw-r--r-- 1 root root 612 Aug 23 2000 chain.bSRAPdddACourierA  A A @Tp/boot ==> ls -l mapSRAPdddACourierA  A A @T;-rw------- 1 root root 49152 Apr 22 10:53 mapSRAPdddACourierA  A A @TFS;APdddA  A A @Te)"Floppy boot sector" is loaded at 0x90000S1APdddA A @Te)Real mode setup code is loaded at 0x92000S1APdddA A @T<S1APdddA A @Tv:These blocks are defined in /usr/src/linux/arch/i386/boot/S1APdddA A @TF bootsect.SS1APdddA A @TCsetup.SS1APdddA A @T<S1APdddA A @TibzImage is loaded at 0x100000SAAPdddA A@ddA @TAccording to the LILO docs the fd bootsector is only used as a source of setup info when booting from the hdd. Presumably this is the information:S;APdddA PA A @T<S1APdddA A @Tx%414 # XXX: This is a fairly snug fit.SHAPdddACourierA A @TW415 SHAPdddACourierA A @T_ 416 .org 497SHAPdddACourierA A @Tw$417 setup_sects: .byte SETUPSECTSSHAPdddACourierA A @Tx%418 root_flags: .word ROOT_RDONLYSHAPdddACourierA A @Tt!419 syssize: .word SYSSIZESHAPdddACourierA A @Tu"420 swap_dev: .word SWAP_DEVSHAPdddACourierA A @Tt!421 ram_size: .word RAMDISKSHAPdddACourierA A @Tv#422 vid_mode: .word SVGA_MODESHAPdddACourierA A @Tu"423 root_dev: .word ROOT_DEVSHAPdddACourierA A @Ts 424 boot_flag: .word 0xAA55SHAPdddACourierA A @TSSHAPdddACourierA A @TJAfter loading setup.s and the kernel the 2nd stage boot loader jumps to setup whose functions include a variety of hardware specific tasks that must be performed in real mode via calls to the bios.SNAPdddA TimesNewRomanA A @A8*,:eA8 A8 TYSNAPdddA TimesNewRomanA A @TV3 *SHAPdddACourierA A @T?4 * setup.s is resp. for getting the system data from the BIOS,SHAPdddACourierA A @TB5 * and putting them into the appropriate places in system memory.SHAPdddACourierA A @T=6 * both setup.s and system has been loaded by the bootblock.SHAPdddACourierA A @TV7 *SHAPdddACourierA A @TA8 * This code asks the bios for memory/disk/other parameters, andSHAPdddACourierA A @T>9 * puts them in a "safe" place: 0x90000-0x901FF, ie where theSHAPdddACourierA A @T?10 * boot-block used to be. It is then up to the protected modeSHAPdddACourierA A @TB11 * system to read them from there before the area is overwrittenSHAPdddACourierA A @Tj12 * for buffer-blocks.SHAPdddACourierA A @TSSHAPdddACourierA A @TV287SHAPdddACourierA A @Ta288 loader_ok:SHAPdddACourierA A @T{(289 # Get memory size (extended mem, kB)SHAPdddACourierA A @TT:SHAPdddACourierA A @TD382 # Ye Olde Traditional Methode. Returns the memory size (16mb orSHAPdddACourierA A @T|)383 # 64mb, depending on the bios) in ax.SHAPdddACourierA A @T] 384 mem88:SHAPdddACourierA A @TW385 SHAPdddACourierA A @T] 386 #endifSHAPdddACourierA A @Ti387 movb $0x88, %ahSHAPdddACourierA A @Td388 int $0x15SHAPdddACourierA A @Tg389 movw %ax, (2)SHAPdddACourierA A @TSSHAPdddACourierA A @T-391 # Set the keyboard repeat rate to the maxSHAPdddACourierA A @Tk392 movw $0x0305, %axSHAPdddACourierA A @Tg393 xorw %bx, %bxSHAPdddACourierA A @Td394 int $0x16SHAPdddACourierA A @TW395 SHAPdddACourierA A @T>396 # Check for video adapter and its parameters and allow theSHAPdddACourierA A @Tt!397 # user to browse video modes.SHAPdddACourierA A @T;398 call video # NOTE: we need %ds pointingSHAPdddACourierA A @TSSHAPdddACourierA A @T0Also get disk parameters and Bus type (if MCA). SHAPdddACourierA A @A!8/ TimesNewRomanTSSHAPdddACourierA A @T]SRAPdddA PACourierA A @TA780 # Well, that wasn't fun :-(. Hopefully it works, and we don'tSHAPdddACourierA A @TD781 # need no steenking BIOS anyway (except for initial loading :-).SHAPdddACourierA A @TD782 # The BIOS-routine wants lots of unnecessary data, and it's lessSHAPdddACourierA A @T?783 # "interesting" anyway. This is how REAL programmers do it.SHAPdddACourierA A @TX784 #SHAPdddACourierA A @T?785 # Well, now's the time to move into protected mode. To makeSHAPdddACourierA A @T=786 # things as simple as possible, we do no register set-up SHAPdddACourierA A @TA787 # we let the gnu-compiled 32-bit programs do that. We jump toSHAPdddACourierA A @T;788 # absolute address 0x1000 (or the loader supplied one),SHAPdddACourierA A @Tr789 # in 32-bit protected mode.SHAPdddACourierA A @TX790 #SHAPdddACourierA A @TB791 # Note he short jump isn't strictly needed, although there areSHAPdddACourierA A @TE792 # reasons why it might be a good idea. It won't hurt in any case.SHAPdddACourierA A @TSSHAPdddACourierA A @T@793 movw $1, %ax # protected mode (PE) bitSHAPdddACourierA A @T4794 lmsw %ax # This is it!SHAPdddACourierA A @Tj795 jmp flush_instrSHAPdddACourierA A @TW796 SHAPdddACourierA A @Tk797 flush_instr:S'APdddA @A8A8CourierT@798 xorw %bx, %bx # Flag to indicate a bootSHAPdddACourierA A @TB799 xorl %esi, %esi # Pointer to real-mode codeSHAPdddACourierA A @Tg800 movw %cs, %siSHAPdddACourierA A @Tr801 subw $DELTA_INITSEG, %siSHAPdddACourierA A @TB802 shll $4, %esi # Convert to 32-bit pointerSHAPdddACourierA A @TSSHAPdddACourierA A @T1803 # NOTE: For high loaded big kernels we need aSHAPdddACourierA A @Tu"804 # jmpi 0x100000,__KERNEL_CSSHAPdddACourierA A @T`805 #S'APdddA @A8A8CourierTC806 # but we yet haven't reloaded CS register, so the default size SHAPdddACourierA A @T~+807 # of the target offset still is 16 bit.SHAPdddACourierA A @TD808 # However, using an operant prefix (0x66), the CPU will properlySHAPdddACourierA A @T9809 # take our 48 bit far pointer. (INTeL 80386 ReferenceSHAPdddACourierA A @T7810 # Manual, Mixing 16-bit and 32-bit code, page 16-6)SHAPdddACourierA A @TW811 SHAPdddACourierA A @T?812 .byte 0x66, 0xea # prefix + jmpi-opcodeSHAPdddACourierA A @TB813 code32: .long 0x1000 # will be set to 0x100000SHAPdddACourierA A @Th814 # for big kernelsSHAPdddACourierA A @Tj815 .word __KERNEL_CSSHAPdddACourierA A @TSSHAPdddACourierA A @TSSHAPdddACourierA A @TThe long jump after the switch to projected mode in setup.S jumps to a function in startup_32() /usr/src/linux/arch/i386/boot/compressed/head.SSXAPdddA PA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @TnIts functions are to:SNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @Tb clear BSSSNAPdddA TimesNewRomanA A @Tndecompress the kernelSNAPdddA TimesNewRomanA A @T~%jump back to kernel entry at 0x100000SNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @THIf this routine was loaded at 0x100000 some sleight of hand is involved.SNAPdddA TimesNewRomanA A @A8 A8 HTmove the kernel mover to 0x1000SXAPdddA TimesNewRomanA  A A @TMjmp to the kernel mover which moves the kernel from where it was decompressedSXAPdddA TimesNewRomanA  A A @Tand then jmp back to 0x100000SXAPdddA TimesNewRomanA  A A @TYSNAPdddA TimesNewRomanA A @TX54 /*SHAPdddACourierA A @Ta55 * Clear BSSSHAPdddACourierA A @TX56 */SHAPdddACourierA A @Td57 xorl %eax,%eaxSHAPdddACourierA A @Tu"58 movl $ SYMBOL_NAME(_edata),%ediSHAPdddACourierA A @Ts 59 movl $ SYMBOL_NAME(_end),%ecxSHAPdddACourierA A @Td60 subl %edi,%ecxSHAPdddACourierA A @TY61 cldSHAPdddACourierA A @TY62 repSHAPdddACourierA A @T[63 stosbSHAPdddACourierA A @TX64 /*SHAPdddACourierA A @T765 * Do the decompression, and jump to the new kernel..SHAPdddACourierA A @TX66 */SHAPdddACourierA A @T567 subl $16,%esp # place for structure on the stackSHAPdddACourierA A @Td68 movl %esp,%eaxSHAPdddACourierA A @T469 pushl %esi # real mode pointer as second argSHAPdddACourierA A @T670 pushl %eax # address of structure as first argSHAPdddACourierA A @Ty&71 call SYMBOL_NAME(decompress_kernel)SHAPdddACourierA A @Te72 orl %eax,%eax SHAPdddACourierA A @T] 73 jnz 3fSHAPdddACourierA A @Tw$74 popl %esi # discard addressSHAPdddACourierA A @Ty&75 popl %esi # real mode pointerSHAPdddACourierA A @Td76 xorl %ebx,%ebxSHAPdddACourierA A @Tt!77 ljmp $(__KERNEL_CS), $0x100000SHAPdddACourierA A @TYSNAPdddA TimesNewRomanA A @TCThe second stage startup_32() now located at 0x100000 is located inShAPdddA PA TimesNewRomanA A@ddA @TYSNAPdddA TimesNewRomanA A @T&/usr/src/linux/arch/i386/kernel/head.SSNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @ToIts functions include:SNAPdddA TimesNewRomanA A @TZ SNAPdddA TimesNewRomanA A @Tz! Set segment regs to known valuesSNAPdddA TimesNewRomanA A @T) Initialize page tables and enable pagingSNAPdddA TimesNewRomanA A @T,Setup a new IDT to be used in protected modeSNAPdddA TimesNewRomanA A @T'Copy bootup parameters out of the way. SNAPdddA TimesNewRomanA A @T7First 2kB of _empty_zero_page is for boot parameters SNAPdddA TimesNewRomanA A @T$Second 2kB is for the command line.S'APdddA @A8 A!8 TimesNewRomanA8 $A!8 $ TimesNewRomanTsDetermine CPU typeS'APdddA @A8A!8 TimesNewRomanTYSNAPdddA TimesNewRomanA A @TjIt concludes withSNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @Tu"270 call SYMBOL_NAME(start_kernel)SHAPdddACourierA A @Tb271 L6:S'APdddA @A8A8CourierT7272 jmp L6 # main should never return here, butSHAPdddACourierA A @T|)273 # just in case, we know what happens.SHAPdddACourierA A @TYSNAPdddA TimesNewRomanA A @T@The start_kernel symbol is located in /usr/src/linux/init/main.cSNAPdddA TimesNewRomanA A @A8 A8 @TcSXAPdddA TimesNewRomanA  A A @T-545 asmlinkage void __init start_kernel(void)SRAPdddACourierA  A A @Tb546 {SRAPdddACourierA  A A @Tu547 char * command_line;SRAPdddACourierA  A A @Tx548 unsigned long mempages;SRAPdddACourierA  A A @T%549 extern char saved_command_line[];SRAPdddACourierA  A A @Tc550 /*SRAPdddACourierA  A A @T>551 * Interrupts are still disabled. Do necessary setups, thenSRAPdddACourierA  A A @Tn552 * enable themSRAPdddACourierA  A A @Tc553 */SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @TcBegin with some processor dependent initialization.. functions called live in the arch/ directoriesSNAPdddA TimesNewRomanA A @A8 cT]SRAPdddACourierA  A A @To554 lock_kernel();SRAPdddACourierA  A A @Tv555 printk(linux_banner);SRAPdddACourierA  A A @T{556 setup_arch(&command_line);SRAPdddACourierA  A A @T<557 printk("Kernel command line: %s\n", saved_command_line);SRAPdddACourierA  A A @T} 558 parse_options(command_line);SRAPdddACourierA  A A @Tm559 trap_init();SRAPdddACourierA  A A @Tl560 init_IRQ();SRAPdddACourierA  A A @Tn561 sched_init();SRAPdddACourierA  A A @Tp562 softirq_init();SRAPdddACourierA  A A @Tm563 time_init();SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @TgS\APdddA PACourierA  A A @T?For the most part memory initialization is machine independent.SNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @Ts584 kmem_cache_init();SRAPdddACourierA  A A @Tg 585 sti();SRAPdddACourierA  A A @Ts586 calibrate_delay();SRAPdddACourierA  A A @Tl595 mem_init();SRAPdddACourierA  A A @Ty596 kmem_cache_sizes_init();SRAPdddACourierA  A A @Tv597 pgtable_cache_init();SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @Tz602 mempages = num_physpages;SRAPdddACourierA  A A @Tu604 fork_init(mempages);SRAPdddACourierA  A A @Tt605 proc_caches_init();SRAPdddACourierA  A A @T{606 vfs_caches_init(mempages);SRAPdddACourierA  A A @Tw607 buffer_init(mempages);SRAPdddACourierA  A A @T{608 page_cache_init(mempages);SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T2Init additional kernel subsystems and turn on smp.SXAPdddA TimesNewRomanA  A A @TcSXAPdddA TimesNewRomanA  A A @Tp612 signals_init();SRAPdddACourierA  A A @Tr614 proc_root_init();SRAPdddACourierA  A A @Tl617 ipc_init();SRAPdddACourierA  A A @Tn619 check_bugs();SRAPdddACourierA  A A @Tl627 smp_init();SRAPdddACourierA  A A @Tm628 rest_init();SRAPdddACourierA  A A @Tb629 }SRAPdddACourierA  A A @T2S'APdddA @TgS\APdddA PACourierA  A A @TCThe function rest_init creates the init process as a kernel thread.SXAPdddA TimesNewRomanA  A A @THThe code running here is running as a process because current is valid..SXAPdddA TimesNewRomanA  A A @A8 A8 6>TcSXAPdddA TimesNewRomanA  A A @T|533 static void rest_init(void)SRAPdddACourierA  A A @Tb534 {SRAPdddACourierA  A A @TM535 kernel_thread(init, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGNAL);SRAPdddACourierA  A A @Tr536 unlock_kernel();SRAPdddACourierA  A A @T|537 current->need_resched = 1;SRAPdddACourierA  A A @Tm538 cpu_idle();SRAPdddACourierA  A A @Tc539 } SRAPdddACourierA  A A @Ta540 SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T*The boot thread then falls into cpu_idle()SXAPdddA TimesNewRomanA  A A @A8  #A8 $*TcSXAPdddA TimesNewRomanA  A A @Tu124 void cpu_idle (void)SRAPdddACourierA  A A @Tb125 {SRAPdddACourierA  A A @T3126 /* endless idle loop with no priority at all */SRAPdddACourierA  A A @Tn127 init_idle();SRAPdddACourierA  A A @Tu128 current->nice = 20;SRAPdddACourierA  A A @Tz129 current->counter = -100;SRAPdddACourierA  A A @Ta130 SRAPdddACourierA  A A @Tm131 while (1) {SRAPdddACourierA  A A @T#132 void (*idle)(void) = pm_idle;SRAPdddACourierA  A A @Tm133 if (!idle)SRAPdddACourierA  A A @Tx134 idle = default_idle;SRAPdddACourierA  A A @T$135 while (!current->need_resched)SRAPdddACourierA  A A @Tk136 idle();SRAPdddACourierA  A A @Tn137 schedule();SRAPdddACourierA  A A @Tu138 check_pgt_cache();SRAPdddACourierA  A A @Tc139 }SRAPdddACourierA  A A @Tb140 }SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T&The boot thread or idle task has pid 0SXAPdddA TimesNewRomanA  A A @A8 T;The idle function used to loop. Now it hlts the processor.SXAPdddA TimesNewRomanA  A A @T2S'APdddA @T4 886 Apr 24 13:06:31 glint2 kernel: Init pid is 1 SRAPdddACourierA  A A @T9 887 Apr 24 13:06:31 glint2 kernel: Init task pid is 0 SRAPdddACourierA  A A @T5 888 Apr 24 13:06:31 glint2 kernel: Saved pid is 0 SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T[The init kernel thread begins with initializing some subsystems that need a process contextScAPdddA PATimesNew RomanA  A A @T"This is done via do_basic_setup() SYAPdddATimesNew RomanA  A A @TdSYAPdddATimesNew RomanA  A A @T"805 static int init(void * unused)SRAPdddACourierA  A A @Tb806 {SRAPdddACourierA  A A @Tp807 lock_kernel();SRAPdddACourierA  A A @Ts808 do_basic_setup();SRAPdddACourierA  A A @Ta809 SRAPdddACourierA  A A @Tv810 prepare_namespace();SRAPdddACourierA  A A @Ta811 SRAPdddACourierA  A A @Tc812 /*SRAPdddACourierA  A A @T3813 * Ok, we have completed the initial bootup, andSRAPdddACourierA  A A @T6814 * we're essentially up and running. Get rid of theSRAPdddACourierA  A A @T6815 * initmem segments and start the user-mode stuff..SRAPdddACourierA  A A @Tc816 */SRAPdddACourierA  A A @Tp817 free_initmem();SRAPdddACourierA  A A @Tq818 unlock_kernel();SRAPdddACourierA  A A @Ta819 SRAPdddACourierA  A A @T,820 if (open("/dev/console", O_RDWR, 0) < 0)SRAPdddACourierA  A A @T=821 printk("Warning: unable to open an initial console.\n");SRAPdddACourierA  A A @Ta822 SRAPdddACourierA  A A @To823 (void) dup(0);SRAPdddACourierA  A A @To824 (void) dup(0);SRAPdddACourierA  A A @Ta825 SRAPdddACourierA  A A @Tc826 /*SRAPdddACourierA  A A @T.827 * We try each of these until one succeeds.SRAPdddACourierA  A A @Tb828 *SRAPdddACourierA  A A @T=829 * The Bourne shell can be used instead of init if we are SRAPdddACourierA  A A @T0830 * trying to recover a really broken machine.SRAPdddACourierA  A A @Tc831 */SRAPdddACourierA  A A @Ta832 SRAPdddACourierA  A A @Tv833 if (execute_command)SRAPdddACourierA  A A @T2834 execve(execute_command,argv_init,envp_init);SRAPdddACourierA  A A @T/835 execve("/sbin/init",argv_init,envp_init);SRAPdddACourierA  A A @T.836 execve("/etc/init",argv_init,envp_init);SRAPdddACourierA  A A @T.837 execve("/bin/init",argv_init,envp_init);SRAPdddACourierA  A A @T,838 execve("/bin/sh",argv_init,envp_init);SRAPdddACourierA  A A @TF839 panic("No init found. Try passing init= option to kernel.");SRAPdddACourierA  A A @Tb840 }SRAPdddACourierA  A A @Ta841 SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T]SRAPdddACourierA  A A @T2S'APdddA @T3The do_basic_setup() function contains still more SXAPdddA PA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @TY672 /*SHAPdddACourierA A @T4673 * Tell the world that we're going to be the grimSHAPdddACourierA A @T~+674 * reaper of innocent orphaned children.SHAPdddACourierA A @TY679 */SHAPdddACourierA A @Tv680 child_reaper = current;S'APdddA @A8A8CourierT2S'APdddA @Tk691 #ifdef CONFIG_SYSCTLSHAPdddACourierA A @Te692 sysctl_init();SHAPdddACourierA A @T] 693 #endifSHAPdddACourierA A @TW694 SHAPdddACourierA A @Th703 #ifdef CONFIG_PCISHAPdddACourierA A @Tb704 pci_init();SHAPdddACourierA A @T] 705 #endifSHAPdddACourierA A @TSSHAPdddACourierA A @Th712 #ifdef CONFIG_MCASHAPdddACourierA A @Tb713 mca_init();SHAPdddACourierA A @T] 714 #endifSHAPdddACourierA A @TSSHAPdddACourierA A @TW733 SHAPdddACourierA A @T<734 /* Networking initialization needs a process context */ SHAPdddACourierA A @Tc735 sock_init();SHAPdddACourierA A @TW736 SHAPdddACourierA A @Tn737 start_context_thread();SHAPdddACourierA A @Tf738 do_initcalls();SHAPdddACourierA A @TW739 SHAPdddACourierA A @TSSHAPdddACourierA A @TX747 }SHAPdddACourierA A @TW748 SHAPdddACourierA A @TSSHAPdddACourierA A @T|)648 static void __init do_initcalls(void)SHAPdddACourierA A @TX649 {SHAPdddACourierA A @Ti650 initcall_t *call;SHAPdddACourierA A @TW651 SHAPdddACourierA A @Tq652 call = &__initcall_start;SHAPdddACourierA A @T\ 653 do {SHAPdddACourierA A @Tc654 (*call)();SHAPdddACourierA A @T` 655 call++;SHAPdddACourierA A @Ty&656 } while (call < &__initcall_end);SHAPdddACourierA A @TW657 SHAPdddACourierA A @TI658 /* Make sure there is no pending stuff from the initcall sequence */SHAPdddACourierA A @Tp659 flush_scheduled_tasks();SHAPdddACourierA A @TX660 }SHAPdddACourierA A @TSSHAPdddACourierA A @T2S'APdddA @TYSNAPdddA TimesNewRomanA A @TYSNAPdddA TimesNewRomanA A @JLexmark Optra T614 Laser PrinterLOPT614 PostScript`Tl`Tld,,lp -d lwnlwnLOPT614PageSize:LetterDuplex:NoneDuplexer:FalseInputSlot:AutoSelectMediaType:NoneTray2:FalseTray3:FalseTray4:FalseTray5:FalseMPFeeder:TrueFeeder:FalseImageEnhance:TrueResolution:600dpiSmoothing:False7 U++V88/? S/=UG'2P   UG'x0?-BG'BG'B,G'BBG'Ew$BXG' Ew$ BeG' E! BrG' E! BG' E! BG' E!  B G' Ew$  B G' Ew$  B G' Ew$  B G' E!  B G' E! BG' E! BG' E! BG'Ew$BG' Ew$ BG'Ew$B5G'Ew$BKG'B/G'BG'BG'BG'BG'BG'BG'BkG'BOG'B3 G'B!G' B!G' Ew$ !B#G' "B$G'Ew$#B+%G' Ew$ $B8&G' E! %BE'G' E! &BR(G' E! 'B_)G' E! (Bl*G' Ew$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G G'B+ G'B G'B G'B G'BG'BG'BG'BgG'BKG'B/G'BG'BG'BG'BG'BG'BG'BkG'BOG'B3G'BG'BG'BG'BG'BG'B G'Bo!G'B7#G'B$G'B$G'B%G'B&G' ,U6G'(G' F @G' %u/=UG'2P  UG'x0?0BG' B G' BG'BG'BG'BG'BG'BG' BG'BG'Bc G'BG G'B+ G'B G'B G'B G'BG'BG'BG'BgG'BKG'B/G'BG'BG'BG'BG'BG'BG'BkG'BOG'B3G'BG'BG'BG'BG'BG'B G'Bo!G'BS"G'B7#G'B$G'B$G'B&G'B'G'B(G'Bs)G' B*G' B+G' ,U6G'(G' F @G' lZRoot Entry ®`VCompObj<Ole persist elements" SfxDocumentInfo uStarBASIC BasicManager2 4SfxWindowsCSwNumRulesUSfxStyleSheetsStandard*jSummaryInformation( ,0SwPageStyleSheets$ 1StarWriterDocument&o