Page 1 of 1

Accesing floppy drive in protected mode

Posted: Thu Jul 05, 2007 9:07 am
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.

Posted: Thu Jul 05, 2007 10:30 am
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.

Posted: Thu Jul 05, 2007 11:17 am
by davidv1992
i've tried, and i couldn't found anything.

Posted: Thu Jul 05, 2007 11:24 am
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...

Posted: Thu Jul 05, 2007 3:00 pm
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.

Posted: Thu Jul 05, 2007 5:54 pm
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...

Posted: Thu Jul 05, 2007 6:06 pm
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

Posted: Thu Jul 05, 2007 6:48 pm
by earlz
I'd have to learn how to do floppy code first!

Posted: Fri Jul 06, 2007 3:34 am
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

Posted: Fri Jul 06, 2007 3:37 am
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