All of lore.kernel.org
 help / color / mirror / Atom feed
* 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

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.