top | item 40613126

Xv6, a simple Unix-like teaching operating system

234 points| arkj | 1 year ago |pdos.csail.mit.edu

97 comments

order

positive_ev|1 year ago

Took this class at MIT. 20/10 would recommend, especially for people who don't come from a systems background. The textbook is quite easy to understand and the labs are a very good check of your comprehension. Just maybe skip the network driver on the first go around :P

bombdailer|1 year ago

Took a class at UCI which copied much of the MIT class and dumbed it way down for us. Would recommend

rustypotato|1 year ago

I also took the class that uses this OS at MIT. Absolutely fantastic. I was just browsing the class website today actually, and you can totally kinda take the class yourself. The site has all the lecture notes, the labs, and even a version of xv6 in a repo with branches for all the labs, along with instructions for getting it all working yourself. It's kinda amazing how open it is.

The first lab: https://pdos.csail.mit.edu/6.1810/2023/labs/util.html

I do plan to work through the whole thing myself again at some point soon.

bgschulman31|1 year ago

Many of the projects in my OS class in college involved building on top of the xv6 operating system. I remember one of the projects was building a scheduler for xv. It was definitely a great way to learn about different pieces of an operating system!

mhw|1 year ago

Ha, on first read of the title I thought this might be a new release of the venerable xv image viewer - http://www.trilon.com/xv/

hnthrowaway0328|1 year ago

I have ways wanted to understand the Windows NT kernel -- maybe the earlier versions as they are simpler.

I heard the first version is close to VMS. Is it true? Is there any material on VMS? OpenVMS is open sourced but the version is too high.

kelsey98765431|1 year ago

For a good look at the development of the NT kernel, read the book show stopper from 1996. It is correct that Dave Cutler did lead a number of projects inside DEC including projects related to VMS, the only inheritance the Microsoft New Technology kernel received from VMS was spiritual at the design and architecture levels. Dave was already in the process of a major overhaul or successor to VMS when his team was shown the door at DEC and many of these visions made their way into windows at the cost of the robustness of the minicomputing established design patterns. Cutler saw the MSDOS team as rookie programmers writing themselves into spaghetti solutions for the wrong problems but papa gates had it locked up tight with the OEM contracting agreements so Bill paid him in blank checks to deal with the kids in the room and ship a real kernel to compete with what steve was cooking at NeXT.

So no, NT is nothing at all like VMS from a featureset or likeness perspective, nothing at all from an implementation perspective (VMS had beautiful clean C standard library and compiler suite), but very much was the race to the bottom by the mini crowd to play games in the micro world.

check dave plumbers interview with cutler on youtube for more color.

pjmlp|1 year ago

Windows Internals book series, old MSTech Journal and DDJ issues, VMS manuals on digital archives.

justin66|1 year ago

Windows 2000 source code is out there in the wild (I expect newer versions have been leaked as well) and has even been used as a teaching tool.

lproven|1 year ago

WTF?

> I heard the first version is close to VMS.

No.

> Is it true?

No.

> Is there any material on VMS?

Tons. It came with metres of docs. It is still on sale. You can get a freebie hobbyist VM image.

> OpenVMS is open sourced

No, it isn't.

> but the version is too high.

Not true.

Always, always check your assumptions before asking a question. If you want to ask "because (a) can I (b)" then check A is true before asking. ALWAYS.

hexagonwin|1 year ago

Huh? OpenVMS was open sourced?

nialv7|1 year ago

Why Unix v6? Why teach with a 50 years old design? I feel to teach the fundamentals of an operating system, i.e. scheduling, IPC, address space management, a microkernel design would be better.

imiric|1 year ago

Studying precursor technologies to ones popular today is a great way to learn what led us to this point, what tradeoffs were made and why, and perhaps what we might've lost as well. Students can get a deeper appreciation for new technologies when they're eventually exposed to them. This can only broaden their horizons in their future careers.

As someone who missed this part of history, I would love to have learned about it in college.

mindwok|1 year ago

You gotta walk before you can run. Xv6 is basic, but it’s a great intro to operating system fundamentals that can fit in a semester for people who’ve never seen these concepts before.

chrsw|1 year ago

I'm guessing many professors don't choose Xv6 for their operating systems class because it's a great design. Some probably pick it because it's good enough, simple and easier to teach in a single semester where students are also taking other classes. Are you saying the microkernel design is not only better but also easier to teach?

halayli|1 year ago

Vonn Neumann architecture is 80 yrs old. Why is it relevant how long a design is if it's still the most relevant and widely used one? The basic abstractions of unix v6 still holds to this day.

The main difference between Microkernels and Monolithic is how address space get to be shared between userland and kernel. I don't see how microkernel design would be "better". Why teach a design that isn't widely used?

darby_nine|1 year ago

While microkernels play a vital role in our software ecosystem, most of the software anyone interacts with is not coordinated with a microkernel. Furthermore most of the software on the internet is not run by a microkernel, nor most of the software available on the internet. I suspect such a course would not prepare one well to either work with kernels or reason about the kernels you work with as a professional.

kragen|1 year ago

a lot of people agree with you, which is why minix exists (though their source control system just fell offline this year), but none of windows nt, linux, os/360, and even really macos/ios are microkernel designs. sel4 and the other l4 variants are, and so is qnx, and linuxcnc runs linux under a microkernel, and xen is kind of a microkernel if you look at it funny, so we're definitely seeing significant mainstream use of microkernels, but it's not clear that that 50-year-old design is actually obsolete the way the pdp-11, the cray-1, and the system/370 are

pjmlp|1 year ago

That is how we end with students always cloning UNIX on their projects, instead of going alternative roots like Redox or SerenityOS.

soraminazuki|1 year ago

Why not? xv6 doesn't prevent you from learning about microkernels in any way. It's also a complete operating system with code that's friendly for beginners.

dailykoder|1 year ago

Because it doesn't really matter. Processor design hasn't changed much in its fundamentals. KISS. Just KISS.

RACEWAR|1 year ago

What's a good way for autodidacts to fiddle through this?

kragen|1 year ago

[deleted]

opless|1 year ago

Plan 9 is also a pretty simple codebase to understand.

bhdb33|1 year ago

One has to respect some of the design decisions behind Plan 9. Per-process namespaces, binds, and treating everything as a file provides a certain level of elegance that just isn't seen in many other Unix-like OSes.

tripdout|1 year ago

I used PintOS in my operating systems class last semester - wish there was a part 2 to that class where we go even more in depth!

renewiltord|1 year ago

XINU is another simple teaching system.

anonymousDan|1 year ago

What I would love is something similar that could boot on raspberry pi...

bionsystem|1 year ago

I like os161 from ops-class dot org too (Harvard course)