I'm trying to develop my own simple uptime command (used to show how long the system has been running) like program where I'm gonna use it for our university's OS, (consider the OS already has all the necessary C libraries needed to make system utilities)

Could someone give me a hint on what to do, is there a simple time library in C I need to include to use the right functions? I've already meddled with linux built in proc/uptime code and still trying to grasp how it works since it makes a lot of calls to other files located at proc

Recommended Answers

All 2 Replies

You could certainly write a background service that ticks seconds and runs at startup, but pretty much every modern OS will provide a way to query uptime. What OS are you targeting?

You could certainly write a background service that ticks seconds and runs at startup

hmm... that's sound like a nifty solution try that out later

but pretty much every modern OS will provide a way to query uptime. What OS are you targeting?

it's our own university's "growing" OS born from a fork of the DEX-OS (you've probably never heard of it :) )

I haven't played with it long enough but by what I've seen it's pretty similar to a linux command prompt version it already has the basic utilities like ls, cd.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.