UPB-FILS-MA / upb-fils-ma.github.io

The website for Microprocessor Architecture
https://embedded-rust-101.wyliodrin.com/
Creative Commons Attribution Share Alike 4.0 International
15 stars 99 forks source link

Memory Management Units #110

Open jonathanpallant opened 5 months ago

jonathanpallant commented 5 months ago

I am very much enjoying reading through the slides for this course. They are well put together, and I do wish I could go back and be 19 years old and discover all this stuff over again.

On https://github.com/UPB-FILS-MA/upb-fils-ma.github.io/blob/main/slides/lectures/01/processor/slides.md, I wonder if it is useful to note the role of the Memory Management Unit (MMU), and the location of program code. A microcontroller typically operates on a flat address space, where virtual addresses correspond 1:1 with physical addresses (i.e. virtual address 0x2000_0000 is always physical address 0x0000_0000 within some internal SRAM block, whilst VA 0x1000_0000 might always be PA 0x0000_0000 within some internal NOR Flash block). The executable code for a microcontroller typically lives in a ROM, usually a Flash EEPROM, and that is usually internal to the SoC.

Conversely, a microprocessor typically uses an MMU to present multiple virtual views of the real world - allowing multiple concurrent programs to use the same virtual addresses but be mapped to different physical addresses. Code for a microprocessor also typically lives in RAM (which is usually external to the SoC because there is so much of it), and is loaded from some kind of block-based non-volatile storage (I'd say 'disk' but I guess actually it's almost always NAND Flash these days). Only the very first boot code will be in ROM - typically only enough to load the next stage from storage.

alexandruradovici commented 4 months ago

I added this to the course about memory protection, #276. Feedback is welcome.