From owner-freebsd-hackers Fri Nov 13 11:34:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA19687 for freebsd-hackers-outgoing; Fri, 13 Nov 1998 11:34:21 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ceia.nordier.com (m2-29-dbn.dial-up.net [196.34.155.93]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA19670 for ; Fri, 13 Nov 1998 11:34:07 -0800 (PST) (envelope-from rnordier@nordier.com) Received: (from rnordier@localhost) by ceia.nordier.com (8.8.7/8.6.12) id VAA12575; Fri, 13 Nov 1998 21:30:46 +0200 (SAT) From: Robert Nordier Message-Id: <199811131930.VAA12575@ceia.nordier.com> Subject: Re: FreeBSD on i386 memory model In-Reply-To: <19981113202027.A15520@ucb.crimea.ua> from Ruslan Ermilov at "Nov 13, 98 08:20:27 pm" To: ru@ucb.crimea.ua (Ruslan Ermilov) Date: Fri, 13 Nov 1998 21:30:44 +0200 (SAT) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ruslan Ermilov wrote: > Hi! > > I would like to practice in writing assembler programs > under FreeBSD. > > Is there any doc/book/man which describes the FreeBSD > memory model on i386 architecture? Essentially it's just a flat protected model, and for most purposes can simply be ignored. Rather than documentation, I'd suggest looking at C startup code (src/lib/csu), i386-specific C library functions (src/lib/libc/i386), and at the output of `cc -S'. 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 lcall $0x7,$0x0 pushl $0x0 movl $0x1,%eax call .+0x5 lcall $0x7,$0x0 msg: .ascii "hello, world!\n" msg.1: -- Robert Nordier To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message