All of lore.kernel.org
 help / color / mirror / Atom feed
* multiboot take partial mmap
@ 2009-06-03 19:52 Andrey Valyaev
  2009-06-03 23:18 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Valyaev @ 2009-06-03 19:52 UTC (permalink / raw)
  To: grub-devel

Try create gub2 multiboot cd. 
My kernel worked fine with grub-legacy.

But encounter problem.
kernel receive mmap up to 1meg...
lsmmap command show full mmap.

multiboot fill mmap over grub_mmap_iterate, 
lsmmap get mmap over grub_machine_mmap_iterate.

May be machine_mmap is better?

Sometime, kernel, loaded from console, see full mmap.
from menu always fail.. :(

Help me, please!!!

PS: sorry for bad english.

-- 
Andrey Valyaev
http://mdf-i.blogspot.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-03 19:52 multiboot take partial mmap Andrey Valyaev
@ 2009-06-03 23:18 ` Vladimir 'phcoder' Serbinenko
  2009-06-04 20:07   ` Andrey Valyaev
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-03 23:18 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, Jun 3, 2009 at 9:52 PM, Andrey Valyaev <dron@osrc.info> wrote:
> Try create gub2 multiboot cd.
> My kernel worked fine with grub-legacy.
>
> But encounter problem.
> kernel receive mmap up to 1meg...
> lsmmap command show full mmap.
>
> multiboot fill mmap over grub_mmap_iterate,
> lsmmap get mmap over grub_machine_mmap_iterate.
>
> May be machine_mmap is better?
It's not. machine_mmap doesn't take into account possible badram and
hooks installed. Be sure to use latest svn and post your exact config
since I didn't have such a problem in my tests
>
> Sometime, kernel, loaded from console, see full mmap.
> from menu always fail.. :(
>
> Help me, please!!!
>
> PS: sorry for bad english.
>
> --
> Andrey Valyaev
> http://mdf-i.blogspot.com
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-03 23:18 ` Vladimir 'phcoder' Serbinenko
@ 2009-06-04 20:07   ` Andrey Valyaev
  2009-06-05  1:24     ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 10+ messages in thread
From: Andrey Valyaev @ 2009-06-04 20:07 UTC (permalink / raw)
  To: The development of GRUB 2

On Четверг 04 июня 2009 03:18:15 Vladimir 'phcoder' Serbinenko wrote:
> > My kernel worked fine with grub-legacy.
> > But encounter problem.
> > kernel receive mmap up to 1meg...
> Be sure to use latest svn and post your exact config
> since I didn't have such a problem in my tests

Sorry, it's my bug...
grub2 place modules to upper pages, but grub-legasy place modules after 
kernel.

I wrong check the modules location for searching temporary kernel memory.

mmap work.

Some question. Module mmap need only for command badram? my loader worked 
without mmap module.

PS: latest svn revision (from 2243) failed with message:

gcc -Icommands -I./commands -I. -I./include -I./include -Wall -W  -Wall -W -
Wshadow -Wpointer-arith -Wmissing-prototypes                  -Wundef -
Wstrict-prototypes -g -Os -falign-jumps=1 -falign-loops=1 -falign-functions=1 
-m32 -fno-stack-protector -mno-stack-arg-probe -fno-builtin -mrtd -mregparm=3 
-m32 -Werror -Wall -MD -c -o search_mod-commands_search.o commands/search.c
cc1: warnings being treated as errors
commands/search.c: In function 'search_fs':
commands/search.c:42: error: generating trampoline in object (requires 
executable stack)
commands/search.c: In function 'grub_cmd_search':
commands/search.c:105: error: generating trampoline in object (requires 
executable stack)
make[1]: *** [search_mod-commands_search.o] Error 1

$ gcc --version
gcc (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) 4.3.3

-- 
Andrey Valyaev
http://mdf-i.blogspot.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-04 20:07   ` Andrey Valyaev
@ 2009-06-05  1:24     ` Vladimir 'phcoder' Serbinenko
  2009-06-05  4:02       ` Andrey Valyaev
                         ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-05  1:24 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: Robert Millan

On Thu, Jun 4, 2009 at 10:07 PM, Andrey Valyaev<dron@osrc.info> wrote:
> On Четверг 04 июня 2009 03:18:15 Vladimir 'phcoder' Serbinenko wrote:
>> > My kernel worked fine with grub-legacy.
>> > But encounter problem.
>> > kernel receive mmap up to 1meg...
>> Be sure to use latest svn and post your exact config
>> since I didn't have such a problem in my tests
>
> Sorry, it's my bug...
> grub2 place modules to upper pages, but grub-legasy place modules after
> kernel.
>
> I wrong check the modules location for searching temporary kernel memory.
>
> mmap work.
Do you mean that memory map as passed by mainstream grub is ok?
>
> Some question. Module mmap need only for command badram?
No. It's needed for drivemap and ACPI spoofing too
> my loader worked
> without mmap module.
Do you mean that you replaced grub_memory_mmap_iterate with
grub_machine_memory_mmap_iterate? As I already said it's NOT correct.
Can you give me more details in a personal mail in Russian so language
wouldn't be a problem for you?
>
> PS: latest svn revision (from 2243) failed with message:
>
> gcc -Icommands -I./commands -I. -I./include -I./include -Wall -W  -Wall -W -
> Wshadow -Wpointer-arith -Wmissing-prototypes                  -Wundef -
> Wstrict-prototypes -g -Os -falign-jumps=1 -falign-loops=1 -falign-functions=1
> -m32 -fno-stack-protector -mno-stack-arg-probe -fno-builtin -mrtd -mregparm=3
> -m32 -Werror -Wall -MD -c -o search_mod-commands_search.o commands/search.c
> cc1: warnings being treated as errors
> commands/search.c: In function 'search_fs':
> commands/search.c:42: error: generating trampoline in object (requires
> executable stack)
> commands/search.c: In function 'grub_cmd_search':
> commands/search.c:105: error: generating trampoline in object (requires
> executable stack)
> make[1]: *** [search_mod-commands_search.o] Error 1
>
> $ gcc --version
> gcc (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) 4.3.3
>
This is because of commit 2243 by Robert Millan. The commit was about
floppy probing but also added -Wall -Werror to search.mod
I myself stepped on this mine once with adding -Wall -Werror to my xnu module.
I'll revert this change (only -Werror, not the rest of commit) as it
causes build error for all gentoo users. Sorry, Robert, but we can't
enable -Werror and still have nested functions. I don't think we
should use -Werror at all because different compilers, versions or
modifications of same compiler cause different warnings and imho
maintaintaining cost is too high and breaks are too frequent. Or
perhaps we can enable -Werror only on some compilers? Or perhaps
anyone has a better idea
> --
> Andrey Valyaev
> http://mdf-i.blogspot.com
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-05  1:24     ` Vladimir 'phcoder' Serbinenko
@ 2009-06-05  4:02       ` Andrey Valyaev
  2009-06-05  9:10       ` Colin Watson
  2009-06-05 16:45       ` Robert Millan
  2 siblings, 0 replies; 10+ messages in thread
From: Andrey Valyaev @ 2009-06-05  4:02 UTC (permalink / raw)
  To: The development of GRUB 2

On Пятница 05 июня 2009 05:24:09 Vladimir 'phcoder' Serbinenko wrote:

> > Sorry, it's my bug...
> > grub2 place modules to upper pages, but grub-legasy place modules after
> > kernel.
> > I wrong check the modules location for searching temporary kernel memory.
> > mmap work.
> Do you mean that memory map as passed by mainstream grub is ok?
>
> > my loader worked
> > without mmap module.
> Do you mean that you replaced grub_memory_mmap_iterate with
> grub_machine_memory_mmap_iterate? As I already said it's NOT correct.

No, i use r2242 without modification.

> Can you give me more details in a personal mail in Russian so language
> wouldn't be a problem for you?

Thank's.... :)

-- 
Andrey Valyaev
http://mdf-i.blogspot.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-05  1:24     ` Vladimir 'phcoder' Serbinenko
  2009-06-05  4:02       ` Andrey Valyaev
@ 2009-06-05  9:10       ` Colin Watson
  2009-06-08 20:43         ` Vladimir 'phcoder' Serbinenko
  2009-06-05 16:45       ` Robert Millan
  2 siblings, 1 reply; 10+ messages in thread
From: Colin Watson @ 2009-06-05  9:10 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: Robert Millan

On Fri, Jun 05, 2009 at 03:24:09AM +0200, Vladimir 'phcoder' Serbinenko wrote:
> On Thu, Jun 4, 2009 at 10:07 PM, Andrey Valyaev<dron@osrc.info> wrote:
> > PS: latest svn revision (from 2243) failed with message:
> >
> > gcc -Icommands -I./commands -I. -I./include -I./include -Wall -W  -Wall -W -
> > Wshadow -Wpointer-arith -Wmissing-prototypes                  -Wundef -
> > Wstrict-prototypes -g -Os -falign-jumps=1 -falign-loops=1 -falign-functions=1
> > -m32 -fno-stack-protector -mno-stack-arg-probe -fno-builtin -mrtd -mregparm=3
> > -m32 -Werror -Wall -MD -c -o search_mod-commands_search.o commands/search.c
> > cc1: warnings being treated as errors
> > commands/search.c: In function 'search_fs':
> > commands/search.c:42: error: generating trampoline in object (requires
> > executable stack)
> > commands/search.c: In function 'grub_cmd_search':
> > commands/search.c:105: error: generating trampoline in object (requires
> > executable stack)
> > make[1]: *** [search_mod-commands_search.o] Error 1
> >
> > $ gcc --version
> > gcc (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) 4.3.3
> >
> This is because of commit 2243 by Robert Millan. The commit was about
> floppy probing but also added -Wall -Werror to search.mod
> I myself stepped on this mine once with adding -Wall -Werror to my xnu module.
> I'll revert this change (only -Werror, not the rest of commit) as it
> causes build error for all gentoo users. Sorry, Robert, but we can't
> enable -Werror and still have nested functions. I don't think we
> should use -Werror at all because different compilers, versions or
> modifications of same compiler cause different warnings and imho
> maintaintaining cost is too high and breaks are too frequent. Or
> perhaps we can enable -Werror only on some compilers? Or perhaps
> anyone has a better idea

You could use -Wno-trampolines (IIRC that's the spelling) on Gentoo's
patched GCC; it's generally good to minimise unwanted warnings even if
they aren't errors. Here's the macro I use in man-db to add GCC warning
options:

  # man-gcc-warning.m4 serial 1
  dnl MAN_GCC_WARNING(WARNING)
  dnl Add -WWARNING to CFLAGS if it is supported by the compiler.
  AC_DEFUN([MAN_GCC_WARNING],
  [man_saved_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -W$1"
   AC_CACHE_CHECK([that GCC supports -W$1],
     [AS_TR_SH([man_cv_gcc_warning_$1])],
     [AS_TR_SH([man_cv_gcc_warning_$1])=no
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
                        [AS_TR_SH([man_cv_gcc_warning_$1])=yes])])
   if test "$AS_TR_SH([man_cv_gcc_warning_$1])" = no; then
     CFLAGS="$man_saved_CFLAGS"
   fi]) # MAN_GCC_WARNING

I then use this in configure.ac:

  if test "$GCC" = yes
  then
          MAN_GCC_WARNING([]) # -W
          MAN_GCC_WARNING([pointer-arith])
          MAN_GCC_WARNING([write-strings])
          MAN_GCC_WARNING([strict-prototypes])
          MAN_GCC_WARNING([shadow])
          MAN_GCC_WARNING([format-security])
          MAN_GCC_WARNING([no-missing-field-initializers])
  fi

Feel free to use and adjust to taste if you want.

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-05  1:24     ` Vladimir 'phcoder' Serbinenko
  2009-06-05  4:02       ` Andrey Valyaev
  2009-06-05  9:10       ` Colin Watson
@ 2009-06-05 16:45       ` Robert Millan
  2009-06-05 17:03         ` Colin Watson
  2 siblings, 1 reply; 10+ messages in thread
From: Robert Millan @ 2009-06-05 16:45 UTC (permalink / raw)
  To: Vladimir 'phcoder' Serbinenko; +Cc: The development of GRUB 2

On Fri, Jun 05, 2009 at 03:24:09AM +0200, Vladimir 'phcoder' Serbinenko wrote:
> > gcc -Icommands -I./commands -I. -I./include -I./include -Wall -W  -Wall -W -
> > Wshadow -Wpointer-arith -Wmissing-prototypes                  -Wundef -
> > Wstrict-prototypes -g -Os -falign-jumps=1 -falign-loops=1 -falign-functions=1
> > -m32 -fno-stack-protector -mno-stack-arg-probe -fno-builtin -mrtd -mregparm=3
> > -m32 -Werror -Wall -MD -c -o search_mod-commands_search.o commands/search.c
> > cc1: warnings being treated as errors
> > commands/search.c: In function 'search_fs':
> > commands/search.c:42: error: generating trampoline in object (requires
> > executable stack)
> > commands/search.c: In function 'grub_cmd_search':
> > commands/search.c:105: error: generating trampoline in object (requires
> > executable stack)
> > make[1]: *** [search_mod-commands_search.o] Error 1
> >
> > $ gcc --version
> > gcc (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) 4.3.3
> >
> This is because of commit 2243 by Robert Millan. The commit was about
> floppy probing but also added -Wall -Werror to search.mod
> I myself stepped on this mine once with adding -Wall -Werror to my xnu module.
> I'll revert this change (only -Werror, not the rest of commit) as it
> causes build error for all gentoo users. Sorry, Robert, but we can't
> enable -Werror and still have nested functions. I don't think we
> should use -Werror at all because different compilers, versions or
> modifications of same compiler cause different warnings and imho
> maintaintaining cost is too high and breaks are too frequent. Or
> perhaps we can enable -Werror only on some compilers? Or perhaps
> anyone has a better idea

Unfixed warnings have given us MUCH worse problems than build failures.

I'm talking countless hours of debugging here.

Why exactly does gcc generate a warning because of nested functions?  Is
there no way to fix this?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-05 16:45       ` Robert Millan
@ 2009-06-05 17:03         ` Colin Watson
  0 siblings, 0 replies; 10+ messages in thread
From: Colin Watson @ 2009-06-05 17:03 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: Vladimir 'phcoder' Serbinenko

On Fri, Jun 05, 2009 at 06:45:54PM +0200, Robert Millan wrote:
> Why exactly does gcc generate a warning because of nested functions?  Is
> there no way to fix this?

It's a Gentoo-specific patch:

  http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.4.0/gentoo/00_all_gcc-trampolinewarn.patch?rev=1.1&view=markup

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-05  9:10       ` Colin Watson
@ 2009-06-08 20:43         ` Vladimir 'phcoder' Serbinenko
  2009-06-08 21:03           ` Colin Watson
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-08 20:43 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Jun 5, 2009 at 11:10 AM, Colin Watson<cjwatson@ubuntu.com> wrote:
> On Fri, Jun 05, 2009 at 03:24:09AM +0200, Vladimir 'phcoder' Serbinenko wrote:
>> On Thu, Jun 4, 2009 at 10:07 PM, Andrey Valyaev<dron@osrc.info> wrote:
>> > PS: latest svn revision (from 2243) failed with message:
>> >
>> > gcc -Icommands -I./commands -I. -I./include -I./include -Wall -W  -Wall -W -
>> > Wshadow -Wpointer-arith -Wmissing-prototypes                  -Wundef -
>> > Wstrict-prototypes -g -Os -falign-jumps=1 -falign-loops=1 -falign-functions=1
>> > -m32 -fno-stack-protector -mno-stack-arg-probe -fno-builtin -mrtd -mregparm=3
>> > -m32 -Werror -Wall -MD -c -o search_mod-commands_search.o commands/search.c
>> > cc1: warnings being treated as errors
>> > commands/search.c: In function 'search_fs':
>> > commands/search.c:42: error: generating trampoline in object (requires
>> > executable stack)
>> > commands/search.c: In function 'grub_cmd_search':
>> > commands/search.c:105: error: generating trampoline in object (requires
>> > executable stack)
>> > make[1]: *** [search_mod-commands_search.o] Error 1
>> >
>> > $ gcc --version
>> > gcc (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) 4.3.3
>> >
>> This is because of commit 2243 by Robert Millan. The commit was about
>> floppy probing but also added -Wall -Werror to search.mod
>> I myself stepped on this mine once with adding -Wall -Werror to my xnu module.
>> I'll revert this change (only -Werror, not the rest of commit) as it
>> causes build error for all gentoo users. Sorry, Robert, but we can't
>> enable -Werror and still have nested functions. I don't think we
>> should use -Werror at all because different compilers, versions or
>> modifications of same compiler cause different warnings and imho
>> maintaintaining cost is too high and breaks are too frequent. Or
>> perhaps we can enable -Werror only on some compilers? Or perhaps
>> anyone has a better idea
>
> You could use -Wno-trampolines (IIRC that's the spelling) on Gentoo's
> patched GCC; it's generally good to minimise unwanted warnings even if
> they aren't errors. Here's the macro I use in man-db to add GCC warning
> options:
>
>  # man-gcc-warning.m4 serial 1
>  dnl MAN_GCC_WARNING(WARNING)
>  dnl Add -WWARNING to CFLAGS if it is supported by the compiler.
>  AC_DEFUN([MAN_GCC_WARNING],
>  [man_saved_CFLAGS="$CFLAGS"
>   CFLAGS="$CFLAGS -W$1"
>   AC_CACHE_CHECK([that GCC supports -W$1],
>     [AS_TR_SH([man_cv_gcc_warning_$1])],
>     [AS_TR_SH([man_cv_gcc_warning_$1])=no
>      AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
>                        [AS_TR_SH([man_cv_gcc_warning_$1])=yes])])
>   if test "$AS_TR_SH([man_cv_gcc_warning_$1])" = no; then
>     CFLAGS="$man_saved_CFLAGS"
>   fi]) # MAN_GCC_WARNING
>
> I then use this in configure.ac:
>
>  if test "$GCC" = yes
>  then
>          MAN_GCC_WARNING([]) # -W
>          MAN_GCC_WARNING([pointer-arith])
>          MAN_GCC_WARNING([write-strings])
>          MAN_GCC_WARNING([strict-prototypes])
>          MAN_GCC_WARNING([shadow])
>          MAN_GCC_WARNING([format-security])
>          MAN_GCC_WARNING([no-missing-field-initializers])
>  fi
>
> Feel free to use and adjust to taste if you want.
I think we could use it with -W, -Wall, -Wno-trampolines. Is everybody
ok with that? Is this code copyrighted by you?
>
> --
> Colin Watson                                       [cjwatson@ubuntu.com]
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: multiboot take partial mmap
  2009-06-08 20:43         ` Vladimir 'phcoder' Serbinenko
@ 2009-06-08 21:03           ` Colin Watson
  0 siblings, 0 replies; 10+ messages in thread
From: Colin Watson @ 2009-06-08 21:03 UTC (permalink / raw)
  To: The development of GRUB 2

On Mon, Jun 08, 2009 at 10:43:42PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> Is this code copyrighted by you?

I think it's really too obvious to be copyrightable, but if it's
copyrightable by anyone it's by me, GPLv2 or later. I have an assignment
pending although the paperwork doesn't seem to have arrived yet (though
I was away for a couple of weeks; maybe I should have another dig
through the post pile ...)

-- 
Colin Watson                                       [cjwatson@ubuntu.com]



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-06-08 21:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-03 19:52 multiboot take partial mmap Andrey Valyaev
2009-06-03 23:18 ` Vladimir 'phcoder' Serbinenko
2009-06-04 20:07   ` Andrey Valyaev
2009-06-05  1:24     ` Vladimir 'phcoder' Serbinenko
2009-06-05  4:02       ` Andrey Valyaev
2009-06-05  9:10       ` Colin Watson
2009-06-08 20:43         ` Vladimir 'phcoder' Serbinenko
2009-06-08 21:03           ` Colin Watson
2009-06-05 16:45       ` Robert Millan
2009-06-05 17:03         ` Colin Watson

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.