Copying boot.bin to sectors on Linux
Copying boot.bin to sectors on Linux
Hello, I have a problem:
I am using linux, and i want to copy boot.bin to bootable sector of floppy. I use like this: dd if=boot.bin of=/dev/fd0 , it writes me that it copied, but when I try to emulate it with bochs or with my real pc, it does not load. On bochs it writes:
[BIOS ] BIOS panic at rombios.c, line 1558
On my real pc it just skips and loads GRUB menu where I choose to load linux or windows. Can someone help me with that please?
I am using linux, and i want to copy boot.bin to bootable sector of floppy. I use like this: dd if=boot.bin of=/dev/fd0 , it writes me that it copied, but when I try to emulate it with bochs or with my real pc, it does not load. On bochs it writes:
[BIOS ] BIOS panic at rombios.c, line 1558
On my real pc it just skips and loads GRUB menu where I choose to load linux or windows. Can someone help me with that please?
Re:Copying boot.bin to sectors on Linux
Did you include a boot signature (0x55 0xaa) at the end of the first sector? If not, no computer is going to see your disk as bootable and thus complain.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Copying boot.bin to sectors on Linux
What about Using the Source ? get the sources package for your distribution, locate bios/rombios.c, head yourself to line 1558 and read the comments around there to know what you should try to fix ?Vladaz wrote: On bochs it writes:
[BIOS ] BIOS panic at rombios.c, line 1558
Re:Copying boot.bin to sectors on Linux
Not really helpful Pype. That particular part of rombios.c is a hack to make sure the panic message gets written out. The error itself probably happened way back in the code.
Re:Copying boot.bin to sectors on Linux
You see, my bootloader even doesn't boot on my real pc. I think there's a problem copying bootloader to boot sector. On windows everything is OK, but on linux there's that problem.
Im sure, that my boot.bin is ok. Because when i tried to boot it straight from bochs, it booted, and it worked, but using floppy it isn't. I think that there is some problem copying to floppy :/
Maybe you know any OS that has installation for linux, so i could just copy that os to floppy and then try?
Im sure, that my boot.bin is ok. Because when i tried to boot it straight from bochs, it booted, and it worked, but using floppy it isn't. I think that there is some problem copying to floppy :/
Maybe you know any OS that has installation for linux, so i could just copy that os to floppy and then try?
Re:Copying boot.bin to sectors on Linux
No need to get that complicated.
Or something similar if all you want is to verify that the 512 bytes of your bootsector did in fact get copied.
Code: Select all
dd if=boot.bin of=/dev/fd0
dd if=/dev/fd0 of=boot.bin.bak bs=512 count=1
md5sum boot.bin boot.bin.bak
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Copying boot.bin to sectors on Linux
well, not being sure i had the same bochs here, that was the best i could suggest ...Curufir wrote: Not really helpful Pype. That particular part of rombios.c is a hack to make sure the panic message gets written out. The error itself probably happened way back in the code.
Re:Copying boot.bin to sectors on Linux
Apologies, read that again and it sounds...odd.
I meant the code wasn't particularily helpful, the suggestion was sound.
I meant the code wasn't particularily helpful, the suggestion was sound.
Re:Copying boot.bin to sectors on Linux
I've tried that code that Curufir posted.
boot.bin.bak is 0 bytes sizes. So I think it doesn't copy that boot.bin.
And one more thing, when i copy i get the result like this:
1+0 records in
1+0 records out
512 bytes transferred in 0,496871 seconds (1030 bytes/sec)
.
But there is one thing, when it is copying my boot.bin, fdd does not make any noise, that you can hear always when you are copying any data to floppys.
boot.bin.bak is 0 bytes sizes. So I think it doesn't copy that boot.bin.
And one more thing, when i copy i get the result like this:
1+0 records in
1+0 records out
512 bytes transferred in 0,496871 seconds (1030 bytes/sec)
.
But there is one thing, when it is copying my boot.bin, fdd does not make any noise, that you can hear always when you are copying any data to floppys.
Re:Copying boot.bin to sectors on Linux
Sorry guys for bothering you ;D
The problem was in my floppy disc It wasn't working
The problem was in my floppy disc It wasn't working
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Copying boot.bin to sectors on Linux
The way linux uses the FDD is different from the way BIOS uses it, which means you may not recognize typical noises ...Vladaz wrote: fdd does not make any noise, that you can hear always when you are copying any data to floppys.
Moreover, when writing to a floppy in linux, the actual data write may be postponed or may continue even after the program terminates. Usually, you should umount or sync to make sure the move is completed ...
Re:Copying boot.bin to sectors on Linux
Only when writing to a mounted device. If you write to the device file itself (/dev/fd0) you do get a direct write.Pype.Clicker wrote: Moreover, when writing to a floppy in linux, the actual data write may be postponed or may continue even after the program terminates. Usually, you should umount or sync to make sure the move is completed ...