SCO-adding system call

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
aashish

SCO-adding system call

Post by aashish »

Please help me in adding new system call in SCO
Please also explain me how the system calls actually work on SCO.
I think Call gates are used for implementing system call in SCO.
I am trying to understand the assembly language code of a binary file which makes a system call 'open'.

I am attaching asm file of the above program.

Thanks in advance.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:SCO-adding system call

Post by Brendan »

Hi,
aashish wrote: Please help me in adding new system call in SCO
Please also explain me how the system calls actually work on SCO.
I think Call gates are used for implementing system call in SCO.
I am trying to understand the assembly language code of a binary file which makes a system call 'open'.

I am attaching asm file of the above program.

Thanks in advance.
Ok, I've converted the asm file into NASM, as it's what I'm most familiar with..

You've got standard C calling conventions:

Code: Select all

   08048467  50                push eax
   08048468  E88BFFFFFF        call 0x80483f8
   0804846D  83C404            add esp,byte +0x4
Which calls this:

Code: Select all

   080483F8  FF25A0950408      jmp near [0x80495a0]
I assume that [0x80495a0] contains the address of a function in a DLL. When the DLL is loaded the OS would set each address in the jump table to addresses corresponding to the DLL's functions (which depend on where the DLL was loaded). The code in the DLL would do the actually system call (if necessary).

This approach is like trying to see what an elephants face looks like by looking under it's tail. Do you have the source code for SCO?

Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Schol-R-LEA

Re:SCO-adding system call

Post by Schol-R-LEA »

First off, this board is primarily about developing new OSes, most of which are open source; while there are some hard-core Unix experts here, most are primarily familiar with Linux or one or more of the *BSD branches, not OpenServer (the 'official' System V descendant that SCO owns the rights to, or at least claims to - Novell has since challenged this,s tating that they only liscensed it from them, or something). A forum specific to SCO Unix might be more apppropriate; The comp.unix.sco.programmer FAQ might be a good place to start.

Second, it would help to know what the purpose is, esp. since you probably don't need to add an actual new system call. Certainly, it isn't needed for writing a new device driver; details on driver programming for SCO OpenServer can be easily googled for.

Third, if yu are intending some kind of 'turnabout' hack against SCO, forget it. Source code control is very different with commercial software developers than it is with open source developers; there really is no way of 'sneaking' your code into their code base without breaking a dozen laws, and if you get caught it would only give the Linux community a black eye. Don't even think about trying.
Post Reply