Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 350 Operating Systems & Programming Languages Ethan Race Oren Rasekh Christopher Roberts Christopher Rogers Anthony Simon Benjamin Ramos.

Similar presentations


Presentation on theme: "CS 350 Operating Systems & Programming Languages Ethan Race Oren Rasekh Christopher Roberts Christopher Rogers Anthony Simon Benjamin Ramos."— Presentation transcript:

1 CS 350 Operating Systems & Programming Languages Ethan Race Oren Rasekh Christopher Roberts Christopher Rogers Anthony Simon Benjamin Ramos

2 Introduction to Programming Languages

3 Programming Languages According to Wikipedia, a programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely For us computer science students, it is the lifeblood of all the programs, homework assignments and projects that we do during our time here in Binghamton University

4 Languages that contain libraries Languages that are object-oriented based We have dealt with many Programming Languages

5 We have also dealt with many functions, libraries and methods The C Specials free() malloc() printf() With Java, you get The scanner library System.out.print.ln() With C++, you get introduced to numerous libraries, like the STL Library and the POSIX Library. WRPDRV() ?

6 The question to ask though is? How does a specific programming language communicate with the operating system in order to achieve what the programmer wants in their program? How does the operating system interpret and compile the libraries, functions and methods of a specific programming language so that we have a working program? How can we as a programmer make our program so that it can run efficiently in the operating system?

7 What we will discuss in this presentation How to wisely use the Operating systems memory in our programs? - Memory Management How to transfer a piece of code from one language to another? - Portability How do you run multiple programs or processes at the same time? - Multiprogramming What Tools are needed in the execution of a language on a given OS? - Compilers. The idea about OS Libraries, Security through System calls and there Reusability - Libraries, API's & System Calls

8 Memory Management How to Overclock a Positronic Brain Ethan Race

9 In most Modern Languages: Automatic Computer Managed Memory & Manual Human managed Memory Types of Memory Management

10 Faster, and more Efficient Makes the programmer's job easier BUT You take a performance hit Might keep memory that is reachable, but never used again Automatic Memory Management

11 The memory is managed by the Computer. o As part of the language, or an extension thereof One form is Garbage Collecting o First in LISP in 1959 o Required by C#, Java and most scripting languages. o Allowed in C++, ADA, along with manual management o Can be turned off in D Automatic Memory Management (Cont.)

12 The programmer decides when memory is freed (free, delete, etc.). Available in C/C++, ADA, etc. Performance is increased The programmer knows what is going on. BUT The programmer has more to keep track of There are generally more errors. o Pointer errors, and memory leaks Manual Memory Management

13 Automatic o Managed by Computer o Easier to program Manual o Managed by Programmer o More performance Memory Management (Summary)

14 Oren Rasekh Portability

15 What is it? How can we achieve it? Do we want it?

16 What is portability? Dictionary.com: Capable of being transported or conveyed Can move from platform to platform Must be efficient Little to no change in code

17 Where is portability? GNU Compiler Collection Java Posix Standards X Window System

18 Things to consider System specific functions o sleep vs. Sleep System word size o compile to 32 bit | 64 bit sizeof o int * pointer = malloc(sizeof(int) * 10);

19 How can we be portable? JAVA

20 How can we be portable? Posix Standards Portable Operating System Interface Standards for cross platform portability Prevent system dependency issues

21 Do we want it? Cons Speed decrease Higher level of abstraction Learning curve Implementation time Pros Write code once Easier to maintain Cost I DON'T KNOW (but probably)

22 Christopher Roberts Multiprogramming

23 1. What is it? 2. How can we do it? a) Processes b) Threads 3. What does the OS need? a) Scheduling b) Memory Management 4. Challenges and Benefits

24 What Is Multiprogramming? D efinition: o Multiple programs running at the same time What is involved: o Space multiplexing o Time multiplexing

25 Processes and Threads Process o a program and its address space ‘ Thread o a unit of work Need to be managed efficiently

26 Multiprogramming and the Operating System Memory o OS must set up Process Control Block and Thread Control Block o Must provide memory protection o Memory swapping  Allows the OS to provide more memory than is physically available

27 Multiprogramming and the Operating System Scheduling o Determine which program/process/thread runs next o Keep track of state of process  Ready  Running  Waiting o Two basic types of schedulers  Non-preemptive - batch systems Priority  Preemptive - modern systems Round Robin

28 Benefits and Challenges Challenges o Protecting critical sections (threads) o Debugging o Using "safe" functions Benefits o Can fully utilize powerful processors o Performance increase

29 Christopher Rogers Compilers

30 What is a compiler? Several types: o Native Compiler o Cross-compiler o Decompiler o Language Translator Responsible for performing various tasks: o Lexical analysis, Semantic analysis, Preprocessing, parsing, and code generation and optimization. Environment for compiler and program Compilers

31 Executable is platform independent. Used in: o Embedded Systems o Microcontrollers o Multiple systems Utilized when arch or OS differs. GCC can be configured to cross compile. Cross-Compilers

32 Platform dependence Windows: o Visual Basic o Microsoft Visual C# o IAR C/C++ Compilers (Proprietary) Unix: o Gambas (Basic) o HP aC++ (C++) o TenDRA (C++) Both: o GCC (C/C++) o Multi (C++) Compilers and the OS

33 Anthony Simon Libs, API's & System Calls

34 An API or Library offers a reusable and standard interface to a programming package What does this mean for a programming language?? Reusability

35 System Calls are API's that provide "secure" execution environments So What?? Security

36 The End


Download ppt "CS 350 Operating Systems & Programming Languages Ethan Race Oren Rasekh Christopher Roberts Christopher Rogers Anthony Simon Benjamin Ramos."

Similar presentations


Ads by Google