I am learning Rust step by step, and I wonder if at the end of the course I will be ever able to write something like a mini scheduler that can run on a real target.
I am learning Rust step by step, and I wonder if at the end of the course I will be ever able to write something like a mini scheduler that can run on a real target.
Probably no, but hey? At least I will have learned something new
The same applied to other languages I have learned in the past. For instance ... Pascal? I have never seen an OS written in such language. Basic? No nice, etc.
Except Assembly. I have seen a lot of firmware and operating systems written in Assembly, but all my books about operating systems mention C or C++ as the only development language.
Have anyone seen and can report here a link to an OS not written in C/C++/ObjC?
TempleOS, obviously (
HolyC and x86 assembly).
Many less famous operating systems such as Linux and Windows follow this pattern, though they tend to use boring mainstream languages like C and C++.
OS/360 was written in pure assembly, because in those days,
men were real men.
I think a large chunk of the first Mac OS versions was written in Pascal. Ditto for Lisa OS which Mac OS was partly based on.
CP/M was partly written in PL/M.
Probably a lot of other examples, that's the two that come to mind at the moment.
Edit: I should also have mentioned Wirth's Oberon OS, written in Oberon! Although mostly an academic exercise and learning tool, it was a usable OS.
http://menuetos.net/ - Pure Assembly
One can't write an OS in garbage
collected languages, maybe some kind of student didactic implementation running on a virtual machine, you get rid of C/C++ and assembly, no OS, end of story.
Maybe sometimes later when the access to the actual hardware will restricted and just be offered via some hypervisor or other virtualization/containerization/obfuscation/simulation system one can make a "safe & modern"
OS in Python, node.js, Ruby, Rust, Go or other crap application languages, but the real OS glued to the HW will still be C/assembly. Other 65535 attempts failed miserably so far, you can't write OS low level stuff with
import system.os.
Of course all the other stuff above could still be used perfectly fine for writing apps and other user mode programs, just not bootloaders, drivers and schedulers. Who isn't able to cut it in assembly and C should stay away from any OS related stuff.
Cheers,
DC1MC
thanks guy!
any publicly available source?
http://menuetos.net/ - Pure Assembly
Wow, crazy, but cool
Who isn't able to cut it in assembly and C should stay away from any OS related stuff.
Umm, not exactly related to your sentence, but it made me thing these two lines are sometimes mixed up.
For instance I don't want to have anything to deal with the Linux kernel, and I develop a lot of applications and libraries in user-space, but with FreeRTOS it's a completely different approach, and I like to play with its kernel stuff.
Also the kind of target makes the difference. For instance I don't like to have anything to deal with the low-level of a PowerPC e5xx because its user-manual is more 600 pages, the architecture itself is very complex (especially with super-scalar with tons of cops around) and my memory is so limited that I do find the whole experience far from being pleasant, but I like to play with a simple Arm classic even in assembly because it's simpler and its datasheet shorter, both of several orders of magnitude
Very few OSes have been written in C or C++, but most of the ones which have survived until now are. There were a lot of OSes developed before C existed, and a lot more were developed before C++ existed.
Lisp machines - a company that temporarily flourished during the first A.I. boom in the mid 80's had their own hardware and most of it including most of the OS was written in Lisp.
This then brings you to the point where you need to decide how much of the coding you want to be in the high(er) level language. You will need some assembly regardless, just to diddle the registers in an intimate fashion.
OpenFirmware was written in Forth.
TOPS-10 - BLISS - https://en.wikipedia.org/wiki/TOPS-10
VMS might be a more interesting example from DEC. It started out mostly in BLISS, and migrated to C over time, with a few big step changes in the C content. Interestingly, BLISS continued for so long that after Compaq bought DEC they produced a BLISS compiler for IA64. This seems to indicate that they never got VMS entirely free of BLISS code.
I think a large chunk of the first Mac OS versions was written in Pascal. Ditto for Lisa OS which Mac OS was partly based on.
That's my, rather vague and dim, recollection too.
TRIPOS was largely written in BCPL with a small bit of assembler in the kernel. Despite what that Wikipedia article says, device drivers were written in BCPL (all the ones I worked on were at least). Although, since BCPL is a predecessor of C it might not count.
@DC1MC
One of the big selling points of Rust is that it is useable for the sort of low level systems programming that C and C++ are used for.
The Xerox Star (and Dandelion etc) were all built up using MESA. (I think the Alto started up BCPL and then MESA?)
I forget the names... The OS was Pilot? CoPilot? later Viewpoint?
The hardware "Wildflower architecture" was micro-coded to be MESA friendly.
MESA was a nice language and had much in common with the language I used for my 3rd year project... Concurrent CLU.
Wow that was a long long time ago.
I think a large chunk of the first Mac OS versions was written in Pascal. Ditto for Lisa OS which Mac OS was partly based on.
That's my, rather vague and dim, recollection too.
Yep. I had a Mac in the early nineties, and remember I had a few "Inside Macintosh" books (is there anyone else here who did?), each dealing with a particular part of the Mac OS API. All interfaces were described in Pascal AFAIR.
In 2017, it was announced that the Lisa OS would be released as open source in 2018.
https://fossbytes.com/apples-lisa-operating-system-free-open-source-release/But AFAIK, it never did. Does anyone know what happened?
Now regarding C... please correct me if I'm wrong, but I think C was actually not that popular outside of the Unix world in the 80's. I think it really started to get momentum in the late 80's to early 90's. So I don't think there actually were many OS's written in C back then, except again from Unix and derivatives.
One of the big selling points of Rust is that it is useable for the sort of low level systems programming that C and C++ are used for.
That's why I have invested money and I am investing time to learn it
Now regarding C... please correct me if I'm wrong, but I think C was actually not that popular outside of the Unix world in the 80's.
By the early 80s C was a big deal all over the computing world.
There were not many OSes written in C + assembly, only the ones who actually matter and passed the test of time, the rest went as academic masturbation, hyper-specialized NIH stuff and forgotten attempts of enthusiasts, forever remaining at version 0.0.1alpha0 in a forgotten '90s stile web page or repository.
Rust will go like all the rest of over-engineered cretinic experiments, only to be eventually used in some kind of hypervisor or virtualization, where the heavy lifting will be done by C or assembly stuff, but it will be not visible to the mediocre programmer who will happily announce that "duuude, I've written a user mode driver in Python... Yeah dude, I written a scheduler in Rust, this OS stuff is so simple...".
Some times low level and difficulty is just that, not reducible to application level stuff and trying to sugarcoat it with automated garbage collectors and object paradigms, glorified interpreters of pseudocode and other crutches for mediocre programmers will always fail.
The Oberon system was written in Oberon - though more of an academic system (at ETH).
AFAIK there was also a simile system in Modula.
Most OS need at least some parts in ASM too. This may not be directly visible but as startup / library code for the compiler. Some of the really low level parts are too low even for C.
AFAIK the Apple Lisa system was written in Pascal. For better performance and less space needed much of this was rewritten / optimized in ASM for the early MAC OS.
There were not many OSes written in C + assembly, only the ones who actually matter and passed the test of time, the rest went as academic masturbation, hyper-specialized NIH stuff and forgotten attempts of enthusiasts, forever remaining at version 0.0.1alpha0 in a forgotten '90s stile web page or repository.
Rust will go like all the rest of over-engineered cretinic experiments, only to be eventually used in some kind of hypervisor or virtualization, where the heavy lifting will be done by C or assembly stuff, but it will be not visible to the mediocre programmer who will happily announce that "duuude, I've written a user mode driver in Python... Yeah dude, I written a scheduler in Rust, this OS stuff is so simple...".
Some times low level and difficulty is just that, not reducible to application level stuff and trying to sugarcoat it with automated garbage collectors and object paradigms, glorified interpreters of pseudocode and other crutches for mediocre programmers will always fail.
Do you know anything at all about Rust or are you just blathering on ignorantly and arrogantly like a senile old man? It is not garbage collected. It was specifically designed for systems programming. It does not need a hypervisor or virtual machine, and its capabilities are very analogous to those of C or C++. It performs better than C/C++ on most microbenchmarks. And it has a lot fewer gotchas that trap even the best programmers from time to time, often leading to major security holes.
Do you know anything at all about Rust or are you just blathering on ignorantly and arrogantly like a senile old man?
Are you blathering on ignorantly and arrogantly like a young idiot without the experience of seeing endless repeating cycles of the Next Big Thing that fades away? There's always that one wonderful little thing they do, that means the world is going to see the brilliance of the Next Big Thing and flock to it. Every once in a long while people actually do. Not often, though. Maybe Rust will hit the big time, but the odds are heavily against it unless one or more massive long term systems that are needed all over the place are written in it.
There were not many OSes written in C + assembly, only the ones who actually matter and passed the test of time, the rest went as academic masturbation, hyper-specialized NIH stuff and forgotten attempts of enthusiasts, forever remaining at version 0.0.1alpha0 in a forgotten '90s stile web page or repository.
Rust will go like all the rest of over-engineered cretinic experiments, only to be eventually used in some kind of hypervisor or virtualization, where the heavy lifting will be done by C or assembly stuff, but it will be not visible to the mediocre programmer who will happily announce that "duuude, I've written a user mode driver in Python... Yeah dude, I written a scheduler in Rust, this OS stuff is so simple...".
Some times low level and difficulty is just that, not reducible to application level stuff and trying to sugarcoat it with automated garbage collectors and object paradigms, glorified interpreters of pseudocode and other crutches for mediocre programmers will always fail.
Try and get a grip on that C Programming Language fanboyism ?
The first versions of rustc (before 1.0) were written in OCaml, and then rewritten in rust itself.
Are you blathering on ignorantly and arrogantly like a young idiot without the experience of seeing endless repeating cycles of the Next Big Thing that fades away? There's always that one wonderful little thing they do, that means the world is going to see the brilliance of the Next Big Thing and flock to it. Every once in a long while people actually do. Not often, though. Maybe Rust will hit the big time, but the odds are heavily against it unless one or more massive long term systems that are needed all over the place are written in it.
Whilst Rust certainly has a big hill to climb in order to avoid being just another Next Big Thing C/C++ killer that fades away, it does have the advantage that it can actually be used for all the things C/C++ can. It also seems to be getting traction in Linux -
Rust code in Linux kernel looks more likely as language team lead promises support.