2014-06-04 19:44 GMT+04:00, Martin Decky <[email protected]>:
>> I wanted to make contiguous view of several physmem regions using
>> malloc to alloc virtual region of total length and then map physical
>> regions ontop of virtual one.
>
> You really lost me here. What do you want to achieve exactly?

Nothing already. I did want. When I was porting x86emu library vertion
from x.org, I didn't want to spend time to implement my own memory IO
functions and did want to rely on default ones. They use continuous
region. I did want to alloc 1MB usign malloc and then map IVT and BIOS
ontop of malloced region and give poiner to library.
Since I, after all, implemented my own functions and, moreover,
decided to stay at current x86emu library instead of x.org's one, this
subject doesn't make sense now.

>
> The libc malloc() uses virtual memory areas backed by anonymous physical
> memory as its backend. But the mapping of these virtual memory areas is
> not guaranteed to be continuous in physical memory.

I told "continuous view", meaning virtual addresses.
>
> If you allocate some memory using malloc(), why do you want to overlay
> some other physical memory on top of it then? Why not simply map that
> physical memory using physmem_map() or dmamem_map() in the first place,
> without wasting some additional memory using malloc()?
>
> If I can guess that your motivation is to have something like a custom
> memory allocator atop a physmem_map()-ed or dmamem_map()-ed virtual
> memory area, then you should really implement such a custom allocator
> from scratch.
>
>
> M.D.
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel
>

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to