Re: [Article] NuttX on Ox64 BL808 RISC-V SBC: Sv39 Memory Management Unit

2023-11-19 Thread Lee, Lup Yuen
Thanks Ken! Yep you read my mind, I'll write about NuttX Apps in the next
article:

(1) What's inside the simplest "Hello World" app
(2) How NuttX Apps call NuttX Kernel with "ecall"
(3) Bundling the NuttX Apps into the Initial RAM Disk (initrd) for Ox64
BL808 SBC. (We'll append the initrd to the NuttX Kernel for easier booting
with U-Boot. It's kinda messy right now for Star64 JH7110, as you have
discovered)

Stay tuned :-)

Lup

On Mon, Nov 20, 2023 at 2:47 AM  wrote:

> Lup,
>
> Another great article!
>
>
> One suggestion.
>
> In section 10 "Swap the SATP Register"
>
> You mention:
>
> "Huh? Our Applications can meddle with the I/O Memory?
>
> Nope they can’t, because the “U” User Permission is denied. Therefore
> we’re all safe and well protected!
> "
>
> I may have missed the reference, but this might be a place to introduce
> the idea that Kernel trampoline, eCalls, and so forth make use of kernel
> memory being mapped and available in all User address spaces so the
> Kernel's handling code does not have to immediately swap SATP to access
> its data structures.
>
> I know this is a large topic on its own, but am important trick to
> learn.
>
> Again, great article!  Thanks!!
> -KenD
>


Re: [Article] NuttX on Ox64 BL808 RISC-V SBC: Sv39 Memory Management Unit

2023-11-19 Thread ken . dickey

Lup,

Another great article!


One suggestion.

In section 10 "Swap the SATP Register"

You mention:

"Huh? Our Applications can meddle with the I/O Memory?

Nope they can’t, because the “U” User Permission is denied. Therefore 
we’re all safe and well protected!

"

I may have missed the reference, but this might be a place to introduce 
the idea that Kernel trampoline, eCalls, and so forth make use of kernel 
memory being mapped and available in all User address spaces so the 
Kernel's handling code does not have to immediately swap SATP to access 
its data structures.


I know this is a large topic on its own, but am important trick to 
learn.


Again, great article!  Thanks!!
-KenD


Re: [Article] NuttX on Ox64 BL808 RISC-V SBC: Sv39 Memory Management Unit

2023-11-18 Thread Tomek CEDRO
On Sun, Nov 19, 2023 at 12:42 AM Lee, Lup Yuen wrote:
> Memory Management Unit (MMU) is the hardware inside our Single-Board
> Computer (SBC) that implements Memory Protection and Virtual Memory.
> (..)
> Check out the article: https://lupyuen.codeberg.page/articles/mmu.html

Amazing read Lup.. as always! Thank You and Congratulations! :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


[Article] NuttX on Ox64 BL808 RISC-V SBC: Sv39 Memory Management Unit

2023-11-18 Thread Lee, Lup Yuen
Memory Management Unit (MMU) is the hardware inside our Single-Board
Computer (SBC) that implements Memory Protection and Virtual Memory.

Sv39 is the RISC-V MMU inside the Pine64 Ox64 SBC, based on Bouffalo Lab
BL808 SoC.

In this article, we boot NuttX on Ox64 SBC to find out how Sv39 MMU works
with:
(1) Memory Protection (for our Kernel)
(2) Virtual Memory (for the Applications)
As we record everything that happens when NuttX configures the Sv39 MMU.

Check out the article: https://lupyuen.codeberg.page/articles/mmu.html

Lup