Documentos de Académico
Documentos de Profesional
Documentos de Cultura
COS 318
Fall 2013
Project 5 Schedule
Design Review
+eneral Suggestions
Project is not divided into 'hases, Follow the rough chec-list in the 'roject 5 s'ecs, +et &a%iliar with the 2$level 'age ta.le descri'tion o& i38/, Read section 3,0,1 and *,2 o& the 1ntel %anual, 2oo- at new PC3 structure in kernel.h, 4s alwa!s" start as earl! as !ou can" and get as %uch done as 'ossi.le .! the design review,
Project 5 Overview
1%'le%ent 'age allocation and eviction 'olic!, 1nitiali5e the %e%or! la!out 6-ernel 'ages7, Set u' each 'rocess8 %e%or!, Swa' 'ages in9out o& dis- : de%and 'aging, Page &ault handler, Relevant &iles( memory.h and memory.c #o asse%.l! 'rogra%%ing
Director! <ntries
>a.le <ntries
<ntr! Flags
P( Page9Page ta.le loaded? @9S( @ser access? 0 : no user access R9)( @ser read9write? 0 : user read$onl! 4( 4ccessed? set on swa'$in D( Dirt! 'age? use at swa'$out
De&ine a 'age %a' data structure to trac- all 'ages and their %etadata 6in memory.h7, 1& there is a &ree 'age" si%'l! use it, Otherwise" !ou need to swa' a 'age out, Recall that !ou can pin 'ages : can8t evict these 'agesA Si%'le eviction 'olic!( e,g, F1FO
1nitiali5e Bernel
e%or!
4llocate #CB<R#<2CP>S 6'age ta.les7 For each 'age ta.le" allocate 'ages until !ou reach 4DCPEFS1C42C < ORF, 1%'ortant( 'h!sical address G virtual address, a-e sure to set correct &lagsA +ive the user 'er%ission to use the screen,
e%or!
Page director! Page ta.les Stac- 'age ta.le Stac- 'ages @se one 'age ta.le and allocate all 'ages, #eeds 'c.$Iswa'Csi5e %e%or!, 4llocate #CPROC<SSCS>4CBCP4+<S,
@S3 dis- i%age &or swa' storage, Swa' in &or allocation" swa' out &or eviction, 4ssu%e that 'rocesses do not change si5e, Processes use whichever location the! were originall! loaded &ro% 6'c.$Iswa'Cloc7, @se usb/scsi.h &or read and write &unctions, Bee' in %ind( )hen do !ou need to &lush the >23?
+et a &ree 'age &ro% the 'age allocator, Swa' in the 'age, @'date the 'age ta.le entr! to the 'age8s address and set the 'resent &lag,
One 'age ta.le is enough &or a 'rocess8 code and data %e%or! s'ace, So%e &unctions 6es'eciall! 'age &ault handler7 can .e interru'tedA
@se a s!nchroni5ation 'ri%itive, Bernel 'ages" 'rocess 'age director!" 'age ta.les" stac- 'age ta.les and stac- 'ages, )ith res'ect to gradingA