comparison slide.md~ @ 3:623da64aac7a default tip

Internship_presentation
author shivanidubey
date Mon, 24 Jun 2019 13:05:55 +0900
parents 54dd75a92d04
children
comparison
equal deleted inserted replaced
2:54dd75a92d04 3:623da64aac7a
1 title: Studying Operating System Using Docker Platform 1 title: Studying Operating System Using Docker Platform
2 author: Shivani Dubey 2 author: Shivani Dubey
3 profile: Intern, University of the Ryukyus 3 profile: Madan Mohan Malaviya University of Technology, Gorakhpur
4 4
5 # Why Operating System? 5 ## Why do we study Operating System?
6 6
7 - Backbone of computer system 7 - Every computer system has an operating system, which manages the resources of the computer.
8 8
9 - Manages the computer's memory and processes, as well as all of its software and hardware. 9 - IoT or IT Services can't work well without resource managements.
10 10
11 - To handle it, we have to understand the API of OS.
11 12
12 # Introduction 13 - To understand the API, it is better to see the implementations.
13 14
15 - For example, API for tuning priorities of the processes.
14 16
15 - Docker 17 ## Xv6 Operating System as an educational tool
16 18
17 - xv6 19 - A Unix-like operating system developed in MIT, based on V6 kernel
18 20
19 What is Docker? 21 - xv6 is written in ANSI C ( not in C++ )
20 22
23 - xv6 is small and simple (9628 lines of codes)
21 24
22 - The modern platform for high velocity innovation. 25 - It can run on Raspberry Pi ( Small PC board )
23 - Docker has products that use operating system level virtualization to develop and deliver software in packages called containers.
24 - Docker can run on any computer, on any infrastructure and in any cloud.
25 26
27 - Or on ARM emulator such as QEMU
26 28
27 What is xv6? 29 ## Xv6 development environment with QEMU
28 30
31 - QEMU emulates ARM CPU with virtual memory
29 32
30 - A Unix-like operating system developed in MIT. 33 - Xv6 operating sytem itself is running on QEMU
31 34
32 - xv6 is modern reimplementation of Sixth Edition Unix in ANSI C. 35 - gdb debugger can be attached to the emulated program (both in user space and system space)
33 36
37 - We can step and trace inside xv6 kernel
34 38
35 # What helped us 39 ... but it requires complex development environments setup
40 ... very time consuming
36 41
42 ## Our development environments
37 43
38
39 - emacs editor (amidst the editor war between vi and emacs!)
40 44
41 - homebrew (it simplifies installation of software in macOS) 45 - homebrew (it simplifies installation of software in macOS)
42 46
43 - Mercurial repository of the lab where we saved everything using ssh 47 - Mercurial repository of the lab where we saved everything using ssh
44 48
49 - Cross Compilers
45 50
46 ## Why Docker? 51 - ARM libraries for C language
47 52
53 - QEMU (ARM Emulator)
48 54
55 ## Introducing Docker
49 56
50 Features of Docker: 57 - What is Docker? It is a container.
51 58
59 - What is Container? An isolated envirornment such as file system.
52 60
53 - Easy and Faster Configuration 61 - It has DockerFile, which describes how to setup the envrionment in the container.
54 62
55 - Increases productivity 63 - Docker can run on any computer using an emulator such as QEMU.
56 64
57 - Application Isolation 65 - Complex development environment can be build using DockerFile and docker built command.
58 66
59 - Services 67 # The DockerFile
60 68
61 - Security Management 69 ```
70 FROM phitek/qemu-arm
71 RUN apt-get update -y
72 RUN apt-get remove gdb -y
73 RUN apt-get install gcc-arm-none-eabi gdb-arm-none-eabi qemu-system-arm -y
74 WORKDIR /code
75 COPY ["src", "."]
76 RUN make
77 CMD /bin/bash
78 ```
62 79
80 - FROM line specifies the shared image in Docker repository.
63 81
64 ## Why xv6? 82 - apt-get installs Linux cross compiling tools.
65 83
84 - Then it creates working directory, copies our sources to it, and executes make.
66 85
86 ## Docker commands
67 87
68 - It gives a good insight into Command Line Interface of Unix OS. 88 - Create docker image and environment, and build xv6 kernel
69 89
70 - xv6 is modern reimplementation of Sixth Edition Unix in ANSI C. 90 docker build --tag xv6-docker
71 91
92 - Run xv6 kernel on QEMU in the container
72 93
73 # Scheduling processes by their priorities 94 docker run --rm --privileged -it xv6-docker ./run-debug.sh
95
96 - Run gdb to connect the xv6 kernel running in the QEMU
97
98 docker exec -it xv6-docker ./debug.sh
74 99
75 100
76 101
77 102
78 - Added getpriority() and setpriority() and get_highest_priority() functions in proc.c file of xv6
79 103
80 104 # Exercise : Adding priorities to the xv6 scheduler
105
106 - Added getpriority() and setpriority()
107
108 - get_highest_priority() functions in proc.c file of xv6
109
110 - Implemented it in schelduler()
81 111
82 - Added a test function testpriority() in usertests.c file of xv6 to implement our algorithm 112 - Added a test function testpriority() in usertests.c file of xv6 to implement our algorithm
83
84 113
85 ## The function 114 ## Function used in our exercise to find highest priority process
86
87 ```c 115 ```c
88 int get_highest_priority_proc(void) 116 int get_highest_priority_proc(void)
89 { 117 {
90 int highest_priority; 118 int highest_priority;
91 int pid = 0; 119 int pid = 0;
99 continue; 127 continue;
100 } 128 }
101 rpid = pid; 129 rpid = pid;
102 if (highest_priority > p->priority) { 130 if (highest_priority > p->priority) {
103 highest_priority=p->priority; 131 highest_priority=p->priority;
104 hpid = pid; 132 hpid = pid; }
105 }
106 } 133 }
107 return hpid > 0?hpid:rpid; 134 return hpid > 0?hpid:rpid;
108 } 135 }
109 ``` 136 ```
137 - It assumes at least one process to be RUNNABLE.
110 138
139 - It may allow no highest priority process.
140
141 - The correctness of the function is *important*.
111 142
112 ## Docker Limitation 143 ## Docker Limitation
113 144
114
115 Mutliple images present in repository due to form command.
116 145
117 If repository breaks, Docker poses problem 146 - If repository breaks, Docker poses a problem (a cloud problem).
118 147
148 - Cloud may be used conveniently but we must not rely on it.
119 149
120 What can be done? 150 - We can use a direct environment without Docker, since we have a Linux server.
121 151
152 - Docker images can easily eat up our disk spaces.
122 153
123 We can keep track of images of Docker. 154 in ~/.zsh_history
124 155
156 ```c
157 : 1561014922:0;docker system prune
158 : 1561014973:0;docker container prune
159 : 1561015350:0;docker image prune
160 : 1561015362:0;docker volume prune
161 ```
162 # Conclusion
125 163
126 # Conclusion
127 164
128 - Docker environment poses some problems, some of which are difficult to comprehend. 165 - Docker environment poses some problems, some of which are difficult to comprehend.
129 166
130 167
131 - Storage is difficult
132 168
133 169 - Yet, it gives a good insight of the underlying important concepts of operating system because it is well documented, fast and uses less resources.
134 - Yet, it gives a good insight of the underlying important concepts of operating system beacuse it is well documented, fast and uses less resources.