title: How does the bootloader pick up the command after a "restarting system with command"?
body: <p>Looking in the <a href="https://github.com/CyanogenMod/android_system_core/blob/gingerbread/toolbox/reboot.c" rel="noreferrer">android source for the reboot command</a> we find the following line:</p>
  
  <pre><code>__reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, \
           LINUX_REBOOT_CMD_RESTART2, argv[optind]);
  </code></pre>
  
  <p>Which is the standard Linux system call to reboot the system with a specific command, see <a href="http://linux.die.net/man/2/reboot" rel="noreferrer">Unix System Call Reboot</a>.</p>
  
  <p>In Android this command is used to tell the bootloader to start either the kernel in recovery mode or to go to the fastboot mode within the bootloader.</p>
  
  <p>My question is: <strong>How does the bootloader pick up the command? And is this functionality implemented in U-Boot?</strong> (I am unable to find it searching either through Google or in the U-Boot source.)</p>
  
  <p>Additionally it seems this is not specific to Android, but is the way Linux performs a "reboot with a command". Any information on how this is "normally" handled/used in Linux?</p>