Floppy driver tutorial
- Slasher
Floppy driver tutorial
Post by Slasher »
[mirrored] at bos.asmhackers.net
[sub]<pype>if broken, ask me for file md5#18d46e742babaf5e3ebf4f2627f3984d </pype>[/sub]
- Tim
Re:Floppy driver tutorial
Post by Tim »
This isn't necessary at all for this structure, since it contains only chars. No compiler will put any padding between these fields.*NOTE: __attribute__ ((packed)) is used in djgpp gcc to instruct the compiler not to place extra bytes in the structure in an attempt to align it. ie it should leave the structure as it is. if you are not using djgpp gcc, you can remove it.
Are you sure you want to copy zeroes into the BIOS disk parameter structure? You probably want the first two parameters the other way round. Also, the second (unsigned char*) is unnecessary.floppy_parameters floppy_disk; /*declare variable of floppy_parameters type*/
memcpy((unsigned char *)DISK_PARAMETER_ADDRESS,(unsigned char *)&floppy_disk,sizeof(floppy_parameters));
I don't think you mention what interrupt the controller uses (IRQ 6).3.wait for an interrupt from the controller
- Slasher
Re:Floppy driver tutorial
Post by Slasher »
Believe it or not, the one I posted is not the complete one. :'(
Well, this is what is missing:
The floppy uses interrupt line 6 (IRQ 6) for its interrupts. If you have reprogrammed the PIC say to handle the master interrupts from 0x20 and the slave interrupts from 0x28, the the floppy's interrupts should be installed at interrupt service routine 0x26.
An example floppy ISR could be
(NASM format)
Code: Select all
extern _floppy_int_count
_floppy_int:
inc word [_floppy_int_count]
mov al,0x20 ;acknowledge interrupt to PIC
out 0x20,al
iret
Code: Select all
unsigned short floppy_int_count=0;
void wait_floppy_interrupt()
{
while(floppy_int_count <= 0);
floppy_int_count--;
return;
}
- gmoney
Re:Floppy driver tutorial
Post by gmoney »
- distantvoices
- Member
Member - Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Floppy driver tutorial
Post by distantvoices »
Damn, this ain't no source code repository for each and every lazy lad who doesn't want to turn his grey matter around one more time to get a problem solved.
No Source Code Requests! we aren't here to *solve* your problems without you doing your homework -- excessively!
</moody>
I for one have managed to get a decent fdc driver up and running - with the aid of code slashers text. So I don't see why you souhlna be able to do so either.
Just tell: what are you doing? where does your code fail? what steps have you done to narrow the error down? what do you think, why it is failing? whay do you suppose to do for geting it fixed?
Then we might get in to a fairly neat talk, ok?
BlueillusionOS iso image
- Tora OS
Re:Floppy driver tutorial
Post by Tora OS »
- distantvoices
- Member
Member - Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:Floppy driver tutorial
Post by distantvoices »
What pisses me off is this "gimme source gimme source" attitude which is not appropriate at all. Homework is to be done by one himself.
BlueillusionOS iso image
- Kemp
Re:Floppy driver tutorial
Post by Kemp »
- Dex4u
Re:Floppy driver tutorial
Post by Dex4u »
The Intel floppy controller pdf is a great doc compeared to other devices doc.
In short people start OS coding before they know how to program, some people can get away with it and are quick learns, most can not and end up rip bits of code from here and there and wonder why thing do not work, in most case it is easier to write code from the start then try and make some one else's code work in your OS.
You should have at least one major coding project under your belt, before trying to make a OS.
- Vladaz`
Re:Floppy driver tutorial
Post by Vladaz` »
Thanks in advance.
- Pype.Clicker
- Member
Member - Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Floppy driver tutorial
Post by Pype.Clicker »
- Slasher
Re:Floppy driver tutorial
Post by Slasher »
http://bos.asmhackers.net/docs/floppy/d ... torial.txt
Once, I have my own site, I'll rewrite it and add more tutorials
- Vladaz
Re:Floppy driver tutorial
Post by Vladaz »
kreceive_message();
start_dma();
For now I only need those functions? Can someone help me?
kreceive_message(); suppose to wait until interrupt arrives from the controller. How could I do that?
- Dex4u