Page 1 of 1

Need Help using DD

Posted: Thu May 24, 2007 1:26 pm
by movaxes
Hi everyone! :D

I' making a Bootloader for a Real Mode OS, the Bootloader loads a binary file from the floppy just after the boot sector, the problem is that I'm using Linux now and can't use partcopy to do this (can I?):

pcopy boot.bin 0 200 -f0
pcopy file.bin 0 2200 -f0 200

How can I make that in dd? I know how to copy the bootloader:

dd if=boot.bin bs=512 of=/dev/fd0

but the second file?

Thank! I've search everywhere in this forum but didn't find anything, dd manual didn't really help me...

Posted: Thu May 24, 2007 1:55 pm
by Candy
seek => skip blocks in input
skip => skip blocks in output
conv=notrunc => when outputting, don't truncate the output (useful for images)
bs => blocksize of above mentioned commands
count => amount of blocks

Posted: Thu May 24, 2007 3:18 pm
by movaxes
Candy wrote:seek => skip blocks in input
skip => skip blocks in output
conv=notrunc => when outputting, don't truncate the output (useful for images)
bs => blocksize of above mentioned commands
count => amount of blocks
Thanks!!

sudo dd if=boot.bin bs=512 of=/dev/fd0
sudo dd if=file.bin bs=512 seek=1 of=/dev/fd0

works fine :D

Posted: Thu May 24, 2007 3:22 pm
by Candy
movaxes wrote:
Candy wrote:seek => skip blocks in input
skip => skip blocks in output
conv=notrunc => when outputting, don't truncate the output (useful for images)
bs => blocksize of above mentioned commands
count => amount of blocks
Thanks!!

sudo dd if=boot.bin bs=512 of=/dev/fd0
sudo dd if=file.bin bs=512 seek=1 of=/dev/fd0

works fine :D
You can practice DD in Windows using John Newbigin's port of DD as well. It has mostly the same command but also supports raw access to devices (iirc direct drive access was like \\.\f: )

Posted: Thu May 24, 2007 3:31 pm
by movaxes
You can practice DD in Windows using John Newbigin's port of DD as well. It has mostly the same command but also supports raw access to devices (iirc direct drive access was like \\.\f: )
Thanks, Windows is no more in my computer, I use Linux now. Works great even if I have bad Ram.

PS: Making an OS is very entertaining :lol: