dd in Cygwin

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.
Candamir

dd in Cygwin

Post by Candamir »

When I'm creating my auxiliary boot disk (as described in the FAQ) in Cygwin (WinXP SP2) with the same instructions as told, it returns:

bash: of=/dev/fd0: No such file or directory

Then, I tried A: instead of /dev/fd0, as this is Linux, but it still didn't work... Has anyone done this before and knows what to do in this case?

Thanks
paulbarker

Re:dd in Cygwin

Post by paulbarker »

Google "rawwrite".
Candamir

Re:dd in Cygwin

Post by Candamir »

I already use rawwrite, but I want to create my own boot disk. This is because the grub disk I downloaded from BonaFide suddenly stopped working on real hardware (still working in bochs), I always get a Read stage2Read Error

I also tried the boot disk you can download at Clicker's site, but the same result (Bochs:+/Hardware:-); if anyone knows what to do, please help me. The strange thing is that it worked some time ago but suddenly stopped to do so...
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:dd in Cygwin

Post by Colonel Kernel »

I'm using dd in Cygwin successfully. If you can wait six hours, I'll be able to consult my makefile and give you the answer. :)
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
Candamir

Re:dd in Cygwin

Post by Candamir »

Thank you, of course I'll wait.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:dd in Cygwin

Post by Colonel Kernel »

This is the line from my makefile (with the appropriate parameters substituted):

Code: Select all

dd if=../../../Bin/free_x86_uni/kernel.img of=/dev/fd0
Your source path will of course differ. I'm not sure what you were doing wrong before -- the "of" part looks the same to me.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
JoeKayzA

Re:dd in Cygwin

Post by JoeKayzA »

Candamir wrote: When I'm creating my auxiliary boot disk (as described in the FAQ) in Cygwin (WinXP SP2) with the same instructions as told, it returns:

bash: of=/dev/fd0: No such file or directory

Then, I tried A: instead of /dev/fd0, as this is Linux, but it still didn't work... Has anyone done this before and knows what to do in this case?
When you use 'ls /dev/fd0', does it show up? Maybe it's called something like '/dev/floppy/0' or '/dev/floppy0' instead - this is the newer device naming convention under Linux, I don't know about Cygwin however.

cheers Joe
YeXo

Re:dd in Cygwin

Post by YeXo »

I'm using a windows version of dd (not cygwin). Google for "dd windows". I use a command like this:

Code: Select all

dd if=floppy.img of=\\.\a:
Hope this helps.
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Re:dd in Cygwin

Post by nick8325 »

Hang on, bash complains? If the path is wrong it should be dd complaining. What command are you using?
Candamir

Re:dd in Cygwin

Post by Candamir »

Code: Select all

dd if=<stage1> of=/dev/fd0 bs=512 count=1
and

Code: Select all

dd if=<stage1> of=\\.\a: bs=512 count=1
and all other variations you posted here, and everytime it's bash that complains, not dd...

But actually, I'm doing this because GRUB suddenly stopped working on real hardware, but still works on BOCHS. My tools are Rawwrite and Virtual Floppy Driver, and I thought it might be a bug in Rawwrite and downloaded cygwin, but... :-\ I always get GRUB reading stage2Read Error. I would use a image downloaded from BonaFide and I also tried one available in the Clicker download section. Could it have something to do with the size of my kernel, because if I remember right, things started to go wrong about the time when my kernel grew from 12k to 16k...
JoeKayzA

Re:dd in Cygwin

Post by JoeKayzA »

Candamir wrote:

Code: Select all

dd if=<stage1> of=/dev/fd0 bs=512 count=1
and

Code: Select all

dd if=<stage1> of=\\.\a: bs=512 count=1
and all other variations you posted here, and everytime it's bash that complains, not dd...
Uh, just a moment, do you really write <stage1> - with the '<' and '>' characters? If so, that would explain why bash is complaining: those characters are control characters for bash, and mean to redirect the input and output of the command. With your specific command, bash will connect the file 'stage1' to stdin, and then try to connect the file 'of=/dev/fd0' to stdout - which fails, therefore you get the message from bash that the file 'of=/dev/fd0' was not found. ;)

Just remove the < and > characters and it should do the job.

cheers Joe
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:dd in Cygwin

Post by Colonel Kernel »

I assume "<stage1>" is just a placeholder for the real input file name, right?

<edit>
Doh... Sometimes Firefox's "open in tabs" means you're replying to a stale version of the thread if you've left the tab alone for a while. :)
</edit>
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
Candamir

Re:dd in Cygwin

Post by Candamir »

OK. Thanks to your advice, I now brought dd to write stage1 to my floppy disk (of=/dev/fd0 worked), but when I proceed to write stage2, it tells me there's no space left on device; I alredy checked dd documentation, what's wrong here?
<edit>
Doh... Sometimes Firefox's "open in tabs" means you're replying to a stale version of the thread if you've left the tab alone for a while.
</edit>
Uses to happen... ;D
JoeKayzA

Re:dd in Cygwin

Post by JoeKayzA »

Candamir wrote: OK. Thanks to your advice, I now brought dd to write stage1 to my floppy disk (of=/dev/fd0 worked), but when I proceed to write stage2, it tells me there's no space left on device; I alredy checked dd documentation, what's wrong here?
That's really strange...that would mean your stage2 is too large, but I can't imagine it's larger than 1.44 MB.

When you set up a GRUB boot floppy with dd (without a filesystem), you want to put stage1 at the beginning, and the stage2 file directly afterwards. So, when I assume your stage1 is exactly 512 bytes (1 block) large, this would mean you issue the following commands:

Code: Select all

dd if=stage1 of=/dev/fd0 bs=512 count=1 

dd if=stage2 of=/dev/fd0 bs=512 seek=1 
'seek' tells dd to skip the first block in the output file and start writing afterwards. Do these commands differ from the ones you are using?

cheers Joe
Candamir

Re:dd in Cygwin

Post by Candamir »

I'm using exactly those commands and stage2 is ~99 kb big (forgot the exact number)... Strange ??? But is there any reason I could assume that the pre-fabricated images I downloaded (mentioned above) don't work when my kernel's size grows beyond 16k? I also downloaded Clicker, which is based on GRUB, and it did work; my home-made bootloader isn't yet capable of anything but displaying text on the screen (I don't even dare /thinking/ about the nightmare it'll be to make it multiboot-compliant ;D) And I checked boochsout and there wasn't even a warning! Because now, I'm approaching to the problem:

- My OS (GRUB) works on BOCHS
- Clicker w. GRUB works on real hardware, Phoenix BIOS, Compaq BIOS (used Rawwrite)
- My OS (no cool name yet) w. GRUB doesn't work on real hardware (Phoenix & Compaq)(used Rawwrite)

Well, if it would depend on three factors (GRUB, Rawwrite and the BIOS), the problem wouldn't have any logical solution ;D :'(, that's why I'm trying to create my own GRUB disk. I'm now trying to use mkisofs in order to use cd's...
Post Reply