Suppose I have a bare bones bootloader running some x86 instructions, and I want to be able to draw some graphics on the screen, without using legacy options like system interrupts. How can I write PTX code to achieve this, and how can I actually execute this PTX code? Is there a better option for lightweight graphics wthout an operating system?
Asked
Active
Viewed 186 times
2
-
PTX is not low enough to be HW based, it's like virtual machine code, later compiled by particular nVidia driver into binary instructions suited for particular card model. So you would have to load nVidia driver (which exists only for some OS and you would have to recreate such OS environment for the driver to make it work) or write your own nVidia driver + compiler of PTX. – Ped7g Jun 08 '18 at 22:52
-
You can sort of "easily" (like hundreds/thousands of code lines) control legacy VGA card directly, without BIOS (and the VGA is still emulated by modern GPUs), but that's probably not something to satisfy you with the limited resolutions and colours. ... also what do you mean by "lightweight"... From user programming point of view it's usually simpler to use some complete framework, like some graphic engine built over OGL, then your code will be probably "lightweight". If you want bare-metal nVidia GPU own driver, including 3D functionality, then google for "nouveau" and try to see its history – Ped7g Jun 08 '18 at 22:54
-
(to get idea, how long such project may take) (but maybe you can steal the compiled binary from PTX for your particular card out of the common OS driver, and build in your own OS just some short initialization to run this binary, that's probably doable within months (not years), if you did sign NDA and you have documentation for your particular chip) – Ped7g Jun 08 '18 at 22:57
-
1Kinda makes me wish there were some sort of universal standard for gpus, kinda like x86 is a more or less universal standard for cpus – MazeOfEncryption Jun 09 '18 at 16:13
-
While that would be nice programming wise, it would probably seriously hamper speed of development on the performance side. But I would at least want to have the datasheet and low level description and driver sources, so I could eventually tinker with my own GPU at home, the closed source black box is the main thing annoying me, at this stage the AMD with ex-ATI cards is in much better position, plus Intel of course. – Ped7g Jun 09 '18 at 19:10
-
Do AMD cards have at least better documentation for low level code? – MazeOfEncryption Jun 11 '18 at 14:54
-
Never really checked the available documentation, because even when the linux driver is open source, it's quite a big chunk of code, and I'm happy to use OS instead, can't see any point to actually trying to avoid modern OS, as it brings so much to the table, even if you would have full documentation, to extract all the power of modern x86 PC is too much work for single person, and linux does the job excellently, so I'm staying in the user-app land, not investing my time to learn some HW specs which keep changing every 6-9 months... (and they are way too complicated nowadays :/ ) – Ped7g Jun 11 '18 at 17:08