Welcome to Crash Course Computer Science!Computers in the 1940's and early 50 's ran one program at a time.A programmer would write one at their desk, for example, on punch cards.Then, they’d carry it to a room containing a room-sized computer, and hand it to a dedicated computer operator.

                               First Generation computer 

That person would then feed the program into the computer when it was next available.The computer would run it, spit out some output, and halt.This very manual process worked OK back when computers were slow, and running a program  often took hours, days or even weeks.But, as we discussed last episode, computers became faster... and faster... and faster– exponentially so!Pretty soon, having humans run around and inserting programs into readers was taking longer than running the actual programs themselves.We needed a way for computers to operate themselves, and so, operating systems were born


                      Intro to Motion Graphics - 2.5d Paralax ...

        

INTRO Operating systems, or OS’es for short, are just programs.But, special privileges on the hardware let them run and manage other programs.They’re typically the first one to start when a computer is turned on, and all subsequent  programs are launched by the OS.They got their start in the 1950's, as computers became more widespread and more powerful.The very first OSes augmented the mundane, manual task of loading programs by hand.Instead of being given one program at a time, computers could be given batches.When the computer was done with one, it would automatically and near-instantly start the next.There was no downtime while someone scurried around an office to find the next program to run.This was called batch processing.While computers got faster, they also got cheaper.So, they were popping up all over the world, especially in universities and government offices.

               Soon, people started sharing software.But there was a problem…In the era of one-off computers, like the Harvard Mark 1 or ENIAC, programmers only had to write code for that one single machine.The processor, punch card readers, and printers were known and unchanging.But as computers became more widespread, their configurations were not always identical,like computers might have the same CPU, but not the same printer.This was a huge pain for programmers.Not only did they have to worry about writing their program, but also how to interface with each and every model of printer, and all devices connected to a computer, what are called peripherals.Interfacing with early peripherals was very low level, requiring programmers to know intimate hardware details about each device.


                            Two women operating ENIAC (full ...


On top of that, programmers rarely had access to every model of a peripheral to test their code on.So, they had to write code as best they could, often just by reading manuals, and hope it worked when shared.Things weren’t exactly plug-and-play back then… more plug-and-pray.This was clearly terrible, so to make it easier for programmers, Operating Systems stepped in as intermediaries between software programs and hardware peripherals.More specifically, they provided a software abstraction, through APIs, called device drivers.These allow programmers to talk to common input and output hardware, or I/O for short,using standardized mechanisms.For example, programmers could call a function like “print high score”, and the OS would do the heavy lifting to get it onto paper.By the end of the 1950's, computers had gotten so fast, they were often idle waiting for slow mechanical things, like printers and punch card readers.While programs were blocked on I/O, the expensive processor was just chill in’... not like a villain… you know, just relaxing.In the late 50’s, the University of Manchester, in the UK, started work on a super computer called Atlas, 

                                                           

                                                                             Super computer 

one of the first in the world.They knew it was going to be wicked fast, so they needed a way to make maximal use of the expensive machine.Their solution was a program called the Atlas Supervisor, finished in 1962.This operating system not only loaded programs automatically, like earlier batch systems,but could also run several at the same time on its single CPU.It did this through clever scheduling.Let’s say we have a game program running on Atlas, and we call the function “print high score” which instructs Atlas to print the value of a variable named “high score”onto paper to show our friends that we’re the ultimate champion of virtual tiddlywinks.That function call is going to take a while, the equivalent of thousands of clock cycles,because mechanical printers are slow in comparison to electronic CPU's.So instead of waiting for the I/O to finish, Atlas instead puts our program to sleep, then selects and runs another program that’s waiting and ready to run.Eventually, the printer will report back to Atlas that it finished printing the value of “high score”.Atlas then marks our program as ready to go, and at some point, it will be scheduled to run again on the CPU, and continue onto the next line of code following the print statement.In this way, Atlas could have one program running calculations on the CPU, while another was printing out data, and yet another reading in data from a punch tape.Atlas’ engineers doubled down on this idea, and outfitted their computer with 4 paper tape readers, 4 paper tape punches, and up to 8 magnetic tape drives.This allowed many programs to be in progress all at once, sharing time on a single CPU.This ability, enabled by the Operating System, is called multitasking 


                                                           Multitasking Of computer  Image 

 The operating systems had to be equally simple.For example, Microsoft’s Disk Operating System, or MS-DOS, was just 160 kilobytes,allowing it to fit, as the name suggests, onto a single disk.First released in 1981, it became the most popular OS for early home computers, even though it lacked multitasking and protected memory.This meant that programs could, and would, regularly crash the system.While annoying, it was an acceptable trade off, as users could just turn their own computers off and on again!Even early versions of Windows, first released by Microsoft in 1985 and which dominated the OS scene throughout the 1990's, lacked strong memory protection.When programs misbehaved, you could get the blue screen of death, a sign that a program had crashed so badly that it took down the whole operating system.Luckily, newer versions of Windows have better protections and usually don't crash that often.Today, computers run modern operating systems, like Mac OS X, Windows 10, Linux, OS and Android.

:                                                              desk, screen, apple ...



Even though the computers we own are most often used by just a single person, you! their OSes all have multitasking and virtual and protected memory.So, they can run many programs at once: you can watch YouTube in your web browser, edit a photo in Photoshop, play music in Spotify and sync Dropbox all at the same time.This wouldn’t be possible without those decades of research and development on Operating Systems, and of course the proper memory to store those programs.Which we’ll get to next week.I’d like to thank Hover for sponsoring this episode.Hover is a service that helps you buy and manage domain names.Hover has over 400 domain extensions to end your domain with - including .com and .net.You can also get unique domains that are more professional than a generic address.Here at Crash Course, we'd get the domain name “mongols.fans” but I think you know that already.Once you have your domain, you can set up your custom email to forward to your existing email address -- including Outlook or Gmail or whatever you already use.