LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-30-2005, 09:34 AM   #1
NCC-1701&NCC-1701-D
Member
 
Registered: May 2005
Distribution: Debian Woody,Knoppix
Posts: 88

Rep: Reputation: 16
Unhappy dd if= of= please help


Hi all,
A few days ago I wrote a small assembly program, which hangs the computer if I boot it. I wanted to test it, so I used dd to writeit in the first sector of my disk,

dd if=/home/xxx/2.bin of=/floppy/2.bin bs=512 count=1

i tried to boot with that floppy but nothing happened....

How can I put a .bin file in a floppy and make it bootable with dd?
Thnks
 
Old 07-30-2005, 09:54 AM   #2
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,513

Rep: Reputation: 46
dd doesn't need the floppy to be mounted. Just dd to the device directly:

dd if=/home/xxx/2.bin of=/dev/fd0/2.bin bs=512 count=1
 
Old 07-30-2005, 10:32 AM   #3
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Quote:
Originally posted by bruno buys
dd doesn't need the floppy to be mounted. Just dd to the device directly:

dd if=/home/xxx/2.bin of=/dev/fd0/2.bin bs=512 count=1
Actually, the output file should just be the disk itself.
Code:
dd if=/home/xxx/2.bin of=/dev/fd0 bs=512 count=1
 
Old 07-30-2005, 12:21 PM   #4
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,513

Rep: Reputation: 46
indeed. thanks matir.
 
Old 07-30-2005, 12:24 PM   #5
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
No problem. I wonder what it takes to make bootable assembly code...
 
Old 07-30-2005, 02:10 PM   #6
zackarya
Member
 
Registered: Jul 2003
Distribution: OpenSuse 10, Debian
Posts: 152

Rep: Reputation: 30
Hi Matir,

I don't mean to be offtopic but since the original question was already answered I thought
I'd answer yours.

Writing a very basic bootloader is really very easy. I've played around a bit with it myself.
Instead of going through it here I found a website that explains the concept very well.

http://www.geocities.com/mvea/bootstrap.htm

And this page is talking about writing an OS in a emulated environment which may also be
interesting to some.

http://www.emu8086.com/assembly_lang...torial_11.html

I'm not sure the original posters reasons but IMO since grub and lilo are both already so good, I would just use one of them.

It's great for learning though, and that's always a good reason.

Zack
 
Old 07-31-2005, 12:14 PM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Cool, thanks for the links. As you say, all I want to do is learn.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration