SlideShare a Scribd company logo
CSCE 510 -
Systems
Programming
Lecture 01 - Template
CSCE 510 Jan 14, 2013
Overview
Last Time
 Outback
Readings for today
 Text Chapter 1 and 2
Prologue
 A Brief History - Systems programming and Unix (Chap 1)
Interlude - Course Pragmatics, CS man of the day, Quiz
Epilogue
 fundamental Unix/systems programming (Chap 2)
 Kernel, Shell, Users/groups, Directory Hierarchy
 File I/O model
 processes
What is Systems Programming?
 Systems Software
 Donavon Diagram
1/14/2013 CSCE 510 Sp
13 -
Slide - 3
Systems Programming by John Donovan, 1972
The Dark Ages - JCL
1/14/2013 CSCE 510
Slide - 4
 Darkages ~ 1972
 JCL?
 Batch Processing
 Job card?
Systems Programming by John Donovan, 1972
What is CSCE 510?
 First version – assembly language,
 macro processors,
 linkers …
 Unix/C version circa 1987  2002 version
 Make
 M4/cpp macro processors
 Shell1: variables, regexps, filename completion, history
 Shell2: I/O redirection, signals, …
 webserver
 2008 Summer version – done in ruby
1/4/2013 CSCE 510 Sp 13
-
Slide - 5
CSCE 510 - 2005
CSCE 510 the 2013 version
1/4/2013 CSCE 510 Sp 13
-
Slide - 7
 The Usual Suspects: programming assignments
 ls, ar, cpp/m4, shell1, shell2, webserver0, SSH
 New possibilities
 Windows – don’t get me started
 Environments: Rails, Posix Threads, Iphone/Android Apps, Vmware,
Cloud Computing, SourceForge, GitHub
 Unix Software: Shells. Gcc/g++, make, script/pseudo-terminals
 Tools: Valgrind, Cucumber/capybara, Rspec, gdb,
 Database: Mysql; postgress
 Languages: …
 Editors/IDEs: Nano/pico, Vi/Vim, Emacs, OS X Textmate
 IDE: Eclipse Netbeans
 Software Engineering: Agile, Git, Junit, Bugzilla,
Which Language?
1/4/2013 CSCE 510 Sp 13
-
Slide - 8
 Linux Journal Best of 2012
 Best Programming Language
 Python 28%
 C++ 19%
 C 18.9%
 Java 8.2% Perl 6.1% Other 4% Ruby 3.1% JavaScript
2.4% C# .7% Erlang .7% Haskell
 (2012-12-02). Linux Journal December 2012 (Kindle
Locations 1628-1633). BELLTOWN MEDIA INC. Kindle
Edition.
Linux Journal December 2012
1/4/2013 CSCE 510 Sp 13
-
Slide - 9
Linux Journal December 2012
More Linux Journal Best of 2012
1/4/2013 CSCE 510 Sp 13
-
Slide - 10
 Best IDE –Eclipse 27%, vim 26%, Netbeans 5% …
 BEST REVISION CONTROL SYSTEM Git 63%, Subversion 18.6%, …
 BEST OPEN-SOURCE CONFIGURATION MANAGEMENT TOOL – Puppet
42% …
 BEST PLATFORM FOR DEVELOPING RICH INTERNET APPS - HTML5 87%
 BEST PACKAGE MANAGEMENT APPLICATION – apt 34%
 BEST CONTENT MANAGEMENT SYSTEM
 WordPress 35%, Drupal 28%, Joomla 15%
 BEST LINUX-FRIENDLY WEB HOSTING COMPANY–other 19%
 BEST LINUX BOOK
 Tie between Linux in a Nutshell and Debian Administrator’s Handbook
 Second place goes to The Linux Programming Interface: A Linux and UNIX
System Programming Handbook, by Michael Kerrisk.
 BEST OTHER LINUX-BASED GADGET – Raspberry Pi
Linux Journal December 2012
A Brief History of Time (UNIX and C)
1/4/2013 CSCE 510 Sp 13
-
Slide - 11
 1969 – First Unix Ken Thompson at AT&T Bell Labs
 Unix pun on MULTICS
 Ideas from Multics:
 Tree structured file system
 Program for interpreting commands (shell)
 Files – unstructured streams of bytes
 1970 Unix rewritten in assembly for DEC PDP-11
 C – Dennis Ritchie – a systems programming language
 BCPL  B (Thompson)  C
 1970 Kernel rewritten in C – eases porting to other
machines
 1984 Turing Award Lecture – C compiler learned
backdoor
Chapter 1 and …
Berkeley Software Division (BSD)
1/4/2013 CSCE 510 Sp 13
-
Slide - 12
 (1975) Thompson visiting Prof. at UC-Berkeley
 A student Bill Joy added new features
 Vi editor
 C shell
 First paging virtual memory management (Unix) BSD 4.2
 Sendmail, Pascal compiler
 Later co-founded Sun Microsystems
 BSD 4.2 (1983) – full TCP/IP & sockets API
Unix after Unix 7th Edition (1979)
1/4/2013 CSCE 510 Sp 13
-
Slide - 13
 BSD continued at UC-Berkeley
 Bell Labs System III  Systems V
 POSIX standard (1988)
 Other Software
 X windows
 Free Software Foundation
 GNU Public License
 Minix – (1988)Unix like; MINI-uniX; for education; A.
Tannenbaum
1/4/2013 CSCE 510 Sp 13
-
Slide - 14
 .
http://en.wikipedia.org/wiki/Linux
GNU
1/4/2013 CSCE 510 Sp 13
-
Slide - 15
 Recursive acronym “GNU’s not UNIX”
 http://www.gnu.org/ not http://www.gnu.com/
 Richard Stallman (1983) Goal a free Unix
 Known for Free Software movement, GNU, Emacs, gcc
 Never really released GNU operating system
 Free Software Foundation
 http://www.fsf.org/
http://en.wikipedia.org/wiki/GNU
Linux -
1/4/2013 CSCE 510 Sp 13
-
Slide - 16
 (1991) Linus Torvalds
 For Intel x86 systems
 Moved to big Iron
 more than 90% of today's 500 fastest
supercomputers run some variant of Linux
 Network routers
 Embedded systems
 Android
http://en.wikipedia.org/wiki/Linux
Computer Science Concepts- Interrupt
1/4/2013 CSCE 510 Sp 13
-
Slide - 17
 Mr. Smith has a plan that
he is executing
 “run for touchdown”
 Suddenly an interrupt
arrives
 Clowney
 Now he is executing
another plan
 Find helmet, walk to
sideline
Course Pragmatics
1/4/2013 CSCE 510 Sp 13
-
Slide - 18
 Text: The Linux Programming Interface by M. Kerrisk
 Website:
 http://www.cse.sc.edu/~matthews/Courses/510/index.html
 Code Examples
 CSE linux server /class/csce510-001
 Assignments –
 Dropbox - https://dropbox.cse.sc.edu/
 Late HW – not accepted
Provost’s Retreat
1/4/2013 CSCE 510 Sp 13
-
Slide - 19
 Best and Worst Classes
 Dr. Buell’s note
Homework Assignment
1/4/2013 CSCE 510 Sp 13
-
Slide - 20
 Write a C/C++ program to read command line
arguments and just print them.
 Read “man getopt” (all sections).
 What sections of the manual has a getopt section?
 What types of strings does getopt usually process?
References
1/4/2013 CSCE 510 Sp 13
-
Slide - 21
 Text: The Linux Programming Interface by M. Kerrisk
 http://man7.org/tlpi/
 Other Books
 Adv Prog in Unix Environment (APUE) by Richard Stevens
(Rago 2nd ed)
 http://www.kohala.com/start/apue.html
 http://www.apuebook.com/ 2nd edition site – code etc
 C by Kernighan and Ritchie (K&R) 2nd edition
 http://en.wikipedia.org/wiki/The_C_Programming_Language
 http://clc-wiki.net/wiki/K%26R2_solutions
 http://cm.bell-labs.com/who/dmr/
1/4/2013 CSCE 510 Sp 13
-
Slide - 22
 Linux in general
 http://www.linux.org/
 Man Pages
 http://man7.org/linux/man-pages/index.html
 Slashdot
 StackOverflow
 Python
 http://www.python.org/
 http://docs.python.org/2/tutorial/
The kernel
1/4/2013 CSCE 510 Sp 13
-
Slide - 23
 What is the kernel?
 What distinguishes it from the Operating System?
Kernel Tasks
1/4/2013 CSCE 510 Sp 13
-
Slide - 24
 Process scheduling
 Memory management
 File System
 Access to devices
 /dev – device drivers
 Networking
 System call API
Kernel Mode and user mode
1/4/2013 CSCE 510 Sp
13 -
Slide - 25
 When an application
makes a system call
 Time command
hermes> time make
… 10 pages of compiles .. uses cc
real 0m33.067s
user 0m13.545s
sys 0m5.596s
hermes>
Directory Hierarchy – fig 2.1
1/4/2013 CSCE 510 Sp 13
-
Slide - 26
File Types
1/4/2013 CSCE 510 Sp 13
-
Slide - 27
 Filenames
 Regular files
 Special Files
 Directory
 . (this directory),
 ..(my parent),
 list of files contained (filename and inode number)
 od –c . “used to work” but alas no longer
 Symbolic link
hermes> ln –s README link
hermes> ls -l link
lrwxrwxrwx 1 matthews faculty 6 2013-01-13 17:51 link -> README
Pathnames
1/4/2013 CSCE 510 Sp 13
-
Slide - 28
 Unix basic commands with hierarchy
 Current working directory – each running process has a
“current working directory” assigned to it
 cd dir - (change directory to dir)
 pwd
 Relative paths
 Absolute Paths – start with /
 / = root of the directory hierarchy
The /class subtree
1/4/2013 CSCE 510 Sp 13
-
Slide - 29
 Examples
 ?
 Code
 TLPI
 APUE
The Shell
1/4/2013 CSCE 510 Sp 13
-
Slide - 30
 Command interpreter in original Unix
 Read command
 Perhaps pre-process command
 Fork/execute
 Return exit status of command
 A little history revisited
 Bourne Shell (sh)
 C chell
 Korn shell
 Bourne Again shell (bash)
Users, Groups and Permissions
1/4/2013 CSCE 510 Sp 13
-
Slide - 31
 User ID (UID)
 Setuid
 Group (GID)
 Permissions
hermes> ls -l
…
drwxr-xr-x 2 matthews faculty 57 2012-10-15 09:54 acl
 Super user = root; sudo
Man – the Online Manual
1/4/2013 CSCE 510 Sp 13
-
Slide - 32
 The sections of the manual
1. Commands
2. System Calls
3. Library functions
4. Special files (usually found in /dev)
5. File formats and conventions eg /etc/passwd
6. Games
7. Miscellaneous (including macro packages and
conventions), e.g. man(7), groff(7)
8. System administration commands (usually only for root)
9. Kernel routines [Non standard]
Man command
Man – the command
1/4/2013 CSCE 510 Sp 13
-
Slide - 33
hermes> man chmod
CHMOD(1) User Commands CHMOD(1)
NAME
chmod - change file mode bits
SYNOPSIS …
 man –k chmod
 man –s 2 chmod
 Online
 http://man.he.net/
 http://www.tldp.org/guides.html
 http://man7.org/linux/man-pages/index.html

More Related Content

Similar to 510Lec01-Overview.pptx

Shell tutorial
Shell tutorialShell tutorial
Shell tutorialVu Duy Tu
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
Nugroho Gito
 
CEIS106_Final_Project.pptx.pdf
CEIS106_Final_Project.pptx.pdfCEIS106_Final_Project.pptx.pdf
CEIS106_Final_Project.pptx.pdf
luxasuhi
 
Intro tounix (1)
Intro tounix (1)Intro tounix (1)
Intro tounix (1)
Raj Mirje
 
Unikernels - Bristech June 2016
Unikernels - Bristech June 2016 Unikernels - Bristech June 2016
Unikernels - Bristech June 2016
Daniel Drozdzewski
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
KiranMantri
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questionsKavya Sri
 
Advanced Bash Scripting Guide 2002
Advanced Bash Scripting Guide 2002Advanced Bash Scripting Guide 2002
Advanced Bash Scripting Guide 2002duquoi
 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
Anatoliy Okhotnikov
 
Linux
LinuxLinux
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
Vincent Batts
 
POS 433 Entire Course NEW
POS 433 Entire Course NEWPOS 433 Entire Course NEW
POS 433 Entire Course NEW
shyamuopuopeleven
 
Threads presentation
Threads presentationThreads presentation
Threads presentation
Lawrence Galvez
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notification
Mahendra M
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device drivers
Alexandre Moreno
 
6202942
62029426202942
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Hajime Tazaki
 

Similar to 510Lec01-Overview.pptx (20)

Shell tutorial
Shell tutorialShell tutorial
Shell tutorial
 
Linux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of TechnologyLinux Survival Kit for Proof of Concept & Proof of Technology
Linux Survival Kit for Proof of Concept & Proof of Technology
 
CEIS106_Final_Project.pptx.pdf
CEIS106_Final_Project.pptx.pdfCEIS106_Final_Project.pptx.pdf
CEIS106_Final_Project.pptx.pdf
 
Intro tounix (1)
Intro tounix (1)Intro tounix (1)
Intro tounix (1)
 
Unikernels - Bristech June 2016
Unikernels - Bristech June 2016 Unikernels - Bristech June 2016
Unikernels - Bristech June 2016
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 
Advanced Bash Scripting Guide 2002
Advanced Bash Scripting Guide 2002Advanced Bash Scripting Guide 2002
Advanced Bash Scripting Guide 2002
 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
 
Linux
LinuxLinux
Linux
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
 
Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02Unixshellscript 100406085942-phpapp02
Unixshellscript 100406085942-phpapp02
 
Linux training
Linux trainingLinux training
Linux training
 
POS 433 Entire Course NEW
POS 433 Entire Course NEWPOS 433 Entire Course NEW
POS 433 Entire Course NEW
 
Threads presentation
Threads presentationThreads presentation
Threads presentation
 
3DD 1e 31 Luglio Apertura
3DD 1e 31 Luglio Apertura3DD 1e 31 Luglio Apertura
3DD 1e 31 Luglio Apertura
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notification
 
brief intro to Linux device drivers
brief intro to Linux device driversbrief intro to Linux device drivers
brief intro to Linux device drivers
 
6202942
62029426202942
6202942
 
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
 

Recently uploaded

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 

Recently uploaded (20)

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 

510Lec01-Overview.pptx

  • 1. CSCE 510 - Systems Programming Lecture 01 - Template CSCE 510 Jan 14, 2013
  • 2. Overview Last Time  Outback Readings for today  Text Chapter 1 and 2 Prologue  A Brief History - Systems programming and Unix (Chap 1) Interlude - Course Pragmatics, CS man of the day, Quiz Epilogue  fundamental Unix/systems programming (Chap 2)  Kernel, Shell, Users/groups, Directory Hierarchy  File I/O model  processes
  • 3. What is Systems Programming?  Systems Software  Donavon Diagram 1/14/2013 CSCE 510 Sp 13 - Slide - 3 Systems Programming by John Donovan, 1972
  • 4. The Dark Ages - JCL 1/14/2013 CSCE 510 Slide - 4  Darkages ~ 1972  JCL?  Batch Processing  Job card? Systems Programming by John Donovan, 1972
  • 5. What is CSCE 510?  First version – assembly language,  macro processors,  linkers …  Unix/C version circa 1987  2002 version  Make  M4/cpp macro processors  Shell1: variables, regexps, filename completion, history  Shell2: I/O redirection, signals, …  webserver  2008 Summer version – done in ruby 1/4/2013 CSCE 510 Sp 13 - Slide - 5
  • 6. CSCE 510 - 2005
  • 7. CSCE 510 the 2013 version 1/4/2013 CSCE 510 Sp 13 - Slide - 7  The Usual Suspects: programming assignments  ls, ar, cpp/m4, shell1, shell2, webserver0, SSH  New possibilities  Windows – don’t get me started  Environments: Rails, Posix Threads, Iphone/Android Apps, Vmware, Cloud Computing, SourceForge, GitHub  Unix Software: Shells. Gcc/g++, make, script/pseudo-terminals  Tools: Valgrind, Cucumber/capybara, Rspec, gdb,  Database: Mysql; postgress  Languages: …  Editors/IDEs: Nano/pico, Vi/Vim, Emacs, OS X Textmate  IDE: Eclipse Netbeans  Software Engineering: Agile, Git, Junit, Bugzilla,
  • 8. Which Language? 1/4/2013 CSCE 510 Sp 13 - Slide - 8  Linux Journal Best of 2012  Best Programming Language  Python 28%  C++ 19%  C 18.9%  Java 8.2% Perl 6.1% Other 4% Ruby 3.1% JavaScript 2.4% C# .7% Erlang .7% Haskell  (2012-12-02). Linux Journal December 2012 (Kindle Locations 1628-1633). BELLTOWN MEDIA INC. Kindle Edition. Linux Journal December 2012
  • 9. 1/4/2013 CSCE 510 Sp 13 - Slide - 9 Linux Journal December 2012
  • 10. More Linux Journal Best of 2012 1/4/2013 CSCE 510 Sp 13 - Slide - 10  Best IDE –Eclipse 27%, vim 26%, Netbeans 5% …  BEST REVISION CONTROL SYSTEM Git 63%, Subversion 18.6%, …  BEST OPEN-SOURCE CONFIGURATION MANAGEMENT TOOL – Puppet 42% …  BEST PLATFORM FOR DEVELOPING RICH INTERNET APPS - HTML5 87%  BEST PACKAGE MANAGEMENT APPLICATION – apt 34%  BEST CONTENT MANAGEMENT SYSTEM  WordPress 35%, Drupal 28%, Joomla 15%  BEST LINUX-FRIENDLY WEB HOSTING COMPANY–other 19%  BEST LINUX BOOK  Tie between Linux in a Nutshell and Debian Administrator’s Handbook  Second place goes to The Linux Programming Interface: A Linux and UNIX System Programming Handbook, by Michael Kerrisk.  BEST OTHER LINUX-BASED GADGET – Raspberry Pi Linux Journal December 2012
  • 11. A Brief History of Time (UNIX and C) 1/4/2013 CSCE 510 Sp 13 - Slide - 11  1969 – First Unix Ken Thompson at AT&T Bell Labs  Unix pun on MULTICS  Ideas from Multics:  Tree structured file system  Program for interpreting commands (shell)  Files – unstructured streams of bytes  1970 Unix rewritten in assembly for DEC PDP-11  C – Dennis Ritchie – a systems programming language  BCPL  B (Thompson)  C  1970 Kernel rewritten in C – eases porting to other machines  1984 Turing Award Lecture – C compiler learned backdoor Chapter 1 and …
  • 12. Berkeley Software Division (BSD) 1/4/2013 CSCE 510 Sp 13 - Slide - 12  (1975) Thompson visiting Prof. at UC-Berkeley  A student Bill Joy added new features  Vi editor  C shell  First paging virtual memory management (Unix) BSD 4.2  Sendmail, Pascal compiler  Later co-founded Sun Microsystems  BSD 4.2 (1983) – full TCP/IP & sockets API
  • 13. Unix after Unix 7th Edition (1979) 1/4/2013 CSCE 510 Sp 13 - Slide - 13  BSD continued at UC-Berkeley  Bell Labs System III  Systems V  POSIX standard (1988)  Other Software  X windows  Free Software Foundation  GNU Public License  Minix – (1988)Unix like; MINI-uniX; for education; A. Tannenbaum
  • 14. 1/4/2013 CSCE 510 Sp 13 - Slide - 14  . http://en.wikipedia.org/wiki/Linux
  • 15. GNU 1/4/2013 CSCE 510 Sp 13 - Slide - 15  Recursive acronym “GNU’s not UNIX”  http://www.gnu.org/ not http://www.gnu.com/  Richard Stallman (1983) Goal a free Unix  Known for Free Software movement, GNU, Emacs, gcc  Never really released GNU operating system  Free Software Foundation  http://www.fsf.org/ http://en.wikipedia.org/wiki/GNU
  • 16. Linux - 1/4/2013 CSCE 510 Sp 13 - Slide - 16  (1991) Linus Torvalds  For Intel x86 systems  Moved to big Iron  more than 90% of today's 500 fastest supercomputers run some variant of Linux  Network routers  Embedded systems  Android http://en.wikipedia.org/wiki/Linux
  • 17. Computer Science Concepts- Interrupt 1/4/2013 CSCE 510 Sp 13 - Slide - 17  Mr. Smith has a plan that he is executing  “run for touchdown”  Suddenly an interrupt arrives  Clowney  Now he is executing another plan  Find helmet, walk to sideline
  • 18. Course Pragmatics 1/4/2013 CSCE 510 Sp 13 - Slide - 18  Text: The Linux Programming Interface by M. Kerrisk  Website:  http://www.cse.sc.edu/~matthews/Courses/510/index.html  Code Examples  CSE linux server /class/csce510-001  Assignments –  Dropbox - https://dropbox.cse.sc.edu/  Late HW – not accepted
  • 19. Provost’s Retreat 1/4/2013 CSCE 510 Sp 13 - Slide - 19  Best and Worst Classes  Dr. Buell’s note
  • 20. Homework Assignment 1/4/2013 CSCE 510 Sp 13 - Slide - 20  Write a C/C++ program to read command line arguments and just print them.  Read “man getopt” (all sections).  What sections of the manual has a getopt section?  What types of strings does getopt usually process?
  • 21. References 1/4/2013 CSCE 510 Sp 13 - Slide - 21  Text: The Linux Programming Interface by M. Kerrisk  http://man7.org/tlpi/  Other Books  Adv Prog in Unix Environment (APUE) by Richard Stevens (Rago 2nd ed)  http://www.kohala.com/start/apue.html  http://www.apuebook.com/ 2nd edition site – code etc  C by Kernighan and Ritchie (K&R) 2nd edition  http://en.wikipedia.org/wiki/The_C_Programming_Language  http://clc-wiki.net/wiki/K%26R2_solutions  http://cm.bell-labs.com/who/dmr/
  • 22. 1/4/2013 CSCE 510 Sp 13 - Slide - 22  Linux in general  http://www.linux.org/  Man Pages  http://man7.org/linux/man-pages/index.html  Slashdot  StackOverflow  Python  http://www.python.org/  http://docs.python.org/2/tutorial/
  • 23. The kernel 1/4/2013 CSCE 510 Sp 13 - Slide - 23  What is the kernel?  What distinguishes it from the Operating System?
  • 24. Kernel Tasks 1/4/2013 CSCE 510 Sp 13 - Slide - 24  Process scheduling  Memory management  File System  Access to devices  /dev – device drivers  Networking  System call API
  • 25. Kernel Mode and user mode 1/4/2013 CSCE 510 Sp 13 - Slide - 25  When an application makes a system call  Time command hermes> time make … 10 pages of compiles .. uses cc real 0m33.067s user 0m13.545s sys 0m5.596s hermes>
  • 26. Directory Hierarchy – fig 2.1 1/4/2013 CSCE 510 Sp 13 - Slide - 26
  • 27. File Types 1/4/2013 CSCE 510 Sp 13 - Slide - 27  Filenames  Regular files  Special Files  Directory  . (this directory),  ..(my parent),  list of files contained (filename and inode number)  od –c . “used to work” but alas no longer  Symbolic link hermes> ln –s README link hermes> ls -l link lrwxrwxrwx 1 matthews faculty 6 2013-01-13 17:51 link -> README
  • 28. Pathnames 1/4/2013 CSCE 510 Sp 13 - Slide - 28  Unix basic commands with hierarchy  Current working directory – each running process has a “current working directory” assigned to it  cd dir - (change directory to dir)  pwd  Relative paths  Absolute Paths – start with /  / = root of the directory hierarchy
  • 29. The /class subtree 1/4/2013 CSCE 510 Sp 13 - Slide - 29  Examples  ?  Code  TLPI  APUE
  • 30. The Shell 1/4/2013 CSCE 510 Sp 13 - Slide - 30  Command interpreter in original Unix  Read command  Perhaps pre-process command  Fork/execute  Return exit status of command  A little history revisited  Bourne Shell (sh)  C chell  Korn shell  Bourne Again shell (bash)
  • 31. Users, Groups and Permissions 1/4/2013 CSCE 510 Sp 13 - Slide - 31  User ID (UID)  Setuid  Group (GID)  Permissions hermes> ls -l … drwxr-xr-x 2 matthews faculty 57 2012-10-15 09:54 acl  Super user = root; sudo
  • 32. Man – the Online Manual 1/4/2013 CSCE 510 Sp 13 - Slide - 32  The sections of the manual 1. Commands 2. System Calls 3. Library functions 4. Special files (usually found in /dev) 5. File formats and conventions eg /etc/passwd 6. Games 7. Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7) 8. System administration commands (usually only for root) 9. Kernel routines [Non standard] Man command
  • 33. Man – the command 1/4/2013 CSCE 510 Sp 13 - Slide - 33 hermes> man chmod CHMOD(1) User Commands CHMOD(1) NAME chmod - change file mode bits SYNOPSIS …  man –k chmod  man –s 2 chmod  Online  http://man.he.net/  http://www.tldp.org/guides.html  http://man7.org/linux/man-pages/index.html