Device Drivers Compiling Applications Package Managers RPM - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

Device Drivers Compiling Applications Package Managers RPM

Description:

Device Types. Two types of these special files. Block mode devices. Character mode devices ... RPM databases installed packages. Maintaining a Databases allows ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 27
Provided by: dhor5
Category:

less

Transcript and Presenter's Notes

Title: Device Drivers Compiling Applications Package Managers RPM


1
Device DriversCompiling ApplicationsPackage
Managers (RPM)
  • CPSC 665
  • Spring 2003
  • Gold Team
  • Philip Mattingly
  • Brett Willman
  • Derek Horton
  • Ben Collins

2
Devices Under Linux
  • All device handling within the Linux kernel
    happens through special files.
  • /dev
  • Use no hard disk space
  • Logically, these files are links to the device
    driver

3
Devices Under Linux
  • When processes open these files, the kernel
    redirects all read and write requests to the
    appropriate driver.

4
Device Types
  • Two types of these special files
  • Block mode devices
  • Character mode devices
  • Network Interfaces

5
Device Types
  • Block mode devices
  • Structure the data they contain into blocks
  • Disks, floppies, CD-ROMs

6
Device Types
  • Character mode devices
  • Require the kernel to send or receive data from
    them one byte at a time.
  • Terminals, modems, printers

7
Device Types
  • Network Interface
  • Packet oriented.
  • No associated /dev file.
  • eth0, eth1

8
Device Control
  • Major part of the operating system is device
    control.
  • Almost all operations are performed by code that
    is specific to a device.

9
Device Drivers
  • Software layer that lies between the applications
    and the actual device.
  • Drivers can be either compiled into the kernel or
    they can be compiled as modules that are loaded
    into the kernel at runtime.

10
Security
  • If the kernel has security holes, then the entire
    system has holes.
  • Kernel modules are just as powerful as a root
    shell. Therefore, only root can load modules.
  • Driver writes must be careful to not introduce
    security bugs (buffer overflows) into the kernel.

11
Security
  • Kernels can be compile monolithically, thus
    requiring no modules.
  • Later kernels (2.2 and 2.4) can be configured to
    disable the loading of modules after bootup.

12
Resources
  • Linux Device Drivers.
  • Linux Internals.
  • Running Linux, 2nd Edition.

13
Tarballs
  • Filename.tar.gz
  • Tape Archive GZIP Compression
  • Standard package distribution over UNIX platforms
  • Source code with configuration scripts

14
Basic Steps
  • Extract files from tarball
  • Configure installation
  • Read ALL installation documentation
  • Compile source code
  • Install executables and libraries
  • Clean source (optional)

15
1. Extract Tarball
  • Tar zxfv filename.tar.gz
  • (z) uncompress GZIP
  • (x) Extract files from tape archive
  • (f) Specify file name
  • (v) Verbose

16
2. Configure Installation
  • ./configure --help
  • Lists options available for installation
  • Determine your needs
  • ./configure --with-options
  • Options include additional module support,
    installation directory
  • Creates Makefile for next steps
  • Shell script
  • Configuration typically determines dependencies
    and required include files

17
3. Compile Source Code
  • make
  • Compiles source code according to rules specified
    in the Makefile
  • Output object code resides where it was compiled

18
4. Install
  • make install
  • Installs object code according to rules specified
    in Makefile
  • Determines directories to copy libraries and
    executables

19
5. Make Clean
  • make clean
  • Not as common, but useful
  • Cleans object code created from Step 3
  • Prevents recompiling unwanted code

20
Post Installation
  • Modify application level configuration scripts
  • httpd.conf, ntp.conf, etc
  • Verify correctness

21
RPM
  • R Package Manager
  • A Package is a collection of files associated
    with an application.
  • Binary
  • Source
  • Configuration Files
  • Documentation
  • Libraries

22
RPM
  • RPM databases installed packages.
  • Maintaining a Databases allows for
  • Queries
  • Verification
  • Version Control

23
Useful RPM Commands
  • Installing packages (Upgrade)
  • rpm Uhv package-name.i386.rpm
  • Removing packages
  • rpm e package-name
  • Querying existence of packages
  • rpm qa grep query

24
Useful Query Commands
  • Querying individual packages
  • rpm qpi package-name
  • File listing of individual packages
  • rpm -qpl package-name

25
Source RPMS
  • All the files in the package besides the binaries
  • Architecture independent
  • Compiled during installation

26
Tarball Vs RPM
  • RPMs created from tarball and released afterwards
  • RPMs configured for specific platform and
    architecture
  • Tarballs can be configured to meet users needs
  • Tarballs Optimize system resources
Write a Comment
User Comments (0)
About PowerShow.com