floppy driver

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
Adek336

floppy driver

Post by Adek336 »

When I get my floppy driver up and working, perhaps it could be given a syscall function. But when a PL3 task wants to get data from the drive, where should it be stored? Should the task send a segm:offs pair, or should it just give the offset relative to the task's DS?

I would not like to read the floppy into my scheduler.

Adrian

PS Memory management makes me sick
Anton

RE:floppy driver

Post by Anton »

You should make a call gate: it will change code level it the one you need like PL1, when it returns it changes the code level back.

Anton
Code Slasher

RE:floppy driver

Post by Code Slasher »

Your driver should get the address for where the user wants to store the data from the system call
eg
read(buffer,size,file handle);

the floppy controller uses DMA to transfer data via channel 2. But the DMA chip can only handle address in the 0 - 16MB range! so there are two options
1. the driver reads the sectors/file into a buffer and then copies the relevent info to the user buffer supplied
2. Alllocates tasks fixed buffer for file i/o in the 16mb memory area

option 1 seems more efficient! of course there are others but these are the only ones i can think of right now.
Post Reply