Lab #1 Instructions and Task List Updated: 5-Oct-2004 at 8:00pm This lab is an introduction to Freedos. Instructions Installing Freedos can be done in a number of ways, however following these steps will ensure that it is properly installed with the source code available. Setting up the computer 1: Boot from Freedos CD-Rom -> Use option 1, and then 1 again at the next prompt, and 1 again at the next 2: Drop to the command line (option 2) 3: Run the "fdisk" command to partition the hard drive (C:) -> Be sure to create a primary DOS partition -> It is ok to use the entire drive 4: Format drive c: to prepare the file system 5: Run the "sys c:" command from the a:\ prompt to transfer the system files (kernel, etc) Setting up freedos 6: Switch to the X: drive in directory: x:\freedos\setup\install 7: Run the "textinst" command to install freedos -> You will be prompted for several things -> The install file directory is: x:\freedos\packages -> The installation destination is: c:\fdos -> You will be prompted for directory confirmation, etc -> When prompted for "Install this package", select "Yes to All" -> Answer "Yes" to all of the other prompts --> You will have to press the Enter key several times --> The error "cannot find... recovers.zip" may occur. If so, select "Yes" to continue 8: After the installation is complete, switch to the C: drive 9: The "cd" command is used to change directories. Use it to change into the "c:\fdos" directory. -> Example: "cd \fdos" 10: Run the "postinst" command -> This will perform some post-installation configuration such as setting up the autoexec.bat and config.sys files in the root directory -> Press "Enter" when asked whether to install the bootsector 11: Remove the CD-Rom from the drive and reboot the system -> Freedos should start up directly from the hard drive -> If it does not, barring hardware or media problems, it is likely that one or more steps were not followed. In this case it would be best to start again, noting that the "fdisk" command and subsequent "format c:" command will remove the existing installation. -> If Freedos does start correctly then select option #1 Tasks #1: Try the "help" command. This will provide you with a command line reference. -> To help with this lab, read information on the "cd", "dir", and "copy" commands #2: By default, most machines are not automatically configured to recognize and use the CD-Rom. Fix the necessary files to correct this problem such that you can read from the CD-ROM -> autoexec.bat and config.sys are two files that should be examined -> It may be helpful to use the "help" command --> Try looking at Atapicdd.sys and Shsucdx in the help menu --> Hint: If Atapicdd.sys does not work properly try VIDE-CDD.SYS located on the CD (or floppy disk) #3: The "dir" command displays the contents of the current directory. If there are more than a screen-full of files, they will scroll beyond the top of the screen and out of view. -> What command line switch(es) will prevent this from happening? #4: Create a directory for testing (example: c:\testing) and create a file using the "copy" command, as follows: copy con test.txt This is a test file. ^Z (this is actually control-Z, which can be generated by pressing F6) The last line is an EOF (end of file) marker that terminated the copy to the console. -> Use the "dir" command to make sure the file is in the directory -> View the contents of the file by using the command: "type test.txt" -> Use the help system to learn the "attrib" command -> Hide the test.txt file so that the standard "dir" command will not display it -> Find out which command line switch(es) for "dir" will display hidden files -> Use the "dir" command to list files with their attributes #5: The "edlin" command is the original DOS text file editor, and our experiments suggest that there are several bugs in the version that comes packaged with the current version of Freedos (beta 9). -> Start "edlin", and try the help command "?" -> Test the various commands and find one or two serious errors -> Edit the "test.txt" file that you created in the last step -> Use the edlin "move" command to move the "a" in line 2 to line 1 -> Verify that the position has changed using the "list" command #6: Install Borland Turbo C 2.01 -> Check the installation archive and run "instc.bat" -> Select the source drive as C -> The source path is: \TEMP_TC\TC -> Select: Install Turbo C on a Hard Drive -> Use the default values and "Start Installation" -> Once installation is complete it is necessary to modify the "PATH" variable such that it includes "c:\TC" as one of the command search directories. This can be done permanently by modifying one of the startup files, or temporarily. -> Try the "set" command -> Make the change permanently and reboot the computer -> Once restarted, use the "path" command to verify that it is set correctly --> Further verify that the paths are being searched correctly by trying the "TC" command from the root directory. If Turbo C starts, then the "c:\tc" path is being searched. Afterwards, try the "tree" command to make sure that the Freedos command directory is still being searched. #7: Before experimenting with the compiler it may be useful to learn what the "pushd" and "popd" commands do. -> Read the help on these commands and experiment with them #8: Compiling a file. -> Read the help on the "sort" command. -> Change to the "c:\fdos\source\sort" directory -> Use the "edit" command to edit the "makefile" file -> The 10th line "UPS=upx --8086" should be commented out, as follows "#UPX=upx --8086" -> Use the "make" command to automatically build the "sort" command -> No errors should occur at this stage, and a new copy of "sort.com" will reside in the directory --> Verify this is new by looking at the file date using the "dir" command -> Use the "tc" command to start Turbo C -> Using the "file" menu, "load" the "sort.c" file -> Examine the source code; -> Find out what switch(es) other than "?" will display the help (usage) text for "sort" -> Modify the source code -> Change the version string, as printed with the "?" switch, to 1.2.1 instead of 1.2 -> Save the changes -> Exit Turbo C -> Run the "make" command, and the "sort.com" command should recompile without errors -> Verify that the command has been changed by running "sort /?" and looking at the version number