home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12754 < prev    next >
Encoding:
Internet Message Format  |  1992-07-21  |  1.5 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!mips!darwin.sura.net!uvaarpa!murdoch!murdoch.acc.virginia.edu!heyes
  2. From: heyes@dadev.cebaf.gov (Graham Heyes)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Writing asynchronous SCSI driver.
  5. Message-ID: <HEYES.92Jul21092205@dadev.cebaf.gov>
  6. Date: 21 Jul 92 14:22:05 GMT
  7. Sender: usenet@murdoch.acc.Virginia.EDU
  8. Distribution: comp.sys.mac.programmer
  9. Organization: Continuous Electron Beam Accelerator Facility
  10. Lines: 26
  11.  
  12. I am writing a Hard disk driver in think C. It all seems to
  13. work and is certainly faster than Apples own driver. Rather
  14. than using the SCSI manager I have leapt in with manuals on
  15. the Mac hardware and access the ncr5380 SCSI controller 
  16. directly. Looking at my code I have a main loop where I wait
  17. for phase changes on the SCSI bus. On average I would expect
  18. a 13mS delay from the drive while the heads move over the 
  19. block that I'm looking for. What I am wondering is if I can 
  20. use that 13mS to do some usefull work. That is where my 
  21. knowledge of the Mac OS falls down. I am assuming Multifinder
  22. is giving me something like a multi-tasking environment with 
  23. the possibility of forced context switching from one task to 
  24. another.
  25.  
  26. 1) How do I switch context in but still be able to recheck 
  27.    the bus phase every 13mS?
  28.  
  29. 2) How do I make a "task" which wants to use the driver pend 
  30.    until the current transaction has completed?
  31.  
  32.  
  33.     This is probably doccumented somewhere but a code 
  34. example would be a great help.
  35.     Thanks
  36.             Graham Heyes
  37.     
  38.