• C 86.3%
  • Assembly 3.7%
  • Makefile 3.3%
  • Shell 2.3%
  • Perl 2%
  • Other 2.4%
Find a file
2019-11-07 23:13:35 +05:30
.cvsignore update .cvsignore 2008-10-15 04:54:24 +00:00
.dir-locals.el Setting indent-tabs-mode nil everywhere is dangerous 2011-09-05 15:22:16 -04:00
.gdbinit.tmpl Use the symbol file 2009-09-20 23:08:36 -04:00
.gitignore Sync up clean and gitignore better 2011-09-05 15:21:40 -04:00
asm.h Remove unused flags (thanks Wolfgang Keller) 2018-08-30 13:14:01 -04:00
bio.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
bootasm.S nits 2016-08-10 12:06:02 -04:00
bootmain.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
buf.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
BUGS sh 2007-09-05 15:55:43 +00:00
cat.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
console.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
cuth delete unnecessary #include lines 2007-08-27 23:26:33 +00:00
date.h Add include guards to header files 2019-10-28 20:53:43 +05:30
defs.h Add include guards to header files 2019-10-28 20:53:43 +05:30
dot-bochsrc make bochsrc work for bochs 2.2.6 2008-09-03 14:10:47 +00:00
echo.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
elf.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
entry.S even more explicit that entry.S is linked into kernel, unlike bootasm.S. 2016-08-10 11:22:36 -04:00
entryother.S nits 2016-08-10 12:06:02 -04:00
exec.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
fcntl.h nit 2007-08-28 04:13:24 +00:00
file.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
file.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
forktest.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
fs.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
fs.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
gdbutil GDB utilities 2009-11-23 17:47:57 -05:00
grep.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
ide.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
init.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
initcode.S nothing much 2016-08-11 15:41:53 -04:00
ioapic.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
kalloc.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
kbd.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
kbd.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
kernel.ld Nuke data.S, since we do have a custom linker script. 2011-09-02 14:51:55 -04:00
kill.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
lapic.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
LICENSE x 2018-08-30 16:20:16 -04:00
ln.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
log.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
ls.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
main.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
Makefile Add priority scheduler 2019-11-07 01:48:25 +05:30
memide.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
memlayout.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
mkdir.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
mkfs.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
mmu.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
mp.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
mp.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
new_sys.txt Implement waitx and getpinfo system calls 2019-11-04 21:33:53 +05:30
Notes nit in console interrupts 2006-09-07 00:00:33 +00:00
param.h check blockno passed to idestart 2015-04-10 07:15:06 -04:00
picirq.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
pinfo.c Final commit 2019-11-07 23:13:35 +05:30
pipe.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
pr.pl remove //DOC in the right place 2009-07-12 19:07:30 -07:00
printf.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
printpcs Various fixes and improvements to printpcs 2012-08-24 14:51:52 -04:00
proc.c Final commit 2019-11-07 23:13:35 +05:30
proc.h Add MLFQ scheduler 2019-11-07 11:49:03 +05:30
README Mention we switched to xv6 on RISC-V 2019-09-24 14:45:16 -04:00
README.md Final commit 2019-11-07 23:13:35 +05:30
report.md Final commit 2019-11-07 23:13:35 +05:30
rm.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
runoff Delete a patch 2018-08-30 15:45:16 -04:00
runoff.list thanks mtasm 2018-08-30 14:10:27 -04:00
runoff.spec Nice layout for a printout of the code 2014-08-29 17:06:49 -04:00
runoff1 xv6: formatting, cleanup, rev5 (take 2) 2011-02-19 21:17:55 -05:00
sh.c Final commit 2019-11-07 23:13:35 +05:30
show1 PDF at http://am.lcs.mit.edu/~rsc/xv6.pdf 2007-08-22 06:01:32 +00:00
shutdown.c Implement shutdown user commmand 2019-10-28 20:54:04 +05:30
sign.pl spacing fixes: no tabs, 2-space indents (for rtm) 2006-09-06 17:04:06 +00:00
sleep1.p Model verifying that wakeup really 2007-10-12 04:21:04 +00:00
sleeplock.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
sleeplock.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
spinlock.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
spinlock.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
spinp Model verifying that wakeup really 2007-10-12 04:21:04 +00:00
stat.h Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
stressfs.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
string.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
swtch.S thanks wxdao 2018-08-30 13:48:47 -04:00
syscall.c Add MLFQ scheduler 2019-11-07 11:49:03 +05:30
syscall.h Add priority scheduler 2019-11-07 01:48:25 +05:30
sysfile.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
sysproc.c Add MLFQ scheduler 2019-11-07 11:49:03 +05:30
tags Implement RR for last level of MLFQ 2019-11-07 20:49:58 +05:30
test.c Final commit 2019-11-07 23:13:35 +05:30
time.c Final commit 2019-11-07 23:13:35 +05:30
toc.ftr Update index example in TOC footer 2011-09-02 16:30:20 -04:00
toc.hdr nits 2007-08-28 18:23:48 +00:00
trap.c Final commit 2019-11-07 23:13:35 +05:30
trapasm.S Update comment to reflect xv6 doesn't have per-cpu segments anymore 2017-08-09 15:21:42 -04:00
traps.h kill TLB shoot down code 2010-07-28 14:38:05 -04:00
TRICKS use acquire/release to force order for pid=np->pid;np->state=RUNNING 2014-08-04 06:13:49 -04:00
types.h some cleanup 2010-07-25 20:30:21 -04:00
uart.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
ulib.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
umalloc.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
user.h Add priority scheduler 2019-11-07 01:48:25 +05:30
usertests.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
usys.S Add priority scheduler 2019-11-07 01:48:25 +05:30
vectors.pl sync with c; .text is implied 2009-05-31 01:00:38 +00:00
vm.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
wc.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30
x86.h Remove trailing white space with: 2016-08-25 09:13:00 -04:00
zombie.c Run clang-format and add header guards 2019-10-31 02:07:39 +05:30

OS Assignment 5 - 2019121007

waitx

to implement waitx 3 fields ctime, rtime and etime are added in the proc structure.

  • ctime is set during fork
  • rtime is updated every time the clock timer interrupt is raised
  • etime is set during exit

using these fields the running and waiting time of the process is calculated.

getpinfo

to implement getpinfo, a struct proc_stat is declared to store the results of the syscall.

the syscall simply copies all information from the proc struction to the proc_stat and returns it.

FCFS

fcfs is implemented as follows:

  • the first runnable process is executed
  • pre-emption is disabled (the process does not yield on clock tick)

PBS is implemented as followes:

  • a field priority is defined in the proc stat
  • a system call is defined to allow changing the priority
  • the scheduler chooses the process with highest priority for execution
  • the process is pre-empted after one tick

MLFQ:

  • the proc stat is modified to add a current_queue field for each process.
  • additionally, the proc stat contains a allocated field which indicates the time quantum allocated to each process
  • the scheduler selects the process from the highest available queue and allocates it a time quantum (2 ^ lvl)
  • when a clock tick occurs, we decrement the allocated field; if it becomes equal to 0, we pre-empt
  • in case we start executing in the lowest priority queue, we finish all processes in the queue before returning to higher priority queues