Introduction to
System Programming
Department of Military Information Engineering Hanyang University
Haewoon Nam
Lecture 1
(CSE2018)
Course Outline
• Lecture Time and Room
– Wed. 10:00a – 12:00pm, Engineering Building 1, Room 301 (Y05-301)
• Lab. Time and Room
– Thu. 03:00p – 05:00pm, Engineering Building 4, Room PC3
• Instructor: Haewoon Nam
– Email: [email protected]
– Office: Engineering Building 3, Room 304
• This is an English Course !!!
– Lectures delivered in English
– Midterm and final exams should be done in English – You can ask questions in Korean
Course Outline
• Textbook:
– None. Most of information can be found and learned using Google
• Most related references
Course Outline
• Lecture notes available at the portal (HY-IN)
• Prerequisites:
– ITE1009 C Programming
– Students who have not completed the prerequisites may still take this course. Please discuss it with the instructor.
• Grading:
– Midterm exam 30%
– Final exam 30%
– Attendance and participation 10%
– Homeworks 10%
– Course project 20%
Course Outline
• Lab. Work:
– Once a week, laboratory class
– Practice in a Linux server (remote login) – Coding practice
– Examples
• Teaching Assistant
– Sewoong Min
• Email: [email protected]
• Office: Engineering Building 3, Room 419-1
Course Outline
• Midterm exam
– 2016/04/13 (Wed)
– During the 7th week class hour – In the class room
• Final exam
– 2016/06/08 (Wed)
– During the 15th week class hour – In the class room
• Course project presentation
– 2016/06/15 (Wed)
– Individual project presentation
Course Schedule
• Week 1 . . . Course introduction
• Week 2 . . . Unix and Linux Basics
• Week 3 . . . C Programming review
• Week 4 . . . C Programming review
• Week 5 . . . Threads and processes
• Week 6 . . . Threads and processes
• Week 7 . . . Threads and processes
• Week 8 . . . Mid-term Exam
• Week 9 . . . Scheduling
• Week 10 . . . Scheduling
• Week 11 . . . Synchronization
• Week 12 . . . Synchronization
• Week 13 . . . Synchronization
• Week 14 . . . Inter-process communication
• Week 15 . . . Inter-process communication
• Week 16 . . . Final Exam
Embedded Software/Hardware Curriculum
• Software Curriculum
Programming Language
System Programming
Data Structures
Microprocessor
Computer Architecture
Hardware C, C++, Java, …
Operating Systems
System Programming
• Computer systems
Computer hardware
(CPU, RAM, VGA, HDD, etc) Operating systems
(Windows, Mac OS X, Linux, etc) Applications
(Chrome, Powerpoint, Word, etc)
System Programming
• Embedded systems
Embedded Operating systems (Linux, uCos, VxWorks, etc)
User Applications
System Programming
Computer hardware Operating systems Applications
CPU
HDD keyboard
mouse
monitor printer RAM
kernel
User applications
Architecture dependent kernel Libraries
File systems
Inter-process communication I/O and device management
Process management
User space
System call interface
Kernel space
History of Microprocessors
• Microprocessors are first introduced by Intel in 1971
• Intel 8085 has an internal memory
• 4 bit microprocessor (Intel 4004) ->
8 bit microprocessor (Intel 8080) ->
16 bit microprocessor (Intel 80186) ->
32 bit microprocessor (Intel 80386 or later) ->
64 bit microprocessor (Intel Pentium)
• Addressing space of 4kB (Intel 4004) ->
64kB (Intel 8085) -> 1MB (Intel 8086) ->
16MB (Intel 80286) -> 4GB (Intel 80386) ->
64GB (Intel Pentium)
• Cache memory was introduced with Intel 80486
Intel 4004
Intel 8080
Intel 8086
Intel 80186 80286 80386 80486
Intel Pentium
History of Operating Systems
• Major OS’s
– Windows – Max OS – Linux – Unix
– Embedded OS’s (Android, iOS)
– Real-time OS’s
History of Operating Systems
• A brief history of OS’s
– Mainframes: from 1950’s
• Earliest computers had no OS
• Every computer has its own OS (Proprietary OS)
• Single stream batch processing
• VMX
• Early Unix (Unix was invented at AT&T Bell Labs)
• Shared by many users (multiuser OS was needed)
– Early personal computers: late 1970’s
• PCs: Altair, Altari ST, TRS 80, Commodore 64, Apple 2
History of Operating Systems
• A brief history of OS’s
– PC’s and Macs: early 1980’s
• Thanks to microprocessors, personal computers become popular
• IBM requested MS for an OS
• MS bought 86-DOS from Seattle Computer Products
• MS developed DOS (Disk Operating System)
• DOS was a command-line OS and backward compatible with CP/M
– GUI (Graphical user interface): 1980’s
• First developed at Xerox PARC research center
• Xerox 8010, Apple Lisa, Apple Macintosh
• Microsoft Windows series, X-windows, etc
History of Operating Systems
• A brief history of OS’s
– 1990’s and later
• Microprocessors getting powerful
• Multi-threading and multi-processing
• Types of operating systems
– Simple Batch System
– Multiprogramming Batch System (time-sharing systems) – Multiprocessor System
– Distributed Operating System
Linux
• Unix-like operating system
– First developed by Linus Torvald in 1991
– Linux is based on a free source code version of UNIX – This source is compiled to Intel CPU machine code – You can run UNIX-based code on cheap PC hardware
– Internal SW architecture is circa 1960’s (A multi-user OS for a single-user machine)
– Runs on many different hardware platforms
• Distributions
– Debian (Raspbian, Ubuntu, etc) : non-commercial – Fedora (Red Hat, etc) : commercial
– Various other distributions (OpenSUSE, Android, etc)
C Program Development Environment
• Phases of C++ (or C) Programs:
– Edit
– Preprocess – Compile – Link
– Load – Execute
Preprocessor program processes the code.
Loader puts program in memory.
Compiler creates object code and stores
it on disk.
Linker links the object code with the libraries
Loader
Primary Memory Compiler
Editor
Preprocessor
Linker
Disk
Disk
Disk
Disk Disk
Program is created in the editor and stored on disk.
. . .