Page 1 of 1
final.iso insted of flopyboot.img
Posted: Thu May 27, 2010 3:34 pm
by machka
hi all, my computer does not have any floppy device so i want to create .iso image to test my own os. so anybody know how could i create an iso image from two files like bsect and sect2.
regards
Re: final.iso insted of flopyboot.img
Posted: Thu May 27, 2010 4:07 pm
by Combuster
This question and others are answered on the wiki:
Bootable CD - please look there first before posting.
Re: final.iso insted of flopyboot.img
Posted: Thu May 27, 2010 4:16 pm
by machka
so my computer does not create bootable floppy from write.c due to floppy drive doesn't existed so could you help me to create floppy.img from bsect.o and sect2.o files.
regards
Re: final.iso insted of flopyboot.img
Posted: Thu May 27, 2010 4:22 pm
by neon
If Windows, look into using
VFD.
Re: final.iso insted of flopyboot.img
Posted: Thu May 27, 2010 5:01 pm
by machka
no i use it in ubuntu 10.4 this part of the code "floppy_desc = open("/dev/sdc1", O_RDWR);" is wrong because my usb floppy is mounted on sdc but code use fd0 so i change write.c to write usb floppy but it isn't working. so i decide to create final.img in order to write it on a floppy disk. but i cant create img file from two files like bsec and sect2. my write.c code is below;
regards
#include <sys/types.h> /* unistd.h needs this */
#include <unistd.h> /* contains read/write */
#include <fcntl.h>
int main()
{
char boot_buf[512];
int floppy_desc, file_desc;
file_desc = open("./bsect", O_RDONLY);
read(file_desc, boot_buf, 510);
close(file_desc);
boot_buf[510] = 0x55;
boot_buf[511] = 0xaa;
floppy_desc = open("/dev/sdc1", O_RDWR);
lseek(floppy_desc, 0, SEEK_SET);
write(floppy_desc, boot_buf, 512);
file_desc = open("./sect2", O_RDONLY);
read(file_desc, boot_buf, 512);
close(file_desc);
lseek(floppy_desc, 512, SEEK_SET);
write(floppy_desc, boot_buf, 512);
close(floppy_desc);
}
Re: final.iso insted of flopyboot.img
Posted: Thu May 27, 2010 5:26 pm
by montrom
Re: final.iso insted of flopyboot.img
Posted: Thu May 27, 2010 5:50 pm
by machka
ok i solve it.
thanks for help
Re: final.iso insted of flopyboot.img
Posted: Thu May 27, 2010 5:55 pm
by machka
so the solution is floppy_desc = open("final.img", O_RDWR); but you have to create final.img before execute the ./write
otherwise floppy_desc equals -1
regards