OSDev.org
https://forum.osdev.org/

Help using grub-mkrescue in Windows 10
https://forum.osdev.org/viewtopic.php?f=1&t=55959
Page 1 of 1

Author:  RadPoseidon [ Tue Oct 26, 2021 8:33 pm ]
Post subject:  Help using grub-mkrescue in Windows 10

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/58886611/os-dev-undefined-reference-kernel-main-and-undefined-operator-newunsigned-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.

Author:  klange [ Tue Oct 26, 2021 8:36 pm ]
Post subject:  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)

Author:  Octocontrabass [ Tue Oct 26, 2021 9:39 pm ]
Post subject:  Re: Help using grub-mkrescue in Windows 10

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.

Install WSL. (If you're not sure which distro to choose, Ubuntu is a good starting point.)

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".)

Author:  RadPoseidon [ Wed Oct 27, 2021 7:29 am ]
Post subject:  Re: Help using grub-mkrescue in Windows 10

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)


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.

Author:  RadPoseidon [ Wed Oct 27, 2021 9:15 am ]
Post subject:  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.

Author:  Octocontrabass [ Wed Oct 27, 2021 9:50 am ]
Post subject:  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?

Author:  Ethin [ Wed Oct 27, 2021 4:39 pm ]
Post subject:  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.

Author:  RadPoseidon [ Thu Oct 28, 2021 12:38 pm ]
Post subject:  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-Compiler#Why_cross-compilers_are_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.

Author:  RadPoseidon [ Thu Oct 28, 2021 8:12 pm ]
Post subject:  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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/