Specific programming in Linux

Specific programming in Linux

Post by Bruno Barberi Gnec » Sat, 15 Aug 1998 04:00:00



I program in C and assembly, but always did heavy stuff in the DOS platform. Now I
want to write and port some programs I wrote to Linux, but I have some questions:

a) Can I write directly to video memory? If yes, what are the addresses of text
and VGA memory in Linux? If not, what's the fastest way to write in the text
memory?

b) how do graphic modes work in Linux? What are them, how to use them?

c) is there a list of Linux' interruptions? Are they the same of DOS
interruptions?

d) what are the differences of file input/output in Linux?

e) is there a text introducing linux specific programming?

f) Any advices? :)

Thanks,

"There's never enough time to do all the nothing you want" Bill Watterson

My other OS is Linux -=- http://graphx.home.ml.org -=- Electric Eng, Poli

 
 
 

Specific programming in Linux

Post by Matt » Sun, 16 Aug 1998 04:00:00



> I program in C and assembly, but always did heavy stuff in the DOS platform. Now I
> want to write and port some programs I wrote to Linux, but I have some questions:

Using assembly to access hardware directly in linux is a bad idea as it reduces
portablility.

Quote:> a) Can I write directly to video memory? If yes, what are the addresses of text
> and VGA memory in Linux? If not, what's the fastest way to write in the text
> memory?

You should not access the video ram directly as your program then wont work over a
network or in an xterm.

Quote:> b) how do graphic modes work in Linux? What are them, how to use them?

Most distos come with SVGALib. I havent used it but it doesnt seem any harder to use
that graphics with DOS.

Quote:> c) is there a list of Linux' interruptions? Are they the same of DOS
> interruptions?

Again using interupts directly is not a good thing. The kernel usually provides ample
services.

Quote:> d) what are the differences of file input/output in Linux?

You dont have to worrie about any crappy 64k segment limitations.

Quote:> e) is there a text introducing linux specific programming?

Linux Programmers Guide.http://sunsite.unc.edu/LDP/LDP/lpg/index.html
Assembly HOWTO
http://sunsite.unc.edu/LDP/HOWTO/Assembly-HOWTO.html
Linux Programmers Bounce Point
http://www.ee.mu.oz.au/linux/programming/
Unix Programming FAQ
http://www.erlenstar.demon.co.uk/unix/faq_toc.html

Quote:> f) Any advices? :)

Check out ncurses for your text based programms.

Matty

 
 
 

Specific programming in Linux

Post by Josh Ste » Sun, 16 Aug 1998 04:00:00




Quote:>I program in C and assembly, but always did heavy stuff in the DOS platform. Now I
>want to write and port some programs I wrote to Linux, but I have some questions:

>a) Can I write directly to video memory? If yes, what are the addresses of text
>and VGA memory in Linux? If not, what's the fastest way to write in the text
>memory?

>b) how do graphic modes work in Linux? What are them, how to use them?

You might want to look here:

http://www.ee.mu.oz.au/linux/programming/

also, for a recent high level summary of "video modes"
in Linux:

http://slashdot.org/features/980812/0926212.shtml

If you are writing a desktop application, then with XFree86
and Linux you should be able to use shared memory pixmaps.
That might ultimately seem analogous to writing directly
to video memory.

Quote:>c) is there a list of Linux' interruptions? Are they the same of DOS
>interruptions?

Linux doesn't use interrupts to make function calls.
It uses libraries that hide implementation details.
Linux programs are mostly portable to any modern Unix machine.

Quote:>d) what are the differences of file input/output in Linux?

You would be best off using the ISO C (or C++) interfaces.

Quote:>e) is there a text introducing linux specific programming?

There are many, but there isn't any one book  that will cover
everything you might be interested in.  Look at the first site
above and see what appeals to you.  Then ask more specifically
about books relevant to a given topic.

- Josh

 
 
 

Specific programming in Linux

Post by Frank Mil » Mon, 17 Aug 1998 04:00:00




Quote:>I program in C and assembly, but always did heavy stuff in the DOS platform.
> Now I >want to write and port some programs I wrote to Linux, but I have
>some questions:
> [snip DOS-isms]

You might want to read the September 'Linux Journal' (just received it
myself), which has an article on porting DOS-graphics programs to Linux.

        -frank

 
 
 

Specific programming in Linux

Post by Hetz Ben Ham » Tue, 18 Aug 1998 04:00:00




> > I program in C and assembly, but always did heavy stuff in the DOS platform. Now I
> > want to write and port some programs I wrote to Linux, but I have some questions:

> Using assembly to access hardware directly in linux is a bad idea as it reduces
> portablility.

You're right. But if you stricly writing for Linux only and Don't want
your program to be ported ever (or make someone else life hell) - then you
can use assembler. as86 for start could be a good choise.

Quote:

> > a) Can I write directly to video memory? If yes, what are the addresses of text
> > and VGA memory in Linux? If not, what's the fastest way to write in the text
> > memory?

> You should not access the video ram directly as your program then wont work over a
> network or in an xterm.

Again, if you want to write for something like really fast graphics
(ahhem....) you can try to use Frame Buffer (found on kernel 2.1.112 and
up).

Quote:

> > b) how do graphic modes work in Linux? What are them, how to use them?

> Most distos come with SVGALib. I havent used it but it doesnt seem any harder to use
> that graphics with DOS.

You can try something new - a new library which gives nice speed and ease
of use (and no need for assembler). The name is: SDL and tthe URL for is:
http://www.devolution.com/~slouken/SDL/

Quote:> > c) is there a list of Linux' interruptions? Are they the same of DOS
> > interruptions?

> Again using interupts directly is not a good thing. The kernel usually provides ample
> services.

> > d) what are the differences of file input/output in Linux?

> You dont have to worrie about any crappy 64k segment limitations.

> > e) is there a text introducing linux specific programming?

> Linux Programmers Guide.http://sunsite.unc.edu/LDP/LDP/lpg/index.html
> Assembly HOWTO
> http://sunsite.unc.edu/LDP/HOWTO/Assembly-HOWTO.html
> Linux Programmers Bounce Point
> http://www.ee.mu.oz.au/linux/programming/
> Unix Programming FAQ
> http://www.erlenstar.demon.co.uk/unix/faq_toc.html

> > f) Any advices? :)

> Check out ncurses for your text based programms.

> Matty

Good luck.

Hetz