Saturday, 31 December 2016

Assignment on 32 bit and 64 bit components in Processor to Application stack





Due to back word compatibility with 32 bit component like OS , application is allowed to run on 64 bit component, but vice versa is not allowed.

Inner component can be 32 or 64 bit if outer is 32
But inner component must be 64 if outer is 64 bit
Any level of miss match will result in problem.

Not applicable for device driver. Cannot run 32 bit driver on 64 bit machine (as per backward compatibility rule).


How to check whether binary is 32bit or 64 bit?

# file <filename>
[root@localhost driver]# file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=740131a4dacce9424b1db8fc53406040406d41bd, not stripped

How to check Whether OS  is 32 or 64 bit?

#uname –a or uname -m
[root@localhost ~]$ uname -a
Linux localhost.localdomain 3.15.10-201.fc20.i686 #1 SMP Wed Aug 27 21:33:30 UTC 2014 i686 i686 i386 GNU/Linux

[root@localhost ~]$ uname -m
i686
Its 32 bit. If you have a 64-bit OS, instead of i686, you have x86_64 or ia64 in the output of uname –a.

Check machine is 32 or 64 bit:

Use grep flags /proc/cpuinfo or lscpu

[root@localhost ~]$ grep flags /proc/cpuinfo
flags                       : fpu vme de pse tsc msr mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 rdtscp constant_tsc pni monitor ssse3

If this content lm flag then it is 64 bit.

 [root@localhost ~]$ lscpu
Architecture:          i686

CPU op-mode(s):        32-bit

No comments:

Post a Comment