[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocation
From: |
Vladimir 'phcoder' Serbinenko |
Subject: |
Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations |
Date: |
Thu, 16 Jul 2009 00:41:59 +0200 |
On Wed, Jul 15, 2009 at 5:33 PM, Pavel Roskin<address@hidden> wrote:
> On Tue, 2009-07-14 at 21:00 -0400, Pavel Roskin wrote:
>> ChangeLog:
>>
>> * boot/i386/pc/boot.S: Declare 0x0-0x7c00 as a discardable .bss
>> segment. Eliminate ABS, rely on the assembler knowing correct
>> addresses. Eliminate .bss segment for the kernel, use direct
>> jump to the kernel address.
>
> I managed to install a Darwin cross-compiler, and it turn out it won't
> accept .bss in assembler files. Using real addresses would be very,
> very nice, but we'll need to find a portable way. Maybe grub-macho2img
> should be taught to cut away sections filled with zeroes.
>
AFAIR during compilation process relocation entries are preserved and
resolved only in the last step. Now thinking it should work even
without .bss. Anyway don't care much about compiling bootsectors under
darwin. Apple's CC generates longer opcodes which breaks bootsectors.
Untill someone finds a fix darwin users will have to use bootsectors
compiled under linux. It's not a huge problem since very few
developpers need to modify boot sector
> So patches 5 and 7 are dropped for now. Patches 1-4 and 6 have been
> applied. Installation on FAT32 is safe now. The "Hard Disk" message
> has been preserved, so it can be shortened later if the real need
> arises.
>
> That said, using direct jump to 0x8000 would save 3 bytes
Unfortunately BIOSes loading at 7c0:0 exist
> and then we
> can save 2 bytes by taking an unconditional jump from the "disk check"
> code and reverting the logic.
I don't understand what part of code you mean but as long if it's just
revertion of a logic to do the same then it's fine with me
> And maybe we could save 1 byte by yanking
> "cli" as writing to %ss disables interrupts until the next instruction.
I pefer to keep cli because alternative i386 implementations may have
bug with it
>
> While testing the patches in qemu, I've seen some error messages and
> found that they should be followed by a new line, as qemu adds its own
> error message.
>
> --
> Regards,
> Pavel Roskin
>
>
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'phcoder' Serbinenko
Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
- [PATCH 1/7] Make boot/i386/pc/boot.S safer to modify, Pavel Roskin, 2009/07/14
- [PATCH 2/7] Remove unused version information from boot/i386/pc/boot.S, Pavel Roskin, 2009/07/14
- [PATCH 3/7] Eliminate kernel_segment, Pavel Roskin, 2009/07/14
- [PATCH 4/7] Eliminate kernel_address, Pavel Roskin, 2009/07/14
- [PATCH 5/7] Add newline after "Error" in bootsector, Pavel Roskin, 2009/07/14
- [PATCH 6/7] Increase BPB size to accommodate FAT32., Pavel Roskin, 2009/07/14
- [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations, Pavel Roskin, 2009/07/14
- Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations, Pavel Roskin, 2009/07/15
- Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations,
Vladimir 'phcoder' Serbinenko <=
- Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations, Pavel Roskin, 2009/07/15
- Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations, Pavel Roskin, 2009/07/15
- Re: [PATCH 7/7] RFC: Use correct addresses, eliminate manual relocations, Vladimir 'phcoder' Serbinenko, 2009/07/16
Re: [PATCH 1/7] Make boot/i386/pc/boot.S safer to modify, Robert Millan, 2009/07/16