You might be able to do that in a hobby operating system, but I wouldn't try it commercially. Companies which try to tell their customers what they want, or even what they can have, tend not to last very long, because their putative customers keep their money in their pockets.nulik wrote:One approach would be to force the programmer to write small code snippets that would run for a short period of time and distribute the snippets evenly accross multiple cores. Lets say the programmers accepted this approach and started to write small code functions. But some code might present bugs, and could enter into infinite loop.
An OS without context switching
Re: An OS without context switching
Re: An OS without context switching
No I am not going to do this. I have already read lots of papers on OSes and this approach is bad. With this approach I will have to pass messages between processes and that will end up a slow OS like happened to Mach, which is micro kernel based. Monolithic kernel will win because with a syscall and no context switch it is going to do the job faster while the snippets will be flushing the TLB.Casm wrote:You might be able to do that in a hobby operating system, but I wouldn't try it commercially. Companies which try to tell their customers what they want, or even what they can have, tend not to last very long, because their putative customers keep their money in their pockets.nulik wrote:One approach would be to force the programmer to write small code snippets that would run for a short period of time and distribute the snippets evenly accross multiple cores. Lets say the programmers accepted this approach and started to write small code functions. But some code might present bugs, and could enter into infinite loop.
But I have a new idea to make an OS with:
- No syscall overhead
- No context switching
- No TLB misses
Re: An OS without context switching
I dont understand your goal?nulik wrote:No I am not going to do this. I have already read lots of papers on OSes and this approach is bad. With this approach I will have to pass messages between processes and that will end up a slow OS like happened to Mach, which is micro kernel based. Monolithic kernel will win because with a syscall and no context switch it is going to do the job faster while the snippets will be flushing the TLB.Casm wrote:You might be able to do that in a hobby operating system, but I wouldn't try it commercially. Companies which try to tell their customers what they want, or even what they can have, tend not to last very long, because their putative customers keep their money in their pockets.nulik wrote:One approach would be to force the programmer to write small code snippets that would run for a short period of time and distribute the snippets evenly accross multiple cores. Lets say the programmers accepted this approach and started to write small code functions. But some code might present bugs, and could enter into infinite loop.
But I have a new idea to make an OS with:I am just checking the manuals if the hardware will support my protection scheme.
- No syscall overhead
- No context switching
- No TLB misses
If you have no context switch, it means you can only ever have one thread running.
Re: An OS without context switching
On the core it is running currently yes, but no thread runs forever. When a thread depends on other processes it can stop execution, new thread can be run on this core. Today's systems have 4 cores, you can run 4 threads in parallel, share the data using shared memory. A better workload organization can easily put an end to context switching, specially on Bulldozer cpus with 8 cores, you will have to redesign all the software though.cxzuk wrote:
I dont understand your goal?
If you have no context switch, it means you can only ever have one thread running.
Re: An OS without context switching
But once the thread ends, it has to do a context switch.nulik wrote:On the core it is running currently yes, but no thread runs forever. When a thread depends on other processes it can stop execution, new thread can be run on this core. Today's systems have 4 cores, you can run 4 threads in parallel, share the data using shared memory. A better workload organization can easily put an end to context switching, specially on Bulldozer cpus with 8 cores, you will have to redesign all the software though.cxzuk wrote:
I dont understand your goal?
If you have no context switch, it means you can only ever have one thread running.
"When a thread depends on other processes it can stop execution, new thread can be run on this core." - Your talking about co-operative multitasking.
So from that, I think what you mean is no pre-emptive context switches.
If so, check out BareMetal (http://www.returninfinity.com/baremetal.html) as its aims are the same, code is very clean and done well.
Re: An OS without context switching
I see no issue with that but this can be achieved with a Posix confirming microkernel like QNX Neutrino. You only need processor affinity, hard realtime scheduling and the ability to disable pre-emption on a thread-by-thread basis (using SCHED_FIFO) and you have it. Neutrino does all these things and additionally has things that really matter like adaptive, sporadic and partitioned scheduling.nulik wrote:On the core it is running currently yes, but no thread runs forever. When a thread depends on other processes it can stop execution, new thread can be run on this core. Today's systems have 4 cores, you can run 4 threads in parallel, share the data using shared memory. A better workload organization can easily put an end to context switching, specially on Bulldozer cpus with 8 cores, you will have to redesign all the software though.cxzuk wrote:
I dont understand your goal?
If you have no context switch, it means you can only ever have one thread running.
[Edit] Just to be sure that I'm not seen as a QNX fanboy, I acknowledge that QNX is not perfect. I'm saying that Posix might already provide what you're looking for.
If a trainstation is where trains stop, what is a workstation ?
Re: An OS without context switching
Neutrino is almost perfect, the only problem is the proprietary license.gerryg400 wrote: this can be achieved with a Posix confirming microkernel like QNX Neutrino.
Besides BareMetal OS I have not found any cooperative multitasking OSes, so I probably will start my own project.
Re: An OS without context switching
IMO, just providing cooperative multitasking features is of little interest. What is interesting is to provide hard realtime functions in a preemptive-multitasking OS, which is quite different. I think this can be done by allocating a core to a realtime-task (or tasks) that use cooperative multitasking. The hard thing is to let the realtime tasks use and communicate with ordinary OS functions. Just disabling preemption will not guarantee that a realtime task gets to run when it needs to. It takes much more than that.
-
- Member
- Posts: 134
- Joined: Thu Aug 18, 2005 11:00 pm
- Location: Sol. Earth. Europe. Romania. Bucuresti
- Contact:
Re: An OS without context switching
I guess that you did not search too wellnulik wrote:Neutrino is almost perfect, the only problem is the proprietary license.gerryg400 wrote: this can be achieved with a Posix confirming microkernel like QNX Neutrino.
Besides BareMetal OS I have not found any cooperative multitasking OSes, so I probably will start my own project.
SolarOS is cooperative (an it has been from the start) and it is also realtime and it has an advanced API and GUI
Even it there are no public releases lately be assured that it is still developed by me
http://www.oby.ro/
Ambition is a lame excuse for the ones not brave enough to be lazy; Solar_OS http://www.oby.ro/os/
Re: An OS without context switching
awesome!bontanu wrote: SolarOS is cooperative (an it has been from the start) and it is also realtime and it has an advanced API and GUI
http://www.oby.ro/
I downloaded sol_os_2009_07_22_v0_104_05.zip but where are the sources ? can't find them. also qemu complained about floppy and aborted the boot process.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: An OS without context switching
I don't think he releases source anymore, but you never know, he's gone back and forth often enough.
I remember trolling on his forum a few years ago. Fun times.
I remember trolling on his forum a few years ago. Fun times.
Re: An OS without context switching
don't worry, if finish my (cooperative) OS it will be GPLBrynet-Inc wrote:I don't think he releases source anymore, but you never know, he's gone back and forth often enough.
I remember trolling on his forum a few years ago. Fun times.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: An OS without context switching
I'm worried.nulik wrote:don't worry, if finish my (cooperative) OS it will be GPL
Re: An OS without context switching
I'm worried.nulik wrote:don't worry, if finish my (cooperative) OS it will be GPL
Not to start a license flame war, I would choose something that is short and to the point - I still haven't read all of any of the GNU licenses and I probably never will, because they are so long, complex and mind numbingly boring, I only sort of know what they say from other sources. Whether I agree with them is another story.
Re: An OS without context switching
Found another OS that is supposedly without context switching:
http://tech.slashdot.org/story/09/02/06 ... century-os
Code: http://code.google.com/p/phantomuserland/
I personally don't like object oriented stuff (because it is slow) , so I doubt this OS will be faster than Linux, because if the kernel does range checking in code and there is a lot of messages between objects, this OS will be the slowest ever. The best way is to rely on page fault checking mechanism which is done in hardware.
http://tech.slashdot.org/story/09/02/06 ... century-os
Code: http://code.google.com/p/phantomuserland/
I personally don't like object oriented stuff (because it is slow) , so I doubt this OS will be faster than Linux, because if the kernel does range checking in code and there is a lot of messages between objects, this OS will be the slowest ever. The best way is to rely on page fault checking mechanism which is done in hardware.