OS structuring

SPIN and External approaches to OS extensibility
L3: Micro kernel-based approach to OS extensibility

OS service example
process, memory management, interprocess communication(ipc), file system, access to I/O devices, access to the network

Why the structure of the OS is important?
-protection, performance, flexibility, scalability, agility, responsiveness

Protection: within and across users + the OS itself
Performance: Time taken to perform the services
Flexibility: Extensibility => not one size at all
Scalability: performance if hardware resources
Agility: adapting to changes in application needs and/or resource availability
Responsiveness: reaching to external events

Commercial OS
– Linux, MacOS, Windows

Managing the CPU and Memory

OS abstraction

Resource needs of applications
-cpu, memory, peripheral devices
app launch time
– know how to create memory
App – os loader – stack, heap, global data memory
App asks for additional resources at runtime

Processor related OS abstractions
– program => static image loaded into memory
– process => a program in execution
Process = program + state => evolves as the program executes

advanced Operating Systems

variety of platforms — cell phones, multi-core, parallel systems, distributed systems, and cloud computing.

Digging deeper into the power of abstruction
Google earth
<-> series of abstruction <->
Electrons, Transistors, Logic gates, Seq. + comb.Logic element, machine organization(Data path + control), Instruction set architecture, System software(os, compilers, etc), Applications

Hardware continuum
smartphone, tablet laptop, desktop, server, cloud

Internal organization
– same for all manifestations
Contr, CPU, memory, Bus, contr, Network

System Bus(Higher speed), frame buffer and I/O Bus(Lower speed) connected with Bridge

OS is a resource manager
OS provides a consistent interface to the hardware resources
OS schedules applications on the cpu

OS protected access to hardware resources
-arbitrate among competing requests

grep

$ curl -L https://tinyurl.com/zeyq9vc | grep fish
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 –:–:– –:–:– –:–:– 0
1 916k 1 16384 0 0 11778 0 0:01:19 0:00:01 0:01:18 11778bluefish
bluefish’s
bluefishes
catfish
catfish’s
catfishes
codfish
codfish’s
codfishes
crawfish
crawfish’s
crawfishes
crayfish
crayfish’s
crayfishes
cuttlefish
cuttlefish’s
cuttlefishes
dogfish
dogfish’s
dogfishes
dwarfish
elfish
fish
fish’s
fishbowl
fishbowl’s
fishbowls
fished
fisher
fisher’s
fisheries
fisherman
fisherman’s
fishermen
fishers
fishery
fishery’s
fishes
fishhook
fishhook’s
fishhooks
fishier
fishiest
fishing
fishing’s
fishnet
fishnet’s
fishnets
fishtail
fishtailed
fishtailing
fishtails
fishwife
fishwife’s
fishwives
fishy
flatfish
flatfish’s
flatfishes
goldfish
goldfish’s
goldfishes
jellyfish
jellyfish’s
jellyfishes
kingfisher
kingfisher’s
kingfishers
62 916k 62 575k 0 0 246k 0 0:00:03 0:00:02 0:00:01 596koafish
raffish
sailfish
sailfish’s
sailfishes
selfish
selfishly
selfishness
selfishness’s
shellfish
shellfish’s
shellfishes
silverfish
silverfish’s
silverfishes
standoffish
starfish
starfish’s
starfishes
sunfish
sunfish’s
sunfishes
swordfish
swordfish’s
swordfishes
unselfish
unselfishly
unselfishness
unselfishness’s
weakfish
weakfish’s
weakfishes
whitefish
whitefish’s
whitefishes
wolfish
100 916k 100 916k 0 0 341k 0 0:00:02 0:00:02 –:–:– 694k

$ numers='one two three'
$ echo $numers
one two three

$ echo $LINES x $COLUMNS
24 x 80
$ echo $PATH
$ ls bin
http://bashrcgenerator.com

$ alias ll=’ls -la’
$ ll

The Bash Academy
Bash Beginners Guide
Bash Programming HOWTO
Regexr — Learn Regular Expressions

Cat

cat -> catenate, Concatenate
$ cat dictionary.txt

rm -> remove
$ rm SillyFile.txt
$ rm -i ValuableFile.txt

$ rm -i google.html
rm: remove regular file 'google.html'? y

$ rmdir hogehoge

$ grep shell dictionary.txt
bombshell
bombshell’s
bombshells
bushelled
bushelling
cockleshell
cockleshell’s
cockleshells
eggshell
eggshell’s
eggshells
nutshell
nutshell’s
nutshells
seashell
seashell’s
seashells
shell
shell’s
shellac
shellac’s
shellacked
shellacking
shellacs
shelled
sheller
shellfish
shellfish’s
shellfishes
shelling
shells
tortoiseshell
tortoiseshell’s
tortoiseshells

curl

curl -> C URL -> see URL

$ curl 'http://google.com'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   259  100   259    0     0   1106      0 --:--:-- --:--:-- --:--:--  2072
302 Moved

302 Moved

The document has moved here.
$ curl -o google.html -L 'http://google.com'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   261  100   261    0     0   1197      0 --:--:-- --:--:-- --:--:--  1864
100 10726    0 10726    0     0  17612      0 --:--:-- --:--:-- --:--:-- 85808
$ curl -L -o dictionary.txt 'https://tinyurl.com/zeyq9vc'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100  916k  100  916k    0     0   217k      0  0:00:04  0:00:04 --:--:--  598k

Opening Git Bash

$ echo Hello, shello!
Hello, shello!

this is wired, isn’t it?

$ echo Hello, shello!!
echo Hello, shelloecho Hello, shello!
Hello, shelloecho Hello, shello!

improve with single quote

$ echo 'Hello, shello!!'
Hello, shello!!

ls = list
$ ls
$ ls Downloads

cd = Change Directory
$ cd Downloads
$ cd .. ; ls

pwd = Print Working Directory
“ls .” is just same as “ls”
$ ls .

all of the files matched pdf.
$ ls -l Documents/*.pdf

$ mkdir Documents/Books
$ mv 'Documents/1911 Webster Dictionary.epub' Documents/Books/
$ mv Documents/*.epub Documents/Books

Unix shell

> echo "Hello, $LOGNAME"
Hello, Karl
> git clone https://github.com/*

Needs to remember the words like below
less, ls, pwd, mkdir, cat, curl, echo, git

console.log("hello!");
hello!

bash

Research

Brain Storm -> Create a Skelelon UI -> Research APIs and Libraries
Choose an Idea -> Create a paper prototype -> get user feedback -> Build APP

Developing nice graphic design
Building the user interface with UIKit
Downloading data from an API
Persisting the data
Working through problems and bug to get the app working well.
Posting the app to the App Store

-Create a Paper Prototype

Default Befaviors

Street Names
isStreetNamesEnabled()
setStreetNamesEnabled(boolean)
Zoom Gestures
isZoomGesturesEnabled
setZoomGesturesEnabled(boolean)
User Navigation
isUserNavigationEnabled
setUserNavigationEnabled(boolean)

@Override
public void onStreetViewPanoramaReady(StreetViewPanorama panorama){

	panorama.setPosition(new LatLng(37.400546,-112.108668));
	panorama.setStreetNamesEnabled(false);
	StreetViewPanoramaCamera camera = new StreetViewPanoramaCamera.Builder()
		.bearing(180)
		.build();
	panorama.animateTo(camera,1000);
}

User Interaction
Detect Camera Changes
setOnStreetViewPanoramaCameraChangeList
Detect User Touches on Panorama
setOnStreetViewPanoramaClickListener
Detect Changes to the Panorama
setOnStreetViewPanoramaChangeListener