Bank switching

from Wikipedia, the free encyclopedia

Bank switching and address memory switching (ASU) are synonymous terms for the expansion of the computer memory of a computer ( RAM or ROM ) beyond its natural addressing spaces by switching individual memory areas that are controlled by software but implemented in hardware . This technology is either an integral part of a microprocessor or is integrated independently of it into computer systems. To enable bank switching, either all or only part of the memory area is reserved. A correspondingly large area from another memory is shown in this reserved memory area (bank) .

Scheme of an address memory switchover with four memory areas

Bank switching technology is considered inelegant and a source of hard-to-find bugs . It is therefore only used if the computer architecture sets appropriate limits. With the increasing spread of 32- and 64-bit computer systems, there is no longer any need for bank switching, as these architectures usually provide sufficient addressing space for memory.

Bank switching in 8-bit systems

Bank switching was used in early 8-bit computer systems; B. the C64 , because it could only address 64 KiB memory , but many companies wanted to install 64 KiB or more RAM and also ROM and sometimes used memory mapped I / O , which both also took up address space. Game modules for video consoles (e.g. Atari 2600 ) also used this technology in order to increase the program memory beyond what was originally intended. In MSX computers with the Z80 processor, the memory was divided into four banks of 16 KiB and RAM or ROM displayed as required.

In another 8-bit system, which primarily required a lot of ROM space, it was implemented, for example, in such a way that the lower 32 KiB of the address space remained unchanged and, in addition to the complete RAM and the memory mapped I / O, especially the basic routines of the operating system (main loop, interface operation ) and the bank switching routines. The entire upper 32 KiB half of the address space was switchable, where one of up to eight different 32 KiB ROM banks could be displayed. The only problem arose when a program part from this upper half of the address wanted to call a subroutine from another bank in the upper half. In this case there were special support routines in the fixed lower half that helped organize this operation.

Bank switching on the IBM PC

The problem later continued on the IBM PC . All IBM-compatible PCs are in real mode , the normal operating mode under MS-DOS and the only RAM possible on older PCs that can in principle be limited to a maximum of 640 KiB of directly usable RAM - the so-called conventional memory . Therefore, in 1988 the Expanded Memory System (EMS ) was specified by the companies Lotus , Intel and Microsoft ("LIM"). RAM plug-in cards that were built according to this LIM-EMS standard could then be used by programs to expand the memory of the PC in 64 KiB banks. These banks could be "shown" individually in the address space by a program.

In Super VGA graphics cards bankswitching also had to be used because the PC architecture (Address A0000 only an address range of 64 KiB hex to AFFFF hex ) had provided for the graphics memory, addressed via the by special addressing modes up to 256 KiB of graphics memory could be. These special addressing modes were introduced with the EGA standard and enabled a maximum graphic resolution of 800 × 600 in 16 colors. For higher resolutions or color depths - depending on the graphics card chipset - there were different methods of showing different parts of the graphics memory in the 64 KiB address window. The VESA BIOS Extension (VBE) Version 2.0 introduced a standardized API for bank switching of the graphics memory. With VBE version 3, functions were added to enable linear access to the graphics memory in 32-bit protected mode , so that bank switching was no longer necessary.

Later, with the Address Windowing Extension from Microsoft, an interface was created in the Windows API with which 32-bit programs could access physical memory beyond the 4 GiB limit .

Individual evidence

  1. VESA BIOS Extension (VBE) Core Functions - Version: 2.0 .
  2. VESA BIOS Extension (VBE) Core Functions Standard - Version: 3.0 . 1998 (PDF; 272 kB).