On 21 April 2012 06:04, Stas Sergeev wrote:
> It is better to have open_mapping() to open /dev/mem,
> alloc_mapping_kmem() to map it somewhere, and mmap_mapping_kmem()
> to do the flip - that's what I did in my patchset. Why don't
> you like that approach?

Hmm, I don't see open_mapping changes in your patches. Maybe I missed
it. In any case, I think I found a simpler approach (attached) for
kmem, by first observing that alloc_mapping(MAPPING_KMEM...) was
always immediately followed by a call to mmap(). The only place where
they are not paired (just mmap_mapping there) is map_video_ram() in
vc.c.
So they can just be combined; and the call in map_video_ram() can
still do the right thing (skipping the actual mmap to /dev/mem, and
just doing mremap) by looking at kmem_map.

In the end that changes mmap_mapping for KMEM to do what it should do
conceptually, map an area of /dev/mem. What goes on behind the scenes
(the remapping) is just to avoid reopening /dev/mem because root was
dropped but the caller doesn't need to know these details.

Bart

Attachment: 0001-Fold-alloc_mapping-into-mmap_mapping-for-MAPPING_KME.patch
Description: Binary data

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Dosemu-devel mailing list
Dosemu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dosemu-devel

Reply via email to