site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=jw+bBWkHOSKvI9zGwLGHIH6vudR2vIeeem6q1JfoblT3cOZn8I8WXI5DVWcCUGQTa0cz+0XoAsHZE2smf5r0EEVO3vZfgpjLuIon0DBEmXzTo45tqqQrP+wmnZDmuzDfnO6I6xB7LZ/4a14oBlIj3v6AbfoR3SG3KhjBx+4WSEs= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=fDRUO/DI2Czn+wMIS5VyZiXtwMnzSikVwv9tJPqUIsORRh3mTMzHxNx4BKw210I8clF/mJAp1PfhhO7njF+oeyCzttw9+qQnvHM2eB/AY3jIytFQEs1TFDodrw7SSGB8cqR4r2q6csqb6o5CNJxPzZrnDqx3Gef3wQdpuFNtobY= Thank you very much, now it runs :D I have now another problem. sysenter_trap: put the esp in ecx sysenter Am I doing anything wrong? Thanks for the help Filipe Cabecinhas On 18 Mar, 2007, at 07:50, Geoffrey Lee wrote: The question is: how does darwin know where is the entry point of the binary and how can I choose it? Use -e flag in ld(1). It is actually stored in the thread state, the kernel loads this thread state when the binary is loaded, you can see for yourself with otool -l, srr0 on ppc and eip on 32bit x86. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... As far as I could see (by going through the source of Darwin, when I want to call a system call directly (I can't link the output of my compiler with the libc, I have to link it with my run-time library) I should do the following: push the arguments to the stack(for example (write): push nbytes, push str, push fd) set eax to the system call number (4) call __sysenter_trap I think I should call the trap so the system call has an address to return to, right? But my problem is, when I return from sysenter, it goes to a weird position instead of going to the address after the call __sysenter_trap. - gl This email sent to site_archiver@lists.apple.com
participants (1)
-
Filipe Cabecinhas