Comunidad Gambas-es
Comunidad hispana de usuarios de GAMBAS
Home
•
Forum
•
FAQ
•
Search
•
Recent Topics
•
Memberlist
•
Register
•
Log in
Forum
»
Linux
»
Programación en otros lenguajes
»
Shell Scripting
Extraer Informacion Del Sistema Desde La Terminal
Reply to topic
Goto page
Previous
1
,
2
vuott
Quote
Posts: 2086
Saturday, 30 January 2016, 00:19
Subject: 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.
Profile
PM
vuott
Quote
Posts: 2086
Saturday, 30 January 2016, 02:05
Subject: Re: Extraer Informacion Del Sistema Desde La Terminal
tincho......usando las funciones externas de SDL2:
Código: [
Descargar
] [
Ocultar
] [
Seleccionar
]
Código: [
Descargar
] [
Mostrar
]
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
Last edited by
vuott
on Saturday, 30 January 2016, 02:10; edited 3 times in total
Profile
PM
jousseph
Quote
Posts: 434 Location: Tachira
Saturday, 30 January 2016, 22:05
Subject: 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.
Profile
PM
YIM
MSN
vuott
Quote
Posts: 2086
Sunday, 31 January 2016, 20:15
Subject: 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
:
Código: [
Descargar
] [
Ocultar
] [
Seleccionar
]
Código: [
Descargar
] [
Mostrar
]
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
Last edited by
vuott
on Sunday, 31 January 2016, 20:17; edited 2 times in total
Profile
PM
Reply to topic
Goto page
Previous
1
,
2
Page
2
of
2
Forum
|
|--Gambas
| |--General
| |--Instalación
| |--Bases de Datos
| |--Controles/Librerías/Componentes
| |--Aplicaciones/Fragmentos de Código
| | |--Retos de programación
| |
| |--Proyecto gauchoCAD
|
|--Linux
| |--Mundo Linux
| |--Hardware
| |--Programación en otros lenguajes
| |--Shell Scripting
| |--Python
| |--C/C++
| |--PHP
| |--HTML y CSS
| |--Javascript
| |--Java
|
|--Otros
|--Sobre Gambas-es
|--Videotutoriales
|--Off-topic
You
cannot
post new topics
You
cannot
reply to topics
You
cannot
edit your posts
You
cannot
delete your posts
You
cannot
vote in polls
You
cannot
attach files
You
can
download files
You
cannot
post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by
Icy Phoenix
based on
phpBB
Design by
DiDiDaDo
Generation Time:
0.1029s
(PHP: -2% SQL: 102%)
SQL queries: 25 - Debug Off - GZIP Enabled