fix some minor problems in load_initrd.
This commit is contained in:
parent
2e5bb743c7
commit
fa2dd120e4
2 changed files with 10 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
1999-10-17 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||||
|
|
||||||
|
* stage2/boot.c (load_initrd): Change types of *RAMDISK and
|
||||||
|
MOVETO to unsigned long.
|
||||||
|
Apply the macro RAW_ADDR to MOVETO.
|
||||||
|
|
||||||
1999-10-16 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
1999-10-16 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||||
|
|
||||||
* docs/multiboot.texi: Include the example source files of a
|
* docs/multiboot.texi: Include the example source files of a
|
||||||
|
|
|
@ -508,18 +508,18 @@ int
|
||||||
load_initrd (char *initrd)
|
load_initrd (char *initrd)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
long *ramdisk, moveto;
|
unsigned long *ramdisk, moveto;
|
||||||
|
|
||||||
if (! grub_open (initrd) || ! (len = grub_read ((char *) cur_addr, -1)))
|
if (! grub_open (initrd) || ! (len = grub_read ((char *) cur_addr, -1)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
moveto = ((mbi.mem_upper + 0x400) * 0x400 - len) & 0xfffff000;
|
moveto = ((mbi.mem_upper + 0x400) * 0x400 - len) & 0xfffff000;
|
||||||
memmove ((void *) moveto, (void *) cur_addr, len);
|
memmove ((void *) RAW_ADDR (moveto), (void *) cur_addr, len);
|
||||||
|
|
||||||
printf (" [Linux-initrd @ 0x%x, 0x%x bytes]\n", moveto, len);
|
printf (" [Linux-initrd @ 0x%x, 0x%x bytes]\n", moveto, len);
|
||||||
|
|
||||||
ramdisk = (long *) (LINUX_SETUP + LINUX_SETUP_INITRD);
|
ramdisk = (unsigned long *) (LINUX_SETUP + LINUX_SETUP_INITRD);
|
||||||
ramdisk[0] = moveto;
|
ramdisk[0] = RAW_ADDR (moveto);
|
||||||
ramdisk[1] = len;
|
ramdisk[1] = len;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue