Add Experimental decode-dimms as i-nex-dimms

This commit is contained in:
eloaders 2014-08-22 15:26:17 +02:00
parent 83a7d8bc8d
commit f638182842
11 changed files with 2232 additions and 65 deletions

View File

@ -1,5 +1,5 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.5.3
# Compiled with Gambas 3.5.4
Title=I-Nex
Startup=MStart
Icon=logo/i-nex.0.4.x.png

View File

@ -47,7 +47,7 @@ Public Sub Form_Open()
Dim sLine As String
Dim MTRR As New String[]
Logs("Starting log", Logger.Info)
Button4.Visible = False
ComboBox10.Visible = False
Object.Call(MCPUSAGE, "GetUSAGE")
''Okno na środku
''
@ -185,21 +185,21 @@ Public Sub Form_Open()
Try Close #data
If Exist("/proc/mtrr", True) Then
For i = 1 To MaxCount
Label[i] = New Label(ScrollView2)
With Label[i]
.X = 2
.Y = Int(i * 20)
.Width = 440
.Height = 21
.Border = Border.Raised
.Padding = 3
.Font.Size = 8
.Text = MTRR[i - 1]
End With
Next
Endif
' If Exist("/proc/mtrr", True) Then
' For i = 1 To MaxCount
' Label[i] = New Label(ScrollView2)
' With Label[i]
' .X = 2
' .Y = Int(i * 20)
' .Width = 440
' .Height = 21
' .Border = Border.Raised
' .Padding = 3
' .Font.Size = 8
' .Text = MTRR[i - 1]
' End With
' Next
' Endif
'Procesor
Logs("Check available procesors", Logger.Info)
@ -1102,9 +1102,9 @@ TabPanel1_Click()
HBox19.Visible = False
Button8.Visible = False
Button14.Visible = False
Button4.Visible = True
ComboBox10.Visible = True
Else
Button4.Visible = False
ComboBox10.Visible = False
Endif
If TabStrip1.Current.Text Like "*Kernel*" Then
Button6.Visible = True
@ -1233,3 +1233,15 @@ Public Sub Button20_Click()
Disk_Drives._init_2()
End
Public Sub ComboBox10_Click()
Try TextBox31.Text = Replace(MDecode_dimms.MODULE_MANUFACTURER[CFloat(ComboBox10.Index)], "\n", "")
Try TextBox32.Text = Replace(MDecode_dimms.DRAM_MANUFACTURER[CFloat(ComboBox10.Index)], "\n", "")
Try TextBox33.Text = Replace(MDecode_dimms.MODULE_TYPE[CFloat(ComboBox10.Index)], "\n", "")
Try TextBox34.Text = Replace(MDecode_dimms.PART_NUMBER[CFloat(ComboBox10.Index)], "\n", "")
Try TextBox35.Text = Replace(MDecode_dimms.RAM_SIZE[CFloat(ComboBox10.Index)], "\n", "")
Try TextBox36.Text = Replace(MDecode_dimms.tCL_tRCD_tRDP_tRAS[CFloat(ComboBox10.Index)], "\n", "")
Try TextBox37.Text = Replace(MDecode_dimms.SDRAM_DEVICE_TYPE[CFloat(ComboBox10.Index)], "\n", "")
Try TextBox38.Text = Replace(MDecode_dimms.MAX_MODULE_SPEED[CFloat(ComboBox10.Index)], "\n", "")
End

View File

@ -1762,67 +1762,63 @@
Text = "Memory"
Picture = Picture["AppIcons/Finfosys/utilities-system-monitor.png"]
{ ProgressBar1 ProgressBar
Move(0,21,469,21)
Move(119,21,350,21)
}
{ ProgressBar4 ProgressBar
Move(0,63,469,21)
Move(119,63,350,21)
}
{ TextLabel24 TextLabel
Move(0,42,469,21)
Move(119,42,350,21)
Font = Font["Bold,8"]
Padding = 1
Text = ("N/A")
Alignment = Align.Center
Border = Border.Raised
}
{ Separator5 Separator
Move(0,196,469,21)
#Translate = False
}
{ Label176 Label
Move(0,175,343,21)
Move(154,133,315,21)
Font = Font["Bold,8"]
Padding = 3
Text = ("Label176")
Border = Border.Raised
}
{ Label85 Label
Move(0,91,189,21)
Move(0,91,154,21)
Font = Font["Bold,8"]
Expand = True
Padding = 3
Border = Border.Raised
}
{ Label86 Label
Move(0,112,189,21)
Move(308,91,161,21)
Font = Font["Bold,8"]
Expand = True
Padding = 3
Border = Border.Raised
}
{ Label87 Label
Move(0,133,189,21)
Move(154,112,154,21)
Font = Font["Bold,8"]
Expand = True
Padding = 3
Border = Border.Raised
}
{ Label88 Label
Move(0,154,189,21)
Move(308,112,161,21)
Font = Font["Bold,8"]
Expand = True
Padding = 3
Border = Border.Raised
}
{ Label89 Label
Move(189,91,154,21)
Move(154,91,154,21)
Font = Font["Bold,8"]
Expand = True
Padding = 3
Border = Border.Raised
}
{ Label90 Label
Move(189,112,154,21)
Move(0,112,154,21)
Font = Font["Bold,8"]
Expand = True
Padding = 3
@ -1830,45 +1826,65 @@
Border = Border.Raised
}
{ Label91 Label
Move(189,154,154,21)
Move(0,133,154,21)
Font = Font["Bold,8"]
Expand = True
Padding = 3
Border = Border.Raised
}
{ Label223 Label
Move(0,0,469,21)
Move(119,0,350,21)
Font = Font["Bold,8"]
Padding = 3
Text = ("Label223")
Alignment = Align.Center
Border = Border.Raised
}
{ ScrollView2 ScrollView
Move(0,217,469,259)
Font = Font["8"]
}
{ Label227 Label
Move(154,196,168,21)
#Translate = False
Font = Font["Bold,8"]
Text = "MTRR"
Alignment = Align.Center
Transparent = True
}
{ Label74 Label
Move(350,119,112,77)
Move(7,21,105,70)
Font = Font["Bold,20"]
Foreground = &HFF7F00&
Alignment = Align.Center
}
{ Label77 Label
Move(343,91,119,21)
Move(0,0,119,21)
Font = Font["Bold,8"]
Text = ("Processes ↓")
Alignment = Align.Center
Border = Border.Raised
}
{ TextBox31 TextBox
Move(0,154,231,28)
Text = ("TextBox31")
}
{ TextBox32 TextBox
Move(231,154,238,28)
Text = ("TextBox32")
}
{ TextBox33 TextBox
Move(0,182,231,28)
Text = ("TextBox33")
}
{ TextBox34 TextBox
Move(231,182,238,28)
Text = ("TextBox34")
}
{ TextBox35 TextBox
Move(0,210,231,28)
Text = ("TextBox35")
}
{ TextBox36 TextBox
Move(231,210,238,28)
Text = ("TextBox36")
}
{ TextBox37 TextBox
Move(0,238,231,28)
Text = ("TextBox37")
}
{ TextBox38 TextBox
Move(231,238,238,28)
Text = ("TextBox38")
}
Index = 8
Text = "Network"
Picture = Picture["AppIcons/Finfosys/network-wired.png"]
@ -2674,25 +2690,22 @@
Alignment = Align.Center
Border = Border.Plain
}
{ Button4 Button
Move(287,511,126,28)
#Translate = False
Visible = False
Font = Font["Bold,8"]
Text = "Decode DIMMS"
Picture = Picture["AppIcons/gtk-yes.png"]
}
{ Button6 Button
Move(315,511,98,28)
Font = Font["8,Bold"]
Text = ("Show modules")
}
{ MenuButton1 MenuButton
Move(210,511,112,28)
Move(238,511,112,28)
Font = Font["Bold,8"]
Foreground = &H0000FF&
Text = ("Validate")
Picture = Picture["AppIcons/gnome-network-properties.png"]
Menu = "Menu2"
}
{ ComboBox10 ComboBox
Move(315,511,98,28)
ReadOnly = True
Text = ("ComboBox10")
}
}

View File

@ -0,0 +1,78 @@
' Gambas module file
Public NOSDRAMDIMMSDAD As New String[]
Public MODULE_TYPE As New String[]
Public MODULE_MANUFACTURER As New String[]
Public DRAM_MANUFACTURER As New String[]
Public ASM_SERIALNUMBER As New String[]
Public PART_NUMBER As New String[]
Public RAM_SIZE As New String[]
Public MAX_MODULE_SPEED As New String[]
Public FUN_MEM_TYPE As New String[]
Public tCL_tRCD_tRDP_tRAS As New String[]
Public SDRAM_DEVICE_TYPE As New String[]
'DRAM Manufacturer
Public Sub _inits()
Dim DECODE_DIMMS As Stream
Dim sLine As String
Dim sIcon As String
Dim iPos As Integer
Dim Character As Integer
Dim sKey As String
Dim sVal As String
DECODE_DIMMS = Exec ["i-nex-dimms"] For Read
For Each sLine In DECODE_DIMMS.Lines
sLine = Trim(sLine)
If Not sLine Then Continue
iPos = InStr(sLine, ":")
If iPos = 0 Then Continue
sKey = Trim(Left$(sLine, iPos - 1))
sVal = Trim(Mid$(sLine, iPos + 1))
Select Case sKey
Case Like "*Module Manufacturer*"
MODULE_MANUFACTURER.Add(sVal)
Case Like "*DRAM Manufacturer*"
DRAM_MANUFACTURER.Add(sVal)
Case Like "*Assembly Serial Number*"
ASM_SERIALNUMBER.Add(sVal)
Case Like "*Part Number*"
PART_NUMBER.Add(sVal)
Case Like "*Module Type*"
MODULE_TYPE.Add(sVal)
Case Like "*Decoding EEPROM*"
NOSDRAMDIMMSDAD.Add(Right(sVal, 6))
Case Like "*Size*"
RAM_SIZE.Add(sVal)
Case Like "*Maximum module speed*"
MAX_MODULE_SPEED.Add(sVal)
Case Like "*Fundamental Memory type*"
FUN_MEM_TYPE.Add(sVal)
Case Like "*Module Type*"
MODULE_TYPE.Add(sVal)
Case Like "*tCL-tRCD-tRP-tRAS*"
tCL_tRCD_tRDP_tRAS.Add(sVal)
Case Like "*SDRAM Device Type*"
SDRAM_DEVICE_TYPE.Add(sVal)
Case Like "**"
Case Like "**"
Case Like "**"
Case Like "**"
Case Like "**"
Case Like "**"
End Select
'Print sVal
Next
Finfosys.ComboBox10.List = NOSDRAMDIMMSDAD
Finfosys.ComboBox10.Index = 0
End

View File

@ -17,6 +17,7 @@
Public CPUINFO_FILE As String
Public Sub Main()
Dim PrintErr As Boolean = True
MDecode_dimms._inits()
Select Case Application.Args[1]
Case "--help"
Print ("\n " & Application.name & " " & Application.version & " running on:\n"

View File

@ -37,4 +37,6 @@ Public Sub _inits()
Break
Endif
Next
End

View File

@ -65,7 +65,8 @@ install-bin: install-bin-i-nex-edid \
install-bin-i-nex-usage \
install-bin-i-nex-cpusage \
install-bin-i-nex-glinfo \
install-bin-i-nex-uname
install-bin-i-nex-uname \
install-bin-i-nex-dimms
@ -87,7 +88,9 @@ install-bin-i-nex-glinfo:
install-bin-i-nex-uname:
test -d $(DESTDIR)$(bindir) || mkdir $(DESTDIR)$(bindir)
$(INSTALL) 0755 i-nex-uname $(DESTDIR)$(bindir)
install-bin-i-nex-dimms:
test -d $(DESTDIR)$(bindir) || mkdir $(DESTDIR)$(bindir)
$(INSTALL) 0755 i-nex-dimms $(DESTDIR)$(bindir)
clean:
@echo -e '$(ACTION_COLOR)Clean JSON$(NO_COLOR)'
$(RM_COM) $(RMFILE_OPT) i-nex-edid

2055
JSON/i-nex-dimms Executable file

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ make: build-inex build-json build-pixmaps
install: install-pastebinit-and-other \
install-pixmaps install-changelogs install-manpages \
install-docs install-json install-inex install-scripts \
link-inex
install-udev-rule link-inex
clean: clean-pixmaps clean-json clean-inex clean-all
@ -88,7 +88,11 @@ clean-json:
clean-inex:
if test -f "I-Nex/Makefile" ; then $(MAKE) -C I-Nex distclean ; fi
install-udev-rule:
$(INSTALL_DM) 600 i2c_smbus.rules $(DESTDIR)$(PREFIX)$(UDEV_RULES_DIR)/i2c_smbus.rules
clean-all:
$(RM_COM) $(RMDIR_OPT) `find . -name ".gambas"`

View File

@ -25,8 +25,8 @@ COMPRESS = gzip -9
RM_COM = rm
RMFILE_OPT = -f
RMDIR_OPT = -Rf
STATIC = true
STATIC = false
UDEV_RULES_DIR = /lib/udev/rules.d
ifeq ($(STATIC),true)
YESNO_LINK = -static
else

View File

@ -1,5 +1,4 @@
SUBSYSTEMS=="pci", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x7113", RUN+="/sbin/modprobe i2c-piix4"
SUBSYSTEMS=="pci", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x7603", RUN+="/sbin/modprobe to-be-written"
SUBSYSTEMS=="pci", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x719b", RUN+="/sbin/modprobe i2c-piix4"
SUBSYSTEMS=="pci", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x2413", RUN+="/sbin/modprobe i2c-i801"
SUBSYSTEMS=="pci", ATTRS{vendor}=="0x8086", ATTRS{device}=="0x2423", RUN+="/sbin/modprobe i2c-i801"