"mtools" commands not working on MacOS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
amandude
Posts: 10
Joined: Wed Jul 07, 2021 7:18 pm

"mtools" commands not working on MacOS

Post 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!
User avatar
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

Re: "mtools" commands not working on MacOS

Post 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!
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: "mtools" commands not working on MacOS

Post 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.
amandude
Posts: 10
Joined: Wed Jul 07, 2021 7:18 pm

Re: "mtools" commands not working on MacOS

Post 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). :)
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: "mtools" commands not working on MacOS

Post 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.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: "mtools" commands not working on MacOS

Post 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.
User avatar
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

Re: "mtools" commands not working on MacOS

Post 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.
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
amandude
Posts: 10
Joined: Wed Jul 07, 2021 7:18 pm

Re: "mtools" commands not working on MacOS

Post 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! :)
Post Reply