background preloader

Linux class

Facebook Twitter

IT Security Magazine - Hakin9 www.hakin9.org. Strace(1): trace system calls/signals. Name strace - trace system calls and signals Synopsis strace [ -dDffhiqrtttTvVxx ] [ -acolumn ] [ -eexpr ] ... [ -ofile ] [ -ppid ] ... [ -sstrsize ] [ -uusername ] [ -Evar=val ] ... [ -Evar ] ... [ command [ arg ... ] ] strace -c [ -D ] [ -eexpr ] ... [ -Ooverhead ] [ -Ssortby ] [ command [ arg ... ] ] Description In the simplest case strace runs the specified command until it exits.

strace(1): trace system calls/signals

Strace is a useful diagnostic, instructional, and debugging tool. Each line in the trace contains the system call name, followed by its arguments in parentheses and its return value. Open("/dev/null", O_RDONLY) = 3 Errors (typically a return value of -1) have the errno symbol and error string appended. open("/foo/bar", O_RDONLY) = -1 ENOENT (No such file or directory) Signals are printed as a signal symbol and a signal string.

Sigsuspend([] <unfinished ... > --- SIGINT (Interrupt) --- +++ killed by SIGINT +++ read(0, 0x7ffff72cf5cf, 1) = ? Arguments are printed in symbolic form with a passion. Options. Jonathan Levin's Resume. Where learning Linux is easy. Linux kernel oops. Linux kernel oops on PA-RISC with a dead ASCII cow.

Linux kernel oops

An oops is a deviation from correct behavior of the Linux kernel which produces a certain error log. The better-known kernel panic condition results from many kinds of oops, but others may allow continued operation with compromised reliability. The term does not stand for anything, other than that it is a simple mistake. Virtual file system. A virtual file system (VFS) or virtual filesystem switch is an abstraction layer on top of a more concrete file system.

Virtual file system

The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference. It can be used to bridge the differences in Windows, Mac OS and Unix filesystems, so that applications can access files on local file systems of those types without having to know what type of file system they are accessing. Kernel panic. A kernel panic message from a Linux system A kernel panic is an action taken by an operating system upon detecting an internal fatal error from which it cannot safely recover.

Kernel panic

The term is largely specific to Unix and Unix-like systems; for Microsoft Windows operating systems the equivalent term is "stop error" (or, colloquially, "Blue Screen of Death"). History[edit] I remarked to Dennis that easily half the code I was writing in Multics was error recovery code. He said, "We left all that stuff out. The original panic() function was essentially unchanged from Fifth Edition UNIX to the VAX-based UNIX 32V and output only an error message with no other information, then dropped the system into an endless idle loop. Source code of panic() function in UNIX V6:[6] As the Unix codebase was enhanced, the panic() function was also enhanced to dump various forms of debugging information to the console. Completely Fair Scheduler. Like the old O(1) scheduler, CFS uses a concept called "sleeper fairness", which considers sleeping or waiting tasks equivalent to those on the runqueue.

Completely Fair Scheduler

This means that interactive tasks which spend most of their time waiting for user input or other events get a comparable share of CPU time when they need it. Algorithm[edit] The scheduler stores the records about the planned tasks in a red-black tree, using the spent processor time as a key.[3] This allows it to pick efficiently the process that has used the least amount of time (it is stored in the leftmost node of the tree). The entry of the picked process is then removed from the tree, the spent execution time is updated and the entry is then returned to the tree where it normally takes some other location. Daemon (computing) Systems often start daemons at boot time and serve the function of responding to network requests, hardware activity, or other programs by performing some task.

Daemon (computing)

Daemons can also configure hardware (like udevd on some GNU/Linux systems), run scheduled tasks (like cron), and perform a variety of other tasks. The word daemon is an alternative spelling of demon,[3] and is pronounced /ˈdiːmən/ DEE-mən. In the context of computer software, the original pronunciation /ˈdiːmən/ has drifted to /ˈdeɪmən/ DAY-mən for some speakers.[1] Alternate terms for daemon are service (Microsoft Windows NT), started task (IBM z/OS),[4] and ghost job (XDS UTS). Monolithic kernel. Loadable modules[edit] Modular operating systems such as OS-9 and most modern monolithic operating systems such as OpenVMS, Linux, BSD, and UNIX variants such as SunOS, and AIX, in addition to MULTICS, can dynamically load (and unload) executable modules at runtime.

Monolithic kernel

This modularity of the operating system is at the binary (image) level and not at the architecture level. Modular monolithic operating systems are not to be confused with the architectural level of modularity inherent in Server-Client operating systems (and its derivatives sometimes marketed as hybrid kernel) which use microkernels and servers (not to be mistaken for modules or daemons). Practically speaking, dynamically loading modules is simply a more flexible way of handling the operating system image at runtime — as opposed to rebooting with a different operating system image. Magic SysRq key. The SysRq key The magic SysRq key is a key combination understood by the Linux kernel, which allows the user to perform various low-level commands regardless of the system's state.

Magic SysRq key

It is often used to recover from freezes, or to reboot a computer without corrupting the filesystem.[1] Much like Sun Microsystems's Open Firmware (OpenBoot), this key combination provides access to powerful tools for software development and disaster recovery. In this sense, it can be considered a form of escape sequence. Principal among the offered commands are means to forcibly unmount file systems, kill processes, recover keyboard state, and write unwritten data to disk. Kernel (computing) A kernel connects the application software to the hardware of a computer In computing, the kernel is a computer program that manages input/output requests from software and translates them into data processing instructions for the central processing unit and other electronic components of a computer.

Kernel (computing)

The kernel is a fundamental part of a modern computer's operating system.[1] For computer programmers, the kernel's interface is a low-level abstraction layer. The kernel's primary function is to manage the computer's hardware and resources and allow other programs to run and use these resources.[1] Typically, the resources consist of: Linux kernel. The Linux kernel is released under the GNU General Public License version 2 (GPLv2)[6] (plus some firmware images with various non-free licenses[8]), and is developed by contributors worldwide.

Linux kernel

Day-to-day development discussions take place on the Linux kernel mailing list. The Linux kernel was initially conceived and created in 1991 by Finnish computer science student Linus Torvalds.[11] Linux rapidly accumulated developers and users who adapted code from other free software projects for use with the new operating system.[12] The Linux kernel has received contributions from thousands of programmers.[13] History[edit] In April 1991, Linus Torvalds, a 21-year-old student at the University of Helsinki, Finland started working on some simple ideas for an operating system. He started with a task switcher in Intel 80386 assembly language and a terminal driver.

After that, many people contributed code to the project. In December 1991, Linux 0.11 was released. #HITB2012AMS D1T1 - Ivo Pooters - Turning Android Inside Out. Index of /hitbsecconf2012ams/materials. Mac OS X and iOS Internals: To the Apple's Core: Jonathan Levin: 9781118057650: Amazon.com. LXR / The Linux Cross Reference. Vi Commands.