From owner-freebsd-hackers Wed Jul 10 8:39:18 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3A3D37B400 for ; Wed, 10 Jul 2002 08:39:13 -0700 (PDT) Received: from mail.speakeasy.net (mail17.speakeasy.net [216.254.0.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C9C843E58 for ; Wed, 10 Jul 2002 08:39:13 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 26035 invoked from network); 10 Jul 2002 15:39:12 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail17.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 10 Jul 2002 15:39:12 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g6AFdA001474; Wed, 10 Jul 2002 11:39:10 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200207101554.09734.tzukanov@narod.ru> Date: Wed, 10 Jul 2002 11:39:15 -0400 (EDT) From: John Baldwin To: Serguei Tzukanov Subject: RE: A question about S/390 port Cc: freebsd-hackers@freebsd.org, freebsd-platforms@freebsd.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 10-Jul-2002 Serguei Tzukanov wrote: > Some working notes. > > I've written the libc/csu part, kernel successfully starts init and init > forks off for the execve of -sh, > (http://tzukanov.narod.ru/freebsd390/bootlog.txt) > but there is problem with printing from userland, e.g. output from > userland are not visible. Write syscall to descs 1,2 in init returns > with success. > I'm sure it's something very stupid, so maybe someone have a clue? > > And another problem (well-known?): > __syscall returns 64-bit value but mmap returns 4-byte word in the > td->td_retval[0]. Wrapper for mmap in libc casts 64 rv to 32 and alays > gets zero. This leads to truncating to zero due to cast on 32-bit > big-endian architectures. > The solution is obvious - using constructs like > td->td_retval[_QUAD_LOWWORD] = xxx in MI code. > > For now I just avoid it with hack in syscall handler. td_retval[0] is the low word, and td_retval[1] is the high word, you just need to make sure the values from those two words get returned properly to userland. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message