I'm looking for a way to know if the cpu of my linux system is running in 64 bit mode. I've got to programm it for the university. My idea was to create something like an function that provides me that information. I'm not sure how should I start. Can somebody give me an idea?. My university give me a code, but I'm not able to check the length of the parameter that the main is sending to the funktion is64bit. My code is this:  int main() {      uint32_t msr = assembleMSR( 0, 0, 0, 0 );      printf("assembled MSR is %#x, should be 0\n", msr);     printf("is64BitMode(&amp;msr) should be 0, is %d\n", is64BitMode(&amp;msr));     printf("is64BitMode(&amp;msr) should my EXAMPLE, is %d\n", is64BitMode(&amp;msr2));      enableInts( &amp;msr);      printf("MSR with ints enabled is %#x, should be 0x8000\n", msr);      return 0; }  int is64BitMode ( uint32_t *MSR ) {      int longi=sizeof(MSR);        printf("longi de size of%d\n", longi);     printf("%d\n", __WORDSIZE);// with this sentence i know that my cpu is running on 64 bits.       (void) MSR;     return 0;     /* TODO */ }
101214
When I type uname -a, it gives the following output.  Linux mars 2.6.9-67.0.15.ELsmp #1 SMP Tue Apr 22 13:50:33 EDT 2008 i686 i686 i386 GNU/Linux   How can I know from this that the given OS is 32 or 64 bit?  This is useful when writing configure scripts, for example: what architecture am I building for?
25209
i know this question has been asked a lot on superuser, but i am stuck as i have checked with different applications, windows system information, vmware processor x64 processor utility, cpu-z, securable, registry entry..and i am getting different results. i have windows 8 32-bit.  windows system information  System Type X86-based PC  System Properties    vmware guest64check    cpu-z    Securable    Why am i getting different results in windows system info and vmware processor utility, and what exaclty is my machine type? Will it be able to run windows 8 64-bit?  Thanks.
121122
I was implementing the ALU from the specs given in my The Elements of Computing systems book. I am stuck on only one problem. How do I find if a given number is zero or not. One thing I can do is or every bit in the bus, and then apply a not gate on that. But there has to be some other elegant solution.
96976
Is there a way to have a 64 bit enum in C++?  Whilst refactoring some code I came across bunch of #defines which would be better as an enum, but being greater than 32 bit causes the compiler to error.  For some reason I thought the following might work:  enum MY_ENUM : unsigned __int64   {       LARGE_VALUE = 0x1000000000000000,   };
16499
If yes, on which operating system, shell or whatever?  Consider the following java program (I'm using java just as an example, any language would be good for this question, which is more about operation systems):  public class ExitCode {     public static void main(String args[]) {         System.exit(Integer.parseInt(args[0]));     } }   Running it on Linux and bash, it returns always values less equal 255, e.g. (echo $? prints the exit code of the previous executed command)  &gt; java ExitCode 2; echo $? 2  &gt; java ExitCode 128; echo $? 128  &gt; java ExitCode 255; echo $? 255  &gt; java ExitCode 256; echo $? 0  &gt; java ExitCode 65536; echo $? 0     EDITED: the (only, so far) answer below fully  explain what happens on UNIXes. I'm still wondering about other OSes.
20464
I need to find the 32-bit version, and all I keep finding is the 64-bit. Can anyone provide me with a link?
4740
I would like to monitor the following system information in Java:   Current CPU usage** (percent) Available memory* (free/total) Available disk space (free/total)  *Note that I mean overall memory available to the whole system, not just the JVM.   I'm looking for a cross-platform solution (Linux, Mac, and Windows) that doesn't rely on my own code calling external programs or using JNI. Although these are viable options, I would prefer not to maintain OS-specific code myself if someone already has a better solution.  If there's a free library out there that does this in a reliable, cross-platform manner, that would be great (even if it makes external calls or uses native code itself).  Any suggestions are much appreciated.  To clarify, I would like to get the current CPU usage for the whole system, not just the Java process(es).  The SIGAR API provides all the functionality I'm looking for in one package, so it's the best answer to my question so far. However, due it being licensed under the GPL, I cannot use it for my original purpose (a closed source, commercial product). It's possible that Hyperic may license SIGAR for commercial use, but I haven't looked into it. For my GPL projects, I will definitely consider SIGAR in the future.  For my current needs, I'm leaning towards the following:   For CPU usage, OperatingSystemMXBean.getSystemLoadAverage() / OperatingSystemMXBean.getAvailableProcessors() (load average per cpu) For memory, OperatingSystemMXBean.getTotalPhysicalMemorySize() and OperatingSystemMXBean.getFreePhysicalMemorySize() For disk space, File.getTotalSpace() and File.getUsableSpace()   Limitations:  The getSystemLoadAverage() and disk space querying methods are only available under Java 6. Also, some JMX functionality may not be available to all platforms (i.e. it's been reported that getSystemLoadAverage() returns -1 on Windows).  Although originally licensed under GPL, it  to , which can generally be used for closed source, commercial products.
73828
I'm creating a set of enum values, but I need each enum value to be 64 bits wide. If I recall correctly, an enum is generally the same size as an int; but I thought I read somewhere that (at least in GCC) the compiler can make the enum any width they need to be to hold their values. So, is it possible to have an enum that is 64 bits wide?
59976
I can't understand what these are even though I've read articles about them.  Does it have something to do with 32 bits and 64 bits CPU? So why is it saying "AMD"64 and "i386"?  AMD is a label just like Intel? So, if I've got an Intel Core 2 Duo (MacBook Pro), then I can't use AMD64 even though Intel Core is 64 bits.
43933
#include &lt;stdio.h&gt; int main() {     unsigned long long int num = 285212672; //FYI: fits in 29 bits     int normalInt = 5;     printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt);     return 0; }   Output:  My number is 8 bytes wide and its value is 285212672l. A normal number is 0.   I assume this unexpected result is from printing the unsigned long long int. How do you printf() an unsigned long long int?
34425
Situation: I have a script watching over NumLock status, well not really watching, but turning it On every 1 second. The script is running in the background.  Reasoning: I often accidentally turn off NumLock. And I have no indicator of NumLock status on the keyboard.  OS, DE, DM, WM, xmodmap:  :  $ lsb_release -a  No LSB modules are available. Distributor ID: LinuxMint Description:    Linux Mint 18 Sarah Release:    18 Codename:   sarah   :  echo $DESKTOP_SESSION  cinnamon   :  cat /etc/X11/default-display-manager  /usr/sbin/mdm   :  wmctrl -m | head -n 1  Name: Mutter (Muffin)   :  xmodmap -pm  xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):  shift       Shift_L (0x32),  Shift_R (0x3e) lock        Caps_Lock (0x42) control     Control_L (0x25),  Control_R (0x69) mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd) mod2        Num_Lock (0x4d) mod3       mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf) mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)   My original Bash script follows:  #!/bin/bash  while true do    numlockx on    sleep 1s  done   As you can see, the script does not care about current status of NumLock. It just keeps turning it on.  Goal: I would like to make the script at least somewhat CPU efficient.  Question: What is the most CPU efficient way to ensure that NumLock is On in Linux (Mint 18)?
104518
I have access to an 8-core node of a Linux cluster.  When logged in to the node, I can see a list of processors using this command:  more /proc/cpuinfo   In my 8-core node, the processors are numbered from 0 to 7.  Each processor is an Intel Xeon CPU (E5430 @ 2.66GHz).  Now suppose I call the program foo with some arguments args:  foo args   The program foo takes a long time to execute (hours or days, for example).  Having called foo, is it possible to determine the particular processor (i.e., 0 to 7) on which foo is running?  The top program shows me the process ID and similar information, but I don't see the processor number.  Is such information available?
76640
VirtualBox, and possibly other VM software, allows the user to specify the number of CPUs exposed to the VM. In my particular case, I have a dual core CPU, with Windows 7 64-bit running natively, and Ubuntu 9.04 64-bit as the VM.  The help file suggests not setting this above the number of physical cores available. This makes sense. So, is it best allocating 1 or 2 CPU cores? Does this depend entirely on the native CPU load?
8992
In C++, I enjoyed having access to a 64 bit unsigned integer, via unsigned long long int, or via uint64_t. Now, in Java longs are 64 bits, I know. However, they are signed.  Is there an unsigned long (long) available as a Java primitive? How do I use it?
47181
On Windows, under normal circumstances a 32 bit process can only access 2GB of RAM (or 3GB with a special switch in the boot.ini file). When running a 32 bit process on a 64 bit operating system, how much memory is available? Are there any special switches or settings that can change this?
70930
I'm trying to measure the memory of a process that I call via the command line (i.e., I want to find out much CPU/RAM the process takes). Is there any command that I can add to the command calling the process that will achieve this?
53017
My Windows XP installation has become unusable for some unknown reason. Since Microsoft is going to end support in a few days anyway, I decided to install Linux Mint.  For optimal hardware utilization, I want to use a 64-bit system if possible. However, since XP isn't working it's not possible to .  Therefore, I want to use the BIOS to find it out.  What information in the BIOS should I use to determine whether or not my I can install a 64-bit operating system?