Hi, guys. I'm trying to get to understand the Linux internals so I can more comfortably program in assembly. Please correct me if I'm wrong. I've read that you can interface with the kernel both through the int 80h (or syscall, for 64bit) functions, which is called POSIX API and through the GNU C library, which is part of the GNU system (whether the GNU C library is part of the Linux kernel, though, I don't know and I assume not). Apparently, most sources suggest going for the high level API (i.e.: the C library), but the reason for this choice is not clear, especially when programming in assembly. So my first question is... can I comfortably choose any of the two options and stay cool that it will always work?
From here, I got to a second question. I understand that ALSA, the sound system, is actually part of the kernel... a module which comes bundled when you download the kernel and install it. Am I right? But I know there is also the ALSA library (I have a different question about that I will post separately). My question here is, is it at all possible, and in a way that's guaranteed not to change, to access the ALSA module via the POSIX API, without relying on the ALSA library?
Any comment, not just answering these questions, but even criticising and explaining why I'm totally wrong or confused will be highly appreciated!!
Joined: 18 Feb 2015
Location: Dnipro, Ukraine
(1). You can interface with the kernel via system calls, as well as via libc. See fasm/examples/elfexe/, and fasm/examples/libcdemo/ for details.
(2). While I have not done any ALSA programming myself, I would dare say that you would have to invoke the functions supplied by the ALSA API from within your assembly code to interact with the sound system.
Hopefully, someone else who may have done some ALSA programming may respond in a more informed way.
syscall 64-bit reference is using C interface, regardless. So whatever you do in Linux, you'll probably end up with C or work around C anyway. If u insist on using syscall, then you need to hack your way into all those equates, structs, constants and similar C stuff. It is fun and challenging, but you are entering into some unchartered territory which is working against your 'working comfortably in assembly' intention.
For 32-but int 80s, I think JohnFound can help you with the assembly reference.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum