Apostolic Friends Forum

Apostolic Friends Forum (https://www.apostolicfriendsforum.com/index.php)
-   Tech Talk: with Bit & Byte (https://www.apostolicfriendsforum.com/forumdisplay.php?f=13)
-   -   OS interface? (https://www.apostolicfriendsforum.com/showthread.php?t=50814)

Esaias 03-25-2017 12:54 AM

OS interface?
 
Can anyone explain the mechanics of how an OS interfaces with the hardware circuits in a PC or Mac? What exactly is the mechanism?

The OS translates code into Machine, assembly, binary etc but how does that actually tell the chip set which pins to fire, which to close, etc? Or which circuits on the board(s) to open, close, etc?

Especially considering the OS exists IN THE HARDWARE once the ISO is loaded???

TGBTG 03-25-2017 01:13 AM

Re: OS interface?
 
Quote:

Originally Posted by Esaias (Post 1475007)
Can anyone explain the mechanics of how an OS interfaces with the hardware circuits in a PC or Mac? What exactly is the mechanism?

The OS translates code into Machine, assembly, binary etc but how does that actually tell the chip set which pins to fire, which to close, etc? Or which circuits on the board(s) to open, close, etc?

Especially considering the OS exists IN THE HARDWARE once the ISO is loaded???

At the fundamental level, it's all based on voltage.

Machine communication - binary (0's and 1's)
Circuit communication - voltage
High voltage - 1
Low voltage - 0

Sure you can find detailed explanations on the web

Jito463 03-25-2017 08:04 AM

Re: OS interface?
 
Quote:

Originally Posted by Esaias (Post 1475007)
Can anyone explain the mechanics of how an OS interfaces with the hardware circuits in a PC or Mac? What exactly is the mechanism?

The OS translates code into Machine, assembly, binary etc but how does that actually tell the chip set which pins to fire, which to close, etc? Or which circuits on the board(s) to open, close, etc?

Especially considering the OS exists IN THE HARDWARE once the ISO is loaded???

To put it simply, there is a chip on the motherboard called the BIOS (Basic Input/Output System). On startup, it detects all the hardware and makes sure everything is reporting back as working correctly. Once it's done with the tests, it hands the controls off to whatever OS is installed (Linux, Mac, Win, BSD, etc). From there, the OS handles all the communication with the components through a simple 1 or 0 signal as TGBTG already mentioned. The higher level programming languages such as C++, are for the convenience of the programmers. The OS converts that code into simple binary language to control the hardware.

Esaias 03-28-2017 11:54 PM

Re: OS interface?
 
When coding in assembly, it still has to be compiled down to.. binary?

How does the compiler know how to translate it down to specific circuit-flipping instructions? Where is that translation located? In the source code of the compiler?

Or does the compiler just forward everything to the OS which does the translating? And how does the OS actually communicate with the CPU? Must be something in the source code of the OS that tells the CPU what to do?

Since there are various OS's, and they can all run on the same chipset (assuming PC), it would seem to indicate that there is a universal operating language used by all the operating systems (Linux, Windows, etc) that can run on the same CPUs. I would assume this is machine code, assembly, binary...?

Anyone know what the actual reason Linux and Windows will not run on a Mac, or why Mac O/s will not run on a PC? I mean, binary is binary, right? So the same codes generate different 'calls' depending on the CPU?

Just trying to understand. Information on the net about THIS stuff is incredibly scanty, for some reason.

Esaias 03-28-2017 11:56 PM

Re: OS interface?
 
I mean, who programs the CPU to even be able to recognise the various operating systems' commands?

Anyone here know how CPUs are manufactured?

Jito463 03-29-2017 05:42 PM

Re: OS interface?
 
Quote:

Originally Posted by Esaias (Post 1475498)
When coding in assembly, it still has to be compiled down to.. binary?

How does the compiler know how to translate it down to specific circuit-flipping instructions? Where is that translation located? In the source code of the compiler?

Or does the compiler just forward everything to the OS which does the translating? And how does the OS actually communicate with the CPU? Must be something in the source code of the OS that tells the CPU what to do?

I'm not a programmer, so I couldn't give you any specifics. I can generalize it for you, but not much more than that.

Quote:

Originally Posted by Esaias (Post 1475498)
Since there are various OS's, and they can all run on the same chipset (assuming PC), it would seem to indicate that there is a universal operating language used by all the operating systems (Linux, Windows, etc) that can run on the same CPUs. I would assume this is machine code, assembly, binary...?

Again, I don't have any specific information for you, except to say that it's more that the details of it is available for programmers who wish to delve into the OS side of things, and there's specific ways to initiate the handoff from the BIOS to the OS.

Quote:

Originally Posted by Esaias (Post 1475498)
Anyone know what the actual reason Linux and Windows will not run on a Mac, or why Mac O/s will not run on a PC? I mean, binary is binary, right? So the same codes generate different 'calls' depending on the CPU?

That's by design of Apple. Actually, Linux and Windows both *can* run on Apples (at least, any Intel-based ones), but they have to use an emulation layer called Boot Camp. As for why MacOS won't run on any computer that's not an Apple, it's again by design. However, there are people who have created what's known as "Hackintoshes", which are machines similar in spec to the Apple ones but not officially made by Apple. The OS is then modified to allow installation.

Quote:

Originally Posted by Esaias (Post 1475498)
Just trying to understand. Information on the net about THIS stuff is incredibly scanty, for some reason.

It's out there, but you really have to dig into it and know what you're searching for.

Quote:

Originally Posted by Esaias (Post 1475499)
I mean, who programs the CPU to even be able to recognise the various operating systems' commands?

Anyone here know how CPUs are manufactured?

Technically, no one "programs" the CPU. It simply processes commands that are passed to it, one only needs to know how to pass those commands on.

Jito463 03-29-2017 05:47 PM

Re: OS interface?
 
Actually, you want to delve into the MSFN Forums if you wish more detailed information. It's a software forum dedicated to Microsoft software, but not an official one. I'm a long time member there, though it's been a while since I visited.

Esaias 03-30-2017 03:44 PM

Re: OS interface?
 
Quote:

Originally Posted by Jito463 (Post 1475602)
Actually, you want to delve into the MSFN Forums if you wish more detailed information. It's a software forum dedicated to Microsoft software, but not an official one. I'm a long time member there, though it's been a while since I visited.

Thanks, I'll check it out.

I noticed something last night. My son and I were working on machine coding. He codes, I was providing theory, lol.

Anyway, I suggested an experiment. We had discovered in two days that coding in assembly is still no different than coding in C, for example, since both have to translate to machine code. So I suggested he make a simple code in C, built as a .exe, one for Windows and one ("file") for Debian, same program.

We compared the two and identified what commands were identical, and what were different. We also dumped it to machine reader to see the machine code it generates. Very interesting results.

Conclusion? All compilers translate to machine code.

Problem? Machine code still has to be translated to binary, so what performs that function?

Related: do chips process an 8 bit binary code one bit at a time, sequentially? How does that work?

Just rummaging around in my brain.

Side note: an OS is built with a compiler. What runs the compiler? Is this an infinite regression loop?

Also: guy built a CPU in Minecraft, fascinating how it was done. Board took up the whole world-map, though lol.

FlamingZword 03-30-2017 11:07 PM

Re: OS interface?
 
I have been dealing with computer technology since 1979.

I am a computer systems engineer, who actually helped to build the Army tactical Internet.

Yet I am still befuddled by it all. :dunno

Esaias 04-01-2017 11:57 PM

Re: OS interface?
 
Quote:

Originally Posted by FlamingZword (Post 1475955)
I have been dealing with computer technology since 1979.

I am a computer systems engineer, who actually helped to build the Army tactical Internet.

Yet I am still befuddled by it all. :dunno

http://www.quickmeme.com/img/63/6304...1d2b92103f.jpg


All times are GMT -6. The time now is 02:50 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.