Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.development > #8327

Re: 64-bit detection

From "Rod Pemberton" <boo@fasdfrewar.cdm>
Newsgroups alt.os.development
Subject Re: 64-bit detection
Date 2015-07-09 23:41 -0400
Organization Aioe.org NNTP Server
Message-ID <op.x1jgivqzyfako5@localhost> (permalink)
References <mnn174$dd$1@speranza.aioe.org>

Show all headers | View raw


On Thu, 09 Jul 2015 19:47:49 -0400, Benjamin David Lunt <zfysz@fysnet.net>  
wrote:

> Hi guys,

Hi Ben.

> Sorry I have been away for a little while.  I have been
> trying to follow some of the threads here, but haven't
> had much time to read them all.

...

> However, I had a thought a few days ago.  Will my 32-bit
> OS run on a 64-bit machine?

Why wouldn't it?  AFAIK, they didn't remove 32-bit mode.

[some edited changes/re-organization to Ben's comments follow]

> As far as I can tell, it runs as if it was a 32-bit machine.

...

> Well, after a few tweaks and fixes, yes it does.

Why did it need any tweaks?

What were the tweaks?

(I.e., useful for any of us to know?)

> I haven't looked into 64-bit machines too much, nor at the
> moment have any interest in doing so.

Ditto.

> However, I am interested in simply detecting the 64-bit
> machine and displaying a message stating so.
> [...]
> how do you detect if 64-bit is available?

Ok.

I have no idea how to do that.

My guess about how to detect 64-bit mode would be:

1) attempt to switch into 64-bit mode and set a flag on success
2) check one of the bits in model specific registers (MSRs)
3) see if CPUID returns something useful

Otherwise, it's a polite RTFM from me, since I need
to do so as well ...


Of course, as would be expected, at least by me anyway,
Sandpile.org has three webpages on those topics directly
off of their main webpage.  Imagine that.

http://www.sandpile.org/x86/cpuid.htm
http://www.sandpile.org/x86/msr.htm
http://www.sandpile.org/x86/flags.htm

Sandpile.org
http://www.sandpile.org

> I thought I would dig out the .pdf's for the 64-bit and
> see if there is a flag in the eflags register (while in
> 32-bit (non-long) mode) that might (inadvertently) indicate
> this.

I don't recall anything in flags.

> I haven't yet, but thought I would look into this and
> was interested in your opinions.
>
> Have you done anything for 64-bit?

No.

I did try some assembly from the 'net for 64-bit
startup for DOS.  However, it didn't work.  The guy
made some shortcuts to the mode switch which he claimed
wasn't necessary and so the code worked for his processor,
but not for mine ...

> Will you?

I'd say probably not any time soon.

I have a few problems with using 64-bit:

1) Most of my code is in C for DOS and the DOS C compilers
I use don't support 64-bit mode.  They don't seem like they're
going to be able to support 64-bit mode any time soon either.

2) Most of my assembly is for DOS.  DOS can only get into
32-bit mode with DPMI or VCPI etc.  I.e., I'd need to code
my own 64-bit startup for DOS just to use 64-bit assembly,
but I already have my 32-bit startup code and DPMI, VCPI,
etc.

3) I simply don't _need_ 64-bit, AFAICT.  64-bit Linux from
2010 updated to 2015 with many speed improvements running on
multiple cores is simply no faster than 32-bit Windows SE on
one core.

4) Linux supports 64-bit assembly and C, but I'd need to
"port" a bunch of code, which may be trivial in some cases.


Rod Pemberton

-- 
Tolerance and socialism attracts intolerance and terrorism.  See:
France, United Kingdom, Germany, Denmark, Belgium, Netherlands, ...
UK: Strong encryption, non-issue. GR: Eurozone currency, priority.

Back to alt.os.development | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

64-bit detection "Benjamin David Lunt" <zfysz@fysnet.net> - 2015-07-09 16:47 -0700
  Re: 64-bit detection "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-09 23:41 -0400
    Re: 64-bit detection "James Harris" <james.harris.1@gmail.com> - 2015-07-10 08:30 +0100
      Re: 64-bit detection "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-10 05:17 -0400
        Re: 64-bit detection "James Harris" <james.harris.1@gmail.com> - 2015-07-10 13:41 +0100
          Re: 64-bit detection "James Harris" <james.harris.1@gmail.com> - 2015-07-12 19:04 +0100
            Re: 64-bit detection "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-13 02:30 -0400
              Re: 64-bit detection "Alexei A. Frounze" <alexfrunews@gmail.com> - 2015-07-13 02:07 -0700
                Re: 64-bit detection "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-13 23:10 -0400
                Re: 64-bit detection "Alexei A. Frounze" <alexfrunews@gmail.com> - 2015-07-14 01:23 -0700
              Re: 64-bit detection "James Harris" <james.harris.1@gmail.com> - 2015-07-13 12:34 +0100
                Re: 64-bit detection "Rod Pemberton" <boo@fasdfrewar.cdm> - 2015-07-13 22:50 -0400
                Re: 64-bit detection "James Harris" <james.harris.1@gmail.com> - 2015-07-14 08:37 +0100
                Re: 64-bit detection "Alexei A. Frounze" <alexfrunews@gmail.com> - 2015-07-14 01:41 -0700
                Re: 64-bit detection "James Harris" <james.harris.1@gmail.com> - 2015-07-14 10:04 +0100
      Re: 64-bit detection "Benjamin David Lunt" <zfysz@fysnet.net> - 2015-07-10 08:44 -0700
      Re: 64-bit detection "Benjamin David Lunt" <zfysz@fysnet.net> - 2015-07-10 10:52 -0700
    Re: 64-bit detection "Benjamin David Lunt" <zfysz@fysnet.net> - 2015-07-10 08:38 -0700
      Re: 64-bit detection "Benjamin David Lunt" <zfysz@fysnet.net> - 2015-07-10 10:58 -0700
  Re: 64-bit detection CN <qmbmnp3799@pacbell.net> - 2015-07-09 23:00 -0700
    Re: 64-bit detection "Benjamin David Lunt" <zfysz@fysnet.net> - 2015-07-10 08:40 -0700
      Re: 64-bit detection "James Harris" <james.harris.1@gmail.com> - 2015-07-10 21:29 +0100

csiph-web