Floppy Disk Driver

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pravinpareek
Posts: 6
Joined: Mon Mar 31, 2014 5:56 am

Floppy Disk Driver

Post 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
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: Floppy Disk Driver

Post 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
pravinpareek
Posts: 6
Joined: Mon Mar 31, 2014 5:56 am

Re: Floppy Disk Driver

Post by pravinpareek »

But i am in protected mode so if there any memory management requirment
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: Floppy Disk Driver

Post by MollenOS »

The DMA buffer must be below 16 mb physical I think. Otherwise no. (I'd like to get this confirmed though.)
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Floppy Disk Driver

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
pravinpareek
Posts: 6
Joined: Mon Mar 31, 2014 5:56 am

Re: Floppy Disk Driver

Post by pravinpareek »

But i want some code example that help my developmet
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Floppy Disk Driver

Post by Gigasoft »

Sorry, but we already went to college.
pravinpareek
Posts: 6
Joined: Mon Mar 31, 2014 5:56 am

Re: Floppy Disk Driver

Post 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.
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Floppy Disk Driver

Post by Gigasoft »

Ask your teacher.
pravinpareek
Posts: 6
Joined: Mon Mar 31, 2014 5:56 am

Re: Floppy Disk Driver

Post by pravinpareek »

so what is the use of this forum our teacher have limited knowledge of floppy disk driver
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Floppy Disk Driver

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
pravinpareek
Posts: 6
Joined: Mon Mar 31, 2014 5:56 am

Re: Floppy Disk Driver

Post by pravinpareek »

Thanks to all for replay..
Post Reply