Environment Setup for CSCE 410/611
(This walkthrough assumes you are running XP with admin privileges.)
Installing DJGPP
First, you must download DJGPP, which has several files. This zip picker will allow you to select the correct options below.
First go to this URL: http://www.delorie.com/djgpp/zip-picker.html
Now click Tell me which Files I need. Now before you begin downloading all the files it gives you, create the directory C:\DJGPP. Then save all the files to that directory.
Then do: Start > Run > cmd
cd to DJGPP directory: cd c:\DJGPP
Extract all files: unzip32.exe *.zip
[There will be some file conflicts, just type A to overwrite all. There the same files anyway.]
Now edit the PATH system variable by right-clicking on My Computer and select Properties.
Go to the Advanced Tab and click the Environment Variables button close to the bottom.
Find the Path system variable and append the path (c:\DJGPP\bin) to the semicolon separated list of paths.
Create a new system variable via the New button (Name: DJGPP Value: c:\DJGPP\djgpp.env)
You can apply all the setting made in the System Properties window, but you can leave it open as we will be adding more variables to it later.
Now in your terminal execute: go32-v2
You should see something like this:
You have now successfully installed DJGPP. Yay.
Installing NASM
Now you must install NASM from here: http://sourceforge.net/projects/nasm/
Just click through the install procedure. It should default to installing under the Program Files folder.
Once it's done, go back to the System Properties window you opened via Properties of My Computer and find the PATH variable again. Now add the path to NASM there. It should be c:\Program Files\NASM .
Check to make sure everything is okay by executing c:>nasm from the command prompt. Be sure to open a new window between changing environment variables and paths otherwise it will appear to have not worked.
You should see something like this:
You have now successfully installed NASM... and there was much rejoicing.
Installing Bochs
Go here: http://sourceforge.net/projects/bochs/ Install it. You know the drill.
At this point, you should have DJGPP, NASM, and BOCHS all installed. Your environment should now be in place. In order to make sure that it works, download the base Bochs support files here: https://people.engr.tamu.edu/bettati/Courses/410/2010A/Projects/BaseBochsEnv.zip
Here's what it contains:
dev_kernel_grub.img: This file contains the image of the boot "floppy disk". It contains the grub bootloader and a dummy kernel.
Now extract your zip file into a folder of your choosing and double click the bochsrc.bxrc file to insure that Bochs is installed correctly. You should see something like this:
And after hitting return....
Congratulations, you're a pro...
Make Sure You Can Make
Ok, so now we want to make sure you're able to compile your source code and that that part of the environment is setup like it should be. This is simple. Just download the MP1 source package: https://people.engr.tamu.edu/bettati/Courses/410/2010A/Projects/MP1_Source.zip
Extract it into your project directory.
Open up a command prompt in that directory and type make. You should see something like this:
Voila.
Now you can modify the source code to your liking, make it, and then copy the kernel.bin file into your dev_kernel_grub.img file as shown below.
Installing FileDisk
Now, in order to get your project going, you must copy your kernel into the .img file. So first, download the filedisk utility from here: http://www.acc.umu.se/~bosse/filedisk-17.zip
Save it wherever you want on your machine and unzip it.
After you've done this, traverse to the filedisk.sys file ( sys\chk\i386 )
Copy filedisk.sys to c:\WINDOWS\system32\drivers
Next, add it to the registry by double clicking on the filedisk.reg file.
Additionally, I made sure it was in my path under the system variables much like NASM an DJGPP also.
Now you should be good to go. Hopefully this tutorial helps! Send all complaints to Dr. Bettati.:-P