Discussion:
Still confused with INIT_PAGING
(too old to reply)
John Kim
2005-04-01 02:20:45 UTC
Permalink
Hey Guys,

I know this was a
post from before,
but I'm still not
sure what
Init_Paging (in
paging.c) is for.
There is absolutely
no description in
the project website
or the powerpoint
slides. The
description on top
of the function is
not that helpful at
all. Please help
(Iulian especially
=)).

-John
Iulian Neamtiu
2005-04-01 04:55:47 UTC
Permalink
You need to initialize the infrastructure for managing space on the paging
device. You'll see the paging device conceptually split into PAGE_SIZE
chunks (or SECTORS_PER_PAGE sectors), and whenever you need to evict pages
you'll write them to the
paging device. Similarly, when you need to bring a page into memory, you
need to retrieve it from the paging device. 'pageBaseAddr' in the page
table
entry will tell you the block address of the page on the paging device.
(See section 'Paging out pages' in the project description).

You can use a bit map or a linked list for managing chunks on the paging
device. Either way, in Init_Paging you need to find out the size of the
paging device (use Get_Paging_Device ()) and set up your infrastructure
accordingly. Look at how free pages are managed in mem.c
(grep for s_freeList) and you probably want to use smth. similar.

Iulian
Post by John Kim
Hey Guys,
I know this was a
post from before,
but I'm still not
sure what
Init_Paging (in
paging.c) is for.
There is absolutely
no description in
the project website
or the powerpoint
slides. The
description on top
of the function is
not that helpful at
all. Please help
(Iulian especially
=)).
-John
c***@CSIC.UMD.EDU
2005-04-08 05:28:38 UTC
Permalink
Post by Iulian Neamtiu
You can use a bit map or a linked list for managing chunks on the paging
device. Either way, in Init_Paging you need to find out the size of the
paging device (use Get_Paging_Device ()) and set up your infrastructure
accordingly. Look at how free pages are managed in mem.c
(grep for s_freeList) and you probably want to use smth. similar.
Iulian
So Init_Paging essentially the same idea as the Init_Pagefile suggested by the
"Paging Out Pages" section? So are we able to move the Init_Paging call from the
Mount_Root_Filesystem function in main.c to the main function?

Loading...