On Mon, 20 Dec 2004 19:30:56 +0200 apalaios@xxxxxxxxxxxx wrote: > Hi...yesterday i was reading the understanding linux kernel and the linux kernel > development. I have found that at boot time the kernel programmes the irq0 to a > tick rate of 1 ms for 2.6 linux kernel and 10ms for 2.4 kernel... > > Also the articles that i have read said that the kernel updates the system clock > each 1 msec. I was wondering then how the kernel is possible to keep > microsecond timestamps for the packets coming in an interface? How can calulate > the time when the basic timer is only at 1 millisecond? > I have also read for the > > struct timespec { > time_t tv_sec; /* seconds */ > long tv_nsec; /* nanoseconds */ > }; > > timespec struct that has a nanosecond field.. How the kernel can insert data to > that field and how it can calculate the nanoseconds have passed?? > Thx..as u can understand i am very confused about time related issues...so plz > shed as much ligh as u can.. > Read do_gettimeofday and follow the flow. It uses an architecture dependant time source to fill in the microsecond/nanosecond field. On i386 this can be one of many sources depending on power management, kernel config, ... but usually it uses the cpu's Time Stamp Counter (TSC) which is an internal register that keeps track of the number of clock ticks. - : send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html