Studying Operating System Using Docker Platform

Shivani Dubey Madan Mohan Malaviya University of Technology, Gorakhpur

Why do we study Operating System?

Xv6 Operating System as an educational tool

Xv6 development environment with QEMU

Our development environments

Introducing Docker

The DockerFile

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

Docker commands

Exercise : Adding priorities to the xv6 scheduler

Function used in our exercise to find highest priority process

int get_highest_priority_proc(void)
{
  int highest_priority;
  int pid = 0;
  int hpid = -1;
  int rpid = 0;
  highest_priority=100;
 
 struct proc *p;
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++, pid++){
    if(p->state != RUNNABLE) {
      continue;    }
    rpid = pid;
    if (highest_priority > p->priority) {
       highest_priority=p->priority;
       hpid = pid; } }
  return hpid > 0?hpid:rpid;
}

Docker Limitation

in ~/.zsh_history

: 1561014922:0;docker system prune
: 1561014973:0;docker container prune
: 1561015350:0;docker image prune
: 1561015362:0;docker volume prune

Conclusion