How to show a picture on the screen using the assembly in Linux?

I want to make a game in a Linux build. Is there a way to show (or draw) an image on the screen using the Linux kernel system calls?

I searched for it, but all the results that I get relate to the DOS assembly language.

+3
source share
3 answers

It can be done, but it seems like an incredibly tedious and slow way to develop assembly software these days.

Assuming you are using the i386 platform (syscall ABI is used for each platform), look at uClibcs ​​libc / sysdeps / linux / i386 / syscall.S:

.text
.global syscall
.type   syscall,%function
syscall:
    pushl %ebp
    pushl %edi
    pushl %esi
    pushl %ebx

    movl  44(%esp),%ebp /* Load the 6 syscall argument registers */
    movl  40(%esp),%edi
    movl  36(%esp),%esi
    movl  32(%esp),%edx
    movl  28(%esp),%ecx
    movl  24(%esp),%ebx
    movl  20(%esp),%eax /* Load syscall number into %eax.  */
    int $0x80

    popl %ebx
    popl %esi
    popl %edi
    popl %ebp

    cmpl $-4095,%eax
    jae  __syscall_error
    ret         /* Return to caller.  */

.size syscall,.-syscall

This assumes that all syscall arguments as well as the syscall number were loaded onto the stack.

Linux, /asm -generic/unistd.h.

, , , , , . Linux Framebuffer. X .

0

, . - , , ARM ? , x86 , , x86-64.

, , , , - , C-API, Linux C API . - , C, , , :

gcc -S t.c

- , , t.s.

0

If you want to use only kernel functions, you should take the vesa framebuffer: Using a Linux framebuffer device . Good luck =)

0
source

All Articles