Code to Low-Level read/write to Floppy Disks 
Author Message
 Code to Low-Level read/write to Floppy Disks

Hello People,

I am trying to read and write directly from my floppy drive for a
proyect I am involved in. My intention is to perform Low-Level
formating of Diskettes, to cram more data into them, and to
thoroughlly analyze it. I have surfed the net and found many texts
about the FDC but they all still depend on the track/sector
information, and I need to go closer to the surface.

Mi wish is to read a whole track (complete with track and sector
markers and structures).

So I write to query the collective wisdom of all of you to see if you
can help me do that.

1) Is it even possible to do with a run of the mill Floppy drive? I am
pretty sure it can but Im no longer 199% sure.

2) If the answer to question 1 is yes, then anyone know how (or better
yet) know of anywhere I can download that Info.

Let me thank you all in advance.

Regards Edgardo.



Thu, 10 Jun 2004 09:10:59 GMT  
 Code to Low-Level read/write to Floppy Disks
Hello {*filter*}folk!

On Sun, 23 Dec 2001 01:10:59 +0000 (UTC), Edgardo spake thus:

Quote:
>Hello People,

>I am trying to read and write directly from my floppy drive for a
>proyect I am involved in. My intention is to perform Low-Level
>formating of Diskettes, to cram more data into them, and to
>thoroughlly analyze it. I have surfed the net and found many texts
>about the FDC but they all still depend on the track/sector
>information, and I need to go closer to the surface.

My page on FDC programming will show you all the registers and
commands for a stnadard FDC. Go to

http://www.*-*-*.com/

You'll have to use your code to insert the gap/sector/track data, as
the standard commands only give you the data in the sectors. To
determine the gap size, you'll have to read other references, then you
can insert that data into the track data once you have read it from
disk. You can determine the current head and track in code, as well as
from what you are telling your app to read, and you will know what
sector you are reading from how you code it. There is no single
command to read the entire physical track including gap and other
data, and the read track command only reads the data contained in the
sectors as a contiguous data stream.

To get more detail on writing a format utility, do a search for
2m30.zip, 2m30src.zip and fdform18.zip, both of which are formatting
utilities with source included which can handle larger than 1.44M
capacity on a 1.44M floppy disk. 2M has comments in Spanish, and I
think (not sure) that FDFormat has it's coments in German. Both have
some code in assembler and some in HLLs, so you will need to either
understand the language the comments are in or the programming
language to take advantage of the information in the utilities. They
are both reasonable sources for information on things like the gap
sizes for different capacities (although they are by no means the only
source for that info, they are just good sources and they are reliable
tools).

debs

----
Mispelled? Impossible! I have an error correcting modem.



Thu, 10 Jun 2004 13:56:00 GMT  
 Code to Low-Level read/write to Floppy Disks

Quote:

> Hello People,

> I am trying to read and write directly from my floppy drive for a
> proyect I am involved in. My intention is to perform Low-Level
> formating of Diskettes, to cram more data into them, and to
> thoroughlly analyze it. I have surfed the net and found many texts
> about the FDC but they all still depend on the track/sector
> information, and I need to go closer to the surface.

> Mi wish is to read a whole track (complete with track and sector
> markers and structures).

> So I write to query the collective wisdom of all of you to see if you
> can help me do that.

> 1) Is it even possible to do with a run of the mill Floppy drive? I am
> pretty sure it can but Im no longer 199% sure.

> 2) If the answer to question 1 is yes, then anyone know how (or better
> yet) know of anywhere I can download that Info.

> Let me thank you all in advance.

> Regards Edgardo.

I hope you are back from your vacation.

If yes, please tell me how to compile the code written by you at the
bottom of the webpage. I use MASM (sorry about that), and it informs
of a whole lot of errors.

any way to get by that?



Tue, 15 Jun 2004 04:55:56 GMT  
 Code to Low-Level read/write to Floppy Disks
Hello {*filter*}folk!

On Thu, 27 Dec 2001 20:55:56 +0000 (UTC), Ozone Radical spake thus:

<snip>

Quote:
>I hope you are back from your vacation.

>If yes, please tell me how to compile the code written by you at the
>bottom of the webpage. I use MASM (sorry about that), and it informs
>of a whole lot of errors.

>any way to get by that?

Were you referring to something on Edgardos site (which he didn't
mention in his post) or the code on my page (the link I psoted in my
reply to him)?

If you were refering to the DMA code on my page, it was originally
taken from some code in The Indispensable PC Hardware Book, and the
syntax used for output to ports is imm,imm. This needs to be changed
for any assembler I know other than A86, and the port number needs to
be in DX. For example:

        out     08h,14h

should read

        mov     al,14h
        out     08h,al

or

        mov     dx,08h
        mov     al,08h
        out     dx,al

I recommend the second format in general, as the first can only be
used for port number 0-255, meaning it can't be used in a general
routine.

The code on the page is being updated, I'm about mid-way through
overhauling the whole page (changing port read/writes throughout the
file and checking typos). Im also working on my own FDC driver, but
that is on a back-burner while I do some more reading around the
differences in different x86 compatible processors and optimisation
techniques, so that I can attempt to optimise my code for as many
processors as possible (no good optimising for one processor and
finding the code is half the speed on all others, when it can be at
95% or more of the speed on all processors). Better to be sure of what
I code than to have to keep going back and redoing it :)

The FDC page was written 2 1/2 years ago, and I ahve only recently
been able to get back into any serious programming (ill health and
other stuff ahve got in the way). I'm going about things slightly
different to before, and will still prepare docs as and when I read
enough to get an understanding of a topic, but as with the FDC page it
could take a while to update things. My health still slows me down, it
just doesn't stop me at the moment :)

If you ahven't got a clue what Im talking about, I'll repost my link
<another shameless plug...>

http://www.*-*-*.com/

After changing the port writes (the out commands), try assembling
again, and if you are still getting errors, let us know what they are
(preferably with the lines of data that the errors refer to, if not
the entire routine), and someone might be able to tell you what you
need to do to get that code working under masm. I use nasm personally,
so although it is similar there are some minor differences that might
make a difference (such as memory referencing, but with the code from
my page, that shouldn't be a problem).

debs

----
Misspelled? Impossible! I have an error correcting modem.



Tue, 15 Jun 2004 13:55:58 GMT  
 Code to Low-Level read/write to Floppy Disks


   >  [...snip...]
   >
   >...For example:
   >
   >   out 08h,14h
   >
   >should read
   >
   >   mov al,14h
   >   out 08h,al
   >
   >or
   >
   >   mov dx,08h
   >   mov al,08h
   >   out dx,al

Oops!  Typo, Debbie.  Should be:

        mov     dx,08h
        mov     al,14h   <-- corrected value
        out     dx,al

   >another shameless plug...
   >http://debs.future.easyspace.com/Programming/Hardware/FDC/floppy.html

Can't hurt to mention it one more time. :)



Tue, 15 Jun 2004 17:56:00 GMT  
 Code to Low-Level read/write to Floppy Disks
Take a look at the Undocumented PC by Frank Van Gilluwe. It explains
programming down to the register level.
Quote:
>Hello People,

>I am trying to read and write directly from my floppy drive for a
>proyect I am involved in. My intention is to perform Low-Level
>formating of Diskettes, to cram more data into them, and to
>thoroughlly analyze it. I have surfed the net and found many texts
>about the FDC but they all still depend on the track/sector
>information, and I need to go closer to the surface.

>Mi wish is to read a whole track (complete with track and sector
>markers and structures).

>So I write to query the collective wisdom of all of you to see if you
>can help me do that.

>1) Is it even possible to do with a run of the mill Floppy drive? I am
>pretty sure it can but Im no longer 199% sure.

>2) If the answer to question 1 is yes, then anyone know how (or better
>yet) know of anywhere I can download that Info.

>Let me thank you all in advance.

>Regards Edgardo.



Sun, 20 Jun 2004 03:24:40 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Low-level disk read/write

2. Floppy Disk Drive Low Level Programming Help!

3. Low level floppy disk stuff

4. low-level floppy code

5. How to read/write floppy disk through PORT ?

6. Need help reading/writing boot sector (floppy disk)

7. How to read/write floppy disk through PORT?

8. Floppy I/O and General Low Level Compatibility

9. Access disk Low level ?!

10. Low level disk services - Usual newbie needs help type of message

11. Low-level disk control

12. Low level hard disk access

 

 
Powered by phpBB® Forum Software