Week 10 The Linux Kernel More Development Tools CSCI 156.

Slides:



Advertisements
Similar presentations
Drivers and the kernel1-1 Drivers and the kernel UNIX system has three layers: m The hardware m The operating system kernel m The user-level programs Kernel.
Advertisements

Linux Boot Loaders. ♦ Overview A boot loader is a small program that exists in the system and loads the operating system into the system’s memory at system.
Week 8 System Initialization and X Windows. Objectives  Summarize the major steps necessary to boot a Linux system  Configure the LILO and GRUB boot.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
Linux+ Guide to Linux Certification, Second Edition
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Booting the Linux Kernel Dr. Michael L. Collard 1.
Linux+ Guide to Linux Certification, Third Edition
CIS238/DL1 Chapter 15 Rebuilding the Linux Kernel Preparing the Source Code Locating the Source Code Installing the Source Code Read the Documentation.
Linux+ Guide to Linux Certification, Second Edition
S.Ha.R.K. Workshop28/02/05 S.Ha.R.K. Installation HowTo Tullio Facchinetti University of Pavia - Italy.
The Boot process. Booting on a PC POST –Hardware test – may not run CPU ie fan not working CPU start-up –Jumps to fixed location to execute BIOS code.
COMPUTER SYSTEM LABORATORY Lab4 - Bootloader. Lab 4 Experimental Goal Learn how to build U-Boot bootloader for PXA /10/8/ 142.
Operating Systems Lab. (#2) University of Tehran – ECE Dept. Fall 2005 Reza Shokri
Source code indexer. What does it do?  Indexes source code for fast lookups of methods, variables, structs, macros, …  But LXR does this… Ctags can.
Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.
Linux Booting Procedure
LOGO Linux Installation. Linux Distribution Including shells, libraries, tools, compiler, servers, applications. Redhat, Fedora, Mandrake, SuSE, Debian,
OS Installing CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.
COSC 4750 Customizing and maintenance. Installing software Redhat/Fedora (and linux in general) has a package installer, called rpm Many programs will.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Chap 1 ~ Introducing LINUX LINUX is a free-stable multi-user operating system that derives from UNIX operating system Benefits: 1) Linux is released under.
Linux in a Virtual Environment Nagarajan Prabakar School of Computing and Information Sciences Florida International University.
Porting Operating Systems Phan Duy Hùng (PhD) ES Lecturer – Hanoi FPT University.
Sogang University Advanced Operating Systems (Linux Module Programming) Sang Gue Oh, Ph.D.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
1 What is a Kernel The kernel of any operating system is the core of all the system’s software. The only thing more fundamental than the kernel is the.
Linux Administration. Pre-Install Different distributions –Redhat, Caldera, mandrake, SuSE, FreeBSD Redhat Server Install –Check HCL –Significant issues.
Troubleshooting and Performance
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 13 Understanding and Installing Windows 2000 and Windows NT.
OPERAING SYSTEM 1 CA-210 WINDOWS XP. CHAPTER 1 OPERATING SYSTEM FUNDAMENTALS.
Linux Kernel Management. Module 9 – Kernel Administration ♦ Overview The innermost layer of Linux operating system is the kernel, which is a thin layer.
Linux Operations and Administration Chapter Twenty Advanced Linux Administration.
National Taiwan University OS Project 0 & 1 Advisor: Dr. Chih-Wen Hsueh Student: Tang-Hsun Tu 台灣大學 網媒所 / 資工所 Wireless Networking and Embedded Systems Laboratory.
Hp education services education.hp.com hp education services education.hp.com 1 HP World/Interex 2002 Linux Kernel Configuration and Patching Chris Cooper.
OS Project 0 February 25, Outline  Linux Installation  Linux Kernel Compilation  System Call Development  Kernel Modules / 452.
LOGO Linux Installation. Linux Distribution Including shells, libraries, tools, compiler, servers, applications. Redhat, Fedora, Mandrake, SuSE, Debian,
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
Linux Kernel Programming (LKP). LKP New sub-course New sub-course We will learn together We will learn together Evaluation of this part of course will.
Linux Operation System Computer Operation Manual.
The Linux Operating System R.Bigelow. What is an Operating System An operating system is a collection of programs that manage a computer's resources.
IT Essentials 1 v3 Module 4 JEOPARDY IT Essentials 1 RouterModesWANEncapsulationWANServicesRouterBasicsRouterCommands RouterModesWANEncapsulationWANServicesRouterBasicsRouterCommands.
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
Embedded Software Design Week II Linux Intro Linux Kernel.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Spring 2007 Vmware and Linux kernel COMS W4118 Columbia University.
Chap 1 ~ Introducing LINUX LINUX is a free-stable multi-user operating system that derives from UNIX operating system Benefits: 1) Linux is released under.
Rebuilding Linux Kernel Dedicated to penguin lovers everywhere 26 September 20161Rebuilding kernel by Visakh M R.
Chap- 2 BOOTING & SHUTDOWN LINUX SYSTEM Created by: Asst. Prof. Ashish Shah, J.M.PATEL COLLEGE, GOREGOAN W 1.
1 COP 4343 Unix System Administration Unit 1: –Linux OS structure –Distributions –Hardware inventory –Disks and partitions –Installation steps –Boot loader.
Introduction to Operating Systems Concepts
Computer System Structures
Operating System Kernel Compilation
OS – Ex 1 Nezer J. Zaidenberg.
Chapter 8 Unix & Linux.
GRUB 2 Dave Soergel.
Linux Kernel Module Programming
Drivers and the kernel UNIX system has three layers: Kernel
Operating System Kernel Compilation
Chapter 2: System Structures
IS3440 Linux Security Unit 7 Securing the Linux Kernel
Chapter Overview Operating System Basics
COP 4343 Unix System Administration
Computer System Laboratory
Linux Operation System
Operating System Kernel Compilation
Presentation transcript:

Week 10 The Linux Kernel More Development Tools CSCI 156

Types of Kernels Monolithic –One large executable does everything –Advantages: speed –Disadvantages: inflexible Microkernel –Small core, interacts with modules in user space. Almost everything done in modules –Advantages: highly modifiable –Disadvantages: typically slower

The Linux Kernel Hybrid! (best of both worlds) –Monolithic kernel with modular support –Modules are inserted into the running kernel thus, everything runs in kernel space –Keep the speed, add the flexibility Linux kernel can be built as purely monolithic –Disadvantages: huge, slows booting, hogs RAM –Advantages: some older hardware has problems with modules

Loading Modules Module loding utilities (must be root) –lsmod – list currently running modules –insmod – insert module into kernel (requires.o) –modprobe – smarter insmod: uses module name –rmmod – remove module from kernel Some modules loaded at startup –In Fedora 2 (these machines) /etc/modprobe.conf –Other systems /etc/modules.conf –(Redhat = Evil)

Writing a Module Big Learning Curve –Memory allocation is different in kernel-space –Allow for pre-emption Alternatives –Hijacking system calls to add/modify: #include pid_t getpid(void) { printf("w00t!\n"); return syscall(SYS_getpid); } gcc -Wall -fPIC -shared -o getpid.so getpid.c LD_PRELOAD=./getpid.so bash -c 'echo $$' To Run:

Building the Kernel Steps –Download the source to /usr/src/linux-version –configure the kernel make menuconfig –build the kernel make bzImage –build the kernel modules make modules && make modules_install How long does it take? –30 minutes w/kernel hacking disabled: 1.2MB –45 minutes w/kernel hacking enabled: 1.3MB

Installing the Kernel Bold replacement –cp arch/i386/boot/bzImage /boot/bzImage-version –what if the kernel fails to boot? Safety Net –cp arch/i386/boot/bzImage /boot/MYIMG-version Using the safety net: –How to specify which kernel to boot (old/new)?

GRUB Bootloader, configured with grub.conf –In the /boot/grub dir (or /etc/grub.conf) –Naming convention: /dev/hda2 -> (hd0,1) –Must specify title, root drive, kernel –Allows for dual-booting multiple Oss Even multiple versions of the same OS: tweak away! Other options –LILO: older boot-loader, fallen out of use –others for other hardware (non-i386) this room?

Switching Gears...Tools ctags –ctags -R recurse through all directories, find tags –while in vim: CTRL-] –jumps to function definition CTRL-T –jumps back to the caller gd –in command mode, go to local variable definition CTRL-N –in insert mode, complete the variable/method name

Method Folding In vim: –:set foldmethod=indent –:set foldlevel=0 –on a folded method: zO to expand/unfold –on an unfolded method: zC to close/fold