Before I get onto my next question, I would like to thank you Stefan and Norman for all the help you have given me. I hope i haven't been annoying you with all of these questions.
the best way to go for mapping a predefined physical memory area into a Genode process is using core's IO_MEM service because, logically, this memory can be seen as device memory. When opening an IO_MEM session (see 'base/include/io_mem_session/connection.h'), you can specify the physical base address and the size of the physical memory resource. You can then request a dataspace capability from this session and use it for attaching the memory to the local address space (via 'env()->rm_session()->attach()'). For an example of using the IO_MEM service, please have a look at the GTA01 platform driver, which relies on this procedure to access platform registers:
os/src/drivers/platform/gta01/main.cc
Please make sure that your trace buffer is outside the normal RAM configured in the elfweaver config file because core will refuse to hand out memory as IO_MEM when this memory is reported as normal RAM. To see the physical memory considered as normal RAM, you can enable the 'verbose_boot_info' flag in 'base-okl4/src/core/platform.cc'.
In trying to map the buffer that has been allocated in the kernel, I keep getting a page fault, which would suggest that the kernel memory has not been mapped. This sampling buffer always gets allocated at physical address 4456448, while the size of the buffer is 262144. I figured i'd try following the code in that file mentioned above. The code currently have is the following:
enum{SAMP_PHYS = 0x440000, SAMP_SIZE = 0x40000}; Io_mem_connection sampbuffer(SAMP_PHYS, SAMP_SIZE); samples = (sampling_buffer_t*)env()->rm_session()->attach(sampbuffer.dataspace());
where samples is of type sampling_buffer_t*. If you have the iguana source that came with OKL4 v2, this type is the same type as the trace_buffer_t. I strongly suspect this code is not correct for mapping the kernel memory to user space. How can i go about mapping this memory so that I can read the contents of this memory so as to perform processing?
Thanks Peter