Tag Info

New answers tagged

1

uname -rv gives both, revision and version. This works on all UNIX platforms since ~1982, except for AIX (Alien UNIX ;-) because IBM implemented AIX after reading the man pages and confused -r with -v and vice versa ;-)


1

uname -r for exact version of the kernel or uname -a for information in the kernel AND information about your distro.


4

You can execute: uname -r It will display something like 3.13.0-62-generic Found on http://askubuntu.com/questions/359574/how-do-i-find-out-the-kernel-version-i-am-running (view that QA to learn other commands you could use)


1

First we need to look at what happens at the hardware level. A page fault happens when the MMU attempts to dereference a virtual address and finds an invalid descriptor for that address. When this happens, the processor executes a trap: it switches to kernel mode, jumps to a predefined address (the trap vector) and fills in some registers to indicate that a ...


1

The low level page fault handler in the OS (that is listed in the trap table from the CPU) get's the fault address from the CPU and uses this fault address to check the entries in process's address space description table. This table contains a list of segment descriptors that each contain a base address and a size. If the address is not in that list. the OS ...


0

bzImage is the target used for x86 architectures working with PC BIOS. In contrast, zImage is an architecture-specific target most commonly used for embedded devices and works well with their bootloaders.


2

So I'm not sure if you're looking to do this programmatically or not. But the first step you'd need to accomplish this is a database that catalogues all of this sort of information for each distribution and their respective releases. Luckily… that is exactly what distrowatch.com is. You can gather this information using their advanced search page, which ...


0

I can't add this as a comment to the above answer, so in favor of all who encounters this I'd like to mention that: In order to make the change permanent, unlike the above answer, you may need to add: fs.inotify.max_user_watches=$<INSERT-VALUE> To /etc/sysctl.conf file $: sudo echo "fs.inotify.max_user_watches=$<INSERT-VALUE>" >> ...


0

If LFS is too tough for you, you can go with archlinux. It is great for learning how to set up your own customised system. It doesn't come with any configuration, you are the one who configures everything. And they have an awesome wiki that explains everything. If you want to go beyond customising just the config files, there ABS (Arch Build System) which ...


0

You can try remastersys tool(I have tried this tool in ubuntu). Most of the time remastersys is used to create backup of current OS and data. This tool will create .iso file, which contains current snapshot (currently installed packages) of OS installed on your machine and you can install the created OS on other machines. Steps to install and use ...


-2

In get_fs(), fs is for free segment.


1

The steps I took to fix it: updated BIOS In the BIOS, diabled the SATA IDE Combined Mode with this help reading the kernel documentation about kernel parameters, since every solution online was about adding parameters to that. I found out that my SSD actually only supports SATA speed 3.0Gbps with a good shell script for i in `grep -l Gbps ...


1

Probably it depends on the video mode and zero page (struct bootparam, documented here, it also includes struct screen_info) setup prepared by a bootloader (GRUB) and BIOS. bootparam is passed to decompress_kernel() as the first argument. The actual function of debug_putstr() is __putstr() (Note that it's enabled only when CONFIG_X86_VERBOSE_BOOTUP is ...


1

So, here's what the link says: Maintaining ELILO If your distribution includes scripts to maintain ELILO automatically, and if those scripts work, you shouldn't need to do much to maintain this boot loader. As noted earlier, though, in my experience these auto-maintenance scripts are often worse than useless. Thus, you may need to keep your ELILO ...


1

In many applications, storage devices will be intermittently busy reading data. If a system is always able to defer writes until a time when the storage device isn't busy reading data, then from an application's point of view the writes will take zero time to complete. The only situations in which writes would not be instantaneous would be when: Write ...


2

It trades a small amount of reliability for a great increase in throughput. Suppose, for example, a video compressing program. With delayed write ("write back"): spend 10ms compressing frame issue write frame to disk wait 10ms for disk to acknowledge write complete GOTO 1 Versus spend 10ms compressing frame issue write frame to disk (completes in ...


0

ulimit can be two things: a POSIX 7 C API interface that was deprecated in favor of getrlimit(): http://pubs.opengroup.org/onlinepubs/9699919799/functions/ulimit.html Applications should use the getrlimit() or setrlimit() functions instead of the obsolescent ulimit() function. This was not the case when sim answered on POSIX 6. On GNU/Linux, ...


5

None of the other answers mentioned delayed allocation. XFS, ext4, BTRFS, and ZFS all use it. XFS has been using it since before ext4 existed, so I'll use it as the example: XFS doesn't even decide where to put data until writeout. Delayed-allocation gives the allocator much more information to base its decisions on. When a file is first being written, ...


3

All the other answers here are at a minimum mostly correct for the normal case, and I would recommend reading any of them before mine, but you mentioned dd and dd has a typical use case that May not involve write caching. Write caching is primarily implemented at the filesystem level. Raw devices do not normally do write caching (multiple device drivers such ...


0

I'm surprised that no one mentioned this reason for compiling a custom kernel: because you want to use a different C/c++ compiler. GCC is pretty good for compiling the linux kernel. But there are vastly superior compilers out there! GCC's optimizations are a bit behind Intel's C/C++ compiler. And Intel supplies the performance primitives libraries, and the ...


0

Simply doing grep 'menuentry' /boot/grub/grub.cfg lists additional entries that are not related to the actual kernel or OS versions. For instance, it lists if [ x"${feature_menuentry_id}" = xy ]; then menuentry_id_option="--id" menuentry_id_option="" export menuentry_id_option I would like to propose a small improvement to the method of searching ...


3

Mysql doesn't have a kernel module, therefore it runs in user mode. Perhaps what you are seeing is that mysql is using memory-mapped files instead of calling read/write. So, accessing a page of memory causes a read/write without using a syscall. Or, perhaps you called strace without "-f" to follow the child processes?


1

The kernel I used was stripped afterwards. My modules were not stripped. Hence they were so big.


2

The philosophy is unsafe-by-default. There are two reasonable and obvious strategies possible: flush writes to disk immediately or delay writing. UNIX historically chose the latter. So get safety, you need to call fsync afterwards. However, you can specify safety upfront by mounting a device with option sync, or per-file by opening them with O_SYNC. ...


13

Many good answers, but let me add one other thing... Remember that Unix is a multi-process and multi-users system, so potentially many users would be trying to do file-operations (esp. writes) at (almost) the same time. With old slow hard-disks - perhaps mounted over the network - this would not only take time (for which the programs would basically ...


0

The i2c bus option is being set at arch/arm/plat-sunxi/devices.c file, following commit fixing it.


0

In your case, interrupt 3 is usually the console serial aux port - which if you have ttyS1 attached, you'll probably find it is now dead. IRQ 4 is the primary console port


23

Asynchronous, buffered I/O was in use before Linux and even before Unix. Unix had it, and so have all its offshoots. Here is what Ritchie and Thompson wrote in their CACM paper The UNIX Time-Sharing System: To the user, both reading and writing of files appear to be synchronous and unbuffered. That is immediately after return from a read call the ...


7

Spinning platters are slower than RAM. We use caching of reads/writes to 'hide' this fact. The useful thing about write IO is that it doesn't require disk IO to happen immediately - unlike a read, where you can't return data to the user until the read completes on the disk. Thus writes operate under a soft time constraint - as long as our sustained ...


10

It is not specific to Linux, and it is called the page cache (which Linux does quite well). See also http://linuxatemyram.com/; so if a file is written, then read again a few seconds later, very often no disk I/O is needed. The main advantage is that on many systems, there is a lot of RAM, and some of it can be used as a cache by the kernel. So some files ...


54

It simply gives an illusion of speed to programs that don't actually have to wait until a write is complete. Mount your filesystems in sync mode (which gives you your instant writes) and see how slow everything is. Sometimes files exist only temporarily... a program does some bit of work and deletes the file right after the work is done. If you delayed ...


38

What's the philosophy behind such an approach? Efficiency (better usage of the disk characteristics) and performance (allows the application to continue immediately after a write). Why isn't the data written at once? The main advantage is the OS is free to reorder and merge contiguous write operations to improve their bandwidth usage (less ...


1

Various layers within Linux, also showing separation between the userland and kernel space for full image Source


2

According to _syscall(2) man page the _syscall0 macro may be obsolete and requires #include <linux/unistd.h>; indeed Linux 4.x don't have it However, you might install musl-libc and use its _syscall function. And you could simply use the indirect syscall(2) in your user code. So your testing program would be #define _GNU_SOURCE /* See ...


0

Well then assuming the instructor wants people to read the source and not just cut and paste from the internet, it's arguably a well-designed assignment. (That said, linux kernel code is not super nice to read. Make sure you know how to use etags, because often you have to trace macros three levels deep to see what is going on.)


1

The DHCP client daemon (dhcpdc, dhclient, etc) are programs that are started during the init process. These programs are not always directly invoked by init, but rather the program that handles networking will do this when an interface is configured to use dhcp. For example, netctl is one such program distros use to manage the networking interfaces. This ...


0

To login as user usertest, do (being root) : root:~# login usertest Password: usertest:~$ echo $0 -bash usertest:~$ exit root:~# _ That's the formal way in which an user logs in. Of course, you could allways execute a command for which it's $0 is changed: bash -c 'echo "hello"; echo $0;' mylogthisshell Which could allways have an starting dash bash ...


1

This is easy to replicate with zsh, which allows the appropriate argument to the exec(3) call to be specified via ARGV0: % ARGV0=-bash bash -bash-4.1$ ps o cmd --pid=$$ CMD -bash -bash-4.1$ exit % ARGV0=imnotaduck bash $ ps o cmd --pid=$$ CMD imnotaduck $ exit % In C, as done by login(1), the code would run something along the lines of: ...


4

Programs like SSH, sudo, su, etc., start the shell using the exec family of system calls. And these system calls allow the calling program to specify every argument, including the function. For example, using sudo to start a login shell: $ strace -fe execve -o sudo.log sudo -i root:~ $ echo $0 -bash root:~ $ logout $ grep bash sudo.log 19124 ...


0

Option 1 (direct access via /sys/.../resource0) Good for testing and nothing wrong with it functionally, although can not do anything advanced and no driver layer abstraction. I find this method icky by the way the user program interacts with the sysfs but that might be my personal opinion. Option 2 (using uio_pci_generic) I don't know what ...


2

My particular problem turned out to be ifplugd. It failed with a NLAPI: Packet too small or truncated error everytime I plugged my ethernet cable in or out. Seems like some change in Kernel 3.9 introduced something. So I recompiled ifplugd with a change to the buffer size in src/nlapi.c line 74. -- char replybuf[1024]; ++ char replybuf[8*1024]; Now it ...


2

I installed the linux-lts package as suggested by @mikeserv from chroot and I set it as the default boot option from the grub configuration. This way I could boot nicely into linux 3.14 and complete the installation process. The vanilla linux kernel is installed alongside with the LTS version so using the "advanced options" from the grub menu I could still ...


1

You should be able to re-compile it using something to the similar commands. make KERNEL_DIR=/usr/src/linux make install KERNEL_DIR=/usr/src/linux make dep make bzIamge make make install make modules Source: iptables: Table does not exist (do you need to insmod?)


2

The kernel and the NIC communicate the same way the kernel (specifically, a device driver, which is part of the kernel) communicates with any other device (e.g., serial communications device (like keyboard, mouse, or RS232), disk (or disk-like mass storage device), display, security token, etc.) – they talk directly to each other.  So, yes, this happens ...


2

"Understanding the Linux Kernel" by "Daniel P. Bovet, Marco Cesati" could be what you are looking for.


2

How about Linux Kernel in a Nutshell by Greg Kroah-Hartman? Also worth having a look at Linux Kernel Newbies : Documents.


0

Probably. Put the kernel into /boot/vmlinuz-<version>, put the modules into /lib/modules/<version>, run dracut /boot/initramfs-<version>.img <version> to generate the initramfs image, cross your fingers, and reboot. You say, "Also, I have no chance to make such experiment on my own", but of course you do. Boot up a Fedora VM, put ...



Top 50 recent answers are included