正在加载图片...
Linux Kernel Internals .2.15 Kernel Support for Loading Modules 3.Virtual Filesystem (VFS) .3 1 Inode Caches and Interaction with dcache .3.2 Filesystem Registration/Unregistration .3.3 File Descriptor Management .3.4 File Structure Management .3.5 Superblock and Mountpoint Management .3.6 Example Virtual Filesystem:pipefs Example Disk Filesyste mains and Binary Formats 1.Booting 1.1 Building the Linux Kernel Image This section explains the steps taken during compilation of the Linux kemel and the output produced at each stage.The build process depends on the architecture so I would like to emphasize that we only consider building a Linux/x86 kernel. When the user types'make zImage'or'make bzImage'the resulting bootable kernel image is stored as arch/i386/boot/zImage or arch/i386/boot/bzImage respectively.Here is how the image is built 1.C and assembl rce files are compiled into ELF relocatable object format(o)and some of them 2.tre gro ally into a mves (a ELF 32 aaohinxwhichisasticalylimked,nonstiped SB 80 o and 8 3 s pro 'nm vmlinux'.irrelevant or uninteresting symbols are grepped out out-D BIG KERNEI whether the t ctively 6 bh sccts bled nd the ed into nary'form called bbootsect(or】 ed 7 Setup code setup S(s video s)i ssed into bsetu s for hzlmage setup.s for e In the s the hootse code the differe nce is marke -D BIG KERNEL esent for bzIms ge The esult is then conve erted into 'raw binary'form called bsetup 8 Enter directory arch/i386/boot/comr ressed and convert /usr/sre/linux/vmlinux to Stmppiggy(tmp filename)in raw binary format,removing.note and.comment ELF sections 9.gzip-9<Stmppiggy>Stmppiggy.gz 10.Link Stmppiggy.gz into ELF relocatable (ld-r)piggy.o 11.Compile compression routines head.S and misc.c(still in arch/i386/boot/compressed directory)into ELF objects head.o and misc.o 3.Virtual Filesystem(VFS) 2 • 2.15 Kernel Support for Loading Modules 3.Virtual Filesystem (VFS) • 3.1 Inode Caches and Interaction with Dcache • 3.2 Filesystem Registration/Unregistration • 3.3 File Descriptor Management • 3.4 File Structure Management • 3.5 Superblock and Mountpoint Management • 3.6 Example Virtual Filesystem: pipefs • 3.7 Example Disk Filesystem: BFS • 3.8 Execution Domains and Binary Formats 1.Booting 1.1 Building the Linux Kernel Image This section explains the steps taken during compilation of the Linux kernel and the output produced at each stage. The build process depends on the architecture so I would like to emphasize that we only consider building a Linux/x86 kernel. When the user types 'make zImage' or 'make bzImage' the resulting bootable kernel image is stored as arch/i386/boot/zImage or arch/i386/boot/bzImage respectively. Here is how the image is built: 1. C and assembly source files are compiled into ELF relocatable object format (.o) and some of them are grouped logically into archives (.a) using ar(1) 2. Using ld(1), the above .o and .a are linked into 'vmlinux' which is a statically linked, non−stripped ELF 32−bit LSB 80386 executable file 3. System.map is produced by 'nm vmlinux', irrelevant or uninteresting symbols are grepped out. 4. Enter directory arch/i386/boot 5. Bootsector asm code bootsect.S is preprocessed either with or without −D__BIG_KERNEL__, depending on whether the target is bzImage or zImage, into bbootsect.s or bootsect.s respectively 6. bbootsect.s is assembled and then converted into 'raw binary' form called bbootsect (or bootsect.s assembled and raw−converted into bootsect for zImage) 7. Setup code setup,S (setup.S includes video.S) is preprocessed into bsetup.s for bzImage or setup.s for zImage. In the same way as the bootsector code, the difference is marked by −D__BIG_KERNEL__ present for bzImage. The result is then converted into 'raw binary' form called bsetup 8. Enter directory arch/i386/boot/compressed and convert /usr/src/linux/vmlinux to $tmppiggy (tmp filename) in raw binary format, removing .note and .comment ELF sections 9. gzip −9 < $tmppiggy > $tmppiggy.gz 10. Link $tmppiggy.gz into ELF relocatable (ld −r) piggy.o 11. Compile compression routines head.S and misc.c (still in arch/i386/boot/compressed directory) into ELF objects head.o and misc.o Linux Kernel Internals 3.Virtual Filesystem (VFS) 2
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有