Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda