TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Writing a Unix clone in about a month

395 pointsby drewdevault12 months ago

16 comments

mtillman12 months ago
This is really cool. Reminds me of the original Unix was invented in a couple weeks while Ritchie&#x27;s family went on vacation to CA to visit his in-laws.<p>Source: UNIX: A History and a Memoir Paperback – October 18, 2019 by Brian W Kernighan (Author)
评论 #40468236 未加载
评论 #40469633 未加载
评论 #40471544 未加载
评论 #40468914 未加载
评论 #40474130 未加载
kpw9412 months ago
&gt; I also finally learned how signals work from top to bottom, and boy is it ugly. I’ve always felt that this was one of the weakest points in the design of Unix and this project did nothing to disabuse me of that notion.<p>Would love any resources that goes in more details, if any HN-er or the author himself knows of some!
评论 #40468976 未加载
评论 #40468755 未加载
评论 #40471889 未加载
评论 #40468841 未加载
评论 #40469203 未加载
评论 #40468789 未加载
评论 #40468454 未加载
评论 #40468639 未加载
samatman12 months ago
I was interested in Hare until I found this immensely self-defeating FAQ item: <a href="https:&#x2F;&#x2F;harelang.org&#x2F;documentation&#x2F;faq.html#will-hare-support-windows-or-macos" rel="nofollow">https:&#x2F;&#x2F;harelang.org&#x2F;documentation&#x2F;faq.html#will-hare-suppor...</a><p>As a baseline, I support developers using whatever license they would like, and targeting whatever operating systems, indeed, writing <i>whatever</i> code they would like in the process.<p>That doesn&#x27;t make this specific policy a good idea. Even FSF, generally considered the most extreme (or, if you prefer, principled) exponents of the Free Software philosophy, support Windows and POSIX. They may grumble and call it Woe32, but Stallman has said some cogent things about how the fight for a world free of proprietary software is more readily advanced by making sure that Free Software projects run on proprietary systems.<p>They do at least license the library code under MPL, so merely using Hare doesn&#x27;t lock you into a license. But I wonder about the longevity of a language where the attitude toward 95+% of the desktop is &quot;unsupported, don&#x27;t ask questions on our forums, we don&#x27;t want you here&quot;.<p>Ironically, a Google search for &quot;harelang repo&quot; has as the first hit an unofficial macOs port, and the actual SourceHut repo doesn&#x27;t show up in the first page of results.<p>Languages either snowball or fizzle out. I&#x27;m typing this on a Mac, but I could pick up a Linux machine right now if I were of a mind to. But why would I invest in learning a language which imposes a purity test on developers, when even the FSF doesn&#x27;t? A great deal of open source <i>and</i> free software gets written on Macs, and in fact, more than you might think on Windows as well.<p>From where I sit, what differentiates Hare from Odin and Zig, is just this attitude of purity and exclusion. I wish you all happy hacking, of course, and success. But I&#x27;m pessimistic about the latter.
评论 #40468160 未加载
评论 #40468282 未加载
评论 #40468020 未加载
评论 #40468102 未加载
评论 #40470059 未加载
评论 #40471434 未加载
评论 #40468582 未加载
评论 #40468415 未加载
评论 #40471862 未加载
评论 #40472136 未加载
评论 #40468061 未加载
评论 #40469049 未加载
andsoitis12 months ago
Impressive, super cool, and inspiring!<p>Example of “creating something impressive in X days” requires a lot of experience and talent that is built over <i>years</i>.
评论 #40469814 未加载
评论 #40468125 未加载
评论 #40470856 未加载
评论 #40467732 未加载
评论 #40470936 未加载
LightFog12 months ago
It was really cool watching the ~daily updates on this on Mastodon - seeing how someone so skilled gradually pieces together a complex piece of software.
评论 #40468289 未加载
8organicbits12 months ago
Code is here: <a href="https:&#x2F;&#x2F;git.sr.ht&#x2F;~sircmpwn&#x2F;bunnix&#x2F;tree&#x2F;master" rel="nofollow">https:&#x2F;&#x2F;git.sr.ht&#x2F;~sircmpwn&#x2F;bunnix&#x2F;tree&#x2F;master</a><p>GPLv3 license.
userbinator12 months ago
<i>The userspace is largely assembled from third-party sources.</i><p>That answered my initial surprise of clicking on the ISO and getting a <i>60MB</i> download.<p>For comparison, Linux 0.01 was a 71k download, but contained only the kernel source.
nickcw12 months ago
Hare looks like an interesting language.<p>Though this limitation will limit its adoption in this multicore age I think:<p>From the FAQ <a href="https:&#x2F;&#x2F;harelang.org&#x2F;documentation&#x2F;faq.html" rel="nofollow">https:&#x2F;&#x2F;harelang.org&#x2F;documentation&#x2F;faq.html</a><p>....<p>Can I use multithreading in Hare?<p>Probably not.<p>We prefer to encourage the use of event loops (see unix::poll or hare-ev) for multiplexing I&#x2F;O operations, or multiprocessing with shared memory if you need to use CPU resources in parallel.<p>It is, strictly speaking, possible to create threads in a Hare program. You can link to libc and use pthreads, or you can use the clone(2) syscall directly. Operating systems implemented in Hare, such as Helios, often implement multi-threading.<p>However, the upstream standard library does not make reentrancy guarantees, so you are solely responsible for not shooting your foot off.
评论 #40468336 未加载
评论 #40481220 未加载
评论 #40470242 未加载
westurner12 months ago
From &quot;Linux System Call Table – Chromiumos&quot; <a href="https:&#x2F;&#x2F;www.chromium.org&#x2F;chromium-os&#x2F;developer-library&#x2F;reference&#x2F;linux-constants&#x2F;syscalls&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.chromium.org&#x2F;chromium-os&#x2F;developer-library&#x2F;refer...</a> <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33395777">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33395777</a> :<p>&gt; google&#x2F;syzkalleR<p>&gt; <i>Fuschia &#x2F; Zircon syscalls:</i> <a href="https:&#x2F;&#x2F;fuchsia.dev&#x2F;fuchsia-src&#x2F;reference&#x2F;syscalls" rel="nofollow">https:&#x2F;&#x2F;fuchsia.dev&#x2F;fuchsia-src&#x2F;reference&#x2F;syscalls</a>
评论 #40474621 未加载
pjmlp12 months ago
Quite cool, by making use of Hare instead.
lupusreal12 months ago
Missed opportunity to call it Drewnix.
评论 #40468697 未加载
anta4012 months ago
Very cool. Most of these Unix clones are usually written in C. This one is written in a new programming language.
评论 #40468401 未加载
评论 #40468912 未加载
calvinmorrison12 months ago
hey drew! did writing this project give you any Hare-y situations you hadn&#x27;t run into before, or maybe - reached into corners not yet probed by Hare and gave you ideas for a new feature or edge case that was scary?
amelius12 months ago
Waiting for an OS that treats GPU(s) as a first class citizen ...
评论 #40468708 未加载
评论 #40473111 未加载
评论 #40475015 未加载
评论 #40470862 未加载
AtlasBarfed12 months ago
Are there &quot;waypoint&quot; commits for major milestones? Id really like to see those.<p>Like PC bootstrap, basic kernel action loops, process forking, yada yada
thefaux12 months ago
Impressive work but I feel this approach is the hard and brittle way to write an os. The easier and more portable way is to write the os as a guest in a host language. You start with a simple shell with the print command and build from there.
评论 #40469273 未加载
评论 #40470689 未加载