Home | Syllabus | Assignments | Resources | Piazza |
Eclipse is a relatively widely used, open source integrated development environment (IDE). If you have ever programmed on Windows, it is
similar
in spirit to Visual Studio. IDE's typically attempt to facilitate your
development by automating as many tasks as possible and making it
easier
to navigate and analyze your code. Use of Eclipse is entirely
optional,
but you may find it useful in helping to manage the complexity of a
large
codebase like OS/161. If you want to learn how to use Eclipse in
general,
there are many tutorials on the web. You might start with the
Eclipse
Workbench user guide which should help orient you on how Eclipse
structures itself.
WARNING: Eclipse (with OS/161 configurations) is hard to setup, and you may get annoying red underlined syntax errors (e.g. NULL is undefined) that do not go away. Keep in mind that you will still need to configure and build your kernel in the CS50 appliance (or via SSHing into your appliance).
If you want to try using Eclipse with OS/161, you have two options:
These instructions are relevant for those using Eclipse in the CS50 appliance and those using Eclipse on their native OSes.
These instructions describe how to create a shared directory between your CS50 appliance and your native Mac using sshfs. Eclipse will access OS/161 source files from this shared directory.
Warning: the appliance currently has a bug with the shared directory feature described below. While that gets fixed, use a version of sshfs for Windows to created a shared directory between the appliance and your native OS. These instructions have proven useful for Windows 8 users. If Eclipse tells you it cannot use anything in your shared drive as a workspace, see this StackOverflow page. On the latest version of the CS50 appliance, there is a shared directory between your Windows machine and the appliance set up already! To get to the shared directory on your windows, go to \\APPLIANCE_IP where APPLIANCE_IP is the IP address on the bottom right corner of the appliance (e.g. \\192.0.0.1\home\jharvard\cs161\os161). Then:
Since you'll still have to configure, compile, build, run, and debug OS/161 from your appliance, it may be useful to have an ssh terminal for your appliance accessible within Eclipse.
Some versions of Eclipse come with Remote Systems Explorer already included, and on others you'll need to install it. Try navigating to Window -> Show View -> Other -> Remote Systems. If a "Remote Systems" folder appears then you don't need to install anything; else, navigate to Help -> Install New Software and install "Remote Systems Explorer." Once your install is complete, navigate to Window -> Show View -> Other -> Remote Systems again.
In the options under the "Remote Systems" folder, double click on "Remote Systems." A window should pop up next to your console. In that window, right-click on the connection "Local" and navigate to New -> Connection. Select "SSH Only" as your connection type, enter your appliance's IP address as the hostname and establish your connection. When this is done, your appliance's IP address should be listed along with the "Local" connection that was originally displayed. Expand the menu under the IP address, and right click "Ssh Terminals." Then click "Launch Terminal" and use the terminal that pops open.
Unfortunately, there's not a good way right now to debug your kernel from within Eclipse, which is a shame as it has a very nice debugging environment. What you can do instead is use one of the many front-ends for gdb. One of these is called DDD, and instructions on getting it to work with OS/161 are below.