Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Personal System Sub-allocation Compatibility in a Paged Environment

IP.com Disclosure Number: IPCOM000107727D
Original Publication Date: 1992-Mar-01
Included in the Prior Art Database: 2005-Mar-22
Document File: 3 page(s) / 121K

Publishing Venue

IBM

Related People

Brew, GE: AUTHOR [+3]

Abstract

Described is a technique designed for personal systems, such as the 16-bit operating system/2 (OS/2*), to provide in 16-bit disk operating system sub-allocation (DosSub) compatibility in a paged environment. An existing OS/2 interface is used to serialize requests enabling new paging requests to be serialized.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Personal System Sub-allocation Compatibility in a Paged Environment

       Described is a technique designed for personal systems,
such as the 16-bit operating system/2 (OS/2*), to provide in 16-bit
disk operating system sub-allocation (DosSub) compatibility in a
paged environment.  An existing OS/2 interface is used to serialize
requests enabling new paging requests to be serialized.

      The 16-bit OS/2 memory sub-allocation application program
interface (API) provides intra-segment memory management services for
managing variable length objects within a private or shared memory
segment.  Sub-allocation services requests using a requestor supplied
selector to a segment allocated by the requestor.  Allocation uses a
first-fit algorithm, and neighboring free blocks are coalesced when
memory is returned.  A call is also provided for changing the size of
an allocated segment.  Allocation is rounded up to a multiple of four
bytes and there is a one-time eight-byte overhead from the allocated
segment for storage management.  Therefore, the storage available for
allocation from a segment of size N bytes is N-8 bytes. When a
segment is being used for sub-allocation, the structures for
maintaining the free list chain are in the segment itself, such that
they consume eight bytes from the register's segment.  Since shared
memory can be used with the sub-allocation services, requests to
allocate or free blocks in the sub-allocation pool are serialized
using disable interrupts (CLI) and enable interrupts (STI)
instructions to provide mutually exclusive access to the free list
among threads in different processes.

      Existing 16-bit DosSub routines execute in a ring 2
input/output privilege level (IOPL) segment so that they may use
CLI/STI instructions to serialize access to the memory pool free
list.  This code has been written to assume that it cannot be
interrupted while CLI is active.  In the 16-bit OS/2, this condition
is true, but in 32-bit OS/2 the paging is enabled and this condition
no longer holds true.  With paging enabled, a page fault can occur at
any time even when CLI is active. Therefore, there exists a
possibility that existing 16-bit applications that use DosSub with
shared memory may be broken, since the integrity of the DosSub free
list can be corrupted by a page fault occurring during a DosSub
CLI/STI section.  The faulting thread would be blocked waiting on a
page to come in from disk and another thread could make another
DosSub request on the same object, potentially corrupting the DosSub
free chain.  To overcome this problem, the concept described herein
provides 16-bit DosSub compatibility using 16- bit OS/2 RAM
semaphores in the DosSub package to serialize requests.

      First, three alternative solutions are considered and the
reasons why they were not adopted.  The three alternative solutions
are as follows:
     - Lock down DosSub and the su...