Booting101 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. The bitsy comes with Wince. To get to Plan 9, you will need a serial cable,
  2. a Windows machine with a serial interface, the CDROM that comes with the bitsy,
  3. and a Plan 9 machine with a serial interface. The Windows machine is used to
  4. get the Linux boot loader onto the bitsy (and to save away wince, if you so
  5. desire). The Plan 9 machine is used to get the plan 9 kernel and a read only
  6. file system onto the bitsy.
  7. 0. charge up the bitsy.
  8. 1. go to
  9. ftp://ftp.handhelds.org/pub/linux/compaq/ipaq/stable/install.html
  10. Get the latest version of the Linux "osloader" and "bootldr" programs
  11. (we have tried versions 1.3.0 and 0000-2.14.8, respectively; newest
  12. versions seem not to allow you to suspend your bitsy due to a bug
  13. which is probably ours). You can find them all at
  14. www.collyer.net/who/geoff/9/bitsy/.
  15. 2. Use ActiveSync to copy osloader and bootldr to the bitsy. Copy or
  16. rename the bootldr binary to "bootldr" on Windows, then copy it to the
  17. bitsy; trying to rename it on WinCE won't produce the right result.
  18. Steps 3 - 7 may work on a Pocket PC bitsy, but see Steps 3a - 7a
  19. if they don't or if you have a Pocket PC 2002 bitsy.
  20. 3. Run osloader by clicking on it under the WinCE File Explorer
  21. 4. Use osloader to save your WinCE flash away. This takes a while,
  22. as it's 16MB over a 115,200 baud line.
  23. 5. Select "Run" from the osloader menu. Ignore "Run from RAM"; it's
  24. not needed.
  25. 6. At this point, the bitsy's screen turns blank, but you can still
  26. talk to the bitsy over its serial port. The serial port is connected
  27. to the OS loader's terminal program. On Windows, you have to exit
  28. ActiveSync before the serial port is available for a terminal program.
  29. I moved the bitsy and its cable over to a Plan 9 machine and connected
  30. using "con -b 115200 /dev/eia[01]" to talk to the console. The
  31. command "help" lists the OS loader's commands.
  32. 7. Now you need to download the BOOT loader program into flash (right
  33. now, you're only running the OS loader program out of RAM; rebooting
  34. will get you back to WinCE). In the con window, "load bootldr" to the
  35. bitsy. It will indicate that it's starting an xmodem download.
  36. Under con, type "Ctrl-\" to get a ">>>" prompt. At this prompt, you
  37. want to run Plan 9's xms program to pipe the bootldr program to the
  38. bitsy. For example, to download /tmp/bootldr, type "!xms /tmp/bootldr".
  39. If this step works successfully, the OS loader will print out some sort
  40. of OK checksum message.
  41. If you have a Pocket PC 2002 or steps 3 - 7 above didn't work for you,
  42. try 3a - 7a.
  43. 3a. Copy BootBlaster (also) to the bitsy via ActiveSync.
  44. 4a. Save your flash by running osloader and selecting "Flash->Save to
  45. File". As it produces 4MB files, use ActiveSync to copy them off the
  46. bitsy.
  47. 5a. Move the bitsy and its cable over to a Plan 9 machine and connect
  48. using "con -b 115200 /dev/eia[01]" to talk to the console.
  49. 6a. Run BootBlaster by clicking on it under the WinCE File Explorer.
  50. 7a. Select "Program"; it should copy "bootldr" into your flash in
  51. about 15 seconds.
  52. 8. Reboot your bitsy (either cycle the power or use the reset
  53. switch). The new boot loader runs out of Flash. You'll get the linux
  54. penguin splash screen and a bunch of options triggered by buttons.
  55. Pick the one that gets you to the boot loader.
  56. 9. Make the partitions you need in the bitsy's flash, type, using
  57. the con program:
  58. partition reset
  59. partition define bootldr 0x000000 0x040000 2
  60. partition define params 0x040000 0x040000 0
  61. partition define kernel 0x080000 0x0c0000 0
  62. partition define user 0x140000 0x0c0000 0
  63. partition define ramdisk 0x200000 0x600000 0
  64. partition define fs 0x800000 0x800000 0
  65. params save
  66. These are the partitions as shown by partition show:
  67. boot> partition show
  68. argv[1]=partition
  69. npartitions=00000006
  70. bootldr
  71. base: 00000000
  72. size: 00040000
  73. flags: 00000002
  74. params
  75. base: 00040000
  76. size: 00040000
  77. flags: 00000000
  78. kernel
  79. base: 00080000
  80. size: 000C0000
  81. flags: 00000000
  82. user
  83. base: 00140000
  84. size: 000C0000
  85. flags: 00000000
  86. ramdisk
  87. base: 00200000
  88. size: 00600000
  89. flags: 00000000
  90. fs
  91. base: 00800000
  92. size: 00800000
  93. flags: 00000000
  94. After each line you'll get a message like `defining partition: params'.
  95. Different versions of the bootloader predefine different partitions.
  96. The bootldr partition is usually predefined, so you don't have to remake
  97. that. You may have to delete one or two partitions. The command is
  98. partition delete <name>
  99. Make sure the partition layout is as given above; some of this knowledge is
  100. built into the kernel.
  101. 10. Before you can fill the new partitions with a kernel and a read-only
  102. file system, you'll have to make them. In the directory /sys/src/9/bitsy,
  103. type mk and mk paqdisk. Before mk-ing paqdisk, make sure you have all
  104. the necessary arm binaries installed in /arm and examine the file
  105. paqfiles/mfs to see what you need to change for connecting to your local
  106. file servers.
  107. 11. Now you can type "load kernel". The boot loader will prompt for
  108. another xmodem download. Again escape using "Ctrl-\", then use
  109. "!xms /sys/src/9/bitsy/9bitsy" (or "!xms /arm/9bitsy" if you've already
  110. installed it).
  111. 12. Download the ramdisk, using "load ramdisk" and
  112. "!xms /sys/src/9/bitsy/paqdisk" (or "!xms /arm/paqdisk" if you've already
  113. installed it), similarly to 10, above.
  114. 13. Type `boot' or `boot flash' depending on your version of the boot loader.
  115. If you need the latter, you may want to
  116. set boot_type flash
  117. params save
  118. to make boot flash the default.
  119. You'll get a Dutch flag (or a French one, if you hold the iPaq the wrong way),
  120. then the boot screen will say, on the serial port, thus in your con window:
  121. root is from [paq]:
  122. Just wait a while or hit enter in the con window and it'll continue.
  123. 14. The bitsy will now want to calibrate the screen. It'll put up a
  124. series of crosses that you should press the center of. Hold the pen
  125. down over each cross for a second or so; aim carefully. Hold the
  126. machine in your hand the way you'ld normally use it or the calibration
  127. could be off since there is depth to the glass in the screen.
  128. 15. You'll get a new screen with a single line at the top and a
  129. keyboard/scribble area at the bottom. This is a simple one file
  130. editor. This file is similar to plan9.ini on PC's. There may be
  131. garbage on the top line. If there is, delete the garbage letters.
  132. (Be careful here: the backspace and delete keys are adjacent on the
  133. wee keyboard and it's much too easy to hit delete instead of
  134. backspace, especially if you haven't calibrated the screen dead-on.)
  135. You should be left with a single line containing (with different
  136. numbers):
  137. calibrate='-16374 22919 251 -24'
  138. You need to enter a few more things, including, but not limited to:
  139. user=<user-name>
  140. wvkey1=<key string>
  141. wvkey2=<key string>
  142. wvkey3=<key string>
  143. wvtxkey=<key string>
  144. wvessid=<wavelan name>
  145. auth=<ip address>
  146. cpu=<ip address>
  147. proxy=<ip address>
  148. fs=<ip address>
  149. Your best bet is to copy these off a working bitsy. wv*key* only
  150. matter if your wireless network is encrypted. When roaming the world,
  151. omit wv*. When you're done, hit the "ESC" key on the simulated
  152. keyboard, or the side button near the word iPAQ on the bitsy. The
  153. system will now come up as you. However, you'll get a message about
  154. the flash file system being corrupted, because we haven't yet
  155. initialized it.
  156. 16. To set up the file systems, sweep a window and give the following
  157. sequence of commands.
  158. # aux/mkflashfs /dev/flash/fs
  159. # aux/flashfs
  160. aux/flashfs created a Plan 9 server in /srv/brzr, which we can use to set up
  161. default directories.
  162. # mount -c /srv/brzr /n/brzr
  163. # cd /n/brzr
  164. # mkdir n usr
  165. # mkdir n/fs n/emelie n/choline n/nslocum
  166. # mkdir usr/yourname usr/yourfriend
  167. 17. For safety, reboot the system:
  168. # reboot
  169. 18. Now reboot, go through the Linux splash screen, the Plan 9 boot
  170. editor, and sweep yourself a new rio window.
  171. Before you can connect to other machines, you need a way to enter
  172. passwords and keys into factotum. The easiest way to do this is to
  173. run
  174. # auth/fgui &
  175. in the window you just made. The window will disappear (fgui spends
  176. most of its time hidden), so sweep a new window and run the command
  177. # mfs
  178. to connect to file servers. You will probably need to modify mfs to
  179. work in your environment (see point 10), though you can supply many
  180. of the variables it needs in step 15, and doing
  181. # import $cpu /net
  182. before running mfs can go a long ways.
  183. 19. When you're all set with a working wavelan, you can download new
  184. kernels more quickly using
  185. # bitsyload k
  186. and new paqdisks using
  187. # bitsyload r
  188. (r stands for ramdisk, the name of the partition into which paqdisk goes).
  189. Note that overwriting the ramdisk partition will cause the read-only file
  190. system which forms the root of you namespace to fail. You'll need to
  191. reboot immediately after bytsyload r.