I have an assignment, changing colors or exactly turning on a pixel or group of them on display (like laptop display). So far I've searched a lot but it seems no one exactly said how to do it. I tried different codes and but I'm usually getting "Segmentation fault (core dumped)" error. I tried fixing it but I couldn't. There are tutorials for DOS and I tried to convert them to Linux but nothing so far. I would be glad if someone could help. I am running Linux(Ubuntu 18) and using NASM.
Asked
Active
Viewed 194 times
0
-
1MS-DOS and Linux are very different OSes in [MS-DOS you have direct unrestricted access to VRAM](https://stackoverflow.com/a/48664419/2521214) (or anything) on linux I suspect that part of memory is protected so you need to use some kind of API from Linux granting you the access (like open file representing gfx driver) or even use its own pixel routines or some kind of blocking the VRAM for you render and then unblock . However I do not code for Linux so I might be wrong ... What kind of video mode are you using text/gfx VGA/VBE or something different like X window ... There is also OpenGL ... – Spektre Jun 13 '21 at 08:16
-
1This https://stackoverflow.com/a/23619676/2521214 is linux gfx example linked to [one of mine low level gfx answers](https://stackoverflow.com/a/21699076/2521214) – Spektre Jun 13 '21 at 08:20
-
@Spektre: If you're running on Linux's console terminal (not a graphical desktop), a program can "take over" the terminal and ask the kernel to map video memory into its address space, or something like that. See https://en.wikipedia.org/wiki/Linux_framebuffer (fbdev and so on). SVGAlib can still do this, I think, because the software support is still around. – Peter Cordes Jun 13 '21 at 08:55
-
Actually, back in the day (before higher memory bandwidth and general 3D direct rendering infrastructure made it unnecessary), there was X11 DGA https://en.wikipedia.org/wiki/Direct_Graphics_Access to let an X11 client map the framebuffer (video RAM) into its address space to store raw pixel date. – Peter Cordes Jun 13 '21 at 08:55
-
Related: [Is it possible to view media on the console?](https://unix.stackexchange.com/q/79409) – Peter Cordes Jun 13 '21 at 08:57