/[grub]/grub/stage2/boot.c
ViewVC logotype

Diff of /grub/stage2/boot.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.44 by okuji, Tue Mar 18 21:07:35 2003 UTC revision 1.45 by okuji, Sun Jan 11 09:38:04 2004 UTC
# Line 1  Line 1 
1  /* boot.c - load and bootstrap a kernel */  /* boot.c - load and bootstrap a kernel */
2  /*  /*
3   *  GRUB  --  GRand Unified Bootloader   *  GRUB  --  GRand Unified Bootloader
4   *  Copyright (C) 1999,2000,2001,2002,2003  Free Software Foundation, Inc.   *  Copyright (C) 1999,2000,2001,2002,2003,2004  Free Software Foundation, Inc.
5   *   *
6   *  This program is free software; you can redistribute it and/or modify   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by   *  it under the terms of the GNU General Public License as published by
# Line 786  load_initrd (char *initrd) Line 786  load_initrd (char *initrd)
786  {  {
787    int len;    int len;
788    unsigned long moveto;    unsigned long moveto;
789      unsigned long max_addr;
790    struct linux_kernel_header *lh    struct linux_kernel_header *lh
791      = (struct linux_kernel_header *) (cur_addr - LINUX_SETUP_MOVE_SIZE);      = (struct linux_kernel_header *) (cur_addr - LINUX_SETUP_MOVE_SIZE);
792        
# Line 809  load_initrd (char *initrd) Line 810  load_initrd (char *initrd)
810      moveto = (mbi.mem_upper + 0x400) << 10;      moveto = (mbi.mem_upper + 0x400) << 10;
811        
812    moveto = (moveto - len) & 0xfffff000;    moveto = (moveto - len) & 0xfffff000;
813    if (moveto + len >= LINUX_INITRD_MAX_ADDRESS)    max_addr = (lh->header == LINUX_MAGIC_SIGNATURE && lh->version >= 0x0203
814      moveto = (LINUX_INITRD_MAX_ADDRESS - len) & 0xfffff000;                ? lh->initrd_addr_max : LINUX_INITRD_MAX_ADDRESS);
815      if (moveto + len >= max_addr)
816        moveto = (max_addr - len) & 0xfffff000;
817        
818    /* XXX: Linux 2.3.xx has a bug in the memory range check, so avoid    /* XXX: Linux 2.3.xx has a bug in the memory range check, so avoid
819       the last page.       the last page.

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26