Writing to a floppy in raw mode

Programming, for all ages and all languages.
Post Reply
earlz

Writing to a floppy in raw mode

Post by earlz »

I am going to make an application(and maybe later a driver) that will format a floppy disk(and later hdd's) using my own commands and using my own filesystem
then i want to be able to copy files from an ntfs/fat volume to my volume and be able to do directories and all that stuff

well everything is fine except I don't know how to write to a floppy disk sectors at a time, in rawmode
earlz

Re:Writing to a floppy in raw mode

Post by earlz »

anyone, please?

btw this is in windows
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Writing to a floppy in raw mode

Post by Candy »

Jordan3 wrote: anyone, please?

btw this is in windows
That doesn't change my answer: DD.

DD (dunno what it stands for) is made for direct block-size copying from and to devices. There's a windows port of it by John Newbigin iirc, and it'll allow you to specify where to write, how much to write, from where etc.
earlz

Re:Writing to a floppy in raw mode

Post by earlz »

is it like a dll or other type of library so to use it easily from C
QuiTeVexat

Re:Writing to a floppy in raw mode

Post by QuiTeVexat »

I'd suggest reading the source code of a win32 dd, such as the one mentioned above. Or if you're okay with a dirtier solution, you could just use dd externally and call it with stdlib's system() or the like.
Cjmovie_guest

Re:Writing to a floppy in raw mode

Post by Cjmovie_guest »

You can look at the source for a program I wrote to write floppy images. You can look the functions up on MSDN.

http://hosted.cjmovie.net/OS/PartCopyX.c

you'll want info on the "CreateFile" and "WriteFile" functions. The program, if you wish to try it, requires the drive to be the letter followed by a colon, eg, "A:", "A" will not work.
Post Reply