Page 1 of 2
Reading floppy using ports...
Posted: Fri Aug 17, 2001 8:36 am
by Peter_Vigren
Anyone out there having a sample code in assembly (preferable nasm) that describes how to read from a floppy using ports (not with int 13h and preferable using DMA)??? I have read several but when I put them into a program it doesn't work at all... Please help me... I had planned to complete my floppy-routine before the summer holiday ends...
Best regards,
Peter Vigren *hopefull*
Re: Reading floppy using ports...
Posted: Fri Aug 24, 2001 12:12 am
by Thomas
I write an OS myself and i was trying and trying to read ONE Fu**ing Sector from Disk. Now i finally did it. Its just a Demo and u will need to dump a special bootsector on the disk in order to use it...but if u want it mail me.
By the Way....doing the same thing in C is pretty shitty...
i cant find the error(s).... Statusregs look OK ... but no Data is Read...
Re: Reading floppy using ports...
Posted: Thu Aug 30, 2001 9:50 am
by Thomas
and?....did it work/help ya?
Re: Reading floppy using ports...
Posted: Thu Aug 30, 2001 4:51 pm
by Chris Giese
Re: Reading floppy using ports...
Posted: Sat Sep 01, 2001 5:05 am
by Peter_Vigren
To Thomas: Haven't had the time to try it yet...
To Chris Giese: The second link is broken...
Re: Reading floppy using ports...
Posted: Sat Sep 01, 2001 4:44 pm
by Chris Giese
Re:Reading floppy using ports...
Posted: Tue Dec 09, 2003 1:32 pm
by Guest
I just wanted to know how do we determine the base port address of the floppy controller. I read that it is 'usually' 0x3f2. I just wanted to know how to get the actual base port address. Please help me.
Re:Reading floppy using ports...
Posted: Tue Dec 09, 2003 1:40 pm
by Therx
[0] A good tutorial :
here
[0] Chris those links are still broken but luckily I have a copy on my site :
here
Pete
Re:Reading floppy using ports...
Posted: Tue Dec 09, 2003 3:07 pm
by Guest
The base port address used for the controller is dependant on whether the controller is configured as the primary or secondary controller. This base address controls the port addresses used for each of the registers on the controller.
this still does not give me the info i need. how do i determine the base port address?
Re:Reading floppy using ports...
Posted: Tue Dec 09, 2003 3:15 pm
by Tim
Hard-code it, but define it as a constant in case you come up with a better method of determining it later.
Code: Select all
#define FDC_BASE_ADDRESS 0x3f0
#define FLOPPY_IRQ 6
Re:Reading floppy using ports...
Posted: Wed Dec 10, 2003 11:36 am
by Guest
I just wanted to know if anyone had a good method of detrmining this?
Some algorithm perhaps.
Re:Reading floppy using ports...
Posted: Wed Dec 10, 2003 11:56 am
by Tim
It's hard-coded. On newer machines the address of the floppy controller might be decided by ACPI, but any machine where the floppy controller isn't at that address/IRQ can't call itself a PC compatible -- it won't run older OSes, and it won't run new ones without special drivers.
Re:Reading floppy using ports...
Posted: Thu Dec 11, 2003 10:34 am
by mr. xsism
http://www.nondot.org/sabre/os/files/Disk/FLOPPY.TXT
Print that out as it will be very useful once you understand the basics. It lists the transfer of bytes needed for ops like seek, rebalicrating, reading, etc. Plus it gives ou the list of ports for the FDC
Re:Reading floppy using ports...
Posted: Thu Dec 11, 2003 11:27 am
by Slasher
Re:Reading floppy using ports...
Posted: Tue Jan 20, 2004 11:27 am
by guest
I'm having some trouble with the floppy driver. when i try to read a sector (0x66) i keep geting the value ST0=0x40 (error). I think this means that the index hole is passed twice. does anyone know why this happens and how it can be corrected?