OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 12:55 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Existing macro system for doing interrupt system calls?
PostPosted: Mon Nov 13, 2017 4:46 pm 
Offline
Member
Member

Joined: Thu Jul 07, 2005 11:00 pm
Posts: 1546
So, I'm developing something not quite an OS, but it resembles it in enough ways to restore my decade old account and ask a question.

Anyway, I have an interrupt system call setup (x86 32bit targeting i686) where all of the arguments etc to the system call is placed on a stack in standard C ABI format. I need a macro or some kind of existing code that allows me to easily implement wrappers around these calls so that user-mode programmers don't need to worry about writing assembly, and so that I don't need a huge amount of assembly for every system call wrapper. I've look at linux/syscalls.h, but it's incredibly difficult to understand and I assume provides a lot more than I need. It would be ideal if there was some way of defining something like:

Code:
__interrupt(0x80) void someCall(int which, uint32_t buffer ...)


Where the compiler pushes things onto the stack like a normal function, but instead of doing a CALL to some address, it does `int 0x80`

Does something like this exist, and somewhat portable between both GCC and Clang?

_________________
My new NEW blag


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 122 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group