Reading floppy using ports...
Reading floppy using ports...
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*
Best regards,
Peter Vigren *hopefull*
Re: Reading floppy using ports...
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...
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...
Did you try Fabian Nunez' driver?
http://people.cs.uct.ac.za/~fabian/coding.html
http://www.execpc.com/~geezer/os/floppy.zip
http://people.cs.uct.ac.za/~fabian/coding.html
http://www.execpc.com/~geezer/os/floppy.zip
Re: Reading floppy using ports...
To Thomas: Haven't had the time to try it yet...
To Chris Giese: The second link is broken...
To Chris Giese: The second link is broken...
Re: Reading floppy using ports...
oops, I'll try again. These are the same files:
http://www.execpc.com/~geezer/os/fdc.zip
http://people.cs.uct.ac.za/~fabian/files/fdc.zip
http://www.execpc.com/~geezer/os/fdc.zip
http://people.cs.uct.ac.za/~fabian/files/fdc.zip
Re:Reading floppy using ports...
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...
this still does not give me the info i need. how do i determine the base port address?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.
Re:Reading floppy using ports...
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...
I just wanted to know if anyone had a good method of detrmining this?
Some algorithm perhaps.
Some algorithm perhaps.
Re:Reading floppy using ports...
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...
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
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...
I know this isn't done with ports but it can help
http://www.mega-tokyo.com/forum/index.p ... 77;start=0
http://www.mega-tokyo.com/forum/index.p ... 77;start=0
Re:Reading floppy using ports...
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?