Class Notes, CSCI402-OS

[Grad OS class] First day in class

Phew . That was a lot of stuff to prepare. I was actually a little bit of scared of not being able to finish it on time. There is still a lot of times if you start now. Fear not. As Casey Neistat said it : “The only thing standing between you and ‘Everything you have ever wanted to do in your life'{your goal} is DOING IT”.  If you did not start doing it now, you would regret later on. He also said : “Ideas are easy, implementation is hard.” Thank Casey, very inspirational.

Class starts a little late because of technical issues. The professor had difficulty projecting his tablet’s content to the screen. He called support and moments later a technician arrived unplugged it (yanked it out ), plugged it back in. “Connect?” , the professor opened his mouth in surprise. “Next time, just unplug it and try again.” “Ok, Thank you.” The technician rushed through the door and disappeared as the door slammed shut itself.

“Since we had a little bit of technical issues. We would have to stay a little bit until 1:20pm. I’m still synchronizing the contents of three classes. Normal class time would be ~1:30 hours”

*Prerequisites/Expectations:

– You can discuss ideas with your classmates, teammates, but when it comes to implement it in code, please write it yourself.

– You are encouraged to put your feet wet. Implement the program yourself as company wanting to hire you, you will prove to them that you know this stuff. You are an expert in this area, and so on.

– This is a graduate course, if you are undergrad, you are in the wrong session. Undergrad is a different course , different textbooks, different slides.

– There are prerequisites but that are for undergrad students, you guys are grad student, you are expected to:

    + know how to program

    + know hardware : how the CPU works : fetch, decode, execute instruction. Our kernel assignment will be based off of x86 machine

    + know Unix basic : how to create/change directory, compile link library.

    + know gdb to debug your program. Company expects you to know this. If you do printf, meh. There are extra credit available, you just need to show TA that you know how to use gdb.

– The individual assignments are doable but the team ones are extremely difficult so you should start early

– If you have any questions, email the professor, response should be within 24-hours. If you did not see any replies after 24 hour, shoot another emails.\

– If you are lagging behind on classes, you can talk to the professor or TA. He will point you in a right direction but he would not the assignment for you. About asking questions, some of you being smart, asking questions like : “I am doing this. Am I right?”, be warn no response does not mean that you are right.

– Grad students, you are expected to read A LOT and interpret stuff right. Also, you are at a grad level course, be wise with your choice of words.

– You should not review right before the exam as it would be too late. Some of the stuff requires reviewing on a daily basis. Some of the stuff are weird, hard to understand, only when you study daily, would you be able to do good and survive in the exam

– The textbook is a very thin but hard to read book. It is the professor’s job to explain it to you in a meaningful way

– A lot of students put their code on github as a way of showing to potential employer. “Hey hire me.” Most of the assignments are from a professor in Brown university, whose license is for private use only. If your employer wants to see the codes, you can send them private copy provided they promised not post to public.

* Lecture 1 – Introduction to OS

There are many definition of OS but it is agreed upon that OS is an abstraction layer on top of hardware that abstract away many tasks so that programmer does not have to worry about nitty-gritty. You write a program to open a file, it should work when the file is in hdd,ssd, flash drive.etc. This is essentially the interface-implementation design in software. you provide the common interface where different implementations are available, but conforming to the interface.

A layer on top of hardware
OS turns out to be a hard and complicated piece of software

The job of an OS is to achieve difficult goals:

  • Performance : It must run fast
  • Resource management : It would control all the resources for a program. allocating memory and deallocating memory, the OS handles it
  • Fault Tolerance : self-explanatory
  • Security : Safe. Be able to protect the system from malicious attacks/intrusions.
  • Marketability : Feature-abundant . Can make money

We will look at the following abstractions

"Promise"
Laid out of future(promise) lectures

 

  • Files : abstracts away disks
  • Program(processes) : abstracts away Memory
  • Threads of execution : abstracts away Processor
  • Input : abstracts away Mouse/Keyboard/Camera,Webcam,etc

a. Files : directories, folders

Files are binaries of different formats stored in an secondary storage, which is slow. Typically , program is copied to main memory or cache to execute, because it is faster

There are about 4 operations, regardless of the devices, that the OS exposed : read,write, open,close. It should be device independent.

There are couple issues with files:

  • Device independence
  • Space efficiencies
  • Error/crash tolerance
  • Shuffling data between different devices.

Bonus, the following image show how the address space, how a program is stored in memory.

Math vs CS
Address space in a x86 machine. Low->high

Note : Something about Math. vs CS I could not recall yet. Gotta be something related to stack trace. Math people like to draw y axis in natural way , in this case the picture should be upside down…Will investigate later.

That’s good for now. Will update picture later.

The TO-DO list for today

  • Install Ubuntu
  • Look at C programming language
  • Look at Linux/Unix environment : commands, execution of programs,etc
  • Look at gdb and be familiar with a couple of commands

What a towering task.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s