flat assembler
Message board for the users of flat assembler.

Index > Linux > fasm not working on Ubuntu 9.10 64bit

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 24 Jan 2010, 15:34
I just installed Ubuntu 64bit yesterday and finally have it running the way it should on my system (after some trouble getting the dsl connection to stay working). Unfortunately Ubuntu doesn't recognize the fasm executable. is it just a 32bit only file? or has anyone found a way to make it run on an Ubuntu 64bit system?
thanks
Matt (madmatt)

_________________
Gimme a sledge hammer! I'LL FIX IT!
Post 24 Jan 2010, 15:34
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 24 Jan 2010, 16:49
madmatt, odd, I have exactly that OS installed here and fasm runs. What package have you tried, Linux or Unix?

And yes, fasm will only run as 32-bit executable but that is not a problem fortunately as 64-bit Linux allows to run 32-bit code.

If you tried the Unix package you may need to download libc-i386 (or something like that) and libc-i386-dev (or again, something like that), to be able to link the object.

Here my console:
Code:
loco@athlon64:~$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:      Ubuntu 9.10
Release:     9.10
Codename:   karmic
loco@athlon64:~$ uname -a
Linux athlon64 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
loco@athlon64:~$ fasm
flat assembler  version 1.69.11
usage: fasm <source> [output]
optional settings:
 -m <limit>    set the limit in kilobytes for the available memory
 -p <limit>    set the maximum allowed number of passes
 -s <file>     dump symbolic information for debugging    
Post 24 Jan 2010, 16:49
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 24 Jan 2010, 20:06
Something I forgot to tell: I've executed fasm with just "fasm" because I have it installed in /usr/bin. To run fasm from its own directory you would invoke it as "./fasm".
Post 24 Jan 2010, 20:06
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 24 Jan 2010, 20:55
LocoDelAssembly wrote:
Something I forgot to tell: I've executed fasm with just "fasm" because I have it installed in /usr/bin. To run fasm from its own directory you would invoke it as "./fasm".

Thanks. I'll put in the /usr/bin and see if that works. I've tried linux over the past 10 years or so, a little here and a little there. This time though I'm going to make a much better effort to learn Linux (Ubuntu 64bit) programming, in C and ASM. I'm still very much a newbie though. Smile I've worked almost always with Windows the last 10 years and it'll be a nice change.

_________________
Gimme a sledge hammer! I'LL FIX IT!
Post 24 Jan 2010, 20:55
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 24 Jan 2010, 22:00
It appears I can't just cut and paste the fasm file to the usr/bin/ folder, need special permission or something. How would I do this?
Post 24 Jan 2010, 22:00
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 24 Jan 2010, 22:22
Where there's a shell, there's a way.

Code:
su
<enter root's password>
mv fasm /usr/bin/
    

provided you're in the directory containing the fasm binary.

You can do it with sudo too (which Ubuntu probably has by default), but let's keep it clean. No heresy. Smile
Post 24 Jan 2010, 22:22
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 24 Jan 2010, 22:30
Quote:

You can do it with sudo too,
He will need this actually, last time I've checked "su" can't be used from non-root user. Funny however, you can do "sudo su" to circumvent this problem.
Post 24 Jan 2010, 22:30
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 24 Jan 2010, 22:54
LocoDelAssembly wrote:
He will need this actually, last time I've checked "su" can't be used from non-root user.

Unless the user is a member of the wheel group.
The idea behind su is to be able to switch to any user. And when switching to a UID 0 user, the user must be part of root's "inner circle" hehe.


LocoDelAssembly wrote:
Funny however, you can do "sudo su" to circumvent this problem.

If you're a sudoer and you're allowed to execute this or that command, or *any* command, then of course you're going to be able to run su and anything else. An insecurely configured sudo with unlimited power is like having your house door key nicely hanging from a rope by the door. It's pure madness.
Post 24 Jan 2010, 22:54
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 24 Jan 2010, 23:24
I managed to find a way to copy it using the terminal and the 'cp' command. I managed to assemble the example 'elfexe64' Smile , But the executable won't run, it gives me a 'command not found message'. Sad I tried using 'sudo' but that didn't work either. Hopefully, someone can help me solve this final problem. Idea
Post 24 Jan 2010, 23:24
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 25 Jan 2010, 00:31
madmatt wrote:
I managed to find a way to copy it using the terminal and the 'cp' command.

There's no way you could *just* copy a file to /usr/bin/ unless you're logged in as root. Could you elaborate?

madmatt wrote:
I managed to assemble the example 'elfexe64' , But the executable won't run, it gives me a 'command not found message'.

How did you run it? ./elfexe64? Post the result of ls -l.

madmatt wrote:
I tried using 'sudo' but that didn't work either.

sudo is for executing applications with alternative (usually higher) privileges. Don't use it unless you need to.
Post 25 Jan 2010, 00:31
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 25 Jan 2010, 01:03
madmatt: as ManOfSteel suggested, try running with "./elfexe64". The reason this is requires is that, unlike Windows, *u*x by default doesn't include your current working directory in the PATH environment variable (which is a pretty good idea not to do) - so you need the "./" part to qualify current directory.
Post 25 Jan 2010, 01:03
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 25 Jan 2010, 08:46
ManOfSteel wrote:
madmatt wrote:
I managed to find a way to copy it using the terminal and the 'cp' command.

There's no way you could *just* copy a file to /usr/bin/ unless you're logged in as root. Could you elaborate?

I'm pretty sure I'm not logged in as root, or I'm pretty sure I would've been able to use cut and past

madmatt wrote:
I managed to assemble the example 'elfexe64' , But the executable won't run, it gives me a 'command not found message'.

How did you run it? ./elfexe64? Post the result of ls -l.

I forgot to use './' before the filename


f0dder wrote:
madmatt: as ManOfSteel suggested, try running with "./elfexe64". The reason this is requires is that, unlike Windows, *u*x by default doesn't include your current working directory in the PATH environment variable (which is a pretty good idea not to do) - so you need the "./" part to qualify current directory.

'./' did the trick, forgot to use it before the filename.

Thanks everybody for your help, I think I've got everything the way I wan't it now.

_________________
Gimme a sledge hammer! I'LL FIX IT!
Post 25 Jan 2010, 08:46
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 25 Jan 2010, 15:09
madmatt wrote:
I'm pretty sure I'm not logged in as root, or I'm pretty sure I would've been able to use cut and past

You can be logged in as your (unprivileged) user, and have one process such as a shell running as root, at the same time. From there - and from there only - you'd be able to change anything in your system.
Post 25 Jan 2010, 15:09
View user's profile Send private message Reply with quote
Plue



Joined: 15 Dec 2005
Posts: 151
Plue 02 Feb 2010, 15:45
Quote:
(which is a pretty good idea not to do)
I've read this so many places, but I still don't understand why having ./ as the last item of your $PATH can possibly be a security risk. Of course having it first would be stupid, but is there really any good reason not to have it last?
Post 02 Feb 2010, 15:45
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.