Acorn MOS - Extension

Extension

The lower 16KiB of the read-only memory map (0x8000 to 0xBFFF) is reserved for the active Sideways paged bank. The Sideways system on the BBC Micro allows for one ROM at a time from sockets on the motherboard (or expansion boards) to be switched into the main memory map. Software can be run from ROM this way (leaving the RAM free of user program code, for more workspace) and the OS can be extended by way of such ROMs. The most prevalent sideways ROM after BASIC is the Acorn Disc Filing System used to provide floppy disc support to the machine.

During a reset, every paged ROM is switched in and asked how much public and private workspace it needs. Each ROM is allocated a chunk of private workspace that remains allocated at all times, and a single block of public workspace, equal to the size of the largest request, is made available to the active ROM. During operation, the paged area is rapidly switched between ROMs when file system commands are issued and unrecognised commands are put to the OS.

MOS allocates a 3½KiB block of memory (0x0000 to 0x0DFF) from the bottom of the memory map for operating system and language ROM workspace:

Address Usage
0x0000-0x00FF misc system variables
0x0100-0x01FF CPU stack
0x0200-0x03FF OS
0x0400-0x07FF allocated to the current language ROM, or to the Tube. BASIC uses 0x0400-0x046B for the single-letter integer variables @% through Z% (4 bytes per letter), which are therefore accessed more quickly than are variables on the heap.
0x0800-0x08FF sound system (stores ADSR envelopes and the tone buffer; if sound is not in use then a small amount of user data can be stored here)
0x0900-0x09FF cassette buffer (user data can be placed here if cassette is not in use, so many small machine code utilities were assembled into page 9)
0x0A00-0x0AFF buffers (keyboard, printer etc.)
0x0B00-0x0BFF user-defined keys (strings that are inserted when function keys are pressed, set by the *KEY command)
0x0C00-0x0CFF user-defined characters for non-teletext modes (user data can be placed here if the display is in teletext mode)
0x0D00-0x0DFF workspace for the currently paged-in ROM

On a cassette-only machine, 0x0E00 is the start of user program memory. With OS extension ROMs fitted such as the a filing system ROM, more memory is allocated above this point; DFS ROMs generally use another 2¾KiB to cache the disc catalogue and manage random access buffers. A network filing system ROM (for Econet) allocates another ½KiB on top of this. This is a serious problem because MOS does not support relocation of machine code, which must be run from the address at which it was assembled, so some programs which assumed a fixed start of user program memory could overwrite MOS workspace. The problem was alleviated in versions 3 to 5 by allowing ROMs to allocate workspace in an alternative RAM bank at 0xC000 to 0xDFFF which was present in Master series computers, though old ROMs could continue to allocate blocks of main memory.

The OS also maintains a vector table of all its calls which can be updated to hook any OS calls for user extension. By altering or 'hooking' these vectors, developers could substitute their own routines for those provided as defaults by the MOS.

Read more about this topic:  Acorn MOS

Famous quotes containing the word extension:

    The medium is the message. This is merely to say that the personal and social consequences of any medium—that is, of any extension of ourselves—result from the new scale that is introduced into our affairs by each extension of ourselves, or by any new technology.
    Marshall McLuhan (1911–1980)

    The desert is a natural extension of the inner silence of the body. If humanity’s language, technology, and buildings are an extension of its constructive faculties, the desert alone is an extension of its capacity for absence, the ideal schema of humanity’s disappearance.
    Jean Baudrillard (b. 1929)

    We are now a nation of people in daily contact with strangers. Thanks to mass transportation, school administrators and teachers often live many miles from the neighborhood schoolhouse. They are no longer in daily informal contact with parents, ministers, and other institution leaders . . . [and are] no longer a natural extension of parental authority.
    James P. Comer (20th century)