Drivers and the kernel UNIX system has three layers: Kernel

Slides:



Advertisements
Similar presentations
Va-scanCopyright 2002, Marchany Unit 8 – Solaris File Systems Randy Marchany VA Tech Computing Center.
Advertisements

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.
Devices and Drivers (Chapter 7) Khattab Alhabashi UNIX System Administration.
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
Exploring the UNIX File System and File Security
Guide To UNIX Using Linux Third Edition
Chapter 9 Extra Topics. The Kernel Core of the operating system Similar to UNIX kernel Originally developed and still controlled by Linus Torvalds uname.
Chapter 12 Drivers and the Kernel. Computer Center, CS, NCTU 2 Roles of Kernel  Components of a UNIX System User-level programs Kernel Hardware  Two.
Overview Basic functions Features Installation: Windows host and Linux host.
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.
Linux Operations and Administration
Booting and boot levels
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Drivers and the Kernel. Computer Center, CS, NCTU 2 Roles of Kernel  Components of a UNIX System User-level programs Kernel Hardware  Two roles of kernel.
Drivers and The Kernel Chapter 12 Presentation by: Kathleen Pensy.
Exercise #1: Exploring Open- Source Operating Systems with Virtual Machines J. H. Wang Mar. 9, 2010.
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.
Managing Software Patches 10/15/ Introducing Solaris OE Patches A patch contains collection of files and directories Patch replaces existing files.
Chapter Two Exploring the UNIX File System and File Security.
Troubleshooting and Performance
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Linux Kernel Management. Module 9 – Kernel Administration ♦ Overview The innermost layer of Linux operating system is the kernel, which is a thin layer.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
Exercise #1: Exploring Open- Source Operating Systems with Virtual Machines J. H. Wang Sep. 25, 2015.
CSC414 “Introduction to UNIX/ Linux” Lecture 2. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Hp education services education.hp.com hp education services education.hp.com 1 HP World/Interex 2002 Linux Kernel Configuration and Patching Chris Cooper.
LOGO Linux Installation. Linux Distribution Including shells, libraries, tools, compiler, servers, applications. Redhat, Fedora, Mandrake, SuSE, Debian,
1 Setup and Compile Linux Kernel Speaker: Yi-Ji Jheng Date:
Drivers and the Kernel. Computer Center, CS, NCTU 2 Introduction – UNIX Kernel and Shell interpret.
2Operating Systems  Program that runs on a computer  Manages hardware resources  Allows for execution of programs  Acts as an intermediary between.
 Components of a UNIX System › User-level programs › Kernel › Hardware  Two roles of kernel › High-level abstractions  Process managements  File system.
UNIX Filesystem and Hierarchy AfNOG 2008 Workshop May Rabat, Morocco.
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
Rebuilding Linux Kernel Dedicated to penguin lovers everywhere 26 September 20161Rebuilding kernel by Visakh M R.
Linux Administration – Finding You Way on the Command Line The Linux File Directory or Tree.
FreeBSD ports & packages. FreeBSD ports & packages - overview Different UNIX distributions use differents package systems for distributing software Debian.
Updating FreeBSD Unix System Administration. Objectives At the end of this session you should be able to: 1. Understand the differences between the CURRENT.
Computer System Structures
After Construction Name: Per #:.
Operating System Kernel Compilation
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 20, 2016.
bitcurator-access-webtools Quick Start Guide
Chapter Objectives In this chapter, you will learn:
Guide to Linux Installation and Administration, 2e
Linux Kernel Module Programming
UBUNTU INSTALLATION
UNIX Filesystem and Hierarchy
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 19, 2017.
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Operating System Kernel Compilation
An Introduction to Device Drivers
Exploring the UNIX File System and File Security
Chapter 2: System Structures
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 21, 2018.
Operating Systems Lecture 4.
IS3440 Linux Security Unit 7 Securing the Linux Kernel
COP 4343 Unix System Administration
CS 6560 Operating System Design
Drivers and the Kernel Chapter 12.
Drivers and the Kernel.
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
Drivers and the Kernel.
bitcurator-access-webtools Quick Start Guide
FreeBSD ports & packages
Operating System Kernel Compilation
Presentation transcript:

Drivers and the kernel UNIX system has three layers: Kernel The hardware The operating system kernel The user-level programs Kernel Kernel hides the hardware, provides a abstract, high-level programming interface Process Signal and semaphores Virtual memory The filesystem Interprocess communication  Kernel contains device drivers that manage its interaction with specific pieces of hardware. Size of kernel Drivers and the kernel

Kernel types Provide the kernel with explicit information about the hardware Depend on kernel prospects for devices on their own Solaris: almost completely modular kernel HP-UX: supports a relatively small and well-defined hardware base FreeBSD: must be told explicitly at kernel compilation time about device Linux: limited module support Drivers and the kernel

Kernel types Kernel build directory and location by system System Solaris /kernel/unix HP-UX /stand /stand/vmunix Linux /usr/src/linux /vmlinuz or /boot/vmlinuz FreeBSD /usr/src/sys /kernel Drivers and the kernel

Why Configure the kernel Generic kernel Many device drivers Optional packages Tailor the kernel for your need Less memory Well-tuned configuration Add support for new types of device Some system is simple Some may need to several steps. Read this: Building the kernel is not difficult; its just difficult to fix when you break it. Get a good reference book for your OS Drivers and the kernel

Configuring a Solaris Kernel Structured around loadable modules Modules are stored in subdirectories of /kernel Current system configuration Display loaded modules: modinfo [-c] Show hardware configurations: prtconf Display loadable modules, hardware configuration and some tunable kernel: Sysdef Drivers and the kernel

Configuring a Solaris Kernel Automatic configuration Probe device and initialize a driver for each device The Solaris kernel area /kernel Modules common to machines that share an instruction set /platform/platform-name/kernel Modules specific to one class of hardware Platform example: ultra1, SUN-blade-100 Command: uname -i /platform/hardware-class-name/kernel For example: sun3u, sun4u Command: uname –m /usr/kernel Drivers and the kernel

Configuring a Solaris Kernel Subdirs under each kernel dir: drv loadable modules for device drivers Note: you can specify the device specific configuration parameters here. misc Loadable object files for misc kernel routines cpu CPU-specific module for the UltraSPARC strmod STREAMS modules sched Operating system schedulers sys loadable system calls fs Filesystem-related kernel modules Drivers and the kernel

Configuring a Solaris Kernel /etc/system Master configuration file Take a look at your /etc/system in the lab Long dev name comes from the link Force to load certain module Set the search path Non default values for variables can be added with set command Example: set maxusers=40 Consulted at boot time Specify another /etc/system with boot –a Or boot with /dev/null if no good copy You will be prompted to answer questions Drivers and the kernel

Accessing New Device Drivers Solaris drivers are usually distributed as a package Run pkgadd Should you add new device drivers they should be installed in /kernel. You can add drivers with the add_drv command, then run drvconfig remove them with the rm_drv command. Once the driver is installed and the new device connected reboot the system with: Ok boot -r Drivers and the kernel

Accessing New Device Drivers Alternatively, you can create the file /reconfigure before rebooting. The kernel will then be reconfigured during the boot process. # touch /reconfigure # reboot One of these procedures is required for all drivers not installed initially. It causes the kernel to properly recognize the new drivers during the boot process. Drivers and the kernel

Building an HP-UX kernel Use SAM for the first few time Kernel configuration file /stand/system Run mk_kernel to rebuild the kernel Copy the new kernel in place to /stand/vmunix Drivers and the kernel

Building an Tru64Unix kernel  Digital UNIX recommends that you be in single user mode when building the kernel. cp /vmunix /vmunix.save save the old kernel cp /genunix /vmunix install the generic kernel to be the running kernel /usr/sbin/shutdown -r +5 reboot the system /usr/sbin/shutdown +1 Log on as root and take the system down to single user mode mount /usr remount the /usr file system Drivers and the kernel

Building an Tru64Unix kernel /usr/sbin/doconfig – you will be prompted for system configuration information. If you need to edit the resulting configuration file answer "yes" at the prompt. The new kernel will then be built and the path to it will be displayed. mv /sys/{hostname}/vmunix /vmunix move the kernel from the path displayed in the step above to the root directory /usr/sbin/shutdown -r now reboot the system If the system fails to boot you can reboot to single user mode using the generic kernel (/genunix) and try again. The master configure file is /etc/sysconfigtab Drivers and the kernel

Configuring a Linux kernel Save the current kernel #cp /vmlinuz /safe Save the current kernel source if applys #cd /usr/src; tar zcvf old-tree.tar.gz Unpack the source code and apply the patches #cd /usr/src # tar xvfz XXX.gz # zcat YYY??.gz | patch –p0 Drivers and the kernel

Configuring a Linux kernel Use tool make menuconfig make xconfig make config Building the linux kernel binary Run make xconfig/menuconfig/config Run make dep Run make clean Run make bzImage Run make modules Run make modules_install Copy image file to /boot/vmlinuz Config lilo/grub about the new kernel Drivers and the kernel

Configuring a Linux kernel /proc Allow to view and set kernel options at run time Are not remembered across reboots Drivers and the kernel

Loadable kernel modules in Linux Check the currently loaded module Run lsmod Insert module Run insmod/modprode Can only be removed explicitly Remove a module Run rmmod Drivers and the kernel

Summary Again, what we covered here does NOT intend to give you exact step by step instructions for a particular OS on a particular platform The basic flow/idea remains same for a relatively long period of time for particular vendor. Things change from one release to another and vendor to vendor Check the vendor’s latest documents for: Release notes New feature updates Installation and upgrade documents System administration documents … … Drivers and the kernel