Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programming from scratch [closed]

What I would like to know is to start programming from scratch without any Operating System and anything like it.

As I know Windows and Mac and almost anything even the DOS is written in C, C++ Pascal etc., so I think I should know one of these languages, but for this I would need a program where I can write the code, and also to compile it but without an Operating System and programs how can be this done? How could they do it?

But this is not enough far, how was C written? in what? So when I mean scratch I mean, building everything from the basics. Maybe from 0,1,0,1 right now I think this is the exact start point. But how can I do it, what should I have and where should I start?

Thanks for every answer!

like image 966
Adam Halasz Avatar asked Dec 03 '10 23:12

Adam Halasz


People also ask

Can I learn programming from Scratch?

With that being said, while of course it's possible for someone to learn programming or coding from scratch… it doesn't mean that it will be easy. But then, few things that are worth learning are.

Is Scratch a block based programming language?

Scratch Blocks is a new development project for the next generation of graphical programming blocks, based on a collaboration between Google and MIT's Scratch Team — building on Google's Blockly technology and informed by the Scratch Team's expertise in developing creative learning tools for young people.

How hard is it to learn coding from Scratch?

No, coding is not hard to learn. However, like anything new, it's not easy to start, and how difficult a time one has with learning to code will vary across a number of factors. The point is, learning to code isn't impossible; or, it's not as impossible as it might seem when it comes to getting your kids involved.


2 Answers

There's a great textbook called The Elements of Computing Systems: Building a Modern Computer from First Principles by Noam Nisan and Shimon Schocken, which serves as the basis for a university course taught by the authors called Workshop In Computer Construction - From NAND to Tetris in 12 Steps. This course is also taught at other universities under different names.

There's a 10 minute introduction on YouTube and a 1 hour Google TechTalk on Google Video, both by the author himself.

The official companion web site is http://nand2tetris.org/

Don't let the title "Computer Construction" fool you. By "computer", the author does not just mean the rectangular plastic box on your desk, he means the entire computing system, from the individual logic gates up to highest-level application programming.

The book/course teaches you

  • how to create your own individual logic gates
  • how to build your own logic circuits
  • how to build your own CPU
  • how to program in machine code directly
  • how to program in your own assembler (which you wrote in machine code)
  • how to write your own virtual machine
  • how to design, implement and program in your own high-level language (which you wrote in assembler)
  • how to write a bootloader
  • how to write an operating system
  • and ultimately how to write a simple game
like image 156
Jörg W Mittag Avatar answered Oct 06 '22 22:10

Jörg W Mittag


You can acquire a microcontroller prototyping board such as Arduino, Beagleboard or MPLAB PIC board, and then create a machine monitor program that can load and execute your other programs in user space.

You can program those microcontrollers in C or their respective instruction sets.

Hook up an LCD display to that MCU board and you have a monitor. Hook up a keyboard and mouse to it and you have controls. (You can even write your own trap handlers for writing to LCD and reading inputs from keyboard and mouse to understand how interrupts and exceptions work at low level. If you want to go lower, you will have to look at MCU pin-outs for interrupt control lines and timing diagrams).

Voilà! You've designed your own computer from scratch!

To answer your question about C, compilers for the first programming languages were written in assembly, and compilers for assembly were written in machine code.

like image 42
vls Avatar answered Oct 06 '22 20:10

vls