I think that I am writing this to the write forum section. I'm new to OS development and I've been following this (http://www.cplusplus.com/articles/zv07M4Gy/) admittedly rather vague article. I had to change some things as per this SO post (https://stackoverflow.com/questions/588 ... nsigned-lo) but I did get both the Assembly Code and C++ code to compile and link, but the thing I'm not sure how to do is build the ISO, the guide says to use grub-mkrescue, but being a Windows user, I've been unable to find a way to download these tools. I've also tried building them myself via the instructions in grub Install file, but I've had no success even when opening a bash shell to try and build it. I've definitely seen posts about people using grub on Windows, although this may have been before Cygwin dropped support for grub.
If anyone else has managed to do this on Windows, or has a good alternative they can recommend it would be much appreciated.
Help using grub-mkrescue in Windows 10
Re: Help using grub-mkrescue in Windows 10
GNU provides pre-compiled Grub utilities for Windows: https://ftp.gnu.org/gnu/grub/grub-2.06-for-windows.zip
You'll want to use grub-mkimage rather than grub-mkrescue. They have different argument formats, but ultimately can do the same basic things.
(grub-mkrescue itself is just a wrapper that combines mkimage with xorriso: https://github.com/rhboot/grub2/blob/ma ... mkrescue.c - I'm not really sure why they don't include it in the Windows builds)
You'll want to use grub-mkimage rather than grub-mkrescue. They have different argument formats, but ultimately can do the same basic things.
(grub-mkrescue itself is just a wrapper that combines mkimage with xorriso: https://github.com/rhboot/grub2/blob/ma ... mkrescue.c - I'm not really sure why they don't include it in the Windows builds)
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Help using grub-mkrescue in Windows 10
Install WSL. (If you're not sure which distro to choose, Ubuntu is a good starting point.)RadPoseidon wrote:If anyone else has managed to do this on Windows, or has a good alternative they can recommend it would be much appreciated.
Inside WSL, install grub-common, xorriso, grub-pc-bin, and grub-efi-amd64-bin. This will give you an ISO that supports both legacy BIOS and x64 UEFI. (If you chose Ubuntu, the command for that will be "sudo apt install grub-common xorriso grub-pc-bin grub-efi-amd64-bin".)
-
- Posts: 8
- Joined: Tue Oct 26, 2021 8:21 pm
Re: Help using grub-mkrescue in Windows 10
Thank you! I'm not sure how I missed the Precompiled Win Utils in all of my Google searches but for better or worse I now have an ISO.klange wrote:GNU provides pre-compiled Grub utilities for Windows: https://ftp.gnu.org/gnu/grub/grub-2.06-for-windows.zip
You'll want to use grub-mkimage rather than grub-mkrescue. They have different argument formats, but ultimately can do the same basic things.
(grub-mkrescue itself is just a wrapper that combines mkimage with xorriso: https://github.com/rhboot/grub2/blob/ma ... mkrescue.c - I'm not really sure why they don't include it in the Windows builds)
-
- Posts: 8
- Joined: Tue Oct 26, 2021 8:21 pm
Re: Help using grub-mkrescue in Windows 10
What options should I use with grub-mkimage? grub-mkrescue has much simpler inputs and --help/--usage don't really explain too much, and so far all of the ISOs I've built are unbootable.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Help using grub-mkrescue in Windows 10
I'm pretty sure grub-mkimage only creates the core GRUB image, not a complete bootable disk image.
Have you tried WSL yet?
Have you tried WSL yet?
Re: Help using grub-mkrescue in Windows 10
Why are you following a tutorial? This tutorial does not cover crucial details, like building a cross-compiler. So that is most likely also contributing to your problem. (It says that you need a "cross-compiler" but misuses the term, or uses it in a different context. It uses the host compiler and does not take you through the process of actually building GCC for OS development.) Perhaps you did this part on your own though.
-
- Posts: 8
- Joined: Tue Oct 26, 2021 8:21 pm
Re: Help using grub-mkrescue in Windows 10
Sorry for the late reply. I've gotten WSL installed which has gotten me closer, and https://wiki.osdev.org/User:Tjmonk15/WSL_Notes is proving useful. ( It pointed me towards another resource about Cross Compilers ( https://wiki.osdev.org/GCC_Cross-Compil ... _necessary ) ) so hopefully maybe soon I should be able to compile a bootable image. I'll give an update then, and thank you for all the help thus far.
-
- Posts: 8
- Joined: Tue Oct 26, 2021 8:21 pm
Re: Help using grub-mkrescue in Windows 10
Ok, after lots of trial and error, and just as much waiting on the Cross Compiler to build, I have a bootable ISO, although it definitely still needs work it's certainly a start. Thanks for all of your help with my sudden desire to build an OS.