[Oberon] call ioctl() function in linux from AOS

Jörg Straube joerg.straube at iaeth.ch
Sat Apr 13 09:31:02 CEST 2013


Zdenek

Generally, there are two approaches to get a driver running under LinuxOberon.
1) your approach: try to port the code.
2) Necati's approach: write an Oberon wrapper module that calls procedures of an existing Linux library.

As Necati did the job already, it might be more efficient to contact him and get his code.

br
Jörg

Am 13.04.2013 um 08:02 schrieb Zdenek <oberon at moravcik.info>:

> Hi Jörg,
> 
> as you wrote module Unix already contains call to function ioctl() which
> I first overlooked.
> Trying to make my code running I had to insert another needed call for
> linux function mmap() because this function is not define in module Unix
> (i.e. in Linux.Unix.Mod)
> So I inserted following code into Unix.Mod:
> 
> MODULE Unix;
> ...
> VAR
> mmap-              : PROCEDURE {C} ( addr: ADDRESS; length: LONGINT;
> prot: LONGINT; flags : LONGINT; fd: LONGINT; offset: LONGINT) : ADDRESS;
> ...
> BEGIN (* Unix *)
> Dlsym( libc, "mmap",    ADDRESSOF( mmap ) );
> ...
> END Unix.
> 
> Then I wrote following module:
> 
> MODULE Test;
> 
> IMPORT Unix;
> 
> PROCEDURE test();
> VAR
> a : ADDRESS;
> BEGIN
> a := Unix.mmap(parameters as defined above ...);
> END test;
> (*  Test.test  ~
>      SystemTools.Free Test   ~     
> *)
> END Test.
> 
> It compiled fine but when I try to run Test.test it answers:
> 
> WMTextView: Command execution error, res 3405 (Test incompatible with
> Unix / mmap)
> 
> Don't know what to do about it ?
> 
> Zdenek
> 
> 
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3644 bytes
Desc: not available
Url : https://lists.inf.ethz.ch/pipermail/oberon/attachments/20130413/b2f58de5/attachment.bin 


More information about the Oberon mailing list