Early days of Unix and design of sh

5 views

Formal Metadata

Title
Early days of Unix and design of sh
Title of Series
Author
Bourne, Stephen R.
License
CC Attribution - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this license.
DOI
Publisher
Berkeley System Distribution (BSD), Andrea Ross
Release Date
2015
Language
English

Content Metadata

Subject Area
Loading...
Computer animation Queue (abstract data type)
Computer programming Building Machine code Variety (linguistics) Multiplication sign Virtual machine Compiler Computer Formal language Video game Electronic visual display Game theory Physical system Code Nominal number Orbit Spring (hydrology) Algebra Computer animation Visualization (computer graphics) Software Logic Spherical cap Order (biology) Differential equation Family Physical system
NP-hard Context awareness State of matter Scientific modelling Source code Home page Interface (computing) Disk read-and-write head Discrete group Mereology Variable (mathematics) Data model Kernel (computing) Electronic visual display Physical system Metropolitan area network Hidden surface determination Process (computing) Software developer Computer file Bit Portable communications device Physical system Fundamental theorem of algebra Modem Point (geometry) Web page Slide rule Maxima and minima Feedback Electronic program guide Directory service Revision control String (computer science) Software testing MiniDisc Surface Projective plane Line (geometry) Binary file Local Group Table (information) Peer-to-peer Subject indexing Computer animation Software Computer network Device driver Gastropod shell Window
Web page Metropolitan area network Computer icon Computer animation Electronic mailing list Kerr-Lösung Gamma function Physical system Library (computing)
Read-only memory Computer file Multiplication sign Tape drive ACID Virtual machine Drop (liquid) Computer Power (physics) Plane (geometry) Virtual memory Causality Read-only memory File system Gastropod shell Operating system Cuboid Traffic reporting Metropolitan area network Physical system Metropolitan area network Boss Corporation Addition Computer Computer file Electronic mailing list Staff (military) 3 (number) Bit Local Group Internet forum Radical (chemistry) Inversion (music) Computer simulation Computer animation Surreal number Data management Window
Code Ferry Corsten Length Multiplication sign Decision theory Mathematical singularity Source code Sheaf (mathematics) 1 (number) Bell and Howell Interface (computing) Mereology Storage area network Variable (mathematics) Formal language Daylight saving time Algebra Multiplication Physical system Exception handling Metropolitan area network Programming language Product (category theory) Process (computing) Constraint (mathematics) Interface (computing) Bit Variable (mathematics) Lattice (order) Buffer solution output Right angle Data type Data management Resultant Point (geometry) Dataflow Computer programming Read-only memory Game controller Random number generation Computer file Patch (Unix) Typinferenz Virtual machine Mass Regular graph Event horizon Code Rule of inference Revision control Data management Social class Read-only memory String (computer science) Utility software Gastropod shell Computer worm Data structure Implementation Computer-assisted translation Booting Standard deviation Scripting language Expression Memory management Division (mathematics) Limit (category theory) Local Group Residual (numerical analysis) Computer animation Revision control Statement (computer science) Iteration Gastropod shell Game theory Form (programming)
Web page Read-only memory Group action Context awareness Computer file Fehlererkennungscode Multiplication sign Virtual machine Auto mechanic Electronic mailing list Theory Variable (mathematics) Software bug Data management Spring (hydrology) String (computer science) Gastropod shell Pattern language Loop (music) Units of measurement Hydraulic jump Game controller Metropolitan area network Product (category theory) Data recovery Forcing (mathematics) Electronic mailing list Expert system Memory management Port scanner Open set Loop (music) Computer animation Personal digital assistant Pattern language Gastropod shell Quicksort Data management Row (database)
Web page Dataflow Game controller Multiplication sign Mathematical singularity Memory management Syntaxbaum Parsing Stack (abstract data type) Variable (mathematics) Variable (mathematics) Word Computer animation Network topology Term (mathematics) Permanent Memory management Representation (politics) Object (grammar) Reading (process) Physical system
and it says here I'm I've been doing nothing useful rather just for the last 15 years and before that I was doing things a lot of useful and as it says also assume Q is the magazine that Georgian and therefore if you of the other people help out with so they start
this this talk is mostly about things I did once upon a time and then about things we're doing today and mostly about why we did and what we will do it again next time I got to and by the way is a nominal are counter in the room is in is because I do want some of my my friends and said to me than nominal when you're in front of people so I want somebody where and when I do I'm not I got a Bell Labs was in Cambridge for a 10 years before I got the labs automated in the background so you can understand why did some things added the Azeri Wilson Willowbrook's invented by proposed work we're and it's orbiting so it's kind of cool be around those guys in those days the year I started life building over systems so we can solve the differential equations for the moon orbit which is a lot of fun except we don't have accessible language variety all machine code and we started designing our own language which is called the Little z was the language and actually just as a side story we actually reported said to a PDP 7 with the 340 display and that's how Conway got the visualization for his life originally so and as he was designed and common wisdom domestication of 1 of the guys who was on the order of 68 progerin me my guy he was the repetition to so common to come visit my family play with this thing so as we call of love from the I spent 5 years in Cambridge foraging developed on writing our 68 environmental from 2 it's still works for what it's worth I arrived in Maryville and 75 on and I do wanna show you want thing
way do this when I that the mathematical logic was formed in Cambridge in those days was actually computer laboratory which is and you have at most as many as we actually have these machines are an effective still 1 and it's in pieces of put 1 of these things work together again to from senior out with actually to be honest I think I lost 1 of the spring but maybe we can find a spring for it anyway just keep going at this story about this is that Jason Miller was some famous numerical analysts according is used to race people right he would try to write a program and you do on his machines or differential equation and he'd say I'd be the 1st time you bring in a 2nd time because the software was written for the 2nd time but the 1st time you could actually be machines doing anyway and that so
I got to balance and 75 and then we were around the in the unit true under from my glasses on if you don't want to consumer slides and some of this is in in the history books and I don't really wanna go over too much except to set the context what we doing and the best version of this if you're interested or if you're ready if you can write this stuff is the retrospective that Dennis Ritchie Road which you can easily grow online or whatever you wanna do the whole project was funded by and often tear-off which was text processing system that was used in the lab and that's how have they got the money and you can see from the most you probably know this this and some of what the state of the system was in those days I wanna say a little bit the
choosing I was a little bit about the key players in the but then it's obvious you know about that I was that use during so you might drivers can was mostly from a guide dog I was applied I know that but that was also kind of but he was the lights noble and stuff like that and he was in String Processing and substrings things those all the work done on that with him and properly organized and in a dog was always some had some extensible save him and also about stuff Joe legend and of the he died 77 actually deal with and often to yourself and you know about Brian by did TBL acts and stuff like that so there's a lot going on in the and the development situation was actually from the from the we went to rooms to edit rooms no windows and reconditioning around stuff in tables I would say those typically 15 guys and the room maybe 10 15 and then we had a PDP 11 45 model for the 33 Teletypes the fun part of it was we had to try 40 14 displays which the different if you're a single mothers but as you recall from and they were affected display and you could of users you see from pages to your house but only if the network is known as the reason that most original this is in the seventies believed it had been using we did have UUCP running and that was something that might mustard and the and you see the red over their profitable motives up to the world so was the thing about him was important this is when we would write a piece of software or change a piece of software it would get deployed in the room where every research and I'm the what you found out pretty quickly and work presented you up and so on and so but the point is that you you a personal reputation was personally accountable for what you're doing right there with your peers and so if you screwed up so you careful about testing of software for you put out even to that small groups and I'm I run a bunch of engineering group since then and tried to instill the idea of people that you're actually personally accountable for the software you write that works sometimes was or what we have the source fundamental pages on-line manual pages will will recall in those days these days manual pages of hard work consists many of them of the minimization you can actually read the banner pages to figure out what's going on the head nouns and verbs in it so you could figure out what announcement and what those 2 so that that was very cool in those days and maybe some of the manual pages these data OK but was aware that all the other stories I don't have a picture of an hour purified this but it's like a more finishing with the top surface on it and you pull the car out and 1 day somebody I think it's can somebody still some coffee and that's in the discretion was happy this so the next day they are purified just haven't signed on on the flat part of this this is a vertical surface it follows from the 6th edition so this is 1975 we talk about written Seidel 40 system calls the great man pages 20 line you can read it to work both fj and the rest of it you can see it's the same I just wanna show you this is but a final like to show this but this is the use of these this is the index to the manual so this page 1 and
is going to go to the Soviet Union you to read or you know what it says
is page 2 were already passed the commands no for you about in this system calls well
subroutines see like C library might see it was when list and wonder would then have near
and a special files staff knows it because the man that was the next to
the manual so wasn't complicated and most of that stuff is survived as you know some of the most it's about 72 about some of addition this is really a timeline here 776 multiple story in a minute how we got to doing this we wrote the show on the road ABB 77 make linear and all showed up and UUCP was already there so they reduce the 32 reports is just like a snapshot of what happens and I'm going to get corrected him biker from sure but I'm I'm pretty sure the Berkeley got involved in the 6th edition to I think you took 6 edition plane that run on 11 what we did anyway so but then we do the 3rd report and publish 7th edition of through the file system by another talked about that I do wanna talk a little bit about what happened in them so Bill Joy called up 1 day and this is in seventies 7 I think about this civil I wanna put this stuff in the show we put emission lines life history and drop drop surrealism really belong in the shell in really belongs in in in the terminal window manager or whatever you wanna call it doesn't really belong in the shell so this year and on the anyway so yeah so you that's another seashell have the UN and often that people which is just fine and of course we have the i and stuff like that and the other story about them this is the this time 1980 was when I was a lad I divided below which you will talk or something that you know was later if we could retrieve probably got lost and which is typical of the and here he got there and we need that so often talk he he died and his bag of taken big old tapes so what's on that said that gives the 3 . 0 or something and he said the acid is does inversion and the oxygen so I was running a computer group then I have to evolve excellence and made that times 1980 and we're running list and we didn't have virtual memory cause we have the rise of operating system which was set using old name approach memory so so it's against arbitrary power civil does it work just have this can on my should my machines and this was a lab I had like 30 40 people using computers so friday nite we jacked up the file systems and our from what time how long it took for a few hours and and replace all the operating systems all of excellence simulators in this last Monday morning are coming from and talk my boss how Alice of times greater and I said how I guess what we did over the weekend said there is a box will be replaced weapons systems all computers this is it is it it doesn't work said yeah is it will converge on future decades did what I I I I I I mean ice and the guys who the this stuff they were they were ecstatic because they've never been used much memories and wanted to do all of these things
anyway that's the biggest story and that was the 1st time i've really that was the 1st time that the it's got back in the bell labs and build it up somewhere in some magazines and you go to this so some division so 1 of things I did them was for the 7th edition was sort of like the release of cop or whatever you wanna coincided with what we would do that the rules of the game were if you touch the source of a program you only if and so you're pretty careful about screwing around the source unless you really want to get into it so I didn't of only a couple things ended up winning loader and a few other things just as a unit of mass and that's how it worked we had to make been introduced in Section 7 7 biased you film and you know and that was an idea that Steve Johnson gave to to to this make this machine thing so we had makefiles residuals were and you put it in the standard and restrictions we will compile overnight make sure it works in in in in a relatively clean relatively safe as it was we didn't really have the and but you gotta make file that you got our manual page and if you don't have any of those things well we didn't actually delete that we just send you announced events that you need to put the Makefile Americans and the man pages long so we don't have souls control those those costs but actually that was how we manage the 7th edition released and there were pretty well so that's hidden story here so this is from the dentist and I were in a meeting in December when was 75 and people at the time of the original show was very limited and have variables in all kinds of things can only flow control and people started a mess of it and M. my patch it over and try to fix it and so then as I got out as meeting our phenomena walk out of the room and show you reflect and reward out of the room and we have to know is called probably doing this work so we said we gotta fix it so we decided that of that we would go and rewrite it and redesigned and we knew we couldn't patch over the existing rankers people were trying to do that it had to many iterations for example you could use a shell command file as a filter because it was with the shell command found itself was the standard input that's hard work so you couldn't you couldn't use you couldn't have Chalfont fulfilled what ensued compiled in and out of them without doing some gymnastics so we went often and and at the same time it turned out can Thompson had left for Berkeley years he he actually on the original show a certain him would've been ok if you've been there we just gone and done anyway but the fact that he was out of town was made by quite the can cancel and this is just a but also some this time the PWD show what that John Mashey pedometers programs were french there was another group business group at Bell Labs but we're using it for production workers Sirius Black short and you try make money for the phone company that started with 75 so anyway we start codon where she start with me deploy actually got deployed the original versions were came out another 76 knowledge of you know 2 3 formant structure right thing get out there and get it working so let me talk about the shell a language 1st of all and it's as you it's 1st was the type the so the issue with shell as a language is that strings of first-class citizens so you you just screwed I mean there's nothing you you you can easily add types or in its you can infer types but times and so you could you could you last thing you wanna do choose both interactively and as a scripting language and so you interactively use the way you want a course strings which is what you during regular programming language so we would you your constrained by that's the the biggest constraint on the language itself and you know we we measure put a few things in there that allow you to do some string processing and these days I wrote some of the things that have been done since and people of added stuff to do string processing that in no using in the dollar stuff you can do crazy things so but it doesn't write a program in face and the idea did the whole point of the the shell of course is at the interfaces system so you're really trying to map the systems and manage the system resources for the user and future king and so that and it turns out the hard parts where the signal management in the process by which we will come back in the so where we so you know I don't have this 68 background which you think being up later about and if you use this conference is 30 years very already done that the but the thing that I liked about our 68 was its expression language which means you could take any of the contracts and replace it with any of the other ones so for example could take any from 1 replaced by conditional and it would return a value which would then be used as as the value of an expression and you can see them basically substitute anything anyway so constraints on the light of there are some constraints obviously but it's not much constraints of language the thing that was true at the time was a lot of the utilities had its arbitrary string length you know they have some 500 character buffer and if you remember about the the crashed all told to go away and I think I like that idea particularly in the shell so I said I'm made a decision early on that there will be no arbitrary limits on anything except memory so much memory the walls and that without have a come back to bite him and I'll tell you that the other thing that was hard about the whole thing was according rules and they went through a bunch of iterations for the 1st couple of years and I'll talk a little bit about that to have served it turns out we used the return code of commands as the thing to do to tell you with what the result of the Phoenician wasn't if mumble mumble had returned code is presented with zeros true and if it was a non-zero false don't of has to the commands did not really have return codes and they with the the exit statement in most of the programs with exit friend friend which is like that's in a random number so I had to get people to go back and fix the code so that there was a sensible return codes so you could use you know if if the name command succeeded it 0 and if it failed in additional 0 summaries so that in work isospin people in this in this so what I did was in the shell when a cat when it prompted just before the prompt it would say what Mexico was for the commander was just exited and so the exit equals 0 4 thousand 271 and that this debris off and we got the executes fixed because it few thing daylight about a week the other thing which is really important time which in and so the submodularity of is a threat to the whole thing we're running on a PV 11 performance is really important and so some of the things I did and some things that were done with done simply just to keep the before to make sure that the thing performed well and calls when the shell the biggest performance here is the is forking and the amount of memory you using when you do for and so that that was and you'll see why that matters in a minute and then the other thing I did which are uh somewhat is algebra memory allocation and explain
why so what's shown in it's got all this stuff in the just 2 . choosing and actually he was
a complete this this is actually an an optimal show this for long but it just it was actually what I do is I went back to my notes in my files and stuff and I dug out things which actually got written at the time and that was that was that was the 1 24th product data sheet on recordings there but if this was the note was sent out a release saying OK here's what his what you get guys with the new shell and it was all that stuff there's a couple cool things and you pipe international loops those with thank you years also worlds in that's interesting in well the single manager really hard work and you the last 2 things you'll see there's about waiting interest 1 until we a good 2 or 3 months so to understand the units signal mechanism and how it affected perhaps because the challenges that actions to you right this is sitting there and if you hit and run your she wanted to do something or not depending on what you're trying to do and there are lots of corner cases in there that took a while to figure out the and so you can see some of them in there and in fact some of the bugs that were in there for a year or 2 after the initial release were to do research on English and and so and that's a that's list and the other thing we did was we built the pattern matching into the shell itself from the use of temple has subprime Uncle called for random
sampling of ministers so units of time what were we doing so this is sort of explains why a couple of things about why we it why I do things the way I didn't know what when when it was written we didn't have stand-alone so we didn't have that we we did have yeah CoNLL-X but the nite which he talked about put using national expert they're pretty heavyweight things to have it's not very hard to parse the shells and the very difficult but you know it's a few couple 3 4 pages senior done in there and so that wasn't a problem was no standard those string complementing inserted right all right yourself so that's how come in doing that by the time some edition came along with these things were done most of you know some days and hours like theory right just to standardize and for what so I didn't do that and by that time but also written in my memory allocated which I'll talk about and that and so it didn't make sense to go back and rewrite all that preserves all were writing memory allocated you'll see 1 minute and there is no such long jump so Dennis of those forces there are no other way to do error recovery in the in thing on the shelf machine and get back to somewhere safe in some contexts that do some useful so the up and the other reason not to use market the time was that it was a safeguards Damery memory allocation going 1 so so
the memory manager persists when people did the the port from the PDP 11 which we never expected people do we have to use we just playing on the people and you wouldn't expect to get you far lots of people from other we news news in the lab but we will we have dynamic control ourselves so you would be would do imports are usually used to be a words for ground for the time you do that takes that weighted it so the way that it worked and I'll actually or should have so the getting ahead of myself here but absolutely just say what the problem is and why you need to do your memory management of these were the 1st of all you read the overall flow for the same you read something and stated in an internal representation that you evaluated in terms of of of internal representation and and washed evaluating you can be doing and you can be doing all kinds of stuff so you you can be forced back into reading again which is by far the top of the system so if you look at the example on the page here it says you know some to this variable and and so that gets ready and it does get executed so that's in the tree and then the next thing you gotta do is go treat everything in between the quotes is that some new the reading and evaluate so you complete recursive system going on here and what you doing that you're allocated heap space so you can store variables as well as putting things on the side your stack because you're going throw away when you're done with them you know that when you're done with executing this except the value of X is retained so we have an interleaved heap and stack them in which all trophic children the understand was used for personal objects and including the parse tree which goes away and is a set of
Loading...
Feedback

Timings

  810 ms - page object

Version

AV-Portal 3.9.1 (0da88e96ae8dbbf323d1005dc12c7aa41dfc5a31)