From owner-freebsd-questions Mon Nov 4 16:11:11 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 67B9537B401 for ; Mon, 4 Nov 2002 16:11:10 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFC1843E7B for ; Mon, 4 Nov 2002 16:11:09 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id gA50B7Ma052709; Mon, 4 Nov 2002 18:11:07 -0600 (CST) (envelope-from dan) Date: Mon, 4 Nov 2002 18:11:07 -0600 From: Dan Nelson To: Naydoe Maung Cc: FreeBSD Questions Subject: Re: NASM (BSD vs. Linux) Message-ID: <20021105001106.GA12357@dan.emsphone.com> References: <200211041524.43350.nyingelay@hotpop.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200211041524.43350.nyingelay@hotpop.com> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i 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 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$ > ================== > > 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. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message