🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #993

Re: Writing Device Drivers

#993
From: "Kenneth A. Kahn"
Date: Fri, 11 Sep 1992 23:55
47 lines
1973 bytes
Organization: Staff of IBM Fellow - IBM Personal/370
Disclaimer: This posting represents the poster's views, not those of IBM
News-Software: UReply 3.0
X-X-From: KENKAHN@PKSMRVM.VNET.IBM.COM (Ken Kahn)
References: <msf.716240474@skaro>

In <msf.716240474@skaro> Michael Fulbright writes:
>I am working on a port of the SBBSD unix device driver for the Sound
>Blaster.  I have looked at several sample device drivers and I have
>almost all the info I need. I have 2 remaining questions:
>
>1) How do you parse the command line from CONFIG.SYS that invoked
>   your device driver?
>
>   Say CONFIG.SYS has    DEVICE=D:\A.SYS A B C D
>
>   How do I get the string 'A B C D'? Is it passed as part of the
>   initialization request packet?

The Request Packet for an INIT call contains a pointer to the invocation
arguments:

   +0   Header
   +13  (undefined)
   +14  DevHlp Entry Point
   +18  INIT Arguments
   +22  Drive Number (Block Device)

The INIT Argument string is everything after the DEVICE= statement.

Example:

   DEVICE=drive:\path\DD.SYS Parm1 Parm2=A
          !
          !
          INIT_Ptr

>
>2) The sample code I have is for pre-2.0 drivers. I understand from
>   'The Design of OS/2' that 2.0 drivers are still 16 bit, except for
>   the VDD part, which i'm not dealing with. Also, in 2.0 you do NOT
>   need to write bimodal code, since the DOS emulation is done in
>   protected mode. Do I have this right?
>

This is correct, though if you want this DD to run on a 1.x system, it doesn't
hurt to keep the Mode switching active.
Technical Details
Message-ID: <9209120024.AA20660@ucbvax.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!PKSMRVM.VNET.IBM.COM!KENKAHN

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!PKSMRVM.VNET.IBM.COM!KENKAHN
From: KENKAHN@PKSMRVM.VNET.IBM.COM ("Kenneth A. Kahn")
Newsgroups: comp.os.os2.programmer
Subject: Re: Writing Device Drivers
Message-ID: <9209120024.AA20660@ucbvax.Berkeley.EDU>
Date: 11 Sep 92 23:55:57 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 47