Mod-2-Linux N Raspbian UPD
Mod-2-Linux N Raspbian UPD
Embedded
Systems
Mod-2: Linux and
Raspbian
Debian and Linux
• Linux
• Unix-like operating system
• Assembled under the model of free and open-source software development and
distribution
• Originally developed for the Intel x86 architecture
• Leading OS on servers, mainframe computers, and supercomputers
• Ported to other hardware platforms, like embedded systems and smartphones
• Android is built on top of the Linux kernel
• Debian
• Free operating system
• Set of basic programs and utilities that make your computer run
• Core = kernel
• Most fundamental program that does all the basic housekeeping and lets you
start other programs
• Use the Linux kernel
Other Variants of Linux…
• Ubuntu [URL : https://ubuntu.com/]
• Ubuntu is one of the most popular Linux distribution based on Debian, consisted of
mostly free and open-source software;
• With official releases in 4 different editions: Ubuntu Desktop, Ubuntu Server, Ubuntu
for IoT - for Internet of things devices and robots, and Ubuntu Cloud;
• Widely adopted by small-to-medium enterprises (SMEs), research centres, start-ups,
etc.
• Qubes OS [URL : https://www.qubes-os.org/]
• a security-focused desktop operating system targeted to provide security through
isolation;
• the key assumption is that no desktop S/W and environment can be totally perfect and
bug-free;
• Therefore, to secure a desktop, a Qubes user takes care to isolate various
environments, so that if one of the components gets compromised, the malicious
software would get access to only the data inside that environment.
Raspbian
• Adjusted to produce optimized "hard float" code that will run on the Raspberry Pi
• Provide significantly faster performance for applications that make heavy use of
floating point arithmetic operations
• Make Raspberry Pi a great cheap computer
• Do most things that a Mac or a PC can do
• e.g., LibreOffice, including a word processor, spreadsheet, presentation
graphics, vector drawing, and database programs
• compatible with Microsoft Office files
User Interface
• Use the command “kill” to communicate (i.e. sending a signal) or manage your own or child
processes, e.g.
• To quickly terminate a process, you have to send a SIGKILL signal. SIGKILL cannot be
ignored by the process and in most cases results in its instant termination.
$ kill -9 <PID>
• Besides, to list all the possible signals to be sent by “kill” command, one may use the
following command.
$ kill -l
Using Hardware Devices
• Any application running in user space User application
• File associated with a hardware device
• Convert file accesses to device
accesses /dev/xxx
• HW device: keyboard, monitor, etc.
• Device drivers enable applications to
access arbitrary hardware devices Device Driver
Hardware Device
The Shell
• Interpret user input and execute commands
• Text-based user interface of an operating Prompt ($)
system
• bash (bourne again shell) is the default shell for
Raspbian
• Give more precise control to the user
• Require memorization for efficiency
• Console/terminal
• Text entry and display device
• Used to be a physical device
• Virtual consoles are typical now
• LXTerminal is the terminal used in Raspbian
Accounts
• There can be many user accounts on a Linux system
• Each account has a username and password for identification
• When you first start the machine, you are promoted for
username and password
• Default
• Username: “pi”
• Password: “raspberry”
Manual Pages
• “man” gives information about a Linux command
Filesystem
pwd
mkdir, rmdir
Editing a file
• Many ways to do this, depending
on the type of file you want to
create
• Typical method involves a text
editor
• Like a word processor but
simpler
• Several are available on Linux for
free
• Emacs, vi, vim, etc. • Run it by typing “nano” at the
• Choose a favorite and stick with it
prompt
• Basic functions via control
sequences
Viewing a file
• “cat” prints the file to the terminal mv
• “head” prints the first 10 lines • Move a file
• Rename it or move it to a new directory
• “last” prints the last 10 lines
cp
• Make a copy of a file
• Files have owners
• User who created the file
File Permissions • Files have access permissions
• Read (r), write (w), execute (x)
• Different permissions can be assigned according to type
• User: the file owner
• Group: a permission group
• Other all users
Root/ADMIN Account
• The root account has highest permission level
• Key files and directories are only accessible by root
• Sometimes you need root privileges
• Install a program
• Change the operating system
• Use the “sudo” command to gain root permission
for a single command
Processes
• A Process is the execution of a program
• Linux allows multiple processes to run concurrently
• Foreground vs. background
• User can do something while other tasks are taken care of
• Read email
• Download file
• Wait for network connection
• Check for viruses
http://bellard.org/jslinux/