From owner-freebsd-hackers Sat Nov 14 11:06:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA07558 for freebsd-hackers-outgoing; Sat, 14 Nov 1998 11:06:42 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (castles134.castles.com [208.214.165.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA07553 for ; Sat, 14 Nov 1998 11:06:40 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (LOCALHOST [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id LAA06709; Sat, 14 Nov 1998 11:04:28 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811141904.LAA06709@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Ruslan Ermilov cc: Robert Nordier , FreeBSD Hackers Subject: Re: FreeBSD on i386 memory model In-reply-to: Your message of "Sat, 14 Nov 1998 19:15:56 +0200." <19981114191556.A17660@ucb.crimea.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 14 Nov 1998 11:04:28 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > FWIW, here's a small standalone i386 assembler program: > > > > main: call .+0x5 > > popl %ebp > > subl $0x5,%ebp > > pushl $msg.1-msg > > leal msg-main(%ebp),%eax > > pushl %eax > > pushl $0x1 > > movl $0x4,%eax > > call .+0x5 <-- why this one? > > lcall $0x7,$0x0 > > pushl $0x0 > > movl $0x1,%eax > > call .+0x5 <-- and this one? > > lcall $0x7,$0x0 > > msg: .ascii "hello, world!\n" > > msg.1: > > Unfortunately, I can't compile it, as(1) gives the following: > > {standard input}: Assembler messages: > {standard input}:5: Error: Unimplemented segment type 0 in parse_operand > {standard input}:10: Error: operands given don't match any known 386 instruction > {standard input}:14: Error: operands given don't match any known 386 instruction > > It seems that as(1) doesn't understand ``lcall $SECTION, $OFFSET''. > At least on my 2.2.1, 2.2.5 and 2.2.7+ machines: No, it doesn't. You can either upgrade to a newer assembler, or do it the "old" way: #define LCALL(x,y) .byte 0x9a ; .long y; .word x Note that on 3.0 systems we use int 0x80 for kernel entry, as it's faster. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message