linux0.12 kernel memory organization and process structure

Source: Internet
Author: User

Process structure

Each process in the Linux0.12 has the following structure:

    1. < Span style= "Font-family:courier New; Font-size:18px "> occupies two of the GDT, one is the TSS segment descriptor and one is the LDT segment descriptor.

    2. occupies one item in the task array, pointing to a page of physical memory, the low end of the physical memory is the Process Control block Task_struct (which includes the TSS segment and the LDT segment), and the remainder is the process's kernel-state stack.

    3. There are related items set up in the page catalog table and in the page table.

In Linux0.12, there are up to 64 processes, the task array size is also defined as 64, and each process corresponds to item one by one in a task array. Although there are 256 items in the GDT, they are not used. The first GDT item is reserved, the kernel uses 2 items, and the system retains 2 items for each process. Such a process corresponds to 2 GDT item one by one. That is, the assignment of the task array and the GDT in linux0.12 is dead, such as the task array of a process is a NR, i.e. its process control block is pointed by Task[nr], then its TSS descriptor and LDT descriptor are located in Gdtr+3*8+nr*16 and gdtr+3 *8+nr*16+8 Place.

Linux0.12 Memory Physical Address 0 starts with a page of table of contents and a four-page table. This page catalog table is shared by all processes. The subsequent four page table maps the 16M physical memory, which is the page table for the kernel and process 0. The page table needs to be requested from the main memory area at a later time when the process is created, and the page catalog entries are taken directly from the page catalog table. Such processes and page catalogs table pages exist with these one by one correspondence, the task number is the NR process, the corresponding page directory of nr*16~ (nr+1) *16 altogether 16 directory entries. This allows 4G of linear space to be shared by 64 processes, with each process being divided into 64M.

One by one correspondence between three structures



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.