Subject: PMAX obreak() syscall problems
To: None <glass@sun-lamp.cs.berkeley.edu, port-pmax@sun-lamp.cs.berkeley.edu>
From: Arne H Juul <arnej@dsl.unit.no>
List: port-pmax
Date: 08/01/1994 14:32:56
Since I had a weekend off here in Trondheim, I suddenly decided to try
how far I could get the NetBSD/pmax port going on a DECstation-3100 we
have here (normally running DEC/OSF 1.0). I also got some help from
Tor Egge, so I felt we should try.

So I followed Adam Glass's instructions, and lo and behold, the # prompt!
But, as he also said, most things didn't work. By inserting lots of
debugging printf's in addition to the syscall tracing, we found at least
two major problems: The obreak() syscall didn't seem to work, and also
programs wanted to call ultrix syscall #256 (getsysinfo) to start. The
first problem stems from the exec_ecoff module, where the original data
segment size (or rather, original break value) didn't take into account
the bss segment. The second we fixed by implementing a stub getsysinfo/
setsysinfo so programs think they work (actually the getsysinfo
implementation here could be argued to be strictly in conformance with
documentation, implementing just one op and returning unavailable on
all others).

I'm including the first (important) diff here, another in my next
message.

   - gratefully yours,
     Arne H. Juul

*** org/exec_ecoff.c	Mon Aug  1 14:30:33 1994
--- sys/kern/exec_ecoff.c	Mon Aug  1 14:31:23 1994
***************
*** 166,172 ****
  	epp->ep_taddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_text_start);
  	epp->ep_tsize = eap->ea_tsize;
  	epp->ep_daddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_data_start);
! 	epp->ep_dsize = eap->ea_dsize;
  	epp->ep_entry = eap->ea_entry;
  
  	/* set up command for text and data segments */
--- 166,172 ----
  	epp->ep_taddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_text_start);
  	epp->ep_tsize = eap->ea_tsize;
  	epp->ep_daddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_data_start);
! 	epp->ep_dsize = eap->ea_dsize + eap->ea_bsize;
  	epp->ep_entry = eap->ea_entry;
  
  	/* set up command for text and data segments */
***************
*** 200,206 ****
  	epp->ep_taddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_text_start);
  	epp->ep_tsize = eap->ea_tsize;
  	epp->ep_daddr = ECOFF_ROUND(eap->ea_data_start, ECOFF_LDPGSZ);
! 	epp->ep_dsize = eap->ea_dsize;
  	epp->ep_entry = eap->ea_entry;
  
  	/* set up command for text segment */
--- 200,206 ----
  	epp->ep_taddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_text_start);
  	epp->ep_tsize = eap->ea_tsize;
  	epp->ep_daddr = ECOFF_ROUND(eap->ea_data_start, ECOFF_LDPGSZ);
! 	epp->ep_dsize = eap->ea_dsize + eap->ea_bsize;
  	epp->ep_entry = eap->ea_entry;
  
  	/* set up command for text segment */
***************
*** 243,249 ****
  	epp->ep_taddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_text_start);
  	epp->ep_tsize = eap->ea_tsize;
  	epp->ep_daddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_data_start);
! 	epp->ep_dsize = eap->ea_dsize;
  	epp->ep_entry = eap->ea_entry;
  
  	/*
--- 243,249 ----
  	epp->ep_taddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_text_start);
  	epp->ep_tsize = eap->ea_tsize;
  	epp->ep_daddr = ECOFF_SEGMENT_ALIGN(eap, eap->ea_data_start);
! 	epp->ep_dsize = eap->ea_dsize + eap->ea_bsize;
  	epp->ep_entry = eap->ea_entry;
  
  	/*

------------------------------------------------------------------------------