how to learn programming over Linux platform?

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
asimsnet
Cadet
Posts: 3
Joined: Tue May 07, 2002 7:03 pm
Location: Karachi

how to learn programming over Linux platform?

Postby asimsnet » Wed Aug 14, 2002 9:18 pm

Assalamoalikum

I am newbie to this Linux world. I want to learn to program for linux systems.
I've been coding in C and assembly for 8051 platforms. Recently I started to use Linux for CNC machine control using EMC and was really impressed by the realtime event handling capability of the OS.

Now I am very interested in using Linux as an Embedded OS
Could anyone can guide me what path should i follow to learn programming for this platform? any good isntitutes in karachi? what books are avialable here to learn C/C++ over linux platform?
Warm regards

Asim

if
Battalion Quarter Master Havaldaar
Posts: 224
Joined: Tue Aug 13, 2002 12:52 pm
Location: Islamabad
Contact:

Postby if » Thu Aug 15, 2002 2:20 pm

AoA,

sorry .... i'm also newbie..... i want help in regard to assembly.... plz help me in assembly... can u

thx
if u find anything which shows my lack of knowledge,
please guide me... thx
------------------------------------
Aslam-o-Aliakum-Wa-Rahmatullah-Wa-Barakatuhu
------------------------------------
if

asimsnet
Cadet
Posts: 3
Joined: Tue May 07, 2002 7:03 pm
Location: Karachi

Re: Assembly language

Postby asimsnet » Thu Aug 15, 2002 7:31 pm

Dear If
Walikumsalam

Yes sure! i can help you learn assembly language. Assembly language is
device specific. Means each processors has a different assembly language if they are not code compatible.
differences may be in terms of syntax and memory addressing.
Assembly language strictly depends over the architechture of the cpu.

I've been coding for 8051 and compatible microcontrollers if that you are interested in then I can help you. Please let me know what exactly you want to learn and what troubles and dificulties are you having?

@sim

Muddassir
Lance Naik
Posts: 29
Joined: Sun Jul 28, 2002 12:53 am
Location: Karachi, Pakistan
Contact:

Postby Muddassir » Thu Aug 15, 2002 9:13 pm

as far a my knowledge is concern i think in karachi we dont have any institute who are teaching C/C++ programming under linux :( . so you should start work by your own. there are linux programming book available in urdu bazar. you will find good books from there.


If I am wrong then please please somebody tell me about the institute.
Muddassir Sayeed siddiqui
Linux User # 282980

kadnan
Battalion Quarter Master Havaldaar
Posts: 208
Joined: Wed Aug 07, 2002 8:00 pm
Location: Karachi,Pakistan
Contact:

Postby kadnan » Fri Aug 16, 2002 10:06 am

"Beginning Linux Programming" -Wrox Publications, you may find this book in urdu bazar, Paramount etc,price is around Rs.200 i think,
its a nice book

mrkkhattak
Site Admin
Posts: 285
Joined: Wed Aug 07, 2002 8:00 pm
Location: Karachi
Contact:

Postby mrkkhattak » Fri Aug 16, 2002 11:58 am

yep... Begining Linux Programming & the second book of this series Professional Linux Programming are nice books :-)

kadnan
Battalion Quarter Master Havaldaar
Posts: 208
Joined: Wed Aug 07, 2002 8:00 pm
Location: Karachi,Pakistan
Contact:

Postby kadnan » Fri Aug 16, 2002 11:16 pm

i donthave that professional one? do you have that? or somethin nice in that professional series book? do let me know

wasif81
Cadet
Posts: 1
Joined: Sat Sep 21, 2002 11:20 pm
Contact:

Can anybody help me with...

Postby wasif81 » Sun Sep 22, 2002 12:03 am

Salaam,
Well, i want to have access to the hardware ports i.e serial & parallel through my programming . For this i want to know that which language will be best on linux & where to get info to start on it. one more thing on windows we used to make dlls to make a function available to other programs too how do we achieve this in linux. I'll be very thank full to u people if u reply to this message.
Allah-Hafiz.

fawad
Site Admin
Posts: 918
Joined: Wed Aug 07, 2002 8:00 pm
Location: Addison, IL
Contact:

Postby fawad » Mon Sep 23, 2002 10:14 pm

Wasif,
The serial and parallel ports are available like regular files under the devfs. For example, /dev/lp0 is the first parallel port and /dev/ttyS0 is the first serial port. You can read about this stuff on the linux documentation project http://www.tldp.org/.
The .dll equivalent on Linux is .so. They are called shared libraries. The .so files are for dynamic linking and .o and .a files are for static linking.

The book: Beginning Linux Programming from Wrox is a nice intro to all these topics+ a whole lot more (sockets, IPC, threading etc.).

-fawad

zeenix
Naik
Posts: 67
Joined: Wed Apr 23, 2003 4:01 am
Location: Finland
Contact:

C is the best

Postby zeenix » Fri Apr 25, 2003 2:27 am

> Well, i want to have access to the hardware ports i.e serial & parallel through > my programming . For this i want to know that which language will be best on > linux & where to get info to start on it. one more thing on windows we used to > make dlls to make a function available to other

About the language, C is the best choice for the linux plateform: from low-level hardware access to high-level thingee like GUIs and 3d graphics, C is the best choice. By C, i do not mean C++, as according to many guru linux programmers: "C++ sucks" and thats why they have adopted/invented techniques for doing OOP in pure C, so that they could survice in the modern era of OOP.
"I think therefore I am" --- Rene Descartes

qadri409
Cadet
Posts: 5
Joined: Fri Jan 31, 2003 10:35 pm
Contact:

Re: how to learn programming over Linux platform?

Postby qadri409 » Fri May 09, 2003 5:04 pm

asimsnet wrote:Assalamoalikum

I am newbie to this Linux world. I want to learn to program for linux systems.
I've been coding in C and assembly for 8051 platforms. Recently I started to use Linux for CNC machine control using EMC and was really impressed by the realtime event handling capability of the OS.

Now I am very interested in using Linux as an Embedded OS
Could anyone can guide me what path should i follow to learn programming for this platform? any good isntitutes in karachi? what books are avialable here to learn C/C++ over linux platform?
Warm regards

Asim

salam ,
am not much expert but i have tried programming in linux just to how it works.
i call emacs from terminol
[falan@localhost/falan]$emacs
..then i write my programm in it
like
#include <stdio.h>
and sooooos sosososo
then i go to the tool bar and save the buffer in the DIR i want ...Remember it gives all these saving messages and other in its bootom so save it as your-prog-name.c and exit
get back to terminol.....
invoke gcc
suppose its like ( the command shell prompt )
[falan@localhost/falan]$gcc -o your-prog-name your-prog-name.c
so it will gice you the executable file which colour will be green
at the shell issue the command like [falan@localhost/falan]$ ./you-prog-name ......... and it will execute :)
if you find it help full do reply ...its nice to see that you can embed assembly codes in C
wish you luck
ALLAH HAFIZ
shahzad Qadri
peshawar

jinix
Lance Naik
Posts: 35
Joined: Tue Jan 06, 2004 7:54 pm
Location: Karachi
Contact:

Embedded system

Postby jinix » Fri Feb 27, 2004 2:18 am

AOA,

Well friend if u need a book in this regard feel free 2 ask me.

Salam,
jinix

amkali
Lance Naik
Posts: 33
Joined: Sat Aug 03, 2002 9:53 pm
Location: Lahore, Pakistan

Postby amkali » Wed May 19, 2004 4:48 pm

Salaamz

I don know abt karachi .... but a shop in Hafeez Center have very good books on all the topic Including Linux ....
But Beware he is very expensive

Other than that there is a shop in liberty 'Galaxy Books' ... But he doesnt have anything of use .....

But if u are serious abt linux programming then the best thing to do is get an unlimited internet connection and find the treasures on the WWW....

Have fun

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Re: how to learn programming over Linux platform?

Postby lambda » Thu May 20, 2004 12:57 pm

qadri409 wrote:i call emacs from terminol


a couple of things. first of all, you don't have to exit emacs. after writing your program and saving it, you can go through the menus and select compile (it's under the tools menu). in the minibuffer, type in

Code: Select all

gcc -g -o progname yourfile.c


it will compile the program, and show you gcc's output. if there are any errors, click on the line describing the error using the middle button on your mouse. emacs will jump to the location in the file with the error. after you fix it, you can compile again (and it'll remember the gcc commandline you used, so you won't have to type it in again).

keyboard shortcuts. to save, hit control-x control-s (usually written as C-x C-s). to compile, hit M-x and then type "compile". M-x is produced by hitting alt-x or (this way works everywhere) escape and then x. you can get rid of the bottom compile output window by clicking in your source window and then hitting C-x 1 (or selecting "one window" from the files menu).

ok, say you got it to compile. now you want to run it. split your windows (either hit C-x 2 or select "split window" from the files menu), and click in the lower window. type M-x shell. you'll get a shell prompt. run your app.

if your app has a runtime bug that causes a segmentation fault or some other kind of crash, or if you want to watch it work, type M-x gdb, and then "gdb progname". this will run gdb in one window, and let you watch the code in the other window. example: type "break main" to set a breakpoint at the main() function, and then type "run".

the keybindings are important to know because they let you use emacs without the x window system (ie, without the menus). there are also a ton of operations you can perform with the keyboard that aren't listed in the menus.

Qadri-409
Battalion Havaldaar Major
Posts: 286
Joined: Sun May 09, 2004 4:16 pm
Location: Peshawar
Contact:

Re: how to learn programming over Linux platform?

Postby Qadri-409 » Thu May 20, 2004 1:08 pm

lambda wrote:
qadri409 wrote:i call emacs from terminol


a couple of things. first of all, you don't have to exit emacs. after writing your program and saving it, you can go through the menus and select compile (it's under the tools menu). in the minibuffer, type in

Code: Select all

gcc -g -o progname yourfile.c


it will compile the program, and show you gcc's output. if there are any errors, click on the line describing the error using the middle button on your mouse. emacs will jump to the location in the file with the error. after you fix it, you can compile again (and it'll remember the gcc commandline you used, so you won't have to type it in again).

keyboard shortcuts. to save, hit control-x control-s (usually written as C-x C-s). to compile, hit M-x and then type "compile". M-x is produced by hitting alt-x or (this way works everywhere) escape and then x. you can get rid of the bottom compile output window by clicking in your source window and then hitting C-x 1 (or selecting "one window" from the files menu).

ok, say you got it to compile. now you want to run it. split your windows (either hit C-x 2 or select "split window" from the files menu), and click in the lower window. type M-x shell. you'll get a shell prompt. run your app.

if your app has a runtime bug that causes a segmentation fault or some other kind of crash, or if you want to watch it work, type M-x gdb, and then "gdb progname". this will run gdb in one window, and let you watch the code in the other window. example: type "break main" to set a breakpoint at the main() function, and then type "run".

the keybindings are important to know because they let you use emacs without the x window system (ie, without the menus). there are also a ton of operations you can perform with the keyboard that aren't listed in the menus.



That is far better approach
by the now am using vi to right progs if any
M Shahzad Qadri


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest