2. RESOURCE MODEL ----------------- The VRM represents hardware capabilities as virtual resources provided to HyperCP/M kernel subsystems. Virtual resources are independent of the underlying hardware implementation. The VRM is responsible for creating, managing, and abstracting these resources so that kernel components can provide consistent execution environments to sessions and personalities. The primary virtual resource categories are: * CPU state. * Memory. * Devices. * Storage resources. Resources are assigned to sessions according to the requirements of the active personality and the capabilities of the underlying implementation. 2.1 Virtual CPU State ~~~~~~~~~~~~~~~~~~~~~ The VRM provides the CPU execution environment used by HyperCP/M sessions. A virtual CPU state includes: * Processor registers. * Program counter. * Stack pointer. * Processor flags. * Interrupt state. * Other processor-specific execution state. The VRM is responsible for preserving and restoring CPU state when execution control transitions between sessions. The underlying processor implementation shall not affect the virtual CPU model presented to a session. 2.2 Virtual Memory ~~~~~~~~~~~~~~~~~~ The VRM provides memory resources to sessions according to the requirements of the active personality. The virtual memory model shall be defined independently of the underlying physical memory implementation. A personality may require: * A conventional Z80 address space. * Banked memory. * Extended memory resources. * Other memory models defined through explicit interfaces. The VRM is responsible for mapping virtual memory resources to available physical memory. The VRM shall ensure that memory resources assigned to one session are isolated from other sessions except where explicitly defined sharing mechanisms exist. 2.3 Virtual Devices ~~~~~~~~~~~~~~~~~~~ The VRM provides abstract device resources to HyperCP/M kernel subsystems. Virtual devices represent hardware capabilities without exposing hardware-specific implementation details. Examples include: * Console devices. * Serial communication devices. * Timers. * Storage devices. * Other hardware interfaces required by supported personalities. Device behavior shall be defined through explicit interfaces. A personality shall not directly access physical hardware. 2.4 Virtual Storage ~~~~~~~~~~~~~~~~~~~ The VRM provides the hardware abstraction layer for storage resources used by HyperCP/M. Virtual storage resources represent storage devices independently of the underlying physical implementation. A virtual storage resource may be implemented using: * Physical disks. * Memory-backed storage. * Host-managed storage. * Other storage technologies. Storage mapping and access policies are defined by the HyperCP/M Storage Manager. 2.5 Resource Ownership and Isolation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The VRM maintains ownership boundaries for virtual resources assigned to sessions. Each session shall have defined ownership of its assigned CPU state, memory resources, and device resources. Resources may be shared between sessions only through explicitly defined kernel-managed mechanisms. The VRM shall prevent unintended access to resources belonging to another session.