Article View: comp.os.os2.programmer
Article #2258Re: Allocating a 64k chunk in a device driver...
From: Colin Goldstein
Date: Fri, 02 Oct 1992 22:53
Date: Fri, 02 Oct 1992 22:53
30 lines
1969 bytes
1969 bytes
In article <1992Sep29.070357.23292@CS.ORST.EDU> @prism.cs.orst.edu writes: >I need to allocate two 64k buffers in ram from a 16bit device driver. Each of >the buffers must be completely contained in a segment. They cannot cross a >segment boundary. Does anyone know of a way to do this? > Keith: How are these buffers to be used. If they are to be used in the device driver only, then the answer is simple. Here's how: Allocate a couple of GDT selectors - AllocGDTSelector (CX=1, DL=2DH) Allocate 64 Kb of memory - AllocPhys (DL=18H, DH=1) Assign the 64 Kb to the selector - PhysToGDTSelector (CX=65536, DL=2EH) This can be made smaller/faster by using CX=2 in AllocGDTSelector. These selectors can be used by the device driver only. If an app requires access to this memory, then further steps are needed. Also, the memory will not cross a boundry as the memory will be addressed as sel:0-65,536. Hope this helps, Colin -- /-------------------------------------------------------------------\ | The views expressed here are my own. | How's life treating you | | They do not necessarily represent | Norm??? | | the views expressed by my employer. | | | ---------------| Like a dog treats a | | colin@novell.com | Novell Inc., | fire hydrant. | | uunet!novell!colin | San Jose, CA | - Cheers | \-------------------------------------------------------------------/
Technical Details
Message-ID:
<1992Oct2.225359.12223@novell.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!crdgw1!newsun!colinReferences:
<1992Sep29.070357.23292@CS.ORST.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!crdgw1!newsun!colin From: colin@novell.com (Colin Goldstein) Newsgroups: comp.os.os2.programmer Subject: Re: Allocating a 64k chunk in a device driver... Message-ID: <1992Oct2.225359.12223@novell.com> Date: 2 Oct 92 22:53:59 GMT References: <1992Sep29.070357.23292@CS.ORST.EDU> Sender: news@novell.com (The Netnews Manager) Organization: Novell Inc., San Jose, Califonia Lines: 30 Nntp-Posting-Host: la.novell.com