From: Nuno L. <nt...@nl...> - 2004-07-30 11:02:52
|
Henry Nestler, dando pulos de alegria, escreveu : > > The colinux-daemon allocate and hold the memory for mmap, for FB to. > Can the colinux-console-fb than connect and disconnect to this memory in > life running without crash of colinux-daemon? The question: Can it > connect, disconnect, connect and so to the same memory at every time? > If yes: It's the same address in all times of programstart? (Adress of > same contens) I'm not sure of this, but I believe the memory allocation is made by the windows kernel driver, not colinux-daemon (the process is started by colinux-daemon, but it's the driver that makes it in windows kernel mode). I don't know what memory is shared by the console, but yes it can connect and disconnect at will (note that this is not the same as multiple access - this needs sychronization). You have a wrong idea of the memory managemnent in windows and linux. Every [user-] process has a private address space, so to access the shared memory you would need first to map it in your process address space. This is acomplished by Win32 API functions like MapViewOfFile(), etc. > Can than I addres behind the limit of 4KB with a simple index > calculation? Or must I do some calculation with Page size of 4KB? > > Works this on shared memory in linux and Windows? > unsigned char *p, *BuffStart; > for (i=640*480; p=BuffStart; i--) > *p++ = 0; No, as stated above, You would need to get the address of the shared memory by calling some not yet done API, and then map it into your process address space. I'm not sure of how it works on Linux, but I believe it is the same basic idea. For a *VERY GOOD* guide on Windows Memory Management (from Mark Russinovich, of sysinternals) in user and kernel mode, please see: http://www.winntmag.com/Articles/Index.cfm?IssueID=56&ArticleID=3686 Regards, ~Nuno Lucas |