Can Somebody put Abstraction of Computer System in a simple way?

168 viewsEngineeringOther

Would appreciate it if examples are provided.

In: Engineering

3 Answers

Anonymous 0 Comments

Back in the old days of DOS, video games often included a setup program and it would ask you what kind of sound card you had, what kind of joystick you had, what kind of graphics card you had, etc. And if your computer’s hardware wasn’t on the lists or wasn’t compatible, you get no sound, no joystick, or the graphics sucked. This is because the game itself had to include all the needed code to run every variant of hardware it supported, and automatic detection was unreliable or even dangerous.

Windows largely solved that problem by taking up the job of dealing with hardware for itself. The makers of the hardware would provide Windows with software that controlled the sound card to the standard that Windows specifies. Then the games would ask Windows to use the sound card, and it would just work. It just tells windows “I want 44.1 kHz audio, 16 bit, stereo” and give it the actual sound clips to play. The game doesn’t know what kind of sound card it is beyond a text description Windows provides, and even that’s just intended so the user can pick which speakers the game audio comes out of.

Windows abstracted the sound card. The game doesn’t need to know how to interact with the actual circuit board and chips of the sound card, it just tells Windows what it wants and it’s taken care of on its behalf. Rather than having to write code for 5 different sound cards and figure out which one is right, you write code once for “Windows sound system” and no matter what audio system you have, it runs.

That’s the concept. It can be applied in tons of different ways. DirectX, and OpenGL abstract the video card for doing 3D graphics (among other things). If you use Linux or other similar systems, most command-line programs interact with files, but can also be set up to connect 2 programs directly together, one’s output is the other’s input. Or you can open a connection across the network and the two programs can be on different computers entirely. From the program’s standpoint, it’s just “send data” and “receive data” even if it doesn’t know where it’s coming from. “Send data” and “receive data” are abstract operations, doing what they sound like, but the details of how they do it don’t matter to the program as long as they work.

You are viewing 1 out of 3 answers, click here to view all answers.