OS with no timers.. at all ?
Re: OS with no timers.. at all ?
Ok,
So this idea is not good. The goal is to let the hardware do as much as possible.
So apic timer has no real workaround (on x86_64)..
Thanks
So this idea is not good. The goal is to let the hardware do as much as possible.
So apic timer has no real workaround (on x86_64)..
Thanks
Re: OS with no timers.. at all ?
Hi,
All hardware requires initialisation; which can be many things; like self-tests, determining resources (memory mapped areas, IRQs, etc), detecting capabilities, detecting/enumerating any "child devices" that are attached, etc.
The initialisation of local APIC mostly involves detecting its presence, detecting its capabilities, calibrating its timer, testing that its functioning correctly, and configure it for however you're planning to use it. None of these things are work-arounds, they're all just "business as usual".
Cheers,
Brendan
Work around for what?AlexHully wrote:So this idea is not good. The goal is to let the hardware do as much as possible.
So apic timer has no real workaround (on x86_64)..
All hardware requires initialisation; which can be many things; like self-tests, determining resources (memory mapped areas, IRQs, etc), detecting capabilities, detecting/enumerating any "child devices" that are attached, etc.
The initialisation of local APIC mostly involves detecting its presence, detecting its capabilities, calibrating its timer, testing that its functioning correctly, and configure it for however you're planning to use it. None of these things are work-arounds, they're all just "business as usual".
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: OS with no timers.. at all ?
I was talking about the fact that, yes, one needs timers, no way around that.
Thanks a lot for your patience, i will come back with some other silly questions
Thanks a lot for your patience, i will come back with some other silly questions
Re: OS with no timers.. at all ?
No, I was thinking about a permanently displayed clock. It doesn't have to be updated at regular intervals. For example, you could just update it every time a keystroke was received or every time a newline was written to the screen. Not perfect, but I'm sure I remember OSs that displayed a clock in that manner.Kevin wrote:I assume that you just mean reading the current time, because using the RTC IRQ would mean using a timer. If so, that's good enough for implementing something like a "date" command, but for a permanently displayed clock, how do you know when to update the displayed time?iansjack wrote:Simple. Just use a RTC chip. Reading it can be purely a user-space process with no support needed for it in the OS.Kevin wrote:Also, if you really were to write an OS without any timers, how would you implement something as simple as a clock in the user interface?
Of course this is begging the question of whether an OS needs to display a clock. MS-DOS didn't and I think it would be difficult to argue that it wasn't an OS. I can't remember a real-time clock being displayed as part of OS/400, and that certainly qualifies as an OS.
In my list of essential services that an OS provides I wouldn't list "displaying a constantly updated clock".
Re: OS with no timers.. at all ?
My point wasn't that you can't have an OS without timers or that a permanently displayed and automatically updated clock is a requirement before you can call it an OS, but just to illustrate that it would be a severely limited OS. DOS itself didn't display a clock, but it was easy enough to write a program to do so (in fact, this was the example that my Turbo Pascal book used to demonstrate TSRs ). In an OS without timers you couldn't write such a program unless you resort to busy waiting.
And it was only one (very obvious) example. Brendan mentioned a few more where timers are pretty much essential.
And it was only one (very obvious) example. Brendan mentioned a few more where timers are pretty much essential.
Re: OS with no timers.. at all ?
It doesn't. See: http://www.quora.com/Why-do-many-Indian ... tion-marksAlexHully wrote:A question mark counts as a word.
Re: OS with no timers.. at all ?
==
Last edited by AlexHully on Wed Jul 22, 2015 1:49 pm, edited 1 time in total.
Re: OS with no timers.. at all ?
muazzam,
Quora is by no mean a reference here.
Why not just open a book (litterature, the real deal) and check by yourself ?
Please don't take my comment as being offending, it is not.
Quora is by no mean a reference here.
Why not just open a book (litterature, the real deal) and check by yourself ?
Please don't take my comment as being offending, it is not.
-
- Member
- Posts: 5588
- Joined: Mon Mar 25, 2013 7:01 pm
Re: OS with no timers.. at all ?
Why not ask someone whose native language is English? I'm not the only one here, right?AlexHully wrote:Why not just open a book (litterature, the real deal) and check by yourself ?
In English, there is no space before the question mark.
Re: OS with no timers.. at all ?
Ok,
It depends on the native language. In my language (French), there is a space (I lost so many points because of it at the university). And since I am writing in English, I should not put a space.
Lesson learned.
-- first post corrected.
It depends on the native language. In my language (French), there is a space (I lost so many points because of it at the university). And since I am writing in English, I should not put a space.
Lesson learned.
-- first post corrected.
Re: OS with no timers.. at all ?
But not in French Canadian!AlexHully wrote:Ok,
It depends on the native language. In my language (French), there is a space (I lost so many points because of it at the university). And since I am writing in English, I should not put a space.
Re: OS with no timers.. at all ?
(my knowledge on the topic looks so contrived right now XD, but it still holds for french "L'honneur est sauf !")
Re: OS with no timers.. at all ?
Oh, so your native language is actually French? I wondered about exactly that because French is the only language of which I know that it adds these spaces, but I didn't want to ask and embarrass myself.
Re: OS with no timers.. at all ?
You could implement some kind of cooperative multitasking so as not to require an external event to drive task switching in the scheduler, but you then run into the problem of needing to make sure that no task hangs or crashes because that would stop the entire system. And every potentially long loop would need to be broken out of every now and then in order to let something else run for a while. Manually rewriting loops in order to be able to enter and exit them at will while maintaining program state is not a fun thing to do. Also, the CPU wouldn't appreciate many frequent jumps between different parts of different programs. You'd need to do some tuning. In some special (and extremely simple?) cases this may be reasonable. But it's not a good choice for a more or less general system. Early versions of Microsoft Windows and Apple Mac OS suffered from the drawbacks of cooperative multitasking, while they obviously did service timer interrupts.AlexHully wrote: The question will be short : could a OS exist without timers?
I mean, no need for cron, watchdogs, tickless kernel.
No timers at all.
Is it a stupid idea to implement?
Not everything is simpler or faster. It depends.AlexHully wrote: It sounds very appealing, not talking about the complexity of such an OS : much simpler. Scheduler : much simpler (tickless).
Overall : simpler/faster.
There exist systems (hard realtime?) with static/fixed scheduling driven by events/interrupts occurring periodically at a constant rate. Every task must start and complete between two such subsequent events/interrupts. With such a design you can, on one hand, avoid certain types of problems associated with preemption and race conditions, on the other hand you waste time or you need to bind several tasks together to make use of the most of the CPU time between the events and given the complexity and "variability"(?) of software (different paths through it taking different amounts of time (also remember of the previous state/cache effects)) you're risking to miss deadlines. You may switch the CPU to a low power state between completion of one task and starting of another. That will conserve energy, but the latency will stay. Again, there are certain benefits to this design, but it doesn't look like a good choice for a general-purpose system.
Re: OS with no timers.. at all ?
If anything, you have more switches with a timer interrupt enabled.alexfru wrote:Also, the CPU wouldn't appreciate many frequent jumps between different parts of different programs.