Link to home
Start Free TrialLog in
Avatar of snb2001
snb2001

asked on

Format a floppy disk

I want to format a floppy disk in turboc such that it is not readable in DOS. please respond urgently. thanks.

I have managed to format the disk in turboc in such a way that it is unredable in dos using biosdisk.
now i want to write and read on the disk. what do i have to do becos i have already tried it with an
error- Bad ECC on disk read- with biosdisk function.
Avatar of BJZ
BJZ

After normally formatting a disk delete the boot sector ( put some 0 ) and DOS could not read the disk normally.
This is sector 0, it needs specific values for 1st and last bytes. Zeroing them should do the trick. errr,,

I misunderstand something.. what tools in turbo C will you use to access the disk to do the format anyway? Or to read it (diskette) afterwards? Odds are you want DOS or minimally the BIOS part, or are you good at implementing low level direct I/O?

For best chance at getting incompatibility, load up linux. MS-Dos won't accept anything done in linux world. See also, free-DOS, they likely have some utilities that are relevant, and could be placed on a FAT16 space where turbo can find & call them.
Hi !

  Once u write something into the boot sector, DOS will ot recognise it.Use the harddisk writing interrupt to write to track 0 sector 1 and u are done.
hope that helps,
rasaraja
That is any different or improved from any of prior comments?

Go here for 90% of the assembler code:
https://www.experts-exchange.com/jsp/qShow.jsp?ta=progsoftgen&qid=20129928
Note: you need not read disk, or loop to all sectors, but should initialize buffer to zero
Avatar of snb2001

ASKER

I have managed to format the disk in turboc in such a way that it is unredable in dos using biosdisk. now i want to write and read on the disk. what do i have to do becos i have already tried it with an error- Bad ECC on disk read.
You have to read it as it was written. If you disable dos|bios, then you cannot use it.

Your error sounds like error control, like Parity bits and CRC, Cyclic Redundancy. But at moment I forget what is ECC. I think the format operation was likely incomplete.
;-)  Ah, you rewired your PC so electons called by subroutine form electromagnet perhaps?

ECC refers to the bits the hardware uses for error control. This is traditionally beyond any accessibility of s/w, for placing the computations in H/W is so much more efficient. So, easiest way to create ECC prob is to have physical damage on disk, either through bad h/w or perhaps a magnet may suffice.

Still, my guess is that you are not using same disk layout when reading it than you did when writing. This could happen I suppose if you tried to change sector length to an odd, say 756 bytes, then tried to read it back as if it was 912 bytes, when the system looks for headers, trailers, parity, etc, - it does not find them where they are suspected to be.  Note - ECC says it can have error AND still correct it, and this is the code not found.

I think your blocking factors are mismatched.
done?

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial