Create img without floppy drive

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
sbeng77
Posts: 17
Joined: Mon Sep 29, 2008 8:06 am
Contact:

Create img without floppy drive

Post by sbeng77 »

Hi all,
on many os dev tutorial there are img files. I don't know if is possible create .img file without floppy. I would create this file on my harddisk.Why need img file?
Best regards.
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Re: Create img without floppy drive

Post by inflater »

Why need img file?
How else would run your OS?...

You must create a image file of a either floppy, harddrive, CD-ROM etc and put the kernel binary there. For floppy, I recommend WinImage. Then, after you've written an appropriate bootsector to it, you can start working on your kernel.

Or you can use physical media (I use normal diskettes for my OS, and when it comes to a full version I'll just make a image file from the floppy and upload it on the net).

You then run your kernel by specifying the image file to the emulator, or physical media to any x86 PC.

You should learn computer basics first. OSdeving is not a great idea for you.

(Sorry for my english I know its wacky a bit... too much gaming :lol:).
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
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: Create img without floppy drive

Post by Combuster »

The idea of an image file is that its an duplicate of the contents on a floppy. You don't need an image file if you use a floppy directly, you don't need a floppy if you use an image file.

The thing is, you can distribute image files over the internet, but folding up a real floppy and attempt push it down the wire would ruin the floppy at best. An image is also much faster in use than a floppy. Hence most people prefer an image, and only copy that image to floppy when they need to do so.

For the record: I recommend MTools
"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 ]
User avatar
codemastersnake
Member
Member
Posts: 148
Joined: Sun Nov 07, 2004 12:00 am
Contact:

Re: Create img without floppy drive

Post by codemastersnake »

inflater wrote:
Why need img file?
You should learn computer basics first. OSdeving is not a great idea for you.
Never demoralize any one [-X

By the way There's a floppy drive emulator if you would be interested: http://magneto.co.in/modules/weblinks/visit.php?lid=9
sbeng77
Posts: 17
Joined: Mon Sep 29, 2008 8:06 am
Contact:

Re: Create img without floppy drive

Post by sbeng77 »

Excuse me but i didn't explain cleary.
I know that i can start my emulator via img file to simulate floppy boot.
I don't know as i can create a img file only having my compiled sources (for example "kernel" output).
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Create img without floppy drive

Post by egos »

sbeng77 wrote:Excuse me but i didn't explain cleary.
I know that i can start my emulator via img file to simulate floppy boot.
I don't know as i can create a img file only having my compiled sources (for example "kernel" output).
You must own booting technology.
Just take your first stage boot loader for FAT12 and follow example here.

Edit:

Code: Select all

include "mkfloppy.inc"

file "bootcode.bin", 512

; fat1
db 0F0h, 0FFh, 0FFh, 9*512-3 dup 0

; fat2
db 0F0h, 0FFh, 0FFh, 9*512-3 dup 0

; root
dent kernel, "KERNEL", FA_ARC
rb 33*512-$

; data
stof kernel, "kernel"
rb 2*80*18*512-$
Compile this code by fasm.
Last edited by egos on Wed Oct 01, 2008 2:47 am, edited 1 time in total.
If you have seen bad English in my words, tell me what's wrong, please.
sbeng77
Posts: 17
Joined: Mon Sep 29, 2008 8:06 am
Contact:

Re: Create img without floppy drive

Post by sbeng77 »

Thank you!
Post Reply