Accesing floppy drive in protected mode

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
davidv1992
Member
Member
Posts: 223
Joined: Thu Jul 05, 2007 8:58 am

Accesing floppy drive in protected mode

Post by davidv1992 »

I wan't to learn how to access my floppy drive while running in protected mode, but i can't get any clue from the wiki article about this. Can somebody help me by pushing me in the right direction.
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Post by hailstorm »

You could search this forum, I guess this subject has been discussed a lot.
You have three options:

Switch back to real mode to execute a bios call
Access the hardware directly.
I could say; use vm86 task, but hey, that requires a lot of programming to, and you still have to go to real mode to execute a bios call or access hardware directly, I believe.
davidv1992
Member
Member
Posts: 223
Joined: Thu Jul 05, 2007 8:58 am

Post by davidv1992 »

i've tried, and i couldn't found anything.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

davidv1992 wrote:i've tried, and i couldn't found anything.
At the end of the wiki article there are links. Those are probably what you're looking for.

This one isn't bad...
C8H10N4O2 | #446691 | Trust the nodes.
Ninjarider
Member
Member
Posts: 62
Joined: Fri Jun 29, 2007 8:36 pm

Post by Ninjarider »

ralph brown should have a list of hardware in/outs. yours options are either return to real or direct access.

in the odd event that this is on a windows machine. theres a 21h interrupt.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

there really should be a better FDD tutorial...and one with working FDD code at the end, or at least some kinda psuedo code...
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

hckr83 wrote:there really should be a better FDD tutorial...and one with working FDD code at the end, or at least some kinda psuedo code...
Write one. :P
C8H10N4O2 | #446691 | Trust the nodes.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

I'd have to learn how to do floppy code first!
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

Try reading the datasheets at http://www.datasheetarchive.com/search. ... sType=part.

Basically, you write to various ports to select the command you want to execute, run it then wait for an interrupt. You can use pio or dma for data transfers (dma is probably better).

Regards,
John
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

Never fear, I is here: :wink:
Here is the pmode floppy driver from DexOS, it is well commented and follows the pedo code in the intel floppy controler PDF.

Floppy code:
http://www.dex4u.com/tuts/FloppyDriver.zip

Intel PDF:
http://bos.asmhackers.net/docs/floppy/d ... asheet.pdf

PS: I am doing a Dev Mag, anyone want to write a floppy tut is most welcome.
Sample:
http://www.dex4u.com/DexMag/DexMag1-0.htm
Post Reply