Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!rutgers!cbmvax!andy
From: andy@cbmvax.UUCP (Andy Finkel)
Newsgroups: comp.sys.amiga
Subject: Re: What opens dos.library, and why doe
Message-ID: <2130@cbmvax.UUCP>
Date: Fri, 17-Jul-87 09:37:58 EDT
Article-I.D.: cbmvax.2130
Posted: Fri Jul 17 09:37:58 1987
Date-Received: Wed, 22-Jul-87 02:24:05 EDT
References: <0274526P@NAVPGS> <172200078@uxc.cso.uiuc.edu>
Reply-To: andy@cbmvax.UUCP (Andy Finkel)
Organization: Commodore Technology, West Chester, PA
Lines: 55

In article <172200078@uxc.cso.uiuc.edu> hamilton@uxc.cso.uiuc.edu writes:
>
>scott norton says:
>> Hacking one evening with the AmigaMonitor, I noticed that the
>> dos.library had an Open count over 10, where other libraries had
>> 2 at most Opens.  After calling up a few programs I noticed that
>> this open count was never decremented.  What is going on? ...

Some of the standard 'exit' routines don't close the dos.library.
So, it a program is compiled with one of those, and you use the
program, your count will tend to increment.
> 
>    dos.library is "special".  it doesn't follow all the conventions
>other libraries are expected to honor.  in particular, it doesn't
>decrement its lib_OpenCnt upon close (the WB1.1 version, anyhow).

Actually, it does decrement its use count on a Close.

>
>> 1.  What really opens the dos.library?  The loader, or is there
>> an some OpenLibrary() incorporated in the programs' startup code?

Most of the startup code opens the dos.library for you.  (Which was
a good thing, as many of our early examples used DosBase rather than
DOSBase as the global).  

>> 4.  Does it really matter?  Since the dos.library is almost as
>> fundimental as the exec.library, I don't expect it will drop to
>> an OpenCount of 0 and be unloaded.  I assume it is a resident
>> library and part of the Kickstart memory.

The current DOS library won't let itself get expunged in any case.
(Even if it was in RAM rather that in Kickstart RAM)

>> The only drawback I
>> can see of not closing this library is that it is not possible to
>> move or replace a library as long as it is open.  So, I can't
>> replace the dos.library with one of my own without altering the
>> kickstart disk or some non-dos code that executes right at
>> startup.

Exec has the means to replace any of the libraries entirely,
through the (underdocumented in a major way) RomTag facility.
The replacement library can sit in RAM.

			andy
-- 
andy finkel		{ihnp4|seismo|allegra}!cbmvax!andy 
Commodore-Amiga, Inc.

"The goal of Computer Science is to build something that will last at
least until we've finished building it."

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.