Page 1 of 2
A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Tue Nov 05, 2013 9:00 pm
by Zz
I ran into a boat load of issues, so I spaced out some monkeying about over two weeks to figure out a fully functional setup for basic OSDev on Windows that gives no headaches.
http://stackoverflow.com/questions/1980 ... on-windows
UPDATED!
-The link broke BUT Scroll down a few posts to see how to get grub rolling. I'm running off memory so if you'd like to help give me feedback here and I'll update
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 06, 2013 7:08 am
by sortie
Hmm, I believe --disable-werror is only relevant for binutils. GCC certainly doesn't enable it by default and most packages don't (and shouldn't!). GRUB 1.98 is entirely obsoleted by GRUB 2.00? Why don't you build that version instead?
GRUB is known to be a bit problematic - does it really enable werror by default? It's a bit worrying that it doesn't respect the --prefix variable, but here's a neat trick that doesn't involving changing the makefile. Decide that you want to stage the installation temporarily at the directory /tmp/staging. This will act as the root for the purpose of installation. When you finally do the installation, instead do:
And it prefixes everything with DESTDIR - if the package respects that - otherwise GRUB is a pile of junk that needs serious fixing. You can then delete anything from /tmp/staging you don't want in your cygwin root and then you can do the final installation by merging /tmp/staging into your actual root directory. But really, use a newer GRUB package, and this might all go away.
But really, easier GRUB availability and installation is an advantage of Unix-like systems compared to Windows.
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 06, 2013 11:05 am
by Zz
Thanks! I'll keep these things in mind when I go home and have my home pc to test these changes on.
Werror was definitely defaulted on all grub's I attempted and version 2.00/1.99 ran into serious issues building. I maybe hacked away at 2.00/1.99 for an entire day fixing one error and getting slammed with another (at the time I was trying cyg64 :/). I just tried to get as close to home as possible with the time I've had between classes. Also, I thought maybe I ran into a gcc werror but couldn't recall so that's good clarification!
I'd love to use a UNIX environment, but really I'm so entangled with Windows in so many ways (especially my summer work) that it's a real inconvenience to boot between two OS's or spend the time (that I don't have until summer comes by) to start from scratch on Linux. Don't get me wrong I love playing around with Linux, but if you can fix what you have to use right?
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 06, 2013 1:48 pm
by sortie
I'd recommend toying around with osdev develop in a virtual machine. It is certainly possible to osdev under Windows, but if you desire to use Unix tools, they are a heap easier to use under Unix systems, especially if your package management solution provides them for you (such as GRUB).
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 06, 2013 1:52 pm
by jnc100
Grub 1.98 is provided as a Cygwin package.
Regards,
John
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 06, 2013 4:11 pm
by Zz
@Sortie - Eh, I know I can but that just seemed clunky. IDEEEEA!!! I think I'll slap a 2.5 in my docking bay an run me some Ubuntu!
@JNC - Wait. I searched high and low and did not see this. I thought that GRUB's integration was not continued. Please do tell...
All in all, hurray development kit on windows
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 06, 2013 6:52 pm
by jnc100
http://cygwin.com/cgi-bin2/package-cat. ... &grep=grub
However it doesn't appear to be available for the 64 bit version.
Regards,
John
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Thu Nov 07, 2013 2:10 am
by Zz
Huh.. That did not install for me nor appear on threw download list. I'll definitely check that out at home building again, thanks! I've dug more information out of this forum than the internet combined in two days you all rock.. To think I avoided asking here this whole time.
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 20, 2013 1:16 am
by bimboxX
sortie wrote: Decide that you want to stage the installation temporarily at the directory /tmp/staging.
@sortie Hi, can you provide exactly what needs to be typed here before the "make install" part? Thank you!
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 20, 2013 6:28 am
by sortie
@bimboxX: Uh? Read this guy's guide.
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Wed Nov 20, 2013 8:56 am
by bimboxX
@sortie sorry I didn't read the SO link. lol. The said link got removed in Stack Overflow so I just assumed the error on the "make" command isn't resolved yet. My pingback from here is a thread with an unresolved error, that's why.
@Zz can you please bring the post back or give me the new link rather. I can't install grub too, no.
Thank you!
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Fri Nov 22, 2013 1:50 pm
by Zz
Errrrm, I don't seeeeeeem to have the guide saved like I thought so...
If you find yourself savvy enough this should work for grub, take a look see and confirm if my memory serves me
make sure you have these items
GCC
Make
Bison
Flex
GMP
MPFR
MPC
>Extract grub 1.98 to src (under the cygwin folder, it's proper, we like)
>Make a build folder (build-ilikefancynames) in src
>enter cygwin
>go into the build folder
>type
>>export PREFIX="/cygdrive/c/.....(go to wherever)...../opt/cross"
>>export TARGET=i586-elf
>>export PATH="$PREFIX/bin:$PATH"
>>../grub-1.98/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --disable-werror
>>make
===NOW HERE IS WHERE THINGS SHOULD GET HAIRY===
>do make install and you should error a good chunk into it
>It should be a path issue
>You know makefiles! Right? Fix it! If not, O_O
>If you can't fix it no matter and you want to get back on the horse send me the error and the makeFile and we will get this on the road!
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Tue Nov 26, 2013 12:10 am
by bimboxX
TARGET_OBJ2ELF=../grub-pe2elf sh genmod.sh moddep.lst iorw.module.exe iorw.mod
TARGET_OBJ2ELF=../grub-pe2elf sh genmod.sh moddep.lst regexp.module.exe regexp.mod
./../grub-pe2elf: error: invalid symbol.
Makefile:81315: recipe for target 'regexp.mod' failed
make[3]: *** [regexp.mod] Error 1
make[3]: Leaving directory '/cygdrive/c/posix/cygwin86/src/build-grub/grub-core'
Makefile:58403: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/cygdrive/c/posix/cygwin86/src/build-grub/grub-core'
Makefile
recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/cygdrive/c/posix/cygwin86/src/build-grub'
Makefile
recipe for target 'all' failed
make: *** [all] Error 2
Hi, thank you for trying to recall. That above is the error. It looks more to me like an issue in grub-pe2elf. What do you think?
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Tue Nov 26, 2013 4:53 pm
by Zz
Ok, that's an issue between cygwin, pe2elf, and the regex file(s). I would recommend finding an older cygwin because that error could mean a lovely lot. I mean you could dig up that regex file and we could peruse it, and maybe a patch file exists somewhere. That error is usually where I pack up and try another build because like said, lots of fun to deal with.
OR post up your computer specs.. Perhaps my toolchain might suffice for grub. I was able to manage this with my home and school computer so hey, mayyyybe.
Re: A simple guide to GRUB 1.98 on Cygwin + Cross Compiler
Posted: Thu Nov 28, 2013 6:26 am
by bimboxX
Hi dude, problem solved. I just used the obsoleted binary version available. Thanks again!