Re-inventing the wheel with programming binary from scratch

Page 1 of 3 [ 41 posts ]  Go to page 1, 2, 3  Next

EphraimB
Raven
Raven

Joined: 4 Nov 2015
Gender: Male
Posts: 100
Location: Far Rockaway, NY

17 Mar 2016, 11:08 am

I want to learn binary from scratch (example: learn how to program drivers, display pixels on the screen, and make an Operating System in binary from scratch). I want to be able to program from the lowest level possible (which everybody did in the 1970’s). I don’t like relying on other people’s code at all. I feel like me re-inventing the wheel will open up new possibilities for me in technology. I want to actually change the world. I don’t want to be known as a simple “typical programmer” just like all other programmers. I want to be famous for making real new evolutions in technology.

Is there any place I can learn this?


_________________
My neurodiverse (Aspie) score: 151 of 200
My neurotypical (non-autistic) score: 70 of 200
I'm very likely neurodiverse (Aspie)

My personality type: INTJ-T


Trogluddite
Veteran
Veteran

User avatar

Joined: 2 Feb 2016
Age: 53
Gender: Male
Posts: 3,075
Location: Yorkshire, UK

17 Mar 2016, 11:25 am

A good place to start might be with a small processor module - something like an Arduino. You don't need to fight against an operating system, and you have direct access to every aspect of the hardware - for example, you don't need to ask for permission to access any block of memory that you want to. Or maybe trawl e-bay for one of the old 8-bit computers that were common in the 80s - those are what I first learned low-level programming on.

The instruction set for those chips is also much smaller and less confusing than for an Intel chip, so is a much gentler introduction to writing assembly language. All the skills you would learn will translate to bigger systems like a PC later on.

On a PC, you can't really avoid dealing with the OS and drivers these days - if nothing else, because all applications are "sand-boxed" to prevent illegal accesses that malware can exploit. IMHO, you don't want to be dealing with all that right at the beginning - even after 20 years of experience, I still find the Windows API to be an absolute nightmare to interface with!


_________________
When you are fighting an invisible monster, first throw a bucket of paint over it.


mikeman7918
Veteran
Veteran

User avatar

Joined: 7 Mar 2016
Age: 26
Gender: Male
Posts: 1,929
Location: Utah, USA

17 Mar 2016, 11:40 am

I strongly recommend this book.

It explains computers down to the transistor and machine language level. It talks about the fundamentals of computing technology as well as how machine language works.


_________________
Also known as MarsMatter.

Diagnosed with Asperger's, ADD, and Generalized Anxiety Disorder in 2004.
In denial that it was a problem until early 2016.

Deviant Art


slenkar
Veteran
Veteran

User avatar

Joined: 25 Apr 2014
Gender: Male
Posts: 1,146
Location: here

17 Mar 2016, 1:01 pm

I'd advise against it because it is the equivalent of trying to make a flat screen TV from scratch,
You'll end up with something not as good as readily available TVs but you would have wasted years of your life
And no one will pay you for it, so you'll also be poor.

There is an operating system coded in assembly called menuet you might want to check it out.

If you want to do this for fun then I would suggest coding for the zx spectrum computer

You don't actually need one you just emulate it on the PC

Getting a line on the screen is as simple as
LD A,256
LD 32568,A

The zx spectrum computer allows you to put binary on the screen, so it's great for learning
You need a .bat script to load the program into the emulator though so it takes some setting up.

There are many reasons people don't use assembly anymore,
mistakes take hours or days to fix,
The old computers had memory limits
Anything ambitious is much harder to do with assembly

Just for fun here is a sreenshot of a game

Image

It would take at least 2-3 years to learn assembly and make a game (and noone pays for games)



redbrick1
Deinonychus
Deinonychus

User avatar

Joined: 25 Dec 2015
Age: 49
Gender: Male
Posts: 300
Location: Bay Area

17 Mar 2016, 3:07 pm

Binary? As in machine code?
The quick answer is...no not really. Maybe people here can point you to a different direction.
You will want to learn assembly language or ASM. There are some pc interfaces that give you the ability.
A little history: ASM was used as early as 1943 used by a EDSAC.
The only benefit I can see using asm is that ithe is the best at interfacing with the the hardware and requires very little memory to implement.
To compile asm on PC try this link:
www.flatassembler.net



CryptoNerd
Sea Gull
Sea Gull

User avatar

Joined: 13 Jan 2016
Age: 1934
Gender: Male
Posts: 229
Location: The bash shell

18 Mar 2016, 2:05 pm

Study assembly language, operating system theory, and the source codes for popular operating systems and device drivers.



Fogman
Veteran
Veteran

User avatar

Joined: 19 Jun 2005
Age: 57
Gender: Male
Posts: 3,986
Location: Frå Nord Dakota til Vermont

19 Mar 2016, 8:05 am

CryptoNerd wrote:
Study assembly language, operating system theory, and the source codes for popular operating systems and device drivers.


*NIX systems wouldn't be hard, but getting source code from Microsoft to study would be almost impossible without actually working for their Windows Dev team.


_________________
When There's No There to get to, I'm so There!


CryptoNerd
Sea Gull
Sea Gull

User avatar

Joined: 13 Jan 2016
Age: 1934
Gender: Male
Posts: 229
Location: The bash shell

19 Mar 2016, 9:10 am

Fogman wrote:
CryptoNerd wrote:
Study assembly language, operating system theory, and the source codes for popular operating systems and device drivers.


*NIX systems wouldn't be hard, but getting source code from Microsoft to study would be almost impossible without actually working for their Windows Dev team.


I meant study the Linux kernel (as well as possibly some alternative OS's like Haiku, ReactOS, etc.). I've never done it, but I've studied other source codes, and I've found that reading source code is one of the best ways to learn about how to implement a piece of software yourself. Good luck.



helloarchy
Sea Gull
Sea Gull

User avatar

Joined: 27 Feb 2015
Posts: 236
Location: Britannia

19 Mar 2016, 11:28 am

I'd recommend you study higher/further maths, then do computer science at university.

In the mean time, the little man computer is a fun way to understand low level assembly and machine code. It's as low as I've ever gone.

http://peterhigginson.co.uk/LMC/
https://en.wikipedia.org/wiki/Little_man_computer



Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 56
Gender: Female
Posts: 2,820
Location: S.F Bay Area

24 Mar 2016, 2:08 am

helloarchy wrote:
I'd recommend you study higher/further maths, then do computer science at university.

In the mean time, the little man computer is a fun way to understand low level assembly and machine code. It's as low as I've ever gone.

http://peterhigginson.co.uk/LMC/
https://en.wikipedia.org/wiki/Little_man_computer

Almost as much fun as building a Redstone computer in Minecraft!

Honestly though, a great way to start is with ATMega MPU's like the ATTiny85 or even Arduino. But instead of a C/C++ variant, go with assembly. You (the OP) will have to deal with binary soon enough and often enough that you'll quickly appreciate the higher language(s).

The problem with reinventing programming in binary is that when this was originally done, it was done *in hardware*. Programs were literally wired in & to change them, patch panels were reconfigured. Assembly and more universal processing units allowed that layer to move into software (ie assembly and then higher languages) where it was far easier to make changes.


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


EphraimB
Raven
Raven

Joined: 4 Nov 2015
Gender: Male
Posts: 100
Location: Far Rockaway, NY

24 Mar 2016, 7:36 am

Are there any tutorials on hard wiring an Operating System?


_________________
My neurodiverse (Aspie) score: 151 of 200
My neurotypical (non-autistic) score: 70 of 200
I'm very likely neurodiverse (Aspie)

My personality type: INTJ-T


Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 56
Gender: Female
Posts: 2,820
Location: S.F Bay Area

24 Mar 2016, 1:12 pm

EphraimB wrote:
Are there any tutorials on hard wiring an Operating System?

There are a few people out there who still build what are called discrete logic computers. Basically (ha, ha...BASIC is not involved) it's a small CPU hand made using logic chips. This may be close to what you are looking for, as the wiring determines how the logic gates work together to produce an output.

Google search link for keywords: homebrew discrete logic computer


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


eric76
Veteran
Veteran

User avatar

Joined: 31 Aug 2012
Gender: Male
Posts: 10,660
Location: In the heart of the dust bowl

04 Apr 2016, 12:49 pm

You don't program binary. Binary is a representation of a number using two digits, usually '0' and '1'.

You program in assembly language. Theoretically you could program in machine language, but that would be a nightmare on any modern processor.

That said, assembly language is easily my favorite computer language. While there aren't really all that many jobs programming in assembly language, if you understand assembly language you should have a considerably better understanding of what is going on with other languages.

Also, keep in mind that assembly language depends on the processor. 80x86 assembly is easily my least favorite assembly. In contrast, the assembly languages on PDP-11 computers and on VAX computers was much more enjoyable.emulator.



Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 56
Gender: Female
Posts: 2,820
Location: S.F Bay Area

04 Apr 2016, 1:36 pm

eric76 wrote:
You don't program binary. Binary is a representation of a number using two digits, usually '0' and '1'.

You program in assembly language. Theoretically you could program in machine language, but that would be a nightmare on any modern processor.

That said, assembly language is easily my favorite computer language. While there aren't really all that many jobs programming in assembly language, if you understand assembly language you should have a considerably better understanding of what is going on with other languages.

Also, keep in mind that assembly language depends on the processor. 80x86 assembly is easily my least favorite assembly. In contrast, the assembly languages on PDP-11 computers and on VAX computers was much more enjoyable.emulator.


It is possible to program in binary by manually loading memory bits, as was done in ye oldest days by hardwiring programs using patch cords. It's a fun exercise on a 4-bit for the first 30 minutes, then your mind starts to develop ideas for automating the process...


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan


eric76
Veteran
Veteran

User avatar

Joined: 31 Aug 2012
Gender: Male
Posts: 10,660
Location: In the heart of the dust bowl

04 Apr 2016, 2:25 pm

Edenthiel wrote:
It is possible to program in binary by manually loading memory bits, as was done in ye oldest days by hardwiring programs using patch cords. It's a fun exercise on a 4-bit for the first 30 minutes, then your mind starts to develop ideas for automating the process...


On the old Data General Supernova computer I used to have to enter a bootstrap program a word at a time by flipping switches to set bits. That wasn't programming.

Sure, you can write programs directly into a binary/octal/hexadecimal representation -- that's called machine language, not binary.



Edenthiel
Veteran
Veteran

User avatar

Joined: 12 Sep 2014
Age: 56
Gender: Female
Posts: 2,820
Location: S.F Bay Area

04 Apr 2016, 5:42 pm

eric76 wrote:
Edenthiel wrote:
It is possible to program in binary by manually loading memory bits, as was done in ye oldest days by hardwiring programs using patch cords. It's a fun exercise on a 4-bit for the first 30 minutes, then your mind starts to develop ideas for automating the process...


On the old Data General Supernova computer I used to have to enter a bootstrap program a word at a time by flipping switches to set bits. That wasn't programming.

Sure, you can write programs directly into a binary/octal/hexadecimal representation -- that's called machine language, not binary.

Respectfully, I disagree. Strictly speaking, any time instructions are created by a person and provided for the processing unit to execute, that is programming. They can be perfectly static such as boot instructions stored in hardwired gates (firmware), bootstrap code set by flipping bits with manual switches or something far more dynamic like stored code.

Btw, if you want to get nostalgic, visit http://simh.trailing-edge.com/

And perhaps both the OT and eric76 will find this interesting: http://maben.homeip.net/static/S100/dat ... %20Ref.pdf

It's the basic programming manual for the DG Nova & for the OP it talks quite a bit about the relationship between binary and how it tells the processor what to do...


_________________
“For small creatures such as we the vastness is bearable only through love.”
―Carl Sagan