RPC from Windows to linux - linux

Is there some (working) example how to create RPC from windows to linux?
Client should be windows NT application, server is linux.
It needs to be MSRPC.
No Corba, no XML-RPC, SUN-RPC etc
MSDN says this:
RPC can be used in all client/server applications based on Windows
operating systems. It can also be used to create client and server
programs for heterogeneous network environments that include such
operating systems as Unix and Apple.
Unfortunately after spending few hours on google I'm giving up.
My expectation:
Linux node should have samba installed, because their MSRPC implementation works.
Using IDL file I generate stubs for both client and server
Client is built using MSVC
Server is build using gcc with some includes/libraries from samba (or other libs)
Linux node must have such RPC port mapper
Can someone point me out?

I think you have 2 possible ways to deal with this:
1- You can try using DCOM with wine, which means that you will actually write your code for windows, but at the same time you can test your results in the process and avoid using WinAPI calls that wine is not able to handle properly. This approach will allow you to generate stubs code from your IDL files.
2- You can try using Samba RPC Pluggable Modules, but I am afraid in this case the RPC communication will be more primitive.
Edit:
It seems there are many other ways. I found a list of libraries in DCOM-Wikipedia, j-Interop for example looks particularly promising.

Related

EtherCat module :How to communicate with linux

I'am going to communicate EtherCAT master(CX2020) with Linux OS PC(ubuntu) for storing value from PLC on server and writing also.
By EthearCAT network protcol, it should be availave to communicate with windows plc installed twincat.
But I couldn't find the way for Linux.
Is there any solution?
There are various ways for you to communicate with a CX2020 from Linux, it all depends on your requirements and what the usage is for.
Without knowing anything about those, one option is to use the Beckhoff ADS protocol. All Beckhoff PLCs have by default ADS installed on them and you can
(with the right credentials setup for ADS) communicate with the ADS-library. The good thing about ADS is that it is open-source, and thus it's possible to
get the code for Linux.
The ADS sourcecode is available at:
https://github.com/Beckhoff/ADS
You basically need to:
Compile/Install the library on your Linux machine
Create an ADS/AMS-route to your CX2020
Create a program that uses this route to communicate with the PLC
With ADS you can access the variables directly in the CX2020 memory (both read and write!).
There are many finished wrapper libraries available for all common programming languages that you can use directly in Linux. If you're up to Python, I would
recommend checking out PyADS (https://github.com/stlehmann/pyads), which has a good user base and many examples available all around the net.

node-serialport O/S requirements

I need to be able to read the serial port from within my JS code. I recently stumbled across this component
https://github.com/voodootikigod/node-serialport
What are the requirements for the client computer O/S?
To install it, all it says to do is
npm install serialport
What is that? Where should this command be run? More details would be appreciated.
Thank you
The module you've pointed out is for node.js an event-driven Javascript application server. The emphasis here is that node.js is server-side, not something that runs in a browser.
The command you've pointed out invokes npm, a package manager for node.js. You would need to execute that command on the server where the code expects to run.
While only the author of the code will be able to give you an authoritative answer, a quick review of both the Javascript and the C++ code doesn't seem to reveal anything that's platform specific.
Well, as long as you can compile that C++ code. That looks to be a problem if your server is on Windows.
The library seems to want to treat the serial port as a regular file. While this should be an obvious way to do it if you're on a Unixish operating system (Linux, BSD, Solaris, OS X, etc -- though I don't think Macs have had serial ports in a few decades), it's not immediately clear or obvious if you can just ask Windows to open COM1 and have it work correctly.
So, chances are that you'll have a much larger chance of success if you're hosting this on a Unix than on Windows.

Implementing a kernel debugging module for a Linux guest OS inside a VmWare VM

Sorry for the rather long post.
I need some input regarding a project that I am going to undertake.
I am trying to make an application that collects kernel debugging information from a guest Linux OS, located inside a VmWare Virtual Machine, and send them to a host OS efficiently.
So far, I have found a similar project, but written for Windows[1].
The author of the project wrote a DLL that is loaded into memory, and replaces the implementation of the KdSendPacket and KdReceivePacket functions, to use the VmWare GuestRpc[2] mechanism, instead of the slow serial port.
The data are then send to a debugging application on the host(Kd or WinDbg) trough a named pipe.
The author claims that there is a speed-up up to 45%, by avoiding the serial port transmission.
I am trying to achieve something similar ,but for Linux, and try to make the debugging process a little faster, than using the serial port.
My concrete questions are :
Do any similar applications exist?
I didn't manage to find any.
Would such an application be worth it ,comparing its functionality to netconsole[3], for example?
What method of intercepting printk messages would you suggest ?
Is there an equivalent of KdSendPacket/KdReceivePacket on Linux ?
[1]. http://virtualkd.sysprogs.org/dox/operation.html
[2]. http://articles.sysprogs.org/kdvmware/guestrpc.shtml
[3]. http://www.kernel.org/doc/Documentation/networking/netconsole.txt
Using the serial port is really suboptimal.. even the (virtual) network would be preferable to that, but getting back to host-guest IPC channels, VMware's VMCI comes to mind.
many approaches can use to achieve your goal, below methods can be applied if network is connected:
use syslog service and transfer log though network to your server:
syslogd, syslogng seems support sending log to a log server with some filter critiera.
directly call tcp/udp socket functions in your kernel module to sends your collected data back to server.
other approaches, you may write application on host machine that calls hypervisor's share memory access function to read the memory buffer of your kernel module. However, the xen/kvm hypervisor both support these apis and i am not sure about weather vmware have this kind of library.

node.js on Windows. When and why?

Note: There is a similar question called 'installing nodejs on windows machine'.
And various answers explaining how by installing cygwin you can get it working there.
now, I don't want to install cygwin.
I just wish I could run nodejs on a windows box.
I want a "nodejs.exe" to kick off.
Can somebody explain to me
1) why nodejs has not been ported on windows - what are the technical reasons for not providing an exe ?
2) are there any plans to have nodejs on windows ?
I really would like to use it but I can't accept that I have to accept cygwin.
That's just not right.
Update:
For optimum node on windows development I recommend you use the Windows Azure powershell for node.js. It's a powershell optimised for using node, npm and the azure APIs. (the azure apis are optional. I would still use this powershell if I didn't use azure).
When : v0.6
Currently you can get a binary file that (kind of) works under windows. Go ask on the node.js IRC channel. They'll hook you up.
Basically if you read up on node.js road plans you will find that proper windows support is planned for 0.6, we are currently on v0.4.7 and the v0.5.x beta is in full storm.
I won't give an ETA but it's soon.
IRC can be found at the Community links
PDF showing v0.6 road plan
July 2011 update:
#nodejs v0.5.1 is the first to ship with an official Windows executable. We're hoping to get some good feedback.
Microsoft has officially gotten involved with joyent in making node.js run natively on windows.
Running Node under Windows presents several technical problems, mostly related to how Windows' internal design differs from that of Linux and the "change in mindset" required to port Unix applications to Windows.
Background
Linux was designed to be a replacement for Unix, a well-known multitasking operating system, so from day one it has been a multi-user/multi-process, server-oriented operating system. The idea of multiple processes sharing system resources is key to its internal design.
Windows was initially designed as a single-user/single-process desktop operating system and so did not support shared access to system resources. In 1993 Microsoft released a newly redesigned version of Windows--called Windows/NT--to better support the shared resource, multitasking model required by servers, but due to its existing installed base of users, Microsoft required NT to also support all the features of its single-user/single-tasking forebearer.
Windows 7 is a direct descendant of NT and Microsoft's need to support legacy users continues to this day (and in the opinion of many, has severely muddled Windows' internal design.)
Further, Microsoft hired a systems architect named Dave Cutler to design NT. Dave is best known for designing a competitor to Unix called VMS, the internal design of which differs significantly from that of Linux, which has caused a lot of problems for developers interested in porting their Unix programs to Windows.
The clearest example of this "impedance mismatch" between the internal design of Windows and Linux is how they handle event-driven, non-blocking input/output (io) on which Node relies to perform its (apparent) multitasking magic in a single thread of operation.
Linux supports two system-level functions called select() and epoll() which can be used to asynchronously inform a process of changes within the operating system that affect it. Node relies heavily on these functions but Windows doesn't support either, relying instead on "Change Notifications" (mostly) to handle event-driven io.

Listening a particular port on linux to access data comes from mobile device

i am newbie to Linux platform, i am working on java technology.
what i have to do is : Having a program that running on mobile devices,that sends some data to my Linux machine, now i have to create a program in java that
listen to a particular port.
access data comes on that port(which is sending by mobile device)
save that data to the database.
response back to the mobile device.
i.e. i would make my Linux system as server that can listen from many clients(mobile devices), but not getting how to configure this environment... :(
i used cent OS 5.4 and
installed jdk1.6.0_24
any help would be appreciated.....
thanx in advance!
khushi
One of Java's greatest strengths is that you can pretty much ignore the host operating system as long as you stick to core Java features. In the case you're describing, you should be able to accomplish everything by simply using the standard Java networking APIs and either the JDBC to access an existing, external database or you could choose any number of embedded Java databases such as Derby. For your stated use case, that you'll be running the application on Linux is pretty much irrelevant (which should be good news... you don't need to learn a whole operating system in addition to writing your app ;-).
Here's a nice client/server tutorial, in that it is broken into steps, and adds each new concept in another step.
Here's another client/server tutorial with much more detail.
I would write it to accept one connection at a time. Once that works, I would study the new(ish) java.lang.concurrent classes, in particular the ExecutorService, as a way of managing the worker bee handling each connection. Then change your program to handle multiple connections using those classes. Breaking it up in two steps like that will be a lot easier.

Resources