Loyola College in Maryland

CS 702 - Operating Systems
Spring 2005


Loyola College > Department of Computer Science > Dr. James Glenn > CS 702 > Examples and Lecture Notes > Running Knoppix

Supplies needed

At a maximum, you will need

Making Knoppix disks

If you do not have a Knoppix CD, then follow the links at DistroWatch to the Knoppix CD image download site, download a CD image, and burn it to your writable CD.

If your system can't boot from a CD, you will have to make a Knoppix boot floppy. Insert the Knoppix CD in a machine running Windows. Open Windows Explorer (or "My Computer") and browse the CD. In the KNOPPIX folder there should be a program called "mkfloppy". Run that program. The program will ask you to insert one of your floppy disks. Insert one of your blank floppies. mkfloppy will then write a boot image to the floppy disk.

Running Knoppix

Insert the Knoppix CD (and the Knoppix boot floppy if necessary) and reboot your system. If your system does not boot into Knoppix, then your system is probably set up to boot only from a hard disk. On many systems you can select a different boot device by pressing F12 when the system first comes on. F12 will bring up a boot menu that allows you to select which device to boot from. Select the CD-ROM drive if possible and the floppy drive otherwise. If F12 does not bring up a boot menu, then you will have to use your BIOS setup program (entered by pressing F2 or DEL during bootup on many systems) to change the boot order.

If Knoppix loads correctly, you will get a "boot:" prompt. Press enter here. You should see the messages "Loading vmlinuz..." and then "Loading miniroot.gz..." Once miniroot.gz has loaded Knoppix will attempt to detect and configure any hardware you have (and at this point it is safe to remove the boot floppy). Once the hardware has been configured, Knoppix will start the GUI.

Writing programs in Knoppix

Once the GUI has launched, you can get a command line by clicking the shell icon at the bottom of the screen or selecting "Konsole" from the "System" submenu of the "K" menu at the bottom left of the screen.

At the command line (which is "knoppix@ttyp0[knoppix]$") you can type "emacs hello.c &" to start an editor. Type your code in the editor and select "Save (current buffer)" from the menu when you are done.

Once you've saved you code, switch back to the command prompt and type "gcc hello.c" to compile your code. If there are syntax errors, switch back to the editor, fix them, save, and recompile. Once you compile with no errors you can run your program by typing "a.out" at the command prompt.

Saving your work

Your code will be saved to a ramdisk, which means that when you turn your system off the code will be gone. To save your code permanently you can do one of the following.

Quitting Knoppix

Selecting "Logout 'knoppix'" from the "K" menu will shut down the system. Please remove the Knoppix CD and reboot the system.