Re: [Oberon] Concurrency support in Oberon
No, Oberon has no concurrency support in the language. The Oberon system provides a simple event loop, that allows programmers to do simple round-robin run-til-done scheduling. --- sinu.nayak2001@gmail.com wrote: From: Srinivas Nayak <sinu.nayak2001@gmail.com> To: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Subject: [Oberon] Concurrency support in Oberon Date: Thu, 21 Jan 2016 20:27:05 +0530 Dear All, We had Pascal, We came to its successor Modula-2. Then we came to its successor Oberon. But do we still have the concurrency programming support in Oberon, which was present in Modula-2? With thanks and best regards, Yours sincerely, Srinivas Nayak Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/ -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
What about Active Oberon? On Thu, Jan 21, 2016 at 8:33 AM John R. Strohm <strohm@airmail.net> wrote:
No, Oberon has no concurrency support in the language.
The Oberon system provides a simple event loop, that allows programmers to do simple round-robin run-til-done scheduling.
--- sinu.nayak2001@gmail.com wrote:
From: Srinivas Nayak <sinu.nayak2001@gmail.com> To: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Subject: [Oberon] Concurrency support in Oberon Date: Thu, 21 Jan 2016 20:27:05 +0530
Dear All,
We had Pascal, We came to its successor Modula-2. Then we came to its successor Oberon.
But do we still have the concurrency programming support in Oberon, which was present in Modula-2?
With thanks and best regards,
Yours sincerely, Srinivas Nayak
Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/ -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
No, Oberon has no concurrency support in the language. The Oberon system provides a simple event loop, that allows programmers to do simple round-robin run-til-done scheduling.
I agree. [Even C doesn't have concurrency support.] May be Oberon OS is simple (provides a simple event loop, that allows programmers to do simple round-robin run-til-done scheduling), but I feel a Linux like system can be programmed using Oberon language. Can't we program a Linux like operating system using Oberon language? With thanks and best regards, Yours sincerely, Srinivas Nayak Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/ On 01/21/2016 11:03 PM, John R. Strohm wrote:
No, Oberon has no concurrency support in the language.
The Oberon system provides a simple event loop, that allows programmers to do simple round-robin run-til-done scheduling.
--- sinu.nayak2001@gmail.com wrote:
From: Srinivas Nayak <sinu.nayak2001@gmail.com> To: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Subject: [Oberon] Concurrency support in Oberon Date: Thu, 21 Jan 2016 20:27:05 +0530
Dear All,
We had Pascal, We came to its successor Modula-2. Then we came to its successor Oberon.
But do we still have the concurrency programming support in Oberon, which was present in Modula-2?
With thanks and best regards,
Yours sincerely, Srinivas Nayak
Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/ -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon .
One would need to tap into the operating systems underlying "process" structures. The SAIL (Stanford Artificial Intelligence Language) which was algol-like had its own processes built into the language where process switch points were invisibly inserted into the generated code. All of the complexity of communication and blocking between processes then needed to be handled, something I believe NW wanted to avoid. -Doug Danforth On 1/21/2016 5:13 PM, Srinivas Nayak wrote:
Can't we program a Linux like operating system using Oberon language?
Replying to old post below:
On 1/21/2016 5:13 PM, Srinivas Nayak wrote:
Can't we program a Linux like operating system using Oberon language?
then.. On Thu, January 21, 2016 6:55 pm, Douglas G. Danforth wrote:
One would need to tap into the operating systems underlying "process" structures.
Isn't that what oberon "system" modules are for, escaping in emergency...
The SAIL (Stanford Artificial Intelligence Language) which was algol-like had its own processes built into the language where process switch points were invisibly inserted into the generated code. All of the complexity of communication and blocking between processes then needed to be handled, something I believe NW wanted to avoid.
Since most operating systems are written in C, and C has nothing like what Sail had, how does C allow one to tap into processes without being a full fledged Sail language... i.e. Oberon is very similar in functionality to C, but at a slightly higher level.. and Oberon has the "system" escape capability... So are we saying that even with the System module capability or "unsafe".. one can still not create a linux (actually BSD) like operating system? What is oberon lacking if so? C has something for processes that Oberon currently doesn't?
I feel, writing a Linux like OS using Oberon is possible... But how to make a Oberon program run on bare Linux, i.e. how to create runtime environment for an Oberon program using Linux linker and loader, that is now on my head... On import, we have to load modules on the fly... We should be able to unload modules and re-load... Forgetting for the time being Garbage collection and command activation... And providing certain run-time data structures... With thanks and best regards, Yours sincerely, Srinivas Nayak Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/ On 11/22/2016 07:34 PM, Lars wrote:
Replying to old post below:
On 1/21/2016 5:13 PM, Srinivas Nayak wrote:
Can't we program a Linux like operating system using Oberon language?
then..
On Thu, January 21, 2016 6:55 pm, Douglas G. Danforth wrote:
One would need to tap into the operating systems underlying "process" structures.
Isn't that what oberon "system" modules are for, escaping in emergency...
The SAIL (Stanford Artificial Intelligence Language) which was algol-like had its own processes built into the language where process switch points were invisibly inserted into the generated code. All of the complexity of communication and blocking between processes then needed to be handled, something I believe NW wanted to avoid.
Since most operating systems are written in C, and C has nothing like what Sail had, how does C allow one to tap into processes without being a full fledged Sail language...
i.e. Oberon is very similar in functionality to C, but at a slightly higher level.. and Oberon has the "system" escape capability...
So are we saying that even with the System module capability or "unsafe".. one can still not create a linux (actually BSD) like operating system? What is oberon lacking if so?
C has something for processes that Oberon currently doesn't? -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Tue, November 22, 2016 10:55 am, Srinivas Nayak wrote:
I feel, writing a Linux like OS using Oberon is possible...
But how to make a Oberon program run on bare Linux, i.e. how to create runtime environment for an Oberon program using Linux linker and loader, that is now on my head...
On import, we have to load modules on the fly... We should be able to unload modules and re-load...
But then the question is should you be copying Linux, or looking into Minix? Minix is a modular operating system design, although many people have criticized it for having too many layers required in order to make it modular. i.e. would your oberon operating system be able to reload things without rebooting the kernel, to make it more robust - the entire purpose of minix.... without crashing the kernel. I'm not so sure linux is even the operating system to copy (not a good role model). But as I've no looked much into minix, I'm not even sure about it either... It has its critics. Just thought I would bring up minix because it is based on modularization. Too bad some minix academic boys from Europe are not on this list to chime in.
Minix is good compared to Linux, at least to study the source. Even Minix is small (kernel) compared to Linux and a nice book helps on your way. Yes, it doesn't need reboot... My interest is now not about creating an OS right away... First I am thinking of how one can program in Oberon on Linux, the way I program in C and C++... Just write code on an editor, compile and run... No Oberon philosophies should be compromised which is its strength... To program in Oberon, Oberon OS shouldn't be installed on Linux... Even before this, probably I dreamed a lot more... How can one create a thread, synchronize, do mutual exclusion etc... so was this thread created... :-D With thanks and best regards, Yours sincerely, Srinivas Nayak Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/ On 11/23/2016 06:38 AM, Lars wrote:
On Tue, November 22, 2016 10:55 am, Srinivas Nayak wrote:
I feel, writing a Linux like OS using Oberon is possible...
But how to make a Oberon program run on bare Linux, i.e. how to create runtime environment for an Oberon program using Linux linker and loader, that is now on my head...
On import, we have to load modules on the fly... We should be able to unload modules and re-load...
But then the question is should you be copying Linux, or looking into Minix?
Minix is a modular operating system design, although many people have criticized it for having too many layers required in order to make it modular.
i.e. would your oberon operating system be able to reload things without rebooting the kernel, to make it more robust - the entire purpose of minix.... without crashing the kernel.
I'm not so sure linux is even the operating system to copy (not a good role model). But as I've no looked much into minix, I'm not even sure about it either... It has its critics. Just thought I would bring up minix because it is based on modularization.
Too bad some minix academic boys from Europe are not on this list to chime in. -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
First I am thinking of how one can program in Oberon on Linux, the way I program in C and C++... Just write code on an editor, compile and run...
Probably the easiest way to call C functions from an Oberon program is to add SysReq procedures to the norebo emulator. I am working with this and it feels relatively quick and effective. Converting the compiler to generate X86 or X86_64 output will take more than 300 man-hours and is highly system dependent. It will deliver faster code. Norebo uses a modified Oberon.Mod to connect the compiler environment (which uses Texts and Files) to the command line. It is possible to replace the InnerCore and use a different interface. My current approach is to use shell and editor in Linux to edit, compile and debug and add specific C functions to norebo for different experiments. Regards, Wim Niemann
Srinivas:
But how to make a Oberon program run on bare Linux, i.e. how to create runtime environment for an Oberon program using Linux linker and loader, that is now on my head...
I am not sure if there is such a thing as a Linux linker and loader. I thought that the Linux toolchain was named gcc. With that perspective, the work has already been done. en.wikipedia.org/wiki/Oberon-2#Implementations says: The Optimizing Oberon-2 Compiler compiles to C, using the gcc toolchain for program generation. [...] XDS Modula2/Oberon2 [...] contains an optimizing compiler for Intel Pentium, or "via-C" translator for cross-platform development. Available for Windows and Linux. Also do not forget Ofront.
On import, we have to load modules on the fly... We should be able to unload modules and re-load...
Linux kernel can load and unload "kernel modules" on demand with commands such as insmod and modprobe. Furthermore, internally the Linux kernel is a cooperative multitasking environment without memory protection. Sounds familiar? I found this information in Linux kernel programming books. These books also say that "kernel modules" are a form of OOP. If I look at Linux kernel, then Il recognize the most important Oberon System features in disguise. I have not seen any reference to Project Oberon in Linux literature despite some Linux kernel architects being prominent figures in academic computer science. Oberon System predated Linux "kernel modules", if I am not mistaken. Linux creators seem not to know the history of their own field.
I feel, writing a Linux like OS using Oberon is possible... Forgetting for the time being Garbage collection and command activation... And providing certain run-time data structures...
First, why write another Linux if you have the original? What would you gain? Second, it is not a stretch to say that Oberon System is an OS kernel by itself. Just the way it is now, it is quite analogous to the Linux kernel. If you agree with that, then you "only" need to add the notion of tasks running in the user memory space, while the Oberon System now assumes the role of the Linux kernel. You "only" need to add virtual memory for the user space, as well as "system calls" to break through the user/kernel barrier. The system calls can be executed by user programs written in some other language other than Oberon. After doing this you will have an analogon of the Linux architecture. I am not sure what would be a benefit of developing such a copy. W.
Nice coincidence, received Skulski's post while I was posting mine, just two seconds after.
First, why write another Linux if you have the original? What would you gain?
You are correct. A big No... I never intended to create one more Linux... When our world is full of OSs... why shall I create one more? It was just thrown as an example to stretch thinking of friends, to answer, how concurrency can be achieved using Oberon language... Intention behind Linux example was: Say tomorrow I will set out to write a new OS using Oberon...say a Unix like OS... Oberon is a system programming language. Everybody agree on this. So, can I succeed choosing Oberon as my language of this OS implementation? I was thinking, is there any language level primitive for atomic action? This was the thought that time... Later I saw Active Oberon is having something called Await and Signal. :-) No doubt, even if Oberon doesn't have any such primitive, like C, we can create small low level functions which directly calls machine instruction like XCHG (for x86) and provide atomicity. And then on wards one can build up slowly the rest of the Unix world. But having a language feature is even better...like Await and Signal. Otherwise, such two SYSTEM functions also will do the job. And this was the after thought... :-) ============ Ok, now about Oberon programming on Linux...
I am not sure if there is such a thing as a Linux linker and loader. I thought that the Linux toolchain was named GCC. With that perspective, the work has already been done.
To my knowledge, Linux's linker is "ld" and loader is "ld-Linux.so" When you compile a program with GCC, ld is called inside GCC it to create the executable. Inside the executable, loader name "ld-Linux.so" is hiddenly kept written. When shell starts to execute the executable, this loader gets activated. Then all needed librararies are loaded and your program starts...
Linux kernel can load and unload "kernel modules" on demand with commands such as insmod and modprobe. Correct, but I was talking about Oberon modules. Furthermore, internally the Linux kernel is a cooperative multitasking environment without memory protection. Sounds familiar? Yes. correct.
en.wikipedia.org/wiki/Oberon-2#Implementations says: The Optimizing Oberon-2 Compiler compiles to C, using the GCC toolchain for program generation. [...] XDS Modula2/Oberon2 [...] contains an optimizing compiler for Intel Pentium, or "via-C" translator for cross-platform development. Available for Windows and Linux.
Correct. OO2C is good. Also there is voc, which is good too. My intention was not about optimized output and portability. I was interested to know how things work... So there, I was thinking, if Oberon is a small language, and can create native code, why not it can emit x86 code directly? Now you will say, why not take OP2 compiler that comes with Native Oberon? But I was thinking, if NW's Oberon 7 compiler is just 4 files and all machine code can be put into 1 file OSG.Mod, why take pain of many files of OP2. Again portability is not the need. Now, if we agree to this, we can have a small Oberon 7 compiler that directly emits x86 code... After this, time to run the code... No doubt, output of OO2C and voc also runs. But they take help of Linux loader. Which is simply inadiquate to provide beauties of Oberon philosophy. Like command activation, dynamically (un)loading imported modules...etc. Towards that end, you will suggest 1. installing Oberon OS on Linux to get those benefits. or 2. installing Blackbox on Linux. 1. I think, why we need a whole OS to load? Can't we create a minimal runtime environment for our Oberon program? Like Java has its own, ld-Linux.so is C's runtime environment... Similarly, if we can create our own loader, it can be activated from executable, it can provide us SYSTEM, it can provide us rest runtime necessities of our program, it can provide garbage collection, etc etc... just a dream :-D 2. I am happy about this... But the way ld-Linux.so works invisibly, if blackbox could work similarly... And yes, I was thinking about Oberon 7, not component pascal and component oriented stuff... Just small part of blackbox which allows Oberon 7 features only... to help me create CLI (and GUI) apps in Oberon in an small environment like guided in Owkwood guideline... Now, I am sure, every body will kill me... They will call me mad... But it was just a dream... With thanks and best regards, Yours sincerely, Srinivas Nayak Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/ On 11/23/2016 10:12 AM, Skulski, Wojciech wrote:
Srinivas:
But how to make a Oberon program run on bare Linux, i.e. how to create runtime environment for an Oberon program using Linux linker and loader, that is now on my head...
I am not sure if there is such a thing as a Linux linker and loader. I thought that the Linux toolchain was named gcc. With that perspective, the work has already been done.
en.wikipedia.org/wiki/Oberon-2#Implementations says: The Optimizing Oberon-2 Compiler compiles to C, using the gcc toolchain for program generation. [...] XDS Modula2/Oberon2 [...] contains an optimizing compiler for Intel Pentium, or "via-C" translator for cross-platform development. Available for Windows and Linux.
Also do not forget Ofront.
On import, we have to load modules on the fly... We should be able to unload modules and re-load...
Linux kernel can load and unload "kernel modules" on demand with commands such as insmod and modprobe. Furthermore, internally the Linux kernel is a cooperative multitasking environment without memory protection. Sounds familiar? I found this information in Linux kernel programming books. These books also say that "kernel modules" are a form of OOP. If I look at Linux kernel, then Il recognize the most important Oberon System features in disguise.
I have not seen any reference to Project Oberon in Linux literature despite some Linux kernel architects being prominent figures in academic computer science. Oberon System predated Linux "kernel modules", if I am not mistaken. Linux creators seem not to know the history of their own field.
I feel, writing a Linux like OS using Oberon is possible... Forgetting for the time being Garbage collection and command activation... And providing certain run-time data structures...
First, why write another Linux if you have the original? What would you gain?
Second, it is not a stretch to say that Oberon System is an OS kernel by itself. Just the way it is now, it is quite analogous to the Linux kernel. If you agree with that, then you "only" need to add the notion of tasks running in the user memory space, while the Oberon System now assumes the role of the Linux kernel. You "only" need to add virtual memory for the user space, as well as "system calls" to break through the user/kernel barrier. The system calls can be executed by user programs written in some other language other than Oberon.
After doing this you will have an analogon of the Linux architecture. I am not sure what would be a benefit of developing such a copy.
W.
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Srinivas The goal of the Oberon language was to show two things - it shall be a high level language simple to learn with as few reserved words as necessary. - it shall offer high level functions but also low layer functions being able to use it to program an OS. The proof of the first point is: the report describing Oberon-07 (syntax and semantics) is only 17 pages. The proof of the second point is: ProjectOberon is an OS completely written in Oberon. Concurrency can be non-preemptive or preemptive. Non-preemptive concurrency is easier to implement in your OS. You have to study mechanisms like semaphores, mutex and coroutines. In essence it boils down to how your underlaying CPU is handling procedure calls. Knowing the exact details of this mechanisms (what registers are used, does the CPU store/restore registers automatically, what happens to the stack…) is paramount when you want to implement e.g. coroutines. Coroutines can be provided on top of ProjectOberon in Oberon-07 as normal module. You will need SYSTEM.REG and SYSTEM.LDREG to do it. Pre-emptive concurrency (aka interrupts) are harder and need some compiler support to handle the interrupt concept of the underlying CPU correctly. br Jörg
Am 23.11.2016 um 07:15 schrieb Srinivas Nayak <sinu.nayak2001@gmail.com>:
Nice coincidence, received Skulski's post while I was posting mine, just two seconds after.
First, why write another Linux if you have the original? What would you gain?
You are correct. A big No... I never intended to create one more Linux... When our world is full of OSs... why shall I create one more? It was just thrown as an example to stretch thinking of friends, to answer, how concurrency can be achieved using Oberon language...
Intention behind Linux example was: Say tomorrow I will set out to write a new OS using Oberon...say a Unix like OS... Oberon is a system programming language. Everybody agree on this. So, can I succeed choosing Oberon as my language of this OS implementation? I was thinking, is there any language level primitive for atomic action?
This was the thought that time...
Later I saw Active Oberon is having something called Await and Signal. :-) No doubt, even if Oberon doesn't have any such primitive, like C, we can create small low level functions which directly calls machine instruction like XCHG (for x86) and provide atomicity. And then on wards one can build up slowly the rest of the Unix world. But having a language feature is even better...like Await and Signal. Otherwise, such two SYSTEM functions also will do the job.
And this was the after thought... :-)
============
Ok, now about Oberon programming on Linux...
I am not sure if there is such a thing as a Linux linker and loader. I thought that the Linux toolchain was named GCC. With that perspective, the work has already been done.
To my knowledge, Linux's linker is "ld" and loader is "ld-Linux.so" When you compile a program with GCC, ld is called inside GCC it to create the executable. Inside the executable, loader name "ld-Linux.so" is hiddenly kept written. When shell starts to execute the executable, this loader gets activated. Then all needed librararies are loaded and your program starts...
Linux kernel can load and unload "kernel modules" on demand with commands such as insmod and modprobe. Correct, but I was talking about Oberon modules. Furthermore, internally the Linux kernel is a cooperative multitasking environment without memory protection. Sounds familiar? Yes. correct.
en.wikipedia.org/wiki/Oberon-2#Implementations says: The Optimizing Oberon-2 Compiler compiles to C, using the GCC toolchain for program generation. [...] XDS Modula2/Oberon2 [...] contains an optimizing compiler for Intel Pentium, or "via-C" translator for cross-platform development. Available for Windows and Linux.
Correct. OO2C is good. Also there is voc, which is good too. My intention was not about optimized output and portability. I was interested to know how things work... So there, I was thinking, if Oberon is a small language, and can create native code, why not it can emit x86 code directly? Now you will say, why not take OP2 compiler that comes with Native Oberon? But I was thinking, if NW's Oberon 7 compiler is just 4 files and all machine code can be put into 1 file OSG.Mod, why take pain of many files of OP2. Again portability is not the need. Now, if we agree to this, we can have a small Oberon 7 compiler that directly emits x86 code...
After this, time to run the code... No doubt, output of OO2C and voc also runs. But they take help of Linux loader. Which is simply inadiquate to provide beauties of Oberon philosophy. Like command activation, dynamically (un)loading imported modules...etc. Towards that end, you will suggest 1. installing Oberon OS on Linux to get those benefits. or 2. installing Blackbox on Linux.
1. I think, why we need a whole OS to load? Can't we create a minimal runtime environment for our Oberon program? Like Java has its own, ld-Linux.so is C's runtime environment... Similarly, if we can create our own loader, it can be activated from executable, it can provide us SYSTEM, it can provide us rest runtime necessities of our program, it can provide garbage collection, etc etc... just a dream :-D
2. I am happy about this... But the way ld-Linux.so works invisibly, if blackbox could work similarly... And yes, I was thinking about Oberon 7, not component pascal and component oriented stuff... Just small part of blackbox which allows Oberon 7 features only... to help me create CLI (and GUI) apps in Oberon in an small environment like guided in Owkwood guideline...
Now, I am sure, every body will kill me... They will call me mad... But it was just a dream...
With thanks and best regards,
Yours sincerely, Srinivas Nayak
Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/
On 11/23/2016 10:12 AM, Skulski, Wojciech wrote:
Srinivas:
But how to make a Oberon program run on bare Linux, i.e. how to create runtime environment for an Oberon program using Linux linker and loader, that is now on my head...
I am not sure if there is such a thing as a Linux linker and loader. I thought that the Linux toolchain was named gcc. With that perspective, the work has already been done.
en.wikipedia.org/wiki/Oberon-2#Implementations says: The Optimizing Oberon-2 Compiler compiles to C, using the gcc toolchain for program generation. [...] XDS Modula2/Oberon2 [...] contains an optimizing compiler for Intel Pentium, or "via-C" translator for cross-platform development. Available for Windows and Linux.
Also do not forget Ofront.
On import, we have to load modules on the fly... We should be able to unload modules and re-load...
Linux kernel can load and unload "kernel modules" on demand with commands such as insmod and modprobe. Furthermore, internally the Linux kernel is a cooperative multitasking environment without memory protection. Sounds familiar? I found this information in Linux kernel programming books. These books also say that "kernel modules" are a form of OOP. If I look at Linux kernel, then Il recognize the most important Oberon System features in disguise.
I have not seen any reference to Project Oberon in Linux literature despite some Linux kernel architects being prominent figures in academic computer science. Oberon System predated Linux "kernel modules", if I am not mistaken. Linux creators seem not to know the history of their own field.
I feel, writing a Linux like OS using Oberon is possible... Forgetting for the time being Garbage collection and command activation... And providing certain run-time data structures...
First, why write another Linux if you have the original? What would you gain?
Second, it is not a stretch to say that Oberon System is an OS kernel by itself. Just the way it is now, it is quite analogous to the Linux kernel. If you agree with that, then you "only" need to add the notion of tasks running in the user memory space, while the Oberon System now assumes the role of the Linux kernel. You "only" need to add virtual memory for the user space, as well as "system calls" to break through the user/kernel barrier. The system calls can be executed by user programs written in some other language other than Oberon.
After doing this you will have an analogon of the Linux architecture. I am not sure what would be a benefit of developing such a copy.
W.
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Srinivas an additional remark. The OS ProjectOberon offers already a kind of special pre-emptive concurrency: background tasks. Not a very useful example but just to show what the Oberon OS offers right out of the box: MODULE Concurrency; IMPORT Oberon, Out; VAR t: Oberon.Task; PROCEDURE Star; BEGIN Out.Write("*“) END Star; PROCEDURE StopStar*; BEGIN Oberon.Remove(t) END StopStar; BEGIN t := Oberon.NewTask(Star, 1500); Oberon.Install(t) END Concurrency. Here the procedure „Star" is called every 1.5 seconds. It writes a star at your cursor position. Concurrency.StopStar gets rid of these annoying stars :-) br Jörg
Am 23.11.2016 um 09:06 schrieb Jörg Straube <joerg.straube@iaeth.ch>:
Srinivas
The goal of the Oberon language was to show two things - it shall be a high level language simple to learn with as few reserved words as necessary. - it shall offer high level functions but also low layer functions being able to use it to program an OS.
The proof of the first point is: the report describing Oberon-07 (syntax and semantics) is only 17 pages. The proof of the second point is: ProjectOberon is an OS completely written in Oberon.
Concurrency can be non-preemptive or preemptive. Non-preemptive concurrency is easier to implement in your OS. You have to study mechanisms like semaphores, mutex and coroutines.
In essence it boils down to how your underlaying CPU is handling procedure calls. Knowing the exact details of this mechanisms (what registers are used, does the CPU store/restore registers automatically, what happens to the stack…) is paramount when you want to implement e.g. coroutines. Coroutines can be provided on top of ProjectOberon in Oberon-07 as normal module. You will need SYSTEM.REG and SYSTEM.LDREG to do it.
Pre-emptive concurrency (aka interrupts) are harder and need some compiler support to handle the interrupt concept of the underlying CPU correctly.
br Jörg
Am 23.11.2016 um 07:15 schrieb Srinivas Nayak <sinu.nayak2001@gmail.com>:
Nice coincidence, received Skulski's post while I was posting mine, just two seconds after.
First, why write another Linux if you have the original? What would you gain?
You are correct. A big No... I never intended to create one more Linux... When our world is full of OSs... why shall I create one more? It was just thrown as an example to stretch thinking of friends, to answer, how concurrency can be achieved using Oberon language...
Intention behind Linux example was: Say tomorrow I will set out to write a new OS using Oberon...say a Unix like OS... Oberon is a system programming language. Everybody agree on this. So, can I succeed choosing Oberon as my language of this OS implementation? I was thinking, is there any language level primitive for atomic action?
This was the thought that time...
Later I saw Active Oberon is having something called Await and Signal. :-) No doubt, even if Oberon doesn't have any such primitive, like C, we can create small low level functions which directly calls machine instruction like XCHG (for x86) and provide atomicity. And then on wards one can build up slowly the rest of the Unix world. But having a language feature is even better...like Await and Signal. Otherwise, such two SYSTEM functions also will do the job.
And this was the after thought... :-)
============
Ok, now about Oberon programming on Linux...
I am not sure if there is such a thing as a Linux linker and loader. I thought that the Linux toolchain was named GCC. With that perspective, the work has already been done.
To my knowledge, Linux's linker is "ld" and loader is "ld-Linux.so" When you compile a program with GCC, ld is called inside GCC it to create the executable. Inside the executable, loader name "ld-Linux.so" is hiddenly kept written. When shell starts to execute the executable, this loader gets activated. Then all needed librararies are loaded and your program starts...
Linux kernel can load and unload "kernel modules" on demand with commands such as insmod and modprobe. Correct, but I was talking about Oberon modules. Furthermore, internally the Linux kernel is a cooperative multitasking environment without memory protection. Sounds familiar? Yes. correct.
en.wikipedia.org/wiki/Oberon-2#Implementations says: The Optimizing Oberon-2 Compiler compiles to C, using the GCC toolchain for program generation. [...] XDS Modula2/Oberon2 [...] contains an optimizing compiler for Intel Pentium, or "via-C" translator for cross-platform development. Available for Windows and Linux.
Correct. OO2C is good. Also there is voc, which is good too. My intention was not about optimized output and portability. I was interested to know how things work... So there, I was thinking, if Oberon is a small language, and can create native code, why not it can emit x86 code directly? Now you will say, why not take OP2 compiler that comes with Native Oberon? But I was thinking, if NW's Oberon 7 compiler is just 4 files and all machine code can be put into 1 file OSG.Mod, why take pain of many files of OP2. Again portability is not the need. Now, if we agree to this, we can have a small Oberon 7 compiler that directly emits x86 code...
After this, time to run the code... No doubt, output of OO2C and voc also runs. But they take help of Linux loader. Which is simply inadiquate to provide beauties of Oberon philosophy. Like command activation, dynamically (un)loading imported modules...etc. Towards that end, you will suggest 1. installing Oberon OS on Linux to get those benefits. or 2. installing Blackbox on Linux.
1. I think, why we need a whole OS to load? Can't we create a minimal runtime environment for our Oberon program? Like Java has its own, ld-Linux.so is C's runtime environment... Similarly, if we can create our own loader, it can be activated from executable, it can provide us SYSTEM, it can provide us rest runtime necessities of our program, it can provide garbage collection, etc etc... just a dream :-D
2. I am happy about this... But the way ld-Linux.so works invisibly, if blackbox could work similarly... And yes, I was thinking about Oberon 7, not component pascal and component oriented stuff... Just small part of blackbox which allows Oberon 7 features only... to help me create CLI (and GUI) apps in Oberon in an small environment like guided in Owkwood guideline...
Now, I am sure, every body will kill me... They will call me mad... But it was just a dream...
With thanks and best regards,
Yours sincerely, Srinivas Nayak
Home: http://www.mathmeth.com/sn/ Blog: http://srinivas-nayak.blogspot.in/
On 11/23/2016 10:12 AM, Skulski, Wojciech wrote:
Srinivas:
But how to make a Oberon program run on bare Linux, i.e. how to create runtime environment for an Oberon program using Linux linker and loader, that is now on my head...
I am not sure if there is such a thing as a Linux linker and loader. I thought that the Linux toolchain was named gcc. With that perspective, the work has already been done.
en.wikipedia.org/wiki/Oberon-2#Implementations says: The Optimizing Oberon-2 Compiler compiles to C, using the gcc toolchain for program generation. [...] XDS Modula2/Oberon2 [...] contains an optimizing compiler for Intel Pentium, or "via-C" translator for cross-platform development. Available for Windows and Linux.
Also do not forget Ofront.
On import, we have to load modules on the fly... We should be able to unload modules and re-load...
Linux kernel can load and unload "kernel modules" on demand with commands such as insmod and modprobe. Furthermore, internally the Linux kernel is a cooperative multitasking environment without memory protection. Sounds familiar? I found this information in Linux kernel programming books. These books also say that "kernel modules" are a form of OOP. If I look at Linux kernel, then Il recognize the most important Oberon System features in disguise.
I have not seen any reference to Project Oberon in Linux literature despite some Linux kernel architects being prominent figures in academic computer science. Oberon System predated Linux "kernel modules", if I am not mistaken. Linux creators seem not to know the history of their own field.
I feel, writing a Linux like OS using Oberon is possible... Forgetting for the time being Garbage collection and command activation... And providing certain run-time data structures...
First, why write another Linux if you have the original? What would you gain?
Second, it is not a stretch to say that Oberon System is an OS kernel by itself. Just the way it is now, it is quite analogous to the Linux kernel. If you agree with that, then you "only" need to add the notion of tasks running in the user memory space, while the Oberon System now assumes the role of the Linux kernel. You "only" need to add virtual memory for the user space, as well as "system calls" to break through the user/kernel barrier. The system calls can be executed by user programs written in some other language other than Oberon.
After doing this you will have an analogon of the Linux architecture. I am not sure what would be a benefit of developing such a copy.
W.
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Tue, November 22, 2016 11:15 pm, Srinivas Nayak wrote:
Nice coincidence, received Skulski's post while I was posting mine, just two seconds after.
First, why write another Linux if you have the original? What would you gain?
You are correct. A big No... I never intended to create one more Linux...
Well there is BSD..and minix.. so why not? As much as I hate forks, or clones, or duplications of efforts, I'm all in favor of academic projects that go against the grind... BSD tends to be simpler without as many nobs as linux, while minix tends to try to solve the crashing issues and danger issues to try and make the system more safe and reliable. Different approaches, all still useful research projects.
When our world is full of OSs... why shall I create one more?
Because all operating systems are garbage and suck. "Sucks less" is the goal... Same goes with programming languages. Why have one more? Because most of them are pathetic... Oh no, a pessimist in the room!
Later I saw Active Oberon is having something called Await and Signal. :-) No doubt, even if Oberon doesn't have any such primitive, like C, we can create small low level functions which directly calls machine instruction like XCHG (for x86) and provide atomicity.
And only allow this if SYSTEM keyword used? That was my point in another email... i.e. if oberon doesn't have something that C has, why not implement it in SYSTEM? If SYSTEM ability is lacking, it must be improved
1. I think, why we need a whole OS to load? Can't we create a minimal runtime environment for our Oberon program? Like Java has its own, ld-Linux.so is C's runtime environment...
And GoLang has a runtime similar to, maybe visual basic 6.0 where the runtime is shipped inside the executable. Well not so similar to visual basic 6 if it was a DLL. So, you ship runtime as part of exe, or part of something else.. like JVM, or ld-linux.so..... What is disadvantage of shipping it with Exe/Elf? makes exe bigger... you don't like that? Making something like ld-linux reduces need for runtime to be cloned into each exe, wasting space? Shipping runtime as DLL/SO causes "DLL hell"? .... like when you got that visual basic error "run time missing" or "Visual c++ library missing"... So you mean putting run time closer to the kernel? instead of a JVM that sits on the system as a service running...
Similarly, if we can create our own loader, it can be activated from executable, it can provide us SYSTEM, it can provide us rest runtime necessities of our program, it can provide garbage collection, etc etc... just a dream :-D
Then for another dream, create apache module that causes web servers to have access to oberon system... Not sure if this would be of any use.
Now, I am sure, every body will kill me... They will call me mad... But it was just a dream...
You may have reached Arthur Schopenhauer... https://www.brainyquote.com/quotes/quotes/a/arthurscho103608.html
Hi Using the module SYSTEM is not dangerous per se. It is rather thought to flag a module as "non portable". Functionality provided by module SYSTEM are either HW related, endianness related or low-level CPU register related. The functionality of SYSTEM is implemented by the compiler itself, so you can compare it to kind of compiler flags in C. Programs using MODULE are most probably not easily portable to other HW, CPUs or register usage schemes. Writing OSes (and compilers) tend to be very close to HW/CPU. br Jörg -----Original Message----- From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Lars Sent: Donnerstag, 24. November 2016 12:20 To: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Subject: Re: [Oberon] Concurrency support in Oberon On Tue, November 22, 2016 11:15 pm, Srinivas Nayak wrote:
Nice coincidence, received Skulski's post while I was posting mine, just two seconds after.
First, why write another Linux if you have the original? What would you gain?
You are correct. A big No... I never intended to create one more Linux...
Well there is BSD..and minix.. so why not? As much as I hate forks, or clones, or duplications of efforts, I'm all in favor of academic projects that go against the grind... BSD tends to be simpler without as many nobs as linux, while minix tends to try to solve the crashing issues and danger issues to try and make the system more safe and reliable. Different approaches, all still useful research projects.
When our world is full of OSs... why shall I create one more?
Because all operating systems are garbage and suck. "Sucks less" is the goal... Same goes with programming languages. Why have one more? Because most of them are pathetic... Oh no, a pessimist in the room!
Later I saw Active Oberon is having something called Await and Signal. :-) No doubt, even if Oberon doesn't have any such primitive, like C, we can create small low level functions which directly calls machine instruction like XCHG (for x86) and provide atomicity.
And only allow this if SYSTEM keyword used? That was my point in another email... i.e. if oberon doesn't have something that C has, why not implement it in SYSTEM? If SYSTEM ability is lacking, it must be improved
1. I think, why we need a whole OS to load? Can't we create a minimal runtime environment for our Oberon program? Like Java has its own, ld-Linux.so is C's runtime environment...
And GoLang has a runtime similar to, maybe visual basic 6.0 where the runtime is shipped inside the executable. Well not so similar to visual basic 6 if it was a DLL. So, you ship runtime as part of exe, or part of something else.. like JVM, or ld-linux.so..... What is disadvantage of shipping it with Exe/Elf? makes exe bigger... you don't like that? Making something like ld-linux reduces need for runtime to be cloned into each exe, wasting space? Shipping runtime as DLL/SO causes "DLL hell"? .... like when you got that visual basic error "run time missing" or "Visual c++ library missing"... So you mean putting run time closer to the kernel? instead of a JVM that sits on the system as a service running...
Similarly, if we can create our own loader, it can be activated from executable, it can provide us SYSTEM, it can provide us rest runtime necessities of our program, it can provide garbage collection, etc etc... just a dream :-D
Then for another dream, create apache module that causes web servers to have access to oberon system... Not sure if this would be of any use.
Now, I am sure, every body will kill me... They will call me mad... But it was just a dream...
You may have reached Arthur Schopenhauer... https://www.brainyquote.com/quotes/quotes/a/arthurscho103608.html -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
First, why write another Linux if you have the original? What would you gain?
You are correct. A big No... I never intended to create one more Linux...
Well there is BSD..and minix.. so why not?
Well (yet another times): avoid mega-lines of a monolithic kernel written in an Intrinsically unsafe programming language ...
On 22 November 2016 at 18:55, Srinivas Nayak <sinu.nayak2001@gmail.com> wrote:
I feel, writing a Linux like OS using Oberon is possible...
I just want to check. You do realise that there is _already_ an Oberon OS? Or rather, family of OSes? The original was also called Oberon: https://en.wikipedia.org/wiki/Oberon_(operating_system) It was subsequently developed into a richer, multiprocessor/multithreaded OS with a zooming GUI: https://en.wikipedia.org/wiki/Bluebottle_OS I posted a collection of links about it on my tech blog: http://liam-on-linux.livejournal.com/46523.html -- Liam Proven • Profile: http://lproven.livejournal.com/profile Email: lproven@cix.co.uk • GMail/Twitter/Facebook/Flickr: lproven Skype/MSN: lproven@hotmail.com • LinkedIn/AIM/Yahoo: liamproven Cell/Mobiles: +44 7939-087884 (UK) • +420 702 829 053 (ČR)
Am 22.11.2016 um 18:55 schrieb Srinivas Nayak:
I feel, writing a Linux like OS using Oberon is possible...
Linux is a kernel, not an OS...
But how to make a Oberon program run on bare Linux, i.e. how to create runtime environment for an Oberon program using Linux linker and loader, that is now on my head...
As far as I understand it, LLVM might be an ideal tool to run Oberon programs on Linux once an LLVM backend is written for an Oberon compiler that generates LLVM-IR output. Peter
"process" is the key word, not system. Every 100 instructions there would be inserted a jump to another set of code corresponding to a different process. One could inhibit that jump by stating SAFE in ones code. One a single CPU platform one simply jumps from one code chunk to another (time share, process share). I suppose on a multi core chip that could be implemented by runing multiple cores in parallel. On 11/22/2016 6:04 AM, Lars wrote:
Since most operating systems are written in C, and C has nothing like what Sail had, how does C allow one to tap into processes without being a full fledged Sail language...
i.e. Oberon is very similar in functionality to C, but at a slightly higher level.. and Oberon has the "system" escape capability...
On Tue, November 22, 2016 4:45 pm, Douglas G Danforth wrote:
"process" is the key word, not system.
But the question is, in order to implement it in oberon, you have to use a unsafe/system module, or regular oberon code without using system? i.e. in oberon the SYSTEM keyword, AFAIR is for low level coding.... So, would this only be implementable if you use SYSTEM to discourage dangerous language usage otherwise. I thought the SYSTEM keyword in oberon was when you were doing C like stuff. So if oberon currently lacks something that C has already, then it would be something to add to SYSTEM, no? If SYSTEM ever needed to be expanded to allow even more low level tools than it currently has..... SYSTEM is where you would add that, right? The question is always how much dangerous features do you offer to the programmer in regular oberon, and how many dangerous features do you keep in the system. If oberon cannot currently write a unix operating system and C can, then wouldn't you implement process related hacks into System, and not main oberon? Another question is, what will oberon have to compete with GoLang goroutines or other language coroutines.
Every 100 instructions there would be inserted a jump to another set of code corresponding to a different process. One could inhibit that jump by stating SAFE in ones code. One a single CPU platform one simply jumps from one code chunk to another (time share, process share). I suppose on a multi core chip that could be implemented by runing multiple cores in parallel.
On 11/22/2016 6:04 AM, Lars wrote:
Since most operating systems are written in C, and C has nothing like what Sail had, how does C allow one to tap into processes without being a full fledged Sail language...
i.e. Oberon is very similar in functionality to C, but at a slightly higher level.. and Oberon has the "system" escape capability...
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Dear all, with the work of Prof. Gutknecht and our group at ETH a significant amount of research has been conducted with regards to how to program systems involving many processors/cores/compute units in the spirit of Oberon. Please consider reading the following theses in order to understand how a multicore system could be programmed (in the spirit of Oberon) "The Active Object System Design and Multiprocessor Implementation" by Pieter Muller (2001) --http://e-collection.library.ethz.ch/eserv/eth:26082/eth-26082-02.pdf "Combining Lock-Free Programming with Cooperative Multitasking for a Portable Multiprocessor Runtime System" by Florian Negele (2014) https://e-collection.library.ethz.ch/view/eth:47094 and, if you like, you may also want to have a glance on our papers on the FPGA-based / heterogeneous systems high level programming approach: Felix Friedrich, Oleksii Morozov, Patrick Hunziker, A Compute Model for Generating High Performance Computingng SoCs on Hybrid Systems with FPGAs. Third International Workshop on FPGAs for Software Programmers (FSP 2016), August 29, 2016, Lausanne, Switzerland, https://www.inf.ethz.ch/personal/felixf/pdfs/2016_FSP_ComputeModelHPSoCFPGA.... Felix Friedrich, Ling Liu, Jürg Gutknecht: Active Cells: A Computing Model for Rapid Construction of On-Chip Multi-core Systems. ACIS-ICIS 2012: 463-469, https://www.inf.ethz.ch/personal/felixf/pdfs/2012_ActiveCells.pdf Sorry for the advertising. But really, a lot of the questions that I currently see on the mailing list might have been answered there. Rgds Felix Friedrich
On Tue, November 22, 2016 4:45 pm, Douglas G Danforth wrote:
"process" is the key word, not system. But the question is, in order to implement it in oberon, you have to use a unsafe/system module, or regular oberon code without using system?
i.e. in oberon the SYSTEM keyword, AFAIR is for low level coding....
So, would this only be implementable if you use SYSTEM to discourage dangerous language usage otherwise.
I thought the SYSTEM keyword in oberon was when you were doing C like stuff. So if oberon currently lacks something that C has already, then it would be something to add to SYSTEM, no?
If SYSTEM ever needed to be expanded to allow even more low level tools than it currently has..... SYSTEM is where you would add that, right? The question is always how much dangerous features do you offer to the programmer in regular oberon, and how many dangerous features do you keep in the system.
If oberon cannot currently write a unix operating system and C can, then wouldn't you implement process related hacks into System, and not main oberon?
Another question is, what will oberon have to compete with GoLang goroutines or other language coroutines.
Every 100 instructions there would be inserted a jump to another set of code corresponding to a different process. One could inhibit that jump by stating SAFE in ones code. One a single CPU platform one simply jumps from one code chunk to another (time share, process share). I suppose on a multi core chip that could be implemented by runing multiple cores in parallel.
On 11/22/2016 6:04 AM, Lars wrote:
Since most operating systems are written in C, and C has nothing like what Sail had, how does C allow one to tap into processes without being a full fledged Sail language...
i.e. Oberon is very similar in functionality to C, but at a slightly higher level.. and Oberon has the "system" escape capability... -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Felix: I remember e-mailing you to about Active Cells. The answer back then was that Active Cells were an academic project which maybe will be released one day. Was it relesed? I would be interested in your comment about differences and similarities between Active Cells and Chips. pypi.python.org/pypi/Chips chips-20.readthedocs.io/en/latest/ github.com/dawsonjon/Chips-2.0 The Chips author recently released an implemenetation of the TCP/IP socket in the FPGA. It is potentially a very useful core, somewhat similar to Wiznet. This core demonstrates that Chips have a real world potential. opencores.org/project,tcp_socket I guess the real question is whether Active Cells have reached a status that they are usable for a non-ETH project. Or are Active Cells still an academic research? Chips are meant to be useful rather than academic. I wonder if Active Cells are heading in this direction. The relevance of this post to concurrency is that Chips are implemented with concurrent RISC cores. Read this: chips-20.readthedocs.io/en/latest/home/index.html#under-the-hood Thanks, Wojtek
On 22 Jan 2016, at 01:39, Srinivas Nayak <sinu.nayak2001@gmail.com> wrote:
I agree. [Even C doesn't have concurrency support.] May be Oberon OS is simple (provides a simple event loop, that allows programmers to do simple round-robin run-til-done scheduling), but I feel a Linux like system can be programmed using Oberon language.
It's a general-purpose programming language so it would be possible.
Can't we program a Linux like operating system using Oberon language?
But why would you want to? B
John R. Strohm wrote:
No, Oberon has no concurrency support in the language.
The Oberon system provides a simple event loop, that allows programmers to do simple round-robin run-til-done scheduling.
It's probably already been mentioned, but there is a concurrent SUPER PASCAL history out there, along with concurrent oberon, known as I believe: Active Oberon Zonnon? https://www.google.ca/search?q=concurrent+oberon See also interesting history: https://www.google.ca/search?q=SUPER+PASCAL Languages that faded away into academic obscurity? Super Pascal, Pascal/R (relational pascal)... Anyone have the electric chargers from the hospital emergency room so I can bring back to life the dead toys?
participants (16)
-
Bob Walkden -
Douglas G Danforth -
Douglas G. Danforth -
Felix Friedrich -
Jack Johnson -
John R. Strohm -
Jörg -
Jörg Straube -
Lars -
Lars O -
Liam Proven -
Peter Matthias -
Skulski, Wojciech -
Srinivas Nayak -
Treutwein Bernhard -
Wim Niemann