> Hi guys I'm new in this forums and I would like to
> ask a little help with our project.
> 
> Our professor told us to add a hello world system
> call to OpenSolaris. We found a good guide and tried
> to follow but there's one problem. We can't seem to
> find the syscall.h file. And we noticed that our
> usr/src directry is empty.
> 
> Any suggestions that you might give will be highly
> appreciated. Thnx :D

The src is not included in the distro - you have to download
that separately.

I remembered an old blog entry on how to write a loadable
syscall, and managed to find it:
http://blogs.sun.com/eschrock/date/20050614

If you have development packages (I'm not talking about system source now)
installed, syscall.h is in /usr/include/sys directory.

Remember to pick an unused system call number.

Home made system calls are all well and good for a
class exercise or some such, but are almost always a mistake
for anything serious, unless they're worth adding to the mainline
kernel.  For one thing, there just aren't enough system call numbers
to go around, since last I heard they were limited to 0 through 255.
I think 64 through 69 might still be free (if memory serves they were at
one time reserved to keep the numbers aligned with some other
implementation, but that compatibility was never of any practical
use), but pretty much everything else looks to be in use.  OpenAFS
used to (may still) use its own syscall, but it's the only thing I know of
that does, and it probably shouldn't.  The more common approach
is communicating with pseudo-device driver via ioctls.

I did a couple once a long time ago just to see if I could...but that
was with the non-redistributable Solaris 8 FCS source, so as-is
they're probably not redistributable...and I wouldn't want to anyway,
since they're of no practical use and I wouldn't want people asking
me questions about them.  I haven't looked at them since then,
so I'm not sure there's much I can tell you.

Make sure that you have -D_KERNEL and whatever other compiler
flags are needed when building loadable kernel code.  Those might include:
(cc/gcc equivalent)
-KPIC / -fPIC
and on SPARC
-xregs=no%appl / -mno-app-regs
-xarch=v9 / -mv9

and probably others too.  Browse the source at src.opensolaris.org
and look at some of the Makefiles for the kernel code (under usr/src/uts);
you should be able to figure it out...
-- 
This message posted from opensolaris.org
_______________________________________________
opensolaris-help mailing list
opensolaris-help@opensolaris.org

Reply via email to