Hi,
How can the processor architecture/capabilities [like 16 bit/32 bit] be
determined using a c program? I wanted to know how an OS
installer/loader determines this while installing the OS on a fresh
system.
Thanks
cv 5 2971 re*****@yahoo.com wrote: How can the processor architecture/capabilities [like 16 bit/32 bit] be determined using a c program?
Not. The very act of determining which kind of system you use depends on
which kind of system you use.
I wanted to know how an OS installer/loader determines this while installing the OS on a fresh system.
Not in C, most likely.
Richard
<re*****@yahoo.com> wrote: How can the processor architecture/capabilities [like 16 bit/32 bit] be determined using a c program? I wanted to know how an OS installer/loader determines this while installing the OS on a fresh system.
I think one human told another human, "Hey, write a compiler on machine X
for machine Y. He then described machine Y.
In article <42**************@sbcglobal.net>,
Thomas Matthews <Th*************************@sbcglobal.net> wrote:
:If processors are very friendly, you can interrogate them.
:Otherwise you have to consult their data sheets.
If the processors are very friendly, invite them down to
the pub and have them buy you a round while you listen to their
life history.
It's the unfriendly processors that you have to play
"Good cop / Bad cop" with.
;-)
--
'ignorandus (Latin): "deserving not to be known"'
-- Journal of Self-Referentialism
"Thomas Matthews" <Th*************************@sbcglobal.net> re*****@yahoo.com wrote: Hi,
How can the processor architecture/capabilities [like 16 bit/32 bit] be determined using a c program? I wanted to know how an OS installer/loader determines this while installing the OS on a fresh system.
ISO C uses an abstract machine, and provide no way of
telling you what the underlying HW is. Your question is
off-topic in c.l.c.
<OT mode = on>
I do believe that this information must be provided during installation or creation of the operating system.
Why answer an off-topic request, if you don't know? :-)
Hosted and freestanding programs are built for different
targets.. e.g. you can't use an OS kernel built for MIPS,
on x86 architecture. Hence, unless there exists a
CPU-independent opcode format, different CPU
architectures need different images.
The abstract C machine, doesn't provide interface like the
Java VM environment do. Therefore, C programs need to
be installed by selecting the correct CPU-architecture
manually.
Of course, an OS installer can be hosted, just put it on a
bootable floppy or CD-ROM!
If processors are very friendly, you can interrogate them. Otherwise you have to consult their data sheets.
Well, detecting the model of a modern Intel CPU, is a
one-liner from C programs (with the use of inline asm).
AMD and other x86 clones provide another CPU vendor
string than "Genuine Intel": http://www.paradicesoftware.com/specs/cpuid/index.htm
Detecting older Intel CPU's however, is more of a
challenge: http://www.ddj.com/documents/s=957/ddj9609o/
</OT mode= off>
--
Tor <torust AT online DOT no> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Hugh Cowan |
last post by:
Hello,
I am currently running PHP 4.3.2 on Windows NT 4.0.
Is there anyway (I am sure there is but I just can't find it) that you
can determine the path of the current script that is running?...
|
by: Guhanath |
last post by:
hai everybody,
I have planned to buy 64 bit processor for my own use.I would like to
confirm that the processor doesnt have any pb regarding any software i
installs(ie oracle,VS 2005 beta,java...
|
by: johny smith |
last post by:
I am trying to figure out a way to print the address of what called a
certain function once inside the function.
I am assuming that this information is on the stack somewhere. But can
someone...
|
by: James |
last post by:
Hi Folks,
I plan to implement some report generation using Formatting objects on the
..NET platform. Does Microsoft have a built in version? .Or What are my
options? are there any free ones which...
|
by: Subrahmanyam Arya |
last post by:
Hi Folks ,
I am trying to solve the problem of reading the numbers correctly
from a serial line into an intel pentium processor machine .
I am reading 1 byte and 2byte data both positive...
|
by: junky_fellow |
last post by:
Hi,
I am using a gcc compiler for a 32 bit powerpc processor. When I
look at the size of unsigned long long, it displays 8 bytes. I was
wondering, how we can have a data type of 64 bits on a 32...
|
by: broeisi |
last post by:
Hello,
Is there a way in C to get information at runtime if a processor is 32
or 64 bit?
Cheers,
Broeisi
|
by: Paul Brauner |
last post by:
Hi, I'm working on a project that outputs several languages including
(hopefully) python. My problem is that the generic backend architecture
has not been designed to output correctly indented...
|
by: aha |
last post by:
Dose anyone know of a cross-platform method for determining the vendor
of a processor? Under linux I can check /proc/cpuinfo. What I'd like
to be able to do is determine if a processor is AMD or...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |