Page 1 of 1

"mtools" commands not working on MacOS

Posted: Sat Aug 14, 2021 10:27 am
by amandude
I have just switched over to my Mac from windows because Mac has the command line tools I need for OS Development.
I have just installed mtools with Homebrew:

Code: Select all

brew install mtools
The issue is when I go to compile using "make building", it stops at the first "mtools" command, "mformat" and says:

Code: Select all

mformat -i iso/BirdOS.img -f 1440 ::

Assertion failed: (clusters_fit_into_fat(Fs)), function check_fs_params_and_set_fat, file mformat.c, line 354.
make: *** [building] Abort trap: 6


All of the "mtools" commands produce some sort of error no matter what I do.
Just to let you know, it was working perfectly fine on windows.

I think it could possibly be that I recently upgraded to MacOS 12 (Monterey) Beta, and I also noticed that brew says this when updating:

Code: Select all

Warning: You are using macOS 12.
We do not provide support for this pre-release version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
pre-release version.
Anyways, is there any way to fix this error, or any other ways to install mtools on MacOS without Homebrew?

Thanks so much!

Re: "mtools" commands not working on MacOS

Posted: Sat Aug 14, 2021 11:01 am
by bloodline
I do all my stuff with Homebrew on my Mac because it’s just so much easier than Windows for OS Dev, perhaps not as easy as using a Linux box, but the Linux needs way too much of my time to get working how I want it to.

Anyway, I ran homebrew on a hugely out of date MacOS Sierra install until early this year always had that “not supported” message and it never caused issue.

I don’t use mtools so I’m going to need to read up about it, but my guess is some incompatibility between platforms!

Re: "mtools" commands not working on MacOS

Posted: Sat Aug 14, 2021 11:56 am
by Octocontrabass
amandude wrote:I have just switched over to my Mac from windows because Mac has the command line tools I need for OS Development.
Out of curiosity, which tools were missing? Everything I've needed so far has been available on Windows through WSL.

Re: "mtools" commands not working on MacOS

Posted: Sat Aug 14, 2021 12:19 pm
by amandude
Octocontrabass wrote:
amandude wrote:I have just switched over to my Mac from windows because Mac has the command line tools I need for OS Development.
Out of curiosity, which tools were missing? Everything I've needed so far has been available on Windows through WSL.
I couldn't seem to compile C++ code for my OS using the x86_64-w64-mingw32-gcc cross compiler because it said cc1plus not found, so I switched over to MacOS to find that x86_64-w64-mingw32-g++ was available, where on windows, I could not seem to get the x86_64-w64-mingw32-g++ command (because it said command not found, but the x86_64-w64-mingw32-gcc command was), or find out how to fix cc1plus not found. But yes, WSL does have most of the command line tools I need. I just couldn't seem to fix some problems listed above and was doing some testing on my Mac to find out if it worked (And now I have the "mtools" problem). :)

Re: "mtools" commands not working on MacOS

Posted: Sat Aug 14, 2021 12:28 pm
by Octocontrabass
amandude wrote:I could not seem to get the x86_64-w64-mingw32-g++ command
Sounds like you didn't install it. For Ubuntu or Debian in WSL, run "sudo apt install g++-mingw-w64-x86-64" to install it.

Re: "mtools" commands not working on MacOS

Posted: Sun Aug 15, 2021 11:03 am
by iansjack
This link: https://bbs.archlinux.org/viewtopic.php?id=268320 suggests that you may want to downgrade to an earlier version of mtools.

Personally, I find OS X a pain when it comes to OS development. Linux in a VM on a Mac, or WSL on a PC are much more friendly solutions.

Edit: On second thoughts - why do you need mtools? OS X is able to create and mount FAT disk images natively.

Re: "mtools" commands not working on MacOS

Posted: Sun Aug 15, 2021 2:26 pm
by bloodline
iansjack wrote: Edit: On second thoughts - why do you need mtools? OS X is able to create and mount FAT disk images natively.
Good point! I use the MacOS tool “hdiutil” for all my Disk image stuff.

Re: "mtools" commands not working on MacOS

Posted: Tue Aug 17, 2021 4:31 pm
by amandude
iansjack wrote:
On second thoughts - why do you need mtools? OS X is able to create and mount FAT disk images natively.
Thanks for the information. I had no idea that you could create a disk image on a mac without mtools!
I will give it a try.
Octocontrabass wrote:
amandude wrote:I could not seem to get the x86_64-w64-mingw32-g++ command
Sounds like you didn't install it. For Ubuntu or Debian in WSL, run "sudo apt install g++-mingw-w64-x86-64" to install it.
That fixed my problem with compiling C++ code. Thanks for your help! :)