How does the CPU communicate with the GPU before drivers are loaded?
As I understand it, GPUs have their own instruction sets, whose instructions are generated by the graphics drivers. The GPU instructions are then sent to the GPU. So, how does graphics communication work before the drivers are loaded? Are there some base instructions which GPUs must implement as a minimum to ensure that the computer can perform basic display tasks?
drivers graphics-card gpu
add a comment |
As I understand it, GPUs have their own instruction sets, whose instructions are generated by the graphics drivers. The GPU instructions are then sent to the GPU. So, how does graphics communication work before the drivers are loaded? Are there some base instructions which GPUs must implement as a minimum to ensure that the computer can perform basic display tasks?
drivers graphics-card gpu
add a comment |
As I understand it, GPUs have their own instruction sets, whose instructions are generated by the graphics drivers. The GPU instructions are then sent to the GPU. So, how does graphics communication work before the drivers are loaded? Are there some base instructions which GPUs must implement as a minimum to ensure that the computer can perform basic display tasks?
drivers graphics-card gpu
As I understand it, GPUs have their own instruction sets, whose instructions are generated by the graphics drivers. The GPU instructions are then sent to the GPU. So, how does graphics communication work before the drivers are loaded? Are there some base instructions which GPUs must implement as a minimum to ensure that the computer can perform basic display tasks?
drivers graphics-card gpu
drivers graphics-card gpu
asked 15 hours ago
VortixDevVortixDev
525416
525416
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
"Are there some base instructions...?" Yes, exactly. All GPUs are required to implement one of several simple interfaces - they're too primitive to be called "instruction sets" - which platform firmware ("BIOS" or "UEFI") and drivers that are included with the OS know how to talk to. The usual choice of "simple interface" these days is "VGA" ("Video Graphics Array"), the register-level interface originally defined for the video cards of that standard. (Now 30+ years old!)
For example, if Device Manager on a Windows system IDs the graphics card as the "Microsoft Basic Video Adapter", the OS was unable to find a specific driver for the card and has loaded the VGA-compatible driver instead.
Well, technically, Windows always loads that driver (so it can display e.g. the boot progress screens), then (fairly late in the boot) identifies and loads the "real" driver for your graphics card.
The VGA standard only supports a few low-res graphics modes and text modes, and does not involve what I'd call "running programs" or even "instructions" on the GPU. In essence, system firmware or the "base video driver" just puts it into the desired mode and then writes bits to a bitmap; bits in the bitmap directly correspond to pixels on the screen. Any arithmetic that has to be done to draw lines or curves is done in the CPU. Which is a very low-level and slow way to make stuff show up on the screen. But it's enough for displays from, and simple interactions with, the firmware, for OS installations and early boot-progress screens, etc.
Wikipedia: Video Graphics Array
I'm pretty sure that the "basic graphics" mode in modern windows is more than just VGA. VGA was limited to 640x480 in 16 colors (or a much lower resolution in 256 colors)
– plugwash
12 hours ago
1
The full situation is complicated. The very first "VGA" cards were indeed that limited. For a long time Windows NT required support for 800x600, but yes, just 16 colors. It looked pretty terrible! See the Wikipedia article I linked.
– Jamie Hanrahan
12 hours ago
3
Windows more likely uses VESA BIOS Extentions (VBE) for its basic adapter. VBE is pretty widely supported and allows for 16-24 bit color and up to 1600x1200 pixels.
– 8bittree
11 hours ago
In addition, for the most part, a GPU can function without display device drivers, it's only when you want to use specific hardware functions do you actually need those drivers (i.e. DX 12, Vulcan, CUDA, etc.). The ability to use a GPU, without drivers, is of course done on purpose.
– Ramhound
10 hours ago
3
It wouldn't be VESA BIOS extension, because Windows flatly does not invoke BIOS/UEFI code for anything after the very earliest stages of bootstrap are done.
– Jamie Hanrahan
9 hours ago
|
show 6 more comments
I'll try to clear up the "voodoo" behind all this, by explaining how the old hardware worked. Modern GPUs do not work like this but they emulate the CPU-to-graphics-card interface.
tl;dr
Graphics chips/cards in the 80s and early 90s had to produce output extremely quickly (relative to clock speed) so they did not execute instructions, but rather had fixed circuits. They just sucked data out of RAM as they went, so the CPU simply needed to dump data in RAM in the right place, and the graphics chip would pick it up and throw it on the screen. The CPU could also set various configuration variables on the graphics chip.
Details:
In the 80s, home computers had a really "dumb" graphics chip that had a few fixed behaviours. It will make the most sense if I go through the pipeline backwards.
CRT Monitors
These monitors needed analog inputs. In other words, higher voltage = brighter output. Colour monitors had 3 channels (Red, Green and Blue (or, eg. YUV or YIQ)). These voltages adjusted the strength of an electron beam. Simple stuff.
CRT monitors literally used electromagnets to deflect the electron beam from left to right, then start again a little bit lower and go left to right, and so on from top to bottom. Then back to the top and repeat.
DAC
Graphics chips had a "digital to analog" converter (a very common electrical component). This converted digital values (e.g. 2, 4, or 8 bits) to voltages that could be supplied to the monitor.
Scanning
Graphics chips had to "keep up" with the electron beam, sending the right value to the DAC so that it could output the corresponding voltage at the right time. (Clocks were used for this which I won't go into.) There wasn't time to execute instructions here. Everything was hard-wired and took a small, fixed number of clock cycles.
Video modes
Early chips were not very fast and had limited RAM. Because of this, they tended to allow the selection of various modes and other configuration parameters, for example background colour, font selection, cursor location and size, palette selection, and sprites. Most offered a high-resolution "character-only" mode, and lower-resolution pixel-by-pixel modes.
The three noteworthy VGA modes are:
- 16(ish) colour 80x25 text mode (this is essentially what a BIOS loading screen looks like)
- 16 colour 640x480 high-res mode
- 256-colour 320x200 high-colour mode
Painting pixels
Very roughly, depending on the graphics system, the pipeline looks something like this:
Current pixel location ⇒ Process character/font/sprite/pixel/config data ⇒ Pixel values ⇒ Palette ⇒ DAC
It's that 2nd step that needs to read from a couple of RAM locations. For instance, in Text Mode, a 1-byte character would be looked up. This would form an index into a font table. A bit would be looked up from this table, indicating whether that pixel should be the foreground or background colour. A third byte would be fetched to get that foreground/background colour. All in all, 3 bytes read from RAM.
But this "flow" is pretty much a set of simple fixed circuits that are arranged exactly like, well, the flow just described.
Memory bus interface
Intel CPUs have this annoying legacy thing called an IO bus but it's not important so I'll pretend it's not there.
CPUs access RAM by broadcasting a READ or WRITE request, and an address, on the memory bus. Although most of the valid addresses elicit a response from RAM, certain ranges are handled by devices instead. For instance, READing from a particular address might give you information about keyboard keypresses.
By writing to the right parts of the "graphics range", you can write both the screen content, and also set the graphics card configuration parameters. The "dumb" graphics chip doesn't execute any instructions. It just keeps plodding along, having a few bytes flowing through its circuits and outputting voltages.
With VGA, there is actually RAM on the graphics card, because you can configure the graphics card to pre-processed data before it gets written to graphics RAM, to boost performance in some situations.
VESA
Graphics cards after VGA offered higher resolutions and good colour depth but worked with similar principles. Many modern graphics cards still provide compatibility with this to allow higher res during booting. But VGA is the "foolproof" one that practically every card will emulate.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395914%2fhow-does-the-cpu-communicate-with-the-gpu-before-drivers-are-loaded%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
"Are there some base instructions...?" Yes, exactly. All GPUs are required to implement one of several simple interfaces - they're too primitive to be called "instruction sets" - which platform firmware ("BIOS" or "UEFI") and drivers that are included with the OS know how to talk to. The usual choice of "simple interface" these days is "VGA" ("Video Graphics Array"), the register-level interface originally defined for the video cards of that standard. (Now 30+ years old!)
For example, if Device Manager on a Windows system IDs the graphics card as the "Microsoft Basic Video Adapter", the OS was unable to find a specific driver for the card and has loaded the VGA-compatible driver instead.
Well, technically, Windows always loads that driver (so it can display e.g. the boot progress screens), then (fairly late in the boot) identifies and loads the "real" driver for your graphics card.
The VGA standard only supports a few low-res graphics modes and text modes, and does not involve what I'd call "running programs" or even "instructions" on the GPU. In essence, system firmware or the "base video driver" just puts it into the desired mode and then writes bits to a bitmap; bits in the bitmap directly correspond to pixels on the screen. Any arithmetic that has to be done to draw lines or curves is done in the CPU. Which is a very low-level and slow way to make stuff show up on the screen. But it's enough for displays from, and simple interactions with, the firmware, for OS installations and early boot-progress screens, etc.
Wikipedia: Video Graphics Array
I'm pretty sure that the "basic graphics" mode in modern windows is more than just VGA. VGA was limited to 640x480 in 16 colors (or a much lower resolution in 256 colors)
– plugwash
12 hours ago
1
The full situation is complicated. The very first "VGA" cards were indeed that limited. For a long time Windows NT required support for 800x600, but yes, just 16 colors. It looked pretty terrible! See the Wikipedia article I linked.
– Jamie Hanrahan
12 hours ago
3
Windows more likely uses VESA BIOS Extentions (VBE) for its basic adapter. VBE is pretty widely supported and allows for 16-24 bit color and up to 1600x1200 pixels.
– 8bittree
11 hours ago
In addition, for the most part, a GPU can function without display device drivers, it's only when you want to use specific hardware functions do you actually need those drivers (i.e. DX 12, Vulcan, CUDA, etc.). The ability to use a GPU, without drivers, is of course done on purpose.
– Ramhound
10 hours ago
3
It wouldn't be VESA BIOS extension, because Windows flatly does not invoke BIOS/UEFI code for anything after the very earliest stages of bootstrap are done.
– Jamie Hanrahan
9 hours ago
|
show 6 more comments
"Are there some base instructions...?" Yes, exactly. All GPUs are required to implement one of several simple interfaces - they're too primitive to be called "instruction sets" - which platform firmware ("BIOS" or "UEFI") and drivers that are included with the OS know how to talk to. The usual choice of "simple interface" these days is "VGA" ("Video Graphics Array"), the register-level interface originally defined for the video cards of that standard. (Now 30+ years old!)
For example, if Device Manager on a Windows system IDs the graphics card as the "Microsoft Basic Video Adapter", the OS was unable to find a specific driver for the card and has loaded the VGA-compatible driver instead.
Well, technically, Windows always loads that driver (so it can display e.g. the boot progress screens), then (fairly late in the boot) identifies and loads the "real" driver for your graphics card.
The VGA standard only supports a few low-res graphics modes and text modes, and does not involve what I'd call "running programs" or even "instructions" on the GPU. In essence, system firmware or the "base video driver" just puts it into the desired mode and then writes bits to a bitmap; bits in the bitmap directly correspond to pixels on the screen. Any arithmetic that has to be done to draw lines or curves is done in the CPU. Which is a very low-level and slow way to make stuff show up on the screen. But it's enough for displays from, and simple interactions with, the firmware, for OS installations and early boot-progress screens, etc.
Wikipedia: Video Graphics Array
I'm pretty sure that the "basic graphics" mode in modern windows is more than just VGA. VGA was limited to 640x480 in 16 colors (or a much lower resolution in 256 colors)
– plugwash
12 hours ago
1
The full situation is complicated. The very first "VGA" cards were indeed that limited. For a long time Windows NT required support for 800x600, but yes, just 16 colors. It looked pretty terrible! See the Wikipedia article I linked.
– Jamie Hanrahan
12 hours ago
3
Windows more likely uses VESA BIOS Extentions (VBE) for its basic adapter. VBE is pretty widely supported and allows for 16-24 bit color and up to 1600x1200 pixels.
– 8bittree
11 hours ago
In addition, for the most part, a GPU can function without display device drivers, it's only when you want to use specific hardware functions do you actually need those drivers (i.e. DX 12, Vulcan, CUDA, etc.). The ability to use a GPU, without drivers, is of course done on purpose.
– Ramhound
10 hours ago
3
It wouldn't be VESA BIOS extension, because Windows flatly does not invoke BIOS/UEFI code for anything after the very earliest stages of bootstrap are done.
– Jamie Hanrahan
9 hours ago
|
show 6 more comments
"Are there some base instructions...?" Yes, exactly. All GPUs are required to implement one of several simple interfaces - they're too primitive to be called "instruction sets" - which platform firmware ("BIOS" or "UEFI") and drivers that are included with the OS know how to talk to. The usual choice of "simple interface" these days is "VGA" ("Video Graphics Array"), the register-level interface originally defined for the video cards of that standard. (Now 30+ years old!)
For example, if Device Manager on a Windows system IDs the graphics card as the "Microsoft Basic Video Adapter", the OS was unable to find a specific driver for the card and has loaded the VGA-compatible driver instead.
Well, technically, Windows always loads that driver (so it can display e.g. the boot progress screens), then (fairly late in the boot) identifies and loads the "real" driver for your graphics card.
The VGA standard only supports a few low-res graphics modes and text modes, and does not involve what I'd call "running programs" or even "instructions" on the GPU. In essence, system firmware or the "base video driver" just puts it into the desired mode and then writes bits to a bitmap; bits in the bitmap directly correspond to pixels on the screen. Any arithmetic that has to be done to draw lines or curves is done in the CPU. Which is a very low-level and slow way to make stuff show up on the screen. But it's enough for displays from, and simple interactions with, the firmware, for OS installations and early boot-progress screens, etc.
Wikipedia: Video Graphics Array
"Are there some base instructions...?" Yes, exactly. All GPUs are required to implement one of several simple interfaces - they're too primitive to be called "instruction sets" - which platform firmware ("BIOS" or "UEFI") and drivers that are included with the OS know how to talk to. The usual choice of "simple interface" these days is "VGA" ("Video Graphics Array"), the register-level interface originally defined for the video cards of that standard. (Now 30+ years old!)
For example, if Device Manager on a Windows system IDs the graphics card as the "Microsoft Basic Video Adapter", the OS was unable to find a specific driver for the card and has loaded the VGA-compatible driver instead.
Well, technically, Windows always loads that driver (so it can display e.g. the boot progress screens), then (fairly late in the boot) identifies and loads the "real" driver for your graphics card.
The VGA standard only supports a few low-res graphics modes and text modes, and does not involve what I'd call "running programs" or even "instructions" on the GPU. In essence, system firmware or the "base video driver" just puts it into the desired mode and then writes bits to a bitmap; bits in the bitmap directly correspond to pixels on the screen. Any arithmetic that has to be done to draw lines or curves is done in the CPU. Which is a very low-level and slow way to make stuff show up on the screen. But it's enough for displays from, and simple interactions with, the firmware, for OS installations and early boot-progress screens, etc.
Wikipedia: Video Graphics Array
edited 14 hours ago
answered 15 hours ago
Jamie HanrahanJamie Hanrahan
18.1k34179
18.1k34179
I'm pretty sure that the "basic graphics" mode in modern windows is more than just VGA. VGA was limited to 640x480 in 16 colors (or a much lower resolution in 256 colors)
– plugwash
12 hours ago
1
The full situation is complicated. The very first "VGA" cards were indeed that limited. For a long time Windows NT required support for 800x600, but yes, just 16 colors. It looked pretty terrible! See the Wikipedia article I linked.
– Jamie Hanrahan
12 hours ago
3
Windows more likely uses VESA BIOS Extentions (VBE) for its basic adapter. VBE is pretty widely supported and allows for 16-24 bit color and up to 1600x1200 pixels.
– 8bittree
11 hours ago
In addition, for the most part, a GPU can function without display device drivers, it's only when you want to use specific hardware functions do you actually need those drivers (i.e. DX 12, Vulcan, CUDA, etc.). The ability to use a GPU, without drivers, is of course done on purpose.
– Ramhound
10 hours ago
3
It wouldn't be VESA BIOS extension, because Windows flatly does not invoke BIOS/UEFI code for anything after the very earliest stages of bootstrap are done.
– Jamie Hanrahan
9 hours ago
|
show 6 more comments
I'm pretty sure that the "basic graphics" mode in modern windows is more than just VGA. VGA was limited to 640x480 in 16 colors (or a much lower resolution in 256 colors)
– plugwash
12 hours ago
1
The full situation is complicated. The very first "VGA" cards were indeed that limited. For a long time Windows NT required support for 800x600, but yes, just 16 colors. It looked pretty terrible! See the Wikipedia article I linked.
– Jamie Hanrahan
12 hours ago
3
Windows more likely uses VESA BIOS Extentions (VBE) for its basic adapter. VBE is pretty widely supported and allows for 16-24 bit color and up to 1600x1200 pixels.
– 8bittree
11 hours ago
In addition, for the most part, a GPU can function without display device drivers, it's only when you want to use specific hardware functions do you actually need those drivers (i.e. DX 12, Vulcan, CUDA, etc.). The ability to use a GPU, without drivers, is of course done on purpose.
– Ramhound
10 hours ago
3
It wouldn't be VESA BIOS extension, because Windows flatly does not invoke BIOS/UEFI code for anything after the very earliest stages of bootstrap are done.
– Jamie Hanrahan
9 hours ago
I'm pretty sure that the "basic graphics" mode in modern windows is more than just VGA. VGA was limited to 640x480 in 16 colors (or a much lower resolution in 256 colors)
– plugwash
12 hours ago
I'm pretty sure that the "basic graphics" mode in modern windows is more than just VGA. VGA was limited to 640x480 in 16 colors (or a much lower resolution in 256 colors)
– plugwash
12 hours ago
1
1
The full situation is complicated. The very first "VGA" cards were indeed that limited. For a long time Windows NT required support for 800x600, but yes, just 16 colors. It looked pretty terrible! See the Wikipedia article I linked.
– Jamie Hanrahan
12 hours ago
The full situation is complicated. The very first "VGA" cards were indeed that limited. For a long time Windows NT required support for 800x600, but yes, just 16 colors. It looked pretty terrible! See the Wikipedia article I linked.
– Jamie Hanrahan
12 hours ago
3
3
Windows more likely uses VESA BIOS Extentions (VBE) for its basic adapter. VBE is pretty widely supported and allows for 16-24 bit color and up to 1600x1200 pixels.
– 8bittree
11 hours ago
Windows more likely uses VESA BIOS Extentions (VBE) for its basic adapter. VBE is pretty widely supported and allows for 16-24 bit color and up to 1600x1200 pixels.
– 8bittree
11 hours ago
In addition, for the most part, a GPU can function without display device drivers, it's only when you want to use specific hardware functions do you actually need those drivers (i.e. DX 12, Vulcan, CUDA, etc.). The ability to use a GPU, without drivers, is of course done on purpose.
– Ramhound
10 hours ago
In addition, for the most part, a GPU can function without display device drivers, it's only when you want to use specific hardware functions do you actually need those drivers (i.e. DX 12, Vulcan, CUDA, etc.). The ability to use a GPU, without drivers, is of course done on purpose.
– Ramhound
10 hours ago
3
3
It wouldn't be VESA BIOS extension, because Windows flatly does not invoke BIOS/UEFI code for anything after the very earliest stages of bootstrap are done.
– Jamie Hanrahan
9 hours ago
It wouldn't be VESA BIOS extension, because Windows flatly does not invoke BIOS/UEFI code for anything after the very earliest stages of bootstrap are done.
– Jamie Hanrahan
9 hours ago
|
show 6 more comments
I'll try to clear up the "voodoo" behind all this, by explaining how the old hardware worked. Modern GPUs do not work like this but they emulate the CPU-to-graphics-card interface.
tl;dr
Graphics chips/cards in the 80s and early 90s had to produce output extremely quickly (relative to clock speed) so they did not execute instructions, but rather had fixed circuits. They just sucked data out of RAM as they went, so the CPU simply needed to dump data in RAM in the right place, and the graphics chip would pick it up and throw it on the screen. The CPU could also set various configuration variables on the graphics chip.
Details:
In the 80s, home computers had a really "dumb" graphics chip that had a few fixed behaviours. It will make the most sense if I go through the pipeline backwards.
CRT Monitors
These monitors needed analog inputs. In other words, higher voltage = brighter output. Colour monitors had 3 channels (Red, Green and Blue (or, eg. YUV or YIQ)). These voltages adjusted the strength of an electron beam. Simple stuff.
CRT monitors literally used electromagnets to deflect the electron beam from left to right, then start again a little bit lower and go left to right, and so on from top to bottom. Then back to the top and repeat.
DAC
Graphics chips had a "digital to analog" converter (a very common electrical component). This converted digital values (e.g. 2, 4, or 8 bits) to voltages that could be supplied to the monitor.
Scanning
Graphics chips had to "keep up" with the electron beam, sending the right value to the DAC so that it could output the corresponding voltage at the right time. (Clocks were used for this which I won't go into.) There wasn't time to execute instructions here. Everything was hard-wired and took a small, fixed number of clock cycles.
Video modes
Early chips were not very fast and had limited RAM. Because of this, they tended to allow the selection of various modes and other configuration parameters, for example background colour, font selection, cursor location and size, palette selection, and sprites. Most offered a high-resolution "character-only" mode, and lower-resolution pixel-by-pixel modes.
The three noteworthy VGA modes are:
- 16(ish) colour 80x25 text mode (this is essentially what a BIOS loading screen looks like)
- 16 colour 640x480 high-res mode
- 256-colour 320x200 high-colour mode
Painting pixels
Very roughly, depending on the graphics system, the pipeline looks something like this:
Current pixel location ⇒ Process character/font/sprite/pixel/config data ⇒ Pixel values ⇒ Palette ⇒ DAC
It's that 2nd step that needs to read from a couple of RAM locations. For instance, in Text Mode, a 1-byte character would be looked up. This would form an index into a font table. A bit would be looked up from this table, indicating whether that pixel should be the foreground or background colour. A third byte would be fetched to get that foreground/background colour. All in all, 3 bytes read from RAM.
But this "flow" is pretty much a set of simple fixed circuits that are arranged exactly like, well, the flow just described.
Memory bus interface
Intel CPUs have this annoying legacy thing called an IO bus but it's not important so I'll pretend it's not there.
CPUs access RAM by broadcasting a READ or WRITE request, and an address, on the memory bus. Although most of the valid addresses elicit a response from RAM, certain ranges are handled by devices instead. For instance, READing from a particular address might give you information about keyboard keypresses.
By writing to the right parts of the "graphics range", you can write both the screen content, and also set the graphics card configuration parameters. The "dumb" graphics chip doesn't execute any instructions. It just keeps plodding along, having a few bytes flowing through its circuits and outputting voltages.
With VGA, there is actually RAM on the graphics card, because you can configure the graphics card to pre-processed data before it gets written to graphics RAM, to boost performance in some situations.
VESA
Graphics cards after VGA offered higher resolutions and good colour depth but worked with similar principles. Many modern graphics cards still provide compatibility with this to allow higher res during booting. But VGA is the "foolproof" one that practically every card will emulate.
add a comment |
I'll try to clear up the "voodoo" behind all this, by explaining how the old hardware worked. Modern GPUs do not work like this but they emulate the CPU-to-graphics-card interface.
tl;dr
Graphics chips/cards in the 80s and early 90s had to produce output extremely quickly (relative to clock speed) so they did not execute instructions, but rather had fixed circuits. They just sucked data out of RAM as they went, so the CPU simply needed to dump data in RAM in the right place, and the graphics chip would pick it up and throw it on the screen. The CPU could also set various configuration variables on the graphics chip.
Details:
In the 80s, home computers had a really "dumb" graphics chip that had a few fixed behaviours. It will make the most sense if I go through the pipeline backwards.
CRT Monitors
These monitors needed analog inputs. In other words, higher voltage = brighter output. Colour monitors had 3 channels (Red, Green and Blue (or, eg. YUV or YIQ)). These voltages adjusted the strength of an electron beam. Simple stuff.
CRT monitors literally used electromagnets to deflect the electron beam from left to right, then start again a little bit lower and go left to right, and so on from top to bottom. Then back to the top and repeat.
DAC
Graphics chips had a "digital to analog" converter (a very common electrical component). This converted digital values (e.g. 2, 4, or 8 bits) to voltages that could be supplied to the monitor.
Scanning
Graphics chips had to "keep up" with the electron beam, sending the right value to the DAC so that it could output the corresponding voltage at the right time. (Clocks were used for this which I won't go into.) There wasn't time to execute instructions here. Everything was hard-wired and took a small, fixed number of clock cycles.
Video modes
Early chips were not very fast and had limited RAM. Because of this, they tended to allow the selection of various modes and other configuration parameters, for example background colour, font selection, cursor location and size, palette selection, and sprites. Most offered a high-resolution "character-only" mode, and lower-resolution pixel-by-pixel modes.
The three noteworthy VGA modes are:
- 16(ish) colour 80x25 text mode (this is essentially what a BIOS loading screen looks like)
- 16 colour 640x480 high-res mode
- 256-colour 320x200 high-colour mode
Painting pixels
Very roughly, depending on the graphics system, the pipeline looks something like this:
Current pixel location ⇒ Process character/font/sprite/pixel/config data ⇒ Pixel values ⇒ Palette ⇒ DAC
It's that 2nd step that needs to read from a couple of RAM locations. For instance, in Text Mode, a 1-byte character would be looked up. This would form an index into a font table. A bit would be looked up from this table, indicating whether that pixel should be the foreground or background colour. A third byte would be fetched to get that foreground/background colour. All in all, 3 bytes read from RAM.
But this "flow" is pretty much a set of simple fixed circuits that are arranged exactly like, well, the flow just described.
Memory bus interface
Intel CPUs have this annoying legacy thing called an IO bus but it's not important so I'll pretend it's not there.
CPUs access RAM by broadcasting a READ or WRITE request, and an address, on the memory bus. Although most of the valid addresses elicit a response from RAM, certain ranges are handled by devices instead. For instance, READing from a particular address might give you information about keyboard keypresses.
By writing to the right parts of the "graphics range", you can write both the screen content, and also set the graphics card configuration parameters. The "dumb" graphics chip doesn't execute any instructions. It just keeps plodding along, having a few bytes flowing through its circuits and outputting voltages.
With VGA, there is actually RAM on the graphics card, because you can configure the graphics card to pre-processed data before it gets written to graphics RAM, to boost performance in some situations.
VESA
Graphics cards after VGA offered higher resolutions and good colour depth but worked with similar principles. Many modern graphics cards still provide compatibility with this to allow higher res during booting. But VGA is the "foolproof" one that practically every card will emulate.
add a comment |
I'll try to clear up the "voodoo" behind all this, by explaining how the old hardware worked. Modern GPUs do not work like this but they emulate the CPU-to-graphics-card interface.
tl;dr
Graphics chips/cards in the 80s and early 90s had to produce output extremely quickly (relative to clock speed) so they did not execute instructions, but rather had fixed circuits. They just sucked data out of RAM as they went, so the CPU simply needed to dump data in RAM in the right place, and the graphics chip would pick it up and throw it on the screen. The CPU could also set various configuration variables on the graphics chip.
Details:
In the 80s, home computers had a really "dumb" graphics chip that had a few fixed behaviours. It will make the most sense if I go through the pipeline backwards.
CRT Monitors
These monitors needed analog inputs. In other words, higher voltage = brighter output. Colour monitors had 3 channels (Red, Green and Blue (or, eg. YUV or YIQ)). These voltages adjusted the strength of an electron beam. Simple stuff.
CRT monitors literally used electromagnets to deflect the electron beam from left to right, then start again a little bit lower and go left to right, and so on from top to bottom. Then back to the top and repeat.
DAC
Graphics chips had a "digital to analog" converter (a very common electrical component). This converted digital values (e.g. 2, 4, or 8 bits) to voltages that could be supplied to the monitor.
Scanning
Graphics chips had to "keep up" with the electron beam, sending the right value to the DAC so that it could output the corresponding voltage at the right time. (Clocks were used for this which I won't go into.) There wasn't time to execute instructions here. Everything was hard-wired and took a small, fixed number of clock cycles.
Video modes
Early chips were not very fast and had limited RAM. Because of this, they tended to allow the selection of various modes and other configuration parameters, for example background colour, font selection, cursor location and size, palette selection, and sprites. Most offered a high-resolution "character-only" mode, and lower-resolution pixel-by-pixel modes.
The three noteworthy VGA modes are:
- 16(ish) colour 80x25 text mode (this is essentially what a BIOS loading screen looks like)
- 16 colour 640x480 high-res mode
- 256-colour 320x200 high-colour mode
Painting pixels
Very roughly, depending on the graphics system, the pipeline looks something like this:
Current pixel location ⇒ Process character/font/sprite/pixel/config data ⇒ Pixel values ⇒ Palette ⇒ DAC
It's that 2nd step that needs to read from a couple of RAM locations. For instance, in Text Mode, a 1-byte character would be looked up. This would form an index into a font table. A bit would be looked up from this table, indicating whether that pixel should be the foreground or background colour. A third byte would be fetched to get that foreground/background colour. All in all, 3 bytes read from RAM.
But this "flow" is pretty much a set of simple fixed circuits that are arranged exactly like, well, the flow just described.
Memory bus interface
Intel CPUs have this annoying legacy thing called an IO bus but it's not important so I'll pretend it's not there.
CPUs access RAM by broadcasting a READ or WRITE request, and an address, on the memory bus. Although most of the valid addresses elicit a response from RAM, certain ranges are handled by devices instead. For instance, READing from a particular address might give you information about keyboard keypresses.
By writing to the right parts of the "graphics range", you can write both the screen content, and also set the graphics card configuration parameters. The "dumb" graphics chip doesn't execute any instructions. It just keeps plodding along, having a few bytes flowing through its circuits and outputting voltages.
With VGA, there is actually RAM on the graphics card, because you can configure the graphics card to pre-processed data before it gets written to graphics RAM, to boost performance in some situations.
VESA
Graphics cards after VGA offered higher resolutions and good colour depth but worked with similar principles. Many modern graphics cards still provide compatibility with this to allow higher res during booting. But VGA is the "foolproof" one that practically every card will emulate.
I'll try to clear up the "voodoo" behind all this, by explaining how the old hardware worked. Modern GPUs do not work like this but they emulate the CPU-to-graphics-card interface.
tl;dr
Graphics chips/cards in the 80s and early 90s had to produce output extremely quickly (relative to clock speed) so they did not execute instructions, but rather had fixed circuits. They just sucked data out of RAM as they went, so the CPU simply needed to dump data in RAM in the right place, and the graphics chip would pick it up and throw it on the screen. The CPU could also set various configuration variables on the graphics chip.
Details:
In the 80s, home computers had a really "dumb" graphics chip that had a few fixed behaviours. It will make the most sense if I go through the pipeline backwards.
CRT Monitors
These monitors needed analog inputs. In other words, higher voltage = brighter output. Colour monitors had 3 channels (Red, Green and Blue (or, eg. YUV or YIQ)). These voltages adjusted the strength of an electron beam. Simple stuff.
CRT monitors literally used electromagnets to deflect the electron beam from left to right, then start again a little bit lower and go left to right, and so on from top to bottom. Then back to the top and repeat.
DAC
Graphics chips had a "digital to analog" converter (a very common electrical component). This converted digital values (e.g. 2, 4, or 8 bits) to voltages that could be supplied to the monitor.
Scanning
Graphics chips had to "keep up" with the electron beam, sending the right value to the DAC so that it could output the corresponding voltage at the right time. (Clocks were used for this which I won't go into.) There wasn't time to execute instructions here. Everything was hard-wired and took a small, fixed number of clock cycles.
Video modes
Early chips were not very fast and had limited RAM. Because of this, they tended to allow the selection of various modes and other configuration parameters, for example background colour, font selection, cursor location and size, palette selection, and sprites. Most offered a high-resolution "character-only" mode, and lower-resolution pixel-by-pixel modes.
The three noteworthy VGA modes are:
- 16(ish) colour 80x25 text mode (this is essentially what a BIOS loading screen looks like)
- 16 colour 640x480 high-res mode
- 256-colour 320x200 high-colour mode
Painting pixels
Very roughly, depending on the graphics system, the pipeline looks something like this:
Current pixel location ⇒ Process character/font/sprite/pixel/config data ⇒ Pixel values ⇒ Palette ⇒ DAC
It's that 2nd step that needs to read from a couple of RAM locations. For instance, in Text Mode, a 1-byte character would be looked up. This would form an index into a font table. A bit would be looked up from this table, indicating whether that pixel should be the foreground or background colour. A third byte would be fetched to get that foreground/background colour. All in all, 3 bytes read from RAM.
But this "flow" is pretty much a set of simple fixed circuits that are arranged exactly like, well, the flow just described.
Memory bus interface
Intel CPUs have this annoying legacy thing called an IO bus but it's not important so I'll pretend it's not there.
CPUs access RAM by broadcasting a READ or WRITE request, and an address, on the memory bus. Although most of the valid addresses elicit a response from RAM, certain ranges are handled by devices instead. For instance, READing from a particular address might give you information about keyboard keypresses.
By writing to the right parts of the "graphics range", you can write both the screen content, and also set the graphics card configuration parameters. The "dumb" graphics chip doesn't execute any instructions. It just keeps plodding along, having a few bytes flowing through its circuits and outputting voltages.
With VGA, there is actually RAM on the graphics card, because you can configure the graphics card to pre-processed data before it gets written to graphics RAM, to boost performance in some situations.
VESA
Graphics cards after VGA offered higher resolutions and good colour depth but worked with similar principles. Many modern graphics cards still provide compatibility with this to allow higher res during booting. But VGA is the "foolproof" one that practically every card will emulate.
answered 6 hours ago
ArteliusArtelius
88676
88676
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395914%2fhow-does-the-cpu-communicate-with-the-gpu-before-drivers-are-loaded%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown