~ubuntu-branches/ubuntu/wily/grub2/wily

« back to all changes in this revision

Viewing changes to grub-core/loader/i386/pc/linux.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2011-01-11 17:11:44 UTC
  • mto: (17.3.26 experimental)
  • mto: This revision was merged to the branch mainline in revision 60.
  • Revision ID: james.westby@ubuntu.com-20110111171144-o2h6luxzei5fivmf
Tags: upstream-1.99~20110111
ImportĀ upstreamĀ versionĀ 1.99~20110111

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include <grub/cpu/relocator.h>
35
35
#include <grub/video.h>
36
36
#include <grub/i386/floppy.h>
 
37
#include <grub/lib/cmdline.h>
37
38
 
38
39
#define GRUB_LINUX_CL_OFFSET            0x9000
39
40
#define GRUB_LINUX_CL_END_OFFSET        0x90FF
86
87
  grub_size_t real_size;
87
88
  grub_ssize_t len;
88
89
  int i;
89
 
  char *dest;
90
90
  char *grub_linux_prot_chunk;
91
91
  int grub_linux_is_bzimage;
92
92
  grub_addr_t grub_linux_prot_target;
286
286
                 ((GRUB_LINUX_MAX_SETUP_SECTS - setup_sects - 1)
287
287
                  << GRUB_DISK_SECTOR_BITS));
288
288
 
289
 
  /* Specify the boot file.  */
290
 
  dest = grub_stpcpy (grub_linux_real_chunk + GRUB_LINUX_CL_OFFSET,
291
 
                      "BOOT_IMAGE=");
292
 
  dest = grub_stpcpy (dest, argv[0]);
293
 
 
294
 
  /* Copy kernel parameters.  */
295
 
  for (i = 1;
296
 
       i < argc
297
 
         && dest + grub_strlen (argv[i]) + 1 < (grub_linux_real_chunk
298
 
                                                + GRUB_LINUX_CL_END_OFFSET);
299
 
       i++)
300
 
    {
301
 
      *dest++ = ' ';
302
 
      dest = grub_stpcpy (dest, argv[i]);
303
 
    }
 
289
  /* Create kernel command line.  */
 
290
  grub_memcpy ((char *)grub_linux_real_chunk + GRUB_LINUX_CL_OFFSET,
 
291
                LINUX_IMAGE, sizeof (LINUX_IMAGE));
 
292
  grub_create_loader_cmdline (argc, argv,
 
293
                              (char *)grub_linux_real_chunk
 
294
                              + GRUB_LINUX_CL_OFFSET + sizeof (LINUX_IMAGE) - 1,
 
295
                              GRUB_LINUX_CL_END_OFFSET - GRUB_LINUX_CL_OFFSET
 
296
                              - (sizeof (LINUX_IMAGE) - 1));
304
297
 
305
298
  if (grub_linux_is_bzimage)
306
299
    grub_linux_prot_target = GRUB_LINUX_BZIMAGE_ADDR;