Using brickOS in the Sun Lab and the MS Lab

preface

In this course, you will encounter brickOS in three different places.

Detailed instructions for how to setup brickOS on your own Windows machine are provided in the rest of this HOWTO. This section covers using brickOS in the MS Lab and in the Sun Lab. Most of the principles are the same, but there are some differences.

Before you read this, it is expected that you are familiar with at least the basics of brickOS (compiling a kernel, downloading a kernel, compiling programs, downloading programs) on some platform.

a note about development in multiple environments: When you compile a brickOS program, the linker will link against the kernel image compiled on the machine you are working with. It is crucial that this kernel image is the same image that is on your robot. Since the kernel images produced by different machines are also likely to be different (i.e. windows and linux), every time you switch development to a different machine, make sure the brickOS kernel in your RCX is the same kernel as the one in the machine you're working on. This will almost always require you to re-download the brickOS kernel every time you switch machines (or at least from the Sun Lab to your dorm). 

You can try using an RCX that has the kernel image from a Linux and downloading a program from a Windows machine or vice versa.  In most cases there shouldn't be a problem because the brickOS kernel images under Linux and Windows are only slightly different.  If you do encounter weird problems, then you should try using the kernel image and program from the same machine.

For now, if you want to work in the Sun Lab or in the MS Lab, you will be expected to bring your own IR tower.

The Sun Lab

The brickOS kernel
Is located in /course/cs148/lib/brickOS.srec
Download this file into your robot if you plan on working from the Sun Lab
Downloading a kernel into your robot
Using the makefile provided in /course/cs148/samples/Makefile just type make brick
Downloading a program into your robot
Using the makefile provided in /course/cs148/samples/Makefile just type make install.
Sample code
Is located at /course/cs148/samples
Sample Makefile
Is located at /course/cs148/samples/Makefile
This should be the only Makefile you need for any of your projects. To compile, copy this file to whatever directory your source code is in and read the makefile to see how to use it. The makefile will compile the program correctly regardless of whether you are running it on a Linux or Windows machine.
Advanced debugging tools
Are available. Look at the sample code (/course/cs148/samples, not on the web) for examples on how to use the following tools:

The MS Lab

Link the course directory to L: drive
To use brickOS in the MSLab, you first need to map your L: drive to the cs148 course directory.
          Open up "My Computer" and click on Tools Menu->Map Network Drive.
Choose L as your drive.
          In Folder type: \\maytag\course0\cs148
          Click finish.
Cygwin
To use brickOS on Windows, you need to open up Cygwin (a program that emulates a UNIX-like shell for Windows).  You can use it as you would as shell under Linux
The brickOS kernel
Is located in /course/cs148/winlib/brickOS.srec
Download this file into your robot if you plan on working from the MSLab
Downloading a kernel into your robot
Using the makefile provided in /course/cs148/samples/Makefile just type make brick
Downloading a program into your robot
Using the makefile provided in /course/cs148/samples/Makefile just type make install.