* Re: [PATCH] ELF64 and changelog and 4Gb
@ 2005-07-19 23:01 Ruslan Nikolaev
2005-07-20 20:50 ` Yoshinori K. Okuji
2005-07-21 21:51 ` Marco Gerards
0 siblings, 2 replies; 3+ messages in thread
From: Ruslan Nikolaev @ 2005-07-19 23:01 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]
> I agree. This is more readable.
I can change it of course... But it is not so bad:
1. if elf class == 64 => using ELF64 validate & loading code
2. else:
- validate header by grub_dl_check_header(). Function
grub_dl_check_header() also will check that elf class is 32-bit.
and so on...
I'm very busy now, but if you want I can update code... As for me I think
that is no need to check elf class twice (small optimization).
> Could you provide us detailed information? What information is passed
> precisely?
Ok... But first I have a question about grub2. Does it really provide
"mmap" information for OS as multiboot defined or memory size only?
As for 4Gb limit:
1. Memory size variable is a 32-bit. It measures in bytes => max 4Gb.
When it passes to OS it converts to KB measuring but it's still truncated
to 4Gb.
2. You can see the following code in file "init.c":
/* Ignore >4GB. */
if (entry->addr <= 0xFFFFFFFF && entry->type == 1)
{
grub_addr_t addr;
grub_size_t len;
addr = (grub_addr_t) entry->addr;
len = ((addr + entry->len > 0xFFFFFFFF)
? 0xFFFFFFFF - addr
: (grub_size_t) entry->len);
add_mem_region (addr, len);
}
Memory regions addr and len also is a 32-bit when BIOS provides it as a
64-bit numbers.
Of course I can be wrong because I don't know grub code very well.
New ChangeLog:
2005-07-17 Ruslan Nikolaev <nruslan@mail.com>
* multiboot.c (grub_rescue_cmd_multiboot): using ELF64 loading code if
ELF CLASS is a 64-bit and CPU CLASS is X86_64
--
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
[-- Attachment #2: Type: text/html, Size: 2244 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ELF64 and changelog and 4Gb
2005-07-19 23:01 [PATCH] ELF64 and changelog and 4Gb Ruslan Nikolaev
@ 2005-07-20 20:50 ` Yoshinori K. Okuji
2005-07-21 21:51 ` Marco Gerards
1 sibling, 0 replies; 3+ messages in thread
From: Yoshinori K. Okuji @ 2005-07-20 20:50 UTC (permalink / raw)
To: The development of GRUB 2
On Wednesday 20 July 2005 01:01, Ruslan Nikolaev wrote:
> > I agree. This is more readable.
>
> I can change it of course... But it is not so bad:
Well, I think the problem is that there is no meaning to use a union here, and
it makes the function too long.
> Ok... But first I have a question about grub2. Does it really provide
> "mmap" information for OS as multiboot defined or memory size only?
As this is written in the comment, this is not implemented yet.
> As for 4Gb limit:
>
> 1. Memory size variable is a 32-bit. It measures in bytes => max 4Gb.
> When it passes to OS it converts to KB measuring but it's still truncated
> to 4Gb.
But this itself is not a bug really. Because mem_upper is the size of a
contiguous region starting from 1MB, and every BIOS has one or more memory
holes before 4GB.
Well, there is a 4GB limit. We must implement memory map passing.
> 2005-07-17 Ruslan Nikolaev <nruslan@mail.com>
>
> * multiboot.c (grub_rescue_cmd_multiboot): using ELF64 loading code if
> ELF CLASS is a 64-bit and CPU CLASS is X86_64
Please look at the examples carefully. The rule is the same as C comments:
Also, please write complete sentences and capitalize the first word. If a
lower-case identifier comes at the beginning of a sentence, don't capitalize
it! Changing the spelling makes it a different identifier. If you don't like
starting a sentence with a lower case letter, write the sentence differently
(e.g., “The identifier lower-case is ...”).
Okuji
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ELF64 and changelog and 4Gb
2005-07-19 23:01 [PATCH] ELF64 and changelog and 4Gb Ruslan Nikolaev
2005-07-20 20:50 ` Yoshinori K. Okuji
@ 2005-07-21 21:51 ` Marco Gerards
1 sibling, 0 replies; 3+ messages in thread
From: Marco Gerards @ 2005-07-21 21:51 UTC (permalink / raw)
To: The development of GRUB 2
"Ruslan Nikolaev" <nruslan@mail.com> writes:
>> I agree. This is more readable.
>
> I can change it of course... But it is not so bad:
>
> 1. if elf class == 64 => using ELF64 validate & loading code
>
> 2. else:
>
> - validate header by grub_dl_check_header(). Function
> grub_dl_check_header() also will check that elf class is 32-bit.
The important thing to remember is that GRUB support more machines
than the PC and other loaders than just multiboot. So having a ELF32
and ELF64 loader like Hollis suggested would be the right thing to
do. It will mean more shared code and a clean solution.
Thanks,
Marco
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-07-21 21:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-19 23:01 [PATCH] ELF64 and changelog and 4Gb Ruslan Nikolaev
2005-07-20 20:50 ` Yoshinori K. Okuji
2005-07-21 21:51 ` Marco Gerards
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.