PPC update
I just fixed an embarassing bug in kern/powerpc/cache.S, where if `address' is not cacheline-aligned (which is a common and reasonable thing), it would fail to flush/invalidate the last cacheline. (It takes a little thinking, but draw a picture and think about the loop termination condition and you'll see why.) Vincent, I believe kern/sparc64/cache.S has the same problem... the fix is only two lines, so finding a failing testcase is the only hard part. :)
I found the failure by relinking GRUB above 96MB; I guess the lower addresses were well-trafficked enough, at least as far as cacheline congruence classes go. Why did I change the link address? Open Firmware has a "claim" method in which a client program (that's us) reserves memory for exclusive use. BootX, the Mac OS X bootloader, claims almost every byte of memory up to 96MB, and it fails if GRUB has claimed memory in the way.
(BTW, I commented out the "map" part of grub_claimmap(), and everything works fine without it. If we can get a little more testing with that, I will remove it entirely.)
Once I fixed the cache flushing bug, I was able to execute BootX further than before. It displayed an icon indicating it could not find OS X's kernel, which is expected because I had to copy BootX to a separate partition with a supported filesystem to load it at all.
So Marco, any time you're ready with that HFS+ driver... ;) In the meantime I will continue to try to find a way to load BootX without linking at 96MB. It would be nice not to require 96MB of RAM to run GRUB...
-Hollis
Quoted 7 lines · Hollis Blanchard
I just fixed an embarassing bug in
kern/powerpc/cache.S, where if `address' is not cacheline-aligned (which is a common and reasonable thing), it would fail to flush/invalidate the last cacheline. (It takes a little thinking, but draw a picture and think about the loop termination condition and you'll see why.) Vincent, I believekern/sparc64/cache.Shas the same problem... the fix is only two lines, so finding a failing testcase is the only hard part. :)
Eight. And when in doubt, better flush too much.
Quoted 7 lines
I found the failure by relinking GRUB above 96MB; I guess the lower addresses were well-trafficked enough, at least as far as cacheline congruence classes go. Why did I change the link address? Open Firmware has a "claim" method in which a client program (that's us) reserves memory for exclusive use. BootX, the Mac OS X bootloader, claims almost every byte of memory up to 96MB, and it fails if GRUB has claimed memory in the way.
Right, but you haven't made this change in CVS, I assume?
Quoted 3 lines
(BTW, I commented out the "map" part of
grub_claimmap(), and everything works fine without it. If we can get a little more testing with that, I will remove it entirely.)
Sure. I don't even remember why we needed it in the first place.
Quoted 4 lines
Once I fixed the cache flushing bug, I was able to execute BootX further than before. It displayed an icon indicating it could not find OS X's kernel, which is expected because I had to copy BootX to a separate partition with a supported filesystem to load it at all.
Nice work!
Quoted 4 lines
So Marco, any time you're ready with that HFS+ driver... ;) In the meantime I will continue to try to find a way to load BootX without linking at 96MB. It would be nice not to require 96MB of RAM to run GRUB...
Yeah, I'll let you know. My guess is that it will take a week. Can't you just copy the file to the wrapped HFS fs in the meanwhile, or is it too small?
Can you describe your biarch change and how that affects the AMD64 port? Can I still crosscompile like I was used to?
--
Marco
Quoted 11 lines · Marco Gerards
Quoted 7 lines · Hollis Blanchard
I just fixed an embarassing bug in
kern/powerpc/cache.S, where if `address' is not cacheline-aligned (which is a common and reasonable thing), it would fail to flush/invalidate the last cacheline. (It takes a little thinking, but draw a picture and think about the loop termination condition and you'll see why.) Vincent, I believekern/sparc64/cache.Shas the same problem... the fix is only two lines, so finding a failing testcase is the only hard part. :)Eight. And when in doubt, better flush too much.
Eight lines? http://cvs.savannah.gnu.org/viewcvs/grub/grub2/kern/powerpc/cache.S.diff?tr1=1.1&tr2=1.2&r1=text&r2=text says it's two.
My first approach was just to flush one extra line, but that failed (DEFAULT CATCH) when accessing unmapped memory (i.e. past the end of memory which had been claimed). The proper fix was simple anyways.
Quoted 9 lines
Quoted 7 lines
I found the failure by relinking GRUB above 96MB; I guess the lower addresses were well-trafficked enough, at least as far as cacheline congruence classes go. Why did I change the link address? Open Firmware has a "claim" method in which a client program (that's us) reserves memory for exclusive use. BootX, the Mac OS X bootloader, claims almost every byte of memory up to 96MB, and it fails if GRUB has claimed memory in the way.
Right, but you haven't made this change in CVS, I assume?
Of course not. You can see for yourself...
Quoted 5 lines
Quoted 3 lines
(BTW, I commented out the "map" part of
grub_claimmap(), and everything works fine without it. If we can get a little more testing with that, I will remove it entirely.)Sure. I don't even remember why we needed it in the first place.
I had convinced myself that something wasn't getting mapped. Actually, I bet I know what it was...
"claim" on Old World firmware didn't work properly, and you did need to map it explicitly. BootX has more complete code to handle this case, and we should take that same approach when we worry about Old World.
Quoted 8 lines
Quoted 4 lines
So Marco, any time you're ready with that HFS+ driver... ;) In the meantime I will continue to try to find a way to load BootX without linking at 96MB. It would be nice not to require 96MB of RAM to run GRUB...
Yeah, I'll let you know. My guess is that it will take a week. Can't you just copy the file to the wrapped HFS fs in the meanwhile, or is it too small?
I have copied BootX there. The mach_kernel is 4MB though, which is too large for my HFS partition, and I assume the root filesystem detection code would get confused anyways...
Quoted 2 lines
Can you describe your biarch change and how that affects the AMD64 port? Can I still crosscompile like I was used to?
http://cvs.savannah.gnu.org/viewcvs/grub/grub2/configure.ac.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
In a word: yes.
-Hollis
Quoted 5 lines · Hollis Blanchard
Quoted 1 line
Eight. And when in doubt, better flush too much.
Eight lines?
http://cvs.savannah.gnu.org/viewcvs/grub/grub2/kern/powerpc/
cache.S.diff?tr1=1.1&tr2=1.2&r1=text&r2=text says it's two.
s/Eight/Right/ :-)
Quoted 12 lines
My first approach was just to flush one extra line, but that failed (DEFAULT CATCH) when accessing unmapped memory (i.e. past the end of memory which had been claimed). The proper fix was simple anyways.
Quoted 8 lines
Quoted 7 lines
I found the failure by relinking GRUB above 96MB; I guess the lower addresses were well-trafficked enough, at least as far as cacheline congruence classes go. Why did I change the link address? Open Firmware has a "claim" method in which a client program (that's us) reserves memory for exclusive use. BootX, the Mac OS X bootloader, claims almost every byte of memory up to 96MB, and it fails if GRUB has claimed memory in the way.
Quoted 3 lines
Quoted 1 line
Right, but you haven't made this change in CVS, I assume?
Of course not. You can see for yourself...
Yeah, but it is quite hard to look where I am now... :-/
Quoted 7 lines
Quoted 3 lines
Yeah, I'll let you know. My guess is that it will take a week. Can't you just copy the file to the wrapped HFS fs in the meanwhile, or is it too small?
I have copied BootX there. The
mach_kernelis 4MB though, which is too large for my HFS partition, and I assume the root filesystem detection code would get confused anyways...
Perhaps you can adjust some variable in OF that points to the device you loaded it from or so... Anyways, that is just a random thought while I have no clue how your code works.
Quoted 5 lines
Quoted 2 lines
Can you describe your biarch change and how that affects the AMD64 port? Can I still crosscompile like I was used to?
http://cvs.savannah.gnu.org/viewcvs/grub/grub2/configure.ac.diff?
tr1=1.17&tr2=1.18&r1=text&r2=text
Heh, that's code and not a description. ;)
I was wondering why it was required, some background, etc.
--
Marco
Quoted 10 lines · Marco Gerards
Quoted 6 lines
Quoted 3 lines
Can you describe your biarch change and how that affects the AMD64 port? Can I still crosscompile like I was used to?
http://cvs.savannah.gnu.org/viewcvs/grub/grub2/configure.ac.diff?
tr1=1.17&tr2=1.18&r1=text&r2=textHeh, that's code and not a description. ;)
I was wondering why it was required, some background, etc.
I was on a ppc64 system with a biarch compiler. In this case, the compiler was set to emit ppc32 binaries by default, but -m32 doesn't hurt. Other PPC biarch compilers may emit ppc64 binaries by default, in which case -m32 is required, same as on an x86-64 system.
-Hollis