flat assembler
Message board for the users of flat assembler.
Index
> Linux > Xlib Window Example for x86_64 LinuxGoto page 1, 2 Next |
| Author |
|
|
sylware 27 Jul 2026, 11:43
You should move to wayland. Xwayland is there only for legacy and it does create problems: it seems it is adding too much latency to some fast games.
If I were you... |
|||
|
|
revolution 27 Jul 2026, 11:51
sylware wrote: You should move to wayland. |
|||
|
|
Jessé 27 Jul 2026, 22:30
sylware wrote: You should move to wayland. Xwayland is there only for legacy and it does create problems: it seems it is adding too much latency to some fast games. No, he shouldn't. Linux is about freedom of choice, and still exist XLibre which is widely and actively developed, and it is the break-free-of-chains continuation of X, with some improvements, according to them. Being here doesn't mean someone should go mainstream (like the folks who still think there's only systemd and Wayland, btw). Anyways, I'm here to see the nice example from bitshifter, done in the old (and pure) static fasm assembly! Looking forward to test the idea, because I never test interfacing directly with X. |
|||
|
|
bitshifter 28 Jul 2026, 04:26
My linux pc is from 2011, even tho it has modern linux on it, i still dont use Wayland, its better with X11 for me...
|
|||
|
|
sylware 28 Jul 2026, 10:13
wayland is much leaner than x11...
|
|||
|
|
bitshifter 28 Jul 2026, 11:30
On my old machine, xfce with x11 runs circles around wayland with gnome.
wayland is made for modern hardware and the compositor is mandatory. _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
|
|
Jessé 28 Jul 2026, 22:39
I've tested your example above, and, couldn't agree more. Not by copying it, but, by understanding it and make my own version.
Quite impressive to have a graphical thing at only 310KB of memory! Of course it does nothing by itself, but, from that point on, it depends on who is creating what... Against 48 MB from SDL3, and 44 MB from GTK4! Both of which I am more familiar with. A major incentive for me to find out more about direct Xlib programming. I'm waiting for the Wayland defenders to present their code (instead of hollow taking, and, of course, in assembly), so we have a strong and decisive point against X (and its derivatives, like XLibre). |
|||
|
|
Jessé 29 Jul 2026, 11:57
Seeking for the minimal footprint possible, I also found that XCB is quite usable too.
Did a quick test and already spawn a window easily. Check it out if you want: https://xcb.freedesktop.org/tutorial/basicwindowsanddrawing/ XCB has a very easy to parse into assembly documentation, and also has C headers that are very easy to understand, to obtain what is needed to interface it from assembly code. And, the best part: 186 KB of memory footprint and you get a window! |
|||
|
|
sylware 29 Jul 2026, 12:31
Dude, the xserver deprecation is accelerating (like GL).
|
|||
|
|
Furs 29 Jul 2026, 22:28
Nah Wayland is a joke who can't get some basic things right in the name of "security".
|
|||
|
|
MаtQuasar 30 Jul 2026, 01:25
Jessé wrote: Seeking for the minimal footprint possible, ... ProMiNick has done also a minimal Xlib window example, with 'Hello World' example in page 2, but I don't know the difference between him and bitshifter's. https://board.flatassembler.net/topic.php?t=22288 |
|||
|
|
sylware 30 Jul 2026, 11:19
Furs wrote: Nah Wayland is a joke who can't get some basic things right in the name of "security". Nah, you probably can, but as custom extensions, namely wayland moved out much non-core stuff away (which has been in x11 core). Core wayland is brutally lean, and give the least amount of information to clients. If you need something beyond core wayland: wayland is like x11, dynamic, you have to query the availability of the extensions. A warning though: a wayland compositor is not a small project, but still far from the size and complexity of the xserver. I am head banging my head against _CLEAN_ window management: a bazillions of little things to do everywhere. (I have coded my own xserver DDX for an old AMDGPU driver of mine, and I am currently coding/designing a binary specification for my own wayland compositor). And if you keep an eye on what is happening on wayland side, you'll seed that the xserver is running on fumes. |
|||
|
|
Furs 30 Jul 2026, 23:45
sylware wrote: Core wayland is brutally lean, and give the least amount of information to clients. Let me put it another way: A hello world program is also brutally lean, which is exactly the problem with it, it's not useful for anything. |
|||
|
|
Jessé 31 Jul 2026, 00:47
I did some code demonstrating libxcb (which has nothing to do with libX11, except being an interface to the X server/protocol itself), and that beauty is the proof of what I'm saying. You can chek it here.
Despite not being the purest assembly form, like the example from bitshifter, I'm convinced that one here can figure out easily what's going on with XCB way of spawning windows. I also demonstrated there one of the advantage points of XCB over libX: the non-blocking approach they implement. And, it worked flawlessly! 186 KB of memory usage, and a perfectly spawned window. The most efficient I've seen so far! |
|||
|
|
revolution 31 Jul 2026, 04:37
Libraries are good for what they do, but they can't match direct communication with the X11 server. For just a simple window, programs can be tiny, just a few kB.
Sending messages to X11 isn't that hard. Just open a socket and talk. |
|||
|
|
sylware 31 Jul 2026, 09:08
Furs wrote:
??? |
|||
|
|
Furs 01 Aug 2026, 20:12
sylware wrote:
Just because you want to isolate and sandbox every app from another because you're paranoid doesn't mean it's good for the rest of us who'd like our apps to, you know, have more control. |
|||
|
|
Ali.Z 02 Aug 2026, 02:13
somebody used ai to recreate xorg server in nasm assembly.
https://github.com/isene/frame i wonder how much did they spend on this. ... perhaps you can test on this xorg implementation too. _________________ Asm For Wise Humans |
|||
|
|
sylware 02 Aug 2026, 11:35
Furs wrote:
Huh? It just means it is the compositor doing that using wl_surface class/instance titles (maybe more infered informations). It was just moved to the compositor/window manager for good. This is how I do it with my x11 window manager (dwm). The window manager which is part of the compositor in wayland. I pass a 'tag'/'session name' to the application for its instance names of windows to differentiate. That say, you can have wayland extension protocols if you want, but they would have to be dynamically discovered with proper fallbacks. I had a quick look at https://github.com/isene/frame He still does not have DRM atomic modesetting (which xserver devs failed to do...). And I'll keep an eye on its GFX hardware acceleration (still not there). And "correct" evdev input handling is far from being straight forward (I am currently coding exactly that in my wayland compositor), more so to fit it with transactional window management state changes. (After quick skimming of https://github.com/isene/chasm: I'll keep tabs on https://github.com/isene/bare and https://github.com/isene/glyph) And guys, x11 is running on fumes, its deprecation is accelerating (like for GL). Don't forget, the main reason for wayland: it is several orders of magnitude leaner and simpler than x11, and build on top of x11 experience. |
|||
|
| Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.