Live data from Hacker News

Writing a Unix clone in about a month

drewdevault.com

71–80 of 140 posts

Re: Writing a Unix clone in about a month

#71
post #60

This is really cool. Reminds me of the original Unix was invented in a couple weeks while Ritchie's family went on vacation to CA to visit his in-laws. Source: UNIX: A History and a Memoir Paperback – October 18, 2019 by Brian W Kernighan (Author)

I think you mean Ken Thompson. I can't be bothered searching through youtube interviews but I'm pretty shure that on more than one occasion, he tells a story something along the lines of having a disk driver, some programs, and maybe some other components. His wife went on a trip and he figured it would be enough time to fill in the gaps and make a complete OS.

I'm pretty sure that is mentioned in this interview:

https://www.youtube.com/watch?v=wqI7MrtxPnk

By the way the CHM oral history video series is full of gems.

Re: Writing a Unix clone in about a month

#72
post #10

Hare looks like an interesting language. Though this limitation will limit its adoption in this multicore age I think: From the FAQ https://harelang.org/documentation/faq.html .... Can I use multithreading in Hare? Probably not. We prefer to encourage the use of event loops (see unix::poll or hare-ev) for multiplexing I/O operations, or multiprocessing with shared memory if you need to use CPU resources in parallel.…

I just wish it had closures

Re: Writing a Unix clone in about a month

#73
post #35
post #18

> 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. Would love any resources that goes in more details, if any HN-er or the author himself knows of some!

Signals are at the intersection of asynchronous IO/syscalls, and interprocess communication. Async and IPC are also weak points in the original Unix design, not originally present. Signals are an awkward attempt to patch some async IPC into the design. They're prone to race conditions. What happens when you get a signal when handling a signal? And what to do with a signal when the process is in the middle of a system…

IPC was actually introduced in "Columbus UNIX."

https://en.wikipedia.org/wiki/CB_UNIX

Re: Writing a Unix clone in about a month

#74
post #24
post #7

I was interested in Hare until I found this immensely self-defeating FAQ item: https://harelang.org/documentation/faq.html#will-hare-suppor... As a baseline, I support developers using whatever license they would like, and targeting whatever operating systems, indeed, writing whatever code they would like in the process. That doesn't make this specific policy a good idea. Even FSF, generally considered the most extre…

"We cannot effectively study, understand, debug, or improve, the underlying operating system if it is non-free. We actively work with the source code for the systems on which we depend, and we are not interested in supporting any platforms for which this is not possible." I understand that you don't like it, but how do you come to regard a statement like this as "arbitrary?" It's exclusive, for sure. "Purity test" is…

I was going to post the same quote. If you have no visibility into the layer you depend on, you really can’t reason about it or write optimized code for it.

The Hares are saying they require that, which I totally understand and respect.

Re: Writing a Unix clone in about a month

#75
post #37
post #33

Earlier quoted context omitted.

That wouldn't be too hard if GPU's would have a stable interface. Try programming a GPU in Assembly language and see how that goes. The experience sucks, but that's the level that needs to be targeted in case of an OS.

For example, in the past Amiga computers had a 'GPU' (although much less powerful than todays GPUs) with a stable interface. It was a first class citizen in its OS. It also was incredibly easy to target in Assembly language.

Amiga died because it was stuck with the same old "GPU" for too long, among other reasons.

Re: Writing a Unix clone in about a month

#76
post #51

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.

[flagged]

Re: Writing a Unix clone in about a month

#77

This is really cool. Reminds me of the original Unix was invented in a couple weeks while Ritchie's family went on vacation to CA to visit his in-laws. Source: UNIX: A History and a Memoir Paperback – October 18, 2019 by Brian W Kernighan (Author)

But I think it’s relevant to say that before writing Unix he was working on Multics for a long time already. Unix was a “simplified” version of it, if I remember well. So it didn’t “spring out of thin air.”

>So it didn’t “spring out of thin air.”

Right. Almost nothing does.

You see, it's https://en.m.wikipedia.org/wiki/Turtles_all_the_way_down

Re: Writing a Unix clone in about a month

#78

This is really cool. Reminds me of the original Unix was invented in a couple weeks while Ritchie's family went on vacation to CA to visit his in-laws. Source: UNIX: A History and a Memoir Paperback – October 18, 2019 by Brian W Kernighan (Author)

But I think it’s relevant to say that before writing Unix he was working on Multics for a long time already. Unix was a “simplified” version of it, if I remember well. So it didn’t “spring out of thin air.”

Mmm, even early versions ended up being more the "anti-multics" than actually simplified-from, despite the name pun...

Re: Writing a Unix clone in about a month

#79
post #66

Earlier quoted context omitted.

Versus now... I changed the text on a button with an internationalized string. It only took me about a week. I put the English string in the catalog, updated a number of tests, run the tests on the local system, pushed the change to staging cluster, fix unanticipated test failures, push the change to production, contact the translators to have the string translated to a number of languages, and have documentation upd…

So... It goes to production before you get translations to all the languages?

In my case, the "production" does not really become visible to users right away. Perhaps, I should have called it "pre-production".

Re: Writing a Unix clone in about a month

#80

Impressive, super cool, and inspiring! Example of “creating something impressive in X days” requires a lot of experience and talent that is built over years .

Drew is smart and his timeline is short but I think it’s the wrong way to look at it if you just put him on a pedestal for it. Making a UNIX clone is a typical undergrad project at most universities. Extending that to something that is complete is something that requires perseverance, not special genius.
Post reply on HN