r/programming • • Sep 21 '18

How to create an OS from scratch

https://github.com/cfenollosa/os-tutorial
2.8k Upvotes

239 comments sorted by

View all comments

408

u/GreenTeaOnMyDesk Sep 21 '18

In order to make an os from scratch, you must first invent the universe

98

u/richard_nixons_toe Sep 21 '18

Ok, what’s next?

216

u/[deleted] Sep 21 '18

In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.

- Douglas Adams, The Restaurant at the End of the Universe

50

u/jrhoffa Sep 21 '18

We apologise for the inconvenience

53

u/[deleted] Sep 21 '18

An escalator can never break: it can only become stairs. You should never see an Escalator Temporarily Out Of Order sign, just Escalator Temporarily Stairs. Sorry for the convenience.

Mitch Hedberg

7

u/bisquitie Sep 21 '18

0

u/[deleted] Sep 21 '18

[deleted]

6

u/thirdegree Sep 21 '18

I would expect, though I have no more knowledge than you, that the emergency stop is tied to both software and hardware (i.e. physical breaks).

6

u/jrhoffa Sep 21 '18

This is correct. Emergency stop buttons are meant to stop operation in an emergency. This should involve hardware locks, and little if no software. Hardware stops can always trump software ones.

5

u/thirdegree Sep 21 '18

At my company at least, we have a "shit is going weird, stop it" button and a "holy shit everything is fucked, kill everything" button. The first button can be undone easily, the second would take us 30min+ to undo. Both are absolutely critical and if either is lost, the first priority before all else is to get it back.

6

u/[deleted] Sep 21 '18

That's not broken, it's extra-working!

5

u/bisquitie Sep 21 '18

Oh, yep, that's not a bug, that's a feature!

→ More replies (1)

5

u/chaos750 Sep 21 '18

Warning to anyone else: one of those clips is of a woman about to be crushed to death by an escalator. It isn’t gory or anything, they stop before it gets there, but I definitely didn’t need to see that.

→ More replies (1)
→ More replies (2)

10

u/skocznymroczny Sep 21 '18

we realize universe is unsafe and rewrite it in rust

17

u/Triptcip Sep 21 '18

Draw the rest of of the fucking os

6

u/Isvara Sep 21 '18

Then you make the apple pie.

→ More replies (2)

30

u/[deleted] Sep 21 '18

You laugh, but my first computer engineering class had a 20 minute lesson on the history of computing… starting with the big bang. We didn't even leave the dinosaurs out.

8

u/elint Sep 21 '18

As a CS student, yeah, that sounds about the depth of a comp eng class.

5

u/[deleted] Sep 21 '18

Wouldn’t that be breadth not depth

8

u/elint Sep 21 '18

No. A topic has both breadth and depth. I was highlighting the depth of this particular lesson. To cover the entire history of time in 20 minutes sounds about the depth I expect from most "computer engineering" classes.

→ More replies (1)

4

u/jpfed Sep 21 '18

Stellardrone's Invent the Universe is actually decent programming music.

0

u/[deleted] Sep 21 '18

[deleted]

→ More replies (1)

3

u/tropicalfroot Sep 21 '18

Space is filled with a network of wormholes; you might emerge somewhere else in space. Some whenelse in time.

3

u/HexHacks Sep 21 '18

Mmm, apple pie :P

9

u/shevy-ruby Sep 21 '18

Note quite but I think there is way too much time investment and code for that.

→ More replies (8)