Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : PCCAPP.ZIP
Filename : TWOLEVEL.H

 
Output of file : TWOLEVEL.H contained in archive : PCCAPP.ZIP
/*
* This file is part of the Choices Operating System
* Developed by: The TAPESTRY Parallel Computing Laboratory
* University of Illinois at Urbana-Champaign
* Department of Computer Science
* 1304 W. Springfield Ave.
* Urbana, IL 61801
*
* Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992
* The University of Illinois Board of Trustees.
* All Rights Reserved.
*
* Author: Vincent F. Russo ([email protected])
* Author: Bjorn A. Helgaas ([email protected])
* Contributing Author: Gary M. Johnston ([email protected])
* Project Manager and Principal Investigator: Roy Campbell ([email protected])
*
* Funded by: NSF TAPESTRY Grant No. 1-5-30035, NASA ICLASS Grant
* No. 1-5-25469 and No. NSG1471 and AT&T Metronet Grant No. 1-5-37411.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for educational, research, and non-profit purposes
* is hereby granted provided that the above copyright notice, the
* original authors names, and this permission notice appear in all such
* copies and supporting documentation; that no charge be made for such
* copies; and that the name of the University of Illinois not be used
* in advertising or publicity pertaining to distribution of the
* software without specific prior written permission. Any entity
* desiring permission to incorporate this software into commercial
* products should contact the Computing Research Laboratory, Department
* of Computer Science, University of Illinois, 1304 W. Springfield
* Avenue, Urbana, IL 61801. The University of Illinois makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/*
* TwoLevelPageTable.h: Generic two-level page tables
*
*/

#ifndef TwoLevelPageTable_h
#define TwoLevelPageTable_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif

#include "AccessType.h"
#include "AddressTranslation.h" /* parent class */
#include "Allocator.h"
#include "LOCK.h"
#include "PAGE_TABLE_ENTRY.h" /* #define PAGE_TABLE_ENTRY,
POINTER_TABLE_ENTRY */


class PhysicalMemoryChain; // forward reference...
class VirtualMemoryRange; // forward reference...

extern ClassStar TwoLevelPageTableClass;
class TwoLevelPageTable : public AddressTranslation {
friend void PhysicalMemorySetup();

protected:
static VirtualMemoryRange * kernelVirtualMemoryMap;
static Allocator * tableMemoryAllocator;

/*
* Table allocation routines. These simply call the
* tableMemoryAllocator and zero the memory returned.
*/
static POINTER_TABLE_ENTRY * allocatePointerTable();
static PAGE_TABLE_ENTRY * allocatePageTable();

static int pointerTableIndex( const char * address );
static int pageTableIndex( const char * address );

/*
* The instance data is a lock and a pointer to a first level
* page table which is allocated from the classes allocator.
*/
LOCK lock; // eventually refine this to be less coarse
// i.e. maybe keep a lock/pte in the ptes themselves.
POINTER_TABLE_ENTRY * thisPointerTable;

#ifdef MULTIRINGTRANSLATION
/*
* Extra top-level page tables to implement protection for the
* different rings. The 'thisPointerTable' contains all mappings
* and is used for ring level 1; each 'otherPointerTables[N]' is
* used for ring level N+2.
*/
POINTER_TABLE_ENTRY * otherPointerTables[ APPLICATIONRING - 1 ];
#endif
/*
* Also keep track of our ring number and a pointer to the
* parent translation for purposes of sharing memory ranges.
*/
unsigned char _ring;
TwoLevelPageTable * _parent;

/*
* setupPointerTable() is called by pointerTable() or addMapping() -
* whichever is the first to discover that we
* haven't yet allocated the first level page table for this
* translation.
*/
void setupPointerTable();

public:
/*
* Used by MMU to get value to load into page table base register.
* This used to be private, but then the MMU class has to be a
* friend, which led to a problem with incomplete base types.
* This way we don't even need to include MMU.h.
*/
#ifdef MULTIRINGTRANSLATION
POINTER_TABLE_ENTRY * pointerTable( unsigned char ring );
#else
POINTER_TABLE_ENTRY * pointerTable();
#endif

/*
* Used by AddressTranslator to see what happened when
* a page fault occurs.
*/
#ifdef MULTIRINGTRANSLATION
AddressTranslationFailureCode determineError( const char * address,
AccessType attemptedAccess, unsigned char ring );
#else
AddressTranslationFailureCode determineError( const char * address,
AccessType attemptedAccess );
#endif

static void init( unsigned int tableAreaSize,
VirtualMemoryRange * kernelVirtualMemoryMap );

Class * classOf();

TwoLevelPageTable( unsigned char ring, TwoLevelPageTable * parent );
~TwoLevelPageTable();

void addMapping( const char * vaddr, PhysicalMemoryChain * chain,
ProtectionLevel prot );
void basicRemoveMapping( const char * vaddr, unsigned int nbytes );
int basicChangeProtection( const char * vaddr,
unsigned int nbytes, ProtectionLevel protection );

const char * mapping( const char * vaddr );
};

#endif /* TwoLevelPageTable_h */
/*
* This file is part of the Choices Operating System
* Developed by: The TAPESTRY Parallel Computing Laboratory
* University of Illinois at Urbana-Champaign
* Department of Computer Science
* 1304 W. Springfield Ave.
* Urbana, IL 61801
*
* Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992
* The University of Illinois Board of Trustees.
* All Rights Reserved.
*
* Author: Systems Research Group ([email protected])
* Project Manager and Principal Investigator: Roy Campbell ([email protected])
*
* Funded by: NSF TAPESTRY Grant No. 1-5-30035, NASA ICLASS Grant
* No. 1-5-25469 and No. NSG1471 and AT&T Metronet Grant No. 1-5-37411.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for educational, research, and non-profit purposes
* is hereby granted provided that the above copyright notice, the
* original authors names, and this permission notice appear in all such
* copies and supporting documentation; that no charge be made for such
* copies; and that the name of the University of Illinois not be used
* in advertising or publicity pertaining to distribution of the
* software without specific prior written permission. Any entity
* desiring permission to incorporate this software into commercial
* products should contact the Computing Research Laboratory, Department
* of Computer Science, University of Illinois, 1304 W. Springfield
* Avenue, Urbana, IL 61801. The University of Illinois makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/* This file was generated by Proxify++ version 0.1 */

#ifndef TwoLevelPageTable_h
#define TwoLevelPageTable_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#include "AccessType.h"
#include "AddressTranslation.h"
#include "Allocator.h"
#include "LOCK.h"
#include "PAGE_TABLE_ENTRY.h"
class PhysicalMemoryChain;
class VirtualMemoryRange;
extern ClassStar TwoLevelPageTableClass;
class TwoLevelPageTable;
#endif TwoLevelPageTable_h


  3 Responses to “Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : PCCAPP.ZIP
Filename : TWOLEVEL.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/