Presentation is loading. Please wait.

Presentation is loading. Please wait.

C and Unix. A Couple Basic Concept and Terms 1. File. 2. Process. 3. Memory 4. HD.

Similar presentations


Presentation on theme: "C and Unix. A Couple Basic Concept and Terms 1. File. 2. Process. 3. Memory 4. HD."— Presentation transcript:

1 C and Unix

2 A Couple Basic Concept and Terms 1. File. 2. Process. 3. Memory 4. HD

3 Binary Number Decimal Binary Octal Hexadecimal Logical Operations Arithmetic Operations

4 Unix What is Unix? What is Operating System (OS)? Basic Computer components. The relationship between hardware and software. The roles of OS. The roles of C (programming language).

5 Unix as an “open” system The internal software architecture is well defined and available in source code form, either free or for a relatively small fee. Another similar OS is Linux which is basically free.

6 Unix Standards AT&T’s Bell Lab first invented and introduced the original Unix version (now becomes system V). Other versions: BSD—Berkeley Standard Distribution IBM—AIX HP– HP-UX

7 Main Features of Unix 1. It is a multi-user system. *** The most important concept—Time Sharing 2. It shares CPUs, memory, disk space efficiently. 3. It has a large number of standard utilities. 4. It is a portable system that is available for many different platforms.

8 Using C with UNIX A little knowledge is necessary before you can write and compile programs on the UNIX system. Every programmer goes through the same three step cycle. 1. Writing the program into a file 2. Compiling the program 3. Running the program During program development, the programmer may repeat this cycle many times, refining, testing and debugging a program until a satisfactory result is achieved.

9 C and UNIX This course teaches C under the UNIX operating system. C programs will look similar under any other system (such as VMS or DOS), some other features will differ from system to system. In particular the method of compiling a program to produce a file of runnable (executable) code will be different on each system. The UNIX system is itself written in C. In fact C was invented specifically to implement UNIX. All of the UNIX commands which you type, plus the other system facilities such as password checking, line printer queues or magnetic tape controllers are written in C.

10 In the course of the development of UNIX, hundreds of functions were written to give access to various facets of the system. These functions are available to the programmer in libraries. By writing in C and using the UNIX system libraries, very powerful system programs can be created. These libraries are less easy to access using other programming languages. C is therefore the natural language for writing UNIX system programs.

11 This Course One of the main objects for this course is to introduce programmers to the C language. Previous programming experience is assumed, so we can quickly progress to looking at the features of C and their uses. Students with little programming experience will need to do some more homework in order to keep up with the lectures.

12 Common C Until recently there was one dominant form of the C language. This was the native UNIX form, which for historical reasons is known as either Bell Labs C, after the most popular compiler, or K. &R. C, after the authors of the most popular textbook on the language. It is now often called "Classic C"

13 ANSI C The American National Standards Institute defined a standard for C, eliminating much uncertainty about the exact syntax of the language. This newcomer, called ANSI C, proclaims itself the standard version of the language. As such it will inevitably overtake, and eventually replace common C. ANSI C does incorporate a few improvements over the old common C. The main difference is in the grammar of the language. The form of function declarations has been changed making them rather more like Pascal (another used to be popular language) procedures. This course introduces ANSI C since it is supported by the SUN workstation compilers. Most C programming texts are now available in ANSI editions.

14 .. Unix File System Unix has three categories of files: 1. Regular Files which could be: code, data, text…. 2. Directory Files 3. Special Files device files, such as: printers, disks, terminals…

15

16


Download ppt "C and Unix. A Couple Basic Concept and Terms 1. File. 2. Process. 3. Memory 4. HD."

Similar presentations


Ads by Google