How do I go from assembly to ISO?

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
Hello,

Here's what I mean.

I want to write bootable code, an OS of sorts.

My plan is to write in assembly, assemble it to flat binary (not formatted for running over an OS as my code will actually be an OS), take that binary file and convert it to an ISO, and finally burn the ISO onto a USB.

I can use notepad to write the assembly, but I need an assembler running on Windows that will spit out flat binary.

Then, I need a way to convert a binary into an ISO.

Finally, I have a program already that will low-level write (burn) an ISO onto a USB for booting.

How can I find a good assembler running on Windows (NOT packaged with Visual Studio - I hate that program) that will spit out flat binary?

Also, how can I convert a binary into an ISO?

Thanks.
 

urvile

Golden Member
Aug 3, 2017
1,575
474
96
Hello,

Here's what I mean.

I want to write bootable code, an OS of sorts.

My plan is to write in assembly, assemble it to flat binary (not formatted for running over an OS as my code will actually be an OS), take that binary file and convert it to an ISO, and finally burn the ISO onto a USB.

I can use notepad to write the assembly, but I need an assembler running on Windows that will spit out flat binary.

Then, I need a way to convert a binary into an ISO.

Finally, I have a program already that will low-level write (burn) an ISO onto a USB for booting.

How can I find a good assembler running on Windows (NOT packaged with Visual Studio - I hate that program) that will spit out flat binary?

Also, how can I convert a binary into an ISO?

Thanks.

Use VI buddy. Notepad is for pussys.
 
  • Like
Reactions: anky

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
I'd look at what the Linux distros do to make USB-bootable versions of them. There should be source code.

The last time I did something like this was for an Atari 800 so I'm a bit out of date on the steps :)
 

chrstrbrts

Senior member
Aug 12, 2014
522
3
81
OK, guys, last night I downloaded NASM for windows and used my very limited understanding of assembly to write a uni-step bootloader.

I then called NASM from the command window and assembled the source code into a flat binary, not elf etc.

Then I found a windows program initially designed for -NIX systems called dd.

I have no idea how anyone decided that 'dd' was sufficient for a program's name, but whatever.

Anyway, dd is a low-level write program.

So, I took my binary and burned it onto the first sector of a USB.

I booted from the USB and....viola! I wrote directly to the frame buffer! My first bootable code!

Anyway, with dd, I don't need an ISO.

I'm still interested in how binaries become ISOs, though.
 
  • Like
Reactions: Ken g6

Merad

Platinum Member
May 31, 2010
2,586
19
81
I believe you're overthinking this. A file system is ultimately just a blob of bytes, whether it's on a CD, hard drive, etc. You have to crack open that blob and start reading its contents before things like data bytes or formatting bytes become relevant. To my knowledge an ISO just takes all of the bytes that would be written to a CD and dumps them into a file.