Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Nov 1998 21:30:44 +0200 (SAT)
From:      Robert Nordier <rnordier@nordier.com>
To:        ru@ucb.crimea.ua (Ruslan Ermilov)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: FreeBSD on i386 memory model
Message-ID:  <199811131930.VAA12575@ceia.nordier.com>
In-Reply-To: <19981113202027.A15520@ucb.crimea.ua> from Ruslan Ermilov at "Nov 13, 98 08:20:27 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811131930.VAA12575>