Allocate a large amount of continuous memory when Linux is started

Source: Internet
Author: User
During Linux boot, a large amount of continuous memory is allocated-Linux general technology-Linux programming and kernel information. The following is a detailed description. I mentioned in LDD that there are several ways to obtain a large number of continuous memories.

1) set parameter Line parameter mem = XXM

2) keep the memory at startup

The first method was used before, but the boot loader should be used together.

In this experiment, the second method is used.

The prototype and header are as follows:

# Include linux/bootmem. h
Void * alloc_bootmem (unsigned long size );
Void * alloc_bootmem_low (unsigned long size );
Void * alloc_bootmem_pages (unsigned long size );
Void * alloc_bootmem_low_pages (unsigned long size );

Steps:

1) Modify init/main. c and find the start_kernel Function

2) After setup_arch (...), add the program code alloc_bootmem_XX

3) output the obtained indicator export.

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.