creating a bootable .iso

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
ishkabible
Member
Member
Posts: 37
Joined: Wed Jan 05, 2011 7:35 pm

creating a bootable .iso

Post by ishkabible »

fist off im trying to create a bootable image so i can test what i will make later. i just want to have a working bootloader and later learn to display pixels to the screen. later i would like to learn to make an actual OS but for now i think i should learn how to do things. im comfortable in x86 and c/c++ and i want to go very low level, lower level than i have yet gone with x86. im trying to start with a bootloader shown on the FASM site becuase FASM is my favorite assembler. http://flatassembler.net/examples.php here is the link, it's the FAT12 bootloader. it comes with 4 different binary's along with there source, i put them all in an iso and tried to use it with Oracle VM VirtualBox. it said it found no bootable media. i had no clue if it would work or not when i tried it but i figured it was worth a shot. i have no clue what else to tell you to help me help you so i presume you will have to ask me questions in order to guide me down the correct path so feel free.

edit: lol i typed 'shot' '****' fixed it now but i wondering how decent a placement that was for the key :)
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: creating a bootable .iso

Post by thepowersgang »

Tip: Look up the format used for CDs before trying a boot loader on them. (Where do you think the term .iso comes from?)

CDs use the ISO-9660 filesystem, not FAT.

In your early testing, I would suggest using a floppy disk image instead. (They're usually FAT formatted, the FDD is simple to write a driver for, and there are heaps of utilities for working with disk images)
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: creating a bootable .iso

Post by Combuster »

There's also a Bootable CD tutorial (actually, there are two) on the wiki. Please try to search a bit before posting.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
ishkabible
Member
Member
Posts: 37
Joined: Wed Jan 05, 2011 7:35 pm

Re: creating a bootable .iso

Post by ishkabible »

dose anyone know of a program to make FAT images and mount them to a virtual drive so i can test them on a VM?
ishkabible
Member
Member
Posts: 37
Joined: Wed Jan 05, 2011 7:35 pm

Re: creating a bootable .iso

Post by ishkabible »

ok win image can make .vfd files but i can't find a way to mount them to a virtual drive. what program would i use to mount them to a virtual drive on windows?
ishkabible
Member
Member
Posts: 37
Joined: Wed Jan 05, 2011 7:35 pm

Re: creating a bootable .iso

Post by ishkabible »

how would i make a bootable .iso in windows? all i want it to do is go off in an infinite loop.
ishkabible
Member
Member
Posts: 37
Joined: Wed Jan 05, 2011 7:35 pm

Re: creating a bootable .iso

Post by ishkabible »

ok i got it to boot kinda, it shows me a bunch of text that was generated by winimage witch is what made the .vfd file not the .iso. i would like to know if there is a utility that allows me to create the floppy images from command line that is also fre
User avatar
JackScott
Member
Member
Posts: 1032
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
GitHub: https://github.com/JackScottAU
Contact:

Re: creating a bootable .iso

Post by JackScott »

Cygwin is the answer to your problems. It recreates a UNIX-like environment within Windows, which you can use to run the 'mkisofs' ISO-generation tool. It's also the best choice for running a GCC Cross-Compiler on Windows, which is the recommended compiler for OSDev. The UNIX tool 'dd' will help create floppy disk images for you, though you have to know what you want to create in the first place.

The tools are all there... you'll just need the knowledge to use them.

As a side note, learning to ask smart questions might prove worthwhile.
shedokan
Posts: 22
Joined: Sat Jan 08, 2011 9:42 am

Re: creating a bootable .iso

Post by shedokan »

He is better off using http://vfd.sourceforge.net/
It can create a foppy image and by using partcopy you can move the boot sector on it.
And move regular files using windows.
ishkabible
Member
Member
Posts: 37
Joined: Wed Jan 05, 2011 7:35 pm

Re: creating a bootable .iso

Post by ishkabible »

i have considered using cygwin to compile c/c++ code but instead i have been using MinGW, becuase i don't like MSVC++ i opted for either Cygwin and Mingw. I'm downloading Cygwin right now, this should work nicely :) thanks!!

edit: also vfd didn't work on my computer, it gave me an error saying i can't run window's 95/me/2000 but im running vista. no clue what it's issue is. i think using the commonly used tools will prove beneficial to me because i know little of OS dev.
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: creating a bootable .iso

Post by Tosi »

If you're downloading Cygwin please don't use the compiler that comes with it and instead make a cross-compiler. It's pretty easy and it prevents so many FAQs and problems that it's more than worth it.

As for VFD, it won't work on my system so I don't know how to use it but I do know it does not work on 64-bit versions of Windows, if you're using that. There is a similar program (I think it's imdisk) linked to on the Wiki that does work on 64-bit Vista and Windows 7, so you might want to try that.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: creating a bootable .iso

Post by Combuster »

Alternatively, you might want to use a tool like mtools (or less recommended, bfi) so that you can build your entire disk image from a build script without needing a (emulated) physical drive as an intermediate.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply