From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVr3e-0006wX-8Q for qemu-devel@nongnu.org; Sat, 07 Feb 2009 12:33:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVr3c-0006vK-2C for qemu-devel@nongnu.org; Sat, 07 Feb 2009 12:33:33 -0500 Received: from [199.232.76.173] (port=57324 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVr3b-0006vH-Rq for qemu-devel@nongnu.org; Sat, 07 Feb 2009 12:33:31 -0500 Received: from rv-out-0506.google.com ([209.85.198.239]:26503) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LVr3b-0000mY-IU for qemu-devel@nongnu.org; Sat, 07 Feb 2009 12:33:31 -0500 Received: by rv-out-0506.google.com with SMTP id g9so864602rvb.2 for ; Sat, 07 Feb 2009 09:33:29 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: Date: Sun, 8 Feb 2009 00:33:29 +0700 Message-ID: Subject: Re: [Qemu-devel] question about syscall From: Mulyadi Santosa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi On Sat, Feb 7, 2009 at 8:15 PM, Antonio Ricci wrote: > Hi all, > i'd want to understand how Qemu handles system calls while executing both > Linux and Windows operating system. I've searched on the web with no > results. > Do you know if there is some documentation about syscall handling in Qemu? > Thanks in advance for help I assume you ask about full system emulation. Try to check how Qemu intercept int 80h or SYSENTER/SYSCALL instruction (if the guest OS is Linux). Not sure what Windows does when doing system call, maybe by executing int instruction toward certain vectors too. As usual, related interrupt handler will be executed (and translated). So from Qemu point of view, it's strictly a matter of intercepting code and translating it. It's the guest OS that does the real work on syscall handling. In user space emulation only, system call is intercepted by the normal dynamic code translation, but syscall is handled by syscall() C function. The complication could arise if the guest OS is not the same type as the host OS. Some "interpretations" are needed here. regards, Mulyadi.