15 ms·
Show HN: A new hobby OS from “scratch” in C#
- adzm 10y agoThis sounds interesting but is really lacking details. Though... now I wonder what happened to singularity / midori.
- amaneureka 10y agoI am really sorry about lack of details on page. I am working on it and soon add more detailed documentation. Meanwhile You can try building it and play around with source. https://github.com/amaneureka/AtomOS/wiki/Build-Environment https://github.com/amaneureka/AtomOS/wiki/Build-Environment
- ifdefdebug 10y agoaccording to the license headers in the source files I am not even allowed to copy the thing to my computer... edit: ok, found the project license (bsd) but you really should update those headers...
- jongalloway2 10y agoWould be nice if there was an ISO or cloud-installable VM image available. I've distributed "live cd" VM ISO's via legal torrent sites, which is a little hassle to set up but will make it a lot easier for people to get involved.
- pjmlp 10y agoAren't you aware of Joe Duffy's blog? http://joeduffyblog.com/ http://joeduffyblog.com/ https://www.infoq.com/presentations/csharp-systems-programming https://www.infoq.com/presentations/csharp-systems-programmi... Basically both projects achieved their goals, but Midori eventually was killed by management, even though they got an usable GUI desktop running with some core applications. Some of their decisions influeced async/await design in C#, the AOT compilers to native code in WP 8.x and WP 10, some of the new features for C# 7 and others planned for future versions.
- ifdefdebug 10y agoanybody knows if the scoped modifier is going to make it from m# into c#? that would be great...
- pjmlp 10y agoCurrently they are playing with Span<> and Memory<> at CoreFX Labs, which make use of IDisposable, so they could at least partially support it at library level. https://github.com/dotnet/corefxlab https://github.com/dotnet/corefxlab https://github.com/dotnet/corefxlab/issues/952 https://github.com/dotnet/corefxlab/issues/952 As for scope M#/System C# style, I guess the door is still open for future C# versions.
- zamalek 10y agoThere's also MOSA[1] and Cosmos[2]. MOSA is focusing more on the compiler/runtime, while Cosmos is doing just enough to get a working OS. Both are pure C#, it looks like Atom is too. [1]: https://github.com/mosa/MOSA-Project https://github.com/mosa/MOSA-Project [2]: https://github.com/CosmosOS/Cosmos https://github.com/CosmosOS/Cosmos
- amaneureka 10y agoYeah. And I managed to take it to the next level with dynamic executable loading and SVGA drivers.
- mihular 10y agoBut why not join forces with cosmos-instead of many half done OS we could have one functional? Were there any particular reasons?
- amaneureka 10y agoFor couple of years I contributed to Cosmos and fixed some bugs in MOSA. But my design idea was much different from them. So I decided to start with a new project. And seems like it worked!
- mihular 10y agoCan you elaborate on differences?
- codingbinary 10y agoBack when MOSA got created, we were aiming for a pure approach. For example, we were trying to use as few intrinsics as possible and a mostly architecture agnostic approach. Furthermore we also focussed on Mono compatibility (that was way before CoreCLR came out). Source: Ex co-creator of MOSA
- mihular 10y ago
- skybrian 10y agoI'm surprised C# is suitable for this. How does that work?
- amaneureka 10y agoBecause It is not possible to run C# executable without .NET framework. I had to work on a compiler first. Source: https://github.com/amaneureka/AtomOS/tree/master/src/Compiler/Atomixilc https://github.com/amaneureka/AtomOS/tree/master/src/Compile... Which works on the top of Microsoft's IL Builder. Then it add compiler stubs to support .NET code and convert code into native x86 assembly. The assembly file is then passed through NAsm and proper linking chain to produce final Kernel ELF binary. Build.sh produces an ISO image which can be used to boot OS in either virtual machine or on real hardware. I explained it here: https://www.reddit.com/r/programming/comments/5xlmc6/a_new_hobby_os_from_scratch_in_c/dej2la3/ https://www.reddit.com/r/programming/comments/5xlmc6/a_new_h...
- pjmlp 10y agoGood luck with the project, we already have too many kernels written in straight C. Only thanks to this kind of work one can prove it is possible.
- ianai 10y agoAs a guy who really thinks *nix is awesome, I welcome new additions, too.
- djsumdog 10y agoThat's a lot-o-work! Pretty impressive man. I think projects like this are awesome.
- spooterspooter 10y agoAnd now, if it gets popular, you can watch Microsoft sue people who use it.
- willvarfar 10y ago
- ishitatsuyuki 10y agoNot sure how it could deal with GC pause.
- amaneureka 10y agoIt does not. new operator internally calls Heap.kmalloc https://github.com/amaneureka/AtomOS/blob/master/src/Kernel/Atomix.Kernel_H/Core/Heap.cs https://github.com/amaneureka/AtomOS/blob/master/src/Kernel/... To free any object instance I have to call Heap.Free
- flukus 10y agoSo random including random c# snippets would probably leak memory? I imagine it would produce an uncanny valley feeling.
- kodfodrasz 10y agoNice, although I'd call the AssemblyAttribute EmitAssemblyAttribute, as the Assmebly word has its special meaning in the .Net world, and can potentially confusing (not to mention the assembly scoped attributes...)
- amaneureka 10y agoSure, Thanks :D
- moon_priestess 10y ago[Removed to avoid distraction.]
- amaneureka 10y agoI didn't mean that way. But I have updated the comment
- moon_priestess 10y agoApologies if I misinterpreted.
- deleted 10y ago[deleted]
- dmarlow 10y agoHow is it different to https://github.com/FlingOS/FlingOS/ https://github.com/FlingOS/FlingOS/ ? Not trying to be difficult, I'm just wanting to learn more about your project.
- naasking 10y agoLooks like a traditional kernel, which I think is a shame. High-level language-based operating systems have a lot more flexibility to enforce fine-grained abstractions rather than a traditional OS's coarse-grained abstractions. For instance, memory safety is process-level in a traditional OS, but object-level in a programming language. So paging logic doesn't make as much sense here, since it would require a lot of expensive runtime support to make every object lazily loaded, not to mention the expense of the bookkeeping overhead to track which objects should be paged out. This encourages a more event-oriented architecture where programs provide the kernel with continuation when requesting services. For instance, something like C#'s async/await operating at the kernel process level would be one possible approach.
- amaneureka 10y agoI strongly recommend you to build the kernel once and check output assembly file. which should answer lot of your doubts like extra overhead of object loading. It's not exactly same how you are interpreting. I tried very hard in order to optimize the output code.
- deleted 10y ago[deleted]
- naasking 10y agoAre you saying this is not a traditional operating system design utilizing the MMU for memory protection? If it is, then everything I said is accurate compared to software isolation in an OS like Midori. If not, then you should really point that out because it makes your project much more interesting!
- amaneureka 10y agoIndeed it is utilizing MMU for memory protection. But no that is not the final objective of project.
- 10y ago
- nkkollaw 10y agoNo way to build on macOS..?
- cd_cd 10y agoThis is fantastic. I have heard of a few projects like this. I'm guessing you're natively compiling the C# code. I'd love to contribute but I'd probably just get in the way. Good luck - a glimpse of the future perhaps.
- SwellJoe 10y agoThere is an OS named "Atomic" (it is a Red Hat project, so not particularly obscure), which seems pretty similar to "AtomOS" and "Atomix": http://www.projectatomic.io/ http://www.projectatomic.io/
- balajiarun 10y agoI see a lot of concepts simply borrowed from Cosmos, rewriting it and seeking copyright - Especially the IL2Native compiler is very similar.
- balajiarun 10y agoDoes your compiler handle generics?
- amaneureka 10y agoYes! https://github.com/amaneureka/AtomOS/blob/master/src/Kernel/Atomix.Kernel_H/Lib/ds/Pair.cs https://github.com/amaneureka/AtomOS/blob/master/src/Kernel/...
- _RPM 10y agocommits messages like "Open Sourced!" annoying
- udp 10y agoI appreciate that this is a hobby project, but comments like this one in Kernel.cs: while (true) //Set CPU in Infinite loop DON'T REMOVE THIS ELSE I'll KILL YOU (^ . ^) combined with things like your "How to contribute" section requiring that anyone wanting to contribute is "dedicated", are frankly going to put anyone off wanting to get involved with this. It also doesn't reflect well on your maturity as a developer.
- BinaryIdiot 10y agoI'm all for humorous comments, even if they're a bit flippant, but that comment just isn't funny. Though I've met some great people with a sense of humor that makes absolute no sense to me and that's just how it came off to me versus a maturity issue (but without my experience I could easily see having an identical opinion to yours). The dedicated part though seems a little more ridiculous to me. Most people who may contributed may not necessary be "dedicated" or even like the project but just may want to help with someone. If I saw a project was looking for dedicated contributors I'd be less likely to contribute anything as I don't want to be married to someone else's project.
- nialv7 10y agoThe "YOU" here might refer to the compiler, not the person looking at the code.
- Animats 10y agoYet another "multitasking monolithic kernel based x86 targeting operating system" isn't that useful. Something new would help. A fast microkernel. A hypervisor that runs containers. A kernel with better security for IoT.
- pjmlp 10y agoBeing written in C# makes it useful, because in this industry we lack visionaries, and most only believe what is put in front of them.
- jatins 10y agoThat looks good! (P.S. turns out we are from same college _and_ school)
- amaneureka 10y agooh! what's your name?