Page 1 of 1

Creating a floppy disk image

Posted: Mon May 26, 2008 7:14 am
by Puffy
Hi,

I was wondering if there is a way to create a bootable floppy disk image without first writing your bootloader/kernel to an actual floppy disk (I don't have access to a floppy drive unfortunatley!).

Thanks,

Puff

Posted: Mon May 26, 2008 7:38 am
by AJ
Hi,

If you are using Windows, see Virtual Floppy Drive. I am not very familiar with Linux, but believe the dd command combined with a loopback device is what you would want there.

Cheers,
Adam

Posted: Mon May 26, 2008 8:14 am
by Stevo14
Yea, under Linux use something like

Code: Select all

dd if=/dev/zero of=./floppy.img bs=1024 count=1440
to make a blank 1.44mb floppy image called "floppy.img".

Posted: Mon May 26, 2008 8:43 am
by Puffy
Thanks for the tips!

As a side note, using the Linux method specified above, how do you actually get your bootloader/kernel data in there as well, since the image produced is blank?

Posted: Mon May 26, 2008 8:44 am
by Solar
Mount per loopback device.

It's in the Wiki, really.

Re: Creating a floppy disk image

Posted: Tue May 27, 2008 4:47 am
by egos
Puffy wrote:Hi,

I was wondering if there is a way to create a bootable floppy disk image without first writing your bootloader/kernel to an actual floppy disk (I don't have access to a floppy drive unfortunatley!).

Thanks,

Puff
I wrote: For quick making and changing a floppy image you can use fasm and special include file. For example,

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 io,        "IO      SYS", FA_RO or FA_HID or FA_SYS or FA_ARC
dent msdos,     "MSDOS   SYS", FA_RO or FA_HID or FA_SYS or FA_ARC
dent command,   "COMMAND COM", FA_ARC
dent drvspace,  "DRVSPACEBIN", FA_RO or FA_HID or FA_SYS or FA_ARC
dent autoexec,  "AUTOEXECBAT", FA_ARC
dent command2,  "COMMAND",     FA_DIR
rb 33*512-$

; data
stof io,        "content/IO.SYS"
stof msdos,     "content/MSDOS.SYS"
stof command,   "content/COMMAND.COM"
stof drvspace,  "content/DRVSPACE.BIN"
stof autoexec,  "content/AUTOEXEC.BAT"

defdir command2
{
dent fdisk,     "FDISK   EXE", FA_ARC
dent format,    "FORMAT  COM", FA_ARC
dent sys,       "SYS     COM", FA_ARC
dent defrag,    "DEFRAG  EXE", FA_ARC
dent scandisk1, "SCANDISKEXE", FA_ARC
dent scandisk2, "SCANDISKINI", FA_ARC
}

stod command2,  root
stof fdisk,     "content/COMMAND/FDISK.EXE"
stof format,    "content/COMMAND/FORMAT.COM"
stof sys,       "content/COMMAND/SYS.COM"
stof defrag,    "content/COMMAND/DEFRAG.EXE"
stof scandisk1, "content/COMMAND/SCANDISK.EXE"
stof scandisk2, "content/COMMAND/SCANDISK.INI"
rb 2*80*18*512-$
LFN not yet supported.

Re: Creating a floppy disk image

Posted: Sat Aug 16, 2008 5:09 pm
by cg123
egos wrote:
Puffy wrote:Hi,

I was wondering if there is a way to create a bootable floppy disk image without first writing your bootloader/kernel to an actual floppy disk (I don't have access to a floppy drive unfortunatley!).

Thanks,

Puff
I wrote: For quick making and changing a floppy image you can use fasm and special include file. For example,

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 io,        "IO      SYS", FA_RO or FA_HID or FA_SYS or FA_ARC
dent msdos,     "MSDOS   SYS", FA_RO or FA_HID or FA_SYS or FA_ARC
dent command,   "COMMAND COM", FA_ARC
dent drvspace,  "DRVSPACEBIN", FA_RO or FA_HID or FA_SYS or FA_ARC
dent autoexec,  "AUTOEXECBAT", FA_ARC
dent command2,  "COMMAND",     FA_DIR
rb 33*512-$

; data
stof io,        "content/IO.SYS"
stof msdos,     "content/MSDOS.SYS"
stof command,   "content/COMMAND.COM"
stof drvspace,  "content/DRVSPACE.BIN"
stof autoexec,  "content/AUTOEXEC.BAT"

defdir command2
{
dent fdisk,     "FDISK   EXE", FA_ARC
dent format,    "FORMAT  COM", FA_ARC
dent sys,       "SYS     COM", FA_ARC
dent defrag,    "DEFRAG  EXE", FA_ARC
dent scandisk1, "SCANDISKEXE", FA_ARC
dent scandisk2, "SCANDISKINI", FA_ARC
}

stod command2,  root
stof fdisk,     "content/COMMAND/FDISK.EXE"
stof format,    "content/COMMAND/FORMAT.COM"
stof sys,       "content/COMMAND/SYS.COM"
stof defrag,    "content/COMMAND/DEFRAG.EXE"
stof scandisk1, "content/COMMAND/SCANDISK.EXE"
stof scandisk2, "content/COMMAND/SCANDISK.INI"
rb 2*80*18*512-$
LFN not yet supported.

Well, uh.. maybe I'm misinterpreting something, but where is said include file?

Re: Creating a floppy disk image

Posted: Sun Aug 17, 2008 12:44 am
by egos
cg123 wrote:Well, uh.. maybe I'm misinterpreting something, but where is said include file?
mkfloppy.zip