LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help with sending 'hello world' over an ethernet in linux assembly languge (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-sending-hello-world-over-an-ethernet-in-linux-assembly-languge-816345/)

dakoder 06-25-2010 09:24 AM

help with sending 'hello world' over an ethernet in linux assembly languge
 
Help.....

I have is an assembly language program which now needs to get 64 bytes of data from the network which is being transmitted every 100 ms (0.1 of a second) by a remote computer, I currently use

'telnet 192.168.xxx.xxx port'

in a bash shell to dump this data which works fine,

I now need to read this data in real time from within a linux assembly language program but do not know which is the best way to do this.
I could get telnet to pipe it to a file and just read the file from within the assembly code (but there may be issues with file sharing)
X11 graphics under assembly works well and I wondered if there was a similar system for using the ethernet in linux ?
is there a '/proc/my_RxTx_serial_data_port.txt file which the kernel automaticaly updates ?
is there a small 'hello ethernet' ELF binary I could pick apart which demonstrates sending/receiving 'hello world' over the ethernet ?
or do I use linux system calls and if so is there a code snippet for this ?

thanks.

Graham

business_kid 06-25-2010 01:51 PM

If you have the info pages installed, you can surely find the system calls in C. Don't do that job in assembler unless you absolutely have to (i.e. some twit of an IT lecturer dreamed this up for you and insists on it). If so, he's a sadist. Where you would use assembler is some routine that will be run a zillion times, and you call that from a C program, and it's all in ram.

fruttenboel 06-25-2010 03:54 PM

Quote:

Originally Posted by dakoder (Post 4014778)
Help.....

I have is an assembly language program which now needs to get 64 bytes of data from the network which is being transmitted every 100 ms (0.1 of a second) by a remote computer, I currently use

The days of assembly language ended over 10 years ago. Unless your processor is less than a 386, don't even think of assembly language. Any scripted language will be fast enough for any purpose.

If you want to stand out in the crowd, use one of the Wirthian languages to get the job done: Pascal, Modula-2 or Oberon. All of them support low level programming (to a certain degree) so you can do most of the things you want to.

The business kit is right... Only very rare cases justify the use and burden of assembly language.

dakoder 06-26-2010 01:30 PM

Some kind soul on the http://tinycorelinux.com/forum/
pointed me to http://sourceforge.net/projects/lscr/
this fantastic resource list everyting in the system call tables and has loads of example low level stuff. perfect.

thanks to all who helped, this kind of technical support really does have a gold seal attached !

graham

dakoder 07-03-2010 05:49 AM

Quote:

Originally Posted by fruttenboel (Post 4015137)
The days of assembly language ended over 10 years ago.

Oh no it did not ! http://www.menuetos.net/ (32/64 bit)

now if only menuet had a /proc & /media & /dev directory and could load ELF binaries and SU privilages and have all drivers and kernel written in assembler all nice and ready for the not now but soon to be embedded intel x86 micro-controller........<grin>

graham


All times are GMT -5. The time now is 06:13 AM.