-2

So, I want to access raspberry camera buffer with assembly code (Something equivalent to open(/dev/video0) in C), but I struggle to find any example.

Can somebody introduce me to the process of how to do so, or share some resources?

Most of the resources on ARM assembly I found, goes till accessing GPIO (turn on the LED), and stop here...

Also, one step further is send some data via ethernet in assembly. But, that's not the main problem.

  • 3
    If you can do it in C, do the same in assembly. You can also ask a compiler for generated assembly. `open` is a system call, so consult a system call reference. For video stuff you will likely need `ioctl` too and of course `read`. – Jester Aug 29 '23 at 14:43
  • 3
    Are you talking about writing an assembly program to run under Linux (in which case Jester's comment is right), or on the bare metal with no operating system, or that you are writing your own operating system? – Nate Eldredge Aug 29 '23 at 15:04
  • @NateEldredge I planned to run under Linux for now. – Veljko Miletic Aug 29 '23 at 16:36
  • 3
    Okay, then Jester is right. But there's not really any good reason to do that stuff in assembly. You might as well write the code for opening the device, reading the data, etc, in C. If you have some custom processing to do to the data that is speed-critical, write that part, and only that part, in assembly. – Nate Eldredge Aug 29 '23 at 16:38
  • @NateEldredge But resources on other two cases you mentioned will be useful for future :) If you have time, it would be nice to share some stuff. Thank you! – Veljko Miletic Aug 29 '23 at 16:39
  • 2
    Like Jester said, you can write it in C can look at the compiler's asm output (which will have all the magic constants from C headers). [How to remove "noise" from GCC/clang assembly output?](https://stackoverflow.com/q/38552116) – Peter Cordes Aug 29 '23 at 18:23

0 Answers0