Phillip Stanley-Marbell
Foundations of Embedded Systems
Department of Engineering, University of Cambridge
http://physcomp.eng.cam.ac.uk
Fascicle 03: Setting Up the Relevant Software and Hardware Tools
(~20 minutes)
Version 0.2020
(Video)
26
Intended Learning Outcomes for Today
2
Use the Unix program man to find out more about a given Unix command
By the end of this session, you will be able to:
Use the vi editor to edit files
Use basic Unix tools to navigate through the server
Compose multiple Unix commands using pipes
12
Get Familiar with the Unix Shell
3
Change directory
cd
List files in directory
ls
Make a directory
mkdir
Check present working directory
pwd
Useful (and Historical) Reference: Original original collection of articles introducing Unix (link)
Echo (print) a string or environment variable
Redirect the output of a command into a file
>
>>
(replace contents of file) (append to contents of file)
12
Additional Useful Unix Tools
4
Programmable column-focused text processing
awk
Disk usage and recursively listing all subdirectories
du
Row-oriented text processing
View manual page (i.e., help) for any command
man
Dump contents of one or more files in one go (“concatenation”)
cat
View contents of file incrementally
Useful (and Historical) Reference: Original original collection of articles introducing Unix (link)
12
Composing Command-Line Tools: Unix Pipelines
5
Historical Reference: Original memo from Doug McIllroy proposing the facility (link)
Unix pipelines let you compose together multiple tools (like garden hoses)
du -a f-of-e-tools/docs | grep 'pdf' | sort -u | awk '{print $2}'
12
Additional Useful Unix Tools: vi
6
Edit a file
vi <file name>
Saving (write file to disk)
:w
Quit without saving
:q!
Save and quit
:wq
Search for string
/string
Historical Reference: Original article on vi by Bill Joy and Mark Horton (link)
Enter “edit mode” using i, exit using [esc]
12
Get Familiar with git
1 of 2
7
Get a copy of a repository
git clone
Repositories
▶︎ A git repository is a directory tree with its associated change history embedded
▶︎ The change history is stored in a subdirectory named .git at top of the tree
▶︎ The recommended reading discusses how to create a new repository and more
Record changes you have made into your local change history
git commit
12
Get Familiar with git
2 of 2
8
Send a copy of your local changes to a remote server (e.g., to GitHub)
git push
Get a copy of changes from a remote server and merge them into local tree
git pull
12
Fork github.com/f-of-e/f-of-e-tools
9
Clone the repository to your account on the coursework server
Fork the tools on GitHub
Do not try to compile the tools on the server (you will run out of space).
If you wish to setup the tools on your own PC, the section of the handout titled
“Setting Up the RISC-V Processor Design Project Repository” (link) describes how.
12
Practice (Do this on your own; no hand-in required)
10
Team Member 1
Team Member 2
Team Member 3
Prepare a five-minute overview of how to update a
fork when the fork’s parent has been modified and
lead a discussion with your team on how to do this.
Prepare a five-minute overview of how to coordinate
changes in your individual forks. One approach is
to designate one of your forks as the only one you
use, create a branch per team member, and merge
your individual branches into the team’s master
branch after you’ve verified it works correctly.
Prepare a five-minute overview of branch naming (e.g.,
using GitHub issue numbers), branching, merging,
and resolving merge conflicts for your team.
12
Things to Do
11
Read the article “What’s Wrong with Git: A Conceptual Design Analysis”
Read the article “An Introduction to Display Editing with Vi” and
familiarize yourself with editing in vi
Read the article “The UNIX Time-Sharing System” (page 1905 in the collection of articles)
Read the article “A Quick Introduction to Version Control with Git and GitHub”
Read the article “Ten Simple Rules for Taking advantage of Git and GitHub”
Complete a “muddiest point” 2-question survey using this link
Decide which team member will focus on power, performance, and resource usage
Backup
12