zak100 schrieb:
> Hi,
> I have got a 'C' laguage to write on boot sector. When I excute it, nothing
> happens and the disk data remains the same. On the other hand assembly
> language version is wroking fine. Can somebody help me plz:
Check the return value of your functions for errors. It is likely the
open fails.
> file_desc = open("./boot", O_RDONLY);
Check here.
> read(file_desc, boot_buf, 510);
Check here.
> close(file_desc);
>
> boot_buf[510] = 0x55;
> boot_buf[511] = 0xaa;
>
> floppy_desc = open("/dev/fd0", O_RDWR);
Check here.
> lseek(floppy_desc, 0, SEEK_CUR);
Check here.
> write(floppy_desc, boot_buf, 512);
Check here.
> close(floppy_desc);
> }
Regards,
Johannes
--
"Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit,
verlästerung von Gott, Bibel und mir und bewusster Blasphemie."
-- Prophet und Visionär Hans Joss aka HJP in de.sci.physik
<[email protected]>
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus