<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Zdenek<div><br></div><div>When you include a new exported function ("mmap") into an existing module ("Unix"), you have to recompile ALL upper modules using the modified module.</div><div>As "Unix" is a module used by quite some upper Oberon modules, you effectively would have to recompile the whole Oberon system.</div><div>So for the next time: better don't touch modules included in the Oberon system unless you know exactly what you're doing.</div><div><br></div><div>So, delete your newly generated Unix object file. If you accidentially overwrote "obj/Unix.Obj", you better reinstall Oberon.</div><div>Move the "mmap" declaration and initializing code into your program, something like:</div><div><br></div><div><blockquote type="cite"></blockquote>MODULE Test;<br><blockquote type="cite"></blockquote><font color="#0f61c8"><br></font><blockquote type="cite"></blockquote>IMPORT Unix;<br><br><blockquote type="cite"></blockquote>VAR<br> mmap- : PROCEDURE {C} (addr: ADDRESS; length: LONGINT; prot: LONGINT;</div><div> flags : LONGINT; fd: LONGINT; offset: LONGINT) : ADDRESS;<br><blockquote type="cite"></blockquote><br></div><div>PROCEDURE test*();<br><blockquote type="cite"></blockquote> VAR</div><div> a: ADDRESS;<br><blockquote type="cite"></blockquote> BEGIN<br><blockquote type="cite"></blockquote></div><div> Unix.Dlsym( Unix.libc, "mmap", ADDRESSOF( mmap ) );<br><blockquote type="cite"></blockquote> a := mmap( parameters as defined above ...);<br><blockquote type="cite"></blockquote> END test;<br><blockquote type="cite"></blockquote><br></div><div>END Test.test ~</div><div><br></div><div><blockquote type="cite"></blockquote>SystemTools.Free Test ~ <br><blockquote type="cite"></blockquote></div><div><br></div><div><br></div><div>Porting a driver code is not a piece of cake...</div><div><br></div><div>br</div><div>Jörg</div><div><br></div><div>Am 13.04.2013 um 08:02 schrieb Zdenek <<a href="mailto:oberon@moravcik.info">oberon@moravcik.info</a>>:</div><div><div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Jörg,<br><br>as you wrote module Unix already contains call to function ioctl() which<br>I first overlooked.<br>Trying to make my code running I had to insert another needed call for<br>linux function mmap() because this function is not define in module Unix<br>(i.e. in Linux.Unix.Mod)<br>So I inserted following code into Unix.Mod:<br><br>MODULE Unix;<br>...<br>VAR<br> mmap- : PROCEDURE {C} ( addr: ADDRESS; length: LONGINT;<br>prot: LONGINT; flags : LONGINT; fd: LONGINT; offset: LONGINT) : ADDRESS;<br>...<br>BEGIN (* Unix *)<br> Dlsym( libc, "mmap", ADDRESSOF( mmap ) );<br>...<br>END Unix.<br><br>Then I wrote following module:<br><br>MODULE Test;<br><br>IMPORT Unix;<br><br>PROCEDURE test();<br>VAR<br> a : ADDRESS;<br>BEGIN<br> a := Unix.mmap(parameters as defined above ...);<br>END test;<br>(* Test.test ~<br> SystemTools.Free Test ~ <br>*)<br>END Test.<br><br>It compiled fine but when I try to run Test.test it answers:<br><br>WMTextView: Command execution error, res 3405 (Test incompatible with<br>Unix / mmap)<br><br>Don't know what to do about it ?<br><br>Zdenek<br><br><br>--<br><a href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br></blockquote></div><br></div></body></html>