Search this blog

Jiffies and other Kernel globals

I recently had to create a alias for accessing the jiffies variable so this write up is regarding what I read and understood about jiffies and other global variables.

Jiffies is a global variable declared in as:

extern unsigned long volatile jiffies;

Its only usage is to store the number of ticks occurred since system start-up. On kernel boot-up, jiffies is initialized to a special initial value, and it is incremented by one for each timer interrupt. As discussed in the previous post, since there are HZ ticks occurred in one second, and thus there are HZ jiffies in a second.

HZ = no. ticks/sec

jiffies = no. of ticks

Now I needed to access this jiffies through our project specific alias:

typedef long                    proj_clock_t;

volatile proj_clock_t    *projhrt = (volatile proj_clock_t *)&jiffies;

Also came across this nice person who has demonstrated ways to access any kind of system memory:

https://code.google.com/archive/p/device-memory-readwrite/

Comments

Product Buy

Popular posts from this blog

हम गये बनारस​ - We visited Varanasi

Writing a Poll Mode Driver (PMD) for DPDK

Scenic Solitude Retreat - Guhagar Chiplun

Colours of Southern India