<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'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 "platform code"<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 "offer" 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's what is known as "VM sources", 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: 'primitiveSerialPortOpenByName'<br>
parameters: #(ByteArray SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger ).<br>
self var: #cString type: 'char *'.<br>
cString := self allocateTerminatedString: deviceName.<br>
self cCode: 'serialPortOpenByName(<br>
cString, baudRate, stopBitsType, parityType, dataBits,<br>
inFlowControl, outFlowControl, xOnChar, xOffChar)'<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'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's compiled into the VirtualMachine.<br>
<br>
And I can use this "machine" for accessing the serial interfaces, (it<br>
even works for '/dev/ttyUSBx' devices. For me this is a great thing<br>
because I'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 "dirty" a<br>
missing #define was introduced. I bet there is a better place for that<br>
but in genrated code. But well it's just an intermediate step.<br>
<br>
If someone here may be interested just drop me a mail and with some help<br>
we'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'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'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>
"Send the given bytes out this serial port. The port must be<br>
open. "<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>