1 |
wow, you both did a good job , I asked lots of people and they did't say |
2 |
very clear, it suddenly enlightened me, thanks all. |
3 |
|
4 |
On 26 November 2010 22:32, Alan McKinnon <alan.mckinnon@×××××.com> wrote: |
5 |
|
6 |
> Apparently, though unproven, at 16:09 on Friday 26 November 2010, Stroller |
7 |
> did |
8 |
> opine thusly: |
9 |
> |
10 |
> > On 26/11/2010, at 6:07am, sam new wrote: |
11 |
> > > Thanks all, I have a question , when we build the system, always use |
12 |
> host |
13 |
> > > client to build the toolchain , then GCC Glibc ...kernel some unity ... |
14 |
> > > from source ,but where the frist system come from ,does it build using |
15 |
> > > the Assembly language or machine language? I mean just give you X86 |
16 |
> > > hardware and power , no OS, no livd cd . I am afraid it is out of this |
17 |
> > > topic.but it always puzzled me :-) |
18 |
> > |
19 |
> > I think you want to know which came first - the chicken or the egg? |
20 |
> > |
21 |
> > For a few years, operating systems were indeed written in assembler. |
22 |
> Then, |
23 |
> > c 1970, Unix was the first operating system written in a higher-level |
24 |
> > programming language, C. Likewise, I guess, the first compilers would be |
25 |
> > written in assembler, until one was written that could compile itself and |
26 |
> > become "self-hosting". |
27 |
> > |
28 |
> > Thus new compilers and operating systems can now be written in |
29 |
> higher-level |
30 |
> > languages (although C isn't very high-level) and compiled using an |
31 |
> > existing compiler. |
32 |
> > |
33 |
> > That Unix was written in C is what has lead to its ubiquity - until then |
34 |
> > every different brand of computer had its own operating system, usually |
35 |
> > written by the manufacturer. Written in assembly, these were |
36 |
> non-portable. |
37 |
> > Writing the operating system in C allowed it to be ported to different |
38 |
> > hardware architectures, and programs could be written that would run on |
39 |
> > all the different systems out there (as long as those ran Unix). |
40 |
> > |
41 |
> > Linux was written on a Minix system, Minix was written c 1987 and so |
42 |
> might |
43 |
> > have been written on one of the BSDs that was around then; the BSDs were |
44 |
> > probably written on an AT&T Unix. |
45 |
> > |
46 |
> > When Intel produce a new chip - or gcc wants to support a new |
47 |
> architecture |
48 |
> > - they rewrite the compiler (the "backend" part of it) to output machine |
49 |
> > code to suit the new chip's instruction set (which will be different from |
50 |
> > that of other chips - PPC vs ARM vs MIPS vs x86). The compiled code is |
51 |
> > then transferred to the new machine and fingers are crossed as everyone |
52 |
> > waits to see if it boots. |
53 |
> > |
54 |
> > http://en.wikipedia.org/wiki/History_of_Unix |
55 |
> > http://en.wikipedia.org/wiki/Compiler |
56 |
> > |
57 |
> > Stroller. |
58 |
> |
59 |
> One could ask the question "where did the first assembler come from?" |
60 |
> |
61 |
> Just as the first OSes and compilers were written in assembler to bootstrap |
62 |
> C, |
63 |
> so the first assemblers were written in hex codes to bootstrap the |
64 |
> assembler. |
65 |
> But hex code editors ran software, so where did the first hex code input |
66 |
> gadget come from? |
67 |
> |
68 |
> And the answer to that is that it was written in binary. Yes that's right - |
69 |
> a |
70 |
> panel with 16 toggle switches and a few pushbuttons. Those didn't require |
71 |
> software as everything was implemented in hardware. |
72 |
> |
73 |
> So now you know :-) |
74 |
> |
75 |
> |
76 |
> -- |
77 |
> alan dot mckinnon at gmail dot com |
78 |
> |
79 |
> |