Re: [PATCH] grub-probe -t prefix, -t all

2007-11-09 Thread Christian Franke
Robert Millan wrote: ... Note that make_system_path_relative_to_its_root() actually exists :-/ Sorry, I didn't search update-grub_lib.in :-\ Apparently both grub_get_prefix() and make_system_path_relative_to_its_root() use the same algorithm. Both do not work on Cygwin due to special (mu

Re: [PATCH] Fix eisa_mmap evaluation, add memory existence check

2007-11-09 Thread Christian Franke
Marco Gerards wrote: ... +static int +addr_is_valid (grub_addr_t addr) +{ + volatile unsigned char * p = (volatile unsigned char *)addr; Why volatile? I have the feeling it is not needed. + unsigned char x, y; + x = *p; + *p = x ^ 0xcf; + y = *p; + *p = x; + return y == (x ^

Re: [PATCH] grub-probe -t prefix, -t all

2007-11-09 Thread Robert Millan
On Fri, Nov 09, 2007 at 10:42:31PM +0100, Christian Franke wrote: > Robert Millan wrote: > >On Mon, Oct 29, 2007 at 09:20:00PM +0100, Christian Franke wrote: > > > >>This patch adds '-t prefix', '-t all', and allows multiple -t options to > >>be specified. > >> > >>'-t prefix' was initially adde

Re: [PATCH] Fix eisa_mmap evaluation, add memory existence check

2007-11-09 Thread Robert Millan
On Fri, Nov 09, 2007 at 10:53:23PM +0100, Christian Franke wrote: > >Ah, and why 0xcf instead of 0xff ? > > > > > > ... or 0xaa or 0x55. 0xaa and 0x55 are typicaly used directly in memory because every bit is negated, which is precisely what `^ 0xff' would do. -- Robert Millan I know my rig

Re: [PATCH] Fix eisa_mmap evaluation, add memory existence check

2007-11-09 Thread Christian Franke
Robert Millan wrote: On Tue, Oct 23, 2007 at 09:06:16PM +0200, Christian Franke wrote: +/* Check memory address */ +static int +addr_is_valid (grub_addr_t addr) +{ + volatile unsigned char * p = (volatile unsigned char *)addr; + unsigned char x, y; + x = *p; + *p = x ^ 0xcf; + y = *p; +

Re: [PATCH] grub-probe -t prefix, -t all

2007-11-09 Thread Christian Franke
Robert Millan wrote: On Mon, Oct 29, 2007 at 09:20:00PM +0100, Christian Franke wrote: This patch adds '-t prefix', '-t all', and allows multiple -t options to be specified. '-t prefix' was initially added to test grub_get_prefix() on Cygwin, but may be useful in scripts. What does

Re: grub2 ChangeLog term/i386/pc/serial.c

2007-11-09 Thread Robert Millan
On Fri, Nov 09, 2007 at 04:26:02PM +0100, Marco Gerards wrote: > > > > I always thought the Right Way to do this would be implement it in GCC, > > so that you can do things like: > > > > __some_magic__(PORT_ADDR) |= 0x80; > > > > which is much more beatufil than either of: > > > > outb (PORT_AD

Re: [PATCH] fix serial console on LinuxBIOS

2007-11-09 Thread Robert Millan
On Fri, Nov 09, 2007 at 04:30:44PM +0100, Marco Gerards wrote: > Robert Millan <[EMAIL PROTECTED]> writes: > > > This patch fixes serial console on LinuxBIOS. > > > > I'd appreciate comments (specially on the > > addition). > > > > -- > > Robert Millan > > > > I know my rights; I want my phone

Re: PC partitions and big disks

2007-11-09 Thread Robert Millan
On Fri, Nov 09, 2007 at 04:33:47PM +0100, Marco Gerards wrote: > Robert Millan <[EMAIL PROTECTED]> writes: > > > This should make the error much clearer when partition exceeds 2 TiB on a PC > > partition map (currently, all user gets is a "out of partition" error which > > is hard to figure out if

Re: [PATCH] Add host open devicename check

2007-11-09 Thread Robert Millan
On Fri, Nov 09, 2007 at 10:17:19PM +0100, Marco Gerards wrote: > Robert Millan <[EMAIL PROTECTED]> writes: > > > On Thu, Oct 25, 2007 at 09:51:38PM +0200, Christian Franke wrote: > >> static grub_err_t > >> -grub_host_open (const char *name __attribute((unused)), grub_disk_t disk) > >> +grub_host

Re: [PATCH] Fix support for recent versions of GNU ld

2007-11-09 Thread Robert Millan
On Mon, Oct 29, 2007 at 10:54:08PM -0400, Pavel Roskin wrote: > * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Strip section > .note.gnu.build-id created by the recent versions of GNU ld. > It causes the test fail. Why does the test fail with new ld ? I don't see any strip command before the objcopy,

Re: [PATCH] Add host open devicename check

2007-11-09 Thread Marco Gerards
Robert Millan <[EMAIL PROTECTED]> writes: > On Thu, Oct 25, 2007 at 09:51:38PM +0200, Christian Franke wrote: >> static grub_err_t >> -grub_host_open (const char *name __attribute((unused)), grub_disk_t disk) >> +grub_host_open (const char *name, grub_disk_t disk) >> { >> + if (grub_strcmp(name

Re: [PATCH] grub-probe -t prefix, -t all

2007-11-09 Thread Robert Millan
On Mon, Oct 29, 2007 at 09:20:00PM +0100, Christian Franke wrote: > This patch adds '-t prefix', '-t all', and allows multiple -t options to > be specified. > > '-t prefix' was initially added to test grub_get_prefix() on Cygwin, but > may be useful in scripts. What does -t prefix do? Is it th

Re: [PATCH] Allow build without dirent.d_type, fix "ls (host)" crash

2007-11-09 Thread Christian Franke
Marco Gerards wrote: ... +static int +is_dir(const char *path, const char *name) is_dir ( OK. Too many projects, too many policies, sorry :-) +{ + int len1 = strlen(path), len2 = strlen(name); Please split this up. Or even better use separate declarations and code.

Re: [PATCH] Add host open devicename check

2007-11-09 Thread Robert Millan
On Thu, Oct 25, 2007 at 09:51:38PM +0200, Christian Franke wrote: > static grub_err_t > -grub_host_open (const char *name __attribute((unused)), grub_disk_t disk) > +grub_host_open (const char *name, grub_disk_t disk) > { > + if (grub_strcmp(name, "host")) > + return grub_error (GRUB_ERR_UN

Re: [PATCH] Fix eisa_mmap evaluation, add memory existence check

2007-11-09 Thread Robert Millan
On Tue, Oct 23, 2007 at 09:06:16PM +0200, Christian Franke wrote: > +/* Check memory address */ > +static int > +addr_is_valid (grub_addr_t addr) > +{ > + volatile unsigned char * p = (volatile unsigned char *)addr; > + unsigned char x, y; > + x = *p; > + *p = x ^ 0xcf; > + y = *p; > + *p = x

Re: [PATCH] Fix packing issue of machine_mmap_entry

2007-11-09 Thread Christian Franke
Marco Gerards wrote: ... Add compile time assert to check packing. Can you remove the compile time assert? Done. We usually check stuff like this using configure. If you can send in a patch for configure.ac, that would be appreciated. Yes, but be patient. The configure

Re: PC partitions and big disks

2007-11-09 Thread Marco Gerards
Robert Millan <[EMAIL PROTECTED]> writes: > This should make the error much clearer when partition exceeds 2 TiB on a PC > partition map (currently, all user gets is a "out of partition" error which > is hard to figure out if you're unaware of the 2 TiB limit). > > Comments? See below :-) > --

Re: [PATCH] fix serial console on LinuxBIOS

2007-11-09 Thread Marco Gerards
Robert Millan <[EMAIL PROTECTED]> writes: > This patch fixes serial console on LinuxBIOS. > > I'd appreciate comments (specially on the addition). > > -- > Robert Millan > > I know my rights; I want my phone call! > What use is a phone call, if you are unable to speak? > (as seen on /.) > No

Re: grub2 ChangeLog term/i386/pc/serial.c

2007-11-09 Thread Marco Gerards
Robert Millan <[EMAIL PROTECTED]> writes: > On Wed, Nov 07, 2007 at 10:35:17PM +0200, Vesa Jääskeläinen wrote: >> > grub_inb() and grub_outb() are based on the inb()/outb() implementation >> > from glibc headers, so I kept the same arguments for consistency. >> >> I see... Once again inconsistenc

Re: [PATCH] Avoid crash on empty menu

2007-11-09 Thread Marco Gerards
Christian Franke <[EMAIL PROTECTED]> writes: > If grub.cfg does not contain any valid menuentry statements, an empty > menu is opened. > grub-emu crashes (and real grub behaves "interesting") if the first > entry is selected. > > The attached patch adds the missing nullptr checks. > > An alternati

Re: [PATCH] Fix grub-emu curses KEY_* mapping

2007-11-09 Thread Marco Gerards
Christian Franke <[EMAIL PROTECTED]> writes: > Curses function keys do not work in grub-emu, this patch fixes this in > grub_ncurses_getkey(). Ha! I once noticed this and forgot to document this bug :( > Another approach would be to remove the scancode translation in > grub_console_getkey(), an

Re: [PATCH] grub2 for Cygwin

2007-11-09 Thread Christian Franke
Hi, Marco Gerards wrote: > > ... > > Busy with other projects, I decided to "release early" in one large > > patch. > > If desired, I can send smaller patches in 2-3 weeks or so. > > > > Meantime, comments on the large patch are appreciated. > > > > You also sent in some small patches. Can I a

Re: [PATCH] Add host open devicename check

2007-11-09 Thread Marco Gerards
Christian Franke <[EMAIL PROTECTED]> writes: > grub-emu ls command does not list any partitions. > > Device scan in grub_disk_open() stops early because grub_host_open() > returns success on all device names. > > Christian > > 2007-10-25 Christian Franke <[EMAIL PROTECTED]> > > * disk/host

Re: [PATCH] Allow build without dirent.d_type, fix "ls (host)" crash

2007-11-09 Thread Marco Gerards
Christian Franke <[EMAIL PROTECTED]> writes: > Second version of the patch. > > It fixes another bug: missing fseek() in grub_hostfs_read(). > > Christian > > 2007-11-02 Christian Franke <[EMAIL PROTECTED]> > > * util/hostfs.c (is_dir): New function. > (grub_hostfs_dir): Handle miss

Re: [PATCH] Fix eisa_mmap evaluation, add memory existence check

2007-11-09 Thread Marco Gerards
Christian Franke <[EMAIL PROTECTED]> writes: > This patch fixes the broken evaluation of the E801 EISA memory > map. The shift was too much, the high word is already shifted :-) The > bug was hidden until the E820 memory map evaluation was broken due to > the struct packing issue fixed in my last

Re: [PATCH] Fix packing issue of machine_mmap_entry

2007-11-09 Thread Marco Gerards
Christian Franke <[EMAIL PROTECTED]> writes: > First patch related to the Cygwin port: > > struct machine_mmap_entry is sensitive to packing of 64 bit values > which apparently differs between gcc releases. Thanks! > Christian > > 2007-10-22 Christian Franke <[EMAIL PROTECTED]> > > * inc

Re: [PATCH] grub2 for Cygwin

2007-11-09 Thread Marco Gerards
Christian Franke <[EMAIL PROTECTED]> writes: Hi, [...] >> I see... Actually this patch has to be splitted to multiple different >> patches as not all changes seem to be related to Cygwin building. And it >> makes it much easier to get approved in smaller slices. And for each >> patch, describe i