Download presentation
Presentation is loading. Please wait.
Published byDonna Tucker Modified over 9 years ago
1
Homework There will be 4 homework assignments There will be 4 homework assignments They will each be graded 0-100+ (There will be bonus) They will each be graded 0-100+ (There will be bonus) Total weight = 55% (total weight of test = 55%) Total weight = 55% (total weight of test = 55%) Homework can be done in groups Homework can be done in groups Each group must meet the ex. Checker and defend their work. the grade of the group will be the grade of it’s worst member! Each group must meet the ex. Checker and defend their work. the grade of the group will be the grade of it’s worst member! The kernel homework will be checked on a computer with VMWare that you should download and verify. The User space code will be checked on VMWare The kernel homework will be checked on a computer with VMWare that you should download and verify. The User space code will be checked on VMWare No rechecks for code that doesn’t run!!! No rechecks for code that doesn’t run!!! No points will be deducted on code quality (unless we see real atrocities) but points will be deducted if the ex doesn’t work as supposed to or use the OS incorrectly. No points will be deducted on code quality (unless we see real atrocities) but points will be deducted if the ex doesn’t work as supposed to or use the OS incorrectly.
2
Defending homework The main reason is policy – since the homework affect grade to such extent it cannot be allowed without oral exam. The main reason is policy – since the homework affect grade to such extent it cannot be allowed without oral exam. This method have proven to be very effective in ensuring students success on the final test. This method have proven to be very effective in ensuring students success on the final test. It cannot be changed not even if you work alone. It cannot be changed not even if you work alone.
3
What questions do we ask when you defend your code? 50 questions are prepared for each ex. 3 random questions per student. 50 questions are prepared for each ex. 3 random questions per student. Questions type : show me where you, what does line do? Why did you add this check etc. Questions type : show me where you, what does line do? Why did you add this check etc. No student that worked on the ex. Should fail. But it is almost impossible to “fake”. (so please DO your homework) No student that worked on the ex. Should fail. But it is almost impossible to “fake”. (so please DO your homework)
4
Strict timetable policy In order to minimize hassle for you, we will give oral exam on the homework within 1 week of dead line. In order to minimize hassle for you, we will give oral exam on the homework within 1 week of dead line. That means we need to schedule a room, invite checker and grade everything within very short time! That means we need to schedule a room, invite checker and grade everything within very short time! Since we do all that – we believe students should be ready. By not submitting homework in time you delay our checking and ruin our system. Since we do all that – we believe students should be ready. By not submitting homework in time you delay our checking and ruin our system. We are also firm believers on strict timelines. We are also firm believers on strict timelines.
5
Using Linux The good but hard way – install on your computer. (Do this if you know what you are doing and at your own risk we cannot and will not provide support if your computer fail) The good but hard way – install on your computer. (Do this if you know what you are doing and at your own risk we cannot and will not provide support if your computer fail) The also possible way – Download VM Player from VMWare.com (free) and use it with our vmware. The also possible way – Download VM Player from VMWare.com (free) and use it with our vmware. We will distribute VMWare machine you can work on. (MTA – via library, TAU – Amir’s door) It will also be available on class on MTA. We will distribute VMWare machine you can work on. (MTA – via library, TAU – Amir’s door) It will also be available on class on MTA. The not recommended ways The not recommended ways Using only user mode linux on TAU. Using only user mode linux on TAU. Using your own different linux distribution Using your own different linux distribution Using another UNIX Using another UNIX ETC… all those methods are at your own risks. Should anything fail, you will be sole responsible due to all incompatibilities. ETC… all those methods are at your own risks. Should anything fail, you will be sole responsible due to all incompatibilities.
6
Using Linux under VMPlayer Simulates computer inside your computer. Simulates computer inside your computer. Slower then real PC but good enough for us. Slower then real PC but good enough for us. For most practical purposes can be treated as a real computer with real OS. (certainly for this course) For most practical purposes can be treated as a real computer with real OS. (certainly for this course) Root password : password Root password : password User password : user User password : user Download from www.scipio.org/Courses/OS_Course Download from www.scipio.org/Courses/OS_Course
7
User vs Root User – can run programs User – can run programs Root – can run system programs. Administrator of system (usually owner or owner’s employee) Root – can run system programs. Administrator of system (usually owner or owner’s employee) User – can hardly cause damages. User – can hardly cause damages. Root – prune to damages. Root – prune to damages. Root – can use low-level system resources (such as row sockets) and setup kernel modules Root – can use low-level system resources (such as row sockets) and setup kernel modules Most of the time we work as user Most of the time we work as user Sometimes (rarely) we work as root. When coding stuff on the kernel or running administration commands. In Ubunto we login as user and sudo(1) when we need root access Sometimes (rarely) we work as root. When coding stuff on the kernel or running administration commands. In Ubunto we login as user and sudo(1) when we need root access
8
Assumed knowledge We assume you know how to code in C in KR Level. We assume you know how to code in C in KR Level. We assume you know how to handle strings We assume you know how to handle strings We assume you know how to do basic math We assume you know how to do basic math We assume you know how to allocate and free memory We assume you know how to allocate and free memory We assume you know how to create functions and use recursion, library functions and function pointers We assume you know how to create functions and use recursion, library functions and function pointers We assume you know how to open files and folders We assume you know how to open files and folders We assume you know what editor, compiler, debugger and Make (build) is. We assume you know what editor, compiler, debugger and Make (build) is.
9
Using Linux There are many manuals on the net. (Try – UNIX is a 4 letter word and vi is 2 letter abbreviation) There are many manuals on the net. (Try – UNIX is a 4 letter word and vi is 2 letter abbreviation) There is also a readme that comes with your VM There is also a readme that comes with your VM Some basic commands Some basic commands mkdir, rmdir, cd – just like MS-DOS mkdir, rmdir, cd – just like MS-DOS ls – list files (dir) ls – list files (dir) vi – Text editor vi – Text editor cp – copy cp – copy rm – remove (delete) rm – remove (delete)
10
Coding and programming in Linux First thing we need to do is edit a source file. (which is basically a text file) First thing we need to do is edit a source file. (which is basically a text file) Create a source file in your favorite editor (I use vi.) Create a source file in your favorite editor (I use vi.) Compile using gcc –c “source file” –o “object file” Compile using gcc –c “source file” –o “object file” Link using gcc -o Link using gcc -o This process can be automated by using Makefile This process can be automated by using Makefile Run using./ (we don’t have. In the default search path) Run using./ (we don’t have. In the default search path)
11
Sample program – compile and run Macintosh:~ scipio$ vi hello.c Macintosh:~ scipio$ gcc -c hello.c -o hello.o Macintosh:~ scipio$ gcc hello.o -o hello Macintosh:~ scipio$./hello hello world
12
Source of hello.c #include #include int main(int argc, char * argv[]) { printf("hello world\n"); return 0; }
13
Makefile Makefile (same as project file in other environments) is a simple way to automate build process Makefile (same as project file in other environments) is a simple way to automate build process Makefile works like that… Makefile works like that… : : For example for hello world the make can look like For example for hello world the make can look like
14
Makefile all : hello hello : hello.o gcc hello.o -o hello gcc hello.o -o hello hello.o : hello.c gcc -g -c hello.c -o hello.o gcc -g -c hello.c -o hello.o
15
Using make Macintosh:~ scipio$ make gcc -g -c hello.c -o hello.o gcc hello.o -o hello
16
debugging The Linux debugger is gdb The Linux debugger is gdb You must compile with –g switch to include debug info (same as debug/release build in other environments) You must compile with –g switch to include debug info (same as debug/release build in other environments) You can use gdb to trace (step, step into, next) your programs. Gdb has a graphical front end – ddd You can use gdb to trace (step, step into, next) your programs. Gdb has a graphical front end – ddd Usually though you will just examine core dump. (core is what your program leaves when it crashes) Usually though you will just examine core dump. (core is what your program leaves when it crashes)
17
Crash.c int main() { int i=5; int j=0; int k=i/j; }
18
Using UNIX to debug… ulimit –c 999999 gcc –g crash.c –o crash./crash gdb –c core./crash … Program received signal EXC_ARITHMETIC, Arithmetic exception. 0x00001ff3 in main () at crash.c:5 5int k=i/j;
19
More options Gcc and gdb has lots more options, while Make is fully programmable environment. Gcc and gdb has lots more options, while Make is fully programmable environment. We don’t teach any of these due to time constraints (and because it’s off topic) but new options may be introduced as we go along. You are welcome to use any option you want and do your own web research. We don’t teach any of these due to time constraints (and because it’s off topic) but new options may be introduced as we go along. You are welcome to use any option you want and do your own web research. You may also use anything you find in your homework. You may also use anything you find in your homework.
20
Using IDE under Linux There are plenty of IDE that act as a wrapper to the above such as (partial list) There are plenty of IDE that act as a wrapper to the above such as (partial list) Kdevelop Kdevelop Eclipse Eclipse Netbeans Netbeans Codewarrior Codewarrior Slickedit Slickedit We don’t teach or support them, but you may use them for your homework. We don’t teach or support them, but you may use them for your homework.
21
Ex. 0 We give you ex. 0 as an optional ex. To iron out your C skills and code under Linux. Should you submit it, it will be checked. But it is not obligatory and will not effect your grade. (there is also no defense on that one) We give you ex. 0 as an optional ex. To iron out your C skills and code under Linux. Should you submit it, it will be checked. But it is not obligatory and will not effect your grade. (there is also no defense on that one) You should probably google most of your problems (there are plenty of good guides) you can also Email Nezer and Tomer if you cannot find the answer in google. You should probably google most of your problems (there are plenty of good guides) you can also Email Nezer and Tomer if you cannot find the answer in google.
22
Ex. 0 Create a user shell supporting the following commands: Create a user shell supporting the following commands: DIR = list files DIR = list files CD = change directory (CD.. = usual meaning) CD = change directory (CD.. = usual meaning) Everything else = try to execute something with the same file name in the current directory using system(3) Everything else = try to execute something with the same file name in the current directory using system(3) Submit source and makfile. Submit source and makfile.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.