Page 1 of 1
MMU operation and ST Startup & running where does code live?
Posted: 11 Feb 2022 14:21
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
Re: MMU operation and ST Startup & running where does code live?
Posted: 11 Feb 2022 15:05
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.
Re: MMU operation and ST Startup & running where does code live?
Posted: 11 Feb 2022 15:21
by Icky
EDIT: This image flow may help with how the ST starts up
System_Startup.jpg
Re: MMU operation and ST Startup & running where does code live?
Posted: 11 Feb 2022 15:31
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.
Re: MMU operation and ST Startup & running where does code live?
Posted: 11 Feb 2022 15:44
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.
Re: MMU operation and ST Startup & running where does code live?
Posted: 11 Feb 2022 16:36
by DoG
Icky wrote: 11 Feb 2022 15:21
This thread may help with how the ST starts up
"You are not authorised to read this forum."
Re: MMU operation and ST Startup & running where does code live?
Posted: 11 Feb 2022 17:27
by Icky
DoG wrote: 11 Feb 2022 16:36
"You are not authorised to read this forum."
@DoG - My bad, edited my original post.
Re: MMU operation and ST Startup & running where does code live?
Posted: 16 Feb 2022 02:16
by Smonson
Is running code from ROM actually any slower than RAM on a stock ST?
Re: MMU operation and ST Startup & running where does code live?
Posted: 16 Feb 2022 16:47
by Badwolf
Smonson wrote: 16 Feb 2022 02:16
Is running code from ROM actually any slower than RAM on a stock ST?
I don't believe so, no.
BW
Re: MMU operation and ST Startup & running where does code live?
Posted: 16 Feb 2022 17:12
by thorsten.otto
microman wrote: 11 Feb 2022 14:21
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