[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.

Graduate school OS Class

Im taking OS class this semester. Today I went to check out to see if there is a course web page online, found out there is and there are tons of informations in there and a take away:

“Class paces are fast-OS is complex so its hard to cover everything all at once(comprehensive). Be prepare to learn things on your own ( class discussions are available and professor is there to help). If you work hard, you will learn a lot” (paraphrase by me, ‘quote’ just in case it is plagiarism^^ )

So I better lift my butt up and study real hard. The course expects me to prepare the following:

* Be proficient in C and its relatedness. OS dev is mostly programmed in C( C++/C# OS however exist[Haiku/Singularity])
-Material : B. Kernighan and D. Ritchie, C Programming Language, 2nd Edition, Prentice Hall, 1988.

-Learn Git(Joe Topjian, Pro Git free book) for source version control and back up code to dropbox.

-Learn gdb, to debug programming

-Learn how to write MakeFile. ONLY SUBMIT *.c and *.h, binaries would result in grade reduction/penalties. Examples I found

Ubuntu 12.04 as a defacto standard. Learn Unix as soon as possible. Material : Joe Topjian, Unix for the Beginning Mage

-Seems to be uploading assignments to an online server. The server is an Unix machine so your submitted assignment might not work out of the box, but the change is minimal and you can log in to the system to verify and test your solution. PLEASE don’t develop from Windows haha, the line feed ending is different. There are programs out there to convert windows text to Unix/Linux compatibles

*Additional resources:

-David Rusling, The Linux Kernel.

The following is from the course website:

(These resources below are provided for your information. Please note that the instructor has not read most of them. Please use these resources at your own risk!)Programming:

  • C Programming (by Steve Holmes at the University of Strathclyde in Glasgow, England) – includes notes on make, separate compilation, file I/O, etc.
  • Makefile tutorial (at Colby College)
  • Steve’s Software Trek (by Steve Karg) – includes some useful C/C++ source code for string manipulation, INI file manipulation, etc.
  • C Examples – lots and lots of sample C code for basic stuff.
  • C/C++ at USC from USC ITSWeb
  • Online Judge online portal for IT interview

UNIX:

Just for fun:

That’s a lot of stuff to learn. See you in a year haha.