Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Other Discussion / Re: framebuffer problem
« Last post by fredericopissarra on February 23, 2025, 06:44:20 PM »
Ah, now i remember : sdl2 is using multithreading so Debugging (at least with my knowledge and radare2) is not working. Seems, that i have to create a  few macros for Output of Registers, while doing calculating stuff to find the Point of Errors.
Here works perfectly:
Code: [Select]
/* test.c */
#include <stdio.h>
#include <pthread.h>

unsigned int count = -1;

static void *thread( void *p )
{
  while ( count-- );

  return NULL;
}

int main( void )
{
  pthread_t tid;

  pthread_create( &tid, NULL, thread, NULL );
  getchar();
  pthread_join( tid, NULL );

  return 0;
}
Code: [Select]
$ cc -g -pthread -o test test.c
$ gdb test
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
...
Reading symbols from test...
(gdb) list
1 #include <stdio.h>
2 #include <pthread.h>
3
4 unsigned int count = -1;
5
6 void *thread( void *p )
7 {
8   while ( count-- );
9
10   return NULL;
(gdb) b 8
Breakpoint 1 at 0x11b5: file test.c, line 8.
(gdb) r
Starting program: /mnt/vol2/work/tmp/test
Downloading separate debug info for system-supplied DSO at 0x7ffff7fc3000
[Thread debugging using libthread_db enabled]                                                                                               
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7bff6c0 (LWP 67336)]
[Switching to Thread 0x7ffff7bff6c0 (LWP 67336)]

Thread 2 "test" hit Breakpoint 1, thread (p=0x0) at test.c:8
8   while ( count-- );
(gdb) p count
$1 = 4294967295
(gdb) quit
A debugging session is active.

Inferior 1 [process 67332] will be killed.

Quit anyway? (y or n) y
$
12
Other Discussion / Re: framebuffer problem
« Last post by andyz74 on February 22, 2025, 07:54:31 PM »
Ah, now i remember : sdl2 is using multithreading so Debugging (at least with my knowledge and radare2) is not working. Seems, that i have to create a  few macros for Output of Registers, while doing calculating stuff to find the Point of Errors.
13
Other Discussion / Re: framebuffer problem
« Last post by andyz74 on February 20, 2025, 07:18:35 PM »
OK...  Thanks you Frederico!  I think, I will do my stuff at sdl2, It is already installed in my system.
14
Other Discussion / Re: framebuffer problem
« Last post by fredericopissarra on February 19, 2025, 11:10:33 PM »
Do you know If one of both framebuffer / sdl is faster as the other?
fbdev don't offer any acceleration support, not even in 2D like Bit Block Transfers (Bitblt)... SDL (2 and 3) does.
15
Other Discussion / Re: framebuffer problem
« Last post by andyz74 on February 19, 2025, 05:53:36 PM »
OK. I will check the Video drivers, If I manage to find Out how. 😂

Do you know If one of both framebuffer / sdl is faster as the other?
16
Other Discussion / Re: framebuffer problem
« Last post by fredericopissarra on February 19, 2025, 12:18:30 PM »
You have to make sure that your video drivers support /dev/fb? and make sure it is enabled in kernel configs, AND if it is accessible to your user...

It is better to use SDL2 (or 3, it is available now!).
17
Other Discussion / framebuffer problem
« Last post by andyz74 on February 18, 2025, 05:51:12 PM »
Hello and good evening!

I've done a little experimenting in doing easy graphic-stuff by writing direct to framebuffer /dev/fb0  (Debian Linux 64bit here)
Mainly in Free Pascal, before testing in Assembly.
While getting lots of garbage as output I also tested code, where I think it HAS to be good and HAS to work, I also got garbage.
( https://github.com/xmdi/SCHIZONE/tree/main/ex/ex020_framebuffer )   
If I test it on my Laptop (also Debian), it works, but not here on my beloved Desktopcomputer.

Now to my questions :
1) Is there anything I have to configure on my framebuffer in my Linux, and
2) Is it worth the time, or should I better invest time in SDL2 for doing graphics stuff?

Greetz, Andy
18
Programming with NASM / Re: Try Catch Exceptions implementation
« Last post by stephane on February 08, 2025, 01:56:23 PM »
Hi everyone!

I've been away for a long time (from programming, and from online social activities), due to personal reasons; I'm back with my desire to learn Assembly, again.
I've just seen your answers, and I just wanted to thank you, even if it comes 3 years later, I appreciate very much!

As for my question in this topic, I don't remember why I wanted to explore it, but your answers help me realize I have more important things to learn first, than trying to implement these kind of features.

Thank you all, for your courtesy, kindness, and interesting answers!
19
Programming with NASM / Re: Problem with calculating root
« Last post by andyz74 on January 30, 2025, 09:37:52 PM »
Main topic for me is  learning Assembler a bit. :-)
Good night now, in Germany we habe 10 pm, time to sleep.
20
Programming with NASM / Re: Problem with calculating root
« Last post by fredericopissarra on January 30, 2025, 08:44:01 PM »
I have another version of my program, in which I use the fp87 for getting the squareroot.  I test both.

The huge amount of divisions to see, what is prime and what not, is in the moment done by normal DIV command. But later, I will try to do this with fp87, and a third version to do it with sse2.

You don't need floating point or square root... Here:
Code: [Select]
_Bool isprime( unsigned int n )
{
  unsigned int d;
  unsigned long long int f;

  if ( n <= 3 )
    return n >= 2;

  d = n % 6;
  if ( d != 1 && d != 5 )
    return 0;

  for ( f = 5; f * f <= n; f += 2 )
    if ( ( n % f ) == 0 )
      return 0;

  return 1;
}
Pages: 1 [2] 3 4 ... 10