7 ms·
Unix v6 Ported to ANSI C
- supersillyus 15y agoI'm starting to suspect that Russ Cox is actually a team of people, all contributing under one name.
- mahmud 15y agoHe is really just one very productive man, and his real name is Nicholas Bourbaki.
- jvehent 15y agoNow that a reference my dad would love :) Not sure if the regular HN folks would know of Bourbaki though
- ahpeeyem 15y ago"Nicolas Bourbaki is the collective pseudonym under which a group of (mainly French) 20th-century mathematicians wrote a series of books presenting an exposition of modern advanced mathematics, beginning in 1935. With the goal of founding all of mathematics on set theory, the group strove for rigour and generality. Their work led to the discovery of several concepts and terminologies still discussed." http://en.wikipedia.org/wiki/Nicolas_Bourbaki http://en.wikipedia.org/wiki/Nicolas_Bourbaki
- mdwrigh2 15y agoI pulled the repository and all of the code is very well documented, and easy to read. Really a great resource for learning OS internals.
- burgerbrain 15y agoThis is unspeakably great. I'm going to have to forward this on to my old OS professor. Really wish we had this when I took that class.
- RexRollman 15y agoI was under the impression that Minix was created and used for this kind of thing. Is there something about Minix that makes it unsuitable today's classrooms?
- mhd 15y agoI guess it depends on what you want to use as your textbook, Tanenbaum's books or Lions' Commentary.
- ghshephard 15y agoA suitably motivated individual might reach out to the various accredited institutions, try and track down one of the Cmpt. Sci Profs who teaches the "Intro to Operating Systems" courses, and find out A) Which Textbook they Use. B) Which training OS system they use. C) Which language they implement their OS in. (ANSI C is likely to be popular) Or, they could be lazy, and hope that this HN thread turns out to be a representative sample of the Textbooks/Operating Systems in use.
- icebraining 15y agoWell, Minix has a microkernel architecture, unlike this which seems to be monolith (and probably simpler to understand).
- derleth 15y agoMinix is a microkernel design, so it's of limited use in understanding how modern OSes work.
- rbanffy 15y agoIt would be fair to say current operating systems.
- derleth 15y agoMicrokernels have been the wave of the future for longer than some of the most popular OSes have been around, namely Windows NT (not just Windows 7, but the whole NT design), Mac OS X (NeXTStep too, for that matter), and Linux (but, admittedly, not Unix). If I may prognosticate, stripped-down monolithic OSes running on hypervisors are the wave of the future. Look at VM/CMS for an extreme example: CMS is about as complex as MS-DOS, being a single-user single-tasking OS with no memory protection or security model. VM is the hypervisor. Together, they date to about 1968, or a little before if you include research systems.
- ssp 15y agoThere is a bug in the memmove() function from ulib.c: void* memmove(void *vdst, void *vsrc, int n) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) *dst++ = *src++; return vdst; } If the two blocks overlap, and the address of dst is greater than the address of src, then parts of the source will be overwritten before it can be copied.
- agumonkey 15y agoreminds me of the intel comment in their implementation of memcpy, something like 'no overlay check as implicit convention'
- microtherion 15y agoYes, the standards say that the behavior of memcpy, as opposed to memmove, is undefined when the arguments overlap.
- robinhouston 15y agoThe original v6 doesn’t have any of the mem* functions, but its bcopy implementation has the same issue. Presumably the convention that bcopy permits overlap had not been established at that time.
- derleth 15y agoRight. Quoting from the manpage: > The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest. http://www.kernel.org/doc/man-pages/online/pages/man3/memmove.3.html http://www.kernel.org/doc/man-pages/online/pages/man3/memmov... Notice how it says 'as though'; I can't see why doing the copy backwards (from end to start) wouldn't work, myself.
- eddington 15y agoStill doesn't work going end to start. src starts at 50, ends at 100 dst starts at 25, ends at 75. First we copy 100 to 75, then 99 to 74, etc ... now we get to copy from 75 to 50, but we've overwritten it already!
- Legion 15y agohttp://pdos.csail.mit.edu/6.828/schedule.html http://pdos.csail.mit.edu/6.828/schedule.html The project page gives this link to the schedule, where the lecture notes are supposed to be, but the link 404's. Is there a working URL for these lecture notes?
- rtm 15y agohttp://pdos.csail.mit.edu/6.828/2011/schedule.html http://pdos.csail.mit.edu/6.828/2011/schedule.html
- matsur 15y agoAnother set of excellent free OS lecture notes here: http://pages.cs.wisc.edu/~remzi/Classes/537/Fall2011/ http://pages.cs.wisc.edu/~remzi/Classes/537/Fall2011/ The lectures themselves are not xv6 specific, although the projects are xv6 based.
- hjalle 15y agoCompared to the OS course I've taken in Sweden this seems to cover more, but I can't find how many credits you get from it. It is scheduled from September to end of december, but is it full time during this period or do they take other courses at the same time? Edit: URL: http://pdos.csail.mit.edu/6.828/2011/index.html http://pdos.csail.mit.edu/6.828/2011/index.html
- rtm 15y agoMost students take 6.828 along with three or four other courses.
- roxtar 15y agoThe info page says that xv6 was released in Fall 2006. What's new?
- rtm 15y agoAddress spaces based on paging rather than segments. Much clearer context switching code. File system crash recovery via logging.
- tankenmate 15y agoAnd now using the HLT instruction so you don't chew CPU power unnecessarily, great for QEMU etc on laptops. I just sent you a patch. Edit: all the user tests passed.
- tankenmate 15y agoOne thing I forgot to mention, now that the scheduler code has been changed the famous "you are not expected to understand this" comment is gone.
- mahmud 15y agoWhy not XINU? It's a great little kernel; already exhaustively documented (Lions' Commentary style) along with its TCP/IP stack. P.S. I still maintain a very HLL is ideal for presenting multi-processing/multi-tasking to students.
- jarz 15y agoComer has a new edition of "Operating System Design: The Xinu Approach" that focuses on a Linksys/Cisco router. I've not read the text officially yet, but the drafts were very interesting. Purdue CS grad students use Xinu for the OS course projects (http://www.cs.purdue.edu/homes/cs503/ http://www.cs.purdue.edu/homes/cs503/).
- mahmud 15y agoVery interesting. Thank you :-)
- KingEllis 15y agoYip yip yip yip yip yip yip. Good.
- roxtar 15y agoI encourage you to try out the 6.828 course material, especially the labs. It's one of the best OS courses. I had taken UCLA's CS 235 which is based on similar content [1]. Learned a lot from that. [1]: http://www.cs.ucla.edu/~kohler/class/10f-aos/ http://www.cs.ucla.edu/~kohler/class/10f-aos/
- tzs 15y ago> Although the Unix v6 source may seem like an ideal introduction to operating systems engineering because of its simplicity, students doubted the relevance of an obsolete OS written in a now defunct dialect of C. In addition, students struggled to learn the details of two different architectures, the PDP-11 and x86, at the same time. Those students were MIT students. I'd expect MIT students to not have had a problem with either of these, so I'm a bit puzzled.