Setting up build environment (Neil Spring)
Options
You have many options in how to set up your build
environment for 412. For your success, ensure that you can
edit, build, and test via keystrokes. Your iterative
development must be faster than a commit/checkout cycle,
remote copy operation, reboot of a virtual machine, etc.
Your beloved windows-based editor may cause you more trouble
than it's worth if you cannot jump quickly locations
identified by compiler errors.
- Option 1: Use a Mac. It's what I use. It takes some setup
to get the cross compiler working.
- Option 2: Install Linux. It could take a day. Dual boot.
- Option 3: Windows: do everything in a VM.
Install Linux (Debian, Ubuntu) in a VM. Virtualbox works. Campus has a site
license for VMWare. Use git, emacs, etc, from within the VM.
- Option 4: Windows and Unix (including Mac): use Vagrant.
Vagrant installs a minimal VM for virtualbox and sets up folder sharing.
Edit, run, debug, commit (using git tools), etc from outside the VM.
On Windows, you'll need to, for example,
'vagrant ssh "cd /vagrant/build && make"' to compile.
(Details below.)
- Option 5: Unix (including Mac): use Docker,
which is like Vagrant but more lightweight.
I suggest options 4 or 5.
The configuration files (vagrant and docker) are in the gitlab repo.
Partially-configured virtual machine
Get the partially-configured virtual machine from
here.
Get the password in class.
Other linux virtual machines are possible,
but this one is already configured with a patched Qemu
and has the rest of the toolchain installed.
Project setup using Vagrant
Here's what I think modern geekos development should look
like in order to simplify and standardize. This is not
what I do, but is the most likely to create a development
environment that will definitely work.
Download and install virtualbox from
https://www.virtualbox.org
or via your package manager (apt-get install virtualbox).
Download and install vagrant from
https://www.vagrantup.com.
Download and install git from
https://git-scm.com
or via your package manager (apt-get install git).
% git clone [the repository]
% cd geekos-project
% vagrant up
(wait a while, or address vagrant's woes about your virtualbox install)
% vagrant ssh
On Windows, "vagrant ssh
" may hang in Git bash.
If so, try "VAGRANT_PREFER_SYSTEM_BIN=1 vagrant ssh
".
Or use Windows powershell instead.
% cd /vagrant/build
% screen make run
Screen is very useful; I would run within screen to make it possible to kill the
curses-based qemu using ctrl-a k. To get help, ctrl-a ?, to create a new window,
ctrl-a c, to switch windows, ctrl-a a.
I prefer to run qemu with an X window rather than have qemu
take over the window using curses. On my linux or mac host,
I would instead
% vagrant ssh -- -X
and remove "-curses" from the Makefile.linux.
If you'd prefer to avoid using the custom qemu (probably
okay with the possible exception of the scheduler project),
remove "-smpQuantum 1000" from build/Makefile.linux
Web Accessibility