Windows uses paging or segmentation??
Results 1 to 7 of 7

Thread: Windows uses paging or segmentation??

  1. #1
    Member
    Join Date
    Sep 2003
    Posts
    76

    Windows uses paging or segmentation??

    Well the subject basically says it all. While in my OS class we've been discussing memory management and of course with this comes the discussion of paging and segmentation. My question is, what kind of memory managemente does Windows use. I believe in the case of Linux segmentation is used and paging of them is made if they get too big. But what about windows??? Does anyone know?? I searched the Microsoft page and besides descriptions of the terms and one sentence that said that earlier versions of windows used segmentation. Nothing solid has appared as to how things work now.
    I Speak in frequencies even dogs have trouble hearing


  2. #2
    Senior Member
    Join Date
    Jun 2002
    Posts
    394
    http://williamstallings.com/

    check out this link. in particular the links for the book called Operating Systems fifth edition.
    Hmm...theres something a little peculiar here. Oh i see what it is! the sentence is talking about itself! do you see that? what do you mean? sentences can\'t talk! No, but they REFER to things, and this one refers directly-unambigeously-unmistakably-to the very sentence which it is!

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Posts
    557
    Hi

    Q-bel, to be honest, your question confuses me a bit.


    paging vs segmentation?


    On one hand, you talk about paging (swapping), which
    is used in a virtual memory environment to name to process
    of transferring data from physical memory to a storage
    device (harddisk). If some memory is addressed, paging makes
    sure that this memory is available.

    On the other hand, you talk about segmentation (segmented
    addressing?), which can be on top of virtual memory management,
    but also just refers to physical memory, where each segment
    has a base address and a certain size.

    Please elaborate your question a little bit.


    and windows 16bit vs 32bit


    Anyway: In older application (16bit) addressing was a problem and
    one had to fight with it, because each segment had a maximum of
    65536 bytes. Nowadays, with 32bit addressing, each segment can have
    4Gb. This results in the fact, that Win32 only changes segments,
    when it transitions between ring 0 and ring 3. Have a look at a
    read to the 10year-anniversary[1] for details.

    Cheers.

    [1] http://msdn.microsoft.com/msdnmag/issues/0700/hood/
    If the only tool you have is a hammer, you tend to see every problem as a nail.
    (Abraham Maslow, Psychologist, 1908-70)

  4. #4
    Member
    Join Date
    Sep 2003
    Posts
    76
    Okay, when talking about the virtual memory concept yes paging is used, in my book the first approach to the theme is with and example where you have the whole program of course in the disk but then bring processes into main memor ( main mem is smaller than the memory needed by the program) and then starts talking about the approaches as to which processes to choose, how to choose them etc etc. Segmentation (as explained in my book ) is presented as another alternative to paging. What you do here is just divide your main memory into segments (say maybe a stack segment, a code segment etc etc. ). This sort of assumes that you have a big enough physical memory. Obviously if this segments get too big you would have to use paging to manage them.
    So basically these two things have something to do with each other but are not different approaches to do the same thing. Howeeeeeeeever, I saw some of the professors old exams which he posts in his page and in one of his questions he asks


    Why does linux use paging only and disregard segmentation. whereas MSWindows uses both????


    This is were I got confused, what does he really meant??? And that is why I wanted to know if Windows used segmentation and paging or just paging. Also in this question he says linux disregards segmentation but I thought that it didnt.

    Well I hope I explained myself better
    I Speak in frequencies even dogs have trouble hearing


  5. #5
    Senior Member
    Join Date
    Mar 2004
    Posts
    557
    Hi

    I guess I mixed up two concepts, so I did some reading. Always good to learn
    something new:


    There are two general concepts of memory protection[1] -
    segmentation and/or paging.

    While linux uses paging only[2], Windows uses both protection
    methods[3]. However, paging has the advantage over segmentation,
    that it makes it easier to allocate new memory for the process.

    [1]
    If both paging and segmentation are used at the same time, as in the IA-32 architecture,
    paging does not map into physical memory at once, but goes through a linear memory
    stage first. Linear memory is the memory as seen solely by the processors segmentation
    circuitry, or as if the pages were turned off but the segmentation was still active.
    Finally[4], another difference in memory management: Windows NT 5.0 and its successors
    use clustered paging, a working set memory analogue and a free memory manager that
    fires up exactly once per second, while Unix uses an adaptive page specific algorithm --
    often least-recently used -- to control paging. In Unix, there is no working set equivalent,
    and the free memory manager runs when needed.

    Happy reading

    Cheers

    [1] http://www.answers.com/topic/memory-protection
    [2] http://www.linux.com/howtos/KernelAn...-HOWTO-5.shtml
    [3] http://www.windowsitlibrary.com/Content/356/04/1.html
    [4] http://www.linuxinsider.com/story/33089.html
    If the only tool you have is a hammer, you tend to see every problem as a nail.
    (Abraham Maslow, Psychologist, 1908-70)

  6. #6
    Senior Member
    Join Date
    Apr 2004
    Posts
    1,130
    On one hand, you talk about paging (swapping), which
    is used in a virtual memory environment to name to process
    of transferring data from physical memory to a storage
    device (harddisk).
    Altough Intel "O.S.es" mixed up the concepts, paging and swapping are diferent concepts.
    Both transfers "pages" between Main Memory and a storage device.
    However:
    Paging is primarily used as a main memory management purpose; "real memory manager" use the paging idea to keep the processes running smoothly as possible stealing "pages" from one or other process that has more priviledge, "need" or other management schema
    Swapping is used as process management purpose; process will be swapped, that means, one process will be taken out of the main memory to allow another one take in.
    As far i know, paging is newer than swapping (yeap, im old) technic. Paging schema needs virtual memory support (page/segment tables, MMU, etc). Swapping does not.
    Meu sítio

    FORMAT C: Yes ...Yes??? ...Nooooo!!! ^C ^C ^C ^C ^C
    If I die before I sleep, I pray the Lord my soul to encrypt.
    If I die before I wake, I pray the Lord my soul to brake.

  7. #7
    Senior Member
    Join Date
    Mar 2004
    Posts
    557
    Hi cacosapo

    Altough Intel "O.S.es" mixed up the concepts
    Well, and me as well Paraphrasing:

    Swapping[1] is process oriented: Swapping allows an OS to run programs simultaneously,
    which memory requirements exceeds the physical memory, by dumping the memory
    dedicated to a specific process to a swap device (typically harddisk). The internal
    structure of the memory is not part of its definition!

    Paging[2] is one way to implement virtual memory, however, paging itself is a general
    algorithm based on dividing the computer memory (real and/or virtual) into smaller pieces,
    typically of size 4-8k, called a page. Paging can be used for physical memory - there is no
    need to invoke virtual memory in the discussion in principle.

    Finalising: An OS realises that process A uses a lot of physical memory, although
    it is currently not "active". Therefore, in order to allow other processes to run more
    smoothly, it decides to swap the memory dedicated to process A onto a storage
    device, away from the physical memory. This swapping can be performed easily if
    the memory is managed by a paging algorithm. The dedicated memory region consists
    of pages: By storing these pages to disk, other pages get access to the physical
    memory. I think, this clearly separates the three issues swapping, paging and
    virtual memory. Now, it only has to be correct.

    Cheers.

    [1] http://en.wikipedia.org/wiki/Disk_swapping
    [2] http://en.wikipedia.org/wiki/Paging
    If the only tool you have is a hammer, you tend to see every problem as a nail.
    (Abraham Maslow, Psychologist, 1908-70)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •