S
S
Soft_touch_plastic2020-08-03 23:11:05
Operating Systems
Soft_touch_plastic, 2020-08-03 23:11:05

How is graphics drawn in the operating system?

Hello, I inform you in advance that I know that I am talking about matters and things in which I understand nothing, but I am not asking this out of idle curiosity. How and where is graphics stored in the operating system? I give an example: for example, I want my operating system to have a beautiful animation of loading computer elements instead of just a black screen, a loading logo and a loading mug: motherboards, vidyuhi and other things, how beautifully it flies up and is assembled into a computer together. That is, the results of the POST should be passed to the uefi/operating system itself (I don't know what controls the computer during the black boot screen). So the question is, in what form is such an animation stored: is it just a pre-rendered video, or does the loader in C have the ability to render on the go and animate errors beautifully? they say the motherboard is ok, the vidyuha is ok, the bus is ok, something is wrong with the usb port, draw an animation of how it flies up to the assembled computer, but it turns red and does not fit). I know it's a mess, but try to answer. And if you can tell where and in what form the entire outer axis is stored?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Kharchenko, 2020-08-04
@Soft_touch_plastic

The question is too superficial. If we talk about OS WIndows - then there are all the graphics in the system libraries (dll, etc.) and graphic files that are loaded as needed.
But the download process itself and what is done there in the POST are different things, and they do not intersect.
That is, when you turn it on, the contents of the BIOS chip are read first (yes, we skip the stage of initializing the chipset and the processor itself, it depends on the hardware), and the BIOS, when executed, already checks and initializes the main parts - MIS / SIO, chipset, memory controller, all sorts of ports , video cards, etc. And if something is wrong, it will either stop or inform about the malfunction and go to the next steps. (for example, if a video card is not found, most BIOSes will by default stop with an error post-code, and then nothing will be loaded; and if a keyboard or SMART BAD disk is not found, then the behavior may be with a stop, or maybe continue execution depends on settings). And already when the POST execution stage is completed, the BIOS transfers control to the first sector of the hard disk, or to another device, depending on how it's configured. The OS no longer knows what was done there before in the POST process.
Another thing is systems with EFI (UEFI). Everything is quite closely connected there, and there are several boot phases, but the boot of the operating system itself will still be after all the procedures in EFI have been completed. The only difference is that the EFI is more tightly coupled to the OS, and the OS itself can store its data on the chip, and the EFI can pass data and parameters to the operating system.
If you need it at the stage of initialization of the EFI-based system, then it is quite possible to assemble a firmware image in which to make the necessary animations, and so on. But this will be too labor-intensive, and will noticeably slow down the download. In Linux and all sorts of bsd, initially at boot, not a screen with a picture, but messages from the bootloader, OS kernel, and startup scripts (initialization system). And no animations are needed, everything is clear from the text what is being loaded and executed right now. In more modern systems it is more difficult - there is already systemd, parallel loading and execution, and other goodies. Plus, they usually put just some kind of animation instead of texts, supposedly it prevents the appearance of console messages that slow down the start process (in fact, this was a long time ago and not true). For example, plymouth. This screen saver starts almost from the bootloader itself,
I have one question left - WHY? After all, any computers over the past 20 years have initialized hardware (passed POST) in a fraction of a second, and another 1 to 3 seconds were spent loading all sorts of option ROMs (setevushki, raid / ide controller, or something else), and spinning up the disk to load it. What kind of animation are we talking about? And today's computers, yes with UEFI, yes with SSD, boot with the OS in a couple of seconds! Now no one cares about showing you something during the download process. Okay, you can put mplayer into autoload with any video you like. Of course, the OS has already booted up a long time ago, and even playing the video will take 20-30 seconds. Yes, it’s beautiful, yes, you can show off in front of your friends (look how awesome it’s done, you can see how the computer boots up!). But again, who needs it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question