TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Fitzsimmons
from: Mike Bilow
date: 1996-02-15 19:43:12
subject: pdpclib

Peter Fitzsimmons wrote in a message to Jason Meaden:

 PF> This is not correct,  at least with \os2\vdisk.sys,  which
 PF> always allocates non-swappable memory.

This is true, but VDISK.SYS was really intended as an example program
showing how to write a device driver.  I don't think IBM ever expected
anyone to actually use it.  The full source to VDISK.SYS is not only in the
DDK, as is the source to many other drivers, but it is the only source
reprinted in full in the Storage Device Driver Reference.

VDISK.SYS is really an awful device driver, written in assembly language
originally for OS/2 1.x and ported to OS/2 2.x by doing the bare minimum
possible.  As a result, the port just replaced DevHlp_AllocPhys() with
DevHlp_VMAlloc(), keeping the logic intact and assuming the use of
completely locked memory.

 PF> I released a modified version of vdisk (called swvdisk2.lzh)
 PF> which does use swapable memory,  and it works well as long
 PF> as you are using a recent fixpak. 

 PF> Albert Shan wrote a new virtual disk system from the ground
 PF> up,  which uses a different technique (you can actually
 PF> change the size of the disk at run time).  It is shareware. 
 PF> It is called something like "super virtual disk". 

There are some serious problems with allocating memory from inside a device
driver, even if you want it to be swappable.  In particular, the system
will stop you if you request more than 4 MB, unless you also set an
undocumented switch that explicitly notifies the kernel that it should
grant a particular request for more than 4 MB.

Since OS/2 (so far) always breaks up disk transfer operations into blocks
with a maximum size of 64 KB, system performance should not be affected by
writing a driver that accesses a large pool of memory, provided that no
more than 64 KB is locked present (swapped in) at a time.  Of course,
accesses to that memory could be slow if a lot of swapping must occur.
 
-- Mike


--- 
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 323/107 170/400 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.