----- Original Message ----- 
From: "Louie Miranda" <[EMAIL PROTECTED]>
To: "Philippine Linux Users Group Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, November 18, 2004 10:13 PM
Subject: Re: [plug] linux uptime


> again,
>
> so how can we do that with jiffies and HZ? edit the kernel? and boot?
commands?

ok ill give you *one* of the solutions... just read the disclaimer first
below...

DISCLAIMER: playing with jiffies will result to broken timing which leads to
hanging of your pc, loss of data, etc... play at your own risk...

i havent touch linux for so many years now because im into freebsd... the
last kernel i played was version 2.2.x... i have quadruple OS in my pc and i
installed redhat linux release 9 (shrike) with the default kernel version of
2.4.20-8 just to satisfy your needs...

we will going to play with the kernel internal variable named *jiffies* and
we will going to access this via *sysctl* under the sysctl name of
kernel.jiffies...

edit /usr/src/linux-2.4/include/linux/sysctl.h and look for CTL_KERN enum
and add at the last of the list with this:

KERN_JIFFIES=57,

i choose 57 because the last of the list is 56 (KERN_CORE_PATTERN=56).. take
note of the comma after 57...

edit /usr/src/linux-2.4/kernel/sysctl.c and add the following:

#include <linux/sched.h>

look for "static ctl_table kern_table[]" and insert this anywhere in the
array as long as it is before the last of the array (the last of the array
is {0}):

{KERN_JIFFIES,"jiffies",&jiffies,sizeof(unsigned
long),0644,NULL,&proc_dointvec},

again.. take note of the last comma...

recompile your kernel and reboot...

to view the current jiffies value using sysctl command is:

#sysctl kernel.jiffies

to change the value of jiffies using sysctl command is (you must be root for
this because of the permission 0644 above):

#sysctl -w kernel.jiffies=86400000

86400000 is the value of 10 days uptime for HZ equals to 100 (days uptime =
86400 x Ndays x HZ)

executing command "uptime" will give you ten days of uptime...

this solution is only good for kernel version 2.4.x...if you are using
kernel version 2.6.x. (which i dont have)... just modify all the necessary
adjustments... i heard that 2.6 is using 64 bit data type for jiffies and
the HZ is 1000 while 32 bit for kernel 2.4 (unsigned long jiffies)..

again... play at your own risk...

fooler.













--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to