unused constants in i386/boot.h
PATCH 1/1 unused constants in i386/boot.h
Here's the patch to remove unused constants.
The real constants used are GRUB_BOOT_MACHINE_KERNEL_ADDR and GRUB_BOOT_MACHINE_KERNEL_SEG.
Best Regards,
Yves Blusseau
ChangeLog +5 -0
@@ -1,3 +1,8 @@ +2009-07-09 Yves BLUSSEAU <[email protected]> + + * 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 <[email protected]> * commands/search.c (search_file): Merge into ...
include/grub/i386/pc/boot.h +0 -6
@@ -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
Quoted 10 lines · Yves Blusseau
<!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 areGRUB_BOOT_MACHINE_KERNEL_ADDRand 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 :-)
Signature · 5 lines
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."
Quoted 12 lines · Yves Blusseau
Quoted 10 lines
<!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 areGRUB_BOOT_MACHINE_KERNEL_ADDRand GRUB_BOOT_MACHINE_KERNEL_SEG.<br>
Quoted 21 lines
Hi,
As long as
boot/i386/pc/boot.Shas 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 :-)
Signature · 13 lines
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 [email protected] 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
Quoting Yves Blusseau <[email protected]>:
Quoted 2 lines
Quoted 2 lines
As long as
boot/i386/pc/boot.Shas 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.
Quoted 9 lines
boot/i386/pc/boot.SDON'T use this macros.They're only defined in
i386/boot.hbut they are not used anywhere. The new name of this constants areGRUB_BOOT_MACHINE_KERNEL_ADDRandGRUB_BOOT_MACHINE_KERNEL_SEG.
So theGRUB_BOOT_MACHINE_KERNEL_ADDRESSandGRUB_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.
Signature · 2 lines
Regards, Pavel Roskin
Quoted 8 lines · Pavel Roskin
Quoting Yves Blusseau <[email protected]>:
Quoted 2 lines
Quoted 2 lines
As long as
boot/i386/pc/boot.Shas 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.
Signature · 5 lines
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."
Quoted 11 lines · Robert Millan
Quoted 8 lines · Pavel Roskin
Quoting Yves Blusseau <[email protected]>:
Quoted 2 lines
Quoted 2 lines
As long as
boot/i386/pc/boot.Shas 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.
Signature · 2 lines
Regards, Pavel Roskin
Pavel Roskin a écrit : 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 <[email protected]>: 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.
Quoted 1 line · Yves Blusseau
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.
Signature · 2 lines
Regards, Pavel Roskin