Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 313099 Details for
Bug 360513
[4.6/4.7] sys-boot/grub-0.97 fails to boot when built w/ >=sys-devel/gcc-4.6.0
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix inifinite boot with >=gcc-4.6
905_all_grub-0.97-gcc46.patch (text/plain), 1.68 KB, created by
Kacper Kowalik (Xarthisius) (RETIRED)
on 2012-05-26 09:09:09 UTC
(
hide
)
Description:
fix inifinite boot with >=gcc-4.6
Filename:
MIME Type:
Creator:
Kacper Kowalik (Xarthisius) (RETIRED)
Created:
2012-05-26 09:09:09 UTC
Size:
1.68 KB
patch
obsolete
>Fix infinite boot loop with >=gcc-4.6 > >https://bugs.gentoo.org/show_bug.cgi?id=360513 >http://code.google.com/p/grub4dos-chenall/source/browse/trunk/stage2/bios.c?spec=svn290&r=290 > >Patch is a part of grub4dos project > >--- a/stage2/bios.c >+++ b/stage2/bios.c >@@ -60,7 +60,18 @@ > unsigned short blocks; > unsigned long buffer; > unsigned long long block; >- } __attribute__ ((packed)) dap; >+ >+ /* This structure is passed in the stack. A buggy BIOS could write >+ * garbage data to the tail of the struct and hang the machine. So >+ * we need this protection. - Tinybit >+ */ >+ unsigned char dummy[16]; >+ } __attribute__ ((packed)) *dap; >+ >+ /* Even the above protection is not enough to avoid stupid actions by >+ * buggy BIOSes. So we do it in the 0040:0000 segment. - Tinybit >+ */ >+ dap = (struct disk_address_packet *)0x580; > > /* XXX: Don't check the geometry by default, because some buggy > BIOSes don't return the number of total sectors correctly, >@@ -72,15 +83,15 @@ > > /* FIXME: sizeof (DAP) must be 0x10. Should assert that the compiler > can't add any padding. */ >- dap.length = sizeof (dap); >- dap.block = sector; >- dap.blocks = nsec; >- dap.reserved = 0; >+ dap->length = 0x10; >+ dap->block = sector; >+ dap->blocks = nsec; >+ dap->reserved = 0; > /* This is undocumented part. The address is formated in > SEGMENT:ADDRESS. */ >- dap.buffer = segment << 16; >+ dap->buffer = segment << 16; > >- err = biosdisk_int13_extensions ((read + 0x42) << 8, drive, &dap); >+ err = biosdisk_int13_extensions ((read + 0x42) << 8, drive, dap); > > /* #undef NO_INT13_FALLBACK */ > #ifndef NO_INT13_FALLBACK
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 360513
:
278079
|
294085
|
294087
|
294089
|
298111
|
298113
|
299559
|
300329
|
310751
|
312587
|
313069
| 313099