The hardware provides a system timer for the kernel to calculate and manage time. The kernel presets the frequency of the system timer, ie the tick rate, and each cycle is called a tick. The Linux kernel starts with the 2.5 kernel and increases the frequency from 100 to 1000 (of course, it brings a lot of advantages and some disadvantages).
jiffies is a global variable in the kernel that is used to record the system startup. The number of beats produced. For example, if the computing system is running for a long time, it can be calculated using jiffies/tick rate. Jiffies are defined in the file:
extern unsigned long volatile jiffies;
You can use jiffies to set timeouts, such as:
unsigned long timeout = jiffies + tick_rate * 2; //Timeout after 2 seconds
if(time_before(jiffies, timeout){
//There is no timeout
}
else{
//Timed out
}
The kernel provides four macros to compare the beat counts. These macros are defined in the file:
time_before(unknown, known)
time_after(unknown, known)
time_before_eq(unknown, known)
time_after_eq(unknown, known)
Use these macros to avoid comparisons Jiffies have a wraparound problem due to excessive size.
In addition to the system timer, there is a time-related clock: Real Time Clock (RTC), which is a hardware clock used to store system time permanently. Turn off the micro battery on the motherboard to keep timing. When the system starts, the kernel starts by reading the RTC. Initialize Wall Time and store it in the xtime variable, which is the main role of RTC.
Find the virtual machine settings, set as shown below (additional figure: must be 3.0 u disk and pl
I am getting error in make posix, prompt: make: cc: Command not found make: *** [posix] Error 127 so
Introduction to Soft InterruptsInsert processing that can be deferred from the hard interrupt handl
Generally speaking, after installing ubuntu, the centralized display driver has been installed. Howe
How to effectively manage Linux system patches?
Basic configuration after Centos installation
Mkimage” command not found – U-Boot images will not be bui
Linux vsftp virtual, physical account simultaneous verification login
Linux operating system kernel startup parameters detailed analysis
Linux system management and maintenance - scp command
Linux package installation and uninstallation tutorial
Linux system and 20 points difference with Windows
Linux and Windows function battle open source system
Linux system information view command
What is the meaning of the Linux file name color
The difference between memory buffer and cache in Linux operating system
How win10 fixes the recycle bin to quick access
How to add an app shortcut in the Win10 start menu
Turn off useless ports under Win2000
Win8 system upgrade Firefox browser can not open IE browser how to do
How to make Win10 boot into tablet mode?
After upgrading the official version of win10, did the software still exist?
After the XP system is powered on, it always pops up the C disk window automatically. How to fix it?