On Thu, 8 May 2008, Satya Kalyan wrote:

> Hi,
>
> I am porting a system software from Linux(32) to OpenSolaris-10. During the 
> feasibility study it is found that the following 4 system calls, are not 
> supported on Solaris.
>
> iopl: changes  the I/O privilege level of the current process, as specified 
> in level
>
> ioperm: sets the port access permission bits for  the  process

No equivalent. Solaris deliberately does not allow applications to access 
arbitrary device state from userland without the help of a device driver.

That means two things:

a) iopl() isn't ever necessary; I/O access privilege is equivalent to
    device access privilege since "all you need" is the ability to open
    device nodes directly. The latter is PRIV_SYS_DEVICES, see the
    manpages to privileges(5) and ppriv(1) for further information on
    how privileges work in Solaris.

b) ioperm() is something that device drivers must do for you when you
    open the device. Even then, it's up to the bus nexus (driver) to
    decide which ports will be made available when the leaf driver
    does ddi_map_regs_setup(9F) to get the handle for them. So you may
    not be able to write a single driver that allows you to access all
    I/O ports.

In short, porting Linux application software that uses iopl / ioperm and 
direct I/O port access requires creating at least one device driver.

For memory-mapped I/O, that's different, you can just mmap /dev/allkmem 
and will be able to read/write anywhere in the physical address space, 
from userland.

More details on that should be queried via [EMAIL PROTECTED] 
that's the more knowledgeable crowd for such questions.

>
> clone: creates a new process and allows the child process to share parts of 
> its execution context with the calling process

Hmm, why use unportable interfaces if there are perfectly-suitable 
portable ones available ...

Generally, it'd be a good idea to change application code that uses 
clone() directly to use POSIX threads instead. Doing so would create 
portable code.

It's possible to emulate most potential uses of clone() in Solaris, see 
section 3.5.1. of the BrandZ design guide:

        http://opensolaris.org/os/community/brandz/design/

but if you'd want to apply such changes to the sourcecode of an app that 
uses clone(), you could just as well change that to use pthreads, for the 
better.

>
> setup: setup devices and file systems, mount root file system

That's a _systemcall_ under Linux ?

How can you use that, given that applications can only start once that 
task is already done ?

Maybe Linux' booting design allows apps to start before, e.g. loading 
them directly from the initrd without any devs / any filesystems, I'm not 
sure on that one. Solaris booting doesn't work this way, even init(1m) 
only starts up _after_ devices and root filesystem have already been 
initialized.

In short: Linux apps that use this you cannot port to Solaris.

Initializing devices / root filesystems is not triggered by a systemcall 
in Solaris.

>
> I am interested to know whether any equivalent implementation for these 
> system calls for OpenSolaris is available. It would be great if someone can 
> guide me on this.

The question, apart from the iopl/ioperm thing, seems largely academic in 
nature ?

FrankH.
k
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to