Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Nov 2002 18:01:09 -0800
From:      Naydoe Maung <nyingelay@hotpop.com>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: NASM (BSD vs. Linux)
Message-ID:  <200211041801.09703.nyingelay@hotpop.com>
In-Reply-To: <20021105001106.GA12357@dan.emsphone.com>
References:  <200211041524.43350.nyingelay@hotpop.com> <20021105001106.GA12357@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 04 November 2002 04:11 pm, Dan Nelson wrote:
> In the last episode (Nov 04), Naydoe Maung said:
> >         mov     eax, 4
> >         mov     ebx, 1
> >         mov     ecx, msg
> >         mov     edx, MSGLEN
> >         int     80h
> >
> > Shell output:
> >
> > bash-2.05b$ nasm -f elf hello.asm
> > bash-2.05b$ ld -o hello hello.o
> > bash-2.05b$ ./hello
> > bash-2.05b$ ls
> > hello           hello.asm       hello.o
> > bash-2.05b$
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >
> > As you can see here, It compiled and linked without any errors,
> > however no appropriate output is being generated.  There were no
> > problems running it on Linux.  I heard some issues about different
> > sys calls and interrupts on Linux and BSD, but I thought since the
> > Linux driver was loaded there should be no problems running Linux
> > oriented programs.  I'm very confused, and I'm sure I'm missing out
> > some stuff.  Help me please.
>
> Try branding your executable as a Linux binary with brandelf, or call
> the write function and link with libc, which will do the syscall for
> you and won't require the Linuxulator to run.
>
> Take a look at the editors/e3 port to see how to write portable
> assembly.

Thank you so much Dan.  "brandelf" works really well on all my ASMs.  I=20
actually "brandelf -t Linux" on the executables, and they all generate pr=
oper=20
outputs magically.  Well, maybe not magically, but I don't quite understa=
nd=20
the logic behind it.  Anyway...

I'm just wondering Dan, or anyone, if you've ever come across the problem=
=20
where the "brandelf -t Linux" won't work on your executables that are ELF=
=20
formatted and a brand of 'Linux' as well?  (I hope that my question makes=
=20
sense.)  Thanks.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211041801.09703.nyingelay>