All of lore.kernel.org
 help / color / mirror / Atom feed
From: graeme.russ@gmail.com (Graeme Russ)
To: kernelnewbies@lists.kernelnewbies.org
Subject: x86 kernel build chain - how bzImage gets created
Date: Tue, 22 Nov 2011 21:46:31 +1100	[thread overview]
Message-ID: <4ECB7D87.3030601@gmail.com> (raw)

Hi All,

Hopefully this will help demystify the build process

Notation:
<primary input file> (<file size in bytes>)
  |
  + <additional input file>
  |
  * <command>
  |
  \-> <output file> (<file size in bytes>)

The file sizes are arbitrary and are based on the current configuration
options I have set for a small kernel. They are simply there to illustrate
the relative differences in file sizes.

Note that vmlinux.o is not used to generate bzImage but I've included it
for completeness

+ arch/x86/kernel/head_32.o
+ arch/x86/kernel/head32.o
+ arch/x86/kernel/head.o
+ arch/x86/kernel/init_task.o
+ init/built-in.o
+ usr/built-in.o
+ arch/x86/built-in.o
+ kernel/built-in.o
+ mm/built-in.o
+ fs/built-in.o
+ ipc/built-in.o
+ security/built-in.o
+ crypto/built-in.o
+ block/built-in.o
+ lib/lib.a
+ arch/x86/lib/lib.a
+ lib/built-in.o
+ arch/x86/lib/built-in.o
+ drivers/built-in.o
+ sound/built-in.o
+ firmware/built-in.o
+ arch/x86/pci/built-in.o
+ net/built-in.o
|
* ld -m elf_i386 -r -o vmlinux.o
|
\->vmlinux.o (2,889,050)

+ arch/x86/kernel/head_32.o
+ arch/x86/kernel/head32.o
+ arch/x86/kernel/head.o
+ arch/x86/kernel/init_task.o
+ init/built-in.o
+ usr/built-in.o
+ arch/x86/built-in.o
+ kernel/built-in.o
+ mm/built-in.o
+ fs/built-in.o
+ ipc/built-in.o
+ security/built-in.o
+ crypto/built-in.o
+ block/built-in.o
+ lib/lib.a
+ arch/x86/lib/lib.a
+ lib/built-in.o
+ arch/x86/lib/built-in.o
+ drivers/built-in.o
+ sound/built-in.o
+ firmware/built-in.o
+ arch/x86/pci/built-in.o
+ net/built-in.o
+ .tmp_kallsyms2.o
|
* ld -m elf_i386 --build-id -T arch/x86/kernel/vmlinux.lds
|
\->vmlinux (2,629,659)
   |
   * objcopy -R .comment -S
   |
   \->arch/x86/boot/compressed/vmlinux.bin (2,094,132)
      |
      * gzip
      |
      \-> arch/x86/boot/compressed/vmlinux.bin.gz (1,074,711)
         |
         * .incbin
         |
         \-> piggy.S
            |
            * gcc
            |
            \-> piggy.o (1,075,419)
               |
               + arch/x86/boot/compressed/head_32.o
               + arch/x86/boot/compressed/misc.o
               + arch/x86/boot/compressed/string.o
               + arch/x86/boot/compressed/cmdline.o
               + arch/x86/boot/compressed/early_serial_console.o
               |
               * ld -m elf_i386 -T arch/x86/boot/compressed/vmlinux.lds
               |
               \->arch/x86/boot/compressed/vmlinux (1,099,538)
                  |
                  * objcopy -O binary -R .note -R .comment -S
                  |
                  \-> arch/x86/boot/vmlinux.bin (1,092,060)
                     |
                     |   + arch/x86/boot/a20.o
                     |   + arch/x86/boot/bioscall.o
                     |   + arch/x86/boot/cmdline.o
                     |   + arch/x86/boot/copy.o
                     |   + arch/x86/boot/cpu.o
                     |   + arch/x86/boot/cpucheck.o
                     |   + arch/x86/boot/early_serial_console.o
                     |   + arch/x86/boot/edd.o
                     |   + arch/x86/boot/header.o
                     |   + arch/x86/boot/main.o
                     |   + arch/x86/boot/mca.o
                     |   + arch/x86/boot/memory.o
                     |   + arch/x86/boot/pm.o
                     |   + arch/x86/boot/pmjump.o
                     |   + arch/x86/boot/printf.o
                     |   + arch/x86/boot/regs.o
                     |   + arch/x86/boot/string.o
                     |   + arch/x86/boot/tty.o
                     |   + arch/x86/boot/video.o
                     |   + arch/x86/boot/video-mode.o
                     |   + arch/x86/boot/version.o
                     |   + arch/x86/boot/video-vga.o
                     |   + arch/x86/boot/video-vesa.o
                     |   + arch/x86/boot/video-bios.o
                     |   |
                     |   * ld -m elf_i386 -T arch/x86/boot/setup.ld
                     |   |
                     |   \->arch/x86/boot/setup.elf (186,171)
                     |      |
                     |      * objcopy -O binary arch/x86/boot/setup.elf
                     |      |
                     +      \-> arch/x86/boot/setup.bin (12,604)
                     |
                     * arch/x86/boot/tools/build
                     |
                     \-> arch/x86/boot/bzImage (1,104,864)

             reply	other threads:[~2011-11-22 10:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22 10:46 Graeme Russ [this message]
2011-11-22 10:59 ` x86 kernel build chain - how bzImage gets created Daniel Baluta
2011-11-22 11:06   ` Graeme Russ
2011-11-22 17:54 ` Mulyadi Santosa
2011-11-27 21:41   ` Graeme Russ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ECB7D87.3030601@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.