From owner-freebsd-hackers@FreeBSD.ORG Sat May 11 18:59:35 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 69AA1C01 for ; Sat, 11 May 2013 18:59:35 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-oa0-f43.google.com (mail-oa0-f43.google.com [209.85.219.43]) by mx1.freebsd.org (Postfix) with ESMTP id 3B235383 for ; Sat, 11 May 2013 18:59:34 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id o6so6155158oag.2 for ; Sat, 11 May 2013 11:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=xk8R6ACUr3AHUh91h7CKf58WO0eV3SGkqVeIqDa4mnY=; b=nYdw0eLkMSWe2Xwuz0CSvzW5GVE7woBrFoaXJu8oCr3YbKDCK2WhoAo/RvbXQVffq4 OHtfKQWaDX/S/gsV/NOQkWl1SMir9InDCwDM5HyyWfBIePxfBnevjl9zb29FKpsRAkHa XI/kUv1+A+m1Afe9LtQK4PfC/lciwsFhqHmnl5uxEAs/rQm00JLnRXQZeQBmD/qYourW Oj3yfZrkZAwC0iFQ9MtpRr0ME7rdD3qMyF4ux43fSy2iU/DsYjBf+Va9+uQMklxCKy9i msRDFpxbdQzcYjO9zFFAUAR61QIU2N+ZtUbQe+z4szXfLjc8Ofns5J0/wmRQ/GBhxSHL LErg== MIME-Version: 1.0 X-Received: by 10.60.125.232 with SMTP id mt8mr3508676oeb.33.1368298774384; Sat, 11 May 2013 11:59:34 -0700 (PDT) Received: by 10.182.161.100 with HTTP; Sat, 11 May 2013 11:59:34 -0700 (PDT) In-Reply-To: <518E7B1E.9050704@mu.org> References: <1368214284.29611.YahooMailNeo@web171503.mail.ir2.yahoo.com> <518D4C4F.90902@mu.org> <1368260611.67320.YahooMailNeo@web171505.mail.ir2.yahoo.com> <518E7B1E.9050704@mu.org> Date: Sat, 11 May 2013 20:59:34 +0200 Message-ID: Subject: Re: syscall to userland interface From: Oliver Pinter To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 18:59:35 -0000 On 5/11/13, Alfred Perlstein wrote: > On 5/11/13 1:23 AM, Karl Dreger wrote: >> >> I am feeling rather stupid at the moment, but I can't find the assembler >> >> files that you are referring to. Do you mean that every syscall under >> >> sys/kern/*.c has a corresponding .S file in src/lib/libc/? > > Nope, the .S files are under the object directory: > >> When you build the system a whole bunch of assembler files are >> automatically generated that define the functions you are looking for. >> >> Look for .S files under the object directory. >> >> Those assembler files have the magic to cause a system call to happen. >> >> example: src/lib/libc/getauid.S (note, this file is GENERATED, it's not >> part of src.) > > > >> >> >> The actual transition from user to kernelland and back probably takes >> >> place via the assembler routines in sys/i386/i386. Most notably >> exception.s >> >> for my i386 cpu. >> >> >> What my question boils down to is this: when running fork and friends >> >> from userland they are invoked as: >> >> fork();, open();, read();, close(); ... >> >> >> but are defined as: >> >> sys_fork(), sys_open(), sys_read(), sys_close(), ... >> >> in their actual c definition. >> >> If the assembler files that you spoke about answer this discrepancy, >> >> then the reason why the penny hasn't dropped yet is because I haven't >> found them. >> >> > Again, they are generated as part of build. You will NOT find them > during a checkout. cd /usr/obj/*/lib/libc/ ls *.S > > -Alfred > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >