[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A few technical questions



This is a plethura of technical questions I want to ask about Linux:

1. I remember that on SCO, one cannot call the inb/outp/inw/outw assembler
system calls when writing normal programs. Such stuff may only be done
within the kernel. Does the same prohibition exists on Linux and if so, is
it possible to write a kernel general device driver to do port I/O? I mean
that I can enable I/O to various ports in the kernel and then I'll be able
to wrap the calls by calling a "my_output_byte_to_port(0x200, '\0')" rather
than "asm { outb 200h, 0 }" ?

2. Does anybody know of any way to perform asynchronous Berkely sockets
calls on Linux? I mean that instead of blocking further execution calls
such as accept(), or connect() will call a certain function that I specify
once they are finished. Such stuff for the select() call will also be nice.
This feature exists in WinSock 1.1 and was greatly improved in Winsock 2.0,
and I think it is very convenient.
Of course I can write my own library with a separate thread (or process?) for 
every call that will exit by calling the handler I assigned, but I'm
looking for a neater way.

3. I was still unable to write a simple multi-threaded program with the
clone() system call. Not only does "#include <asm/unistd.h>" causes many
errors, but after I fix them by defining a macro before the include, the
call seems to do the same thing as a regular fork(). I also noticed that
its two parameters are appearently in the opposite order than what is
documented in the manual page, but reversing them won't help either. I've
tried to run it even without X but to no avail.

	Shlomi Fish

P.S: if I see another message in the "root's shell" thread I am about to
shot myself in the leg using C, C++, perl, the Bourne shell, pascal, java
and lisp.



----------------------------------------------------------
Shlomi Fish                                Smart Link Ltd.
Home: shlomif@ibm.net
Work: shlomi@slink.co.il

The Bible dictates that "Thou shalt not seethe [=cook] a kid [= young goat]
in his mother's milk." To avoid possibility of breaking that regulation,
the Jewish tradition ruled that it also applies to female goats, to mature
goats, and to the meat and milk of two completely unrelated goats. It is
also forbidden to eat the meat with fresh milk, and it applies to beef and
mutten as well (including mixing the milk and meat of two different
beasts). Finally, chicken, which are incapable of milk production, may not
be eaten along with any mammal's milk either. 

We are fortunate that most mathematicians were not Jewish. Otherwise, it
would have been forbidden to divide by all numbers between -1 and 1.
----------------------------------------------------------


Follow-Ups: