Question:
please answer this question about compiler?
?
2012-04-01 23:25:17 UTC
1)initially we dont have compiler installed in our system
2)we take an os and install it,...suppose i am assuming it,...it has a compiler which gets installed automatically so that it can understand the os programs
let us concentrate on the compiler installed now
how can this compiler be understood by the system...i mean we dont have anything to understand these compiler programs written in a specific language
all answers are welcome :)
Three answers:
Shadow Wolf
2012-04-02 00:58:46 UTC
You are talking about bootstrapping a system. There are a couple ways to do it.



The old way was to hand code a machine language program that would serve as the BIOS and then more programs built up from that. It took quite a while to develop a new computer and get an operating system running on it. Everything had to either be hand coded in machine code or once an assembly language compiler was made, then the slightly easier assembly language programming would be used. Some of the older computers never had an assembly language compiler. It was all hand coded machine code.



The entire idea behind C changed how computers were developed. C was designed as a development programming language to replace hand coding machine code and assembly language. It is small enough to write a basic compiler in a short time and speed up the bootstrap process.



The more modern way would be to build a cross compiler using the various free compiler building tools that are available. It would run on a PC but the programs it made as it's output would be for the new wizbang computer. You could port the Linux operating system over to your new wizbang computer using the cross compiler as well as develop all or most of the hardware drivers. You would still need to do some of the basic work so that you could boot up a hard drive or use other unique hardware interfaces.



Once you have the basics such as a C compiler and an operating system, then it is simple to add more programs. Many of the programs in C would simply need to be compiled for the new computer system. It would be similar to building Linux completely from scratch as that would be what you were doing. You would have the added trouble of dealing with hardware differences for the new computer.



Shadow Wolf
2012-04-01 23:32:11 UTC
The compiler translates the programming languages that people use into machine-readable code. The compiler itself was compiled into machine-readable code by another compiler. Once code is compiled, it can be read by the machine without the assistance of a compiler.
munk
2016-12-05 14:50:48 UTC
int significant() { srand(time(0)); int theNumber = rand() % a hundred + a million; int tries = 0, wager; cout << "tWelcome to wager My huge form nn"; do { cout << "enter a wager: "; cin >> wager; ++tries; if (wager > theNumber) cout << "Too intense!nn"; if (wager < theNumber) cout << "Too low!nn"; } collectively as (wager != theNumber); cout << "nThat's it! you acquire it in " << tries << " guesses!n"; cin.forget approximately approximately(cin.rdbuf()->in_avail() +a million); return 0; } replace: upload a remark in the previous "7 hours": // 7 hours in the past next, you could in basic terms have one significant() functionality on your software . . . each little thing else will the two be interior this functionality or in a functionality of a distinctive call.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...