Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
kernel [2015/05/22 02:57]
slackermedia
kernel [2021/09/01 02:23] (current)
slackermedia
Line 1: Line 1:
-[[{arrowp.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​position:​absolute;​top:​0;​left:​0;​}dep|]] 
- 
-[[{arrown.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​position:​absolute;​top:​0;​margin-left:​2.5em;​}sound|]] 
- 
- 
 ====== Low Latency Kernel ====== ====== Low Latency Kernel ======
 +
 +<WRAP info>
 +**TL;DR** \\
 +Give applications permission to not play nice with others: ''/​sbin/​setcap cap_ipc_lock,​cap_sys_nice=ep /​path/​to/​greedy/​application''​
 +</​WRAP>​
  
 A computer'​s CPU does //a lot//, cycling constantly through series of loops and commands and probes and checks and refreshes and updates so consistently that sys admin even today talk in terms of "CPU cycles"​ when estimating the "​cost"​ of a computationally intensive project. Regardless of what you do artistically on your computer, yours is no exception: the CPU is in high demand every second, and not everything demanding its attention can be tended to at the same time. For this reason, the driver of the CPU (the "​kernel"​) queues all tasks needing attention, delegates priorities to each one, and then executes chunks of each waiting task according to priority. This happens millions times per second. A computer'​s CPU does //a lot//, cycling constantly through series of loops and commands and probes and checks and refreshes and updates so consistently that sys admin even today talk in terms of "CPU cycles"​ when estimating the "​cost"​ of a computationally intensive project. Regardless of what you do artistically on your computer, yours is no exception: the CPU is in high demand every second, and not everything demanding its attention can be tended to at the same time. For this reason, the driver of the CPU (the "​kernel"​) queues all tasks needing attention, delegates priorities to each one, and then executes chunks of each waiting task according to priority. This happens millions times per second.
Line 33: Line 33:
   * The DAW(s) that you use.   * The DAW(s) that you use.
   * Loopers, beatboxes, drum machines, sequencers.   * Loopers, beatboxes, drum machines, sequencers.
 +  * Ffmpeg, if you intend to do screen captures with it.
 +
  
 You do not need to worry about getting everything all at once; if something needs to be //less nice// with other processes, you'll hear it. You can whitelist it as needed, and the change will be immediate. You do not need to worry about getting everything all at once; if something needs to be //less nice// with other processes, you'll hear it. You can whitelist it as needed, and the change will be immediate.
 +
 +<WRAP important>​
 +If you came here for a low latency kernel, that's it! you're done. You can skip the next section.
 +</​WRAP>​
 +
  
 ====== Realtime Kernel ====== ====== Realtime Kernel ======
Line 44: Line 51:
   -The kernel source code   -The kernel source code
   -Realtime patches for the source code   -Realtime patches for the source code
- 
  
 ===== Patching the Kernel ===== ===== Patching the Kernel =====
Line 76: Line 82:
  
 <​code>​ <​code>​
-tar xvf linux-X.Y.ZZ.tar.bz2 +tar xvf linux-X.Y.ZZ.tar.bz2 ​-C /​usr/​src/​linux-X.YY.ZZ 
-cd !$+cd /​usr/​src/​linux-X.YY.ZZ
 </​code>​ </​code>​
  
Line 83: Line 89:
  
 <​code>​ <​code>​
-xzcat ../​patch-X.Y.ZZ-rt1.tar.xz | patch -p1+xzcat ../​patch-X.Y.ZZ-rt1.tar.xz | patch -p1
 </​code>​ </​code>​
  
-You will see a few screen-fulls of text and eventually get a bash prompt back.+You will see a few screen-fulls of text and eventually get a BASH prompt back.
  
 Now you can compile the new kernel. Now you can compile the new kernel.
Line 102: Line 108:
  
 <​code>​ <​code>​
-# cp /​media/​cdrom/​testing/​source/​ linux-X.X.XX.X-configs/​config-generic-smp-X.X.XX.X-smp /​path/​to/​linux-X.X.XX.X/​.config+# cp /​media/​cdrom/​testing/​source
 +/​linux-X.X.XX.X-configs/​config-generic-smp-X.X.XX.X-smp ​
 +/​path/​to/​linux-X.X.XX.X/​.config
 </​code>​ </​code>​
  
Line 108: Line 116:
  
 Launch ''​menuconfig'',​ an ncurses-based,​ menu-driven list of possible options for your new kernel. The menu can be overwhelming,​ but as it starts off with the default Slackware configuration,​ there will not be much you need to change, but for the realtime options. ​ Launch ''​menuconfig'',​ an ncurses-based,​ menu-driven list of possible options for your new kernel. The menu can be overwhelming,​ but as it starts off with the default Slackware configuration,​ there will not be much you need to change, but for the realtime options. ​
 +
 +<​code>​
 +# make menuconfig
 +</​code>​
  
 Most of the realtime options can be found in the **Processor type and features** menu. Most of the realtime options can be found in the **Processor type and features** menu.
Line 131: Line 143:
  
 <​code>​ <​code>​
-make bzImage +make bzImage 
-make modules+make modules
 </​code>​ </​code>​
  
 Take a coffee break and come back when the compile is finished. Take a coffee break and come back when the compile is finished.
  
-Once built, back up your current kernel image (you may need to boot back into it, if your attempt at building your own has failed). ​These steps must be done as root:+Once built, back up your current kernel image (you may need to boot back into it, if your attempt at building your own has failed).
  
 <​code>​ <​code>​
Line 144: Line 156:
 </​code>​ </​code>​
  
-And then move the new compressed kernel image (bzImage) and system map into your boot directory. ​The next steps also must be executed as root:+And then move the new compressed kernel image (bzImage) and system map into your boot directory.
  
 <​code>​ <​code>​
Line 151: Line 163:
 </​code>​ </​code>​
  
-And finally install the kernel modules (the drivers), also as root:+And finally install the kernel modules (the drivers):
  
 <​code>​ <​code>​
Line 157: Line 169:
 </​code>​ </​code>​
  
 +When this finishes, do **not** reboot.
  
 +===== Lilo =====
  
 +The new realtime kernel is now in place and its modules are installed, but the bootloader (the part of the system that gets loaded after the computer has been powered on but before an OS has been selected) needs to know where the new kernel is, and to use it. It also should be told where the last known good kernel is located so that if your new kernel fails for whatever reason, you can still boot your computer!
  
-To assure that you have the correct kernel up and running, ​you can also check the dmesg output for following strings: +Using ''​kdesu''​ to grant you root privileges within your graphical environment (or you can work in the terminal if you are comfortable with terminal-based text editors), edit ''​lilo.conf''​ in the text editor of your choice; ​
-Real-Time Preemption Support (C2004-2006 Ingo Molnar+
  
 +<​code>​
 +$ kdesu emacs /​etc/​lilo.conf
 +</​code>​
 +
 +In you text editor, duplicate the current entry, but change the label to reflect that it will boot the realtime kernel, and change the vmlinuz reference in the stock kernel so that it points to vmlinux.stock rather than vmlinuz. In the end, you will have entries quite similar to this: 
 +
 +<​code>​
 +image = /​boot/​vmlinuz
 +root = /dev/sda1
 +label = slackermedia
 +read-only
 +
 +image = /​boot/​vmlinuz.stock
 +root = /dev/sda1
 +label = slackware
 +read-only
 +</​code>​
 +
 +<WRAP tip>
 +You may also change the delay that it takes for LILO to choose its default entry. By default, Slackware provides you two minutes (1200 milliseconds). Depending on your needs, a time of 30 or 60 milliseconds (that is, 3 or 6 seconds) may be sufficient.\
 +</​WRAP>​
 +
 +Update the bootloader with its new configuration:​
 +
 +<​code>​
 +# lilo
 +</​code>​
 +
 +Reboot the machine with your new realtime kernel.
 +
 +It should boot as quickly as or quicker than (depending on how much customization you did in ''​menuconfig''​) the stock Slackware kernel.
 +
 +To verify that you have the correct kernel running after a successful boot, check the ''​dmesg''​ output for the strings "​Real-Time Preemption Support / Ingo Molnar":​
 +
 +<​code>​
 +# dmesg | grep -i preemption
 +</​code>​
 +
 +If the new kernel does not boot as expected, then it will most certainly provide errors during the boot process. Take note of the errors, reboot to with the stock kernel, and research what the errors mean. 
 +
 +<WRAP alert>
 +Always remember to run lilo after doing a new kernel installation! ​
 +</​WRAP>​
 +
 +Typical errors are that you have left some important code to be built as modules rather than building them into the kernel. Often, this is the filesystem, so verify that you have the proper filesystem(s) included.
 +
 +Another possibility is that you have removed some vital component of the kernel altogether in an effort to reduce its size. Research the issue, go back to the source code (in ''/​usr/​src/​linux-XX.YY.ZZ''​) and run (as root) ''​make clean ; make menuconfig''​ and include what you had previously taken out of the kernel.
 +
 +If you had installed Slackware with the ''​huge''​ kernel and are trying to use the ''​generic''​ configuration,​ then it's possible that you do need the ''​huge''​ kernel after all, meaning you'll need to download the ''​huge''​ configuration file and make that into the config file and compile again.
 +
 +
 +
 +
 +<WRAP centeralign>​
 +<wrap fa>​[[ffmpeginstall|R]]</​wrap>​ <wrap fa>​[[start|S]]</​wrap>​ <wrap fa>​[[dvd|Q]]</​wrap>​
 +</​WRAP>​
  
-[[{arrown.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​float:​right;​}sound|]][[{arrowp.png|border:​0;​background:​none;​width:​0;​float:​right;​}dep|]]