Tag Info

Hot answers tagged

42

When trying to gain insight into what sort of magic is happening behind the scenes your best friend is strace. Learning to operate this tool is one of the best things you can do to get a better appreciation for what crazy magic is happening behind the scenes. $ strace -s 200 -m strace.log cat /proc/cpuinfo ... read(3, "processor\t: 0\nvendor_id\t: ...


38

Whenever you read a file under /proc, this invokes some code in the kernel which computes the text to read as the file content. The fact that the content is generated on the fly explains why almost all files have their time reported as now and their size reported as 0 — here you should read 0 as “don't know”. Unlike usual filesystems, the filesystem which is ...


13

System calls per se are a concept. They represent actions that processes can ask the kernel to perform. Those system calls are implemented in the kernel of the UNIX-like system. This implementation (written in C, and in asm for small parts) actually performs the action in the system. Then, processes use an interface to ask the system for the execution of ...


8

There is a solution using partprobe from parted software. More information here: http://www.gnu.org/software/parted/ After using your fdisk command and having done your modifications, do a partprobe or partprobe /dev/sdx and it should inform the kernel of the change without reboot.


8

The answer given by @slm is very comprehensive, but I think a simpler explanation might come from a change in perspective. In day-to-day usage we can think of files as physical things, ie. chunks of data stored on some device. This makes files like /proc/cpuinfo very mysterious and confusing. However, it all makes perfect sense if we think of files as an ...


6

No. Trivial counter example, this will interact with the kernel: int main() { volatile char *silly = 0; *silly = 'a'; } That'll call the kernel's page fault handler, ultimately resulting in your process getting a SIGSEGV (presuming the compiler doesn't "optimize" that code to do something other than the obvious, since that's undefined behavior by ...


5

The Linux kernel syscall API is the the primary API (though hidden under libc, and rarely used directly by programmers), and most standard IPC mechanisms are heavily biased toward the everything is a file approach, which eliminates them here as they ultimately require read/write (and more) calls. However, on most platforms (if you exclude all the system ...


5

You ask: Can this quarter of a century evolution be summarily qualified beyond the linear addition of all the listed features that make up this kernel over time? And does this bring any insight as to what the Linux kernel is about, or where it's going? I doubt such questions have well-defined answers. However, I think it is not difficult to ...


5

Answers Definitely not a bug. The parameter which defines the maximum size for one argument is MAX_ARG_STRLEN. There is no documentation for this parameter other than the comments in binfmts.h: /* * These are the maximum length and maximum number of strings passed to the * execve() system call. MAX_ARG_STRLEN is essentially random but serves to * ...


5

First, a clarification: It requires to have root privilege to change permission to a file. From man 2 chmod we can see that the chmod() system call will return EPERM (a permissions error) if: The effective UID does not match the owner of the file, and the process is not privileged (Linux: it does not have the CAP_FOWNER capability). This ...


5

Magic keys tend to be disabled in Debian these days, so you can't just hard-reboot your machine or kill all your X processes by pressing a few keys accidentally. The X Ctrl+Alt+Backspace key sequence is controlled by the "DontZap" option in /etc/X11/xorg.conf -- man xorg.conf for more details. I think you want this, though: Section "ServerFlags" Option ...


4

The traffic is going over the lo interface. When an IP is added to a box, a route for that address is added to the 'local' table. All the routes in this table route traffic over the loopback interface. You can view the contents of the 'local' table with the following: ip route show table local Which on my system looks like this: local 10.230.134.38 dev ...


4

Root and non root privileges are all user space related things. For example, a root user can install an application and an ordinary user can't. However, even the root user has some limitations. Those limitations are imposed by the design of the operating system do differentiate between user space and kernel space. For example, even dough you are a root ...


4

Generally, those security programs contain two parts, one running in kernel space, one running in user space. The user space part is only an interface to iteract with kernel space part. For example, iptables contains: netfilter, a set of hooks to the networking code in the kernel. It also includes mechanisms for passing packets to user space program. ...


4

A system call is a way to ask your operating system (kernel) to do some operation on behalf of your program, that the program can't do by itself (or is just inconvenient). The reason for not being able to do some operation is normally that allowing a random program to do them might compromise the integrity of the system, like doing I/O (directly to RAM, ...


3

In Linux at least the system call mechanism works under most architectures by placing some specifically formatted data (usually some kind of c struct) in either some registers or predefined memory addresses. The issue comes however in actually forcing the CPU to do the switch into kernel space so it can run the privileged kernel code to service the call. ...


3

NOTE: ALL THE BELOW INFORMATION IS FROM THE REFERENCED SITE From this link, I found the below information. A system call is an interface between a user-space application and a service that the kernel provides. Because the service is provided in the kernel, a direct call cannot be performed; instead, you must use a process of crossing the ...


3

The Linux kernel source hasn't had the CONFIG_IP_FORWARDING option since the 2.0.x kernel series. As far as I know, there is no compile time option anymore to enable IP forwarding by default for the built kernel. Since the 2.1.x series, the correct way to enable IP forwarding for IPv4 has been with the net.ipv4.ip_forward sysctl option. Add the following ...


3

Sure, let's do the how-many-directions-can-we-look-at-this-elephant-from? thing. The actual system call is, in your built program, the machine instruction that triggers the privilege escalation into kernel mode, and in the kernel itself it's the code that instruction invokes. The libc code (and every language runtime) sets up the machine registers and ...


2

(I'll try to be brief.) In theory, there are two dimensions of privileges: The computer's instruction set architecture (ISA), which protects certain information and/or functions of the machine. The operating system (OS) creating an eco-system for applications and communication. At its core is the kernel, a program that can run on the ISA with no ...


2

During these 0.6 seconds, stuff happens. All the messages up to “Starting kernel” are printed by U-Boot All the messages from “Booting Linux” onwards are printed by the Linux kernel. The kernel needs to initialize its own data structures and a number of peripherals (enough to be able to print a trace). This takes time. You can see what the kernel is doing ...


2

Swapping only when there is no free memory is only the case if you set swappiness to 0. Otherwise, during idle time, the kernel will swap memory. In doing this the data is not removed from memory, but rather a copy is made in the swap partition. This means that, should the situation arise that memory is depleted, it does not have to write to disk then and ...


2

A firewall does not exist in a single place in the kernel network stack. In Linux, for instance, the underlying infrastructure to support firewall functionality is provided by the netfilter packet filter framework. The netfilter framework in itself is nothing more than a set of hooks at various points in the kernel protocol stack. Netfilter provides five ...


2

If you take a look at the uname Wikipedia page titled: Uname there's a very nice table that shows the output of uname with all of its switches for just about every Unix I've ever heard of. excerpt of table                If you look at the output it would imply that -s shows the name of the ...


2

uname -r The first is the version string that was used when the kernel was compiled. That's the role of -r. $ uname -r 3.13.7-100.fc19.x86_64 This string can get a bit confusing but the base portion (everything before the first dash) is part of the actual Linux kernel version you're using. The rest is related to packaging options that were selected. ...


1

It looks like Petalinux uses /etc/rcS.d for its init scripts, the following is a step by step that should allow you to resolve this issue: http://www.xilinx.com/support/answers/55998.htm Please let us know if you have any further issues.


1

Release follow kernel version with package/release specific information added. If we go by your example 2.6.32-279.el6.x86_64, this means: 2.6.32 Linux kernel, this is base version and tells you the version of Linux kernel in most distributions and packages. 279 is this package specific release version. el6 suggests its Enterprise Linux (RHEL/CentOS). What ...


1

Apparently there were missing pieces that the driver depended on, that were not auto-selected by the menuconfig. In my case I was missing: pps_core and ptp I found these by booting a working install with the modules folder renamed. This caused the kernel to not find any loadable modules. Then I tried to insmod the e1000e.ko. This indicated that there ...


1

The step 3 will only compile modules. For them to actually go somewhere, you'd have to do make modules_install. As pointed out in comments, make -n modules_install will show you where they would go. The exact location depents on the version of the kernel you're compiling, the target directory being /lib/modules/<kernel_release>. The version you're ...


1

You are missing one of the drivers that is necessary to access your root filesystem. The code in the initramfs is looking for a block device to mount and failing, so the problem is in accessing that device. You won't get a more explicit message because the code in the initramfs can only see what it has access to and the problem is that it doesn't have access ...



Only top voted, non community-wiki answers of a minimum length are eligible