Portal    Foro    Buscar    FAQ    Registrarse    Conectarse

Extraer Informacion Del Sistema Desde La Terminal

Extraer Informacion Del Sistema Desde La Terminal
Artículo
Responder citando    Descargar mensaje  
Mensaje Re: Extraer Informacion Del Sistema Desde La Terminal 
 
tincho escribió:  
anche tutte le lingue latine sono un piacere di leggere!

tincho, sono perfettamente d'accordo con te: le lingue neo-latine sono le più belle.    



 
vuott - Ver perfil del usuario Enviar mensaje privado  
vuott [ Sabado, 30 Enero 2016, 00:19 ]
 


Extraer Informacion Del Sistema Desde La Terminal
Comentarios
Responder citando    Descargar mensaje  
Mensaje Re: Extraer Informacion Del Sistema Desde La Terminal 
 
tincho......usando las funciones externas de SDL2:    

Library "libSDL2-2.0:0.2.0"

' int SDL_GetCPUCacheLineSize(void)
' Returns the L1 cache line size of the CPU, in kilobytes.
Private Extern SDL_GetCPUCacheLineSize() As Integer

' int SDL_GetCPUCount(void)
' Returns the total number of logical CPU cores.
Private Extern SDL_GetCPUCount() As Integer

' int SDL_GetSystemRAM(void)
' Returns the amount of RAM configured in the system in MB.
Private Extern SDL_GetSystemRAM() As Integer

' SDL_bool SDL_Has3DNow(void)
' Determines whether the CPU has 3DNow! features.
Private Extern SDL_Has3DNow() As Boolean

' SDL_bool SDL_HasAVX(void)
' Determines whether the CPU has AVX features.
Private Extern SDL_HasAVX() As Boolean

' SDL_bool SDL_HasAltiVec(void)
' Determines whether the CPU has AltiVec features.
Private Extern SDL_HasAltiVec() As Boolean

' SDL_bool SDL_HasMMX(void)
' Determines whether the CPU has MMX features.
Private Extern SDL_HasMMX() As Boolean

' SDL_bool SDL_HasRDTSC(void)
' Determines whether the CPU has RDTSC instruction.
Private Extern SDL_HasRDTSC() As Boolean

' SDL_bool SDL_HasSSE(void)
' Determines whether the CPU has SSE features.
Private Extern SDL_HasSSE() As Boolean

' SDL_bool SDL_HasSSE2(void)
' Determines whether the CPU has SSE2 features.
Private Extern SDL_HasSSE2() As Boolean

' SDL_bool SDL_HasSSE3(void)
' Determines whether the CPU has SSE3 features.
Private Extern SDL_HasSSE3() As Boolean

' SDL_bool SDL_HasSSE41(void)
' Determines whether the CPU has SSE4.1 features.
Private Extern SDL_HasSSE41() As Boolean

' SDL_bool SDL_HasSSE42(void)
' Determines whether the CPU has SSE4.2 features.
Private Extern SDL_HasSSE42() As Boolean


Public Sub Main()

  Print "L1 cache line:       kb   "; SDL_GetCPUCacheLineSize()
  Print "Num. of CPU cores:         "; SDL_GetCPUCount()
  Print "RAM configured:      Mb "; SDL_GetSystemRAM()
  Print "3DNow! features:        "; CBoolean(SDL_Has3DNow())
  Print "AVX features:           "; CBoolean(SDL_HasAVX())
  Print "AVX2 features:          "; CBoolean(SDL_HasAltiVec())
  Print "MMX features:           "; CBoolean(SDL_HasMMX())
  Print "RDTSC instruction:      "; CBoolean(SDL_HasRDTSC())
  Print "SSE features:           "; CBoolean(SDL_HasSSE())
  Print "SSE2 features:          "; CBoolean(SDL_HasSSE2())
  Print "SSE3 features:          "; CBoolean(SDL_HasSSE3())
  Print "SSE4.1 features:        "; CBoolean(SDL_HasSSE41())
  Print "SSE4.2 features:        "; CBoolean(SDL_HasSSE42())

End


...y otras paginas del wiki italiano que yo ecribí:
http://www.gambas-it.org/wiki/index...I_di_Libcpufreq
http://www.gambas-it.org/wiki/index...sorse_di_Gambas



 
última edición por vuott el Sabado, 30 Enero 2016, 02:10; editado 3 veces 
vuott - Ver perfil del usuario Enviar mensaje privado  
vuott [ Sabado, 30 Enero 2016, 02:05 ]
Responder citando    Descargar mensaje  
Mensaje Re: Extraer Informacion Del Sistema Desde La Terminal 
 
Eso ya esta hecho utilizando los ejemplos de gambas en los ejemplos de consola yo desarrolle una consola que hace todo lo que tu dices.



 
jousseph - Ver perfil del usuario Enviar mensaje privado  
jousseph [ Sabado, 30 Enero 2016, 22:05 ]
Responder citando    Descargar mensaje  
Mensaje Re: Extraer Informacion Del Sistema Desde La Terminal 
 
tincho,
siempre por lo que se refiere a la CPU, puedes usar una función externa del API de libavutil:    

Library "libavutil:52.3.0"

' int av_get_cpu_flags(void)
' Return the flags which specify extensions supported by the CPU.
Private Extern av_get_cpu_flags() As Integer


Public Sub Main()

  Dim i, i2, c As Integer
  Dim b As Byte

  i = av_get_cpu_flags()

  While c < &40000000
    i2 = i And c

    Select Case i2
      Case 1
        Print "standard MMX"
      Case 2
        Print "SSE integer functions or AMD MMX ext"
      Case 4
        Print "AMD 3DNOW"
      Case 8
        Print "SSE functions"
      Case 16
        Print "PIV SSE2 functions"
      Case 32
        Print "AMD 3DNowExt"
      Case 64
        Print "Prescott SSE3 functions"
      Case 128
        Print "Conroe SSSE3 functions"
      Case 256
        Print "Penryn SSE4.1 functions"
      Case 512
        Print "Nehalem SSE4.2 functions"
      Case 1024
        Print "Bulldozer XOP functions"
      Case 2048
        Print "Bulldozer FMA4 functions"
      Case 4096
        Print "i686 cmov"
      Case 16384
        Print "AVX functions"
      Case 268435456
        Print "Atom processor"
      Case 536870912
        Print "SSE3 supported"
      Case 1073741824
        Print "SSE2 supported"
    End Select
    
    c = 2 ^ b
    Inc b
    
  Wend

End




 
última edición por vuott el Domingo, 31 Enero 2016, 20:17; editado 2 veces 
vuott - Ver perfil del usuario Enviar mensaje privado  
vuott [ Domingo, 31 Enero 2016, 20:15 ]
Mostrar mensajes anteriores:    
 
Publicar nuevo tema  Responder al tema  Página 2 de 2
Ir a la página Anterior  1, 2
 

Usuarios navegando en este tema: 0 registrados, 0 ocultos y 1 invitado
Usuarios registrados conectados: Ninguno


 



 

cron