From mboxrd@z Thu Jan 1 00:00:00 1970 From: pnr@planet.nl (Paul Ruizendaal) Date: Tue, 14 Feb 2017 15:35:46 +0100 Subject: [TUHS] Another odd comment in V6 In-Reply-To: <20170214141424.A5BC518C0A2@mercury.lcs.mit.edu> References: <20170214141424.A5BC518C0A2@mercury.lcs.mit.edu> Message-ID: <9D5768C7-995F-4C38-A316-E2B8F43E710F@planet.nl> On 14 Feb 2017, at 15:14 , Noel Chiappa wrote: >> From: Paul Ruizendaal > >> Actually, research Unix does save the complete state of a process and >> could back up the PC. The reason that it doesn't work is in the syscall >> API design, using registers to pass values etc. If all values were >> passed on the stack it would work. > > Sorry, I don't follow this? > > The problem with 'backing up the PC' is that you 'sort of' have to restore the > arguments to the state they were in at the time the system call was first > made. This is actually easier if the arguments are in registers. Yeah, you're right. I was thinking of the 2.9BSD code which only does the backup in certain cases and when stack parameter mode was used (the 0200 bit), but stating it like I did is indeed incomplete to say the least. Another difficulty in stock V6 would be code like this: http://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/s4/chmod.s where the data at label 9: could be overwritten by a signal handler and re-executing the sys call would not work as intended.