Kernel Exercise 5 Brandon Cline Stuart Fischer Rachel Langhans Brian Minter Adam Stasio.

Slides:



Advertisements
Similar presentations
Christo Wilson Project 2: User Programs in Pintos
Advertisements

CSCC69: Operating Systems
Using VMX within Linux We explore the feasibility of executing ROM-BIOS code within the Linux x86_64 kernel.
Versioning Extensions for Linux CS736 Spring 1999 J. Adam Butts Paramjit Oberoi.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
1 Speaker: I-Wei Chen Operating Systems, Spring 2002 Project #1: Adding a System Call.
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
Add a New System Call to Linux. Hw1 Add a New System Call to Linux and Compile Kernel Add a New System Call to Linux by Kernel Module.
Synchronization (other solutions …). Announcements Assignment 2 is graded Project 1 is due today.
Project #1, Linux Kernel Modifications CS-502 Fall Programming Project #1 Linux Kernel Hacking CS-502, Operating Systems Fall 2007.
CSE 451: Operating Systems Section 2 Interrupts, Syscalls, Virtual Machines, and Project 1.
NDT Tools Tutorial: How-To setup your own NDT server Rich Carlson Summer 04 Joint Tech July 19, 2004.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 5: Control Structures II (Repetition)
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 13: Pointers, Classes, Virtual Functions, and Abstract Classes.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 14: Pointers, Classes, Virtual Functions, and Abstract Classes.
Welcome to the World of Nachos CPS 110 Spring 2004 Discussion Session 1.
THE BIG PICTURE. How does JavaScript interact with the browser?
Solutions to the first midterm COSC 4330/6310 Summer 2012.
A First Book of C++: From Here To There, Third Edition2 Objectives You should be able to describe: Function and Parameter Declarations Returning a Single.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Nachos Assignment#1 System calls implementation. What are system calls? Enable you to interact with OS kernel. A switch from User Mode to Kernel Mode.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Overloading Binary Operators Two ways to overload –As a member function of a class –As a friend function As member functions –General syntax Data Structures.
Linux Operations and Administration
System Calls: A Kernel Project Hunter Bell CS Fall
CSE 451 – Operating Systems Section, Autumn 2003 TAs: Mike Swift Adrienne Noble
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
1 CSE 451 Section 2: Interrupts, Syscalls, Virtual Machines, and Project 1.
Chapter 5 Control Structure (Repetition). Objectives In this chapter, you will: Learn about repetition (looping) control structures Explore how to construct.
Operating Systems Lecture November 2015© Copyright Virtual University of Pakistan 2 Agenda for Today Review of previous lecture Hardware (I/O, memory,
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
System Calls. The Linux we use is: Linux-Mandrake 7.0. In this project, you are going to change some kernel files and recompile the kernel. After you.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Test Specifications A Specification System for Multi-Platform Test Suite Configuration, Build, and Execution Greg Cooksey.
LOGO System Call. Introduction System call is the mechanism used by an application program to request service from the OS. Users use it to communicate.
Artificial Intelligence Lecture No. 26 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Operating Systems Process Creation
1 Week 7 System Calls, Kernel Threads, Kernel Debugging Sarah Diesburg Florida State University.
An Introduction to Programming with C++ Sixth Edition Chapter 10 Void Functions.
Genesis: From Raw Hardware to Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 5: Control Structures II (Repetition)
Functions Functions, locals, parameters, and separate compilation.
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
Winter 2016CISC101 - Prof. McLeod1 CISC101 Reminders Quiz 3 next week. See next slide. Both versions of assignment 3 are posted. Due today.
1 COMP 3500 Introduction to Operating Systems Project 4 – Processes and System Calls Overview Dr. Xiao Qin Auburn University
1 COMP 3500 Introduction to Operating Systems Project 4 – Processes and System Calls Part 3: Adding System Calls to OS/161 Dr. Xiao Qin Auburn University.
CSNB334 Advanced Operating Systems 3. Kernel Structure and Organization Lecturer: Abdul Rahim Ahmad.
S ALVATORE DI G IROLAMO (TA) Networks and Operating Systems: Exercise Session 1.
1 COMP 3500 Introduction to Operating Systems Project 4 – Processes and System Calls Part 4: Managing File System State Dr. Xiao Qin Auburn University.
Computer System Structures
Add a New System Call to Linux
Note: Some of the slides are repeated from Introduction to C++
Basic concepts of C++ Presented by Prof. Satyajit De
Winter 2009 Tutorial #6 Arrays Part 2, Structures, Debugger
How & When The Kernel Runs
Chapter 13: Pointers, Classes, Virtual Functions, and Abstract Classes
Protection of System Resources
Chapter 10: Void Functions
FIGURE 4-10 Function Return Statements
Functions, locals, parameters, and separate compilation
CSI-121 Structured Programming Language Lecture 14 Functions (Part 2)
Genesis: From Raw Hardware to Processes
Exercise 6 from Gary Nutt’s Kernel Projects for Linux
Build A New Kernel and Add New System Calls in A Linux OS
Operating Systems Lecture 3.
How & When The Kernel Runs
Chapter 5: Control Structures II (Repetition)
System calls….. C-program->POSIX call
Presentation transcript:

Kernel Exercise 5 Brandon Cline Stuart Fischer Rachel Langhans Brian Minter Adam Stasio

Problem Statement Add a new function of return type “int” to the Linux kernel called “pedagogictime(int flag, struct timeval *thetime)” This function should return the current system time using a reference parameter If the “flag” parameter is TRUE, the function should print the system time using stdout. Function should return TRUE if successful, FALSE otherwise. Create a user-space program to test the new system call

Why Modify the Kernel? Changing the kernel allows a user to customize the OS for his or her individual needs. Kernel functions execute in kernel mode and have direct access to kernel variables and hardware I/O but can be initiated in user space. An effectively modified kernel/OS can enhance the productivity of a company or organization.

Modified Files /usr/src/linux /arch/i386/kernel/entry.S /usr/src/linux /include/asm/unistd.h /usr/src/linux /kernel/Makefile

entry.S At the end of the list of.long SYMBOL_NAME(…) statements, we added the entry for our system call.long SYMBOL_NAME(sys_pedagogictime)

unistd.h At the end of the list of #define __NR_…### We added: #define __NR_pedagogictime191

Makefile O_TARGET := kernel.o O_OBJS = …pedagogictime.o

Created Files /usr/src/linux /include/linux/pedagogictime.h –The header file for the system call’s operational code /usr/src/linux /kernel/pedagogictime.c –The system call’s operational code /mytest.c –The program used to test the new system call

Process for Rebuilding the Kernel make clean make oldconfig make dep OR make depend make make install reboot

Difficulties Encountered Creation of the stub using the syscall2() reference Instructions in the exercise book were geared towards mandrake Figuring out how to reference external variables Correct de-referencing of passed structs Make sometimes unable to locate files that we did not modify and were correctly placed. This was fixed by altering the associated #include statements. Some group members unfamiliar with C

Summary… What we learned How to modify the Linux kernel. Alterations to the kernel can improve productivity Versions of Linux are often different from one another requiring different methods of modification. Making changes to the Linux kernel is a fairly simple process, though it does take a while to learn to do effectively.