title: Booting custom kernel in Grub2
body: <p>I want to boot a custom kernel with Grub2. I used old (grub 1) multiboot header:</p>
  
  <pre><code>.set flags, 0x0
  .set magic, 0x1badb002
  .set checksum, -(magic + flags)
  
  .align 4
  .long magic
  .long flags
  .long checksum
  
  ...
  
  movl %eax, magic
  </code></pre>
  
  <p>But it doesn't work with Grub2, so I've searched for new  Multiboot specification and found it: <a href="http://bzr.savannah.gnu.org/lh/grub/branches/multiboot2/annotate/head:/doc/multiboot2.h" rel="nofollow">http://bzr.savannah.gnu.org/lh/grub/branches/multiboot2/annotate/head:/doc/multiboot2.h</a>
  (it's not a real specification, it's just a header file)</p>
  
  <p>So, now I am using this multiboot header:</p>
  
  <pre><code>.set flags, 0x0
  .set magic, 0xe85250d6
  .set magic_the_second, 0x36d76289
  .set checksum, -(magic + flags)
  
  .align 4
  .long magic
  .long flags
  .long checksum
  
  ...
  
  movl %eax, magic_the_second
  </code></pre>
  
  <p>But it also doesn't work:
      No multiboot header</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks!</p>