PDDREF:Running OS/2 Version 1.3 16-Bit PDDs on OS/2

From EDM2
Jump to: navigation, search
Physical Device Driver Reference
  1. Introduction
  2. Physical Device Driver Overview
  3. Physical Device Driver Architecture and Structure
  4. OS/2 Physical Device Driver Operations
  5. OS/2 Physical Device Driver Design Issues
  6. Character Device Monitors
  7. Installation of External Loadable Device Drivers
  8. Physical Device Driver Strategy Commands
  9. Device Helper (DevHlp) Services
  10. Resource Management
  11. Linking Resource Manager Services
  12. Generic IOCtl Commands
Appendixes
OS/2 Version Compatibility Considerations
Running OS/2 Version 1.3 16-Bit PDDs on OS/2
Using Advanced Bios
Notices
Glossary

The following items are possible problems that can occur when OS/2 Version 1.3 16-bit physical device drivers are run on OS/2 2.1 or later.

Use of Physical Addresses - PhysToUVirt

Physical device drivers that use DevHlp_PhysToUVirt will notice changes in these areas:

  • Returned offset (in BX) can no longer equal 0.
  • The OS/2 I/O Subsystems and Device Support Device Drivers (erroneously) stated that the result found in BX, on return from the call to PhysToUVirt, would always be 0.
  • In OS/2 2.1, BX is not always equal to 0 on return from PhysToUVirt.
  • Mapped areas that are greater than 60KB might not be fully mapped if their beginning offset is greater than 0. For example, a 64KB object that begins at n bytes offset from a 4KB page boundary results in a segment/descriptor that has a length of 64KB-n.

Direct Call to Physical Device Drivers

Physical device drivers that set up their own GDT call gate will not work in OS/2 2.1. The solution is to use the DevHlp_DynamicAPI in order to have the system generate a GDT call gate into the physical device driver.

Direct Writing of GDT Selectors

Physical device drivers that set up GDT descriptors for private use will not work in OS/2 2.1. The solution is to use one of three Device Helper services - PhysToGDTSelector, PhysToUVirt or PhysToVirt. The decision about which service to use must be based on the context in which the memory is to be accessed.

Physical Device Drivers that Need Real Mode

Physical device drivers that need to switch to real mode will fail. OS/2 defines virtual device drivers that coordinate the access that DOS session have to physical devices. Refer to the Virtual Device Driver Reference for further information.

Physical Device Drivers Support of DOS Applications

OS/2 physical device drivers, that were written to support a single DOS application, can fail in OS/2 if they start supporting several DOS applications at the same time. This concerns physical device drivers that maintain addresses of items within a DOS program. Because OS/2 2.1 supports the running of multiple DOS sessions, an address within a DOS program might not always refer to the same DOS session.

If a physical device driver supports multiple DOS applications and needs to maintain data relative to each, the device driver must be modified to the VDD/PDD model.