# HG changeset patch # User shivanidubey # Date 1561349155 -32400 # Node ID 623da64aac7a1217d3e3e3fd4637109d27eb3176 # Parent 54dd75a92d0447fc286ba63cfdee0fd9e67037c7 Internship_presentation diff -r 54dd75a92d04 -r 623da64aac7a slide.html --- a/slide.html Sat Jun 22 12:32:52 2019 +0900 +++ b/slide.html Mon Jun 24 13:05:55 2019 +0900 @@ -78,7 +78,7 @@
Backbone of computer system
+Every computer system has an operating system, which manages the resources of the computer.
+IoT or IT Services can’t work well without resource managements.
Manages the computer’s memory and processes, as well as all of its software and hardware.
+To handle it, we have to understand the API of OS.
+To understand the API, it is better to see the implementations.
+For example, API for tuning priorities of the processes.
Docker
+A Unix-like operating system developed in MIT, based on V6 kernel
+xv6 is written in ANSI C ( not in C++ )
xv6
+xv6 is small and simple (9628 lines of codes)
+It can run on Raspberry Pi ( Small PC board )
+Or on ARM emulator such as QEMU
What is Docker?
+ + +What is xv6?
+A Unix-like operating system developed in MIT.
+QEMU emulates ARM CPU with virtual memory
+Xv6 operating sytem itself is running on QEMU
xv6 is modern reimplementation of Sixth Edition Unix in ANSI C.
+gdb debugger can be attached to the emulated program (both in user space and system space)
+We can step and trace inside xv6 kernel
+ +... but it requires complex development environments setup
+... very time consuming
+
emacs editor (amidst the editor war between vi and emacs!)
-homebrew (it simplifies installation of software in macOS)
Mercurial repository of the lab where we saved everything using ssh
Cross Compilers
+ARM libraries for C language
+QEMU (ARM Emulator)
+What is Docker? It is a container.
+What is Container? An isolated envirornment such as file system.
+It has DockerFile, which describes how to setup the envrionment in the container.
+Docker can run on any computer using an emulator such as QEMU.
+Complex development environment can be build using DockerFile and docker built command.
+Features of Docker:
+FROM phitek/qemu-arm
+RUN apt-get update -y
+RUN apt-get remove gdb -y
+RUN apt-get install gcc-arm-none-eabi gdb-arm-none-eabi qemu-system-arm -y
+WORKDIR /code
+COPY ["src", "."]
+RUN make
+CMD /bin/bash
+
Easy and Faster Configuration
-Increases productivity
+FROM line specifies the shared image in Docker repository.
Application Isolation
+apt-get installs Linux cross compiling tools.
Services
-Security Management
+Then it creates working directory, copies our sources to it, and executes make.
It gives a good insight into Command Line Interface of Unix OS
+Create docker image and environment, and build xv6 kernel
+ +docker build –tag xv6-docker
xv6 is modern reimplementation of Sixth Edition Unix in ANSI C
+Run xv6 kernel on QEMU in the container
+ +docker run –rm –privileged -it xv6-docker ./run-debug.sh
+Run gdb to connect the xv6 kernel running in the QEMU
+ +docker exec -it xv6-docker ./debug.sh
Added getpriority() and setpriority() and get_highest_priority() functions in proc.c file of xv6
+Added getpriority() and setpriority()
+get_highest_priority() functions in proc.c file of xv6
+Implemented it in schelduler()
Added a test function testpriority() in usertests.c file of xv6 to implement our algorithm
@@ -226,30 +301,37 @@int get_highest_priority_proc(void)
{
int highest_priority;
int pid = 0;
int hpid = -1;
int rpid = 0;
-
highest_priority=100;
- struct proc *p;
+
+ struct proc *p;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++, pid++){
if(p->state != RUNNABLE) {
- continue;
- }
+ continue; }
rpid = pid;
if (highest_priority > p->priority) {
highest_priority=p->priority;
- hpid = pid;
- }
- }
+ hpid = pid; } }
return hpid > 0?hpid:rpid;
}
+It assumes at least one process to be RUNNABLE.
+It may allow no highest priority process.
+The correctness of the function is important.
+Mutliple images present in repository due to form command.
- -If repository breaks, Docker poses problem
+If repository breaks, Docker poses a problem (a cloud problem).
+Cloud may be used conveniently but we must not rely on it.
+We can use a direct environment without Docker, since we have a Linux server.
+Docker images can easily eat up our disk spaces.
+What can be done?
+in ~/.zsh_history
-We can keep track of images of Docker
- +: 1561014922:0;docker system prune
+: 1561014973:0;docker container prune
+: 1561015350:0;docker image prune
+: 1561015362:0;docker volume prune
+
Docker environment poses some problems, some of which are difficult to comprehend
+Docker environment poses some problems, some of which are difficult to comprehend.
Storage is difficult too
-Yet, it gives a good insight of the underlying important concepts of operating system beacuse it is well documented, fast and uses less resources
+Yet, it gives a good insight of the underlying important concepts of operating system because it is well documented, fast and uses less resources.
Backbone of computer system
+Every computer system has an operating system, which manages the resources of the computer.
+IoT or IT Services can’t work well without resource managements.
Manages the computer’s memory and processes, as well as all of its software and hardware.
+To handle it, we have to understand the API of OS.
+To understand the API, it is better to see the implementations.
+For example, API for tuning priorities of the processes.
Docker
+A Unix-like operating system developed in MIT, based on V6 kernel
+xv6 is written in ANSI C ( not in C++ )
xv6
+xv6 is small and simple (9628 lines of codes)
+It can run on Raspberry Pi ( Small PC board )
+Or on ARM emulator such as QEMU
What is Docker?
+ + +What is xv6?
+A Unix-like operating system developed in MIT.
+QEMU emulates ARM CPU with virtual memory
+Xv6 operating sytem itself is running on QEMU
xv6 is modern reimplementation of Sixth Edition Unix in ANSI C.
+gdb debugger can be attached to the emulated program (both in user space and system space)
+We can step and trace inside xv6 kernel
+ +... but it requires complex development environments setup
+... very time consuming
+
emacs editor (amidst the editor war between vi and emacs!)
-homebrew (it simplifies installation of software in macOS)
Mercurial repository of the lab where we saved everything using ssh
Cross Compilers
+ARM libraries for C language
+QEMU (ARM Emulator)
+What is Docker? It is a container.
+What is Container? An isolated envirornment such as file system.
+It has DockerFile, which describes how to setup the envrionment in the container.
+Docker can run on any computer using an emulator such as QEMU.
+Complex development environment can be build using DockerFile and docker built command.
+Features of Docker:
+FROM phitek/qemu-arm
+RUN apt-get update -y
+RUN apt-get remove gdb -y
+RUN apt-get install gcc-arm-none-eabi gdb-arm-none-eabi qemu-system-arm -y
+WORKDIR /code
+COPY ["src", "."]
+RUN make
+CMD /bin/bash
+
Easy and Faster Configuration
-Increases productivity
+FROM line specifies the shared image in Docker repository.
Application Isolation
+apt-get installs Linux cross compiling tools.
Services
-Security Management
+Then it creates working directory, copies our sources to it, and executes make.
It gives a good insight into Command Line Interface of Unix OS
+Create docker image and environment, and build xv6 kernel
+ +docker build –tag xv6-docker
xv6 is modern reimplementation of Sixth Edition Unix in ANSI C
+Run xv6 kernel on QEMU in the container
+ +docker run –rm –privileged -it xv6-docker ./run-debug.sh
+Run gdb to connect the xv6 kernel running in the QEMU
+ +docker exec -it xv6-docker ./debug.sh
Added getpriority() and setpriority() and get_highest_priority() functions in proc.c file of xv6
+Added getpriority() and setpriority()
+get_highest_priority() functions in proc.c file of xv6
+Implemented it in schelduler()
Added a test function testpriority() in usertests.c file of xv6 to implement our algorithm
@@ -210,30 +285,37 @@int get_highest_priority_proc(void)
{
int highest_priority;
int pid = 0;
int hpid = -1;
int rpid = 0;
-
highest_priority=100;
- struct proc *p;
+
+ struct proc *p;
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++, pid++){
if(p->state != RUNNABLE) {
- continue;
- }
+ continue; }
rpid = pid;
if (highest_priority > p->priority) {
highest_priority=p->priority;
- hpid = pid;
- }
- }
+ hpid = pid; } }
return hpid > 0?hpid:rpid;
}
+It assumes at least one process to be RUNNABLE.
+It may allow no highest priority process.
+The correctness of the function is important.
+Mutliple images present in repository due to form command.
- -If repository breaks, Docker poses problem
+If repository breaks, Docker poses a problem (a cloud problem).
+Cloud may be used conveniently but we must not rely on it.
+We can use a direct environment without Docker, since we have a Linux server.
+Docker images can easily eat up our disk spaces.
+What can be done?
+in ~/.zsh_history
-We can keep track of images of Docker
- +: 1561014922:0;docker system prune
+: 1561014973:0;docker container prune
+: 1561015350:0;docker image prune
+: 1561015362:0;docker volume prune
+
Docker environment poses some problems, some of which are difficult to comprehend
+Docker environment poses some problems, some of which are difficult to comprehend.
Storage is difficult too
-Yet, it gives a good insight of the underlying important concepts of operating system beacuse it is well documented, fast and uses less resources
+Yet, it gives a good insight of the underlying important concepts of operating system because it is well documented, fast and uses less resources.