Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12745 Discussions

How to port the mmap function?

Altera_Forum
Honored Contributor II
1,184 Views

One Unix implementation use the mmap function and /dev/zero to fulfill the virtual memory. 

 

How could I port such functionality onto Nios II? Must I include the OS? Can HAL solve the problem?
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
495 Views

Hi neo, 

 

> ... use the mmap function and /dev/zero to fulfill the virtual memory. 

> How could I port such functionality onto Nios II? 

 

I'm not sure what you're asking ... Nios-II does not have 

an MMU ... there's no virtual memory. Do you just want to 

clear memory? 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
495 Views

What are you planning to use your virtual memory for, and what will you use as the backing store for it? 

 

Neither the HAL nor any other OS I'm aware of supports virtual memory (or the mmap function) - as has been pointed out it will be hard for them to do so until we have an MMU. 

 

As I said in another post, it might be possible, without an MMU, to implement a subset of mmap for file access, but it will be less efficient than using read/write.
0 Kudos
Reply