Tag Info

Hot answers tagged

19

From sysfs.txt: sysfs is a ram-based filesystem [...]. It provides a means to export kernel data structures, their attributes, and the linkages between them to userspace. In essence /sys allows you to get information about the system and its components (mostly attached and installed hardware) in a structured way. See also the Wikipedia Article on ...


18

Maybe you misunderstood what the author of that post meant. The vmlinuz file contains other things besides the gzipped content, so you need to find out where the gzipped content starts. To do that, use: od -A d -t x1 vmlinuz | grep '1f 8b 08 00' What this does is to show you where in that file you can find the gzip header. The output looks like: ...


15

This is known as a fork bomb. Does linux have any protection measure to such program which can run out of memory? Not really. Each fork produces a new process, with its own virtual address space and memory usage. So each copy is relatively small. Eventually, you'll use up all the physical+swap memory on the system, and the out-of-memory (OOM) killer ...


14

The kernel sources now contain a script for this, extract-vmlinux. You don't need to roll your own. See this SO answer.


14

(it actually drops so..) run sync first, then free pagecache: echo 1 > /proc/sys/vm/drop_caches free dentries and inodes: echo 2 > /proc/sys/vm/drop_caches free pagecache, dentries and inodes: echo 3 > /proc/sys/vm/drop_caches Then you can start with a clean cache, but of course caching will still work.


12

You need to specify a file when using the grep command. With the command you're using, you're searching in the standard input... Try grep -r "test" directory.


10

Linux 0.01 is very unlikely to work on modern hardware due to lack of driver support. Also, modern distros probably won't boot on ancient kernels because they need interfaces that weren't in the oldest Linuxes. You'll want to install a 386 simulator such as Bochs, install an ancient Linux distro such as SLS or early Debian/Slackware on it, then try to ...


10

Yes, although it may not be enabled by default on your system. The setrlimit system call defines system limits -- including the number of processes per user. Let's look at it first in the kernel (since you mentioned "linux"): you can use the manpage for setrlimit, which will tell you to do something like #include <sys/resource.h> ... struct rlimit ...


9

By compiling linux kernel are we building a totally standalone OS which doesn't depend on any linux destributions? No. Linux by itself is not an operating system. It is just a kernel. A userland, comprising a collection of system libraries and basic software, is necessary to facilitate your interaction with the computer. In what we commonly mean when we ...


8

You could do a cat /lib/modules/$(uname -r)/modules.builtin From the Kernel Documentaton modules.builtin This file lists all modules that are built into the kernel. This is used by modprobe to not fail when trying to load something builtin.


7

It depends if you want to use it on user level or system level. On user level the ulimit(or corresponding commands for other shells) would be easiest solution. However on system level there are mechanisms to prevent malicious users (or just not using ulimit) from stopping the system. Linux cgroups mechanism can limit the resources on per-group basis. You ...


7

find / -name "*.txt" -exec grep "text here" {} \; -print 2>/dev/null Which can be explained in human speak as: find starting from / in all files named *.txt (quotes are to bypass shell interpretation) with the resulting hits, perform the following grep "test here" in the file {} end of exec (\;) escaped end of statement print the files that match ...


7

From a quick search this problem seems to have quite many possible reasons, and seems to point to the fact that your new kernel's default for clock-source is wrong for your motherboard. One advice that worked for some was to use clocksource=hpet or clocksource=acpi_pm. In another thread, someone fixed this with clocksource=jiffies, another advised to try ...


7

The two aren't really inconsistent - the sudo command always changes user, either to root, or to the user you specify with the -u switch. All the -s does is provide a shortcut for starting a shell as that user. It is really equivalent to: sudo $SHELL except that it will likely fallback to /bin/sh or something if SHELL is not set.


7

You should think long and hard about why you think you're smarter than the scheduler. After that, if you still want to set the cpu affinity of a process on linux you can use the taskset command or, if you're writing the program yourself, the sched_setaffinity system call.


7

In all actuality, the kernel provided by your distro is probably the best one for almost everybody. What pretty much every distro is doing is compiling all options as modules and dynamically loading the modules as they are needed. It's a good exercise, especially if you're interested in learning about the kernel, but as far as day to day operation goes the ...


7

Red Hat magazine had 1 and 2 reversed. Beware of bugs that might prevent disabling overcommitting to work like that one: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/345601


6

Yes, this works, done it a lot in the past. If you need to compile for different architecture (say, you're on an x86 and want to compile for an ARM processor) then you would need a cross-compiler (done that as well). But if both machines are x86/x64 there's no problem.


6

Read the release notes on the page you linked to and read The Linux Kernel 0.01 Commentary. You'll need a machine with a floppy drive, a legacy IDE controller (or a pretty good imitation), a hard drive you can repartition at will, old compiler and assembler versions, and probably some low-level knowledge to hack around hardware quirks that Linux 0.01 ...


6

I also struggled with that issue. I just want my system to stay responsive, no matter what, and I prefer losing processes to waiting a few minutes. There seems to be no way to achieve this using the kernel oom killer. However, in the user space, we can do whatever we want. So i wrote the Early OOM Daemon ( https://github.com/rfjakob/earlyoom ) that will ...


6

Many programs (the binaries/scripts) end up in /bin or /usr/bin with other parts in various configuration directories (often in/under etc) as you already noted. For any specific command you can checkout whereis whereis prog_name and it will give you some information about where this command is to be found. You can also try which which prog_name ...


6

There no universal standard, but the kernel is usually found in the /boot directory.


6

Use ulimit -u from the bash shell to set a limit on "max user processes". From the C shell, you use the limit command. If you need a system call to do this, use the setrlimit call to set RLIMIT_NPROC.


6

The IPsec stack integrated in the Linux kernel since 2.6 (NETKEY) was originally based on the KAME stack (at least in regards to the API). The source code is part of the kernel repository, where the main components are found in the net/xfrm folder, including the implementation of the Netlink/XFRM configuration interface. The alternative and standardized ...


6

Can't beat Wikipedia's simplicity: Filesystem Hierarchy Standard > FHS compliance Modern Linux distributions include a /sys directory as a virtual filesystem (sysfs, comparable to /proc, which is a procfs), which stores and allows modification of the devices connected to the system, whereas many traditional UNIX and Unix-like operating systems use ...


5

You could actually build a kernel to your specific hardware if you wanted to. I think a good distribution to illustrate this is gentoo - you can run kernels tuned to your hardware or run genkernel. You could use a generic kernel, which is bigger, or build a kernel to your needs. Forget something that can't be loaded as a module, and you rebuild the whole ...


5

You forgot to export them. Edit your ~/.bashrc to something like this: export GOROOT=/home/linux/go/hg export GOOS=linux export GOARCH=386 export GOBIN=/home/linux/go/bin If you want the GOBIN available in your search paths, append this line too: export PATH=$PATH:$GOBIN


5

To answer my own question. This grub2 entry worked. menuentry 'Xen 4 with Linux 2.6.32.45-xen' --class ubuntu --class gnu-linux --class gnu --class os --class xen { recordfail insmod ext2 set root='(hd0,1)' search --no-floppy --fs-uuid --set 75475e50-82e2-4f74-b860-6cf92c91b42e multiboot /xen.gz placeholder ...


5

It's okay to compile in the repository itself. New files are ignored by Git until you add them manually for the first time. (You can use make mrproper or git clean -dfx to get rid of compilation output.)


5

That is not specifically the Linux boot sequence. That is how the original IBM PC system worked and the PC you're currently using is just an evolved version of that original system due to people putting too much importance on backwards compatibility. Lots of computers that does not need to be backwards compatible to the IBM PC architecture boot Linux ...



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