Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
Determining TASK_SIZE from c Program

TASK_SIZE is a kernel constant that defines the upper limit of the accessible memory for the code working at the lowest privilege level.

Its value is usually set to 0xc0000000 on systems with less than 1GB of physical memory (all examples included in this article refer to this value). The memory above this limit contains the kernel code .

Is there a way to determine the running kernels TASK_SIZE through c program ??

TASK_SIZE

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

After a lot of google search and analysis , i got a logic

Assume net virtual address are 4gb and the it is divided in 1:3 ratio.

Rough assumptions:-

Kernel (upper 1 gb): c0000000 -ffffffff

USer space (below 3gb):0-c0000000

than

   #define GB *1073741824
   unsigned int num;
   unsigned int task_size;
   task_size=(unsigned)&number+ 1 GB / 1 GB * 1GB;

[the process's stack area will be allocated below the kernel space]

so address of num (in stack)= somewhere around in 3 GB range ex:[3214369612]

now adding 1 GB = 1073741824+3214369612=4288111436

dividing by 1GB=3.993614983 that will be 3 (unsigned int)

now multiplying by 1GB = 3 *1073741824 = 3221225472 i.e. (0xC0000000 in hex)

hence i got the kernel starting address (TASK_SIZE)

I tried it assuming (2:6) ratio also and got correct result.

Is this a fair logic ,Please comment ???

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda