anchor.diff:              Factor
       end.
   
  -linux_which_cpuinfo() ->
  -    %% Check for x86 (Intel or AMD)
  +
  +linux_cpuinfo_lookup(Key) when is_list(Key) ->
  +    linux_info_lookup(Key, "/proc/cpuinfo").
  +
  +linux_which_cpuinfo(wind_river) ->
       CPU =
  -        try [string:trim(S) || S <- string:tokens(os:cmd("grep \"model name\" /proc/cpuinfo"), [$:,$\n])] of
  -            ["model name", ModelName | _] ->
  -                ModelName;
  -            _ ->
  +        case linux_cpuinfo_lookup("model") of
  +            "-" ->
  +                throw(noinfo);
  +            Model ->
  +                case linux_cpuinfo_lookup("platform") of
  +                    "-" ->
  +                        Model;
  +                    Platform ->
  +                        Model ++ " (" ++ Platform ++ ")"
  +                end
  +        end,
  +    case linux_cpuinfo_lookup("total bogomips") of
  +        "-" ->
  +            {ok, CPU};
  +        BMips ->
  +            {ok, {CPU, BMips}}
  +    end;
  +
  +linux_which_cpuinfo(other) ->
  +    %% Check for x86 (Intel or AMD or ...)
  +    CPU =
  +        case linux_cpuinfo_lookup("model name") of
  +            "-" ->
                   %% ARM (at least some distros...)
  -                try [string:trim(S) || S <- string:tokens(os:cmd("grep \"Processor\" /proc/cpuinfo"), [$:,$\n])] of
  -                    ["Processor", Proc | _] ->
  -                        Proc;
  -                    _ ->
  +                case linux_cpuinfo_lookup("Processor") of
  +                    "-" ->
                           %% Ok, we give up
  -                        throw(noinfo)
  -                catch
  -                    _:_:_ ->
  -                        throw(noinfo)
  -                end
  -        catch
  -            _:_:_ ->
  -                throw(noinfo)
  +                        throw(noinfo);
  +                    Proc ->
  +                        Proc
  +                end;
  +            ModelName ->
  +                ModelName
           end,
  -    try [string:trim(S) || S <- string:tokens(os:cmd("grep -i \"bogomips\" /proc/cpuinfo"), [$:,$\n])] of
  -        [_, BMips | _] ->
  -            {ok, {CPU, BMips}};
  -        _ ->
  -            {ok, CPU}
  -    catch
  -        _:_:_ ->
  -            {ok, CPU}
  -    end.
  +    case linux_cpuinfo_lookup("bogomips") of
  +        "-" ->
  +            {ok, CPU};
  +        BMips ->
  +            {ok, {CPU, BMips}}
  +    end.
  +
  +linux_meminfo_lookup(Key) when is_list(Key) ->
  +    linux_info_lookup(Key, "/proc/meminfo").
   
   %% We *add* the value this return to the Factor.
   linux_which_meminfo() ->
  -    try [string:trim(S) || S <- string:tokens(os:cmd("grep MemTotal /proc/meminfo"), [$:])] of
  -        [_, MemTotal] ->
  +    case linux_meminfo_lookup("MemTotal") of
  +        "-" ->
  +            0;
  +        MemTotal ->
               io:format("Memory:"
                         "~n   ~s"
                         "~n", [MemTotal]),
  
positive.code:     end.
                      
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %% Set kill timer
  
negative.code:                     end;
                  _X ->
                      0
              end
      end.
  
  
  