All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] unused constants in i386/boot.h
@ 2009-07-09  8:45 Yves Blusseau
  2009-07-10 17:36 ` Robert Millan
  0 siblings, 1 reply; 8+ messages in thread
From: Yves Blusseau @ 2009-07-09  8:45 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/html, Size: 437 bytes --]

[-- Attachment #2: unused_constants.diff --]
[-- Type: text/plain, Size: 1011 bytes --]

diff --git a/ChangeLog b/ChangeLog
index 3fe273f..f8b098a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-09  Yves BLUSSEAU  <yves.grub-devel@zetam.org>
+
+	* include/grub/i386/pc/boot.h: Remove unused contants
+	GRUB_BOOT_MACHINE_KERNEL_ADDRESS and GRUB_BOOT_MACHINE_KERNEL_SEGMENT
+
 2009-07-07  Pavel Roskin  <proski@gnu.org>
 
 	* commands/search.c (search_file): Merge into ...
diff --git a/include/grub/i386/pc/boot.h b/include/grub/i386/pc/boot.h
index f35cb3a..3a5606a 100644
--- a/include/grub/i386/pc/boot.h
+++ b/include/grub/i386/pc/boot.h
@@ -34,15 +34,9 @@
 /* The offset of BOOT_DRIVE.  */
 #define GRUB_BOOT_MACHINE_BOOT_DRIVE	0x4c
 
-/* The offset of KERNEL_ADDRESS.  */
-#define GRUB_BOOT_MACHINE_KERNEL_ADDRESS	0x40
-
 /* The offset of KERNEL_SECTOR.  */
 #define GRUB_BOOT_MACHINE_KERNEL_SECTOR	0x44
 
-/* The offset of KERNEL_SEGMENT.  */
-#define GRUB_BOOT_MACHINE_KERNEL_SEGMENT	0x42
-
 /* The offset of BOOT_DRIVE_CHECK.  */
 #define GRUB_BOOT_MACHINE_DRIVE_CHECK	0x4e
 

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

* Re: [PATCH] unused constants in i386/boot.h
  2009-07-09  8:45 [PATCH] unused constants in i386/boot.h Yves Blusseau
@ 2009-07-10 17:36 ` Robert Millan
  2009-07-12  9:02   ` Yves Blusseau
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Millan @ 2009-07-10 17:36 UTC (permalink / raw)
  To: The development of GRUB 2

On Thu, Jul 09, 2009 at 10:45:43AM +0200, Yves Blusseau wrote:
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> </head>
> <body bgcolor="#ffffff" text="#000000">
> <div class="moz-text-flowed"
>  style="font-family: -moz-fixed; font-size: 13px;" lang="x-western">Here's
> the patch to remove unused constants.<br>
> The real constants used are GRUB_BOOT_MACHINE_KERNEL_ADDR and
> GRUB_BOOT_MACHINE_KERNEL_SEG.<br>

Hi,

As long as boot/i386/pc/boot.S has the variables whose offset these macros
are describing, I think it's fine to keep them.

Btw, please include a non-HTML version in your emails :-)

-- 
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] 8+ messages in thread

* Re: [PATCH] unused constants in i386/boot.h
  2009-07-10 17:36 ` Robert Millan
@ 2009-07-12  9:02   ` Yves Blusseau
  2009-07-12 13:21     ` Pavel Roskin
  0 siblings, 1 reply; 8+ messages in thread
From: Yves Blusseau @ 2009-07-12  9:02 UTC (permalink / raw)
  To: The development of GRUB 2

> On Thu, Jul 09, 2009 at 10:45:43AM +0200, Yves Blusseau wrote:
>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>> <html>
>> <head>
>> </head>
>> <body bgcolor="#ffffff" text="#000000">
>> <div class="moz-text-flowed"
>> style="font-family: -moz-fixed; font-size: 13px;" lang="x- 
>> western">Here's
>> the patch to remove unused constants.<br>
>> The real constants used are GRUB_BOOT_MACHINE_KERNEL_ADDR and
>> GRUB_BOOT_MACHINE_KERNEL_SEG.<br>
>
> Hi,
>
> As long as boot/i386/pc/boot.S has the variables whose offset these  
> macros
> are describing, I think it's fine to keep them.
>
> Btw, please include a non-HTML version in your emails :-)
>
> -- 
> 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."
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel

Hi

boot/i386/pc/boot.S DON'T use this macros.

They're only defined in i386/boot.h but they are not used anywhere.  
The new name of this constants are GRUB_BOOT_MACHINE_KERNEL_ADDR and  
GRUB_BOOT_MACHINE_KERNEL_SEG.
So the GRUB_BOOT_MACHINE_KERNEL_ADDRESS and  
GRUB_BOOT_MACHINE_KERNEL_SEGMENT (see the difference with the  
constants below) constants can be definitively removed, and it's  
better to remove them to avoid confusion.

Yves Blusseau



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

* Re: [PATCH] unused constants in i386/boot.h
  2009-07-12  9:02   ` Yves Blusseau
@ 2009-07-12 13:21     ` Pavel Roskin
  2009-07-14 17:37       ` Robert Millan
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Roskin @ 2009-07-12 13:21 UTC (permalink / raw)
  To: grub-devel

Quoting Yves Blusseau <blusseau@zetam.org>:

>> As long as boot/i386/pc/boot.S has the variables whose offset these macros
>> are describing, I think it's fine to keep them.

I'd rather not keep the macros that are not used outside boot.S.  They  
give a wrong impression that somebody somewhere needs to know that  
offset.

As for the macros that are used, we should always have assembler  
statements ensuring that the described field is indeed there.

> boot/i386/pc/boot.S DON'T use this macros.
>
> They're only defined in i386/boot.h but they are not used anywhere. The
> new name of this constants are GRUB_BOOT_MACHINE_KERNEL_ADDR and
> GRUB_BOOT_MACHINE_KERNEL_SEG.
> So the GRUB_BOOT_MACHINE_KERNEL_ADDRESS and
> GRUB_BOOT_MACHINE_KERNEL_SEGMENT (see the difference with the constants
> below) constants can be definitively removed, and it's better to remove
> them to avoid confusion.

I believe we should use every such removal to simplify the code.  We  
can now use direct jump instead of an indirect.  That would hopefully  
save us two bytes we need to implement fat32 support.

I think we should also remove the version from boot.S, as it's not  
being checked anywhere.

I realize that somebody might suggest adding such check, but I'd  
rather append those to bytes at the end of the bootsector.  The extra  
bytes would be checked and stripped by grub-setup, so that they don't  
take space in the actual bootsector.  Also, if we add such check, we  
need a very clear message in i386/boot.h requiring the version to be  
updated whenever any change to the offsets is made.  The version  
number should be a plain integer, perhaps 16-bit, without distinction  
between major and minor versions, so that nobody needs to think where  
their change calls for a major version increase.

-- 
Regards,
Pavel Roskin



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

* Re: [PATCH] unused constants in i386/boot.h
  2009-07-12 13:21     ` Pavel Roskin
@ 2009-07-14 17:37       ` Robert Millan
  2009-07-14 18:55         ` Pavel Roskin
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Millan @ 2009-07-14 17:37 UTC (permalink / raw)
  To: The development of GRUB 2

On Sun, Jul 12, 2009 at 09:21:07AM -0400, Pavel Roskin wrote:
> Quoting Yves Blusseau <blusseau@zetam.org>:
>
>>> As long as boot/i386/pc/boot.S has the variables whose offset these macros
>>> are describing, I think it's fine to keep them.
>
> I'd rather not keep the macros that are not used outside boot.S.  They  
> give a wrong impression that somebody somewhere needs to know that  
> offset.

Ok, let's remove them.  I don't feel strongly about it.

-- 
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] 8+ messages in thread

* Re: [PATCH] unused constants in i386/boot.h
  2009-07-14 17:37       ` Robert Millan
@ 2009-07-14 18:55         ` Pavel Roskin
  2009-07-15  7:36           ` Yves Blusseau
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Roskin @ 2009-07-14 18:55 UTC (permalink / raw)
  To: The development of GRUB 2

On Tue, 2009-07-14 at 19:37 +0200, Robert Millan wrote:
> On Sun, Jul 12, 2009 at 09:21:07AM -0400, Pavel Roskin wrote:
> > Quoting Yves Blusseau <blusseau@zetam.org>:
> >
> >>> As long as boot/i386/pc/boot.S has the variables whose offset these macros
> >>> are describing, I think it's fine to keep them.
> >
> > I'd rather not keep the macros that are not used outside boot.S.  They  
> > give a wrong impression that somebody somewhere needs to know that  
> > offset.
> 
> Ok, let's remove them.  I don't feel strongly about it.

I'm working on a patch series that would remove unnecessary stuff and
widen the BPB.

-- 
Regards,
Pavel Roskin



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

* Re: [PATCH] unused constants in i386/boot.h
  2009-07-14 18:55         ` Pavel Roskin
@ 2009-07-15  7:36           ` Yves Blusseau
  2009-07-15 17:46             ` Pavel Roskin
  0 siblings, 1 reply; 8+ messages in thread
From: Yves Blusseau @ 2009-07-15  7:36 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/html, Size: 1466 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3313 bytes --]

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

* Re: [PATCH] unused constants in i386/boot.h
  2009-07-15  7:36           ` Yves Blusseau
@ 2009-07-15 17:46             ` Pavel Roskin
  0 siblings, 0 replies; 8+ messages in thread
From: Pavel Roskin @ 2009-07-15 17:46 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, 2009-07-15 at 09:36 +0200, Yves Blusseau wrote:

> Cool, i have planed to do it but if you do the job it'll be great !

It's committed.  I'm looking at the sanity checks in grub-setup now.

By the way, please do something about your mailer.  You messages come in
HTML format, which makes it hard to quote them.

-- 
Regards,
Pavel Roskin



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

end of thread, other threads:[~2009-07-15 17:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-09  8:45 [PATCH] unused constants in i386/boot.h Yves Blusseau
2009-07-10 17:36 ` Robert Millan
2009-07-12  9:02   ` Yves Blusseau
2009-07-12 13:21     ` Pavel Roskin
2009-07-14 17:37       ` Robert Millan
2009-07-14 18:55         ` Pavel Roskin
2009-07-15  7:36           ` Yves Blusseau
2009-07-15 17:46             ` Pavel Roskin

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.