MMU operation and ST Startup & running where does code live?

News,announcements,programming,fixes,game patches & discussions.

Moderator: troed

Post Reply
microman
Posts: 29
Joined: Fri Jan 28, 2022 3:55 pm

MMU operation and ST Startup & running where does code live?

Post by microman »

The ST would appear to have 2 places it can execute code from: a) in ROM & b) in RAM.

It is clear that the first few cold start instructions must execute from ROM and any code on disk must be loaded into RAM for execution.

After initial startup what happens to the ROM is the code copied into faster RAM for normal execution or is it executed directly from the slower ROM?

Where do I find documentation on kernel mode execution and MMU functions?

Does the MMU remap any physical block(s) into anywhere in the CPUs address space?
How do I set mapping and set protection on regions of memory?

Thanks

Peter
User avatar
sporniket
Posts: 956
Joined: Sat Sep 26, 2020 9:12 pm
Location: France
Contact:

Re: MMU operation and ST Startup & running where does code live?

Post by sporniket »

given that only TT and Falcon have a processor with builtin MMU, I guess you are looking for TOS v3 and more, not ST.
User avatar
Icky
Site Admin
Site Admin
Posts: 3986
Joined: Sun Sep 03, 2017 10:57 am
Location: UK

Re: MMU operation and ST Startup & running where does code live?

Post by Icky »

EDIT: This image flow may help with how the ST starts up

System_Startup.jpg
System_Startup.jpg (448.19 KiB) Viewed 3433 times
User avatar
exxos
Site Admin
Site Admin
Posts: 23499
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: MMU operation and ST Startup & running where does code live?

Post by exxos »

ROM is not copied to RAM unless a program specifically copies ROM to alt-ram for faster execution for example. Code still executes from ROM otherwise.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
rubber_jonnie
Site Admin
Site Admin
Posts: 10472
Joined: Thu Aug 17, 2017 7:40 pm
Location: Essex
Contact:

Re: MMU operation and ST Startup & running where does code live?

Post by rubber_jonnie »

Normal operation is for OS code to be executed from the ROM. Unless of course a cartridge (Such as a diag cart) is detected, in which case the ROMs on the cart will run instead. Still from the ROM though and not RAM IIRC.

The only exceptions I'm aware of are the original STs that came with OS on floppy disk or if I understand it correctly (And I may have this wrong) when you use a patcher to load an alternate version of TOS from floppy.

Since you are probably not doing either of the above then take it as running from ROM.
Collector of many retro things!
800XL and 65XE both with Ultimate1MB,VBXL/XE & PokeyMax, SIDE3, SDrive Max, 2x 1010 cassette, 2x 1050 one with Happy mod, 3x 2600 Jr, 7800 and Lynx II
Approx 20 STs, including a 520 STM, 520 STFMs, 3x Mega ST, MSTE & 2x 32 Mhz boosted STEs
Plus the rest, totalling around 50 machines including a QL, 3x BBC Model B, Electron, Spectrums, ZX81 etc...
User avatar
DoG
Posts: 1125
Joined: Sat Apr 07, 2018 12:26 pm

Re: MMU operation and ST Startup & running where does code live?

Post by DoG »

Icky wrote: Fri Feb 11, 2022 3:21 pm This thread may help with how the ST starts up
"You are not authorised to read this forum."
User avatar
Icky
Site Admin
Site Admin
Posts: 3986
Joined: Sun Sep 03, 2017 10:57 am
Location: UK

Re: MMU operation and ST Startup & running where does code live?

Post by Icky »

DoG wrote: Fri Feb 11, 2022 4:36 pm "You are not authorised to read this forum."
@DoG - My bad, edited my original post.
User avatar
Smonson
Posts: 708
Joined: Sat Oct 28, 2017 10:21 am
Location: Canberra, Australia
Contact:

Re: MMU operation and ST Startup & running where does code live?

Post by Smonson »

Is running code from ROM actually any slower than RAM on a stock ST?
User avatar
Badwolf
Posts: 2231
Joined: Tue Nov 19, 2019 12:09 pm

Re: MMU operation and ST Startup & running where does code live?

Post by Badwolf »

Smonson wrote: Wed Feb 16, 2022 2:16 am Is running code from ROM actually any slower than RAM on a stock ST?
I don't believe so, no.

BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
DSTB1 Open source 16Mhz 68k and AltRAM accelerator for the ST
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
User avatar
thorsten.otto
Posts: 148
Joined: Mon Nov 04, 2019 2:20 am

Re: MMU operation and ST Startup & running where does code live?

Post by thorsten.otto »

microman wrote: Fri Feb 11, 2022 2:21 pm Does the MMU remap any physical block(s) into anywhere in the CPUs address space?
How do I set mapping and set protection on regions of memory?
Question about ROM have already been answered above i think. Regarding MMU: as normally only TT and Falcon can have one, TOS 1.x and 2.x don't do anything with it. Even in TOS 3.x and above, only the TTR registers are setup to map the $FF0000 range to $FFFF0000 so you can access I/O at both addresses. Only a minimal MMU translation table is setup. There are however some programs that make use of it: MiNT (when using Memory-Protection), MAPROM (copies ROM to RAM, and optionally protects it to be readonly), and several Virtual Memory Managers like Outside and Vram.

Explaining how to set up the mapping is beyond the scope here ;) Basically, everything is explained in the processor manuals. It is rather complicated, though. You could have a look at mint sources, most of it is in https://github.com/freemint/freemint/bl ... mprot030.c
Post Reply

Return to “SOFTWARE PROGRAMMING & DISCUSSION”