0

I was following the instructions in https://createyourownos.blogspot.com/ to make my own tiny OS. I managed to do the compile and the assemble step, but how can I make a bootable USB out of .bin file?

8
  • To make this short, I followed this link createyourownos.blogspot.com. That is the only one to follow the steps from the blog says “You need nasm and qemu” I arrived at the .bin file by converting the .asm file to .bin file using nasm – Calvin Tanuri Apr 19 at 7:16
  • If I understand the instructions correctly, you'll need to install qemu and can then run qemu-system-x86_64 bootloader to load your OS. Did you try this? What was the result and how does it differ from what you expect? – nohillside Apr 19 at 12:52
  • No, that's not it - he wants to boot his Mac from a USB pen drive with the OS. So in that way the question is fully detailed for answering now. – jksoegaard Apr 19 at 12:54
  • @jksoegaard Well, maybe they do, it's a bit unclear. Are you willing to give a long lecture about boot drives and formats now? :-) – nohillside Apr 19 at 12:59
  • 1
    I have at least updated my answer now ;-) I doubt that it is in any way worth detailing the exact formats, as it will be more complicated to boot that OS than make it in the first place. I would heavily advise buying old, cheap PC hardware without EFI to make it easy to understand for newcomers. – jksoegaard Apr 19 at 13:22
2

It is not in general possible to create a bootable USB from any ".bin" file.

As per your comments you are not willing to detail how you arrived at the ".bin" file, how it was created, what it contains, or anything like that - we can then conclude that it is not possible for you to create a bootable USB from this ".bin" file.

UPDATE: You have since updated your comments with the source of your ".bin" file being from a specific blog-tutorial on making a simple operating system. In this case your operating system is 32-bit, where Macs today commonly boot 64-bit software. Your operating system also relies on the BIOS to actually do something, but this is not the way modern computers work.

I would suggest to you to keep using qemu or similar to boot your operating system in. Alternatively, buy an old, simple PC that you can tinker with. This will give you fewest headaches.

Alternatively, you need to ensure that the Mac enables the legacy BIOS CSM (compatibility support module) while booting. This can be done by ensure your disk has one of the old MBR partition tables (i.e. not GPT) and that your partition is set as bootable. You operating system then needs to moved into that partition accordingly.

Depending on how old your Mac is, you probably want to go along the road of loading rEFIt in first, and install the old legaby-BIOS version of GRUB 2 as a boot chain to ultimately boot your OS.

If you have the newest M1 Mac, you operating system cannot work at all due to it being 32-bit Intel only. If you have a newer Mac with T2, you'll need to relax secure boot restrictions in order to get going.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .