How to get boot time and show it on terminal wtih kernel programming in Linux? -


what i'm thinking getting uptime , current date , time, , subtracting these. i'll convert output output resembles output of "date" command in linux.

but think takes long? , think there might better solution since looks brute force.

-- beginner on kernel programming

try following code

u64 nsec = local_clock(); unsigned long rem_nsec = do_div(nsec, 100000000000); printk("time boot %5lu.%06lu ", (unsigned long)nsec, rem_nsec / 1000); 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -