From owner-freebsd-questions Mon Nov 4 17:59:16 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 852AC37B404 for ; Mon, 4 Nov 2002 17:59:14 -0800 (PST) Received: from babyruth.hotpop.com (babyruth.hotpop.com [204.57.55.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA49343E4A for ; Mon, 4 Nov 2002 17:59:13 -0800 (PST) (envelope-from nyingelay@hotpop.com) Received: from hotpop.com (kubrick.hotpop.com [204.57.55.16]) by babyruth.hotpop.com (Postfix) with SMTP id 6778321620B for ; Tue, 5 Nov 2002 01:59:07 +0000 (UTC) Received: from dreambsd (adsl-64-172-60-138.dsl.snfc21.pacbell.net [64.172.60.138]) by smtp-2.hotpop.com (Postfix) with ESMTP id 4D8531B84EE; Tue, 5 Nov 2002 01:59:00 +0000 (UTC) Content-Type: text/plain; charset="iso-8859-1" From: Naydoe Maung To: Dan Nelson Subject: Re: NASM (BSD vs. Linux) Date: Mon, 4 Nov 2002 18:01:09 -0800 User-Agent: KMail/1.4.3 Cc: FreeBSD Questions References: <200211041524.43350.nyingelay@hotpop.com> <20021105001106.GA12357@dan.emsphone.com> In-Reply-To: <20021105001106.GA12357@dan.emsphone.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211041801.09703.nyingelay@hotpop.com> X-HotPOP: ----------------------------------------------- Sent By HotPOP.com FREE Email Get your FREE POP email at www.HotPOP.com ----------------------------------------------- Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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