Hey /g/ this is a question i've never been able to get a straight answer about.
We all know that programs are compiled down to machine code and the kernel communicates with our hardware to make our processes run. And that machine code is essentially zeros and ones that correspond to low and high powers in transistors, which is how memory is stored (correct me if im wrong).
My question is how is the gap between software and hardware actually breached? how do these virtual zeros and ones get converted to physical power levels? How does the lowest level piece of software interact with the hardware?
>>59121977
To build a computer first comes the RAM. The CPU comes second and its job is to manipulate the RAM. Software is what memory you feed the CPU to manipulate said RAM.
>>59121977
It's too hard to give a simple answer to this kind of thing
I've been looking for it for a while now
>>59122004
there is no first nor seconds. Boths are require to compute. Just see how a turing machine works. A computer is that with more predifined functions so "complex" operations are done in 1 clock's tick.
>>59121977
The hardware implements the operations it can do (and a short abstraction on top of that is assembly). Any compiled program that you write has to conform to the interface that the hardware gives you through its opcodes and the kernel would have to conform to any conventions of the hardware gives it (memory protection, addressing, bootstrapping into long mode, flash program memory location in the case of MCUs etc.). Look into verilog/vhdl and computer architecture if you want to know more.
>>59121977
Do you see how physical power levels can influence other physical power levels, resulting in computation?
Like how if you provide physical power levels in this 1bit half-adder, you get the sum out?
Do you see how a sufficiently complex system can run software if provided with the initial power levels?
Humans can induce power levels by flipping switches, pushing keys, toggling light with punch cards and other things to get that process going.
>>59121977
>how do these virtual zeros and ones get converted to physical power levels?
Those ones and zeros are the power levels
there's no '''conversion'''
>>59122083
You are stupid. We know what came first. Pic related.
>>59122069
>I'm an illiterate bastard, I'll proceed posting >>>/v/ as I always do.
>>59122083
yes i understand how the turing machine works to translate instructions to produce output but im more concerned with how this is output/result is then applied to hardware to change the physical state of memory. I guess you could say i want to know how the turing box scans the tape.
>>59122119
i will check it out. thanks
>>59122211
yes this is where i've arrived at so far.
And all automated processes are achieved with a clock?
But i still dont fully understand. Say, for simplicity, i click a button that runs a process. The click triggers the power change and the cpu is loaded with that process code. How does this virtual code influence how power changes within the hardware if it only exists so far as software.
>>59121977
> physical power levels
do you mean as in "watts"? transistors have resistance which dissipates power.
> the kernel communicates with the hardware
Not in the way you are thinking:
A CPU runs based on instructions. These instructions come in a stream, meaning after each one is executed it moves on to the next, or it jumps to another place. The "place" is stored as a number. This number represents the memory address of the current instruction.
No matter what, your computer is reading a stream of instructions that come in one by one. The OS and every program your computer execute are all merged into a line that is executed. It might not feel that way because sometimes it actually can do 2 things at once and CPUs are designed to make it better at multitasking, but it's true
there is no conversion between SW and HW every step is electrical.
google "pipeline"
There never was a gap. It's always been on hardware. "Software" only exists as an abstraction. It is converted into electricity the moment your finger hits the keyboard.
>>59122600
Pretty much this.
If you're genuinely interested OP, I suggest you take a look at Computer Systems by Bryant & OHallaron. Dense but effective.
https://doc.lagout.org/programmation/Computer%20Systems%20-%20A%20Programmers%20Perspective.pdf
OP,
As soon as the CPU powers on, it is designed to request instructions (opcodes/machine code/binary) from a memory address. This is typically mapped to a chip (bios) and it jumps around again to load OS and other things. You are asking how this instruction/data becomes electricty.
When the motherboard is powered on, it gets electricity from your outlet which is flowing... because its plugged in. The computer components can now control that electricity using logic gates made from transistors.
There is a current from the wall to the power supply to the motherboard and its busses, and to the cpu. From the cpu the current flows through to the RAM and the storage etc...
When the CPU requests instructions at an address of RAM, it does so by opening up a series of logic gates to a specific combination of inputs at the RAM controller. These inputs corrospond to a specific address in RAM. Depending on how the digital circuit is activated it will either read or write that address.
If it reads the address, those values (which are charged by the same electricity from the wall hence RAM is volatile) will cause high or low (1 or 0) to flow down the IC pathways and the CPU pins which were requesting the data will receive it where it will be sent down more logic gates to do whatever is decided by the next instruction fetch cycle.
The logic gate groups are called instruction set architectures.
T. CompSci B.S