<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
But I think there are a few problems with Pharo 1.3 and Cog. AFAIKT one<br>
needs AbstractLauncher. I shamlessly stole it from Squeak. If I do<br>
not have it and start my generated CogVM I just get an open window with<br>
some black rectangle  in the upper left.<br>
This problem was  mentioned at:<br>
<br>
<a href="http://code.google.com/p/pharo/issues/detail?id=4002" target="_blank">http://code.google.com/p/pharo/issues/detail?id=4002</a><br>
<br></blockquote><div><br><br>yes. Cog doesn&#39;t load in Pharo 1.3 anymore. We will fix it. <br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Now what did I have to do?<br>
I downloaded the sources from squeak-vm and Cog and there are at least<br>
two different C files and probably a header files with the prototyps:<br>
The two files are<br>
sqUnixSerial.c which is in  platforms/unix/plugins/SerialPlugin<br>
SerialPlugin in src/plugins/SerialPlugin<br>
<br>
It seems the first is the handwritten C-code<br></blockquote><div><br>yes, everything under /platform is the hand written part and known as &quot;platform code&quot;<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
The first is needed to &quot;offer&quot; the functionality and the later is<br>
probabl seems t be the interface to Squeak. I guess this is generated<br>
code from some Slang code</blockquote><div><br>yes, and that&#39;s what is known as &quot;VM sources&quot;, the auto generated C code from SLANG that is usually placed in /src<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
 which looks like this:<br>
<br>
parityType dataBits: dataBits inFlowControlType: inFlowControl outFlowControlType: outFlowControl xOnByte: xOnChar xOffByte: xOffChar<br>
<br>
        | cString |<br>
        self primitive: &#39;primitiveSerialPortOpenByName&#39;<br>
                parameters: #(ByteArray SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger ).<br>
        self var: #cString type: &#39;char *&#39;.<br>
        cString := self allocateTerminatedString: deviceName.<br>
        self cCode: &#39;serialPortOpenByName(<br>
                        cString, baudRate, stopBitsType, parityType, dataBits,<br>
                        inFlowControl, outFlowControl, xOnChar, xOffChar)&#39;<br>
<br>
which then write out the proper C code for that plugin.<br>
<br></blockquote><div><br><br>yep<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
You see I&#39;m still ignorant on how this is all supposed to work.<br>
<br></blockquote><div><br>so do  I :)<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Nevertheless copying the files at the proper places in the src and<br>
platform tree. This codes get&#39;s compiled into the VirtualMachine.<br>
<br>
And I can use this &quot;machine&quot; for accessing the serial interfaces, (it<br>
even works for &#39;/dev/ttyUSBx&#39; devices. For me this is a great thing<br>
because I&#39;m forced to access some periperal devices via serial lines.<br>
<br>
I need some extra hack in the generated file (I know this is &quot;dirty&quot; a<br>
missing #define was introduced. I bet there is a better place for that<br>
but in genrated code. But well it&#39;s  just an intermediate step.<br>
<br>
If someone here may be interested just drop me a mail and with some help<br>
we&#39;ll be able to modify the Cog sources cleanly to use this modified<br>
Plugin for intefacing to serial lines in Linux.<br></blockquote><div><br><br>Eliot should be interested.<br>But you didn&#39;t comment your changes. Maybe you can push them in git ?<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
I&#39;m also quite aware that the Smalltalk side of the code could need a<br>
little attention: It looks like:<br>
<br>
<br>
<br>
nextPutAll: aStringOrByteArray<br>
        &quot;Send the given bytes out this serial port. The port must be<br>
        open. &quot;<br>
        ^ port isString<br>
                ifTrue: [self<br>
                primWritePortByName: port<br>
                from: aStringOrByteArray<br>
                startingAt: 1<br>
                count: aStringOrByteArray size]<br>
                ifFalse: [self<br>
                primWritePort: port<br>
                from: aStringOrByteArray<br>
                startingAt: 1<br>
                count: aStringOrByteArray size]<font color="#888888"><br>
<br>
</font><div class="h5"><br>
</div></blockquote></div><br>for this you can open a pharo issue<br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>