Skip to content

kostis-init/xv6_with_shared_memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

xv6_with_shared_memory

This was an assignment for the class of Operating Systems in DIT @ University of Athens (2017).
  • Modified xv6 kernel adding shared memory & semaphores

Source Code

New files have been added and some existing code has been updated.
  • shmem.c:
    • shared memory implementation
  • sem.c:
    • semaphores implementation
  • proc.c:
    • changed fork to copy the addresses under the KERNBASE memory (copyuvm)
    • changed exit
  • vm.c:
    • changed copyuvm to copy high addresses
    • changed deallocuvm to not kfree a shared page if it is being used from another proccess
    • added some functions for mappages and unmap_addr (via walkpgdir)
  • syscall.c:
    • changed argptr to accept pointers to high addresses (shared memory)
  • sysproc.c:
    • added syscalls (shmget, shmrem, sem_init, sem_up, sem_down)

Build & Run

Check the instructions in the original README.
$ cd ./src/xv6
$ make
$ make qemu-nox

Test

Test xv6 with test.c and test2.c or create new workloads.

Fork

// We are inside QEMU running our kernel
$ test

Multiple processes

// We are inside QEMU running our kernel
$ test2&;test2&;test2&

Exit

Terminate QEMU by pressing Ctrl-A X

About

Modified xv6 OS, added shared memory & semaphores

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published