0% found this document useful (0 votes)
20 views22 pages

Mod-2-Linux N Raspbian UPD

Uploaded by

vanessagong2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views22 pages

Mod-2-Linux N Raspbian UPD

Uploaded by

vanessagong2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

ELEC 3442

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

Text-based interface Graphic interface

• Type commands directly into text-based console


• Use point-and-click interface
File System

• Can create and modify files in a directory structure


• Similar to other file system interfaces
Multiple Processes

• Can download and run multiple programs


• Can execute many processes concurrently
• Use the command “ps”
• Give a list of all processes running on the machine
• Background processes can handle things in the background for
Simple Process Comm./Management
• After using “ps” to list out the currently running (i.e. active) processes, it can be seen that
each process is uniquely identified by the process ID (PID) under the Raspbian OS;

• 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

Hierarchy of directories and files


cd ls

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

• Each process has a unique PID


• “kill” can be used to end a process
Shutdown
• Should not just unplug a Linux machine
• Proper shutdown procedure is needed to place data
structures in a good state
• Flush all buffers, close files, etc.
• Use the “shutdown” command
Using the GUI for Raspbian
• After initial login, type “startx”
• Initiate the X windows system with a default window
manager
• The manager determines the look
PC Emulator: test Linux commands in
web browser

http://bellard.org/jslinux/

You might also like