Need Help using DD

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
movaxes
Posts: 5
Joined: Mon Jan 29, 2007 3:16 pm
Contact:

Need Help using DD

Post 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...
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post 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
movaxes
Posts: 5
Joined: Mon Jan 29, 2007 3:16 pm
Contact:

Post 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
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post 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: )
movaxes
Posts: 5
Joined: Mon Jan 29, 2007 3:16 pm
Contact:

Post 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:
Post Reply