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:
“Predatory capitalism created a complex industrial system and an advanced technology; it permitted a considerable extension of democratic practice and fostered certain liberal values, but within limits that are now being pressed and must be overcome. It is not a fit system for the mid- twentieth century.”
—Noam Chomsky (b. 1928)
“The motive of science was the extension of man, on all sides, into Nature, till his hands should touch the stars, his eyes see through the earth, his ears understand the language of beast and bird, and the sense of the wind; and, through his sympathy, heaven and earth should talk with him. But that is not our science.”
—Ralph Waldo Emerson (18031882)
“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)