Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!lll-lcc!pyramid!prls!mips!mash From: mash@mips.UUCP Newsgroups: comp.arch Subject: Re: catering to bad code Message-ID: <7@winchester.mips.UUCP> Date: Sat, 21-Feb-87 21:01:02 EST Article-I.D.: winchest.7 Posted: Sat Feb 21 21:01:02 1987 Date-Received: Sun, 22-Feb-87 10:39:34 EST References: <14833@amdcad.UUCP> <554@aw.sei.cmu.edu.sei.cmu.edu> Reply-To: mash@winchester.UUCP (John Mashey) Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 34 In article <14833@amdcad.UUCP> phil@amdcad.UUCP (Phil Ngai) writes: >In a Unix system I am designing, I am considering catering to bad >code. That is, like the VAX I propose to make location 0 contain a >readable 0. I think that code which gets ported to a Sun machine often >has to have this kind of thing cleaned up. .... [followed by many articles, mostly against allowing zero in there, with a few allowing the option.] 1) At MIPS we left 0 out of the process image, for all the reasons that others have cited, although the next version has a ld option to move text to 0, just in case. However, on at least some machines you might be able to write a SIGSEGV catcher that stepped past the offending instruction [which after all, can't be right], or maybe even stuck a zero in the right register. Doing this implies the need to semi-interpret the offending instruction and bump the PC past it. This is anything from trivial to difficult, depending on the machine, but is at least a possibility for someone who doesn't control the OS on their machine, or has one whose architecture doesn't have a zero location in user space at all. 2) The discussion reminds me of a similar effect that happened somewhere around 1970. At Penn State, we were switching from a 360/67 to a 370/165. 360's required data items to be placed on natural boundaries [words on words, halfwords on halfwords, etc]. If you disobeyed you got a specification exception. 370's don't make that restriction. People at our computer center, as I recall, actually requested a price from IBM to get our 370 modified to restore the boundary requirement, because they'd found that in the (large number of) bugs they'd reported to IBM, SOMETHING LIKE 30-40% HAD FIRST SHOWN UP AS SPECIFICATION ERRORS! (We didn't get this feature, but people tried.) -- -john mashey DISCLAIMER: UUCP: {decvax,ucbvax,ihnp4}!decwrl!mips!mash, DDD: 408-720-1700, x253 USPS: MIPS Computer Systems, 930 E. Arques, Sunnyvale, CA 94086