Porting 2D CAD from DOS to Linux

Porting 2D CAD from DOS to Linux

Post by Hugo Marie » Fri, 29 Mar 2002 04:58:49



Hello,

I am planning to port a 2D CAD system (URL:
http://users.pandora.be/desi-iii), now freeware,  to a Linux environment,
but I have a few (a lot) of questions:

First of all: the program is written in MS-Fortran 5.1, which fortran should
I use ? -- don't ask me to convert to C, I have then two years work with the
conversion alone (360 modules) -- what do you think about Absoft, Salford or
Intel (I have tried gcc -> too much troubles with equivalence statements) ?.
If possible freeware, then DESI-III for Linux will be freeware, else if I
have to invest in a compiler, DESI-III will become shareware)

Second: Can I have direct access to video memory with VESA standard calls ?
I have a few assembler routines to convert: save and restore a part of the
screen, draw lines and draw pixel text in some variations. Where can I find
info ? Or can I find a decent free and fortran compatible library ?

Third: Can I read from the mouse via system calls, which buttons are
activated, how many steps did the mouse in X and Y since the last "mouse
call".

If all this can be solved, watch my site!

Thanks for your info and help.

Hugo

 
 
 

Porting 2D CAD from DOS to Linux

Post by Erik de Castro Lop » Fri, 29 Mar 2002 05:21:07



> Hello,

> I am planning to port a 2D CAD system (URL:
> http://users.pandora.be/desi-iii), now freeware,  to a Linux environment,
> but I have a few (a lot) of questions:

> First of all: the program is written in MS-Fortran 5.1, which fortran should
> I use ? -- don't ask me to convert to C, I have then two years work with the
> conversion alone (360 modules) -- what do you think about Absoft, Salford or
> Intel (I have tried gcc -> too much troubles with equivalence statements) ?.
> If possible freeware, then DESI-III for Linux will be freeware, else if I
> have to invest in a compiler, DESI-III will become shareware)

I have only tried g77 and that worked for the small amount of Fortran
code I ran through it.

Quote:> Second: Can I have direct access to video memory with VESA standard calls ?

No. Linux is a general purpose multi-user protected OS. It will not allow
any arbitrary program to change the screen behind its back.

Erik
--
+-----------------------------------------------------------+

+-----------------------------------------------------------+
#!/bin/sh
unzip ; strip; touch ; finger ; mount ; gasp ;
yes ; more ; umount ; sleep ;

 
 
 

Porting 2D CAD from DOS to Linux

Post by D. Stimit » Fri, 29 Mar 2002 05:40:06




> > Hello,

> > I am planning to port a 2D CAD system (URL:
> > http://users.pandora.be/desi-iii), now freeware,  to a Linux environment,
> > but I have a few (a lot) of questions:

> > First of all: the program is written in MS-Fortran 5.1, which fortran should
> > I use ? -- don't ask me to convert to C, I have then two years work with the
> > conversion alone (360 modules) -- what do you think about Absoft, Salford or
> > Intel (I have tried gcc -> too much troubles with equivalence statements) ?.
> > If possible freeware, then DESI-III for Linux will be freeware, else if I
> > have to invest in a compiler, DESI-III will become shareware)

> I have only tried g77 and that worked for the small amount of Fortran
> code I ran through it.

> > Second: Can I have direct access to video memory with VESA standard calls ?

> No. Linux is a general purpose multi-user protected OS. It will not allow
> any arbitrary program to change the screen behind its back.

On the bright side, if he can somehow use OpenGL, it'll work great, and
there won't be any need for asm.


- Show quoted text -

> Erik
> --
> +-----------------------------------------------------------+

> +-----------------------------------------------------------+
> #!/bin/sh
> unzip ; strip; touch ; finger ; mount ; gasp ;
> yes ; more ; umount ; sleep ;

 
 
 

Porting 2D CAD from DOS to Linux

Post by Pete Zaitc » Fri, 29 Mar 2002 07:53:36



> First of all: the program is written in MS-Fortran 5.1, which fortran should
> I use ? -- don't ask me to convert to C, I have then two years work with the
> conversion alone (360 modules) -- what do you think about Absoft, Salford or
> Intel (I have tried gcc -> too much troubles with equivalence statements) ?.

I'd encourage you to give g77 a second try. MS Fortran 5.1 is
nearly 15 years old, I cannot believe that g77 cannot handle
code that 5.1 handles. BTW, If you have trouble with equivalence,
I would strongly suggest to look for bugs. It's a part of a
language that requires utmost discipline. Once you start using
equivalence for commons (e.g. store into one set, read from
other set), the code becomes utterly unmaintainable and unportable.

Quote:> Second: Can I have direct access to video memory with VESA standard calls ?
> I have a few assembler routines to convert: save and restore a part of the
> screen, draw lines and draw pixel text in some variations. Where can I find
> info ? Or can I find a decent free and fortran compatible library ?

Google for SVGAlib. You also might want to think about porting
to X11 Window System. For your application, perhaps you may
do with raw Xlib.

Quote:> Third: Can I read from the mouse via system calls, which buttons are
> activated, how many steps did the mouse in X and Y since the last "mouse
> call".

If you go with SVGAlib, I strongly suggest not to use /dev/mouse
directly and read from gpm pipe instead. Read gpm's man.
Once you port to X11, the problem solves itself.

-- Pete