Git Product home page Git Product logo

xv6-book's Introduction

NOTE: We have stopped maintaining the x86 book for xv6 but have switched the book to RISC-V (see
https://github.com/mit-pdos/xv6-riscv-book/).

---

The book compiles using Heirloom Troff,
an open source update of the original Unix troff.

cvs -d :pserver:[email protected]:/cvsroot/heirloom co heirloom-doctools
cd heirloom-doctools
make
sudo make INSTALL=install STRIP=strip install	# sic

This will install the binaries in /usr/ucb, but
you want to install them in /usr/local/ucb, which is
what the run1 script expects.  Move the binaries or
update PREFIX in mk.config in heirloom-doctools.

xv6-book's People

Contributors

bford avatar kaashoek avatar pmaddams avatar rsc avatar sbshah97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xv6-book's Issues

Reflowable output format?

Is there an easy way to generate a version of the book with reflowable text, like html or epub? Searching around, I found this page, so someone came up with some way of doing it. I tried fiddling with the Makefile and scripts to use troff -Thtml and dhtml instead of dpost. I was able to get valid html output but it had no formatting and no figures. I was not previously familiar with troff, but the syntax seems pretty straightforward. Perhaps a new troff->ReSructed Text converter would not be too hard to write (it seems like the link above was generated with sphinx and Restructured Text).

Uppercases not compliant in all the book

Issue

Some functions that are quoted in the book at the beginning of sentences start with an uppercase, some others don't.
I have already made a PR to correct the ones I could correct, but for other, this is probably due to the index where all functions need to have a lowercase.
I am not sure about the fix you prefer, but I think you should add a new macro in book.mac (there is already one that enables to index a name without writing it in the book, so it is possible, using .index function and then .code Function (like you did for Tvinit in trap.t l.282-283), to have a better behavior, but then "+code" would be missing in the sidebar...)

List

I will list here all the occurrences I find in the book (July 2019).

first.t

userinit (l.608, l. 629)
scheduler (l. 759)
allocuvm (l. 882)

mem.t

main (l. 205)
mappages (l. 231)
walkpgdir (l. 253)
kalloc (l. 419)
loaduvm (l. 555)

trap.t

argint (l. 581)
argptr (l. 614)
argstr (l. 625)
trap (l. 1011)

Two TODOs

In

xv6-book/trap.t

Line 339 in cfe48f6

TODO: Replace SETGATE with real code.

TODO: Replace SETGATE with real code.

xv6-book/fs.t

Line 13 in cfe48f6

TODO: Explain the name sys_mknod.

TODO: Explain the name sys_mknod.

Perhaps someone wants "to really do the TODOs" so that they can be removed?

Map interrupt 0 to IRQ 0

In trap.t, line 699 says:

xv6 programs to map interrupt 0 to IRQ 0

This sentence is not particularly clear. I would suggest:

During initialization, xv6 programs interrupt gates:
.code-index tvinit
.line trap.c:/^tvinit/
initialize entry 0 of IDT to vector0, and
so on.

Segments are not used for per-CPU storage

In mem.t (lines 860-870), it is written:

but xv6 uses segments only for the common trick of
implementing per-cpu variables such as
.code proc
that are at a fixed address but have different values
on different CPUs (see
.code-index seginit ).
Implementations of per-CPU (or per-thread) storage on non-segment
architectures would dedicate a register to holding a pointer
to the per-CPU data area, but the x86 has so few general
registers that the extra effort required to use segmentation
is worthwhile.

As far as I understand, all segments in GDT/LDT start from 0 to ffffffff. Thus, they are not used for the described trick. Furthermore, proc is referenced through struct cpu in the cpus[] array (and index in this array is obtained by searching the local APICID).

Therefore, I suggest removing this whole paragraph.

code lines potentially cited incorrectly for EMBRYO state change in allocproc

error_in_embryo_code_line_numbers

Here the code lines pointed out after "unique pid" seem a little off from what's intended. My guess is that the intention was to specify (2488-2489), but due to the occurrence of EMBRYO in the comments preceding the allocproc function, the regex matched the wrong EMBRYO. Not sure what your favorite fix would be, but seems like it should be a pretty easy fix.

.lines proc.c:/EMBRYO/,/nextpid/ .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.