Operating System Kernel Compilation

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

1 Virtualization, Compilation, Intro to Project 2 Sarah Diesburg 9/15/2010 COP4610 / CGS5765.
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.
1 Web Server Administration Chapter 3 Installing the Server.
Project 0: Linux & VM Dabbling CS-502, Fall Project 0: Linux & Virtual Machine Dabbling CS-502, Operating Systems.
Overview Basic functions Features Installation: Windows host and Linux host.
Embedded Programming and Robotics Lesson 12 Introducing the Raspberry Pi Intro to Raspberry Pi1.
Eucalyptus Virtual Machines Running Maven, Tomcat, and Mysql.
Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.
CSN08101 Digital Forensics Lecture 1B: Essential Linux and Caine Module Leader: Dr Gordon Russell Lecturers: Robert Ludwiniak.
Kernel Development using Virtualization Installing VMWare and using a virtual machine to build and test a Linux Kernel.
VMWare Workstation Installation. Starting Vmware Workstation Go to the start menu and start the VMware Workstation program. *Note: The following instructions.
NUMOSS NURUL ‘IZZATI BINTI OTHMAN A
CIS 191 – Lesson 2 System Administration. CIS 191 – Lesson 2 System Architecture Component Architecture –The OS provides the simple components from which.
LOGO Linux Installation. Linux Distribution Including shells, libraries, tools, compiler, servers, applications. Redhat, Fedora, Mandrake, SuSE, Debian,
Booting. Booting is the process of powering it on and starting the operating system. power on your machine, and in a few minutes your computer will be.
COSC 4750 Customizing and maintenance. Installing software Redhat/Fedora (and linux in general) has a package installer, called rpm Many programs will.
Exercise #1: Exploring Open- Source Operating Systems with Virtual Machines J. H. Wang Mar. 9, 2010.
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.
CMSBrownBag,05/29/2007 B.Mangano How to “use” CMSSW on own Linux Box and be happy In this context “use” means: - check-out pre-compiled CMSSW code - run.
09/21/081 Ho Chi Minh city University of Technology Linux kernel R.M. Introduction of building Linux kernel from source.
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.
Exercise #1: Exploring Open- Source Operating Systems with Virtual Machines J. H. Wang Sep. 25, 2015.
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,
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
Implementation of Embedded OS
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
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.
Linux Introduction Linux was developed in the early 1990’s by Linus Torvald computer science student at the University of Helsinki Linux is distributed.
Rebuilding Linux Kernel Dedicated to penguin lovers everywhere 26 September 20161Rebuilding kernel by Visakh M R.
Security Risk Assessment Determine how important your computer is to your group ● Mission critical? ● Sensitive information? ● Expensive hardware? ● Service.
BY: SALMAN 1.
Working with Windows 7 at CERN
Andrea Chierici Virtualization tutorial Catania 1-3 dicember 2010
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 20, 2016.
Class Projects and Environment
RASPBERRY PI WORKSHOP.
GRUB 2 Dave Soergel.
Implementation of Embedded OS
Programming Tools Most of the programming assignments will require using the C language. We will use a current version of the GCC C compiler. What’s GCC?
Chapter Objectives In this chapter, you will learn:
BY: SALMAN.
Seamless Guest OS's and more!
Computer System Laboratory
OS Homework 1 February 22, 2017.
Java on the LEGO Mindstorms EV3
Drivers and the kernel UNIX system has three layers: Kernel
linux and related thing
Testing new kernels is easy and important – you should do it, too!
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 19, 2017.
Lab 1 introduction, debrief
Creating a Windows 10 Virtual machine
Engineering Innovation Center
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Operating System Kernel Compilation
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 21, 2018.
IS3440 Linux Security Unit 7 Securing the Linux Kernel
SUSE Linux Enterprise Desktop Administration
OPS235: Week 1 Installing Linux ( Lab1: Investigations 1-4)
Chapter 11 Supporting Printers and Scanners
Class Projects and Environment
Chapter 9 Linux Installation Procedures
Lecture9: Embedded Network Operating System: cisco IOS
Software - Operating Systems
Installing Windows Exam: 902
Linux Operation System
Operating System Kernel Compilation
Lecture9: Embedded Network Operating System: cisco IOS
Presentation transcript:

Operating System Kernel Compilation Sarah Diesburg CS 3430 Operating Systems

Kernel Coding The next project involves compiling a new kernel! Fun but challenging…. Each person/team will get their own virtual machine(s) See website instructions for how to install/use the virtual machine

Booting with the Bootloader (grub2) The newest version of the kernel will boot by default Look in the submenu (or further down the list) for any older version

Logging In Username: os Password: os Username: root Password: iamr00t

No GUI/Desktop? I disabled it by default (to run faster) If you really want it, issue (as root) #> systemctl set-default multi-user.target If you want to turn it off again, issue (as root) #> systemctl set-default graphical.target

Communicating with your fresh virtual machine Use ssh Log into the terminal, and issue /sbin/ifconfig to get the second IP address Type the IP address directly into PuTTY Transfer files Must use Winscp or Filezilla with the IP address found above Basically, communicate with it the same way you communicated with the student.cs.uni.edu machine

SSH/WinSCP Demo…

If you created your own virtual machine…. Good for you! You will want to install these packages: gcc make ssh vim / emacs / (your choice of editor) sudo libncurses5-dev

Basic System Commands $> passwd $> su $> sudo Change your password $> su Become root directly. Use root’s password when prompted. $> sudo Do something with root’s privileges without having to become root

Basic System Commands $> chown –R os:os <dir> Changes ownership of dir to user/group os $> adduser <username> Adds user specified by username $> userdel <username> Deletes user specified by username

Kernel Compilation

Example of Kernel Compilation….

Choosing a Kernel The next project will involve kernel development We all need to be in the same boat… The class version will be 4.4.2 (bleeding edge stable version)

Kernel Repository http://kernel.org – place to download latest and greatest Linux kernels! Traditional place for kernel is in /usr/src/ It is already in there for you …That is, unless you created your own virtual machine. Then download it from kernel.org, and extract it with the command $> tar xv linux-4.4.2.tar.xz

Compiling the Kernel Compiles based on configuration of .config file located in the kernel source directory How can I correctly configure my kernel? Use the ‘make defconfig’ command Use the ‘make menuconfig’ command

‘make defconfig’ This new command makes the default configuration file for Linux. It creates a smaller configuration file than previous methods, so the kernel is faster to compile

‘make menuconfig’ Only do this if you are trying to make the kernel smaller Manually select and deselect drivers and options for your kernel * -- compiled directly into kernel M – compiled into a module (driver) that can be dynamically added Can be tough to figure out what you need and don’t need Command ‘lspci’ shows hardware on computer

‘make menuconfig’

‘lspci’

General Linux Source Organization Memory Management Networking Layer Security Sound Processing Architecture-specific Code Disk Drivers Devices File Systems

Config Example (Inside Source Dir) $> cd /usr/src/linux-4.4.2 $> make defconfig

Compiling the Kernel Issue ‘make’ inside the source directory Grab some coffee….

Installing the Kernel Install the modules (drivers) $> sudo make modules_install Install the actual kernel $> sudo make install What does ‘sudo’ do?

Final Step Create the ramfs image Why do we need an extra ramfs image?

Boot Driver Problem Suppose you compiled the disk drivers and root file system drivers as modules Boot process loads the kernel image Kernel image does not contain disk drivers

Boot Driver Solutions Hard: Figure out all drivers needed to read the root file system and compile into kernel May take a few tries… Easy: Create a root file system image file that will load the right modules for you initramfs

initramfs Create the initramfs image $> cd /boot $> sudo mkinitramfs –o /boot/initrd.img-4.4.2 4.4.2

Configure the Boot Loader (Grub) $> sudo update-grub Now you can issue a reboot and cross your fingers! $> sudo reboot

Telling Which Kernel You are In Select the new kernel from the grub menu! Watch your virtual machine If something goes wrong, reboot and go back into your original kernel to try again The following command will tell you which kernel you are in: $> uname -r

Uh oh…. If it doesn’t boot, go back into the original kernel Always important to have one working kernel! Make sure you didn’t skip a step… You may have taken too much out of the kernel… Start with bloated kernel, take things out one by one

Next Recitation More on Project 2 Loading a kernel module and playing with proc files