Author Topic: How To Read Out Model Number From Kernel  (Read 2537 times)

dhns

  • Hero Member
  • *****
  • Posts: 699
    • View Profile
    • http://www.goldelico.com
How To Read Out Model Number From Kernel
« on: February 06, 2005, 05:37:00 am »
is there a 'standard' command or ioctl() to read out the detailled model number, e.g. a string like SL5000, SL5500, SL5600, C750, C860, etc. I need to write a shell script that can handle some subtle differences (in the formats of /dev/sharp_ts) of these models.

I have tried uname -r to get the Linux kernel version and uname -m to get the processor version. But that seems not to be accurate enough.

-- hns
SL5500G, C860, C3100, WLAN, RTM8000, Powerbook G4, and others...
http://www.handheld-linux.com
http://www.quantum-step.com

m-morino

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • http://morimasa.net/
How To Read Out Model Number From Kernel
« Reply #1 on: February 06, 2005, 05:54:32 am »
Hi,

Quote
is there a 'standard' command or ioctl() to read out the detailled model number, e.g. a string like SL5000, SL5500, SL5600, C750, C860, etc. I need to write a shell script that can handle some subtle differences (in the formats of /dev/sharp_ts) of these models.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=65814\"][{POST_SNAPBACK}][/a][/div]
/proc/deviceinfo/product contains the information you need. On my C3000,
Code: [Select]
$ cat /proc/deviceinfo/product
SL-C3000
I'm not sure about the values other models have, but it will be similar to above style.

HTH,

--
  m-morino
« Last Edit: February 06, 2005, 05:57:21 am by m-morino »
m-morino

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
How To Read Out Model Number From Kernel
« Reply #2 on: February 06, 2005, 06:41:29 am »
/proc/deviceinfo/product is pretty meaningless since it is getting specified by the root file system. /proc/cpuinfo is a much better indicator since this is getting specified by the kernel.

Even better is to look at the CPU type, flash and memory size, because these three are the only differences among the C7x0 series.
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

dhns

  • Hero Member
  • *****
  • Posts: 699
    • View Profile
    • http://www.goldelico.com
How To Read Out Model Number From Kernel
« Reply #3 on: February 06, 2005, 01:19:55 pm »
Hm,
I think it comes to checking uname -r in combination with /proc/cpuinfo
Many thanks for the hints!

And, shouldn't we compile a list which model displays which revision, model etc.? And that for the Sharp and derived ROMs incl. OE & pdaXrom?

Here a start for the C3000:
Code: [Select]
uname -a: Linux zaurus 2.4.20 #1 Thu, 28 Oct 2004 09:59:43 +0900 armv5tel unknown
/proc/deviceinfo/product: SL-C3000
/proc/cpuinfo:
Processor       : XScale-PXA270 rev 4 (v5l)
BogoMIPS        : 415.33
Features        : swp half thumb fastmult edsp
CPU implementor : 0x69
CPU architecture: 5TE
CPU variant     : 0x0
CPU part        : 0x411
CPU revision    : 4
Cache type      : undefined 5
Cache clean     : undefined 5
Cache lockdown  : undefined 5
Cache unified   : harvard
I size          : 32768
I assoc         : 32
I line length   : 32
I sets          : 32
D size          : 32768
D assoc         : 32
D line length   : 32
D sets          : 32

Hardware        : SHARP Spitz
Revision        : 0000
Serial          : 0000000000000000


and a C860:
Code: [Select]
uname -a: Linux zaurus 2.4.18-rmk7-pxa3-embedix #1 Thu, 6 Nov 2003 09:29:23 +0900
armv5tel unknown
/proc/deviceinfo/product: SL-C860
/proc/cpuinfo:
Processor       : Intel XScale-PXA255 rev 6 (v5l)
BogoMIPS        : 397.31
Features        : swp half thumb fastmult edsp
CPU implementor : 0x69
CPU architecture: 5TE
CPU variant     : 0x0
CPU part        : 0x2d0
CPU revision    : 6
Cache type      : undefined 5
Cache clean     : undefined 5
Cache lockdown  : undefined 5
Cache unified   : harvard
I size          : 16384
I assoc         : 16
I line length   : 32
I sets          : 32
D size          : 16384
D assoc         : 16
D line length   : 32
D sets          : 32

Hardware        : SHARP Shepherd
Revision        : 0000
Serial          : 0000000000000000

and a SL-5500G with ROM 3.10:
Code: [Select]
uname -a: Linux zaurus 2.4.18-rmk7-pxa3-embedix #1 Fri, 9 May 2003 09:20:18 +0900 armv4l unknown
/proc/deviceinfo/product: SL-5500
/proc/cpuinfo:
Processor       : Intel StrongARM-1110 rev 9 (v4l)
BogoMIPS        : 137.21
Features        : swp half 26bit fastmult
CPU implementor : 0x69
CPU architecture: 4
CPU variant     : 0x0
CPU part        : 0xb11
CPU revision    : 9

Hardware        : Sharp-Collie
Revision        : 0000
Serial          : 0000000000000000
I see the kernel version of a SL5500 and C860 are the same - but they differ in compilation time or processor or Hardware.

-- hns
« Last Edit: February 06, 2005, 04:11:33 pm by dhns »
SL5500G, C860, C3100, WLAN, RTM8000, Powerbook G4, and others...
http://www.handheld-linux.com
http://www.quantum-step.com