[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: loading kernels with different LMA and VMA (fwd)
From: |
Rogelio M. Serrano Jr. |
Subject: |
Re: loading kernels with different LMA and VMA (fwd) |
Date: |
Thu, 29 Mar 2001 01:41:45 +0800 (PHT) |
On 28 Mar 2001, Gordon Matzigkeit wrote:
> >>>>> 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)
yes i noticed it already. i thought of using unsigned int instead of int
but it looks like your suggestion is better anyway ill try both.
> 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,
>
It does help. The remaining problem now is what physical address to use
for an entry address if the entry address that i get from the elf header
is virtual?
perhaps we use the _start? or maybe extend the multiboot_header struct to
indicate the physical entry point?
could this be the reason why the grub implementation assumes that LMA =
VMA?
> --
> Gordon Matzigkeit <address@hidden> //\ I'm a FIG (http://fig.org/)
> Committed to freedom and diversity \// Run Bash (http://fig.org/gnu/bash/)
>