home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / os2 / programm / 4382 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  3.3 KB

  1. Xref: sparky comp.os.os2.programmer:4382 comp.os.os2.apps:5466
  2. Path: sparky!uunet!decwrl!waikato.ac.nz!hamish
  3. From: hamish@waikato.ac.nz
  4. Newsgroups: comp.os.os2.programmer,comp.os.os2.apps
  5. Subject: Re: Writing Device Drivers for OS/2 2.0
  6. Message-ID: <1992Aug22.225508.10297@waikato.ac.nz>
  7. Date: 22 Aug 92 22:55:08 +1200
  8. References: <1992Aug21.151852.8673@natinst.com>
  9. Organization: University of Waikato, Hamilton, New Zealand
  10. Lines: 53
  11.  
  12. In article <1992Aug21.151852.8673@natinst.com>, ramdas@natinst.com (Malathi Ramdas) writes:
  13. >     I am in the process of writing an instrument control character based devcie
  14. > driver for OS/2 2.0. The device driver architecture under OS/2 2.0 is still
  15.  
  16. Keep muttering to yourself. Device Drivers are Fun! You'll need it :)
  17.  
  18. > 16-bit. Does that mean that I need to generate 16-bit device driver code. (ie:
  19. > generate code using a 16-bit compiler and 16-bit linker). Also, what would
  20.  
  21. Yes. BUT!! Only the interface to the device driver is 16-bit. You can have 32
  22. bit code in the driver if you wish. (I do).
  23.  
  24. > be the address format of the data address in an IOCTL request packet passed by
  25. > the kernel on behalf of an application making a DosDevIOCtl API call to my
  26. > device driver? Would it be in a 16:16 (selector:offset) form or a 0:32 
  27. > address form (flat address)? Would it depend on whether the application is 
  28.  
  29. When the strategy routine of the diver gets called the request is pointed to by
  30. the ES:SI registers. (Or is that ES:[BX]? My PC is at work, and I'm at home). 
  31.  
  32. > 16-bit or 32-bit? From what I read all 16-bit processes  get tiled
  33. > into a flat virtual address space. I hope to hear that all virtual addresses
  34. > that gets passed to my driver is in a 0:32 bit form.
  35. >    Is there a 32-bit assembler that goes out with OS/2 2.0. I still have the
  36. > masm assembler that is 16-bit. I have not received anything along with toolkit
  37. >
  38.  
  39. 5.1 will generate 386 32-bit instructions. 6.0 will do it properly so I hear.
  40. (I have one on order). The best way to learn is to grab the hrtimer.zip archive
  41. fromhobbes in os2/all/programming, it has a device driver for a hi-res timer in
  42. it. I used that to write an ndis and odi protocol stack device drivers. It has
  43. one bug though, quite serious. When initialising it gets the size of the data
  44. segment wrong. It just so happens to work thopugh, unless you add a lot of
  45. data, then it dies as the data you want to use gets thrown away at init time.
  46.  
  47. Also grab the OS/2 tech library. The device drivber reference is invaluable
  48. here. Oh and one thing. This got me a good one. Device Drivers are linked as
  49. DLL's, not Device Drivers. Strange huh?
  50.  
  51. -- 
  52. ==============================================================================
  53. |  Hamish Marson   <h.marson@waikato.ac.nz>                             OS/2 |
  54. |  Programmer (n/5), School of Computing and Mathematical Sciences           | 
  55. |  University of Waikato,                                                    |
  56. |  Hamilton, New Zealand.                                                    |
  57. |Disclaimer:  Anything said in this message is the personal opinion of the   |
  58. |             finger hitting the keyboard & doesn't represent my employers   |
  59. |             opinion in any way. (ie we probably don't agree)               |
  60. ==============================================================================
  61.   Q. If Nuclear Tests are so safe, why don't the French do them under Paris?
  62.