linux exposed (unofficial guide to kernel hacking)

23
Linux Exposed (Unofficial guide to kernel hacking)

Upload: lucinda-morgan

Post on 01-Jan-2016

245 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Linux Exposed (Unofficial guide to kernel hacking)

Linux Exposed(Unofficial guide to kernel

hacking)

Page 2: Linux Exposed (Unofficial guide to kernel hacking)

Linux as an operating System

What is now known as Linux began life as a small student project at the University of Helsinki in Finland. Linux Torvalds wanted a small, UNIX-like operating system, and so he set out to write one. He received help from volunteers all around the globe, who collaborated via bulletin-board, electronic mail, and the Internet to create the Linux operating system.

Page 3: Linux Exposed (Unofficial guide to kernel hacking)

The crew ended up creating a rather remarkable operating system that works very well, is very stable, and rivals offerings from Microsoft, Apple, and Sun. Linux offers the following features:– •  Multitasking—Linux natively runs more than one

task (program) at a time in a UNIX-like fashion. It also supports preemptive multitasking, where priorities can be set for different processes.

– •  Multi-user—Many users can be networked to a single Linux server. Linux is the least expensive, and perhaps best-featured, multi-user operating system on the planet today.

– •  User-friendly—The X Window System interface and a slew of great tools make Linux easy to use.

Page 4: Linux Exposed (Unofficial guide to kernel hacking)

Today, Linux claims half a million users, and that number keeps growing every day. One reason is cost—Linux itself is free of charge, and only those who package a Linux distribution charge for it (and many don’t charge at all). These distributions, such as Red Hat Linux, vary as to their installation processes and accompanying tools.

Page 5: Linux Exposed (Unofficial guide to kernel hacking)

Linux Basics

File Types

Organization of files and directories

File permissions and Linux

An overview of X window

Basic System Administration

Page 6: Linux Exposed (Unofficial guide to kernel hacking)

FILE TYPES

Under Linux, a file can be one of several types: – •  Ordinary files – •  Directories – •  Links – •  Special device files

Page 7: Linux Exposed (Unofficial guide to kernel hacking)

Organization of Files and DirectoriesDirectory Contents================================= bin binary files boot boot files dev device drivers etc configuration files home home directory lib library files tmp temporary storage files usr commands var system definitions

Page 8: Linux Exposed (Unofficial guide to kernel hacking)
Page 9: Linux Exposed (Unofficial guide to kernel hacking)

File permissions and Linux

Because UNIX is a creature centered around security, Linux allows permissions to be designated for files and directories. If you lack the proper permissions, you can’t change files or directories. The root user, of course, has the proper permissions to access every file in the Linux file system (which means that you shouldn’t expect absolute security if you’re working on a larger system). Under Linux, there are three different levels of permissions: owner, group, and world.

Page 10: Linux Exposed (Unofficial guide to kernel hacking)

Output of ls –l command-rwxrwxrwx 1 kevinr group1 512 Apr 3 19:12 test

– •  The seventh column (19:12) lists the time the file was created. – •  The sixth column (Apr 3) lists the date the file was created. – •  The fifth column (512) lists the size of the file in bytes. – •  The fourth column (group1) lists the group the file belongs to.

(We’ll explain this later.) – •  The third column (kevinr) lists the owner of the file. – •  The second column (1) shows the number of links to the file. – •  The eighth column (test) lists the filename. – •  The first column (-rwxrwxrwx) lists the permissions associated

with the file and the type of the file

Page 11: Linux Exposed (Unofficial guide to kernel hacking)

An overview of X window System

X window offers a graphical interface to the Unix world .

X window provides a way to deliver all the user interface paradigms like windows, dialog boxes ,buttons and menus.

It is X window that enables the creation of the sophisticated graphics that make unix based workstations the system of choice for many engineering and design applications

Page 12: Linux Exposed (Unofficial guide to kernel hacking)

Window ManagersAnd

Other ClientsX-Server

VideoCard

Monitor

Mouse/Keyboard

Basic Client-Server Architecture of

X-Window

Page 13: Linux Exposed (Unofficial guide to kernel hacking)
Page 14: Linux Exposed (Unofficial guide to kernel hacking)

Open Source Software ( OSS )

OSS literally means software whose source is openTo be termed as OSS ,the software should not restrict the user from freely using it, modifying it and distributing it.Advantages over proprietary software are :-

Longevity, Quality, portability, compatibility, Response time

Page 15: Linux Exposed (Unofficial guide to kernel hacking)

Hacking Linux Kernel

Need of Kernel Compilation

Finding Source Code

Compiling and Linking the Kernel

Compiling and linking modules

Backing up the old kernel and Moving in the new one

Page 16: Linux Exposed (Unofficial guide to kernel hacking)

Finding Source code

Type rpm –qa | grep kernel

Choosing Kernel features- Make xconfig- Make menuconfig- Make config

Compiling and Linking Kernel

-make dep

-make bzImage

Page 17: Linux Exposed (Unofficial guide to kernel hacking)
Page 18: Linux Exposed (Unofficial guide to kernel hacking)

Compiling and linking Modules

- make modules- make modules_install

Backing up old Kernel and Moving to the new one

@/boot/grub/grub.conf file

Image=/boot/vmlinuz

Label=linux

Root= /dev/hda5

Page 19: Linux Exposed (Unofficial guide to kernel hacking)

/boot/grub/grub.conf file (Edited)

Image=/boot/vmlinuz

Label=linux

Root=/dev/hda5

Image=/boot/vmlinuz-2.4.2.2-2-old

Label=linux-old

Root=/dev/hda5

Page 20: Linux Exposed (Unofficial guide to kernel hacking)

Conclusion

If you’re curious about UNIX or other operating systems, then Linux gives you a great environment to experiment with at a very reasonable—if not free—cost. If you need more power from your hardware than Windows or DOS gives you, then Linux is the operating system that can give it to you. If you need a robust, reliable server for your company Internet or World Wide Web services, Linux can do that just fine and very inexpensively. But, if you don’t want to learn something new, don’t want to leverage your existing hardware, and like the frequent crashes involved with Windows, then forget about Linux!

Page 21: Linux Exposed (Unofficial guide to kernel hacking)

References

www.wikipedia.com

www.linuxhacks.com

www.linux.org

www.faqs-linux.com

Page 22: Linux Exposed (Unofficial guide to kernel hacking)
Page 23: Linux Exposed (Unofficial guide to kernel hacking)