Date: Sat, 14 Nov 1998 11:04:28 -0800 From: Mike Smith <mike@smith.net.au> To: Ruslan Ermilov <ru@ucb.crimea.ua> Cc: Robert Nordier <rnordier@nordier.com>, FreeBSD Hackers <hackers@FreeBSD.ORG> Subject: Re: FreeBSD on i386 memory model Message-ID: <199811141904.LAA06709@dingo.cdrom.com> In-Reply-To: Your message of "Sat, 14 Nov 1998 19:15:56 %2B0200." <19981114191556.A17660@ucb.crimea.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811141904.LAA06709>