Live data from Hacker News

Xv6

en.wikipedia.org

11–20 of 53 posts

Re: Xv6

#11
xv6 is an amazing teaching OS - it is very simple to dive into and play around with. A while ago I wanted to explore some filesystem/permissions stuff and use xv6 to play with some concepts (see http://sarahjamielewis.com/posts/file-system-permissions-and... - still lots I want to play around with there when I find some time) - If you are at all interested in OS dev it is a great gateway.

Re: Xv6

#13

If it's only for education purposes, why C? Wouldn't you want to choose a more "clear" language to get the ideas across?

C is about as "clear" as one can get, other than assembly.

Most other languages hide away implementation details that are critical to writing an operating system--how would you handle, say, interrupts?

Re: Xv6

#14

If it's only for education purposes, why C? Wouldn't you want to choose a more "clear" language to get the ideas across?

If my school had decided to teach operating systems using some non-C language because it's "more clear," I can only imagine that my development as a programmer would have been delayed by years.

Sometimes education is about pure theory, and sometimes it's about how people do things out in the world. I think this is a case where the second approach is much more valuable.

Re: Xv6

#15

If it's only for education purposes, why C? Wouldn't you want to choose a more "clear" language to get the ideas across?

Because C is the de-facto standard for writing operating systems. If you want to write an oh-cool blog piece for general programmer audiences about how OSes work, sure, go ahead and write it in Python (seen that done, and pretty well, in fact). But if you want to prepare people to be able to work on real operating systems, they need to know how to do it in C.

I think an OS class isn't meant to prepare you for working on the operating system. The vast majority of people that take an OS class aren't going to work on OSs, but they should appreciate how everything works. Using a language optimized for communicating "how everything works" clearly should be a priority!

Re: Xv6

#16

Earlier quoted context omitted.

Because C is the de-facto standard for writing operating systems. If you want to write an oh-cool blog piece for general programmer audiences about how OSes work, sure, go ahead and write it in Python (seen that done, and pretty well, in fact). But if you want to prepare people to be able to work on real operating systems, they need to know how to do it in C.

I think an OS class isn't meant to prepare you for working on the operating system. The vast majority of people that take an OS class aren't going to work on OSs, but they should appreciate how everything works. Using a language optimized for communicating "how everything works" clearly should be a priority!

Yes, and that language is C. C is a very simple language, and it's very clear. If you're writing anything that interfaces directly with the OS, you'll need to know C.

Re: Xv6

#17

I'm a student at Johns Hopkins, and we're using xv6 in our OS course this semester: http://gaming.jhu.edu/~phf/2015/fall/cs318/ xv6 is pretty awesome for learning, and lecture is generally spent reading through the source code, some of which is...cute. Most of us have the source code printed out. If you're interested in reading the source, this document is well-formated: https://pdos.csail.mit.edu/6.828/2014/xv6/xv6-…

I went through my school's version of this class on xv6, and wow, what a trip. After thinking hard and working hard on things I never had a solid grasp on - filesystems, virtual memory, interrupts, multitasking - I now appreciate and understand things going on after a call to fork() or exec().

For my final project I implemented a simple threading library based on the interface that pthread() uses. It's amazing how beautifully simple kernels can be.

Re: Xv6

#19
post #11

xv6 is an amazing teaching OS - it is very simple to dive into and play around with. A while ago I wanted to explore some filesystem/permissions stuff and use xv6 to play with some concepts (see http://sarahjamielewis.com/posts/file-system-permissions-and... - still lots I want to play around with there when I find some time) - If you are at all interested in OS dev it is a great gateway.

I'm interested, but where would you suggest to start?

Re: Xv6

#20
post #11

xv6 is an amazing teaching OS - it is very simple to dive into and play around with. A while ago I wanted to explore some filesystem/permissions stuff and use xv6 to play with some concepts (see http://sarahjamielewis.com/posts/file-system-permissions-and... - still lots I want to play around with there when I find some time) - If you are at all interested in OS dev it is a great gateway.

I'm interested, but where would you suggest to start?

Grab the source, compile it and get it running...after that...whatever you find interesting. Some ideas:

* Trace the execution of one of the user land programs (e.g. ls) to see how it uses the syscalls.

* Add a new syscall - there are a few open-courseware labs online which have this as in introductory exercise (e.g http://moss.cs.iit.edu/cs450/assign01-xv6-syscall.html)

* In a similar vein - find some other labs for other courses using this - and follow them.

* Read through the companion book (can be compiled from the source or downloaded pre-compiled) and follow it through the source code.

Post reply on HN