From owner-freebsd-hackers Sat Jul 11 08:38:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA11681 for freebsd-hackers-outgoing; Sat, 11 Jul 1998 08:38:22 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from sparky8 (sparky8.cc.binghamton.edu [128.226.4.18]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id IAA11674 for ; Sat, 11 Jul 1998 08:38:20 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by sparky8 (SMI-8.6/8.6.9) with SMTP id LAA00784; Sat, 11 Jul 1998 11:38:16 -0400 Date: Sat, 11 Jul 1998 11:38:12 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@sparky8 To: Jonny cc: hackers@FreeBSD.ORG Subject: Re: Assembly.. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I myself do not fully understand the details of the system call mechanism. But I think the following two sources might be of help: (1) Dr. Dobb's Journal March 1998 - Benchmarking and Software Testing, Tracing BSD System Calls, by Sean Eric Fagan (2) http://www.x86.org/intel.doc/P2Manuals.html, Intel Architecture Software Developer's Manual, Volume 3: System Programming Guide -------------------------------------------------- | Zhihui Zhang, http://cs.binghamton.edu/~zzhang | | Dept. of Computer Science, SUNY at Binghamton | -------------------------------------------------- On Sat, 11 Jul 1998, Jonny wrote: > > Hi, im having a bit of a problem understanding the way > freebsd does its syscalls in asm.. ive searched, and > read the as info pages numerous times, and looked over > kernel src, along with compiling simple C code with -S -o blah.s > i was told fbsd uses 'call gates' so that where linux would do > > movl $1,%eax // exit() syscall in linux > movl $0,%ebx // exit code > int $0x80 // do the syscall > > i was told fbsd is similar > only where linux does the interrupt it would do a call ie; > > call 0x7,0x0 > > which gives me errors from as (no known i386 instructions) > > i understand i could do the 'call syscallName' but i want > a thorough understanding on how these ' call gates' work.. > if someone could explain a bit how they work and are called.. > and provide me a sample standalone asm code .. heck 'hello world' > for that matter.. i would greatly appreciate it. > > thanx in advance. > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message