home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / os2 / programm / 4900 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  1.9 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!PKSMRVM.VNET.IBM.COM!KENKAHN
  2. From: KENKAHN@PKSMRVM.VNET.IBM.COM ("Kenneth A. Kahn")
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: Writing Device Drivers
  5. Message-ID: <9209120024.AA20660@ucbvax.Berkeley.EDU>
  6. Date: 11 Sep 92 23:55:57 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 47
  9.  
  10. Organization: Staff of IBM Fellow - IBM Personal/370
  11. Disclaimer: This posting represents the poster's views, not those of IBM
  12. News-Software: UReply 3.0
  13. X-X-From: KENKAHN@PKSMRVM.VNET.IBM.COM (Ken Kahn)
  14. References: <msf.716240474@skaro>
  15.  
  16. In <msf.716240474@skaro> Michael Fulbright writes:
  17. >I am working on a port of the SBBSD unix device driver for the Sound
  18. >Blaster.  I have looked at several sample device drivers and I have
  19. >almost all the info I need. I have 2 remaining questions:
  20. >
  21. >1) How do you parse the command line from CONFIG.SYS that invoked
  22. >   your device driver?
  23. >
  24. >   Say CONFIG.SYS has    DEVICE=D:\A.SYS A B C D
  25. >
  26. >   How do I get the string 'A B C D'? Is it passed as part of the
  27. >   initialization request packet?
  28.  
  29. The Request Packet for an INIT call contains a pointer to the invocation
  30. arguments:
  31.  
  32.    +0   Header
  33.    +13  (undefined)
  34.    +14  DevHlp Entry Point
  35.    +18  INIT Arguments
  36.    +22  Drive Number (Block Device)
  37.  
  38. The INIT Argument string is everything after the DEVICE= statement.
  39.  
  40. Example:
  41.  
  42.    DEVICE=drive:\path\DD.SYS Parm1 Parm2=A
  43.           !
  44.           !
  45.           INIT_Ptr
  46.  
  47. >
  48. >2) The sample code I have is for pre-2.0 drivers. I understand from
  49. >   'The Design of OS/2' that 2.0 drivers are still 16 bit, except for
  50. >   the VDD part, which i'm not dealing with. Also, in 2.0 you do NOT
  51. >   need to write bimodal code, since the DOS emulation is done in
  52. >   protected mode. Do I have this right?
  53. >
  54.  
  55. This is correct, though if you want this DD to run on a 1.x system, it doesn't
  56. hurt to keep the Mode switching active.
  57.