README 3.5 KB

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