Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 Jun 1999 12:25:17 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        gallatin@cs.duke.edu
Cc:        pornin@bolet.ens.fr, freebsd-alpha@FreeBSD.ORG
Subject:   OSF/1 emulation (Re: Compiling XFree on an alpha..)
Message-ID:  <14171.15261.616728.29321F@ett.sat.t.u-tokyo.ac.jp>
In-Reply-To: In your message of "Mon,  3 May 1999 10:04:37 -0400 (EDT)" <14125.44049.845050.285497@grasshopper.cs.duke.edu>
References:  <19990503083942.B20136@bolet.ens.fr> <199905021908.MAA19491@mail.cybcon.com> <Pine.BSF.4.05.9905022031590.555-100000@herring.nlsystems.com> <14125.44049.845050.285497@grasshopper.cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
At Mon,  3 May 1999 10:04:37 -0400 (EDT),
Andrew Gallatin <gallatin@cs.duke.edu> wrote:
> 
> 
> 
> Thomas Pornin writes:
>  > On Sun, May 02, 1999 at 08:32:47PM +0100, Doug Rabson wrote:
>  > > Fair enough. I don't think XF86Setup and netscape work with Linux/alpha
>  > > either...
>  > 
>  > I do not know for XF86Setup (my first XFree installation was back in
>  > the days where XF86Setup did not exist, and the Xconfigure thing would
>  > not work, therefore I write XF86Config by hand) but you may run the OSF
>  > Netscape on Linux/Alpha. I have a fully functional Communicator 4.51
>  > and it is stable. This requires the OSF shared libs, though (or maybe
> 
> FreeBSD is also capable of running Netscape, and other DU binaries
> such as Mathematica and S-Plus under the osf/1 compatibility module.
> You can fetch it from: ftp://ftp.cs.duke.edu/pub/gallatin/osf1.tar.gz
> 
> Be warned that I haven't had much time to play with it since December, 
> so it might need a little tweaking to get it working again with
> -current. 
> 
> ------------------------------------------------------------------------------
> Andrew Gallatin, Sr Systems Programmer	http://www.cs.duke.edu/~gallatin
> Duke University				Email: gallatin@cs.duke.edu
> Department of Computer Science		Phone: (919) 660-6590

Here is a patch for -current.

Do you have a plan to commit this module to the tree?
It must be nice to have it by default.
Once it's commited, I'd like to implement FP control function.

-- 
/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp

diff -ru sys/alpha/osf1/imgact_osf1.c /sys/alpha/osf1/imgact_osf1.c
--- sys/alpha/osf1/imgact_osf1.c	Fri Jan  1 03:08:05 1999
+++ /sys/alpha/osf1/imgact_osf1.c	Wed May 12 14:17:43 1999
@@ -78,8 +78,8 @@
 static int
 exec_osf1_imgact(struct image_params *imgp)
 {
-	struct ecoff_exechdr *execp = (struct ecoff_exechdr*)imgp->image_header;
-        struct ecoff_aouthdr *eap = &execp->a;
+	const struct ecoff_exechdr *execp = (const struct ecoff_exechdr*)imgp->image_header;
+	const struct ecoff_aouthdr *eap = &execp->a;
         struct vmspace *vmspace;
 	int error,path_not_saved;
         vm_offset_t  taddr;
@@ -133,9 +133,9 @@
 		       UIO_SYSSPACE, "/compat/osf1/sbin/loader", imgp->proc);
 		error = namei(ndp);
 		if(error){
-			printf("imgact_osf1: err = %d, unable to find /compat/osf1/sbin/loader",error);
+			printf("imgact_osf1: err = %d, unable to find /compat/osf1/sbin/loader\n",error);
 			free(imgp->auxargs, M_TEMP);
-			return(0);
+			return(error);
 		} 
 		if (imgp->vp) {
 			vrele(imgp->vp);
@@ -147,7 +147,7 @@
 		osf_auxargs->loader = "/compat/osf1/sbin/loader";
 	}
 
-	execp = (struct ecoff_exechdr*)imgp->image_header;
+	execp = (const struct ecoff_exechdr*)imgp->image_header;
         eap = &execp->a;
 	taddr = ECOFF_SEGMENT_ALIGN(execp, eap->text_start);
 	tend  = round_page(eap->text_start + eap->tsize);
@@ -191,27 +191,27 @@
         imgp->vp->v_flag |= VTEXT;
 
 	/* set up text segment */
-	if(error = vm_mmap(&vmspace->vm_map, &taddr, tsize,
+	if((error = vm_mmap(&vmspace->vm_map, &taddr, tsize,
 			   VM_PROT_READ|VM_PROT_EXECUTE, VM_PROT_ALL, MAP_FIXED|MAP_COPY, 
-			   (caddr_t)imgp->vp, ECOFF_TXTOFF(execp))){
+			   (caddr_t)imgp->vp, ECOFF_TXTOFF(execp)))){
 		DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error));
                 return error;
 	}
 	/* .. data .. */
-	if(error = vm_mmap(&vmspace->vm_map, &daddr, dsize,
+	if((error = vm_mmap(&vmspace->vm_map, &daddr, dsize,
 			   VM_PROT_READ|VM_PROT_EXECUTE|VM_PROT_WRITE,
 			   VM_PROT_ALL, MAP_FIXED|MAP_COPY, 
-			   (caddr_t)imgp->vp, ECOFF_DATOFF(execp))){
+			   (caddr_t)imgp->vp, ECOFF_DATOFF(execp)))){
 		DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error));
 		goto bail;
 	}	
 	/* .. bss .. */
 	if(round_page(bsize)){
 		baddr = trunc_page(dend);
-		if(error = vm_map_find(&vmspace->vm_map, NULL, (vm_offset_t) 0, &baddr, 
+		if((error = vm_map_find(&vmspace->vm_map, NULL, (vm_offset_t) 0, &baddr, 
 				       round_page(bsize), FALSE,
 				       VM_PROT_READ|VM_PROT_EXECUTE|VM_PROT_WRITE,
-				       VM_PROT_ALL, FALSE)){
+				       VM_PROT_ALL, FALSE))){
 			DPRINTF(("%s(%d): error = %d\n", __FILE__, __LINE__, error));
 			goto bail;
 
@@ -223,8 +223,8 @@
 	if(dend > raw_dend){
 		caddr_t zeros = malloc(dend-raw_dend,M_TEMP,M_WAITOK);
 		bzero(zeros,dend-raw_dend);
-		if(error = copyout(zeros, (caddr_t)raw_dend,
-			   dend-raw_dend)){
+		if((error = copyout(zeros, (caddr_t)raw_dend,
+			   dend-raw_dend))){
 			printf("Can't zero start of bss, error %d\n",error);
 			free(zeros,M_TEMP);
 			goto bail;
@@ -252,5 +252,5 @@
  * Since `const' objects end up in the text segment, EXEC_SET is the
  * correct directive to use.  Do not staticize; used by OSF1 LKM.
  */
-const struct execsw osf1_execsw = { exec_osf1_imgact, "Alpha OSF/1 ecoff" };
+struct execsw osf1_execsw = { exec_osf1_imgact, "Alpha OSF/1 ecoff" };
 EXEC_SET(execsw_set, osf1_execsw);
diff -ru sys/alpha/osf1/osf1_misc.c /sys/alpha/osf1/osf1_misc.c
--- sys/alpha/osf1/osf1_misc.c	Fri Jan  1 04:28:47 1999
+++ /sys/alpha/osf1/osf1_misc.c	Wed May 12 14:15:14 1999
@@ -830,7 +830,7 @@
 	uid_t uid = SCARG(uap, uid);
 	int error;
 
-	if ((error = suser(pc->pc_ucred, &p->p_acflag)) != 0 &&
+	if ((error = suser(p)) != 0 &&
 	    uid != pc->p_ruid && uid != pc->p_svuid)
 		return (error);
 
@@ -862,7 +862,7 @@
 	gid_t gid = SCARG(uap, gid);
 	int error;
 
-	if ((error = suser(pc->pc_ucred, &p->p_acflag)) != 0 &&
+	if ((error = suser(p)) != 0 &&
 	    gid != pc->p_rgid && gid != pc->p_svgid)
 		return (error);
 
@@ -1175,11 +1175,11 @@
 		struct osf1_timeval otv;
 		struct timeval tv;
 		int error;
-		if(error=copyin((caddr_t)uap->tv,(caddr_t)&otv,sizeof(otv)))
+		if((error=copyin((caddr_t)uap->tv,(caddr_t)&otv,sizeof(otv))))
 			return(error);
 		TV_CP(otv,tv);
 		uap->tv = stackgap_alloc(&sg, sizeof(struct timeval));
-		if(error=copyout((caddr_t)&tv, (caddr_t)uap->tv,sizeof(tv)))
+		if((error=copyout((caddr_t)&tv, (caddr_t)uap->tv,sizeof(tv))))
 			return(error);
 	}
 	return(select(p, (struct select_args *)uap));
@@ -1197,23 +1197,23 @@
 	int error = 0;
 	caddr_t sg = stackgap_init();
 
-	if(error = copyin((caddr_t)uap->itv,(caddr_t)&otv,sizeof(otv))){
+	if((error = copyin((caddr_t)uap->itv,(caddr_t)&otv,sizeof(otv)))){
 		printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
 		return error;
 	}
 	TV_CP(otv.it_interval,itv.it_interval);
 	TV_CP(otv.it_value,itv.it_value);
 	uap->itv = stackgap_alloc(&sg, sizeof(struct itimerval));
-	if(error = copyout((caddr_t)&itv,(caddr_t)uap->itv,sizeof(itv))){
+	if((error = copyout((caddr_t)&itv,(caddr_t)uap->itv,sizeof(itv)))){
 		printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
 		return error;
 	}
 	uap->oitv = stackgap_alloc(&sg, sizeof(struct itimerval));
-	if(error = setitimer(p, (struct setitimer_args *)uap)){
+	if((error = setitimer(p, (struct setitimer_args *)uap))){
 		printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
 		return error;
 	}
-	if(error = copyin((caddr_t)uap->oitv,(caddr_t)&itv,sizeof(itv))){
+	if((error = copyin((caddr_t)uap->oitv,(caddr_t)&itv,sizeof(itv)))){
 		printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
 		return error;
 	}
@@ -1236,17 +1236,17 @@
 	caddr_t sg = stackgap_init();
 
 	uap->itv = stackgap_alloc(&sg, sizeof(struct itimerval));
-	if(error = getitimer(p, (struct getitimer_args *)uap)){
+	if((error = getitimer(p, (struct getitimer_args *)uap))){
 		printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
 		return error;
 	}
-	if(error = copyin((caddr_t)uap->itv,(caddr_t)&itv,sizeof(itv))){
+	if((error = copyin((caddr_t)uap->itv,(caddr_t)&itv,sizeof(itv)))){
 		printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
 		return error;
 	}
 	TV_CP(itv.it_interval,otv.it_interval);
 	TV_CP(itv.it_value,otv.it_value);
-	if(error = copyout((caddr_t)&otv, old_itv, sizeof(otv))){
+	if((error = copyout((caddr_t)&otv, old_itv, sizeof(otv)))){
 		printf("%s(%d): error = %d\n", __FILE__, __LINE__, error);
 	}
 	return error;
diff -ru sys/alpha/osf1/osf1_signal.c /sys/alpha/osf1/osf1_signal.c
--- sys/alpha/osf1/osf1_signal.c	Fri Jan  1 04:31:50 1999
+++ /sys/alpha/osf1/osf1_signal.c	Tue May 11 01:39:24 1999
@@ -616,7 +616,7 @@
 	/*
 	 * Allocate and validate space for the signal handler
 	 * context. Note that if the stack is in P0 space, the
-	 * call to grow() is a nop, and the useracc() check
+	 * call to grow_stack() is a nop, and the useracc() check
 	 * will fail if the process has not already allocated
 	 * the space with a `brk'.
 	 */
@@ -628,7 +628,7 @@
 	} else
 		scp = (struct sigcontext *)(alpha_pal_rdusp() - rndfsize);
 	if ((u_long)scp <= USRSTACK - ctob(p->p_vmspace->vm_ssize))
-		(void)grow(p, (u_long)scp);
+		(void)grow_stack(p, (u_long)scp);
 #ifdef DEBUG
 	if (sigdbg)
 		printf("sendsig(%d): sig %d ssp %p usp %p\n", p->p_pid,


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14171.15261.616728.29321F>