Page 1 of 1

Floppy Disk Driver

Posted: Mon Mar 31, 2014 6:16 am
by pravinpareek
Hi,
I am trying to develop an os for my college project but i have some problem with floppy disk driver

my question is that "there is any requirement of memory management like paging for floppy driver to read a sector and read sector tutorial for floppy" But in "c" language

Re: Floppy Disk Driver

Posted: Mon Mar 31, 2014 11:42 am
by Nable
Could you take a look at the top part of forum page, please?
There's a nice huge link there: "The OSDev.org Wiki - Got a question? Search this first!"
It often helps, really. One can also find a page with forum rules, list of rules is not long but every line is important.
pravinpareek wrote:there is any requirement of memory management like paging
No. One can use floppy in plain real mode without any paging.
pravinpareek wrote:But in "c" language
http://wiki.osdev.org/Floppy#Code_Examples

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 2:35 am
by pravinpareek
But i am in protected mode so if there any memory management requirment

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 2:45 am
by MollenOS
The DMA buffer must be below 16 mb physical I think. Otherwise no. (I'd like to get this confirmed though.)

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 2:49 am
by Brendan
Hi,
pravinpareek wrote:But i am in protected mode so if there any memory management requirment
For "legacy ISA floppy controller:
  • For PIO: you can transfer data directly to/from the buffer provided by the caller
    For DMA: you have to be able to allocate a buffer suitable for DMA (below 0x01000000, doesn't cross a 64 KiB boundary)
For other types of floppy (e.g. attached to USB) you probably will need something to allocate things for the controller (e.g. to manage USB transfer descriptors)

However; in general floppy is very slow and benefits a lot from caching, and in that case you'd need to allocate memory for caches. Also note that PIO sucks (consumes 100% of CPU time and makes the OS seem very sluggish while floppy is being used) and should be avoided in any code that's worth writing.


Cheers,

Brendan

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 2:58 am
by pravinpareek
But i want some code example that help my developmet

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 3:01 am
by Gigasoft
Sorry, but we already went to college.

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 3:03 am
by pravinpareek
hi,

I would request you to guide me on few of my query's mentioned below -:

i) Is it essential to enable paging prior to developing Floppy Disk Driver.
II) other essential aspects to keep in mind while developing Floppy Disk Driver.

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 3:05 am
by Gigasoft
Ask your teacher.

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 3:09 am
by pravinpareek
so what is the use of this forum our teacher have limited knowledge of floppy disk driver

Re: Floppy Disk Driver

Posted: Tue Apr 01, 2014 5:19 am
by Brendan
Hi,
pravinpareek wrote:i) Is it essential to enable paging prior to developing Floppy Disk Driver.
No, paging is not essential.
pravinpareek wrote:II) other essential aspects to keep in mind while developing Floppy Disk Driver.
Depending on how you implement it, some things may or may not be essential. For example, if you don't use polling then support for IRQs is essential; if your OS supports multi-CPU then some sort of spinlock/mutex may be essential, if you do asynchronous IO then some sort of queue of pending requests would be essential, etc.

If we ignore all of the "optionally essential" things; everything that's always essential (regardless of how the OS is designed and regardless of how the floppy driver works) is obvious to anyone who has actually read the floppy controller datasheet.

With this in mind, the first and only thing on my list of things that are essential is reading the floppy controller datasheet.


Cheers,

Brendan

Re: Floppy Disk Driver

Posted: Wed Apr 02, 2014 3:06 am
by pravinpareek
Thanks to all for replay..