README 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. This is Plan 9 for amd64 built with gcc (and soon, I hope, clang).
  2. This file is a quick list of instructions to get you started quickly.
  3. Prerequisites
  4. =============
  5. To build harvey and play with it, you need to have git, golang, qemu, gcc,
  6. binutils and bison installed. On a Debian, Ubuntu or other .deb system,
  7. you should be able to get going with
  8. sudo aptitude install git golang build-essential bison qemu-system
  9. GERRIT
  10. ======
  11. We use gerrithub.io for code-review. If you want to submit changes, go to
  12. https://review.gerrithub.io/#/admin/projects/Harvey-OS/harvey
  13. and check out the repository from gerrithub rather than github. The clone
  14. command will probably look something like this:
  15. git clone ssh://USERNAME@review.gerrithub.io:29418/Harvey-OS/harvey
  16. you'll need to run a few commands inside the top-level directory to get set
  17. up for code-review:
  18. cd harvey
  19. curl -Lo .git/hooks/commit-msg http://review.gerrithub.io/tools/hooks/commit-msg
  20. chmod u+x .git/hooks/commit-msg
  21. git config remote.origin.push HEAD:refs/for/master
  22. One last thing, we need to initialize any submodules:
  23. git submodule init
  24. git submodule update
  25. If you are on a Mac, you should install macports (https://www.macports.org/) and do
  26. port install x86_64-elf-gcc
  27. port install x86_64-elf-binutils
  28. port install qemu
  29. export TOOLPREFIX=x86_64-elf-
  30. or if you use homebrew (https://http://brew.sh/)
  31. brew tap sevki/gcc_cross_compilers
  32. brew install sevki/gcc_cross_compilers/x86_64-elf-gcc
  33. brew install qemu
  34. export TOOLPREFIX=x86_64-elf-
  35. and you're now all set, you can build the whole thing just by running
  36. export HARVEY=$(pwd)
  37. export ARCH=amd64
  38. ./BUILD all
  39. Once building is complete, you can try booting the kernel with qemu
  40. (cd sys/src/9/k10 && sh ../../../../util/QRUN)
  41. Next you should find a bug somewhere in harvey and fix it. In general, the
  42. util/build tool "just works" in any subdirectory, so you can also build just
  43. the stuff you are looking at, too, eg.
  44. cd sys/src/cmd/aux
  45. build aux.json
  46. Let's say you found a bug and the files you needed to change were
  47. sys/src/9/ip/tcp.c and sys/src/9/ip/ipaux.c. To submit this for review, you do
  48. git add sys/src/9/ip/tcp.c
  49. git add sys/src/9/ip/ipaux.c
  50. git diff --staged # to check that the patch still makes sense
  51. git commit -m 'your description of the patch'
  52. git push
  53. Note the lack of qualifiers in the last push command. It is important,
  54. because it needs to be pushed to "origin HEAD:refs/for/master" for review
  55. (and not to master). This will generate a code-review change request, others
  56. will review it, and if it looks good we will merge it to the mainline repo
  57. using gerrithub.io.
  58. If your patch needs further work (you notice something wrong with it yourself,
  59. or someone suggests changes), you can just edit the affected files and then
  60. amend the change list as follows
  61. git add sys/src/9/ip/tcp.c
  62. git commit --amend
  63. git push
  64. More information on using Gerrit can be found on the gerrithub.io website.
  65. Getting go9p to serve your files
  66. ================================
  67. The currently recommended way of doing this is to run go9p/ufs as the
  68. file server for harvey. It is provided as a submodule in util/third_party
  69. and should be automatically compiled & copied to util/ when you run
  70. 'BUILD utils'.
  71. Once it's built, you can run this:
  72. (export HARVEY=$(pwd) && cd sys/src/9/k10 && sh ../../../../util/GO9PRUN)
  73. to boot with ufs serving the harvey directory for your harvey instance. Once
  74. harvey is up, you can telnet onto it with
  75. util/telnet localhost:5555
  76. Where 5555 is forwarded to the harvey instance. This gives you a prompt
  77. without any security. Once you have the prompt, you can mount the harvey
  78. directory as your root like this (10.0.2.2 is what qemu has as the host)
  79. srv tcp!10.0.2.2!5640 k
  80. mount -a /srv/k /