Alive
News Team Current issue History Online Support Download Forum @Pouet

01 - 02 - SE - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14

Alive 6
[ Back to main ]

2.  Two kinds of RAM in the TT
    ==========================

    The TT sports two kinds of RAM - So called "dual purpose RAM",
    commonly known as ST-RAM, and "single purpose RAM", also known as
    TT-RAM. The ST-RAM is, as seen by the programmer, identical to the
    RAM in the ST and is being shared by CPU and all the custom-chips.
    It appears in the RAM-space of the 68030 at adress

      $00000008 to $009FFFFF

    The most significant difference to the RAM in the ST is the way it
    is internally organised since it allows the TT-Shifter to access
    64 bits at once. This, however, is of no concern for the
    programmer.
    The ST-RAM is, in theory, expandable from $00A00000 to $00DFFFFF.

    The other kind of RAM maps the remaining adress space of the
    MC68030. It (commonly) supports burst-mode access for lightning
    fast fills of the 68030-cache and cannot be accessed by any other
    device of the TT. Hence, it only supports 32-bit wide accesses,
    which is however sufficient for the CPU.


  For the programmer:
  ===================
    For sensible support of multitasking or advanced systems, a
    program should always "start" with an MSHRINK GEMDOS-command to
    "free" the RAM that the program does not require. TOS memory
    management is somewhat simple, so each program is being given the
    whole free RAM of the computer and it is being relied on that the
    program returns the unused RAM.
    If the program requires additional RAM, this should be done via
    either a MALLOC, or better yet, an MXALLOC GEMDOS-command.
    Please refer to the GEMDOS documentation for the usage of MSHRINK
    to reduce the memory usage of your program.

    The important difference between MALLOC and MXALLOC is that MALLOC
    will always allocate the RAM-type specified in the file-flags.
    However, if file-flags are set to allocate TT-RAM via MALLOC and
    this certain program uses MALLOC to request screen memory, the
    program will not work since screen memory has to be in ST-RAM.
    MXALLOC allows to specify which RAM to allocate within the command
    itself. The usage is as follows:
      move.w   mode,-(sp)   ;which RAM to allocate
      move.l   amount,-(sp)   ;number of byte to allocate
      move.w   #$44,-(sp)   ;GEMDOS function number
      trap #1         ;execute GEMDOS
      addq.l #8,sp      ;clean up stack

    amount contains the number of bytes to request, mode allows the
    following settings:
      mode = 0   allocate ST-RAM only, error if not enough ST-RAM free
      mode = 1   allocate TT-RAM only, error if not enough TT-RAM free
      mode = 2  allocate what is free, preference on ST-RAM
      mode = 3   allocate what is free, preference on TT-RAM
    Using MXALLOC allows the programmer to both allocate ST- and
    TT-RAM specifically for all purposes.
    Please note that ALL memory-areas that customchips need to access,
    like video memory (Shifter), sampled sound data (DMA-sound chip),
    I/O-buffers (DMA in general) need to be in ST-RAM.

    It is unwise to use MALLOC and restrict the program to use ST-RAM
    via the fileflags, even if the program is prefered to run on an ST
    and only meant to be TT-compatible. TT-RAM is lightning fast in
    comparison to ST-RAM and will result in a tremendous speedup in
    all CPU-intense tasks.

  Compatibilities and incompatibilities
  =====================================
  => In comparison to the Atari ST and Atari STE:
     This computer series does not feature TT-RAM in general. There
     are some expansions that have TT-RAM, but the number is too small
     to list them in detail here. An MXALLOC-call that requires TT-RAM
     will fail to work on these machines, but an MXALLOC-call that
     just prefers TT-RAM will allocate ST-RAM (if free).

  => In comparison to the Atari Falcon030:
     The Falcon030 also has, in general, no TT-RAM. Certain
     accelerator cards (FX card, Centurbo 2, etc.) do have TT-RAM
     though, some even allow burst-mode access, just like the TT does.
     In these cases, it's also sensible to write TT-RAM compatible
     software by using MXALLOC that prefers but does not require
     TT-RAM.

  => What to look for when writing ST-Programs:
     Already dealt with in the chapter "for the programmer".

[ Back to main ]
[ Onto Next Chapter]

Alive 6