This project introduces the steps that you must take to implement, build, and run programs in the C and Go programming languages. You will learn how to use Makefiles to automatically build programs and copy their binaries to a suitable directory. The programs that you implement will demonstrate the execution of constructs that help you to detect details about the computer that runs the programs and the size of the data that the programs allocate to memory.
Even though the course instructor will have covered all of the concepts central to this project before you start to work on it, please note that not every detail needed to successfully complete the assignment will have been covered during prior classroom sessions. This is by design as an important skill that you must practice as you explore the depth and breadth in the field of operating systems. If you have questions about this project, please schedule a meeting with the course instructor during office hours.
After cloning this repository to your computer, please take the following steps:
Along with studying the references provided as comments in the C and Go source code files, please make sure that you refer to the chapter and to the slides on the course web site for more information about this project's context.
- Make sure that you have installed the following programs on your laptop:
- Gcc toolchain
- Go programming language
- C programming language
- Use the
cdcommand to change into the directory for this repository. - Review the
Makefilein theproject/clang/directory to see the targets for the version of this project implemented in the C programming language. - Review the
Makefilein theproject/golang/directory to see the targets for the version of this project implemented in the Go programming language . - Both of these
Makefiles will work on the Linux and MacOS operating systems and, additionally, on GitHub Actions, and inside of the OS-Sketch Docker container. You may need to revise portions of theseMakefiles so that they work correctly on the Windows operating system. - To build the C and Go programs you need to run the following commands from the
respective
clang/andgolang/directories:make run-sizeofto build thebin/run-sizeofbinary
- Note that the
makecommands are the same regardless of whether you are in theclang/or thegolang/directories! With that said, it is important to note that theMakefileingolang/does something different than the one inclang. Make sure that you understand how theseMakefiles work!
The run-sizeof program that you implement should output the following
information when run in your terminal window. All of this information should be
detected through functions calls that access operating system information and
not output in a hard-coded fashion. This means that, for instance, the
run-sizeof program will output different information when it runs on your
computer than when it is run in GitHub Actions or on the instructor's computer!
Please note that you may decide that your implementation of run-sizeof may
output more information that what is required by the following list; with that
said, you must at least provide the following information and be able to label
and interpret all of the output that the program creates.
- The technical name of the operating system on which the program was run
- The technical name of the computer architecture on which the program was run
- The size of the following data types for each programming language:
char: single-character valueint: single- and/or double-precision integer valuefloat: single-precision floating-point valuedouble: double-precision floating-point value
When a specific programming language does not, in your judgement, provide a
direct counterpart to the four aforementioned data types, you should qualify
your program's output and/or provide additional output for the most similar data
types. Ultimately, you should be able to use the output of the two run-sizeof
programs to reach a principled conclusion about the size of data in each
language. It is important that your C and Go programs both run on Windows,
Linux, and MacOS and automatically report data type sizes that are not
hard-coded for a specific architecture platform or operating system. Your
programs should also feature an automated approach, that is as general-purpose
and platform-independent as is possible, for detecting the operating system and
computer architecture on which the program is run and then display that in the
terminal window and/or in GitHub Actions. Finally, whenever it is appropriate to
do so, your C and Go programs should include references to the online technical
resources that you consulted and a statement about how they influenced your
approach to implementing the programs and collecting the required data.
As you work on this project, you should regularly take time to reflect on the steps that you are taking and why you are taking them. Each time you run a program you should think about the inputs, outputs, and behavior of that program, jotting down notes to help you remember these insights. When you are writing C and Go programs, please reserve time to reflect on the features of the language that you are learning and how the languages are similar to and different from each other. Make sure that you also reflect on your own strengths and weaknesses, how you can improve in advance of the next project, and the online technical resources that you consulted when completing the project. You should also ensure that you provide sufficient justification for the source code of the C and Go programs and sufficient commentary on their output.
Please review the following notes about the way in which your project will be automatically assess in GitHub Actions:
- If you have already installed the
GatorGrade program that runs
the automated grading checks provided by
GatorGrader you can, from the
repository's base directory, run the automated grading checks by typing
gatorgrade --config config/gatorgrade.yml. - You may also review the output from running GatorGrader in GitHub Actions.
- Don't forget to provide all of the required responses to the technical writing
prompts in the
writing/reflection.mdfile. - Please make sure that you completely delete the
TODOmarkers and their labels from all of the provided source code. This means that instead of only deleting theTODOmarker from the code you should delete theTODOmarker and the entire prompt and then add your own comments to demonstrate that you understand all of the source code in this project. - Please make sure that you also completely delete the
TODOmarkers and their labels from every line of thewriting/reflection.mdfile. This means that you should not simply delete theTODOmarker but instead delete the entire prompt so that your reflection is a document that contains polished technical writing that is suitable for publication on your professional web site.