diff --git a/year4/semester2/CT420/assignments/assignment2/latex/CT420-Assignment-02.pdf b/year4/semester2/CT420/assignments/assignment2/latex/CT420-Assignment-02.pdf index e7a7238d..3adee3a9 100644 Binary files a/year4/semester2/CT420/assignments/assignment2/latex/CT420-Assignment-02.pdf and b/year4/semester2/CT420/assignments/assignment2/latex/CT420-Assignment-02.pdf differ diff --git a/year4/semester2/CT420/assignments/assignment2/latex/CT420-Assignment-02.tex b/year4/semester2/CT420/assignments/assignment2/latex/CT420-Assignment-02.tex index b1dfe601..2993a640 100644 --- a/year4/semester2/CT420/assignments/assignment2/latex/CT420-Assignment-02.tex +++ b/year4/semester2/CT420/assignments/assignment2/latex/CT420-Assignment-02.tex @@ -4,13 +4,17 @@ % packages \usepackage{microtype} % Slightly tweak font spacing for aesthetics \usepackage[english]{babel} % Language hyphenation and typographical rules -\usepackage[final, colorlinks = true, urlcolor = black, linkcolor = black]{hyperref} \usepackage{changepage} % adjust margins on the fly +\usepackage[final, colorlinks = true, urlcolor = black, linkcolor = black, citecolor = black]{hyperref} \usepackage{fontspec} \setmainfont{EB Garamond} \setmonofont[Scale=MatchLowercase]{Deja Vu Sans Mono} +\usepackage[backend=biber, style=numeric, date=iso, urldate=iso]{biblatex} +\addbibresource{references.bib} +\DeclareFieldFormat{urldate}{Accessed on: #1} + \usepackage{minted} \usemintedstyle{algol_nu} \usepackage{xcolor} @@ -73,4 +77,54 @@ \hrule \medskip +\section{Host Environment} +For my host environment, I chose to run Ubuntu Server 24.04.2 LTS using a VirtualBox hypervisor. +I chose this operating system as I have sufficient Linux experience to feel confident using an operating system with no graphical interface (as opposed to Ubuntu Desktop), and the absence of a GUI means a smaller ISO file, memory footprint, \& CPU footprint. +I chose Ubuntu specifically because it's a Linux system with which I have previous experience, and is well-document with plenty of packages available to install if needs be. +Ubuntu also makes it easy to install the \verb|PREEMPT_RT| patches, which transform the standard Linux kernel into a fully preemptible, real-time kernel, which I felt was more suitable for this assignment, as the standard Linux kernel is not suitable for a hard real-time system due to its lack of preemption. + +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/hardware.png} + \caption{Virtual machine hardware configuration} +\end{figure} + +I set the virtual machine to have a single CPU and set the amount of RAM to 2048MB which is the recommended minimum for Ubuntu Server\supercite{ubuntu_server_installation}. +I left the hard disk size at the default of 25GB as I saw no reason to change it. +The real-time kernel with the \verb|PREEMPT_RT| patches installed is available with Ubuntu Pro, which is free for personal use. +After setting up an Ubuntu Pro account, I enabled the real-time kernel using the \mintinline{bash}{pro} command. + +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/proenable.png} + \caption{Enabling the real-time kernel with the \mintinline{bash}{pro} command} +\end{figure} + +Finally, I transferred over the following C file (taken from the lecture slides) via \mintinline{shell}{scp} to the virtual machine to get the clock resolution, which is 1 nanosecond: +\begin{code} +\begin{minted}[linenos, breaklines, frame=single]{C} +#include +#include +#include + +int main(){ + struct timespec clock_res; + int stat; + stat=clock_getres(CLOCK_REALTIME, &clock_res); + printf("Clock resolution is %d seconds, %ld nanoseconds\n",clock_res.tv_sec,clock_res.tv_nsec); + return 0; +} +\end{minted} +\end{code} + +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/clockres.png} + \caption{Getting the clock resolution of the virtual machine} +\end{figure} + + + + +\printbibliography \end{document} diff --git a/year4/semester2/CT420/assignments/assignment2/latex/images/clockres.png b/year4/semester2/CT420/assignments/assignment2/latex/images/clockres.png new file mode 100644 index 00000000..65400638 Binary files /dev/null and b/year4/semester2/CT420/assignments/assignment2/latex/images/clockres.png differ diff --git a/year4/semester2/CT420/assignments/assignment2/latex/images/hardware.png b/year4/semester2/CT420/assignments/assignment2/latex/images/hardware.png new file mode 100644 index 00000000..ee151500 Binary files /dev/null and b/year4/semester2/CT420/assignments/assignment2/latex/images/hardware.png differ diff --git a/year4/semester2/CT420/assignments/assignment2/latex/images/proenable.png b/year4/semester2/CT420/assignments/assignment2/latex/images/proenable.png new file mode 100644 index 00000000..97af6384 Binary files /dev/null and b/year4/semester2/CT420/assignments/assignment2/latex/images/proenable.png differ diff --git a/year4/semester2/CT420/assignments/assignment2/latex/references.bib b/year4/semester2/CT420/assignments/assignment2/latex/references.bib new file mode 100644 index 00000000..f1538f9d --- /dev/null +++ b/year4/semester2/CT420/assignments/assignment2/latex/references.bib @@ -0,0 +1,7 @@ +@misc{ubuntu_server_installation, + author = {Canonical Group Ltd.}, + title = {Basic Ubuntu Server Installation}, + year = {2025}, + url = {https://documentation.ubuntu.com/server/tutorial/basic-installation/}, + note = {Accessed: 2025-03-18} +}