Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Help with How Computers work
- rishi272011
-
100 posts
Help with How Computers work
On the Hardware side, I know that Computers use logic gates and logic to execute programs in Machine Language from their ROM.
On the Software side, I know up to Assemblers and Assembly Language which ‘assembles’ into machine specific Binary.
My questions:
My apologies if this sounds too complex or difficult to explain. Please provide places I can learn more about these points.
On the Software side, I know up to Assemblers and Assembly Language which ‘assembles’ into machine specific Binary.
My questions:
- What connects the two?
- Is the assembled code directly stored in the ROM?
- What about the OS? What about the executables (like EXEs)? Aren't they stored in the RAM? Does the architecture matter?
- Where is the firmware stored?
My apologies if this sounds too complex or difficult to explain. Please provide places I can learn more about these points.
Last edited by rishi272011 (Aug. 10, 2024 14:50:14)
- miteswell
-
5 posts
Help with How Computers work
Last edited by miteswell (Aug. 10, 2024 12:23:56)
- speakerset
-
16 posts
Help with How Computers work
Look at assembly language, it is the most bare-bones language their is, below it is just 1’s and 0’s
- gilbert_given_189
-
1000+ posts
Help with How Computers work
See What connects the two?memory-mapped I/O and port-mapped I/O. Each computer does it differently, but the main gist is that there are specific memory addresses that could be read/written by the CPU that correspond to hardware I/O.
Not necessarily. Assembled code can also run in RAM (in fact, this is the most common way to run assemblies nowadays with the existence of OSes and their dynamic loading). Is the assembled code directly stored in the ROM?
It's just back when computers distribute software with cartridges, the computer program is stored in ROM, since that's the only effective long-term storage they have, aside from software on disk/tape which has to be loaded to RAM first before being run.
This differs from one computer to another. Most old microcomputers have their OS (or something like it) built-in in ROM, while others had none of such, requiring the firmware to load it from disk to RAM to be executed by the CPU. (Or sometimes, the firmware loads a program to help booting into the OS, usually called a bootloader or a boot manager.) What about the OS? What about the executables (like EXEs)? Aren't they stored in the RAM?
Executables files are always run in RAM. (the data is not usually directly accessible by the CPU, exceptions to that are called execute in place)
Yes. Each CPU has a different instruction set, executable formats comes in many forms, and there's also different standards on what the registers are being used for in different OSes. All of those make a slightly different and (almost always) incompatible formats. Does the architecture matter?
Most likely in ROM or EEPROM if you want to flash your own firmware (which is a thing people do). Where is the firmware stored?
Last edited by gilbert_given_189 (Aug. 14, 2024 06:56:26)
- 10goto10
-
500+ posts
Help with How Computers work
Very old computers had switches on their front panels where you could hand-load your assembled program and then start that program at a specific address. So, at one time, people connected the two (executing a program and machine language programs).
An upgrade was made to the design of computers that allowed the computer to start executing a program stored in ROM when it was turned on or restarted. It then might start reading data from a disk drive location and then jump to a memory location in it’s RAM where that disk data was stored. I found this very old topic on another site http://www.retrotechnology.com/pdp11/pdp8i_boot.html
Wikipedia says “ Early Intel processors started at physical address 000FFFF0h”. https://en.wikipedia.org/wiki/BIOS#System_startup
Except people don’t say that a CPU ‘ interprets ’ the machine language code stored in its RAM. The term I remember is ‘decode’. The CPU decodes the contents of a memory location starting with the opcode (like add, complement the accumulator, jump to location, disable interrupts, so on).
Good luck with your study. I’m using an iPad which does not have a disk drive and would not know what to do with machine language for a PC so architecture does matter.
An upgrade was made to the design of computers that allowed the computer to start executing a program stored in ROM when it was turned on or restarted. It then might start reading data from a disk drive location and then jump to a memory location in it’s RAM where that disk data was stored. I found this very old topic on another site http://www.retrotechnology.com/pdp11/pdp8i_boot.html
Wikipedia says “ Early Intel processors started at physical address 000FFFF0h”. https://en.wikipedia.org/wiki/BIOS#System_startup
After an executable is loaded into RAM it is data that is interpreted as instructions by either the logic gates in the computer or by another program that is interpreting it. Linux scripts are often called ‘executables’. Here is a much longer answer that I think might help https://stackoverflow.com/questions/59826292/where-is-the-difference-between-binaries-and-executables-in-the-context-of-a
- … What about the executables (like EXEs)? Aren't they stored in the RAM? Does the architecture matter?
Except people don’t say that a CPU ‘ interprets ’ the machine language code stored in its RAM. The term I remember is ‘decode’. The CPU decodes the contents of a memory location starting with the opcode (like add, complement the accumulator, jump to location, disable interrupts, so on).
Good luck with your study. I’m using an iPad which does not have a disk drive and would not know what to do with machine language for a PC so architecture does matter.
- Mr_rudy
-
100+ posts
Help with How Computers work
On the Hardware side, I know that Computers use logic gates and logic to execute programs in Machine Language from their ROM.i would recommend getting a Ben Eater 6502 kit here, you will learn a lot
On the Software side, I know up to Assemblers and Assembly Language which ‘assembles’ into machine specific Binary.
My questions:
- What connects the two?
- Is the assembled code directly stored in the ROM?
- What about the OS? What about the executables (like EXEs)? Aren't they stored in the RAM? Does the architecture matter?
- Where is the firmware stored?
My apologies if this sounds too complex or difficult to explain. Please provide places I can learn more about these points.
- Discussion Forums
- » Advanced Topics
-
» Help with How Computers work