Understanding Unix-Linux Programming [UPD]
Unix is a computer Operating System which is capable of handling activities from multiple users at the same time. The development of Unix started around 1969 at AT&T Bell Labs by Ken Thompson and Dennis Ritchie. This tutorial gives a very good understanding on Unix.
Understanding Unix-Linux Programming
We assume you have adequate exposure to Operating Systems and their functionalities. A basic understanding on various computer concepts will also help you in understanding the various exercises given in this tutorial.
This readable and comprehensive text clearly explains Unix programming and structure by addressing the solid fundamentals of Unix and providing different solutions to problems. All ideas and principles are introduced in the context of a practical problem, and excellent use is made of illustrations and listings in the text. Projects are solved by the development of complete programs, which are clearly commented on and integrated with explanations in the text.
Bruce Molay, an award-winning teacher at Harvard and an independent software developer for over two decades, has combined his two passions of masterly teaching and Unix programming in this book.
The class is lectured in English unless all students can speak/understandCzech.Make sure you subscribe yourself to the nswi015-l mailinglist to stay current with what is going on. Archive is alsoavailable (to subscribers only).ContentsSyllabusMaterialsUnix machine accessExamsLabsFinal lab assignmentConsultationsContactScheduleReferencesSyllabusWe follow this syllabus. The schedule may slipduring the semester though.Materials The primary material for this lecture are the commented slides. Slides as used during the lectures. They are part of the commented slides so you will probably not need them. See opening slides for recommended materials for further study. An extensive list of recommended and not recommended materials can be found on Miroslav Virius's page. Mr. Virius teaches C/C++ at the Faculty of Nuclear Sciences and Physical Engineering in Prague. Online access to the C source code files used during the lectures. Often not complete, and may contain bugs on purpose. Read comments carefully. You can download tarred achives in releases. Some ViM tips for editting and navigating C source code files. Information on the recommended C style for writing code so that fellow programmers can read it as well.Unix machine access See here.ExamsThe exam schedule will be provided at the end of the semester. We hope examscan be held in person but we will adjust accordingly based on the Covid-19situation at the time.Exam rules.LabsAssignments from the individual lab classes: unix-linux-prog-in-c-labs@githubFinal Lab AssignmentThe final lab assignment you need to implement to get credits for thelabs (which is a hard dependency for entering the credits that you get forpassing the exam into the school information system) is a simple Unix/Linuxshell.The assignment is a home project and we require a GitHub link (or alink to a similar hosting site supporting either Git or Mercurial) to yourimplementation when you hand it over to us. When you are done, send the linkvia e-mail to both of us (see Contact below).It is an individual, not a team project. In your source code files, youare not allowed to use code written by anybody else than you. The idea is youlearn by coding your own project.See extra feedback basedon what other students already handed over before you send it to us.Assignment verification tests are provided in -cz/unix-linux-prog-in-c-labs/tree/master/final-assignment-tests/shell.You must pass the tests before handing over your solution. See the READMEfile for more information. Note that we will build your shell and verify thetests at least on one of the Linux machines u-pl* in the MFF UK lab atMalá Strana. Which one should not matter as their configuration isexpected to be identical. See Unix machine accessabove for more information. So, that means it is up to you what a Linux distroor Unix-like system you choose to develop your shell on but you must be able tobuild it and verify the tests on a u-pl* machine as well.The first phase of the shell assignment must be finished and handed over to usvia e-mail before the end of the Winter semester, ie. Sunday 23:59, January8, 2023, CET. You need to send the e-mail before the deadline. If for anyreason the Winter semester is prolonged then January 8 still stands unlessannounced otherwise.The second phase must be finished and handed over to us via e-mail before theexamination period for the Summer semester starts, i.e. by Monday 23:59, May22, 2023, CET. You need to send the e-mail before the deadline. The datestands even if the semester is prolonged.The deadlines are hardrequirements so stick to the schedule. We do notaccept late arrivals and that automatically means you are not eligible for thecredits for the year. Obviously, you can send us the whole thing in one stepbefore the first deadline, no need to separate the project in two parts.If you need to finish your semester earlier (that may apply to Erasmusstudents), you need to finish the 2nd assignment in full before that.ConsulationsVia e-mail or after a lecture or practice.Contactvlada at kotalovi dot cz, jp at devnull dot cz
Note: Hi, I borrowed some of the material (provided in this page) from the Web and A. S. Tanenbaum "Modern Operating Systems" text book. I am unable to mention all the references. If anyone found that I kept (accidentally) copy-right things in this page, please let me know. I will immediately remove such things from this page. Thank you very much.-->Spring 2009 CS153 - Design of Operating Systems Office hours: Thursday 11:10 AM to 12:10 PM. (Room no:465, EBUII) Lab hours: Tuesday 8:10 AM to 11:00 AM. Recommended books for the lab projects: Linux Device Drivers, Jonathan Corbat et al., O'REILLY Third Edition.
Kernel Projects for Linux, Gary Nutt.
Understanding the LINUX KERNEL, Daniel P. Bovet & Marco Cesati
Advanced Programming in the UNIX Environment, Richard Stevens.
Practice of Programming, Brain Kernighan and Rob Pike.
Projects and Lab Notes: Lab Policies and Submitting Projects
Project -1: Observing Linux Behaviour Problem statement
Notes
Resources: Proc filesystem documentation
Red Hat notes on /proc
Input/Output on Streams - Documentation
Low-Level Input/Output - Documentation
Best practices for programming in C
C Traps and Pitfalls
Project -2: Shell Implementation Specifications Problem statement
Shell Notes-1
Wait and Signals
Shell-Lab1-code
Shell-Lab2-code
Resources GNU C Library
Duplicating Descriptors, sample code
Signals, sample code
fork.c (Linux kernel 2.6)
Project-3: Notes for threads assignment
CPS 356 (3 hours) is a course that introduces the theoretical and practical issues underlyingan operating system's structure and operation. Topics include process and thread creation and management, scheduling, concurrent, multi-threadedprogramming and synchronization, deadlock, memory management, viritual memory, and computer security.Concepts are demonstrated using the C, Go, and Elixir programming languages in a Linux environment. This course assumes no prior experience with Linux, Go, or Elixir.
Shell scripting is a fundamental skill that every systems administrator should know. The ability to script mundane & repeatable tasks allows a sysadmin to perform these tasks quickly. These scripts can be used for anything from installing software, configuring software or quickly resolving a known issue.A fundamental core of any programming language is the if statement. In this article I am going to show several examples of using if statements and explain how they work....
The written problems are to be done individually. The programming problems are to be done in your assigned programming groups. All homework submissions are to be made via Courseworks. Refer to the homework policy section on the class web site for further details.
Please complete and submit a private group programming assignment evaluation. The evaluation should be in a separate file called evaluation.txt that is submitted with your individual written assignment submission.
Programming problems are to be done in your assigned groups using copies of the virtual machine (VM) image already provided. For all programming problems you will be required to submit source code, a README file documenting your files and code, and a test run of your programs. In addition, you should submit a cover sheet using either homework_work.txt or homework_nonwork.txt, depending on whether or not the programming assignment is completely working or not. For source code submissions, you only need to submit new source code files that you created and kernel source code files that you changed. You should clearly indicate your names, email addresses, and assigned group number on your submission. Each group is required to submit one writeup for the programming assignment.
You are strongly advised to read Understanding Linux Kernel Chapter 7 Process Scheduling, before starting the programming assignment. Most of the code of interest for this assignment is in kernel/sched.c and include/linux/sched.h. These are probably not the only files you will need to look at, but they're a good start. While there is a fair amount of code in these files, a key goal of this assignment is for you to understand how to abstract the scheduler code so that you learn in detail the parts of the scheduler that are crucial for this assignment and ignore the parts that are not.
Backup your kernel changes outside your VM often. Sometimes your virtual disk can get corrupted, and you may lose all changes you've made. Remember, as a safety measure, you are strongly encouraged to backup your VMware image from time to time.
printk statements in system calls will print their output to the console whenever they are invoked. To request printk messages be sent to a log file, insert the following line into the /etc/syslog.conf file: kern.* /var/kern.log This will cause printk messages to be written to /var/kern.log. You can send a signal to request the syslog daemon re-read the updated /etc/syslog.conf file, with the command "kill -1 pid" where pid is the pid of the syslogd process.
A lot of your problems will come from system administration issues. If nobody in your group in familiar with unix, you might want to pick up a book on Unix/Linux system administration.
You can find some Linux programming tips at the course resources page.
041b061a72