bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loading kernels with different LMA and VMA (fwd)


From: Gordon Matzigkeit
Subject: Re: loading kernels with different LMA and VMA (fwd)
Date: 28 Mar 2001 11:13:53 -0600
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

>>>>> Rogelio M Serrano writes:

105      if (type == KERNEL_TYPE_MULTIBOOT)
106        entry_addr = (entry_func) pu.elf->e_entry;
107      else
108        entry_addr = (entry_func) (pu.elf->e_entry & 0xFFFFFF);
109
110      if (((int) entry_addr) < 0x100000)
111        errnum = ERR_BELOW_1MB;

 RMS> in line 110 if my e_entry is 0xf0100000 we should not get an
 RMS> error right?  same with line 520: my p_addr this time is
 RMS> 0x100000

[...]

 RMS> am i getting the error at 111?

The problem I see is that the test at 110 looks like:

      if (((int) 0xf0100000) < 0x100000)

Try this on your own, and you'll see that the problem is the (int)
cast turning your large address into a negative number.  Perhaps a
better test would be:

      if (entry_addr < (entry_func) 0x100000)

Of course, this is all speculation, since I can't check the results
myself at the moment.

I hope this helps you,

-- 
 Gordon Matzigkeit <address@hidden>  //\ I'm a FIG (http://fig.org/)
Committed to freedom and diversity \//  Run Bash (http://fig.org/gnu/bash/)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]